1"use strict";(self.webpackChunkorderry=self.webpackChunkorderry||[]).push([[13763],{13763:function(w,S,e){e.r(S),e.d(S,{default:function(){return z}});var o=e(74848),v=e(96540),c=e(1575),C=e(62830),L=e(70881),E=e(49785),N=e(62770),U=e(13965),j=e(80661),f=e(3734),h=e(25716),D=e(99589),M=e(14854),F=e(22832),K=e(93647),R=e(23824),B=e(99813),g=e(94119),P=e(14756),T=e(71612),p=e(54350),J=e(45182);const n={NAME:"name",LINK:"link",CALLBACKUUID:"callbackuuid",USERS:"users"},O=3;var W=e(94618);const H=(t,r)=>{var l;const{callbackuuid:a="",link:u="",users:s,...i}=t,{integrationId:I,telephonyAddressId:x}=r;return{id:x,integrationId:I,...i,link:u,data:JSON.stringify({callbackuuid:a}),users:(l=(0,W.j1)(s))!=null?l:[]}};function Y(t){const{telephonyAddressId:r,integrationId:l,name:a,tableName:u}=t,{t:s}=(0,N.Bd)(),{formState:{errors:i},setValue:I,handleSubmit:x}=(0,E.xW)(),A=(0,T.j)(),{error:Q,isLoading:y,onSubmit:X,onDelete:$}=(0,J.V)({integrationId:l,telephonyAddressId:r,tableName:u,preparePayload:H});return(0,v.useEffect)(()=>{if(!r&&A.data){const k=A.data.map(q=>({value:q.value}));I(n.USERS,k,{shouldDirty:!1})}},[A.data]),(0,p.B)(Q),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(F.A,{children:(0,o.jsx)(g.A,{title:a||s("New extension number")})}),(0,o.jsxs)(D.A,{children:[(0,o.jsx)(h.A,{errors:i,name:n.NAME,labelProps:{label:s("Display name"),htmlFor:n.NAME,isRequired:!0},children:(0,o.jsx)(U.A,{name:n.NAME,id:n.NAME})}),(0,o.jsx)(h.A,{errors:i,name:n.LINK,description:s("Short number, usually consists of {{count}} digits. You can find it in your VoIP account.",{count:O}),labelProps:{label:s("Number (address)"),htmlFor:n.LINK,isRequired:!0},isFullWidth:!0,children:(0,o.jsx)(U.A,{name:n.LINK,id:n.LINK,maxWidth:"100%"})}),(0,o.jsx)(h.A,{errors:i,name:n.CALLBACKUUID,labelProps:{label:s("Callback UUID"),htmlFor:n.CALLBACKUUID,isRequired:!0},children:(0,o.jsx)(U.A,{name:n.CALLBACKUUID,id:n.CALLBACKUUID})}),(0,o.jsx)(h.A,{name:n.USERS,labelProps:{htmlFor:n.USERS,label:s("Employee"),isRequired:!0},errors:i,children:(0,o.jsx)(j.A,{name:n.USERS,data:A.data,ItemComponent:f.A,contentWidth:"100%",expandAllToNodes:!0,isLoading:A.isLoading})})]}),(0,o.jsxs)(M.A,{children:[(0,o.jsx)(R.A,{children:(0,o.jsx)(P.A,{text:s("Save"),isLoading:y,onClick:x(X)})}),r&&(0,o.jsx)(B.A,{children:(0,o.jsx)(K.A,{isLoading:y,dataCid:"delete-extension-number-btn",confirmProps:{onConfirm:$,title:s("Delete extension number?")}})})]})]})}var V=(0,v.memo)(Y);const b=t=>{var r,l;return{[n.NAME]:(t==null?void 0:t[n.NAME])||"",[n.LINK]:(t==null?void 0:t[n.LINK])||"",[n.CALLBACKUUID]:((r=t==null?void 0:t.data)==null?void 0:r[n.CALLBACKUUID])||"",[n.USERS]:((l=t==null?void 0:t[n.USERS])==null?void 0:l.map(a=>({value:a})))||"all"}};var m=e(12664),d=e(34338);const G=m.Ik().shape({[n.NAME]:m.Yj().trim().max(32,d.UU.maxSymbols(32)).required(d.UU.required),[n.CALLBACKUUID]:m.Yj().trim().max(500,d.UU.maxSymbols(500)).required(d.UU.required),[n.LINK]:m.Yj().max(32,d.UU.maxSymbols(32)).required(d.UU.required),[n.USERS]:m.YO().min(1,d.UU.required)});function Z(t){const{integrationId:r,data:l,tableName:a,...u}=t,s=(0,v.useMemo)(()=>({defaultValues:b(l),resolver:(0,c.t)(G)}),[l]);return(0,o.jsx)(C.A,{...u,size:L.MODAL_SIZE.SIZE_480,position:L.MODAL_POSITION.RIGHT,formProps:s,...t,children:(0,o.jsx)(V,{telephonyAddressId:l==null?void 0:l.id,integrationId:r!=null?r:l==null?void 0:l.integrationId,name:l==null?void 0:l.name,tableName:a})})}var z=(0,v.memo)(Z)}}]); 2 3//# sourceMappingURL=13763.4137334b843a656f82a0.js.map
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.