@foxy.io/elements 1.47.0-beta.1 → 1.47.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.
Files changed (44) hide show
  1. package/dist/cdn/foxy-native-integration-form.js +1 -1
  2. package/dist/cdn/foxy-store-form.js +1 -1
  3. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  4. package/dist/cdn/foxy-webhook-card.js +1 -1
  5. package/dist/cdn/foxy-webhook-form.js +1 -1
  6. package/dist/cdn/shared-589d66fe.js +1 -0
  7. package/dist/cdn/translations/admin-subscription-form/en.json +16 -16
  8. package/dist/cdn/translations/api-browser/en.json +1 -1
  9. package/dist/cdn/translations/cart-form/en.json +13 -13
  10. package/dist/cdn/translations/coupon-code-form/en.json +1 -1
  11. package/dist/cdn/translations/coupon-form/en.json +4 -4
  12. package/dist/cdn/translations/customer/en.json +4 -4
  13. package/dist/cdn/translations/customer-portal/en.json +2 -2
  14. package/dist/cdn/translations/customer-portal-settings-form/en.json +2 -2
  15. package/dist/cdn/translations/experimental-add-to-cart-builder/en.json +4 -4
  16. package/dist/cdn/translations/gift-card-code-form/en.json +2 -2
  17. package/dist/cdn/translations/gift-card-form/en.json +5 -5
  18. package/dist/cdn/translations/item-category-form/en.json +7 -7
  19. package/dist/cdn/translations/item-form/en.json +5 -5
  20. package/dist/cdn/translations/native-integration-form/en.json +2 -2
  21. package/dist/cdn/translations/pagination/en.json +1 -1
  22. package/dist/cdn/translations/payment-method-card/en.json +1 -1
  23. package/dist/cdn/translations/store-shipping-method-form/en.json +4 -4
  24. package/dist/cdn/translations/subscription-form/en.json +3 -3
  25. package/dist/cdn/translations/tax-form/en.json +2 -2
  26. package/dist/cdn/translations/template-config-form/en.json +21 -21
  27. package/dist/cdn/translations/template-set-form/en.json +1 -1
  28. package/dist/cdn/translations/transaction/en.json +14 -14
  29. package/dist/cdn/translations/update-payment-method-form/en.json +1 -1
  30. package/dist/cdn/translations/webhook-form/en.json +5 -3
  31. package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js +5 -12
  32. package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js.map +1 -1
  33. package/dist/elements/public/StoreForm/StoreForm.js +2 -10
  34. package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
  35. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js +2 -10
  36. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js.map +1 -1
  37. package/dist/elements/public/WebhookCard/WebhookCard.js +8 -5
  38. package/dist/elements/public/WebhookCard/WebhookCard.js.map +1 -1
  39. package/dist/elements/public/WebhookForm/WebhookForm.js +1 -0
  40. package/dist/elements/public/WebhookForm/WebhookForm.js.map +1 -1
  41. package/dist/utils/is-http-url.d.ts +1 -0
  42. package/dist/utils/is-http-url.js +19 -0
  43. package/dist/utils/is-http-url.js.map +1 -0
  44. package/package.json +1 -1
