1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4656],{73092:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/createQuickAccess",function(){return n(87978)}])},95427:function(e,t,n){"use strict";n.d(t,{Y:function(){return l}});var r=n(85893);n(67294);var i=n(14225);let l=e=>{let{label:t="Button",...n}=e;return(0,r.jsx)(i.z,{...n,children:t})}},73641:function(e,t,n){"use strict";n.d(t,{I:function(){return i}});var r=n(85893);n(67294);let i=e=>{let{children:t,onSubmit:n,ref:i,withArray:l}=e,c=e=>{e.preventDefault();let t=e.currentTarget,r=new FormData(t),i=r.entries(),c=Object.fromEntries(i);l&&(c=Object.keys(c).reduce((e,t)=>{if(t.includes("[")){let[n,r]=t.split("[");return r.replace("]",""),e[n]||(e[n]=[]),e[n].push(c[t]),e}return e[t]=c[t],e},{})),n(c)};return(0,r.jsx)("form",{ref:i,onSubmit:c,style:{width:"100%",height:"100%"},children:t})}},28410:function(e,t,n){"use strict";n.d(t,{Q:function(){return d}});var r=n(85893);n(67294);var i=n(38049),l=n(39371),c=n(82140),s=n(33090),o=n(32735),u=n(76627),a=n.n(u);let d=e=>{let{label:t,error:n,labelStyle:u,mask:d,ref:x,suffix:h,block:f,autoComplete:v,...p}=e;return(0,r.jsxs)(i.NI,{hidden:p.hidden,children:[t&&(0,r.jsx)(l.l,{pl:2,...u,children:t}),(0,r.jsxs)(c.B,{children:[(0,r.jsx)(s.I,{as:a(),...p,mask:d,ref:x,readOnly:f,autoComplete:v}),h&&(0,r.jsx)(o.x,{children:h})]}),n&&(0,r.jsx)(i.Q6,{color:"red.500",pl:2,m:0,children:n})]})}},7787:function(e,t,n){"use strict";n.d(t,{d:function(){return s}});var r=n(85893);n(67294);var i=n(38049),l=n(39371),c=n(57169);let s=e=>{let{label:t,error:n,labelStyle:s,ref:o,...u}=e;return(0,r.jsxs)(i.NI,{children:[t&&(0,r.jsx)(l.l,{pl:2,...s,children:t}),(0,r.jsx)(c.g,{...u,ref:o}),n&&(0,r.jsx)(i.Q6,{color:"red.500",pl:2,m:0,children:n})]})}},87978:function(e,t,n){"use strict";n.r(t);var r=n(85893),i=n(95427),l=n(73641),c=n(28410),s=n(7787),o=n(7422),u=n(93717),a=n(57747),d=n(38049),x=n(71293),h=n(67294),f=n(91444);let v=e=>{var t,n,v,p;let{closeModal:g}=e,[j,m]=(0,h.useState)({title:"",url:"",description:""}),y=async e=>{if((null==j?void 0:j.title)==""){f.Am.error("\xc9 necess\xe1rio ter um titulo!");return}if((null==j?void 0:j.url)==""){f.Am.error("\xc9 necess\xe1rio ter uma url!");return}try{let t={id:null==j?void 0:j.id,title:null==j?void 0:j.title,url:null==e?void 0:e.url,description:null==j?void 0:j.description};await (0,o.$m)(t),f.Am.success("Acesso r\xe1pido criado com sucesso!"),g()}catch(e){f.Am.error("Erro ao criar acesso r\xe1pido!")}},k=e=>{e.target.value.length<=30&&m({...j,title:e.target.value})},_=e=>{e.target.value.length<=120&&m({...j,description:e.target.value})};return(0,r.jsx)(u.k,{direction:"column",w:"100%",h:"100%",p:4,align:"center",justifyContent:"center",children:(0,r.jsx)(l.I,{onSubmit:y,children:(0,r.jsxs)(u.k,{direction:"column",gridGap:4,children:[(0,r.jsx)(a.xu,{children:(0,r.jsxs)(d.NI,{children:[(0,r.jsx)(c.Q,{label:"Titulo",placeholder:"Digite o titulo aqui",name:"title",value:null==j?void 0:j.title,defaultValue:" ",onChange:k}),(0,r.jsxs)(u.k,{justifyContent:"space-between",children:[(0,r.jsx)(x.x,{fontWeight:"light",color:"grey",fontSize:12,pl:2,pt:1,children:"Limite de 30 caracteres"}),(0,r.jsxs)(x.x,{fontWeight:"light",color:(null==j?void 0:null===(t=j.title)||void 0===t?void 0:t.length)<30?"grey":"red.500",fontSize:12,pl:2,pt:1,children:[null==j?void 0:null===(n=j.title)||void 0===n?void 0:n.length,"/",30]})]})]})}),(0,r.jsx)(a.xu,{children:(0,r.jsxs)(d.NI,{children:[(0,r.jsx)(c.Q,{label:"URL",placeholder:"Digite o link do Acesso Rapido",name:"url",defaultValue:null==j?void 0:j.url,onChange:e=>m({...j,url:e.target.value})}),(0,r.jsx)(x.x,{fontWeight:"light",color:"grey",fontSize:12,pl:2,pt:1,children:"Digite o link do Acesso Rapido"})]})}),(0,r.jsx)(a.xu,{children:(0,r.jsxs)(d.NI,{children:[(0,r.jsx)(s.d,{label:"Descri\xe7\xe3o",placeholder:"Digite a descri\xe7\xe3o aqui",name:"description",value:null==j?void 0:j.description,onChange:_}),(0,r.jsxs)(u.k,{justifyContent:"space-between",children:[(0,r.jsx)(x.x,{fontWeight:"light",color:"grey",fontSize:12,pl:2,pt:1,children:"Limite de 120 caracteres"}),(0,r.jsxs)(x.x,{fontWeight:"light",color:(null==j?void 0:null===(v=j.description)||void 0===v?void 0:v.length)<120?"grey":"red.500",fontSize:12,pl:2,pt:1,children:[null==j?void 0:null===(p=j.description)||void 0===p?void 0:p.length,"/",120]})]})]})}),(0,r.jsx)(i.Y,{type:"submit",label:"criar"})]})})})};t.default=v},7422:function(e,t,n){"use strict";n.d(t,{$m:function(){return c},H_:function(){return l},ZM:function(){return i},jL:function(){return o},n8:function(){return s}});var r=n(58467);let i=async e=>{try{let{data:t}=await r.Z.get("public/quick-access",(0,r.d)(e));return t}catch(e){var t;return null===(t=e.response)||void 0===t?void 0:t.data}},l=async e=>{try{let{data:t}=await r.Z.get("/quick-access",(0,r.d)(e));return t}catch(e){var t;return null===(t=e.response)||void 0===t?void 0:t.data}},c=async(e,t)=>{try{let{data:n}=await r.Z.post("/quick-access",e,(0,r.d)(t));return n}catch(e){var n;return null===(n=e.response)||void 0===n?void 0:n.data}},s=async(e,t)=>{try{let{data:n}=await r.Z.put("/quick-access/".concat(e.id),e,(0,r.d)(t));return n}catch(e){var n;return null===(n=e.response)||void 0===n?void 0:n.data}},o=async(e,t)=>{try{await r.Z.delete("/quick-access/".concat(e),(0,r.d)(t))}catch(e){var n;return null===(n=e.response)||void 0===n?void 0:n.data}}},71293:function(e,t,n){"use strict";n.d(t,{x:function(){return a}});var r=n(16554),i=n(77030),l=n(33179),c=n(65548),s=n(25432),o=n(87052),u=n(85893),a=(0,r.G)(function(e,t){let n=(0,i.mq)("Text",e),{className:r,align:a,decoration:d,casing:x,...h}=(0,l.Lr)(e),f=(0,o.o)({textAlign:e.align,textDecoration:e.decoration,textTransform:e.casing});return(0,u.jsx)(c.m.p,{ref:t,className:(0,s.cx)("chakra-text",e.className),...f,...h,__css:n})});a.displayName="Text"},93717:function(e,t,n){"use strict";n.d(t,{k:function(){return c}});var r=n(16554),i=n(65548),l=n(85893),c=(0,r.G)(function(e,t){let{direction:n,align:r,justify:c,wrap:s,basis:o,grow:u,shrink:a,...d}=e;return(0,l.jsx)(i.m.div,{ref:t,__css:{display:"flex",flexDirection:n,alignItems:r,justifyContent:c,flexWrap:s,flexBasis:o,flexGrow:u,flexShrink:a},...d})});c.displayName="Flex"},87052:function(e,t,n){"use strict";function r(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}n.d(t,{o:function(){return r}})},57169:function(e,t,n){"use strict";n.d(t,{g:function(){return d}});var r=n(41001),i=n(16554),l=n(77030),c=n(33179),s=n(65548),o=n(25432),u=n(85893),a=["h","minH","height","minHeight"],d=(0,i.G)((e,t)=>{let n=(0,l.mq)("Textarea",e),{className:i,rows:d,...x}=(0,c.Lr)(e),h=(0,r.Y)(x),f=d?function(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}(n,a):n;return(0,u.jsx)(s.m.textarea,{ref:t,rows:d,...h,className:(0,o.cx
1)("chakra-textarea",i),__css:f})});d.displayName="Textarea"}},function(e){e.O(0,[8990,9774,2888,179],function(){return e(e.s=73092)}),_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.