bettertend/frontend/dist/assets/CreateAssetView-WCmUfURR.js

14 lines
38 KiB
JavaScript

import{_ as ie,r as k,c as M,o as re,m as be,a as v,g as i,b as e,j as I,d as u,n as X,i as J,aX as de,t as x,w as f,e as s,F as w,af as ve,aR as me,Q as ge,h as ye,aO as ne,aT as ue,k as y,b5 as xe,v as he,ae as we,aV as ke}from"./index-QAlcqU00.js";import{C as q,c as ae,u as Ce,S as ce,a as Ve,A as $e,b as Se,d as Ae,e as _e}from"./assets-CvfPiugk.js";import{u as Me}from"./locations-ElrWcwNd.js";import{F as U}from"./FPInput-D5RURom0.js";import{F as Ie}from"./FPCard-AB6NRXg5.js";import{F as le}from"./FPSelect-j7n_x8eB.js";import{F as De}from"./FPModal-DMoPysvU.js";import{u as Be,W as je,C as Ee}from"./CustomFieldsForm-BwcGiCuE.js";import"./FPCheckbox-DcRYwN3n.js";const Fe={class:"asset-parent-selector"},Te={key:0,class:"mb-3 p-3 bg-blue-50 border border-blue-200 rounded-lg"},Ue={class:"flex items-center justify-between"},Pe={class:"flex items-center space-x-2"},Oe={class:"font-medium text-gray-900 text-sm"},Re={class:"text-xs text-gray-500"},Le={class:"border border-gray-200 rounded-lg max-h-80 overflow-y-auto"},Ne={key:0,class:"p-4 text-center text-gray-500"},He={key:1,class:"p-4 text-center text-red-600"},ze={class:"text-sm"},qe={key:2,class:"py-1"},We=["onClick","disabled"],Ye=["onClick"],Qe={key:1,class:"w-4 h-4"},Ge={class:"flex-1 min-w-0"},Ke={class:"text-sm font-medium text-gray-900 truncate"},Xe={class:"text-xs text-gray-500"},Ze={key:2,class:"flex-shrink-0"},Je={key:3,class:"p-4 text-center text-gray-500"},et={class:"text-sm"},tt={class:"mt-3 flex items-center justify-between text-xs text-gray-500"},at={class:"flex items-center space-x-4"},st={key:0},lt={__name:"AssetParentSelector",props:{modelValue:{type:[String,Number],default:null},currentAssetId:{type:[String,Number],default:null},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},excludeDescendants:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(j,{emit:H}){const D=j,b=H,{hierarchyOptions:l,flatAssetsList:p,expandedNodes:S,loading:g,error:h,loadAssetHierarchy:$,expandAll:_,collapseAll:E,expandNode:W,collapseNode:O,searchInHierarchy:Y,getHierarchyStats:G,getAssetDescendants:Q}=Be(),P=k(""),R=k(null),B=M(()=>D.modelValue?p.value.find(a=>a.id===D.modelValue):null),F=M(()=>B.value?q[B.value.category]||q[ae.OTHER]:q[ae.OTHER]),A=M(()=>B.value&&{WindIcon:"svg",ArrowUpIcon:"svg",ShieldCheckIcon:"svg",BoltIcon:"svg",WrenchIcon:"svg",CogIcon:"svg",BuildingIcon:"svg",ComputerDesktopIcon:"svg",ExclamationTriangleIcon:"svg",CubeIcon:"svg"}[F.value.icon]||"svg"),z=M(()=>({blue:"text-blue-600",green:"text-green-600",red:"text-red-600",yellow:"text-yellow-600",gray:"text-gray-600",purple:"text-purple-600",orange:"text-orange-600",brown:"text-amber-600"})[F.value.color]||"text-gray-600"),T=M(()=>({blue:"bg-blue-100",green:"bg-green-100",red:"bg-red-100",yellow:"bg-yellow-100",gray:"bg-gray-100",purple:"bg-purple-100",orange:"bg-orange-100",brown:"bg-amber-100"})[F.value.color]||"bg-gray-100"),L=M(()=>{let a=l.value;if(D.currentAssetId&&D.excludeDescendants){const d=Q(D.currentAssetId),c=new Set([D.currentAssetId,...d.map(N=>N.id)]);a=a.filter(N=>!c.has(N.value)).map(N=>({...N,disabled:c.has(N.value)}))}return a}),K=M(()=>G()),ee=a=>{a.disabled||(b("update:modelValue",a.value),b("change",{id:a.value,name:a.title.trim(),category:a.subtitle}))},Z=()=>{b("update:modelValue",null),b("change",null)},te=a=>{S.value.has(a)?O(a):W(a)},r=()=>{R.value&&clearTimeout(R.value),R.value=setTimeout(()=>{P.value?Y(P.value):$()},300)},m=a=>{const d=q[a.subtitle]||q[ae.OTHER];return{WindIcon:"svg",ArrowUpIcon:"svg",ShieldCheckIcon:"svg",BoltIcon:"svg",WrenchIcon:"svg",CogIcon:"svg",BuildingIcon:"svg",ComputerDesktopIcon:"svg",ExclamationTriangleIcon:"svg",CubeIcon:"svg"}[d.icon]||"svg"},V=a=>{const d=q[a.subtitle]||q[ae.OTHER];return{blue:"text-blue-600",green:"text-green-600",red:"text-red-600",yellow:"text-yellow-600",gray:"text-gray-600",purple:"text-purple-600",orange:"text-orange-600",brown:"text-amber-600"}[d.color]||"text-gray-600"},C=a=>{const d=q[a.subtitle]||q[ae.OTHER];return{blue:"bg-blue-100",green:"bg-green-100",red:"bg-red-100",yellow:"bg-yellow-100",gray:"bg-gray-100",purple:"bg-purple-100",orange:"bg-orange-100",brown:"bg-amber-100"}[d.color]||"bg-gray-100"};return re(()=>{$()}),be(()=>L.value,a=>{}),(a,d)=>(i(),v("div",Fe,[d[10]||(d[10]=e("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Parent Asset",-1)),B.value?(i(),v("div",Te,[e("div",Ue,[e("div",Pe,[e("div",{class:X(["w-6 h-6 rounded flex items-center justify-center",T.value])},[(i(),J(de(A.value),{class:X(["w-3 h-3",z.value])},null,8,["class"]))],2),e("div",null,[e("p",Oe,x(B.value.name),1),e("p",Re,x(B.value.path||F.value.label),1)])]),u(s(w),{variant:"ghost",size:"sm",onClick:Z},{default:f(()=>d[3]||(d[3]=[e("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])),_:1,__:[3]})])])):I("",!0),u(s(U),{modelValue:P.value,"onUpdate:modelValue":d[0]||(d[0]=c=>P.value=c),placeholder:"Search for parent asset...",onInput:r,class:"mb-3"},{prepend:f(()=>d[4]||(d[4]=[e("svg",{class:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])),_:1},8,["modelValue"]),e("div",Le,[s(g)?(i(),v("div",Ne,d[5]||(d[5]=[e("svg",{class:"w-5 h-5 animate-spin mx-auto mb-2",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),e("span",{class:"text-sm"},"Loading assets...",-1)]))):s(h)?(i(),v("div",He,[d[6]||(d[6]=e("svg",{class:"w-5 h-5 mx-auto mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e("span",ze,x(s(h)),1)])):s(l).length?(i(),v("div",qe,[(i(!0),v(ve,null,me(s(l),c=>(i(),v("button",{key:c.value,onClick:N=>ee(c),disabled:c.disabled,class:X(["w-full px-3 py-2 text-left hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-2",{"bg-blue-50 border-l-2 border-blue-500":j.modelValue===c.value,"text-gray-400":c.disabled}])},[e("div",{style:ge({width:`${c.depth*16}px`}),class:"flex-shrink-0"},null,4),c.hasChildren?(i(),v("button",{key:0,onClick:ye(N=>te(c.value),["stop"]),class:X(["w-4 h-4 flex items-center justify-center text-gray-400 hover:text-gray-600",{"rotate-90":s(S).has(c.value)}])},d[7]||(d[7]=[e("svg",{class:"w-3 h-3 transition-transform",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)]),10,Ye)):(i(),v("div",Qe)),e("div",{class:X(["w-5 h-5 rounded flex items-center justify-center flex-shrink-0",C(c)])},[(i(),J(de(m(c)),{class:X(["w-3 h-3",V(c)])},null,8,["class"]))],2),e("div",Ge,[e("p",Ke,x(c.title.trim()),1),e("p",Xe,x(c.subtitle),1)]),j.modelValue===c.value?(i(),v("div",Ze,d[8]||(d[8]=[e("svg",{class:"w-4 h-4 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)]))):I("",!0)],10,We))),128))])):(i(),v("div",Je,[d[9]||(d[9]=e("svg",{class:"w-8 h-8 mx-auto mb-2 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})],-1)),e("p",et,x(P.value?"No assets found matching your search":"No assets available"),1)]))]),e("div",tt,[e("div",at,[e("button",{onClick:d[1]||(d[1]=(...c)=>s(_)&&s(_)(...c)),class:"hover:text-gray-700"},"Expand All"),e("button",{onClick:d[2]||(d[2]=(...c)=>s(E)&&s(E)(...c)),class:"hover:text-gray-700"},"Collapse All")]),K.value?(i(),v("div",st,x(K.value.totalAssets)+" assets available ",1)):I("",!0)])]))}},ot=ie(lt,[["__scopeId","data-v-1c5c2d80"]]);function rt(){const j=k(!1),H=k(!1),D=k("prompt"),b=k(null),l=k(null),p=k(null),S=k(null),g=k([]),h=k(null),$=k(!1);let _=null,E=null;const W=M(()=>H.value&&D.value==="granted"),O=M(()=>["CODE128","CODE39","CODE93","EAN8","EAN13","UPC_A","UPC_E","CODABAR","ITF","QR_CODE","DATA_MATRIX","AZTEC","PDF417"]),Y=async()=>{try{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new Error("Camera not supported");return H.value=!0,!0}catch{return H.value=!1,S.value="Camera not supported by this device",!1}},G=async()=>{try{$.value=!0;const r=await navigator.mediaDevices.getUserMedia({video:{facingMode:"environment",width:{ideal:1280},height:{ideal:720}}});return D.value="granted",r.getTracks().forEach(m=>m.stop()),!0}catch{return D.value="denied",S.value="Camera permission denied",!1}finally{$.value=!1}},Q=async()=>{try{const r=await navigator.mediaDevices.enumerateDevices();g.value=r.filter(V=>V.kind==="videoinput");const m=g.value.find(V=>V.label.toLowerCase().includes("back")||V.label.toLowerCase().includes("rear"));return h.value=m||g.value[0]||null,g.value}catch{return S.value="Failed to get camera devices",[]}},P=async(r=null)=>{try{if(j.value||($.value=!0,S.value=null,D.value!=="granted"&&!await G()))return;if(await Q(),!h.value)throw new Error("No camera devices available");const m={video:{deviceId:h.value.deviceId,width:{ideal:1280},height:{ideal:720},facingMode:"environment"}};l.value=await navigator.mediaDevices.getUserMedia(m),r&&(b.value=r),b.value&&(b.value.srcObject=l.value,await b.value.play()),await B(),j.value=!0,F()}catch(m){S.value=m.message||"Failed to start scanning",console.error("Scanner error:",m)}finally{$.value=!1}},R=()=>{j.value=!1,l.value&&(l.value.getTracks().forEach(r=>r.stop()),l.value=null),b.value&&(b.value.srcObject=null),E&&(cancelAnimationFrame(E),E=null),_&&(_=null),S.value=null},B=async()=>(_={decode:r=>null},_),F=()=>{if(!j.value||!b.value)return;const r=()=>{if(j.value)try{const m=document.createElement("canvas"),V=m.getContext("2d");m.width=b.value.videoWidth,m.height=b.value.videoHeight,V.drawImage(b.value,0,0,m.width,m.height);const C=V.getImageData(0,0,m.width,m.height),a=_==null?void 0:_.decode(C);a?A(a):E=requestAnimationFrame(r)}catch(m){console.error("Scan loop error:",m),E=requestAnimationFrame(r)}};E=requestAnimationFrame(r)},A=r=>{p.value={text:r.text,format:r.format,timestamp:new Date().toISOString(),confidence:r.confidence||100},R()},z=async r=>{const m=j.value;m&&R(),h.value=g.value.find(V=>V.deviceId===r)||h.value,m&&await P()},T=(r,m="CODE128")=>`
<svg width="200" height="50" xmlns="http://www.w3.org/2000/svg">
${r.split("").map((d,c)=>{const N=c*200/r.length,oe=200/r.length;return`<rect x="${N}" y="10" width="${oe*.8}" height="30" fill="#000"/>`}).join("")}
<text x="${200/2}" y="45" text-anchor="middle" font-size="10" font-family="monospace">
${r}
</text>
</svg>
`,L=(r,m=200)=>{const V=m/25,C=[];for(let a=0;a<25;a++)for(let d=0;d<25;d++)((d+a)%3===0||d===0||d===24||a===0||a===24||d<7&&a<7||d>17&&a<7||d<7&&a>17)&&C.push(`<rect x="${d*V}" y="${a*V}" width="${V}" height="${V}" fill="#000"/>`);return`
<svg width="${m}" height="${m}" xmlns="http://www.w3.org/2000/svg">
<rect width="${m}" height="${m}" fill="#fff"/>
${C.join("")}
</svg>
`},K=(r,m)=>{const C={CODE128:a=>/^[\x00-\x7F]+$/.test(a),CODE39:a=>/^[A-Z0-9\-. $\/+%*]+$/.test(a),EAN13:a=>/^\d{13}$/.test(a),EAN8:a=>/^\d{8}$/.test(a),UPC_A:a=>/^\d{12}$/.test(a),UPC_E:a=>/^\d{8}$/.test(a),QR_CODE:()=>!0}[m];return C?C(r):!0},ee=r=>r?{...r,isValid:K(r.text,r.format),displayText:r.text,scanTime:new Date(r.timestamp).toLocaleString()}:null,Z=()=>{p.value=null,S.value=null},te=async()=>{if(!b.value)return null;const r=document.createElement("canvas"),m=r.getContext("2d");return r.width=b.value.videoWidth,r.height=b.value.videoHeight,m.drawImage(b.value,0,0,r.width,r.height),r.toDataURL("image/jpeg",.8)};return re(()=>{Y()}),ne(()=>{R()}),{isScanning:j,hasCamera:H,cameraPermission:D,videoElement:b,scanResult:p,error:S,devices:g,selectedDevice:h,loading:$,canScan:W,supportedFormats:O,checkCameraSupport:Y,requestCameraPermission:G,getAvailableDevices:Q,startScanning:P,stopScanning:R,switchCamera:z,generateBarcode:T,generateQRCode:L,validateBarcode:K,formatScanResult:ee,clearResult:Z,takePhoto:te}}const nt={class:"barcode-scanner"},it={class:"flex items-center justify-between mb-4"},dt={class:"text-lg font-medium text-gray-900"},ut={class:"text-sm text-gray-500"},ct={class:"flex items-center space-x-2"},vt={key:0,class:"mb-4 p-3 bg-gray-50 rounded-lg"},mt={key:1,class:"text-center py-8"},gt={key:2,class:"text-center py-8"},pt={key:3,class:"text-center py-8"},ft={key:4,class:"text-center py-8"},bt={key:5,class:"p-4 bg-red-50 border border-red-200 rounded-lg text-red-700"},yt={class:"flex items-center"},xt={class:"mt-3 flex space-x-2"},ht={key:6,class:"space-y-4"},wt={class:"p-4 bg-green-50 border border-green-200 rounded-lg"},kt={class:"flex items-start justify-between"},Ct={class:"flex items-start space-x-3"},Vt={class:"flex-1"},$t={class:"mt-2 space-y-1 text-sm text-green-700"},St={class:"font-mono bg-white px-2 py-1 rounded border"},At={class:"flex items-center space-x-4 text-xs"},_t={key:0},Mt={class:"flex space-x-2"},It={key:7,class:"space-y-4"},Dt={class:"relative bg-black rounded-lg overflow-hidden"},Bt={key:0,class:"absolute inset-0 pointer-events-none"},jt={class:"flex items-center justify-center space-x-4"},Et={class:"text-center"},Ft={class:"text-xs text-gray-500"},Tt={key:0},Ut={key:8,class:"mt-6 p-4 bg-gray-50 rounded-lg border-t"},Pt={class:"space-y-3"},Ot={class:"flex space-x-2"},Rt={__name:"BarcodeScanner",props:{title:{type:String,default:"Barcode Scanner"},description:{type:String,default:"Scan barcodes or QR codes to identify assets"},acceptedFormats:{type:Array,default:()=>[]},autoStart:{type:Boolean,default:!1}},emits:["scan-result","close","error"],setup(j,{emit:H}){const D=j,b=H,{isScanning:l,hasCamera:p,cameraPermission:S,videoElement:g,scanResult:h,error:$,devices:_,selectedDevice:E,loading:W,canScan:O,supportedFormats:Y,requestCameraPermission:G,startScanning:Q,stopScanning:P,switchCamera:R,formatScanResult:B,clearResult:F}=rt(),A=k(null),z=k(!1),T=k(!1),L=k(""),K=M(()=>_.value.map(C=>({value:C.deviceId,label:C.label||`Camera ${C.deviceId.slice(0,8)}...`}))),ee=async C=>{await R(C),z.value=!1},Z=()=>{h.value&&(b("scan-result",B(h.value)),F())},te=()=>{F(),Q(A.value)},r=()=>{if(L.value.trim()){const C={text:L.value.trim(),format:"MANUAL",timestamp:new Date().toISOString(),confidence:100};b("scan-result",B(C)),L.value="",T.value=!1}},m=()=>{h.value&&D.autoStart&&Z()},V=()=>{$.value&&b("error",$.value)};return re(()=>{g.value=A.value,D.autoStart&&O.value&&Q(A.value);const C=watch(()=>h.value,m),a=watch(()=>$.value,V);ne(()=>{C(),a()})}),ne(()=>{P()}),(C,a)=>{var d;return i(),v("div",nt,[e("div",it,[e("div",null,[e("h3",dt,x(j.title),1),e("p",ut,x(j.description),1)]),e("div",ct,[s(_).length>1?(i(),J(s(w),{key:0,variant:"ghost",size:"sm",onClick:a[0]||(a[0]=c=>z.value=!z.value)},{default:f(()=>a[8]||(a[8]=[e("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])),_:1,__:[8]})):I("",!0),u(s(w),{variant:"ghost",size:"sm",onClick:a[1]||(a[1]=c=>C.$emit("close"))},{default:f(()=>a[9]||(a[9]=[e("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])),_:1,__:[9]})])]),z.value&&s(_).length>1?(i(),v("div",vt,[a[10]||(a[10]=e("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Select Camera",-1)),u(s(le),{modelValue:(d=s(E))==null?void 0:d.deviceId,options:K.value,"onUpdate:modelValue":ee,class:"w-full"},null,8,["modelValue","options"])])):I("",!0),s(S)==="prompt"?(i(),v("div",mt,[a[12]||(a[12]=ue('<svg class="w-16 h-16 mx-auto mb-4 text-gray-300" fill="none" viewBox="0 0 24 24" stroke="currentColor" data-v-8cee4ab0><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z" data-v-8cee4ab0></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 13a3 3 0 11-6 0 3 3 0 016 0z" data-v-8cee4ab0></path></svg><h4 class="text-lg font-medium text-gray-900 mb-2" data-v-8cee4ab0>Camera Access Required</h4><p class="text-gray-500 mb-4" data-v-8cee4ab0>Allow camera access to scan barcodes and QR codes</p>',3)),u(s(w),{onClick:s(G),loading:s(W)},{default:f(()=>a[11]||(a[11]=[y(" Grant Camera Access ",-1)])),_:1,__:[11]},8,["onClick","loading"])])):s(S)==="denied"?(i(),v("div",gt,[a[14]||(a[14]=e("svg",{class:"w-16 h-16 mx-auto mb-4 text-red-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728L5.636 5.636m12.728 12.728L18.364 5.636M5.636 18.364l12.728-12.728"})],-1)),a[15]||(a[15]=e("h4",{class:"text-lg font-medium text-red-900 mb-2"},"Camera Access Denied",-1)),a[16]||(a[16]=e("p",{class:"text-red-600 mb-4"},"Please enable camera access in your browser settings and refresh the page",-1)),u(s(w),{variant:"secondary",onClick:s(G)},{default:f(()=>a[13]||(a[13]=[y(" Try Again ",-1)])),_:1,__:[13]},8,["onClick"])])):s(p)?s(W)?(i(),v("div",ft,a[21]||(a[21]=[e("div",{class:"flex items-center justify-center space-x-2 text-gray-500"},[e("svg",{class:"w-8 h-8 animate-spin",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]),e("span",null,"Starting camera...")],-1)]))):s($)?(i(),v("div",bt,[e("div",yt,[a[22]||(a[22]=e("svg",{class:"w-5 h-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),y(" "+x(s($)),1)]),e("div",xt,[u(s(w),{variant:"secondary",size:"sm",onClick:s(F)},{default:f(()=>a[23]||(a[23]=[y(" Clear Error ",-1)])),_:1,__:[23]},8,["onClick"]),u(s(w),{variant:"secondary",size:"sm",onClick:a[3]||(a[3]=c=>T.value=!T.value)},{default:f(()=>a[24]||(a[24]=[y(" Enter Manually ",-1)])),_:1,__:[24]})])])):s(h)?(i(),v("div",ht,[e("div",wt,[e("div",kt,[e("div",Ct,[a[26]||(a[26]=e("svg",{class:"w-6 h-6 text-green-500 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e("div",Vt,[a[25]||(a[25]=e("h4",{class:"font-medium text-green-800"},"Code Scanned Successfully",-1)),e("div",$t,[e("div",St,x(s(B)(s(h)).displayText),1),e("div",At,[e("span",null,"Format: "+x(s(h).format),1),e("span",null,"Time: "+x(s(B)(s(h)).scanTime),1),s(h).confidence?(i(),v("span",_t,"Confidence: "+x(Math.round(s(h).confidence))+"%",1)):I("",!0)])])])]),u(s(w),{variant:"ghost",size:"sm",onClick:s(F)},{default:f(()=>a[27]||(a[27]=[e("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])),_:1,__:[27]},8,["onClick"])])]),e("div",Mt,[u(s(w),{onClick:Z,class:"flex-1"},{default:f(()=>a[28]||(a[28]=[y(" Use This Code ",-1)])),_:1,__:[28]}),u(s(w),{variant:"secondary",onClick:te,class:"flex-1"},{default:f(()=>a[29]||(a[29]=[y(" Scan Again ",-1)])),_:1,__:[29]})])])):s(O)?(i(),v("div",It,[e("div",Dt,[e("video",{ref_key:"videoRef",ref:A,class:"w-full h-64 md:h-80 object-cover",autoplay:"",muted:"",playsinline:""},null,512),s(l)?(i(),v("div",Bt,a[30]||(a[30]=[ue('<div class="absolute inset-4 border-2 border-white rounded-lg" data-v-8cee4ab0><div class="absolute top-0 left-0 w-6 h-6 border-t-4 border-l-4 border-blue-500 rounded-tl-lg" data-v-8cee4ab0></div><div class="absolute top-0 right-0 w-6 h-6 border-t-4 border-r-4 border-blue-500 rounded-tr-lg" data-v-8cee4ab0></div><div class="absolute bottom-0 left-0 w-6 h-6 border-b-4 border-l-4 border-blue-500 rounded-bl-lg" data-v-8cee4ab0></div><div class="absolute bottom-0 right-0 w-6 h-6 border-b-4 border-r-4 border-blue-500 rounded-br-lg" data-v-8cee4ab0></div></div><div class="absolute inset-4 overflow-hidden rounded-lg" data-v-8cee4ab0><div class="scan-line" data-v-8cee4ab0></div></div><div class="absolute bottom-6 left-1/2 transform -translate-x-1/2" data-v-8cee4ab0><div class="bg-black bg-opacity-75 text-white px-3 py-2 rounded-lg text-sm" data-v-8cee4ab0> Position barcode or QR code within the frame </div></div>',3)]))):I("",!0)]),e("div",jt,[s(l)?(i(),J(s(w),{key:1,onClick:s(P),variant:"secondary",class:"flex-1"},{default:f(()=>a[32]||(a[32]=[e("svg",{class:"w-5 h-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),y(" Stop Scanning ",-1)])),_:1,__:[32]},8,["onClick"])):(i(),J(s(w),{key:0,onClick:a[4]||(a[4]=c=>s(Q)(A.value)),loading:s(W),class:"flex-1"},{default:f(()=>a[31]||(a[31]=[e("svg",{class:"w-5 h-5 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),y(" Start Scanning ",-1)])),_:1,__:[31]},8,["loading"])),u(s(w),{variant:"ghost",onClick:a[5]||(a[5]=c=>T.value=!T.value)},{default:f(()=>a[33]||(a[33]=[e("svg",{class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)])),_:1,__:[33]})]),e("div",Et,[e("p",Ft,[y(" Supports: "+x(s(Y).slice(0,5).join(", "))+" ",1),s(Y).length>5?(i(),v("span",Tt,"and "+x(s(Y).length-5)+" more",1)):I("",!0)])])])):I("",!0):(i(),v("div",pt,[a[18]||(a[18]=e("svg",{class:"w-16 h-16 mx-auto mb-4 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),a[19]||(a[19]=e("h4",{class:"text-lg font-medium text-gray-900 mb-2"},"Camera Not Supported",-1)),a[20]||(a[20]=e("p",{class:"text-gray-500 mb-4"},"Your device doesn't support camera access for barcode scanning",-1)),u(s(w),{variant:"secondary",onClick:a[2]||(a[2]=c=>T.value=!T.value)},{default:f(()=>a[17]||(a[17]=[y(" Enter Code Manually ",-1)])),_:1,__:[17]})])),T.value?(i(),v("div",Ut,[a[36]||(a[36]=e("h4",{class:"font-medium text-gray-900 mb-3"},"Enter Code Manually",-1)),e("div",Pt,[u(s(U),{modelValue:L.value,"onUpdate:modelValue":a[6]||(a[6]=c=>L.value=c),placeholder:"Enter barcode or QR code",onKeyup:xe(r,["enter"])},null,8,["modelValue"]),e("div",Ot,[u(s(w),{onClick:r,disabled:!L.value.trim(),class:"flex-1"},{default:f(()=>a[34]||(a[34]=[y(" Use This Code ",-1)])),_:1,__:[34]},8,["disabled"]),u(s(w),{variant:"secondary",onClick:a[7]||(a[7]=c=>T.value=!1)},{default:f(()=>a[35]||(a[35]=[y(" Cancel ",-1)])),_:1,__:[35]})])])])):I("",!0)])}}},Lt=ie(Rt,[["__scopeId","data-v-8cee4ab0"]]),Nt={class:"create-asset-view"},Ht={class:"flex items-center justify-between mb-6"},zt={class:"flex items-center space-x-3"},qt={class:"mb-8"},Wt={class:"flex items-center justify-between text-sm text-gray-500 mb-2"},Yt={class:"w-full bg-gray-200 rounded-full h-2"},Qt={class:"flex items-center justify-center mb-8"},Gt={class:"flex space-x-8","aria-label":"Progress"},Kt=["onClick"],Xt={key:0,class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Zt={key:1},Jt={class:"max-w-4xl mx-auto"},ea={key:0,class:"space-y-6"},ta={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},aa={class:"md:col-span-2"},sa={key:0,class:"mt-1 text-sm text-red-600"},la={class:"border-t pt-6"},oa={class:"flex items-center justify-between mb-4"},ra={key:0,class:"mt-4"},na={key:1,class:"space-y-6"},ia={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},da={class:"border-t pt-6"},ua={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ca={key:2,class:"space-y-6"},va={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ma={key:3,class:"space-y-6"},ga={key:4,class:"space-y-6"},pa={class:"flex items-center justify-between pt-6 border-t"},fa={key:1},ba={class:"flex items-center space-x-3"},ya={class:"space-y-4"},xa={class:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm"},ha={key:0},wa={__name:"CreateAssetView",setup(j){const H=he(),D=Ce(),b=Me(),l=k({..._e}),p=k({}),S=k(!1),g=k(1),h=k(!1),$=k(!1),_=k({isValid:!0,errors:{}}),E=k({isValid:!0,errors:{}}),W=k([{id:"basic",title:"Basic Info",required:!0},{id:"physical",title:"Physical Details",required:!1},{id:"financial",title:"Financial",required:!1},{id:"warranty",title:"Warranty",required:!1},{id:"custom",title:"Custom Fields",required:!1}]),O=M(()=>W.value.length),Y=M(()=>Object.entries(q).map(([n,t])=>({value:n,label:t.label}))),G=M(()=>Object.entries(ce).map(([n,t])=>({value:n,label:t.label}))),Q=M(()=>Object.entries(Ve).map(([n,t])=>({value:n,label:t.label}))),P=M(()=>b.locations.map(n=>({value:n.id,label:n.name}))),R=M(()=>"Parent Asset Name"),B=M(()=>{switch(g.value){case 1:return z();case 2:return T();case 3:return L();case 4:return _.value.isValid;case 5:return E.value.isValid;default:return!0}}),F=M(()=>z()&&_.value.isValid&&E.value.isValid),A=n=>{const t=Ae[n];if(!t)return;const o=l.value[n];if(t.required&&(!o||o.toString().trim()==="")){p.value[n]=`${n} is required`;return}if(t.minLength&&o&&o.length<t.minLength){p.value[n]=`Minimum ${t.minLength} characters required`;return}if(t.maxLength&&o&&o.length>t.maxLength){p.value[n]=`Maximum ${t.maxLength} characters allowed`;return}delete p.value[n]},z=()=>(A("name"),A("category"),A("status"),A("criticality"),!["name","category","status","criticality"].some(t=>p.value[t])),T=()=>!0,L=()=>!0,K=()=>{const n=Date.now().toString().slice(-6),t=l.value.category?l.value.category.slice(0,3).toUpperCase():"AST";l.value.assetNumber=`${t}-${n}`},ee=n=>n<g.value?"text-blue-600 cursor-pointer":n===g.value?"text-blue-600":"text-gray-400",Z=n=>n<g.value?"border-blue-600 bg-blue-600 text-white":n===g.value?"border-blue-600 text-blue-600":"border-gray-300 text-gray-400",te=n=>{(n<=g.value||n===g.value+1&&B.value)&&(g.value=n)},r=()=>{B.value&&g.value<O.value&&g.value++},m=()=>{g.value>1&&g.value--},V=n=>{l.value.barcode=n.text,$.value=!1},C=n=>{l.value.parentAsset=n?{id:n.id}:null},a=n=>{_.value=n},d=n=>{E.value=n},c=n=>{var t;return((t=q[n])==null?void 0:t.label)||n},N=n=>{var t;return((t=ce[n])==null?void 0:t.label)||n},oe=()=>{F.value&&(h.value=!0)},pe=async()=>{try{S.value=!0;const n=await D.createAsset(l.value);h.value=!1,H.push({name:"AssetDetail",params:{id:n.id}})}catch(n){console.error("Failed to create asset:",n)}finally{S.value=!1}},fe=()=>{H.push({name:"AssetsList"})};return re(()=>{b.locations.length===0&&b.loadLocations(),l.value.status=$e.OPERATIONAL,l.value.criticality=Se.MEDIUM,l.value.category=ae.OTHER}),(n,t)=>(i(),v("div",Nt,[e("div",Ht,[t[32]||(t[32]=e("div",null,[e("h1",{class:"text-2xl font-bold text-gray-900"},"Create New Asset"),e("p",{class:"text-gray-600 mt-1"},"Add a new asset to your inventory with comprehensive details")],-1)),e("div",zt,[u(s(w),{variant:"ghost",onClick:fe},{default:f(()=>t[30]||(t[30]=[y(" Cancel ",-1)])),_:1,__:[30]}),u(s(w),{onClick:oe,loading:S.value,disabled:!F.value},{default:f(()=>t[31]||(t[31]=[y(" Create Asset ",-1)])),_:1,__:[31]},8,["loading","disabled"])])]),e("div",qt,[e("div",Wt,[e("span",null,"Step "+x(g.value)+" of "+x(O.value),1),e("span",null,x(Math.round(g.value/O.value*100))+"% Complete",1)]),e("div",Yt,[e("div",{class:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:ge({width:`${g.value/O.value*100}%`})},null,4)])]),e("div",Qt,[e("nav",Gt,[(i(!0),v(ve,null,me(W.value,(o,se)=>(i(),v("button",{key:o.id,onClick:ka=>te(se+1),class:X(["flex items-center text-sm font-medium",ee(se+1)])},[e("span",{class:X(["flex items-center justify-center w-8 h-8 rounded-full border-2 mr-3",Z(se+1)])},[se+1<g.value?(i(),v("svg",Xt,t[33]||(t[33]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):(i(),v("span",Zt,x(se+1),1))],2),y(" "+x(o.title),1)],10,Kt))),128))])]),e("div",Jt,[u(s(Ie),{class:"p-6"},{default:f(()=>[g.value===1?(i(),v("div",ea,[t[38]||(t[38]=e("div",{class:"border-b pb-4 mb-6"},[e("h2",{class:"text-xl font-semibold text-gray-900"},"Basic Information"),e("p",{class:"text-gray-600 mt-1"},"Essential details about the asset")],-1)),e("div",ta,[u(s(U),{modelValue:l.value.name,"onUpdate:modelValue":t[0]||(t[0]=o=>l.value.name=o),label:"Asset Name",placeholder:"Enter asset name",required:!0,error:p.value.name,onBlur:t[1]||(t[1]=o=>A("name"))},null,8,["modelValue","error"]),u(s(U),{modelValue:l.value.assetNumber,"onUpdate:modelValue":t[2]||(t[2]=o=>l.value.assetNumber=o),label:"Asset Number",placeholder:"Unique identifier (auto-generated if empty)",error:p.value.assetNumber,onBlur:t[3]||(t[3]=o=>A("assetNumber"))},{append:f(()=>[u(s(w),{variant:"ghost",size:"sm",onClick:K},{default:f(()=>t[34]||(t[34]=[y(" Generate ",-1)])),_:1,__:[34]})]),_:1},8,["modelValue","error"]),e("div",aa,[t[35]||(t[35]=e("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Description",-1)),we(e("textarea",{"onUpdate:modelValue":t[4]||(t[4]=o=>l.value.description=o),class:X(["w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500",{"border-red-300":p.value.description}]),placeholder:"Describe the asset's purpose and characteristics",rows:"3",onBlur:t[5]||(t[5]=o=>A("description"))},null,34),[[ke,l.value.description]]),p.value.description?(i(),v("p",sa,x(p.value.description),1)):I("",!0)]),u(s(le),{modelValue:l.value.category,"onUpdate:modelValue":t[6]||(t[6]=o=>l.value.category=o),label:"Category",placeholder:"Select asset category",options:Y.value,required:!0,error:p.value.category,onChange:t[7]||(t[7]=o=>A("category"))},null,8,["modelValue","options","error"]),u(s(U),{modelValue:l.value.subcategory,"onUpdate:modelValue":t[8]||(t[8]=o=>l.value.subcategory=o),label:"Subcategory",placeholder:"Specific type within category",error:p.value.subcategory},null,8,["modelValue","error"]),u(s(le),{modelValue:l.value.status,"onUpdate:modelValue":t[9]||(t[9]=o=>l.value.status=o),label:"Status",placeholder:"Select current status",options:G.value,required:!0,error:p.value.status,onChange:t[10]||(t[10]=o=>A("status"))},null,8,["modelValue","options","error"]),u(s(le),{modelValue:l.value.criticality,"onUpdate:modelValue":t[11]||(t[11]=o=>l.value.criticality=o),label:"Criticality",placeholder:"Select criticality level",options:Q.value,required:!0,error:p.value.criticality,onChange:t[12]||(t[12]=o=>A("criticality"))},null,8,["modelValue","options","error"])]),e("div",la,[e("div",oa,[t[37]||(t[37]=e("div",null,[e("h3",{class:"text-lg font-medium text-gray-900"},"Barcode/QR Code"),e("p",{class:"text-gray-600 text-sm"},"Scan or enter barcode for quick identification")],-1)),u(s(w),{variant:"secondary",onClick:t[13]||(t[13]=o=>$.value=!$.value)},{default:f(()=>[t[36]||(t[36]=e("svg",{class:"w-4 h-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),y(" "+x($.value?"Hide":"Scan")+" Barcode ",1)]),_:1,__:[36]})]),u(s(U),{modelValue:l.value.barcode,"onUpdate:modelValue":t[14]||(t[14]=o=>l.value.barcode=o),label:"Barcode/QR Code",placeholder:"Enter or scan barcode",error:p.value.barcode},null,8,["modelValue","error"]),$.value?(i(),v("div",ra,[u(Lt,{title:"Scan Asset Barcode",description:"Position the barcode within the frame",onScanResult:V,onClose:t[15]||(t[15]=o=>$.value=!1)})])):I("",!0)])])):I("",!0),g.value===2?(i(),v("div",na,[t[41]||(t[41]=e("div",{class:"border-b pb-4 mb-6"},[e("h2",{class:"text-xl font-semibold text-gray-900"},"Physical Details"),e("p",{class:"text-gray-600 mt-1"},"Manufacturer information and specifications")],-1)),e("div",ia,[u(s(U),{modelValue:l.value.manufacturer,"onUpdate:modelValue":t[16]||(t[16]=o=>l.value.manufacturer=o),label:"Manufacturer",placeholder:"Asset manufacturer",error:p.value.manufacturer},null,8,["modelValue","error"]),u(s(U),{modelValue:l.value.model,"onUpdate:modelValue":t[17]||(t[17]=o=>l.value.model=o),label:"Model",placeholder:"Model number or name",error:p.value.model},null,8,["modelValue","error"]),u(s(U),{modelValue:l.value.serialNumber,"onUpdate:modelValue":t[18]||(t[18]=o=>l.value.serialNumber=o),label:"Serial Number",placeholder:"Unique serial number",error:p.value.serialNumber},null,8,["modelValue","error"]),u(s(U),{modelValue:l.value.modelYear,"onUpdate:modelValue":t[19]||(t[19]=o=>l.value.modelYear=o),modelModifiers:{number:!0},type:"number",label:"Model Year",placeholder:"Year of manufacture",min:1900,max:new Date().getFullYear()+1,error:p.value.modelYear},null,8,["modelValue","max","error"])]),e("div",da,[t[40]||(t[40]=e("h3",{class:"text-lg font-medium text-gray-900 mb-4"},"Location & Hierarchy",-1)),e("div",ua,[u(s(le),{modelValue:l.value.location,"onUpdate:modelValue":t[20]||(t[20]=o=>l.value.location=o),label:"Location",placeholder:"Select asset location",options:P.value,error:p.value.location},null,8,["modelValue","options","error"]),e("div",null,[t[39]||(t[39]=e("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Parent Asset",-1)),u(ot,{modelValue:l.value.parentAsset,"onUpdate:modelValue":t[21]||(t[21]=o=>l.value.parentAsset=o),disabled:!1,onChange:C},null,8,["modelValue"])])])])])):I("",!0),g.value===3?(i(),v("div",ca,[t[42]||(t[42]=e("div",{class:"border-b pb-4 mb-6"},[e("h2",{class:"text-xl font-semibold text-gray-900"},"Financial Information"),e("p",{class:"text-gray-600 mt-1"},"Purchase details and financial tracking")],-1)),e("div",va,[u(s(U),{modelValue:l.value.purchasePrice,"onUpdate:modelValue":t[22]||(t[22]=o=>l.value.purchasePrice=o),modelModifiers:{number:!0},type:"number",label:"Purchase Price",placeholder:"0.00",step:"0.01",min:"0",error:p.value.purchasePrice},null,8,["modelValue","error"]),u(s(U),{modelValue:l.value.currentValue,"onUpdate:modelValue":t[23]||(t[23]=o=>l.value.currentValue=o),modelModifiers:{number:!0},type:"number",label:"Current Value",placeholder:"0.00",step:"0.01",min:"0",error:p.value.currentValue},null,8,["modelValue","error"]),u(s(U),{modelValue:l.value.purchaseDate,"onUpdate:modelValue":t[24]||(t[24]=o=>l.value.purchaseDate=o),type:"date",label:"Purchase Date",error:p.value.purchaseDate},null,8,["modelValue","error"]),u(s(U),{modelValue:l.value.installationDate,"onUpdate:modelValue":t[25]||(t[25]=o=>l.value.installationDate=o),type:"date",label:"Installation Date",error:p.value.installationDate},null,8,["modelValue","error"])])])):I("",!0),g.value===4?(i(),v("div",ma,[t[43]||(t[43]=e("div",{class:"border-b pb-4 mb-6"},[e("h2",{class:"text-xl font-semibold text-gray-900"},"Warranty Information"),e("p",{class:"text-gray-600 mt-1"},"Warranty coverage and provider details")],-1)),u(je,{modelValue:l.value.warranty,"onUpdate:modelValue":t[26]||(t[26]=o=>l.value.warranty=o),onValidationChange:a},null,8,["modelValue"])])):I("",!0),g.value===5?(i(),v("div",ga,[t[44]||(t[44]=e("div",{class:"border-b pb-4 mb-6"},[e("h2",{class:"text-xl font-semibold text-gray-900"},"Additional Properties"),e("p",{class:"text-gray-600 mt-1"},"Custom fields and extended information")],-1)),u(Ee,{modelValue:l.value.customFields,"onUpdate:modelValue":t[27]||(t[27]=o=>l.value.customFields=o),onValidationChange:d},null,8,["modelValue"])])):I("",!0),e("div",pa,[g.value>1?(i(),J(s(w),{key:0,variant:"secondary",onClick:m},{default:f(()=>t[45]||(t[45]=[e("svg",{class:"w-4 h-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),y(" Previous ",-1)])),_:1,__:[45]})):(i(),v("div",fa)),e("div",ba,[g.value<O.value?(i(),J(s(w),{key:0,onClick:r,disabled:!B.value},{default:f(()=>t[46]||(t[46]=[y(" Next ",-1),e("svg",{class:"w-4 h-4 ml-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])),_:1,__:[46]},8,["disabled"])):(i(),J(s(w),{key:1,onClick:oe,loading:S.value,disabled:!F.value},{default:f(()=>t[47]||(t[47]=[y(" Create Asset ",-1)])),_:1,__:[47]},8,["loading","disabled"]))])])]),_:1})]),u(s(De),{modelValue:h.value,"onUpdate:modelValue":t[29]||(t[29]=o=>h.value=o),title:"Confirm Asset Creation"},{content:f(()=>[e("div",ya,[t[52]||(t[52]=e("p",{class:"text-gray-600"}," Are you sure you want to create this asset with the following details? ",-1)),e("div",xa,[e("div",null,[t[48]||(t[48]=e("strong",null,"Name:",-1)),y(" "+x(l.value.name),1)]),e("div",null,[t[49]||(t[49]=e("strong",null,"Category:",-1)),y(" "+x(c(l.value.category)),1)]),e("div",null,[t[50]||(t[50]=e("strong",null,"Status:",-1)),y(" "+x(N(l.value.status)),1)]),l.value.parentAsset?(i(),v("div",ha,[t[51]||(t[51]=e("strong",null,"Parent:",-1)),y(" "+x(R.value),1)])):I("",!0)])])]),actions:f(()=>[u(s(w),{variant:"secondary",onClick:t[28]||(t[28]=o=>h.value=!1)},{default:f(()=>t[53]||(t[53]=[y(" Cancel ",-1)])),_:1,__:[53]}),u(s(w),{onClick:pe,loading:S.value},{default:f(()=>t[54]||(t[54]=[y(" Create Asset ",-1)])),_:1,__:[54]},8,["loading"])]),_:1},8,["modelValue"])]))}},Ba=ie(wa,[["__scopeId","data-v-82f99eaf"]]);export{Ba as default};