import{n as _}from"./chunk-2UYAVX6J.js";import{b as m}from"./chunk-WLNOQDND.js";import{l as g,p as b}from"./chunk-4SIJUOYU.js";import{c as z}from"./chunk-6GCD7JC6.js";import{a as c}from"./chunk-B7E4YH53.js";import{a as y}from"./chunk-NHAEOK7K.js";import{m as S}from"./chunk-A7R3CFJO.js";import{x as d}from"./chunk-OIJW4GMG.js";import{J as s,ca as l,ia as n}from"./chunk-3FIHWXA5.js";import{b as a,i as u}from"./chunk-QOJKCMZT.js";import{a as o,b as h}from"./chunk-K4ALXBGI.js";u();u();var p=class e{constructor(t){this._http=t,this._defaultFilter={criteria:null,take:100,skip:0,orderBy:"id",isAscending:!0}}bind(t,i){return this._http.post(`/api/fiscalization-settings/${t}/bind`,o({},i))}unbind(t){return this._http.post(`/api/fiscalization-settings/${t}/unbind`,{})}use(t,i){return this._http.post(`/api/fiscalization-settings/${t}/use`,o({},i))}updateToken(t,i){return this._http.post(`/api/fiscalization-settings/${t}/update-token`,{token:i})}getToken(t){return this._http.get(`/api/fiscalization-settings/${t}/get-token`)}getAll(t=this._defaultFilter){let i=h(o({},t),{criteria:{search:null,filter:{storeId:this._retailStoreId}}});return this._http.post("/api/fiscalization-settings/all",o({},i),{headers:y})}static{this.\u0275fac=function(i){return new(i||e)(n(d))}}static{this.\u0275prov=l({token:e,factory:e.\u0275fac})}};a([c(z.selectedStoreId)],p.prototype,"_retailStoreId",void 0);var f=class e{constructor(t,i,r){this._fiscalizationSettingsServiceApi=t,this._trinityServiceApi=i,this._store=r}bind(t,i){return this._fiscalizationSettingsServiceApi.bind(t,i).pipe(s(1))}unbind(t){return this._fiscalizationSettingsServiceApi.unbind(t).pipe(s(1))}use(t){return this._fiscalizationSettingsServiceApi.use(t.id,{useFiscalizationSettings:!t.isEnabled}).pipe(s(1))}getAll(t){return this._fiscalizationSettingsServiceApi.getAll(t).pipe(s(1))}updateToken(t,i){return this._fiscalizationSettingsServiceApi.updateToken(t,i).pipe(s(1))}getToken(t){return this._fiscalizationSettingsServiceApi.getToken(t).pipe(s(1))}canCashboxWKFiscalize(t){let i=this.cashboxes.find(r=>r.id===t);return i?i.isFiscalized&&i.fiscalizationSettings!=null&&i.fiscalizationSettings.integrationSystem===m.Webkassa&&this.companySettings.simplifiedTaxRegime===!1:!1}canCashboxTrinityFiscalize(t){let i=this.cashboxes.find(r=>r.id===t);return i?i.isFiscalized&&i.fiscalizationSettings!=null&&i.fiscalizationSettings.integrationSystem===m.Trinity&&this.companySettings.simplifiedTaxRegime===!0:!1}static{this.\u0275fac=function(i){return new(i||e)(n(p),n(_),n(S))}}static{this.\u0275prov=l({token:e,factory:e.\u0275fac})}};a([c(b.cashboxes)],f.prototype,"cashboxes",void 0);a([c(g.companySettings)],f.prototype,"companySettings",void 0);export{p as a,f as b};
