@foxy.io/elements 1.49.0-beta.1 → 1.49.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-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-email-template-form.js +1 -1
- package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-integration-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-item-option-form.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-store-transaction-folder-form.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-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-user-form.js +1 -1
- package/dist/cdn/foxy-user-invitation-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/{shared-d9457718.js → shared-1fa1abbd.js} +2 -2
- package/dist/cdn/shared-462566b0.js +1 -0
- package/dist/cdn/shared-4dc0bd88.js +1 -0
- package/dist/cdn/{shared-ec1daff0.js → shared-4ffaa9b7.js} +7 -7
- package/dist/cdn/{shared-07268049.js → shared-7c5881c1.js} +1 -1
- package/dist/cdn/translations/native-integration-form/en.json +1 -1
- package/dist/cdn/translations/store-form/en.json +5 -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/InternalPasswordControl/InternalPasswordControl.d.ts +3 -0
- package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.js +11 -0
- package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.js.map +1 -1
- package/dist/elements/internal/InternalPasswordControl/index.d.ts +1 -0
- package/dist/elements/internal/InternalPasswordControl/index.js +1 -0
- package/dist/elements/internal/InternalPasswordControl/index.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/CopyToClipboard/CopyToClipboard.d.ts +1 -1
- package/dist/elements/public/CopyToClipboard/CopyToClipboard.js +19 -5
- package/dist/elements/public/CopyToClipboard/CopyToClipboard.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/QueryBuilder/QueryBuilder.d.ts +4 -2
- package/dist/elements/public/QueryBuilder/QueryBuilder.js +27 -7
- package/dist/elements/public/QueryBuilder/QueryBuilder.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/SimpleDateRule.js +3 -1
- package/dist/elements/public/QueryBuilder/components/SimpleDateRule.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/SimpleNumberRule.js +15 -11
- package/dist/elements/public/QueryBuilder/components/SimpleNumberRule.js.map +1 -1
- package/dist/elements/public/QueryBuilder/types.d.ts +1 -0
- package/dist/elements/public/QueryBuilder/types.js.map +1 -1
- package/dist/elements/public/StoreForm/StoreForm.js +1 -0
- package/dist/elements/public/StoreForm/StoreForm.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
- package/dist/cdn/shared-759f65d8.js +0 -1
- /package/dist/cdn/{shared-eadf0d23.js → shared-084e1772.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-8bf38c47.js";import"./shared-1301af85.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-8bf38c47.js";import"./shared-1301af85.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-084e1772.js";import{a as r}from"./shared-328aa161.js";import{B as t}from"./shared-8f9014ff.js";import{h as o}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"./shared-097487d0.js";import"./shared-8dd6e5cc.js";import"./shared-9a454e09.js";import"./shared-5212ef4f.js";import"./shared-26b55da2.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.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-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-d48e260f.js";import"./shared-3c0e3876.js";import"./shared-ba43928a.js";import"./shared-910d49eb.js";import"./shared-4e709717.js";import"./shared-d0aed1c1.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-18e301f2.js";import"./shared-6880e1f6.js";import"./shared-b0453b08.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";const a={AF:[],AX:[],AL:[],DZ:[],AS:[],AD:[],AO:[],AI:[],AQ:[],AG:[],AR:[],AM:[],AW:[],AU:["ACT","NSW","NT","QLD","SA","TAS","VIC","WA"],AT:["BL","KN","NO","OO","SB","ST","TI","VB","WI"],AZ:[],BS:[],BH:[],BD:[],BB:[],BY:[],BE:[],BZ:[],BJ:[],BM:[],BT:[],BO:[],BQ:["BO","SA","SE"],BA:[],BW:[],BV:[],BR:[],IO:[],BN:[],BG:[],BF:[],BI:[],KH:[],CM:[],CA:["AB","BC","MB","NB","NL","NT","NS","NU","ON","PE","QC","SK","YT"],CV:[],CW:[],KY:[],CF:[],TD:[],CL:[],CN:[],CX:[],CC:[],CO:[],KM:[],CG:[],CD:[],CK:[],CR:[],CI:[],HR:[],CU:[],CY:[],CZ:[],DK:[],DJ:[],DM:[],DO:[],EC:[],EG:[],SV:[],SX:[],GQ:[],ER:[],EE:[],ET:[],FK:[],FO:[],FJ:[],FI:[],FR:[],GF:[],PF:[],TF:[],GA:[],GM:[],GE:[],DE:["BW","BY","BE","BB","HB","HH","HE","MV","NI","NW","RP","SL","SN","ST","SH","TH"],GH:[],GI:[],GR:[],GL:[],GD:[],GP:[],GU:[],GT:[],GG:[],GN:[],GW:[],GY:[],HT:[],HM:[],VA:[],HN:[],HK:[],HU:[],IS:[],IN:["AN","AP","AR","AS","BR","CH","CT","DN","DD","DL","GA","GJ","HR","HP","JK","JH","KA","KL","LD","MP","MH","MN","ML","MZ","NL","OR","PY","PB","RJ","SK","TN","TG","TR","UT","UP","WB"],ID:[],IR:[],IQ:[],IE:["CW","CN","CE","CO","DL","D","G","KY","KE","KK","LS","LM","LK","LD","LH","MO","MH","MN","OY","RN","SO","TA","WD","WH","WX","WW"],IM:[],IL:[],IT:[],JM:[],JP:["10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","05","02","07","01","08","03","04","09","06"],JE:[],JO:[],KZ:[],KE:[],KI:[],KP:[],KR:[],KW:[],KG:[],LA:[],LV:[],LB:[],LS:[],LR:[],LY:[],LI:[],LT:[],LU:[],MO:[],MK:[],MG:[],MW:[],MY:[],MV:[],ML:[],MT:[],MH:[],MQ:[],MR:[],MU:[],YT:[],MX:[],FM:[],MD:[],MC:[],MN:[],ME:[],MS:[],MA:[],MZ:[],MM:[],NA:[],NR:[],NP:[],NL:[],NC:[],NZ:[],NI:[],NE:[],NG:[],NU:[],NF:[],MP:[],NO:["10","11","12","14","15","16","17","18","19","20","30","34","38","42","46","50","54","01","02","03","04","05","06","07","08","09"],OM:[],PK:[],PW:[],PS:[],PA:[],PG:[],PY:[],PE:[],PH:[],PN:[],PL:[],PT:[],PR:[],QA:[],RE:[],RO:[],RU:[],RW:[],BL:[],SH:[],KN:[],LC:[],MF:[],PM:[],VC:[],WS:[],SM:[],SS:[],ST:[],SA:[],SN:[],RS:[],SC:[],SL:[],SG:[],SK:[],SI:[],SB:[],SO:[],ZA:[],GS:[],ES:["A Coruna","Alava","Albacete","Alicante","Almeria","Asturias","Avila","Badajoz","Baleares","Barcelona","Burgos","Caceres","Cadiz","CN","Cantabria","Castellon","Ceuta","Ciudad Real","Cordoba","Cuenca","Gipuzkoa","Girona","Granada","Guadalajara","Guipuzcoa","Huelva","Huesca","Jaen","La Rioja","Las Palmas","Leon","Lleida","Lugo","Madrid","Malaga","Melilla","Murcia","Navarra","Ourense","Palencia","Pontevedra","Salamanca","Santa Cruz de Tenerife","Segovia","Sevilla","Soria","Tarragona","Teruel","Toledo","Valencia","Valladolid","Vizcaya","Zamora","Zaragoza"],LK:[],SD:[],SR:[],SJ:[],SZ:[],SE:[],CH:["AG","AR","AI","BL","BS","BE","FR","GE","GL","GR","JU","LU","NE","NW","OW","SH","SZ","SO","SG","TI","TG","UR","VS","VD","ZH","ZG"],SY:[],TW:[],TJ:[],TZ:[],TH:[],TL:[],TG:[],TK:[],TO:[],TT:[],TN:[],TR:[],TM:[],TC:[],TV:[],UG:[],UA:[],AE:[],GB:[],US:["AL","AK","AS","AZ","AR","AF","AA","AC","AE","AM","AP","CA","CO","CT","DE","DC","FM","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MH","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","MP","OH","OK","OR","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY"],UM:[],UY:[],UZ:[],VU:[],VE:[],VN:[],VG:[],VI:[],WF:[],EH:[],YE:[],ZM:[],ZW:[]};let s,n,i,d=e=>e;const l=r(e,"address-form");class c extends l{constructor(){super(...arguments),this.__ignoreAddressRestrictionsGetValue=()=>this.form.ignore_address_restrictions?["true"]:[],this.__ignoreAddressRestrictionsSetValue=e=>{this.edit({ignore_address_restrictions:e.includes("true")})},this.__ignoreAddressRestrictionsOptions=[{label:"option_true",value:"true"}],this.__countrySetValue=e=>{this.edit({country:e,region:""})}}static get v8n(){return[({address_name:e})=>e&&e.length>0||"address-name:v8n_required",({address_name:e})=>!e||e.length<=100||"address-name:v8n_too_long",({first_name:e})=>!e||e.length<=50||"first-name:v8n_too_long",({last_name:e})=>!e||e.length<=50||"last-name:v8n_too_long",({region:e})=>!e||e.length<=50||"region:v8n_too_long",({city:e})=>!e||e.length<=50||"city:v8n_too_long",({phone:e})=>!e||e.length<=50||"phone:v8n_too_long",({company:e})=>!e||e.length<=50||"company:v8n_too_long",({address2:e})=>!e||e.length<=100||"address-two:v8n_too_long",({address1:e})=>e&&e.length>0||"address-one:v8n_required",({address1:e})=>!e||e.length<=100||"address-one:v8n_too_long",({postal_code:e})=>!e||e.length<=50||"postal-code:v8n_too_long"]}get hiddenSelector(){var e,r;const o=[super.hiddenSelector.toString()];return(!!(null===(e=this.data)||void 0===e?void 0:e.is_default_shipping)||!!(null===(r=this.data)||void 0===r?void 0:r.is_default_billing))&&o.unshift("delete","address-name","header:copy-id"),new t(o.join(" ").trim())}get headerTitleKey(){var e,r;return(null===(e=this.data)||void 0===e?void 0:e.is_default_shipping)?"title_default_shipping":(null===(r=this.data)||void 0===r?void 0:r.is_default_billing)?"title_default_billing":super.headerTitleKey}renderBody(){const e=this.__regionOptions;return o(s||(s=d` ${0} <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control class="col-span-2" infer="address-name"> </foxy-internal-text-control> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> <foxy-internal-text-control infer="company"></foxy-internal-text-control> <foxy-internal-text-control infer="phone"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="address-one" property="address1"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="address-two" property="address2"> </foxy-internal-text-control> <foxy-internal-select-control infer="country" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control infer="city"></foxy-internal-text-control> <foxy-internal-text-control infer="postal-code"></foxy-internal-text-control> <foxy-internal-checkbox-group-control infer="ignore-address-restrictions" class="col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> </div> ${0} `),this.renderHeader(),this.__countryOptions,this.__countrySetValue,e.length>0?o(n||(n=d` <foxy-internal-select-control infer="region" .options="${0}"> </foxy-internal-select-control> `),e):o(i||(i=d`<foxy-internal-text-control infer="region"></foxy-internal-text-control>`)),this.__ignoreAddressRestrictionsGetValue,this.__ignoreAddressRestrictionsSetValue,this.__ignoreAddressRestrictionsOptions,super.renderBody())}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let r;try{r=(await e.json())._embedded["fx:errors"][0].message}catch(r){throw e}throw r.includes("Country is invalid or disallowed by store configuration")?["error:country_banned"]:r.includes("this address name already exists for this customer")?["error:address_name_exists"]:e}}get __countryOptions(){return Object.keys(a).map((e=>({label:this.t(`country_${e.toLowerCase()}`),value:e})))}get __regionOptions(){var e,r;const t=null!==(e=this.form.country)&&void 0!==e?e:"";return(null!==(r=a[t])&&void 0!==r?r:[]).map((e=>({label:this.t(`country_${t.toLowerCase()}_region_${e.toLowerCase()}`),value:e})))}}customElements.define("foxy-address-form",c);export{c as AddressForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-transaction.js";import"./shared-d9457718.js";import"./shared-f7965314.js";import"./shared-d01853e2.js";import"./shared-5078246e.js";import{I as e}from"./shared-eadf0d23.js";import"./foxy-admin-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-be071e3d.js";import"./shared-4cc1fb20.js";import{a as t}from"./shared-9a454e09.js";import"./foxy-form-dialog.js";import"./shared-26b55da2.js";import"./shared-591ee1bf.js";import"./shared-1301af85.js";import{B as r,_ as a}from"./shared-8f9014ff.js";import{s as o}from"./shared-2061be9a.js";import{p as s}from"./shared-f0fa0a88.js";import{h as i,s as n}from"./shared-ba5c42c7.js";import{i as l}from"./shared-53e42a77.js";import"./foxy-copy-to-clipboard.js";import{R as d,a as c}from"./shared-328aa161.js";import{g as m}from"./shared-96e4f603.js";import"./foxy-billing-address-card.js";import"./shared-04277241.js";import"./foxy-spinner.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-021fbb51.js";import"./shared-b0453b08.js";import"./shared-930e68b7.js";import"./shared-de4ec7bb.js";import"./shared-fd8b44e3.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./foxy-custom-field-form.js";import"./shared-8bf38c47.js";import"./shared-0ea24ca2.js";import"./shared-b0db52f7.js";import"./shared-9a291941.js";import"./shared-097487d0.js";import"./shared-0a7a4660.js";import"./shared-5fd5805c.js";import"./foxy-custom-field-card.js";import"./shared-5212ef4f.js";import"./shared-490dadf8.js";import"./shared-41c9c53f.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-c84333db.js";import"./foxy-payment-card.js";import"./shared-cf613436.js";import"./foxy-webhook-card.js";import"./shared-bab2ea2c.js";import"./foxy-webhook-form.js";import"./shared-759f65d8.js";import"./shared-31e75a4a.js";import"./shared-d48e260f.js";import"./shared-910d49eb.js";import"./shared-ba43928a.js";import"./shared-bc8a1435.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-a9a8eb7c.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-address-form.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-3c0e3876.js";import"./shared-67aeac0f.js";import"./foxy-item-card.js";import"./shared-56a16e03.js";import"./foxy-item-form.js";import"./shared-6e0eccb8.js";import"./shared-53e476fd.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";import"./shared-f9bb0924.js";import"./shared-aa258319.js";import"./shared-d74aac59.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-7a5d645f.js";let f,h,u,p,x,y,v,_,g,b,j,w=e=>e;customElements.define("foxy-internal-admin-subscription-form-status-action-form",class extends e{constructor(){super(...arguments),this.__endDatePresetOptions=JSON.stringify([{value:"tomorrow",label:"option_tomorrow"},{value:"next_transaction_date",label:"option_next_transaction_date"},{value:"custom_date",label:"option_custom_date"}]),this.__endDatePresetGetValue=()=>{var e;return null!==(e=this.form.end_date_preset)&&void 0!==e?e:"next_transaction_date"},this.__endDatePresetSetValue=e=>{if(this.edit({end_date_preset:e}),"tomorrow"===e){const e=new Date;e.setDate(e.getDate()+1),e.setHours(0,0,0,0),this.edit({end_date:o(e)})}else"next_transaction_date"===e?this.edit({end_date:this.form.next_transaction_date}):this.edit({end_date:""})},this.__endDateGetValue=()=>this.form.end_date_preset?this.form.end_date:this.form.next_transaction_date,this.__nextTransactionDateGetValue=()=>{const e=new Date;e.setDate(e.getDate()+1),e.setHours(0,0,0,0);const t=o(e);if(!this.form.next_transaction_date)return t;const r=s(this.form.next_transaction_date.substring(0,10));return!r||r<e?t:this.form.next_transaction_date}}static get v8n(){return[({next_transaction_date:e,end_date:t},r)=>{var a;if(null===(a=r.data)||void 0===a?void 0:a.is_active){if(!t||"0000-00-00"===t)return"end-date:v8n_required"}else if(!e)return"next-transaction-date:v8n_required";return!0}]}get readonlySelector(){const e=[super.readonlySelector.toString()];return"custom_date"!==this.form.end_date_preset&&e.push("end-date"),new r(e.join(" ").trim())}renderBody(){var e;const t=new Date;t.setDate(t.getDate()+1),t.setHours(0,0,0,0);const r=!!(null===(e=this.data)||void 0===e?void 0:e.is_active),a=r?"cancel":"reactivate",s=r?"bg-error-10":"bg-success-10",l=n(r?f||(f=w`<svg class="text-error" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z" /></svg>`):h||(h=w`<svg class="text-success" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>`));return i(u||(u=w` <foxy-internal-summary-control infer="" label="" helper-text=""> <div class="text-center flex flex-col items-center bg-transparent"> <div class="rounded-full ${0} p-m mb-s mx-auto">${0}</div> <p class="font-medium text-xl leading-m"> <foxy-i18n infer="" key="${0}_title"></foxy-i18n> </p> <p class="text-secondary leading-s"> <foxy-i18n infer="" key="${0}_subtitle"></foxy-i18n> </p> </div> </foxy-internal-summary-control> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> <vaadin-button theme="primary ${0} large" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}_submit"></foxy-i18n> </vaadin-button> `),s,l,a,a,r?i(p||(p=w` <foxy-internal-select-control options="${0}" layout="summary-item" infer="end-date-preset" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-date-control layout="summary-item" infer="end-date" min="${0}" hide-clear-button .getValue="${0}"> </foxy-internal-date-control> `),this.__endDatePresetOptions,this.__endDatePresetGetValue,this.__endDatePresetSetValue,o(t),this.__endDateGetValue):i(x||(x=w` <foxy-internal-date-control layout="summary-item" infer="next-transaction-date" min="${0}" hide-clear-button .getValue="${0}"> </foxy-internal-date-control> `),o(t),this.__nextTransactionDateGetValue),r?[this.__renderFaq("cancel_why_not_today",n(y||(y=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M5.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75V12ZM6 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H6ZM7.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H8a.75.75 0 0 1-.75-.75V12ZM8 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H8ZM9.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V10ZM10 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H10ZM9.25 14a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V14ZM12 9.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V10a.75.75 0 0 0-.75-.75H12ZM11.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H12a.75.75 0 0 1-.75-.75V12ZM12 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H12ZM13.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H14a.75.75 0 0 1-.75-.75V10ZM14 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H14Z" /><path fill-rule="evenodd" d="M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2Zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75Z" clip-rule="evenodd" /></svg>`))),this.__renderFaq("cancel_whats_next",n(v||(v=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M3.288 4.818A1.5 1.5 0 0 0 1 6.095v7.81a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905c.155-.096.285-.213.389-.344v2.973a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905a1.5 1.5 0 0 0 0-2.552l-6.323-3.906A1.5 1.5 0 0 0 10 6.095v2.972a1.506 1.506 0 0 0-.389-.343L3.288 4.818Z" /></svg>`))),this.__renderFaq("cancel_how_to_reactivate",n(_||(_=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M6.111 11.89A5.5 5.5 0 1 1 15.501 8 .75.75 0 0 0 17 8a7 7 0 1 0-11.95 4.95.75.75 0 0 0 1.06-1.06Z" /><path d="M8.232 6.232a2.5 2.5 0 0 0 0 3.536.75.75 0 1 1-1.06 1.06A4 4 0 1 1 14 8a.75.75 0 0 1-1.5 0 2.5 2.5 0 0 0-4.268-1.768Z" /><path d="M10.766 7.51a.75.75 0 0 0-1.37.365l-.492 6.861a.75.75 0 0 0 1.204.65l1.043-.799.985 3.678a.75.75 0 0 0 1.45-.388l-.978-3.646 1.292.204a.75.75 0 0 0 .74-1.16l-3.874-5.764Z" /></svg>`)))]:[this.__renderFaq("reactivate_why_not_today",n(g||(g=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-success flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M5.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75V12ZM6 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H6ZM7.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H8a.75.75 0 0 1-.75-.75V12ZM8 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H8ZM9.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V10ZM10 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H10ZM9.25 14a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V14ZM12 9.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V10a.75.75 0 0 0-.75-.75H12ZM11.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H12a.75.75 0 0 1-.75-.75V12ZM12 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H12ZM13.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H14a.75.75 0 0 1-.75-.75V10ZM14 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H14Z" /><path fill-rule="evenodd" d="M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2Zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75Z" clip-rule="evenodd" /></svg>`))),this.__renderFaq("reactivate_whats_next",n(b||(b=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-success flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M3.288 4.818A1.5 1.5 0 0 0 1 6.095v7.81a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905c.155-.096.285-.213.389-.344v2.973a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905a1.5 1.5 0 0 0 0-2.552l-6.323-3.906A1.5 1.5 0 0 0 10 6.095v2.972a1.506 1.506 0 0 0-.389-.343L3.288 4.818Z" /></svg>`)))],r?"error":"success",this.disabled,(()=>this.submit()),a)}submit(){var e;(null===(e=this.data)||void 0===e?void 0:e.is_active)?"next_transaction_date"===this.__endDatePresetGetValue()&&this.edit({end_date:this.form.next_transaction_date}):this.edit({next_transaction_date:this.__nextTransactionDateGetValue(),is_active:!0,end_date:"0000-00-00"}),super.submit()}async _sendPatch(e){return delete e.end_date_preset,super._sendPatch(e)}__renderFaq(e,t){return i(j||(j=w` <div class="bg-transparent flex leading-xs" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p class="grid"> <foxy-i18n class="leading-m text-s font-medium" infer="" key="${0}_title"> </foxy-i18n> <foxy-i18n class="leading-xs text-secondary text-xs" infer="" key="${0}_text"> </foxy-i18n> </p> </div> `),t,e,e)}});let k,$,V,M=e=>e;customElements.define("foxy-internal-admin-subscription-form-status-action",class extends t{get hiddenSelector(){const e=[super.hiddenSelector.toString()];return e.unshift("form:save-button"),new r(e.join(" ").trim())}renderControl(){var e,t;const r=this.nucleon,a=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.end_date,o=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t.is_active,s=!o||!a||"0000-00-00"===a;return i(k||(k=M` <vaadin-button theme="tertiary-inline${0}" @click="${0}"> <foxy-i18n infer="" key="caption_${0}"></foxy-i18n> </vaadin-button> ${0} `),s?o?" error":" success":"",(e=>{var t;const r=e.currentTarget;null===(t=this.renderRoot.querySelector("#dialog"))||void 0===t||t.show(r)}),o?a&&"0000-00-00"!==a?"uncancel":"cancel":"reactivate",s?i($||($=M` <foxy-form-dialog infer="form" form="foxy-internal-admin-subscription-form-status-action-form" href="${0}" no-confirm-when-dirty close-on-patch alert id="dialog"> </foxy-form-dialog> `),l(null==r?void 0:r.href)):i(V||(V=M` <foxy-internal-confirm-dialog message="uncancel_message" confirm="uncancel_confirm" cancel="uncancel_cancel" header="uncancel_header" infer="" id="dialog" @hide="${0}"> </foxy-internal-confirm-dialog> `),(e=>{var t,r;e.detail.cancelled||(null===(t=this.nucleon)||void 0===t||t.edit({end_date:"0000-00-00"}),null===(r=this.nucleon)||void 0===r||r.submit())})))}});let Z,H=e=>e;class S extends(d(t)){constructor(){super(...arguments),this.search=null}static get properties(){return a(a({},super.properties),{},{search:{}})}renderControl(){var e,t;const r=this.nucleon;let a;try{const o=new URL(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:sub_token_url"].href)&&void 0!==t?t:"");if(this.search){const e=new URLSearchParams(o.search);o.search=this.search,e.forEach(((e,t)=>o.searchParams.set(t,e)))}a=o.toString()}catch(e){a=void 0}return i(Z||(Z=H` <div class="leading-xs flex items-center gap-xs"> <foxy-i18n class="truncate min-w-0" infer="" key="label"></foxy-i18n> <span class="text-tertiary"> • </span> <foxy-copy-to-clipboard layout="complete" theme="tertiary-inline" infer="copy-to-clipboard" text="${0}"> </foxy-copy-to-clipboard> </div> <foxy-i18n class="leading-xs block text-xs text-secondary" infer="" key="helper_text"> </foxy-i18n> `),a)}}customElements.define("foxy-internal-admin-subscription-form-link-control",S);let A,D,P=e=>e;customElements.define("foxy-internal-admin-subscription-form-error",class extends t{renderControl(){var e,t;return i(A||(A=P` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),n(D||(D=P`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.error_message)}});let B,C,q,G,E,F,z,L=e=>e;const O=c(e,"admin-subscription-form");class R extends O{constructor(){super(...arguments),this.uoeSettingsPage=null}static get properties(){return a(a({},super.properties),{},{uoeSettingsPage:{attribute:"uoe-settings-page"}})}get hiddenSelector(){const e=["delete",super.hiddenSelector.toString()],t=this.data;return(null==t?void 0:t.error_message)&&t.past_due_amount||e.unshift("error-message"),new r(e.join(" ").trim())}get headerSubtitleKey(){const e=m(this.data);return e?`subtitle_${e}`:super.headerSubtitleKey}renderHeaderActions(){return i(B||(B=L` <foxy-internal-admin-subscription-form-status-action infer="status-action"> </foxy-internal-admin-subscription-form-status-action> `))}renderBody(){var e,t,r,a,o,s,d,c,m;let f;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");r.searchParams.set("zoom","items"),f=r.toString()}catch(e){f=void 0}const h=null===(a=null===(r=this.data)||void 0===r?void 0:r._links["fx:charge_past_due"])||void 0===a?void 0:a.href,u=null===(o=this.data)||void 0===o?void 0:o.past_due_amount,p=null===(s=this.data)||void 0===s?void 0:s.error_message,x=null===(d=this.data)||void 0===d?void 0:d._embedded["fx:transaction_template"].currency_code;return i(C||(C=L` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="self-service-links"> <foxy-internal-admin-subscription-form-link-control infer="load-in-cart"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="cart=checkout" infer="load-on-checkout"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=next_transaction_date" infer="cancel-at-end-of-billing-period"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=true" infer="cancel-next-day"> </foxy-internal-admin-subscription-form-link-control> <div class="flex items-start leading-xs text-xs text-secondary" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="uoe_hint_text"></foxy-i18n> ${0} </p> </div> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-admin-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),l(x),h&&x&&u?i(q||(q=L` <foxy-internal-post-action-control message-options="${0}" theme="tertiary-inline" infer="charge-past-due" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({amount:`${u} ${x}`}),h,(()=>this.refresh())):p&&!u?i(G||(G=L` <details class="leading-xs text-xs text-secondary rounded-b focus-within-ring-2 focus-within-ring-inset focus-within-ring-primary-50" style="--gap:calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"> <summary class="cursor-pointer transition-colors hover-text-body focus-outline-none"> <span class="flex items-start" style="gap:var(--gap)"> ${0} <foxy-i18n infer="" key="error_with_zero_past_due_hint"></foxy-i18n> </span> </summary> <p style="padding-left:calc(1.25em + var(--gap))" class="pt-xs"> <span class="whitespace-pre-line">${0}</span> </p> </details> `),n(E||(E=L`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`)),p):"",n(F||(F=L`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`)),this.uoeSettingsPage?i(z||(z=L` <a target="_blank" class="inline-block rounded font-medium text-body cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="uoe_link_text"></foxy-i18n> </a> `),this.uoeSettingsPage):"",this.renderTemplateOrSlot(),l(null===(m=null===(c=this.data)||void 0===c?void 0:c._links)||void 0===m?void 0:m["fx:attributes"].href),l(f),super.renderBody())}}customElements.define("foxy-admin-subscription-form",R);export{R as AdminSubscriptionForm};
|
|
1
|
+
import"./foxy-transaction.js";import"./shared-1fa1abbd.js";import"./shared-f7965314.js";import"./shared-d01853e2.js";import"./shared-5078246e.js";import{I as e}from"./shared-084e1772.js";import"./foxy-admin-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-be071e3d.js";import"./shared-4cc1fb20.js";import{a as t}from"./shared-9a454e09.js";import"./foxy-form-dialog.js";import"./shared-26b55da2.js";import"./shared-591ee1bf.js";import"./shared-1301af85.js";import{B as r,_ as a}from"./shared-8f9014ff.js";import{s as o}from"./shared-2061be9a.js";import{p as s}from"./shared-f0fa0a88.js";import{h as i,s as n}from"./shared-ba5c42c7.js";import{i as l}from"./shared-53e42a77.js";import"./foxy-copy-to-clipboard.js";import{R as d,a as c}from"./shared-328aa161.js";import{g as m}from"./shared-96e4f603.js";import"./foxy-billing-address-card.js";import"./shared-04277241.js";import"./foxy-spinner.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-021fbb51.js";import"./shared-b0453b08.js";import"./shared-930e68b7.js";import"./shared-de4ec7bb.js";import"./shared-fd8b44e3.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./foxy-custom-field-form.js";import"./shared-8bf38c47.js";import"./shared-0ea24ca2.js";import"./shared-b0db52f7.js";import"./shared-9a291941.js";import"./shared-097487d0.js";import"./shared-0a7a4660.js";import"./shared-5fd5805c.js";import"./foxy-custom-field-card.js";import"./shared-5212ef4f.js";import"./shared-490dadf8.js";import"./shared-41c9c53f.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-c84333db.js";import"./foxy-payment-card.js";import"./shared-cf613436.js";import"./foxy-webhook-card.js";import"./shared-bab2ea2c.js";import"./foxy-webhook-form.js";import"./shared-462566b0.js";import"./shared-31e75a4a.js";import"./shared-d48e260f.js";import"./shared-910d49eb.js";import"./shared-ba43928a.js";import"./shared-bc8a1435.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-a9a8eb7c.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-address-form.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-3c0e3876.js";import"./shared-67aeac0f.js";import"./foxy-item-card.js";import"./shared-56a16e03.js";import"./foxy-item-form.js";import"./shared-4dc0bd88.js";import"./shared-53e476fd.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";import"./shared-f9bb0924.js";import"./shared-aa258319.js";import"./shared-d74aac59.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-7a5d645f.js";let f,h,u,p,x,y,v,_,g,b,j,w=e=>e;customElements.define("foxy-internal-admin-subscription-form-status-action-form",class extends e{constructor(){super(...arguments),this.__endDatePresetOptions=JSON.stringify([{value:"tomorrow",label:"option_tomorrow"},{value:"next_transaction_date",label:"option_next_transaction_date"},{value:"custom_date",label:"option_custom_date"}]),this.__endDatePresetGetValue=()=>{var e;return null!==(e=this.form.end_date_preset)&&void 0!==e?e:"next_transaction_date"},this.__endDatePresetSetValue=e=>{if(this.edit({end_date_preset:e}),"tomorrow"===e){const e=new Date;e.setDate(e.getDate()+1),e.setHours(0,0,0,0),this.edit({end_date:o(e)})}else"next_transaction_date"===e?this.edit({end_date:this.form.next_transaction_date}):this.edit({end_date:""})},this.__endDateGetValue=()=>this.form.end_date_preset?this.form.end_date:this.form.next_transaction_date,this.__nextTransactionDateGetValue=()=>{const e=new Date;e.setDate(e.getDate()+1),e.setHours(0,0,0,0);const t=o(e);if(!this.form.next_transaction_date)return t;const r=s(this.form.next_transaction_date.substring(0,10));return!r||r<e?t:this.form.next_transaction_date}}static get v8n(){return[({next_transaction_date:e,end_date:t},r)=>{var a;if(null===(a=r.data)||void 0===a?void 0:a.is_active){if(!t||"0000-00-00"===t)return"end-date:v8n_required"}else if(!e)return"next-transaction-date:v8n_required";return!0}]}get readonlySelector(){const e=[super.readonlySelector.toString()];return"custom_date"!==this.form.end_date_preset&&e.push("end-date"),new r(e.join(" ").trim())}renderBody(){var e;const t=new Date;t.setDate(t.getDate()+1),t.setHours(0,0,0,0);const r=!!(null===(e=this.data)||void 0===e?void 0:e.is_active),a=r?"cancel":"reactivate",s=r?"bg-error-10":"bg-success-10",l=n(r?f||(f=w`<svg class="text-error" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z" /></svg>`):h||(h=w`<svg class="text-success" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>`));return i(u||(u=w` <foxy-internal-summary-control infer="" label="" helper-text=""> <div class="text-center flex flex-col items-center bg-transparent"> <div class="rounded-full ${0} p-m mb-s mx-auto">${0}</div> <p class="font-medium text-xl leading-m"> <foxy-i18n infer="" key="${0}_title"></foxy-i18n> </p> <p class="text-secondary leading-s"> <foxy-i18n infer="" key="${0}_subtitle"></foxy-i18n> </p> </div> </foxy-internal-summary-control> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> <vaadin-button theme="primary ${0} large" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}_submit"></foxy-i18n> </vaadin-button> `),s,l,a,a,r?i(p||(p=w` <foxy-internal-select-control options="${0}" layout="summary-item" infer="end-date-preset" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-date-control layout="summary-item" infer="end-date" min="${0}" hide-clear-button .getValue="${0}"> </foxy-internal-date-control> `),this.__endDatePresetOptions,this.__endDatePresetGetValue,this.__endDatePresetSetValue,o(t),this.__endDateGetValue):i(x||(x=w` <foxy-internal-date-control layout="summary-item" infer="next-transaction-date" min="${0}" hide-clear-button .getValue="${0}"> </foxy-internal-date-control> `),o(t),this.__nextTransactionDateGetValue),r?[this.__renderFaq("cancel_why_not_today",n(y||(y=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M5.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75V12ZM6 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H6ZM7.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H8a.75.75 0 0 1-.75-.75V12ZM8 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H8ZM9.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V10ZM10 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H10ZM9.25 14a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V14ZM12 9.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V10a.75.75 0 0 0-.75-.75H12ZM11.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H12a.75.75 0 0 1-.75-.75V12ZM12 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H12ZM13.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H14a.75.75 0 0 1-.75-.75V10ZM14 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H14Z" /><path fill-rule="evenodd" d="M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2Zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75Z" clip-rule="evenodd" /></svg>`))),this.__renderFaq("cancel_whats_next",n(v||(v=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M3.288 4.818A1.5 1.5 0 0 0 1 6.095v7.81a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905c.155-.096.285-.213.389-.344v2.973a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905a1.5 1.5 0 0 0 0-2.552l-6.323-3.906A1.5 1.5 0 0 0 10 6.095v2.972a1.506 1.506 0 0 0-.389-.343L3.288 4.818Z" /></svg>`))),this.__renderFaq("cancel_how_to_reactivate",n(_||(_=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M6.111 11.89A5.5 5.5 0 1 1 15.501 8 .75.75 0 0 0 17 8a7 7 0 1 0-11.95 4.95.75.75 0 0 0 1.06-1.06Z" /><path d="M8.232 6.232a2.5 2.5 0 0 0 0 3.536.75.75 0 1 1-1.06 1.06A4 4 0 1 1 14 8a.75.75 0 0 1-1.5 0 2.5 2.5 0 0 0-4.268-1.768Z" /><path d="M10.766 7.51a.75.75 0 0 0-1.37.365l-.492 6.861a.75.75 0 0 0 1.204.65l1.043-.799.985 3.678a.75.75 0 0 0 1.45-.388l-.978-3.646 1.292.204a.75.75 0 0 0 .74-1.16l-3.874-5.764Z" /></svg>`)))]:[this.__renderFaq("reactivate_why_not_today",n(g||(g=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-success flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M5.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75V12ZM6 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H6ZM7.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H8a.75.75 0 0 1-.75-.75V12ZM8 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H8ZM9.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V10ZM10 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H10ZM9.25 14a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V14ZM12 9.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V10a.75.75 0 0 0-.75-.75H12ZM11.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H12a.75.75 0 0 1-.75-.75V12ZM12 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H12ZM13.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H14a.75.75 0 0 1-.75-.75V10ZM14 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H14Z" /><path fill-rule="evenodd" d="M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2Zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75Z" clip-rule="evenodd" /></svg>`))),this.__renderFaq("reactivate_whats_next",n(b||(b=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-success flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M3.288 4.818A1.5 1.5 0 0 0 1 6.095v7.81a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905c.155-.096.285-.213.389-.344v2.973a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905a1.5 1.5 0 0 0 0-2.552l-6.323-3.906A1.5 1.5 0 0 0 10 6.095v2.972a1.506 1.506 0 0 0-.389-.343L3.288 4.818Z" /></svg>`)))],r?"error":"success",this.disabled,(()=>this.submit()),a)}submit(){var e;(null===(e=this.data)||void 0===e?void 0:e.is_active)?"next_transaction_date"===this.__endDatePresetGetValue()&&this.edit({end_date:this.form.next_transaction_date}):this.edit({next_transaction_date:this.__nextTransactionDateGetValue(),is_active:!0,end_date:"0000-00-00"}),super.submit()}async _sendPatch(e){return delete e.end_date_preset,super._sendPatch(e)}__renderFaq(e,t){return i(j||(j=w` <div class="bg-transparent flex leading-xs" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p class="grid"> <foxy-i18n class="leading-m text-s font-medium" infer="" key="${0}_title"> </foxy-i18n> <foxy-i18n class="leading-xs text-secondary text-xs" infer="" key="${0}_text"> </foxy-i18n> </p> </div> `),t,e,e)}});let k,$,V,M=e=>e;customElements.define("foxy-internal-admin-subscription-form-status-action",class extends t{get hiddenSelector(){const e=[super.hiddenSelector.toString()];return e.unshift("form:save-button"),new r(e.join(" ").trim())}renderControl(){var e,t;const r=this.nucleon,a=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.end_date,o=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t.is_active,s=!o||!a||"0000-00-00"===a;return i(k||(k=M` <vaadin-button theme="tertiary-inline${0}" @click="${0}"> <foxy-i18n infer="" key="caption_${0}"></foxy-i18n> </vaadin-button> ${0} `),s?o?" error":" success":"",(e=>{var t;const r=e.currentTarget;null===(t=this.renderRoot.querySelector("#dialog"))||void 0===t||t.show(r)}),o?a&&"0000-00-00"!==a?"uncancel":"cancel":"reactivate",s?i($||($=M` <foxy-form-dialog infer="form" form="foxy-internal-admin-subscription-form-status-action-form" href="${0}" no-confirm-when-dirty close-on-patch alert id="dialog"> </foxy-form-dialog> `),l(null==r?void 0:r.href)):i(V||(V=M` <foxy-internal-confirm-dialog message="uncancel_message" confirm="uncancel_confirm" cancel="uncancel_cancel" header="uncancel_header" infer="" id="dialog" @hide="${0}"> </foxy-internal-confirm-dialog> `),(e=>{var t,r;e.detail.cancelled||(null===(t=this.nucleon)||void 0===t||t.edit({end_date:"0000-00-00"}),null===(r=this.nucleon)||void 0===r||r.submit())})))}});let Z,H=e=>e;class S extends(d(t)){constructor(){super(...arguments),this.search=null}static get properties(){return a(a({},super.properties),{},{search:{}})}renderControl(){var e,t;const r=this.nucleon;let a;try{const o=new URL(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:sub_token_url"].href)&&void 0!==t?t:"");if(this.search){const e=new URLSearchParams(o.search);o.search=this.search,e.forEach(((e,t)=>o.searchParams.set(t,e)))}a=o.toString()}catch(e){a=void 0}return i(Z||(Z=H` <div class="leading-xs flex items-center gap-xs"> <foxy-i18n class="truncate min-w-0" infer="" key="label"></foxy-i18n> <span class="text-tertiary"> • </span> <foxy-copy-to-clipboard layout="complete" theme="tertiary-inline" infer="copy-to-clipboard" text="${0}"> </foxy-copy-to-clipboard> </div> <foxy-i18n class="leading-xs block text-xs text-secondary" infer="" key="helper_text"> </foxy-i18n> `),a)}}customElements.define("foxy-internal-admin-subscription-form-link-control",S);let A,D,P=e=>e;customElements.define("foxy-internal-admin-subscription-form-error",class extends t{renderControl(){var e,t;return i(A||(A=P` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),n(D||(D=P`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.error_message)}});let B,C,q,G,E,F,z,L=e=>e;const O=c(e,"admin-subscription-form");class R extends O{constructor(){super(...arguments),this.uoeSettingsPage=null}static get properties(){return a(a({},super.properties),{},{uoeSettingsPage:{attribute:"uoe-settings-page"}})}get hiddenSelector(){const e=["delete",super.hiddenSelector.toString()],t=this.data;return(null==t?void 0:t.error_message)&&t.past_due_amount||e.unshift("error-message"),new r(e.join(" ").trim())}get headerSubtitleKey(){const e=m(this.data);return e?`subtitle_${e}`:super.headerSubtitleKey}renderHeaderActions(){return i(B||(B=L` <foxy-internal-admin-subscription-form-status-action infer="status-action"> </foxy-internal-admin-subscription-form-status-action> `))}renderBody(){var e,t,r,a,o,s,d,c,m;let f;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");r.searchParams.set("zoom","items"),f=r.toString()}catch(e){f=void 0}const h=null===(a=null===(r=this.data)||void 0===r?void 0:r._links["fx:charge_past_due"])||void 0===a?void 0:a.href,u=null===(o=this.data)||void 0===o?void 0:o.past_due_amount,p=null===(s=this.data)||void 0===s?void 0:s.error_message,x=null===(d=this.data)||void 0===d?void 0:d._embedded["fx:transaction_template"].currency_code;return i(C||(C=L` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="self-service-links"> <foxy-internal-admin-subscription-form-link-control infer="load-in-cart"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="cart=checkout" infer="load-on-checkout"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=next_transaction_date" infer="cancel-at-end-of-billing-period"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=true" infer="cancel-next-day"> </foxy-internal-admin-subscription-form-link-control> <div class="flex items-start leading-xs text-xs text-secondary" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="uoe_hint_text"></foxy-i18n> ${0} </p> </div> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-admin-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),l(x),h&&x&&u?i(q||(q=L` <foxy-internal-post-action-control message-options="${0}" theme="tertiary-inline" infer="charge-past-due" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({amount:`${u} ${x}`}),h,(()=>this.refresh())):p&&!u?i(G||(G=L` <details class="leading-xs text-xs text-secondary rounded-b focus-within-ring-2 focus-within-ring-inset focus-within-ring-primary-50" style="--gap:calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"> <summary class="cursor-pointer transition-colors hover-text-body focus-outline-none"> <span class="flex items-start" style="gap:var(--gap)"> ${0} <foxy-i18n infer="" key="error_with_zero_past_due_hint"></foxy-i18n> </span> </summary> <p style="padding-left:calc(1.25em + var(--gap))" class="pt-xs"> <span class="whitespace-pre-line">${0}</span> </p> </details> `),n(E||(E=L`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`)),p):"",n(F||(F=L`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`)),this.uoeSettingsPage?i(z||(z=L` <a target="_blank" class="inline-block rounded font-medium text-body cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="uoe_link_text"></foxy-i18n> </a> `),this.uoeSettingsPage):"",this.renderTemplateOrSlot(),l(null===(m=null===(c=this.data)||void 0===c?void 0:c._links)||void 0===m?void 0:m["fx:attributes"].href),l(f),super.renderBody())}}customElements.define("foxy-admin-subscription-form",R);export{R as AdminSubscriptionForm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-910d49eb.js";import"./shared-be071e3d.js";import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";import"./shared-26b55da2.js";import{I as t}from"./shared-
|
|
1
|
+
import"./shared-910d49eb.js";import"./shared-be071e3d.js";import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";import"./shared-26b55da2.js";import{I as t}from"./shared-084e1772.js";import"./shared-0a7a4660.js";import"./foxy-copy-to-clipboard.js";import"./foxy-swipe-actions.js";import{_ as e}from"./shared-8f9014ff.js";import{a as s,T as r}from"./shared-328aa161.js";import{c as i}from"./shared-4e709717.js";import{c as o,h as n}from"./shared-ba5c42c7.js";import{C as a}from"./shared-41c9c53f.js";import{N as h}from"./shared-fd8b44e3.js";import"./shared-b0db52f7.js";import"./shared-021fbb51.js";import"./shared-097487d0.js";import"./shared-d48e260f.js";import"./shared-ba43928a.js";import"./shared-9a291941.js";import"./shared-8dd6e5cc.js";import"./foxy-spinner.js";import"./shared-930e68b7.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./shared-53e42a77.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-591ee1bf.js";import"./shared-9a454e09.js";import"./shared-5212ef4f.js";import"./shared-d01853e2.js";import"./shared-f9bb0924.js";import"./shared-1301af85.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-3c0e3876.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./shared-bab2ea2c.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";let l,d,c,p,f,m,u,_,b,y,g,v,x,$=t=>t;const j=Symbol(),w=Symbol();class k extends(s(t)){constructor(){super(...arguments),this.open=!1}static get properties(){return e(e({},super.properties),{},{open:{type:Boolean,reflect:!0}})}static get styles(){return[...super.styles,o(l||(l=$`.resource{display:grid;grid-template-columns:repeat(auto-fill,minmax(calc(18.75 * var(--lumo-space-m)),1fr));grid-gap:1px}.resource>:first-child{grid-column-start:1;grid-column-end:-2}foxy-internal-source-control::part(editor){border-radius:0;max-height:none;box-shadow:none;border:none}foxy-internal-source-control::part(helper-text),foxy-internal-source-control::part(label){position:absolute;width:1px;height:1px;padding-top:0;margin-top:-1px;overflow-x:hidden;overflow-y:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-top-width:0}`))]}static get v8n(){return[...super.v8n,t=>"string"!=typeof t[j]||"invalid_json"]}renderBody(){return n(d||(d=$` <details class="select-none rounded-t-l rounded-b-l overflow-hidden border border-contrast-10" ?open="${0}" @toggle="${0}"> <summary class="${0}"> <div class="flex items-center space-x-s p-s pr-m transition-colors cursor-pointer bg-contrast-5 hover-bg-contrast-10"> <foxy-copy-to-clipboard infer="copy-to-clipboard" text="${0}"> </foxy-copy-to-clipboard> <span class="font-medium truncate">${0}</span> <span class="flex-1"></span> ${0} ${0} ${0} </div> </summary> ${0} </details> `),this.open,(t=>{const e=t.currentTarget;this.open=e.open}),i({"ring-inset ring-primary-50 rounded-t-l":!0,"focus-outline-none focus-ring-2":!0,"rounded-b-l":!this.open}),this.href||this.parent,this.__renderTitle(),this.in({idle:{snapshot:"dirty"}})||this.in({idle:"template"})?n(c||(c=$` <foxy-internal-submit-control infer="${0}" theme="tertiary-inline success"> </foxy-internal-submit-control> `),this.href?"submit":"create"):"",this.in({idle:{snapshot:"dirty"}})||this.in({idle:{template:"dirty"}})?n(p||(p=$` <vaadin-button data-testid="undo" theme="tertiary-inline contrast" class="px-xs" @click="${0}"> <foxy-i18n infer="" key="undo"></foxy-i18n> </vaadin-button> `),(()=>this.undo())):"",this.in({idle:"snapshot"})?n(f||(f=$` <foxy-internal-delete-control infer="delete" theme="tertiary-inline error"> </foxy-internal-delete-control> `)):"",this.open?this.__renderForm():"")}async _fetch(...t){var e;try{const s=t[0]instanceof Request?t[0]:new Request(...t);if("POST"!==s.method)return await super._fetch(...t);const r=null!==(e=this.form[w])&&void 0!==e?e:JSON.stringify(this.form);return await super._fetch(s.url,{method:"POST",body:r})}catch(t){throw["invalid_json"]}}__renderTitle(){if(!this.href)return n(m||(m=$` <span class="text-tertiary">POST</span> <span>${0}</span> `),this.parent);let t="",e="",s="";try{const r=new URL(this.href);t=r.pathname,t.startsWith("/")&&(t=t.substring(1));const i=t.split("/");t=i.slice(0,i.length-1).join("/"),i.length>1&&(t=`${t}/`,e=i[i.length-1]),s=r.search}catch(e){t=this.href}return n(u||(u=$` ${0} `),[n(_||(_=$`<span>${0}</span>`),t),n(b||(b=$`<span class="text-primary">${0}</span>`),e),n(y||(y=$`<span class="text-tertiary">${0}</span>`),s)])}__renderForm(){return n(g||(g=$` <div class="bg-base"> <div class="${0} border-t border-contrast-5 bg-contrast-10"> <foxy-internal-source-control infer="editor" class="flex-1 bg-base" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> ${0} </div> </div> `),this.data?"resource":"",(()=>this.__formAsString),(t=>this.__formAsString=t),this.data?n(v||(v=$` <div class="bg-base"> <ul class="bg-contrast-5 p-xs h-full"> ${0} </ul> </div> `),this.__links.map((([t,e])=>this.__renderLink(t,e.href,e.title)))):"")}get __links(){var t,e;const s=Object.entries(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links)&&void 0!==e?e:{}).filter((([t,e])=>"self"!==t&&!Array.isArray(e)&&!e.templated));try{s.sort((([t],[e])=>t.localeCompare(e,this.lang)))}catch(t){s.sort((([t],[e])=>t.localeCompare(e)))}return s}get __formAsString(){const t=this.form,e=t[w],s=t[j];return"string"==typeof s?s:"string"==typeof e?e:JSON.stringify(t,((t,e)=>t.startsWith("_")?void 0:e),2)}set __formAsString(t){this.undo();try{const e=JSON.parse(t);"object"==typeof e&&this.edit(e),this.edit({[w]:t})}catch(e){this.edit({[j]:t})}}__renderLink(t,e,s){return n(x||(x=$` <li data-testclass="link" class="m-xs rounded overflow-hidden transition-colors hover-bg-contrast-5"> <foxy-swipe-actions> <button class="${0}" @click="${0}"> <div class="flex items-center"> <div class="flex-1 space-y-xs px-s min-w-0 text-s"> <div class="truncate font-medium">${0}</div> <div class="opacity-75 truncate">${0}</div> </div> <iron-icon class="icon-inline text-xl text-tertiary mr-s flex-shrink-0" icon="icons:chevron-right"> </iron-icon> </div> </button> <div slot="action" class="h-full flex"> <vaadin-button theme="secondary success" class="h-full rounded-none" @click="${0}"> POST </vaadin-button> </div> </foxy-swipe-actions> </li> `),i({"rounded leading-none space-y-xs block text-left w-full py-s":!0,"ring-inset ring-primary-50":!0,"focus-outline-none focus-ring-2 ":!0}),(()=>{const t=new CustomEvent("navigate:get",{bubbles:!0,detail:e});this.dispatchEvent(t)}),s||e,t,(()=>{const t=new CustomEvent("navigate:post",{bubbles:!0,detail:e});this.dispatchEvent(t)}))}}customElements.define("foxy-internal-api-browser-resource-form",k);let C,S,E,T,U,O,B,P,A,G=t=>t;const H=a(r(s(h,"api-browser")));class R extends H{constructor(){super(...arguments),this.home=null,this.__newCurrentUrl=null,this.__history=[],this.__renderItem=({href:t,html:e})=>t?e(S||(S=G`
|
|
2
2
|
<foxy-internal-api-browser-resource-form infer="" href=${0}>
|
|
3
3
|
</foxy-internal-api-browser-resource-form>
|
|
4
4
|
`),t):e(C||(C=G``)),this.__handleExistingResourceFetch=t=>{"DELETE"===t.request.method&&(t.preventDefault(),t.respondWith(new R.API(this).fetch(t.request).then((t=>(t.ok&&(this.__canGoBack?this.__goBack():this.__canGoHome?this.__goHome():(this.parent="",this.href="")),t)))))}}static get properties(){return e(e({},super.properties),{},{__newCurrentUrl:{attribute:!1},__history:{attribute:!1},home:{type:String}})}render(){var t;return n(E||(E=G` <div class="space-y-m"> <div class="flex items-center gap-s flex-wrap-reverse"> <vaadin-button title="${0}" theme="icon contrast" class="p-0" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-m" icon="icons:arrow-back"></iron-icon> </vaadin-button> <vaadin-button title="${0}" theme="icon contrast" class="p-0" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-m" icon="icons:home"></iron-icon> </vaadin-button> <vaadin-text-field placeholder="https://api.foxy.io/stores/0" aria-label="${0}" class="flex-1" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} <div class="grid grid-cols-2"> <vaadin-button title="${0}" theme="${0}" class="rounded-r-none p-0" ?disabled="${0}" @click="${0}"> GET </vaadin-button> <vaadin-button title="${0}" theme="${0}" class="rounded-l-none p-0" ?disabled="${0}" @click="${0}"> POST </vaadin-button> </div> </div> <div @navigate:get="${0}" @navigate:post="${0}"> ${0} </div> </div> `),this.t("go_back"),this.disabled||!this.__canGoBack,(()=>this.__goBack()),this.t("go_home"),this.disabled||!this.__canGoHome,(()=>this.__goHome()),this.t("current_url"),this.disabled,this.readonly,this.__newCurrentUrl||this.href||this.parent,(t=>"Enter"===t.key&&this.__go()),(t=>{const e=t.currentTarget;this.__newCurrentUrl=e.value}),this.__newCurrentUrl?n(T||(T=G` <vaadin-button title="${0}" theme="icon primary" class="p-0" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-m" icon="icons:arrow-forward"></iron-icon> </vaadin-button> `),this.t("navigate"),this.disabled||this.in("busy"),this.__go):n(U||(U=G` <vaadin-button title="${0}" theme="icon contrast" class="p-0" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-m" icon="icons:refresh"></iron-icon> </vaadin-button> `),this.t("refresh"),this.disabled||this.in("busy"),(()=>this.refresh())),this.t("get_mode"),this.href?"contrast primary":"contrast",this.disabled||"get"===this.__mode,(()=>this.__mode="get"),this.t("post_mode"),this.href?"contrast":"contrast primary",this.disabled||"post"===this.__mode,(()=>this.__mode="post"),(t=>{t.stopPropagation(),this.__history.push({href:this.href,parent:this.parent}),this.__newCurrentUrl=null,this.parent="",this.href=t.detail}),(t=>{t.stopPropagation(),this.__history.push({href:this.href,parent:this.parent}),this.__newCurrentUrl=null,this.parent=t.detail,this.href=""}),this.href?n(O||(O=G` ${0} `),(null===(t=this.data)||void 0===t?void 0:t._links.first)?n(B||(B=G` <foxy-pagination first="${0}" infer=""> <foxy-collection-page class="block space-y-m mb-m" infer="" .item="${0}"> </foxy-collection-page> </foxy-pagination> `),this.href,this.__renderItem):n(P||(P=G` <foxy-internal-api-browser-resource-form infer="" href="${0}" open @fetch="${0}"> </foxy-internal-api-browser-resource-form> `),this.href,this.__handleExistingResourceFetch)):n(A||(A=G` <foxy-internal-api-browser-resource-form infer="" parent="${0}" open @update="${0}"> </foxy-internal-api-browser-resource-form> `),this.parent,(t=>{const e=t.currentTarget;e.in({idle:"snapshot"})&&(this.href=e.data._links.self.href,this.parent="")})))}get __canGoBack(){return this.__history.length>0}get __canGoHome(){return this.href!==this.home}get __mode(){return this.href?"get":"post"}set __mode(t){"get"===t?(this.href=this.parent,this.parent=""):(this.parent=this.href,this.href="")}__goBack(){var t,e;const s=this.__history.length-1,r=this.__history[s];this.parent=null!==(t=null==r?void 0:r.parent)&&void 0!==t?t:"",this.href=null!==(e=null==r?void 0:r.href)&&void 0!==e?e:"",this.__history=this.__history.slice(0,s)}__goHome(){var t;this.__history=[],this.parent="",this.href=null!==(t=this.home)&&void 0!==t?t:""}__go(){if("string"==typeof this.__newCurrentUrl){this.__history.push({href:this.href,parent:this.parent});this[this.href?"href":"parent"]=this.__newCurrentUrl,this.__newCurrentUrl=null}}}customElements.define("foxy-api-browser",R);export{R as ApiBrowser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-8bf38c47.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-8bf38c47.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-084e1772.js";import{a as r}from"./shared-328aa161.js";import{B as s}from"./shared-8f9014ff.js";import{h as t}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"./shared-097487d0.js";import"./shared-8dd6e5cc.js";import"./shared-9a454e09.js";import"./shared-5212ef4f.js";import"./shared-26b55da2.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.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-910d49eb.js";import"./shared-d48e260f.js";import"./shared-ba43928a.js";import"./shared-4e709717.js";import"./shared-d0aed1c1.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-18e301f2.js";import"./shared-6880e1f6.js";import"./shared-b0453b08.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let o,a,i=e=>e;const d=r(e,"applied-coupon-code-form");class p extends d{constructor(){super(...arguments),this.__ignoreUsageLimitsOptions=[{value:"checked",label:"option_checked"}],this.__getIgnoreUsageLimitsValue=()=>this.form.ignore_usage_limits?["checked"]:[],this.__setIgnoreUsageLimitsValue=e=>{this.edit({ignore_usage_limits:e.includes("checked")})}}static get v8n(){return[({code:e})=>!!e||"code:v8n_required"]}get readonlySelector(){return this.data?new s("not=delete"):super.readonlySelector}get hiddenSelector(){return new s(`timestamps ${super.hiddenSelector}`)}renderBody(){return t(o||(o=i` ${0} <foxy-internal-text-control helper-text="${0}" infer="code"> </foxy-internal-text-control> ${0} ${0} `),this.renderHeader(),this.t(this.data?"code.helper_text_existing":"code.helper_text_new"),this.data?"":t(a||(a=i` <foxy-internal-checkbox-group-control infer="ignore-usage-limits" class="-my-xs" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__getIgnoreUsageLimitsValue,this.__setIgnoreUsageLimitsValue,this.__ignoreUsageLimitsOptions),super.renderBody())}}customElements.define("foxy-applied-coupon-code-form",p);export{p as AppliedCouponCodeForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-7a5d645f.js";import"./shared-0a7a4660.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-7a5d645f.js";import"./shared-0a7a4660.js";import{I as e}from"./shared-084e1772.js";import{a as r}from"./shared-328aa161.js";import{B as t}from"./shared-8f9014ff.js";import{h as i}from"./shared-ba5c42c7.js";import"./shared-b0db52f7.js";import"./shared-021fbb51.js";import"./shared-9a291941.js";import"./shared-be071e3d.js";import"./shared-097487d0.js";import"./shared-8dd6e5cc.js";import"./shared-9a454e09.js";import"./shared-5212ef4f.js";import"./shared-26b55da2.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.js";import"./shared-fd8b44e3.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-18e301f2.js";import"./shared-6880e1f6.js";import"./shared-b0453b08.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let s,o=e=>e;const a=r(e,"attribute-form");class d extends a{constructor(){super(...arguments),this.__visibilityGetValue=()=>this.form.visibility||"private",this.__visibilityOptions=[{label:"option_public",value:"public"},{label:"option_restricted",value:"restricted"},{label:"option_private",value:"private"}]}static get v8n(){return[({value:e})=>e&&e.length>0||"value:v8n_required",({value:e})=>!e||e.length<=1e3||"value:v8n_too_long",({name:e})=>e&&e.length>0||"name:v8n_required",({name:e})=>!e||e.length<=500||"name:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.href&&e.unshift("visibility"),new t(e.join(" ").trim())}get headerSubtitleKey(){var e;return`subtitle_${null===(e=this.data)||void 0===e?void 0:e.visibility}`}renderBody(){return i(s||(s=o` ${0} <foxy-internal-source-control infer="name"></foxy-internal-source-control> <foxy-internal-source-control infer="value"></foxy-internal-source-control> <foxy-internal-radio-group-control infer="visibility" .options="${0}" .getValue="${0}"> </foxy-internal-radio-group-control> ${0} `),this.renderHeader(),this.__visibilityOptions,this.__visibilityGetValue,super.renderBody())}}customElements.define("foxy-attribute-form",d);export{d as AttributeForm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-4dc0bd88.js";import"./shared-1fa1abbd.js";import"./shared-591ee1bf.js";import"./shared-bc8a1435.js";import"./shared-1301af85.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-084e1772.js";import"./foxy-applied-coupon-code-card.js";import"./foxy-applied-coupon-code-form.js";import"./foxy-custom-field-card.js";import"./foxy-custom-field-form.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-26b55da2.js";import{a as t,I as r}from"./shared-9a454e09.js";import{_ as o,B as i}from"./shared-8f9014ff.js";import{c as s}from"./shared-4e709717.js";import{h as n,c as a}from"./shared-ba5c42c7.js";import"./shared-be071e3d.js";import{R as l,a as d}from"./shared-328aa161.js";import{i as c}from"./shared-53e42a77.js";import"./foxy-update-payment-method-form.js";import{U as u}from"./shared-cd96ff03.js";import{s as m}from"./shared-53e476fd.js";import"./shared-04277241.js";import{g as p}from"./shared-bab2ea2c.js";import{T as _}from"./shared-490dadf8.js";import{T as h}from"./shared-8874ec69.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-021fbb51.js";import"./shared-9a291941.js";import"./shared-b0db52f7.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-6880e1f6.js";import"./shared-b0453b08.js";import"./shared-41c9c53f.js";import"./shared-930e68b7.js";import"./foxy-form-dialog.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./shared-69c98b7b.js";import"./shared-fd8b44e3.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-0ea24ca2.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-d48e260f.js";import"./shared-3c0e3876.js";import"./shared-ba43928a.js";import"./shared-910d49eb.js";import"./shared-097487d0.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5fd5805c.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-d01853e2.js";import"./shared-f9bb0924.js";import"./shared-5212ef4f.js";import"./shared-d0aed1c1.js";import"./shared-de4ec7bb.js";import"./shared-8bf38c47.js";import"./shared-0a7a4660.js";import"./shared-7a5d645f.js";import"./shared-56a16e03.js";import"./shared-c84333db.js";import"./shared-f7965314.js";import"./shared-aa258319.js";import"./shared-d74aac59.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-payment-card-embed.js";import"./shared-334b7e24.js";import"./shared-7f7d6ceb.js";import"./shared-11de7969.js";let f,y,v=e=>e;customElements.define("foxy-internal-cart-form-create-session-action",class extends t{constructor(){super(...arguments),this.__loader=null}static get properties(){return o(o({},super.properties),{},{__loader:{attribute:!1}})}renderControl(){var e,t;const r=null===(e=this.__loader)||void 0===e?void 0:e.state,o=null===(t=this.__loader)||void 0===t?void 0:t.result;return o?n(f||(f=v` <a target="_blank" class="rounded font-medium transition-colors text-body focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="state_idle"></foxy-i18n> </a> `),o):n(y||(y=v` <div class="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </div> `),s({"transition-colors font-medium rounded":!0,"text-tertiary":"fail"!==r,"text-error":"fail"===r}),"fail"===r?"state_fail":"state_busy")}updated(e){var t;super.updated(e);const r=this.nucleon,o=null==r?void 0:r.data,i=null!==(t=null==o?void 0:o._links["fx:create_session"].href)&&void 0!==t?t:null;this.__reloadSessionHref(i)}async __reloadSessionHref(e){var t;if((null===(t=this.__loader)||void 0===t?void 0:t.href)===e)return;const r=this.nucleon;if(r)if(e){const t={result:null,state:"busy",href:e},o=new r.constructor.API(this);this.__loader=t;try{const r=await o.fetch(e,{method:"POST"});if(!r.ok)throw new Error;t.result=(await r.json()).cart_link,t.state="idle"}catch(e){t.state="fail"}finally{this.requestUpdate()}}else this.__loader=null}});let g;const x=a(g||(g=(e=>e)`
|
|
2
2
|
#dialog{
|
|
3
3
|
width:100dvw;
|
|
4
4
|
max-height:calc(100dvh - var(--lumo-space-m));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-55fa26c2.js";import"./shared-a9a8eb7c.js";import{I as t}from"./shared-
|
|
1
|
+
import"./shared-55fa26c2.js";import"./shared-a9a8eb7c.js";import{I as t}from"./shared-084e1772.js";import{R as e,a as r}from"./shared-328aa161.js";import{B as o}from"./shared-8f9014ff.js";import{h as n}from"./shared-ba5c42c7.js";import"./shared-ee752063.js";import"./shared-b0db52f7.js";import"./shared-021fbb51.js";import"./shared-910d49eb.js";import"./shared-097487d0.js";import"./shared-d48e260f.js";import"./shared-ba43928a.js";import"./shared-be071e3d.js";import"./shared-9a291941.js";import"./shared-9a454e09.js";import"./shared-5212ef4f.js";import"./shared-26b55da2.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.js";import"./shared-fd8b44e3.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./shared-d0aed1c1.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-6880e1f6.js";import"./shared-b0453b08.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let s,a=t=>t;const i=e(r(t,"client-form"));class c extends i{get headerSubtitleOptions(){var t,e;try{return{context:"with_domain",domain:new URL(null!==(e=null===(t=this.data)||void 0===t?void 0:t.redirect_uri)&&void 0!==e?e:"").hostname}}catch(t){return super.headerSubtitleOptions}}get readonlySelector(){const t=["client-secret"];return(this.data||this.in({busy:"fetching"}))&&t.push("client-id"),new o(`${t.join(" ")} ${super.readonlySelector.toString()}`)}get hiddenSelector(){const t=[];return this.data||this.in({busy:"fetching"})||t.push("client-secret"),new o(`${t.join(" ")} ${super.hiddenSelector.toString()}`)}renderBody(){return n(s||(s=a` ${0} <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control class="col-span-2" infer="client-id"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="client-secret"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="redirect-uri"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="project-name"> </foxy-internal-text-control> <foxy-internal-text-area-control class="col-span-2" infer="project-description"> </foxy-internal-text-area-control> <foxy-internal-text-control infer="company-name"></foxy-internal-text-control> <foxy-internal-text-control infer="company-url"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="company-logo"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="contact-name"> </foxy-internal-text-control> <foxy-internal-text-control infer="contact-email"></foxy-internal-text-control> <foxy-internal-text-control infer="contact-phone"></foxy-internal-text-control> </div> ${0} `),this.renderHeader(),super.renderBody())}}customElements.define("foxy-client-form",c);export{c as ClientForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-1da8110b.js";import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./shared-26b55da2.js";import{_ as t}from"./shared-8f9014ff.js";import{c as o,h as
|
|
1
|
+
import"./shared-1da8110b.js";import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./shared-26b55da2.js";import{_ as t}from"./shared-8f9014ff.js";import{c as o,h as i,L as e}from"./shared-ba5c42c7.js";import{a as s}from"./shared-328aa161.js";import{C as n}from"./shared-41c9c53f.js";import{I as r}from"./shared-930e68b7.js";import{i as a}from"./shared-53e42a77.js";import{c}from"./shared-4e709717.js";import"./shared-021fbb51.js";import"./shared-9a291941.js";import"./shared-b0db52f7.js";import"./shared-6880e1f6.js";import"./shared-8dd6e5cc.js";let l,d,h,u,p,m=t=>t;const b=n(s(r(e),"copy-to-clipboard"));class f extends b{constructor(){super(...arguments),this.layout=null,this.theme=null,this.icon=null,this.text=null,this.__state="idle"}static get properties(){return t(t({},super.properties),{},{layout:{},theme:{},text:{type:String},icon:{type:String},__state:{attribute:!1}})}static get styles(){return o(l||(l=m`.icon-button{position:relative;appearance:none;background:0 0;border:none;border-radius:var(--lumo-border-radius-s);color:inherit;font-size:inherit;padding:0;width:1.5em;height:1.5em;display:flex;justify-content:center;align-items:center;transition:color .15s ease}.icon-button.inline{width:var(--lumo-size-s);height:var(--lumo-size-s);margin-left:calc(0px - ((var(--lumo-size-s) - 1em)/ 4));margin-right:calc(0px - ((var(--lumo-size-s) - 1em)/ 2))}.icon-button:not(.inline)::before{position:absolute;inset:0;content:' ';display:block;background:currentColor;opacity:.08;transition:opacity .15s ease;border-radius:var(--lumo-border-radius-s)}.icon-button:focus{outline:0;box-shadow:0 0 0 2px currentColor}.icon-button:disabled{opacity:.5;cursor:default}@media (hover:hover){.icon-button:not(:disabled):not(.inline):hover{cursor:pointer}.icon-button.inline:not(:disabled):hover{color:var(--lumo-body-text-color);cursor:default}.icon-button:not(:disabled):not(.inline):hover::before{opacity:.16}}iron-icon{--iron-icon-height:1em;--iron-icon-width:1em}`))}render(){var t,o,e;const s=null!==(t=this.layout)&&void 0!==t?t:"icon";let n="",r="";return"busy"===this.__state?(n="copying",r="icons:hourglass-empty"):"fail"===this.__state?(n="failed_to_copy",r="icons:error-outline"):"done"===this.__state?(n="done",r="icons:done"):(n="click_to_copy",r=null!==(o=this.icon)&&void 0!==o?o:"icons:content-copy"),i(d||(d=m` ${0} `),"icon"===s||"icon-inline"===s?i(h||(h=m` <button id="trigger" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="${0}"></iron-icon> </button> <vcf-tooltip position="bottom" style="--lumo-base-color:black" theme="light" for="trigger"> <span class="text-s" style="color:#fff"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </span> </vcf-tooltip> `),c({"icon-button":!0,inline:"icon-inline"===s}),this.disabled,this.__copy,r,n):i(u||(u=m` <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"></foxy-i18n> ${0} </vaadin-button> `),a(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled,this.__copy,n,"complete"===s?i(p||(p=m` <iron-icon style="--lumo-icon-size-m:1em;transform:translateY(-.1em)" icon="${0}"> </iron-icon> `),r):""))}__copy(){var t;"idle"===this.__state&&(this.__state="busy",navigator.clipboard.writeText(null!==(t=this.text)&&void 0!==t?t:"").then((()=>this.__state="done")).catch((()=>this.__state="fail")).then((()=>setTimeout((()=>this.__state="idle"),2e3))))}}customElements.define("foxy-copy-to-clipboard",f);export{f as CopyToClipboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-1fa1abbd.js";import"./shared-591ee1bf.js";import"./shared-a9a8eb7c.js";import{I as r}from"./shared-084e1772.js";import"./foxy-admin-transaction-card.js";import{_ as e,B as s}from"./shared-8f9014ff.js";import{a as t}from"./shared-328aa161.js";import{i as o}from"./shared-53e42a77.js";import{h as a}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-1301af85.js";import"./shared-d0aed1c1.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-bab2ea2c.js";import"./shared-04277241.js";import"./shared-de4ec7bb.js";import"./foxy-nucleon-element.js";let i,d,n=r=>r;const m=t(r,"coupon-code-form");class c extends m{constructor(){super(...arguments),this.getTransactionPageHref=null,this.__transactionsItemRenderer=r=>{let e;if(r.data){const s=new URL(r.data._links["fx:transaction"].href);s.searchParams.set("zoom","folder,items"),e=s.toString()}else e=r.href;return a(i||(i=n`<foxy-admin-transaction-card infer="" href="${0}"></foxy-admin-transaction-card>`),e)}}static get properties(){return e(e({},super.properties),{},{getTransactionPageHref:{attribute:!1}})}static get v8n(){return[({code:r})=>!!r||"code:v8n_required",({code:r})=>!r||r.length<=50||"code:v8n_too_long",({code:r})=>!(null==r?void 0:r.includes(" "))||"code:v8n_has_spaces"]}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.href||r.unshift("transactions"),new s(r.join(" ").trim())}renderBody(){var r,e;let s;try{const t=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:coupon_code_transactions"].href)&&void 0!==e?e:"");t.searchParams.set("zoom","items"),s=t.toString()}catch(r){s=void 0}return a(d||(d=n` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="code"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" infer="transactions" limit="5" .item="${0}" .getPageHref="${0}" hide-delete-button> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),o(s),this.__transactionsItemRenderer,this.getTransactionPageHref,super.renderBody())}}customElements.define("foxy-coupon-code-form",c);export{c as CouponCodeForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-4bafbc5f.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-4bafbc5f.js";import{I as e}from"./shared-084e1772.js";import{a as s}from"./shared-328aa161.js";import{B as r}from"./shared-8f9014ff.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-1da8110b.js";import"./shared-021fbb51.js";import"./shared-9a291941.js";import"./shared-b0db52f7.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-6880e1f6.js";import"./shared-9a454e09.js";import"./shared-5212ef4f.js";import"./shared-26b55da2.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.js";import"./shared-fd8b44e3.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-be071e3d.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./foxy-copy-to-clipboard.js";import"./shared-b0453b08.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let t,d=e=>e;const a=s(e,"coupon-codes-form");class i extends a{constructor(){super(...arguments),this.__couponCodesGetValue=()=>{var e,s;return null!==(s=null===(e=this.form.coupon_codes)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==s?s:[]},this.__couponCodesSetValue=e=>{this.edit({coupon_codes:e.map((({value:e})=>e.split(" ").map((e=>e.trim())))).flat().filter(((e,s,r)=>r.indexOf(e)===s))})}}static get v8n(){return[({coupon_codes:e})=>e&&e.length>0||"coupon-codes:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("coupon-codes"),new r(e.join(" ").trim())}get hiddenSelector(){const e=["delete timestamps",super.hiddenSelector.toString()];return new r(e.join(" ").trim())}renderBody(){return o(t||(t=d` <foxy-internal-editable-list-control infer="coupon-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__couponCodesGetValue,this.__couponCodesSetValue,super.renderBody())}async _sendPost(e){const s=JSON.stringify(e),r=await this._fetch(this.parent,{body:s,method:"POST"});return this.status={key:"success"},r}}customElements.define("foxy-coupon-codes-form",i);export{i as CouponCodesForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-8f61408a.js";import"./shared-1492fa1c.js";import"./shared-4bafbc5f.js";import{I as e}from"./shared-9a454e09.js";import{p as t,s as r}from"./shared-ec1daff0.js";import{_ as o,B as s}from"./shared-8f9014ff.js";import{O as i,T as n}from"./shared-8874ec69.js";import{h as a,c as l,s as d}from"./shared-ba5c42c7.js";import"./shared-26b55da2.js";import{R as c,a as u}from"./shared-328aa161.js";import{c as m}from"./shared-4e709717.js";import{r as p}from"./shared-5fd5805c.js";import"./shared-591ee1bf.js";import"./shared-bc8a1435.js";import"./shared-d01853e2.js";import"./shared-a9a8eb7c.js";import"./shared-5078246e.js";import{I as f}from"./shared-eadf0d23.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import{i as h}from"./shared-53e42a77.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-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-53e476fd.js";import"./foxy-pagination.js";import"./shared-1301af85.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-5212ef4f.js";import"./shared-f9bb0924.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"./shared-63c32024.js";import"./shared-2061be9a.js";import"./shared-f0fa0a88.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-bab2ea2c.js";import"./shared-aa258319.js";import"./shared-0a7a4660.js";import"./shared-490dadf8.js";import"./shared-de4ec7bb.js";import"./shared-04277241.js";import"./shared-d9457718.js";import"./foxy-swipe-actions.js";import"./foxy-admin-transaction-card.js";import"./shared-7a5d645f.js";let y,_,b,x,v=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.disableZoom=!1,this.disableOr=!1,this.operators=Object.values(i)}static get properties(){return o(o({},super.properties),{},{disableZoom:{type:Boolean,attribute:"disable-zoom"},disableOr:{type:Boolean,attribute:"disable-or"},operators:{type:Array}})}renderControl(){const{label:e,helperText:t,_errorMessage:r}=this,o=r&&!this.disabled&&!this.readonly;return a(y||(y=v` <section class="grid gap-s leading-xs"> <div ?hidden="${0}"> ${0} ${0} </div> <div class="bg-contrast-5 rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-query-builder infer="query-builder" style="--lumo-border-radius:var(--lumo-border-radius-s);--lumo-border-radius-l:var(--lumo-border-radius-s)" .operators="${0}" .value="${0}" ?disable-zoom="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> </div> ${0} </section> `),!e&&!t,e?a(_||(_=v`<p class="text-l font-medium">${0}</p>`),e):"",t?a(b||(b=v`<p class="text-s text-secondary">${0}</p>`),t):"",this.operators,this._value,this.disableZoom,this.disableOr,(e=>{var t;const r=e.currentTarget;this._value=null!==(t=r.value)&&void 0!==t?t:""}),o?a(x||(x=v`<p class="text-s text-error">${0}</p>`),r):"")}});let g,j,$,w,C,k,A,V,R,S,q=e=>e;class O extends(c(e)){static get styles(){return[super.styles,l(g||(g=q`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`))]}renderControl(){const e=a(j||(j=q` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-20"> <foxy-i18n infer="" key="or"></foxy-i18n> </div> <div class="flex-1 border-t border-contrast-10"></div> <div class="w-m ml-s flex-shrink-0"></div> </div> `));return a($||($=q` <div class="mb-s" ?hidden="${0}"> <p class="font-medium text-body text-l" ?hidden="${0}">${0}</p> <p class="text-s text-secondary" ?hidden="${0}">${0}</p> </div> <div class="rounded bg-contrast-5" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <p class="text-s text-error mt-s" ?hidden="${0}"> ${0} </p> `),!this.label&&!this.helperText,!this.label,this.label,!this.helperText,this.helperText,p([...Object.entries(this._value||{}),null],((e,t)=>String(t)),((t,r)=>null===t?[r>0?e:"",this.__renderRule({onChange:({key:e,items:t})=>{var r;this._value=o(o({},this._value),{},{[e]:[...null!==(r=this._value[e])&&void 0!==r?r:[],...t]})}})]:[r>0?e:"",this.__renderRule({rule:{key:t[0],items:t[1]},onChange:e=>{var r,o;const s={},i=Object.keys(this._value);for(let n=0;n<i.length;n++){const a=i[n];if(a===t[0])if(e.key===a)s[a]=e.items;else{const t=null!==(r=this._value[e.key])&&void 0!==r?r:[];n>i.indexOf(e.key)?s[e.key]=[...t,...e.items]:(s[e.key]=[...e.items,...t],i.splice(i.indexOf(e.key),1))}else s[a]=null!==(o=this._value[a])&&void 0!==o?o:[]}this._value=s},onDelete:()=>{const e=o({},this._value);delete e[t[0]],this._value=e}})])),!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}__renderRule({rule:e,onDelete:t,onChange:r}){var o,s;const i=null!==(o=null==e?void 0:e.items)&&void 0!==o?o:[];return a(w||(w=q` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="flex-1 bg-base rounded-s overflow-hidden border border-contrast-10"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base"> <div aria-hidden="true" class="${0}"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base"> <div class="${0}"> <div aria-hidden="true"> ${0} </div> </div> </div> <div class="bg-base"> <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> </div> </div> </div> </div> <div class="flex -mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center border-t border-b border-transparent divide-y divide-transparent" ?hidden="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> </div> `),this.t("rule"),m({"text-tertiary":!this.readonly&&!this.disabled,"text-disabled":this.readonly||this.disabled,"w-m h-m":!0}),d(C||(C=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z" class="fill-current"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z" class="fill-current"/></svg>`)),this.__renderInput({value:null!==(s=null==e?void 0:e.key)&&void 0!==s?s:"",label:this.t("option_name"),onChange:e=>{void 0===e?null==t||t():r({key:e,items:i})}}),m({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"cursor-default text-tertiary":!(this.disabled||this.readonly),"text-disabled cursor-default":this.disabled||this.readonly}),d(k||(k=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z" class="fill-current"/><path d="M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z" class="fill-current"/></svg>`)),p(this.readonly?i:[...i,null],((e,t)=>t),((t,o)=>a(A||(A=q` <div class="bg-base"> ${0} </div> `),this.__renderInput({value:null!=t?t:"",label:t?String(o+1):this.t("add_value"),onChange:s=>{const n=[...i];s?null===t?n.push(s):n[o]=s:n.splice(o,1),e&&r({key:e.key,items:n})}})))),this.readonly||0===Object.keys(this._value).length,this.t("delete"),m({"box-content flex items-center justify-center":!0,"w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!this.disabled,"cursor-default text-disabled":this.disabled,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!e}),this.disabled||this.readonly||!e,(()=>null==t?void 0:t()),d(V||(V=q`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-l" style="width: 1.25em; height: 1.25em"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)))}__renderInput(e){return a(R||(R=q` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> <input placeholder="${0}" class="${0}" .value="${0}" ?disabled="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} </label> `),e.label,m({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0}),e.value,this.disabled||this.readonly,(t=>{const r=t.currentTarget;"Backspace"!==t.key||r.value||e.onChange()}),(t=>{t.currentTarget.value||e.onChange()}),(t=>{const r=t.currentTarget;e.onChange(r.value)}),m({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!e.value,"sr-only":!e.value,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly}),this.t(e.label),this.disabled||this.readonly?"":a(S||(S=q` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}}customElements.define("foxy-internal-array-map-control",O);let T,H,L,I,M,B=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const r=this.nucleon,o=null!==(e=null==r?void 0:r.form.coupon_discount_details)&&void 0!==e?e:"",s=null!==(t=null==r?void 0:r.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",i=this.helperText,n=this.__renderRulesDescription(),l=this._errorMessage;return a(T||(T=B` <section> <div class="mb-s" ?hidden="${0}"> <p class="flex items-center justify-between space-x-m"> <span class="font-medium flex-1 text-l">${0}</span> <span class="min-w-0">${0}</span> </p> <p class="text-s text-secondary">${0}</p> </div> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),!this.label&&!i&&!n,this.label,this.__renderPreset(),i,{details:o,type:s,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,r=this.nucleon;null==r||r.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),n?a(H||(H=B`<p class="text-s text-secondary mt-s">${0}</p>`),n):"",!l||this.disabled||this.readonly?"":a(L||(L=B`<p class="mt-s text-s leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const r=this.nucleon,o=null!==(e=null==r?void 0:r.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",s=null!==(t=null==r?void 0:r.form.coupon_discount_details)&&void 0!==t?t:"";return s?this.t("discount_summary",{params:{details:s,type:o,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,t=null==e?void 0:e.form.coupon_discount_details,r=null==e?void 0:e.form.coupon_discount_type,s=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],i=s.find((e=>e.details===t&&e.type===r));return a(I||(I=B` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),m({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),i?this.t("discount_summary",{params:o(o({},i),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,r;const o=e.currentTarget,i=s[o.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(t=null==i?void 0:i.details)&&void 0!==t?t:"",coupon_discount_type:null!==(r=null==i?void 0:i.type)&&void 0!==r?r:"quantity_amount"})}),s.map((e=>a(M||(M=B` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===i,this.t("discount_summary",{params:o(o({},e),{},{ns:this.ns})})))),!i&&!!t&&!!r,this.t("custom_discount"))}});let Z,z,P=e=>e;const D=c(u(f,"coupon-form"));class G extends D{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.__customerAttributeRestrictionsOperators=[i.Not,i.In],this.__customerAttributeRestrictionsGetValue=()=>{var e;const o=t(null!==(e=this.form.customer_attribute_restrictions)&&void 0!==e?e:"").filter((e=>Array.isArray(e)||"string"==typeof e.name)).map((e=>{if(Array.isArray(e))return e.filter((({name:e})=>"string"==typeof e)).map((({name:e,operator:t,value:r})=>({path:e,operator:t,value:r})));return{operator:e.operator,value:e.value,path:e.name}}));return r(o,!0)},this.__customerAttributeRestrictionsSetValue=e=>{const o=t(e).map((e=>{if(Array.isArray(e))return e.map((({path:e,operator:t,value:r})=>({name:e,path:"attributes",operator:t,value:r})));return{operator:e.operator,value:e.value,path:"attributes",name:e.path}}));this.edit({customer_attribute_restrictions:r(o,!0)})},this.__customerSubscriptionRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.customer_subscription_restrictions)||void 0===e?void 0:e.split(",").map((e=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).map((e=>({value:e})));return null!=t?t:[]},this.__customerSubscriptionRestrictionsSetValue=e=>{this.edit({customer_subscription_restrictions:e.map((({value:e})=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"option_code",path:"code",type:n.String},{label:"option_number_of_uses_to_date",path:"number_of_uses_to_date",type:n.Number},{label:"option_date_created",path:"date_created",type:n.Date},{label:"option_date_modified",path:"date_modified",type:n.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__couponCodesActions[0].state="busy",e.__couponCodesActions=[...e.__couponCodesActions];try{await navigator.clipboard.writeText(t.code),e.__couponCodesActions[0].state="end"}catch(t){e.__couponCodesActions[0].state="error"}finally{e.__couponCodesActions=[...e.__couponCodesActions],setTimeout((()=>{e.__couponCodesActions[0].state="idle",e.__couponCodesActions=[...e.__couponCodesActions]}),1e3)}}}]}static get properties(){return o(o({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",({inclusive_tax_rate:e})=>!e||e>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:e})=>!e||e<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:e})=>!e||e>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:e})=>!!e||"rules:v8n_required",({coupon_discount_details:e})=>!e||e.length<=200||"rules:v8n_too_long",({item_option_restrictions:e})=>!e||JSON.stringify(e).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:e})=>!e||e.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:e})=>!e||e>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:e})=>!e||e.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:e})=>!e||e>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data?e.push("coupon-codes-stub","category-restrictions-stub","attributes-stub"):e.push("coupon-codes","category-restrictions","attributes"),new s(e.join(" ").trim())}get headerSubtitleOptions(){return o(o({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}renderHeaderActions(e){return a(Z||(Z=P` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:coupon_codes"].href],e._links["fx:coupon_codes"].href,[e._links["fx:coupon_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,o,s,i,n,l;let d;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),d=r.toString()}catch(e){d=void 0}return a(z||(z=P` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-summary-control infer="coupon-codes-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-array-map-control infer="item-option-restrictions"> </foxy-internal-array-map-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions" disable-zoom disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-summary-control infer="auto-apply"> <foxy-internal-switch-control infer="customer-auto-apply"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="category-restrictions-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </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="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-summary-control infer="uses"> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-customer" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-code" step="1" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="timeframe"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="taxes"> <foxy-internal-number-control layout="summary-item" infer="inclusive-tax-rate" min="0" max="1"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="options"> <foxy-internal-switch-control infer="multiple-codes-allowed"></foxy-internal-switch-control> <foxy-internal-switch-control infer="combinable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-category-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-line-item-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="is-taxable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="shared-codes-allowed"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="attributes-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),d,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],this.__customerAttributeRestrictionsOperators,this.__customerAttributeRestrictionsGetValue,this.__customerAttributeRestrictionsSetValue,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,h(null===(r=this.data)||void 0===r?void 0:r._links.self.href),h(null===(s=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===s?void 0:s._links["fx:item_categories"].href),h(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),h(null===(n=this.data)||void 0===n?void 0:n._links["fx:attributes"].href),super.renderBody(),h(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",G);export{G as CouponForm};
|
|
1
|
+
import"./shared-8f61408a.js";import"./shared-1492fa1c.js";import"./shared-4bafbc5f.js";import{I as e}from"./shared-9a454e09.js";import{p as t,s as r}from"./shared-4ffaa9b7.js";import{_ as o,B as s}from"./shared-8f9014ff.js";import{O as i,T as n}from"./shared-8874ec69.js";import{h as a,c as l,s as d}from"./shared-ba5c42c7.js";import"./shared-26b55da2.js";import{R as c,a as u}from"./shared-328aa161.js";import{c as m}from"./shared-4e709717.js";import{r as p}from"./shared-5fd5805c.js";import"./shared-591ee1bf.js";import"./shared-bc8a1435.js";import"./shared-d01853e2.js";import"./shared-a9a8eb7c.js";import"./shared-5078246e.js";import{I as f}from"./shared-084e1772.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import{i as h}from"./shared-53e42a77.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-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-53e476fd.js";import"./foxy-pagination.js";import"./shared-1301af85.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-5212ef4f.js";import"./shared-f9bb0924.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"./shared-63c32024.js";import"./shared-2061be9a.js";import"./shared-f0fa0a88.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-bab2ea2c.js";import"./shared-aa258319.js";import"./shared-0a7a4660.js";import"./shared-490dadf8.js";import"./shared-de4ec7bb.js";import"./shared-04277241.js";import"./shared-1fa1abbd.js";import"./foxy-swipe-actions.js";import"./foxy-admin-transaction-card.js";import"./shared-7a5d645f.js";let y,_,b,x,v=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.disableZoom=!1,this.disableOr=!1,this.operators=Object.values(i)}static get properties(){return o(o({},super.properties),{},{disableZoom:{type:Boolean,attribute:"disable-zoom"},disableOr:{type:Boolean,attribute:"disable-or"},operators:{type:Array}})}renderControl(){const{label:e,helperText:t,_errorMessage:r}=this,o=r&&!this.disabled&&!this.readonly;return a(y||(y=v` <section class="grid gap-s leading-xs"> <div ?hidden="${0}"> ${0} ${0} </div> <div class="bg-contrast-5 rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-query-builder infer="query-builder" style="--lumo-border-radius:var(--lumo-border-radius-s);--lumo-border-radius-l:var(--lumo-border-radius-s)" .operators="${0}" .value="${0}" ?disable-zoom="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> </div> ${0} </section> `),!e&&!t,e?a(_||(_=v`<p class="text-l font-medium">${0}</p>`),e):"",t?a(b||(b=v`<p class="text-s text-secondary">${0}</p>`),t):"",this.operators,this._value,this.disableZoom,this.disableOr,(e=>{var t;const r=e.currentTarget;this._value=null!==(t=r.value)&&void 0!==t?t:""}),o?a(x||(x=v`<p class="text-s text-error">${0}</p>`),r):"")}});let g,j,$,w,C,k,A,V,R,S,q=e=>e;class O extends(c(e)){static get styles(){return[super.styles,l(g||(g=q`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`))]}renderControl(){const e=a(j||(j=q` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-20"> <foxy-i18n infer="" key="or"></foxy-i18n> </div> <div class="flex-1 border-t border-contrast-10"></div> <div class="w-m ml-s flex-shrink-0"></div> </div> `));return a($||($=q` <div class="mb-s" ?hidden="${0}"> <p class="font-medium text-body text-l" ?hidden="${0}">${0}</p> <p class="text-s text-secondary" ?hidden="${0}">${0}</p> </div> <div class="rounded bg-contrast-5" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <p class="text-s text-error mt-s" ?hidden="${0}"> ${0} </p> `),!this.label&&!this.helperText,!this.label,this.label,!this.helperText,this.helperText,p([...Object.entries(this._value||{}),null],((e,t)=>String(t)),((t,r)=>null===t?[r>0?e:"",this.__renderRule({onChange:({key:e,items:t})=>{var r;this._value=o(o({},this._value),{},{[e]:[...null!==(r=this._value[e])&&void 0!==r?r:[],...t]})}})]:[r>0?e:"",this.__renderRule({rule:{key:t[0],items:t[1]},onChange:e=>{var r,o;const s={},i=Object.keys(this._value);for(let n=0;n<i.length;n++){const a=i[n];if(a===t[0])if(e.key===a)s[a]=e.items;else{const t=null!==(r=this._value[e.key])&&void 0!==r?r:[];n>i.indexOf(e.key)?s[e.key]=[...t,...e.items]:(s[e.key]=[...e.items,...t],i.splice(i.indexOf(e.key),1))}else s[a]=null!==(o=this._value[a])&&void 0!==o?o:[]}this._value=s},onDelete:()=>{const e=o({},this._value);delete e[t[0]],this._value=e}})])),!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}__renderRule({rule:e,onDelete:t,onChange:r}){var o,s;const i=null!==(o=null==e?void 0:e.items)&&void 0!==o?o:[];return a(w||(w=q` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="flex-1 bg-base rounded-s overflow-hidden border border-contrast-10"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base"> <div aria-hidden="true" class="${0}"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base"> <div class="${0}"> <div aria-hidden="true"> ${0} </div> </div> </div> <div class="bg-base"> <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> </div> </div> </div> </div> <div class="flex -mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center border-t border-b border-transparent divide-y divide-transparent" ?hidden="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> </div> `),this.t("rule"),m({"text-tertiary":!this.readonly&&!this.disabled,"text-disabled":this.readonly||this.disabled,"w-m h-m":!0}),d(C||(C=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z" class="fill-current"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z" class="fill-current"/></svg>`)),this.__renderInput({value:null!==(s=null==e?void 0:e.key)&&void 0!==s?s:"",label:this.t("option_name"),onChange:e=>{void 0===e?null==t||t():r({key:e,items:i})}}),m({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"cursor-default text-tertiary":!(this.disabled||this.readonly),"text-disabled cursor-default":this.disabled||this.readonly}),d(k||(k=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z" class="fill-current"/><path d="M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z" class="fill-current"/></svg>`)),p(this.readonly?i:[...i,null],((e,t)=>t),((t,o)=>a(A||(A=q` <div class="bg-base"> ${0} </div> `),this.__renderInput({value:null!=t?t:"",label:t?String(o+1):this.t("add_value"),onChange:s=>{const n=[...i];s?null===t?n.push(s):n[o]=s:n.splice(o,1),e&&r({key:e.key,items:n})}})))),this.readonly||0===Object.keys(this._value).length,this.t("delete"),m({"box-content flex items-center justify-center":!0,"w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!this.disabled,"cursor-default text-disabled":this.disabled,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!e}),this.disabled||this.readonly||!e,(()=>null==t?void 0:t()),d(V||(V=q`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-l" style="width: 1.25em; height: 1.25em"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)))}__renderInput(e){return a(R||(R=q` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> <input placeholder="${0}" class="${0}" .value="${0}" ?disabled="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} </label> `),e.label,m({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0}),e.value,this.disabled||this.readonly,(t=>{const r=t.currentTarget;"Backspace"!==t.key||r.value||e.onChange()}),(t=>{t.currentTarget.value||e.onChange()}),(t=>{const r=t.currentTarget;e.onChange(r.value)}),m({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!e.value,"sr-only":!e.value,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly}),this.t(e.label),this.disabled||this.readonly?"":a(S||(S=q` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}}customElements.define("foxy-internal-array-map-control",O);let T,H,L,I,M,B=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const r=this.nucleon,o=null!==(e=null==r?void 0:r.form.coupon_discount_details)&&void 0!==e?e:"",s=null!==(t=null==r?void 0:r.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",i=this.helperText,n=this.__renderRulesDescription(),l=this._errorMessage;return a(T||(T=B` <section> <div class="mb-s" ?hidden="${0}"> <p class="flex items-center justify-between space-x-m"> <span class="font-medium flex-1 text-l">${0}</span> <span class="min-w-0">${0}</span> </p> <p class="text-s text-secondary">${0}</p> </div> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),!this.label&&!i&&!n,this.label,this.__renderPreset(),i,{details:o,type:s,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,r=this.nucleon;null==r||r.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),n?a(H||(H=B`<p class="text-s text-secondary mt-s">${0}</p>`),n):"",!l||this.disabled||this.readonly?"":a(L||(L=B`<p class="mt-s text-s leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const r=this.nucleon,o=null!==(e=null==r?void 0:r.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",s=null!==(t=null==r?void 0:r.form.coupon_discount_details)&&void 0!==t?t:"";return s?this.t("discount_summary",{params:{details:s,type:o,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,t=null==e?void 0:e.form.coupon_discount_details,r=null==e?void 0:e.form.coupon_discount_type,s=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],i=s.find((e=>e.details===t&&e.type===r));return a(I||(I=B` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),m({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),i?this.t("discount_summary",{params:o(o({},i),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,r;const o=e.currentTarget,i=s[o.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(t=null==i?void 0:i.details)&&void 0!==t?t:"",coupon_discount_type:null!==(r=null==i?void 0:i.type)&&void 0!==r?r:"quantity_amount"})}),s.map((e=>a(M||(M=B` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===i,this.t("discount_summary",{params:o(o({},e),{},{ns:this.ns})})))),!i&&!!t&&!!r,this.t("custom_discount"))}});let Z,z,P=e=>e;const D=c(u(f,"coupon-form"));class G extends D{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.__customerAttributeRestrictionsOperators=[i.Not,i.In],this.__customerAttributeRestrictionsGetValue=()=>{var e;const o=t(null!==(e=this.form.customer_attribute_restrictions)&&void 0!==e?e:"").filter((e=>Array.isArray(e)||"string"==typeof e.name)).map((e=>{if(Array.isArray(e))return e.filter((({name:e})=>"string"==typeof e)).map((({name:e,operator:t,value:r})=>({path:e,operator:t,value:r})));return{operator:e.operator,value:e.value,path:e.name}}));return r(o,!0)},this.__customerAttributeRestrictionsSetValue=e=>{const o=t(e).map((e=>{if(Array.isArray(e))return e.map((({path:e,operator:t,value:r})=>({name:e,path:"attributes",operator:t,value:r})));return{operator:e.operator,value:e.value,path:"attributes",name:e.path}}));this.edit({customer_attribute_restrictions:r(o,!0)})},this.__customerSubscriptionRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.customer_subscription_restrictions)||void 0===e?void 0:e.split(",").map((e=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).map((e=>({value:e})));return null!=t?t:[]},this.__customerSubscriptionRestrictionsSetValue=e=>{this.edit({customer_subscription_restrictions:e.map((({value:e})=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"option_code",path:"code",type:n.String},{label:"option_number_of_uses_to_date",path:"number_of_uses_to_date",type:n.Number},{label:"option_date_created",path:"date_created",type:n.Date},{label:"option_date_modified",path:"date_modified",type:n.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__couponCodesActions[0].state="busy",e.__couponCodesActions=[...e.__couponCodesActions];try{await navigator.clipboard.writeText(t.code),e.__couponCodesActions[0].state="end"}catch(t){e.__couponCodesActions[0].state="error"}finally{e.__couponCodesActions=[...e.__couponCodesActions],setTimeout((()=>{e.__couponCodesActions[0].state="idle",e.__couponCodesActions=[...e.__couponCodesActions]}),1e3)}}}]}static get properties(){return o(o({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",({inclusive_tax_rate:e})=>!e||e>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:e})=>!e||e<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:e})=>!e||e>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:e})=>!!e||"rules:v8n_required",({coupon_discount_details:e})=>!e||e.length<=200||"rules:v8n_too_long",({item_option_restrictions:e})=>!e||JSON.stringify(e).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:e})=>!e||e.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:e})=>!e||e>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:e})=>!e||e.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:e})=>!e||e>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data?e.push("coupon-codes-stub","category-restrictions-stub","attributes-stub"):e.push("coupon-codes","category-restrictions","attributes"),new s(e.join(" ").trim())}get headerSubtitleOptions(){return o(o({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}renderHeaderActions(e){return a(Z||(Z=P` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:coupon_codes"].href],e._links["fx:coupon_codes"].href,[e._links["fx:coupon_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,o,s,i,n,l;let d;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),d=r.toString()}catch(e){d=void 0}return a(z||(z=P` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-summary-control infer="coupon-codes-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-array-map-control infer="item-option-restrictions"> </foxy-internal-array-map-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions" disable-zoom disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-summary-control infer="auto-apply"> <foxy-internal-switch-control infer="customer-auto-apply"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="category-restrictions-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </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="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-summary-control infer="uses"> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-customer" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-code" step="1" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="timeframe"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="taxes"> <foxy-internal-number-control layout="summary-item" infer="inclusive-tax-rate" min="0" max="1"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="options"> <foxy-internal-switch-control infer="multiple-codes-allowed"></foxy-internal-switch-control> <foxy-internal-switch-control infer="combinable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-category-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-line-item-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="is-taxable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="shared-codes-allowed"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="attributes-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),d,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],this.__customerAttributeRestrictionsOperators,this.__customerAttributeRestrictionsGetValue,this.__customerAttributeRestrictionsSetValue,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,h(null===(r=this.data)||void 0===r?void 0:r._links.self.href),h(null===(s=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===s?void 0:s._links["fx:item_categories"].href),h(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),h(null===(n=this.data)||void 0===n?void 0:n._links["fx:attributes"].href),super.renderBody(),h(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",G);export{G as CouponForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-8bf38c47.js";import"./shared-0a7a4660.js";import{I as e}from"./shared-
|
|
1
|
+
import"./shared-8bf38c47.js";import"./shared-0a7a4660.js";import{I as e}from"./shared-084e1772.js";import{a as r}from"./shared-328aa161.js";import{h as s}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"./shared-097487d0.js";import"./shared-8dd6e5cc.js";import"./shared-9a454e09.js";import"./shared-5212ef4f.js";import"./shared-26b55da2.js";import"./shared-8f9014ff.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.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-4cc1fb20.js";import"./shared-67aeac0f.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-18e301f2.js";import"./shared-6880e1f6.js";import"./shared-b0453b08.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let i,t=e=>e;const o=r(e,"custom-field-form");class a extends o{constructor(){super(...arguments),this.__visibilityGetValue=()=>this.form.is_hidden?["hidden"]:[],this.__visibilitySetValue=e=>{this.edit({is_hidden:e.includes("hidden")})},this.__visibilityOptions=[{label:"option_hidden",value:"hidden"}]}static get v8n(){return[({value:e})=>e&&e.length>0||"value:v8n_required",({value:e})=>!e||e.length<=700||"value:v8n_too_long",({name:e})=>e&&e.length>0||"name:v8n_required",({name:e})=>!e||e.length<=100||"name:v8n_too_long"]}renderBody(){return s(i||(i=t` ${0} <foxy-internal-source-control infer="name"></foxy-internal-source-control> <foxy-internal-source-control infer="value"></foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="visibility" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.renderHeader(),this.__visibilityGetValue,this.__visibilitySetValue,this.__visibilityOptions,super.renderBody())}}customElements.define("foxy-custom-field-form",a);export{a as CustomFieldForm};
|