@ikas/storefront 2.0.58 → 2.0.60-alpha.1

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.
@@ -1 +1 @@
1
- import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
1
+ import e from'../ext/strict-uri-encode/index.js';export{default}from"../node_modules/strict-uri-encode/index.js";
@@ -1 +1 @@
1
- import e from'../ext/strict-uri-encode/index.js';export{default}from"../node_modules/strict-uri-encode/index.js";
1
+ import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
@@ -1 +1 @@
1
- import{__awaiter as n,__generator as e,__assign as t,__makeTemplateObject as r}from'../../ext/tslib/tslib.es6.js';import a from'../../ext/graphql-tag/src/index.js';import{apollo as i}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import{IkasCustomer as s}from"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import{IkasOrderRefundSettings as d}from"../../models/data/order/refund/settings.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import{IkasOrderTransaction as u}from"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasStorefrontConfig as c}from"../../storefront/index.js";var m,l,p,g,f,y,b,I,h,N,v,k,L,A,S,x,$,C=function(){function C(){}return C.login=function(o,d){return n(this,void 0,void 0,(function(){var n,u,c,l,p;return e(this,(function(e){switch(e.label){case 0:n=a(m||(m=r(["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d}})];case 2:return u=e.sent(),c=u.data,(l=u.errors)&&l.length&&console.log(l),c&&c.customerLogin?[2,t(t({},c.customerLogin),{customer:new s(c.customerLogin.customer)})]:[3,4];case 3:return p=e.sent(),console.log(p),[3,4];case 4:return[2]}}))}))},C.socialLogin=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(l||(l=r(["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{code:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.customerSocialLogin.customer?[2,{customer:new s(d.customerSocialLogin.customer),token:d.customerSocialLogin.token,tokenExpiry:d.customerSocialLogin.tokenExpiry}]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.register=function(o,d,u,m,l,g){return n(this,void 0,void 0,(function(){var n,f,y,b,I;return e(this,(function(e){switch(e.label){case 0:n=a(p||(p=r(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d,firstName:u,lastName:m,isAcceptMarketing:l,locale:c.getCurrentLocale(),attributes:g}})];case 2:return f=e.sent(),y=f.data,(b=f.errors)&&b.length&&console.log(b),y&&y.registerCustomer?[2,t(t({},y.registerCustomer),{customer:new s(y.registerCustomer.customer)})]:[3,4];case 3:return I=e.sent(),console.log(I),[3,4];case 4:return[2]}}))}))},C.refreshToken=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(g||(g=r(["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "],["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{token:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o?[2,o.customerRefreshToken]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.forgotPassword=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d;return e(this,(function(e){switch(e.label){case 0:n=a(f||(f=r(["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "],["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:t,locale:c.getCurrentLocale()}})];case 2:return s=e.sent(),(o=s.errors)&&o.length?(console.log(o),[2,!1]):[3,4];case 3:return d=e.sent(),console.log(d),[3,4];case 4:return[2,!0]}}))}))},C.recoverPassword=function(t,s,o){return n(this,void 0,void 0,(function(){var n,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(y||(y=r(["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "],["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{password:t,passwordAgain:s,token:o}})];case 2:return d=e.sent(),(u=d.errors)&&u.length?(console.log(u),[2,!1]):[3,4];case 3:return c=e.sent(),console.log(c),[2,!1];case 4:return[2,!0]}}))}))},C.checkEmail=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(b||(b=r(["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "],["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o&&o.checkCustomerEmail?[2,o.checkCustomerEmail.exists]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2,!1]}}))}))},C.getCustomer=function(){return n(this,void 0,void 0,(function(){var n,t,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(I||(I=r(["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n subscriptionStatus\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n subscriptionStatus\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n})];case 2:return t=e.sent(),o=t.data,(d=t.errors)&&d.length&&console.log(d),o&&o.getMyCustomer?[2,new s(o.getMyCustomer)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.saveCustomer=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(h||(h=r(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n subscriptionStatus\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n subscriptionStatus\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{firstName:t.firstName,lastName:t.lastName,addresses:t.addresses,phone:t.phone,subscriptionStatus:t.subscriptionStatus,attributes:t.attributes.map((function(n){return{value:n.value,customerAttributeId:n.customerAttributeId,customerAttributeOptionId:n.customerAttributeOptionId}}))}}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.saveMyCustomer?[2,new s(d.saveMyCustomer)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrders=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(N||(N=r(["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:t?{orderId:t}:{}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length&&console.log(u),d&&d.getCustomerOrders?[2,d.getCustomerOrders.map((function(n){return new o(n)}))]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrderByEmail=function(t,s){return n(this,void 0,void 0,(function(){var n,d,u,c,m;return e(this,(function(e){switch(e.label){case 0:n=a(v||(v=r(["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t,orderNumber:s}})];case 2:return d=e.sent(),u=d.data,(c=d.errors)&&c.length&&console.log(c),u&&u.getOrderByEmail?[2,new o(u.getOrderByEmail)]:[3,4];case 3:return m=e.sent(),console.log(m),[3,4];case 4:return[2]}}))}))},C.getOrderTransactions=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,c;return e(this,(function(e){switch(e.label){case 0:n=a(k||(k=r(["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "],["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{checkoutId:(null==t?void 0:t.checkoutId)?{eq:t.checkoutId}:void 0,id:(null==t?void 0:t.id)?{eq:t.id}:void 0,orderId:(null==t?void 0:t.orderId)?{eq:t.orderId}:void 0}})];case 2:return s=e.sent(),o=s.data,d=s.errors,Array.isArray(d)&&d.length?[2,[]]:[2,o.listOrderTransactions.map((function(n){return new u(n)}))];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveIkasOrderRefund=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(L||(L=r(["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length?[2]:d&&d.createOrderRefundRequest?[2,new o(null==d?void 0:d.createOrderRefundRequest)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.createCustomerEmailSubscription=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(A||(A=r(["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "],["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{email:t}}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getLastViewedProducts=function(t){var s;return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(S||(S=r(["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "],["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{customerId:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length?[2,[]]:[2,(null===(s=d.getLastViewedProducts)||void 0===s?void 0:s.products)||[]];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveLastViewedProducts=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(x||(x=r(["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "],["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getOrderRefundSettings=function(){return n(this,void 0,void 0,(function(){var n,t,s,o,u;return e(this,(function(e){switch(e.label){case 0:n=a($||($=r(["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "],["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{storefrontId:{eq:c.storefrontId}}})];case 2:return t=e.sent(),s=t.data,(o=t.errors)&&o.length&&console.log(o),s&&s.listOrderRefundSettings.length?[2,new d(s.listOrderRefundSettings[0])]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCustomerAPI};
1
+ import{__awaiter as n,__generator as e,__assign as t,__makeTemplateObject as r}from'../../ext/tslib/tslib.es6.js';import a from'../../ext/graphql-tag/src/index.js';import{apollo as i}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import{IkasCustomer as s}from"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import{IkasOrderRefundSettings as d}from"../../models/data/order/refund/settings.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import{IkasOrderTransaction as u}from"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasStorefrontConfig as c}from"../../storefront/index.js";var m,l,p,g,f,y,b,I,h,v,N,k,L,A,S,x,$,C=function(){function C(){}return C.login=function(o,d){return n(this,void 0,void 0,(function(){var n,u,c,l,p;return e(this,(function(e){switch(e.label){case 0:n=a(m||(m=r(["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation customerLogin($email: String!, $password: String!) {\n customerLogin(email: $email, password: $password) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d}})];case 2:return u=e.sent(),c=u.data,(l=u.errors)&&l.length&&console.log(l),c&&c.customerLogin?[2,t(t({},c.customerLogin),{customer:new s(c.customerLogin.customer)})]:[3,4];case 3:return p=e.sent(),console.log(p),[3,4];case 4:return[2]}}))}))},C.socialLogin=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(l||(l=r(["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n query customerSocialLogin($code: String!) {\n customerSocialLogin(code: $code) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n identityNumber\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{code:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.customerSocialLogin.customer?[2,{customer:new s(d.customerSocialLogin.customer),token:d.customerSocialLogin.token,tokenExpiry:d.customerSocialLogin.tokenExpiry}]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.register=function(o,d,u,m,l,g){return n(this,void 0,void 0,(function(){var n,f,y,b,I;return e(this,(function(e){switch(e.label){case 0:n=a(p||(p=r(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "],["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n $locale: String\n $attributes: [CustomerAttributeValueInput!]\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n locale: $locale\n attributes: $attributes\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n subscriptionStatus\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:o,password:d,firstName:u,lastName:m,isAcceptMarketing:l,locale:c.getCurrentLocale(),attributes:g}})];case 2:return f=e.sent(),y=f.data,(b=f.errors)&&b.length&&console.log(b),y&&y.registerCustomer?[2,t(t({},y.registerCustomer),{customer:new s(y.registerCustomer.customer)})]:[3,4];case 3:return I=e.sent(),console.log(I),[3,4];case 4:return[2]}}))}))},C.refreshToken=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(g||(g=r(["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "],["\n mutation customerRefreshToken($token: String!) {\n customerRefreshToken(token: $token) {\n token\n tokenExpiry\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{token:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o?[2,o.customerRefreshToken]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.forgotPassword=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(f||(f=r(["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "],["\n mutation customerForgotPassword($email: String!, $locale: String!) {\n customerForgotPassword(email: $email, locale: $locale)\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{email:t,locale:c.getCurrentLocale()}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length?(console.log(d),[2,!1]):[2,!!(null==o?void 0:o.customerForgotPassword)];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2,!1]}}))}))},C.recoverPassword=function(t,s,o){return n(this,void 0,void 0,(function(){var n,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(y||(y=r(["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "],["\n mutation customerRecoverPassword(\n $password: String!\n $passwordAgain: String!\n $token: String!\n ) {\n customerRecoverPassword(\n password: $password\n passwordAgain: $passwordAgain\n token: $token\n )\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{password:t,passwordAgain:s,token:o}})];case 2:return d=e.sent(),(u=d.errors)&&u.length?(console.log(u),[2,!1]):[3,4];case 3:return c=e.sent(),console.log(c),[2,!1];case 4:return[2,!0]}}))}))},C.checkEmail=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(b||(b=r(["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "],["\n query checkCustomerEmail($email: String!) {\n checkCustomerEmail(email: $email) {\n exists\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t}})];case 2:return s=e.sent(),o=s.data,(d=s.errors)&&d.length&&console.log(d),o&&o.checkCustomerEmail?[2,o.checkCustomerEmail.exists]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2,!1]}}))}))},C.getCustomer=function(){return n(this,void 0,void 0,(function(){var n,t,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=a(I||(I=r(["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n subscriptionStatus\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n query getMyCustomer {\n getMyCustomer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n customerGroupIds\n subscriptionStatus\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n})];case 2:return t=e.sent(),o=t.data,(d=t.errors)&&d.length&&console.log(d),o&&o.getMyCustomer?[2,new s(o.getMyCustomer)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.saveCustomer=function(t){return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(h||(h=r(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n subscriptionStatus\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "],["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n identityNumber\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n subscriptionStatus\n accountStatus\n email\n firstName\n customerGroupIds\n attributes {\n customerAttributeId\n customerAttributeOptionId\n value\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{firstName:t.firstName,lastName:t.lastName,addresses:t.addresses,phone:t.phone,subscriptionStatus:t.subscriptionStatus,attributes:t.attributes.map((function(n){return{value:n.value,customerAttributeId:n.customerAttributeId,customerAttributeOptionId:n.customerAttributeOptionId}}))}}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length&&console.log(u),d&&d.saveMyCustomer?[2,new s(d.saveMyCustomer)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrders=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(v||(v=r(["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getCustomerOrders($orderId: String) {\n getCustomerOrders(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:t?{orderId:t}:{}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length&&console.log(u),d&&d.getCustomerOrders?[2,d.getCustomerOrders.map((function(n){return new o(n)}))]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getOrderByEmail=function(t,s){return n(this,void 0,void 0,(function(){var n,d,u,c,m;return e(this,(function(e){switch(e.label){case 0:n=a(N||(N=r(["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrderByEmail($email: String!, $orderNumber: String!) {\n getOrderByEmail(email: $email, orderNumber: $orderNumber) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{email:t,orderNumber:s}})];case 2:return d=e.sent(),u=d.data,(c=d.errors)&&c.length&&console.log(c),u&&u.getOrderByEmail?[2,new o(u.getOrderByEmail)]:[3,4];case 3:return m=e.sent(),console.log(m),[3,4];case 4:return[2]}}))}))},C.getOrderTransactions=function(t){return n(this,void 0,void 0,(function(){var n,s,o,d,c;return e(this,(function(e){switch(e.label){case 0:n=a(k||(k=r(["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "],["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{checkoutId:(null==t?void 0:t.checkoutId)?{eq:t.checkoutId}:void 0,id:(null==t?void 0:t.id)?{eq:t.id}:void 0,orderId:(null==t?void 0:t.orderId)?{eq:t.orderId}:void 0}})];case 2:return s=e.sent(),o=s.data,d=s.errors,Array.isArray(d)&&d.length?[2,[]]:[2,o.listOrderTransactions.map((function(n){return new u(n)}))];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveIkasOrderRefund=function(t){return n(this,void 0,void 0,(function(){var n,s,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(L||(L=r(["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n mutation createOrderRefundRequest($input: OrderRefundRequestInput!) {\n createOrderRefundRequest(input: $input) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return s=e.sent(),d=s.data,(u=s.errors)&&u.length?[2]:d&&d.createOrderRefundRequest?[2,new o(null==d?void 0:d.createOrderRefundRequest)]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.createCustomerEmailSubscription=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(A||(A=r(["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "],["\n mutation createCustomerEmailSubscription(\n $input: CreateCustomerEmailSubscriptionInput!\n ) {\n createCustomerEmailSubscription(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:{email:t}}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getLastViewedProducts=function(t){var s;return n(this,void 0,void 0,(function(){var n,o,d,u,c;return e(this,(function(e){switch(e.label){case 0:n=a(S||(S=r(["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "],["\n query getLastViewedProducts($customerId: String) {\n getLastViewedProducts(customerId: $customerId) {\n products {\n productId\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{customerId:t}})];case 2:return o=e.sent(),d=o.data,(u=o.errors)&&u.length?[2,[]]:[2,(null===(s=d.getLastViewedProducts)||void 0===s?void 0:s.products)||[]];case 3:return c=e.sent(),console.log(c),[2,[]];case 4:return[2]}}))}))},C.saveLastViewedProducts=function(t){return n(this,void 0,void 0,(function(){var n,s,o;return e(this,(function(e){switch(e.label){case 0:n=a(x||(x=r(["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "],["\n mutation saveLastViewedProducts($input: ProductLastViewedInput!) {\n saveLastViewedProducts(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().mutate({mutation:n,variables:{input:t}})];case 2:return(s=e.sent().errors)&&s.length?[2,!1]:[3,4];case 3:return o=e.sent(),console.log(o),[2,!1];case 4:return[2,!0]}}))}))},C.getOrderRefundSettings=function(){return n(this,void 0,void 0,(function(){var n,t,s,o,u;return e(this,(function(e){switch(e.label){case 0:n=a($||($=r(["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "],["\n query listOrderRefundSettings($storefrontId: StringFilterInput!) {\n listOrderRefundSettings(storefrontId: $storefrontId) {\n isActiveRefundSection\n orderRefundDayLimit\n refundDesc\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.getClient().query({query:n,variables:{storefrontId:{eq:c.storefrontId}}})];case 2:return t=e.sent(),s=t.data,(o=t.errors)&&o.length&&console.log(o),s&&s.listOrderRefundSettings.length?[2,new d(s.listOrderRefundSettings[0])]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCustomerAPI};
@@ -1 +1 @@
1
- import{__assign as e}from'../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as r}from"mobx-react-lite";import{FormItem as a}from"../form-item/index.js";import{FormItemType as o,FormItemInputType as n}from"../form-item/model.js";import i from"./model.js";import{IkasCheckoutRequirementEnum as l}from"../../../../models/data/checkout-settings/index.js";import{Checkbox as s}from"../checkbox/index.js";import c from"../../styles/common.module.scss.js";import d from"../../style.module.scss.js";import"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{useTranslation as m}from"../../../../utils/i18n.js";var u=r((function(r){var a,o=m().t,n=t.useMemo((function(){return new i(e({},r))}),[]);return t.useEffect((function(){Object.entries(r).forEach((function(e){n[e[0]]=e[1]}))}),Object.values(r)),t.createElement("div",null,n.allowTitleChange&&t.createElement("div",{className:d.RowPB},t.createElement(h,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2].join(" ")},t.createElement(v,e({},r,{vm:n})),t.createElement(p,e({},r,{vm:n})),t.createElement("div",null)," "),!!n.address.checkoutSettings&&n.address.checkoutSettings.identityNumberRequirement!==l.INVISIBLE&&t.createElement("div",{className:d.RowPB},t.createElement(E,e({},r,{vm:n}))),(null===(a=n.address.checkoutSettings)||void 0===a?void 0:a.postalCodeRequirement)!==l.INVISIBLE?t.createElement(t.Fragment,null,t.createElement("div",{className:d.RowPB},t.createElement(g,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2].join(" ")},t.createElement(C,e({},r,{vm:n})),t.createElement(y,e({},r,{vm:n})),t.createElement("div",null)," ")):t.createElement(t.Fragment,null,t.createElement("div",{className:d.RowPB},t.createElement(g,e({},r,{vm:n}))),t.createElement("div",{className:d.RowPB},t.createElement(C,e({},r,{vm:n})))),(n.countryOptions.length>1||n.hasState)&&t.createElement("div",{className:[d.RowPB,c.Grid,n.countryOptions.length>1&&n.hasState?c.Grid2:""].join(" ")},t.createElement(f,e({},r,{vm:n})),n.hasState&&t.createElement(T,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2,d.RowPB].join(" ")},n.isFreeTextCity?t.createElement(k,e({},r,{vm:n})):t.createElement(b,e({},r,{vm:n})),n.districtOptions.length?t.createElement(N,e({},r,{vm:n})):t.createElement(x,e({},r,{vm:n}))),!!n.address.checkoutSettings&&n.address.checkoutSettings.phoneRequirement!==l.INVISIBLE&&t.createElement("div",null,t.createElement(j,e({},r,{vm:n}))),!!n.allowCorporateInfo&&t.createElement("div",{style:{marginTop:"12px"}},t.createElement(s,{value:n.isCorporate,label:o("checkout-page:corporateInvoice"),onChange:n.onCorporateChange})),!!n.isCorporate&&t.createElement("div",{className:c.Grid,style:{marginTop:"12px"}},t.createElement(R,e({},r,{vm:n})),t.createElement(L,e({},r,{vm:n})),t.createElement(S,e({},r,{vm:n}))))})),v=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:firstName"),autocomplete:"given-name",value:n.firstName||"",onChange:n.onFirstNameChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.firstName),errorText:i("checkout-page:firstNameError")})})),p=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:lastName"),autocomplete:"family-name",value:n.lastName||"",onChange:n.onLastNameChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.lastName),errorText:i("checkout-page:lastNameError")})})),E=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:identityNumber"),value:n.identityNumber||"",onChange:n.onIdentityNumberChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.identityNumber),errorText:i("checkout-page:identityNumberError")})})),h=r((function(e){var r=e.vm,n=m().t;return t.createElement(a,{type:o.TEXT,label:n("checkout-page:addressTitle"),value:r.address.title||"",onChange:r.onAddressTitleChange,hasError:r.isErrorsVisible&&!r.address.title,errorText:n("checkout-page:addressTitleError")})})),g=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:addressLine1"),autocomplete:"address-line1",value:n.address.addressLine1||"",onChange:n.onAddressLine1Change,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.addressLine1),errorText:i("checkout-page:addressError")})})),C=r((function(e){var r=e.vm,n=m().t;return t.createElement(a,{type:o.TEXT,autocomplete:"address-line2",label:n("checkout-page:addressLine2"),value:r.address.addressLine2||"",onChange:r.onAddressLine2Change})})),y=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:postalCode"),autocomplete:"postal-code",value:n.address.postalCode||"",onChange:n.onAddressPostalCodeChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.postalCode),errorText:i("checkout-page:postalCodeError")})})),f=r((function(e){var r,n,i=e.vm,l=m().t;return i.countryOptions.length<=1?null:t.createElement(a,{type:o.SELECT,label:l("checkout-page:country"),autocomplete:"country-name",value:(null===(r=i.country)||void 0===r?void 0:r.id)||"",onChange:i.onCountryChange,options:i.countryOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.country),errorText:l("checkout-page:countryError")})})),T=r((function(e){var r,n,i=e.vm,l=m().t;return t.createElement(a,{type:o.SELECT,label:l("checkout-page:state"),value:(null===(r=i.state)||void 0===r?void 0:r.id)||"",onChange:i.onStateChange,options:i.stateOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.state),errorText:l("checkout-page:stateError")})})),b=r((function(e){var r,n,i=e.vm,l=m().t;return t.createElement(a,{type:o.SELECT,label:l("checkout-page:city"),autocomplete:"off",value:(null===(r=i.city)||void 0===r?void 0:r.id)||"",onChange:i.onCityChange,options:i.cityOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.city),errorText:l("checkout-page:cityError")})})),k=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,autocomplete:"address-level3",label:i("checkout-page:city"),value:(null===(r=n.city)||void 0===r?void 0:r.name)||"",onChange:n.onCityInputChange})})),N=r((function(e){var r,n,i=e.vm,l=m().t;return t.createElement(a,{type:o.SELECT,label:l("checkout-page:district"),autocomplete:"off",value:(null===(r=i.district)||void 0===r?void 0:r.id)||"",onChange:i.onDistrictChange,options:i.districtOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.district),errorText:l("checkout-page:districtError")})})),x=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,autocomplete:"address-level3",label:i("checkout-page:district"),value:(null===(r=n.district)||void 0===r?void 0:r.name)||"",onChange:n.onDistrictInputChange})})),j=r((function(e){var r,i=e.vm,l=m().t;return t.createElement(a,{type:o.TEL,inputType:n.TEL,label:l("checkout-page:phone"),autocomplete:"tel",value:i.phone||"",onChange:i.onPhoneChange,hasError:i.isErrorsVisible&&!(null===(r=i.address.validationResult)||void 0===r?void 0:r.phone),currentCountryCode:i.myCountryCode,errorText:l("checkout-page:phoneError")})})),R=r((function(e){var r=e.vm,n=m().t;return t.createElement(a,{type:o.TEXT,label:n("checkout-page:companyName"),value:r.address.company||"",onChange:r.onCompanyChange})})),L=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:taxOffice"),value:(null===(r=n.address)||void 0===r?void 0:r.taxOffice)||"",onChange:n.onTaxOfficeChange})})),S=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:taxNumber"),value:(null===(r=n.address)||void 0===r?void 0:r.taxNumber)||"",onChange:n.onTaxNumberChange})}));export{u as AddressForm};
1
+ import{__assign as e}from'../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as r}from"mobx-react-lite";import{FormItem as a}from"../form-item/index.js";import{FormItemType as o,FormItemInputType as n}from"../form-item/model.js";import i from"./model.js";import{IkasCheckoutRequirementEnum as l}from"../../../../models/data/checkout-settings/index.js";import{Checkbox as s}from"../checkbox/index.js";import c from"../../styles/common.module.scss.js";import d from"../../style.module.scss.js";import"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{useTranslation as m}from"../../../../utils/i18n.js";var u=r((function(r){var a,o=m().t,n=t.useMemo((function(){return new i(e({},r))}),[]);return t.useEffect((function(){Object.entries(r).forEach((function(e){n[e[0]]=e[1]}))}),Object.values(r)),t.createElement("div",null,n.allowTitleChange&&t.createElement("div",{className:d.RowPB},t.createElement(h,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2].join(" ")},t.createElement(v,e({},r,{vm:n})),t.createElement(p,e({},r,{vm:n})),t.createElement("div",null)," "),!!n.address.checkoutSettings&&n.address.checkoutSettings.identityNumberRequirement!==l.INVISIBLE&&t.createElement("div",{className:d.RowPB},t.createElement(E,e({},r,{vm:n}))),(null===(a=n.address.checkoutSettings)||void 0===a?void 0:a.postalCodeRequirement)!==l.INVISIBLE?t.createElement(t.Fragment,null,t.createElement("div",{className:d.RowPB},t.createElement(g,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2].join(" ")},t.createElement(C,e({},r,{vm:n})),t.createElement(y,e({},r,{vm:n})),t.createElement("div",null)," ")):t.createElement(t.Fragment,null,t.createElement("div",{className:d.RowPB},t.createElement(g,e({},r,{vm:n}))),t.createElement("div",{className:d.RowPB},t.createElement(C,e({},r,{vm:n})))),(n.countryOptions.length>1||n.hasState)&&t.createElement("div",{className:[d.RowPB,c.Grid,n.countryOptions.length>1&&n.hasState?c.Grid2:""].join(" ")},t.createElement(f,e({},r,{vm:n})),n.hasState&&t.createElement(T,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2,d.RowPB].join(" ")},n.isFreeTextCity?t.createElement(k,e({},r,{vm:n})):t.createElement(b,e({},r,{vm:n})),!n.isDistrictHidden&&(n.districtOptions.length?t.createElement(N,e({},r,{vm:n})):t.createElement(x,e({},r,{vm:n})))),!!n.address.checkoutSettings&&n.address.checkoutSettings.phoneRequirement!==l.INVISIBLE&&t.createElement("div",null,t.createElement(j,e({},r,{vm:n}))),!!n.allowCorporateInfo&&t.createElement("div",{style:{marginTop:"12px"}},t.createElement(s,{value:n.isCorporate,label:o("checkout-page:corporateInvoice"),onChange:n.onCorporateChange})),!!n.isCorporate&&t.createElement("div",{className:c.Grid,style:{marginTop:"12px"}},t.createElement(R,e({},r,{vm:n})),t.createElement(L,e({},r,{vm:n})),t.createElement(S,e({},r,{vm:n}))))})),v=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:firstName"),autocomplete:"given-name",value:n.firstName||"",onChange:n.onFirstNameChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.firstName),errorText:i("checkout-page:firstNameError")})})),p=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:lastName"),autocomplete:"family-name",value:n.lastName||"",onChange:n.onLastNameChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.lastName),errorText:i("checkout-page:lastNameError")})})),E=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:identityNumber"),value:n.identityNumber||"",onChange:n.onIdentityNumberChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.identityNumber),errorText:i("checkout-page:identityNumberError")})})),h=r((function(e){var r=e.vm,n=m().t;return t.createElement(a,{type:o.TEXT,label:n("checkout-page:addressTitle"),value:r.address.title||"",onChange:r.onAddressTitleChange,hasError:r.isErrorsVisible&&!r.address.title,errorText:n("checkout-page:addressTitleError")})})),g=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:addressLine1"),autocomplete:"address-line1",value:n.address.addressLine1||"",onChange:n.onAddressLine1Change,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.addressLine1),errorText:i("checkout-page:addressError")})})),C=r((function(e){var r=e.vm,n=m().t;return t.createElement(a,{type:o.TEXT,autocomplete:"address-line2",label:n("checkout-page:addressLine2"),value:r.address.addressLine2||"",onChange:r.onAddressLine2Change})})),y=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:postalCode"),autocomplete:"postal-code",value:n.address.postalCode||"",onChange:n.onAddressPostalCodeChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.postalCode),errorText:i("checkout-page:postalCodeError")})})),f=r((function(e){var r,n,i=e.vm,l=m().t;return i.countryOptions.length<=1?null:t.createElement(a,{type:o.SELECT,label:l("checkout-page:country"),autocomplete:"country-name",value:(null===(r=i.country)||void 0===r?void 0:r.id)||"",onChange:i.onCountryChange,options:i.countryOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.country),errorText:l("checkout-page:countryError")})})),T=r((function(e){var r,n,i=e.vm,l=m().t;return t.createElement(a,{type:o.SELECT,label:l("checkout-page:state"),value:(null===(r=i.state)||void 0===r?void 0:r.id)||"",onChange:i.onStateChange,options:i.stateOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.state),errorText:l("checkout-page:stateError")})})),b=r((function(e){var r,n,i=e.vm,l=m().t;return t.createElement(a,{type:o.SELECT,label:l("checkout-page:city"),autocomplete:"off",value:(null===(r=i.city)||void 0===r?void 0:r.id)||"",onChange:i.onCityChange,options:i.cityOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.city),errorText:l("checkout-page:cityError")})})),k=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,autocomplete:"address-level3",label:i("checkout-page:city"),value:(null===(r=n.city)||void 0===r?void 0:r.name)||"",onChange:n.onCityInputChange})})),N=r((function(e){var r,n,i=e.vm,l=m().t;return t.createElement(a,{type:o.SELECT,label:l("checkout-page:district"),autocomplete:"off",value:(null===(r=i.district)||void 0===r?void 0:r.id)||"",onChange:i.onDistrictChange,options:i.districtOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.district),errorText:l("checkout-page:districtError")})})),x=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,autocomplete:"address-level3",label:i("checkout-page:district"),value:(null===(r=n.district)||void 0===r?void 0:r.name)||"",onChange:n.onDistrictInputChange})})),j=r((function(e){var r,i=e.vm,l=m().t;return t.createElement(a,{type:o.TEL,inputType:n.TEL,label:l("checkout-page:phone"),autocomplete:"tel",value:i.phone||"",onChange:i.onPhoneChange,hasError:i.isErrorsVisible&&!(null===(r=i.address.validationResult)||void 0===r?void 0:r.phone),currentCountryCode:i.myCountryCode,errorText:l("checkout-page:phoneError")})})),R=r((function(e){var r=e.vm,n=m().t;return t.createElement(a,{type:o.TEXT,label:n("checkout-page:companyName"),value:r.address.company||"",onChange:r.onCompanyChange})})),L=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:taxOffice"),value:(null===(r=n.address)||void 0===r?void 0:r.taxOffice)||"",onChange:n.onTaxOfficeChange})})),S=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:taxNumber"),value:(null===(r=n.address)||void 0===r?void 0:r.taxNumber)||"",onChange:n.onTaxNumberChange})}));export{u as AddressForm};
@@ -102,6 +102,7 @@ export default class AddressFormViewModel {
102
102
  }[];
103
103
  get hasState(): boolean;
104
104
  get isFreeTextCity(): boolean;
105
+ get isDistrictHidden(): boolean;
105
106
  fillDropdownOptions: () => Promise<void>;
106
107
  listCountries: () => Promise<void>;
107
108
  listStates: () => Promise<void>;
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i}from'../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as e}from"mobx";import"../../../../api/blog/index.js";import"../../../../api/brand/index.js";import"../../../../api/cart/index.js";import"../../../../api/category/index.js";import"../../../../api/checkout/index.js";import{IkasCityAPI as s}from"../../../../api/city/index.js";import{IkasCountryAPI as r}from"../../../../api/country/index.js";import"../../../../api/customer/index.js";import"../../../../api/customer-review/index.js";import"../../../../api/customer-review-summary/index.js";import{IkasDistrictAPI as o}from"../../../../api/district/index.js";import"../../../../api/html-meta-data/index.js";import"../../../../api/merchant/index.js";import"../../../../api/product-search/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/customer-review/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/installment-info/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../api/product-option-file/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product-attribute/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product-filter/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/data/order-transaction/index.js";import"../../../../models/data/product-option-set/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/product-campaing/campaign/index.js";import"../../../../models/data/customer-attribute/index.js";import"../../../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../../../models/theme/theme.js";import"../../../../models/theme/page/index.js";import"../../../../models/theme/component/prop/index.js";import"../../../../models/theme/page/component/prop-value/link.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-detail/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import"../../../../models/ui/validator/index.js";import"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import"../../../../models/theme/settings/index.js";import"../../../../models/theme/custom-data/index.js";import"../../../../api/apollo.js";import"../../../../api/favorite-product/index.js";import"../../../../api/contact-form/index.js";import{IkasStateAPI as n}from"../../../../api/state/index.js";import"../../../../api/product-option-set/index.js";import"../../../../api/raffle/index.js";import"../../../../api/back-in-stock-reminder/index.js";import"../../../../api/product-campaign/index.js";import{stringSorter as a}from"../../../../utils/helper.js";import{IkasStorefrontConfig as d}from"../../../../storefront/index.js";import"../../../../utils/i18n.js";import{FREE_TEXT_CITY_COUNTRY_LIST as l}from"../../../../utils/constants.js";var u=function(){function u(a){var l=this;this.isCorporate=!1,this.isErrorsVisible=!1,this.allowedCountryIds=null,this.allowCorporateInfo=!1,this.allowTitleChange=!1,this.firstNameChangeCallback=null,this.lastNameChangeCallback=null,this.countries=[],this.states=[],this.cities=[],this.districts=[],this.myCountryCode=null,this.fillDropdownOptions=function(){return t(l,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.listCountries()];case 1:return t.sent(),[4,this.listStates()];case 2:return t.sent(),[4,this.listCities()];case 3:return t.sent(),[4,this.listDistricts()];case 4:return t.sent(),[2]}}))}))},this.listCountries=function(){return t(l,void 0,void 0,(function(){var t,e,s,o,n,a,l,u=this;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),this.myCountryCode?[3,2]:(t=this,[4,r.getMyCountry()]);case 1:t.myCountryCode=i.sent()||void 0,i.label=2;case 2:return[4,r.listCountries(void 0,(null===(a=this.allowedCountryIds)||void 0===a?void 0:a.length)?this.allowedCountryIds:void 0)];case 3:return e=i.sent(),s=d.routings.find((function(t){return t.id===d.storefrontRoutingId})),(null===(l=null==s?void 0:s.countryCodes)||void 0===l?void 0:l.length)?e=e.filter((function(t){var i;return t.iso2&&(null===(i=s.countryCodes)||void 0===i?void 0:i.includes(t.iso2))})):(o=d.routings.filter((function(t){return t.id!==d.storefrontRoutingId})),e=e.filter((function(t){return t.iso2&&!o.some((function(i){var e;return null===(e=i.countryCodes)||void 0===e?void 0:e.includes(t.iso2)}))}))),this.countries=e,1!==this.countries.length||this.country?this.myCountryCode&&!this.country&&(n=this.countries.find((function(t){return t.iso2===u.myCountryCode})))&&this.onCountryChange(n.id):this.onCountryChange(this.countries[0].id),[3,5];case 4:return i.sent(),[3,5];case 5:return[2]}}))}))},this.listStates=function(){return t(l,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.country)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.listStates(this.country.id)];case 2:return t=i.sent(),this.states=t,this.hasState||this.onStateChange(this.states[0].id),[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}}))}))},this.listCities=function(){return t(l,void 0,void 0,(function(){var t,e,r;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.state)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),t=this,[4,s.listCities(this.state.id,null===(r=this.country)||void 0===r?void 0:r.id)];case 2:return t.cities=i.sent(),[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}}))}))},this.listDistricts=function(){return t(l,void 0,void 0,(function(){var t,e,s;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.city)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),t=this,[4,o.listDistricts(this.city.id,null===(s=this.state)||void 0===s?void 0:s.id)];case 2:return t.districts=i.sent(),this.districts.length?this.address.isDistrictRequired=!0:this.address.isDistrictRequired=!1,[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}}))}))},this.modelToOption=function(t){return{label:t.name,value:t.id+""}},this.onFirstNameChange=function(t){l.firstNameChangeCallback&&l.firstNameChangeCallback(t),l.address.firstName=t},this.onLastNameChange=function(t){l.lastNameChangeCallback&&l.lastNameChangeCallback(t),l.address.lastName=t},this.onPhoneChange=function(t){l.address.phone=t},this.onIdentityNumberChange=function(t){t?t.length<=11&&(l.address.identityNumber=t):l.address.identityNumber=""},this.onAddressTitleChange=function(t){l.address.title=t},this.onAddressLine1Change=function(t){l.address.addressLine1=t},this.onAddressLine2Change=function(t){l.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){l.address.postalCode=t},this.onCountryChange=function(t){var i;if((null===(i=l.country)||void 0===i?void 0:i.id)!==t){var e=l.countries.find((function(i){return i.id===t}));l.address.country={id:null==e?void 0:e.id,name:null==e?void 0:e.name,code:null==e?void 0:e.iso3,iso2:null==e?void 0:e.iso2,iso3:null==e?void 0:e.iso3},l.address.state=void 0,l.address.city=void 0,l.address.district=void 0,l.states=[],l.cities=[],l.districts=[],l.listStates()}},this.onStateChange=function(t){var i;if((null===(i=l.state)||void 0===i?void 0:i.id)!==t){var e=l.states.find((function(i){return i.id===t}));l.address.state={id:e.id,name:null==e?void 0:e.name,code:null==e?void 0:e.stateCode},l.address.city=void 0,l.address.district=void 0,l.cities=[],l.districts=[],l.listCities()}},this.onCityChange=function(t){var i;if((null===(i=l.city)||void 0===i?void 0:i.id)!==t){var e=l.cities.find((function(i){return i.id===t}));l.address.city={id:e.id,name:e.name},l.address.district=void 0,l.districts=[],l.listDistricts()}},this.onCityInputChange=function(t){l.districts=[],l.address.city={id:void 0,name:t}},this.onDistrictChange=function(t){var i;if((null===(i=l.district)||void 0===i?void 0:i.id)!==t){var e=l.districts.find((function(i){return i.id===t}));l.address.district={id:e.id,name:e.name}}},this.onDistrictInputChange=function(t){l.address.district={id:void 0,name:t}},this.onCorporateChange=function(t){l.isCorporate=t,t||(l.address.company=null,l.address.taxNumber=null,l.address.taxOffice=null)},this.onCompanyChange=function(t){l.address.company=t},this.onTaxNumberChange=function(t){l.address.taxNumber=t},this.onTaxOfficeChange=function(t){l.address.taxOffice=t},this.address=a.address,this.isCorporate=a.isCorporate||!1,this.isErrorsVisible=a.isErrorsVisible||!1,this.isCustomerAddress=a.isCustomerAddress||!1,this.allowedCountryIds=a.allowedCountryIds,this.allowCorporateInfo=a.allowCorporateInfo||!1,this.allowTitleChange=a.allowTitleChange||!1,this.firstNameChangeCallback=a.firstNameChangeCallback||null,this.lastNameChangeCallback=a.lastNameChangeCallback||null,e(this,{firstNameChangeCallback:!1,lastNameChangeCallback:!1}),this.fillDropdownOptions()}return Object.defineProperty(u.prototype,"firstName",{get:function(){return this.address.firstName},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"lastName",{get:function(){return this.address.lastName},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"phone",{get:function(){return this.address.phone},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"identityNumber",{get:function(){return this.address.identityNumber},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"country",{get:function(){return this.address.country},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"state",{get:function(){return this.address.state},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"city",{get:function(){return this.address.city},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"district",{get:function(){return this.address.district},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"countryOptions",{get:function(){var t=this.countries.map(this.modelToOption);return t.sort((function(t,i){return a(t.label,i.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"stateOptions",{get:function(){var t=this.states.map(this.modelToOption);return t.sort((function(t,i){return a(t.label,i.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"cityOptions",{get:function(){return this.cities.map(this.modelToOption)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"districtOptions",{get:function(){var t=this.districts.map(this.modelToOption);return t.sort((function(t,i){return a(t.label,i.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isFreeTextCity",{get:function(){var t=this;return l.some((function(i){var e,s;return(null===(s=null===(e=t.address.country)||void 0===e?void 0:e.iso2)||void 0===s?void 0:s.toLowerCase())===i.toLowerCase()}))},enumerable:!1,configurable:!0}),u}();export{u as default};
1
+ import{__awaiter as t,__generator as i}from'../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as e}from"mobx";import"../../../../api/blog/index.js";import"../../../../api/brand/index.js";import"../../../../api/cart/index.js";import"../../../../api/category/index.js";import"../../../../api/checkout/index.js";import{IkasCityAPI as s}from"../../../../api/city/index.js";import{IkasCountryAPI as r}from"../../../../api/country/index.js";import"../../../../api/customer/index.js";import"../../../../api/customer-review/index.js";import"../../../../api/customer-review-summary/index.js";import{IkasDistrictAPI as o}from"../../../../api/district/index.js";import"../../../../api/html-meta-data/index.js";import"../../../../api/merchant/index.js";import"../../../../api/product-search/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/customer-review/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/installment-info/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../api/product-option-file/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product-attribute/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product-filter/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/data/order-transaction/index.js";import"../../../../models/data/product-option-set/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/product-campaing/campaign/index.js";import"../../../../models/data/customer-attribute/index.js";import"../../../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../../../models/theme/theme.js";import"../../../../models/theme/page/index.js";import"../../../../models/theme/component/prop/index.js";import"../../../../models/theme/page/component/prop-value/link.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-detail/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import"../../../../models/ui/validator/index.js";import"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import"../../../../models/theme/settings/index.js";import"../../../../models/theme/custom-data/index.js";import"../../../../api/apollo.js";import"../../../../api/favorite-product/index.js";import"../../../../api/contact-form/index.js";import{IkasStateAPI as n}from"../../../../api/state/index.js";import"../../../../api/product-option-set/index.js";import"../../../../api/raffle/index.js";import"../../../../api/back-in-stock-reminder/index.js";import"../../../../api/product-campaign/index.js";import{stringSorter as a}from"../../../../utils/helper.js";import{IkasStorefrontConfig as d}from"../../../../storefront/index.js";import"../../../../utils/i18n.js";import{FREE_TEXT_CITY_COUNTRY_LIST as l,DISTRICT_HIDDEN_COUNTRY_LIST as u}from"../../../../utils/constants.js";var c=function(){function c(a){var l=this;this.isCorporate=!1,this.isErrorsVisible=!1,this.allowedCountryIds=null,this.allowCorporateInfo=!1,this.allowTitleChange=!1,this.firstNameChangeCallback=null,this.lastNameChangeCallback=null,this.countries=[],this.states=[],this.cities=[],this.districts=[],this.myCountryCode=null,this.fillDropdownOptions=function(){return t(l,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.listCountries()];case 1:return t.sent(),[4,this.listStates()];case 2:return t.sent(),[4,this.listCities()];case 3:return t.sent(),[4,this.listDistricts()];case 4:return t.sent(),[2]}}))}))},this.listCountries=function(){return t(l,void 0,void 0,(function(){var t,e,s,o,n,a,l,u=this;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),this.myCountryCode?[3,2]:(t=this,[4,r.getMyCountry()]);case 1:t.myCountryCode=i.sent()||void 0,i.label=2;case 2:return[4,r.listCountries(void 0,(null===(a=this.allowedCountryIds)||void 0===a?void 0:a.length)?this.allowedCountryIds:void 0)];case 3:return e=i.sent(),s=d.routings.find((function(t){return t.id===d.storefrontRoutingId})),(null===(l=null==s?void 0:s.countryCodes)||void 0===l?void 0:l.length)?e=e.filter((function(t){var i;return t.iso2&&(null===(i=s.countryCodes)||void 0===i?void 0:i.includes(t.iso2))})):(o=d.routings.filter((function(t){return t.id!==d.storefrontRoutingId})),e=e.filter((function(t){return t.iso2&&!o.some((function(i){var e;return null===(e=i.countryCodes)||void 0===e?void 0:e.includes(t.iso2)}))}))),this.countries=e,1!==this.countries.length||this.country?this.myCountryCode&&!this.country&&(n=this.countries.find((function(t){return t.iso2===u.myCountryCode})))&&this.onCountryChange(n.id):this.onCountryChange(this.countries[0].id),[3,5];case 4:return i.sent(),[3,5];case 5:return[2]}}))}))},this.listStates=function(){return t(l,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.country)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.listStates(this.country.id)];case 2:return t=i.sent(),this.states=t,this.hasState||this.onStateChange(this.states[0].id),[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}}))}))},this.listCities=function(){return t(l,void 0,void 0,(function(){var t,e,r;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.state)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),t=this,[4,s.listCities(this.state.id,null===(r=this.country)||void 0===r?void 0:r.id)];case 2:return t.cities=i.sent(),[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}}))}))},this.listDistricts=function(){return t(l,void 0,void 0,(function(){var t,e,s;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.city)||void 0===e?void 0:e.id)||this.isDistrictHidden)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),t=this,[4,o.listDistricts(this.city.id,null===(s=this.state)||void 0===s?void 0:s.id)];case 2:return t.districts=i.sent(),this.districts.length?this.address.isDistrictRequired=!0:this.address.isDistrictRequired=!1,[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}}))}))},this.modelToOption=function(t){return{label:t.name,value:t.id+""}},this.onFirstNameChange=function(t){l.firstNameChangeCallback&&l.firstNameChangeCallback(t),l.address.firstName=t},this.onLastNameChange=function(t){l.lastNameChangeCallback&&l.lastNameChangeCallback(t),l.address.lastName=t},this.onPhoneChange=function(t){l.address.phone=t},this.onIdentityNumberChange=function(t){t?t.length<=11&&(l.address.identityNumber=t):l.address.identityNumber=""},this.onAddressTitleChange=function(t){l.address.title=t},this.onAddressLine1Change=function(t){l.address.addressLine1=t},this.onAddressLine2Change=function(t){l.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){l.address.postalCode=t},this.onCountryChange=function(t){var i;if((null===(i=l.country)||void 0===i?void 0:i.id)!==t){var e=l.countries.find((function(i){return i.id===t}));l.address.country={id:null==e?void 0:e.id,name:null==e?void 0:e.name,code:null==e?void 0:e.iso3,iso2:null==e?void 0:e.iso2,iso3:null==e?void 0:e.iso3},l.address.state=void 0,l.address.city=void 0,l.address.district=void 0,l.states=[],l.cities=[],l.districts=[],l.listStates()}},this.onStateChange=function(t){var i;if((null===(i=l.state)||void 0===i?void 0:i.id)!==t){var e=l.states.find((function(i){return i.id===t}));l.address.state={id:e.id,name:null==e?void 0:e.name,code:null==e?void 0:e.stateCode},l.address.city=void 0,l.address.district=void 0,l.cities=[],l.districts=[],l.listCities()}},this.onCityChange=function(t){var i;if((null===(i=l.city)||void 0===i?void 0:i.id)!==t){var e=l.cities.find((function(i){return i.id===t}));l.address.city={id:e.id,name:e.name},l.address.district=void 0,l.districts=[],l.listDistricts()}},this.onCityInputChange=function(t){l.districts=[],l.address.city={id:void 0,name:t}},this.onDistrictChange=function(t){var i;if((null===(i=l.district)||void 0===i?void 0:i.id)!==t){var e=l.districts.find((function(i){return i.id===t}));l.address.district={id:e.id,name:e.name}}},this.onDistrictInputChange=function(t){l.address.district={id:void 0,name:t}},this.onCorporateChange=function(t){l.isCorporate=t,t||(l.address.company=null,l.address.taxNumber=null,l.address.taxOffice=null)},this.onCompanyChange=function(t){l.address.company=t},this.onTaxNumberChange=function(t){l.address.taxNumber=t},this.onTaxOfficeChange=function(t){l.address.taxOffice=t},this.address=a.address,this.isCorporate=a.isCorporate||!1,this.isErrorsVisible=a.isErrorsVisible||!1,this.isCustomerAddress=a.isCustomerAddress||!1,this.allowedCountryIds=a.allowedCountryIds,this.allowCorporateInfo=a.allowCorporateInfo||!1,this.allowTitleChange=a.allowTitleChange||!1,this.firstNameChangeCallback=a.firstNameChangeCallback||null,this.lastNameChangeCallback=a.lastNameChangeCallback||null,e(this,{firstNameChangeCallback:!1,lastNameChangeCallback:!1}),this.fillDropdownOptions()}return Object.defineProperty(c.prototype,"firstName",{get:function(){return this.address.firstName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"lastName",{get:function(){return this.address.lastName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"phone",{get:function(){return this.address.phone},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"identityNumber",{get:function(){return this.address.identityNumber},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"country",{get:function(){return this.address.country},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"state",{get:function(){return this.address.state},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"city",{get:function(){return this.address.city},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"district",{get:function(){return this.address.district},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"countryOptions",{get:function(){var t=this.countries.map(this.modelToOption);return t.sort((function(t,i){return a(t.label,i.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"stateOptions",{get:function(){var t=this.states.map(this.modelToOption);return t.sort((function(t,i){return a(t.label,i.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"cityOptions",{get:function(){return this.cities.map(this.modelToOption)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"districtOptions",{get:function(){var t=this.districts.map(this.modelToOption);return t.sort((function(t,i){return a(t.label,i.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isFreeTextCity",{get:function(){var t=this;return l.some((function(i){var e,s;return(null===(s=null===(e=t.address.country)||void 0===e?void 0:e.iso2)||void 0===s?void 0:s.toLowerCase())===i.toLowerCase()}))},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isDistrictHidden",{get:function(){var t=this;return u.some((function(i){var e,s;return(null===(s=null===(e=t.address.country)||void 0===e?void 0:e.iso2)||void 0===s?void 0:s.toLowerCase())===i.toLowerCase()}))},enumerable:!1,configurable:!0}),c}();export{c as default};