shared-ritm 1.2.39 → 1.2.40

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.
@@ -14369,7 +14369,11 @@ class tn {
14369
14369
  },
14370
14370
  (t) => Promise.reject(t)
14371
14371
  ), this.axiosInstance.interceptors.response.use(
14372
- (t) => t.data,
14372
+ (t) => {
14373
+ var o;
14374
+ const n = t.data;
14375
+ return ((o = n == null ? void 0 : n.data) == null ? void 0 : o.filter_value) !== void 0 ? t : n;
14376
+ },
14373
14377
  (t) => {
14374
14378
  var n, o;
14375
14379
  return (((n = t.response) == null ? void 0 : n.status) === 401 || ((o = t.response) == null ? void 0 : o.status) === 403) && this.logout(), Promise.reject(t);
@@ -14391,7 +14395,7 @@ class tn {
14391
14395
  async get(t, n) {
14392
14396
  try {
14393
14397
  const o = await this.axiosInstance.get(t, n);
14394
- return (o == null ? void 0 : o.data) ?? o;
14398
+ return (o == null ? void 0 : o.data) === !1 ? !1 : (o == null ? void 0 : o.data) ?? o;
14395
14399
  } catch (o) {
14396
14400
  const r = o;
14397
14401
  throw this.handleError(r), o;
@@ -14408,7 +14412,7 @@ class tn {
14408
14412
  async post(t, n, o) {
14409
14413
  try {
14410
14414
  const r = await this.axiosInstance.post(t, n, o);
14411
- return (r == null ? void 0 : r.data) || r;
14415
+ return (r == null ? void 0 : r.data) === !1 ? !1 : (r == null ? void 0 : r.data) || r;
14412
14416
  } catch (r) {
14413
14417
  const l = r;
14414
14418
  throw this.handleError(l), r;
@@ -4,4 +4,4 @@
4
4
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(g){return g instanceof this?g:new this(g)}static concat(g,...Q){const C=new this(g);return Q.forEach(w=>C.set(w)),C}static accessor(g){const C=(this[JI]=this[JI]={accessors:{}}).accessors,w=this.prototype;function E(I){const D=Tg(I);C[D]||(Ni(w,I),C[D]=!0)}return N.isArray(g)?g.forEach(E):E(g),this}};gB.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),N.reduceDescriptors(gB.prototype,({value:A},g)=>{let Q=g[0].toUpperCase()+g.slice(1);return{get:()=>A,set(C){this[Q]=C}}}),N.freezeMethods(gB);function VC(A,g){const Q=this||Rg,C=g||Q,w=gB.from(C.headers);let E=C.data;return N.forEach(A,function(D){E=D.call(Q,E,w.normalize(),g?g.status:void 0)}),w.normalize(),E}function NI(A){return!!(A&&A.__CANCEL__)}function eg(A,g,Q){cA.call(this,A??"canceled",cA.ERR_CANCELED,g,Q),this.name="CanceledError"}N.inherits(eg,cA,{__CANCEL__:!0});function zI(A,g,Q){const C=Q.config.validateStatus;!Q.status||!C||C(Q.status)?A(Q):g(new cA("Request failed with status code "+Q.status,[cA.ERR_BAD_REQUEST,cA.ERR_BAD_RESPONSE][Math.floor(Q.status/100)-4],Q.config,Q.request,Q))}function zi(A){const g=/^([-+\w]{1,25})(:?\/\/|:)/.exec(A);return g&&g[1]||""}function vi(A,g){A=A||10;const Q=new Array(A),C=new Array(A);let w=0,E=0,I;return g=g!==void 0?g:1e3,function(M){const o=Date.now(),e=C[E];I||(I=o),Q[w]=M,C[w]=o;let Y=E,c=0;for(;Y!==w;)c+=Q[Y++],Y=Y%A;if(w=(w+1)%A,w===E&&(E=(E+1)%A),o-I<g)return;const t=e&&o-e;return t?Math.round(c*1e3/t):void 0}}function ki(A,g){let Q=0,C=1e3/g,w,E;const I=(o,e=Date.now())=>{Q=e,w=null,E&&(clearTimeout(E),E=null),A.apply(null,o)};return[(...o)=>{const e=Date.now(),Y=e-Q;Y>=C?I(o,e):(w=o,E||(E=setTimeout(()=>{E=null,I(w)},C-Y)))},()=>w&&I(w)]}const PQ=(A,g,Q=3)=>{let C=0;const w=vi(50,250);return ki(E=>{const I=E.loaded,D=E.lengthComputable?E.total:void 0,M=I-C,o=w(M),e=I<=D;C=I;const Y={loaded:I,total:D,progress:D?I/D:void 0,bytes:M,rate:o||void 0,estimated:o&&D&&e?(D-I)/o:void 0,event:E,lengthComputable:D!=null,[g?"download":"upload"]:!0};A(Y)},Q)},vI=(A,g)=>{const Q=A!=null;return[C=>g[0]({lengthComputable:Q,total:A,loaded:C}),g[1]]},kI=A=>(...g)=>N.asap(()=>A(...g)),mi=bA.hasStandardBrowserEnv?((A,g)=>Q=>(Q=new URL(Q,bA.origin),A.protocol===Q.protocol&&A.host===Q.host&&(g||A.port===Q.port)))(new URL(bA.origin),bA.navigator&&/(msie|trident)/i.test(bA.navigator.userAgent)):()=>!0,Li=bA.hasStandardBrowserEnv?{write(A,g,Q,C,w,E){const I=[A+"="+encodeURIComponent(g)];N.isNumber(Q)&&I.push("expires="+new Date(Q).toGMTString()),N.isString(C)&&I.push("path="+C),N.isString(w)&&I.push("domain="+w),E===!0&&I.push("secure"),document.cookie=I.join("; ")},read(A){const g=document.cookie.match(new RegExp("(^|;\\s*)("+A+")=([^;]*)"));return g?decodeURIComponent(g[3]):null},remove(A){this.write(A,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ri(A){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(A)}function Ti(A,g){return g?A.replace(/\/?\/$/,"")+"/"+g.replace(/^\/+/,""):A}function mI(A,g,Q){let C=!Ri(g);return A&&(C||Q==!1)?Ti(A,g):g}const LI=A=>A instanceof gB?{...A}:A;function KB(A,g){g=g||{};const Q={};function C(o,e,Y,c){return N.isPlainObject(o)&&N.isPlainObject(e)?N.merge.call({caseless:c},o,e):N.isPlainObject(e)?N.merge({},e):N.isArray(e)?e.slice():e}function w(o,e,Y,c){if(N.isUndefined(e)){if(!N.isUndefined(o))return C(void 0,o,Y,c)}else return C(o,e,Y,c)}function E(o,e){if(!N.isUndefined(e))return C(void 0,e)}function I(o,e){if(N.isUndefined(e)){if(!N.isUndefined(o))return C(void 0,o)}else return C(void 0,e)}function D(o,e,Y){if(Y in g)return C(o,e);if(Y in A)return C(void 0,o)}const M={url:E,method:E,data:E,baseURL:I,transformRequest:I,transformResponse:I,paramsSerializer:I,timeout:I,timeoutMessage:I,withCredentials:I,withXSRFToken:I,adapter:I,responseType:I,xsrfCookieName:I,xsrfHeaderName:I,onUploadProgress:I,onDownloadProgress:I,decompress:I,maxContentLength:I,maxBodyLength:I,beforeRedirect:I,transport:I,httpAgent:I,httpsAgent:I,cancelToken:I,socketPath:I,responseEncoding:I,validateStatus:D,headers:(o,e,Y)=>w(LI(o),LI(e),Y,!0)};return N.forEach(Object.keys(Object.assign({},A,g)),function(e){const Y=M[e]||w,c=Y(A[e],g[e],e);N.isUndefined(c)&&Y!==D||(Q[e]=c)}),Q}const RI=A=>{const g=KB({},A);let{data:Q,withXSRFToken:C,xsrfHeaderName:w,xsrfCookieName:E,headers:I,auth:D}=g;g.headers=I=gB.from(I),g.url=HI(mI(g.baseURL,g.url,g.allowAbsoluteUrls),A.params,A.paramsSerializer),D&&I.set("Authorization","Basic "+btoa((D.username||"")+":"+(D.password?unescape(encodeURIComponent(D.password)):"")));let M;if(N.isFormData(Q)){if(bA.hasStandardBrowserEnv||bA.hasStandardBrowserWebWorkerEnv)I.setContentType(void 0);else if((M=I.getContentType())!==!1){const[o,...e]=M?M.split(";").map(Y=>Y.trim()).filter(Boolean):[];I.setContentType([o||"multipart/form-data",...e].join("; "))}}if(bA.hasStandardBrowserEnv&&(C&&N.isFunction(C)&&(C=C(g)),C||C!==!1&&mi(g.url))){const o=w&&E&&Li.read(E);o&&I.set(w,o)}return g},ji=typeof XMLHttpRequest<"u"&&function(A){return new Promise(function(Q,C){const w=RI(A);let E=w.data;const I=gB.from(w.headers).normalize();let{responseType:D,onUploadProgress:M,onDownloadProgress:o}=w,e,Y,c,t,n;function F(){t&&t(),n&&n(),w.cancelToken&&w.cancelToken.unsubscribe(e),w.signal&&w.signal.removeEventListener("abort",e)}let i=new XMLHttpRequest;i.open(w.method.toUpperCase(),w.url,!0),i.timeout=w.timeout;function r(){if(!i)return;const h=gB.from("getAllResponseHeaders"in i&&i.getAllResponseHeaders()),P={data:!D||D==="text"||D==="json"?i.responseText:i.response,status:i.status,statusText:i.statusText,headers:h,config:A,request:i};zI(function(R){Q(R),F()},function(R){C(R),F()},P),i=null}"onloadend"in i?i.onloadend=r:i.onreadystatechange=function(){!i||i.readyState!==4||i.status===0&&!(i.responseURL&&i.responseURL.indexOf("file:")===0)||setTimeout(r)},i.onabort=function(){i&&(C(new cA("Request aborted",cA.ECONNABORTED,A,i)),i=null)},i.onerror=function(){C(new cA("Network Error",cA.ERR_NETWORK,A,i)),i=null},i.ontimeout=function(){let a=w.timeout?"timeout of "+w.timeout+"ms exceeded":"timeout exceeded";const P=w.transitional||fI;w.timeoutErrorMessage&&(a=w.timeoutErrorMessage),C(new cA(a,P.clarifyTimeoutError?cA.ETIMEDOUT:cA.ECONNABORTED,A,i)),i=null},E===void 0&&I.setContentType(null),"setRequestHeader"in i&&N.forEach(I.toJSON(),function(a,P){i.setRequestHeader(P,a)}),N.isUndefined(w.withCredentials)||(i.withCredentials=!!w.withCredentials),D&&D!=="json"&&(i.responseType=w.responseType),o&&([c,n]=PQ(o,!0),i.addEventListener("progress",c)),M&&i.upload&&([Y,t]=PQ(M),i.upload.addEventListener("progress",Y),i.upload.addEventListener("loadend",t)),(w.cancelToken||w.signal)&&(e=h=>{i&&(C(!h||h.type?new eg(null,A,i):h),i.abort(),i=null)},w.cancelToken&&w.cancelToken.subscribe(e),w.signal&&(w.signal.aborted?e():w.signal.addEventListener("abort",e)));const G=zi(w.url);if(G&&bA.protocols.indexOf(G)===-1){C(new cA("Unsupported protocol "+G+":",cA.ERR_BAD_REQUEST,A));return}i.send(E||null)})},yi=(A,g)=>{const{length:Q}=A=A?A.filter(Boolean):[];if(g||Q){let C=new AbortController,w;const E=function(o){if(!w){w=!0,D();const e=o instanceof Error?o:this.reason;C.abort(e instanceof cA?e:new eg(e instanceof Error?e.message:e))}};let I=g&&setTimeout(()=>{I=null,E(new cA(`timeout ${g} of ms exceeded`,cA.ETIMEDOUT))},g);const D=()=>{A&&(I&&clearTimeout(I),I=null,A.forEach(o=>{o.unsubscribe?o.unsubscribe(E):o.removeEventListener("abort",E)}),A=null)};A.forEach(o=>o.addEventListener("abort",E));const{signal:M}=C;return M.unsubscribe=()=>N.asap(D),M}},Wi=function*(A,g){let Q=A.byteLength;if(Q<g){yield A;return}let C=0,w;for(;C<Q;)w=C+g,yield A.slice(C,w),C=w},Si=async function*(A,g){for await(const Q of Ki(A))yield*Wi(Q,g)},Ki=async function*(A){if(A[Symbol.asyncIterator]){yield*A;return}const g=A.getReader();try{for(;;){const{done:Q,value:C}=await g.read();if(Q)break;yield C}}finally{await g.cancel()}},TI=(A,g,Q,C)=>{const w=Si(A,g);let E=0,I,D=M=>{I||(I=!0,C&&C(M))};return new ReadableStream({async pull(M){try{const{done:o,value:e}=await w.next();if(o){D(),M.close();return}let Y=e.byteLength;if(Q){let c=E+=Y;Q(c)}M.enqueue(new Uint8Array(e))}catch(o){throw D(o),o}},cancel(M){return D(M),w.return()}},{highWaterMark:2})},HQ=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",jI=HQ&&typeof ReadableStream=="function",xi=HQ&&(typeof TextEncoder=="function"?(A=>g=>A.encode(g))(new TextEncoder):async A=>new Uint8Array(await new Response(A).arrayBuffer())),yI=(A,...g)=>{try{return!!A(...g)}catch{return!1}},Vi=jI&&yI(()=>{let A=!1;const g=new Request(bA.origin,{body:new ReadableStream,method:"POST",get duplex(){return A=!0,"half"}}).headers.has("Content-Type");return A&&!g}),WI=64*1024,bC=jI&&yI(()=>N.isReadableStream(new Response("").body)),uQ={stream:bC&&(A=>A.body)};HQ&&(A=>{["text","arrayBuffer","blob","formData","stream"].forEach(g=>{!uQ[g]&&(uQ[g]=N.isFunction(A[g])?Q=>Q[g]():(Q,C)=>{throw new cA(`Response type '${g}' is not supported`,cA.ERR_NOT_SUPPORT,C)})})})(new Response);const bi=async A=>{if(A==null)return 0;if(N.isBlob(A))return A.size;if(N.isSpecCompliantForm(A))return(await new Request(bA.origin,{method:"POST",body:A}).arrayBuffer()).byteLength;if(N.isArrayBufferView(A)||N.isArrayBuffer(A))return A.byteLength;if(N.isURLSearchParams(A)&&(A=A+""),N.isString(A))return(await xi(A)).byteLength},Oi=async(A,g)=>{const Q=N.toFiniteNumber(A.getContentLength());return Q??bi(g)},OC={http:ci,xhr:ji,fetch:HQ&&(async A=>{let{url:g,method:Q,data:C,signal:w,cancelToken:E,timeout:I,onDownloadProgress:D,onUploadProgress:M,responseType:o,headers:e,withCredentials:Y="same-origin",fetchOptions:c}=RI(A);o=o?(o+"").toLowerCase():"text";let t=yi([w,E&&E.toAbortSignal()],I),n;const F=t&&t.unsubscribe&&(()=>{t.unsubscribe()});let i;try{if(M&&Vi&&Q!=="get"&&Q!=="head"&&(i=await Oi(e,C))!==0){let P=new Request(g,{method:"POST",body:C,duplex:"half"}),L;if(N.isFormData(C)&&(L=P.headers.get("content-type"))&&e.setContentType(L),P.body){const[R,x]=vI(i,PQ(kI(M)));C=TI(P.body,WI,R,x)}}N.isString(Y)||(Y=Y?"include":"omit");const r="credentials"in Request.prototype;n=new Request(g,{...c,signal:t,method:Q.toUpperCase(),headers:e.normalize().toJSON(),body:C,duplex:"half",credentials:r?Y:void 0});let G=await fetch(n);const h=bC&&(o==="stream"||o==="response");if(bC&&(D||h&&F)){const P={};["status","statusText","headers"].forEach(z=>{P[z]=G[z]});const L=N.toFiniteNumber(G.headers.get("content-length")),[R,x]=D&&vI(L,PQ(kI(D),!0))||[];G=new Response(TI(G.body,WI,R,()=>{x&&x(),F&&F()}),P)}o=o||"text";let a=await uQ[N.findKey(uQ,o)||"text"](G,A);return!h&&F&&F(),await new Promise((P,L)=>{zI(P,L,{data:a,headers:gB.from(G.headers),status:G.status,statusText:G.statusText,config:A,request:n})})}catch(r){throw F&&F(),r&&r.name==="TypeError"&&/Load failed|fetch/i.test(r.message)?Object.assign(new cA("Network Error",cA.ERR_NETWORK,A,n),{cause:r.cause||r}):cA.from(r,r&&r.code,A,n)}})};N.forEach(OC,(A,g)=>{if(A){try{Object.defineProperty(A,"name",{value:g})}catch{}Object.defineProperty(A,"adapterName",{value:g})}});const SI=A=>`- ${A}`,pi=A=>N.isFunction(A)||A===null||A===!1,KI={getAdapter:A=>{A=N.isArray(A)?A:[A];const{length:g}=A;let Q,C;const w={};for(let E=0;E<g;E++){Q=A[E];let I;if(C=Q,!pi(Q)&&(C=OC[(I=String(Q)).toLowerCase()],C===void 0))throw new cA(`Unknown adapter '${I}'`);if(C)break;w[I||"#"+E]=C}if(!C){const E=Object.entries(w).map(([D,M])=>`adapter ${D} `+(M===!1?"is not supported by the environment":"is not available in the build"));let I=g?E.length>1?`since :
5
5
  `+E.map(SI).join(`
6
6
  `):" "+SI(E[0]):"as no adapter specified";throw new cA("There is no suitable adapter to dispatch the request "+I,"ERR_NOT_SUPPORT")}return C},adapters:OC};function pC(A){if(A.cancelToken&&A.cancelToken.throwIfRequested(),A.signal&&A.signal.aborted)throw new eg(null,A)}function xI(A){return pC(A),A.headers=gB.from(A.headers),A.data=VC.call(A,A.transformRequest),["post","put","patch"].indexOf(A.method)!==-1&&A.headers.setContentType("application/x-www-form-urlencoded",!1),KI.getAdapter(A.adapter||Rg.adapter)(A).then(function(C){return pC(A),C.data=VC.call(A,A.transformResponse,C),C.headers=gB.from(C.headers),C},function(C){return NI(C)||(pC(A),C&&C.response&&(C.response.data=VC.call(A,A.transformResponse,C.response),C.response.headers=gB.from(C.response.headers))),Promise.reject(C)})}const VI="1.9.0",fQ={};["object","boolean","number","function","string","symbol"].forEach((A,g)=>{fQ[A]=function(C){return typeof C===A||"a"+(g<1?"n ":" ")+A}});const bI={};fQ.transitional=function(g,Q,C){function w(E,I){return"[Axios v"+VI+"] Transitional option '"+E+"'"+I+(C?". "+C:"")}return(E,I,D)=>{if(g===!1)throw new cA(w(I," has been removed"+(Q?" in "+Q:"")),cA.ERR_DEPRECATED);return Q&&!bI[I]&&(bI[I]=!0,console.warn(w(I," has been deprecated since v"+Q+" and will be removed in the near future"))),g?g(E,I,D):!0}},fQ.spelling=function(g){return(Q,C)=>(console.warn(`${C} is likely a misspelling of ${g}`),!0)};function Xi(A,g,Q){if(typeof A!="object")throw new cA("options must be an object",cA.ERR_BAD_OPTION_VALUE);const C=Object.keys(A);let w=C.length;for(;w-- >0;){const E=C[w],I=g[E];if(I){const D=A[E],M=D===void 0||I(D,E,A);if(M!==!0)throw new cA("option "+E+" must be "+M,cA.ERR_BAD_OPTION_VALUE);continue}if(Q!==!0)throw new cA("Unknown option "+E,cA.ERR_BAD_OPTION)}}const dQ={assertOptions:Xi,validators:fQ},nB=dQ.validators;let xB=class{constructor(g){this.defaults=g||{},this.interceptors={request:new uI,response:new uI}}async request(g,Q){try{return await this._request(g,Q)}catch(C){if(C instanceof Error){let w={};Error.captureStackTrace?Error.captureStackTrace(w):w=new Error;const E=w.stack?w.stack.replace(/^.+\n/,""):"";try{C.stack?E&&!String(C.stack).endsWith(E.replace(/^.+\n.+\n/,""))&&(C.stack+=`
7
- `+E):C.stack=E}catch{}}throw C}}_request(g,Q){typeof g=="string"?(Q=Q||{},Q.url=g):Q=g||{},Q=KB(this.defaults,Q);const{transitional:C,paramsSerializer:w,headers:E}=Q;C!==void 0&&dQ.assertOptions(C,{silentJSONParsing:nB.transitional(nB.boolean),forcedJSONParsing:nB.transitional(nB.boolean),clarifyTimeoutError:nB.transitional(nB.boolean)},!1),w!=null&&(N.isFunction(w)?Q.paramsSerializer={serialize:w}:dQ.assertOptions(w,{encode:nB.function,serialize:nB.function},!0)),Q.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?Q.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:Q.allowAbsoluteUrls=!0),dQ.assertOptions(Q,{baseUrl:nB.spelling("baseURL"),withXsrfToken:nB.spelling("withXSRFToken")},!0),Q.method=(Q.method||this.defaults.method||"get").toLowerCase();let I=E&&N.merge(E.common,E[Q.method]);E&&N.forEach(["delete","get","head","post","put","patch","common"],n=>{delete E[n]}),Q.headers=gB.concat(I,E);const D=[];let M=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(Q)===!1||(M=M&&F.synchronous,D.unshift(F.fulfilled,F.rejected))});const o=[];this.interceptors.response.forEach(function(F){o.push(F.fulfilled,F.rejected)});let e,Y=0,c;if(!M){const n=[xI.bind(this),void 0];for(n.unshift.apply(n,D),n.push.apply(n,o),c=n.length,e=Promise.resolve(Q);Y<c;)e=e.then(n[Y++],n[Y++]);return e}c=D.length;let t=Q;for(Y=0;Y<c;){const n=D[Y++],F=D[Y++];try{t=n(t)}catch(i){F.call(this,i);break}}try{e=xI.call(this,t)}catch(n){return Promise.reject(n)}for(Y=0,c=o.length;Y<c;)e=e.then(o[Y++],o[Y++]);return e}getUri(g){g=KB(this.defaults,g);const Q=mI(g.baseURL,g.url,g.allowAbsoluteUrls);return HI(Q,g.params,g.paramsSerializer)}};N.forEach(["delete","get","head","options"],function(g){xB.prototype[g]=function(Q,C){return this.request(KB(C||{},{method:g,url:Q,data:(C||{}).data}))}}),N.forEach(["post","put","patch"],function(g){function Q(C){return function(E,I,D){return this.request(KB(D||{},{method:g,headers:C?{"Content-Type":"multipart/form-data"}:{},url:E,data:I}))}}xB.prototype[g]=Q(),xB.prototype[g+"Form"]=Q(!0)});let Zi=class $I{constructor(g){if(typeof g!="function")throw new TypeError("executor must be a function.");let Q;this.promise=new Promise(function(E){Q=E});const C=this;this.promise.then(w=>{if(!C._listeners)return;let E=C._listeners.length;for(;E-- >0;)C._listeners[E](w);C._listeners=null}),this.promise.then=w=>{let E;const I=new Promise(D=>{C.subscribe(D),E=D}).then(w);return I.cancel=function(){C.unsubscribe(E)},I},g(function(E,I,D){C.reason||(C.reason=new eg(E,I,D),Q(C.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(g){if(this.reason){g(this.reason);return}this._listeners?this._listeners.push(g):this._listeners=[g]}unsubscribe(g){if(!this._listeners)return;const Q=this._listeners.indexOf(g);Q!==-1&&this._listeners.splice(Q,1)}toAbortSignal(){const g=new AbortController,Q=C=>{g.abort(C)};return this.subscribe(Q),g.signal.unsubscribe=()=>this.unsubscribe(Q),g.signal}static source(){let g;return{token:new $I(function(w){g=w}),cancel:g}}};function qi(A){return function(Q){return A.apply(null,Q)}}function _i(A){return N.isObject(A)&&A.isAxiosError===!0}const XC={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(XC).forEach(([A,g])=>{XC[g]=A});function OI(A){const g=new xB(A),Q=oI(xB.prototype.request,g);return N.extend(Q,xB.prototype,g,{allOwnKeys:!0}),N.extend(Q,g,null,{allOwnKeys:!0}),Q.create=function(w){return OI(KB(A,w))},Q}const mA=OI(Rg);mA.Axios=xB,mA.CanceledError=eg,mA.CancelToken=Zi,mA.isCancel=NI,mA.VERSION=VI,mA.toFormData=GQ,mA.AxiosError=cA,mA.Cancel=mA.CanceledError,mA.all=function(g){return Promise.all(g)},mA.spread=qi,mA.isAxiosError=_i,mA.mergeConfig=KB,mA.AxiosHeaders=gB,mA.formToJSON=A=>dI(N.isHTMLForm(A)?new FormData(A):A),mA.getAdapter=KI.getAdapter,mA.HttpStatusCode=XC,mA.default=mA;const{Axios:jF,AxiosError:yF,CanceledError:WF,isCancel:SF,CancelToken:KF,VERSION:xF,all:VF,Cancel:bF,isAxiosError:OF,spread:pF,toFormData:XF,AxiosHeaders:ZF,HttpStatusCode:qF,formToJSON:_F,getAdapter:$F,mergeConfig:As}=mA;class GB{constructor(){_I(this,"axiosInstance");this.axiosInstance=mA.create({baseURL:process.env.VUE_APP_BACKEND,headers:{"Content-Type":"application/json",Accept:"application/json"}}),this.axiosInstance.interceptors.request.use(g=>{const Q=this.getToken();return Q&&g.headers&&(g.headers.Authorization=`Bearer ${Q}`),g},g=>Promise.reject(g)),this.axiosInstance.interceptors.response.use(g=>g.data,g=>{var Q,C;return(((Q=g.response)==null?void 0:Q.status)===401||((C=g.response)==null?void 0:C.status)===403)&&this.logout(),Promise.reject(g)})}getToken(){return localStorage.getItem("token")}removeToken(){localStorage.removeItem("token")}logout(){this.removeToken(),window.location.href="/sign-in"}handleError(g){g.response?console.error("API Error:",g.response.status,g.response.data):g.request?console.error("No response received:",g.request):console.error("Error during request setup:",g.message)}async get(g,Q){try{const C=await this.axiosInstance.get(g,Q);return(C==null?void 0:C.data)??C}catch(C){const w=C;throw this.handleError(w),C}}async delete(g,Q){try{return await this.axiosInstance.delete(g,Q)}catch(C){const w=C;throw this.handleError(w),C}}async post(g,Q,C){try{const w=await this.axiosInstance.post(g,Q,C);return(w==null?void 0:w.data)||w}catch(w){const E=w;throw this.handleError(E),w}}async put(g,Q,C){try{return(await this.axiosInstance.put(g,Q,C)).data}catch(w){const E=w;throw this.handleError(E),w}}}class $i extends GB{async fetchCriticalPathTasks(g){return await this.get(`gantt/get_list_task_on_critical_path?${g}`)}async fetchGanttList(g){return await this.get(`/list/tasks/search?${g}&gantt=1`)}}let ZC;function An(){return ZC||(ZC=new $i),ZC}class Bn extends GB{async fetchPieProjects(g){return await this.get("repairs/pie/projects?"+g)}async fetchPieTasks(g){return await this.get("repairs/pie/tasks?"+g)}async fetchPiePersonnel(g){return await this.get("repairs/metrics/get_list_position?"+g)}async fetchPersonnelData(g){return await this.get("repairs/metrics/list_position_intersection_group_by_status?"+g)}async fetchPersonnelInfo(g){return await this.get(`repairs/metrics/list_position_intersection_details?${g}`)}async fetchPiePersonnelInfo(g){return await this.get(`repairs/metrics/get_list_user_by_position?${g}`)}async fetchPieCriticalPath(g){return await this.get("repairs/metrics/get_critical_path_group_by_status?"+g)}async fetchPieCriticalPathInfo(g){return await this.get(`repairs/metrics/get_list_task_critical_path_by_status?${g}`)}async fetchPieTmc(g){return await this.get("repairs/metrics/get_list_instrument_type?"+g)}async fetchPieTmcInfo(g){return await this.get(`repairs/metrics/get_list_warehouse_by_instrument_type?${g}`)}async fetchPieUntimelyClosedTask(g){return await this.get("repairs/metrics/get_list_comment_type?"+g)}async fetchPieUntimelyClosedTaskInfo(g){return await this.get(`repairs/metrics/get_list_task_by_comment_type?${g}`)}async fetchPieAdditionalTasks(g){return await this.get("repairs/metrics/get_list_task_after_plan_fixate_group_by_status?"+g)}async fetchPieAdditionalTasksInfo(g){return await this.get(`repairs/metrics/get_list_task_after_plan_fixate_by_status?${g}`)}async fetchPersonnel(g){return await this.get("repairs/statistic/personnel?"+g)}async fetchPieExpired(g){return await this.get("repairs/metrics/get_list_task_expired_group_by_status?"+g)}async fetchPieExpiredInfo(g){return await this.get(`repairs/metrics/get_list_task_expired?${g}`)}async fetchEconomicsPerformance(g){return await this.get(`repairs/metrics/get_economic_performance?${g}`)}async fetchEconomicsInfo(g){return await this.get(`repairs/metrics/get_list_task_economic_performance?${g}`)}async fetchQualityMetrics(g){return await this.get(`repairs/metrics/get_quality_metrics?${g}`)}async fetchQualityInfo(g){return await this.get(`repairs/metrics/get_list_task_by_quality?${g}`)}async fetchPieWorkZone(g){return await this.get("repairs/metrics/get_list_work_zone_instrument?"+g)}async fetchWorkZoneInfo(g){return await this.get("repairs/metrics/get_list_work_zone_instrument_by_status?"+g)}async fetchPieAllTasks(g){return await this.get("repairs/metrics/get_list_task_group_by_status?"+g)}async fetchPieAllTasksInfo(g){return await this.get("repairs/metrics/get_list_task_by_status?"+g)}}let qC;function gn(){return qC||(qC=new Bn),qC}class Qn extends GB{async fetchProjectById(g){return this.get(`/projects/${g}`)}createProject(g){return this.post("/projects",g)}editProject(g,Q){return this.put(`/projects/${g}`,Q)}fetchProjects(g){return this.get("/search/projects",{params:g})}cloneProject(g){return this.post(`projects/${g.id}/clone`,g)}archiveProject(g,Q){return this.put(`/projects/${g}`,Q)}unArchiveProject(g,Q){return this.put(`/projects/${g}`,Q)}moveAprProject(g){return this.post("repairs/move_plan_to_real",{repairs:[g]})}restoreProject(g){return this.post("/restore_project",{projects_ids:[g]})}importTasks(g){return this.post("tasks/import",g)}importKtd(g){return this.post("/parse_ktd",g,{headers:{"Content-Type":"multipart/form-data"}})}fetchProjectTeamList(g){return this.put(`/projects/${g}`,null)}deleteProject(g){return this.delete(`/projects/${g}`)}}let _C;function Cn(){return _C||(_C=new Qn),_C}class wn extends GB{fetchFilters(g){return this.get(`get_list_repair?smart=1&${g}`)}fetchRepairs(g,Q,C,w,E){return this.get("get_list_repair"+(g?`${Q}&per_page=100000${E?"&"+E:""}&${C?"":w}`:`?per_page=100000${E?"&"+E:""}&${w}`))}fetchEquipment(){return this.get("repairs/equipment/list?per_page=100000")}createRepair(g){return this.post("/repairs/equipments",g)}startRepair(g){return this.post(`/repairs/${g}/start`,null)}finishRepair(g){return this.post("/repairs/complete_repair_list",{repairIdList:[g]})}finishPreparationProject(g){return this.post(`/repairs/${g}/finish_preparation`,null)}moveRepairToCurrent(g){return this.post("/repairs/transfer_repair_plan_to_current",{repairs:[g]})}moveArchiveToCurrent(g){return this.post("/repairs/transfer_repair_archive_to_current",{repairs_ids:[g]})}moveRepairToApr(g){return this.post("/repairs/transfer_repair_current_to_plan",{repairs:[g]})}moveRepairToArchive(g){return this.post("/repairs/transfer_repair_current_to_archive",{repairs_ids:[g]})}restoreRepair(g){return this.post("/restore_repair",{repairs_ids:[g]})}updateRepair(g,Q){return this.put(`/repairs/${Q}`,g)}copyRepair(g){return this.post(`/repairs/${g}/clone`,null)}deleteRepair(g){return this.delete(`/repairs/${g}`)}}let $C;function En(){return $C||($C=new wn),$C}class In extends GB{async fetchTaskById(g){return await this.get(`/tasks/${g}`)}async fetchTasksList(g){return await this.get("/list/tasks/search",{params:g})}async fetchSubtasksList(g){return await this.get(`/task/${g}/subtasks/list`)}async fetchTaskBranch(g){return await this.get(`/get_list_task_branch?task_id=${g}`)}async fetchInstrumentsList(g){return await this.get("admin/instruments",{params:g})}async fetchInstrumentTypeListWithPreparedWarehouse(g){return await this.get("/instrument_type/get_instrument_type_list_with_prepared_warehouse",{params:g})}async fetchInstrumentsEquivalentList(g){return await this.get("tasks/instrument/list",{params:g})}async fetchDiffInstruments(g){return await this.get(`tasks/${g.taskId}/fill/module`,{params:g})}async replaceInstruments(g){return await this.post("/instruments/equivalent/attach",g)}async fetchTaskUsagePersonal(g){return await this.get(`tasks/${g.taskId}/usage/users`,{params:g})}async fetchTaskUsageInstrument(g){return await this.get(`tasks/${g.taskId}/usage/instruments`,{params:g})}fetchEquipment(g){return this.get("repairs/equipment/list",{params:g})}fetchTaskVideoSources(g){return this.get("work_zone/get_list_video_source",{params:g})}fetchTaskVideoSourcesStream(g){return this.get("horizon/video-source",{params:g})}createWorkZone(g){return this.post("admin/work-zones",g)}async createTask(g){return await this.post("tasks",g)}async editTask(g){return await this.put(`tasks/${g.taskId}`,g.data)}async mergeTask(g){return await this.post("tasks/merge",g)}async deleteTask(g){return await this.delete(`tasks/${g}`)}async changeStatus(g){const{taskId:Q,data:C}=g;return await this.put(`task/${Q}/change-status`,C)}async uploadComment(g){return await this.post("comments",g)}async deleteComment(g){return await this.delete(`comments/${g}`)}async editComment(g){const{commentId:Q,data:C}=g;return await this.put(`comments/${Q}`,C)}async saveMetrics(g){return await this.put("/update_quality_metrics",g)}async checkReasonForStatus(g){return await this.post("/tasks/check_reason_for_task",g)}async verifyTaskStatus(g){const{task_id:Q,data:C}=g;return await this.get(`/task/${Q}/change-status/verification`,{params:C})}async checkBranchBeforeCloseTask(g){return await this.post("/check_branch_before_close_task",g)}}let Aw;function Dn(){return Aw||(Aw=new In),Aw}class en extends GB{login(g,Q){return this.post("/login",{email:g,password:Q})}loginPhoto(g){return this.post("/login/from_photo",{photo:g})}logout(){return this.post("/logout",null)}userInfo(){return this.get("/users/auth")}configs(){return this.get("/configs")}changePassword(g,Q,C){return this.put(`/users/${g}/password`,{password:Q,password_confirmation:C})}}let Bw;function Mn(){return Bw||(Bw=new en),Bw}class on extends GB{uploadFile(g){return this.post("/upload-file",g,{headers:{"Content-Type":"multipart/form-data"}})}}let gw;function Yn(){return gw||(gw=new on),gw}class tn extends GB{fetchControlZones(g){return this.get("/frame/list",{params:g})}async fetchControlZone(g){return this.get(`/frame/${g}`)}createControlZone(g){return this.post("/frame",g)}editControlZone(g,Q){return this.put(`/frame/${g}`,Q)}deleteControlZone(g){return this.delete(`/frame/${g}`)}}let Qw;function cn(){return Qw||(Qw=new tn),Qw}const nn=A=>{const g=B.ref({}),Q=B.ref({});A.columns.forEach(({name:e,filterType:Y})=>{Y&&(g.value[e]=Y==="multi"?[]:void 0,Q.value[e]=!1)});const C=(e,Y)=>typeof Y.field=="function"?Y.field(e):e[Y.field],w=B.computed(()=>Array.isArray(A.rows)?A.rows:A.rows.value),E=B.computed(()=>w.value.filter(e=>A.columns.every(Y=>{const c=g.value[Y.name];if(!Y.filterType||c==null||Array.isArray(c)&&c.length===0)return!0;const t=C(e,Y);return Y.filterType==="single"?t===c:Array.isArray(t)?t.some(n=>c.includes(n)):c.includes(t)}))),I=(e,Y)=>{const c=A.columns.find(t=>t.name===e);if((c==null?void 0:c.filterType)==="multi"){const t=g.value[e],n=t.indexOf(Y);n>-1?t.splice(n,1):t.push(Y),g.value[e]=[...t]}else g.value[e]=Y,Q.value[e]=!1},D=B.computed(()=>{var Y;const e={};for(const c of A.columns){const t=g.value[c.name],n=((Y=A.filtersOptions)==null?void 0:Y.value[c.name])||[];t&&(e[c.name]=Array.isArray(t)?n.filter(F=>t.includes(F.name)).map(F=>F.id):n.filter(F=>F.name===t).map(F=>F.id))}return e}),M=e=>{const Y=A.columns.find(c=>c.name===e);g.value[e]=(Y==null?void 0:Y.filterType)==="multi"?[]:void 0},o=(e,Y)=>{Q.value[e]=Y};return{rows:w,columns:B.computed(()=>A.columns),columnFilters:g,filterMenus:Q,filteredRows:E,toggleFilterValue:I,clearFilter:M,openFilterMenu:o,selectedFilters:D}},Fn=(A,g)=>({message:g,color:A==="danger"?"red":A==="success"?"green":A==="warning"?"orange":"white",position:"top-right"});tA.ApiService=GB,tA.AppButton=BQ,tA.AppCheckbox=ZD,tA.AppConfirmDialog=rt,tA.AppDatePicker=he,tA.AppDropdown=ut,tA.AppInput=We,tA.AppInputSearch=Se,tA.AppLayout=Oe,tA.AppLayoutHeader=JY,tA.AppLayoutPage=vY,tA.AppLoader=RE,tA.AppSelect=yY,tA.AppSheet=pY,tA.AppSidebar=wt,tA.AppTable=dc,tA.AppTableModal=yt,tA.AppTablePagination=vt,tA.AppTableSearch=kt,tA.AppToggle=It,tA.AppWrapper=ot,tA.notificationSettings=Fn,tA.useAuthService=Mn,tA.useControlsService=cn,tA.useFileService=Yn,tA.useGanttService=An,tA.useMetricsService=gn,tA.useProjectsService=Cn,tA.useRepairsService=En,tA.useTableModel=nn,tA.useTasksService=Dn,Object.defineProperty(tA,Symbol.toStringTag,{value:"Module"})});
7
+ `+E):C.stack=E}catch{}}throw C}}_request(g,Q){typeof g=="string"?(Q=Q||{},Q.url=g):Q=g||{},Q=KB(this.defaults,Q);const{transitional:C,paramsSerializer:w,headers:E}=Q;C!==void 0&&dQ.assertOptions(C,{silentJSONParsing:nB.transitional(nB.boolean),forcedJSONParsing:nB.transitional(nB.boolean),clarifyTimeoutError:nB.transitional(nB.boolean)},!1),w!=null&&(N.isFunction(w)?Q.paramsSerializer={serialize:w}:dQ.assertOptions(w,{encode:nB.function,serialize:nB.function},!0)),Q.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?Q.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:Q.allowAbsoluteUrls=!0),dQ.assertOptions(Q,{baseUrl:nB.spelling("baseURL"),withXsrfToken:nB.spelling("withXSRFToken")},!0),Q.method=(Q.method||this.defaults.method||"get").toLowerCase();let I=E&&N.merge(E.common,E[Q.method]);E&&N.forEach(["delete","get","head","post","put","patch","common"],n=>{delete E[n]}),Q.headers=gB.concat(I,E);const D=[];let M=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(Q)===!1||(M=M&&F.synchronous,D.unshift(F.fulfilled,F.rejected))});const o=[];this.interceptors.response.forEach(function(F){o.push(F.fulfilled,F.rejected)});let e,Y=0,c;if(!M){const n=[xI.bind(this),void 0];for(n.unshift.apply(n,D),n.push.apply(n,o),c=n.length,e=Promise.resolve(Q);Y<c;)e=e.then(n[Y++],n[Y++]);return e}c=D.length;let t=Q;for(Y=0;Y<c;){const n=D[Y++],F=D[Y++];try{t=n(t)}catch(i){F.call(this,i);break}}try{e=xI.call(this,t)}catch(n){return Promise.reject(n)}for(Y=0,c=o.length;Y<c;)e=e.then(o[Y++],o[Y++]);return e}getUri(g){g=KB(this.defaults,g);const Q=mI(g.baseURL,g.url,g.allowAbsoluteUrls);return HI(Q,g.params,g.paramsSerializer)}};N.forEach(["delete","get","head","options"],function(g){xB.prototype[g]=function(Q,C){return this.request(KB(C||{},{method:g,url:Q,data:(C||{}).data}))}}),N.forEach(["post","put","patch"],function(g){function Q(C){return function(E,I,D){return this.request(KB(D||{},{method:g,headers:C?{"Content-Type":"multipart/form-data"}:{},url:E,data:I}))}}xB.prototype[g]=Q(),xB.prototype[g+"Form"]=Q(!0)});let Zi=class $I{constructor(g){if(typeof g!="function")throw new TypeError("executor must be a function.");let Q;this.promise=new Promise(function(E){Q=E});const C=this;this.promise.then(w=>{if(!C._listeners)return;let E=C._listeners.length;for(;E-- >0;)C._listeners[E](w);C._listeners=null}),this.promise.then=w=>{let E;const I=new Promise(D=>{C.subscribe(D),E=D}).then(w);return I.cancel=function(){C.unsubscribe(E)},I},g(function(E,I,D){C.reason||(C.reason=new eg(E,I,D),Q(C.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(g){if(this.reason){g(this.reason);return}this._listeners?this._listeners.push(g):this._listeners=[g]}unsubscribe(g){if(!this._listeners)return;const Q=this._listeners.indexOf(g);Q!==-1&&this._listeners.splice(Q,1)}toAbortSignal(){const g=new AbortController,Q=C=>{g.abort(C)};return this.subscribe(Q),g.signal.unsubscribe=()=>this.unsubscribe(Q),g.signal}static source(){let g;return{token:new $I(function(w){g=w}),cancel:g}}};function qi(A){return function(Q){return A.apply(null,Q)}}function _i(A){return N.isObject(A)&&A.isAxiosError===!0}const XC={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(XC).forEach(([A,g])=>{XC[g]=A});function OI(A){const g=new xB(A),Q=oI(xB.prototype.request,g);return N.extend(Q,xB.prototype,g,{allOwnKeys:!0}),N.extend(Q,g,null,{allOwnKeys:!0}),Q.create=function(w){return OI(KB(A,w))},Q}const mA=OI(Rg);mA.Axios=xB,mA.CanceledError=eg,mA.CancelToken=Zi,mA.isCancel=NI,mA.VERSION=VI,mA.toFormData=GQ,mA.AxiosError=cA,mA.Cancel=mA.CanceledError,mA.all=function(g){return Promise.all(g)},mA.spread=qi,mA.isAxiosError=_i,mA.mergeConfig=KB,mA.AxiosHeaders=gB,mA.formToJSON=A=>dI(N.isHTMLForm(A)?new FormData(A):A),mA.getAdapter=KI.getAdapter,mA.HttpStatusCode=XC,mA.default=mA;const{Axios:jF,AxiosError:yF,CanceledError:WF,isCancel:SF,CancelToken:KF,VERSION:xF,all:VF,Cancel:bF,isAxiosError:OF,spread:pF,toFormData:XF,AxiosHeaders:ZF,HttpStatusCode:qF,formToJSON:_F,getAdapter:$F,mergeConfig:As}=mA;class GB{constructor(){_I(this,"axiosInstance");this.axiosInstance=mA.create({baseURL:process.env.VUE_APP_BACKEND,headers:{"Content-Type":"application/json",Accept:"application/json"}}),this.axiosInstance.interceptors.request.use(g=>{const Q=this.getToken();return Q&&g.headers&&(g.headers.Authorization=`Bearer ${Q}`),g},g=>Promise.reject(g)),this.axiosInstance.interceptors.response.use(g=>{var C;const Q=g.data;return((C=Q==null?void 0:Q.data)==null?void 0:C.filter_value)!==void 0?g:Q},g=>{var Q,C;return(((Q=g.response)==null?void 0:Q.status)===401||((C=g.response)==null?void 0:C.status)===403)&&this.logout(),Promise.reject(g)})}getToken(){return localStorage.getItem("token")}removeToken(){localStorage.removeItem("token")}logout(){this.removeToken(),window.location.href="/sign-in"}handleError(g){g.response?console.error("API Error:",g.response.status,g.response.data):g.request?console.error("No response received:",g.request):console.error("Error during request setup:",g.message)}async get(g,Q){try{const C=await this.axiosInstance.get(g,Q);return(C==null?void 0:C.data)===!1?!1:(C==null?void 0:C.data)??C}catch(C){const w=C;throw this.handleError(w),C}}async delete(g,Q){try{return await this.axiosInstance.delete(g,Q)}catch(C){const w=C;throw this.handleError(w),C}}async post(g,Q,C){try{const w=await this.axiosInstance.post(g,Q,C);return(w==null?void 0:w.data)===!1?!1:(w==null?void 0:w.data)||w}catch(w){const E=w;throw this.handleError(E),w}}async put(g,Q,C){try{return(await this.axiosInstance.put(g,Q,C)).data}catch(w){const E=w;throw this.handleError(E),w}}}class $i extends GB{async fetchCriticalPathTasks(g){return await this.get(`gantt/get_list_task_on_critical_path?${g}`)}async fetchGanttList(g){return await this.get(`/list/tasks/search?${g}&gantt=1`)}}let ZC;function An(){return ZC||(ZC=new $i),ZC}class Bn extends GB{async fetchPieProjects(g){return await this.get("repairs/pie/projects?"+g)}async fetchPieTasks(g){return await this.get("repairs/pie/tasks?"+g)}async fetchPiePersonnel(g){return await this.get("repairs/metrics/get_list_position?"+g)}async fetchPersonnelData(g){return await this.get("repairs/metrics/list_position_intersection_group_by_status?"+g)}async fetchPersonnelInfo(g){return await this.get(`repairs/metrics/list_position_intersection_details?${g}`)}async fetchPiePersonnelInfo(g){return await this.get(`repairs/metrics/get_list_user_by_position?${g}`)}async fetchPieCriticalPath(g){return await this.get("repairs/metrics/get_critical_path_group_by_status?"+g)}async fetchPieCriticalPathInfo(g){return await this.get(`repairs/metrics/get_list_task_critical_path_by_status?${g}`)}async fetchPieTmc(g){return await this.get("repairs/metrics/get_list_instrument_type?"+g)}async fetchPieTmcInfo(g){return await this.get(`repairs/metrics/get_list_warehouse_by_instrument_type?${g}`)}async fetchPieUntimelyClosedTask(g){return await this.get("repairs/metrics/get_list_comment_type?"+g)}async fetchPieUntimelyClosedTaskInfo(g){return await this.get(`repairs/metrics/get_list_task_by_comment_type?${g}`)}async fetchPieAdditionalTasks(g){return await this.get("repairs/metrics/get_list_task_after_plan_fixate_group_by_status?"+g)}async fetchPieAdditionalTasksInfo(g){return await this.get(`repairs/metrics/get_list_task_after_plan_fixate_by_status?${g}`)}async fetchPersonnel(g){return await this.get("repairs/statistic/personnel?"+g)}async fetchPieExpired(g){return await this.get("repairs/metrics/get_list_task_expired_group_by_status?"+g)}async fetchPieExpiredInfo(g){return await this.get(`repairs/metrics/get_list_task_expired?${g}`)}async fetchEconomicsPerformance(g){return await this.get(`repairs/metrics/get_economic_performance?${g}`)}async fetchEconomicsInfo(g){return await this.get(`repairs/metrics/get_list_task_economic_performance?${g}`)}async fetchQualityMetrics(g){return await this.get(`repairs/metrics/get_quality_metrics?${g}`)}async fetchQualityInfo(g){return await this.get(`repairs/metrics/get_list_task_by_quality?${g}`)}async fetchPieWorkZone(g){return await this.get("repairs/metrics/get_list_work_zone_instrument?"+g)}async fetchWorkZoneInfo(g){return await this.get("repairs/metrics/get_list_work_zone_instrument_by_status?"+g)}async fetchPieAllTasks(g){return await this.get("repairs/metrics/get_list_task_group_by_status?"+g)}async fetchPieAllTasksInfo(g){return await this.get("repairs/metrics/get_list_task_by_status?"+g)}}let qC;function gn(){return qC||(qC=new Bn),qC}class Qn extends GB{async fetchProjectById(g){return this.get(`/projects/${g}`)}createProject(g){return this.post("/projects",g)}editProject(g,Q){return this.put(`/projects/${g}`,Q)}fetchProjects(g){return this.get("/search/projects",{params:g})}cloneProject(g){return this.post(`projects/${g.id}/clone`,g)}archiveProject(g,Q){return this.put(`/projects/${g}`,Q)}unArchiveProject(g,Q){return this.put(`/projects/${g}`,Q)}moveAprProject(g){return this.post("repairs/move_plan_to_real",{repairs:[g]})}restoreProject(g){return this.post("/restore_project",{projects_ids:[g]})}importTasks(g){return this.post("tasks/import",g)}importKtd(g){return this.post("/parse_ktd",g,{headers:{"Content-Type":"multipart/form-data"}})}fetchProjectTeamList(g){return this.put(`/projects/${g}`,null)}deleteProject(g){return this.delete(`/projects/${g}`)}}let _C;function Cn(){return _C||(_C=new Qn),_C}class wn extends GB{fetchFilters(g){return this.get(`get_list_repair?smart=1&${g}`)}fetchRepairs(g,Q,C,w,E){return this.get("get_list_repair"+(g?`${Q}&per_page=100000${E?"&"+E:""}&${C?"":w}`:`?per_page=100000${E?"&"+E:""}&${w}`))}fetchEquipment(){return this.get("repairs/equipment/list?per_page=100000")}createRepair(g){return this.post("/repairs/equipments",g)}startRepair(g){return this.post(`/repairs/${g}/start`,null)}finishRepair(g){return this.post("/repairs/complete_repair_list",{repairIdList:[g]})}finishPreparationProject(g){return this.post(`/repairs/${g}/finish_preparation`,null)}moveRepairToCurrent(g){return this.post("/repairs/transfer_repair_plan_to_current",{repairs:[g]})}moveArchiveToCurrent(g){return this.post("/repairs/transfer_repair_archive_to_current",{repairs_ids:[g]})}moveRepairToApr(g){return this.post("/repairs/transfer_repair_current_to_plan",{repairs:[g]})}moveRepairToArchive(g){return this.post("/repairs/transfer_repair_current_to_archive",{repairs_ids:[g]})}restoreRepair(g){return this.post("/restore_repair",{repairs_ids:[g]})}updateRepair(g,Q){return this.put(`/repairs/${Q}`,g)}copyRepair(g){return this.post(`/repairs/${g}/clone`,null)}deleteRepair(g){return this.delete(`/repairs/${g}`)}}let $C;function En(){return $C||($C=new wn),$C}class In extends GB{async fetchTaskById(g){return await this.get(`/tasks/${g}`)}async fetchTasksList(g){return await this.get("/list/tasks/search",{params:g})}async fetchSubtasksList(g){return await this.get(`/task/${g}/subtasks/list`)}async fetchTaskBranch(g){return await this.get(`/get_list_task_branch?task_id=${g}`)}async fetchInstrumentsList(g){return await this.get("admin/instruments",{params:g})}async fetchInstrumentTypeListWithPreparedWarehouse(g){return await this.get("/instrument_type/get_instrument_type_list_with_prepared_warehouse",{params:g})}async fetchInstrumentsEquivalentList(g){return await this.get("tasks/instrument/list",{params:g})}async fetchDiffInstruments(g){return await this.get(`tasks/${g.taskId}/fill/module`,{params:g})}async replaceInstruments(g){return await this.post("/instruments/equivalent/attach",g)}async fetchTaskUsagePersonal(g){return await this.get(`tasks/${g.taskId}/usage/users`,{params:g})}async fetchTaskUsageInstrument(g){return await this.get(`tasks/${g.taskId}/usage/instruments`,{params:g})}fetchEquipment(g){return this.get("repairs/equipment/list",{params:g})}fetchTaskVideoSources(g){return this.get("work_zone/get_list_video_source",{params:g})}fetchTaskVideoSourcesStream(g){return this.get("horizon/video-source",{params:g})}createWorkZone(g){return this.post("admin/work-zones",g)}async createTask(g){return await this.post("tasks",g)}async editTask(g){return await this.put(`tasks/${g.taskId}`,g.data)}async mergeTask(g){return await this.post("tasks/merge",g)}async deleteTask(g){return await this.delete(`tasks/${g}`)}async changeStatus(g){const{taskId:Q,data:C}=g;return await this.put(`task/${Q}/change-status`,C)}async uploadComment(g){return await this.post("comments",g)}async deleteComment(g){return await this.delete(`comments/${g}`)}async editComment(g){const{commentId:Q,data:C}=g;return await this.put(`comments/${Q}`,C)}async saveMetrics(g){return await this.put("/update_quality_metrics",g)}async checkReasonForStatus(g){return await this.post("/tasks/check_reason_for_task",g)}async verifyTaskStatus(g){const{task_id:Q,data:C}=g;return await this.get(`/task/${Q}/change-status/verification`,{params:C})}async checkBranchBeforeCloseTask(g){return await this.post("/check_branch_before_close_task",g)}}let Aw;function Dn(){return Aw||(Aw=new In),Aw}class en extends GB{login(g,Q){return this.post("/login",{email:g,password:Q})}loginPhoto(g){return this.post("/login/from_photo",{photo:g})}logout(){return this.post("/logout",null)}userInfo(){return this.get("/users/auth")}configs(){return this.get("/configs")}changePassword(g,Q,C){return this.put(`/users/${g}/password`,{password:Q,password_confirmation:C})}}let Bw;function Mn(){return Bw||(Bw=new en),Bw}class on extends GB{uploadFile(g){return this.post("/upload-file",g,{headers:{"Content-Type":"multipart/form-data"}})}}let gw;function Yn(){return gw||(gw=new on),gw}class tn extends GB{fetchControlZones(g){return this.get("/frame/list",{params:g})}async fetchControlZone(g){return this.get(`/frame/${g}`)}createControlZone(g){return this.post("/frame",g)}editControlZone(g,Q){return this.put(`/frame/${g}`,Q)}deleteControlZone(g){return this.delete(`/frame/${g}`)}}let Qw;function cn(){return Qw||(Qw=new tn),Qw}const nn=A=>{const g=B.ref({}),Q=B.ref({});A.columns.forEach(({name:e,filterType:Y})=>{Y&&(g.value[e]=Y==="multi"?[]:void 0,Q.value[e]=!1)});const C=(e,Y)=>typeof Y.field=="function"?Y.field(e):e[Y.field],w=B.computed(()=>Array.isArray(A.rows)?A.rows:A.rows.value),E=B.computed(()=>w.value.filter(e=>A.columns.every(Y=>{const c=g.value[Y.name];if(!Y.filterType||c==null||Array.isArray(c)&&c.length===0)return!0;const t=C(e,Y);return Y.filterType==="single"?t===c:Array.isArray(t)?t.some(n=>c.includes(n)):c.includes(t)}))),I=(e,Y)=>{const c=A.columns.find(t=>t.name===e);if((c==null?void 0:c.filterType)==="multi"){const t=g.value[e],n=t.indexOf(Y);n>-1?t.splice(n,1):t.push(Y),g.value[e]=[...t]}else g.value[e]=Y,Q.value[e]=!1},D=B.computed(()=>{var Y;const e={};for(const c of A.columns){const t=g.value[c.name],n=((Y=A.filtersOptions)==null?void 0:Y.value[c.name])||[];t&&(e[c.name]=Array.isArray(t)?n.filter(F=>t.includes(F.name)).map(F=>F.id):n.filter(F=>F.name===t).map(F=>F.id))}return e}),M=e=>{const Y=A.columns.find(c=>c.name===e);g.value[e]=(Y==null?void 0:Y.filterType)==="multi"?[]:void 0},o=(e,Y)=>{Q.value[e]=Y};return{rows:w,columns:B.computed(()=>A.columns),columnFilters:g,filterMenus:Q,filteredRows:E,toggleFilterValue:I,clearFilter:M,openFilterMenu:o,selectedFilters:D}},Fn=(A,g)=>({message:g,color:A==="danger"?"red":A==="success"?"green":A==="warning"?"orange":"white",position:"top-right"});tA.ApiService=GB,tA.AppButton=BQ,tA.AppCheckbox=ZD,tA.AppConfirmDialog=rt,tA.AppDatePicker=he,tA.AppDropdown=ut,tA.AppInput=We,tA.AppInputSearch=Se,tA.AppLayout=Oe,tA.AppLayoutHeader=JY,tA.AppLayoutPage=vY,tA.AppLoader=RE,tA.AppSelect=yY,tA.AppSheet=pY,tA.AppSidebar=wt,tA.AppTable=dc,tA.AppTableModal=yt,tA.AppTablePagination=vt,tA.AppTableSearch=kt,tA.AppToggle=It,tA.AppWrapper=ot,tA.notificationSettings=Fn,tA.useAuthService=Mn,tA.useControlsService=cn,tA.useFileService=Yn,tA.useGanttService=An,tA.useMetricsService=gn,tA.useProjectsService=Cn,tA.useRepairsService=En,tA.useTableModel=nn,tA.useTasksService=Dn,Object.defineProperty(tA,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.2.39",
3
+ "version": "1.2.40",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -1,126 +1,134 @@
1
- import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
2
-
3
- export enum ApiServiceType {
4
- SERVICE_AUTH = 'SERVICE_AUTH',
5
- }
6
-
7
- export type ResponseApi<T> = {
8
- count: number
9
- current_page: number
10
- data: T
11
- per_page: number
12
- total: number
13
- total_pages: number
14
- }
15
-
16
- export default class ApiService {
17
- private axiosInstance: AxiosInstance
18
-
19
- constructor() {
20
- this.axiosInstance = axios.create({
21
- baseURL: process.env.VUE_APP_BACKEND,
22
- headers: {
23
- 'Content-Type': 'application/json',
24
- Accept: 'application/json',
25
- },
26
- })
27
-
28
- this.axiosInstance.interceptors.request.use(
29
- (config: InternalAxiosRequestConfig) => {
30
- const token = this.getToken()
31
- if (token && config.headers) {
32
- config.headers.Authorization = `Bearer ${token}`
33
- }
34
- return config
35
- },
36
- (error: AxiosError) => {
37
- return Promise.reject(error)
38
- },
39
- )
40
-
41
- this.axiosInstance.interceptors.response.use(
42
- (response: AxiosResponse) => {
43
- return response.data
44
- },
45
- (error: AxiosError) => {
46
- if (error.response?.status === 401 || error.response?.status === 403) {
47
- this.logout()
48
- }
49
- return Promise.reject(error)
50
- },
51
- )
52
- }
53
-
54
- private getToken() {
55
- return localStorage.getItem('token')
56
- }
57
-
58
- private removeToken() {
59
- localStorage.removeItem('token')
60
- }
61
-
62
- public logout(): void {
63
- this.removeToken()
64
- window.location.href = '/sign-in'
65
- }
66
-
67
- private handleError(error: AxiosError): void {
68
- if (error.response) {
69
- console.error('API Error:', error.response.status, error.response.data)
70
- } else if (error.request) {
71
- console.error('No response received:', error.request)
72
- } else {
73
- console.error('Error during request setup:', error.message)
74
- }
75
- }
76
-
77
- protected async get<T>(url: string, options?: AxiosRequestConfig) {
78
- try {
79
- const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
80
- return response?.data ?? (response as unknown as T)
81
- } catch (error) {
82
- const axiosError = error as AxiosError
83
- this.handleError(axiosError)
84
- throw error
85
- }
86
- }
87
-
88
- protected async delete<T>(url: string, options?: AxiosRequestConfig) {
89
- try {
90
- return await this.axiosInstance.delete<T>(url, options)
91
- } catch (error) {
92
- const axiosError = error as AxiosError
93
- this.handleError(axiosError)
94
- throw error
95
- }
96
- }
97
-
98
- protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
99
- try {
100
- const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
101
- return response?.data || (response as any)
102
- } catch (error) {
103
- const axiosError = error as AxiosError
104
- this.handleError(axiosError)
105
- throw error
106
- }
107
- }
108
-
109
- // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
110
- // return axios
111
- // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
112
- // .catch((err: AxiosError) => processError401<T2>(err))
113
- // .then(extractData)
114
- // }
115
- //
116
- protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
117
- try {
118
- const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
119
- return response.data
120
- } catch (error) {
121
- const axiosError = error as AxiosError
122
- this.handleError(axiosError)
123
- throw error
124
- }
125
- }
126
- }
1
+ import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
2
+
3
+ export enum ApiServiceType {
4
+ SERVICE_AUTH = 'SERVICE_AUTH',
5
+ }
6
+
7
+ export type ResponseApi<T> = {
8
+ count: number
9
+ current_page: number
10
+ data: T
11
+ per_page: number
12
+ total: number
13
+ total_pages: number
14
+ }
15
+
16
+ export default class ApiService {
17
+ private axiosInstance: AxiosInstance
18
+
19
+ constructor() {
20
+ this.axiosInstance = axios.create({
21
+ baseURL: process.env.VUE_APP_BACKEND,
22
+ headers: {
23
+ 'Content-Type': 'application/json',
24
+ Accept: 'application/json',
25
+ },
26
+ })
27
+
28
+ this.axiosInstance.interceptors.request.use(
29
+ (config: InternalAxiosRequestConfig) => {
30
+ const token = this.getToken()
31
+ if (token && config.headers) {
32
+ config.headers.Authorization = `Bearer ${token}`
33
+ }
34
+ return config
35
+ },
36
+ (error: AxiosError) => {
37
+ return Promise.reject(error)
38
+ },
39
+ )
40
+
41
+ this.axiosInstance.interceptors.response.use(
42
+ (response: AxiosResponse) => {
43
+ const responseData = response.data
44
+
45
+ if (responseData?.data?.filter_value !== undefined) {
46
+ return response
47
+ }
48
+
49
+ return responseData
50
+ },
51
+ (error: AxiosError) => {
52
+ if (error.response?.status === 401 || error.response?.status === 403) {
53
+ this.logout()
54
+ }
55
+ return Promise.reject(error)
56
+ },
57
+ )
58
+ }
59
+
60
+ private getToken() {
61
+ return localStorage.getItem('token')
62
+ }
63
+
64
+ private removeToken() {
65
+ localStorage.removeItem('token')
66
+ }
67
+
68
+ public logout(): void {
69
+ this.removeToken()
70
+ window.location.href = '/sign-in'
71
+ }
72
+
73
+ private handleError(error: AxiosError): void {
74
+ if (error.response) {
75
+ console.error('API Error:', error.response.status, error.response.data)
76
+ } else if (error.request) {
77
+ console.error('No response received:', error.request)
78
+ } else {
79
+ console.error('Error during request setup:', error.message)
80
+ }
81
+ }
82
+
83
+ protected async get<T>(url: string, options?: AxiosRequestConfig) {
84
+ try {
85
+ const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
86
+ if (response?.data === false) return false as unknown as T
87
+ return response?.data ?? (response as unknown as T)
88
+ } catch (error) {
89
+ const axiosError = error as AxiosError
90
+ this.handleError(axiosError)
91
+ throw error
92
+ }
93
+ }
94
+
95
+ protected async delete<T>(url: string, options?: AxiosRequestConfig) {
96
+ try {
97
+ return await this.axiosInstance.delete<T>(url, options)
98
+ } catch (error) {
99
+ const axiosError = error as AxiosError
100
+ this.handleError(axiosError)
101
+ throw error
102
+ }
103
+ }
104
+
105
+ protected async post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
106
+ try {
107
+ const response: AxiosResponse<T2> = await this.axiosInstance.post<T1, AxiosResponse<T2>>(url, payload, options)
108
+ if (response?.data === false) return false
109
+ return response?.data || (response as any)
110
+ } catch (error) {
111
+ const axiosError = error as AxiosError
112
+ this.handleError(axiosError)
113
+ throw error
114
+ }
115
+ }
116
+
117
+ // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
118
+ // return axios
119
+ // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
120
+ // .catch((err: AxiosError) => processError401<T2>(err))
121
+ // .then(extractData)
122
+ // }
123
+ //
124
+ protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
125
+ try {
126
+ const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
127
+ return response.data
128
+ } catch (error) {
129
+ const axiosError = error as AxiosError
130
+ this.handleError(axiosError)
131
+ throw error
132
+ }
133
+ }
134
+ }