tsv2-library 0.0.36 → 0.0.37
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.
package/dist/tsv2-library.cjs.js
CHANGED
|
@@ -262,7 +262,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
262
262
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Hc]=this[Hc]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=mi(s);n[l]||(Y6(o,s),n[l]=!0)}return Q.isArray(t)?t.forEach(i):i(t),this}}Wa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Q.reduceDescriptors(Wa.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});Q.freezeMethods(Wa);const Dr=Wa;function ms(e,t){const r=this||Ul,n=t||r,o=Dr.from(n.headers);let i=n.data;return Q.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Pp(e){return!!(e&&e.__CANCEL__)}function _o(e,t,r){Pe.call(this,e??"canceled",Pe.ERR_CANCELED,t,r),this.name="CanceledError"}Q.inherits(_o,Pe,{__CANCEL__:!0});function X6(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Pe("Request failed with status code "+r.status,[Pe.ERR_BAD_REQUEST,Pe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const q6=br.hasStandardBrowserEnv?{write(e,t,r,n,o,i){const s=[e+"="+encodeURIComponent(t)];Q.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Q.isString(n)&&s.push("path="+n),Q.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Z6(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function J6(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ip(e,t){return e&&!Z6(t)?J6(e,t):t}const Q6=br.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function o(i){let s=i;return t&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(s){const l=Q.isString(s)?o(s):s;return l.protocol===n.protocol&&l.host===n.host}}():function(){return function(){return!0}}();function e5(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function t5(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=n[i];s||(s=u),r[o]=c,n[o]=u;let f=i,h=0;for(;f!==o;)h+=r[f++],f=f%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-s<t)return;const p=d&&u-d;return p?Math.round(h*1e3/p):void 0}}function Uc(e,t){let r=0;const n=t5(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,l=i-r,c=n(l),u=i<=s;r=i;const d={loaded:i,total:s,progress:s?i/s:void 0,bytes:l,rate:c||void 0,estimated:c&&s&&u?(s-i)/c:void 0,event:o};d[t?"download":"upload"]=!0,e(d)}}const r5=typeof XMLHttpRequest<"u",n5=r5&&function(e){return new Promise(function(r,n){let o=e.data;const i=Dr.from(e.headers).normalize();let{responseType:s,withXSRFToken:l}=e,c;function u(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}let d;if(Q.isFormData(o)){if(br.hasStandardBrowserEnv||br.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((d=i.getContentType())!==!1){const[m,...v]=d?d.split(";").map(y=>y.trim()).filter(Boolean):[];i.setContentType([m||"multipart/form-data",...v].join("; "))}}let f=new XMLHttpRequest;if(e.auth){const m=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(m+":"+v))}const h=Ip(e.baseURL,e.url);f.open(e.method.toUpperCase(),Sp(h,e.params,e.paramsSerializer),!0),f.timeout=e.timeout;function p(){if(!f)return;const m=Dr.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),y={data:!s||s==="text"||s==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:m,config:e,request:f};X6(function(x){r(x),u()},function(x){n(x),u()},y),f=null}if("onloadend"in f?f.onloadend=p:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(p)},f.onabort=function(){f&&(n(new Pe("Request aborted",Pe.ECONNABORTED,e,f)),f=null)},f.onerror=function(){n(new Pe("Network Error",Pe.ERR_NETWORK,e,f)),f=null},f.ontimeout=function(){let v=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const y=e.transitional||Ep;e.timeoutErrorMessage&&(v=e.timeoutErrorMessage),n(new Pe(v,y.clarifyTimeoutError?Pe.ETIMEDOUT:Pe.ECONNABORTED,e,f)),f=null},br.hasStandardBrowserEnv&&(l&&Q.isFunction(l)&&(l=l(e)),l||l!==!1&&Q6(h))){const m=e.xsrfHeaderName&&e.xsrfCookieName&&q6.read(e.xsrfCookieName);m&&i.set(e.xsrfHeaderName,m)}o===void 0&&i.setContentType(null),"setRequestHeader"in f&&Q.forEach(i.toJSON(),function(v,y){f.setRequestHeader(y,v)}),Q.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),s&&s!=="json"&&(f.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&f.addEventListener("progress",Uc(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",Uc(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=m=>{f&&(n(!m||m.type?new _o(null,e,f):m),f.abort(),f=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const g=e5(h);if(g&&br.protocols.indexOf(g)===-1){n(new Pe("Unsupported protocol "+g+":",Pe.ERR_BAD_REQUEST,e));return}f.send(o||null)})},Ws={http:O6,xhr:n5};Q.forEach(Ws,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Kc=e=>`- ${e}`,i5=e=>Q.isFunction(e)||e===null||e===!1,Bp={getAdapter:e=>{e=Q.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let i=0;i<t;i++){r=e[i];let s;if(n=r,!i5(r)&&(n=Ws[(s=String(r)).toLowerCase()],n===void 0))throw new Pe(`Unknown adapter '${s}'`);if(n)break;o[s||"#"+i]=n}if(!n){const i=Object.entries(o).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since :
|
|
263
263
|
`+i.map(Kc).join(`
|
|
264
264
|
`):" "+Kc(i[0]):"as no adapter specified";throw new Pe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:Ws};function gs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _o(null,e)}function Wc(e){return gs(e),e.headers=Dr.from(e.headers),e.data=ms.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Bp.getAdapter(e.adapter||Ul.adapter)(e).then(function(n){return gs(e),n.data=ms.call(e,e.transformResponse,n),n.headers=Dr.from(n.headers),n},function(n){return Pp(n)||(gs(e),n&&n.response&&(n.response.data=ms.call(e,e.transformResponse,n.response),n.response.headers=Dr.from(n.response.headers))),Promise.reject(n)})}const Gc=e=>e instanceof Dr?e.toJSON():e;function Wn(e,t){t=t||{};const r={};function n(u,d,f){return Q.isPlainObject(u)&&Q.isPlainObject(d)?Q.merge.call({caseless:f},u,d):Q.isPlainObject(d)?Q.merge({},d):Q.isArray(d)?d.slice():d}function o(u,d,f){if(Q.isUndefined(d)){if(!Q.isUndefined(u))return n(void 0,u,f)}else return n(u,d,f)}function i(u,d){if(!Q.isUndefined(d))return n(void 0,d)}function s(u,d){if(Q.isUndefined(d)){if(!Q.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function l(u,d,f){if(f in t)return n(u,d);if(f in e)return n(void 0,u)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(u,d)=>o(Gc(u),Gc(d),!0)};return Q.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||o,h=f(e[d],t[d],d);Q.isUndefined(h)&&f!==l||(r[d]=h)}),r}const Ap="1.6.7",Kl={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Kl[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Yc={};Kl.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Ap+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new Pe(o(s," has been removed"+(r?" in "+r:"")),Pe.ERR_DEPRECATED);return r&&!Yc[s]&&(Yc[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}};function o5(e,t,r){if(typeof e!="object")throw new Pe("options must be an object",Pe.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new Pe("option "+i+" must be "+c,Pe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Pe("Unknown option "+i,Pe.ERR_BAD_OPTION)}}const Gs={assertOptions:o5,validators:Kl},zr=Gs.validators;class Ca{constructor(t){this.defaults=t,this.interceptors={request:new zc,response:new zc}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
265
|
-
`+i):n.stack=i}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Wn(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Gs.assertOptions(n,{silentJSONParsing:zr.transitional(zr.boolean),forcedJSONParsing:zr.transitional(zr.boolean),clarifyTimeoutError:zr.transitional(zr.boolean)},!1),o!=null&&(Q.isFunction(o)?r.paramsSerializer={serialize:o}:Gs.assertOptions(o,{encode:zr.function,serialize:zr.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&Q.merge(i.common,i[r.method]);i&&Q.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),r.headers=Dr.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,h;if(!c){const g=[Wc.bind(this),void 0];for(g.unshift.apply(g,l),g.push.apply(g,u),h=g.length,d=Promise.resolve(r);f<h;)d=d.then(g[f++],g[f++]);return d}h=l.length;let p=r;for(f=0;f<h;){const g=l[f++],m=l[f++];try{p=g(p)}catch(v){m.call(this,v);break}}try{d=Wc.call(this,p)}catch(g){return Promise.reject(g)}for(f=0,h=u.length;f<h;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=Wn(this.defaults,t);const r=Ip(t.baseURL,t.url);return Sp(r,t.params,t.paramsSerializer)}}Q.forEach(["delete","get","head","options"],function(t){Ca.prototype[t]=function(r,n){return this.request(Wn(n||{},{method:t,url:r,data:(n||{}).data}))}});Q.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(Wn(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Ca.prototype[t]=r(),Ca.prototype[t+"Form"]=r(!0)});const oa=Ca;class Wl{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new _o(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new Wl(function(o){t=o}),cancel:t}}}const a5=Wl;function s5(e){return function(r){return e.apply(null,r)}}function l5(e){return Q.isObject(e)&&e.isAxiosError===!0}const Ys={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(Ys).forEach(([e,t])=>{Ys[t]=e});const u5=Ys;function Dp(e){const t=new oa(e),r=fp(oa.prototype.request,t);return Q.extend(r,oa.prototype,t,{allOwnKeys:!0}),Q.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Dp(Wn(e,o))},r}const lt=Dp(Ul);lt.Axios=oa;lt.CanceledError=_o;lt.CancelToken=a5;lt.isCancel=Pp;lt.VERSION=Ap;lt.toFormData=Ka;lt.AxiosError=Pe;lt.Cancel=lt.CanceledError;lt.all=function(t){return Promise.all(t)};lt.spread=s5;lt.isAxiosError=l5;lt.mergeConfig=Wn;lt.AxiosHeaders=Dr;lt.formToJSON=e=>Op(Q.isHTMLForm(e)?new FormData(e):e);lt.getAdapter=Bp.getAdapter;lt.HttpStatusCode=u5;lt.default=lt;const c5=lt,d5=({type:e="Group",headers:t={},params:r={}}={})=>{const n=JSON.parse(localStorage.getItem("user")??"{}"),o=e==="Group"?{}.VITE_APP_GROUPS_API:{}.VITE_APP_ATTRIBUTES_API;return c5.create({baseURL:`${o}/v2/`,headers:{"Content-type":"application/json",Authorization:`Bearer ${n.token}`,...t},params:r})},f5={getTreeList:e=>d5({type:e}).get(e==="Group"?"/tree":"/category/tree")},Gl=a.defineComponent({__name:"Tree",props:{type:{},selectedKeys:{default:void 0},selectionMode:{default:"checkbox"},filter:{}},emits:["update:selectedKeys","nodeSelect"],setup(e,{emit:t}){const r=e,n=t;a.onMounted(()=>{u()});const o=a.ref(!1),i=a.ref(),s=a.ref([]),l=a.ref({"-1":!0}),c=a.computed({get:()=>r.selectedKeys??{},set:d=>{n("update:selectedKeys",d)}}),u=async()=>{try{o.value=!0;const d=sessionStorage.getItem(`${r.type}Tree`);if(d){s.value=JSON.parse(d);return}const{data:f}=await f5.getTreeList(r.type);f&&(s.value=f.data,sessionStorage.setItem(`${r.type}Tree`,JSON.stringify(f.data)))}finally{o.value=!1}};return a.watch(()=>r.filter,d=>{i.value&&(i.value.filterValue=d)}),(d,f)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(a.unref(cp),{ref_key:"tree",ref:i,expandedKeys:l.value,"onUpdate:expandedKeys":f[1]||(f[1]=h=>l.value=h),"selection-keys":c.value,"onUpdate:selectionKeys":f[2]||(f[2]=h=>c.value=h),loading:o.value,"selection-mode":r.selectionMode,value:s.value,onNodeSelect:f[3]||(f[3]=h=>n("nodeSelect",h)),"filter-by":"name","loading-mode":"icon"},{togglericon:a.withCtx(({expanded:h})=>[a.createVNode(Ue,{class:a.normalizeClass([...a.unref(jd).togglericon.class,{"rotate-90":h}]),"data-ts-section":"togglericon",icon:"arrow-right"},null,8,["class"])]),checkboxicon:a.withCtx(({checked:h,partialChecked:p})=>[a.createVNode(Mo,{"model-value":h||(p?!1:null),"tri-state":""},null,8,["model-value"])]),default:a.withCtx(h=>[a.createTextVNode(a.toDisplayString(h.node.name)+" ",1),a.createCommentVNode("",!0)]),_:1},8,["expandedKeys","selection-keys","loading","selection-mode","value"]),a.createVNode(jl,{ref:"treeNodeMenu",model:[],popup:!0,class:"sidebar-tree-menu-hover"},{itemicon:a.withCtx(({item:h})=>[a.createVNode(Ue,{icon:h.icon,severity:h.danger?"danger":void 0},null,8,["icon","severity"])]),_:1},512)],64))}}),p5={class:"flex flex-col gap-[14.5px] items-start w-full","data-ts-section":"header-wrapper"},Yl=a.defineComponent({__name:"DialogSelectTree",props:{visible:{type:Boolean},type:{default:"Group"},header:{default:"Select Group"},selectionMode:{default:"checkbox"}},emits:["update:visible","select"],setup(e,{emit:t}){const r=e,n=t,o=a.ref(""),i=a.ref(),s=a.ref(),l=a.ref(),c=a.ref(),u=a.computed(()=>r.type==="Group"?"Select Group":"Select Category"),d=()=>{i.value=l.value,s.value=c.value,Object.keys(i.value??{}).length&&(n("select",{keys:i.value,singleNode:s.value}),n("update:visible",!1))};return a.watch(()=>r.visible,f=>{l.value=f?i.value:void 0,c.value=f?s.value:void 0}),(f,h)=>(a.openBlock(),a.createBlock(La,a.mergeProps({pt:{root:{class:[...a.unref(rr).root({state:{}}).class,"!w-[400px]"]},header:{class:"relative"},icons:{class:"absolute top-0 right-0"},content:{class:[...a.unref(rr).content({state:{},instance:{}}).class,"pr-1.5 focus-visible:outline-none"]},footer:{class:"flex justify-end items-center gap-1"}},"onUpdate:visible":h[4]||(h[4]=p=>f.$emit("update:visible",p))},f.$props,{modal:""}),{header:a.withCtx(()=>[a.createElementVNode("div",p5,[a.createElementVNode("h3",{class:a.normalizeClass([...a.unref(rr).title.class,"!leading-6"])},a.toDisplayString(u.value),3),a.createVNode(Vl,{modelValue:o.value,"onUpdate:modelValue":h[0]||(h[0]=p=>o.value=p),class:"w-full"},null,8,["modelValue"])])]),footer:a.withCtx(()=>[a.renderSlot(f.$slots,"footer",{},()=>[a.createVNode(ze,{onClick:h[3]||(h[3]=p=>f.$emit("update:visible",!1)),label:"Cancel",severity:"secondary",text:""}),a.createVNode(ze,{onClick:d,label:"select",severity:"success"})])]),default:a.withCtx(()=>[a.createVNode(Gl,{"selected-keys":l.value,"onUpdate:selectedKeys":h[1]||(h[1]=p=>l.value=p),filter:o.value,"selection-mode":f.selectionMode,type:r.type,onNodeSelect:h[2]||(h[2]=p=>c.value=p)},null,8,["selected-keys","filter","selection-mode","type"])]),_:3},16,["pt"]))}});function h5(){return Fp().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Fp(){return typeof navigator<"u"&&typeof window<"u"?window:typeof global<"u"?global:{}}const m5=typeof Proxy=="function",g5="devtools-plugin:setup",v5="plugin:settings:set";let In,Xs;function y5(){var e;return In!==void 0||(typeof window<"u"&&window.performance?(In=!0,Xs=window.performance):typeof global<"u"&&(!((e=global.perf_hooks)===null||e===void 0)&&e.performance)?(In=!0,Xs=global.perf_hooks.performance):In=!1),In}function b5(){return y5()?Xs.now():Date.now()}class w5{constructor(t,r){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=r;const n={};if(t.settings)for(const s in t.settings){const l=t.settings[s];n[s]=l.defaultValue}const o=`__vue-devtools-plugin-settings__${t.id}`;let i=Object.assign({},n);try{const s=localStorage.getItem(o),l=JSON.parse(s);Object.assign(i,l)}catch{}this.fallbacks={getSettings(){return i},setSettings(s){try{localStorage.setItem(o,JSON.stringify(s))}catch{}i=s},now(){return b5()}},r&&r.on(v5,(s,l)=>{s===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(s,l)=>this.target?this.target.on[l]:(...c)=>{this.onQueue.push({method:l,args:c})}}),this.proxiedTarget=new Proxy({},{get:(s,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...c)=>(this.targetQueue.push({method:l,args:c,resolve:()=>{}}),this.fallbacks[l](...c)):(...c)=>new Promise(u=>{this.targetQueue.push({method:l,args:c,resolve:u})})})}async setRealTarget(t){this.target=t;for(const r of this.onQueue)this.target.on[r.method](...r.args);for(const r of this.targetQueue)r.resolve(await this.target[r.method](...r.args))}}function x5(e,t){const r=e,n=Fp(),o=h5(),i=m5&&r.enableEarlyProxy;if(o&&(n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!i))o.emit(g5,e,t);else{const s=i?new w5(r,o):null;(n.__VUE_DEVTOOLS_PLUGINS__=n.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:r,setupFn:t,proxy:s}),s&&t(s.proxiedTarget)}}/**
|
|
265
|
+
`+i):n.stack=i}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Wn(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Gs.assertOptions(n,{silentJSONParsing:zr.transitional(zr.boolean),forcedJSONParsing:zr.transitional(zr.boolean),clarifyTimeoutError:zr.transitional(zr.boolean)},!1),o!=null&&(Q.isFunction(o)?r.paramsSerializer={serialize:o}:Gs.assertOptions(o,{encode:zr.function,serialize:zr.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&Q.merge(i.common,i[r.method]);i&&Q.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),r.headers=Dr.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,h;if(!c){const g=[Wc.bind(this),void 0];for(g.unshift.apply(g,l),g.push.apply(g,u),h=g.length,d=Promise.resolve(r);f<h;)d=d.then(g[f++],g[f++]);return d}h=l.length;let p=r;for(f=0;f<h;){const g=l[f++],m=l[f++];try{p=g(p)}catch(v){m.call(this,v);break}}try{d=Wc.call(this,p)}catch(g){return Promise.reject(g)}for(f=0,h=u.length;f<h;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=Wn(this.defaults,t);const r=Ip(t.baseURL,t.url);return Sp(r,t.params,t.paramsSerializer)}}Q.forEach(["delete","get","head","options"],function(t){Ca.prototype[t]=function(r,n){return this.request(Wn(n||{},{method:t,url:r,data:(n||{}).data}))}});Q.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(Wn(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Ca.prototype[t]=r(),Ca.prototype[t+"Form"]=r(!0)});const oa=Ca;class Wl{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new _o(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new Wl(function(o){t=o}),cancel:t}}}const a5=Wl;function s5(e){return function(r){return e.apply(null,r)}}function l5(e){return Q.isObject(e)&&e.isAxiosError===!0}const Ys={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(Ys).forEach(([e,t])=>{Ys[t]=e});const u5=Ys;function Dp(e){const t=new oa(e),r=fp(oa.prototype.request,t);return Q.extend(r,oa.prototype,t,{allOwnKeys:!0}),Q.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Dp(Wn(e,o))},r}const lt=Dp(Ul);lt.Axios=oa;lt.CanceledError=_o;lt.CancelToken=a5;lt.isCancel=Pp;lt.VERSION=Ap;lt.toFormData=Ka;lt.AxiosError=Pe;lt.Cancel=lt.CanceledError;lt.all=function(t){return Promise.all(t)};lt.spread=s5;lt.isAxiosError=l5;lt.mergeConfig=Wn;lt.AxiosHeaders=Dr;lt.formToJSON=e=>Op(Q.isHTMLForm(e)?new FormData(e):e);lt.getAdapter=Bp.getAdapter;lt.HttpStatusCode=u5;lt.default=lt;const c5=lt,d5=({type:e="Group",headers:t={},params:r={}}={})=>{const n=JSON.parse(localStorage.getItem("user")??"{}"),o=e==="Group"?"https://dev-api-groups.tagsamurai.com":"https://dev-api-asset-attributes.tagsamurai.com";return c5.create({baseURL:`${o}/v2/`,headers:{"Content-type":"application/json",Authorization:`Bearer ${n.token}`,...t},params:r})},f5={getTreeList:e=>d5({type:e}).get(e==="Group"?"/tree":"/category/tree")},Gl=a.defineComponent({__name:"Tree",props:{type:{},selectedKeys:{default:void 0},selectionMode:{default:"checkbox"},filter:{}},emits:["update:selectedKeys","nodeSelect"],setup(e,{emit:t}){const r=e,n=t;a.onMounted(()=>{u()});const o=a.ref(!1),i=a.ref(),s=a.ref([]),l=a.ref({"-1":!0}),c=a.computed({get:()=>r.selectedKeys??{},set:d=>{n("update:selectedKeys",d)}}),u=async()=>{try{o.value=!0;const d=sessionStorage.getItem(`${r.type}Tree`);if(d){s.value=JSON.parse(d);return}const{data:f}=await f5.getTreeList(r.type);f&&(s.value=f.data,sessionStorage.setItem(`${r.type}Tree`,JSON.stringify(f.data)))}finally{o.value=!1}};return a.watch(()=>r.filter,d=>{i.value&&(i.value.filterValue=d)}),(d,f)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(a.unref(cp),{ref_key:"tree",ref:i,expandedKeys:l.value,"onUpdate:expandedKeys":f[1]||(f[1]=h=>l.value=h),"selection-keys":c.value,"onUpdate:selectionKeys":f[2]||(f[2]=h=>c.value=h),loading:o.value,"selection-mode":r.selectionMode,value:s.value,onNodeSelect:f[3]||(f[3]=h=>n("nodeSelect",h)),"filter-by":"name","loading-mode":"icon"},{togglericon:a.withCtx(({expanded:h})=>[a.createVNode(Ue,{class:a.normalizeClass([...a.unref(jd).togglericon.class,{"rotate-90":h}]),"data-ts-section":"togglericon",icon:"arrow-right"},null,8,["class"])]),checkboxicon:a.withCtx(({checked:h,partialChecked:p})=>[a.createVNode(Mo,{"model-value":h||(p?!1:null),"tri-state":""},null,8,["model-value"])]),default:a.withCtx(h=>[a.createTextVNode(a.toDisplayString(h.node.name)+" ",1),a.createCommentVNode("",!0)]),_:1},8,["expandedKeys","selection-keys","loading","selection-mode","value"]),a.createVNode(jl,{ref:"treeNodeMenu",model:[],popup:!0,class:"sidebar-tree-menu-hover"},{itemicon:a.withCtx(({item:h})=>[a.createVNode(Ue,{icon:h.icon,severity:h.danger?"danger":void 0},null,8,["icon","severity"])]),_:1},512)],64))}}),p5={class:"flex flex-col gap-[14.5px] items-start w-full","data-ts-section":"header-wrapper"},Yl=a.defineComponent({__name:"DialogSelectTree",props:{visible:{type:Boolean},type:{default:"Group"},header:{default:"Select Group"},selectionMode:{default:"checkbox"}},emits:["update:visible","select"],setup(e,{emit:t}){const r=e,n=t,o=a.ref(""),i=a.ref(),s=a.ref(),l=a.ref(),c=a.ref(),u=a.computed(()=>r.type==="Group"?"Select Group":"Select Category"),d=()=>{i.value=l.value,s.value=c.value,Object.keys(i.value??{}).length&&(n("select",{keys:i.value,singleNode:s.value}),n("update:visible",!1))};return a.watch(()=>r.visible,f=>{l.value=f?i.value:void 0,c.value=f?s.value:void 0}),(f,h)=>(a.openBlock(),a.createBlock(La,a.mergeProps({pt:{root:{class:[...a.unref(rr).root({state:{}}).class,"!w-[400px]"]},header:{class:"relative"},icons:{class:"absolute top-0 right-0"},content:{class:[...a.unref(rr).content({state:{},instance:{}}).class,"pr-1.5 focus-visible:outline-none"]},footer:{class:"flex justify-end items-center gap-1"}},"onUpdate:visible":h[4]||(h[4]=p=>f.$emit("update:visible",p))},f.$props,{modal:""}),{header:a.withCtx(()=>[a.createElementVNode("div",p5,[a.createElementVNode("h3",{class:a.normalizeClass([...a.unref(rr).title.class,"!leading-6"])},a.toDisplayString(u.value),3),a.createVNode(Vl,{modelValue:o.value,"onUpdate:modelValue":h[0]||(h[0]=p=>o.value=p),class:"w-full"},null,8,["modelValue"])])]),footer:a.withCtx(()=>[a.renderSlot(f.$slots,"footer",{},()=>[a.createVNode(ze,{onClick:h[3]||(h[3]=p=>f.$emit("update:visible",!1)),label:"Cancel",severity:"secondary",text:""}),a.createVNode(ze,{onClick:d,label:"select",severity:"success"})])]),default:a.withCtx(()=>[a.createVNode(Gl,{"selected-keys":l.value,"onUpdate:selectedKeys":h[1]||(h[1]=p=>l.value=p),filter:o.value,"selection-mode":f.selectionMode,type:r.type,onNodeSelect:h[2]||(h[2]=p=>c.value=p)},null,8,["selected-keys","filter","selection-mode","type"])]),_:3},16,["pt"]))}});function h5(){return Fp().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Fp(){return typeof navigator<"u"&&typeof window<"u"?window:typeof global<"u"?global:{}}const m5=typeof Proxy=="function",g5="devtools-plugin:setup",v5="plugin:settings:set";let In,Xs;function y5(){var e;return In!==void 0||(typeof window<"u"&&window.performance?(In=!0,Xs=window.performance):typeof global<"u"&&(!((e=global.perf_hooks)===null||e===void 0)&&e.performance)?(In=!0,Xs=global.perf_hooks.performance):In=!1),In}function b5(){return y5()?Xs.now():Date.now()}class w5{constructor(t,r){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=r;const n={};if(t.settings)for(const s in t.settings){const l=t.settings[s];n[s]=l.defaultValue}const o=`__vue-devtools-plugin-settings__${t.id}`;let i=Object.assign({},n);try{const s=localStorage.getItem(o),l=JSON.parse(s);Object.assign(i,l)}catch{}this.fallbacks={getSettings(){return i},setSettings(s){try{localStorage.setItem(o,JSON.stringify(s))}catch{}i=s},now(){return b5()}},r&&r.on(v5,(s,l)=>{s===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(s,l)=>this.target?this.target.on[l]:(...c)=>{this.onQueue.push({method:l,args:c})}}),this.proxiedTarget=new Proxy({},{get:(s,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...c)=>(this.targetQueue.push({method:l,args:c,resolve:()=>{}}),this.fallbacks[l](...c)):(...c)=>new Promise(u=>{this.targetQueue.push({method:l,args:c,resolve:u})})})}async setRealTarget(t){this.target=t;for(const r of this.onQueue)this.target.on[r.method](...r.args);for(const r of this.targetQueue)r.resolve(await this.target[r.method](...r.args))}}function x5(e,t){const r=e,n=Fp(),o=h5(),i=m5&&r.enableEarlyProxy;if(o&&(n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!i))o.emit(g5,e,t);else{const s=i?new w5(r,o):null;(n.__VUE_DEVTOOLS_PLUGINS__=n.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:r,setupFn:t,proxy:s}),s&&t(s.proxiedTarget)}}/**
|
|
266
266
|
* vee-validate v4.12.5
|
|
267
267
|
* (c) 2024 Abdelrahman Awad
|
|
268
268
|
* @license MIT
|