@snabcentr/common-lib 1.66.0 → 1.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/manifest.json +1 -1
  2. package/dist/release_notes.tmp +3 -3
  3. package/dist/sc-common-lib.js +891 -858
  4. package/dist/sc-common-lib.js.map +1 -1
  5. package/dist/sc-common-lib.umd.cjs +1 -1
  6. package/dist/sc-common-lib.umd.cjs.map +1 -1
  7. package/dist/src/auth/index.d.ts +1 -0
  8. package/dist/src/auth/index.d.ts.map +1 -1
  9. package/dist/src/auth/states/auth-state-store.d.ts +50 -0
  10. package/dist/src/auth/states/auth-state-store.d.ts.map +1 -0
  11. package/dist/src/auth/states/index.d.ts +2 -0
  12. package/dist/src/auth/states/index.d.ts.map +1 -0
  13. package/dist/src/http/classes/http-requester.d.ts +4 -0
  14. package/dist/src/http/classes/http-requester.d.ts.map +1 -1
  15. package/dist/src/index.d.ts +0 -1
  16. package/dist/src/index.d.ts.map +1 -1
  17. package/dist/src/references/index.d.ts +1 -0
  18. package/dist/src/references/index.d.ts.map +1 -1
  19. package/dist/src/references/states/index.d.ts +2 -0
  20. package/dist/src/references/states/index.d.ts.map +1 -0
  21. package/dist/src/{states/references-store.d.ts → references/states/references-state-store.d.ts} +18 -18
  22. package/dist/src/references/states/references-state-store.d.ts.map +1 -0
  23. package/dist/src/user/index.d.ts +1 -0
  24. package/dist/src/user/index.d.ts.map +1 -1
  25. package/dist/src/user/providers/user-auth-data-provider.d.ts +17 -0
  26. package/dist/src/user/providers/user-auth-data-provider.d.ts.map +1 -0
  27. package/dist/src/user/providers/user-data-provider.d.ts.map +1 -1
  28. package/dist/src/user/states/index.d.ts +2 -0
  29. package/dist/src/user/states/index.d.ts.map +1 -0
  30. package/dist/src/user/states/user-state-store.d.ts +21 -0
  31. package/dist/src/user/states/user-state-store.d.ts.map +1 -0
  32. package/package.json +2 -1
  33. package/dist/src/states/index.d.ts +0 -3
  34. package/dist/src/states/index.d.ts.map +0 -1
  35. package/dist/src/states/references-store.d.ts.map +0 -1
  36. package/dist/src/states/user-state-store.d.ts +0 -45
  37. package/dist/src/states/user-state-store.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- (function(c,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("jwt-decode"),require("lodash-es"),require("ts-case-convert"),require("date-fns"),require("pinia"),require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","jwt-decode","lodash-es","ts-case-convert","date-fns","pinia","vue","axios"],a):(c=typeof globalThis<"u"?globalThis:c||self,a(c["SC Common Lib"]={},c["jwt-decode"],c["lodash-es"],c["ts-case-convert"],c["date-fns"],c.pinia,c.vue,c.axios))})(this,function(c,a,g,se,h,Ce,m,qr){"use strict";var ft=Object.defineProperty;var yt=(c,a,g)=>a in c?ft(c,a,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[a]=g;var t=(c,a,g)=>yt(c,typeof a!="symbol"?a+"":a,g);class ne{constructor(r){t(this,"exp",0);t(this,"iat",0);t(this,"authTime",0);t(this,"jti","");t(this,"iss","");t(this,"aud",[]);t(this,"sub","");t(this,"typ","Bearer");t(this,"azp","");t(this,"sid","");t(this,"acr","");t(this,"allowedOrigins",[]);t(this,"realmAccess",{roles:[]});t(this,"resourceAccess",{});t(this,"scope","");t(this,"emailVerified",!1);t(this,"name","");t(this,"guid","");t(this,"preferredUsername","");t(this,"givenName","");t(this,"email","");g.merge(this,r)}static getJwtPayload(r){return new ne(se.objectToCamel(a.jwtDecode(r)))}}class Ur extends ne{constructor(e){super(e);t(this,"familyName");t(this,"middleName");t(this,"locale");t(this,"phoneNumber");t(this,"phoneNumberVerified");t(this,"address");g.merge(this,e)}static getJwtPayload(e){return new ne(se.objectToCamel(a.jwtDecode(e)))}}class q{constructor(r,e){t(this,"id");t(this,"guid");this.id=r==null?void 0:r.id,g.isNil(this.id)&&(g.isNil(e)?typeof(r==null?void 0:r.id)=="number"?this.id=-1:typeof(r==null?void 0:r.id)=="string"&&(this.id=""):this.id=e),this.guid=(r==null?void 0:r.guid)??""}isNewRec(){return typeof this.id=="number"?this.id===-1:typeof this.id=="string"?this.id==="":g.isNil(this.id)}}class D extends q{constructor(e){super(e);t(this,"name","");this.name=(e==null?void 0:e.name)??""}}class Le extends D{constructor(e){super(e);t(this,"slug");t(this,"code");t(this,"type");this.slug=(e==null?void 0:e.slug)??"",this.code=(e==null?void 0:e.code)??""}}class Pe extends Le{constructor(e){super(e);t(this,"isPrimary");this.isPrimary=(e==null?void 0:e.isPrimary)??!1}}class oe extends Pe{constructor(e){super(e);t(this,"isHidden");t(this,"parentCategoryId");t(this,"properties");t(this,"currencyRates");this.isHidden=(e==null?void 0:e.isHidden)??!1,this.parentCategoryId=e==null?void 0:e.parentCategoryId,this.properties=e==null?void 0:e.properties,this.type="category",this.currencyRates=e!=null&&e.currencyRates?Object.fromEntries(Object.entries(e.currencyRates).map(([i,s])=>[g.toUpper(i),s])):void 0}}var Oe=(n=>(n.K0="k0",n.K1="k1",n.K2="k2",n.K3="k3",n.K4="k4",n.Retail="retail",n))(Oe||{});class P extends D{constructor(e){super(e);t(this,"slug");t(this,"description");this.description=e==null?void 0:e.description,this.slug=e==null?void 0:e.slug}}class ce extends P{static getRetailPriceCoefficient(){return{id:-2,slug:Oe.Retail,name:"Розн. цена",guid:"",isNewRec:g.constant(!0)}}}class we{constructor(r){t(this,"coefficient");t(this,"value");t(this,"cost");t(this,"percent");t(this,"readOnly");this.coefficient=new ce(r==null?void 0:r.coefficient),this.value=(r==null?void 0:r.value)??0,this.cost=(r==null?void 0:r.cost)??0,this.percent=(r==null?void 0:r.percent)??0,this.readOnly=(r==null?void 0:r.readOnly)??!0}}class ke{constructor(r){t(this,"lat");t(this,"long");this.lat=(r==null?void 0:r.lat)??0,this.long=(r==null?void 0:r.long)??0}}class H extends P{}class le extends P{constructor(e){var i;super(e);t(this,"address");t(this,"isMain");t(this,"deliveryTypes");t(this,"regions");t(this,"coordinates");this.address=(e==null?void 0:e.address)??"",this.isMain=(e==null?void 0:e.isMain)??!1,this.deliveryTypes=((i=e==null?void 0:e.deliveryTypes)==null?void 0:i.map(s=>new H(s)))??[],this.regions=(e==null?void 0:e.regions)??[],this.coordinates=new ke(e==null?void 0:e.coordinates)}}class er{constructor(r){t(this,"warehouse");t(this,"count");this.warehouse=new le(r==null?void 0:r.warehouse),this.count=(r==null?void 0:r.count)??0}}const re=class re{static init(r){re.config=r}static getConfig(){if(g.isUndefined(re.config))throw new Error("Config is undefined. Please set config by AppConfigProvider.init().");return re.config}static loadRemoteConfig(r="/config.json"){const e=fetch(r).then(i=>i.ok?i.json():(console.error(new Error(`Ошибка загрузки ${r}: ${i.statusText}`)),new Promise(s=>{s({})})));return e.catch(i=>{console.error(i)}),e}};t(re,"config");let A=re;class rr extends Le{constructor(e){super(e);t(this,"isHidden");this.isHidden=(e==null?void 0:e.isHidden)??!1}}class tr{constructor(r,e){t(this,"image");t(this,"preview");t(this,"isDefault");this.image=`${e??""}${r.image}`,this.preview=`${e??""}${r.preview}`,this.isDefault=r.isDefault}}class T extends rr{constructor(e){var s,o,l,p;super(e);t(this,"supplierSku");t(this,"unit");t(this,"pack");t(this,"minCount");t(this,"quantityUnit");t(this,"currency");t(this,"currencySignature");t(this,"cost");t(this,"costRub");t(this,"costDate");t(this,"onOrder");t(this,"stockCount");t(this,"category");t(this,"categories");t(this,"images");t(this,"properties");t(this,"retailCost");t(this,"retailCostRub");t(this,"priceCoefficients");this.supplierSku=e==null?void 0:e.supplierSku,this.unit=(e==null?void 0:e.unit)??"",this.pack=e==null?void 0:e.pack,this.minCount=e==null?void 0:e.minCount,this.quantityUnit=e==null?void 0:e.quantityUnit,this.currency=(e==null?void 0:e.currency)??"",this.cost=(e==null?void 0:e.cost)??0,this.costRub=(e==null?void 0:e.costRub)??0,this.costDate=g.isString(e==null?void 0:e.costDate)?h.parseISO(e.costDate):e==null?void 0:e.costDate,this.onOrder=(e==null?void 0:e.onOrder)??!1,this.stockCount=((s=e==null?void 0:e.stockCount)==null?void 0:s.map(f=>new er(f)))??[],this.currencySignature=(e==null?void 0:e.currencySignature)??"",this.type="product";const i=(e==null?void 0:e.category)??((o=e==null?void 0:e.categories)==null?void 0:o.find(f=>f.isPrimary));i&&(this.category=new Pe({...i,isPrimary:!0}),this.categories=[this.category]),e!=null&&e.categories&&(this.categories=e.categories.map(f=>new Pe(f))),this.images=((l=e==null?void 0:e.images)==null?void 0:l.map(f=>new tr(f,A.getConfig().http.mediaUrl)))??[],this.properties=(e==null?void 0:e.properties)??{},this.retailCost=e==null?void 0:e.retailCost,this.retailCostRub=e==null?void 0:e.retailCostRub,this.priceCoefficients=((p=e==null?void 0:e.priceCoefficients)==null?void 0:p.map(f=>new we(f)))??[],e&&"codeNumber"in e&&!e.code&&(this.code=e==null?void 0:e.codeNumber)}getIsMeasurable(){var i;const e=(i=A.getConfig().catalog)==null?void 0:i.products.units;return[...(e==null?void 0:e.linear)??["пог.м.","м."],...(e==null?void 0:e.square)??["м2"]].includes(this.unit)}getRetailCost(){return this.retailCost??this.cost}getRetailCostRub(){return this.retailCostRub??this.costRub}}class ir extends q{constructor(e){super(e);t(this,"category");t(this,"product");t(this,"quantity");t(this,"height");t(this,"length");t(this,"width");t(this,"barcode");t(this,"marker");t(this,"configurator");t(this,"configuratorParams");t(this,"isAdditionalSale");this.product=new T(e==null?void 0:e.product),this.quantity=e.quantity??0,this.marker=e.marker,this.category=e.category??new oe,this.height=e.height,this.length=e.length,this.width=e.width,this.configurator=e.configurator,this.configuratorParams=e.configuratorParams&&g.cloneDeep(e.configuratorParams),this.isAdditionalSale=e.isAdditionalSale}}class sr extends ir{constructor(e){super(e);t(this,"currency");t(this,"cost");t(this,"costOne");t(this,"costOneRub");t(this,"costRub");t(this,"logicGroupId");t(this,"salesDirection");t(this,"specificationImgUrl");t(this,"sawing");this.currency=e.currency,this.cost=e.cost,this.costOne=e.costOne,this.costOneRub=e.costOneRub,this.costRub=e.costRub,this.logicGroupId=e.logicGroupId,this.salesDirection=e.salesDirection,this.specificationImgUrl=e.specificationImgUrl,this.sawing=e.sawing}}class ue{constructor(r){t(this,"items");t(this,"resultSum");t(this,"directionsSum");this.items=r.items.map(e=>new sr(e)),this.resultSum=r.resultSum,this.directionsSum=r.directionsSum}}class b extends P{}class de extends D{constructor(e){super(e);t(this,"phone");t(this,"email");t(this,"getNews");t(this,"salesDirection");t(this,"createdAt");t(this,"lastLoginAt");t(this,"isActive");this.phone=/^\d+$/.test((e==null?void 0:e.phone)??"")?`+${e==null?void 0:e.phone}`:(e==null?void 0:e.phone)??"",this.email=(e==null?void 0:e.email)??"",this.getNews=(e==null?void 0:e.getNews)??!1,this.salesDirection=e!=null&&e.salesDirection?new b(e.salesDirection):void 0,this.createdAt=g.isString(e==null?void 0:e.createdAt)?h.parseISO(e.createdAt):e==null?void 0:e.createdAt,this.lastLoginAt=g.isString(e==null?void 0:e.lastLoginAt)?h.parseISO(e.lastLoginAt):e==null?void 0:e.lastLoginAt,this.isActive=(e==null?void 0:e.isActive)??!1}}class nr extends de{constructor(e){super(e);t(this,"type");t(this,"canDoReclamations");t(this,"photo");this.type=e==null?void 0:e.type,this.canDoReclamations=(e==null?void 0:e.canDoReclamations)??!1,this.photo=e==null?void 0:e.photo}}class or extends y{getCurrentUser(){return this.get("/internal/users/info",{},r=>new nr(r.data))}}const ve=Ce.defineStore("__user_state_private",()=>{var i;const n=m.ref({}),r=m.ref(Promise.resolve((i=A.getConfig().devMode)==null?void 0:i.initAuthBearerToken)),e=m.ref(void 0);return{dataLoaderList:n,accessTokenPromise:r,currentUser:e}}),Ne=Ce.defineStore("user_state",()=>{const n=m.computed({get(){return ve().accessTokenPromise},set(i){ve().accessTokenPromise=i}}),r=()=>{ve().accessTokenPromise=void 0},e=m.computed(()=>{const i=ve();return!i.currentUser&&!i.dataLoaderList.currentUser&&(i.dataLoaderList.currentUser=!0,y.getInstance(or).getCurrentUser().then(s=>{i.currentUser=s}).catch(g.noop).finally(g.noop)),i.currentUser});return{accessTokenPromise:n,invalidateJwtAccessToken:r,currentUser:e}});class Re{static simpleInstanceInitializer(r){return new r}static instanceInitializer(r,e){return new r(e)}}const I=class I{constructor(){t(this,"httpClient");t(this,"baseUrl",`${A.getConfig().http.portalApiUrl}/api`);t(this,"errorResponseHandler",g.noop);t(this,"setBaseUrlRequestInterceptor",r=>(r.baseURL=this.baseUrl,r));t(this,"authRequestInterceptor",async r=>{const e=await Ne().accessTokenPromise;return e&&r.headers.set("Authorization",`Bearer ${e}`),r});t(this,"dataConverterRequestInterceptor",r=>(r.method&&(r.method==="get"&&r.params&&(r.params=se.objectToSnake(r.params)),["put","patch","post"].includes(g.toLower(r.method))&&r.data&&(r.data=se.objectToSnake(r.data))),r));t(this,"authErrorsResponseInterceptors",r=>{var i;const e=r.rawError?(i=r.rawError)==null?void 0:i.config:void 0;return r.status===401?!e||e.__isRetryRequest?Promise.reject(r):(Ne().invalidateJwtAccessToken(),e.__isRetryRequest=!0,this.httpClient(e)):Promise.reject(r)});t(this,"dataConverterResponseInterceptor",r=>(r.data&&(r.data=se.objectToCamel(r.data)),r));const r=A.getConfig().version;this.errorResponseHandler=I.defaultErrorsResponseHandler,this.httpClient=qr.create({headers:{"APP-VERSION":`${r.name} (${r.version}, ${h.format(r.date,A.getConfig().dateFormats.uiDate)})`,Accept:"application/json","Content-Type":"application/json"}}),this.httpClient.interceptors.request.use(this.setBaseUrlRequestInterceptor,e=>Promise.reject(e)),this.httpClient.interceptors.request.use(this.authRequestInterceptor,e=>Promise.reject(e)),this.httpClient.interceptors.request.use(this.dataConverterRequestInterceptor,e=>Promise.reject(e)),this.httpClient.interceptors.response.use(e=>e,this.authErrorsResponseInterceptors),this.httpClient.interceptors.response.use(this.dataConverterResponseInterceptor,e=>I.convertHttpErrorResponse(e))}static setDefaultErrorsResponseHandler(r){I.defaultErrorsResponseHandler=r}static getInstance(r){return Object.prototype.hasOwnProperty.call(I.instances,r.name)||(I.instances[r.name]=Re.simpleInstanceInitializer(r)),I.instances[r.name]}static convertHttpErrorResponse(r){var i,s;const e=r==null?void 0:r.response;return Promise.reject({status:(e==null?void 0:e.status)??0,statusText:(e==null?void 0:e.statusText)??"Unknown",message:((i=e==null?void 0:e.data)==null?void 0:i.message)??"Unknown Error. Probably network error.",errors:(s=e==null?void 0:e.data)==null?void 0:s.errors,headers:(e==null?void 0:e.headers)??{},data:e==null?void 0:e.data,rawError:r})}request(r,e=void 0,i={},s=!1){const o=this.httpClient.request(r).then(l=>e?e(l):l.data);return o.catch(l=>{this.errorResponseHandler(l,i,s)}),o}get(r,e={},i=void 0,s=!1){return this.request({method:"GET",url:r,params:e},i,{},s)}getBlob(r,e={},i=void 0,s=!1){return this.request({method:"GET",url:r,params:e,responseType:"blob"},i,{},s)}patch(r,e={},i=void 0,s={},o=!1){return this.request({method:"PATCH",url:r,data:e},i,s,o)}post(r,e={},i=void 0,s={},o=!1){return this.request({method:"POST",url:r,data:e},i,s,o)}delete(r,e=void 0,i=!1){return this.request({method:"DELETE",url:r},e,{},i)}};t(I,"instances",{}),t(I,"defaultErrorsResponseHandler",g.noop);let y=I;class Gr extends y{getCart(r){return this.get(`internal/clients/${r.id}/cart`,{},e=>new ue(e.data))}deleteCart(r){return this.delete(`internal/clients/${r.id}/cart`)}addCartItem(r,e,i={}){return this.patch(`internal/clients/${r.id}/cart`,{id:e.configurator&&e.category.id,productId:e.product.id,quantity:e.quantity,height:e.height,length:e.length,width:e.width,configurator:e.configurator,marker:e.marker,isAdditionalSale:e.isAdditionalSale,...e.configuratorParams},s=>new ue(s.data),i)}patchCartItem(r,e,i={}){return this.patch(`internal/clients/${r.id}/cart/${e.id}`,{id:e.configurator&&e.category.id,productId:e.product.id,quantity:e.quantity,height:e.height,length:e.length,width:e.width,configurator:e.configurator,marker:e.marker,isAdditionalSale:e.isAdditionalSale,...e.configuratorParams},s=>new ue(s.data),i)}deleteCartItem(r,e){return this.get(`internal/clients/${r.id}/cart/${e.id}`,{})}addCartItemFromCSV(r){return this.post(`internal/clients/${r.id}/cart/add-products-from-csv`,{},e=>new ue(e.data))}}var cr=(n=>(n.m2Cost="m2Cost",n.percent="percent",n.value="value",n))(cr||{}),ae=(n=>(n.Discount="discount",n.PriceTemplate="price_template",n.ClientPrice="client_price",n.Product="product",n))(ae||{}),lr=(n=>(n.Unknown="unknown",n.Bool="bool",n.Integer="integer",n.Float="float",n.String="string",n.Range="range",n.Json="json",n.Object="object",n))(lr||{});class U extends oe{constructor(e){var i,s;super(e);t(this,"categories");t(this,"products");this.categories=(i=e==null?void 0:e.categories)==null?void 0:i.map(o=>new U(o)),this.products=(s=e==null?void 0:e.products)==null?void 0:s.map(o=>new T(o))}}class qe extends D{constructor(e){super(e);t(this,"updatedAt");this.updatedAt=g.isString(e==null?void 0:e.updatedAt)?h.parseISO(e.updatedAt):e==null?void 0:e.updatedAt}}class ur extends qe{constructor(e){super(e);t(this,"deletedAt");this.deletedAt=g.isString(e==null?void 0:e.deletedAt)?h.parseISO(e.deletedAt):e==null?void 0:e.deletedAt}}class Mr{static getActualDataFromStorage(r){const e=localStorage.getItem(r);if(e)try{const i=JSON.parse(e);if(h.isAfter(h.parseISO(i.availableFor)||h.startOfToday(),new Date))return i.data??{}}catch{localStorage.removeItem(r)}}static saveActualDataToStorage(r,e,i){localStorage.setItem(r,JSON.stringify({availableFor:i,data:e}))}}class G extends D{constructor(e){super(e);t(this,"type");this.type=e==null?void 0:e.type}}class pr extends D{constructor(e){super(e);t(this,"costCoefficient");t(this,"isLowPriceAllowed");t(this,"publishedAt");t(this,"description");t(this,"percent");t(this,"owner");t(this,"deletedAt");this.costCoefficient=(e==null?void 0:e.costCoefficient)??0,this.isLowPriceAllowed=(e==null?void 0:e.isLowPriceAllowed)??!1,this.publishedAt=g.isString(e==null?void 0:e.publishedAt)?h.parseISO(e.publishedAt):e==null?void 0:e.publishedAt,this.description=(e==null?void 0:e.description)??void 0,this.percent=(e==null?void 0:e.percent)??0,this.owner=new G(e==null?void 0:e.owner),this.deletedAt=g.isString(e==null?void 0:e.deletedAt)?h.parseISO(e.deletedAt):e==null?void 0:e.deletedAt}}class j extends qe{constructor(e){super(e);t(this,"description");t(this,"createdAt");this.description=(e==null?void 0:e.description)??"",this.createdAt=g.isString(e==null?void 0:e.createdAt)?h.parseISO(e.createdAt):(e==null?void 0:e.createdAt)??new Date}}class z extends T{constructor(e){super(e);t(this,"costCoefficient");t(this,"costSource");t(this,"discount");t(this,"priceTemplate");t(this,"isPreviouslyOrdered");t(this,"isRequired");t(this,"isFavorite");this.costCoefficient=(e==null?void 0:e.costCoefficient)??0,this.costSource=(e==null?void 0:e.costSource)??ae.Product,this.discount=e!=null&&e.discount?new pr(e.discount):void 0,this.priceTemplate=e!=null&&e.priceTemplate?new j(e.priceTemplate):void 0,this.isPreviouslyOrdered=e==null?void 0:e.isPreviouslyOrdered,this.isRequired=e==null?void 0:e.isRequired,this.isFavorite=e==null?void 0:e.isFavorite}}class gr{constructor(r){t(this,"phone");t(this,"email");this.phone=/^\d+$/.test(r.phone??"")?`+${r.phone}`:r.phone,this.email=r.email}}class K extends D{constructor(e){super(e);t(this,"salesDirection",new b);t(this,"photo");t(this,"contacts");t(this,"isDefault");e&&(this.salesDirection=new b(e.salesDirection),this.photo=e.photo,e.contacts&&(this.contacts=new gr(e.contacts)),e.isDefault!==void 0&&(this.isDefault=e.isDefault))}}class pe extends K{constructor(e){super(e);t(this,"isActive");t(this,"isSupervisor");t(this,"canDoReclamations");t(this,"createdAt");t(this,"supervisorId");this.isActive=(e==null?void 0:e.isActive)??!1,this.isSupervisor=(e==null?void 0:e.isSupervisor)??!1,this.canDoReclamations=(e==null?void 0:e.canDoReclamations)??!1,this.createdAt=e==null?void 0:e.createdAt,this.supervisorId=e==null?void 0:e.supervisorId}}class Br extends oe{constructor(e){super(e);t(this,"isDisabled");t(this,"isRequired");t(this,"isFavorite");t(this,"hidingComment");t(this,"manager");this.isDisabled=(e==null?void 0:e.isDisabled)??!1,this.isRequired=(e==null?void 0:e.isRequired)??!1,this.isFavorite=(e==null?void 0:e.isFavorite)??!1,this.hidingComment=e==null?void 0:e.hidingComment,this.manager=e!=null&&e.manager?new pe(e.manager):void 0}}class ge extends Br{constructor(e){var i,s;super(e);t(this,"categories");t(this,"products");this.categories=(i=e==null?void 0:e.categories)==null?void 0:i.map(o=>new ge(o)),this.products=(s=e==null?void 0:e.products)==null?void 0:s.map(o=>new z(o))}}class Ue{constructor(r){t(this,"priceCoefficient");t(this,"increasePercent");this.priceCoefficient=(r==null?void 0:r.priceCoefficient)&&new ce(r.priceCoefficient),this.increasePercent=r==null?void 0:r.increasePercent}}class De extends Ue{constructor(e){super(e);t(this,"productCategory");this.productCategory=new oe(e==null?void 0:e.productCategory)}}class W extends P{}class Q extends P{constructor(e){super(e);t(this,"country",new W);e&&(this.country=new W(e.country))}}class Ae extends P{constructor(e){super(e);t(this,"region",new Q);e&&(this.region=new Q(e.region))}}class Y extends de{constructor(e){var i;super(e);t(this,"salesDirection");t(this,"debt");t(this,"alternativeName");t(this,"city");t(this,"comment");t(this,"isPhoneApproved");t(this,"isEmailApproved");t(this,"managers");this.salesDirection=new b(e==null?void 0:e.salesDirection),this.debt=(e==null?void 0:e.debt)??0,this.alternativeName=(e==null?void 0:e.alternativeName)??"",this.city=new Ae(e==null?void 0:e.city),this.comment=e==null?void 0:e.comment,this.isPhoneApproved=(e==null?void 0:e.isPhoneApproved)??!1,this.isEmailApproved=(e==null?void 0:e.isEmailApproved)??!1,this.managers=((i=e==null?void 0:e.managers)==null?void 0:i.map(s=>new K(s)))??[]}}class X extends q{constructor(e){super(e);t(this,"createdAt");t(this,"deletedAt");t(this,"client");t(this,"priceTemplate");this.createdAt=g.isString(e==null?void 0:e.createdAt)?h.parseISO(e.createdAt):(e==null?void 0:e.createdAt)??new Date,this.deletedAt=g.isString(e==null?void 0:e.deletedAt)?h.parseISO(e.deletedAt):e==null?void 0:e.deletedAt,this.client=new Y(e==null?void 0:e.client),this.priceTemplate=new j(e==null?void 0:e.priceTemplate)}}class $e extends Ue{constructor(e){super(e);t(this,"product");this.product=new T(e==null?void 0:e.product)}}class Ge extends P{}class Z extends D{constructor(e){super(e);t(this,"type");t(this,"description");t(this,"metadata");this.type=new Ge(e==null?void 0:e.type),this.description=(e==null?void 0:e.description)??"",this.metadata=e==null?void 0:e.metadata}}class V{constructor(r){t(this,"property");t(this,"value");this.property=new Z(r==null?void 0:r.property),this.value=(r==null?void 0:r.value)??""}}class _{constructor(r){t(this,"from");t(this,"to");this.from=g.isString(r==null?void 0:r.from)?h.parseISO(r.from):(r==null?void 0:r.from)??null,this.to=g.isString(r==null?void 0:r.to)?h.parseISO(r.to):(r==null?void 0:r.to)??null}}class Hr{constructor(r){t(this,"id");t(this,"name");t(this,"description");t(this,"createdAt",new _);t(this,"updatedAt",new _);this.id=r==null?void 0:r.id,this.name=r==null?void 0:r.name,this.description=r==null?void 0:r.description,this.createdAt=new _(r==null?void 0:r.createdAt),this.updatedAt=new _(r==null?void 0:r.updatedAt)}resetFilterValue(r){switch(r){case"id":case"name":case"description":this[r]=void 0;break;case"createdAt":this.createdAt.from=null,this.createdAt.to=null;break;case"updatedAt":this.updatedAt.from=null,this.updatedAt.to=null;break}return this}asClearRaw(){var e,i,s,o;const r={};return Object.keys(this).forEach(l=>{const p=this[l];g.isNil(p)||g.isString(p)&&p.trim().length===0||g.isFunction(p.isNewRec)&&p.isNewRec()||(r[l]=p)}),!((e=r==null?void 0:r.createdAt)!=null&&e.from)&&!((i=r==null?void 0:r.createdAt)!=null&&i.to)&&delete r.createdAt,!((s=r==null?void 0:r.updatedAt)!=null&&s.from)&&!((o=r==null?void 0:r.updatedAt)!=null&&o.to)&&delete r.updatedAt,r}}class hr extends P{}class Me extends P{}class jr extends P{}class mr extends P{}class he extends D{constructor(e){super(e);t(this,"signature","");t(this,"symbol","");e&&(this.signature=e.signature??"",this.symbol=e.symbol??"")}}var S=(n=>(n.Person="individual",n.Ic="entrepreneur",n.UlR="legal",n.UlNr="non_resident_legal",n))(S||{});class M extends P{static generatePersonItem(){return new M({id:1,guid:"",slug:S.Person,name:""})}}class fr extends P{}class yr extends P{}class F extends P{}class Cr extends P{}class Pr extends P{}class Be extends P{}class He extends P{}const te=class te extends y{constructor(){super();t(this,"responseDataCacheTimeout");this.responseDataCacheTimeout=A.getConfig().http.responseDataCacheTimeout}static getCachedResponse(e){const i=te.responseDataCache.get(e);if(i&&i.validTo>new Date)return i.val}cacheResponse(e,i){te.responseDataCache.set(e,{validTo:h.addSeconds(new Date,this.responseDataCacheTimeout),val:i})}getTypedDataArrayRequester(e,i,s=!1,o={}){const l=i+(g.isEmpty(o)?"":` >>> ${JSON.stringify(o)}`),p=s?te.getCachedResponse(l):void 0;return p?Promise.resolve(p):this.get(i,o).then(f=>{const R=f.map($=>Re.instanceInitializer(e,$));return s&&R&&this.cacheResponse(i,R),R})}};t(te,"responseDataCache",new Map);let x=te;class w extends x{getReference(r,e=!1){return this.getTypedDataArrayRequester(hr,`/internal/references/${r}`,e)}getChannelPrimaryInterest(){return this.getTypedDataArrayRequester(Me,"/internal/references/channel-primary-interest",!0)}getContactPositions(){return this.getTypedDataArrayRequester(mr,"/internal/references/contact-position",!0)}getCurrency(){return this.getTypedDataArrayRequester(he,"/public/references/currency",!0)}getPartnerGroup(){return this.getTypedDataArrayRequester(F,"/internal/references/partner-group",!0)}getOpf(){return this.getTypedDataArrayRequester(M,"/public/references/opf",!0)}getOrderPaymentStatuses(){return this.getTypedDataArrayRequester(fr,"/public/references/order-payment-status",!0)}getOrderStatuses(){return this.getTypedDataArrayRequester(yr,"/public/references/order-status",!0)}getPaymentTypes(){return this.getTypedDataArrayRequester(Cr,"/public/references/payment-type",!0)}getResourceTypes(){return this.getTypedDataArrayRequester(Be,"/internal/references/resource-type",!0)}getSalesDirections(){return this.getTypedDataArrayRequester(b,"/public/references/sales-direction",!0)}getSourcePrimaryInterest(){return this.getTypedDataArrayRequester(He,"/internal/references/source-primary-interest",!0)}searchCity(r){return this.getTypedDataArrayRequester(Ae,`/internal/references/city-with-region-and-country/search?term=${r}`)}searchRegion(r){return this.getTypedDataArrayRequester(Q,`/internal/references/region-with-country/search?term=${r}`)}searchCountry(r){return this.getTypedDataArrayRequester(W,`/internal/references/country/search?term=${r}`)}getDeliveryTypes(){return this.getTypedDataArrayRequester(H,"/internal/references/delivery-type",!0)}getWarehouses(){return this.getTypedDataArrayRequester(le,"/public/references/warehouse",!0)}getPropertyTypes(){return this.getTypedDataArrayRequester(Ge,"/internal/references/property-type",!0)}getPriceCoefficients(){return this.getTypedDataArrayRequester(ce,"/internal/references/price-coefficient",!0)}getProductFileType(){return this.getTypedDataArrayRequester(Pr,"/public/references/product-file-type",!0)}}var wr=(n=>(n.Admin="admin",n.Manager="manager",n.Operator="operator",n.Client="client",n.Guest="guest",n))(wr||{});class vr{constructor(r){t(this,"cost");t(this,"costDate");t(this,"isLowCost");t(this,"isRetail");t(this,"discountName");t(this,"priceTemplateName");t(this,"client");t(this,"executor");t(this,"currency");this.cost=r.cost,this.costDate=g.isString(r.costDate)?h.parseISO(r.costDate):r.costDate,this.isLowCost=r.isLowCost,this.isRetail=r.isRetail,this.discountName=r.discountName,this.priceTemplateName=r.priceTemplateName,this.client=r.client?new G(r.client):void 0,this.executor=r.executor?new G(r.executor):void 0,this.currency=r.currency?new he(r.currency):void 0}}class je{constructor(r){t(this,"products",[]);t(this,"productCategories",[]);r!=null&&r.products&&(this.products=r.products.map(e=>new T(e))),r!=null&&r.productCategories&&(this.productCategories=r.productCategories.map(e=>new U(e)))}}class E extends D{constructor(e){super(e);t(this,"description");t(this,"canChangeLowCost");t(this,"parentRoleId");t(this,"subRoles",[]);t(this,"parentRole");t(this,"level",0);this.description=e==null?void 0:e.description,this.canChangeLowCost=(e==null?void 0:e.canChangeLowCost)??!1,this.parentRoleId=e==null?void 0:e.parentRoleId}}class ze{constructor(r){t(this,"role");t(this,"category");t(this,"minCoefficient");this.role=new E(r==null?void 0:r.role),this.category=new oe(r==null?void 0:r.category),this.minCoefficient=new ce(r==null?void 0:r.minCoefficient)}}class Rr{constructor(r){t(this,"phone");t(this,"tablet");t(this,"laptop");this.phone=(r==null?void 0:r.phone)??360,this.tablet=(r==null?void 0:r.tablet)??600,this.laptop=(r==null?void 0:r.laptop)??1024}}class ar{constructor(r){t(this,"portalApiUrl");t(this,"mediaUrl");t(this,"responseDataCacheTimeout");this.portalApiUrl=(r==null?void 0:r.portalApiUrl)??"",this.mediaUrl=(r==null?void 0:r.mediaUrl)??"",this.responseDataCacheTimeout=(r==null?void 0:r.responseDataCacheTimeout)??3*60*60}}class Dr{constructor(r){t(this,"dsn");t(this,"environment");t(this,"ignoreErrors");t(this,"trace");t(this,"replay");t(this,"additionalParams");var e,i,s,o;this.dsn=(r==null?void 0:r.dsn)??"",this.environment=(r==null?void 0:r.environment)??"production",this.ignoreErrors=(r==null?void 0:r.ignoreErrors)??[/Network\s{1,3}Error/,/Request\s{1,3}aborted/,/Request\s{1,3}failed\s{1,3}with\s{1,3}status\s{1,3}code\s{1,3}(401|403|422)/],this.trace={allowedTargets:((e=r==null?void 0:r.trace)==null?void 0:e.allowedTargets)??[/^\//],sampleRate:((i=r==null?void 0:r.trace)==null?void 0:i.sampleRate)??0},this.replay={replaysOnErrorSampleRate:((s=r==null?void 0:r.replay)==null?void 0:s.replaysOnErrorSampleRate)??0,replaysSessionSampleRate:((o=r==null?void 0:r.replay)==null?void 0:o.replaysSessionSampleRate)??0},this.additionalParams=(r==null?void 0:r.additionalParams)??{}}}class Ar{constructor(r){t(this,"date");t(this,"name");t(this,"version");this.date=g.isString(r==null?void 0:r.date)?h.parseISO(r.date):(r==null?void 0:r.date)??new Date,this.name=(r==null?void 0:r.name)??"",this.version=(r==null?void 0:r.version)??"0.0.0"}}class zr{constructor(r){t(this,"environment");t(this,"devMode");t(this,"http");t(this,"deviceTypeByResolution");t(this,"sentry");t(this,"urls");t(this,"version");t(this,"dateFormats");var e,i,s;this.environment=(r==null?void 0:r.environment)??"production",this.devMode=(r==null?void 0:r.devMode)??{},this.http=new ar(r==null?void 0:r.http),this.deviceTypeByResolution=new Rr(r==null?void 0:r.deviceTypeByResolution),this.sentry=new Dr({environment:this.environment,...r==null?void 0:r.sentry}),this.urls=r==null?void 0:r.urls,this.version=new Ar(r==null?void 0:r.version),this.dateFormats={api:((e=r==null?void 0:r.dateFormats)==null?void 0:e.api)??"yyyy-MM-dd HH:mm:ss",uiDate:((i=r==null?void 0:r.dateFormats)==null?void 0:i.uiDate)??"dd.MM.yyyy",uiDateWithTime:((s=r==null?void 0:r.dateFormats)==null?void 0:s.uiDateWithTime)??"dd.MM.yyyy HH:mm"}}}class Wr extends y{search(r,e=!1){return this.get("/internal/catalog/search",{term:r,show_hidden:e})}getPriceExportLink(r="csv",e=!1,i=void 0,s=void 0){let l=`${A.getConfig().http.portalApiUrl}/api/internal/price/export?format=${r}&show_hidden=${e}`;return i&&(l+=`&category_id=${i}`),s&&(l+=`&client_id=${s}`),l}}class Vr extends y{importPrices(r,e){return this.post(`/internal/clients/${r}/price/import`,e)}updateCategoryPrices(r,e,i){var s;return this.patch(`/internal/clients/${r}/price/categories/${e}`,{price_coefficient_id:(s=i.coefficient)==null?void 0:s.id,increase_percent:i.value})}removeCategoryPrices(r,e){return this.delete(`/internal/clients/${r}/price/categories/${e}`)}markCategoryRequired(r,e){return this.post(`/internal/clients/${r}/price/categories/${e}/required`)}unmarkCategoryRequired(r,e){return this.delete(`/internal/clients/${r}/price/categories/${e}/required`)}markCategoryDisabled(r,e,i){return this.post(`/internal/clients/${r}/price/categories/${e}/disabled`,{comment:i})}unmarkCategoryDisabled(r,e){return this.delete(`/internal/clients/${r}/price/categories/${e}/disabled`)}addCategoryManager(r,e,i){return this.post(`/internal/clients/${r}/price/categories/${e}/manager`,{manager_id:i})}removeCategoryManager(r,e){return this.delete(`/internal/clients/${r}/price/categories/${e}/manager`)}updateProductPrice(r,e,i){var s;return this.patch(`/internal/clients/${r}/price/products/${e}`,{price_coefficient_id:(s=i.coefficient)==null?void 0:s.id,increase_percent:i.value},o=>new z(o.data))}removeProductPrice(r,e){return this.delete(`/internal/clients/${r}/price/products/${e}`,i=>new z(i.data))}markProductRequired(r,e){return this.post(`/internal/clients/${r}/price/products/${e}/required`)}unmarkProductRequired(r,e){return this.delete(`/internal/clients/${r}/price/products/${e}/required`)}getCommercialOfferHtml(r,e){return this.get(`/internal/clients/${r}/price/commercial-offer/view`,e,i=>new Blob([i.data],{type:"text/html"}))}getCommercialOfferPdf(r,e){return this.getBlob(`/internal/clients/${r}/price/commercial-offer/download`,e,i=>new Blob([i.request.response],{type:"application/pdf"}))}sendCommercialOffer(r,e){return this.post(`/internal/clients/${r}/price/commercial-offer/send`,e)}}class Fr extends y{getTemplateList(r){return this.get(`/internal/clients/${r}/price/templates`,{},e=>e.data.map(i=>new X(i)))}getActiveTemplate(r){return this.get(`/internal/clients/${r}/price/templates/active`,{},e=>new X(e.data))}attachTemplate(r,e,i){const s=A.getConfig().dateFormats.api;return this.post(`/internal/clients/${r}/price/templates/${e}`,i&&{startAt:i.startAt&&h.format(i.startAt,s),endAt:i.endAt&&h.format(i.endAt,s)},o=>new X(o.data),{},!0)}applyTemplate(r,e){return this.post(`/internal/clients/${r}/price/templates/${e}/apply`,{},void 0,{},!0)}changeTemplate(r,e,i,s){const o=A.getConfig().dateFormats.api;return this.patch(`/internal/clients/${r}/price/templates/${e}/${i}`,s&&{startAt:s.startAt&&h.format(s.startAt,o),endAt:s.endAt&&h.format(s.endAt,o)},l=>new X(l.data))}detachTemplate(r,e,i){return this.delete(`/internal/clients/${r}/price/templates/${e}/${i}`)}}class Jr extends y{getRootCategoriesList(r=!1){return this.get("/internal/catalog/categories",{showHidden:r},e=>e.data.map(i=>new U(i)))}getCategoryData(r,e=!1,i=!1){return this.get(`/internal/catalog/categories/${r}`,{showHidden:e,withNestedCategories:i},s=>new U(s.data))}getPublicCategoryData(r){return this.get(`/public/catalog/categories/${r}`,{},e=>new U(e.data))}getCategoryProductsList(r,e=!0,i=!1){return this.get(`/internal/catalog/categories/${r}/products`,{showHidden:i,withPriceCoefficients:e},s=>g.map(s.data,o=>new T(o)))}getCategoryProductsCoefficients(r){return this.get(`/internal/catalog/categories/${r}/products/coefficients`,{},e=>{const{data:i}=e;return g.forEach(i,s=>s.map(o=>new we(o))),i})}publicSimpleSearch(r,e=10){return new Promise((i,s)=>{this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then(o=>{i(o.categories.map(l=>new U(l)))}).catch(o=>{s(o)})})}}class Kr extends y{getProductData(r,e=!1){return this.get(`/internal/catalog/products/${r}`,{withPriceCoefficients:e},i=>new T(i.data))}getPublicProductData(r){return this.get(`/public/catalog/products/${r}`,{},e=>new T(e.data))}getProductPriceCoefficients(r){return this.get(`/internal/catalog/products/${r}/coefficients`,{},e=>g.map(e.data,i=>new we(i)))}getProductPriceHistory(r,e){const i={};return g.isNil(e)||(i.clientId=e),this.get(`/internal/price/products/${r}/history`,i,s=>g.map(s.data,o=>new vr(o)))}publicSimpleSearch(r,e=10){return new Promise((i,s)=>{this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then(o=>{i(o.products.map(l=>new T(l)))}).catch(o=>{s(o)})})}}class Qr extends y{getRootCategoriesList(r,e=!1){return this.get("/internal/catalog/categories",{clientId:r,showHidden:e},i=>i.data.map(s=>new ge(s)))}getCategoryData(r,e,i=!1,s=!1){return this.get(`/internal/catalog/categories/${e}`,{clientId:r,showHidden:i,withNestedCategories:s},o=>new ge(o.data))}getCategoryProductsList(r,e,i=!0,s=!1){return this.get(`/internal/catalog/categories/${e}/products`,{client_id:r,showHidden:s,withPriceCoefficients:i},o=>g.map(o.data,l=>new z(l)))}}class Yr extends y{getProductData(r,e,i=!1){return this.get(`/internal/catalog/products/${r}`,{clientId:e,withPriceCoefficients:i},s=>new z(s.data))}}var Te=(n=>(n.BeginWith="bw",n.Contains="cn",n.Custom="custom",n.EndsWith="ew",n.Equals="eq",n.GreaterOrEqual="ge",n.GreaterThan="gt",n.InList="in",n.LessOrEqual="le",n.LessThan="lt",n.NotBeginWith="bn",n.NotContains="nc",n.NotEndsWith="en",n.NotEqual="ne",n.NotInList="ni",n.NotNull="nn",n.Null="nu",n))(Te||{});class We{constructor(r){t(this,"field");t(this,"op");t(this,"value");this.field=(r==null?void 0:r.field)??"",this.op=(r==null?void 0:r.op)??Te.Equals,this.value=(r==null?void 0:r.value)??""}toPrimitive(){const r={field:this.field,op:this.op};return r.value=g.isDate(this.value)?h.format(this.value,A.getConfig().dateFormats.api):this.value,r}}class ee{constructor(r){t(this,"groupOp");t(this,"filters");t(this,"groups");var e,i;this.groupOp=(r==null?void 0:r.groupOp)??"and",this.filters=((e=r==null?void 0:r.filters)==null?void 0:e.map(s=>new We(s)))??[],this.groups=((i=r==null?void 0:r.groups)==null?void 0:i.map(s=>new ee(s)))??[]}toPrimitive(){return{groupOp:this.groupOp,filters:this.filters.map(r=>r instanceof We&&g.isFunction(r.toPrimitive)?r.toPrimitive():r),groups:this.groups.map(r=>r instanceof ee?r.toPrimitive():r)}}}class me extends y{getPaginated(r,e,i,s,o,l,p){let f={page:(s==null?void 0:s.page)??1,perPage:(s==null?void 0:s.pageSize)??10};return e&&(f.filters=JSON.stringify((e instanceof ee?e:new ee(e)).toPrimitive())),g.isEmpty(i)||(f.sort=g.isArray(i)?i:[i]),o&&(f={...f,...o}),this.get(r,f,l,p)}}class Xr extends me{getTemplateList(r,e,i){return this.getPaginated("/internal/price/templates",r,e,i,{},s=>{const o={...s.data};return o.data=o.data.map(l=>new j(l)),o})}createTemplate(r,e={}){return this.post("/internal/price/templates",r,i=>new j(i.data),e)}getTemplate(r){return this.get(`/internal/price/templates/${r}`,{},e=>new j(e.data))}updateTemplate(r,e,i={}){return this.patch(`/internal/price/templates/${r}`,e,s=>new j(s.data),i)}removeTemplate(r){return this.delete(`/internal/price/templates/${r}`)}getProductTemplatePrices(r){return this.get(`/internal/price/templates/${r}/products`,{},e=>e.data.map(i=>new $e(i)))}getProductTemplatePrice(r,e){return this.get(`/internal/price/templates/${r}/products/${e}`,{},i=>new $e(i.data))}saveProductTemplatePrice(r,e,i){var s;return this.post(`/internal/price/templates/${r}/products/${e}`,{price_coefficient_id:(s=i.coefficient)==null?void 0:s.id,increase_percent:i.value},o=>new $e(o.data))}deleteProductTemplatePrice(r,e){return this.delete(`/internal/price/templates/${r}/products/${e}`)}getCategoryTemplatePrices(r){return this.get(`/internal/price/templates/${r}/categories`,{},e=>e.data.map(i=>new De(i)))}getCategoryTemplatePrice(r,e){return this.get(`/internal/price/templates/${r}/categories/${e}`,{},i=>new De(i.data))}saveCategoryTemplatePrice(r,e,i,s=!1){var o;return this.request({method:"POST",url:`/internal/price/templates/${r}/categories/${e}`,data:{price_coefficient_id:(o=i.coefficient)==null?void 0:o.id,increase_percent:i.value},params:s?{recursively:!0}:{}},l=>new De(l.data))}deleteCategoryTemplatePrice(r,e,i=!1){return this.request({method:"DELETE",url:`/internal/price/templates/${r}/categories/${e}`,params:i?{recursively:!0}:{}})}getTemplateClients(r){return this.get(`/internal/price/templates/${r}/clients`,{},e=>e.data.map(i=>new X(i)))}}class Zr extends y{getRoles(){return this.get("/internal/price/roles",{},r=>r.data.map(e=>new E(e)))}createRole(r){return this.post("/internal/price/roles",r,e=>new E(e.data))}getRole(r){return this.get(`/internal/price/roles/${r}`,{},e=>new E(e.data))}updateRole(r,e){return this.patch(`/internal/price/roles/${r}`,e,i=>new E(i.data))}deleteRole(r){return this.delete(`/internal/price/roles/${r}`)}getCategoryRules(r){return this.get(`/internal/price/roles/rules/categories/${r}`,{},e=>e.data.map(i=>new ze(i)))}updateCategoryRules(r,e){return this.patch(`/internal/price/roles/rules/categories/${r}`,e,i=>i.data.map(s=>new ze(s)))}}class xr extends me{getProperties(r,e,i){return this.getPaginated("/internal/catalog/properties",r,e,i,{},s=>{const o={...s.data};return o.data=o.data.map(l=>new Z(l)),o})}createProperty(r){const{typeId:e,...i}=r;return this.post("/internal/catalog/properties",{...i,type:e},s=>new Z(s.data))}getProperty(r){return this.get(`/internal/catalog/properties/${r}`,{},e=>new Z(e.data))}updateProperty(r,e){const{typeId:i,...s}=e;return this.patch(`/internal/catalog/properties/${r}`,{...s,type:i},o=>new Z(o.data))}deleteProperty(r){return this.delete(`/internal/catalog/properties/${r}`)}getProductProperties(r){return this.get(`/internal/catalog/products/${r}/properties`,{},e=>e.data.map(i=>new V(i)))}getProductProperty(r,e){return this.get(`/internal/catalog/products/${r}/properties/${e}`,{},i=>new V(i.data))}updateProductProperty(r,e,i){return this.patch(`/internal/catalog/products/${r}/properties/${e}`,{value:i},s=>new V(s.data))}deleteProductProperty(r,e){return this.delete(`/internal/catalog/products/${r}/properties/${e}`)}getProductDescription(r){return this.get(`/internal/catalog/products/${r}/properties/description`)}updateProductDescription(r,e){return this.patch(`/internal/catalog/products/${r}/properties/description`,{text:e})}deleteProductDescription(r){return this.delete(`/internal/catalog/products/${r}/properties/description`)}getProductSpecification(r){return this.get(`/internal/catalog/products/${r}/properties/specification`)}updateProductSpecification(r,e){return this.patch(`/internal/catalog/products/${r}/properties/specification`,{text:e})}deleteProductSpecification(r){return this.delete(`/internal/catalog/products/${r}/properties/specification`)}getProductFiles(r){return this.get(`/internal/catalog/products/${r}/properties/files`)}addProductFile(r,e){return this.post(`/internal/catalog/products/${r}/properties/files`,e)}updateProductFile(r,e,i){return this.patch(`/internal/catalog/products/${r}/properties/files/${e}`,i)}deleteProductFile(r,e){return this.delete(`/internal/catalog/products/${r}/properties/files/${e}`)}updateProductSlug(r,e){return this.patch(`/internal/catalog/products/${r}/properties/slug`,{slug:e})}getCategoryProperties(r){return this.get(`/internal/catalog/categories/${r}/properties`,{},e=>e.data.map(i=>new V(i)))}getCategoryProperty(r,e){return this.get(`/internal/catalog/categories/${r}/properties/${e}`,{},i=>new V(i.data))}updateCategoryProperty(r,e,i){return this.patch(`/internal/catalog/categories/${r}/properties/${e}`,{value:i},s=>new V(s.data))}deleteCategoryProperty(r,e){return this.delete(`/internal/catalog/categories/${r}/properties/${e}`)}getCategoryDescription(r){return this.get(`/internal/catalog/categories/${r}/properties/description`)}updateCategoryDescription(r,e){return this.patch(`/internal/catalog/categories/${r}/properties/description`,{text:e})}deleteCategoryDescription(r){return this.delete(`/internal/catalog/categories/${r}/properties/description`)}getCategorySpecification(r){return this.get(`/internal/catalog/categories/${r}/properties/specification`)}updateCategorySpecification(r,e){return this.patch(`/internal/catalog/categories/${r}/properties/specification`,{text:e})}deleteCategorySpecification(r){return this.delete(`/internal/catalog/categories/${r}/properties/specification`)}getCategoryFiles(r){return this.get(`/internal/catalog/categories/${r}/properties/files`)}addCategoryFile(r,e){return this.post(`/internal/catalog/categories/${r}/properties/files`,e)}updateCategoryFile(r,e,i){return this.patch(`/internal/catalog/categories/${r}/properties/files/${e}`,i)}deleteCategoryFile(r,e){return this.delete(`/internal/catalog/categories/${r}/properties/files/${e}`)}updateCategorySlug(r,e){return this.patch(`/internal/catalog/categories/${r}/properties/slug`,{slug:e})}updateCategoryImage(r,e){return this.post(`/internal/catalog/categories/${r}/image`,{image:e})}}class Er extends y{getProductCategoryRecommendations(r){return this.get(`/internal/catalog/recommendations/categories/${r.id}`,{},e=>new je(e.data))}getProductRecommendations(r){return this.get(`/internal/catalog/recommendations/products/${r.id}`,{},e=>new je(e.data))}saveProductCategoryRecommendations(r,e){return this.post(`/internal/catalog/recommendations/categories/${r.id}`,{product_categories:e.productCategories.map(i=>i.id),products:e.products.map(i=>i.id)})}saveProductRecommendations(r,e){return this.post(`/internal/catalog/recommendations/products/${r.id}`,{product_categories:e.productCategories.map(i=>i.id),products:e.products.map(i=>i.id)})}}function Ve(n,r,e){let i;return n.some(s=>{if(s.type===e&&s.id===r)return i=s,!0;if(s.type==="product")return!1;const o=s;if(o.products&&o.products.length>0){const l=Ve(o.products,r,e);if(l)return i=l,!0}if(o.categories&&o.categories.length>0){const l=Ve(o.categories,r,e);if(l)return i=l,!0}return!1}),i}var $r=(n=>(n.LastOrder="last_order",n.Contacts="contacts",n.PartnerGroups="partner_groups",n.PreferredDeliveryType="preferred_delivery_type",n.SalesDirection="sales_direction",n.Managers="managers",n))($r||{});class Se extends q{constructor(e){super(e);t(this,"bankName","");t(this,"bic","");t(this,"accountNumber","");t(this,"correspondentAccount","");t(this,"currency",new he);e&&(this.bankName=e.bankName??"",this.bic=e.bic??"",this.accountNumber=e.accountNumber??"",this.correspondentAccount=e.correspondentAccount??"",this.currency=new he(e.currency))}}class be extends D{constructor(e){super(e);t(this,"phone");t(this,"email");this.email=e==null?void 0:e.email,this.phone=/^\d+$/.test((e==null?void 0:e.phone)??"")?`+${e==null?void 0:e.phone}`:e==null?void 0:e.phone}}class B extends be{constructor(e){super(e);t(this,"isPrimary");t(this,"position");t(this,"notDisturb");t(this,"comment");t(this,"updatedAt");t(this,"deletedAt");this.isPrimary=(e==null?void 0:e.isPrimary)??!1,this.position=e==null?void 0:e.position,this.notDisturb=(e==null?void 0:e.notDisturb)??!1,this.comment=e==null?void 0:e.comment,this.updatedAt=e==null?void 0:e.updatedAt,this.deletedAt=g.isString(e==null?void 0:e.deletedAt)?h.parseISO(e.deletedAt):e==null?void 0:e.deletedAt}}class Fe extends D{constructor(e){super(e);t(this,"manager",new K);t(this,"opf",M.generatePersonItem());t(this,"salesDirection",new b);t(this,"partnerGroup",new F);t(this,"contacts",[]);t(this,"bankAccounts",[]);t(this,"comment");t(this,"alternativeName");t(this,"createdAt");t(this,"creator");t(this,"updatedAt");t(this,"updater");if(e){if(this.opf=new M(e.opf),this.salesDirection=new b(e.salesDirection),this.comment=e.comment,this.alternativeName=e.alternativeName,this.createdAt=g.isString(e==null?void 0:e.createdAt)?h.parseISO(e.createdAt):e.createdAt,this.creator=e.creator?new G(e.creator):void 0,this.updatedAt=g.isString(e==null?void 0:e.updatedAt)?h.parseISO(e.updatedAt):e.updatedAt,this.updater=e.updater?new G(e.updater):void 0,e.partnerGroup&&(this.partnerGroup=new F(e.partnerGroup)),e.manager&&(this.manager=new K(e.manager)),e.contacts){const i=[];e.contacts.forEach(s=>{i.push(new B(s))}),this.contacts=i}if(e.bankAccounts){const i=[];e.bankAccounts.forEach(s=>{i.push(new Se(s))}),this.bankAccounts=i}}}}class Tr extends Fe{constructor(r){super(r)}}class Je extends Fe{constructor(e){super(e);t(this,"inn","");t(this,"okpo","");t(this,"directorName","");t(this,"directorPosition","");t(this,"directorActsOn","");t(this,"legalAddress","");t(this,"postalAddress","");t(this,"actualAddress","");e&&(this.inn=e.inn??"",this.okpo=e.okpo??"",this.directorName=e.directorName??"",this.directorPosition=e.directorPosition??"",this.directorActsOn=e.directorActsOn??"",this.legalAddress=e.legalAddress??"",this.postalAddress=e.postalAddress??"",this.actualAddress=e.actualAddress??"")}}class Ke extends Je{constructor(e){super(e);t(this,"kpp","");e&&(this.kpp=e.kpp??"")}}class Sr extends Ke{constructor(e){super(e);t(this,"registrationCountry",new W);t(this,"registrationNumber","");t(this,"taxNumber","");e&&(this.registrationCountry=new W(e.registrationCountry),this.registrationNumber=e.registrationNumber??"",this.taxNumber=e.taxNumber??"")}}class fe{static createInstance(r){switch(r.opf.slug){case S.Ic:return new Je(r);case S.UlR:return new Ke(r);case S.UlNr:return new Sr(r);default:return new Tr(r)}}}class Ie extends q{constructor(e){super(e);t(this,"isPrimary");this.isPrimary=e.isPrimary}}class br extends B{constructor(e){super(e);t(this,"relations",{clients:[],contragents:[],addresses:[]});e.relations&&(e.relations.addresses&&(this.relations.addresses=e.relations.addresses.map(i=>new Ie(i))),e.relations.clients&&(this.relations.clients=e.relations.clients.map(i=>new Ie(i))),e.relations.contragents&&(this.relations.contragents=e.relations.contragents.map(i=>new Ie(i))))}}class ye extends ur{constructor(e){var i;super(e);t(this,"address","");t(this,"coordinates");t(this,"contacts");t(this,"comment");t(this,"operatingHours");t(this,"isOneTime");t(this,"isTransportCompanyAddress");this.address=(e==null?void 0:e.address)??"",this.coordinates=new ke(e==null?void 0:e.coordinates),this.contacts=((i=e==null?void 0:e.contacts)==null?void 0:i.map(s=>new B(s)))??[],this.comment=e==null?void 0:e.comment,this.operatingHours=e==null?void 0:e.operatingHours,this.isOneTime=e==null?void 0:e.isOneTime,this.isTransportCompanyAddress=e==null?void 0:e.isTransportCompanyAddress}}class Qe extends Y{constructor(e){var i,s,o,l;super(e);t(this,"contragents");t(this,"partnerGroups");t(this,"contacts");t(this,"deliveryAddresses");t(this,"channelPrimaryInterest");t(this,"sourcePrimaryInterest");t(this,"preferredDeliveryType");t(this,"primaryDemand");t(this,"isExcludedFromMsCallsToClients");t(this,"preferredWarehouse");t(this,"extraData");this.contragents=((i=e==null?void 0:e.contragents)==null?void 0:i.map(p=>fe.createInstance(p)))??[],this.partnerGroups=((s=e==null?void 0:e.partnerGroups)==null?void 0:s.map(p=>new F(p)))??[],this.contacts=((o=e==null?void 0:e.contacts)==null?void 0:o.map(p=>new B(p)))??[],this.deliveryAddresses=((l=e==null?void 0:e.deliveryAddresses)==null?void 0:l.map(p=>new ye(p)))??[],this.channelPrimaryInterest=new Me(e==null?void 0:e.channelPrimaryInterest),this.sourcePrimaryInterest=new He(e==null?void 0:e.sourcePrimaryInterest),this.preferredDeliveryType=new H(e==null?void 0:e.preferredDeliveryType),this.primaryDemand=e==null?void 0:e.primaryDemand,this.isExcludedFromMsCallsToClients=(e==null?void 0:e.isExcludedFromMsCallsToClients)??!1,this.preferredWarehouse=e!=null&&e.preferredWarehouse?new le(e.preferredWarehouse):void 0,this.extraData=(e==null?void 0:e.extraData)??{}}}class et{constructor(r){t(this,"id");t(this,"name");t(this,"alternativeName");t(this,"searchTerm");t(this,"cities");t(this,"region");t(this,"country");t(this,"phone");t(this,"email");t(this,"isActive");t(this,"createdAt",new _);t(this,"lastLoginDate",new _);t(this,"lastLoginDateHasOrder");t(this,"managers");t(this,"isManagerRequired");t(this,"salesDirections");t(this,"contragentInn");t(this,"contragentType");t(this,"preferredDeliveryType");t(this,"partnerGroups");t(this,"contact");t(this,"lastOrder");var e,i,s,o,l,p;this.id=r==null?void 0:r.id,this.name=r==null?void 0:r.name,this.alternativeName=r==null?void 0:r.alternativeName,this.searchTerm=r==null?void 0:r.searchTerm,this.cities=(e=r==null?void 0:r.cities)==null?void 0:e.map(f=>new Ae(f)),this.region=new Q(r==null?void 0:r.region),this.country=new W(r==null?void 0:r.country),this.phone=r==null?void 0:r.phone,this.email=r==null?void 0:r.email,this.isActive=r&&Object.prototype.hasOwnProperty.call(r,"isActive")?r==null?void 0:r.isActive:!0,this.createdAt=new _(r==null?void 0:r.createdAt),this.lastLoginDate=new _(r==null?void 0:r.lastLoginDate),this.lastLoginDateHasOrder=(r==null?void 0:r.lastLoginDateHasOrder)??void 0,this.managers=r!=null&&r.managers&&r.managers.length>0?r.managers.map(f=>new pe(f)):[],this.salesDirections=(i=r==null?void 0:r.salesDirections)==null?void 0:i.map(f=>new b(f)),this.contragentInn=r==null?void 0:r.contragentInn,this.contragentType=new M(r==null?void 0:r.contragentType),this.preferredDeliveryType=new H(r==null?void 0:r.preferredDeliveryType),this.partnerGroups=(s=r==null?void 0:r.partnerGroups)==null?void 0:s.map(f=>new F(f)),this.contact=new be(r==null?void 0:r.contact),this.lastOrder={createdAt:new _((o=r==null?void 0:r.lastOrder)==null?void 0:o.createdAt),creator:(l=r==null?void 0:r.lastOrder)==null?void 0:l.creator,isApproved:(p=r==null?void 0:r.lastOrder)==null?void 0:p.isApproved}}resetFilterValue(r){switch(r){case"id":case"phone":case"email":case"name":case"alternativeName":case"searchTerm":case"contragentInn":this[r]=void 0;break;case"cities":this.cities=[];break;case"region":this.region=new Q;break;case"isActive":this.isActive=!0;break;case"createdAt":this.createdAt.from=null,this.createdAt.to=null;break;case"lastLoginDate":this.lastLoginDate.from=null,this.lastLoginDate.to=null;break;case"lastLoginDateHasOrder":this.lastLoginDateHasOrder=void 0;break;case"lastOrder":this.lastOrder={};break;case"managers":this.managers=[];break;case"salesDirections":this.salesDirections=[];break;case"contragentType":this.contragentType=new M;break;case"preferredDeliveryType":this.preferredDeliveryType=new H;break;case"partnerGroups":this.partnerGroups=[];break;case"contact":this.contact=new be;break}return this}asClearRaw(){var e,i,s,o;const r={};return Object.keys(this).forEach(l=>{const p=this[l];g.isNil(p)||g.isString(p)&&p.trim().length===0||g.isFunction(p.isNewRec)&&p.isNewRec()||(r[l]=p)}),!((e=r==null?void 0:r.createdAt)!=null&&e.from)&&!((i=r==null?void 0:r.createdAt)!=null&&i.to)&&delete r.createdAt,!((s=r==null?void 0:r.lastLoginDate)!=null&&s.from)&&!((o=r==null?void 0:r.lastLoginDate)!=null&&o.to)&&delete r.lastLoginDate,r}}class Ye extends q{constructor(e){super(e);t(this,"createdAt");t(this,"creator");t(this,"isApproved1c");this.createdAt=g.isString(e==null?void 0:e.createdAt)?h.parseISO(e.createdAt):(e==null?void 0:e.createdAt)??new Date,this.creator=new G(e==null?void 0:e.creator),this.isApproved1c=(e==null?void 0:e.isApproved1c)??!1}}class Ir extends D{constructor(e){var i,s;super(e);t(this,"contacts",[]);t(this,"preferredDeliveryType");t(this,"partnerGroups",[]);t(this,"lastOrder");t(this,"salesDirection");t(this,"managers");(i=e.contacts)!=null&&i.length&&(this.contacts=e.contacts.map(o=>new B(o))),e.lastOrder&&(this.lastOrder=new Ye(e.lastOrder)),(s=e.partnerGroups)!=null&&s.length&&(this.partnerGroups=e.partnerGroups.map(o=>new F(o))),e.preferredDeliveryType&&(this.preferredDeliveryType=new H(e.preferredDeliveryType)),e.salesDirection&&(this.salesDirection=new b(e.salesDirection)),e.managers&&(this.managers=e.managers.map(o=>new K(o)))}}class _r{constructor(r){t(this,"page",1);t(this,"pageSize",50);this.page=(r==null?void 0:r.page)??1,this.pageSize=(r==null?void 0:r.pageSize)??50}}class rt extends _r{constructor(e){super(e);t(this,"itemCount",0);t(this,"pageCount",1);t(this,"pageSlot",5);t(this,"pageSizes",[25,50,100]);t(this,"showSizePicker",!0);this.itemCount=(e==null?void 0:e.itemCount)??0,this.pageCount=(e==null?void 0:e.pageCount)??1,this.pageSlot=(e==null?void 0:e.pageSlot)??5,this.pageSizes=(e==null?void 0:e.pageSizes)??[25,50,100],this.showSizePicker=(e==null?void 0:e.showSizePicker)??!0}}class tt{constructor(r){t(this,"field");t(this,"direction");this.field=(r==null?void 0:r.field)??"",this.direction=(r==null?void 0:r.direction)??"asc"}}class it extends me{getClient(r){return this.get(`/internal/clients/${r}`,{},e=>new Qe(e.data))}getClientsList(r,e,i,s){return this.getPaginated("/internal/clients",r,e,i,s,o=>{const l={...o.data};return l.data=l.data.map(p=>new Y(p)),l})}getClientByPhone(r){return this.getClientsList({groupOp:"and",groups:[],filters:[{field:"phone",op:Te.Contains,value:r}]})}getAdditionalClientsData(r,e){const i=r.map(s=>s.id);return this.post("/internal/clients/additional-data",{clients:i,requested_data_types:e},s=>{let o=[];return(s==null?void 0:s.data.length)>0&&(o=s.data.map(l=>new Ir(l))),o})}getAllClientContacts(r){return this.get(`/internal/clients/${r}/contacts/all`,{},e=>{let i=[];return(e==null?void 0:e.data.length)>0&&(i=e.data.map(s=>new br(s))),i})}createClientCommonData(r,e={}){var i;return this.post("/internal/clients",{name:r.name,alternative_name:r.alternativeName,partner_groups:r.partnerGroups.map(s=>s.id),phone:r.phone,email:r.email,city_id:r.city.id,get_news:r.getNews,channel_primary_interest_id:r.channelPrimaryInterest.id,source_primary_interest_id:r.sourcePrimaryInterest.id,primary_demand:r.primaryDemand,is_excluded_from_ms_calls_to_clients:r.isExcludedFromMsCallsToClients,preferred_warehouse_id:(i=r.preferredWarehouse)==null?void 0:i.id},s=>new Qe(s.data),e)}updateClientCommonData(r,e={}){var i;return this.patch(`/internal/clients/${r.id}`,{name:r.name,alternative_name:r.alternativeName,partner_groups:r.partnerGroups.map(s=>s.id),phone:r.phone,email:r.email,city_id:r.city.id,get_news:r.getNews,channel_primary_interest_id:r.channelPrimaryInterest.id,source_primary_interest_id:r.sourcePrimaryInterest.id,primary_demand:r.primaryDemand,is_excluded_from_ms_calls_to_clients:r.isExcludedFromMsCallsToClients,preferred_warehouse_id:(i=r.preferredWarehouse)==null?void 0:i.id},void 0,e)}changeClientPassword(r,e,i,s={}){return this.patch(`/internal/clients/${r}`,{password:e,password_confirmation:i},void 0,s)}updateClientComment(r){return this.patch(`/internal/clients/${r.id}`,{comment:r.comment})}changeClientActivation(r){return this.patch(`/internal/clients/${r.id}`,{is_active:r.isActive})}async attachClientToManagers(r,e){const i=e.map(s=>this.patch(`/internal/clients/${r}/managers/${s.id}/attach`,{is_primary:s.isDefault}));await Promise.all(i)}async detachClientFromManagers(r,e){const i=e.map(s=>this.patch(`/internal/clients/${r}/managers/${s.id}/detach`));await Promise.all(i)}createContragentClientData(r,e,i={}){var f,R,$,L,O,k,d,N;let s;const o=e,l=e,p=e;switch(e.opf.slug){case S.Ic:s={opf:o.opf.slug,name:o.name,alternative_name:o.alternativeName,partner_group_id:(f=o.partnerGroup)==null?void 0:f.id,manager_id:(R=o.manager)==null?void 0:R.id,comment:o.comment,inn:o.inn,okpo:o.okpo,director_name:o.directorName,director_position:o.directorPosition,director_acts_on:o.directorActsOn,legal_address:o.legalAddress,postal_address:o.postalAddress,actual_address:o.actualAddress};break;case S.UlR:s={opf:l.opf.slug,name:l.name,alternative_name:l.alternativeName,partner_group_id:($=l.partnerGroup)==null?void 0:$.id,manager_id:(L=l.manager)==null?void 0:L.id,comment:l.comment,inn:l.inn,kpp:l.kpp,okpo:l.okpo,director_name:l.directorName,director_position:l.directorPosition,director_acts_on:l.directorActsOn,legal_address:l.legalAddress,postal_address:l.postalAddress,actual_address:l.actualAddress};break;case S.UlNr:s={opf:p.opf.slug,name:p.name,alternative_name:p.alternativeName,partner_group_id:(O=p.partnerGroup)==null?void 0:O.id,manager_id:(k=p.manager)==null?void 0:k.id,comment:p.comment,director_name:p.directorName,director_position:p.directorPosition,director_acts_on:p.directorActsOn,legal_address:p.legalAddress,postal_address:p.postalAddress,actual_address:p.actualAddress,registration_country_id:p.registrationCountry.id,registration_number:p.registrationNumber,tax_number:p.taxNumber||void 0};break;default:s={opf:e.opf.slug,name:e.name,alternative_name:e.alternativeName,partner_group_id:(d=e.partnerGroup)==null?void 0:d.id,manager_id:(N=e.manager)==null?void 0:N.id,comment:e.comment};break}return this.post(`/internal/clients/${r}/contragents`,s,J=>fe.createInstance(J.data),i)}updateContragentClientData(r,e,i={}){var f,R,$,L,O,k,d,N;let s;const o=e,l=e,p=e;switch(e.opf.slug){case S.Ic:s={opf:o.opf.slug,name:o.name,alternative_name:o.alternativeName,partner_group_id:(f=o.partnerGroup)==null?void 0:f.id,manager_id:(R=o.manager)==null?void 0:R.id,comment:o.comment,inn:o.inn,okpo:o.okpo,director_name:o.directorName,director_position:o.directorPosition,director_acts_on:o.directorActsOn,legal_address:o.legalAddress,postal_address:o.postalAddress,actual_address:o.actualAddress};break;case S.UlR:s={opf:l.opf.slug,name:l.name,alternative_name:l.alternativeName,partner_group_id:($=l.partnerGroup)==null?void 0:$.id,manager_id:(L=l.manager)==null?void 0:L.id,comment:l.comment,inn:l.inn,kpp:l.kpp,okpo:l.okpo,director_name:l.directorName,director_position:l.directorPosition,director_acts_on:l.directorActsOn,legal_address:l.legalAddress,postal_address:l.postalAddress,actual_address:l.actualAddress};break;case S.UlNr:s={opf:p.opf.slug,name:p.name,alternative_name:p.alternativeName,partner_group_id:(O=p.partnerGroup)==null?void 0:O.id,manager_id:(k=p.manager)==null?void 0:k.id,comment:p.comment,director_name:p.directorName,director_position:p.directorPosition,director_acts_on:p.directorActsOn,legal_address:p.legalAddress,postal_address:p.postalAddress,actual_address:p.actualAddress,registration_country_id:p.registrationCountry.id,registration_number:p.registrationNumber,tax_number:p.taxNumber||void 0};break;default:s={opf:e.opf.slug,name:e.name,alternative_name:e.alternativeName,partner_group_id:(d=e.partnerGroup)==null?void 0:d.id,manager_id:(N=e.manager)==null?void 0:N.id,comment:e.comment};break}return this.patch(`/internal/clients/${r}/contragents/${e.id}`,s,J=>fe.createInstance(J.data),i)}deleteClientContragent(r,e){return this.delete(`/internal/clients/${r}/contragents/${e.id}`)}createClientDeliveryAddress(r,e,i={}){var o,l;const s={address:e.address,is_one_time:e.isOneTime??!1,is_transport_company_address:e.isTransportCompanyAddress??!1,comment:e.comment??""};return e.coordinates&&(s.coordinates={lat:(o=e.coordinates)==null?void 0:o.lat,long:(l=e.coordinates)==null?void 0:l.long}),e.operatingHours&&(s.operating_hours={from:e.operatingHours.from,to:e.operatingHours.to}),this.post(`/internal/clients/${r}/delivery-addresses`,s,p=>new ye(p.data),i)}updateClientDeliveryAddress(r,e,i={}){var o,l;const s={address:e.address,is_one_time:e.isOneTime??!1,is_transport_company_address:e.isTransportCompanyAddress??!1,comment:e.comment??""};return e.operatingHours&&(s.operating_hours={from:e.operatingHours.from,to:e.operatingHours.to}),e.coordinates&&(s.coordinates={lat:(o=e.coordinates)==null?void 0:o.lat,long:(l=e.coordinates)==null?void 0:l.long}),this.patch(`/internal/clients/${r}/delivery-addresses/${e.id}`,s,p=>new ye(p.data),i)}deleteClientDeliveryAddress(r,e){return this.delete(`/internal/clients/${r}/delivery-addresses/${e.id}`)}createContragentBankAccount(r,e,i,s={}){return this.post(`/internal/clients/${r}/contragents/${e}/bank-accounts`,{bank_name:i.bankName,bic:i.bic,account_number:i.accountNumber,correspondent_account:i.correspondentAccount,currency_id:i.currency.id},o=>new Se(o.data),s)}updateContragentBankAccount(r,e,i,s={}){return this.patch(`/internal/clients/${r}/contragents/${e}/bank-accounts/${i.id}`,{bank_name:i.bankName,bic:i.bic,account_number:i.accountNumber,correspondent_account:i.correspondentAccount,currency_id:i.currency.id},o=>new Se(o.data),s)}deleteContragentBankAccount(r,e,i){return this.delete(`/internal/clients/${r}/contragents/${e}/bank-accounts/${i.id}`)}createClientContact(r,e,i={}){return this.createContact(r,e,{client:{id:r,is_primary:e.isPrimary??!1,not_disturb:e.notDisturb??!1}},i)}updateClientContact(r,e,i={}){return this.patch(`/internal/clients/${r}/contacts/${e.id}`,{name:e.name,position:e.position,phone:e.phone,email:e.email,comment:e.comment,not_disturb:e.notDisturb},s=>new B(s.data),i)}setPrimaryClientContact(r,e){return this.setPrimaryContact(`/internal/clients/${r}/contacts/${e.id}/primary`,e.isPrimary??!1)}detachClientContact(r,e){return this.detachContact(`/internal/clients/${r}/contacts/${e.id}/detach`)}createContragentContact(r,e,i,s={}){return this.createContact(r,i,{contragents:[{id:e,is_primary:i.isPrimary??!1,not_disturb:i.notDisturb??!1}]},s)}setPrimaryContragentContact(r,e,i){return this.setPrimaryContact(`/internal/clients/${r}/contragents/${e}/contacts/${i.id}/primary`,i.isPrimary??!1)}detachContragentContact(r,e,i){return this.detachContact(`/internal/clients/${r}/contragents/${e}/contacts/${i.id}/detach`)}createDeliveryAddressContact(r,e,i,s={}){return this.createContact(r,i,{addresses:[{id:e,is_primary:i.isPrimary??!1,not_disturb:i.notDisturb??!1}]},s)}setPrimaryDeliveryAddressContact(r,e,i){return this.setPrimaryContact(`/internal/clients/${r}/delivery-addresses/${e}/contacts/${i.id}/primary`,i.isPrimary??!1)}detachDeliveryAddressContact(r,e,i){return this.detachContact(`/internal/clients/${r}/delivery-addresses/${e}/contacts/${i.id}/detach`)}createContact(r,e,i,s={}){var l,p;const o={name:e.name,position:e.position,comment:e.comment,...i};return(l=e.phone)!=null&&l.length&&(o.phone=e.phone),(p=e.email)!=null&&p.length&&(o.email=e.email),this.post(`/internal/clients/${r}/contacts`,o,f=>new B(f.data),s)}setPrimaryContact(r,e){return this.patch(r,{is_primary:e})}detachContact(r){return this.patch(r)}sendClientEmailConfirmation(r){return this.get(`/internal/clients/${r.id}/verification/email?email=${r.email}`)}}class st extends y{checkPhoneIsBusy(r){return new Promise((e,i)=>{this.request({method:"GET",url:"/public/user/verification/phone/check",params:{phone:r}}).then(s=>{e(!!s.isBusy)}).catch(i)})}}class nt extends y{getConfiguratorSettings(r){var e;return this.get(`internal/catalog/categories/${r.id}/configurators/${(e=r.properties)==null?void 0:e.editor}/settings`)}searchProduct(r,e,i={}){var o;const s=this.get(`internal/catalog/categories/${r.id}/configurators/${(o=r.properties)==null?void 0:o.editor}/product`,{params:e},l=>new T(l.data));return s.catch(l=>{this.errorResponseHandler(l,i)}),s}createTemplate(r,e,i={}){var s;return this.post(`internal/catalog/categories/${r.id}/configurators/${(s=r.properties)==null?void 0:s.editor}/template`,{...e},()=>{},i)}removeTemplate(r,e){var i;return this.delete(`internal/catalog/categories/${r.id}/configurators/${(i=r.properties)==null?void 0:i.editor}/template/${e}`)}}class ot{static defaultDateRanges(){const r=h.addBusinessDays(new Date,1);return{nextWorkingDay:{label:"Следующий рабочий день",from:h.startOfDay(r),to:h.endOfDay(r)},today:{label:"Сегодня",from:h.startOfToday(),to:h.endOfToday()},yesterday:{label:"Вчера",from:h.startOfYesterday(),to:h.endOfYesterday()},tomorrow:{label:"Завтра",from:h.startOfTomorrow(),to:h.endOfTomorrow()}}}}const ie=class ie{static setLinearValues(r){ie.linearValues=r}static productIsMeasurable(r){return ie.linearValues.includes(r.unit)}static getProductMultiplicity(r){var e,i;return!((e=r.properties)!=null&&e.ignoreMinCountCheck)&&((i=r.properties)!=null&&i.minCount)&&!ie.productIsMeasurable(r)?r.properties.minCount:1}static getProductLengthMultiplicity(r){var e,i,s;return(e=r.properties)!=null&&e.lengthStep?r.properties.lengthStep:!((i=r.properties)!=null&&i.ignoreMinCountCheck)&&((s=r.properties)!=null&&s.minCount)?r.properties.minCount:.01}};t(ie,"linearValues",["пог.м.","м.","м2"]);let Xe=ie;class ct{static generateUndefinedManagerInstance(){return new pe({id:0,name:"- Не назначен -",isActive:!0,guid:"-undefined-"})}static isUndefinedManagerInstance(r){return r.id===0&&r.guid==="-undefined-"}}class Lr extends x{async getManagers(){const r="/internal/managers",e=x.getCachedResponse(r);if(e)return e;const s=(await this.get(r)).data.map(o=>Re.instanceInitializer(pe,o));return this.cacheResponse(r,s),s}}class Ze extends Ye{constructor(e){var i,s,o,l,p,f,R,$;super(e);t(this,"client");t(this,"payment");t(this,"delivery");t(this,"attachedUser");t(this,"status");t(this,"salesDirection");t(this,"pendingAt");t(this,"processedAt");t(this,"isOnOrder");t(this,"isNotInStock");this.client=new Y(e==null?void 0:e.client),this.payment={type:((i=e==null?void 0:e.payment)==null?void 0:i.type)??-1,status:((s=e==null?void 0:e.payment)==null?void 0:s.status)??-1,onlinePaymentLink:(o=e==null?void 0:e.payment)==null?void 0:o.onlinePaymentLink},this.delivery={type:((l=e==null?void 0:e.delivery)==null?void 0:l.type)??-1,date:g.isString((p=e==null?void 0:e.delivery)==null?void 0:p.date)?h.parseISO(e.delivery.date):((f=e==null?void 0:e.delivery)==null?void 0:f.date)??new Date,address:(R=e==null?void 0:e.delivery)!=null&&R.address?new ye(e.delivery.address):void 0,warehouse:($=e==null?void 0:e.delivery)!=null&&$.warehouse?new le(e.delivery.warehouse):void 0},this.attachedUser=new G(e==null?void 0:e.attachedUser),this.status=(e==null?void 0:e.status)??0,this.salesDirection=new b(e==null?void 0:e.salesDirection),this.pendingAt=g.isString(e==null?void 0:e.pendingAt)?h.parseISO(e.pendingAt):e==null?void 0:e.pendingAt,this.processedAt=g.isString(e==null?void 0:e.processedAt)?h.parseISO(e.processedAt):e==null?void 0:e.processedAt,this.isOnOrder=(e==null?void 0:e.isOnOrder)??!1,this.isNotInStock=(e==null?void 0:e.isNotInStock)??!1}}class Or extends q{constructor(e){super(e);t(this,"product");t(this,"quantity");t(this,"currency");t(this,"costOne");t(this,"costOneRub");t(this,"cost");t(this,"costRub");t(this,"marker");t(this,"height");t(this,"length");t(this,"width");t(this,"logicGroupId");t(this,"salesDirection");t(this,"specificationImgUrl");t(this,"configurator");t(this,"configuratorParams");t(this,"sawing");this.product=new z(e.product),this.quantity=e.quantity,this.currency=e.currency,this.costOne=e.costOne,this.costOneRub=e.costOneRub,this.cost=e.cost,this.costRub=e.costRub,this.marker=e.marker,this.height=e.height,this.length=e.length,this.width=e.width,this.logicGroupId=e.logicGroupId,this.salesDirection=e.salesDirection,this.specificationImgUrl=e.specificationImgUrl,this.configurator=e.configurator,this.configuratorParams=e.configuratorParams,this.sawing=e.sawing}}class kr extends Ze{constructor(e){super(e);t(this,"products");t(this,"invoices");t(this,"comment");t(this,"image");t(this,"contragent");t(this,"barcode");t(this,"orderSource");t(this,"isAllowProcessingWithoutPayment");this.products=(e.products??[]).map(i=>new Or(i)),this.invoices=e.invoices??[],this.comment=e.comment,this.image=e.image,this.contragent=e.contragent?fe.createInstance(e.contragent):void 0,this.barcode=e.barcode,this.orderSource=e.orderSource?new P(e.orderSource):void 0,this.isAllowProcessingWithoutPayment=e.isAllowProcessingWithoutPayment}}class lt extends me{getOrders(r,e,i){return this.getPaginated("/internal/orders",r,e?[e]:void 0,i,{},s=>{const o={...s.data};return o.data=o.data.map(l=>new Ze(l)),o})}getClientOrderStatistics(r,e){return this.get(`/internal/clients/${r}/orders/statistics`,e?{period:e}:{})}getOrder(r){return this.get(`/internal/orders/${r}`,{},e=>new kr(e.data))}}class _e{constructor(r){t(this,"client");t(this,"product");t(this,"cost");t(this,"costCoefficient");t(this,"source");this.client=new Y(r==null?void 0:r.client),this.product=new T(r==null?void 0:r.product),this.cost=(r==null?void 0:r.cost)??0,this.costCoefficient=(r==null?void 0:r.costCoefficient)??0,this.source=(r==null?void 0:r.source)??ae.Product}}const xe=n=>{var r,e,i,s,o;return n?g.omitBy({cities:(r=n.cities)==null?void 0:r.map(l=>l.id),clients:(e=n.clients)==null?void 0:e.map(l=>l.id),managers:(i=n.managers)==null?void 0:i.map(l=>l.id),partnerGroups:(s=n.partnerGroups)==null?void 0:s.map(l=>l.id),salesDirections:(o=n.salesDirections)==null?void 0:o.map(l=>l.id),hideNotActive:n.hideNotActive},l=>g.isNil(l)||(g.isArray(l)||g.isObject(l))&&g.isEmpty(l)):{}},dr=n=>{const r={};return n.from&&(n.from.coefficient||n.from.value)&&(r.from={},n.from.coefficient&&(r.from.priceCoefficientId=n.from.coefficient.id),n.from.value&&(r.from.increasePercent=n.from.value)),n.to&&(n.to.coefficient||n.to.value)&&(r.to={},n.to.coefficient&&(r.to.priceCoefficientId=n.to.coefficient.id),n.to.value&&(r.to.increasePercent=n.to.value)),r};class ut extends y{analyzeProductPrices(r,e,i){return this.get(`/internal/price/products/${r}/analyze`,{...dr(e),filters:xe(i)},s=>s.data.map(o=>new _e(o)))}analyzeCategoryPrices(r,e,i){return this.get(`/internal/price/categories/${r}/analyze`,{...dr(e),filters:xe(i)},s=>s.data.map(o=>new _e(o)))}analyzeCategoryPricesBySquare(r,e,i){return this.get(`/internal/price/categories/${r}/analyze/square`,{...e,filters:xe(i)},s=>s.data.map(o=>new _e(o)))}}class Nr{constructor(r){t(this,"name");t(this,"content");this.name=r.name,this.content=r.content}}class Ee{constructor(r){t(this,"resourceType");t(this,"resourceId");t(this,"h1");t(this,"title");t(this,"description");t(this,"keywords");t(this,"meta");var e;this.resourceType=new Be(r==null?void 0:r.resourceType),this.resourceId=(r==null?void 0:r.resourceId)??"",this.h1=r==null?void 0:r.h1,this.title=r==null?void 0:r.title,this.description=r==null?void 0:r.description,this.keywords=r==null?void 0:r.keywords,this.meta=((e=r==null?void 0:r.meta)==null?void 0:e.map(i=>new Nr(i)))??[]}}class pt extends y{getResourceSeoData(r,e){return this.get(`/internal/seo/${r.slug}/${e}`,{},i=>new Ee(i.data))}saveResourceSeoData(r,e={}){return this.post(`/internal/seo/${r.resourceType.slug}/${r.resourceId}`,r,i=>new Ee(i.data),e)}deleteResourceSeoData(r,e){return this.delete(`/internal/seo/${r.slug}/${e}`)}}const v=Ce.defineStore("__references_private",()=>{const n=m.ref({}),r=m.ref(void 0),e=m.ref(void 0),i=m.ref(void 0),s=m.ref(void 0),o=m.ref(void 0),l=m.ref(void 0),p=m.ref(void 0),f=m.ref(void 0),R=m.ref(void 0),$=m.ref(void 0),L=m.ref(void 0),O=m.ref(void 0),k=m.ref(void 0),d=m.ref(void 0),N=m.ref(void 0),J=m.ref(void 0),u=m.ref(void 0);return{dataLoaderList:n,channelPrimaryInterestReference:r,contactPositionsReference:e,currencyReference:i,deliveryTypeReference:s,managersList:o,opfReference:l,orderPaymentStatusReference:p,orderStatusReference:f,paymentTypeReference:R,partnerGroupReference:$,productFileTypeReference:L,resourceTypesReference:O,salesDirectionsReference:k,sourcePrimaryInterestReference:d,warehousesReference:N,propertyTypesReference:J,priceCoefficientsReference:u}}),gt=Ce.defineStore("references",()=>{const n=m.computed(()=>{const u=v();return!u.channelPrimaryInterestReference&&!u.dataLoaderList.channelPrimaryInterestReference&&(u.dataLoaderList.channelPrimaryInterestReference=!0,y.getInstance(w).getChannelPrimaryInterest().then(C=>{u.channelPrimaryInterestReference=C}).catch(g.noop)),u.channelPrimaryInterestReference}),r=m.computed(()=>{const u=v();return!u.contactPositionsReference&&!u.dataLoaderList.contactPositionsReference&&(u.dataLoaderList.contactPositionsReference=!0,y.getInstance(w).getContactPositions().then(C=>{u.contactPositionsReference=C}).catch(g.noop)),u.contactPositionsReference}),e=m.computed(()=>{const u=v();return!u.currencyReference&&!u.dataLoaderList.currencyReference&&(u.dataLoaderList.currencyReference=!0,y.getInstance(w).getCurrency().then(C=>{u.currencyReference=C}).catch(g.noop)),u.currencyReference}),i=m.computed(()=>{const u=v();return!u.opfReference&&!u.dataLoaderList.opfReference&&(u.dataLoaderList.opfReference=!0,y.getInstance(w).getOpf().then(C=>{u.opfReference=C}).catch(g.noop)),u.opfReference}),s=m.computed(()=>{const u=v();return!u.orderPaymentStatusReference&&!u.dataLoaderList.orderPaymentStatusReference&&(u.dataLoaderList.orderPaymentStatusReference=!0,y.getInstance(w).getOrderPaymentStatuses().then(C=>{u.orderPaymentStatusReference=C}).catch(g.noop)),u.orderPaymentStatusReference}),o=m.computed(()=>{const u=v();return!u.orderStatusReference&&!u.dataLoaderList.orderStatusReference&&(u.dataLoaderList.orderStatusReference=!0,y.getInstance(w).getOrderStatuses().then(C=>{u.orderStatusReference=C}).catch(g.noop)),u.orderStatusReference}),l=m.computed(()=>{const u=v();return!u.paymentTypeReference&&!u.dataLoaderList.paymentTypeReference&&(u.dataLoaderList.paymentTypeReference=!0,y.getInstance(w).getPaymentTypes().then(C=>{u.paymentTypeReference=C}).catch(g.noop)),u.paymentTypeReference}),p=m.computed(()=>{const u=v();return!u.partnerGroupReference&&!u.dataLoaderList.partnerGroupReference&&(u.dataLoaderList.partnerGroupReference=!0,y.getInstance(w).getPartnerGroup().then(C=>{u.partnerGroupReference=C}).catch(g.noop)),u.partnerGroupReference}),f=m.computed(()=>{const u=v();return!u.productFileTypeReference&&!u.dataLoaderList.productFileTypeReference&&(u.dataLoaderList.productFileTypeReference=!0,y.getInstance(w).getProductFileType().then(C=>{u.productFileTypeReference=C}).catch(g.noop)),u.productFileTypeReference}),R=m.computed(()=>{const u=v();return!u.resourceTypesReference&&!u.dataLoaderList.resourceTypesReference&&(u.dataLoaderList.resourceTypesReference=!0,y.getInstance(w).getResourceTypes().then(C=>{u.resourceTypesReference=C}).catch(g.noop)),u.resourceTypesReference}),$=m.computed(()=>{const u=v();return!u.salesDirectionsReference&&!u.dataLoaderList.salesDirectionsReference&&(u.dataLoaderList.salesDirectionsReference=!0,y.getInstance(w).getSalesDirections().then(C=>{u.salesDirectionsReference=C}).catch(g.noop)),u.salesDirectionsReference}),L=m.computed(()=>{const u=v();return!u.sourcePrimaryInterestReference&&!u.dataLoaderList.sourcePrimaryInterestReference&&(u.dataLoaderList.sourcePrimaryInterestReference=!0,y.getInstance(w).getSourcePrimaryInterest().then(C=>{u.sourcePrimaryInterestReference=C}).catch(g.noop)),u.sourcePrimaryInterestReference}),O=m.computed(()=>{const u=v();return!u.deliveryTypeReference&&!u.dataLoaderList.deliveryTypeReference&&(u.dataLoaderList.deliveryTypeReference=!0,y.getInstance(w).getDeliveryTypes().then(C=>{u.deliveryTypeReference=C}).catch(g.noop)),u.deliveryTypeReference}),k=m.computed(()=>{const u=v();return!u.managersList&&!u.dataLoaderList.managersList&&(u.dataLoaderList.managersList=!0,y.getInstance(Lr).getManagers().then(C=>{u.managersList=C}).catch(g.noop)),u.managersList}),d=m.computed(()=>{const u=v();return!u.warehousesReference&&!u.dataLoaderList.warehousesReference&&(u.dataLoaderList.warehousesReference=!0,y.getInstance(w).getWarehouses().then(C=>{u.warehousesReference=C}).catch(g.noop)),u.warehousesReference}),N=m.computed(()=>{const u=v();return!u.propertyTypesReference&&!u.dataLoaderList.propertyTypesReference&&(u.dataLoaderList.propertyTypesReference=!0,y.getInstance(w).getPropertyTypes().then(C=>{u.propertyTypesReference=C}).catch(g.noop)),u.propertyTypesReference}),J=m.computed(()=>{const u=v();return!u.priceCoefficientsReference&&!u.dataLoaderList.priceCoefficientsReference&&(u.dataLoaderList.priceCoefficientsReference=!0,y.getInstance(w).getPriceCoefficients().then(C=>{u.priceCoefficientsReference=C}).catch(g.noop)),u.priceCoefficientsReference});return{channelPrimaryInterestsReference:n,contactPositionsReference:r,currencyReference:e,opfReference:i,orderPaymentStatusReference:s,orderStatusReference:o,paymentTypeReference:l,partnerGroupsReference:p,productFilesTypesReference:f,resourceTypesReference:R,salesDirectionsReference:$,sourcePrimaryInterestsReference:L,deliveryTypeReference:O,managersList:k,warehousesReference:d,propertyTypesReference:N,priceCoefficientsReference:J}});class ht extends y{searchAddresses(r){return this.execSuggestionQuery("/public/suggestions/address",r)}searchBank(r){return this.execSuggestionQuery("/public/suggestions/bank",r)}searchOrganization(r){return this.execSuggestionQuery("/public/suggestions/organization",r)}execSuggestionQuery(r,e){return this.get(r,{query:e}).then(i=>{const s=[...i];let o=1;return s.forEach(l=>{l.id=o++}),s})}}class mt{constructor(r,e){t(this,"showFeedback",!1);t(this,"feedback","");t(this,"validationStatus");this.showFeedback=!!r,this.feedback=r,this.validationStatus=e}}c.AnyReference=hr,c.AppBaseConfig=zr,c.AppConfigProvider=A,c.BankAccount=Se,c.BasePaginationProvider=me,c.CalculationTypeEnum=cr,c.Cart=ue,c.CartItem=sr,c.CartItemBase=ir,c.CartProvider=Gr,c.CatalogProvider=Wr,c.CatalogableItem=Le,c.Category=U,c.CategoryPricingRule=ze,c.ChannelPrimaryInterest=Me,c.City=jr,c.CityWithRegionAndCountry=Ae,c.Client=Qe,c.ClientAdditionalData=Ir,c.ClientCategory=ge,c.ClientDataProvider=it,c.ClientPriceProvider=Vr,c.ClientPriceTemplateProvider=Fr,c.ClientProduct=z,c.ClientProductCategoryDataProvider=Qr,c.ClientProductDataProvider=Yr,c.ClientShortInfo=Y,c.ClientsAdditionalDataRequestTypeEnum=$r,c.ClientsListFilters=et,c.ConfiguratorProvider=nt,c.Contact=be,c.ContactLinks=gr,c.ContactPerson=B,c.ContactPersonRelated=br,c.ContactPosition=mr,c.ContactRelation=Ie,c.ContragentBase=Fe,c.ContragentFactory=fe,c.ContragentIc=Je,c.ContragentPerson=Tr,c.ContragentUlNr=Sr,c.ContragentUlR=Ke,c.CostSourceEnum=ae,c.Country=W,c.Currency=he,c.DataSuggestionProvider=ht,c.DataTablePagination=rt,c.DataTablePaginationRequestParams=_r,c.DataTableSortRequestParams=tt,c.DateTimeProvider=ot,c.DeletableNamedIdentity=ur,c.DeliveryAddress=ye,c.DeliveryType=H,c.DetailedJwtPayload=Ur,c.DeviceTypeResolutionConfig=Rr,c.DiscountShortInfo=pr,c.FieldValidationResultData=mt,c.FilterGroup=ee,c.FilterItem=We,c.FilterOpEnum=Te,c.GeoCoordinates=ke,c.HiddenCatalogableItem=rr,c.HttpCachedRequester=x,c.HttpParamsConfig=ar,c.HttpRequester=y,c.Identity=q,c.Image=tr,c.JwtPayload=ne,c.Manager=pe,c.ManagerCommon=K,c.ManagerDataFactory=ct,c.ManagerDataProvider=Lr,c.MetaTagItem=Nr,c.NamedIdentity=D,c.Opf=M,c.OpfEnum=S,c.Order=kr,c.OrderInfo=Ze,c.OrderPaymentStatus=fr,c.OrderProduct=Or,c.OrderShortInfo=Ye,c.OrderStatus=yr,c.OrdersDataProvider=lt,c.PartnerGroup=F,c.PaymentType=Cr,c.PreferencesStorageProvider=Mr,c.PriceAnalyze=_e,c.PriceAnalyzeProvider=ut,c.PriceCoefficient=ce,c.PriceCoefficientEnum=Oe,c.PriceTemplate=j,c.PriceTemplateCategory=De,c.PriceTemplateClient=X,c.PriceTemplateICatalogableItem=Ue,c.PriceTemplateProduct=$e,c.PriceTemplateProvider=Xr,c.PricingRole=E,c.PricingRoleProvider=Zr,c.PrimaryCatalogableItem=Pe,c.Product=T,c.ProductCategoryDataProvider=Jr,c.ProductDataProvider=Kr,c.ProductFileType=Pr,c.ProductPriceCoefficient=we,c.ProductPriceHistory=vr,c.PropertiesProvider=xr,c.Property=Z,c.PropertyType=Ge,c.PropertyTypeEnum=lr,c.PropertyValue=V,c.RecommendationsDataProvider=Er,c.RecommendationsList=je,c.Reference=P,c.ReferenceDataProvider=w,c.Region=Q,c.ResourceType=Be,c.SalesDirection=b,c.SentryConfig=Dr,c.Seo=Ee,c.SeoDataProvider=pt,c.SourcePrimaryInterest=He,c.StockCount=er,c.TemplatesListFilters=Hr,c.TypedInstanceFactory=Re,c.UnitsHelper=Xe,c.UnknownClientDataProvider=st,c.UpdatableNamedIdentity=qe,c.User=nr,c.UserCommonInfo=de,c.UserDataProvider=or,c.UserShortInfo=G,c.UserTypeEnum=wr,c.VersionConfig=Ar,c.Warehouse=le,c.findCatalogItemByIdRecursive=Ve,c.useReferencesStore=gt,c.useUserStateStore=Ne,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ (function(c,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("jwt-decode"),require("lodash-es"),require("ts-case-convert"),require("pinia"),require("vue"),require("date-fns"),require("axios")):typeof define=="function"&&define.amd?define(["exports","jwt-decode","lodash-es","ts-case-convert","pinia","vue","date-fns","axios"],R):(c=typeof globalThis<"u"?globalThis:c||self,R(c["SC Common Lib"]={},c["jwt-decode"],c["lodash-es"],c["ts-case-convert"],c.pinia,c.vue,c["date-fns"],c.axios))})(this,function(c,R,p,ne,K,h,m,qr){"use strict";var Ct=Object.defineProperty;var Pt=(c,R,p)=>R in c?Ct(c,R,{enumerable:!0,configurable:!0,writable:!0,value:p}):c[R]=p;var t=(c,R,p)=>Pt(c,typeof R!="symbol"?R+"":R,p);class oe{constructor(r){t(this,"exp",0);t(this,"iat",0);t(this,"authTime",0);t(this,"jti","");t(this,"iss","");t(this,"aud",[]);t(this,"sub","");t(this,"typ","Bearer");t(this,"azp","");t(this,"sid","");t(this,"acr","");t(this,"allowedOrigins",[]);t(this,"realmAccess",{roles:[]});t(this,"resourceAccess",{});t(this,"scope","");t(this,"emailVerified",!1);t(this,"name","");t(this,"guid","");t(this,"preferredUsername","");t(this,"givenName","");t(this,"email","");p.merge(this,r)}static getJwtPayload(r){return new oe(ne.objectToCamel(R.jwtDecode(r)))}}class Ur extends oe{constructor(e){super(e);t(this,"familyName");t(this,"middleName");t(this,"locale");t(this,"phoneNumber");t(this,"phoneNumberVerified");t(this,"address");p.merge(this,e)}static getJwtPayload(e){return new oe(ne.objectToCamel(R.jwtDecode(e)))}}const te=class te{static init(r){te.config=r}static getConfig(){if(p.isUndefined(te.config))throw new Error("Config is undefined. Please set config by AppConfigProvider.init().");return te.config}static loadRemoteConfig(r="/config.json"){const e=fetch(r).then(i=>i.ok?i.json():(console.error(new Error(`Ошибка загрузки ${r}: ${i.statusText}`)),new Promise(s=>{s({})})));return e.catch(i=>{console.error(i)}),e}};t(te,"config");let D=te;const Le=K.defineStore("__auth_state_private",()=>{var e;const n=h.ref(Promise.resolve((e=D.getConfig().devMode)==null?void 0:e.initAuthBearerToken)),r=h.ref(void 0);return{accessToken:n,accessTokenUpdater:r}}),Pe=K.defineStore("__auth_state",()=>{const n=h.computed(()=>{const i=Le();if(p.isNil(i.accessToken)&&!p.isNil(i.accessTokenUpdater)){const s=i.accessTokenUpdater();i.accessToken=s,s.then(o=>{i.accessToken=Promise.resolve(o)}).catch(p.noop)}return i.accessToken});function r(i){Le().accessTokenUpdater=i}function e(){Le().accessToken=void 0}return{accessToken:n,setAccessTokenUpdater:r,invalidateAccessToken:e}});class q{constructor(r,e){t(this,"id");t(this,"guid");this.id=r==null?void 0:r.id,p.isNil(this.id)&&(p.isNil(e)?typeof(r==null?void 0:r.id)=="number"?this.id=-1:typeof(r==null?void 0:r.id)=="string"&&(this.id=""):this.id=e),this.guid=(r==null?void 0:r.guid)??""}isNewRec(){return typeof this.id=="number"?this.id===-1:typeof this.id=="string"?this.id==="":p.isNil(this.id)}}class A extends q{constructor(e){super(e);t(this,"name","");this.name=(e==null?void 0:e.name)??""}}class ke extends A{constructor(e){super(e);t(this,"slug");t(this,"code");t(this,"type");this.slug=(e==null?void 0:e.slug)??"",this.code=(e==null?void 0:e.code)??""}}class we extends ke{constructor(e){super(e);t(this,"isPrimary");this.isPrimary=(e==null?void 0:e.isPrimary)??!1}}class ce extends we{constructor(e){super(e);t(this,"isHidden");t(this,"parentCategoryId");t(this,"properties");t(this,"currencyRates");this.isHidden=(e==null?void 0:e.isHidden)??!1,this.parentCategoryId=e==null?void 0:e.parentCategoryId,this.properties=e==null?void 0:e.properties,this.type="category",this.currencyRates=e!=null&&e.currencyRates?Object.fromEntries(Object.entries(e.currencyRates).map(([i,s])=>[p.toUpper(i),s])):void 0}}var de=(n=>(n.K0="k0",n.K1="k1",n.K2="k2",n.K3="k3",n.K4="k4",n.Retail="retail",n))(de||{});class P extends A{constructor(e){super(e);t(this,"slug");t(this,"description");this.description=e==null?void 0:e.description,this.slug=e==null?void 0:e.slug}}class le extends P{static getRetailPriceCoefficient(){return{id:-2,slug:de.Retail,name:"Розн. цена",guid:"",isNewRec:p.constant(!0)}}}class ae{constructor(r){t(this,"coefficient");t(this,"value");t(this,"cost");t(this,"percent");t(this,"readOnly");this.coefficient=new le(r==null?void 0:r.coefficient),this.value=(r==null?void 0:r.value)??0,this.cost=(r==null?void 0:r.cost)??0,this.percent=(r==null?void 0:r.percent)??0,this.readOnly=(r==null?void 0:r.readOnly)??!0}}class Oe{constructor(r){t(this,"lat");t(this,"long");this.lat=(r==null?void 0:r.lat)??0,this.long=(r==null?void 0:r.long)??0}}class H extends P{}class ue extends P{constructor(e){var i;super(e);t(this,"address");t(this,"isMain");t(this,"deliveryTypes");t(this,"regions");t(this,"coordinates");this.address=(e==null?void 0:e.address)??"",this.isMain=(e==null?void 0:e.isMain)??!1,this.deliveryTypes=((i=e==null?void 0:e.deliveryTypes)==null?void 0:i.map(s=>new H(s)))??[],this.regions=(e==null?void 0:e.regions)??[],this.coordinates=new Oe(e==null?void 0:e.coordinates)}}class er{constructor(r){t(this,"warehouse");t(this,"count");this.warehouse=new ue(r==null?void 0:r.warehouse),this.count=(r==null?void 0:r.count)??0}}class rr extends ke{constructor(e){super(e);t(this,"isHidden");this.isHidden=(e==null?void 0:e.isHidden)??!1}}class tr{constructor(r,e){t(this,"image");t(this,"preview");t(this,"isDefault");this.image=`${e??""}${r.image}`,this.preview=`${e??""}${r.preview}`,this.isDefault=r.isDefault}}class S extends rr{constructor(e){var s,o,l,g;super(e);t(this,"supplierSku");t(this,"unit");t(this,"pack");t(this,"minCount");t(this,"quantityUnit");t(this,"currency");t(this,"currencySignature");t(this,"cost");t(this,"costRub");t(this,"costDate");t(this,"onOrder");t(this,"stockCount");t(this,"category");t(this,"categories");t(this,"images");t(this,"properties");t(this,"retailCost");t(this,"retailCostRub");t(this,"priceCoefficients");this.supplierSku=e==null?void 0:e.supplierSku,this.unit=(e==null?void 0:e.unit)??"",this.pack=e==null?void 0:e.pack,this.minCount=e==null?void 0:e.minCount,this.quantityUnit=e==null?void 0:e.quantityUnit,this.currency=(e==null?void 0:e.currency)??"",this.cost=(e==null?void 0:e.cost)??0,this.costRub=(e==null?void 0:e.costRub)??0,this.costDate=p.isString(e==null?void 0:e.costDate)?m.parseISO(e.costDate):e==null?void 0:e.costDate,this.onOrder=(e==null?void 0:e.onOrder)??!1,this.stockCount=((s=e==null?void 0:e.stockCount)==null?void 0:s.map(f=>new er(f)))??[],this.currencySignature=(e==null?void 0:e.currencySignature)??"",this.type="product";const i=(e==null?void 0:e.category)??((o=e==null?void 0:e.categories)==null?void 0:o.find(f=>f.isPrimary));i&&(this.category=new we({...i,isPrimary:!0}),this.categories=[this.category]),e!=null&&e.categories&&(this.categories=e.categories.map(f=>new we(f))),this.images=((l=e==null?void 0:e.images)==null?void 0:l.map(f=>new tr(f,D.getConfig().http.mediaUrl)))??[],this.properties=(e==null?void 0:e.properties)??{},this.retailCost=e==null?void 0:e.retailCost,this.retailCostRub=e==null?void 0:e.retailCostRub,this.priceCoefficients=((g=e==null?void 0:e.priceCoefficients)==null?void 0:g.map(f=>new ae(f)))??[],e&&"codeNumber"in e&&!e.code&&(this.code=e==null?void 0:e.codeNumber)}getIsMeasurable(){var i;const e=(i=D.getConfig().catalog)==null?void 0:i.products.units;return[...(e==null?void 0:e.linear)??["пог.м.","м."],...(e==null?void 0:e.square)??["м2"]].includes(this.unit)}getRetailCost(){return this.retailCost??this.cost}getRetailCostRub(){return this.retailCostRub??this.costRub}}class ir extends q{constructor(e){super(e);t(this,"category");t(this,"product");t(this,"quantity");t(this,"height");t(this,"length");t(this,"width");t(this,"barcode");t(this,"marker");t(this,"configurator");t(this,"configuratorParams");t(this,"isAdditionalSale");this.product=new S(e==null?void 0:e.product),this.quantity=e.quantity??0,this.marker=e.marker,this.category=e.category??new ce,this.height=e.height,this.length=e.length,this.width=e.width,this.configurator=e.configurator,this.configuratorParams=e.configuratorParams&&p.cloneDeep(e.configuratorParams),this.isAdditionalSale=e.isAdditionalSale}}class sr extends ir{constructor(e){super(e);t(this,"currency");t(this,"cost");t(this,"costOne");t(this,"costOneRub");t(this,"costRub");t(this,"logicGroupId");t(this,"salesDirection");t(this,"specificationImgUrl");t(this,"sawing");this.currency=e.currency,this.cost=e.cost,this.costOne=e.costOne,this.costOneRub=e.costOneRub,this.costRub=e.costRub,this.logicGroupId=e.logicGroupId,this.salesDirection=e.salesDirection,this.specificationImgUrl=e.specificationImgUrl,this.sawing=e.sawing}}class pe{constructor(r){t(this,"items");t(this,"resultSum");t(this,"directionsSum");this.items=r.items.map(e=>new sr(e)),this.resultSum=r.resultSum,this.directionsSum=r.directionsSum}}class ve{static simpleInstanceInitializer(r){return new r}static instanceInitializer(r,e){return new r(e)}}const I=class I{constructor(){t(this,"httpClient");t(this,"baseUrl",`${D.getConfig().http.portalApiUrl}/api`);t(this,"errorResponseHandler",p.noop);t(this,"interceptorIds",{request:{},response:{}});t(this,"setBaseUrlRequestInterceptor",r=>(r.baseURL=this.baseUrl,r));t(this,"authRequestInterceptor",async r=>{let e;return p.isNil(Pe().accessToken)||(e=await Pe().accessToken),e&&r.headers.set("Authorization",`Bearer ${e}`),r});t(this,"dataConverterRequestInterceptor",r=>(r.method&&(r.method==="get"&&r.params&&(r.params=ne.objectToSnake(r.params)),["put","patch","post"].includes(p.toLower(r.method))&&r.data&&(r.data=ne.objectToSnake(r.data))),r));t(this,"authErrorsResponseInterceptors",r=>{var i;const e=r.rawError?(i=r.rawError)==null?void 0:i.config:void 0;return r.status===401?!e||e.__isRetryRequest?Promise.reject(r):(Pe().invalidateAccessToken(),e.__isRetryRequest=!0,this.httpClient(e)):Promise.reject(r)});t(this,"dataConverterResponseInterceptor",r=>(r.data&&(r.data=ne.objectToCamel(r.data)),r));const r=D.getConfig().version;this.errorResponseHandler=I.defaultErrorsResponseHandler,this.httpClient=qr.create({headers:{"APP-VERSION":`${r.name} (${r.version}, ${m.format(r.date,D.getConfig().dateFormats.uiDate)})`,Accept:"application/json","Content-Type":"application/json"}}),this.interceptorIds.request.setBaseUrlRequestInterceptor=this.httpClient.interceptors.request.use(this.setBaseUrlRequestInterceptor,e=>Promise.reject(e)),this.interceptorIds.request.authRequestInterceptor=this.httpClient.interceptors.request.use(this.authRequestInterceptor,e=>Promise.reject(e)),this.interceptorIds.request.dataConverterRequestInterceptor=this.httpClient.interceptors.request.use(this.dataConverterRequestInterceptor,e=>Promise.reject(e)),this.interceptorIds.response.convertHttpErrorResponseInterceptor=this.httpClient.interceptors.response.use(e=>e,e=>I.convertHttpErrorResponse(e)),this.interceptorIds.response.authErrorsResponseInterceptor=this.httpClient.interceptors.response.use(e=>e,this.authErrorsResponseInterceptors),this.interceptorIds.response.dataConverterResponseInterceptor=this.httpClient.interceptors.response.use(this.dataConverterResponseInterceptor,e=>Promise.reject(e))}static setDefaultErrorsResponseHandler(r){I.defaultErrorsResponseHandler=r}static getInstance(r){return Object.prototype.hasOwnProperty.call(I.instances,r.name)||(I.instances[r.name]=ve.simpleInstanceInitializer(r)),I.instances[r.name]}static convertHttpErrorResponse(r){var e,i;if(!p.isNil(r.request)||!p.isNil(r.response)){const s=r==null?void 0:r.response;return Promise.reject({status:(s==null?void 0:s.status)??0,statusText:(s==null?void 0:s.statusText)??"Unknown",message:((e=s==null?void 0:s.data)==null?void 0:e.message)??"Unknown Error. Probably network error.",errors:(i=s==null?void 0:s.data)==null?void 0:i.errors,headers:(s==null?void 0:s.headers)??{},data:s==null?void 0:s.data,rawError:r})}return Promise.reject(r)}request(r,e=void 0,i={},s=!1){const o=this.httpClient.request(r).then(l=>e?e(l):l.data);return o.catch(l=>{this.errorResponseHandler(l,i,s)}),o}get(r,e={},i=void 0,s=!1){return this.request({method:"GET",url:r,params:e},i,{},s)}getBlob(r,e={},i=void 0,s=!1){return this.request({method:"GET",url:r,params:e,responseType:"blob"},i,{},s)}patch(r,e={},i=void 0,s={},o=!1){return this.request({method:"PATCH",url:r,data:e},i,s,o)}post(r,e={},i=void 0,s={},o=!1){return this.request({method:"POST",url:r,data:e},i,s,o)}delete(r,e=void 0,i=!1){return this.request({method:"DELETE",url:r},e,{},i)}};t(I,"instances",{}),t(I,"defaultErrorsResponseHandler",p.noop);let y=I;class Gr extends y{getCart(r){return this.get(`internal/clients/${r.id}/cart`,{},e=>new pe(e.data))}deleteCart(r){return this.delete(`internal/clients/${r.id}/cart`)}addCartItem(r,e,i={}){return this.patch(`internal/clients/${r.id}/cart`,{id:e.configurator&&e.category.id,productId:e.product.id,quantity:e.quantity,height:e.height,length:e.length,width:e.width,configurator:e.configurator,marker:e.marker,isAdditionalSale:e.isAdditionalSale,...e.configuratorParams},s=>new pe(s.data),i)}patchCartItem(r,e,i={}){return this.patch(`internal/clients/${r.id}/cart/${e.id}`,{id:e.configurator&&e.category.id,productId:e.product.id,quantity:e.quantity,height:e.height,length:e.length,width:e.width,configurator:e.configurator,marker:e.marker,isAdditionalSale:e.isAdditionalSale,...e.configuratorParams},s=>new pe(s.data),i)}deleteCartItem(r,e){return this.get(`internal/clients/${r.id}/cart/${e.id}`,{})}addCartItemFromCSV(r){return this.post(`internal/clients/${r.id}/cart/add-products-from-csv`,{},e=>new pe(e.data))}}var nr=(n=>(n.m2Cost="m2Cost",n.percent="percent",n.value="value",n))(nr||{}),Re=(n=>(n.Discount="discount",n.PriceTemplate="price_template",n.ClientPrice="client_price",n.Product="product",n))(Re||{}),or=(n=>(n.Unknown="unknown",n.Bool="bool",n.Integer="integer",n.Float="float",n.String="string",n.Range="range",n.Json="json",n.Object="object",n))(or||{});class U extends ce{constructor(e){var i,s;super(e);t(this,"categories");t(this,"products");this.categories=(i=e==null?void 0:e.categories)==null?void 0:i.map(o=>new U(o)),this.products=(s=e==null?void 0:e.products)==null?void 0:s.map(o=>new S(o))}}class Ne extends A{constructor(e){super(e);t(this,"updatedAt");this.updatedAt=p.isString(e==null?void 0:e.updatedAt)?m.parseISO(e.updatedAt):e==null?void 0:e.updatedAt}}class cr extends Ne{constructor(e){super(e);t(this,"deletedAt");this.deletedAt=p.isString(e==null?void 0:e.deletedAt)?m.parseISO(e.deletedAt):e==null?void 0:e.deletedAt}}class Mr{static getActualDataFromStorage(r){const e=localStorage.getItem(r);if(e)try{const i=JSON.parse(e);if(m.isAfter(m.parseISO(i.availableFor)||m.startOfToday(),new Date))return i.data??{}}catch{localStorage.removeItem(r)}}static saveActualDataToStorage(r,e,i){localStorage.setItem(r,JSON.stringify({availableFor:i,data:e}))}}class G extends A{constructor(e){super(e);t(this,"type");this.type=e==null?void 0:e.type}}class lr extends A{constructor(e){super(e);t(this,"costCoefficient");t(this,"isLowPriceAllowed");t(this,"publishedAt");t(this,"description");t(this,"percent");t(this,"owner");t(this,"deletedAt");this.costCoefficient=(e==null?void 0:e.costCoefficient)??0,this.isLowPriceAllowed=(e==null?void 0:e.isLowPriceAllowed)??!1,this.publishedAt=p.isString(e==null?void 0:e.publishedAt)?m.parseISO(e.publishedAt):e==null?void 0:e.publishedAt,this.description=(e==null?void 0:e.description)??void 0,this.percent=(e==null?void 0:e.percent)??0,this.owner=new G(e==null?void 0:e.owner),this.deletedAt=p.isString(e==null?void 0:e.deletedAt)?m.parseISO(e.deletedAt):e==null?void 0:e.deletedAt}}class j extends Ne{constructor(e){super(e);t(this,"description");t(this,"createdAt");this.description=(e==null?void 0:e.description)??"",this.createdAt=p.isString(e==null?void 0:e.createdAt)?m.parseISO(e.createdAt):(e==null?void 0:e.createdAt)??new Date}}class z extends S{constructor(e){super(e);t(this,"costCoefficient");t(this,"costSource");t(this,"discount");t(this,"priceTemplate");t(this,"isPreviouslyOrdered");t(this,"isRequired");t(this,"isFavorite");this.costCoefficient=(e==null?void 0:e.costCoefficient)??0,this.costSource=(e==null?void 0:e.costSource)??Re.Product,this.discount=e!=null&&e.discount?new lr(e.discount):void 0,this.priceTemplate=e!=null&&e.priceTemplate?new j(e.priceTemplate):void 0,this.isPreviouslyOrdered=e==null?void 0:e.isPreviouslyOrdered,this.isRequired=e==null?void 0:e.isRequired,this.isFavorite=e==null?void 0:e.isFavorite}}class ur{constructor(r){t(this,"phone");t(this,"email");this.phone=/^\d+$/.test(r.phone??"")?`+${r.phone}`:r.phone,this.email=r.email}}class b extends P{}class Q extends A{constructor(e){super(e);t(this,"salesDirection",new b);t(this,"photo");t(this,"contacts");t(this,"isDefault");e&&(this.salesDirection=new b(e.salesDirection),this.photo=e.photo,e.contacts&&(this.contacts=new ur(e.contacts)),e.isDefault!==void 0&&(this.isDefault=e.isDefault))}}class ge extends Q{constructor(e){super(e);t(this,"isActive");t(this,"isSupervisor");t(this,"canDoReclamations");t(this,"createdAt");t(this,"supervisorId");this.isActive=(e==null?void 0:e.isActive)??!1,this.isSupervisor=(e==null?void 0:e.isSupervisor)??!1,this.canDoReclamations=(e==null?void 0:e.canDoReclamations)??!1,this.createdAt=e==null?void 0:e.createdAt,this.supervisorId=e==null?void 0:e.supervisorId}}class Br extends ce{constructor(e){super(e);t(this,"isDisabled");t(this,"isRequired");t(this,"isFavorite");t(this,"hidingComment");t(this,"manager");this.isDisabled=(e==null?void 0:e.isDisabled)??!1,this.isRequired=(e==null?void 0:e.isRequired)??!1,this.isFavorite=(e==null?void 0:e.isFavorite)??!1,this.hidingComment=e==null?void 0:e.hidingComment,this.manager=e!=null&&e.manager?new ge(e.manager):void 0}}class he extends Br{constructor(e){var i,s;super(e);t(this,"categories");t(this,"products");this.categories=(i=e==null?void 0:e.categories)==null?void 0:i.map(o=>new he(o)),this.products=(s=e==null?void 0:e.products)==null?void 0:s.map(o=>new z(o))}}class qe{constructor(r){t(this,"priceCoefficient");t(this,"increasePercent");this.priceCoefficient=(r==null?void 0:r.priceCoefficient)&&new le(r.priceCoefficient),this.increasePercent=r==null?void 0:r.increasePercent}}class De extends qe{constructor(e){super(e);t(this,"productCategory");this.productCategory=new ce(e==null?void 0:e.productCategory)}}class W extends P{}class Y extends P{constructor(e){super(e);t(this,"country",new W);e&&(this.country=new W(e.country))}}class Ae extends P{constructor(e){super(e);t(this,"region",new Y);e&&(this.region=new Y(e.region))}}class Ue extends A{constructor(e){super(e);t(this,"phone");t(this,"email");t(this,"getNews");t(this,"salesDirection");t(this,"createdAt");t(this,"lastLoginAt");t(this,"isActive");this.phone=/^\d+$/.test((e==null?void 0:e.phone)??"")?`+${e==null?void 0:e.phone}`:(e==null?void 0:e.phone)??"",this.email=(e==null?void 0:e.email)??"",this.getNews=(e==null?void 0:e.getNews)??!1,this.salesDirection=e!=null&&e.salesDirection?new b(e.salesDirection):void 0,this.createdAt=p.isString(e==null?void 0:e.createdAt)?m.parseISO(e.createdAt):e==null?void 0:e.createdAt,this.lastLoginAt=p.isString(e==null?void 0:e.lastLoginAt)?m.parseISO(e.lastLoginAt):e==null?void 0:e.lastLoginAt,this.isActive=(e==null?void 0:e.isActive)??!1}}class X extends Ue{constructor(e){var i;super(e);t(this,"salesDirection");t(this,"debt");t(this,"alternativeName");t(this,"city");t(this,"comment");t(this,"isPhoneApproved");t(this,"isEmailApproved");t(this,"managers");this.salesDirection=new b(e==null?void 0:e.salesDirection),this.debt=(e==null?void 0:e.debt)??0,this.alternativeName=(e==null?void 0:e.alternativeName)??"",this.city=new Ae(e==null?void 0:e.city),this.comment=e==null?void 0:e.comment,this.isPhoneApproved=(e==null?void 0:e.isPhoneApproved)??!1,this.isEmailApproved=(e==null?void 0:e.isEmailApproved)??!1,this.managers=((i=e==null?void 0:e.managers)==null?void 0:i.map(s=>new Q(s)))??[]}}class Z extends q{constructor(e){super(e);t(this,"createdAt");t(this,"deletedAt");t(this,"client");t(this,"priceTemplate");this.createdAt=p.isString(e==null?void 0:e.createdAt)?m.parseISO(e.createdAt):(e==null?void 0:e.createdAt)??new Date,this.deletedAt=p.isString(e==null?void 0:e.deletedAt)?m.parseISO(e.deletedAt):e==null?void 0:e.deletedAt,this.client=new X(e==null?void 0:e.client),this.priceTemplate=new j(e==null?void 0:e.priceTemplate)}}class Te extends qe{constructor(e){super(e);t(this,"product");this.product=new S(e==null?void 0:e.product)}}class Ge extends P{}class x extends A{constructor(e){super(e);t(this,"type");t(this,"description");t(this,"metadata");this.type=new Ge(e==null?void 0:e.type),this.description=(e==null?void 0:e.description)??"",this.metadata=e==null?void 0:e.metadata}}class V{constructor(r){t(this,"property");t(this,"value");this.property=new x(r==null?void 0:r.property),this.value=(r==null?void 0:r.value)??""}}class _{constructor(r){t(this,"from");t(this,"to");this.from=p.isString(r==null?void 0:r.from)?m.parseISO(r.from):(r==null?void 0:r.from)??null,this.to=p.isString(r==null?void 0:r.to)?m.parseISO(r.to):(r==null?void 0:r.to)??null}}class Hr{constructor(r){t(this,"id");t(this,"name");t(this,"description");t(this,"createdAt",new _);t(this,"updatedAt",new _);this.id=r==null?void 0:r.id,this.name=r==null?void 0:r.name,this.description=r==null?void 0:r.description,this.createdAt=new _(r==null?void 0:r.createdAt),this.updatedAt=new _(r==null?void 0:r.updatedAt)}resetFilterValue(r){switch(r){case"id":case"name":case"description":this[r]=void 0;break;case"createdAt":this.createdAt.from=null,this.createdAt.to=null;break;case"updatedAt":this.updatedAt.from=null,this.updatedAt.to=null;break}return this}asClearRaw(){var e,i,s,o;const r={};return Object.keys(this).forEach(l=>{const g=this[l];p.isNil(g)||p.isString(g)&&g.trim().length===0||p.isFunction(g.isNewRec)&&g.isNewRec()||(r[l]=g)}),!((e=r==null?void 0:r.createdAt)!=null&&e.from)&&!((i=r==null?void 0:r.createdAt)!=null&&i.to)&&delete r.createdAt,!((s=r==null?void 0:r.updatedAt)!=null&&s.from)&&!((o=r==null?void 0:r.updatedAt)!=null&&o.to)&&delete r.updatedAt,r}}class pr extends P{}class Me extends P{}class jr extends P{}class gr extends P{}class me extends A{constructor(e){super(e);t(this,"signature","");t(this,"symbol","");e&&(this.signature=e.signature??"",this.symbol=e.symbol??"")}}var $=(n=>(n.Person="individual",n.Ic="entrepreneur",n.UlR="legal",n.UlNr="non_resident_legal",n))($||{});class M extends P{static generatePersonItem(){return new M({id:1,guid:"",slug:$.Person,name:""})}}class hr extends P{}class mr extends P{}class F extends P{}class fr extends P{}class yr extends P{}class Be extends P{}class He extends P{}const ie=class ie extends y{constructor(){super();t(this,"responseDataCacheTimeout");this.responseDataCacheTimeout=D.getConfig().http.responseDataCacheTimeout}static getCachedResponse(e){const i=ie.responseDataCache.get(e);if(i&&i.validTo>new Date)return i.val}cacheResponse(e,i){ie.responseDataCache.set(e,{validTo:m.addSeconds(new Date,this.responseDataCacheTimeout),val:i})}getTypedDataArrayRequester(e,i,s=!1,o={}){const l=i+(p.isEmpty(o)?"":` >>> ${JSON.stringify(o)}`),g=s?ie.getCachedResponse(l):void 0;return g?Promise.resolve(g):this.get(i,o).then(f=>{const v=f.map(T=>ve.instanceInitializer(e,T));return s&&v&&this.cacheResponse(i,v),v})}};t(ie,"responseDataCache",new Map);let E=ie;class w extends E{getReference(r,e=!1){return this.getTypedDataArrayRequester(pr,`/internal/references/${r}`,e)}getChannelPrimaryInterest(){return this.getTypedDataArrayRequester(Me,"/internal/references/channel-primary-interest",!0)}getContactPositions(){return this.getTypedDataArrayRequester(gr,"/internal/references/contact-position",!0)}getCurrency(){return this.getTypedDataArrayRequester(me,"/public/references/currency",!0)}getPartnerGroup(){return this.getTypedDataArrayRequester(F,"/internal/references/partner-group",!0)}getOpf(){return this.getTypedDataArrayRequester(M,"/public/references/opf",!0)}getOrderPaymentStatuses(){return this.getTypedDataArrayRequester(hr,"/public/references/order-payment-status",!0)}getOrderStatuses(){return this.getTypedDataArrayRequester(mr,"/public/references/order-status",!0)}getPaymentTypes(){return this.getTypedDataArrayRequester(fr,"/public/references/payment-type",!0)}getResourceTypes(){return this.getTypedDataArrayRequester(Be,"/internal/references/resource-type",!0)}getSalesDirections(){return this.getTypedDataArrayRequester(b,"/public/references/sales-direction",!0)}getSourcePrimaryInterest(){return this.getTypedDataArrayRequester(He,"/internal/references/source-primary-interest",!0)}searchCity(r){return this.getTypedDataArrayRequester(Ae,`/internal/references/city-with-region-and-country/search?term=${r}`)}searchRegion(r){return this.getTypedDataArrayRequester(Y,`/internal/references/region-with-country/search?term=${r}`)}searchCountry(r){return this.getTypedDataArrayRequester(W,`/internal/references/country/search?term=${r}`)}getDeliveryTypes(){return this.getTypedDataArrayRequester(H,"/internal/references/delivery-type",!0)}getWarehouses(){return this.getTypedDataArrayRequester(ue,"/public/references/warehouse",!0)}getPropertyTypes(){return this.getTypedDataArrayRequester(Ge,"/internal/references/property-type",!0)}getPriceCoefficients(){return this.getTypedDataArrayRequester(le,"/internal/references/price-coefficient",!0)}getProductFileType(){return this.getTypedDataArrayRequester(yr,"/public/references/product-file-type",!0)}}class Cr extends E{async getManagers(){const r="/internal/managers",e=E.getCachedResponse(r);if(e)return e;const s=(await this.get(r)).data.map(o=>ve.instanceInitializer(ge,o));return this.cacheResponse(r,s),s}}const a=K.defineStore("__references_private",()=>{const n=h.ref({}),r=h.ref(void 0),e=h.ref(void 0),i=h.ref(void 0),s=h.ref(void 0),o=h.ref(void 0),l=h.ref(void 0),g=h.ref(void 0),f=h.ref(void 0),v=h.ref(void 0),T=h.ref(void 0),L=h.ref(void 0),k=h.ref(void 0),d=h.ref(void 0),O=h.ref(void 0),N=h.ref(void 0),J=h.ref(void 0),u=h.ref(void 0);return{dataLoaderList:n,channelPrimaryInterestReference:r,contactPositionsReference:e,currencyReference:i,deliveryTypeReference:s,managersList:o,opfReference:l,orderPaymentStatusReference:g,orderStatusReference:f,paymentTypeReference:v,partnerGroupReference:T,productFileTypeReference:L,resourceTypesReference:k,salesDirectionsReference:d,sourcePrimaryInterestReference:O,warehousesReference:N,propertyTypesReference:J,priceCoefficientsReference:u}}),zr=K.defineStore("references",()=>{const n=h.computed(()=>{const u=a();return!u.channelPrimaryInterestReference&&!u.dataLoaderList.channelPrimaryInterestReference&&(u.dataLoaderList.channelPrimaryInterestReference=!0,y.getInstance(w).getChannelPrimaryInterest().then(C=>{u.channelPrimaryInterestReference=C}).catch(p.noop)),u.channelPrimaryInterestReference}),r=h.computed(()=>{const u=a();return!u.contactPositionsReference&&!u.dataLoaderList.contactPositionsReference&&(u.dataLoaderList.contactPositionsReference=!0,y.getInstance(w).getContactPositions().then(C=>{u.contactPositionsReference=C}).catch(p.noop)),u.contactPositionsReference}),e=h.computed(()=>{const u=a();return!u.currencyReference&&!u.dataLoaderList.currencyReference&&(u.dataLoaderList.currencyReference=!0,y.getInstance(w).getCurrency().then(C=>{u.currencyReference=C}).catch(p.noop)),u.currencyReference}),i=h.computed(()=>{const u=a();return!u.opfReference&&!u.dataLoaderList.opfReference&&(u.dataLoaderList.opfReference=!0,y.getInstance(w).getOpf().then(C=>{u.opfReference=C}).catch(p.noop)),u.opfReference}),s=h.computed(()=>{const u=a();return!u.orderPaymentStatusReference&&!u.dataLoaderList.orderPaymentStatusReference&&(u.dataLoaderList.orderPaymentStatusReference=!0,y.getInstance(w).getOrderPaymentStatuses().then(C=>{u.orderPaymentStatusReference=C}).catch(p.noop)),u.orderPaymentStatusReference}),o=h.computed(()=>{const u=a();return!u.orderStatusReference&&!u.dataLoaderList.orderStatusReference&&(u.dataLoaderList.orderStatusReference=!0,y.getInstance(w).getOrderStatuses().then(C=>{u.orderStatusReference=C}).catch(p.noop)),u.orderStatusReference}),l=h.computed(()=>{const u=a();return!u.paymentTypeReference&&!u.dataLoaderList.paymentTypeReference&&(u.dataLoaderList.paymentTypeReference=!0,y.getInstance(w).getPaymentTypes().then(C=>{u.paymentTypeReference=C}).catch(p.noop)),u.paymentTypeReference}),g=h.computed(()=>{const u=a();return!u.partnerGroupReference&&!u.dataLoaderList.partnerGroupReference&&(u.dataLoaderList.partnerGroupReference=!0,y.getInstance(w).getPartnerGroup().then(C=>{u.partnerGroupReference=C}).catch(p.noop)),u.partnerGroupReference}),f=h.computed(()=>{const u=a();return!u.productFileTypeReference&&!u.dataLoaderList.productFileTypeReference&&(u.dataLoaderList.productFileTypeReference=!0,y.getInstance(w).getProductFileType().then(C=>{u.productFileTypeReference=C}).catch(p.noop)),u.productFileTypeReference}),v=h.computed(()=>{const u=a();return!u.resourceTypesReference&&!u.dataLoaderList.resourceTypesReference&&(u.dataLoaderList.resourceTypesReference=!0,y.getInstance(w).getResourceTypes().then(C=>{u.resourceTypesReference=C}).catch(p.noop)),u.resourceTypesReference}),T=h.computed(()=>{const u=a();return!u.salesDirectionsReference&&!u.dataLoaderList.salesDirectionsReference&&(u.dataLoaderList.salesDirectionsReference=!0,y.getInstance(w).getSalesDirections().then(C=>{u.salesDirectionsReference=C}).catch(p.noop)),u.salesDirectionsReference}),L=h.computed(()=>{const u=a();return!u.sourcePrimaryInterestReference&&!u.dataLoaderList.sourcePrimaryInterestReference&&(u.dataLoaderList.sourcePrimaryInterestReference=!0,y.getInstance(w).getSourcePrimaryInterest().then(C=>{u.sourcePrimaryInterestReference=C}).catch(p.noop)),u.sourcePrimaryInterestReference}),k=h.computed(()=>{const u=a();return!u.deliveryTypeReference&&!u.dataLoaderList.deliveryTypeReference&&(u.dataLoaderList.deliveryTypeReference=!0,y.getInstance(w).getDeliveryTypes().then(C=>{u.deliveryTypeReference=C}).catch(p.noop)),u.deliveryTypeReference}),d=h.computed(()=>{const u=a();return!u.managersList&&!u.dataLoaderList.managersList&&(u.dataLoaderList.managersList=!0,y.getInstance(Cr).getManagers().then(C=>{u.managersList=C}).catch(p.noop)),u.managersList}),O=h.computed(()=>{const u=a();return!u.warehousesReference&&!u.dataLoaderList.warehousesReference&&(u.dataLoaderList.warehousesReference=!0,y.getInstance(w).getWarehouses().then(C=>{u.warehousesReference=C}).catch(p.noop)),u.warehousesReference}),N=h.computed(()=>{const u=a();return!u.propertyTypesReference&&!u.dataLoaderList.propertyTypesReference&&(u.dataLoaderList.propertyTypesReference=!0,y.getInstance(w).getPropertyTypes().then(C=>{u.propertyTypesReference=C}).catch(p.noop)),u.propertyTypesReference}),J=h.computed(()=>{const u=a();return!u.priceCoefficientsReference&&!u.dataLoaderList.priceCoefficientsReference&&(u.dataLoaderList.priceCoefficientsReference=!0,y.getInstance(w).getPriceCoefficients().then(C=>{u.priceCoefficientsReference=C}).catch(p.noop)),u.priceCoefficientsReference});return{channelPrimaryInterestsReference:n,contactPositionsReference:r,currencyReference:e,opfReference:i,orderPaymentStatusReference:s,orderStatusReference:o,paymentTypeReference:l,partnerGroupsReference:g,productFilesTypesReference:f,resourceTypesReference:v,salesDirectionsReference:T,sourcePrimaryInterestsReference:L,deliveryTypeReference:k,managersList:d,warehousesReference:O,propertyTypesReference:N,priceCoefficientsReference:J}});var Pr=(n=>(n.Admin="admin",n.Manager="manager",n.Operator="operator",n.Client="client",n.Guest="guest",n))(Pr||{});class wr extends Ue{constructor(e){super(e);t(this,"type");t(this,"canDoReclamations");t(this,"photo");this.type=e==null?void 0:e.type,this.canDoReclamations=(e==null?void 0:e.canDoReclamations)??!1,this.photo=e==null?void 0:e.photo}}class ar extends y{getCurrentUser(){return this.get("/internal/users/info",{},r=>new wr(r.data))}}const Wr=K.defineStore("__user_state_private",()=>{const n=h.ref({}),r=h.ref(void 0);return{dataLoaderList:n,currentUser:r}}),Vr=K.defineStore("user_state",()=>({currentUser:h.computed(async()=>{const r=Wr();return!r.currentUser&&!r.dataLoaderList.currentUser&&(r.dataLoaderList.currentUser=!0,r.currentUser=await y.getInstance(ar).getCurrentUser()),r.currentUser})}));class vr{constructor(r){t(this,"cost");t(this,"costDate");t(this,"isLowCost");t(this,"isRetail");t(this,"discountName");t(this,"priceTemplateName");t(this,"client");t(this,"executor");t(this,"currency");this.cost=r.cost,this.costDate=p.isString(r.costDate)?m.parseISO(r.costDate):r.costDate,this.isLowCost=r.isLowCost,this.isRetail=r.isRetail,this.discountName=r.discountName,this.priceTemplateName=r.priceTemplateName,this.client=r.client?new G(r.client):void 0,this.executor=r.executor?new G(r.executor):void 0,this.currency=r.currency?new me(r.currency):void 0}}class je{constructor(r){t(this,"products",[]);t(this,"productCategories",[]);r!=null&&r.products&&(this.products=r.products.map(e=>new S(e))),r!=null&&r.productCategories&&(this.productCategories=r.productCategories.map(e=>new U(e)))}}class ee extends A{constructor(e){super(e);t(this,"description");t(this,"canChangeLowCost");t(this,"parentRoleId");t(this,"subRoles",[]);t(this,"parentRole");t(this,"level",0);this.description=e==null?void 0:e.description,this.canChangeLowCost=(e==null?void 0:e.canChangeLowCost)??!1,this.parentRoleId=e==null?void 0:e.parentRoleId}}class ze{constructor(r){t(this,"role");t(this,"category");t(this,"minCoefficient");this.role=new ee(r==null?void 0:r.role),this.category=new ce(r==null?void 0:r.category),this.minCoefficient=new le(r==null?void 0:r.minCoefficient)}}class Rr{constructor(r){t(this,"phone");t(this,"tablet");t(this,"laptop");this.phone=(r==null?void 0:r.phone)??360,this.tablet=(r==null?void 0:r.tablet)??600,this.laptop=(r==null?void 0:r.laptop)??1024}}class Dr{constructor(r){t(this,"portalApiUrl");t(this,"mediaUrl");t(this,"responseDataCacheTimeout");this.portalApiUrl=(r==null?void 0:r.portalApiUrl)??"",this.mediaUrl=(r==null?void 0:r.mediaUrl)??"",this.responseDataCacheTimeout=(r==null?void 0:r.responseDataCacheTimeout)??3*60*60}}class Ar{constructor(r){t(this,"dsn");t(this,"environment");t(this,"ignoreErrors");t(this,"trace");t(this,"replay");t(this,"additionalParams");var e,i,s,o;this.dsn=(r==null?void 0:r.dsn)??"",this.environment=(r==null?void 0:r.environment)??"production",this.ignoreErrors=(r==null?void 0:r.ignoreErrors)??[/Network\s{1,3}Error/,/Request\s{1,3}aborted/,/Request\s{1,3}failed\s{1,3}with\s{1,3}status\s{1,3}code\s{1,3}(401|403|422)/],this.trace={allowedTargets:((e=r==null?void 0:r.trace)==null?void 0:e.allowedTargets)??[/^\//],sampleRate:((i=r==null?void 0:r.trace)==null?void 0:i.sampleRate)??0},this.replay={replaysOnErrorSampleRate:((s=r==null?void 0:r.replay)==null?void 0:s.replaysOnErrorSampleRate)??0,replaysSessionSampleRate:((o=r==null?void 0:r.replay)==null?void 0:o.replaysSessionSampleRate)??0},this.additionalParams=(r==null?void 0:r.additionalParams)??{}}}class Tr{constructor(r){t(this,"date");t(this,"name");t(this,"version");this.date=p.isString(r==null?void 0:r.date)?m.parseISO(r.date):(r==null?void 0:r.date)??new Date,this.name=(r==null?void 0:r.name)??"",this.version=(r==null?void 0:r.version)??"0.0.0"}}class Fr{constructor(r){t(this,"environment");t(this,"devMode");t(this,"http");t(this,"deviceTypeByResolution");t(this,"sentry");t(this,"urls");t(this,"version");t(this,"dateFormats");var e,i,s;this.environment=(r==null?void 0:r.environment)??"production",this.devMode=(r==null?void 0:r.devMode)??{},this.http=new Dr(r==null?void 0:r.http),this.deviceTypeByResolution=new Rr(r==null?void 0:r.deviceTypeByResolution),this.sentry=new Ar({environment:this.environment,...r==null?void 0:r.sentry}),this.urls=r==null?void 0:r.urls,this.version=new Tr(r==null?void 0:r.version),this.dateFormats={api:((e=r==null?void 0:r.dateFormats)==null?void 0:e.api)??"yyyy-MM-dd HH:mm:ss",uiDate:((i=r==null?void 0:r.dateFormats)==null?void 0:i.uiDate)??"dd.MM.yyyy",uiDateWithTime:((s=r==null?void 0:r.dateFormats)==null?void 0:s.uiDateWithTime)??"dd.MM.yyyy HH:mm"}}}class Jr extends y{search(r,e=!1){return this.get("/internal/catalog/search",{term:r,show_hidden:e})}getPriceExportLink(r="csv",e=!1,i=void 0,s=void 0){let l=`${D.getConfig().http.portalApiUrl}/api/internal/price/export?format=${r}&show_hidden=${e}`;return i&&(l+=`&category_id=${i}`),s&&(l+=`&client_id=${s}`),l}}class Kr extends y{importPrices(r,e){return this.post(`/internal/clients/${r}/price/import`,e)}updateCategoryPrices(r,e,i){var s;return this.patch(`/internal/clients/${r}/price/categories/${e}`,{price_coefficient_id:(s=i.coefficient)==null?void 0:s.id,increase_percent:i.value})}removeCategoryPrices(r,e){return this.delete(`/internal/clients/${r}/price/categories/${e}`)}markCategoryRequired(r,e){return this.post(`/internal/clients/${r}/price/categories/${e}/required`)}unmarkCategoryRequired(r,e){return this.delete(`/internal/clients/${r}/price/categories/${e}/required`)}markCategoryDisabled(r,e,i){return this.post(`/internal/clients/${r}/price/categories/${e}/disabled`,{comment:i})}unmarkCategoryDisabled(r,e){return this.delete(`/internal/clients/${r}/price/categories/${e}/disabled`)}addCategoryManager(r,e,i){return this.post(`/internal/clients/${r}/price/categories/${e}/manager`,{manager_id:i})}removeCategoryManager(r,e){return this.delete(`/internal/clients/${r}/price/categories/${e}/manager`)}updateProductPrice(r,e,i){var s;return this.patch(`/internal/clients/${r}/price/products/${e}`,{price_coefficient_id:(s=i.coefficient)==null?void 0:s.id,increase_percent:i.value},o=>new z(o.data))}removeProductPrice(r,e){return this.delete(`/internal/clients/${r}/price/products/${e}`,i=>new z(i.data))}markProductRequired(r,e){return this.post(`/internal/clients/${r}/price/products/${e}/required`)}unmarkProductRequired(r,e){return this.delete(`/internal/clients/${r}/price/products/${e}/required`)}getCommercialOfferHtml(r,e){return this.get(`/internal/clients/${r}/price/commercial-offer/view`,e,i=>new Blob([i.data],{type:"text/html"}))}getCommercialOfferPdf(r,e){return this.getBlob(`/internal/clients/${r}/price/commercial-offer/download`,e,i=>new Blob([i.request.response],{type:"application/pdf"}))}sendCommercialOffer(r,e){return this.post(`/internal/clients/${r}/price/commercial-offer/send`,e)}}class Qr extends y{getTemplateList(r){return this.get(`/internal/clients/${r}/price/templates`,{},e=>e.data.map(i=>new Z(i)))}getActiveTemplate(r){return this.get(`/internal/clients/${r}/price/templates/active`,{},e=>new Z(e.data))}attachTemplate(r,e,i){const s=D.getConfig().dateFormats.api;return this.post(`/internal/clients/${r}/price/templates/${e}`,i&&{startAt:i.startAt&&m.format(i.startAt,s),endAt:i.endAt&&m.format(i.endAt,s)},o=>new Z(o.data),{},!0)}applyTemplate(r,e){return this.post(`/internal/clients/${r}/price/templates/${e}/apply`,{},void 0,{},!0)}changeTemplate(r,e,i,s){const o=D.getConfig().dateFormats.api;return this.patch(`/internal/clients/${r}/price/templates/${e}/${i}`,s&&{startAt:s.startAt&&m.format(s.startAt,o),endAt:s.endAt&&m.format(s.endAt,o)},l=>new Z(l.data))}detachTemplate(r,e,i){return this.delete(`/internal/clients/${r}/price/templates/${e}/${i}`)}}class Yr extends y{getRootCategoriesList(r=!1){return this.get("/internal/catalog/categories",{showHidden:r},e=>e.data.map(i=>new U(i)))}getCategoryData(r,e=!1,i=!1){return this.get(`/internal/catalog/categories/${r}`,{showHidden:e,withNestedCategories:i},s=>new U(s.data))}getPublicCategoryData(r){return this.get(`/public/catalog/categories/${r}`,{},e=>new U(e.data))}getCategoryProductsList(r,e=!0,i=!1){return this.get(`/internal/catalog/categories/${r}/products`,{showHidden:i,withPriceCoefficients:e},s=>p.map(s.data,o=>new S(o)))}getCategoryProductsCoefficients(r){return this.get(`/internal/catalog/categories/${r}/products/coefficients`,{},e=>{const{data:i}=e;return p.forEach(i,s=>s.map(o=>new ae(o))),i})}publicSimpleSearch(r,e=10){return new Promise((i,s)=>{this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then(o=>{i(o.categories.map(l=>new U(l)))}).catch(o=>{s(o)})})}}class Xr extends y{getProductData(r,e=!1){return this.get(`/internal/catalog/products/${r}`,{withPriceCoefficients:e},i=>new S(i.data))}getPublicProductData(r){return this.get(`/public/catalog/products/${r}`,{},e=>new S(e.data))}getProductPriceCoefficients(r){return this.get(`/internal/catalog/products/${r}/coefficients`,{},e=>p.map(e.data,i=>new ae(i)))}getProductPriceHistory(r,e){const i={};return p.isNil(e)||(i.clientId=e),this.get(`/internal/price/products/${r}/history`,i,s=>p.map(s.data,o=>new vr(o)))}publicSimpleSearch(r,e=10){return new Promise((i,s)=>{this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then(o=>{i(o.products.map(l=>new S(l)))}).catch(o=>{s(o)})})}}class Zr extends y{getRootCategoriesList(r,e=!1){return this.get("/internal/catalog/categories",{clientId:r,showHidden:e},i=>i.data.map(s=>new he(s)))}getCategoryData(r,e,i=!1,s=!1){return this.get(`/internal/catalog/categories/${e}`,{clientId:r,showHidden:i,withNestedCategories:s},o=>new he(o.data))}getCategoryProductsList(r,e,i=!0,s=!1){return this.get(`/internal/catalog/categories/${e}/products`,{client_id:r,showHidden:s,withPriceCoefficients:i},o=>p.map(o.data,l=>new z(l)))}}class xr extends y{getProductData(r,e,i=!1){return this.get(`/internal/catalog/products/${r}`,{clientId:e,withPriceCoefficients:i},s=>new z(s.data))}}var Se=(n=>(n.BeginWith="bw",n.Contains="cn",n.Custom="custom",n.EndsWith="ew",n.Equals="eq",n.GreaterOrEqual="ge",n.GreaterThan="gt",n.InList="in",n.LessOrEqual="le",n.LessThan="lt",n.NotBeginWith="bn",n.NotContains="nc",n.NotEndsWith="en",n.NotEqual="ne",n.NotInList="ni",n.NotNull="nn",n.Null="nu",n))(Se||{});class We{constructor(r){t(this,"field");t(this,"op");t(this,"value");this.field=(r==null?void 0:r.field)??"",this.op=(r==null?void 0:r.op)??Se.Equals,this.value=(r==null?void 0:r.value)??""}toPrimitive(){const r={field:this.field,op:this.op};return r.value=p.isDate(this.value)?m.format(this.value,D.getConfig().dateFormats.api):this.value,r}}class re{constructor(r){t(this,"groupOp");t(this,"filters");t(this,"groups");var e,i;this.groupOp=(r==null?void 0:r.groupOp)??"and",this.filters=((e=r==null?void 0:r.filters)==null?void 0:e.map(s=>new We(s)))??[],this.groups=((i=r==null?void 0:r.groups)==null?void 0:i.map(s=>new re(s)))??[]}toPrimitive(){return{groupOp:this.groupOp,filters:this.filters.map(r=>r instanceof We&&p.isFunction(r.toPrimitive)?r.toPrimitive():r),groups:this.groups.map(r=>r instanceof re?r.toPrimitive():r)}}}class fe extends y{getPaginated(r,e,i,s,o,l,g){let f={page:(s==null?void 0:s.page)??1,perPage:(s==null?void 0:s.pageSize)??10};return e&&(f.filters=JSON.stringify((e instanceof re?e:new re(e)).toPrimitive())),p.isEmpty(i)||(f.sort=p.isArray(i)?i:[i]),o&&(f={...f,...o}),this.get(r,f,l,g)}}class Er extends fe{getTemplateList(r,e,i){return this.getPaginated("/internal/price/templates",r,e,i,{},s=>{const o={...s.data};return o.data=o.data.map(l=>new j(l)),o})}createTemplate(r,e={}){return this.post("/internal/price/templates",r,i=>new j(i.data),e)}getTemplate(r){return this.get(`/internal/price/templates/${r}`,{},e=>new j(e.data))}updateTemplate(r,e,i={}){return this.patch(`/internal/price/templates/${r}`,e,s=>new j(s.data),i)}removeTemplate(r){return this.delete(`/internal/price/templates/${r}`)}getProductTemplatePrices(r){return this.get(`/internal/price/templates/${r}/products`,{},e=>e.data.map(i=>new Te(i)))}getProductTemplatePrice(r,e){return this.get(`/internal/price/templates/${r}/products/${e}`,{},i=>new Te(i.data))}saveProductTemplatePrice(r,e,i){var s;return this.post(`/internal/price/templates/${r}/products/${e}`,{price_coefficient_id:(s=i.coefficient)==null?void 0:s.id,increase_percent:i.value},o=>new Te(o.data))}deleteProductTemplatePrice(r,e){return this.delete(`/internal/price/templates/${r}/products/${e}`)}getCategoryTemplatePrices(r){return this.get(`/internal/price/templates/${r}/categories`,{},e=>e.data.map(i=>new De(i)))}getCategoryTemplatePrice(r,e){return this.get(`/internal/price/templates/${r}/categories/${e}`,{},i=>new De(i.data))}saveCategoryTemplatePrice(r,e,i,s=!1){var o;return this.request({method:"POST",url:`/internal/price/templates/${r}/categories/${e}`,data:{price_coefficient_id:(o=i.coefficient)==null?void 0:o.id,increase_percent:i.value},params:s?{recursively:!0}:{}},l=>new De(l.data))}deleteCategoryTemplatePrice(r,e,i=!1){return this.request({method:"DELETE",url:`/internal/price/templates/${r}/categories/${e}`,params:i?{recursively:!0}:{}})}getTemplateClients(r){return this.get(`/internal/price/templates/${r}/clients`,{},e=>e.data.map(i=>new Z(i)))}}class et extends y{getRoles(){return this.get("/internal/price/roles",{},r=>r.data.map(e=>new ee(e)))}createRole(r){return this.post("/internal/price/roles",r,e=>new ee(e.data))}getRole(r){return this.get(`/internal/price/roles/${r}`,{},e=>new ee(e.data))}updateRole(r,e){return this.patch(`/internal/price/roles/${r}`,e,i=>new ee(i.data))}deleteRole(r){return this.delete(`/internal/price/roles/${r}`)}getCategoryRules(r){return this.get(`/internal/price/roles/rules/categories/${r}`,{},e=>e.data.map(i=>new ze(i)))}updateCategoryRules(r,e){return this.patch(`/internal/price/roles/rules/categories/${r}`,e,i=>i.data.map(s=>new ze(s)))}}class rt extends fe{getProperties(r,e,i){return this.getPaginated("/internal/catalog/properties",r,e,i,{},s=>{const o={...s.data};return o.data=o.data.map(l=>new x(l)),o})}createProperty(r){const{typeId:e,...i}=r;return this.post("/internal/catalog/properties",{...i,type:e},s=>new x(s.data))}getProperty(r){return this.get(`/internal/catalog/properties/${r}`,{},e=>new x(e.data))}updateProperty(r,e){const{typeId:i,...s}=e;return this.patch(`/internal/catalog/properties/${r}`,{...s,type:i},o=>new x(o.data))}deleteProperty(r){return this.delete(`/internal/catalog/properties/${r}`)}getProductProperties(r){return this.get(`/internal/catalog/products/${r}/properties`,{},e=>e.data.map(i=>new V(i)))}getProductProperty(r,e){return this.get(`/internal/catalog/products/${r}/properties/${e}`,{},i=>new V(i.data))}updateProductProperty(r,e,i){return this.patch(`/internal/catalog/products/${r}/properties/${e}`,{value:i},s=>new V(s.data))}deleteProductProperty(r,e){return this.delete(`/internal/catalog/products/${r}/properties/${e}`)}getProductDescription(r){return this.get(`/internal/catalog/products/${r}/properties/description`)}updateProductDescription(r,e){return this.patch(`/internal/catalog/products/${r}/properties/description`,{text:e})}deleteProductDescription(r){return this.delete(`/internal/catalog/products/${r}/properties/description`)}getProductSpecification(r){return this.get(`/internal/catalog/products/${r}/properties/specification`)}updateProductSpecification(r,e){return this.patch(`/internal/catalog/products/${r}/properties/specification`,{text:e})}deleteProductSpecification(r){return this.delete(`/internal/catalog/products/${r}/properties/specification`)}getProductFiles(r){return this.get(`/internal/catalog/products/${r}/properties/files`)}addProductFile(r,e){return this.post(`/internal/catalog/products/${r}/properties/files`,e)}updateProductFile(r,e,i){return this.patch(`/internal/catalog/products/${r}/properties/files/${e}`,i)}deleteProductFile(r,e){return this.delete(`/internal/catalog/products/${r}/properties/files/${e}`)}updateProductSlug(r,e){return this.patch(`/internal/catalog/products/${r}/properties/slug`,{slug:e})}getCategoryProperties(r){return this.get(`/internal/catalog/categories/${r}/properties`,{},e=>e.data.map(i=>new V(i)))}getCategoryProperty(r,e){return this.get(`/internal/catalog/categories/${r}/properties/${e}`,{},i=>new V(i.data))}updateCategoryProperty(r,e,i){return this.patch(`/internal/catalog/categories/${r}/properties/${e}`,{value:i},s=>new V(s.data))}deleteCategoryProperty(r,e){return this.delete(`/internal/catalog/categories/${r}/properties/${e}`)}getCategoryDescription(r){return this.get(`/internal/catalog/categories/${r}/properties/description`)}updateCategoryDescription(r,e){return this.patch(`/internal/catalog/categories/${r}/properties/description`,{text:e})}deleteCategoryDescription(r){return this.delete(`/internal/catalog/categories/${r}/properties/description`)}getCategorySpecification(r){return this.get(`/internal/catalog/categories/${r}/properties/specification`)}updateCategorySpecification(r,e){return this.patch(`/internal/catalog/categories/${r}/properties/specification`,{text:e})}deleteCategorySpecification(r){return this.delete(`/internal/catalog/categories/${r}/properties/specification`)}getCategoryFiles(r){return this.get(`/internal/catalog/categories/${r}/properties/files`)}addCategoryFile(r,e){return this.post(`/internal/catalog/categories/${r}/properties/files`,e)}updateCategoryFile(r,e,i){return this.patch(`/internal/catalog/categories/${r}/properties/files/${e}`,i)}deleteCategoryFile(r,e){return this.delete(`/internal/catalog/categories/${r}/properties/files/${e}`)}updateCategorySlug(r,e){return this.patch(`/internal/catalog/categories/${r}/properties/slug`,{slug:e})}updateCategoryImage(r,e){return this.post(`/internal/catalog/categories/${r}/image`,{image:e})}}class tt extends y{getProductCategoryRecommendations(r){return this.get(`/internal/catalog/recommendations/categories/${r.id}`,{},e=>new je(e.data))}getProductRecommendations(r){return this.get(`/internal/catalog/recommendations/products/${r.id}`,{},e=>new je(e.data))}saveProductCategoryRecommendations(r,e){return this.post(`/internal/catalog/recommendations/categories/${r.id}`,{product_categories:e.productCategories.map(i=>i.id),products:e.products.map(i=>i.id)})}saveProductRecommendations(r,e){return this.post(`/internal/catalog/recommendations/products/${r.id}`,{product_categories:e.productCategories.map(i=>i.id),products:e.products.map(i=>i.id)})}}function Ve(n,r,e){let i;return n.some(s=>{if(s.type===e&&s.id===r)return i=s,!0;if(s.type==="product")return!1;const o=s;if(o.products&&o.products.length>0){const l=Ve(o.products,r,e);if(l)return i=l,!0}if(o.categories&&o.categories.length>0){const l=Ve(o.categories,r,e);if(l)return i=l,!0}return!1}),i}var Sr=(n=>(n.LastOrder="last_order",n.Contacts="contacts",n.PartnerGroups="partner_groups",n.PreferredDeliveryType="preferred_delivery_type",n.SalesDirection="sales_direction",n.Managers="managers",n))(Sr||{});class $e extends q{constructor(e){super(e);t(this,"bankName","");t(this,"bic","");t(this,"accountNumber","");t(this,"correspondentAccount","");t(this,"currency",new me);e&&(this.bankName=e.bankName??"",this.bic=e.bic??"",this.accountNumber=e.accountNumber??"",this.correspondentAccount=e.correspondentAccount??"",this.currency=new me(e.currency))}}class be extends A{constructor(e){super(e);t(this,"phone");t(this,"email");this.email=e==null?void 0:e.email,this.phone=/^\d+$/.test((e==null?void 0:e.phone)??"")?`+${e==null?void 0:e.phone}`:e==null?void 0:e.phone}}class B extends be{constructor(e){super(e);t(this,"isPrimary");t(this,"position");t(this,"notDisturb");t(this,"comment");t(this,"updatedAt");t(this,"deletedAt");this.isPrimary=(e==null?void 0:e.isPrimary)??!1,this.position=e==null?void 0:e.position,this.notDisturb=(e==null?void 0:e.notDisturb)??!1,this.comment=e==null?void 0:e.comment,this.updatedAt=e==null?void 0:e.updatedAt,this.deletedAt=p.isString(e==null?void 0:e.deletedAt)?m.parseISO(e.deletedAt):e==null?void 0:e.deletedAt}}class Fe extends A{constructor(e){super(e);t(this,"manager",new Q);t(this,"opf",M.generatePersonItem());t(this,"salesDirection",new b);t(this,"partnerGroup",new F);t(this,"contacts",[]);t(this,"bankAccounts",[]);t(this,"comment");t(this,"alternativeName");t(this,"createdAt");t(this,"creator");t(this,"updatedAt");t(this,"updater");if(e){if(this.opf=new M(e.opf),this.salesDirection=new b(e.salesDirection),this.comment=e.comment,this.alternativeName=e.alternativeName,this.createdAt=p.isString(e==null?void 0:e.createdAt)?m.parseISO(e.createdAt):e.createdAt,this.creator=e.creator?new G(e.creator):void 0,this.updatedAt=p.isString(e==null?void 0:e.updatedAt)?m.parseISO(e.updatedAt):e.updatedAt,this.updater=e.updater?new G(e.updater):void 0,e.partnerGroup&&(this.partnerGroup=new F(e.partnerGroup)),e.manager&&(this.manager=new Q(e.manager)),e.contacts){const i=[];e.contacts.forEach(s=>{i.push(new B(s))}),this.contacts=i}if(e.bankAccounts){const i=[];e.bankAccounts.forEach(s=>{i.push(new $e(s))}),this.bankAccounts=i}}}}class $r extends Fe{constructor(r){super(r)}}class Je extends Fe{constructor(e){super(e);t(this,"inn","");t(this,"okpo","");t(this,"directorName","");t(this,"directorPosition","");t(this,"directorActsOn","");t(this,"legalAddress","");t(this,"postalAddress","");t(this,"actualAddress","");e&&(this.inn=e.inn??"",this.okpo=e.okpo??"",this.directorName=e.directorName??"",this.directorPosition=e.directorPosition??"",this.directorActsOn=e.directorActsOn??"",this.legalAddress=e.legalAddress??"",this.postalAddress=e.postalAddress??"",this.actualAddress=e.actualAddress??"")}}class Ke extends Je{constructor(e){super(e);t(this,"kpp","");e&&(this.kpp=e.kpp??"")}}class br extends Ke{constructor(e){super(e);t(this,"registrationCountry",new W);t(this,"registrationNumber","");t(this,"taxNumber","");e&&(this.registrationCountry=new W(e.registrationCountry),this.registrationNumber=e.registrationNumber??"",this.taxNumber=e.taxNumber??"")}}class ye{static createInstance(r){switch(r.opf.slug){case $.Ic:return new Je(r);case $.UlR:return new Ke(r);case $.UlNr:return new br(r);default:return new $r(r)}}}class Ie extends q{constructor(e){super(e);t(this,"isPrimary");this.isPrimary=e.isPrimary}}class Ir extends B{constructor(e){super(e);t(this,"relations",{clients:[],contragents:[],addresses:[]});e.relations&&(e.relations.addresses&&(this.relations.addresses=e.relations.addresses.map(i=>new Ie(i))),e.relations.clients&&(this.relations.clients=e.relations.clients.map(i=>new Ie(i))),e.relations.contragents&&(this.relations.contragents=e.relations.contragents.map(i=>new Ie(i))))}}class Ce extends cr{constructor(e){var i;super(e);t(this,"address","");t(this,"coordinates");t(this,"contacts");t(this,"comment");t(this,"operatingHours");t(this,"isOneTime");t(this,"isTransportCompanyAddress");this.address=(e==null?void 0:e.address)??"",this.coordinates=new Oe(e==null?void 0:e.coordinates),this.contacts=((i=e==null?void 0:e.contacts)==null?void 0:i.map(s=>new B(s)))??[],this.comment=e==null?void 0:e.comment,this.operatingHours=e==null?void 0:e.operatingHours,this.isOneTime=e==null?void 0:e.isOneTime,this.isTransportCompanyAddress=e==null?void 0:e.isTransportCompanyAddress}}class Qe extends X{constructor(e){var i,s,o,l;super(e);t(this,"contragents");t(this,"partnerGroups");t(this,"contacts");t(this,"deliveryAddresses");t(this,"channelPrimaryInterest");t(this,"sourcePrimaryInterest");t(this,"preferredDeliveryType");t(this,"primaryDemand");t(this,"isExcludedFromMsCallsToClients");t(this,"preferredWarehouse");t(this,"extraData");this.contragents=((i=e==null?void 0:e.contragents)==null?void 0:i.map(g=>ye.createInstance(g)))??[],this.partnerGroups=((s=e==null?void 0:e.partnerGroups)==null?void 0:s.map(g=>new F(g)))??[],this.contacts=((o=e==null?void 0:e.contacts)==null?void 0:o.map(g=>new B(g)))??[],this.deliveryAddresses=((l=e==null?void 0:e.deliveryAddresses)==null?void 0:l.map(g=>new Ce(g)))??[],this.channelPrimaryInterest=new Me(e==null?void 0:e.channelPrimaryInterest),this.sourcePrimaryInterest=new He(e==null?void 0:e.sourcePrimaryInterest),this.preferredDeliveryType=new H(e==null?void 0:e.preferredDeliveryType),this.primaryDemand=e==null?void 0:e.primaryDemand,this.isExcludedFromMsCallsToClients=(e==null?void 0:e.isExcludedFromMsCallsToClients)??!1,this.preferredWarehouse=e!=null&&e.preferredWarehouse?new ue(e.preferredWarehouse):void 0,this.extraData=(e==null?void 0:e.extraData)??{}}}class it{constructor(r){t(this,"id");t(this,"name");t(this,"alternativeName");t(this,"searchTerm");t(this,"cities");t(this,"region");t(this,"country");t(this,"phone");t(this,"email");t(this,"isActive");t(this,"createdAt",new _);t(this,"lastLoginDate",new _);t(this,"lastLoginDateHasOrder");t(this,"managers");t(this,"isManagerRequired");t(this,"salesDirections");t(this,"contragentInn");t(this,"contragentType");t(this,"preferredDeliveryType");t(this,"partnerGroups");t(this,"contact");t(this,"lastOrder");var e,i,s,o,l,g;this.id=r==null?void 0:r.id,this.name=r==null?void 0:r.name,this.alternativeName=r==null?void 0:r.alternativeName,this.searchTerm=r==null?void 0:r.searchTerm,this.cities=(e=r==null?void 0:r.cities)==null?void 0:e.map(f=>new Ae(f)),this.region=new Y(r==null?void 0:r.region),this.country=new W(r==null?void 0:r.country),this.phone=r==null?void 0:r.phone,this.email=r==null?void 0:r.email,this.isActive=r&&Object.prototype.hasOwnProperty.call(r,"isActive")?r==null?void 0:r.isActive:!0,this.createdAt=new _(r==null?void 0:r.createdAt),this.lastLoginDate=new _(r==null?void 0:r.lastLoginDate),this.lastLoginDateHasOrder=(r==null?void 0:r.lastLoginDateHasOrder)??void 0,this.managers=r!=null&&r.managers&&r.managers.length>0?r.managers.map(f=>new ge(f)):[],this.salesDirections=(i=r==null?void 0:r.salesDirections)==null?void 0:i.map(f=>new b(f)),this.contragentInn=r==null?void 0:r.contragentInn,this.contragentType=new M(r==null?void 0:r.contragentType),this.preferredDeliveryType=new H(r==null?void 0:r.preferredDeliveryType),this.partnerGroups=(s=r==null?void 0:r.partnerGroups)==null?void 0:s.map(f=>new F(f)),this.contact=new be(r==null?void 0:r.contact),this.lastOrder={createdAt:new _((o=r==null?void 0:r.lastOrder)==null?void 0:o.createdAt),creator:(l=r==null?void 0:r.lastOrder)==null?void 0:l.creator,isApproved:(g=r==null?void 0:r.lastOrder)==null?void 0:g.isApproved}}resetFilterValue(r){switch(r){case"id":case"phone":case"email":case"name":case"alternativeName":case"searchTerm":case"contragentInn":this[r]=void 0;break;case"cities":this.cities=[];break;case"region":this.region=new Y;break;case"isActive":this.isActive=!0;break;case"createdAt":this.createdAt.from=null,this.createdAt.to=null;break;case"lastLoginDate":this.lastLoginDate.from=null,this.lastLoginDate.to=null;break;case"lastLoginDateHasOrder":this.lastLoginDateHasOrder=void 0;break;case"lastOrder":this.lastOrder={};break;case"managers":this.managers=[];break;case"salesDirections":this.salesDirections=[];break;case"contragentType":this.contragentType=new M;break;case"preferredDeliveryType":this.preferredDeliveryType=new H;break;case"partnerGroups":this.partnerGroups=[];break;case"contact":this.contact=new be;break}return this}asClearRaw(){var e,i,s,o;const r={};return Object.keys(this).forEach(l=>{const g=this[l];p.isNil(g)||p.isString(g)&&g.trim().length===0||p.isFunction(g.isNewRec)&&g.isNewRec()||(r[l]=g)}),!((e=r==null?void 0:r.createdAt)!=null&&e.from)&&!((i=r==null?void 0:r.createdAt)!=null&&i.to)&&delete r.createdAt,!((s=r==null?void 0:r.lastLoginDate)!=null&&s.from)&&!((o=r==null?void 0:r.lastLoginDate)!=null&&o.to)&&delete r.lastLoginDate,r}}class Ye extends q{constructor(e){super(e);t(this,"createdAt");t(this,"creator");t(this,"isApproved1c");this.createdAt=p.isString(e==null?void 0:e.createdAt)?m.parseISO(e.createdAt):(e==null?void 0:e.createdAt)??new Date,this.creator=new G(e==null?void 0:e.creator),this.isApproved1c=(e==null?void 0:e.isApproved1c)??!1}}class _r extends A{constructor(e){var i,s;super(e);t(this,"contacts",[]);t(this,"preferredDeliveryType");t(this,"partnerGroups",[]);t(this,"lastOrder");t(this,"salesDirection");t(this,"managers");(i=e.contacts)!=null&&i.length&&(this.contacts=e.contacts.map(o=>new B(o))),e.lastOrder&&(this.lastOrder=new Ye(e.lastOrder)),(s=e.partnerGroups)!=null&&s.length&&(this.partnerGroups=e.partnerGroups.map(o=>new F(o))),e.preferredDeliveryType&&(this.preferredDeliveryType=new H(e.preferredDeliveryType)),e.salesDirection&&(this.salesDirection=new b(e.salesDirection)),e.managers&&(this.managers=e.managers.map(o=>new Q(o)))}}class Lr{constructor(r){t(this,"page",1);t(this,"pageSize",50);this.page=(r==null?void 0:r.page)??1,this.pageSize=(r==null?void 0:r.pageSize)??50}}class st extends Lr{constructor(e){super(e);t(this,"itemCount",0);t(this,"pageCount",1);t(this,"pageSlot",5);t(this,"pageSizes",[25,50,100]);t(this,"showSizePicker",!0);this.itemCount=(e==null?void 0:e.itemCount)??0,this.pageCount=(e==null?void 0:e.pageCount)??1,this.pageSlot=(e==null?void 0:e.pageSlot)??5,this.pageSizes=(e==null?void 0:e.pageSizes)??[25,50,100],this.showSizePicker=(e==null?void 0:e.showSizePicker)??!0}}class nt{constructor(r){t(this,"field");t(this,"direction");this.field=(r==null?void 0:r.field)??"",this.direction=(r==null?void 0:r.direction)??"asc"}}class ot extends fe{getClient(r){return this.get(`/internal/clients/${r}`,{},e=>new Qe(e.data))}getClientsList(r,e,i,s){return this.getPaginated("/internal/clients",r,e,i,s,o=>{const l={...o.data};return l.data=l.data.map(g=>new X(g)),l})}getClientByPhone(r){return this.getClientsList({groupOp:"and",groups:[],filters:[{field:"phone",op:Se.Contains,value:r}]})}getAdditionalClientsData(r,e){const i=r.map(s=>s.id);return this.post("/internal/clients/additional-data",{clients:i,requested_data_types:e},s=>{let o=[];return(s==null?void 0:s.data.length)>0&&(o=s.data.map(l=>new _r(l))),o})}getAllClientContacts(r){return this.get(`/internal/clients/${r}/contacts/all`,{},e=>{let i=[];return(e==null?void 0:e.data.length)>0&&(i=e.data.map(s=>new Ir(s))),i})}createClientCommonData(r,e={}){var i;return this.post("/internal/clients",{name:r.name,alternative_name:r.alternativeName,partner_groups:r.partnerGroups.map(s=>s.id),phone:r.phone,email:r.email,city_id:r.city.id,get_news:r.getNews,channel_primary_interest_id:r.channelPrimaryInterest.id,source_primary_interest_id:r.sourcePrimaryInterest.id,primary_demand:r.primaryDemand,is_excluded_from_ms_calls_to_clients:r.isExcludedFromMsCallsToClients,preferred_warehouse_id:(i=r.preferredWarehouse)==null?void 0:i.id},s=>new Qe(s.data),e)}updateClientCommonData(r,e={}){var i;return this.patch(`/internal/clients/${r.id}`,{name:r.name,alternative_name:r.alternativeName,partner_groups:r.partnerGroups.map(s=>s.id),phone:r.phone,email:r.email,city_id:r.city.id,get_news:r.getNews,channel_primary_interest_id:r.channelPrimaryInterest.id,source_primary_interest_id:r.sourcePrimaryInterest.id,primary_demand:r.primaryDemand,is_excluded_from_ms_calls_to_clients:r.isExcludedFromMsCallsToClients,preferred_warehouse_id:(i=r.preferredWarehouse)==null?void 0:i.id},void 0,e)}changeClientPassword(r,e,i,s={}){return this.patch(`/internal/clients/${r}`,{password:e,password_confirmation:i},void 0,s)}updateClientComment(r){return this.patch(`/internal/clients/${r.id}`,{comment:r.comment})}changeClientActivation(r){return this.patch(`/internal/clients/${r.id}`,{is_active:r.isActive})}async attachClientToManagers(r,e){const i=e.map(s=>this.patch(`/internal/clients/${r}/managers/${s.id}/attach`,{is_primary:s.isDefault}));await Promise.all(i)}async detachClientFromManagers(r,e){const i=e.map(s=>this.patch(`/internal/clients/${r}/managers/${s.id}/detach`));await Promise.all(i)}createContragentClientData(r,e,i={}){var f,v,T,L,k,d,O,N;let s;const o=e,l=e,g=e;switch(e.opf.slug){case $.Ic:s={opf:o.opf.slug,name:o.name,alternative_name:o.alternativeName,partner_group_id:(f=o.partnerGroup)==null?void 0:f.id,manager_id:(v=o.manager)==null?void 0:v.id,comment:o.comment,inn:o.inn,okpo:o.okpo,director_name:o.directorName,director_position:o.directorPosition,director_acts_on:o.directorActsOn,legal_address:o.legalAddress,postal_address:o.postalAddress,actual_address:o.actualAddress};break;case $.UlR:s={opf:l.opf.slug,name:l.name,alternative_name:l.alternativeName,partner_group_id:(T=l.partnerGroup)==null?void 0:T.id,manager_id:(L=l.manager)==null?void 0:L.id,comment:l.comment,inn:l.inn,kpp:l.kpp,okpo:l.okpo,director_name:l.directorName,director_position:l.directorPosition,director_acts_on:l.directorActsOn,legal_address:l.legalAddress,postal_address:l.postalAddress,actual_address:l.actualAddress};break;case $.UlNr:s={opf:g.opf.slug,name:g.name,alternative_name:g.alternativeName,partner_group_id:(k=g.partnerGroup)==null?void 0:k.id,manager_id:(d=g.manager)==null?void 0:d.id,comment:g.comment,director_name:g.directorName,director_position:g.directorPosition,director_acts_on:g.directorActsOn,legal_address:g.legalAddress,postal_address:g.postalAddress,actual_address:g.actualAddress,registration_country_id:g.registrationCountry.id,registration_number:g.registrationNumber,tax_number:g.taxNumber||void 0};break;default:s={opf:e.opf.slug,name:e.name,alternative_name:e.alternativeName,partner_group_id:(O=e.partnerGroup)==null?void 0:O.id,manager_id:(N=e.manager)==null?void 0:N.id,comment:e.comment};break}return this.post(`/internal/clients/${r}/contragents`,s,J=>ye.createInstance(J.data),i)}updateContragentClientData(r,e,i={}){var f,v,T,L,k,d,O,N;let s;const o=e,l=e,g=e;switch(e.opf.slug){case $.Ic:s={opf:o.opf.slug,name:o.name,alternative_name:o.alternativeName,partner_group_id:(f=o.partnerGroup)==null?void 0:f.id,manager_id:(v=o.manager)==null?void 0:v.id,comment:o.comment,inn:o.inn,okpo:o.okpo,director_name:o.directorName,director_position:o.directorPosition,director_acts_on:o.directorActsOn,legal_address:o.legalAddress,postal_address:o.postalAddress,actual_address:o.actualAddress};break;case $.UlR:s={opf:l.opf.slug,name:l.name,alternative_name:l.alternativeName,partner_group_id:(T=l.partnerGroup)==null?void 0:T.id,manager_id:(L=l.manager)==null?void 0:L.id,comment:l.comment,inn:l.inn,kpp:l.kpp,okpo:l.okpo,director_name:l.directorName,director_position:l.directorPosition,director_acts_on:l.directorActsOn,legal_address:l.legalAddress,postal_address:l.postalAddress,actual_address:l.actualAddress};break;case $.UlNr:s={opf:g.opf.slug,name:g.name,alternative_name:g.alternativeName,partner_group_id:(k=g.partnerGroup)==null?void 0:k.id,manager_id:(d=g.manager)==null?void 0:d.id,comment:g.comment,director_name:g.directorName,director_position:g.directorPosition,director_acts_on:g.directorActsOn,legal_address:g.legalAddress,postal_address:g.postalAddress,actual_address:g.actualAddress,registration_country_id:g.registrationCountry.id,registration_number:g.registrationNumber,tax_number:g.taxNumber||void 0};break;default:s={opf:e.opf.slug,name:e.name,alternative_name:e.alternativeName,partner_group_id:(O=e.partnerGroup)==null?void 0:O.id,manager_id:(N=e.manager)==null?void 0:N.id,comment:e.comment};break}return this.patch(`/internal/clients/${r}/contragents/${e.id}`,s,J=>ye.createInstance(J.data),i)}deleteClientContragent(r,e){return this.delete(`/internal/clients/${r}/contragents/${e.id}`)}createClientDeliveryAddress(r,e,i={}){var o,l;const s={address:e.address,is_one_time:e.isOneTime??!1,is_transport_company_address:e.isTransportCompanyAddress??!1,comment:e.comment??""};return e.coordinates&&(s.coordinates={lat:(o=e.coordinates)==null?void 0:o.lat,long:(l=e.coordinates)==null?void 0:l.long}),e.operatingHours&&(s.operating_hours={from:e.operatingHours.from,to:e.operatingHours.to}),this.post(`/internal/clients/${r}/delivery-addresses`,s,g=>new Ce(g.data),i)}updateClientDeliveryAddress(r,e,i={}){var o,l;const s={address:e.address,is_one_time:e.isOneTime??!1,is_transport_company_address:e.isTransportCompanyAddress??!1,comment:e.comment??""};return e.operatingHours&&(s.operating_hours={from:e.operatingHours.from,to:e.operatingHours.to}),e.coordinates&&(s.coordinates={lat:(o=e.coordinates)==null?void 0:o.lat,long:(l=e.coordinates)==null?void 0:l.long}),this.patch(`/internal/clients/${r}/delivery-addresses/${e.id}`,s,g=>new Ce(g.data),i)}deleteClientDeliveryAddress(r,e){return this.delete(`/internal/clients/${r}/delivery-addresses/${e.id}`)}createContragentBankAccount(r,e,i,s={}){return this.post(`/internal/clients/${r}/contragents/${e}/bank-accounts`,{bank_name:i.bankName,bic:i.bic,account_number:i.accountNumber,correspondent_account:i.correspondentAccount,currency_id:i.currency.id},o=>new $e(o.data),s)}updateContragentBankAccount(r,e,i,s={}){return this.patch(`/internal/clients/${r}/contragents/${e}/bank-accounts/${i.id}`,{bank_name:i.bankName,bic:i.bic,account_number:i.accountNumber,correspondent_account:i.correspondentAccount,currency_id:i.currency.id},o=>new $e(o.data),s)}deleteContragentBankAccount(r,e,i){return this.delete(`/internal/clients/${r}/contragents/${e}/bank-accounts/${i.id}`)}createClientContact(r,e,i={}){return this.createContact(r,e,{client:{id:r,is_primary:e.isPrimary??!1,not_disturb:e.notDisturb??!1}},i)}updateClientContact(r,e,i={}){return this.patch(`/internal/clients/${r}/contacts/${e.id}`,{name:e.name,position:e.position,phone:e.phone,email:e.email,comment:e.comment,not_disturb:e.notDisturb},s=>new B(s.data),i)}setPrimaryClientContact(r,e){return this.setPrimaryContact(`/internal/clients/${r}/contacts/${e.id}/primary`,e.isPrimary??!1)}detachClientContact(r,e){return this.detachContact(`/internal/clients/${r}/contacts/${e.id}/detach`)}createContragentContact(r,e,i,s={}){return this.createContact(r,i,{contragents:[{id:e,is_primary:i.isPrimary??!1,not_disturb:i.notDisturb??!1}]},s)}setPrimaryContragentContact(r,e,i){return this.setPrimaryContact(`/internal/clients/${r}/contragents/${e}/contacts/${i.id}/primary`,i.isPrimary??!1)}detachContragentContact(r,e,i){return this.detachContact(`/internal/clients/${r}/contragents/${e}/contacts/${i.id}/detach`)}createDeliveryAddressContact(r,e,i,s={}){return this.createContact(r,i,{addresses:[{id:e,is_primary:i.isPrimary??!1,not_disturb:i.notDisturb??!1}]},s)}setPrimaryDeliveryAddressContact(r,e,i){return this.setPrimaryContact(`/internal/clients/${r}/delivery-addresses/${e}/contacts/${i.id}/primary`,i.isPrimary??!1)}detachDeliveryAddressContact(r,e,i){return this.detachContact(`/internal/clients/${r}/delivery-addresses/${e}/contacts/${i.id}/detach`)}createContact(r,e,i,s={}){var l,g;const o={name:e.name,position:e.position,comment:e.comment,...i};return(l=e.phone)!=null&&l.length&&(o.phone=e.phone),(g=e.email)!=null&&g.length&&(o.email=e.email),this.post(`/internal/clients/${r}/contacts`,o,f=>new B(f.data),s)}setPrimaryContact(r,e){return this.patch(r,{is_primary:e})}detachContact(r){return this.patch(r)}sendClientEmailConfirmation(r){return this.get(`/internal/clients/${r.id}/verification/email?email=${r.email}`)}}class ct extends y{checkPhoneIsBusy(r){return new Promise((e,i)=>{this.request({method:"GET",url:"/public/user/verification/phone/check",params:{phone:r}}).then(s=>{e(!!s.isBusy)}).catch(i)})}}class lt extends y{getConfiguratorSettings(r){var e;return this.get(`internal/catalog/categories/${r.id}/configurators/${(e=r.properties)==null?void 0:e.editor}/settings`)}searchProduct(r,e,i={}){var o;const s=this.get(`internal/catalog/categories/${r.id}/configurators/${(o=r.properties)==null?void 0:o.editor}/product`,{params:e},l=>new S(l.data));return s.catch(l=>{this.errorResponseHandler(l,i)}),s}createTemplate(r,e,i={}){var s;return this.post(`internal/catalog/categories/${r.id}/configurators/${(s=r.properties)==null?void 0:s.editor}/template`,{...e},()=>{},i)}removeTemplate(r,e){var i;return this.delete(`internal/catalog/categories/${r.id}/configurators/${(i=r.properties)==null?void 0:i.editor}/template/${e}`)}}class ut{static defaultDateRanges(){const r=m.addBusinessDays(new Date,1);return{nextWorkingDay:{label:"Следующий рабочий день",from:m.startOfDay(r),to:m.endOfDay(r)},today:{label:"Сегодня",from:m.startOfToday(),to:m.endOfToday()},yesterday:{label:"Вчера",from:m.startOfYesterday(),to:m.endOfYesterday()},tomorrow:{label:"Завтра",from:m.startOfTomorrow(),to:m.endOfTomorrow()}}}}const se=class se{static setLinearValues(r){se.linearValues=r}static productIsMeasurable(r){return se.linearValues.includes(r.unit)}static getProductMultiplicity(r){var e,i;return!((e=r.properties)!=null&&e.ignoreMinCountCheck)&&((i=r.properties)!=null&&i.minCount)&&!se.productIsMeasurable(r)?r.properties.minCount:1}static getProductLengthMultiplicity(r){var e,i,s;return(e=r.properties)!=null&&e.lengthStep?r.properties.lengthStep:!((i=r.properties)!=null&&i.ignoreMinCountCheck)&&((s=r.properties)!=null&&s.minCount)?r.properties.minCount:.01}};t(se,"linearValues",["пог.м.","м.","м2"]);let Xe=se;class pt{static generateUndefinedManagerInstance(){return new ge({id:0,name:"- Не назначен -",isActive:!0,guid:"-undefined-"})}static isUndefinedManagerInstance(r){return r.id===0&&r.guid==="-undefined-"}}class Ze extends Ye{constructor(e){var i,s,o,l,g,f,v,T;super(e);t(this,"client");t(this,"payment");t(this,"delivery");t(this,"attachedUser");t(this,"status");t(this,"salesDirection");t(this,"pendingAt");t(this,"processedAt");t(this,"isOnOrder");t(this,"isNotInStock");this.client=new X(e==null?void 0:e.client),this.payment={type:((i=e==null?void 0:e.payment)==null?void 0:i.type)??-1,status:((s=e==null?void 0:e.payment)==null?void 0:s.status)??-1,onlinePaymentLink:(o=e==null?void 0:e.payment)==null?void 0:o.onlinePaymentLink},this.delivery={type:((l=e==null?void 0:e.delivery)==null?void 0:l.type)??-1,date:p.isString((g=e==null?void 0:e.delivery)==null?void 0:g.date)?m.parseISO(e.delivery.date):((f=e==null?void 0:e.delivery)==null?void 0:f.date)??new Date,address:(v=e==null?void 0:e.delivery)!=null&&v.address?new Ce(e.delivery.address):void 0,warehouse:(T=e==null?void 0:e.delivery)!=null&&T.warehouse?new ue(e.delivery.warehouse):void 0},this.attachedUser=new G(e==null?void 0:e.attachedUser),this.status=(e==null?void 0:e.status)??0,this.salesDirection=new b(e==null?void 0:e.salesDirection),this.pendingAt=p.isString(e==null?void 0:e.pendingAt)?m.parseISO(e.pendingAt):e==null?void 0:e.pendingAt,this.processedAt=p.isString(e==null?void 0:e.processedAt)?m.parseISO(e.processedAt):e==null?void 0:e.processedAt,this.isOnOrder=(e==null?void 0:e.isOnOrder)??!1,this.isNotInStock=(e==null?void 0:e.isNotInStock)??!1}}class kr extends q{constructor(e){super(e);t(this,"product");t(this,"quantity");t(this,"currency");t(this,"costOne");t(this,"costOneRub");t(this,"cost");t(this,"costRub");t(this,"marker");t(this,"height");t(this,"length");t(this,"width");t(this,"logicGroupId");t(this,"salesDirection");t(this,"specificationImgUrl");t(this,"configurator");t(this,"configuratorParams");t(this,"sawing");this.product=new z(e.product),this.quantity=e.quantity,this.currency=e.currency,this.costOne=e.costOne,this.costOneRub=e.costOneRub,this.cost=e.cost,this.costRub=e.costRub,this.marker=e.marker,this.height=e.height,this.length=e.length,this.width=e.width,this.logicGroupId=e.logicGroupId,this.salesDirection=e.salesDirection,this.specificationImgUrl=e.specificationImgUrl,this.configurator=e.configurator,this.configuratorParams=e.configuratorParams,this.sawing=e.sawing}}class dr extends Ze{constructor(e){super(e);t(this,"products");t(this,"invoices");t(this,"comment");t(this,"image");t(this,"contragent");t(this,"barcode");t(this,"orderSource");t(this,"isAllowProcessingWithoutPayment");this.products=(e.products??[]).map(i=>new kr(i)),this.invoices=e.invoices??[],this.comment=e.comment,this.image=e.image,this.contragent=e.contragent?ye.createInstance(e.contragent):void 0,this.barcode=e.barcode,this.orderSource=e.orderSource?new P(e.orderSource):void 0,this.isAllowProcessingWithoutPayment=e.isAllowProcessingWithoutPayment}}class gt extends fe{getOrders(r,e,i){return this.getPaginated("/internal/orders",r,e?[e]:void 0,i,{},s=>{const o={...s.data};return o.data=o.data.map(l=>new Ze(l)),o})}getClientOrderStatistics(r,e){return this.get(`/internal/clients/${r}/orders/statistics`,e?{period:e}:{})}getOrder(r){return this.get(`/internal/orders/${r}`,{},e=>new dr(e.data))}}class _e{constructor(r){t(this,"client");t(this,"product");t(this,"cost");t(this,"costCoefficient");t(this,"source");this.client=new X(r==null?void 0:r.client),this.product=new S(r==null?void 0:r.product),this.cost=(r==null?void 0:r.cost)??0,this.costCoefficient=(r==null?void 0:r.costCoefficient)??0,this.source=(r==null?void 0:r.source)??Re.Product}}const xe=n=>{var r,e,i,s,o;return n?p.omitBy({cities:(r=n.cities)==null?void 0:r.map(l=>l.id),clients:(e=n.clients)==null?void 0:e.map(l=>l.id),managers:(i=n.managers)==null?void 0:i.map(l=>l.id),partnerGroups:(s=n.partnerGroups)==null?void 0:s.map(l=>l.id),salesDirections:(o=n.salesDirections)==null?void 0:o.map(l=>l.id),hideNotActive:n.hideNotActive},l=>p.isNil(l)||(p.isArray(l)||p.isObject(l))&&p.isEmpty(l)):{}},Or=n=>{const r={};return n.from&&(n.from.coefficient||n.from.value)&&(r.from={},n.from.coefficient&&(r.from.priceCoefficientId=n.from.coefficient.id),n.from.value&&(r.from.increasePercent=n.from.value)),n.to&&(n.to.coefficient||n.to.value)&&(r.to={},n.to.coefficient&&(r.to.priceCoefficientId=n.to.coefficient.id),n.to.value&&(r.to.increasePercent=n.to.value)),r};class ht extends y{analyzeProductPrices(r,e,i){return this.get(`/internal/price/products/${r}/analyze`,{...Or(e),filters:xe(i)},s=>s.data.map(o=>new _e(o)))}analyzeCategoryPrices(r,e,i){return this.get(`/internal/price/categories/${r}/analyze`,{...Or(e),filters:xe(i)},s=>s.data.map(o=>new _e(o)))}analyzeCategoryPricesBySquare(r,e,i){return this.get(`/internal/price/categories/${r}/analyze/square`,{...e,filters:xe(i)},s=>s.data.map(o=>new _e(o)))}}class Nr{constructor(r){t(this,"name");t(this,"content");this.name=r.name,this.content=r.content}}class Ee{constructor(r){t(this,"resourceType");t(this,"resourceId");t(this,"h1");t(this,"title");t(this,"description");t(this,"keywords");t(this,"meta");var e;this.resourceType=new Be(r==null?void 0:r.resourceType),this.resourceId=(r==null?void 0:r.resourceId)??"",this.h1=r==null?void 0:r.h1,this.title=r==null?void 0:r.title,this.description=r==null?void 0:r.description,this.keywords=r==null?void 0:r.keywords,this.meta=((e=r==null?void 0:r.meta)==null?void 0:e.map(i=>new Nr(i)))??[]}}class mt extends y{getResourceSeoData(r,e){return this.get(`/internal/seo/${r.slug}/${e}`,{},i=>new Ee(i.data))}saveResourceSeoData(r,e={}){return this.post(`/internal/seo/${r.resourceType.slug}/${r.resourceId}`,r,i=>new Ee(i.data),e)}deleteResourceSeoData(r,e){return this.delete(`/internal/seo/${r.slug}/${e}`)}}class ft extends y{searchAddresses(r){return this.execSuggestionQuery("/public/suggestions/address",r)}searchBank(r){return this.execSuggestionQuery("/public/suggestions/bank",r)}searchOrganization(r){return this.execSuggestionQuery("/public/suggestions/organization",r)}execSuggestionQuery(r,e){return this.get(r,{query:e}).then(i=>{const s=[...i];let o=1;return s.forEach(l=>{l.id=o++}),s})}}class yt{constructor(r,e){t(this,"showFeedback",!1);t(this,"feedback","");t(this,"validationStatus");this.showFeedback=!!r,this.feedback=r,this.validationStatus=e}}c.AnyReference=pr,c.AppBaseConfig=Fr,c.AppConfigProvider=D,c.BankAccount=$e,c.BasePaginationProvider=fe,c.CalculationTypeEnum=nr,c.Cart=pe,c.CartItem=sr,c.CartItemBase=ir,c.CartProvider=Gr,c.CatalogProvider=Jr,c.CatalogableItem=ke,c.Category=U,c.CategoryPricingRule=ze,c.ChannelPrimaryInterest=Me,c.City=jr,c.CityWithRegionAndCountry=Ae,c.Client=Qe,c.ClientAdditionalData=_r,c.ClientCategory=he,c.ClientDataProvider=ot,c.ClientPriceProvider=Kr,c.ClientPriceTemplateProvider=Qr,c.ClientProduct=z,c.ClientProductCategoryDataProvider=Zr,c.ClientProductDataProvider=xr,c.ClientShortInfo=X,c.ClientsAdditionalDataRequestTypeEnum=Sr,c.ClientsListFilters=it,c.ConfiguratorProvider=lt,c.Contact=be,c.ContactLinks=ur,c.ContactPerson=B,c.ContactPersonRelated=Ir,c.ContactPosition=gr,c.ContactRelation=Ie,c.ContragentBase=Fe,c.ContragentFactory=ye,c.ContragentIc=Je,c.ContragentPerson=$r,c.ContragentUlNr=br,c.ContragentUlR=Ke,c.CostSourceEnum=Re,c.Country=W,c.Currency=me,c.DataSuggestionProvider=ft,c.DataTablePagination=st,c.DataTablePaginationRequestParams=Lr,c.DataTableSortRequestParams=nt,c.DateTimeProvider=ut,c.DeletableNamedIdentity=cr,c.DeliveryAddress=Ce,c.DeliveryType=H,c.DetailedJwtPayload=Ur,c.DeviceTypeResolutionConfig=Rr,c.DiscountShortInfo=lr,c.FieldValidationResultData=yt,c.FilterGroup=re,c.FilterItem=We,c.FilterOpEnum=Se,c.GeoCoordinates=Oe,c.HiddenCatalogableItem=rr,c.HttpCachedRequester=E,c.HttpParamsConfig=Dr,c.HttpRequester=y,c.Identity=q,c.Image=tr,c.JwtPayload=oe,c.Manager=ge,c.ManagerCommon=Q,c.ManagerDataFactory=pt,c.ManagerDataProvider=Cr,c.MetaTagItem=Nr,c.NamedIdentity=A,c.Opf=M,c.OpfEnum=$,c.Order=dr,c.OrderInfo=Ze,c.OrderPaymentStatus=hr,c.OrderProduct=kr,c.OrderShortInfo=Ye,c.OrderStatus=mr,c.OrdersDataProvider=gt,c.PartnerGroup=F,c.PaymentType=fr,c.PreferencesStorageProvider=Mr,c.PriceAnalyze=_e,c.PriceAnalyzeProvider=ht,c.PriceCoefficient=le,c.PriceCoefficientEnum=de,c.PriceTemplate=j,c.PriceTemplateCategory=De,c.PriceTemplateClient=Z,c.PriceTemplateICatalogableItem=qe,c.PriceTemplateProduct=Te,c.PriceTemplateProvider=Er,c.PricingRole=ee,c.PricingRoleProvider=et,c.PrimaryCatalogableItem=we,c.Product=S,c.ProductCategoryDataProvider=Yr,c.ProductDataProvider=Xr,c.ProductFileType=yr,c.ProductPriceCoefficient=ae,c.ProductPriceHistory=vr,c.PropertiesProvider=rt,c.Property=x,c.PropertyType=Ge,c.PropertyTypeEnum=or,c.PropertyValue=V,c.RecommendationsDataProvider=tt,c.RecommendationsList=je,c.Reference=P,c.ReferenceDataProvider=w,c.Region=Y,c.ResourceType=Be,c.SalesDirection=b,c.SentryConfig=Ar,c.Seo=Ee,c.SeoDataProvider=mt,c.SourcePrimaryInterest=He,c.StockCount=er,c.TemplatesListFilters=Hr,c.TypedInstanceFactory=ve,c.UnitsHelper=Xe,c.UnknownClientDataProvider=ct,c.UpdatableNamedIdentity=Ne,c.User=wr,c.UserCommonInfo=Ue,c.UserDataProvider=ar,c.UserShortInfo=G,c.UserTypeEnum=Pr,c.VersionConfig=Tr,c.Warehouse=ue,c.findCatalogItemByIdRecursive=Ve,c.useAuthStateStore=Pe,c.useReferencesStore=zr,c.useUserStateStore=Vr,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=sc-common-lib.umd.cjs.map