1var N=Object.defineProperty;var O=(i,s,t)=>s in i?N(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t;var r=(i,s,t)=>O(i,typeof s!="symbol"?s+"":s,t);import{n as e,ax as u}from"./antdProComponents-CFjaKfty.js";import{r as j}from"./react-_5RlvHhi.js";import{cK as q,an as L,d as Q,P as C,aq as E,aR as K}from"./index-CR8yoNY4.js";import{a1 as $,a3 as k}from"./antdForm-D_29pKbP.js";import{aG as o}from"./antdBase-DlFOY6T8.js";import{c as J,b as m}from"./query-BM65dpYW.js";import{a as G}from"./antdModal-tqe9k7Ax.js";import"./antdTable-CU40bWxf.js";import"./antdIcons-BdMX_pWi.js";import"./pdfjs-Jc8nWIli.js";import"./jspdf-Dp8Wz4gx.js";import"./utils-BGnmWEL9.js";import"./tiptap-BdEHFol7.js";import"./reactPdf-CWXH5nfV.js";import"./antdMaskInput-Bpz7D-sT.js";import"./antdProTable-Ds9khEp6.js";import"./chart-BVWW38sX.js";import"./others-D2FK10gv.js";import"./x6-8W7Bzdfz.js";import"./pdfLib-_sLH-ZSH.js";class V extends q{constructor(){super("/api/n1/diia/admin/");r(this,"fetchDiiaToken",async()=>this.get({url:"token"}));r(this,"fetchBranches",async()=>this.get({url:"branches"}));r(this,"syncronizeBranches",async()=>this.get({url:"synchronize"}));r(this,"postBranch",async t=>this.post({url:"branches",data:t}));r(this,"putBranch",async({id:t,data:p})=>this.put({url:`branches/${t}`,data:p}));r(this,"deleteBranch",async t=>this.delete({url:`branches/${t}`}))}}const c=new V,de=()=>{const[i,s]=j.useState(!1),[t,p]=j.useState(),f=j.useRef(null),h=J(),{mutate:S,data:d}=m({mutationFn:c.fetchDiiaToken}),{data:a,isLoading:F,queryKeys:x}=L({keys:["branches"],fetcher:c.fetchBranches}),{mutate:T,isLoading:g}=m({mutationFn:c.syncronizeBranches}),{mutate:A}=m({mutationFn:c.postBranch,onSuccess:()=>{h.invalidateQueries(x)}}),{mutate:I}=m({mutationFn:c.putBranch,onSuccess:()=>{h.invalidateQueries(x)}}),{mutate:M}=m({mutationFn:c.deleteBranch,onSuccess:()=>{h.invalidateQueries(x)}}),z=()=>{var l;const n=JSON.parse((l=f.current.resizableTextArea)==null?void 0:l.textArea.value);return t?I({id:t.branch_id,data:n}):A(n)},v=(d==null?void 0:d.token)||"",B="ÐÑÑ: адмÑнÑÑÑÑÑваннÑ",w=(t==null?void 0:t.name)||"Add new branch";Q(B);const b=n=>{n&&p(n),s(!0)},D=()=>{s(!1),p(null)},P=[{title:"Ðазва вÑддÑленнÑ",render:n=>{var l;return e.jsxs(e.Fragment,{children:[e.jsx(o,{type:"link",onClick:()=>b(n),children:n==null?void 0:n.name}),e.jsx("span",{children:(l=n==null?void 0:n.offers)==null?void 0:l.map(y=>(y==null?void 0:y.name)+", ")})]})}},{title:" ",dataIndex:"id",render:n=>e.jsx(G,{title:"Ðи впевненÑ, Ñо Ñ
оÑеÑе видалиÑи ÑÑ Ð³ÑлкÑ?",onConfirm:()=>M(n),children:e.jsx(o,{type:"primary",children:"ÐидалиÑи"})})}],R=F||g;return e.jsxs("div",{children:[e.jsxs(u,{justify:"space-between",align:"center",className:"mb-2",children:[e.jsx(C,{text:B,resetMargin:!0}),e.jsxs(u,{gap:10,align:"center",children:[e.jsx($.Item,{label:"СеÑÑйний Ñокен",className:"mb-0",children:e.jsx(k,{disabled:!0,value:v})}),e.jsx(o,{onClick:S,type:"primary",ghost:!0,children:"СÑвоÑиÑи ÑеÑÑÑ"})]})]}),e.jsxs(u,{justify:"space-between",children:[e.jsx(C,{text:"Branches"}),e.jsxs(u,{gap:10,children:[e.jsx(o,{type:"primary",ghost:!0,onClick:T,loading:g,children:"СинÑ
ÑонÑзÑваÑи"}),e.jsx(o,{type:"primary",onClick:()=>b(),children:"ÐодаÑи"})]})]}),e.jsx(E,{rowKey:"id",columns:P,count:a==null?void 0:a.count,loading:R,dataSource:a==null?void 0:a.items}),e.jsxs(K,{isOpen:i,onCancel:D,title:w,children:[e.jsx(k.TextArea,{ref:f,defaultValue:JSON.stringify(t,null,2),autoSize:{minRows:10}}),e.jsx(u,{justify:"flex-end",className:"mt-2",children:e.jsx(o,{type:"primary",onClick:z,children:"ÐбеÑегÑи"})})]})]})};export{de as default};
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.