tsv2-library 0.3.62 → 0.3.63
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.es.js
CHANGED
|
@@ -71541,7 +71541,10 @@ const gxe = /* @__PURE__ */ gc(mxe, [["__scopeId", "data-v-349deb23"]]), vxe = (
|
|
|
71541
71541
|
try {
|
|
71542
71542
|
n(!0);
|
|
71543
71543
|
const { data: S } = await Ri.matchAssetWithTag(i.id, w);
|
|
71544
|
-
(R = S == null ? void 0 : S.data) != null && R.totalRecords ? p.value = !0 : p.value = !1
|
|
71544
|
+
(R = S == null ? void 0 : S.data) != null && R.totalRecords ? p.value = !0 : (p.value = !1, r.add({
|
|
71545
|
+
severity: "error",
|
|
71546
|
+
message: "Error, failed to verify. TAG doesn't match."
|
|
71547
|
+
}));
|
|
71545
71548
|
} catch (S) {
|
|
71546
71549
|
r.add({
|
|
71547
71550
|
error: S,
|
package/dist/tsv2-library.umd.js
CHANGED
|
@@ -492,7 +492,7 @@ Minimum version required to store current data is: `+a+`.
|
|
|
492
492
|
`);const s=uH(t,n,o),l=gM.getSymbolSize(t),c=new tH(l);return sH(c,t),lH(c),cH(c,t),Gg(c,n,0),t>=7&&AH(c,t),MH(c,s),isNaN(i)&&(i=_g.getBestMask(c,Gg.bind(null,c,n))),_g.applyMask(i,c),Gg(c,n,i),{modules:c,version:t,errorCorrectionLevel:n,maskPattern:i,segments:o}}rf.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let i=Rg.M,o,a;return typeof n<"u"&&(i=Rg.from(n.errorCorrectionLevel,Rg.M),o=NM.from(n.version),a=_g.from(n.maskPattern),n.toSJISFunc&&gM.setToSJISFunction(n.toSJISFunc)),gH(t,o,i,a)};var yf={},Pg={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let i=n.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+n);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(a){return[a,a]}))),i.length===6&&i.push("F","F");const o=parseInt(i.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(i){i||(i={}),i.color||(i.color={});const o=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,a=i.width&&i.width>=21?i.width:void 0,s=i.scale||4;return{width:a,scale:a?4:s,margin:o,color:{dark:t(i.color.dark||"#000000ff"),light:t(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},e.getScale=function(i,o){return o.width&&o.width>=i+o.margin*2?o.width/(i+o.margin*2):o.scale},e.getImageWidth=function(i,o){const a=e.getScale(i,o);return Math.floor((i+o.margin*2)*a)},e.qrToImageData=function(i,o,a){const s=o.modules.size,l=o.modules.data,c=e.getScale(s,a),M=Math.floor((s+a.margin*2)*c),d=a.margin*c,N=[a.color.light,a.color.dark];for(let h=0;h<M;h++)for(let g=0;g<M;g++){let T=(h*M+g)*4,y=a.color.light;if(h>=d&&g>=d&&h<M-d&&g<M-d){const I=Math.floor((h-d)/c),f=Math.floor((g-d)/c);y=N[l[I*s+f]?1:0]}i[T++]=y.r,i[T++]=y.g,i[T++]=y.b,i[T]=y.a}}})(Pg),function(e){const t=Pg;function n(o,a,s){o.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=s,a.width=s,a.style.height=s+"px",a.style.width=s+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(a,s,l){let c=l,M=s;typeof c>"u"&&(!s||!s.getContext)&&(c=s,s=void 0),s||(M=i()),c=t.getOptions(c);const d=t.getImageWidth(a.modules.size,c),N=M.getContext("2d"),h=N.createImageData(d,d);return t.qrToImageData(h.data,a,c),n(N,M,d),N.putImageData(h,0,0),M},e.renderToDataURL=function(a,s,l){let c=l;typeof c>"u"&&(!s||!s.getContext)&&(c=s,s=void 0),c||(c={});const M=e.render(a,s,c),d=c.type||"image/png",N=c.rendererOpts||{};return M.toDataURL(d,N.quality)}}(yf);var If={};const NH=Pg;function ff(e,t){const n=e.a/255,i=t+'="'+e.hex+'"';return n<1?i+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function Hg(e,t,n){let i=e+t;return typeof n<"u"&&(i+=" "+n),i}function hH(e,t,n){let i="",o=0,a=!1,s=0;for(let l=0;l<e.length;l++){const c=Math.floor(l%t),M=Math.floor(l/t);!c&&!a&&(a=!0),e[l]?(s++,l>0&&c>0&&e[l-1]||(i+=a?Hg("M",c+n,.5+M+n):Hg("m",o,0),o=0,a=!1),c+1<t&&e[l+1]||(i+=Hg("h",s),s=0)):o++}return i}If.render=function(t,n,i){const o=NH.getOptions(n),a=t.modules.size,s=t.modules.data,l=a+o.margin*2,c=o.color.light.a?"<path "+ff(o.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",M="<path "+ff(o.color.dark,"stroke")+' d="'+hH(s,a,o.margin)+'"/>',d='viewBox="0 0 '+l+" "+l+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+d+' shape-rendering="crispEdges">'+c+M+`</svg>
|
|
493
493
|
`;return typeof i=="function"&&i(null,h),h};const EH=CP,Jg=rf,pf=yf,TH=If;function Wg(e,t,n,i,o){const a=[].slice.call(arguments,1),s=a.length,l=typeof a[s-1]=="function";if(!l&&!EH())throw new Error("Callback required as last argument");if(l){if(s<2)throw new Error("Too few arguments provided");s===2?(o=n,n=t,t=i=void 0):s===3&&(t.getContext&&typeof o>"u"?(o=i,i=void 0):(o=i,i=n,n=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=t,t=i=void 0):s===2&&!t.getContext&&(i=n,n=t,t=void 0),new Promise(function(c,M){try{const d=Jg.create(n,i);c(e(d,t,i))}catch(d){M(d)}})}try{const c=Jg.create(n,i);o(null,e(c,t,i))}catch(c){o(c)}}Ds.create=Jg.create,Ds.toCanvas=Wg.bind(null,pf.render),Ds.toDataURL=Wg.bind(null,pf.renderToDataURL),Ds.toString=Wg.bind(null,function(e,t,n){return TH.render(e,n)});const yH={key:0,class:"text-body-medium !tracking-[0.28px] user-select-none py-1 px-3 inline-block min-w-4 leading-[17px]","data-ts-section":"inputresizer"},hM=r.defineComponent({__name:"InputNumber",props:{modelValue:{},value:{},label:{},min:{},max:{},maxDigit:{default:16},padStart:{default:0},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},validatorMessage:{},showValidatorMessage:{type:Boolean,default:!0},placeholder:{},disabled:{type:Boolean},invalid:{type:Boolean},showButtons:{type:Boolean},size:{},mode:{},currency:{},locale:{},minFractionDigits:{},useGrouping:{type:Boolean},fieldInfo:{},addonLeftClass:{},inputGroupClass:{},inputNumberClass:{},inputId:{},autoResize:{type:Boolean}},emits:["update:modelValue","input"],setup(e,{emit:t}){const n=e,i=t,o=r.ref(0),a=r.reactive({value:n.value??n.modelValue}),s=r.computed(()=>n.placeholder??`Enter ${n.label?n.label.toLowerCase():"number"}`);r.onMounted(()=>{n.useValidator&&(Object.assign(a,Pn(n.fieldName??"numberInput",T=>M(T))),n.value!=null&&(a.value=n.value))});const l=r.computed(()=>n.invalid||!!a.errorMessage),c=r.computed(()=>n.inputId?n.inputId:(n.label??n.fieldName??"input-number").toLowerCase().trim().replaceAll(" ","-")+"-inputnumber"),M=async T=>(await r.nextTick(),n.invalid&&n.validatorMessage?n.validatorMessage:!T&&n.mandatory?`${n.label} must not be empty`:!0),d=(T,y)=>{const I=y==="input"?T.value:T;let f=I!=null?I!=="-"?+I:I:void 0;if(f!=null&&!isNaN(+f)){f=I!=null?+I:void 0;const w=typeof f=="number"?N(f):!1;let p=f==null?void 0:f.toString().slice(0,f<0?n.maxDigit+1:n.maxDigit);p!=null&&(p=+p),a.value=w?p:f,w&&o.value++,i(y==="input"?"input":"update:modelValue",w?p:f)}else f==null&&(a.value=f,i(y==="input"?"input":"update:modelValue",void 0))},N=T=>T!=null&&T.toString().length>(n.maxDigit>16?16:n.maxDigit),h=()=>{d(+(a.value??0)+1,"modelValue")},g=()=>{d(+(a.value??0)-1,"modelValue")};return r.watch(()=>n.value,T=>{N(T)||(a.value=T)},{once:!0}),r.watch(()=>n.modelValue,T=>{N(T)||(a.value=T)}),(T,y)=>(r.openBlock(),r.createBlock(Er,{info:T.fieldInfo,label:n.label,mandatory:n.mandatory},{default:r.withCtx(()=>[r.createVNode(Li,{class:r.normalizeClass(["grid ",{"grid-cols-[max-content,1fr,max-content]":T.$slots["addon-left"]&&T.$slots["addon-right"]||T.showButtons,"grid-cols-[1fr,max-content]":!T.$slots["addon-left"]&&T.$slots["addon-right"],"grid-cols-[max-content,1fr]":T.$slots["addon-left"]&&!T.$slots["addon-right"]},{"w-max":T.autoResize},T.inputGroupClass]),disabled:n.disabled,invalid:l.value},{default:r.withCtx(()=>[T.$slots["addon-left"]||n.showButtons?(r.openBlock(),r.createBlock(r.unref(Oa),{key:0,class:r.normalizeClass([{"!px-2":n.showButtons},T.addonLeftClass]),disabled:T.disabled},{default:r.withCtx(()=>[r.renderSlot(T.$slots,"addon-left",{},()=>[r.createVNode(r.unref(He),{onClick:g,class:"!text-base text-general-500",icon:"subtract"})])]),_:3},8,["class","disabled"])):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["relative",{"w-max":T.autoResize}]),"data-ts-section":"autoresizeinputwrapper"},[T.autoResize?(r.openBlock(),r.createElementBlock("span",yH,r.toDisplayString((a.value??"").toString().padStart(T.padStart,"0")),1)):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(hs),r.mergeProps({key:o.value},T.$props,{class:[T.inputNumberClass,{"absolute left-0 top-0 !text-transparent caret-general-800":T.autoResize}],"input-id":c.value,"model-value":a.value,placeholder:T.autoResize?"":s.value,"show-buttons":!1,onInput:y[0]||(y[0]=I=>d(I,"input")),"onUpdate:modelValue":y[1]||(y[1]=I=>d(I,"modelValue"))}),null,16,["class","input-id","model-value","placeholder"]))],2),T.$slots["addon-right"]||n.showButtons?(r.openBlock(),r.createBlock(r.unref(Oa),{key:1,class:r.normalizeClass({"!text-general-200 !dark:text-general-200":n.disabled,"!px-2":n.showButtons})},{default:r.withCtx(()=>[r.renderSlot(T.$slots,"addon-right",{},()=>[r.createVNode(r.unref(He),{onClick:h,class:"!text-base text-general-500",icon:"add-line"})])]),_:3},8,["class"])):r.createCommentVNode("",!0)]),_:3},8,["class","disabled","invalid"]),n.showValidatorMessage?(r.openBlock(),r.createBlock(er,{key:0,message:a.errorMessage??n.validatorMessage},null,8,["message"])):r.createCommentVNode("",!0)]),_:3},8,["info","label","mandatory"]))}}),IH=({headers:e={},params:t={}}={})=>{const n=JSON.parse(localStorage.getItem("user")??"{}"),i="https://dev-api-tag.tagsamurai.com";return jn.create({baseURL:`${i}/v2/qr`,headers:{"Content-type":"application/json",Authorization:`Bearer ${n.token}`,...e},params:t})},fH={createQr:e=>{const t={amount:e};return IH().post("/",t)}},EM=e=>(r.pushScopeId("data-v-349deb23"),e=e(),r.popScopeId(),e),pH={key:0,class:""},mH={class:"flex items-center gap-1"},DH=EM(()=>r.createElementVNode("label",null,"Preview",-1)),wH={class:"flex flex-col gap-3 w-fit mx-auto"},jH={class:"grid grid-cols-2 gap-x-[15px] gap-y-3"},BH=["src"],LH={key:1,class:"box",style:{border:"1px solid #000"}},xH=["src"],CH={class:"code-container",style:{overflow:"hidden"}},zH=EM(()=>r.createElementVNode("div",{class:"text-code"},"Q*2D1AB4",-1)),QH=["src"],SH=["src"],kH={key:1,class:"box",style:{border:"1px solid #000"}},UH=["src"],bH={class:"code-container",style:{overflow:"hidden"}},OH=EM(()=>r.createElementVNode("div",{class:"text-code"},"Q*2D1AB4",-1)),YH=["src"],FH=EM(()=>r.createElementVNode("div",{class:"mt-3 flex w-100 h-[26px] bg-general-800 text-white text-xs font-medium justify-center items-center"}," Printer Side ",-1)),RH={class:"flex w-100 justify-between items-center"},_H={class:"",style:{"font-weight":"300","font-size":"11.2px"}},vH={style:{position:"absolute",left:"99999999999999px"}},VH={id:"print-container",class:"flex flex-col gap-3 w-fit mx-auto",style:{display:"flex","flex-direction":"column",gap:"0.75rem",width:"fit-content","margin-left":"auto","margin-right":"auto"}},GH={class:"grid grid-cols-2 gap-x-[30px] gap-y-3",style:{display:"grid","grid-template-columns":"repeat(2, minmax(0, 1fr))","column-gap":"30px","row-gap":"0.75rem",height:"87px",width:"197px"}},PH={key:0,class:"box",style:{transform:"translateX(-7px)",padding:"0"}},HH=["src"],JH={class:"",style:{width:"100%",height:"100%",position:"relative",display:"flex","justify-content":"end","align-items":"end",overflow:"hidden"}},WH={class:"text-code",style:{transform:"rotate(-90deg) translateX(5px) translateY(8px)","z-index":"999999"}},ZH=["src"],XH=r.defineComponent({__name:"DialogPrintQR",props:{visible:{type:Boolean}},emits:["printed","update:visible"],setup(e,{emit:t}){const{setLoading:n}=ri(),i=zn(),o=r.getCurrentInstance(),a=o==null?void 0:o.appContext.config.globalProperties.$htmlToPaper;r.onMounted(async()=>{h.value=await Ds.toDataURL(N.value)});const s=e,l=t,c=r.ref(),M=r.ref([{label:"Left (Default)",value:"left"},{label:"Right",value:"right"}]),d=r.ref("left"),N=r.ref("Q*2D1AB4"),h=r.ref(""),g=r.ref([]),T=r.computed(()=>s.visible),y=r.computed(()=>"https://assets.tagsamurai.com/img/ts-full-horizontal.png"),I=r.computed(()=>"https://assets.tagsamurai.com/img/not-printed.png"),f=r.computed(()=>!c.value||c.value<1),w=r.computed(()=>d.value==="left"?c.value&&c.value>2?4:2:c.value&&c.value>=2?4:2),p=async()=>{try{if(f.value)return;n(!0);const{data:S}=await fH.createQr(c.value);if(S){const B=S.data;for(const L of B){const j=L,_={code:j,url:await Ds.toDataURL(j)};g.value.push(_)}setTimeout(()=>{D()},1e3)}}catch(S){i.add({error:S,message:"Error, failed to generate QR"})}finally{n(!1)}},D=async()=>{await a("print-container",{styles:["https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap","https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap","https://fonts.googleapis.com","https://fonts.gstatic.com","https://assets.tagsamurai.com/css/custom-paper.css","https://assets.tagsamurai.com/css/print-qr.css"],timeout:1e3,autoClose:!0}),l("printed"),C()},C=()=>l("update:visible",!1);return r.watch(T,()=>{c.value=void 0,d.value="left",g.value=[]}),(S,B)=>(r.openBlock(),r.createBlock(r.unref(yo),{visible:T.value,"onUpdate:visible":[B[3]||(B[3]=L=>T.value=L),B[4]||(B[4]=L=>l("update:visible",!!L))],draggable:!1,pt:{root:{class:[...r.unref(Ut).root({state:{}}).class,"!w-[400px]"]},header:{class:r.unref(Ut).header.class},content:{class:r.unref(Ut).content({state:{},instance:{}}).class},footer:{class:r.unref(Ut).footer.class}},closable:"","data-ts-name":"dialog-asset-name-detail",header:"Print Label QR",modal:""},{default:r.withCtx(()=>[r.createVNode(hM,{modelValue:c.value,"onUpdate:modelValue":B[0]||(B[0]=L=>c.value=L),onInput:B[1]||(B[1]=L=>c.value=L),label:"Amount",mandatory:"",placeholder:"Input amount of label"},null,8,["modelValue"]),r.createVNode(ds,{modelValue:d.value,"onUpdate:modelValue":B[2]||(B[2]=L=>d.value=L),options:M.value,label:"Start Print From","option-label":"label","option-value":"value"},null,8,["modelValue","options"]),f.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",pH,[r.createElementVNode("div",mH,[DH,r.createVNode(He,{icon:"info",info:`This preview is only for showing the side of the\r
|
|
494
494
|
label that printed or not. It does not show the\r
|
|
495
|
-
exact amount you entered.`,severity:"primary"})]),r.createElementVNode("div",wH,[r.createElementVNode("div",jH,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,L=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:L},[d.value==="left"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[c.value<L?(r.openBlock(),r.createElementBlock("img",{key:0,src:I.value,alt:""},null,8,BH)):(r.openBlock(),r.createElementBlock("div",LH,[r.createElementVNode("img",{src:y.value,alt:"",class:"logo"},null,8,xH),r.createElementVNode("div",CH,[zH,r.createElementVNode("img",{src:h.value,alt:"",class:"qr-code",style:{"margin-bottom":"-5px","margin-right":"-10px"}},null,8,QH)])]))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[L===1||c.value<L-1?(r.openBlock(),r.createElementBlock("img",{key:0,src:I.value,alt:""},null,8,SH)):(r.openBlock(),r.createElementBlock("div",kH,[r.createElementVNode("img",{src:y.value,alt:"",class:"logo"},null,8,UH),r.createElementVNode("div",bH,[OH,r.createElementVNode("img",{src:h.value,alt:"",class:"qr-code",style:{"margin-bottom":"-5px","margin-right":"-10px"}},null,8,YH)])]))],64))],64))),128))])]),FH])),r.createElementVNode("div",RH,[r.createElementVNode("div",_H," Label: "+r.toDisplayString(c.value||0)+" pcs ",1),r.createVNode(tt,{disabled:!c.value||c.value<0,onClick:p,label:"Start Print"},null,8,["disabled"])]),r.createElementVNode("div",vH,[r.createElementVNode("div",VH,[r.createElementVNode("div",GH,[d.value==="right"?(r.openBlock(),r.createElementBlock("div",PH)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.value,(L,j)=>(r.openBlock(),r.createElementBlock("div",{key:j,class:"box",style:{transform:"translateX(-7px)",padding:"0"}},[r.createElementVNode("img",{src:y.value,alt:"",class:"logo",style:{transform:"translateY(10px)","z-index":"999999"}},null,8,HH),r.createElementVNode("div",JH,[r.createElementVNode("div",WH,r.toDisplayString(r.unref(FB)(L.code)),1),r.createElementVNode("img",{src:L.url,alt:"",class:"qr-code",style:{transform:"translateX(-10px)"}},null,8,ZH)])]))),128))])])])]),_:1},8,["visible","pt"]))}}),Bxe="",mf=Fl(XH,[["__scopeId","data-v-349deb23"]]),KH=({headers:e={},params:t={}}={})=>{const n=JSON.parse(localStorage.getItem("user")??"{}"),i="https://dev-api-damage.tagsamurai.com";return jn.create({baseURL:`${i}/v2`,headers:{Authorization:`Bearer ${n.token}`,...e},params:t})},qH={reportDamage:(e,t)=>KH({headers:{"Content-Type":"multipart/form-data"}}).put(`/report-damage/${e}`,t)},$H={class:"font-bold"},eJ=r.createElementVNode("p",null,"Are you sure want to continue?",-1),tJ={class:"flex flex-col gap-3"},nJ={key:0,class:"flex flex-col gap-3"},rJ={key:0,class:"flex items-center gap-3"},iJ={class:"flex"},aJ={key:0,class:"flex mr-1"},Df=r.defineComponent({__name:"DialogReportDamage",props:{id:{},reportSource:{},visible:{type:Boolean},byUser:{type:Boolean},successMessage:{},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(e,{emit:t}){const{setLoading:n}=ri(),i=zn(),o=e,a=t,s=r.computed(()=>o.visible),l=r.computed(()=>{var f,w,p,D;return((w=(f=M.value)==null?void 0:f.asset)==null?void 0:w.rfid)||((D=(p=M.value)==null?void 0:p.asset)==null?void 0:D.qr)}),c=r.ref(),M=r.ref(),d=r.ref(!1),N=r.ref(!1),h=r.ref(),g=async f=>{try{n(!0);const w={notes:f.formValues.notes,image:f.formValues.image,reportSource:o.reportSource,serialNumber:h.value},p="Success, damaged asset report has been submitted.";if(o.submitFunction)await o.submitFunction(w)&&(i.add({message:o.successMessage??p}),a("reported"),I());else{const{data:D}=await qH.reportDamage(o.id,w);D&&(i.add({message:o.successMessage??p}),a("reported"),I())}}catch(w){i.add({error:w,message:"Error, failed to report damaged asset."})}finally{n(!1)}},T=async f=>{var w;try{n(!0);const{data:p}=await Ei.matchAssetWithTag(o.id,f);(w=p==null?void 0:p.data)!=null&&w.totalRecords?N.value=!0:N.value=!1}catch(p){i.add({error:p,message:"Error, failed to verify. TAG doesn't match."})}finally{n(!1)}},y=()=>{d.value=!0,I()},I=()=>{a("update:visible",!1)};return r.watch(s,()=>{N.value=!!o.byUser,h.value=void 0}),r.watch(N,f=>{var w;f||(w=c.value.form)==null||w.clearField()}),(f,w)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(pc),{ref_key:"dialogForm",ref:c,visible:s.value,"onUpdate:visible":w[2]||(w[2]=p=>s.value=p),"reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:I,action:"Submit",closable:"","data-ts-name":"report-damage",header:"Report Damage",width:"large"},{confirm:r.withCtx(p=>[r.createVNode(r.unref(vr),{visible:p.visible,onConfirm:D=>p.submit(g),"onUpdate:visible":D=>!D&&p.hide(),body:"Are you sure want to continue?","confirm-label":"Continue","data-ts-section":"confirm-dialog",header:"Report Damaged Asset",severity:"danger"},{body:r.withCtx(()=>{var D,C,S;return[r.createElementVNode("p",null,[r.createElementVNode("span",$H,r.toDisplayString(((S=(C=(D=M.value)==null?void 0:D.asset)==null?void 0:C.name)==null?void 0:S.nameWithSequence)??"-"),1),r.createTextVNode(" will be reported as damaged asset. ")]),eJ]}),_:2},1032,["visible","onConfirm","onUpdate:visible"])]),fields:r.withCtx(()=>{var p,D,C,S,B;return[r.createElementVNode("div",tJ,[r.createVNode(r.unref(cs),{id:o.id,ref_key:"assetInfo",ref:M},null,8,["id"]),(p=M.value)!=null&&p.asset?(r.openBlock(),r.createElementBlock("div",nJ,[!o.byUser&&l.value?(r.openBlock(),r.createElementBlock("div",rJ,[r.createElementVNode("div",iJ,[(C=(D=M.value)==null?void 0:D.asset)!=null&&C.rfid?(r.openBlock(),r.createElementBlock("div",aJ,[r.createVNode(r.unref(Ya),{onConnected:w[0]||(w[0]=L=>h.value=(L==null?void 0:L.serialNumber)??""),onScan:T}),r.createVNode(r.unref(He),{class:"w-[13.33px] h-[13.33px]",icon:"info",info:"Use short range scanner to verify asset",severity:"primary"})])):r.createCommentVNode("",!0),(B=(S=M.value)==null?void 0:S.asset)!=null&&B.qr?(r.openBlock(),r.createBlock(r.unref(Ya),{key:1,onConnected:w[1]||(w[1]=L=>h.value=(L==null?void 0:L.serialNumber)??""),onScan:T,type:"QR"})):r.createCommentVNode("",!0)]),r.createVNode(r.unref(Ct),{label:N.value?"Verified":"Unverified",severity:N.value?"success":"warning"},null,8,["label","severity"]),N.value?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(r.unref(tt),{key:0,onClick:y,label:"Report TAG",text:""}))])):r.createCommentVNode("",!0),r.createVNode(r.unref(xc),{"data-ts-section":"condition-input",disabled:"",label:"Condition",mandatory:"","use-validator":"",value:"Damaged"}),r.createVNode(r.unref(E0),{disabled:!N.value&&l.value,"data-ts-section":"photo-input","field-name":"image",label:"Photo",mandatory:"","use-validator":""},null,8,["disabled"]),r.createVNode(r.unref(xs),{"custom-validation":{empty:"Note must not be empty"},disabled:!N.value&&l.value,"max-length":120,rows:3,"data-ts-section":"notes-input","field-name":"notes","input-class":"!min-h-[67px]",label:"Note",mandatory:"",placeholder:"Enter note","use-validator":""},null,8,["disabled"])])):r.createCommentVNode("",!0)])]}),_:1},8,["visible"]),r.createVNode(r.unref(Zg),{id:o.id,visible:d.value,"onUpdate:visible":w[3]||(w[3]=p=>d.value=p),onReported:w[4]||(w[4]=p=>a("reported"))},null,8,["id","visible"])],64))}}),oJ=({headers:e={},params:t={}}={})=>{const n=JSON.parse(localStorage.getItem("user")??"{}"),i="https://dev-api-missing.tagsamurai.com";return jn.create({baseURL:`${i}/v2`,headers:{"Content-type":"application/json",Authorization:`Bearer ${n.token}`,...e},params:t})},sJ={reportMissing:(e,t)=>oJ().put(`/report-missing/${e}`,t)},wf=({headers:e={},params:t={}}={})=>{const n=JSON.parse(localStorage.getItem("user")??"{}"),i="https://dev-api-tracking-v2.tagsamurai.com";return jn.create({baseURL:`${i}/v2/tracking`,headers:{"Content-type":"application/json",Authorization:`Bearer ${n.token}`,...e},params:t})},lJ={reportPermanentlyMissing:(e,t)=>wf().put(`/report-permanently-missing/${e}`,t),getTrackingDetail:e=>wf().get(`/${e}`)},cJ={class:"font-bold"},AJ=r.createElementVNode("p",null,"Are you sure you want to report it?",-1),MJ={class:"flex flex-col gap-3"},jf=r.defineComponent({__name:"DialogReportMissing",props:{id:{},trackingId:{},visible:{type:Boolean},permanentlyMissing:{type:Boolean},successMessage:{},submitWithoutApi:{type:Boolean},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(e,{emit:t}){const{setLoading:n}=ri(),i=zn(),o=e,a=t,s=r.computed(()=>o.visible),l=r.computed(()=>o.permanentlyMissing?"Report Permanently Missing":"Report Missing"),c=r.computed(()=>o.permanentlyMissing?"Report as Permanenly Missing":"Report Missing Asset"),M=r.ref(),d=async N=>{try{n(!0);const h={notes:N.formValues.notes},g=o.permanentlyMissing?"Success, asset has been reported as permanently missing.":"Success, missing asset has been reported.";if(o.submitWithoutApi)i.add({message:o.successMessage??g}),a("reported",h),a("update:visible",!1);else if(o.submitFunction)await o.submitFunction(h)&&(i.add({message:o.successMessage??g}),a("reported"),a("update:visible",!1));else{const{data:T}=o.permanentlyMissing?await lJ.reportPermanentlyMissing(o.trackingId??"",h):await sJ.reportMissing(o.id,h);T&&(i.add({message:o.successMessage??g}),a("reported"),a("update:visible",!1))}}catch(h){const g=o.permanentlyMissing?"Error, failed to report asset as permanently missing.":"Error, failed to report missing asset.";i.add({error:h,message:g})}finally{n(!1)}};return(N,h)=>(r.openBlock(),r.createBlock(r.unref(pc),{visible:s.value,"onUpdate:visible":h[0]||(h[0]=g=>s.value=g),header:l.value,"reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:h[1]||(h[1]=g=>a("update:visible",!1)),action:"Submit",closable:"","data-ts-name":"report-missing",width:"large"},{confirm:r.withCtx(g=>[r.createVNode(r.unref(vr),{header:c.value,visible:g.visible,onConfirm:T=>g.submit(d),"onUpdate:visible":T=>!T&&g.hide(),"confirm-label":"Report","data-ts-section":"confirm-dialog",severity:"danger"},{body:r.withCtx(()=>{var T,y,I;return[r.createElementVNode("p",null,[r.createElementVNode("span",cJ,r.toDisplayString(((I=(y=(T=M.value)==null?void 0:T.asset)==null?void 0:y.name)==null?void 0:I.nameWithSequence)??"-"),1),r.createTextVNode(" will be reported as "+r.toDisplayString(o.permanentlyMissing?"permanently missing asset":"missing asset")+". ",1)]),AJ]}),_:2},1032,["header","visible","onConfirm","onUpdate:visible"])]),fields:r.withCtx(()=>[r.createElementVNode("div",MJ,[(r.openBlock(),r.createBlock(r.unref(cs),{id:o.id,key:o.id,ref_key:"assetInfo",ref:M},null,8,["id"])),r.createVNode(r.unref(xs),{"custom-validation":{empty:"Note must not be empty"},"max-length":120,rows:3,"data-ts-section":"notes-input","field-name":"notes","input-class":"!min-h-[67px]",label:"Note",mandatory:"",placeholder:"Enter note","use-validator":""})])]),_:1},8,["visible","header"]))}}),uJ=({headers:e={},params:t={}}={})=>{const n=JSON.parse(localStorage.getItem("user")??"{}"),i="https://dev-api-tag.tagsamurai.com";return jn.create({baseURL:`${i}/v2/tag-transaction`,headers:{"Content-type":"application/json",Authorization:`Bearer ${n.token}`,...e},params:t})},dJ={reportTag:(e,t)=>uJ().put(`/report/${e}`,t)},gJ={class:"flex flex-col gap-3"},Zg=r.defineComponent({__name:"DialogReportTag",props:{id:{},tagReported:{},visible:{type:Boolean},successMessage:{},submitLabel:{},submitWithoutApi:{type:Boolean},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(e,{emit:t}){const{setLoading:n}=ri(),i=zn(),o=e,a=t,s=r.computed(()=>o.visible),l=r.computed(()=>{var g,T,y,I,f,w,p,D,C,S,B,L,j,_,J,X,ae,ue,oe,ce,ee,pe;const N=(g=o.tagReported)==null?void 0:g.rfid,h=(T=o.tagReported)==null?void 0:T.qr;return[{label:"RFID TAG",value:"RFID",visible:((I=(y=c.value)==null?void 0:y.asset)==null?void 0:I.rfid)&&!N&&!((p=(w=(f=c.value)==null?void 0:f.asset)==null?void 0:w.tagReported)!=null&&p.rfid)},{label:"QR TAG",value:"QR",visible:((C=(D=c.value)==null?void 0:D.asset)==null?void 0:C.qr)&&!h&&!((L=(B=(S=c.value)==null?void 0:S.asset)==null?void 0:B.tagReported)!=null&&L.qr)},{label:"RFID & QR TAG",value:"RFID & QR",visible:((_=(j=c.value)==null?void 0:j.asset)==null?void 0:_.rfid)&&((X=(J=c.value)==null?void 0:J.asset)==null?void 0:X.qr)&&!N&&!((oe=(ue=(ae=c.value)==null?void 0:ae.asset)==null?void 0:ue.tagReported)!=null&&oe.rfid)&&!h&&!((pe=(ee=(ce=c.value)==null?void 0:ce.asset)==null?void 0:ee.tagReported)!=null&&pe.qr)}].filter(re=>re.visible)}),c=r.ref(),M=async N=>{try{n(!0);const g={RFID:{qr:!1,rfid:!0},QR:{qr:!0,rfid:!1},"RFID & QR":{qr:!0,rfid:!0}}[N.formValues.tagType],T="Success, TAG has been reported.";if(o.submitWithoutApi)i.add({message:o.successMessage??T}),a("reported",g),a("update:visible",!1);else if(o.submitFunction)await o.submitFunction(g)&&(i.add({message:o.successMessage??T}),a("reported",g),a("update:visible",!1));else{const{data:y}=await dJ.reportTag(o.id,g);y&&(i.add({message:o.successMessage??T}),a("reported",g),a("update:visible",!1))}}catch(h){i.add({error:h,message:"Error, failed to report TAG."})}finally{n(!1)}},d=r.computed(()=>{var N,h,g,T,y;return((N=l.value)==null?void 0:N.length)>1&&((g=(h=c.value)==null?void 0:h.asset)==null?void 0:g.tagType)==="RFID & QR"?"RFID & QR":(y=(T=l.value)==null?void 0:T[0])==null?void 0:y.value});return(N,h)=>(r.openBlock(),r.createBlock(r.unref(pc),{visible:s.value,"onUpdate:visible":h[0]||(h[0]=g=>s.value=g),"action-label":o.submitLabel??"Submit","reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:h[1]||(h[1]=g=>a("update:visible",!1)),action:"Submit",closable:"","data-ts-name":"report-tag",header:"Report TAG",width:"large"},{confirm:r.withCtx(g=>{var T,y,I;return[r.createVNode(r.unref(vr),{lists:[(I=(y=(T=c.value)==null?void 0:T.asset)==null?void 0:y.name)==null?void 0:I.nameWithSequence],visible:g.visible,onConfirm:f=>g.submit(M),"onUpdate:visible":f=>!f&&g.hide(),body:"Are you sure want to report it?","confirm-label":"Report","data-ts-section":"confirm-dialog",header:"Report TAG",severity:"danger"},null,8,["lists","visible","onConfirm","onUpdate:visible"])]}),fields:r.withCtx(()=>{var g;return[r.createElementVNode("div",gJ,[r.createVNode(r.unref(cs),{id:o.id,ref_key:"assetInfo",ref:c},null,8,["id"]),(g=c.value)!=null&&g.asset?(r.openBlock(),r.createBlock(r.unref(ds),{key:0,disabled:l.value.length<=1,"initial-value":d.value,options:l.value,"data-ts-section":"reported-tag-dropdown","field-info":"Reported TAG will be mark a damaged / missing TAG","field-name":"tagType",label:"Reported TAG",mandatory:"","option-label":"label","option-value":"value",placeholder:"Select TAG","use-validator":""},null,8,["disabled","initial-value","options"])):r.createCommentVNode("",!0)])]}),_:1},8,["visible","action-label"]))}});var NJ={root:function(t){var n=t.instance,i=t.props;return["p-inputtextarea p-inputtext p-component",{"p-filled":n.filled,"p-inputtextarea-resizable ":i.autoResize,"p-invalid":i.invalid,"p-variant-filled":i.variant?i.variant==="filled":n.$primevue.config.inputStyle==="filled"}]}},hJ=wt.extend({name:"textarea",classes:NJ}),EJ={name:"BaseTextarea",extends:ot,props:{modelValue:null,autoResize:Boolean,invalid:{type:Boolean,default:!1},variant:{type:String,default:null}},style:hJ,provide:function(){return{$parentInstance:this}}},Bf={name:"Textarea",extends:EJ,inheritAttrs:!1,emits:["update:modelValue"],mounted:function(){this.$el.offsetParent&&this.autoResize&&this.resize()},updated:function(){this.$el.offsetParent&&this.autoResize&&this.resize()},methods:{resize:function(){this.$el.style.height="auto",this.$el.style.height=this.$el.scrollHeight+"px",parseFloat(this.$el.style.height)>=parseFloat(this.$el.style.maxHeight)?(this.$el.style.overflowY="scroll",this.$el.style.height=this.$el.style.maxHeight):this.$el.style.overflow="hidden"},onInput:function(t){this.autoResize&&this.resize(),this.$emit("update:modelValue",t.target.value)}},computed:{filled:function(){return this.modelValue!=null&&this.modelValue.toString().length>0},ptmParams:function(){return{context:{disabled:this.$attrs.disabled||this.$attrs.disabled===""}}}}},TJ=["value","aria-invalid"];function yJ(e,t,n,i,o,a){return r.openBlock(),r.createElementBlock("textarea",r.mergeProps({class:e.cx("root"),value:e.modelValue,"aria-invalid":e.invalid||void 0,onInput:t[0]||(t[0]=function(){return a.onInput&&a.onInput.apply(a,arguments)})},e.ptmi("root",a.ptmParams)),null,16,TJ)}Bf.render=yJ;const xs=r.defineComponent({__name:"Textarea",props:{modelValue:{},value:{},disabled:{type:Boolean},autoResize:{type:Boolean,default:!0},variant:{},useValidator:{type:Boolean},fieldName:{default:"textareaInput"},mandatory:{type:Boolean},maxLength:{default:void 0},invalid:{type:Boolean},customValidation:{},inputClass:{},placeholder:{},rows:{default:5},label:{},textareaPt:{default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){var d,N;const n=e,i=t;r.onMounted(()=>{l()});const o=r.reactive({value:((d=n.value)==null?void 0:d.trim())??((N=n.modelValue)==null?void 0:N.trim())}),a=r.computed(()=>n.invalid||!!o.errorMessage),s=r.computed(()=>n.placeholder??`Enter ${n.label?n.label.toLowerCase():"text"}`),l=()=>{var h,g;n.useValidator&&(Object.assign(o,Pn(n.fieldName,T=>c(T))),(n.value??n.modelValue)&&(o.value=((h=n.value)==null?void 0:h.trim())??((g=n.modelValue)==null?void 0:g.trim())))},c=h=>{var g,T;return n.validatorMessage&&n.invalid?n.validatorMessage:!h&&n.mandatory?((g=n.customValidation)==null?void 0:g.empty)??n.validatorMessage??`${n.label} must not be empty`:n.maxLength&&((h==null?void 0:h.length)??0)>n.maxLength?((T=n.customValidation)==null?void 0:T.exceed)??"Max. "+n.maxLength+" characters":!0},M=()=>{var h;o.value=(h=o.value)==null?void 0:h.trim(),i("update:modelValue",o.value)};return r.watch(()=>n.value,h=>{o.value=h==null?void 0:h.trim()},{once:!0}),r.watch(()=>n.modelValue,h=>{o.value=h}),(h,g)=>(r.openBlock(),r.createBlock(Er,{info:h.fieldInfo,label:n.label,mandatory:n.mandatory},{default:r.withCtx(()=>[r.createVNode(r.unref(Bf),{modelValue:o.value,"onUpdate:modelValue":[g[0]||(g[0]=T=>o.value=T),g[1]||(g[1]=T=>i("update:modelValue",T))],"auto-resize":h.autoResize,class:r.normalizeClass([{"resize-none":h.autoResize,resize:!h.autoResize},{"!border-danger-500 border:bg-danger-500":a.value},h.inputClass,`min-h-[${h.rows*26}px]`]),disabled:h.disabled,placeholder:s.value,pt:n.textareaPt,rows:n.rows,onBlur:M},null,8,["modelValue","auto-resize","class","disabled","placeholder","pt","rows"]),r.createVNode(er,{message:o.errorMessage},null,8,["message"])]),_:1},8,["info","label","mandatory"]))}}),IJ=r.defineComponent({__name:"DisposalReportBulkAction",props:{selectedData:{default:[]},selectedDataModifiers:{},assetsToReport:{default:[]},assetsToReportModifiers:{}},emits:r.mergeModels(["noted","removed"],["update:selectedData","update:assetsToReport"]),setup(e,{emit:t}){const{t:n}=ca(),i=t,o=r.useModel(e,"selectedData"),a=r.useModel(e,"assetsToReport"),s=r.shallowRef(!1),l=r.shallowRef(),c=[{label:n("Note"),icon:"note",useAdditionSlot:!0,command:()=>{i("noted",o.value,l.value),o.value=[],l.value=void 0}},{label:n("Remove from List"),icon:"delete-bin",danger:!0,command:()=>{s.value=!0}}],M=()=>{a.value=a.value.filter(d=>!o.value.some(N=>N._id===d._id)),i("removed",o.value),o.value=[]};return(d,N)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(Pd),r.mergeProps({"selected-data":o.value,"onUpdate:selectedData":N[1]||(N[1]=h=>o.value=h)},d.$attrs,{options:c,naming:"Asset(s)"}),{addition:r.withCtx(({selectedOption:h})=>[(h==null?void 0:h.label)===r.unref(n)("Note")?(r.openBlock(),r.createBlock(xs,{key:0,modelValue:l.value,"onUpdate:modelValue":N[0]||(N[0]=g=>l.value=g),placeholder:r.unref(n)("Enter note"),rows:1,"textarea-pt":{root:{maxlength:30}},class:"!max-w-[250px]"},null,8,["modelValue","placeholder"])):r.createCommentVNode("",!0)]),_:1},16,["selected-data"]),r.createVNode(r.unref(vr),{visible:s.value,"onUpdate:visible":N[2]||(N[2]=h=>s.value=h),body:r.unref(n)("Are you sure you want to remove it?"),"confirm-label":r.unref(n)("Remove"),header:r.unref(n)("Remove from List"),lists:o.value,onConfirm:M,"list-label":"name.nameWithSequence",severity:"danger"},null,8,["visible","body","confirm-label","header","lists"])],64))}}),fJ=r.defineComponent({__name:"DisposalReportTableFilter",props:{assets:{}},emits:["apply"],setup(e,{emit:t}){const n=e,i=t,o=zn(),{t:a}=ca(),s=r.shallowRef([{label:a("Name"),placeholder:a("Select asset name"),field:"name",type:"multiselect"},{label:a("Brand"),placeholder:a("Select brand"),field:"brand",type:"multiselect"},{label:a("Model/Type"),placeholder:a("Select model/type"),field:"model",type:"multiselect"},{label:a("Group"),field:"group",type:"group"}]),l=r.reactive({}),c=r.shallowRef(n.assets.length),M=r.ref({}),d=r.ref({}),N=async y=>{var f,w,p;const I=y.field+"Options";try{d.value[I]=!0;const D=n.assets.map(C=>C._id??"");if(D.length!==c.value||!((w=(f=M.value)==null?void 0:f[I])!=null&&w.length)){c.value=D.length;const C={_id:JSON.stringify(D),[I]:!0},{data:S}=await Ei.getOptions("by-id",C);M.value[I]=(p=S.data)==null?void 0:p[I]}}catch(D){console.error(D),o.add({error:D,message:"Error, failed to get filter option."})}finally{d.value[I]=!1}},h=()=>({"name.key":{value:l.name,matchMode:Nn.IN},"brand.key":{value:l.brand,matchMode:Nn.IN},"model.key":{value:l.model,matchMode:Nn.IN},"group.key":{value:l.group,matchMode:Nn.IN}}),g=()=>{const y=h();i("apply",y)},T=()=>{Object.keys(l).forEach(I=>delete l[I])};return(y,I)=>(r.openBlock(),r.createBlock(r.unref(Is),{onApply:g,onClear:T,class:"!gap-x-3 !gap-y-4 !p-3","data-ts-name":"diposalreportfilter"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,f=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f.field},[f.type==="multiselect"?(r.openBlock(),r.createBlock(r.unref(Aa),r.mergeProps({key:0,ref_for:!0},f,{modelValue:l[f.field],"onUpdate:modelValue":w=>l[f.field]=w,loading:d.value[f.field+"Options"],options:M.value[f.field+"Options"],onShow:w=>N(f),"option-label":"label","option-value":"value"}),null,16,["modelValue","onUpdate:modelValue","loading","options","onShow"])):f.type==="group"?(r.openBlock(),r.createBlock(r.unref(nc),{key:1,keys:l.group,"onUpdate:keys":I[0]||(I[0]=w=>l.group=w),"field-label":f.label,type:"Group"},null,8,["keys","field-label"])):r.createCommentVNode("",!0)],64))),128))]),_:1}))}}),pJ={class:"flex flex-col gap-2","data-ts-section":"disposalreporttablewrapper"},mJ={class:"flex gap-1"},DJ={class:"flex gap-1 justify-end"},wJ=r.defineComponent({__name:"DisposalReportTable",props:{tableName:{},useOption:{type:Boolean},childrenColumns:{},childrenUseOption:{type:Boolean},childrenOptions:{},childrenDataKey:{},childrenFilters:{},data:{},disableKey:{},disableAllRows:{type:Boolean},search:{},tag:{},defaultQueryParams:{},fetchFunction:{type:Function},rows:{},isSelectedAll:{type:Boolean},filters:{},lazy:{type:Boolean},loading:{type:Boolean},selectionType:{},useSelection:{type:Boolean},selectedData:{},expandedRows:{},usePaginator:{type:Boolean},options:{},singleSelect:{type:Boolean},customColumn:{type:Boolean},scrollHeight:{},globalFilterFields:{},totalDisabledRows:{},router:{},reason:{}},setup(e){const t=e;r.onMounted(()=>{I()});const n=zn(),{t:i}=ca(),{setLoading:o}=ri(),a=r.shallowRef(),s=r.shallowRef(!1),l=r.shallowRef(),c=r.shallowRef(!1),M=r.shallowRef(!1),d=r.shallowRef([]),N=r.shallowRef(0),h=r.shallowRef([]),g=r.shallowRef({}),T=r.ref(new Map),y=[{field:"assetImageSmall",header:"Photo",style:"min-width: 72px",fixed:!0,sortable:!0,excluded:!0,bodyComponent:B=>({component:Ci,props:{thumbnail:B.assetImageSmall,preview:B.assetImageBig,description:"asset-report-photo",style:"width: 28px; height: 28px;"}})},{header:"Name",field:"name.nameWithSequence",sortable:!0,fixed:!0,bodyTemplate:B=>{var L;return((L=B.name)==null?void 0:L.nameWithSequence)??"-"}},{header:"Brand",field:"brand.name",sortable:!0,fixed:!1,bodyComponent:B=>{var L;return{component:Ct,props:{label:(L=B.brand)==null?void 0:L.name,severity:"dark",format:"nowrap"}}}},{header:"Model/Type",field:"model.name",sortable:!0,fixed:!1,bodyComponent:B=>{var L;return{component:Ct,props:{label:(L=B.model)==null?void 0:L.name,severity:"dark",format:"nowrap"}}}},{header:"Group",field:"group.name",sortable:!0,fixed:!1,bodyComponent:B=>{var L;return{component:Ct,props:{label:(L=B.group)==null?void 0:L.name,format:"nowrap"}}}},{header:"Note",field:"note",fixed:!0,bodyComponent:B=>({component:xs,props:{modelValue:T.value.get(B._id??"assetId"),placeholder:i("Enter note"),rows:1,textareaPt:{root:{maxlength:30}}},events:{"update:modelValue":L=>{T.value.set(B._id??"assetId",L)}}})}],I=async()=>{try{o(!0);const B=sessionStorage.getItem("assetsDisposalReport")??"[]",{data:L}=await Ei.getAssetsById(B,{});L.data.data.forEach(j=>{T.value.set(j._id??"",null)}),d.value=L.data.data,N.value=L.data.totalRecords}catch(B){console.error(B),n.add({error:B,message:"Error, failed to get assets. "})}finally{o(!1)}},f=[{label:i("Remove from List"),icon:"delete-bin",danger:!0,command:()=>{c.value=!0}}],w=()=>{d.value=d.value.filter(B=>B._id!==g.value._id),p([g.value]),g.value={}},p=B=>{B.forEach(L=>{T.value.delete(L._id??"")}),h.value=[],d.value.length||C(),n.add({message:i("Success, asset has been removed from the list."),severity:"success"})},D=(B,L)=>{B.forEach(j=>{T.value.set(j._id??"",L??null)})},C=()=>{const B=window.location.pathname,L=B.slice(0,B.lastIndexOf("/"));t.router.replace(L),sessionStorage.removeItem("assetsDisposalReport")},S=async()=>{const B=[];T.value.forEach((L,j)=>{const _={asset:j,notes:L,reason:t.reason};B.push(_)});try{o(!0),await PN.postReportDisposal({data:B}),n.add({message:i("Success, disposal report has been submitted.")}),C()}catch(L){console.error(L),n.add({error:L,message:i("Error, failed to submit disposal report.")})}finally{o(!1)}};return(B,L)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",pJ,[r.createElementVNode("div",mJ,[r.createVNode(IJ,{"assets-to-report":d.value,"onUpdate:assetsToReport":L[0]||(L[0]=j=>d.value=j),"selected-data":h.value,"onUpdate:selectedData":L[1]||(L[1]=j=>h.value=j),onNoted:D,onRemoved:p,class:"mr-auto"},null,8,["assets-to-report","selected-data"]),r.createVNode(r.unref(gs),{onSearch:L[2]||(L[2]=j=>a.value=j)}),r.createVNode(r.unref(As),{"show-filter":s.value,"onUpdate:showFilter":L[3]||(L[3]=j=>s.value=j)},null,8,["show-filter"])]),r.withDirectives(r.createVNode(fJ,{assets:d.value,onApply:L[4]||(L[4]=j=>l.value=j)},null,8,["assets"]),[[r.vShow,s.value]]),r.createVNode(r.unref(ys),r.mergeProps(B.$props,{"selected-data":h.value,"onUpdate:selectedData":L[5]||(L[5]=j=>h.value=j),columns:y,data:d.value,filters:l.value,options:f,rows:10,search:a.value,"total-records":N.value,onToggleOption:L[6]||(L[6]=j=>g.value=j),"custom-column":"","data-key":"_id","rounded-header":"","selection-type":"checkbox","use-option":"","use-paginator":""}),null,16,["selected-data","data","filters","search","total-records"])]),r.createVNode(r.unref(vr),{visible:c.value,"onUpdate:visible":L[7]||(L[7]=j=>c.value=j),body:r.unref(i)("Are you sure you want to remove it?"),"confirm-label":r.unref(i)("Remove"),header:r.unref(i)("Remove from List"),lists:[g.value],onConfirm:w,"list-label":"name.nameWithSequence",severity:"danger"},null,8,["visible","body","confirm-label","header","lists"]),r.createVNode(r.unref(vr),{visible:M.value,"onUpdate:visible":L[8]||(L[8]=j=>M.value=j),"confirm-label":r.unref(i)("Continue"),header:r.unref(i)("Cancel Report"),onConfirm:C,severity:"danger"},{body:r.withCtx(()=>[r.createElementVNode("p",null,r.toDisplayString(r.unref(i)("This action will cancel the disposal report.")),1),r.createElementVNode("p",null,r.toDisplayString(r.unref(i)("Are you sure you want to continue?")),1)]),_:1},8,["visible","confirm-label","header"]),r.createElementVNode("div",DJ,[r.createVNode(r.unref(tt),{label:r.unref(i)("Cancel"),onClick:L[9]||(L[9]=j=>M.value=!0),severity:"dark",text:""},null,8,["label"]),r.createVNode(r.unref(tt),{label:r.unref(i)("Submit"),onClick:S,severity:"success"},null,8,["label"])])],64))}}),jJ={class:"flex flex-col gap-3","data-ts-name":"disposalreport"},BJ={class:"text-general-800 font-bold text-base leading-[21.86px] tracking-[0.02em]","data-ts-section":"pagetitle"},Lf=r.defineComponent({__name:"DisposalReport",props:{router:{},reason:{}},setup(e){const{t}=ca();return(n,i)=>(r.openBlock(),r.createBlock(r.unref(Sg),null,{content:r.withCtx(()=>[r.createElementVNode("div",jJ,[r.createElementVNode("h2",BJ,r.toDisplayString(r.unref(t)("Asset Disposal")),1),r.createVNode(wJ,r.normalizeProps(r.guardReactiveProps(n.$props)),null,16)])]),_:1}))}});var xf={name:"UploadIcon",extends:jt},LJ=r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.58942 9.82197C6.70165 9.93405 6.85328 9.99793 7.012 10C7.17071 9.99793 7.32234 9.93405 7.43458 9.82197C7.54681 9.7099 7.61079 9.55849 7.61286 9.4V2.04798L9.79204 4.22402C9.84752 4.28011 9.91365 4.32457 9.98657 4.35479C10.0595 4.38502 10.1377 4.40039 10.2167 4.40002C10.2956 4.40039 10.3738 4.38502 10.4467 4.35479C10.5197 4.32457 10.5858 4.28011 10.6413 4.22402C10.7538 4.11152 10.817 3.95902 10.817 3.80002C10.817 3.64102 10.7538 3.48852 10.6413 3.37602L7.45127 0.190618C7.44656 0.185584 7.44176 0.180622 7.43687 0.175736C7.32419 0.063214 7.17136 0 7.012 0C6.85264 0 6.69981 0.063214 6.58712 0.175736C6.58181 0.181045 6.5766 0.186443 6.5715 0.191927L3.38282 3.37602C3.27669 3.48976 3.2189 3.6402 3.22165 3.79564C3.2244 3.95108 3.28746 4.09939 3.39755 4.20932C3.50764 4.31925 3.65616 4.38222 3.81182 4.38496C3.96749 4.3877 4.11814 4.33001 4.23204 4.22402L6.41113 2.04807V9.4C6.41321 9.55849 6.47718 9.7099 6.58942 9.82197ZM11.9952 14H2.02883C1.751 13.9887 1.47813 13.9228 1.22584 13.8061C0.973545 13.6894 0.746779 13.5241 0.558517 13.3197C0.370254 13.1154 0.22419 12.876 0.128681 12.6152C0.0331723 12.3545 -0.00990605 12.0775 0.0019109 11.8V9.40005C0.0019109 9.24092 0.065216 9.08831 0.1779 8.97579C0.290584 8.86326 0.443416 8.80005 0.602775 8.80005C0.762134 8.80005 0.914966 8.86326 1.02765 8.97579C1.14033 9.08831 1.20364 9.24092 1.20364 9.40005V11.8C1.18295 12.0376 1.25463 12.274 1.40379 12.4602C1.55296 12.6463 1.76817 12.7681 2.00479 12.8H11.9952C12.2318 12.7681 12.447 12.6463 12.5962 12.4602C12.7453 12.274 12.817 12.0376 12.7963 11.8V9.40005C12.7963 9.24092 12.8596 9.08831 12.9723 8.97579C13.085 8.86326 13.2378 8.80005 13.3972 8.80005C13.5565 8.80005 13.7094 8.86326 13.8221 8.97579C13.9347 9.08831 13.998 9.24092 13.998 9.40005V11.8C14.022 12.3563 13.8251 12.8996 13.45 13.3116C13.0749 13.7236 12.552 13.971 11.9952 14Z",fill:"currentColor"},null,-1),xJ=[LJ];function CJ(e,t,n,i,o,a){return r.openBlock(),r.createElementBlock("svg",r.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),xJ,16)}xf.render=CJ;var zJ={root:function(t){var n=t.props;return"p-message p-component p-message-"+n.severity},wrapper:"p-message-wrapper",icon:"p-message-icon",text:"p-message-text",closeButton:"p-message-close p-link",closeIcon:"p-message-close-icon"},QJ=wt.extend({name:"message",classes:zJ}),SJ={name:"BaseMessage",extends:ot,props:{severity:{type:String,default:"info"},closable:{type:Boolean,default:!0},sticky:{type:Boolean,default:!0},life:{type:Number,default:3e3},icon:{type:String,default:void 0},closeIcon:{type:String,default:void 0},closeButtonProps:{type:null,default:null}},style:QJ,provide:function(){return{$parentInstance:this}}},Cf={name:"Message",extends:SJ,inheritAttrs:!1,emits:["close","life-end"],timeout:null,data:function(){return{visible:!0}},watch:{sticky:function(t){t||this.closeAfterDelay()}},mounted:function(){this.sticky||this.closeAfterDelay()},methods:{close:function(t){this.visible=!1,this.$emit("close",t)},closeAfterDelay:function(){var t=this;setTimeout(function(){t.visible=!1,t.$emit("life-end")},this.life)}},computed:{iconComponent:function(){return{info:us,success:Lr,warn:Ms,error:Io}[this.severity]},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{ripple:kn},components:{TimesIcon:ii,InfoCircleIcon:us,CheckIcon:Lr,ExclamationTriangleIcon:Ms,TimesCircleIcon:Io}};function jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function zf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function Lo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zf(Object(n),!0).forEach(function(i){kJ(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zf(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function kJ(e,t,n){return t=UJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UJ(e){var t=bJ(e,"string");return jc(t)=="symbol"?t:String(t)}function bJ(e,t){if(jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||"default");if(jc(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var OJ=["aria-label"];function YJ(e,t,n,i,o,a){var s=r.resolveComponent("TimesIcon"),l=r.resolveDirective("ripple");return r.openBlock(),r.createBlock(r.Transition,r.mergeProps({name:"p-message",appear:""},e.ptmi("transition")),{default:r.withCtx(function(){return[r.withDirectives(r.createElementVNode("div",r.mergeProps({class:e.cx("root"),role:"alert","aria-live":"assertive","aria-atomic":"true"},e.ptm("root")),[e.$slots.container?r.renderSlot(e.$slots,"container",{key:0,onClose:a.close,closeCallback:a.close}):(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:1,class:e.cx("wrapper")},e.ptm("wrapper")),[r.renderSlot(e.$slots,"messageicon",{class:"p-message-icon"},function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.icon?"span":a.iconComponent),r.mergeProps({class:[e.cx("icon"),e.icon]},e.ptm("icon")),null,16,["class"]))]}),r.createElementVNode("div",r.mergeProps({class:["p-message-text",e.cx("text")]},e.ptm("text")),[r.renderSlot(e.$slots,"default")],16),e.closable?r.withDirectives((r.openBlock(),r.createElementBlock("button",r.mergeProps({key:0,class:e.cx("closeButton"),"aria-label":a.closeAriaLabel,type:"button",onClick:t[0]||(t[0]=function(c){return a.close(c)})},Lo(Lo(Lo({},e.closeButtonProps),e.ptm("button")),e.ptm("closeButton"))),[r.renderSlot(e.$slots,"closeicon",{},function(){return[e.closeIcon?(r.openBlock(),r.createElementBlock("i",r.mergeProps({key:0,class:[e.cx("closeIcon"),e.closeIcon]},Lo(Lo({},e.ptm("buttonIcon")),e.ptm("closeIcon"))),null,16)):(r.openBlock(),r.createBlock(s,r.mergeProps({key:1,class:[e.cx("closeIcon"),e.closeIcon]},Lo(Lo({},e.ptm("buttonIcon")),e.ptm("closeIcon"))),null,16,["class"]))]})],16,OJ)),[[l]]):r.createCommentVNode("",!0)],16))],16),[[r.vShow,o.visible]])]}),_:3},16)}Cf.render=YJ;var FJ={root:function(t){var n=t.instance;return["p-progressbar p-component",{"p-progressbar-determinate":n.determinate,"p-progressbar-indeterminate":n.indeterminate}]},container:"p-progressbar-indeterminate-container",value:"p-progressbar-value p-progressbar-value-animate",label:"p-progressbar-label"},RJ=wt.extend({name:"progressbar",classes:FJ}),_J={name:"BaseProgressBar",extends:ot,props:{value:{type:Number,default:null},mode:{type:String,default:"determinate"},showValue:{type:Boolean,default:!0}},style:RJ,provide:function(){return{$parentInstance:this}}},Xg={name:"ProgressBar",extends:_J,inheritAttrs:!1,computed:{progressStyle:function(){return{width:this.value+"%",display:"flex"}},indeterminate:function(){return this.mode==="indeterminate"},determinate:function(){return this.mode==="determinate"}}},vJ=["aria-valuenow"];function VJ(e,t,n,i,o,a){return r.openBlock(),r.createElementBlock("div",r.mergeProps({role:"progressbar",class:e.cx("root"),"aria-valuemin":"0","aria-valuenow":e.value,"aria-valuemax":"100"},e.ptmi("root")),[a.determinate?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:e.cx("value"),style:a.progressStyle},e.ptm("value")),[e.value!=null&&e.value!==0&&e.showValue?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:e.cx("label")},e.ptm("label")),[r.renderSlot(e.$slots,"default",{},function(){return[r.createTextVNode(r.toDisplayString(e.value+"%"),1)]})],16)):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0),a.indeterminate?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:1,class:e.cx("container")},e.ptm("container")),[r.createElementVNode("div",r.mergeProps({class:e.cx("value")},e.ptm("value")),null,16)],16)):r.createCommentVNode("",!0)],16,vJ)}Xg.render=VJ;var GJ={root:function(t){var n=t.props;return["p-fileupload p-fileupload-".concat(n.mode," p-component")]},buttonbar:"p-fileupload-buttonbar",chooseButton:function(t){var n=t.instance,i=t.props;return["p-button p-component p-fileupload-choose",{"p-fileupload-choose-selected":i.mode==="basic"&&n.hasFiles,"p-disabled":i.disabled,"p-focus":n.focused}]},chooseIcon:"p-button-icon p-button-icon-left",chooseButtonLabel:"p-button-label",content:"p-fileupload-content",empty:"p-fileupload-empty",uploadIcon:"p-button-icon p-button-icon-left",label:"p-button-label",file:"p-fileupload-file",thumbnail:"p-fileupload-file-thumbnail",details:"p-fileupload-file-details",fileName:"p-fileupload-file-name",fileSize:"p-fileupload-file-size",badge:"p-fileupload-file-badge",actions:"p-fileupload-file-actions",removeButton:"p-fileupload-file-remove"},PJ=wt.extend({name:"fileupload",classes:GJ}),HJ={name:"BaseFileUpload",extends:ot,props:{name:{type:String,default:null},url:{type:String,default:null},mode:{type:String,default:"advanced"},multiple:{type:Boolean,default:!1},accept:{type:String,default:null},disabled:{type:Boolean,default:!1},auto:{type:Boolean,default:!1},maxFileSize:{type:Number,default:null},invalidFileSizeMessage:{type:String,default:"{0}: Invalid file size, file size should be smaller than {1}."},invalidFileTypeMessage:{type:String,default:"{0}: Invalid file type, allowed file types: {1}."},fileLimit:{type:Number,default:null},invalidFileLimitMessage:{type:String,default:"Maximum number of files exceeded, limit is {0} at most."},withCredentials:{type:Boolean,default:!1},previewWidth:{type:Number,default:50},chooseLabel:{type:String,default:null},uploadLabel:{type:String,default:null},cancelLabel:{type:String,default:null},customUpload:{type:Boolean,default:!1},showUploadButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},chooseIcon:{type:String,default:void 0},uploadIcon:{type:String,default:void 0},cancelIcon:{type:String,default:void 0},style:null,class:null},style:PJ,provide:function(){return{$parentInstance:this}}},Qf={name:"FileContent",hostName:"FileUpload",extends:ot,emits:["remove"],props:{files:{type:Array,default:function(){return[]}},badgeSeverity:{type:String,default:"warning"},badgeValue:{type:String,default:null},previewWidth:{type:Number,default:50},templates:{type:null,default:null}},methods:{formatSize:function(t){var n,i=1024,o=3,a=((n=this.$primevue.config.locale)===null||n===void 0?void 0:n.fileSizeTypes)||["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t===0)return"0 ".concat(a[0]);var s=Math.floor(Math.log(t)/Math.log(i)),l=parseFloat((t/Math.pow(i,s)).toFixed(o));return"".concat(l," ").concat(a[s])}},components:{FileUploadButton:_i,FileUploadBadge:vd,TimesIcon:ii}},JJ=["alt","src","width"];function WJ(e,t,n,i,o,a){var s=r.resolveComponent("FileUploadBadge"),l=r.resolveComponent("TimesIcon"),c=r.resolveComponent("FileUploadButton");return r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.files,function(M,d){return r.openBlock(),r.createElementBlock("div",r.mergeProps({key:M.name+M.type+M.size,class:e.cx("file")},e.ptm("file")),[r.createElementVNode("img",r.mergeProps({role:"presentation",class:e.cx("thumbnail"),alt:M.name,src:M.objectURL,width:n.previewWidth},e.ptm("thumbnail")),null,16,JJ),r.createElementVNode("div",r.mergeProps({class:e.cx("details")},e.ptm("details")),[r.createElementVNode("div",r.mergeProps({class:e.cx("fileName")},e.ptm("fileName")),r.toDisplayString(M.name),17),r.createElementVNode("span",r.mergeProps({class:e.cx("fileSize")},e.ptm("fileSize")),r.toDisplayString(a.formatSize(M.size)),17),r.createVNode(s,{value:n.badgeValue,class:r.normalizeClass(e.cx("badge")),severity:n.badgeSeverity,unstyled:e.unstyled,pt:e.ptm("badge")},null,8,["value","class","severity","unstyled","pt"])],16),r.createElementVNode("div",r.mergeProps({class:e.cx("actions")},e.ptm("actions")),[r.createVNode(c,{onClick:function(h){return e.$emit("remove",d)},text:"",rounded:"",severity:"danger",class:r.normalizeClass(e.cx("removeButton")),unstyled:e.unstyled,pt:e.ptm("removeButton")},{icon:r.withCtx(function(N){return[n.templates.fileremoveicon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.fileremoveicon),{key:0,class:r.normalizeClass(N.class),file:M,index:d},null,8,["class","file","index"])):(r.openBlock(),r.createBlock(l,r.mergeProps({key:1,class:N.class,"aria-hidden":"true"},e.ptm("removeButton").icon),null,16,["class"]))]}),_:2},1032,["onClick","class","unstyled","pt"])],16)],16)}),128)}Qf.render=WJ;function Kg(e){return KJ(e)||XJ(e)||Sf(e)||ZJ()}function ZJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
495
|
+
exact amount you entered.`,severity:"primary"})]),r.createElementVNode("div",wH,[r.createElementVNode("div",jH,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,L=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:L},[d.value==="left"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[c.value<L?(r.openBlock(),r.createElementBlock("img",{key:0,src:I.value,alt:""},null,8,BH)):(r.openBlock(),r.createElementBlock("div",LH,[r.createElementVNode("img",{src:y.value,alt:"",class:"logo"},null,8,xH),r.createElementVNode("div",CH,[zH,r.createElementVNode("img",{src:h.value,alt:"",class:"qr-code",style:{"margin-bottom":"-5px","margin-right":"-10px"}},null,8,QH)])]))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[L===1||c.value<L-1?(r.openBlock(),r.createElementBlock("img",{key:0,src:I.value,alt:""},null,8,SH)):(r.openBlock(),r.createElementBlock("div",kH,[r.createElementVNode("img",{src:y.value,alt:"",class:"logo"},null,8,UH),r.createElementVNode("div",bH,[OH,r.createElementVNode("img",{src:h.value,alt:"",class:"qr-code",style:{"margin-bottom":"-5px","margin-right":"-10px"}},null,8,YH)])]))],64))],64))),128))])]),FH])),r.createElementVNode("div",RH,[r.createElementVNode("div",_H," Label: "+r.toDisplayString(c.value||0)+" pcs ",1),r.createVNode(tt,{disabled:!c.value||c.value<0,onClick:p,label:"Start Print"},null,8,["disabled"])]),r.createElementVNode("div",vH,[r.createElementVNode("div",VH,[r.createElementVNode("div",GH,[d.value==="right"?(r.openBlock(),r.createElementBlock("div",PH)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.value,(L,j)=>(r.openBlock(),r.createElementBlock("div",{key:j,class:"box",style:{transform:"translateX(-7px)",padding:"0"}},[r.createElementVNode("img",{src:y.value,alt:"",class:"logo",style:{transform:"translateY(10px)","z-index":"999999"}},null,8,HH),r.createElementVNode("div",JH,[r.createElementVNode("div",WH,r.toDisplayString(r.unref(FB)(L.code)),1),r.createElementVNode("img",{src:L.url,alt:"",class:"qr-code",style:{transform:"translateX(-10px)"}},null,8,ZH)])]))),128))])])])]),_:1},8,["visible","pt"]))}}),Bxe="",mf=Fl(XH,[["__scopeId","data-v-349deb23"]]),KH=({headers:e={},params:t={}}={})=>{const n=JSON.parse(localStorage.getItem("user")??"{}"),i="https://dev-api-damage.tagsamurai.com";return jn.create({baseURL:`${i}/v2`,headers:{Authorization:`Bearer ${n.token}`,...e},params:t})},qH={reportDamage:(e,t)=>KH({headers:{"Content-Type":"multipart/form-data"}}).put(`/report-damage/${e}`,t)},$H={class:"font-bold"},eJ=r.createElementVNode("p",null,"Are you sure want to continue?",-1),tJ={class:"flex flex-col gap-3"},nJ={key:0,class:"flex flex-col gap-3"},rJ={key:0,class:"flex items-center gap-3"},iJ={class:"flex"},aJ={key:0,class:"flex mr-1"},Df=r.defineComponent({__name:"DialogReportDamage",props:{id:{},reportSource:{},visible:{type:Boolean},byUser:{type:Boolean},successMessage:{},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(e,{emit:t}){const{setLoading:n}=ri(),i=zn(),o=e,a=t,s=r.computed(()=>o.visible),l=r.computed(()=>{var f,w,p,D;return((w=(f=M.value)==null?void 0:f.asset)==null?void 0:w.rfid)||((D=(p=M.value)==null?void 0:p.asset)==null?void 0:D.qr)}),c=r.ref(),M=r.ref(),d=r.ref(!1),N=r.ref(!1),h=r.ref(),g=async f=>{try{n(!0);const w={notes:f.formValues.notes,image:f.formValues.image,reportSource:o.reportSource,serialNumber:h.value},p="Success, damaged asset report has been submitted.";if(o.submitFunction)await o.submitFunction(w)&&(i.add({message:o.successMessage??p}),a("reported"),I());else{const{data:D}=await qH.reportDamage(o.id,w);D&&(i.add({message:o.successMessage??p}),a("reported"),I())}}catch(w){i.add({error:w,message:"Error, failed to report damaged asset."})}finally{n(!1)}},T=async f=>{var w;try{n(!0);const{data:p}=await Ei.matchAssetWithTag(o.id,f);(w=p==null?void 0:p.data)!=null&&w.totalRecords?N.value=!0:(N.value=!1,i.add({severity:"error",message:"Error, failed to verify. TAG doesn't match."}))}catch(p){i.add({error:p,message:"Error, failed to verify. TAG doesn't match."})}finally{n(!1)}},y=()=>{d.value=!0,I()},I=()=>{a("update:visible",!1)};return r.watch(s,()=>{N.value=!!o.byUser,h.value=void 0}),r.watch(N,f=>{var w;f||(w=c.value.form)==null||w.clearField()}),(f,w)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(pc),{ref_key:"dialogForm",ref:c,visible:s.value,"onUpdate:visible":w[2]||(w[2]=p=>s.value=p),"reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:I,action:"Submit",closable:"","data-ts-name":"report-damage",header:"Report Damage",width:"large"},{confirm:r.withCtx(p=>[r.createVNode(r.unref(vr),{visible:p.visible,onConfirm:D=>p.submit(g),"onUpdate:visible":D=>!D&&p.hide(),body:"Are you sure want to continue?","confirm-label":"Continue","data-ts-section":"confirm-dialog",header:"Report Damaged Asset",severity:"danger"},{body:r.withCtx(()=>{var D,C,S;return[r.createElementVNode("p",null,[r.createElementVNode("span",$H,r.toDisplayString(((S=(C=(D=M.value)==null?void 0:D.asset)==null?void 0:C.name)==null?void 0:S.nameWithSequence)??"-"),1),r.createTextVNode(" will be reported as damaged asset. ")]),eJ]}),_:2},1032,["visible","onConfirm","onUpdate:visible"])]),fields:r.withCtx(()=>{var p,D,C,S,B;return[r.createElementVNode("div",tJ,[r.createVNode(r.unref(cs),{id:o.id,ref_key:"assetInfo",ref:M},null,8,["id"]),(p=M.value)!=null&&p.asset?(r.openBlock(),r.createElementBlock("div",nJ,[!o.byUser&&l.value?(r.openBlock(),r.createElementBlock("div",rJ,[r.createElementVNode("div",iJ,[(C=(D=M.value)==null?void 0:D.asset)!=null&&C.rfid?(r.openBlock(),r.createElementBlock("div",aJ,[r.createVNode(r.unref(Ya),{onConnected:w[0]||(w[0]=L=>h.value=(L==null?void 0:L.serialNumber)??""),onScan:T}),r.createVNode(r.unref(He),{class:"w-[13.33px] h-[13.33px]",icon:"info",info:"Use short range scanner to verify asset",severity:"primary"})])):r.createCommentVNode("",!0),(B=(S=M.value)==null?void 0:S.asset)!=null&&B.qr?(r.openBlock(),r.createBlock(r.unref(Ya),{key:1,onConnected:w[1]||(w[1]=L=>h.value=(L==null?void 0:L.serialNumber)??""),onScan:T,type:"QR"})):r.createCommentVNode("",!0)]),r.createVNode(r.unref(Ct),{label:N.value?"Verified":"Unverified",severity:N.value?"success":"warning"},null,8,["label","severity"]),N.value?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(r.unref(tt),{key:0,onClick:y,label:"Report TAG",text:""}))])):r.createCommentVNode("",!0),r.createVNode(r.unref(xc),{"data-ts-section":"condition-input",disabled:"",label:"Condition",mandatory:"","use-validator":"",value:"Damaged"}),r.createVNode(r.unref(E0),{disabled:!N.value&&l.value,"data-ts-section":"photo-input","field-name":"image",label:"Photo",mandatory:"","use-validator":""},null,8,["disabled"]),r.createVNode(r.unref(xs),{"custom-validation":{empty:"Note must not be empty"},disabled:!N.value&&l.value,"max-length":120,rows:3,"data-ts-section":"notes-input","field-name":"notes","input-class":"!min-h-[67px]",label:"Note",mandatory:"",placeholder:"Enter note","use-validator":""},null,8,["disabled"])])):r.createCommentVNode("",!0)])]}),_:1},8,["visible"]),r.createVNode(r.unref(Zg),{id:o.id,visible:d.value,"onUpdate:visible":w[3]||(w[3]=p=>d.value=p),onReported:w[4]||(w[4]=p=>a("reported"))},null,8,["id","visible"])],64))}}),oJ=({headers:e={},params:t={}}={})=>{const n=JSON.parse(localStorage.getItem("user")??"{}"),i="https://dev-api-missing.tagsamurai.com";return jn.create({baseURL:`${i}/v2`,headers:{"Content-type":"application/json",Authorization:`Bearer ${n.token}`,...e},params:t})},sJ={reportMissing:(e,t)=>oJ().put(`/report-missing/${e}`,t)},wf=({headers:e={},params:t={}}={})=>{const n=JSON.parse(localStorage.getItem("user")??"{}"),i="https://dev-api-tracking-v2.tagsamurai.com";return jn.create({baseURL:`${i}/v2/tracking`,headers:{"Content-type":"application/json",Authorization:`Bearer ${n.token}`,...e},params:t})},lJ={reportPermanentlyMissing:(e,t)=>wf().put(`/report-permanently-missing/${e}`,t),getTrackingDetail:e=>wf().get(`/${e}`)},cJ={class:"font-bold"},AJ=r.createElementVNode("p",null,"Are you sure you want to report it?",-1),MJ={class:"flex flex-col gap-3"},jf=r.defineComponent({__name:"DialogReportMissing",props:{id:{},trackingId:{},visible:{type:Boolean},permanentlyMissing:{type:Boolean},successMessage:{},submitWithoutApi:{type:Boolean},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(e,{emit:t}){const{setLoading:n}=ri(),i=zn(),o=e,a=t,s=r.computed(()=>o.visible),l=r.computed(()=>o.permanentlyMissing?"Report Permanently Missing":"Report Missing"),c=r.computed(()=>o.permanentlyMissing?"Report as Permanenly Missing":"Report Missing Asset"),M=r.ref(),d=async N=>{try{n(!0);const h={notes:N.formValues.notes},g=o.permanentlyMissing?"Success, asset has been reported as permanently missing.":"Success, missing asset has been reported.";if(o.submitWithoutApi)i.add({message:o.successMessage??g}),a("reported",h),a("update:visible",!1);else if(o.submitFunction)await o.submitFunction(h)&&(i.add({message:o.successMessage??g}),a("reported"),a("update:visible",!1));else{const{data:T}=o.permanentlyMissing?await lJ.reportPermanentlyMissing(o.trackingId??"",h):await sJ.reportMissing(o.id,h);T&&(i.add({message:o.successMessage??g}),a("reported"),a("update:visible",!1))}}catch(h){const g=o.permanentlyMissing?"Error, failed to report asset as permanently missing.":"Error, failed to report missing asset.";i.add({error:h,message:g})}finally{n(!1)}};return(N,h)=>(r.openBlock(),r.createBlock(r.unref(pc),{visible:s.value,"onUpdate:visible":h[0]||(h[0]=g=>s.value=g),header:l.value,"reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:h[1]||(h[1]=g=>a("update:visible",!1)),action:"Submit",closable:"","data-ts-name":"report-missing",width:"large"},{confirm:r.withCtx(g=>[r.createVNode(r.unref(vr),{header:c.value,visible:g.visible,onConfirm:T=>g.submit(d),"onUpdate:visible":T=>!T&&g.hide(),"confirm-label":"Report","data-ts-section":"confirm-dialog",severity:"danger"},{body:r.withCtx(()=>{var T,y,I;return[r.createElementVNode("p",null,[r.createElementVNode("span",cJ,r.toDisplayString(((I=(y=(T=M.value)==null?void 0:T.asset)==null?void 0:y.name)==null?void 0:I.nameWithSequence)??"-"),1),r.createTextVNode(" will be reported as "+r.toDisplayString(o.permanentlyMissing?"permanently missing asset":"missing asset")+". ",1)]),AJ]}),_:2},1032,["header","visible","onConfirm","onUpdate:visible"])]),fields:r.withCtx(()=>[r.createElementVNode("div",MJ,[(r.openBlock(),r.createBlock(r.unref(cs),{id:o.id,key:o.id,ref_key:"assetInfo",ref:M},null,8,["id"])),r.createVNode(r.unref(xs),{"custom-validation":{empty:"Note must not be empty"},"max-length":120,rows:3,"data-ts-section":"notes-input","field-name":"notes","input-class":"!min-h-[67px]",label:"Note",mandatory:"",placeholder:"Enter note","use-validator":""})])]),_:1},8,["visible","header"]))}}),uJ=({headers:e={},params:t={}}={})=>{const n=JSON.parse(localStorage.getItem("user")??"{}"),i="https://dev-api-tag.tagsamurai.com";return jn.create({baseURL:`${i}/v2/tag-transaction`,headers:{"Content-type":"application/json",Authorization:`Bearer ${n.token}`,...e},params:t})},dJ={reportTag:(e,t)=>uJ().put(`/report/${e}`,t)},gJ={class:"flex flex-col gap-3"},Zg=r.defineComponent({__name:"DialogReportTag",props:{id:{},tagReported:{},visible:{type:Boolean},successMessage:{},submitLabel:{},submitWithoutApi:{type:Boolean},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(e,{emit:t}){const{setLoading:n}=ri(),i=zn(),o=e,a=t,s=r.computed(()=>o.visible),l=r.computed(()=>{var g,T,y,I,f,w,p,D,C,S,B,L,j,_,J,X,ae,ue,oe,ce,ee,pe;const N=(g=o.tagReported)==null?void 0:g.rfid,h=(T=o.tagReported)==null?void 0:T.qr;return[{label:"RFID TAG",value:"RFID",visible:((I=(y=c.value)==null?void 0:y.asset)==null?void 0:I.rfid)&&!N&&!((p=(w=(f=c.value)==null?void 0:f.asset)==null?void 0:w.tagReported)!=null&&p.rfid)},{label:"QR TAG",value:"QR",visible:((C=(D=c.value)==null?void 0:D.asset)==null?void 0:C.qr)&&!h&&!((L=(B=(S=c.value)==null?void 0:S.asset)==null?void 0:B.tagReported)!=null&&L.qr)},{label:"RFID & QR TAG",value:"RFID & QR",visible:((_=(j=c.value)==null?void 0:j.asset)==null?void 0:_.rfid)&&((X=(J=c.value)==null?void 0:J.asset)==null?void 0:X.qr)&&!N&&!((oe=(ue=(ae=c.value)==null?void 0:ae.asset)==null?void 0:ue.tagReported)!=null&&oe.rfid)&&!h&&!((pe=(ee=(ce=c.value)==null?void 0:ce.asset)==null?void 0:ee.tagReported)!=null&&pe.qr)}].filter(re=>re.visible)}),c=r.ref(),M=async N=>{try{n(!0);const g={RFID:{qr:!1,rfid:!0},QR:{qr:!0,rfid:!1},"RFID & QR":{qr:!0,rfid:!0}}[N.formValues.tagType],T="Success, TAG has been reported.";if(o.submitWithoutApi)i.add({message:o.successMessage??T}),a("reported",g),a("update:visible",!1);else if(o.submitFunction)await o.submitFunction(g)&&(i.add({message:o.successMessage??T}),a("reported",g),a("update:visible",!1));else{const{data:y}=await dJ.reportTag(o.id,g);y&&(i.add({message:o.successMessage??T}),a("reported",g),a("update:visible",!1))}}catch(h){i.add({error:h,message:"Error, failed to report TAG."})}finally{n(!1)}},d=r.computed(()=>{var N,h,g,T,y;return((N=l.value)==null?void 0:N.length)>1&&((g=(h=c.value)==null?void 0:h.asset)==null?void 0:g.tagType)==="RFID & QR"?"RFID & QR":(y=(T=l.value)==null?void 0:T[0])==null?void 0:y.value});return(N,h)=>(r.openBlock(),r.createBlock(r.unref(pc),{visible:s.value,"onUpdate:visible":h[0]||(h[0]=g=>s.value=g),"action-label":o.submitLabel??"Submit","reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:h[1]||(h[1]=g=>a("update:visible",!1)),action:"Submit",closable:"","data-ts-name":"report-tag",header:"Report TAG",width:"large"},{confirm:r.withCtx(g=>{var T,y,I;return[r.createVNode(r.unref(vr),{lists:[(I=(y=(T=c.value)==null?void 0:T.asset)==null?void 0:y.name)==null?void 0:I.nameWithSequence],visible:g.visible,onConfirm:f=>g.submit(M),"onUpdate:visible":f=>!f&&g.hide(),body:"Are you sure want to report it?","confirm-label":"Report","data-ts-section":"confirm-dialog",header:"Report TAG",severity:"danger"},null,8,["lists","visible","onConfirm","onUpdate:visible"])]}),fields:r.withCtx(()=>{var g;return[r.createElementVNode("div",gJ,[r.createVNode(r.unref(cs),{id:o.id,ref_key:"assetInfo",ref:c},null,8,["id"]),(g=c.value)!=null&&g.asset?(r.openBlock(),r.createBlock(r.unref(ds),{key:0,disabled:l.value.length<=1,"initial-value":d.value,options:l.value,"data-ts-section":"reported-tag-dropdown","field-info":"Reported TAG will be mark a damaged / missing TAG","field-name":"tagType",label:"Reported TAG",mandatory:"","option-label":"label","option-value":"value",placeholder:"Select TAG","use-validator":""},null,8,["disabled","initial-value","options"])):r.createCommentVNode("",!0)])]}),_:1},8,["visible","action-label"]))}});var NJ={root:function(t){var n=t.instance,i=t.props;return["p-inputtextarea p-inputtext p-component",{"p-filled":n.filled,"p-inputtextarea-resizable ":i.autoResize,"p-invalid":i.invalid,"p-variant-filled":i.variant?i.variant==="filled":n.$primevue.config.inputStyle==="filled"}]}},hJ=wt.extend({name:"textarea",classes:NJ}),EJ={name:"BaseTextarea",extends:ot,props:{modelValue:null,autoResize:Boolean,invalid:{type:Boolean,default:!1},variant:{type:String,default:null}},style:hJ,provide:function(){return{$parentInstance:this}}},Bf={name:"Textarea",extends:EJ,inheritAttrs:!1,emits:["update:modelValue"],mounted:function(){this.$el.offsetParent&&this.autoResize&&this.resize()},updated:function(){this.$el.offsetParent&&this.autoResize&&this.resize()},methods:{resize:function(){this.$el.style.height="auto",this.$el.style.height=this.$el.scrollHeight+"px",parseFloat(this.$el.style.height)>=parseFloat(this.$el.style.maxHeight)?(this.$el.style.overflowY="scroll",this.$el.style.height=this.$el.style.maxHeight):this.$el.style.overflow="hidden"},onInput:function(t){this.autoResize&&this.resize(),this.$emit("update:modelValue",t.target.value)}},computed:{filled:function(){return this.modelValue!=null&&this.modelValue.toString().length>0},ptmParams:function(){return{context:{disabled:this.$attrs.disabled||this.$attrs.disabled===""}}}}},TJ=["value","aria-invalid"];function yJ(e,t,n,i,o,a){return r.openBlock(),r.createElementBlock("textarea",r.mergeProps({class:e.cx("root"),value:e.modelValue,"aria-invalid":e.invalid||void 0,onInput:t[0]||(t[0]=function(){return a.onInput&&a.onInput.apply(a,arguments)})},e.ptmi("root",a.ptmParams)),null,16,TJ)}Bf.render=yJ;const xs=r.defineComponent({__name:"Textarea",props:{modelValue:{},value:{},disabled:{type:Boolean},autoResize:{type:Boolean,default:!0},variant:{},useValidator:{type:Boolean},fieldName:{default:"textareaInput"},mandatory:{type:Boolean},maxLength:{default:void 0},invalid:{type:Boolean},customValidation:{},inputClass:{},placeholder:{},rows:{default:5},label:{},textareaPt:{default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){var d,N;const n=e,i=t;r.onMounted(()=>{l()});const o=r.reactive({value:((d=n.value)==null?void 0:d.trim())??((N=n.modelValue)==null?void 0:N.trim())}),a=r.computed(()=>n.invalid||!!o.errorMessage),s=r.computed(()=>n.placeholder??`Enter ${n.label?n.label.toLowerCase():"text"}`),l=()=>{var h,g;n.useValidator&&(Object.assign(o,Pn(n.fieldName,T=>c(T))),(n.value??n.modelValue)&&(o.value=((h=n.value)==null?void 0:h.trim())??((g=n.modelValue)==null?void 0:g.trim())))},c=h=>{var g,T;return n.validatorMessage&&n.invalid?n.validatorMessage:!h&&n.mandatory?((g=n.customValidation)==null?void 0:g.empty)??n.validatorMessage??`${n.label} must not be empty`:n.maxLength&&((h==null?void 0:h.length)??0)>n.maxLength?((T=n.customValidation)==null?void 0:T.exceed)??"Max. "+n.maxLength+" characters":!0},M=()=>{var h;o.value=(h=o.value)==null?void 0:h.trim(),i("update:modelValue",o.value)};return r.watch(()=>n.value,h=>{o.value=h==null?void 0:h.trim()},{once:!0}),r.watch(()=>n.modelValue,h=>{o.value=h}),(h,g)=>(r.openBlock(),r.createBlock(Er,{info:h.fieldInfo,label:n.label,mandatory:n.mandatory},{default:r.withCtx(()=>[r.createVNode(r.unref(Bf),{modelValue:o.value,"onUpdate:modelValue":[g[0]||(g[0]=T=>o.value=T),g[1]||(g[1]=T=>i("update:modelValue",T))],"auto-resize":h.autoResize,class:r.normalizeClass([{"resize-none":h.autoResize,resize:!h.autoResize},{"!border-danger-500 border:bg-danger-500":a.value},h.inputClass,`min-h-[${h.rows*26}px]`]),disabled:h.disabled,placeholder:s.value,pt:n.textareaPt,rows:n.rows,onBlur:M},null,8,["modelValue","auto-resize","class","disabled","placeholder","pt","rows"]),r.createVNode(er,{message:o.errorMessage},null,8,["message"])]),_:1},8,["info","label","mandatory"]))}}),IJ=r.defineComponent({__name:"DisposalReportBulkAction",props:{selectedData:{default:[]},selectedDataModifiers:{},assetsToReport:{default:[]},assetsToReportModifiers:{}},emits:r.mergeModels(["noted","removed"],["update:selectedData","update:assetsToReport"]),setup(e,{emit:t}){const{t:n}=ca(),i=t,o=r.useModel(e,"selectedData"),a=r.useModel(e,"assetsToReport"),s=r.shallowRef(!1),l=r.shallowRef(),c=[{label:n("Note"),icon:"note",useAdditionSlot:!0,command:()=>{i("noted",o.value,l.value),o.value=[],l.value=void 0}},{label:n("Remove from List"),icon:"delete-bin",danger:!0,command:()=>{s.value=!0}}],M=()=>{a.value=a.value.filter(d=>!o.value.some(N=>N._id===d._id)),i("removed",o.value),o.value=[]};return(d,N)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(Pd),r.mergeProps({"selected-data":o.value,"onUpdate:selectedData":N[1]||(N[1]=h=>o.value=h)},d.$attrs,{options:c,naming:"Asset(s)"}),{addition:r.withCtx(({selectedOption:h})=>[(h==null?void 0:h.label)===r.unref(n)("Note")?(r.openBlock(),r.createBlock(xs,{key:0,modelValue:l.value,"onUpdate:modelValue":N[0]||(N[0]=g=>l.value=g),placeholder:r.unref(n)("Enter note"),rows:1,"textarea-pt":{root:{maxlength:30}},class:"!max-w-[250px]"},null,8,["modelValue","placeholder"])):r.createCommentVNode("",!0)]),_:1},16,["selected-data"]),r.createVNode(r.unref(vr),{visible:s.value,"onUpdate:visible":N[2]||(N[2]=h=>s.value=h),body:r.unref(n)("Are you sure you want to remove it?"),"confirm-label":r.unref(n)("Remove"),header:r.unref(n)("Remove from List"),lists:o.value,onConfirm:M,"list-label":"name.nameWithSequence",severity:"danger"},null,8,["visible","body","confirm-label","header","lists"])],64))}}),fJ=r.defineComponent({__name:"DisposalReportTableFilter",props:{assets:{}},emits:["apply"],setup(e,{emit:t}){const n=e,i=t,o=zn(),{t:a}=ca(),s=r.shallowRef([{label:a("Name"),placeholder:a("Select asset name"),field:"name",type:"multiselect"},{label:a("Brand"),placeholder:a("Select brand"),field:"brand",type:"multiselect"},{label:a("Model/Type"),placeholder:a("Select model/type"),field:"model",type:"multiselect"},{label:a("Group"),field:"group",type:"group"}]),l=r.reactive({}),c=r.shallowRef(n.assets.length),M=r.ref({}),d=r.ref({}),N=async y=>{var f,w,p;const I=y.field+"Options";try{d.value[I]=!0;const D=n.assets.map(C=>C._id??"");if(D.length!==c.value||!((w=(f=M.value)==null?void 0:f[I])!=null&&w.length)){c.value=D.length;const C={_id:JSON.stringify(D),[I]:!0},{data:S}=await Ei.getOptions("by-id",C);M.value[I]=(p=S.data)==null?void 0:p[I]}}catch(D){console.error(D),o.add({error:D,message:"Error, failed to get filter option."})}finally{d.value[I]=!1}},h=()=>({"name.key":{value:l.name,matchMode:Nn.IN},"brand.key":{value:l.brand,matchMode:Nn.IN},"model.key":{value:l.model,matchMode:Nn.IN},"group.key":{value:l.group,matchMode:Nn.IN}}),g=()=>{const y=h();i("apply",y)},T=()=>{Object.keys(l).forEach(I=>delete l[I])};return(y,I)=>(r.openBlock(),r.createBlock(r.unref(Is),{onApply:g,onClear:T,class:"!gap-x-3 !gap-y-4 !p-3","data-ts-name":"diposalreportfilter"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,f=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f.field},[f.type==="multiselect"?(r.openBlock(),r.createBlock(r.unref(Aa),r.mergeProps({key:0,ref_for:!0},f,{modelValue:l[f.field],"onUpdate:modelValue":w=>l[f.field]=w,loading:d.value[f.field+"Options"],options:M.value[f.field+"Options"],onShow:w=>N(f),"option-label":"label","option-value":"value"}),null,16,["modelValue","onUpdate:modelValue","loading","options","onShow"])):f.type==="group"?(r.openBlock(),r.createBlock(r.unref(nc),{key:1,keys:l.group,"onUpdate:keys":I[0]||(I[0]=w=>l.group=w),"field-label":f.label,type:"Group"},null,8,["keys","field-label"])):r.createCommentVNode("",!0)],64))),128))]),_:1}))}}),pJ={class:"flex flex-col gap-2","data-ts-section":"disposalreporttablewrapper"},mJ={class:"flex gap-1"},DJ={class:"flex gap-1 justify-end"},wJ=r.defineComponent({__name:"DisposalReportTable",props:{tableName:{},useOption:{type:Boolean},childrenColumns:{},childrenUseOption:{type:Boolean},childrenOptions:{},childrenDataKey:{},childrenFilters:{},data:{},disableKey:{},disableAllRows:{type:Boolean},search:{},tag:{},defaultQueryParams:{},fetchFunction:{type:Function},rows:{},isSelectedAll:{type:Boolean},filters:{},lazy:{type:Boolean},loading:{type:Boolean},selectionType:{},useSelection:{type:Boolean},selectedData:{},expandedRows:{},usePaginator:{type:Boolean},options:{},singleSelect:{type:Boolean},customColumn:{type:Boolean},scrollHeight:{},globalFilterFields:{},totalDisabledRows:{},router:{},reason:{}},setup(e){const t=e;r.onMounted(()=>{I()});const n=zn(),{t:i}=ca(),{setLoading:o}=ri(),a=r.shallowRef(),s=r.shallowRef(!1),l=r.shallowRef(),c=r.shallowRef(!1),M=r.shallowRef(!1),d=r.shallowRef([]),N=r.shallowRef(0),h=r.shallowRef([]),g=r.shallowRef({}),T=r.ref(new Map),y=[{field:"assetImageSmall",header:"Photo",style:"min-width: 72px",fixed:!0,sortable:!0,excluded:!0,bodyComponent:B=>({component:Ci,props:{thumbnail:B.assetImageSmall,preview:B.assetImageBig,description:"asset-report-photo",style:"width: 28px; height: 28px;"}})},{header:"Name",field:"name.nameWithSequence",sortable:!0,fixed:!0,bodyTemplate:B=>{var L;return((L=B.name)==null?void 0:L.nameWithSequence)??"-"}},{header:"Brand",field:"brand.name",sortable:!0,fixed:!1,bodyComponent:B=>{var L;return{component:Ct,props:{label:(L=B.brand)==null?void 0:L.name,severity:"dark",format:"nowrap"}}}},{header:"Model/Type",field:"model.name",sortable:!0,fixed:!1,bodyComponent:B=>{var L;return{component:Ct,props:{label:(L=B.model)==null?void 0:L.name,severity:"dark",format:"nowrap"}}}},{header:"Group",field:"group.name",sortable:!0,fixed:!1,bodyComponent:B=>{var L;return{component:Ct,props:{label:(L=B.group)==null?void 0:L.name,format:"nowrap"}}}},{header:"Note",field:"note",fixed:!0,bodyComponent:B=>({component:xs,props:{modelValue:T.value.get(B._id??"assetId"),placeholder:i("Enter note"),rows:1,textareaPt:{root:{maxlength:30}}},events:{"update:modelValue":L=>{T.value.set(B._id??"assetId",L)}}})}],I=async()=>{try{o(!0);const B=sessionStorage.getItem("assetsDisposalReport")??"[]",{data:L}=await Ei.getAssetsById(B,{});L.data.data.forEach(j=>{T.value.set(j._id??"",null)}),d.value=L.data.data,N.value=L.data.totalRecords}catch(B){console.error(B),n.add({error:B,message:"Error, failed to get assets. "})}finally{o(!1)}},f=[{label:i("Remove from List"),icon:"delete-bin",danger:!0,command:()=>{c.value=!0}}],w=()=>{d.value=d.value.filter(B=>B._id!==g.value._id),p([g.value]),g.value={}},p=B=>{B.forEach(L=>{T.value.delete(L._id??"")}),h.value=[],d.value.length||C(),n.add({message:i("Success, asset has been removed from the list."),severity:"success"})},D=(B,L)=>{B.forEach(j=>{T.value.set(j._id??"",L??null)})},C=()=>{const B=window.location.pathname,L=B.slice(0,B.lastIndexOf("/"));t.router.replace(L),sessionStorage.removeItem("assetsDisposalReport")},S=async()=>{const B=[];T.value.forEach((L,j)=>{const _={asset:j,notes:L,reason:t.reason};B.push(_)});try{o(!0),await PN.postReportDisposal({data:B}),n.add({message:i("Success, disposal report has been submitted.")}),C()}catch(L){console.error(L),n.add({error:L,message:i("Error, failed to submit disposal report.")})}finally{o(!1)}};return(B,L)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",pJ,[r.createElementVNode("div",mJ,[r.createVNode(IJ,{"assets-to-report":d.value,"onUpdate:assetsToReport":L[0]||(L[0]=j=>d.value=j),"selected-data":h.value,"onUpdate:selectedData":L[1]||(L[1]=j=>h.value=j),onNoted:D,onRemoved:p,class:"mr-auto"},null,8,["assets-to-report","selected-data"]),r.createVNode(r.unref(gs),{onSearch:L[2]||(L[2]=j=>a.value=j)}),r.createVNode(r.unref(As),{"show-filter":s.value,"onUpdate:showFilter":L[3]||(L[3]=j=>s.value=j)},null,8,["show-filter"])]),r.withDirectives(r.createVNode(fJ,{assets:d.value,onApply:L[4]||(L[4]=j=>l.value=j)},null,8,["assets"]),[[r.vShow,s.value]]),r.createVNode(r.unref(ys),r.mergeProps(B.$props,{"selected-data":h.value,"onUpdate:selectedData":L[5]||(L[5]=j=>h.value=j),columns:y,data:d.value,filters:l.value,options:f,rows:10,search:a.value,"total-records":N.value,onToggleOption:L[6]||(L[6]=j=>g.value=j),"custom-column":"","data-key":"_id","rounded-header":"","selection-type":"checkbox","use-option":"","use-paginator":""}),null,16,["selected-data","data","filters","search","total-records"])]),r.createVNode(r.unref(vr),{visible:c.value,"onUpdate:visible":L[7]||(L[7]=j=>c.value=j),body:r.unref(i)("Are you sure you want to remove it?"),"confirm-label":r.unref(i)("Remove"),header:r.unref(i)("Remove from List"),lists:[g.value],onConfirm:w,"list-label":"name.nameWithSequence",severity:"danger"},null,8,["visible","body","confirm-label","header","lists"]),r.createVNode(r.unref(vr),{visible:M.value,"onUpdate:visible":L[8]||(L[8]=j=>M.value=j),"confirm-label":r.unref(i)("Continue"),header:r.unref(i)("Cancel Report"),onConfirm:C,severity:"danger"},{body:r.withCtx(()=>[r.createElementVNode("p",null,r.toDisplayString(r.unref(i)("This action will cancel the disposal report.")),1),r.createElementVNode("p",null,r.toDisplayString(r.unref(i)("Are you sure you want to continue?")),1)]),_:1},8,["visible","confirm-label","header"]),r.createElementVNode("div",DJ,[r.createVNode(r.unref(tt),{label:r.unref(i)("Cancel"),onClick:L[9]||(L[9]=j=>M.value=!0),severity:"dark",text:""},null,8,["label"]),r.createVNode(r.unref(tt),{label:r.unref(i)("Submit"),onClick:S,severity:"success"},null,8,["label"])])],64))}}),jJ={class:"flex flex-col gap-3","data-ts-name":"disposalreport"},BJ={class:"text-general-800 font-bold text-base leading-[21.86px] tracking-[0.02em]","data-ts-section":"pagetitle"},Lf=r.defineComponent({__name:"DisposalReport",props:{router:{},reason:{}},setup(e){const{t}=ca();return(n,i)=>(r.openBlock(),r.createBlock(r.unref(Sg),null,{content:r.withCtx(()=>[r.createElementVNode("div",jJ,[r.createElementVNode("h2",BJ,r.toDisplayString(r.unref(t)("Asset Disposal")),1),r.createVNode(wJ,r.normalizeProps(r.guardReactiveProps(n.$props)),null,16)])]),_:1}))}});var xf={name:"UploadIcon",extends:jt},LJ=r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.58942 9.82197C6.70165 9.93405 6.85328 9.99793 7.012 10C7.17071 9.99793 7.32234 9.93405 7.43458 9.82197C7.54681 9.7099 7.61079 9.55849 7.61286 9.4V2.04798L9.79204 4.22402C9.84752 4.28011 9.91365 4.32457 9.98657 4.35479C10.0595 4.38502 10.1377 4.40039 10.2167 4.40002C10.2956 4.40039 10.3738 4.38502 10.4467 4.35479C10.5197 4.32457 10.5858 4.28011 10.6413 4.22402C10.7538 4.11152 10.817 3.95902 10.817 3.80002C10.817 3.64102 10.7538 3.48852 10.6413 3.37602L7.45127 0.190618C7.44656 0.185584 7.44176 0.180622 7.43687 0.175736C7.32419 0.063214 7.17136 0 7.012 0C6.85264 0 6.69981 0.063214 6.58712 0.175736C6.58181 0.181045 6.5766 0.186443 6.5715 0.191927L3.38282 3.37602C3.27669 3.48976 3.2189 3.6402 3.22165 3.79564C3.2244 3.95108 3.28746 4.09939 3.39755 4.20932C3.50764 4.31925 3.65616 4.38222 3.81182 4.38496C3.96749 4.3877 4.11814 4.33001 4.23204 4.22402L6.41113 2.04807V9.4C6.41321 9.55849 6.47718 9.7099 6.58942 9.82197ZM11.9952 14H2.02883C1.751 13.9887 1.47813 13.9228 1.22584 13.8061C0.973545 13.6894 0.746779 13.5241 0.558517 13.3197C0.370254 13.1154 0.22419 12.876 0.128681 12.6152C0.0331723 12.3545 -0.00990605 12.0775 0.0019109 11.8V9.40005C0.0019109 9.24092 0.065216 9.08831 0.1779 8.97579C0.290584 8.86326 0.443416 8.80005 0.602775 8.80005C0.762134 8.80005 0.914966 8.86326 1.02765 8.97579C1.14033 9.08831 1.20364 9.24092 1.20364 9.40005V11.8C1.18295 12.0376 1.25463 12.274 1.40379 12.4602C1.55296 12.6463 1.76817 12.7681 2.00479 12.8H11.9952C12.2318 12.7681 12.447 12.6463 12.5962 12.4602C12.7453 12.274 12.817 12.0376 12.7963 11.8V9.40005C12.7963 9.24092 12.8596 9.08831 12.9723 8.97579C13.085 8.86326 13.2378 8.80005 13.3972 8.80005C13.5565 8.80005 13.7094 8.86326 13.8221 8.97579C13.9347 9.08831 13.998 9.24092 13.998 9.40005V11.8C14.022 12.3563 13.8251 12.8996 13.45 13.3116C13.0749 13.7236 12.552 13.971 11.9952 14Z",fill:"currentColor"},null,-1),xJ=[LJ];function CJ(e,t,n,i,o,a){return r.openBlock(),r.createElementBlock("svg",r.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),xJ,16)}xf.render=CJ;var zJ={root:function(t){var n=t.props;return"p-message p-component p-message-"+n.severity},wrapper:"p-message-wrapper",icon:"p-message-icon",text:"p-message-text",closeButton:"p-message-close p-link",closeIcon:"p-message-close-icon"},QJ=wt.extend({name:"message",classes:zJ}),SJ={name:"BaseMessage",extends:ot,props:{severity:{type:String,default:"info"},closable:{type:Boolean,default:!0},sticky:{type:Boolean,default:!0},life:{type:Number,default:3e3},icon:{type:String,default:void 0},closeIcon:{type:String,default:void 0},closeButtonProps:{type:null,default:null}},style:QJ,provide:function(){return{$parentInstance:this}}},Cf={name:"Message",extends:SJ,inheritAttrs:!1,emits:["close","life-end"],timeout:null,data:function(){return{visible:!0}},watch:{sticky:function(t){t||this.closeAfterDelay()}},mounted:function(){this.sticky||this.closeAfterDelay()},methods:{close:function(t){this.visible=!1,this.$emit("close",t)},closeAfterDelay:function(){var t=this;setTimeout(function(){t.visible=!1,t.$emit("life-end")},this.life)}},computed:{iconComponent:function(){return{info:us,success:Lr,warn:Ms,error:Io}[this.severity]},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{ripple:kn},components:{TimesIcon:ii,InfoCircleIcon:us,CheckIcon:Lr,ExclamationTriangleIcon:Ms,TimesCircleIcon:Io}};function jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function zf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function Lo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zf(Object(n),!0).forEach(function(i){kJ(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zf(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function kJ(e,t,n){return t=UJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UJ(e){var t=bJ(e,"string");return jc(t)=="symbol"?t:String(t)}function bJ(e,t){if(jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||"default");if(jc(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var OJ=["aria-label"];function YJ(e,t,n,i,o,a){var s=r.resolveComponent("TimesIcon"),l=r.resolveDirective("ripple");return r.openBlock(),r.createBlock(r.Transition,r.mergeProps({name:"p-message",appear:""},e.ptmi("transition")),{default:r.withCtx(function(){return[r.withDirectives(r.createElementVNode("div",r.mergeProps({class:e.cx("root"),role:"alert","aria-live":"assertive","aria-atomic":"true"},e.ptm("root")),[e.$slots.container?r.renderSlot(e.$slots,"container",{key:0,onClose:a.close,closeCallback:a.close}):(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:1,class:e.cx("wrapper")},e.ptm("wrapper")),[r.renderSlot(e.$slots,"messageicon",{class:"p-message-icon"},function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.icon?"span":a.iconComponent),r.mergeProps({class:[e.cx("icon"),e.icon]},e.ptm("icon")),null,16,["class"]))]}),r.createElementVNode("div",r.mergeProps({class:["p-message-text",e.cx("text")]},e.ptm("text")),[r.renderSlot(e.$slots,"default")],16),e.closable?r.withDirectives((r.openBlock(),r.createElementBlock("button",r.mergeProps({key:0,class:e.cx("closeButton"),"aria-label":a.closeAriaLabel,type:"button",onClick:t[0]||(t[0]=function(c){return a.close(c)})},Lo(Lo(Lo({},e.closeButtonProps),e.ptm("button")),e.ptm("closeButton"))),[r.renderSlot(e.$slots,"closeicon",{},function(){return[e.closeIcon?(r.openBlock(),r.createElementBlock("i",r.mergeProps({key:0,class:[e.cx("closeIcon"),e.closeIcon]},Lo(Lo({},e.ptm("buttonIcon")),e.ptm("closeIcon"))),null,16)):(r.openBlock(),r.createBlock(s,r.mergeProps({key:1,class:[e.cx("closeIcon"),e.closeIcon]},Lo(Lo({},e.ptm("buttonIcon")),e.ptm("closeIcon"))),null,16,["class"]))]})],16,OJ)),[[l]]):r.createCommentVNode("",!0)],16))],16),[[r.vShow,o.visible]])]}),_:3},16)}Cf.render=YJ;var FJ={root:function(t){var n=t.instance;return["p-progressbar p-component",{"p-progressbar-determinate":n.determinate,"p-progressbar-indeterminate":n.indeterminate}]},container:"p-progressbar-indeterminate-container",value:"p-progressbar-value p-progressbar-value-animate",label:"p-progressbar-label"},RJ=wt.extend({name:"progressbar",classes:FJ}),_J={name:"BaseProgressBar",extends:ot,props:{value:{type:Number,default:null},mode:{type:String,default:"determinate"},showValue:{type:Boolean,default:!0}},style:RJ,provide:function(){return{$parentInstance:this}}},Xg={name:"ProgressBar",extends:_J,inheritAttrs:!1,computed:{progressStyle:function(){return{width:this.value+"%",display:"flex"}},indeterminate:function(){return this.mode==="indeterminate"},determinate:function(){return this.mode==="determinate"}}},vJ=["aria-valuenow"];function VJ(e,t,n,i,o,a){return r.openBlock(),r.createElementBlock("div",r.mergeProps({role:"progressbar",class:e.cx("root"),"aria-valuemin":"0","aria-valuenow":e.value,"aria-valuemax":"100"},e.ptmi("root")),[a.determinate?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:e.cx("value"),style:a.progressStyle},e.ptm("value")),[e.value!=null&&e.value!==0&&e.showValue?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:e.cx("label")},e.ptm("label")),[r.renderSlot(e.$slots,"default",{},function(){return[r.createTextVNode(r.toDisplayString(e.value+"%"),1)]})],16)):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0),a.indeterminate?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:1,class:e.cx("container")},e.ptm("container")),[r.createElementVNode("div",r.mergeProps({class:e.cx("value")},e.ptm("value")),null,16)],16)):r.createCommentVNode("",!0)],16,vJ)}Xg.render=VJ;var GJ={root:function(t){var n=t.props;return["p-fileupload p-fileupload-".concat(n.mode," p-component")]},buttonbar:"p-fileupload-buttonbar",chooseButton:function(t){var n=t.instance,i=t.props;return["p-button p-component p-fileupload-choose",{"p-fileupload-choose-selected":i.mode==="basic"&&n.hasFiles,"p-disabled":i.disabled,"p-focus":n.focused}]},chooseIcon:"p-button-icon p-button-icon-left",chooseButtonLabel:"p-button-label",content:"p-fileupload-content",empty:"p-fileupload-empty",uploadIcon:"p-button-icon p-button-icon-left",label:"p-button-label",file:"p-fileupload-file",thumbnail:"p-fileupload-file-thumbnail",details:"p-fileupload-file-details",fileName:"p-fileupload-file-name",fileSize:"p-fileupload-file-size",badge:"p-fileupload-file-badge",actions:"p-fileupload-file-actions",removeButton:"p-fileupload-file-remove"},PJ=wt.extend({name:"fileupload",classes:GJ}),HJ={name:"BaseFileUpload",extends:ot,props:{name:{type:String,default:null},url:{type:String,default:null},mode:{type:String,default:"advanced"},multiple:{type:Boolean,default:!1},accept:{type:String,default:null},disabled:{type:Boolean,default:!1},auto:{type:Boolean,default:!1},maxFileSize:{type:Number,default:null},invalidFileSizeMessage:{type:String,default:"{0}: Invalid file size, file size should be smaller than {1}."},invalidFileTypeMessage:{type:String,default:"{0}: Invalid file type, allowed file types: {1}."},fileLimit:{type:Number,default:null},invalidFileLimitMessage:{type:String,default:"Maximum number of files exceeded, limit is {0} at most."},withCredentials:{type:Boolean,default:!1},previewWidth:{type:Number,default:50},chooseLabel:{type:String,default:null},uploadLabel:{type:String,default:null},cancelLabel:{type:String,default:null},customUpload:{type:Boolean,default:!1},showUploadButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},chooseIcon:{type:String,default:void 0},uploadIcon:{type:String,default:void 0},cancelIcon:{type:String,default:void 0},style:null,class:null},style:PJ,provide:function(){return{$parentInstance:this}}},Qf={name:"FileContent",hostName:"FileUpload",extends:ot,emits:["remove"],props:{files:{type:Array,default:function(){return[]}},badgeSeverity:{type:String,default:"warning"},badgeValue:{type:String,default:null},previewWidth:{type:Number,default:50},templates:{type:null,default:null}},methods:{formatSize:function(t){var n,i=1024,o=3,a=((n=this.$primevue.config.locale)===null||n===void 0?void 0:n.fileSizeTypes)||["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t===0)return"0 ".concat(a[0]);var s=Math.floor(Math.log(t)/Math.log(i)),l=parseFloat((t/Math.pow(i,s)).toFixed(o));return"".concat(l," ").concat(a[s])}},components:{FileUploadButton:_i,FileUploadBadge:vd,TimesIcon:ii}},JJ=["alt","src","width"];function WJ(e,t,n,i,o,a){var s=r.resolveComponent("FileUploadBadge"),l=r.resolveComponent("TimesIcon"),c=r.resolveComponent("FileUploadButton");return r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.files,function(M,d){return r.openBlock(),r.createElementBlock("div",r.mergeProps({key:M.name+M.type+M.size,class:e.cx("file")},e.ptm("file")),[r.createElementVNode("img",r.mergeProps({role:"presentation",class:e.cx("thumbnail"),alt:M.name,src:M.objectURL,width:n.previewWidth},e.ptm("thumbnail")),null,16,JJ),r.createElementVNode("div",r.mergeProps({class:e.cx("details")},e.ptm("details")),[r.createElementVNode("div",r.mergeProps({class:e.cx("fileName")},e.ptm("fileName")),r.toDisplayString(M.name),17),r.createElementVNode("span",r.mergeProps({class:e.cx("fileSize")},e.ptm("fileSize")),r.toDisplayString(a.formatSize(M.size)),17),r.createVNode(s,{value:n.badgeValue,class:r.normalizeClass(e.cx("badge")),severity:n.badgeSeverity,unstyled:e.unstyled,pt:e.ptm("badge")},null,8,["value","class","severity","unstyled","pt"])],16),r.createElementVNode("div",r.mergeProps({class:e.cx("actions")},e.ptm("actions")),[r.createVNode(c,{onClick:function(h){return e.$emit("remove",d)},text:"",rounded:"",severity:"danger",class:r.normalizeClass(e.cx("removeButton")),unstyled:e.unstyled,pt:e.ptm("removeButton")},{icon:r.withCtx(function(N){return[n.templates.fileremoveicon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.fileremoveicon),{key:0,class:r.normalizeClass(N.class),file:M,index:d},null,8,["class","file","index"])):(r.openBlock(),r.createBlock(l,r.mergeProps({key:1,class:N.class,"aria-hidden":"true"},e.ptm("removeButton").icon),null,16,["class"]))]}),_:2},1032,["onClick","class","unstyled","pt"])],16)],16)}),128)}Qf.render=WJ;function Kg(e){return KJ(e)||XJ(e)||Sf(e)||ZJ()}function ZJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
496
496
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function KJ(e){if(Array.isArray(e))return qg(e)}function TM(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Sf(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(M){throw M},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
497
497
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,l;return{s:function(){n=n.call(e)},n:function(){var M=n.next();return a=M.done,M},e:function(M){s=!0,l=M},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(s)throw l}}}}function Sf(e,t){if(e){if(typeof e=="string")return qg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qg(e,t)}}function qg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var kf={name:"FileUpload",extends:HJ,inheritAttrs:!1,emits:["select","uploader","before-upload","progress","upload","error","before-send","clear","remove","remove-uploaded-file"],duplicateIEEvent:!1,data:function(){return{uploadedFileCount:0,files:[],messages:[],focused:!1,progress:null,uploadedFiles:[]}},methods:{onFileSelect:function(t){if(t.type!=="drop"&&this.isIE11()&&this.duplicateIEEvent){this.duplicateIEEvent=!1;return}this.messages=[],this.files=this.files||[];var n=t.dataTransfer?t.dataTransfer.files:t.target.files,i=TM(n),o;try{for(i.s();!(o=i.n()).done;){var a=o.value;this.isFileSelected(a)||this.validate(a)&&(this.isImage(a)&&(a.objectURL=window.URL.createObjectURL(a)),this.files.push(a))}}catch(s){i.e(s)}finally{i.f()}this.$emit("select",{originalEvent:t,files:this.files}),this.fileLimit&&this.checkFileLimit(),this.auto&&this.hasFiles&&!this.isFileLimitExceeded()&&this.upload(),t.type!=="drop"&&this.isIE11()?this.clearIEInput():this.clearInputElement()},choose:function(){this.$refs.fileInput.click()},upload:function(){var t=this;if(this.customUpload)this.fileLimit&&(this.uploadedFileCount+=this.files.length),this.$emit("uploader",{files:this.files}),this.clear();else{var n=new XMLHttpRequest,i=new FormData;this.$emit("before-upload",{xhr:n,formData:i});var o=TM(this.files),a;try{for(o.s();!(a=o.n()).done;){var s=a.value;i.append(this.name,s,s.name)}}catch(l){o.e(l)}finally{o.f()}n.upload.addEventListener("progress",function(l){l.lengthComputable&&(t.progress=Math.round(l.loaded*100/l.total)),t.$emit("progress",{originalEvent:l,progress:t.progress})}),n.onreadystatechange=function(){if(n.readyState===4){var l;t.progress=0,n.status>=200&&n.status<300?(t.fileLimit&&(t.uploadedFileCount+=t.files.length),t.$emit("upload",{xhr:n,files:t.files})):t.$emit("error",{xhr:n,files:t.files}),(l=t.uploadedFiles).push.apply(l,Kg(t.files)),t.clear()}},n.open("POST",this.url,!0),this.$emit("before-send",{xhr:n,formData:i}),n.withCredentials=this.withCredentials,n.send(i)}},clear:function(){this.files=[],this.messages=null,this.$emit("clear"),this.isAdvanced&&this.clearInputElement()},onFocus:function(){this.focused=!0},onBlur:function(){this.focused=!1},isFileSelected:function(t){if(this.files&&this.files.length){var n=TM(this.files),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;if(o.name+o.type+o.size===t.name+t.type+t.size)return!0}}catch(a){n.e(a)}finally{n.f()}}return!1},isIE11:function(){return!!window.MSInputMethodContext&&!!document.documentMode},validate:function(t){return this.accept&&!this.isFileTypeValid(t)?(this.messages.push(this.invalidFileTypeMessage.replace("{0}",t.name).replace("{1}",this.accept)),!1):this.maxFileSize&&t.size>this.maxFileSize?(this.messages.push(this.invalidFileSizeMessage.replace("{0}",t.name).replace("{1}",this.formatSize(this.maxFileSize))),!1):!0},isFileTypeValid:function(t){var n=this.accept.split(",").map(function(l){return l.trim()}),i=TM(n),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,s=this.isWildcard(a)?this.getTypeClass(t.type)===this.getTypeClass(a):t.type==a||this.getFileExtension(t).toLowerCase()===a.toLowerCase();if(s)return!0}}catch(l){i.e(l)}finally{i.f()}return!1},getTypeClass:function(t){return t.substring(0,t.indexOf("/"))},isWildcard:function(t){return t.indexOf("*")!==-1},getFileExtension:function(t){return"."+t.name.split(".").pop()},isImage:function(t){return/^image\//.test(t.type)},onDragEnter:function(t){this.disabled||(t.stopPropagation(),t.preventDefault())},onDragOver:function(t){this.disabled||(!this.isUnstyled&&U.addClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!0),t.stopPropagation(),t.preventDefault())},onDragLeave:function(){this.disabled||(!this.isUnstyled&&U.removeClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!1))},onDrop:function(t){if(!this.disabled){!this.isUnstyled&&U.removeClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!1),t.stopPropagation(),t.preventDefault();var n=t.dataTransfer?t.dataTransfer.files:t.target.files,i=this.multiple||n&&n.length===1;i&&this.onFileSelect(t)}},onBasicUploaderClick:function(t){this.hasFiles?this.upload():t.button===0&&this.$refs.fileInput.click()},remove:function(t){this.clearInputElement();var n=this.files.splice(t,1)[0];this.files=Kg(this.files),this.$emit("remove",{file:n,files:this.files})},removeUploadedFile:function(t){var n=this.uploadedFiles.splice(t,1)[0];this.uploadedFiles=Kg(this.uploadedFiles),this.$emit("remove-uploaded-file",{file:n,files:this.uploadedFiles})},clearInputElement:function(){this.$refs.fileInput.value=""},clearIEInput:function(){this.$refs.fileInput&&(this.duplicateIEEvent=!0,this.$refs.fileInput.value="")},formatSize:function(t){var n,i=1024,o=3,a=((n=this.$primevue.config.locale)===null||n===void 0?void 0:n.fileSizeTypes)||["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t===0)return"0 ".concat(a[0]);var s=Math.floor(Math.log(t)/Math.log(i)),l=parseFloat((t/Math.pow(i,s)).toFixed(o));return"".concat(l," ").concat(a[s])},isFileLimitExceeded:function(){return this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount&&this.focused&&(this.focused=!1),this.fileLimit&&this.fileLimit<this.files.length+this.uploadedFileCount},checkFileLimit:function(){this.isFileLimitExceeded()&&this.messages.push(this.invalidFileLimitMessage.replace("{0}",this.fileLimit.toString()))},onMessageClose:function(){this.messages=null}},computed:{isAdvanced:function(){return this.mode==="advanced"},isBasic:function(){return this.mode==="basic"},chooseButtonClass:function(){return[this.cx("chooseButton"),this.class]},basicChooseButtonLabel:function(){return this.auto?this.chooseButtonLabel:this.hasFiles?this.files.map(function(t){return t.name}).join(", "):this.chooseButtonLabel},hasFiles:function(){return this.files&&this.files.length>0},hasUploadedFiles:function(){return this.uploadedFiles&&this.uploadedFiles.length>0},chooseDisabled:function(){return this.disabled||this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount},uploadDisabled:function(){return this.disabled||!this.hasFiles||this.fileLimit&&this.fileLimit<this.files.length},cancelDisabled:function(){return this.disabled||!this.hasFiles},chooseButtonLabel:function(){return this.chooseLabel||this.$primevue.config.locale.choose},uploadButtonLabel:function(){return this.uploadLabel||this.$primevue.config.locale.upload},cancelButtonLabel:function(){return this.cancelLabel||this.$primevue.config.locale.cancel},completedLabel:function(){return this.$primevue.config.locale.completed},pendingLabel:function(){return this.$primevue.config.locale.pending}},components:{FileUploadButton:_i,FileUploadProgressBar:Xg,FileUploadMessage:Cf,FileContent:Qf,PlusIcon:ug,UploadIcon:xf,TimesIcon:ii},directives:{ripple:kn}},qJ=["multiple","accept","disabled"],$J=["accept","disabled","multiple"];function eW(e,t,n,i,o,a){var s=r.resolveComponent("FileUploadButton"),l=r.resolveComponent("FileUploadProgressBar"),c=r.resolveComponent("FileContent"),M=r.resolveComponent("FileUploadMessage"),d=r.resolveDirective("ripple");return a.isAdvanced?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:e.cx("root")},e.ptmi("root")),[r.createElementVNode("input",r.mergeProps({ref:"fileInput",type:"file",onChange:t[0]||(t[0]=function(){return a.onFileSelect&&a.onFileSelect.apply(a,arguments)}),multiple:e.multiple,accept:e.accept,disabled:a.chooseDisabled},e.ptm("input")),null,16,qJ),r.createElementVNode("div",r.mergeProps({class:e.cx("buttonbar")},e.ptm("buttonbar")),[r.renderSlot(e.$slots,"header",{files:o.files,uploadedFiles:o.uploadedFiles,chooseCallback:a.choose,uploadCallback:a.upload,clearCallback:a.clear},function(){return[r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({class:a.chooseButtonClass,style:e.style,onClick:t[1]||(t[1]=function(){return a.choose&&a.choose.apply(a,arguments)}),onKeydown:t[2]||(t[2]=r.withKeys(function(){return a.choose&&a.choose.apply(a,arguments)},["enter"])),onFocus:t[3]||(t[3]=function(){return a.onFocus&&a.onFocus.apply(a,arguments)}),onBlur:t[4]||(t[4]=function(){return a.onBlur&&a.onBlur.apply(a,arguments)}),tabindex:"0"},e.ptm("chooseButton")),[r.renderSlot(e.$slots,"chooseicon",{class:r.normalizeClass(e.cx("chooseIcon"))},function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.chooseIcon?"span":"PlusIcon"),r.mergeProps({class:[e.cx("chooseIcon"),e.chooseIcon],"aria-hidden":"true"},e.ptm("chooseIcon")),null,16,["class"]))]}),r.createElementVNode("span",r.mergeProps({class:e.cx("chooseButtonLabel")},e.ptm("chooseButtonLabel")),r.toDisplayString(a.chooseButtonLabel),17)],16)),[[d]]),e.showUploadButton?(r.openBlock(),r.createBlock(s,{key:0,label:a.uploadButtonLabel,onClick:a.upload,disabled:a.uploadDisabled,unstyled:e.unstyled,pt:e.ptm("uploadButton")},{icon:r.withCtx(function(N){return[r.renderSlot(e.$slots,"uploadicon",{},function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.uploadIcon?"span":"UploadIcon"),r.mergeProps({class:[N.class,e.uploadIcon],"aria-hidden":"true"},e.ptm("uploadButton").icon,{"data-pc-section":"uploadbuttonicon"}),null,16,["class"]))]})]}),_:3},8,["label","onClick","disabled","unstyled","pt"])):r.createCommentVNode("",!0),e.showCancelButton?(r.openBlock(),r.createBlock(s,{key:1,label:a.cancelButtonLabel,onClick:a.clear,disabled:a.cancelDisabled,unstyled:e.unstyled,pt:e.ptm("cancelButton")},{icon:r.withCtx(function(N){return[r.renderSlot(e.$slots,"cancelicon",{},function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.cancelIcon?"span":"TimesIcon"),r.mergeProps({class:[N.class,e.cancelIcon],"aria-hidden":"true"},e.ptm("cancelButton").icon,{"data-pc-section":"cancelbuttonicon"}),null,16,["class"]))]})]}),_:3},8,["label","onClick","disabled","unstyled","pt"])):r.createCommentVNode("",!0)]})],16),r.createElementVNode("div",r.mergeProps({ref:"content",class:e.cx("content"),onDragenter:t[5]||(t[5]=function(){return a.onDragEnter&&a.onDragEnter.apply(a,arguments)}),onDragover:t[6]||(t[6]=function(){return a.onDragOver&&a.onDragOver.apply(a,arguments)}),onDragleave:t[7]||(t[7]=function(){return a.onDragLeave&&a.onDragLeave.apply(a,arguments)}),onDrop:t[8]||(t[8]=function(){return a.onDrop&&a.onDrop.apply(a,arguments)})},e.ptm("content"),{"data-p-highlight":!1}),[r.renderSlot(e.$slots,"content",{files:o.files,uploadedFiles:o.uploadedFiles,removeUploadedFileCallback:a.removeUploadedFile,removeFileCallback:a.remove,progress:o.progress,messages:o.messages},function(){return[a.hasFiles?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(l,{value:o.progress,showValue:!1,unstyled:e.unstyled,pt:e.ptm("progressbar")},null,8,["value","unstyled","pt"]),r.createVNode(c,{files:o.files,onRemove:a.remove,badgeValue:a.pendingLabel,previewWidth:e.previewWidth,templates:e.$slots,unstyled:e.unstyled,pt:e.pt},null,8,["files","onRemove","badgeValue","previewWidth","templates","unstyled","pt"])],64)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.messages,function(N){return r.openBlock(),r.createBlock(M,{key:N,severity:"error",onClose:a.onMessageClose,unstyled:e.unstyled,pt:e.ptm("message")},{default:r.withCtx(function(){return[r.createTextVNode(r.toDisplayString(N),1)]}),_:2},1032,["onClose","unstyled","pt"])}),128)),r.createVNode(c,{files:o.uploadedFiles,onRemove:a.removeUploadedFile,badgeValue:a.completedLabel,badgeSeverity:"success",previewWidth:e.previewWidth,templates:e.$slots,unstyled:e.unstyled,pt:e.pt},null,8,["files","onRemove","badgeValue","previewWidth","templates","unstyled","pt"])]}),e.$slots.empty&&!a.hasFiles&&!a.hasUploadedFiles?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:e.cx("empty")},e.ptm("empty")),[r.renderSlot(e.$slots,"empty")],16)):r.createCommentVNode("",!0)],16)],16)):a.isBasic?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:1,class:e.cx("root")},e.ptmi("root")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.messages,function(N){return r.openBlock(),r.createBlock(M,{key:N,severity:"error",onClose:a.onMessageClose,unstyled:e.unstyled,pt:e.ptm("messages")},{default:r.withCtx(function(){return[r.createTextVNode(r.toDisplayString(N),1)]}),_:2},1032,["onClose","unstyled","pt"])}),128)),r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({class:a.chooseButtonClass,style:e.style,onMouseup:t[12]||(t[12]=function(){return a.onBasicUploaderClick&&a.onBasicUploaderClick.apply(a,arguments)}),onKeydown:t[13]||(t[13]=r.withKeys(function(){return a.choose&&a.choose.apply(a,arguments)},["enter"])),onFocus:t[14]||(t[14]=function(){return a.onFocus&&a.onFocus.apply(a,arguments)}),onBlur:t[15]||(t[15]=function(){return a.onBlur&&a.onBlur.apply(a,arguments)}),tabindex:"0"},e.ptm("chooseButton")),[!a.hasFiles||e.auto?r.renderSlot(e.$slots,"uploadicon",{key:0,class:r.normalizeClass(e.cx("uploadIcon"))},function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.uploadIcon?"span":"UploadIcon"),r.mergeProps({class:[e.cx("uploadIcon"),e.uploadIcon],"aria-hidden":"true"},e.ptm("uploadIcon")),null,16,["class"]))]}):r.renderSlot(e.$slots,"chooseicon",{key:1,class:r.normalizeClass(e.cx("chooseIcon"))},function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.chooseIcon?"span":"PlusIcon"),r.mergeProps({class:[e.cx("chooseIcon"),e.chooseIcon],"aria-hidden":"true"},e.ptm("chooseIcon")),null,16,["class"]))]}),r.createElementVNode("span",r.mergeProps({class:e.cx("label")},e.ptm("label")),r.toDisplayString(a.basicChooseButtonLabel),17),a.hasFiles?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("input",r.mergeProps({key:2,ref:"fileInput",type:"file",accept:e.accept,disabled:e.disabled,multiple:e.multiple,onChange:t[9]||(t[9]=function(){return a.onFileSelect&&a.onFileSelect.apply(a,arguments)}),onFocus:t[10]||(t[10]=function(){return a.onFocus&&a.onFocus.apply(a,arguments)}),onBlur:t[11]||(t[11]=function(){return a.onBlur&&a.onBlur.apply(a,arguments)})},e.ptm("input")),null,16,$J))],16)),[[d]])],16)):r.createCommentVNode("",!0)}kf.render=eW;const tW=r.defineComponent({__name:"InputGroupAddon",props:{pt:{},ptOptions:{},unstyled:{type:Boolean}},setup(e){return(t,n)=>(r.openBlock(),r.createBlock(r.unref(Oa),r.normalizeProps(r.guardReactiveProps(t.$props)),{default:r.withCtx(()=>[r.renderSlot(t.$slots,"default")]),_:3},16))}}),nW={class:"flex flex-row gap-3 items-end"},rW={class:"w-full"},iW={key:0,class:"flex w-full justify-end"},aW={class:"'!mt-0 font-light text-xs text-general-500'"},oW={key:0},sW={key:0,class:"h-[21px]"},lW=1048576,Uf=r.defineComponent({__name:"FileUpload",props:r.mergeModels({accept:{},disabled:{type:Boolean},maxFileSize:{},invalidFileSizeMessage:{},invalidFileTypeMessage:{},label:{default:"Upload File"},withUpload:{type:Boolean,default:!0},uploadLabel:{default:"Upload"},placeholder:{default:"Select File"},fileExtensions:{},fileRequirements:{},uploadFunction:{},useValidator:{type:Boolean},fieldName:{default:"fileUpload"},mandatory:{type:Boolean},useErrorToast:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:r.mergeModels(["select","before-upload","progress","upload","uploader","error","before-send","clear","remove","removeUploadedFile"],["update:modelValue"]),setup(e,{emit:t}){const n=zn(),i=r.useModel(e,"modelValue"),o=e,a=t,s=r.ref(),l=r.ref(),c=r.reactive({value:void 0}),M=r.computed(()=>!!c.errorMessage||(y.value?y.value.length>0:!1)),d=r.ref(!1);r.onMounted(()=>{o.useValidator&&Object.assign(c,Pn(o.fieldName,w=>N(w))),i.value&&(l.value=i.value,s.value=l.value.name)});const N=w=>!(o.mandatory&&!w&&!l.value),h=w=>{var p;try{l.value=w.files[0],s.value=(p=w.files[0])==null?void 0:p.name}catch{}},g=(w,p)=>{if(o.disabled||d.value)return;y.value=void 0,l.value=void 0,s.value=void 0,new Promise((C,S)=>{try{p(),C()}catch(B){S(B)}}).then(()=>{w()})},T=async(w,p)=>{try{d.value=!0,o.uploadFunction&&await o.uploadFunction(w),l.value=void 0,s.value=void 0,p(),d.value=!1}catch(D){throw d.value=!1,D}},y=r.ref(),I=w=>{y.value=w},f=(w,p,D)=>{(w.key==="Enter"||w.key===" ")&&g(p,D)};return r.watch(l,w=>{c.value=w,i.value=w}),r.watch(y,w=>{if(w&&w.length>0){const p=w[0].replace("{2}",o.accept?o.accept:"").replace("{2.1}",o.fileExtensions?o.fileExtensions:"");p.includes("Invalid file size")&&a("error","FILE_SIZE_TOO_LARGE"),o.useErrorToast&&n.add({message:p,severity:"error"})}}),(w,p)=>(r.openBlock(),r.createBlock(r.unref(kf),r.mergeProps(w.$props,{"file-limit":1,onError:p[0]||(p[0]=D=>w.$emit("error",D)),onSelect:h,onUpload:p[1]||(p[1]=D=>w.$emit("upload",D))}),{header:r.withCtx(({files:D,chooseCallback:C,clearCallback:S})=>[r.createElementVNode("div",nW,[r.createElementVNode("div",rW,[r.createVNode(Er,{label:o.label,mandatory:o.mandatory},{default:r.withCtx(()=>[r.createVNode(Li,{disabled:o.disabled||d.value,invalid:M.value,onClick:B=>g(C,S)},{default:r.withCtx(()=>[r.createVNode(tW,null,{default:r.withCtx(()=>[r.createTextVNode("Browse")]),_:1}),r.createVNode(r.unref(xi),{class:r.normalizeClass(s.value?["text-primary-500","dark:text-primary-400"]:""),disabled:o.disabled||d.value,invalid:M.value,"model-value":s.value,placeholder:o.placeholder,onKeydown:r.withModifiers(B=>f(B,C,S),["prevent"]),readonly:""},null,8,["class","disabled","invalid","model-value","placeholder","onKeydown"])]),_:2},1032,["disabled","invalid","onClick"]),o.fileExtensions||o.fileRequirements?(r.openBlock(),r.createElementBlock("div",iW,[r.createElementVNode("small",aW,[w.fileRequirements?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(w.fileRequirements),1)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(o.maxFileSize?`${o.fileExtensions}. max file ${Math.round(o.maxFileSize/lW)} MB`:`${o.fileExtensions} file`),1)],64))])])):r.createCommentVNode("",!0)]),_:2},1032,["label","mandatory"])]),o.withUpload?(r.openBlock(),r.createElementBlock("div",oW,[r.createVNode(tt,{disabled:o.disabled||d.value||!l.value,label:o.uploadLabel,onClick:B=>T(D,S),severity:"success",type:"button"},null,8,["disabled","label","onClick"]),o.fileExtensions?(r.openBlock(),r.createElementBlock("div",sW)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)])]),content:r.withCtx(({messages:D})=>[r.createTextVNode(r.toDisplayString(I(D)),1)]),_:1},16))}}),Sxe="";function bf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function _t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bf(Object(n),!0).forEach(function(i){ai(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bf(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function ai(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cW(e,t){if(e==null)return{};var n,i,o=function(s,l){if(s==null)return{};var c,M,d={},N=Object.keys(s);for(M=0;M<N.length;M++)c=N[M],l.indexOf(c)>=0||(d[c]=s[c]);return d}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function xo(e){return function(t){if(Array.isArray(t))return $g(t)}(e)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||function(t,n){if(t){if(typeof t=="string")return $g(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return $g(t,n)}}(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
498
498
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function $g(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var Of,AW,yM,Un=(Of=function(e){/*!
|