@@ -1 +1 @@
1
- import"./shared-52367e6b.js";import"./shared-5b8b7c5f.js";import"./shared-adbdfff2.js";import"./shared-d640517d.js";import"./shared-dedec962.js";import"./shared-56226850.js";import{I as e}from"./shared-c9061102.js";import"./foxy-nucleon-element.js";import"./shared-b06c67fa.js";import{I as o}from"./shared-ecbd0750.js";import"./foxy-item-category-card.js";import{_ as r,m as t,B as n}from"./shared-8f9014ff.js";import{g as a}from"./shared-bab2ea2c.js";import{i}from"./shared-53e42a77.js";import{h as l,s}from"./shared-ba5c42c7.js";import{c}from"./shared-4e709717.js";import{a as p}from"./shared-47f3f5f5.js";import"./shared-34a87829.js";import"./shared-5a469962.js";import"./shared-66278c21.js";import"./shared-6bf89411.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-bf8d95b9.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-6f071960.js";import"./shared-27c16d99.js";import"./shared-b3fe8c63.js";import"./shared-e55c8dc4.js";import"./shared-0e25ac65.js";import"./shared-360196ad.js";import"./shared-3d353eb8.js";import"./shared-930e68b7.js";import"./shared-fb859ece.js";import"./shared-4194ffe7.js";import"./shared-32b2d003.js";import"./shared-1c985317.js";import"./shared-58add5b4.js";import"./shared-69c98b7b.js";import"./shared-41c9c53f.js";import"./foxy-copy-to-clipboard.js";import"./shared-b2cbe727.js";import"./foxy-spinner.js";import"./shared-fd8b44e3.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-65112811.js";import"./shared-9e0b104a.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-6e92b5fc.js";import"./shared-be2ce0e6.js";import"./shared-5212ef4f.js";import"./shared-a7150987.js";import"./shared-542c8ef1.js";let u,f,d,m=e=>e;customElements.define("foxy-internal-native-integration-form-code-map-control",class extends o{constructor(){super(...arguments),this.itemCategoryBase=null,this.itemCategories=null,this.__newMappingGetValue=()=>{},this.__newMappingSetValue=e=>{const o=a(e);if("string"==typeof o||"number"==typeof o)if(this._value&&o in this._value){const e=this.renderRoot.querySelector(`#category-${o}`);null==e||e.animate([{background:""},{background:"var(--lumo-primary-color-50pct)"},{background:""}],{duration:2e3,easing:"ease"})}else this._value=r(r({},this._value),{},{[o]:""})}}static get properties(){return r(r({},super.properties),{},{itemCategoryBase:{attribute:"item-category-base"},itemCategories:{attribute:"item-categories"}})}renderControl(){var e,o;return l(u||(u=m` <foxy-internal-summary-control infer="existing-mappings" unsafe-helper-text> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control helper-text="" label="" infer="new-mapping" class="mt-s"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="" item="foxy-item-category-card" .getValue="${0}" .setValue="${0}"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> `),Object.entries(null!==(e=this._value)&&void 0!==e?e:{}).map((([e,o])=>{var t,n,a,p,u;let y;try{y=new URL(e,null!==(t=this.itemCategoryBase)&&void 0!==t?t:void 0).toString()}catch(e){y=void 0}const _=this.renderRoot.querySelector(`#category${e}Loader`),v=(null==_?void 0:_.in("fail"))?this.t("existing-mappings.status_fail"):(null==_?void 0:_.in("busy"))?this.t("existing-mappings.status_busy"):null;return l(f||(f=m` <div class="flex items-center gap-xs" id="category-${0}"> <foxy-nucleon parent="${0}" class="hidden" infer="" href="${0}" id="category${0}Loader" @update="${0}"> </foxy-nucleon> <foxy-internal-text-control helper-text="" layout="summary-item" label="${0}" infer="" class="flex-1" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> `),e,i(null!==(n=this.itemCategories)&&void 0!==n?n:void 0),i(y),e,(()=>this.requestUpdate()),null!==(u=null!==(p=null===(a=null==_?void 0:_.data)||void 0===a?void 0:a.name)&&void 0!==p?p:v)&&void 0!==u?u:e,(()=>o),(o=>this._value=r(r({},this._value),{},{[e]:o})),this.t("delete"),c({"flex-shrink-0 rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly||!!o,(()=>{const o=r({},this._value);delete o[e],this._value=o}),s(d||(d=m`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: translate(0.1em, 0.1em) scale(1.3);"><path fill-rule="evenodd" d="M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z" clip-rule="evenodd" /> </svg>`)))})),i(null!==(o=this.itemCategories)&&void 0!==o?o:void 0),this.__newMappingGetValue,this.__newMappingSetValue)}get _value(){return super._value}set _value(e){super._value=e}});const y=JSON.stringify({service:"legacy_xml",version:1,events:["transaction/created"],title:"",url:""}),_=JSON.stringify({encryption_key:"",service:"json",version:1,events:[],title:"",url:""}),v=JSON.stringify({part_number_product_option:"",product_order_priority:"",calling_system_number:"",external_company_id:"",audit_settings:"never",company_role:"B",service_url:"",host_system:"",from_city:""}),h=JSON.stringify({url:""}),x=JSON.stringify({merchantID:""}),g=JSON.stringify({category_to_product_tax_code_mappings:{},enable_colorado_delivery_fee:!1,address_validation_countries:[],use_address_validation:!1,create_invoice:!1,company_code:"",service_url:"",use_ava_tax:!1,key:"",id:""}),b=JSON.stringify({inventory_field_name:"",inventory_field_id:"",collection_name:"",sku_field_name:"",collection_id:"",sku_field_id:"",site_name:"",service:"webflow",version:1,site_id:"",events:["transaction/created"],auth:""}),j=JSON.stringify({service:"zapier",events:[],url:""}),w=JSON.stringify({category_to_product_tax_code_mappings:{},create_invoice:!1,api_token:""});let $,k,C,S,O,q,V,J,B,A,N,L,P,z,G,M=e=>e;const W=p(e,"native-integration-form");class R extends W{constructor(){super(...arguments),this.itemCategoryBase=null,this.store=null,this.__createConfigGetterFor=t((e=>()=>{var o;return null===(o=this.__config)||void 0===o?void 0:o[e]})),this.__createConfigSetterFor=t((e=>o=>this.__config={[e]:o})),this.__providerGetValue=()=>this.form.provider,this.__providerSetValue=e=>{this.edit({provider:e,config:"{}"}),this.__config={}},this.__templateProviderOptions=[{value:"avalara",label:"option_avalara"},{value:"onesource",label:"option_onesource"},{value:"taxjar",label:"option_taxjar"},{value:"custom_tax",label:"option_custom_tax"}],this.__avalaraAddressValidationCountriesOptions=[{value:"US"},{value:"CA"}],this.__onesourceCompanyRoleOptions=[{value:"B",label:"option_buyer"},{value:"M",label:"option_middleman"},{value:"S",label:"option_seller"}],this.__onesourceProductOrderPriorityGetValue=()=>{var e,o;return(null!==(o=null===(e=this.__config)||void 0===e?void 0:e.product_order_priority.split(","))&&void 0!==o?o:[]).filter((e=>!!e)).map((e=>({value:e})))},this.__onesourceProductOrderPrioritySetValue=e=>{this.__config={product_order_priority:e.map((e=>e.value)).join(",")}},this.__onesourceAuditSettingsOptions=[{value:"capture_only",label:"option_capture_only"},{value:"auth_and_capture",label:"option_auth_and_capture"},{value:"never",label:"option_never"}],this.__webhookServiceOptions=[{value:"json",label:"option_json"},{value:"legacy_xml",label:"option_legacy_xml"}],this.__webhookJsonEventsOptions=[{value:"transaction/created",label:"option_transaction_created"},{value:"subscription/cancelled",label:"option_subscription_cancelled"}]}static get properties(){return r(r({},super.properties),{},{itemCategoryBase:{attribute:"item-category-base"},store:{}})}static get v8n(){const e=t(JSON.parse),o=t((e=>{try{return Boolean(new URL(e))}catch(e){return!1}}));return[({provider:r="avalara",config:t="{}"})=>{const n=e(t).service_url,a=n?o(n)?null:"v8n_invalid":"v8n_required";return"avalara"!==r||!a||`avalara-service-url:${a}`},({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).id||"avalara-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).key||"avalara-key:v8n_required",({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).company_code||"avalara-company-code:v8n_required",({provider:o="avalara",config:r="{}"})=>"taxjar"!==o||!!e(r).api_token||"taxjar-api-token:v8n_required",({provider:r="avalara",config:t="{}"})=>{const n=e(t).service_url,a=n?o(n)?null:"v8n_invalid":"v8n_required";return"onesource"!==r||!a||`onesource-service-url:${a}`},({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).external_company_id||"onesource-external-company-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).calling_system_number||"onesource-calling-system-number:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).from_city||"onesource-from-city:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).host_system||"onesource-host-system:v8n_required",({provider:o="avalara",config:r="{}"})=>{const{service:t,title:n}=e(r);return"webhook"!==o||"json"!==t||!!n||"webhook-json-title:v8n_required"},({provider:o="avalara",config:r="{}"})=>{const{service:t,encryption_key:n}=e(r);return"webhook"!==o||"json"!==t||!!n||"webhook-json-encryption-key:v8n_required"},({provider:r="avalara",config:t="{}"})=>{const{service:n,url:a}=e(t),i=a?o(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==r||"json"!==n||!i||`webhook-json-url:${i}`},({provider:o="avalara",config:r="{}"})=>{const{service:t,title:n}=e(r);return"webhook"!==o||"legacy_xml"!==t||!!n||"webhook-legacy-xml-title:v8n_required"},({provider:r="avalara",config:t="{}"})=>{const{service:n,url:a}=e(t),i=a?o(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==r||"legacy_xml"!==n||!i||`webhook-legacy-xml-url:${i}`},({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).site_id||"webflow-site-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).site_name||"webflow-site-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).collection_id||"webflow-collection-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).collection_name||"webflow-collection-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).sku_field_id||"webflow-sku-field-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).sku_field_name||"webflow-sku-field-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).inventory_field_id||"webflow-inventory-field-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).inventory_field_name||"webflow-inventory-field-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).auth||"webflow-auth:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("apple-pay-group-one","zapier-group-one","provider-group-one"),new n(e.join(" ").trim())}get headerTitleOptions(){return{context:this.data?`existing_${this.data.provider}`:"new",id:this.headerCopyIdValue}}renderBody(){var e;const o=this.form.provider;return l($||($=M` ${0} ${0} ${0} ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.href?"":l(k||(k=M` <foxy-internal-summary-control infer="provider-group-one"> <foxy-internal-select-control layout="summary-item" infer="provider" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> `),this.__providerGetValue,this.__providerSetValue,this.__templateProviderOptions),"avalara"===o?this.__renderAvalaraConfig():"taxjar"===o?this.__renderTaxJarConfig():"onesource"===o?this.__renderOneSourceConfig():"webflow"===o?this.__renderWebflowConfig():"zapier"===o?this.__renderZapierConfig():"webhook"===o?this.__renderWebhookConfig():"apple_pay"===o?this.__renderApplePayConfig():"custom_tax"===o?this.__renderCustomTaxConfig():"",super.renderBody(),i(null!==(e=this.store)&&void 0!==e?e:void 0),(()=>this.requestUpdate()))}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let o;try{o=(await e.json())._embedded["fx:errors"][0].message}catch(o){throw e}throw o.includes("has already been configured")?["error:already_configured"]:e}}get __config(){try{return JSON.parse(this.form.config)}catch(e){return null}}set __config(e){var o;const t=this.__config,n=null!==(o=this.form.provider)&&void 0!==o?o:"avalara",a="avalara"===n?g:"taxjar"===n?w:"onesource"===n?v:"webflow"===n?b:"zapier"===n?j:"webhook"===n?"legacy_xml"===(null==t?void 0:t.service)?y:_:void 0,i=a?JSON.parse(a):{},l=JSON.stringify(r(r(r({},i),t),e));this.edit({provider:n,config:l})}__renderAvalaraConfig(){var e,o,r,t,n,a;const s=null===(o=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===o?void 0:o.is_active,c=null===(t=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===t?void 0:t._links["fx:item_categories"].href,p="boolean"==typeof s?this.t("avalara-group-one.avalara-service-url.placeholder_"+(s?"active":"inactive")):void 0;return l(C||(C=M` <foxy-internal-summary-control infer="avalara-group-one"> <foxy-internal-text-control json-template="${0}" placeholder="${0}" json-path="service_url" property="config" layout="summary-item" infer="avalara-service-url"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="id" property="config" layout="summary-item" infer="avalara-id"> </foxy-internal-text-control> <foxy-internal-password-control json-template="${0}" json-path="key" property="config" layout="summary-item" infer="avalara-key"> </foxy-internal-password-control> <foxy-internal-text-control json-template="${0}" json-path="company_code" property="config" layout="summary-item" infer="avalara-company-code"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="avalara-group-two"> <foxy-internal-switch-control json-template="${0}" json-path="use_ava_tax" property="config" infer="avalara-use-ava-tax"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" json-path="use_address_validation" property="config" infer="avalara-use-address-validation"> </foxy-internal-switch-control> ${0} <foxy-internal-switch-control json-template="${0}" json-path="create_invoice" property="config" infer="avalara-create-invoice"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" json-path="enable_colorado_delivery_fee" property="config" infer="avalara-enable-colorado-delivery-fee"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-native-integration-form-code-map-control item-category-base="${0}" item-categories="${0}" json-template="${0}" json-path="category_to_product_tax_code_mappings" property="config" layout="summary-item" infer="avalara-category-to-product-tax-code-mappings"> </foxy-internal-native-integration-form-code-map-control> `),g,i(p),g,g,g,g,g,(null===(n=this.__config)||void 0===n?void 0:n.use_address_validation)?l(S||(S=M` <foxy-internal-editable-list-control json-template="${0}" json-path="address_validation_countries" property="config" layout="summary-item" infer="avalara-address-validation-countries" .options="${0}"> </foxy-internal-editable-list-control> `),g,this.__avalaraAddressValidationCountriesOptions):"",g,g,i(null!==(a=this.itemCategoryBase)&&void 0!==a?a:void 0),i(c),g)}__renderTaxJarConfig(){var e,o,r;const t=null===(o=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===o?void 0:o._links["fx:item_categories"].href;return l(O||(O=M` <foxy-internal-summary-control infer="taxjar-group-one"> <foxy-internal-password-control json-template="${0}" json-path="api_token" property="config" layout="summary-item" infer="taxjar-api-token"> </foxy-internal-password-control> <foxy-internal-switch-control json-template="${0}" json-path="create_invoice" property="config" infer="taxjar-create-invoice"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-native-integration-form-code-map-control item-category-base="${0}" item-categories="${0}" json-template="${0}" json-path="category_to_product_tax_code_mappings" property="config" infer="taxjar-category-to-product-tax-code-mappings"> </foxy-internal-native-integration-form-code-map-control> `),w,w,i(null!==(r=this.itemCategoryBase)&&void 0!==r?r:void 0),i(t),w)}__renderOneSourceConfig(){return l(q||(q=M` <foxy-internal-summary-control infer="onesource-group-one"> <foxy-internal-text-control json-template="${0}" json-path="service_url" property="config" layout="summary-item" infer="onesource-service-url"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="external_company_id" property="config" layout="summary-item" infer="onesource-external-company-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="from_city" property="config" layout="summary-item" infer="onesource-from-city"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-two"> <foxy-internal-text-control json-template="${0}" json-path="calling_system_number" property="config" layout="summary-item" infer="onesource-calling-system-number"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="host_system" property="config" layout="summary-item" infer="onesource-host-system"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-three"> <foxy-internal-select-control json-template="${0}" json-path="audit_settings" property="config" layout="summary-item" infer="onesource-audit-settings" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control json-template="${0}" json-path="company_role" property="config" layout="summary-item" infer="onesource-company-role" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-four"> <foxy-internal-text-control json-template="${0}" json-path="part_number_product_option" property="config" layout="summary-item" infer="onesource-part-number-product-option" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-five"> <foxy-internal-editable-list-control layout="summary-item" infer="onesource-product-order-priority" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> `),v,v,v,v,v,v,this.__onesourceAuditSettingsOptions,v,this.__onesourceCompanyRoleOptions,v,this.__createConfigGetterFor("part_number_product_option"),this.__createConfigSetterFor("part_number_product_option"),this.__onesourceProductOrderPriorityGetValue,this.__onesourceProductOrderPrioritySetValue)}__renderWebhookConfig(){var e,o;return l(V||(V=M` <div class="flex items-start border border-error rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="webhook-warning" key="warning_text"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-error transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> <foxy-i18n infer="webhook-warning" key="link_text"></foxy-i18n> </a> </p> </div> ${0} `),s(J||(J=M`<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>`)),"json"===(null===(e=this.__config)||void 0===e?void 0:e.service)?this.__renderWebhookJsonConfig():"legacy_xml"===(null===(o=this.__config)||void 0===o?void 0:o.service)?this.__renderWebhookLegacyXmlConfig():"")}__renderWebhookJsonConfig(){return l(B||(B=M` <foxy-internal-summary-control infer="webhook-json-group-one"> <foxy-internal-text-control json-template="${0}" json-path="title" property="config" layout="summary-item" infer="webhook-json-title"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="webhook-json-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="service" property="config" layout="summary-item" infer="webhook-service" .options="${0}"> </foxy-internal-select-control> <foxy-internal-password-control json-template="${0}" json-path="encryption_key" property="config" layout="summary-item" infer="webhook-json-encryption-key"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webhook-json-group-two"> ${0} </foxy-internal-summary-control> `),_,_,_,this.__webhookServiceOptions,_,this.__webhookJsonEventsOptions.map((e=>l(A||(A=M` <foxy-internal-switch-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),`webhook-json-events-${e.value.replace(/\//g,"-")}`,(()=>{var o,r;return null===(r=null===(o=this.__config)||void 0===o?void 0:o.events)||void 0===r?void 0:r.includes(e.value)}),(o=>{var r,t;const n=null!==(t=null===(r=this.__config)||void 0===r?void 0:r.events)&&void 0!==t?t:[];this.__config={events:o?[...n,e.value]:n.filter((o=>o!==e.value))}})))))}__renderWebhookLegacyXmlConfig(){return l(N||(N=M` <foxy-internal-summary-control infer="webhook-legacy-xml-group-one"> <foxy-internal-text-control json-template="${0}" json-path="title" property="config" layout="summary-item" infer="webhook-legacy-xml-title"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="webhook-legacy-xml-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="service" property="config" layout="summary-item" infer="webhook-service" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> `),y,y,y,this.__webhookServiceOptions)}__renderWebflowConfig(){return l(L||(L=M` <foxy-internal-summary-control infer="webflow-group-one"> <foxy-internal-text-control json-template="${0}" json-path="site_id" property="config" layout="summary-item" infer="webflow-site-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="site_name" property="config" layout="summary-item" infer="webflow-site-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-two"> <foxy-internal-text-control json-template="${0}" json-path="collection_id" property="config" layout="summary-item" infer="webflow-collection-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="collection_name" property="config" layout="summary-item" infer="webflow-collection-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-three"> <foxy-internal-text-control json-template="${0}" json-path="sku_field_id" property="config" layout="summary-item" infer="webflow-sku-field-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="sku_field_name" property="config" layout="summary-item" infer="webflow-sku-field-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-four"> <foxy-internal-text-control json-template="${0}" json-path="inventory_field_id" property="config" layout="summary-item" infer="webflow-inventory-field-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="inventory_field_name" property="config" layout="summary-item" infer="webflow-inventory-field-name"> </foxy-internal-text-control> </foxy-internal-summary-control> `),b,b,b,b,b,b,b,b)}__renderZapierConfig(){return l(P||(P=M` <foxy-internal-summary-control infer="zapier-group-one"> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="zapier-url"> </foxy-internal-text-control> <foxy-internal-editable-list-control json-template="${0}" json-path="events" property="config" layout="summary-item" infer="zapier-events" simple-value> </foxy-internal-editable-list-control> <p class="text-secondary leading-xs"> <foxy-i18n infer="zapier-warning" key="warning_text"></foxy-i18n> </p> </foxy-internal-summary-control> `),j,j)}__renderApplePayConfig(){return l(z||(z=M` <foxy-internal-summary-control infer="apple-pay-group-one"> <foxy-internal-text-control json-template="${0}" json-path="merchantID" property="config" layout="summary-item" infer="apple-pay-merchant-id"> </foxy-internal-text-control> <p class="text-secondary leading-xs"> <foxy-i18n infer="apple-pay-warning" key="warning_text"></foxy-i18n> </p> </foxy-internal-summary-control> `),x)}__renderCustomTaxConfig(){return l(G||(G=M` <foxy-internal-summary-control infer="custom-tax-group-one"> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="custom-tax-url"> </foxy-internal-text-control> </foxy-internal-summary-control> `),h)}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-native-integration-form",R);export{R as NativeIntegrationForm};
1
+ import"./shared-52367e6b.js";import"./shared-5b8b7c5f.js";import"./shared-adbdfff2.js";import"./shared-d640517d.js";import"./shared-dedec962.js";import"./shared-56226850.js";import{I as e}from"./shared-c9061102.js";import"./foxy-nucleon-element.js";import"./shared-b06c67fa.js";import{I as o}from"./shared-ecbd0750.js";import"./foxy-item-category-card.js";import{_ as r,m as t,B as n}from"./shared-8f9014ff.js";import{g as a}from"./shared-bab2ea2c.js";import{i}from"./shared-53e42a77.js";import{h as l,s}from"./shared-ba5c42c7.js";import{c}from"./shared-4e709717.js";import{a as p}from"./shared-47f3f5f5.js";import{i as u}from"./shared-589d66fe.js";import"./shared-34a87829.js";import"./shared-5a469962.js";import"./shared-66278c21.js";import"./shared-6bf89411.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-bf8d95b9.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-6f071960.js";import"./shared-27c16d99.js";import"./shared-b3fe8c63.js";import"./shared-e55c8dc4.js";import"./shared-0e25ac65.js";import"./shared-360196ad.js";import"./shared-3d353eb8.js";import"./shared-930e68b7.js";import"./shared-fb859ece.js";import"./shared-4194ffe7.js";import"./shared-32b2d003.js";import"./shared-1c985317.js";import"./shared-58add5b4.js";import"./shared-69c98b7b.js";import"./shared-41c9c53f.js";import"./foxy-copy-to-clipboard.js";import"./shared-b2cbe727.js";import"./foxy-spinner.js";import"./shared-fd8b44e3.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-65112811.js";import"./shared-9e0b104a.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-6e92b5fc.js";import"./shared-be2ce0e6.js";import"./shared-5212ef4f.js";import"./shared-a7150987.js";import"./shared-542c8ef1.js";let f,d,m,y=e=>e;customElements.define("foxy-internal-native-integration-form-code-map-control",class extends o{constructor(){super(...arguments),this.itemCategoryBase=null,this.itemCategories=null,this.__newMappingGetValue=()=>{},this.__newMappingSetValue=e=>{const o=a(e);if("string"==typeof o||"number"==typeof o)if(this._value&&o in this._value){const e=this.renderRoot.querySelector(`#category-${o}`);null==e||e.animate([{background:""},{background:"var(--lumo-primary-color-50pct)"},{background:""}],{duration:2e3,easing:"ease"})}else this._value=r(r({},this._value),{},{[o]:""})}}static get properties(){return r(r({},super.properties),{},{itemCategoryBase:{attribute:"item-category-base"},itemCategories:{attribute:"item-categories"}})}renderControl(){var e,o;return l(f||(f=y` <foxy-internal-summary-control infer="existing-mappings" unsafe-helper-text> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control helper-text="" label="" infer="new-mapping" class="mt-s"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="" item="foxy-item-category-card" .getValue="${0}" .setValue="${0}"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> `),Object.entries(null!==(e=this._value)&&void 0!==e?e:{}).map((([e,o])=>{var t,n,a,p,u;let f;try{f=new URL(e,null!==(t=this.itemCategoryBase)&&void 0!==t?t:void 0).toString()}catch(e){f=void 0}const _=this.renderRoot.querySelector(`#category${e}Loader`),v=(null==_?void 0:_.in("fail"))?this.t("existing-mappings.status_fail"):(null==_?void 0:_.in("busy"))?this.t("existing-mappings.status_busy"):null;return l(d||(d=y` <div class="flex items-center gap-xs" id="category-${0}"> <foxy-nucleon parent="${0}" class="hidden" infer="" href="${0}" id="category${0}Loader" @update="${0}"> </foxy-nucleon> <foxy-internal-text-control helper-text="" layout="summary-item" label="${0}" infer="" class="flex-1" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> `),e,i(null!==(n=this.itemCategories)&&void 0!==n?n:void 0),i(f),e,(()=>this.requestUpdate()),null!==(u=null!==(p=null===(a=null==_?void 0:_.data)||void 0===a?void 0:a.name)&&void 0!==p?p:v)&&void 0!==u?u:e,(()=>o),(o=>this._value=r(r({},this._value),{},{[e]:o})),this.t("delete"),c({"flex-shrink-0 rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly||!!o,(()=>{const o=r({},this._value);delete o[e],this._value=o}),s(m||(m=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: translate(0.1em, 0.1em) scale(1.3);"><path fill-rule="evenodd" d="M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z" clip-rule="evenodd" /> </svg>`)))})),i(null!==(o=this.itemCategories)&&void 0!==o?o:void 0),this.__newMappingGetValue,this.__newMappingSetValue)}get _value(){return super._value}set _value(e){super._value=e}});const _=JSON.stringify({service:"legacy_xml",version:1,events:["transaction/created"],title:"",url:""}),v=JSON.stringify({encryption_key:"",service:"json",version:1,events:[],title:"",url:""}),h=JSON.stringify({part_number_product_option:"",product_order_priority:"",calling_system_number:"",external_company_id:"",audit_settings:"never",company_role:"B",service_url:"",host_system:"",from_city:""}),x=JSON.stringify({url:""}),g=JSON.stringify({merchantID:""}),b=JSON.stringify({category_to_product_tax_code_mappings:{},enable_colorado_delivery_fee:!1,address_validation_countries:[],use_address_validation:!1,create_invoice:!1,company_code:"",service_url:"",use_ava_tax:!1,key:"",id:""}),j=JSON.stringify({inventory_field_name:"",inventory_field_id:"",collection_name:"",sku_field_name:"",collection_id:"",sku_field_id:"",site_name:"",service:"webflow",version:1,site_id:"",events:["transaction/created"],auth:""}),w=JSON.stringify({service:"zapier",events:[],url:""}),$=JSON.stringify({category_to_product_tax_code_mappings:{},create_invoice:!1,api_token:""});let k,C,S,O,q,V,J,A,B,N,P,z,L,G,M,W=e=>e;const R=p(e,"native-integration-form");class Z extends R{constructor(){super(...arguments),this.itemCategoryBase=null,this.store=null,this.__createConfigGetterFor=t((e=>()=>{var o;return null===(o=this.__config)||void 0===o?void 0:o[e]})),this.__createConfigSetterFor=t((e=>o=>this.__config={[e]:o})),this.__providerGetValue=()=>this.form.provider,this.__providerSetValue=e=>{this.edit({provider:e,config:"{}"}),this.__config={}},this.__templateProviderOptions=[{value:"avalara",label:"option_avalara"},{value:"onesource",label:"option_onesource"},{value:"taxjar",label:"option_taxjar"},{value:"custom_tax",label:"option_custom_tax"}],this.__avalaraAddressValidationCountriesOptions=[{value:"US"},{value:"CA"}],this.__onesourceCompanyRoleOptions=[{value:"B",label:"option_buyer"},{value:"M",label:"option_middleman"},{value:"S",label:"option_seller"}],this.__onesourceProductOrderPriorityGetValue=()=>{var e,o;return(null!==(o=null===(e=this.__config)||void 0===e?void 0:e.product_order_priority.split(","))&&void 0!==o?o:[]).filter((e=>!!e)).map((e=>({value:e})))},this.__onesourceProductOrderPrioritySetValue=e=>{this.__config={product_order_priority:e.map((e=>e.value)).join(",")}},this.__onesourceAuditSettingsOptions=[{value:"capture_only",label:"option_capture_only"},{value:"auth_and_capture",label:"option_auth_and_capture"},{value:"never",label:"option_never"}],this.__webhookServiceOptions=[{value:"json",label:"option_json"},{value:"legacy_xml",label:"option_legacy_xml"}],this.__webhookJsonEventsOptions=[{value:"transaction/created",label:"option_transaction_created"},{value:"subscription/cancelled",label:"option_subscription_cancelled"}]}static get properties(){return r(r({},super.properties),{},{itemCategoryBase:{attribute:"item-category-base"},store:{}})}static get v8n(){const e=t(JSON.parse);return[({provider:o="avalara",config:r="{}"})=>{const t=e(r).service_url,n=t?u(t)?null:"v8n_invalid":"v8n_required";return"avalara"!==o||!n||`avalara-service-url:${n}`},({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).id||"avalara-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).key||"avalara-key:v8n_required",({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).company_code||"avalara-company-code:v8n_required",({provider:o="avalara",config:r="{}"})=>"taxjar"!==o||!!e(r).api_token||"taxjar-api-token:v8n_required",({provider:o="avalara",config:r="{}"})=>{const t=e(r).service_url,n=t?u(t)?null:"v8n_invalid":"v8n_required";return"onesource"!==o||!n||`onesource-service-url:${n}`},({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).external_company_id||"onesource-external-company-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).calling_system_number||"onesource-calling-system-number:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).from_city||"onesource-from-city:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).host_system||"onesource-host-system:v8n_required",({provider:o="avalara",config:r="{}"})=>{const{service:t,title:n}=e(r);return"webhook"!==o||"json"!==t||!!n||"webhook-json-title:v8n_required"},({provider:o="avalara",config:r="{}"})=>{const{service:t,encryption_key:n}=e(r);return"webhook"!==o||"json"!==t||!!n||"webhook-json-encryption-key:v8n_required"},({provider:o="avalara",config:r="{}"})=>{const{service:t,url:n}=e(r),a=n?u(n)?null:"v8n_invalid":"v8n_required";return"webhook"!==o||"json"!==t||!a||`webhook-json-url:${a}`},({provider:o="avalara",config:r="{}"})=>{const{service:t,title:n}=e(r);return"webhook"!==o||"legacy_xml"!==t||!!n||"webhook-legacy-xml-title:v8n_required"},({provider:o="avalara",config:r="{}"})=>{const{service:t,url:n}=e(r),a=n?u(n)?null:"v8n_invalid":"v8n_required";return"webhook"!==o||"legacy_xml"!==t||!a||`webhook-legacy-xml-url:${a}`},({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).site_id||"webflow-site-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).site_name||"webflow-site-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).collection_id||"webflow-collection-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).collection_name||"webflow-collection-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).sku_field_id||"webflow-sku-field-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).sku_field_name||"webflow-sku-field-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).inventory_field_id||"webflow-inventory-field-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).inventory_field_name||"webflow-inventory-field-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).auth||"webflow-auth:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("apple-pay-group-one","zapier-group-one","provider-group-one"),new n(e.join(" ").trim())}get headerTitleOptions(){return{context:this.data?`existing_${this.data.provider}`:"new",id:this.headerCopyIdValue}}renderBody(){var e;const o=this.form.provider;return l(k||(k=W` ${0} ${0} ${0} ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.href?"":l(C||(C=W` <foxy-internal-summary-control infer="provider-group-one"> <foxy-internal-select-control layout="summary-item" infer="provider" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> `),this.__providerGetValue,this.__providerSetValue,this.__templateProviderOptions),"avalara"===o?this.__renderAvalaraConfig():"taxjar"===o?this.__renderTaxJarConfig():"onesource"===o?this.__renderOneSourceConfig():"webflow"===o?this.__renderWebflowConfig():"zapier"===o?this.__renderZapierConfig():"webhook"===o?this.__renderWebhookConfig():"apple_pay"===o?this.__renderApplePayConfig():"custom_tax"===o?this.__renderCustomTaxConfig():"",super.renderBody(),i(null!==(e=this.store)&&void 0!==e?e:void 0),(()=>this.requestUpdate()))}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let o;try{o=(await e.json())._embedded["fx:errors"][0].message}catch(o){throw e}throw o.includes("has already been configured")?["error:already_configured"]:e}}get __config(){try{return JSON.parse(this.form.config)}catch(e){return null}}set __config(e){var o;const t=this.__config,n=null!==(o=this.form.provider)&&void 0!==o?o:"avalara",a="avalara"===n?b:"taxjar"===n?$:"onesource"===n?h:"webflow"===n?j:"zapier"===n?w:"webhook"===n?"legacy_xml"===(null==t?void 0:t.service)?_:v:void 0,i=a?JSON.parse(a):{},l=JSON.stringify(r(r(r({},i),t),e));this.edit({provider:n,config:l})}__renderAvalaraConfig(){var e,o,r,t,n,a;const s=null===(o=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===o?void 0:o.is_active,c=null===(t=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===t?void 0:t._links["fx:item_categories"].href,p="boolean"==typeof s?this.t("avalara-group-one.avalara-service-url.placeholder_"+(s?"active":"inactive")):void 0;return l(S||(S=W` <foxy-internal-summary-control infer="avalara-group-one"> <foxy-internal-text-control json-template="${0}" placeholder="${0}" json-path="service_url" property="config" layout="summary-item" infer="avalara-service-url"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="id" property="config" layout="summary-item" infer="avalara-id"> </foxy-internal-text-control> <foxy-internal-password-control json-template="${0}" json-path="key" property="config" layout="summary-item" infer="avalara-key"> </foxy-internal-password-control> <foxy-internal-text-control json-template="${0}" json-path="company_code" property="config" layout="summary-item" infer="avalara-company-code"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="avalara-group-two"> <foxy-internal-switch-control json-template="${0}" json-path="use_ava_tax" property="config" infer="avalara-use-ava-tax"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" json-path="use_address_validation" property="config" infer="avalara-use-address-validation"> </foxy-internal-switch-control> ${0} <foxy-internal-switch-control json-template="${0}" json-path="create_invoice" property="config" infer="avalara-create-invoice"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" json-path="enable_colorado_delivery_fee" property="config" infer="avalara-enable-colorado-delivery-fee"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-native-integration-form-code-map-control item-category-base="${0}" item-categories="${0}" json-template="${0}" json-path="category_to_product_tax_code_mappings" property="config" layout="summary-item" infer="avalara-category-to-product-tax-code-mappings"> </foxy-internal-native-integration-form-code-map-control> `),b,i(p),b,b,b,b,b,(null===(n=this.__config)||void 0===n?void 0:n.use_address_validation)?l(O||(O=W` <foxy-internal-editable-list-control json-template="${0}" json-path="address_validation_countries" property="config" layout="summary-item" infer="avalara-address-validation-countries" .options="${0}"> </foxy-internal-editable-list-control> `),b,this.__avalaraAddressValidationCountriesOptions):"",b,b,i(null!==(a=this.itemCategoryBase)&&void 0!==a?a:void 0),i(c),b)}__renderTaxJarConfig(){var e,o,r;const t=null===(o=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===o?void 0:o._links["fx:item_categories"].href;return l(q||(q=W` <foxy-internal-summary-control infer="taxjar-group-one"> <foxy-internal-password-control json-template="${0}" json-path="api_token" property="config" layout="summary-item" infer="taxjar-api-token"> </foxy-internal-password-control> <foxy-internal-switch-control json-template="${0}" json-path="create_invoice" property="config" infer="taxjar-create-invoice"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-native-integration-form-code-map-control item-category-base="${0}" item-categories="${0}" json-template="${0}" json-path="category_to_product_tax_code_mappings" property="config" infer="taxjar-category-to-product-tax-code-mappings"> </foxy-internal-native-integration-form-code-map-control> `),$,$,i(null!==(r=this.itemCategoryBase)&&void 0!==r?r:void 0),i(t),$)}__renderOneSourceConfig(){return l(V||(V=W` <foxy-internal-summary-control infer="onesource-group-one"> <foxy-internal-text-control json-template="${0}" json-path="service_url" property="config" layout="summary-item" infer="onesource-service-url"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="external_company_id" property="config" layout="summary-item" infer="onesource-external-company-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="from_city" property="config" layout="summary-item" infer="onesource-from-city"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-two"> <foxy-internal-text-control json-template="${0}" json-path="calling_system_number" property="config" layout="summary-item" infer="onesource-calling-system-number"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="host_system" property="config" layout="summary-item" infer="onesource-host-system"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-three"> <foxy-internal-select-control json-template="${0}" json-path="audit_settings" property="config" layout="summary-item" infer="onesource-audit-settings" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control json-template="${0}" json-path="company_role" property="config" layout="summary-item" infer="onesource-company-role" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-four"> <foxy-internal-text-control json-template="${0}" json-path="part_number_product_option" property="config" layout="summary-item" infer="onesource-part-number-product-option" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-five"> <foxy-internal-editable-list-control layout="summary-item" infer="onesource-product-order-priority" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> `),h,h,h,h,h,h,this.__onesourceAuditSettingsOptions,h,this.__onesourceCompanyRoleOptions,h,this.__createConfigGetterFor("part_number_product_option"),this.__createConfigSetterFor("part_number_product_option"),this.__onesourceProductOrderPriorityGetValue,this.__onesourceProductOrderPrioritySetValue)}__renderWebhookConfig(){var e,o;return l(J||(J=W` <div class="flex items-start border border-error rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="webhook-warning" key="warning_text"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-error transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> <foxy-i18n infer="webhook-warning" key="link_text"></foxy-i18n> </a> </p> </div> ${0} `),s(A||(A=W`<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>`)),"json"===(null===(e=this.__config)||void 0===e?void 0:e.service)?this.__renderWebhookJsonConfig():"legacy_xml"===(null===(o=this.__config)||void 0===o?void 0:o.service)?this.__renderWebhookLegacyXmlConfig():"")}__renderWebhookJsonConfig(){return l(B||(B=W` <foxy-internal-summary-control infer="webhook-json-group-one"> <foxy-internal-text-control json-template="${0}" json-path="title" property="config" layout="summary-item" infer="webhook-json-title"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="webhook-json-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="service" property="config" layout="summary-item" infer="webhook-service" .options="${0}"> </foxy-internal-select-control> <foxy-internal-password-control json-template="${0}" json-path="encryption_key" property="config" layout="summary-item" infer="webhook-json-encryption-key"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webhook-json-group-two"> ${0} </foxy-internal-summary-control> `),v,v,v,this.__webhookServiceOptions,v,this.__webhookJsonEventsOptions.map((e=>l(N||(N=W` <foxy-internal-switch-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),`webhook-json-events-${e.value.replace(/\//g,"-")}`,(()=>{var o,r;return null===(r=null===(o=this.__config)||void 0===o?void 0:o.events)||void 0===r?void 0:r.includes(e.value)}),(o=>{var r,t;const n=null!==(t=null===(r=this.__config)||void 0===r?void 0:r.events)&&void 0!==t?t:[];this.__config={events:o?[...n,e.value]:n.filter((o=>o!==e.value))}})))))}__renderWebhookLegacyXmlConfig(){return l(P||(P=W` <foxy-internal-summary-control infer="webhook-legacy-xml-group-one"> <foxy-internal-text-control json-template="${0}" json-path="title" property="config" layout="summary-item" infer="webhook-legacy-xml-title"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="webhook-legacy-xml-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="service" property="config" layout="summary-item" infer="webhook-service" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> `),_,_,_,this.__webhookServiceOptions)}__renderWebflowConfig(){return l(z||(z=W` <foxy-internal-summary-control infer="webflow-group-one"> <foxy-internal-text-control json-template="${0}" json-path="site_id" property="config" layout="summary-item" infer="webflow-site-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="site_name" property="config" layout="summary-item" infer="webflow-site-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-two"> <foxy-internal-text-control json-template="${0}" json-path="collection_id" property="config" layout="summary-item" infer="webflow-collection-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="collection_name" property="config" layout="summary-item" infer="webflow-collection-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-three"> <foxy-internal-text-control json-template="${0}" json-path="sku_field_id" property="config" layout="summary-item" infer="webflow-sku-field-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="sku_field_name" property="config" layout="summary-item" infer="webflow-sku-field-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-four"> <foxy-internal-text-control json-template="${0}" json-path="inventory_field_id" property="config" layout="summary-item" infer="webflow-inventory-field-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="inventory_field_name" property="config" layout="summary-item" infer="webflow-inventory-field-name"> </foxy-internal-text-control> </foxy-internal-summary-control> `),j,j,j,j,j,j,j,j)}__renderZapierConfig(){return l(L||(L=W` <foxy-internal-summary-control infer="zapier-group-one"> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="zapier-url"> </foxy-internal-text-control> <foxy-internal-editable-list-control json-template="${0}" json-path="events" property="config" layout="summary-item" infer="zapier-events" simple-value> </foxy-internal-editable-list-control> <p class="text-secondary leading-xs"> <foxy-i18n infer="zapier-warning" key="warning_text"></foxy-i18n> </p> </foxy-internal-summary-control> `),w,w)}__renderApplePayConfig(){return l(G||(G=W` <foxy-internal-summary-control infer="apple-pay-group-one"> <foxy-internal-text-control json-template="${0}" json-path="merchantID" property="config" layout="summary-item" infer="apple-pay-merchant-id"> </foxy-internal-text-control> <p class="text-secondary leading-xs"> <foxy-i18n infer="apple-pay-warning" key="warning_text"></foxy-i18n> </p> </foxy-internal-summary-control> `),g)}__renderCustomTaxConfig(){return l(M||(M=W` <foxy-internal-summary-control infer="custom-tax-group-one"> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="custom-tax-url"> </foxy-internal-text-control> </foxy-internal-summary-control> `),x)}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-native-integration-form",Z);export{Z as NativeIntegrationForm};