1try{let 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]="d10fe1bb-f51c-4221-8a5b-ce32ea428b7a",e._sentryDebugIdIdentifier="sentry-dbid-d10fe1bb-f51c-4221-8a5b-ce32ea428b7a")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9037,9784],{7447:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/product/unit-category/form",function(){return r(86959)}])},4340:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(74848),l=r(13368),a=r.n(l);let s=e=>{let{title:t}=e,r=e.description||"Jova POS merupakan sistem kasir yang mampu memudahkan anda dalam melakukan transaksi, pembayaran, manajemen data produk, manajemen stock hingga pembelian ke supplier.",l=e.canonical||"https://www.jovapos.com/";return(0,n.jsxs)(a(),{children:[(0,n.jsx)("title",{children:t||"Aplikasi Kasir Bisnis Anda - Jova POS"}),(0,n.jsx)("meta",{name:"description",content:r}),(0,n.jsx)("link",{rel:"canonical",href:l}),(0,n.jsx)("link",{rel:"icon",href:"/jovapos.svg"}),(0,n.jsx)("script",{async:!0,src:"https://www.googletagmanager.com/gtag/js?id=G-G226FWSEEJ"}),(0,n.jsx)("script",{dangerouslySetInnerHTML:{__html:"\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', 'G-G226FWSEEJ');\n "}})]})}},39088:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(74848),l=r(59037),a=r(52177),s=r(64847),i=r(32578);let o=e=>{let{isSubmiting:t=!1,page:r,type:o="Edit"}=e,[{dataMe:u}]=(0,a.w)(),d=(0,s.F)(u,r,o),c=(0,i.useTranslations)("GeneralTranslate");return d&&(0,n.jsx)("button",{type:"submit",disabled:t,className:"bg-primary text-white px-12 py-2 rounded-lg text-sm justify-center items-center text-center",children:t?(0,n.jsx)(l.default,{}):(0,n.jsx)("span",{children:c("Save")})})}},53948:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(74848),l=r(86715);let a=e=>{let t=(0,l.useRouter)(),{title:r}=e;return(0,n.jsx)("nav",{className:"flex",children:(0,n.jsxs)("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[(0,n.jsx)("li",{className:"inline-flex items-center",onClick:()=>t.back(),children:(0,n.jsx)("a",{href:"#",className:"inline-flex items-center text-sm font-medium text-gray-700 hover:text-primary",children:r[0]})}),(0,n.jsx)("li",{children:(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("svg",{className:"w-6 h-6 text-gray-400",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),(0,n.jsx)("p",{className:"ml-1 text-sm font-medium text-thirdary md:ml-2",children:r[1]})]})})]})})}},10452:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(74848);let l=e=>{let{children:t,className:r}=e;return(0,n.jsx)("div",{className:"bg-white w-full rounded-2xl shadow border py-5 px-10 ".concat(r),children:t})}},7242:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(74848);let l=e=>{let{name:t}=e;return(0,n.jsx)("div",{className:"text-primary font-bold text-xl font-default",children:t})}},59037:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var n=r(74848);let l=()=>(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("svg",{role:"status",className:"w-6 h-6 text-white animate-spin dark:text-white dark:text-xl fill-primary mx-auto",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.
11071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]})})},86959:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>b,default:()=>C});var n=r(74848),l=r(69621);r(907);var a=r(53948),s=r(26485),i=r(96540),o=r(10452),u=r(7242),d=r(49785),c=r(39088),m=r(32578);let f=e=>{var t,r,l,a,f,v,p,x,g,h,y,b;let C=(0,m.useTranslations)("GeneralTranslate"),[j,w]=(0,i.useState)(e.data),E=[{value:1,label:"Active"},{value:0,label:"Inactive"}],{control:N,register:S,watch:k,handleSubmit:R,setValue:I,reset:_,formState:{errors:A}}=(0,d.mN)({mode:"onChange",reValidateMode:"onChange",defaultValues:j}),M=[{label:C("Service"),value:0},{label:C("Item"),value:1}];return(0,i.useEffect)(()=>{e.data&&(I("name",e.data.name),I("type",e.data.type),I("status",e.data.status))},[e.data]),(0,n.jsxs)("form",{onSubmit:R(t=>{e.submitHandler(t)}),children:[(0,n.jsx)(o.A,{className:"my-5",children:(0,n.jsxs)("div",{className:"py-5 flex flex-col gap-6",children:[(0,n.jsx)("h1",{className:"text-primary font-bold text-[20px]",children:(0,n.jsx)(u.A,{name:C("Unit Category Information")})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-sm font-semibold leading-6 text-gray-900",children:C("Name")}),(0,n.jsx)("input",{value:k("name"),className:"form-control block w-full px-4 py-2 font-normal text-gray-700 text-sm bg-white bg-clip-padding border border-solid border-[#CCCCCC] rounded-lg transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none",type:"text",placeholder:C("Name"),...S("name",{required:"Name cannot be empty"})}),(null==A?void 0:null===(r=A.name)||void 0===r?void 0:null===(t=r.message)||void 0===t?void 0:t.toString())&&(0,n.jsx)("p",{className:"text-red-500 text-xs",children:null==A?void 0:null===(a=A.name)||void 0===a?void 0:null===(l=a.message)||void 0===l?void 0:l.toString()})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-sm font-semibold leading-6 text-gray-900",children:C("Type")}),(0,n.jsx)(d.xI,{name:"type",control:N,rules:{required:"Select Type"},render:e=>{let{field:{onChange:t,ref:r,value:l,...a}}=e;return(0,n.jsx)(s.Ay,{isSearchable:!1,styles:{control:(e,t)=>({...e,padding:"2px 0",borderRadius:"8px"})},className:"flex-1 h-full form-control w-full font-normal text-gray-700 bg-white rounded-lg text-sm",options:M,placeholder:C("Select an option"),value:M.find(e=>{let{value:t}=e;return t===Number(k("type"))}),onChange:e=>{t(e.value)}})}}),(null==A?void 0:null===(v=A.type)||void 0===v?void 0:null===(f=v.message)||void 0===f?void 0:f.toString())&&(0,n.jsx)("p",{className:"text-red-500 text-xs",children:null==A?void 0:null===(x=A.type)||void 0===x?void 0:null===(p=x.message)||void 0===p?void 0:p.toString()})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-sm font-semibold leading-6 text-gray-900",children:"Status"}),(0,n.jsx)(d.xI,{name:"status",control:N,rules:{required:"Select Status"},render:e=>{let{field:{onChange:t,ref:r,value:l,...a}}=e;return(0,n.jsx)(s.Ay,{styles:{control:(e,t)=>({...e,padding:"2px 0",borderRadius:"8px"})},className:"flex-1 h-full form-control w-full font-normal text-gray-700 bg-white rounded-lg text-sm",options:E,placeholder:C("Select an option"),value:E.find(e=>{let{value:t}=e;return t===Number(k("status"))}),onChange:e=>{t(e.value)}})}}),(null==A?void 0:null===(h=A.status)||void 0===h?void 0:null===(g=h.message)||void 0===g?void 0:g.toString())&&(0,n.jsx)("p",{className:"text-red-500 text-xs",children:null==A?void 0:null===(b=A.status)||void 0===b?void 0:null===(y=b.message)||void 0===y?void 0:y.toString()})]})]})}),(0,n.jsx)("div",{className:"flex justify-end mt-4",children:(0,n.jsx)(c.A,{page:["unit-category"],isSubmiting:e.isSubmiting,type:e.data?"Add":"Edit"})})]})};var v=r(86715),p=r(77969),x=r(95420),g=r(38189),h=r(4340),y=r(75249),b=!0;let C=function(){let e=(0,v.useRouter)(),[t,r]=(0,i.useState)(!1),s=(0,m.useTranslations)("GeneralTranslate"),[o,u]=(0,i.useState)(null),[d,c]=(0,i.useState)(),[b,{loading:C,error:j,data:w}]=(0,p._)(g.Bu,{fetchPolicy:"no-cache",onCompleted:e=>{var t=e.unitCategory.unit_category;c({id:t.id,name:t.name,status:t.status,type:t.type})},onError:()=>{y.oR.error(s("error message1"))}}),[E,{loading:N,error:S}]=(0,x.n)(g.xg,{onCompleted:t=>{null!=t?(y.oR.success(s("Success")),e.push("/product/unit-category")):(r(!1),y.oR.error(t))},onError:e=>{r(!1),y.oR.error(e)}}),[k,{loading:R,error:I}]=(0,x.n)(g.Yb,{onCompleted:t=>{null!=t?(y.oR.success(s("Success")),e.push("/product/unit-category")):(r(!1),y.oR.error(t))},onError:e=>{r(!1),y.oR.error(e)}});return(0,i.useEffect)(()=>{e.isReady&&void 0!==e.query.id&&(u(e.query.id),b({variables:{id:e.query.id}}))},[e.isReady]),(0,n.jsxs)("div",{className:"h-full w-full absolute",children:[(0,n.jsx)(h.A,{title:s("Product Unit Category")}),(0,n.jsx)(l.A,{children:(0,n.jsxs)("div",{className:"pb-6",children:[(0,n.jsx)(a.A,{title:[s("Unit Category"),"".concat(s("Add")," ").concat(s("Unit Category"))]}),(0,n.jsx)(f,{data:d,isSubmiting:N||C||R,submitHandler:t=>
1{r(!0),e.query.id&&w?k({variables:{id:e.query.id,input:{name:t.name,status:1==t.status?"ACTIVE":"INACTIVE",type:0==t.type?"SERVICE":"ITEM"}}}):E({variables:{input:{name:t.name,status:1==t.status?"ACTIVE":"INACTIVE",type:0==t.type?"SERVICE":"ITEM"}}})}})]})})]})}},64847:(e,t,r)=>{"use strict";function n(e,t,r){var n;let l=t[t.length-1],a="type"===l?"member-type":l,s=(null===(n=(null==e?void 0:e.filter(e=>(null==e?void 0:e.module_route)===a))[0])||void 0===n?void 0:n.type)||null;if(s)return!!s[r]}r.d(t,{F:()=>n})},907:()=>{},54269:(e,t,r)=>{"use strict";r.d(t,{E:()=>l});var n=r(27243),l=r(2619).Sw?n.useLayoutEffect:n.useEffect},77969:(e,t,r)=>{"use strict";r.d(t,{_:()=>u});var n=r(31635),l=r(27243),a=r(60144),s=r(46537),i=r(54269),o=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function u(e,t){var r,u=l.useRef(void 0),d=l.useRef(void 0),c=l.useRef(void 0),m=(0,a.l)(t,u.current||{}),f=null!==(r=null==m?void 0:m.query)&&void 0!==r?r:e;d.current=t,c.current=f;var v=(0,n.Cl)((0,n.Cl)({},m),{skip:!u.current}),p=(0,s.SX)(f,v),x=p.obsQueryFields,g=p.result,h=p.client,y=p.resultData,b=p.observable,C=p.onQueryExecuted,j=b.options.initialFetchPolicy||(0,s.kk)(v.defaultOptions,h.defaultOptions),w=l.useReducer(function(e){return e+1},0)[1],E=l.useMemo(function(){for(var e={},t=0;t<o.length;t++)!function(t){var r=x[t];e[t]=function(){return u.current||(u.current=Object.create(null),w()),r.apply(this,arguments)}}(o[t]);return e},[w,x]),N=!!u.current,S=l.useMemo(function(){return(0,n.Cl)((0,n.Cl)((0,n.Cl)({}
1,g),E),{called:N})},[g,E,N]),k=l.useCallback(function(e){u.current=e?(0,n.Cl)((0,n.Cl)({},e),{fetchPolicy:e.fetchPolicy||j}):{fetchPolicy:j};var t,r,l,i,o=(0,a.l)(d.current,(0,n.Cl)({query:c.current},u.current)),m=(r=(t=(0,n.Cl)((0,n.Cl)({},o),{skip:!1})).query||f,l=(0,s.Er)(h,r,t,!1)(b),i=b.reobserveAsConcast((0,s.t_)(b,h,t,l)),C(l),new Promise(function(e){var t;i.subscribe({next:function(e){t=e},error:function(){e((0,s.$X)(b.getCurrentResult(),y.previousData,b,h))},complete:function(){e((0,s.$X)(b.maskResult(t),y.previousData,b,h))}})})).then(function(e){return Object.assign(e,E)});return m.catch(function(){}),m},[h,f,E,j,b,y,C]),R=l.useRef(k);return(0,i.E)(function(){R.current=k}),[l.useCallback(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R.current.apply(R,e)},[]),S]}},95420:(e,t,r)=>{"use strict";r.d(t,{n:()=>c});var n=r(31635),l=r(27243),a=r(60144),s=r(15381),i=r(75443),o=r(9211),u=r(70111),d=r(54269);function c(e,t){var r=(0,u.m)(null==t?void 0:t.client);(0,i.D$)(e,i.KG.Mutation);var c=l.useState({called:!1,loading:!1,client:r}),m=c[0],f=c[1],v=l.useRef({result:m,mutationId:0,isMounted:!0,client:r,mutation:e,options:t});(0,d.E)(function(){Object.assign(v.current,{client:r,options:t,mutation:e})});var p=l.useCallback(function(e){void 0===e&&(e={});var t=v.current,r=t.options,l=t.mutation,i=(0,n.Cl)((0,n.Cl)({},r),{mutation:l}),u=e.client||v.current.client;v.current.result.loading||i.ignoreResults||!v.current.isMounted||f(v.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:u});var d=++v.current.mutationId,c=(0,a.l)(i,e);return u.mutate(c).then(function(t){var r,n,l=t.data,a=t.errors,i=a&&a.length>0?new o.K4({graphQLErrors:a}):void 0,m=e.onError||(null===(r=v.current.options)||void 0===r?void 0:r.onError);if(i&&m&&m(i,c),d===v.current.mutationId&&!c.ignoreResults){var p={called:!0,loading:!1,data:l,error:i,client:u};v.current.isMounted&&!(0,s.L)(v.current.result,p)&&f(v.current.result=p)}var x=e.onCompleted||(null===(n=v.current.options)||void 0===n?void 0:n.onCompleted);return i||null==x||x(t.data,c),t},function(t){if(d===v.current.mutationId&&v.current.isMounted){var r,n={loading:!1,error:t,data:void 0,called:!0,client:u};(0,s.L)(v.current.result,n)||f(v.current.result=n)}var l=e.onError||(null===(r=v.current.options)||void 0===r?void 0:r.onError);if(l)return l(t,c),{data:void 0,errors:t};throw t})},[]),x=l.useCallback(function(){if(v.current.isMounted){var e={called:!1,loading:!1,client:v.current.client};Object.assign(v.current,{mutationId:0,result:e}),f(e)}},[]);return l.useEffect(function(){var e=v.current;return e.isMounted=!0,function(){e.isMounted=!1}},[]),[p,(0,n.Cl)({reset:x},m)]}}},e=>{var t=t=>e(e.s=t);e.O(0,[9965,9190,1106,1348,4967,6485,9785,7796,9621,8189,636,6593,8792],()=>t(7447)),_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.