PageSourceSearch

https://handymesh.com/_next/static/chunks/pages/mesh/job-board/quo…/[quotationId]/edit-672b0b4c6194f95a.js

js handymesh.com collected 2026-09-24 14:45:05 UTC 24,657 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cd71aeb8-74ae-4854-89b3-b74348a84127",e._sentryDebugIdIdentifier="sentry-dbid-cd71aeb8-74ae-4854-89b3-b74348a84127")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2384],{56524:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var n=r(84913),i=r(67294),o=["variant","color","size"],a=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{fill:t,d:"M13.978 5.319l-3.21 3.21-1.97 1.96a2.13 2.13 0 000 3.01l5.18 5.18c.68.68 1.84.19 1.84-.76V6.079c0-.96-1.16-1.44-1.84-.76z"}))},c=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"1.5",d:"M11.19 7.94l-2.62 2.62c-.77.77-.77 2.03 0 2.8l6.52 6.52M15.09 4.04l-1.04 1.04"}))},l=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{fill:t,d:"M10.77 8.52l5.05 3.79v5.61c0 .96-1.16 1.44-1.84.76L8.8 13.51a2.13 2.13 0 010-3.01l1.97-1.98z",opacity:".4"}),i.createElement("path",{fill:t,d:"M15.82 6.08v6.23l-5.05-3.79 3.21-3.21c.68-.67 1.84-.19 1.84.77z"}))},s=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"1.5",d:"M15 19.92L8.48 13.4c-.77-.77-.77-2.03 0-2.8L15 4.08"}))},d=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{fill:t,d:"M15 20.67c-.19 0-.38-.07-.53-.22l-6.52-6.52a2.74 2.74 0 010-3.86l6.52-6.52c.29-.29.77-.29 1.06 0 .29.29.29.77 0 1.06l-6.52 6.52c-.48.48-.48 1.26 0 1.74l6.52 6.52c.29.29.29.77 0 1.06-.15.14-.34.22-.53.22z"}))},u=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"1.5",d:"M15 19.92L8.48 13.4c-.77-.77-.77-2.03 0-2.8L15 4.08"}))},h=function(e,t){switch(e){case"Bold":return i.createElement(a,{color:t});case"Broken":return i.createElement(c,{color:t});case"Bulk":return i.createElement(l,{color:t});case"Linear":default:return i.createElement(s,{color:t});case"Outline":return i.createElement(d,{color:t});case"TwoTone":return i.createElement(u,{color:t})}},m=(0,i.forwardRef)(function(e,t){var r=e.variant,a=e.color,c=e.size,l=void 0===c?"24":c,s=(0,n._)(e,o);return i.createElement("svg",(0,n.a)({},s,{xmlns:"http://www.w3.org/2000/svg",ref:t,width:l,height:l,viewBox:"0 0 24 24",fill:"none"}),h(void 0===r?"Linear":r,void 0===a?"currentColor":a))});m.displayName="ArrowLeft2"},22768:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var n=r(84913),i=r(67294),o=["variant","color","size"],a=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{d:"M15.8 2.21c-.41-.41-1.12-.13-1.12.44v3.49c0 1.46 1.24 2.67 2.75 2.67.95.01 2.27.01 3.4.01.57 0 .87-.67.47-1.07-1.44-1.45-4.02-4.06-5.5-5.54Z",fill:t}),i.createElement("path",{d:"M20.5 10.19h-2.89c-2.37 0-4.3-1.93-4.3-4.3V3c0-.55-.45-1-1-1H8.07C4.99 2 2.5 4 2.5 7.57v8.86C2.5 20 4.99 22 8.07 22h7.86c3.08 0 5.57-2 5.57-5.57v-5.24c0-.55-.45-1-1-1Zm-9 7.56h-4c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h4c.41 0 .75.34.75.75s-.34.75-.75.75Zm2-4h-6c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h6c.41 0 .75.34.75.75s-.34.75-.75.75Z",fill:t}))},c=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{d:"M12 13h1M7 13h2.45M7 17h4M2 9c0-5 2-7 7-7h5M22 10v5c0 5-2 7-7 7H9c-5 0-7-2-7-7v-2.02M18 10c-3 0-4-1-4-4V2l8 8",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},l=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{opacity:".4",d:"M20.5 10.19h-2.89c-2.37 0-4.3-1.93-4.3-4.3V3c0-.55-.45-1-1-1H8.07C4.99 2 2.5 4 2.5 7.57v8.86C2.5 20 4.99 22 8.07 22h7.86c3.08 0 5.57-2 5.57-5.57v-5.24c0-.55-.45-1-1-1Z",fill:t}),i.createElement("path",{d:"M15.8 2.21c-.41-.41-1.12-.13-1.12.44v3.49c0 1.46 1.24 2.67 2.75 2.67.95.01 2.27.01 3.4.01.57 0 .87-.67.47-1.07-1.44-1.45-4.02-4.06-5.5-5.54ZM13.5 13.75h-6c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h6c.41 0 .75.34.75.75s-.34.75-.75.75ZM11.5 17.75h-4c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h4c.41 0 .75.34.75.75s-.34.75-.75.75Z",fill:t}))},s=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{d:"M21 7v10c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5V7c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5Z",stroke:t,strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M14.5 4.5v2c0 1.1.9 2 2 2h2M8 13h4M8 17h8",stroke:t,strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"}))},d=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{d:"M16 22.75H8c-3.65 0-5.75-2.1-5.75-5.75V7c0-3.65 2.1-5.75 5.75-5.75h8c3.65 0 5.75 2.1 5.75 5.75v10c0 3.65-2.1 5.75-5.75 5.75Zm-8-20C5.14 2.75 3.75 4.14 3.75 7v10c0 2.8
16 1.39 4.25 4.25 4.25h8c2.86 0 4.25-1.39 4.25-4.25V7c0-2.86-1.39-4.25-4.25-4.25H8Z",fill:t}),i.createElement("path",{d:"M18.5 9.25h-2c-1.52 0-2.75-1.23-2.75-2.75v-2c0-.41.34-.75.75-.75s.75.34.75.75v2c0 .69.56 1.25 1.25 1.25h2c.41 0 .75.34.75.75s-.34.75-.75.75ZM12 13.75H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h4c.41 0 .75.34.75.75s-.34.75-.75.75ZM16 17.75H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h8c.41 0 .75.34.75.75s-.34.75-.75.75Z",fill:t}))},u=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{d:"M21 7v10c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5V7c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5Z",stroke:t,strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{opacity:".4",d:"M14.5 4.5v2c0 1.1.9 2 2 2h2M8 13h4M8 17h8",stroke:t,strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"}))},h=function(e,t){switch(e){case"Bold":return i.createElement(a,{color:t});case"Broken":return i.createElement(c,{color:t});case"Bulk":return i.createElement(l,{color:t});case"Linear":default:return i.createElement(s,{color:t});case"Outline":return i.createElement(d,{color:t});case"TwoTone":return i.createElement(u,{color:t})}},m=(0,i.forwardRef)(function(e,t){var r=e.variant,a=e.color,c=e.size,l=void 0===c?"24":c,s=(0,n._)(e,o);return i.createElement("svg",(0,n.a)({},s,{xmlns:"http://www.w3.org/2000/svg",ref:t,width:l,height:l,viewBox:"0 0 24 24",fill:"none"}),h(void 0===r?"Linear":r,void 0===a?"currentColor":a))});m.displayName="DocumentText"},52587:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var n=r(84913),i=r(67294),o=["variant","color","size"],a=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{d:"M18.809 6.25h1.36c-.19-.27-.39-.52-.6-.77l-.76.77ZM18.52 4.42c-.25-.21-.5-.41-.77-.6v1.36l.77-.76ZM19.58 5.481l2.95-2.95c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-2.95 2.95c.38.33.73.69 1.06 1.06ZM17.752 3c0-.41-.34-.75-.75-.75-.4 0-.72.32-.74.71.52.25 1.02.53 1.49.86V3ZM21.752 7c0-.41-.34-.75-.75-.75h-.83c.33.47.62.97.86 1.49.4-.02.72-.34.72-.74ZM12.75 14.75h.3c.39 0 .7-.35.7-.78 0-.54-.15-.62-.49-.74l-.51-.18v1.7Z",fill:t}),i.createElement("path",{d:"M21.04 7.74c-.01 0-.02.01-.04.01h-4c-.1 0-.19-.02-.29-.06a.782.782 0 0 1-.41-.41.868.868 0 0 1-.05-.28V3c0-.01.01-.02.01-.04C14.96 2.35 13.52 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.52-.35-2.96-.96-4.26Zm-7.29 4.08c.64.22 1.5.69 1.5 2.16 0 1.25-.99 2.28-2.2 2.28h-.3v.25c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-.25h-.08c-1.33 0-2.42-1.12-2.42-2.5 0-.42.34-.76.75-.76s.75.34.75.75c0 .55.41 1 .92 1h.08v-2.22l-1-.35c-.64-.22-1.5-.69-1.5-2.16 0-1.25.99-2.28 2.2-2.28h.3V7.5c0-.41.34-.75.75-.75s.75.34.75.75v.25h.08c1.33 0 2.42 1.12 2.42 2.5 0 .41-.34.75-.75.75s-.75-.34-.75-.75c0-.55-.41-1-.92-1h-.08v2.22l1 .35Z",fill:t}),i.createElement("path",{d:"M10.25 10.03c0 .54.15.62.49.74l.51.18v-1.7h-.3c-.38 0-.7.35-.7.78Z",fill:t}))},c=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{d:"M9.5 13.748c0 .97.75 1.75 1.67 1.75h1.88c.8 0 1.45-.68 1.45-1.53 0-.91-.4-1.24-.99-1.45l-3.01-1.05c-.59-.21-.99-.53-.99-1.45 0-.84.65-1.53 1.45-1.53h1.88c.92 0 1.67.78 1.67 1.75M12 7.5v9M17 3v4h4M22 2l-5 5",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12c0 3.94 2.28 7.35 5.6 8.98M22 12c0 5.52-4.48 10-10 10",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},l=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{opacity:".4",d:"M18.809 6.25h1.36c-.19-.27-.39-.52-.6-.77l-.76.77ZM18.52 4.42c-.25-.21-.5-.41-.77-.6v1.36l.77-.76Z",fill:t}),i.createElement("path",{opacity:".4",d:"M17 7.75c-.1 0-.19-.02-.29-.06a.782.782 0 0 1-.41-.41.717.717 0 0 1-.06-.29v-4c0-.01.01-.02.01-.04C14.96 2.35 13.52 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-1.52-.35-2.96-.96-4.26-.01 0-.02.01-.04.01h-4Z",fill:t}),i.createElement("path",{d:"m19.58 5.481 2.95-2.95c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-2.95 2.95c.38.33.73.69 1.06 1.06ZM17.752 3c0-.41-.34-.75-.75-.75-.4 0-.72.32-.74.71.52.25 1.02.53 1.49.86V3ZM21.752 7c0-.41-.34-.75-.75-.75h-.83c.33.47.62.97.86 1.49.4-.02.72-.34.72-.74ZM13.75 11.82l-1-.35V9.25h.08c.51 0 .92.45.92 1 0 .41.34.75.75.75s.75-.34.75-.75c0-1.38-1.08-2.5-2.42-2.5h-.08V7.5c0-.41-.34-.75-.75-.75s-.75.34-.75.75v.25h-.3c-1.21 0-2.2 1.02-2.2 2.28 0 1.46.85 1.93 1.5 2.16l1 .35v2.22h-.08c-.51 0-.92-.45-.92-1 0-.41-.34-.75-.75-.75s-.75.34-.75.75c0 1.38 1.08 2.5 2.42 2.5h.08v.25c0 .41.34.75.75.75s.75-.34.75-.75v-.25h.3c1.21 0 2.2-1.02 2.2-2.28 0-1.47-.85-1.94-1.5-2.16Zm-3.01-1.06c-.34-.12-.49-.19-.49-.74 0-.43.32-.78.7-.78h.3v1.69l-.51-.17Zm2.31 3.99h-.3v-1.69l.51.18c.34.12.49.19.49.74 0 .42-.32.77-.7.77Z",fill:t}))},s=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{d:"M9.5 13.75c0 .97.75 1.75 1.67 1.75h1.88c.8 0 1.45-.68 1.45-1.53 0-.91-.4-1.24-.99-1.45l-3.01-1.05c-.59-.21-.99-.53-.99-1.45 0-.84.65-1.53 1.45-1.53h1.88c.92 0 1.67.78 1.67 1.75M12 7.5v9",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M22 12c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M17 3v4h4M22 2l-5 5",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},d=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{d:"M13.05 16.248h-1.88c-1.33 0-2.42-1.12-2.42-2.5 0-.41.34-.75.75-.75s.75.34.75.75c0 .55.41 1 .92 1h1.88c.39 0 .7-.35.7-.78 0-.54-.15-.62-.49-.74l-3.01-1.05c-.64-.22-1.5-.69-1.5-2.16 0-1.25.99-2.28 2.2-2.28h1.88c1.33 0 2.42 1.12 2.42 2.5 0 .41-.34.75-.75.75s-.75-.34-.75-.75c0-.55-.41-1-.92-1h-1.88c-.39 0-.7.35-.7.78 0 .54.15.62.49.74l3.01 1.05c.64.22 1.5.69 1.5 2.16 0 1.26-.99 2.28-2.2 2.28Z",fill:t}),i.createElement("path",{d:"M12 17.25c-.41 0-.75-.34-.75-.75v-9c0-.41.34-.75.75-.75s.75.34.75.75v9c0 .41-.34.75-.75.75Z",fill:t}),i.createElement("path",{d:"M12 22.75C6.07 22.75 1.25 17.93 1.25 12S6.07 1.25 12 1.25c.41 0 .75.34.75.75s-.34.75-.75.75C6.9 2.75 2.75 6.9 2.75 12S6.9 21.25 12 21.25s9.25-4.15 9.25-9.25c0-.41.34-.75.75-.75s.75.34.75.75c0 5.93-4.82 10.75-10.75 10.75Z",fill:t}),i.createElement("path",{d:"M21 7.75h-4c-.41 0-.75-.34-.75-.75V3c0-.41.34-.75.75-.75s.75.34.75.75v3.25H21c.41 0 .75.34.75.75s-.34.75-.75.75Z",fill:t}),i.createElement("path",{d:"M17.001 7.751c-.19 0-.38-.07-.53-.22a.754.754 0 0 1 0-1.06l5-5c.29-.29.77-.29 1.06 0 .29.29.29.77 0 1.06l-5 5c-.15.15-.34.22-.53.22Z",fill:t}))},u=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("g",{opacity:".4",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},i.createElement("path",{d:"M9.5 13.748c0 .97.75 1.75 1.67 1.75h1.88c.8 0 1.45-.68 1.45-1.53 0-.91-.4-1.24-.99-1.45l-3.01-1.05c-.59-.21-.99-.53-.99-1.45 0-.84.65-1.53 1.45-1.53h1.88c.92 0 1.67.78 1.67 1.75M12 7.5v9"})),i.createElement("path",{d:"M22 12c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M17 3v4h4M22 2l-5 5",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},h=function(e,t){switch(e){case"Bold":return i.createElement(a,{color:t});case"Broken":return i.createElement(c,{color:t});case"Bulk":return i.createElement(l,{color:t});case"Linear":default:return i.createElement(s,{color:t});case"Outline":return i.createElement(d,{color:t});case"TwoTone":return i.createElement(u,{color:t})}},m=(0,i.forwardRef)(function(e,t){var r=e.variant,a=e.color,c=e.size,l=void 0===c?"24":c,s=(0,n._)(e,o);return i.createElement("svg",(0,n.a)({},s,{xmlns:"http://www.w3.org/2000/svg",ref:t,width:l,height:l,viewBox:"0 0 24 24",fill:"none"}),h(void 0===r?"Linear":r,void 0===a?"currentColor":a))});m.displayName="MoneyRecive"},75717:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/mesh/job-board/quotations/[quotationId]/edit",function(){return r(86932)}])},86932:function(e,t,r){"use strict";r.r(t);var n=r(85893),i=r(67294),o=r(11163),a=r(6459),c=r(8186),l=r(48899),s=r(90092),d=r(68029),u=r(38491),h=r(73636),m=r(12519),p=r(96657),x=r(8843),f=r(69915),v=r(50090),j=r(12553),g=r(54506),b=r(30980),k=r(42845),E=r(82206),y=r(73244),M=r(62893),w=r(64831),z=r(54795),S=r(45007),I=r(67629),L=r(5752),C=r(56524),Z=r(5713),q=r(78316),W=r(22768),P=r(52587),T=r(31529),F=r(18471),_=r(68730);t.default=()=>{let e=(0,o.useRouter)(),{meshId:t,quotationId:r}=e.query,N=(0,S.I0)(),V=(0,a.p)(),D=(0,F.$V)();null==D||D.id;let{activeRole:A}=(0,_.q)(),{currentQuotation:R,loadingQuotation:U,loading:B,error:Q}=(0,S.v9)(e=>e.quotation),[O,H]=(0,i.useState)([]),[Y,J]=(0,i.useState)(0),[X,$]=(0,i.useState)(""),[G,K]=(0,i.useState)("7"),[ee,et]=(0,i.useState)(0),[er,en]=(0,i.useState)(!1),[ei,eo]=(0,i.useState)(!1),[ea,ec]=(0,i.useState)({});(0,i.useEffect)(()=>{r&&"string"==typeof r&&N((0,I.uZ)(r))},[r,N]),(0,i.useEffect)(()=>
1{if(R&&(null==R?void 0:R.status)==="draft"){if(H(R.quotationItems.map(e=>({tempId:crypto.randomUUID(),itemId:e.itemId,itemType:e.itemType,name:e.name,description:e.description||"",quantity:e.quantity,unitPrice:e.unitPrice}))),$(R.notes||""),et(R.depositPercentage?Math.round(100*R.depositPercentage):0),en(R.depositAmount&&R.depositAmount>0),R.expiresAt){let e=new Date,t=Math.ceil((new Date(R.expiresAt).getTime()-e.getTime())/864e5);K(t>0?t.toString():"7")}J(R.totalPrice-R.quotationItems.reduce((e,t)=>e+t.totalPrice,0))}},[R]),(0,i.useEffect)(()=>{"provider"!==A&&(V({title:"Access denied",description:"Only providers can edit quotations",status:"error",duration:3e3}),e.push("/mesh/job-board")),R&&(null==R?void 0:R.status)!=="draft"&&(V({title:"Cannot edit quotation",description:"Only draft quotations can be edited",status:"warning",duration:3e3}),e.push("/mesh/job-board/quotations/".concat(r)))},[A,R,t,r,e,V]);let el=()=>({tempId:crypto.randomUUID(),itemType:"material",name:"",description:"",quantity:1,unitPrice:0}),es=e=>{if(1===O.length){V({title:"Cannot remove last item",description:"A quotation must have at least one item.",status:"warning",duration:3e3,isClosable:!0});return}H(O.filter(t=>t.tempId!==e))},ed=(e,t,r)=>{H(O.map(n=>n.tempId===e?{...n,[t]:r}:n))},eu=e=>e.quantity*e.unitPrice,eh=()=>O.reduce((e,t)=>e+eu(t),0),em=()=>eh()+Y,ep=()=>{let e=em();return er&&0!==ee?(0,L.MO)(e,ee):{depositAmount:0,balanceAmount:e}},ex=()=>{let e={};0===O.length?e.items="Please add at least one quotation item":O.some(e=>!e.name.trim()||e.quantity<=0||e.unitPrice<0)&&(e.items="All items must have a name, positive quantity, and valid price"),Y<0&&(e.laborCost="Labor cost cannot be negative");let t=parseInt(G);return(isNaN(t)||t<1)&&(e.validityPeriod="Validity period must be at least 1 day"),ec(e),0===Object.keys(e).length},ef=async function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!ex()){V({title:"Validation error",description:"Please fix the errors before saving",status:"error",duration:3e3,isClosable:!0});return}if(!r||"string"!=typeof r)return;let n=em(),{depositAmount:i,balanceAmount:o}=ep(),a=parseInt(G),c=new Date;c.setDate(c.getDate()+a);let l={quotationItems:O.map(e=>{var t;return{itemType:e.itemType,name:e.name.trim(),description:(null===(t=e.description)||void 0===t?void 0:t.trim())||void 0,quantity:e.quantity,unitPrice:e.unitPrice}}),totalPrice:n,notes:X.trim()||void 0,expiresAt:c.toISOString()};try{await N((0,I.qm)({quotationId:r,updateData:l})).unwrap(),t?(await N((0,I.e2)({quotationId:r,notes:X.trim()||void 0})).unwrap(),V({title:"Quotation submitted!",description:"Your quotation has been sent to the customer.",status:"success",duration:5e3,isClosable:!0})):V({title:"Quotation updated!",description:"Your changes have been saved.",status:"success",duration:3e3,isClosable:!0}),e.push("/mesh/job-board/quotations/".concat(r))}catch(e){V({title:"Failed to update quotation",description:e||"An error occurred",status:"error",duration:5e3,isClosable:!0})}};if(U)return(0,n.jsx)(T.Z,{children:(0,n.jsxs)(c.g,{spacing:4,align:"center",justify:"center",minH:"50vh",children:[(0,n.jsx)(l.$,{size:"xl",color:"blue.500",thickness:"4px"}),(0,n.jsx)(s.x,{fontSize:"16px",color:"gray.600",children:"Loading quotation..."})]})});if(Q||!R)return(0,n.jsx)(T.Z,{children:(0,n.jsxs)(d.x,{p:8,bg:"red.50",borderRadius:"12px",border:"1px solid",borderColor:"red.200",textAlign:"center",children:[(0,n.jsx)(s.x,{fontSize:"16px",color:"red.700",children:Q||"Quotation not found"}),(0,n.jsx)(u.z,{mt:4,colorScheme:"blue",onClick:()=>e.push("/mesh/job-board"),children:"Back to Job Requests"})]})});if((null==R?void 0:R.status)!=="draft")return null;let{depositAmount:ev,balanceAmount:ej}=ep();return(0,n.jsx)(T.Z,{children:(0,n.jsxs)(c.g,{spacing:6,align:"stretch",maxW:"1200px",mx:"auto",mb:5,children:[(0,n.jsx)(h.U,{justify:"space-between",flexWrap:"wrap",position:"sticky",top:0,bg:"white",zIndex:10,py:3,children:(0,n.jsxs)(h.U,{spacing:3,children:[(0,n.jsx)(m.h,{"aria-label":"Back",variant:"ghost",size:"md",icon:(0,n.jsx)(C.Z,{}),onClick:()=>e.back()}),(0,n.jsxs)(c.g,{align:"start",spacing:0,children:[(0,n.jsx)(s.x,{fontSize:"20",fontWeight:700,children:"Edit Quotation"}),(0,n.jsx)(s.x,{fontSize:"14px",color:"gray.600",children:"Update your quotation details"})]})]})}),(0,n.jsxs)(p.b,{status:"info",borderRadius:"8px",children:[(0,n.jsx)(x.z,{}),(0,n.jsxs)(d.x,{children:[(0,n.jsx)(f.C,{fontSize:"14px",children:"Draft Quotation"}),(0,n.jsx)(v.X,{fontSize:"13px",children:"Save your changes or submit the quotation to send it to the customer for review."})]})]}),(0,n.jsxs)(d.x,{p:5,bg:"white",borderRadius:"12px",border:"1px solid",borderColor:"gray.200",shadow:"sm",children:[(0,n.jsxs)(h.U,{justify:"space-between",mb:4,children:[(0,n.jsx)(s.x,{fontSize:"18px",fontWeight:"600",children:"Quotation Items"}),(0,n.jsx)(u.z,{size:"md",colorScheme:"blue",leftIcon:(0,n.jsx)(j.J,{as:Z.Z,boxSize:4}),onClick:()=>{H([...O,el()])},children:"Add Item"})]}),ea.items&&(0,n.jsx)(s.x,{fontSize:"13px",color:"red.500",mb:3,children:ea.items}),(0,n.jsx)(c.g,{spacing:4,align:"stretch",children:O.map((e,t)=>(0,n.jsxs)(d.x,{p:4,border:"1px solid",borderColor:"gray.200",borderRadius:"8px",bg:"gray.50",children:[(0,n.jsxs)(h.U,{justify:"space-between",mb:3,children:[(0,n.jsxs)(s.x,{fontSize:"14px",fontWeight:"600",children:["Item ",t+1]}),(0,n.jsx)(m.h,{"aria-label":"Remove item",icon:(0,n.jsx)(j.J,{as:q.Z,boxSize:4}),size:"md",colorScheme:"red",variant:"ghost",onClick:()=>es(e.tempId)})]}),(0,n.jsxs)(c.g,{spacing:3,align:"stretch",children:[(0,n.jsxs)(h.U,{spacing:3,align:"start",children:[(0,n.jsxs)(g.NI,{flex:1,children:[(0,n.jsx)(b.l,{fontSize:"13px",children:"Item Type"}
1),(0,n.jsxs)(k.P,{value:e.itemType,onChange:t=>ed(e.tempId,"itemType",t.target.value),size:"md",children:[(0,n.jsx)("option",{value:"material",children:"Material"}),(0,n.jsx)("option",{value:"labor",children:"Labor"}),(0,n.jsx)("option",{value:"other",children:"Other"})]})]}),(0,n.jsxs)(g.NI,{flex:2,isRequired:!0,children:[(0,n.jsx)(b.l,{fontSize:"13px",children:"Item Name"}),(0,n.jsx)(E.I,{value:e.name,onChange:t=>ed(e.tempId,"name",t.target.value),placeholder:"e.g., Paint, Tiles, Installation",size:"md"})]})]}),(0,n.jsxs)(g.NI,{children:[(0,n.jsx)(b.l,{fontSize:"13px",children:"Description (Optional)"}),(0,n.jsx)(y.g,{value:e.description,onChange:t=>ed(e.tempId,"description",t.target.value),placeholder:"Additional details about this item",size:"md",rows:2})]}),(0,n.jsxs)(h.U,{spacing:3,children:[(0,n.jsxs)(g.NI,{isRequired:!0,children:[(0,n.jsx)(b.l,{fontSize:"13px",children:"Quantity"}),(0,n.jsxs)(M.Y2,{value:e.quantity,onChange:t=>ed(e.tempId,"quantity",parseFloat(t)||0),min:0,size:"md",children:[(0,n.jsx)(M.zu,{}),(0,n.jsxs)(M.Fi,{children:[(0,n.jsx)(M.WQ,{}),(0,n.jsx)(M.Y_,{})]})]})]}),(0,n.jsxs)(g.NI,{isRequired:!0,children:[(0,n.jsx)(b.l,{fontSize:"13px",children:"Unit Price (₦)"}),(0,n.jsxs)(M.Y2,{value:e.unitPrice,onChange:t=>ed(e.tempId,"unitPrice",parseFloat(t)||0),min:0,size:"md",children:[(0,n.jsx)(M.zu,{}),(0,n.jsxs)(M.Fi,{children:[(0,n.jsx)(M.WQ,{}),(0,n.jsx)(M.Y_,{})]})]})]}),(0,n.jsxs)(g.NI,{children:[(0,n.jsx)(b.l,{fontSize:"13px",children:"Total"}),(0,n.jsx)(s.x,{fontSize:"16px",fontWeight:"600",color:"blue.700",children:(0,L.lr)(eu(e))})]})]})]})]},e.tempId))}),(0,n.jsx)(w.i,{my:4}),(0,n.jsxs)(g.NI,{isInvalid:!!ea.laborCost,children:[(0,n.jsx)(b.l,{fontSize:"14px",fontWeight:"600",children:"Workmanship/Labor Cost (₦)"}),(0,n.jsxs)(M.Y2,{value:Y,onChange:e=>J(parseFloat(e)||0),min:0,children:[(0,n.jsx)(M.zu,{placeholder:"Enter labor cost"}),(0,n.jsxs)(M.Fi,{children:[(0,n.jsx)(M.WQ,{}),(0,n.jsx)(M.Y_,{})]})]}),ea.laborCost&&(0,n.jsx)(z.J1,{children:ea.laborCost}),(0,n.jsx)(g.Q6,{fontSize:"12px",children:"This is added to the total cost separately from items"})]})]}),(0,n.jsxs)(d.x,{p:5,bg:"white",borderRadius:"12px",border:"1px solid",borderColor:"gray.200",shadow:"sm",children:[(0,n.jsx)(s.x,{fontSize:"16px",fontWeight:"600",mb:4,children:"Price Summary"}),(0,n.jsxs)(c.g,{spacing:2,align:"stretch",children:[(0,n.jsxs)(h.U,{justify:"space-between",children:[(0,n.jsx)(s.x,{fontSize:"14px",children:"Items Subtotal:"}),(0,n.jsx)(s.x,{fontSize:"14px",fontWeight:"600",children:(0,L.lr)(eh())})]}),(0,n.jsxs)(h.U,{justify:"space-between",children:[(0,n.jsx)(s.x,{fontSize:"14px",children:"Labor Cost:"}),(0,n.jsx)(s.x,{fontSize:"14px",fontWeight:"600",children:(0,L.lr)(Y)})]}),(0,n.jsx)(w.i,{}),(0,n.jsxs)(h.U,{justify:"space-between",children:[(0,n.jsx)(s.x,{fontSize:"18px",fontWeight:"700",color:"blue.700",children:"Grand Total:"}),(0,n.jsx)(s.x,{fontSize:"24px",fontWeight:"700",color:"blue.700",children:(0,L.lr)(em())})]})]})]}),(0,n.jsxs)(d.x,{p:5,bg:"white",borderRadius:"12px",border:"1px solid",borderColor:"gray.200",shadow:"sm",children:[(0,n.jsx)(s.x,{fontSize:"16px",fontWeight:"600",mb:4,children:"Additional Details"}),(0,n.jsxs)(c.g,{spacing:4,align:"stretch",children:[(0,n.jsxs)(g.NI,{isInvalid:!!ea.validityPeriod,children:[(0,n.jsx)(b.l,{fontSize:"14px",children:"Validity Period (Days)"}),(0,n.jsxs)(M.Y2,{value:G,onChange:K,min:1,max:90,children:[(0,n.jsx)(M.zu,{placeholder:"7"}),(0,n.jsxs)(M.Fi,{children:[(0,n.jsx)(M.WQ,{}),(0,n.jsx)(M.Y_,{})]})]}),ea.validityPeriod&&(0,n.jsx)(z.J1,{children:ea.validityPeriod}),(0,n.jsx)(g.Q6,{fontSize:"12px",children:"How long is this quotation valid for?"})]}),(0,n.jsxs)(g.NI,{children:[(0,n.jsx)(b.l,{fontSize:"14px",children:"Notes (Optional)"}),(0,n.jsx)(y.g,{value:X,onChange:e=>$(e.target.value),placeholder:"Any additional notes or terms for the customer...",rows:4}),(0,n.jsx)(g.Q6,{fontSize:"12px",children:"additional information or terms you want to include in the quotation"})]})]})]}),(0,n.jsxs)(h.U,{spacing:3,justify:"flex-end",children:[(0,n.jsx)(u.z,{variant:"outline",onClick:()=>e.back(),isDisabled:B,children:"Cancel"}),(0,n.jsx)(u.z,{colorScheme:"blue",onClick:()=>ef(!1),isLoading:B,loadingText:"Saving...",leftIcon:(0,n.jsx)(j.J,{as:W.Z,boxSize:4}),children:"Save Draft"}),(0,n.jsx)(u.z,{colorScheme:"green",onClick:()=>ef(!0),isLoading:B,loadingText:"Submitting...",leftIcon:(0,n.jsx)(j.J,{as:P.Z,boxSize:4}),children:"Save & Submit"})]})]})})}}},function(e){e.O(0,[5443,4838,1664,1657,2775,6714,2893,9203,1529,2888,9774,179],function(){return e(e.s=75717)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.