@elcrm/telegram 0.0.46 → 0.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -2576,7 +2576,7 @@ function pt({
2576
2576
  view: x
2577
2577
  }) {
2578
2578
  l = l !== void 0 ? l : !0, a = a !== void 0 ? a : !0, f = !!(f && (r === "" || r === void 0)) && !(l && a), h = h || "";
2579
- const v = "+7(___) ___ __ __", b = new Set("_"), C = ((k) => Array.from(v, (P, X) => b.has(P) ? k = X + 1 : k))(0), R = [...v].findIndex((k) => b.has(k)), T = new RegExp("\\d", "g"), D = (k) => (k = k.match(T) || [], Array.from(
2579
+ const v = "+7__________", b = new Set("_"), C = ((k) => Array.from(v, (P, X) => b.has(P) ? k = X + 1 : k))(0), R = [...v].findIndex((k) => b.has(k)), T = new RegExp("\\d", "g"), D = (k) => (k = k.match(T) || [], Array.from(
2580
2580
  v,
2581
2581
  (P) => (k[0] === P || b.has(P)) && k.shift() || P
2582
2582
  )), z = (k) => {
package/dist/index.umd.js CHANGED
@@ -28,4 +28,4 @@ Check the top-level render call using <`+w+">.")}return h}}function On(s,h){{if(
28
28
  <%s {...props} />
29
29
  React keys must be passed directly to JSX without using spread:
30
30
  let props = %s;
31
- <%s key={someKey} {...props} />`,kt,we,No,we),An[we+kt]=!0}}return s===i?Eo(W):So(W),W}}function Bo(s,h,w){return qn(s,h,w,!0)}function To(s,h,w){return qn(s,h,w,!1)}var Io=To,$o=Bo;Te.Fragment=i,Te.jsx=Io,Te.jsxs=$o}()),Te}process.env.NODE_ENV==="production"?Qe.exports=Wr():Qe.exports=Zr();var n=Qe.exports;const Lt={notice:"_notice_q5jau_1",error:"_error_q5jau_10",success:"_success_q5jau_13",warning:"_warning_q5jau_16",copy:"_copy_q5jau_19","show-notice":"_show-notice_q5jau_1","hide-notice":"_hide-notice_q5jau_1"};let ue={};function Ur(){let[e,t]=b.useState([]);return ue.set=r=>{t([...e,r])},ue.del=r=>{t(e.filter(i=>i.key!==r))},e.length===0?"":n.jsx("ul",{className:Lt.notice,children:e.map(r=>r.item)})}function Ie({data:e}){let[t,r]=b.useState("show");b.useEffect(()=>{setTimeout(function(){r("hide")},1800),setTimeout(function(){ue.del(e.key)},2500)},[e.key]);let i;switch(e.type){case"error":i=n.jsx(ge.error,{});break;case"success":i=n.jsx(ge.success,{});break;case"copy":i=n.jsx(ge.success,{});break;case"remark":i=n.jsx(ge.success,{});break;default:i=n.jsx(ge.success,{});break}return n.jsxs("li",{className:"item "+Lt[e.type],"data-status":t,children:[i,n.jsx("p",{children:e.text})]})}function Yr(e){let t=Date.now(),r={key:t,...e};ue.set({item:n.jsx(Ie,{data:r},t),key:t})}function Kr(e){let t=Date.now(),r={key:t,text:e,type:"error"};ue.set({item:n.jsx(Ie,{data:r},t),key:t})}function Hr(e){let t=Date.now(),r={key:t,text:e,type:"success"};ue.set({item:n.jsx(Ie,{data:r},t),key:t})}function Gr(e){let t=Date.now(),r={key:t,text:e,type:"remark"};ue.set({item:n.jsx(Ie,{data:r},t),key:t})}function Vr(e){let t=Date.now(),r={key:t,text:e,type:"copy"};ue.set({item:n.jsx(Ie,{data:r},t),key:t})}const ge={};ge.error=()=>n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22Z",fill:"#fff"}),n.jsx("path",{d:"M8.96967 8.96967C9.26256 8.67678 9.73744 8.67678 10.0303 8.96967L12 10.9394L13.9697 8.96969C14.2626 8.6768 14.7374 8.6768 15.0303 8.96969C15.3232 9.26258 15.3232 9.73746 15.0303 10.0303L13.0607 12L15.0303 13.9697C15.3232 14.2625 15.3232 14.7374 15.0303 15.0303C14.7374 15.3232 14.2625 15.3232 13.9696 15.0303L12 13.0607L10.0304 15.0303C9.73746 15.3232 9.26258 15.3232 8.96969 15.0303C8.6768 14.7374 8.6768 14.2626 8.96969 13.9697L10.9394 12L8.96967 10.0303C8.67678 9.73744 8.67678 9.26256 8.96967 8.96967Z",fill:"#bb2014"})]}),ge.success=()=>n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22Z",fill:"#fff"}),n.jsx("path",{d:"M16.0303 8.96967C16.3232 9.26256 16.3232 9.73744 16.0303 10.0303L11.0303 15.0303C10.7374 15.3232 10.2626 15.3232 9.96967 15.0303L7.96967 13.0303C7.67678 12.7374 7.67678 12.2626 7.96967 11.9697C8.26256 11.6768 8.73744 11.6768 9.03033 11.9697L10.5 13.4393L14.9697 8.96967C15.2626 8.67678 15.7374 8.67678 16.0303 8.96967Z",fill:"#367738"})]});const et={alerts:"_alerts_1pds5_1",menuAnimation:"_menuAnimation_1pds5_1",menuItemAnimation:"_menuItemAnimation_1pds5_1","--body":"_--body_1pds5_103",allert:"_allert_1pds5_111","--form":"_--form_1pds5_111",al:"_al_1pds5_1"};let $e={};function Xr(){let[e,t]=b.useState("");return $e.set=r=>t(r),$e.del=()=>t(""),n.jsx(n.Fragment,{children:e})}const Jr=({data:e,callback:t})=>(e.button=e.button===void 0?"Подтвердить":e.button,n.jsxs("div",{className:et.alerts,children:[n.jsxs("dl",{children:[n.jsx("dt",{children:e.title}),n.jsx("dd",{children:e.text}),n.jsx("ul",{children:n.jsx("button",{"data-color":e.color||"blue",onClick:()=>{t(),$e.del()},children:e.button})})]}),n.jsx("div",{className:et["--body"],onClick:$e.del})]}));function Qr(e,t){$e.set(n.jsx(Jr,{data:e,callback:t}))}const At={btn:"_btn_1hz2s_6",confirm:"_confirm_1hz2s_19"};function qt({onClick:e,onSend:t,label:r,onRef:i}){let[a,o]=b.useState(!1);const l=()=>{if(e)return e();a||(o(!0),t&&t(o))};return n.jsx("button",{ref:i,className:[At.btn,At.confirm].join(" "),onClick:l,children:a?"Ожидайте":r})}const te={white:"_white_11p39_14",black:"_black_11p39_26",shake:"_shake_11p39_1",modal:"_modal_11p39_73",o:"_o_11p39_83",w:"_w_11p39_14",h:"_h_11p39_107",l:"_l_11p39_121",t:"_t_11p39_159",m:"_m_11p39_73",x:"_x_11p39_167",s:"_s_11p39_177",c:"_c_11p39_182",f:"_f_11p39_187",btn:"_btn_11p39_230",g:"_g_11p39_243","size-a":"_size-a_11p39_296","size-s":"_size-s_11p39_300","size-m":"_size-m_11p39_304","size-l":"_size-l_11p39_308","size-x":"_size-x_11p39_312","size-f":"_size-f_11p39_316",confirm:"_confirm_11p39_322",cancel:"_cancel_11p39_327",disabled:"_disabled_11p39_332",await:"_await_11p39_339",active:"_active_11p39_389",coincidence:"_coincidence_11p39_395",sa:"_sa_11p39_431",ss:"_ss_11p39_435",sm:"_sm_11p39_439",sl:"_sl_11p39_443",sx:"_sx_11p39_447",sf:"_sf_11p39_451"};let me={};function ei({config:e}){let[t,r]=b.useState([]);return me.x=i=>{i||r([])},me.config=e,me.add=i=>{r([...t,i])},n.jsx(n.Fragment,{children:t.map(i=>i)})}function ti({title:e,children:t,button:r,tabs:i,size:a="m",menu:o}){const[l,d]=b.useState(!0),c=b.useRef(),u=p=>{if(r){if(r.onClick)return p(!1),r.onClick({setOpen:d});if(r.onSend)return r.onSend({setOpen:d,disabled:p})}},f=()=>{c.current.setAttribute("shake",!0),setTimeout(()=>{c.current.setAttribute("shake",!1)},1e3)};return n.jsx(n.Fragment,{children:l?n.jsxs("div",{className:`${te.modal} ${te.white}`,children:[n.jsx("div",{className:te.o,onClick:f}),n.jsxs("div",{className:[te.w,te[`s${a}`]].join(" "),ref:c,children:[n.jsxs("div",{className:te.h,children:[n.jsx("div",{className:te.t,children:e}),n.jsxs("div",{className:te.m,children:[i&&n.jsx("nav",{children:i.map((p,m)=>n.jsx("span",{onClick:p.onClick,className:p.active?"active":"",children:p.name},m))}),o]}),n.jsx("div",{className:te.x,onClick:()=>{d(!1)},children:n.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:n.jsx("path",{d:"M19.0005 4.99988L5.00045 18.9999M5.00045 4.99988L19.0005 18.9999",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),t,r!==void 0?n.jsx(qt,{label:r.label,onSend:u}):""]})]}):""})}function ni(e){me.add(n.jsx(ri,{children:e},String(Date.now())))}function ri({children:e}){return n.jsx(n.Fragment,{children:e})}function ii(e){if(e.target.classList[0]!=="modal")return;let t=e.target.children[0];t.setAttribute("shake",!0),setTimeout(()=>{t.setAttribute("shake",!1)},1e3)}function ai({type:e,name:t,params:r}){let[i,a]=b.useState(null);return b.useEffect(()=>{me.config(e,t,r,a)},[r.id]),n.jsx(n.Fragment,{children:i})}function oi(e,t){me.config(e,t)}function si(e){me.x(e)}const tt={};function li(e,t){tt[e]=t}function di(e,t){tt[e]!==void 0&&tt[e](t)}const fe={};function ci(e,t){const[r,i]=b.useState(t);return b.useEffect(()=>{if(fe[e])return fe[e].push(i);fe[e]=[i]},[]),[r]}function ui(e,t){if(fe[e])return fe[e].push(t);fe[e]=[t]}function fi(e,t){fe[e]&&fe[e].forEach(r=>r(t))}const Le={setListener:di,useListener:li,setEmitter:fi,useEmitter:ci,subEmitter:ui};function pi(){let[e,t]=b.useState([]);return Le.useListener("form",r=>{t([r])}),n.jsx(n.Fragment,{children:e.map(r=>r)})}const se={Path:ur,setPage:Qn,getPage:St,usePage:Jn,isPage:er,setModule:nr,getModule:Et,useModule:tr,isModule:rr,setTabs:ar,getTabs:Pe,useTabs:ir,isTabs:or,useId:sr,setId:dr,subId:lr,getId:Bt,isId:cr},Ae={Send:Yr,Error:Kr,Remark:Gr,Success:Hr,Copy:Vr},Wt=({onClick:e,active:t})=>(t=!!t,n.jsx("div",{role:"switch",onClick:()=>e,"aria-checked":`${t?"true":"false"}`}));function Zt({onClick:e,onSend:t,name:r,onRef:i}){let[a,o]=b.useState(!1);const l=()=>{if(e)return e();a||(o(!0),t&&t(o))};return n.jsx("button",{ref:i,"data-form":"button",className:a?"btn await":"btn confirm pointer",onClick:l,children:a?"Ожидайте":r})}function Ut({value:e,onValue:t,onActive:r,data:i,name:a,view:o,edit:l=!0,active:d=!0,placeholder:c="Введите сообщение"}){const u=b.useRef({value:e,timerId:null,shift:!1,send:!0}),f=()=>{u.current.value.length>0?u.current.send&&(r(!0),u.current.send=!1,u.current.timerId=setTimeout(()=>{u.current.send=!0},3e3)):r(!1)},p=y=>{u.current.value=y.target.textContent,f()},m=y=>{y.keyCode===16&&(u.current.shift=!0),y.keyCode===13&&!u.current.shift&&(y.preventDefault(),u.current.value.length!==0&&(y.target.textContent="",i&&i(u.current.value),t&&t(u.current.value),u.current.value="",r(!1)))},x=y=>{y.keyCode===16&&(u.current.shift=!1)},g=y=>{y.preventDefault(),navigator.clipboard.readText().then(k=>{window.document.execCommand("insertText",!1,k)}).catch(k=>{})},v=()=>{r(!1)},_={spellCheck:"true"};return c&&(_.placeholder=c),l&&d&&(_.contentEditable="plaintext-only"),n.jsx("dl",{"data-form":"message",children:n.jsx("dd",{onPaste:g,onInput:p,onKeyUp:x,onKeyDown:m,onBlur:v,..._,suppressContentEditableWarning:!0,children:e})})}function Yt(e){let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=e.edit!==void 0?e.edit:!0,i=e.active!==void 0?e.active:!0,a=e.placeholder!==void 0?e.placeholder:"",o=c=>{e.onValue({value:c.target.textContent,name:e.name})},l=c=>{c.key==="Enter"&&c.preventDefault()},d=c=>{c.preventDefault(),navigator.clipboard.readText().then(u=>{window.document.execCommand("insertText",!1,u)}).catch(u=>{})};return n.jsxs("dl",{"data-form":"input","type-data":"generator",children:[t(),n.jsx("dd",{onPaste:d,onInput:o,onKeyDown:l,contentEditable:r&&i?"plaintext-only":"false","data-placeholder":a,suppressContentEditableWarning:!0,children:e.value})]})}let _e={};_e.KeyDown=e=>{e.key==="Enter"&&e.preventDefault()},_e.PasteOne=e=>{e.preventDefault(),navigator.clipboard.readText().then(t=>{t=t.replace(/^\s*/,"").replace(/\s*$/,""),window.document.execCommand("insertText",!1,t)}).catch(t=>{})},_e.Focus=e=>{e.target.textContent.length===0&&(e.target.innerHTML="<br>")},_e.Blur=e=>{e.target.scrollLeft=0,e.target.querySelector("br")!==null&&e.target.querySelector("br").remove()};function Kt({value:e,onValue:t,placeholder:r="",name:i}){let a=(x,g)=>Number(Math.round(x+Math.random()*(g-x))),o=b.useRef(null),l=b.useRef(null),d=a(1e4,99999),c=x=>{x.key!=="Backspace"&&(x.key==="Enter"&&x.preventDefault(),x.target.textContent.length===5&&x.preventDefault(),/\d/.test(x.key)||x.preventDefault())},u=x=>{t({value:Number(x.target.textContent)===d,name:i})},f=x=>{x.preventDefault(),navigator.clipboard.readText().then(g=>{window.document.execCommand("insertText",!1,g.replace(/(\r\n|\n|\r)/gm," ").replace(/[^0-9]/g,"").substring(0,5))}).catch(g=>{})};b.useEffect(()=>{const x=o.current,g=x.getContext("2d");g.clearRect(0,0,x.width,x.height),g.font="30px brush script mt",g.fillStyle="#eee",g.textAlign="center",g.fillText(d,50,27),l.current.textContent=""},[d]);const p={};p.field="captcha";const m={};return r&&(m.placeholder=r),n.jsxs("dl",{...p,children:[n.jsx("dd",{ref:l,onPaste:f,onInput:u,onBlur:_e.Blur,onKeyDown:c,contentEditable:"plaintext-only",suppressContentEditableWarning:!0,...m}),n.jsx("canvas",{ref:o,width:"100",height:"35"})]})}function Ht(e){let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=()=>e.error?n.jsx("em",{children:e.error}):"",i={n1:"",n2:"",n3:"",n4:"",n5:"",n6:"",code:""},a=u=>{u.preventDefault(),u.target.textContent=u.target.textContent.slice(-1).replace(/[^+\d]/g,"");let f=window.getSelection(),p=u.target.textContent.length;if(i[u.target.id]=u.target.textContent,i.code=i.n1+""+i.n2+i.n3+i.n4+i.n5+i.n6,f.collapse(u.target.firstChild,1),p===0){u.target.blur(),u.target.focus();return}u.target.nextSibling!=null&&u.target.nextSibling.focus()},o=u=>{if(u.key==="Enter"&&u.preventDefault(),u.key==="Backspace"){if(u.preventDefault(),u.target.textContent="",i[u.target.id]="",u.target.previousSibling!=null){let f=u.target.previousSibling.id.slice(1);u.target.previousSibling.textContent="",i["n"+f]="",u.target.previousSibling.focus()}i.code=i.n1+""+i.n2+i.n3+i.n4+i.n5+i.n6}},l=u=>{if(e.real)e.onValue({value:i.code,name:e.name});else if(i.code.length===6&&(e.onValue({value:i.code,name:e.name}),e.empty)){i={n1:"",n2:"",n3:"",n4:"",n5:"",n6:"",code:""};for(let f=1;f<=6;f++){let p=document.getElementById("n"+f);p&&(p.textContent="")}}},d=u=>{u.target.textContent=""},c=u=>{u.preventDefault()};return n.jsxs("dl",{"data-form":"code",children:[t(),n.jsxs("div",{children:[n.jsx("dd",{id:"n1",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0}),n.jsx("dd",{id:"n2",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0}),n.jsx("dd",{id:"n3",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0}),n.jsx("dd",{id:"n4",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0}),n.jsx("dd",{id:"n5",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0}),n.jsx("dd",{id:"n6",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0})]}),r()]})}function Gt(e){let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=()=>e.error?n.jsx("em",{children:e.error}):"";e.edit!==void 0&&e.edit,e.active!==void 0&&e.active;let[i,a]=b.useState(e.value),o=l=>{let d=l.target.getAttribute("set-color");a(d),e.onValue({value:d,name:e.name})};return n.jsx(n.Fragment,{children:e.view==="icon"?n.jsx("i",{"data-icon":"F043"}):n.jsxs("dl",{children:[t(),n.jsxs("dd",{"el-val":i,children:[n.jsx("em",{onClick:o,"set-color":"0"}),n.jsx("em",{onClick:o,"set-color":"1"}),n.jsx("em",{onClick:o,"set-color":"2"}),n.jsx("em",{onClick:o,"set-color":"3"}),n.jsx("em",{onClick:o,"set-color":"4"}),n.jsx("em",{onClick:o,"set-color":"5"})]}),r()]})})}function xi(e,t){t===void 0?(t=e,e=new Date):e=new Date(e);let r={yyyy:e.getFullYear(),yy:(""+e.getFullYear()).slice(-2),mm:("0"+(e.getMonth()+1)).slice(-2),dd:("0"+e.getDate()).slice(-2),HH:("0"+e.getHours()).slice(-2),MM:("0"+e.getMinutes()).slice(-2),SS:("0"+e.getSeconds()).slice(-2),__:"      ",_:"    "};for(const i in r)t=t.replace(i,r[i]);return t}function hi(e){let t=["Января","Февраля","Марта","Апреля","Мая","Июня","Июля","Августа","Сентября","Октября","Ноября","Декабря"],r=new Date(e);return{day:(""+r.getFullYear()).slice(-2)+""+("0"+(r.getMonth()+1)).slice(-2)+("0"+r.getDate()).slice(-2),name:r.getDate()+" "+t[r.getMonth()]}}const gi=e=>{function t(T,$){var M,U,q;T=T??"",$=$??1;for(var M=[],q=0,U=T.length;q<U;)M.push(T.slice(q,q+=$));return M}function r(T,$){var M=[2,0,1,1,1,2];return $[T>4&&T<20?2:M[Math.min(T,5)]]}var i={null:"ноль",a1:["один","два","три","четыре","пять","шесть","семь","восемь","девять"],a2:["одна","две","три","четыре","пять","шесть","семь","восемь","девять"],a10:["десять","одиннадцать","двенадцать","тринадцать","четырнадцать","пятнадцать","шестнадцать","семнадцать","восемнадцать","девятнадцать"],a20:["двадцать","тридцать","сорок","пятьдесят","шестьдесят","семьдесят","восемьдесят","девяносто"],a100:["сто","двести","триста","четыреста","пятьсот","шестьсот","семьсот","восемьсот","девятьсот"],uc:["копейка","копейки","копеек"],ur:["рубль","рубля","рублей"],u3:["тысяча","тысячи","тысяч"],u2:["миллион","миллиона","миллионов"],u1:["миллиард","миллиарда","миллиардов"]},a,o,l,d,_,c,u,v,f,p,m,x;f=parseFloat(e).toFixed(2).split("."),c=f[0],d=f[1];var g=12-c.length;if(g<0)return!1;for(var v=[];g--;)v.push("0");c=v.join("")+c;var _=[];if(c>0){p=t(c,3);for(var y=-1;y<p.length;y++)if(u=p[y],u>0&&(m=t(u,1),a=parseInt(m[0]),o=parseInt(m[1]),l=parseInt(m[2]),_.push(i.a100[a-1]),x=y+1==3?"a2":"a1",o>1?_.push(i.a20[o-2]+(l>0?" "+i[x][l-1]:"")):_.push(o>0?i.a10[l]:i[x][l-1]),p.length>y+1)){var k=i["u"+(y+1)];_.push(r(u,k))}}else _.push(i.null);return _.push(r(c,i.ur)),_.push(d+" "+r(d,i.uc)),_.join(" ").replace(RegExp(" {2,}","g")," ").trimLeft()};function mi(e){let t=-1,r=[" kB"," MB"," GB"," TB","PB","EB","ZB","YB"];do e=e/1024,t++;while(e>1024);return Math.max(e,.1).toFixed(1)+r[t]}function _i(e){let t={};return t["application/atom+xml"]="atom",t["application/json"]="json",t["application/javascript"]="js",t["application/ogg"]="ogg",t["application/pdf"]="pdf",t["application/soap+xml"]="soap",t["application/font-woff"]="woff",t["application/xhtml+xml"]="xml",t["application/xml-dtd"]="dtd",t["application/xop+xml"]="xop",t["application/zip"]="zip",t["application/gzip"]="gzip",t["application/x-bittorrent"]="bittorrent",t["application/x-tex"]="tex",t["application/xml"]="xml",t["application/msword"]="doc",t["image/svg+xml"]="svg",t[e]}function bi(e,t,r,i){let a={sexM:"m",sexF:"f",gcaseIm:"nominative",gcaseNom:"nominative",gcaseRod:"genitive",gcaseGen:"genitive",gcaseDat:"dative",gcaseVin:"accusative",gcaseAcc:"accusative",gcaseTvor:"instrumentative",gcaseIns:"instrumentative",gcasePred:"prepositional",gcasePos:"prepositional",rules:{lastName:{exceptions:[" дюма,тома,дега,люка,ферма,гамарра,петипа,шандра . . . . ."," гусь,ремень,камень,онук,богода,нечипас,долгопалец,маненок,рева,кива . . . . ."," вий,сой,цой,хой -я -ю -я -ем -е"],suffixes:["f б,в,г,д,ж,з,й,к,л,м,н,п,р,с,т,ф,х,ц,ч,ш,щ,ъ,ь . . . . .","f ска,цка -ой -ой -ую -ой -ой","f ая --ой --ой --ую --ой --ой"," ская --ой --ой --ую --ой --ой","f на -ой -ой -у -ой -ой"," иной -я -ю -я -ем -е"," уй -я -ю -я -ем -е"," ца -a -е -у -ей -е"," рих а у а ом е"," ия . . . . ."," иа,аа,оа,уа,ыа,еа,юа,эа . . . . ."," их,ых . . . . ."," о,е,э,и,ы,у,ю . . . . ."," ова,ева -ой -ой -у -ой -ой"," га,ка,ха,ча,ща,жа -и -е -у -ой -е"," ца -и -е -у -ей -е"," а -ы -е -у -ой -е"," ь -я -ю -я -ем -е"," ия -и -и -ю -ей -и"," я -и -е -ю -ей -е"," ей -я -ю -я -ем -е"," ян,ан,йн а у а ом е"," ынец,обец --ца --цу --ца --цем --це"," онец,овец --ца --цу --ца --цом --це"," ц,ч,ш,щ а у а ем е"," ай -я -ю -я -ем -е"," гой,кой -го -му -го --им -м"," ой -го -му -го --ым -м"," ах,ив а у а ом е"," ший,щий,жий,ний --его --ему --его -м --ем"," кий,ый --ого --ому --ого -м --ом"," ий -я -ю -я -ем -и"," ок --ка --ку --ка --ком --ке"," ец --ца --цу --ца --цом --це"," в,н а у а ым е"," б,г,д,ж,з,к,л,м,п,р,с,т,ф,х а у а ом е"]},firstName:{exceptions:[" лев --ьва --ьву --ьва --ьвом --ьве"," павел --ла --лу --ла --лом --ле","m шота . . . . .","m пётр ---етра ---етру ---етра ---етром ---етре","f рашель,нинель,николь,габриэль,даниэль . . . . ."],suffixes:[" е,ё,и,о,у,ы,э,ю . . . . .","f б,в,г,д,ж,з,й,к,л,м,н,п,р,с,т,ф,х,ц,ч,ш,щ,ъ . . . . .","f ь -и -и . ю -и","m ь -я -ю -я -ем -е"," га,ка,ха,ча,ща,жа -и -е -у -ой -е"," ша -и -е -у -ей -е"," а -ы -е -у -ой -е"," ия -и -и -ю -ей -и"," я -и -е -ю -ей -е"," ей -я -ю -я -ем -е"," ий -я -ю -я -ем -и"," й -я -ю -я -ем -е"," б,в,г,д,ж,з,к,л,м,н,п,р,с,т,ф,х,ц,ч а у а ом е"]},middleName:{suffixes:[" ич а у а ем е"," на -ы -е -у -ой -е"]}},initialized:!1,init:function(){this.initialized||(this.prepareRules(),this.initialized=!0)},prepareRules:function(){for(var l in this.rules)for(var d in this.rules[l])for(var c=0,u=this.rules[l][d].length;c<u;c++)this.rules[l][d][c]=this.rule(this.rules[l][d][c])},rule:function(l){var d=l.match(/^\s*([fm]?)\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*$/);return d?{sex:d[1],test:d[2].split(","),mods:[d[3],d[4],d[5],d[6],d[7]]}:!1},word:function(l,d,c,u){if(u===this.gcaseNom)return l;if(l.match(/[-]/)){for(var f=l.split("-"),p=0,m=f.length;p<m;p++)f[p]=this.word(f[p],d,c,u);return f.join("-")}if(l.match(/^[А-ЯЁ]\.?$/i))return l;this.init();var x=this.rules[c];let g;return x.exceptions&&(g=this.pick(l,d,u,x.exceptions,!0),g)?g:(g=this.pick(l,d,u,x.suffixes,!1),g||l)},pick:function(l,d,c,u,f){let p=l.toLowerCase();for(var m=0,x=u.length;m<x;m++)if(this.ruleMatch(p,d,u[m],f))return this.applyMod(l,c,u[m]);return!1},ruleMatch:function(l,d,c,u){if(c.sex===this.sexM&&d===this.sexF||c.sex===this.sexF&&d!==this.sexF)return!1;for(var f=0,p=c.test.length;f<p;f++){var m=u?l:l.substr(Math.max(l.length-c.test[f].length,0));if(m===c.test[f])return!0}return!1},applyMod:function(l,d,c){let u;switch(d){case this.gcaseNom:u=".";break;case this.gcaseGen:u=c.mods[0];break;case this.gcaseDat:u=c.mods[1];break;case this.gcaseAcc:u=c.mods[2];break;case this.gcaseIns:u=c.mods[3];break;case this.gcasePos:u=c.mods[4];break}for(var f=0,p=u.length;f<p;f++){var m=u.substr(f,1);switch(m){case".":break;case"-":l=l.substr(0,l.length-1);break;default:l+=m}}return l},getSex:()=>{if(a.mn.length>2)switch(a.mn.substr(a.mn.length-2)){case"ич":return"m";case"на":return"f"}return""},fullName:l=>((a.fullNameSurnameLast?"":a.lastName(l)+" ")+a.firstName(l)+" "+a.middleName(l)+(a.fullNameSurnameLast?" "+a.lastName(l):"")).replace(/^ +| +$/g,""),lastName:l=>a.word(a.ln,a.sex,"lastName",l),firstName:l=>a.word(a.fn,a.sex,"firstName",l),middleName:l=>a.word(a.mn,a.sex,"middleName",l)};if(typeof t>"u"){var o=e.match(/^\s*(\S+)(\s+(\S+)(\s+(\S+))?)?\s*$/);if(!o)return"Cannot parse supplied name";o[5]&&o[3].match(/(ич|на)$/)&&!o[5].match(/(ич|на)$/)?(e=o[5],t=o[1],r=o[3],a.fullNameSurnameLast=!0):(e=o[1],t=o[3],r=o[5])}return a.ln=e,a.fn=t||"",a.mn=r||"",a.sex=i||a.getSex(),a}function vi(e){let t=e.split(" ");switch(t.length){case 2:return t[0]+" "+t[1].substring(0,1)+".";case 3:return t[0]+" "+t[1].substring(0,1)+"."+t[2].substring(0,1)+".";default:return e}}function yi(e){return{1:{val:"01",name:"Январь",names:"Января",abc:"Янв"},2:{val:"02",name:"Февраль",names:"Февраля",abc:"Февр"},3:{val:"03",name:"Март",names:"Марта",abc:"Март"},4:{val:"04",name:"Апрель",names:"Апреля",abc:"Апр"},5:{val:"05",name:"Май",names:"Мая",abc:"Май"},6:{val:"06",name:"Июнь",names:"Июня",abc:"Июнь"},7:{val:"07",name:"Июль",names:"Июля",abc:"Июль"},8:{val:"08",name:"Август",names:"Августа",abc:"Авг"},9:{val:"09",name:"Сентябрь",names:"Сентебря",abc:"Сент"},10:{val:"10",name:"Октябрь",names:"Октября",abc:"Окт"},11:{val:"11",name:"Ноябрь",names:"Ноября",abc:"Нояб"},12:{val:"12",name:"Декабрь",names:"Декабря",abc:"Дек"}}[e]}function wi(e){return parseFloat(e).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g,"$1 ")}function ki(e,t){let r=t+"";for(;r.length<e;)r="0"+r;return r}function ji(e,t,r){let i=t/e*r;return(typeof i!="number"||i===1/0)&&(i=0),parseFloat(i).toFixed(1)}function Ci(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Si(e,t){e=Math.abs(e)%100;let r=e%10;return e>10&&e<20?t[2]:r>1&&r<5?t[1]:r===1?t[0]:t[2]}function Ei(e,t,r){return he(e,t)?he(e,t).n:r||""}function Bi(e,t){return e.reduce(function(r,i){let a=t instanceof Function?t(i):i[t];return r[a]!==void 0||(r[a]={}),r[a][i.id]=i,r},{})}function Ti(e){return parseInt((Date.now()-new Date(e).getTime())/31536e6+"")+""}const pe={Age:Ti,Date:xi,MoneyString:gi,DateSort:hi,Size:mi,TypeFiles:_i,Cases:bi,Initials:vi,Month:yi,Money:wi,Number:ki,Percent:ji,CapitalizeFirstLetter:Ci,DeclensionWord:Si,Select:Ei,ObjectByArray:Bi};function nt({label:e,value:t,placeholder:r,onValue:i,name:a}){const o="__.__.____",l=new Set("_"),d=(g=>Array.from(o,(v,_)=>l.has(v)?g=_+1:g))(0),c=[...o].findIndex(g=>l.has(g)),u=new RegExp("\\d","g"),f=g=>(g=g.match(u)||[],Array.from(o,v=>(g[0]===v||l.has(v))&&g.shift()||v)),p=g=>{const[v,_]=[g.target.selectionStart,g.target.selectionEnd].map(y=>(y=f(g.target.value.slice(0,y)).findIndex(k=>l.has(k)),y<0?d[d.length-1]:m?d[y-1]||c:y));g.target.value=f(g.target.value).join(""),g.target.setSelectionRange(v,_),m=!1,i==null||i({name:a,value:g.target.value})};let m=!1;const x={};return x.field="input",n.jsxs("dl",{...x,children:[n.jsx("dt",{}),n.jsx("dd",{children:n.jsx("input",{type:"tel",placeholder:r,onChange:p,inputMode:"numeric",onKeyDown:g=>m=g.key==="Backspace",onFocus:p,defaultValue:pe.Date(t,"dd.mm.yyyy"),onBlur:g=>g.target.value===o&&(g.target.value="")})})]})}function Ii({children:e}){return n.jsx("div",{className:"l",children:n.jsx("ul",{children:e})})}function $i({children:e}){return n.jsx("div",{className:te.s,children:e})}function Ni({children:e,className:t}){let r={};return t&&(r.className=t),n.jsx("div",{"data-form":"outline",...r,children:n.jsx("ul",{children:e})})}function Di({children:e}){return n.jsx("div",{className:te.c,children:e})}const rt={List:Ii,Scroll:$i,Main:ti,Add:ni,Icon:ai,Open:oi,Shake:ii,Form:Ni,Center:Di,Close:si};function it({value:e,onValue:t,name:r,placeholder:i="",title:a,error:o,hide:l=!1,edit:d=!0,show:c=!0,active:u=!0,after:f="",view:p,modal:m,module:x,options:g,className:v}){let[_,y]=b.useState(e),k=M=>{if(!(d&&u)||!m)return;let q=m.split(".");rt.Open(q[1],{callback:U=>{t&&t({value:U,name:r}),y(U)},onValue:t,options:g,name:r,value:e})};const T={};T.field="input",v&&(T.className=v);const $={};return i&&($.placeholder=i),l?n.jsx(n.Fragment,{}):n.jsxs("dl",{...T,children:[a&&n.jsx("dt",{children:a}),n.jsx("dd",{...$,onClick:k,edit:(d&&u)+"","data-after":f,children:_}),o&&n.jsx("em",{children:o})]})}function at(e){let t=e.value,r=p=>e.type==="multi"?p.replace(/[^+\d.+-]/g,""):p.replace(/[^+\d.]/g,""),i=(p,m)=>{let x=document.createRange(),g=window.getSelection();x.setStart(m.childNodes[0],p),x.collapse(!0),g.removeAllRanges(),g.addRange(x),m.focus()},a=p=>{e.onValue({value:r(p.target.textContent),name:e.name}),p.target.textContent=r(p.target.textContent),p.target.textContent.length>0&&i(p.target.textContent.length,p.target)},o=p=>{p.target.textContent===""&&(p.target.textContent=0),e.onValue({value:r(p.target.textContent),name:e.name}),p.target.textContent=pe.Money(p.target.textContent)},l=p=>{p.target.textContent=r(p.target.textContent)},d=p=>{p.key==="Enter"&&p.preventDefault()},c=p=>{p.preventDefault(),navigator.clipboard.readText().then(m=>{m=m.replace(/^\s*/,"").replace(/\s*$/,""),window.document.execCommand("insertText",!1,m)}).catch(m=>{})},u=()=>e.title?n.jsx("dt",{children:e.title}):"",f=()=>e.error?n.jsx("em",{children:e.error}):"";return n.jsxs("dl",{"data-form":"input",children:[u(),n.jsx("dd",{onInput:a,onPaste:c,onBlur:o,onKeyDown:d,onFocus:l,contentEditable:!0,suppressContentEditableWarning:!0,"e-after":e.after,children:pe.Money(t)}),f()]})}const Vt={o:"_o_1kqkq_1",c:"_c_1kqkq_11"};function Xt({value:e,onValue:t,name:r,view:i,error:a,edit:o=!0,active:l=!0,title:d,placeholder:c="",after:u}){let[f,p]=b.useState(e);b.useEffect(()=>{p(e)},[e]);let m=v=>{p(v),t&&t({value:v,name:r})},x=v=>{if(!o||!l)return;const _=v.target.getBoundingClientRect(),y=_.left,k=_.top;Le.setListener("form",n.jsx(Mi,{position:{x:y,y:k},onValue:m,date:f},new Date().getTime()))};const g={};return c&&(g.placeholder=c),n.jsx(n.Fragment,{children:i==="icon"?n.jsx("i",{"data-icon":"F043",onClick:x}):n.jsxs("dl",{children:[d&&n.jsx("dt",{children:d}),n.jsx("dd",{onClick:x,...g,children:pe.Date(f,"mm.yyyy")}),a&&n.jsx("em",{children:a})]})})}const Mi=e=>{let[t,r]=b.useState(!0),i=new Date,a=new Date(e.date),o={y:parseInt(i.getFullYear()),m:parseInt(i.getMonth())+1},l={y:parseInt(a.getFullYear()),m:parseInt(a.getMonth())+1},[d,c]=b.useState(l.y),u=()=>{r(!1)},f=()=>{c(d+1)},p=()=>{c(d-1)},m=y=>{e.onValue(d+"-"+pe.Number(2,y)),u()},x=y=>o.y===l.y&&o.m===y?"_FFEB3B":"",g=Array(12).fill("").map((y,k)=>k+1),v=window.innerHeight-e.position.y+33<320?e.position.y-312:e.position.y+33,_=window.innerWidth-e.position.x<265?e.position.x-235:e.position.x;return n.jsx(n.Fragment,{children:t?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:Vt.o,onClick:()=>u()},new Date().getTime()),n.jsxs("div",{className:Vt.c,style:{top:v+"px",left:_+"px"},children:[n.jsxs("s",{children:[n.jsx("i",{"data-icon":"F021",onClick:()=>p()}),n.jsx("h2",{children:d}),n.jsx("i",{"data-icon":"F022",onClick:()=>f()})]}),n.jsx("div",{children:g.map((y,k)=>n.jsx("span",{onClick:()=>{m(y)},color:x(y),children:n.jsx("b",{children:pe.Month(y).abc})},k))})]})]}):""})};function Jt(e){let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=()=>e.error?n.jsx("em",{children:e.error}):"",[i,a]=b.useState(!1),o=e.edit!==void 0?e.edit:!0,l=e.active!==void 0?e.active:!0,c=!!(e.hide&&(e.value===""||e.value===void 0))&&!(o&&l);i=o?!0:i;let u=e.placeholder!==void 0?e.placeholder:"Заметка пуста",f=_=>{e.onValue&&e.onValue({value:_.target.innerText,name:e.name})},p=_=>{_.preventDefault(),navigator.clipboard.readText().then(y=>{window.document.execCommand("insertText",!1,y)}).catch(y=>{})},m=_=>{o||a(!i)};const x=_=>{e.onSave&&e.onSave({value:_.target.innerText,name:e.name})},g={};g.field="notes",e.className&&(g.className=e.className);const v={};return u&&(v.placeholder=u),i&&(v.open=""),o&&l&&(v.edit=""),c?n.jsx(n.Fragment,{}):n.jsxs("dl",{...g,children:[t(),n.jsx("dd",{onPaste:p,onInput:f,onBlur:x,contentEditable:o&&l?"plaintext-only":"false",...v,onDoubleClick:m,suppressContentEditableWarning:!0,children:e.value}),r()]})}function ot({onValue:e,onSave:t,value:r,name:i,active:a,max:o,edit:l,title:d,error:c,show:u,hide:f,placeholder:p,className:m,after:x,view:g}){l=l!==void 0?l:!0,a=a!==void 0?a:!0,f=!!(f&&(r===""||r===void 0))&&!(l&&a),p=p!==void 0?p:"",o=o!==void 0?o:99;let _=T=>{e==null||e({name:i,value:T.currentTarget.value})};const y=T=>{t==null||t({name:i,value:T.currentTarget.value})},k={};return k.field="input",m&&(k.className=m),f?n.jsx(n.Fragment,{}):n.jsxs("dl",{...k,children:[d&&n.jsx("dt",{children:d}),n.jsx("dd",{children:n.jsx("input",{name:i,type:"tel",inputMode:"numeric",onChange:_,onBlur:y,placeholder:p,defaultValue:r})}),c&&n.jsx("em",{children:c})]})}function Qt({value:e,onValue:t,name:r,placeholder:i="",className:a,title:o,error:l,edit:d=!0,active:c=!0,reload:u=!1,after:f=""}){let p=_=>{t&&t({value:_.target.textContent,name:r,reload:u})},m=_=>{_.key==="Enter"&&_.preventDefault()},x=_=>{_.preventDefault(),navigator.clipboard.readText().then(y=>{window.document.execCommand("insertText",!1,y.replace(/(\r\n|\n|\r)/gm," "))}).catch(y=>{})};const g={};g.field="password",a&&(g.className=a);const v={};return i&&(v.placeholder=i),n.jsxs("dl",{...g,children:[o?n.jsx("dt",{children:o}):"",n.jsx("dd",{onPaste:x,onInput:p,onKeyDown:m,onBlur:_e.Blur,contentEditable:d&&c?"plaintext-only":"false",...v,suppressContentEditableWarning:!0,children:e}),l?n.jsx("em",{children:l}):""]})}function st({onValue:e,onSave:t,value:r,name:i,active:a,max:o,edit:l,title:d,error:c,show:u,hide:f,placeholder:p,className:m,after:x,view:g}){l=l!==void 0?l:!0,a=a!==void 0?a:!0,f=!!(f&&(r===""||r===void 0))&&!(l&&a),p=p||"";const _="+7(___) ___ __ __",y=new Set("_"),k=(C=>Array.from(_,(R,Q)=>y.has(R)?C=Q+1:C))(0),T=[..._].findIndex(C=>y.has(C)),$=new RegExp("\\d","g"),M=C=>(C=C.match($)||[],Array.from(_,R=>(C[0]===R||y.has(R))&&C.shift()||R)),q=C=>{const[R,Q]=[C.target.selectionStart,C.target.selectionEnd].map(F=>(F=M(C.target.value.slice(0,F)).findIndex(X=>y.has(X)),F<0?k[k.length-1]:re?k[F-1]||T:F));C.target.value=M(C.target.value).join(""),C.target.setSelectionRange(R,Q),re=!1,e==null||e({name:i,value:C.target.value})},U=C=>{const[R,Q]=[C.target.selectionStart,C.target.selectionEnd].map(F=>(F=M(C.target.value.slice(0,F)).findIndex(X=>y.has(X)),F<0?k[k.length-1]:re?k[F-1]||T:F));C.target.value=M(C.target.value).join(""),C.target.setSelectionRange(R,Q),re=!1,e==null||e({name:i,value:C.target.value})};let re=!1;const L={};return L.field="input",m&&(L.className=m),f?n.jsx(n.Fragment,{}):n.jsxs("dl",{...L,children:[d&&n.jsx("dt",{children:d}),n.jsx("dd",{children:n.jsx("input",{name:i,type:"tel",inputMode:"numeric",onChange:q,onBlur:U,placeholder:p,defaultValue:r})}),c&&n.jsx("em",{children:c})]})}const en=e=>{let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=e.edit!==void 0?e.edit:!0,i=e.active!==void 0?e.active:!0,a=e.placeholder!==void 0?e.placeholder:"",o=0,l=()=>{clearTimeout(o),o=setTimeout(()=>{},1e3)},d=f=>{f.key==="Enter"&&f.preventDefault()},c=f=>{f.preventDefault(),navigator.clipboard.readText().then(p=>{window.document.execCommand("insertText",!1,p)}).catch(p=>{})};const u={};return a&&(u.placeholder=a),n.jsxs("dl",{"data-form":"input",children:[t(),n.jsx("dd",{onPaste:c,onInput:l,onKeyDown:d,contentEditable:r&&i?"plaintext-only":"false",...u,suppressContentEditableWarning:!0,children:e.value})]})};function lt({title:e,error:t,edit:r=!0,active:i=!0,hide:a,value:o="0",onValue:l,options:d,placeholder:c="",name:u,after:f,view:p,className:m}){var k;const x=b.useId(),[g,v]=b.useState((k=d[parseInt(o)])==null?void 0:k.n);let _=T=>{v(d[T.target.value].n),l==null||l({name:u,value:T.target.value})};const y={};return y.field="select",m&&(y.className=m),n.jsxs("dl",{...y,children:[e?n.jsx("dt",{children:e}):"",n.jsxs("dd",{children:[g,n.jsx("select",{name:u,id:x,defaultValue:o+"",onChange:_,children:Object.keys(d).map(T=>n.jsx("option",{value:T,children:d[T].n},T))})]})]})}function dt({value:e,onValue:t,name:r,placeholder:i="",title:a="",error:o="",hide:l=!1,edit:d=!0,active:c=!0,after:u="",show:f=!0,view:p,onSave:m,className:x=""}){let g=!!(l&&(e===""||e===void 0)),v=$=>{t==null||t({value:$.target.value,name:r})},_=$=>{$.preventDefault(),navigator.clipboard.readText().then(M=>{window.document.execCommand("insertText",!1,M.replace(/(\r\n|\n|\r)/gm," "))}).catch(M=>{})},y=$=>{$.preventDefault(),navigator.clipboard.writeText($.target.value).then(function(){Ae.Copy("Данные в буфер обмене")},function(M){})};if(!(d&&c)&&!f||!(d&&c)&&g)return"";const k={};k.field="input",x&&(k.className=x);const T=$=>{m==null||m({value:$.target.value,name:r})};return n.jsxs("dl",{...k,children:[a?n.jsx("dt",{children:a}):"",n.jsx("dd",{children:n.jsx("input",{name:r,autoComplete:"off",type:"text",onChange:v,onPaste:_,onBlur:T,onContextMenu:y,placeholder:i,defaultValue:e,spellCheck:"false"})}),o?n.jsx("em",{children:o}):""]})}function ct(e){let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=()=>e.error?n.jsx("em",{children:e.error}):"",i=e.edit!==void 0?e.edit:!0,a=e.active!==void 0?e.active:!0,l=!!(e.hide&&(e.default===""||e.options[e.default]===void 0))&&!(i&&a),d=e.placeholder!==void 0?e.placeholder:"",c=x=>{f(e.options[x]),e.onValue({value:x,name:e.name})},[u,f]=b.useState(e.default!==void 0?e.options[e.default]:e.default),p=x=>{if(!(i&&a))return;const g=x.target.getBoundingClientRect();Le.setListener("form",n.jsx(zi,{parent:g,onValue:c,view:e.view,options:e.options},new Date().getTime()))};const m={};return d&&(m.placeholder=d),l?n.jsx(n.Fragment,{}):n.jsxs("dl",{"data-form":"select",children:[t(),n.jsx("dd",{onClick:p,"data-edit":(i&&a)+"",...m,children:u}),r()]})}const zi=({onValue:e,parent:t,view:r,options:i})=>{let[a,o]=b.useState(!0),l=()=>{o(!1)},d=p=>{o(!1),e(p)},c=Object.keys(i).length*36,u=window.innerHeight-t.y+t.height<c?t.y-(c-33):t.y+33,f=window.innerWidth-t.x<265?t.x-235:t.x;return n.jsx(n.Fragment,{children:a?n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-select":"backdrop",onClick:l},new Date().getTime()),n.jsx("div",{"data-select":"background "+r,style:{top:u+"px",left:f+"px",width:t.width},children:n.jsx("ul",{children:Object.keys(i).map((p,m)=>n.jsx("li",{onClick:()=>{d(p)},children:i[p]},m))})})]}):""})};function ut({set:e,value:t,onValue:r,name:i,placeholder:a="",title:o="",error:l="",hide:d=!1,edit:c=!0,show:u=!0,active:f=!0,after:p="",view:m,module:x,item:g,className:v=""}){let _={};switch(e){case"String":return n.jsx(dt,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v});case"Select":return g&&(_=oe.getSelect(parseInt(g))?oe.getSelect(parseInt(g)):{0:{s:"1",n:"не известно"}}),n.jsx(lt,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v,options:_});case"Users":return oe.getSelect("user"),n.jsx(ct,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v,options:_});case"Date":return n.jsx(nt,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v});case"Phone":return n.jsx(st,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v});case"Number":return n.jsx(ot,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v});case"Money":return n.jsx(at,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v});case"Modal":return n.jsx(it,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i||"",placeholder:a,className:v,options:_,module:x||""})}}function tn({value:e,onValue:t,name:r,placeholder:i="",title:a="",error:o="",hide:l=!1,edit:d=!0,active:c=!0,after:u="",show:f=!0,view:p,onBlur:m,onSave:x,className:g=""}){let v=!!(l&&(e===""||e===void 0));if(!(d&&c)&&!f||!(d&&c)&&v)return"";let _=$=>{t&&t({value:$.target.innerText,name:r})},y=$=>{x&&x({value:$.target.innerText,name:r})},k=$=>{$.preventDefault(),navigator.clipboard.readText().then(M=>{window.document.execCommand("insertText",!1,M)}).catch(M=>{})};const T={};return i&&(T.placeholder=i),n.jsxs("dl",{children:[a??n.jsx("dt",{children:a}),n.jsx("dd",{onPaste:k,onBlur:y,onInput:_,contentEditable:d&&c?"plaintext-only":"false",...T,suppressContentEditableWarning:!0,children:e}),o??n.jsx("em",{children:o})]})}function nn({value:e,onValue:t,name:r,placeholder:i="",title:a="",error:o="",hide:l=!1,edit:d=!0,active:c=!0,after:u="",show:f=!0,view:p,onBlur:m,onSave:x,className:g=""}){let v=!!(l&&(e===""||e===void 0));if(pe.Date(e===void 0?new Date:e,"HH:MM"),b.useRef(null),!(d&&c)&&!f||!(d&&c)&&v)return"";const _="__:__",y=new Set("_"),k=(C=>Array.from(_,(R,Q)=>y.has(R)?C=Q+1:C))(0),T=[..._].findIndex(C=>y.has(C)),$=new RegExp("\\d","g"),M=C=>(C=C.match($)||[],Array.from(_,R=>(C[0]===R||y.has(R))&&C.shift()||R)),q=C=>{const[R,Q]=[C.target.selectionStart,C.target.selectionEnd].map(F=>(F=M(C.target.value.slice(0,F)).findIndex(X=>y.has(X)),F<0?k[k.length-1]:L?k[F-1]||T:F));C.target.value=M(C.target.value).join(""),C.target.setSelectionRange(R,Q),t==null||t({name:r,value:C.target.value})},U={};U.field="input",g&&(U.className=g);const re={};i&&(re.placeholder=i);let L=!1;return n.jsx(n.Fragment,{children:n.jsxs("dl",{...U,children:[a?n.jsx("dt",{children:a}):"",n.jsx("dd",{...re,children:n.jsx("input",{type:"tel",placeholder:i,onChange:q,inputMode:"numeric",onKeyDown:C=>L=C.key==="Backspace",onFocus:q,onBlur:C=>C.target.value===_&&(C.target.value="")})}),o?n.jsx("em",{children:o}):""]})})}function rn({onValue:e,label:t,value:r,className:i,name:a,reload:o}){r=!!r;const[l,d]=b.useState(r),c=()=>{let p=!l;e({name:a,value:p,reload:o}),d(p)},u={};u.field="check",i&&(u.className=i);const f={};return l&&(f.active=""),n.jsxs("dl",{...u,children:[t?n.jsx("dt",{children:t}):"",n.jsx("dd",{...f,onClick:c})]})}const an=({onValue:e,value:t,name:r,item:i})=>{const[a,o]=b.useState(!!t);b.useEffect(()=>{o(!!t)},[t]);let l=()=>{let d=parseInt(a)===0?1:0;o(d),e({value:d,name:r,key:i,item:i})};return n.jsx("div",{role:"switch",onClick:l,"aria-checked":`${a?"true":"false"}`})};function on({value:e,onValue:t,name:r,placeholder:i="",title:a="",error:o="",hide:l=!1,edit:d=!0,active:c=!0,after:u="",show:f=!0,view:p,onBlur:m,onSave:x,className:g=""}){const[v,_]=b.useState(e!==void 0?e.split(","):[]);b.useEffect(()=>{e!==void 0&&_(e!==void 0?e.split(","):[])},[e]);let y=()=>{_([...v,""])},k=L=>{v.splice(L,1),v.length===0&&v.push(""),_([...v]),m!==void 0&&m({value:v.join(","),name:r})},T=!!(l&&(e===""||e===void 0)),$=L=>{};if(!(d&&c)&&!f||!(d&&c)&&T)return"";const M={};M.field="group",g&&(M.className=g);const q=L=>{_e.Blur(L),x&&x({value:L.target.textContent,name:r})};let U=(L,C)=>{v[C]=L.target.textContent,t!==void 0&&t({value:v.join(","),name:r})},re=L=>{L.key==="Enter"&&L.preventDefault()};return n.jsxs("dl",{...M,children:[n.jsxs("dt",{children:[a,n.jsx("i",{onClick:y,children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",children:[n.jsx("path",{d:"M12 5.25v13.5"}),n.jsx("path",{d:"M18.75 12H5.25"})]})})]}),n.jsx("dd",{children:v.map((L,C)=>n.jsxs("li",{className:"field_group_item",children:[n.jsx("span",{onInput:R=>U(R,C),edit:"true",name:r,placeholder:i,onPaste:$,contentEditable:!0,onKeyDown:re,onBlur:q,suppressContentEditableWarning:!0,children:v[C]}),n.jsx("i",{onClick:()=>{k(C)},children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",children:[n.jsx("path",{d:"M17.25 17.25 6.75 6.75"}),n.jsx("path",{d:"m17.25 6.75-10.5 10.5"})]})})]},C))}),o?n.jsx("em",{children:o}):""]})}const Fi=e=>(e=e!==void 0&&e!==""?e.split(","):[],e.reduce((t,r)=>(t[r]=!0,t),{}));function sn({value:e,onValue:t,name:r,placeholder:i="",title:a,error:o,hide:l=!1,edit:d=!0,show:c=!0,active:u=!0,after:f="",view:p,modal:m,module:x,options:g,className:v}){const[_,y]=b.useState(Fi(e)),k=M=>{if(!(d&&u)||!m)return;let q=m.split(".");rt.Open(q[1],{callback:U=>{t&&t({value:U,name:r}),y(U)},onValue:t,options:g,name:r,value:_})},T={};T.field="group",v&&(T.className=v);const $={};return i&&($.placeholder=i),l?n.jsx(n.Fragment,{}):n.jsxs("dl",{...T,children:[n.jsxs("dt",{children:[a,n.jsx("i",{onClick:k,children:n.jsxs("svg",{width:"20",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M12 5.25v13.5"}),n.jsx("path",{d:"M18.75 12H5.25"})]})})]}),n.jsx("dd",{...$,onClick:open,edit:(d&&u)+"","data-after":f,children:Object.keys(_).map(M=>{var q;return n.jsx("div",{className:"field_group_item",children:(q=g[M])==null?void 0:q.label},M)})}),o&&n.jsx("em",{children:o})]})}const ln={Color:Gt,Date:nt,Code:Ht,Check:rn,Switch:Wt,Button:Zt,Message:Ut,Generator:Yt,Captcha:Kt,Modal:it,Money:at,Month:Xt,Notes:Jt,Number:ot,Password:Qt,Phone:st,Search:en,Select:lt,Set:ut,Textarea:tn,Time:nn,Users:ct,String:dt,Toogle:an,Group:on,Options:sn},be={debug:"_debug_ug20b_34",b:"_b_ug20b_46",o:"_o_ug20b_50",mb:"_mb_ug20b_55",tm:"_tm_ug20b_66",ta:"_ta_ug20b_133","--body":"_--body_ug20b_143"},S=window.Telegram.WebApp,le={is:!1,MainButton:{},BackButton:{}};let ve={};ve.dark={"--tg-theme-bg-color":"#212121","--tg-theme-text-color":"#ffffff","--tg-theme-hint-color":"#aaaaaa","--tg-theme-link-color":"#8774e1","--tg-theme-button-color":"#8774e1","--tg-theme-button-text-color":"#ffffff","--tg-theme-secondary-bg-color":"#0f0f0f","--tg-theme-header-bg-color":"#212121","--tg-theme-accent-text-color":"#8774e1","--tg-theme-section-bg-color":"#212121","--tg-theme-section-header-text-color":"#aaaaaa","--tg-theme-subtitle-text-color":"#aaaaaa","--tg-theme-destructive-text-color":"#e53935"},ve.light={"--tg-theme-bg-color":"#ffffff","--tg-theme-text-color":"#000000","--tg-theme-hint-color":"#999999","--tg-theme-link-color":"#2481cc","--tg-theme-button-color":"#2481cc","--tg-theme-button-text-color":"#ffffff","--tg-theme-secondary-bg-color":"#efeff3"},ve.users={"--tg-theme-bg-color":"#000000","--tg-theme-text-color":"#ffffff","--tg-theme-hint-color":"#98989e","--tg-theme-link-color":"#ffffff","--tg-theme-button-color":"#ffffff","--tg-theme-button-text-color":"#000000","--tg-theme-secondary-bg-color":"#000000"},S.getUser=()=>{var e;return((e=S.initDataUnsafe)==null?void 0:e.user)===void 0?{}:S.initDataUnsafe},S.MainButton.callback=[],S.MainButton.set=e=>{le.is?le.MainButton.set(e):(S.MainButton.callback.forEach(t=>{S.MainButton.offClick(t)}),S.MainButton.callback=[],typeof e=="boolean"?S.MainButton.isVisible=!1:(S.MainButton.text=e.text,e.color&&(S.MainButton.color=e.color),e.textColor&&(S.MainButton.textColor=e.textColor),S.MainButton.isVisible=!0,S.MainButton.isActive=e.isActive===void 0?!0:e.isActive,S.MainButton.callback.push(()=>{var t;e.page===void 0?(t=e.callback)==null||t.call(e):se.setPage(e.page)}),S.MainButton.onClick(S.MainButton.callback[0])))},S.BackButton.state=[!1],S.BackButton.listen=[],S.BackButton.router=e=>{e===!1?(S.BackButton.isVisible=!1,S.BackButton.offClick(S.BackButton.listen[0]),S.BackButton.listen.shift(),S.BackButton.state.length!==1&&S.BackButton.state.pop()):(S.BackButton.isVisible=!0,S.BackButton.offClick(S.BackButton.listen[0]),S.BackButton.listen.shift(),S.BackButton.listen.push(()=>{let t=S.BackButton.state.pop();if(t.page!==void 0)se.setPage(t.page);else{let r=S.BackButton.state[S.BackButton.state.length-1];S.BackButton.router(r)}}),S.BackButton.onClick(S.BackButton.listen[0]))},S.BackButton.set=e=>{le.is?le.BackButton.set(e):(S.BackButton.state.push(e),S.BackButton.router(e))},S.Notice=(e,t)=>{t!==void 0?(Ae.Send({type:e,text:t}),le.is||S.HapticFeedback.notificationOccurred(e)):(Ae.Send(e),le.is||S.HapticFeedback.notificationOccurred(e.type))},S.Init=({dev:e})=>{if(e){let[t,r]=b.useState(!1),[i,a]=b.useState(!1),[o,l]=b.useState("dark"),[d,c]=b.useState(!1),[u,f]=b.useState(!1);le.is=!0,le.MainButton.set=r,le.BackButton.set=a,b.useEffect(()=>{for(let x in ve[o])document.documentElement.style.setProperty(x,ve[o][x])},[]);let p=x=>{for(let g in ve[x])document.documentElement.style.setProperty(g,ve[x][g]);l(x),c(!1)},m=()=>{c(!1),f(!0)};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:be.debug,children:[i===!1?n.jsx("div",{className:be.b,children:"Отмена"}):n.jsx("div",{onClick:()=>{i.page===void 0||se.setPage(i.page)},className:be.b,children:"Назад"}),n.jsx("div",{className:be.o,onClick:()=>c(!d),children:"Меню"})]}),t&&n.jsx("div",{className:be.mb,children:n.jsx("button",{onClick:()=>{t.page&&se.setPage(t.page),t.callback&&t.callback()},children:t.text})}),d?n.jsxs("div",{className:be.tm,children:[n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("button",{onClick:m,children:"Authorization"})}),n.jsx("li",{children:n.jsx("button",{onClick:()=>se.setPage("Add"),children:"Add Page"})})]}),n.jsxs("ul",{children:[n.jsxs("li",{children:[n.jsx("button",{children:"Thema"}),n.jsxs("ol",{children:[n.jsx("li",{children:n.jsx("button",{onClick:()=>p("dark"),children:"Dark"})}),n.jsx("li",{children:n.jsx("button",{onClick:()=>p("light"),children:"Light"})}),n.jsx("li",{children:n.jsx("button",{onClick:()=>p("users"),children:"Users"})})]})]}),n.jsx("li",{children:n.jsx("button",{onClick:()=>c(!d),children:"Closed"})})]})]}):"",u?n.jsx(Pi,{setAuthorization:f}):""]})}else return n.jsx(n.Fragment,{})};const Pi=({setAuthorization:e})=>{let t={},r=a=>{t=a.value},i=a=>{localStorage.setItem("auth",t)};return n.jsx("div",{className:be.ta,children:n.jsxs("div",{className:"--body",children:[n.jsx("fieldset",{children:n.jsx(ln.Notes,{label:"Data JSON",name:"description",onValue:r,placeholder:""})}),n.jsx("div",{onClick:i,children:" Сщхранить "})]})})},Ri=({children:e,config:t})=>(window.location.pathname==="/clear"&&(window.history.pushState({},"","/"),V()),N.New(t.crypto),t.defaultModule&&Wn(t.defaultModule),Un(n.jsxs(n.Fragment,{children:[n.jsx(S.Init,{dev:t.dev}),n.jsx(ei,{config:t.modal}),n.jsx(Ur,{}),n.jsx(Xr,{}),n.jsx(pi,{}),e]}))),dn=({list:e,onClick:t,active:r,size:i,view:a})=>n.jsx("nav",{children:n.jsx("ul",{className:[i,a].join(" "),children:e.map(o=>n.jsx(Oi,{onClick:t,active:r,label:o.label,link:o.link},o.link))})}),Oi=({onClick:e,label:t,link:r,active:i})=>n.jsx("li",{"tabs-active":String(i===r),onClick:()=>e(r),children:t});dn.defaultProps={size:"M",view:"H"};const Li=({title:e="",button:t,description:r="",children:i})=>n.jsxs("fieldset",{children:[e&&n.jsxs("legend",{children:[e,t&&n.jsx("div",{role:"button-outline",onClick:()=>t.onClick(),children:t.label})," "]}),n.jsx("ul",{children:i}),r&&n.jsx("article",{children:r})]}),Ai={setting:"_setting_dva4m_2"},qi=({children:e})=>n.jsx("div",{className:Ai.setting,children:e}),Wi=({label:e,children:t})=>{let[r,i]=b.useState(!1);return n.jsxs("li",{"data-item":"accordion",children:[n.jsxs("dl",{onClick:()=>i(!r),children:[n.jsx("dt",{children:e}),n.jsx("dd",{children:n.jsx("div",{"data-close":String(r)})})]}),r&&n.jsx("div",{children:t})]})},Zi=({label:e,onClick:t,button:r})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{role:"button",onClick:()=>t(),children:r})]})}),cn={Switch:({active:e,onClick:t})=>(e=typeof e=="number"?!!e:e,n.jsx("div",{role:"switch",onClick:()=>{t()},"aria-checked":e?"true":"false"}))},Ui={Accordion:Wi,Button:Zi,Switch:({label:e,onClick:t,active:r})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{children:n.jsx(cn.Switch,{onClick:t,active:r})})]})}),Info:({label:e,info:t})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{role:"info",children:t})]})}),Select:({label:e,active:t,options:r})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{role:"info",children:t})]})}),Component:({label:e,children:t})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{children:t})]})}),Node:({label:e,children:t})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{children:t})]})})};function un({list:e,onClick:t,active:r,size:i,view:a}){return n.jsx("nav",{children:n.jsx("ul",{className:[i,a].join(" "),children:e.map(o=>n.jsx(Yi,{onClick:t,active:r,label:o.label,link:o.link},o.link))})})}const Yi=({onClick:e,label:t,link:r,active:i})=>n.jsx("li",{"tabs-active":String(i===r),onClick:()=>e(r),children:t});un.defaultProps={size:"M",view:"H"};const Ki={Section:Li,Main:qi,Item:Ui,Tabs:un};function fn({text:e,type:t,button:r}){let[i,a]=b.useState(!1),o={active:t};const l=()=>{if(r){if(r.onClick)return r.onClick({});if(r.onSend)return i?void 0:(a(!0),r.onSend(a))}};return n.jsxs("div",{className:et.al,...o,children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",fillRule:"evenodd",clipRule:"evenodd",children:n.jsx("path",{fill:"#fff",d:"M10.362 2.015C11.4264 1.66167 12.5736 1.66167 13.638 2.015C14.6981 2.36687 15.5304 3.20141 16.3665 4.37395C17.1999 5.5426 18.1208 7.17206 19.3078 9.2725L19.3544 9.35496C20.5417 11.4557 21.4625 13.0851 22.0364 14.4065C22.613 15.7343 22.9002 16.8807 22.6711 17.9821C22.4403 19.0911 21.8714 20.0995 21.0428 20.8617C20.2162 21.622 19.0907 21.9428 17.6736 22.0968C16.2645 22.25 14.4212 22.25 12.0488 22.25H11.9513C9.57882 22.25 7.73554 22.25 6.32642 22.0968C4.90927 21.9428 3.78379 21.622 2.95722 20.8617C2.12862 20.0995 1.55968 19.0911 1.32895 17.9821C1.0998 16.8807 1.387 15.7343 1.96365 14.4065C2.53752 13.0851 3.45835 11.4557 4.64558 9.35495L4.69218 9.2725L4.69218 9.27249C5.87921 7.17206 6.80008 5.5426 7.63347 4.37395C8.46963 3.20141 9.30194 2.36687 10.362 2.015ZM11 17C11 16.4477 11.4457 16 11.9955 16H12.0045C12.5543 16 13 16.4477 13 17C13 17.5523 12.5543 18 12.0045 18H11.9955C11.4457 18 11 17.5523 11 17ZM11 13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V9C13 8.44772 12.5523 8 12 8C11.4477 8 11 8.44772 11 9V13Z"})}),n.jsx("span",{children:e}),r&&n.jsx("button",{onClick:l,children:r.label})]})}const H={h:"_h_1usnu_1",g:"_g_1usnu_11",hr:"_hr_1usnu_16",hl:"_hl_1usnu_28",t:"_t_1usnu_40",s:"_s_1usnu_60",u:"_u_1usnu_69",o:"_o_1usnu_76",l:"_l_1usnu_105",hh:"_hh_1usnu_115",c:"_c_1usnu_128",loadingB:"_loadingB_1usnu_1",m:"_m_1usnu_180",ul:"_ul_1usnu_196",f:"_f_1usnu_226"},pn=({title:e,left:t,right:r,children:i})=>n.jsxs("div",{className:H.h,children:[n.jsx("div",{className:H.t,children:e}),t&&n.jsx("div",{className:H.hl,children:t}),r&&n.jsx("div",{className:H.hr,children:r}),i]}),xn=({children:e,...t})=>n.jsx("div",{className:H.l,children:e}),hn=({children:e})=>n.jsx("div",{className:H.s,children:e}),gn=({children:e,edit:t})=>{const r={};return t&&(r.edit=""),n.jsx("div",{...r,className:H.f,children:e})};function mn({children:e}){return n.jsx("div",{className:H.g,children:e})}const Hi={Header:pn,Section:hn,Group:mn,Form:gn,List:xn,A:fn,U:({children:e})=>n.jsx("div",{className:H.u,children:e}),G:mn,C:({children:e})=>n.jsx("div",{className:H.c,children:e}),L:xn,O:({children:e,className:t,title:r})=>n.jsxs("div",{className:[H.o,t].join(" "),children:[r&&n.jsx("div",{className:H.hh,children:r}),e]}),S:hn,H:pn,M:({children:e})=>n.jsx("div",{className:H.m,children:e}),F:gn},Gi={Send:Qr,Line:fn};function Vi(){return n.jsx("svg",{viewBox:"0 0 462.86 359.96",children:n.jsx("path",{d:"M210.5,307.78c-27,35.41-58.14,58-120.55,50.84-1-.12-1.58-.39-1.58-2V327.87c0-1.32.51-2.12,1.85-2,100.39-1,88.17-63.46,74.8-90.94-47.3-97.28-14.46-166.27,20.26-205.14,14.1-16.37,50.53-42,128.07-23.24,9.1,2,30.51,7.8,24.46,11.38C317.5,30,297.66,68.33,295,73.12c-3.62,6.59-6.26,13.17-4.57,14.13,2.37,1.35,3.5-1.56,6.58-7.91C319.78,34.41,366-22.76,402.78,37.68a1.14,1.14,0,0,1,.09.26c9.3,56.05,30.57,228.62-97.76,224.22-23.38-2-28.82-22-32.57-18.89-3.36,3,10,21.4,32.76,23.19C448.18,270.75,411.55,66.74,407.79,41.91a1.41,1.41,0,0,1,0-.3c2-7.32,129.15,17.47,112.77,158.08,4.82,6.57,10.89,10,18.7,16.08l.13.07c8.9,3.67,10.46,12.06,11.43,18.88a63.15,63.15,0,0,1-.14,15.49c-10.48-4.62-22.74-10.11-22.26-22.53.43-12,7.35-5.21-8.8-14.22a.69.69,0,0,0-1,.57c-.33,3.87-2.7,14.69-3,16.59v0c-4.64,17-16.59,86-18.41,99.58-.77,5.7-4.94,10.41-11.4,10.39l-56.71.18c-7.73.22-9.57-7.9-10.27-11.89-2.7-15.31-4.08-29.7-4.18-29.67-20.24,9.26-108.69,3.08-108.69,3.27V330c-.29,7.56-4.51,15.26-11.74,15.32l-52.87,1c-10.36.1-13.85-1.67-15.5-11.87-2.08-13.08-1-34.26-5.32-37.43-2,1.84-8.33,8.11-10,10.83M196.16,203q9.57,0,11.42-7.72c2.18-9.07-5.66-17.7-14.77-15.68-4.95,1.11-7.53,4.94-7.53,11.53C185.28,199,188.94,203,196.16,203Z",transform:"translate(-88.37 0)"})})}const Xi={};function Ji(e){Xi.add(e)}function Qi({color:e,size:t,name:r}){return n.jsx("svg",{width:t,height:t,color:e,children:n.jsx("use",{href:`#${r}`})})}const ea={Logo:Vi,Sprite:Ji,Symbol:Qi};function ta(){return n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M5.15837 11.491C5.08489 12.887 5.16936 14.373 3.92213 15.3084C3.34164 15.7438 3 16.427 3 17.1527C3 18.1508 3.7818 19 4.8 19H19.2C20.2182 19 21 18.1508 21 17.1527C21 16.427 20.6584 15.7438 20.0779 15.3084C18.8306 14.373 18.9151 12.887 18.8416 11.491C18.6501 7.85223 15.6438 5 12 5C8.35617 5 5.34988 7.85222 5.15837 11.491Z",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),n.jsx("path",{d:"M10.5 3.125C10.5 3.95343 11.1716 5 12 5C12.8284 5 13.5 3.95343 13.5 3.125C13.5 2.29657 12.8284 2 12 2C11.1716 2 10.5 2.29657 10.5 3.125Z",stroke:"currentColor",strokeWidth:"1",fill:"none"}),n.jsx("path",{d:"M15 19C15 20.6569 13.6569 22 12 22C10.3431 22 9 20.6569 9 19",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})}function na(){return n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M4.4094 11.4516C4.62188 7.41446 7.95728 4.25 12 4.25C16.0427 4.25 19.3781 7.41446 19.5906 11.4516C19.5997 11.6241 19.6064 11.7893 19.6129 11.9485C19.6351 12.49 19.6544 12.9615 19.7525 13.4133C19.8698 13.9531 20.0867 14.3775 20.5279 14.7084C21.2972 15.2854 21.75 16.191 21.75 17.1527C21.75 18.534 20.6628 19.75 19.2 19.75H4.8C3.33719 19.75 2.25 18.534 2.25 17.1527C2.25 16.191 2.70278 15.2854 3.47213 14.7084C3.91329 14.3775 4.13025 13.9531 4.24749 13.4133C4.34561 12.9615 4.3649 12.49 4.38705 11.9485V11.9485L4.38705 11.9485C4.39356 11.7893 4.40032 11.6241 4.4094 11.4516Z",fill:"#141B34"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5286 1.37434C10.9737 1.08296 11.517 1 12 1C12.483 1 13.0263 1.08296 13.4714 1.37434C13.9652 1.69759 14.25 2.22083 14.25 2.875C14.25 3.47116 14.017 4.09375 13.6626 4.57057C13.3138 5.03989 12.7415 5.5 12 5.5C11.2585 5.5 10.6862 5.03989 10.3374 4.57057C9.98299 4.09375 9.75 3.47116 9.75 2.875C9.75 2.22083 10.0348 1.69759 10.5286 1.37434Z",fill:"#141B34"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 18C9.55228 18 10 18.4477 10 19C10 20.1046 10.8954 21 12 21C13.1046 21 14 20.1046 14 19C14 18.4477 14.4477 18 15 18C15.5523 18 16 18.4477 16 19C16 21.2091 14.2091 23 12 23C9.79086 23 8 21.2091 8 19C8 18.4477 8.44772 18 9 18Z",fill:"#141B34"})]})}function ra(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:n.jsx("path",{d:"M8.85746 12.5061C6.36901 10.6456 4.59564 8.59915 3.62734 7.44867C3.3276 7.09253 3.22938 6.8319 3.17033 6.3728C2.96811 4.8008 2.86701 4.0148 3.32795 3.5074C3.7889 3 4.60404 3 6.23433 3H17.7657C19.396 3 20.2111 3 20.672 3.5074C21.133 4.0148 21.0319 4.8008 20.8297 6.37281C20.7706 6.83191 20.6724 7.09254 20.3726 7.44867C19.403 8.60062 17.6261 10.6507 15.1326 12.5135C14.907 12.6821 14.7583 12.9567 14.7307 13.2614C14.4837 15.992 14.2559 17.4876 14.1141 18.2442C13.8853 19.4657 12.1532 20.2006 11.226 20.8563C10.6741 21.2466 10.0043 20.782 9.93278 20.1778C9.79643 19.0261 9.53961 16.6864 9.25927 13.2614C9.23409 12.9539 9.08486 12.6761 8.85746 12.5061Z",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})})}const ia={n:"_n_euuvm_1"};let Ne={},De=[];const aa=(e,t)=>{switch(t.type){case"open":return{...e,open:t.open};case"view":return{...e,view:e.view===t.view?null:t.view};case"add":return{...e,news:[...e.news,t.data],active:!0};case"news":return{...e,news:t.data,active:t.data.length!==0};case"hide":let r=e.news.filter(a=>a.id!==t.id);return{...e,news:r,active:r.length!==0};case"size":return{...e,size:t.size};case"take":let i={[t.list]:t.take};i={...e.take,...i},e.active=!1;for(let a in i)i[a]!=="999"&&(e.active=!0);return Ne.get(i,e.active),{...e,take:i,active:e.active};case"exit":return e;default:throw new Error}};function oa(e){Ne.fn({action:"add",data:e})}function sa(e){Ne.fn({action:"add",data:e})}function la(e){Ne.fn({action:"new",data:e})}function da(e){Ne.fn=e}function ca(){const[e,t]=b.useReducer(aa,{open:!1,active:!1,news:[],take:{}});We.useListener("bell",async i=>{}),da(async i=>{switch(i.action){case"add":De.push(i.data);break}}),b.useEffect(()=>{(async()=>{let i=await We.Send({type:"module",module:"M00",query:"x0054",array:["M01","M02"]});for(let a in i)switch(a){case"news":t({type:"news",data:i.news});break;case"M01":i[a].forEach(o=>{De.push({module:"M01",type:1,id:o.id,datetime:new Date(o.tDate).getTime(),txt:o.p01})});break;case"M02":i[a].forEach(o=>{De.push({module:"M02",type:117,id:o.id,datetime:new Date(o.tDate).getTime(),txt:o.p01})});break}})(),setInterval(()=>{De.forEach((i,a)=>{t({type:"add",data:{module:i.module,type:i.type,id:i.id,datetime:i.datetime,txt:i.title}}),i.datetime<new Date().getTime()&&De.splice(a,1)})},6e4)},[]);let r=async i=>{t({type:"hide",id:i.id})};return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:ia.n,onClick:()=>{t({type:"open",open:!0})},children:e.active?n.jsx(na,{}):n.jsx(ta,{})}),e.open?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"notify-o",onClick:()=>{t({type:"open",open:!1})}}),n.jsxs("div",{className:"notify-m",children:[n.jsx("div",{className:"notify-l",children:e.news.map((i,a)=>n.jsx(ua,{data:i,dispatch:t},a))}),n.jsx("div",{className:"notify-b",onClick:r,children:"История"})]})]}):""]})}const ua=({data:e,dispatch:t})=>{let r=async i=>{t({type:"hide",id:i.id}),await We.Send({type:"module",module:"M00",query:"x0055",data:{id:i.id,type:i.type,db:i.db}})};return n.jsxs("div",{className:"notify-i",children:[n.jsx("div",{className:"--icon","data-icon":e.type}),n.jsxs("div",{className:"--body",children:[n.jsx("div",{className:"--name",children:e.type}),n.jsx("div",{className:"--text",children:e.txt})]}),n.jsx("div",{className:"--hide","data-icon":"F038",onClick:()=>r(e),children:" "})]})},fa="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2xldCBhPVtdLHM9bnVsbDtvbmNvbm5lY3Q9ZnVuY3Rpb24obCl7dmFyIHQ9bC5zb3VyY2U7YS5wdXNoKHQpO2NvbnN0IG49ZT0+e3MhPT1udWxsJiZzLnJlYWR5U3RhdGU9PT0xP3Muc2VuZChKU09OLnN0cmluZ2lmeShlKSk6dC5wb3N0TWVzc2FnZSh7dHlwZToibm9TZW5kIn0pfTtsZXQgcj1lPT57aWYocyE9PW51bGwmJnMucmVhZHlTdGF0ZT09PTEpcmV0dXJuIHQucG9zdE1lc3NhZ2Uoe3R5cGU6InRydWUifSk7ZS5say5hZGRyZXNzPT09ImxvY2FsaG9zdCI/cz1uZXcgV2ViU29ja2V0KGB3czovL2xvY2FsaG9zdDoke2UubGsuc29ja2V0KzF9YCk6cz1uZXcgV2ViU29ja2V0KCJ3c3M6Ly8iK2UubGsuYWRkcmVzcysiOiIrKGUubGsuc29ja2V0KzEpKSxzLm9uZXJyb3I9KCk9PnQucG9zdE1lc3NhZ2Uoe3R5cGU6ImVycm9yIn0pLHMub25vcGVuPSgpPT57bih7dHlwZToiY29ubmVjdCIsdWtleTplLnVrZXl9KX0scy5vbm1lc3NhZ2U9bz0+e2xldCBjPUpTT04ucGFyc2Uoby5kYXRhKTthLmZvckVhY2goZD0+e2QucG9zdE1lc3NhZ2UoYyl9KX0scy5vbmNsb3NlPSgpPT50LnBvc3RNZXNzYWdlKHt0eXBlOiJjbG9zZWQifSl9O3Qub25tZXNzYWdlPWZ1bmN0aW9uKGUpe3N3aXRjaChlLmRhdGEudHlwZSl7Y2FzZSJsZW5ndGgiOnJldHVybiB0LnBvc3RNZXNzYWdlKGEubGVuZ3RoKTtjYXNlImFsbCI6cmV0dXJuIGEuZm9yRWFjaChvPT5vLnBvc3RNZXNzYWdlKHthbGw6YS5sZW5ndGh9KSk7Y2FzZSJzZW5kIjpyZXR1cm4gbihlLmRhdGEuanNvbik7Y2FzZSJjb25uZWN0IjpyZXR1cm4gcihlLmRhdGEpO2RlZmF1bHQ6dC5wb3N0TWVzc2FnZSh7dHlwZToiZGVmYXVsdCIsZGF0YTplLmRhdGEuanNvbn0pfX19fSkoKTsK";function pa(e){return new SharedWorker("data:text/javascript;base64,"+fa,{name:e==null?void 0:e.name})}function xa(e){let t={},r={};e.data.forEach(a=>{t[a.id]={s:a.v,n:a.a},r[a.id]=a});let i={...he(),901:t};$t(r),Ee(i)}let ne={},Y={},qe=["filter","online","users","company","select","setting","info","job"];function ha(){const[e,t]=b.useState(!1),[r,i]=b.useState(!1);function a(o){const l=new pa;ne.laodData=d=>{let c=qe.indexOf(d);c>=0&&qe.splice(c,1),qe.length===0&&t(!0)},ne.send=d=>{l.port.postMessage({type:"send",json:d})},l.port.onmessage=d=>{let c=d.data;c.type==="error"&&i(!0),c.type==="true"&&t(!0),c.type==="closed"&&l.port.postMessage({type:"connect",ukey:o,lk:Xe()}),qe.length!==0&&ne.laodData(c.type),Y[c.type]&&Y[c.type](c)},l.port.postMessage({type:"connect",ukey:o,lk:Xe()})}return[a,e,r]}Y.module=e=>{ne[e.listen]!==void 0&&(ne[e.listen](e),delete ne[e.listen])},Y.bell=la,Y.company=xa,Y.info=e=>{let t={};t.db=e.db,t.id=e.data.id,t.job=e.data.job,t.login=e.data.login,t.name=e.data.p02,t.patronymic=e.data.p03,t.surname=e.data.p01,t.email=e.data.email,t.admin=e.data.menu.includes("99"),Nt(t),Tt(e.data.menu)},Y.version=async e=>{Re.version.Server(e.data)},Y.online=async e=>{},Y.offline=async e=>{},Y.chat=e=>{switch(e.data.action){case"new_message":se.getModule();break;case"view_message":se.getModule();break;case"write_message":se.getModule();break}},Y.users=e=>{let t={};e.data.forEach(i=>{let a=i.p01+" "+i.p02+" "+i.p03,o=i.p01+" "+i.p02.substring(0,1)+"."+i.p03.substring(0,1)+".",l=i.p01.substring(0,1)+""+i.p02.substring(0,1)+i.p03.substring(0,1);t[i.id]={id:i.id,admin:i.m.includes("99"),ava:JSON.parse(i.a),job:i.j,login:"",online:{time:i.o,status:0},sts:i.s,nameFull:a,name:o,number:l}});let r={...he(),user:t};Ee(r)},Y.api=e=>{let t={};e.data.forEach(r=>{t[r.api]={key:r.key,p01:r.p01,p02:r.p02}})},Y.delete=()=>{V()},Y.select=e=>{let t={...he()};e.data.forEach(r=>{t[r.n]=JSON.parse(r.s)}),Ee(t)},Y.job=e=>{let t={...he()},r={};Object.keys(e.data).forEach(i=>{r[i]={s:1,n:e.data[i]}}),t[1]=r,Ee(t)},Y.setting=e=>{fr(e.data)},Y.app=()=>{};const ga=(e,t)=>{ne[e]=t},ma=(e,t)=>{ne[e](t)};function _a(e){let t="_"+String(Math.random()).substring(2,7);return new Promise(r=>{ne[t]=i=>{i.error!==void 0?r({error:i.error}):r(i.data),delete ne[t]},e={...e,listen:t},e.type="modules",ne.send(e)})}const We={useConnect:ha,useListener:ga,setListener:ma,Send:_a};class ba{constructor(t="el",r="db"){jt(this,"storeName");jt(this,"_dbp");this.storeName=r,this._dbp=new Promise((i,a)=>{const o=indexedDB.open(t,1);o.onerror=()=>a(o.error),o.onsuccess=()=>i(o.result),o.onupgradeneeded=()=>{o.result.createObjectStore(r)}})}_withIDBStore(t,r){return this._dbp.then(i=>new Promise((a,o)=>{const l=i.transaction(this.storeName,t);l.oncomplete=()=>a(),l.onabort=l.onerror=()=>o(l.error),r(l.objectStore(this.storeName))}))}}let ft,O={};const je=()=>(ft||(ft=new ba),ft),xe=(e,t,r=je())=>r._withIDBStore("readwrite",i=>{O[e]=t,i.put(N.enCode(t),e)}),ae=(e,t=je())=>O[e]===void 0?new Promise((r,i)=>{let a;t._withIDBStore("readonly",o=>{a=o.get(e)}).then(()=>{if(a.result!==void 0){let o=N.deCode(a.result);O[e]=o,r(o)}else r({})})}):O[e],va=(e,t=je())=>t._withIDBStore("readwrite",r=>{r.delete(e)}),pt=(e=je())=>e._withIDBStore("readwrite",t=>{t.clear()}),ya={id:async(e,t,r)=>{let i=await ae(t);if(r!==void 0)r({type:"load",base:i});else return i[e]},get:ae,set:xe,add:async(e,t,r,i)=>{let a,o;o=await ae(r),o[e.id]=e,await xe(r,o),a!==null&&(a=await ae(t),a[e.id]=e.eDate,await xe(t,a)),i!==void 0&&i({type:"load",page:a,base:o})},del:va,upd:(e,t,r,i=je())=>{if(O[e]===void 0)return new Promise((a,o)=>{let l;i._withIDBStore("readonly",d=>{l=d.get(e)}).then(()=>{if(l.result!==void 0){let d=N.deCode(l.result);O[e]=d,O[e][t.id]={...O[e][t.id],...t.data},i.put(N.enCode(O[e]),e),a({})}else a({})})});if(O[e][t.id]!==void 0)return O[e][t.id]={...O[e][t.id],...t.data},r!==void 0&&O[r]!==void 0?O[r][t.id]!==void 0&&(O[r][t.id]=t.data.eDate):O[r]=[],delete O[e][t.id].$_item,delete O[e][t.id].$_send,i._withIDBStore("readwrite",a=>{a.put(N.enCode(O[e]),e),r!==void 0&&a.put(N.enCode(O[r]),r)})},key:(e=je())=>{const t=[];return e._withIDBStore("readonly",r=>{(r.openKeyCursor||r.openCursor).call(r).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)},load:e=>O[e],split:(e,t,r=[],i={})=>{let a=r.length!==0,o=[],l=i.sort,d=Object.keys(i).length!==0,c=Object.keys(i),u=Object.keys(e),f=[],p=x=>{let g="";if(r.forEach(v=>{g+=t[x][v]}),d){let v={};c.forEach(_=>{v[_]=t[x][_]});for(let _ in l)t[x][l[_]]===void 0&&(pt(),location.reload()),_==="s1"&&(v[_]=new Date(t[x][l[_]]).getTime()),_==="s2"&&(v[_]=t[x][l[_]]),_==="s3"&&(v[_]=t[x][l[_]].replace(/[^a-zа-яё]/gi,"").substring(0,1));o.push({id:x,text:g,...v})}else o.push({id:x,text:g})},m=x=>{};return u.forEach(x=>{f.push(t[x])}),f.forEach(x=>{x===void 0?(pt(),location.reload()):(a&&p(x.id),d&&m(x.id))}),{list:f,search:o,filter:i}},clear:pt,updAll:async(e,t,r,i)=>{let a=await ae(t),o=await ae(r);for(let l in e)o[l]=e[l],a[l]=e[l].eDate;await xe(t,a),await xe(r,o),i!==void 0&&i({type:"load",page:a,base:o})},delAll:async(e,t,r,i)=>{let a=await ae(t),o=await ae(r);e.forEach(l=>delete a[l]),await xe(t,a),i!==void 0&&i({type:"load",page:a,base:o})},delList:async(e,t,r)=>{let i=await ae(t);e.forEach(a=>delete i[a]),await xe(t,i)},addList:async(e,t,r)=>{let i=await ae(t);e.forEach(a=>i[a.id]=a.eDate),await xe(t,i)}},wa={setSetting:pr,getSetting:xr},ka={s:"_s_18bde_1",loadingB:"_loadingB_18bde_1",ul:"_ul_18bde_31"};function ja({children:e}){return n.jsx("ul",{className:H.ul,children:e})}function Ca(e,t){switch(t.type){case"load":return{...e,load:t.load,wait:!1,item:1,data:t.data,list:t.data[1],size:Object.keys(t.data).length};case"update":let r=Object.keys(e.data).length,i=e.item+1;return i=r<i?1:i,e.item===i?e:{...e,wait:e.size===i,item:i,list:[...e.list,...e.data[i]]};case"clear":return{load:!1,list:[],data:{},item:1,wait:!1,size:0};default:throw new Error}}function Sa({list:e,load:t,className:r,...i}){const a=b.useRef(null),[o,l]=b.useReducer(Ca,{load:!1,list:[],data:{},item:1,wait:!1,size:0});b.useEffect(()=>{a.current.scrollTop=0,e!==null&&l({type:"load",load:!0,data:e})},[t]);let d=()=>{a.current.scrollHeight-a.current.scrollTop-300<=a.current.clientHeight&&!o.wait&&l({type:"update"})};return n.jsx("div",{className:[ka.s,r].join(" "),ref:a,onScroll:d,children:n.jsx(ja,{"el-empty":"Данные не найдены",children:o.load&&o.list!==void 0?o.list.map(c=>n.jsx(i.item,{data:c},c.id)):n.jsxs("div",{"data-load":"load",children:[n.jsx("i",{}),n.jsx("i",{}),n.jsx("i",{})]})})})}const Ea=({label:e,onValue:t,value:r,name:i,item:a})=>{const[o,l]=b.useState(!!r);b.useEffect(()=>{l(!!r)},[r]);let d=()=>{let c=parseInt(o)===0?1:0;l(c),t({value:c,name:i,key:a,item:a})};return n.jsx("div",{role:"switch",onClick:d,"aria-checked":`${o?"true":"false"}`})},ye={};function Ba(e){const[t,r]=b.useState({}),i=b.useRef(e);ye.u=o=>{i.current={...i.current,[o.name]:o.value}},ye.r=()=>{r(Date.now())};const a=o=>{i.current[o.name]=o.value,o.reload&&ye.r()};return[i.current,a]}function Ta(e){ye.u(e),e.reload&&ye.r()}function Ia(){ye.r&&ye.r()}const $a={Color:Gt,Date:nt,Code:Ht,Check:rn,Switch:Wt,Button:Zt,Message:Ut,Generator:Yt,Captcha:Kt,Modal:it,Money:at,Month:Xt,Notes:Jt,Number:ot,Password:Qt,Phone:st,Search:en,Select:lt,Set:ut,Textarea:tn,Time:nn,Users:ct,String:dt,Form:ut,runReload:Ia,useData:Ba,setValue:Ta,Palette:Ea,Toogle:an,Group:on,Options:sn},_n={spinner:"_spinner_1ul0m_1",l:"_l_1ul0m_75",loadingB:"_loadingB_1ul0m_1"};function Na(){return n.jsx("div",{className:_n.spinner,children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 483 484",children:n.jsx("path",{d:"M264,492a22.2,22.2,0,0,0,22-22V411a22.2,22.2,0,0,0-22-22H236a22.2,22.2,0,0,0-22,22v59a22.2,22.2,0,0,0,22,22Zm74-134a23.9,23.9,0,0,0-6,16,20.35,20.35,0,0,0,6,15l42,42q7,7,16,7,10,0,16-7l20-20a20.35,20.35,0,0,0,6-15,23.9,23.9,0,0,0-6-16l-42-42q-7-7-16-7-8,0-15,7ZM163,389a18.94,18.94,0,0,0,7-15q0-9-7-16l-20-20q-7-7-16-7-8,0-15,7L70,380q-7,7-7,16a18.94,18.94,0,0,0,7,15l20,20q7,7,16,7a18.94,18.94,0,0,0,15-7ZM112,237a22.2,22.2,0,0,0-22-22H31a21.17,21.17,0,0,0-15.5,6.5A21.17,21.17,0,0,0,9,237v28a21.17,21.17,0,0,0,6.5,15.5A21.17,21.17,0,0,0,31,287H90a22.2,22.2,0,0,0,22-22Zm358,50a22.2,22.2,0,0,0,22-22V237a22.2,22.2,0,0,0-22-22H411a22.2,22.2,0,0,0-22,22v28a22.2,22.2,0,0,0,22,22ZM163,142q7-7,7-15.5T163,111L121,69q-7-7-15-7-7,0-16,7L70,89q-7,7-7,16a18.94,18.94,0,0,0,7,15l42,42a18.94,18.94,0,0,0,15,7q10,0,16-7Zm269-22a20.35,20.35,0,0,0,6-15,23.9,23.9,0,0,0-6-16L412,69q-7-7-16-7-7,0-16,7l-42,42q-7,8-7,16t7,15l21,20a18.94,18.94,0,0,0,15,7q10,0,16-7Zm-168-9a22.06,22.06,0,0,0,15.5-6q6.5-6,6.5-16V30a21.17,21.17,0,0,0-6.5-15.5A21.17,21.17,0,0,0,264,8H236a21.17,21.17,0,0,0-15.5,6.5A21.17,21.17,0,0,0,214,30V89q0,10,6.5,16a22.06,22.06,0,0,0,15.5,6Z",transform:"translate(-9 -8)"})})})}function Da(){return n.jsxs("div",{className:_n.l,children:[n.jsx("i",{}),n.jsx("i",{}),n.jsx("i",{})]})}const Ma={Spinner:Na,Inline:Da},bn={s:"_s_t9swc_1"};let xt;function za({className:e,placeholder:t}){let r=l=>{xt(l.target.textContent)},i=l=>{l.key==="Enter"&&l.preventDefault()},a=l=>{l.preventDefault(),navigator.clipboard.readText().then(d=>{window.document.execCommand("insertText",!1,d)}).catch(d=>{})};const o={};return t&&(o.placeholder=t),o.className=e?[bn.s,e].join(" "):bn.s,n.jsx("div",{onPaste:a,onInput:r,onKeyDown:i,contentEditable:"true",...o,suppressContentEditableWarning:!0})}function Fa(e,t,r){let i=[],a=1,o=0,l={},d=50;return l[a]=[],e.forEach(c=>{c.text.toLowerCase().indexOf(t)>-1&&i.push(c.id)}),i.forEach(c=>{o++,o<=d||(a++,o=1,l[a]=[]),l[a].push(r[c])}),l}function Pa(e){xt=e}function Ra(e){xt=e}const Oa={Field:za,Run:Fa,Get:Pa,useValue:Ra},La={f:"_f_q3r0i_1"};let J={};function Aa(e,t){switch(t.type){case"open":return{...e,open:t.open};case"view":return{...e,view:e.view===t.view?null:t.view};case"data":let r={};return Object.keys(t.data).forEach(a=>{a!=="sort"&&(r[a]=t.data[a],e.take[a]="999")}),{...e,data:r,take:e.take};case"size":return{...e,size:t.size};case"take":let i={[t.list]:t.take};i={...e.take,...i},e.active=!1;for(let a in i)i[a]!=="999"&&(e.active=!0);return J.get(i,e.active),{...e,take:i,active:e.active};case"exit":for(let a in e.take)e.take[a]="999";return J.get&&J.get([],!1),{...e,size:0,active:!1,take:e.take,open:!1};default:throw new Error}}function qa(){const[e,t]=b.useReducer(Aa,{open:!1,view:null,data:{},take:{},size:0,active:!1});return J.set=r=>{t({type:"data",data:r})},J.count=r=>{t({type:"size",size:r})},J.reset=()=>{t({type:"exit"})},n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:La.f,onClick:()=>{t({type:"open",open:!0})},children:[n.jsx(ra,{}),e.active&&n.jsxs("i",{children:[e.size,"1"]})]}),e.open?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"filter o",onClick:()=>{t({type:"open",open:!1})}}),n.jsxs("div",{className:"filter m",children:[n.jsx("div",{className:"filter l",children:Object.keys(e.data).map(r=>n.jsx(Ka,{data:r,dispatch:t,state:e},r))}),n.jsx("div",{className:"filter b",onClick:()=>{t({type:"exit"})},children:"Убрать фильтер"})]})]}):n.jsx(n.Fragment,{})]})}function Wa(e){J.get=e}function Za(e){J.set!==void 0&&J.set(e)}function Ua(e){J.reset!==void 0&&J.reset(e)}function Ya(e,t,r,i){let a=[],o=1,l=0,d={},c=50;return d[o]=[],i===!0&&(Object.keys(t).forEach(u=>{Number.parseInt(t[u])!==999&&(e=e.filter(f=>Number.parseInt(f[u])===Number.parseInt(t[u])))}),vn(e.length)),e.forEach(u=>{a.push(u.id)}),a.forEach(u=>{l++,l<=c||(o++,l=1,d[o]=[]),d[o].push(r[u])}),d}function vn(e){J.count(e)}function Ka({data:e,state:t,dispatch:r}){let i=()=>{r({type:"view",view:e})},a=()=>{r({type:"take",list:e,take:"999"})};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"filter s",children:[n.jsxs("div",{onClick:i,children:[" ",t.data[e].name," "]}),t.take[e]!=="999"?n.jsx("div",{onClick:a,className:"filter x","data-icon":"F038"}):""]}),n.jsx("div",{className:"filter u","set-active":(t.view===e)+"",children:Object.keys(t.data[e].list).map((o,l)=>n.jsx(Ha,{data:t.data[e].list[o],head:e,type:o,dispatch:r,state:t},l))})]})}function Ha({data:e,head:t,state:r,dispatch:i,type:a}){if(a!=="999"&&e.count===void 0)return"";const o=()=>{i({type:"take",list:t,take:a})};return n.jsxs("div",{className:"filter a",onClick:o,"set-active":(r.take[t]===a)+"",children:[e.name,n.jsx("div",{className:"filter e",children:e.count})]})}const Ga={Button:qa,useValue:Wa,Set:Za,Run:Ya,Count:vn,Reset:Ua},Va={Bell:ca,Send:sa,Add:oa};function Xa({active:e,onActive:t,id:r,name:i}){const[a,o]=b.useState(!!e);b.useEffect(()=>{o(!!e)},[e]);let l=()=>{let d=parseInt(a)===0?1:0;o(d),t&&t({value:d,name:i,id:r})};return n.jsx("div",{role:"switch",onClick:l,"aria-checked":`${a?"true":"false"}`})}const Ja={sort:"_sort_1yrvt_1"};let Ze={};function Qa(e,t){switch(t.type){case"active":let r="<";return e.active===t.data&&(r=e.sort==="<"?">":"<"),Ze.get({active:t.data,sort:r},!1),It({active:t.data,sort:r}),{...e,active:t.data,sort:r};default:throw new Error}}function eo(){const[e,t]=b.useReducer(Qa,Je()===void 0?{active:1,sort:"<"}:Je());return n.jsxs("div",{className:Ja.sort,children:[n.jsx("i",{"data-color":e.active===1?"_506290":"_b5b9cc","data-icon":e.active===1?e.sort==="<"?"F073":"F072":"F071",onClick:()=>t({type:"active",data:1})}),n.jsx("i",{"data-color":e.active===2?"_506290":"_b5b9cc","data-icon":e.active===2?e.sort==="<"?"F066":"F067":"F074",onClick:()=>t({type:"active",data:2})}),n.jsx("i",{"data-color":e.active===3?"_506290":"_b5b9cc","data-icon":e.active===3?e.sort==="<"?"F068":"F069":"F070",onClick:()=>t({type:"active",data:3})})]})}function to(e){Ze.get=e}function no(e){Ze.set(e)}function ro(e,t,r){let i=1,a=0,o={},l=50;o[i]=[];let d={},c="s1a";switch(d.s1a=(u,f)=>f.s1-u.s1,d.s1d=(u,f)=>u.s1-f.s1,d.s2a=(u,f)=>u.s2-f.s2,d.s2d=(u,f)=>f.s2-u.s2,d.s3a=(u,f)=>u.s3.localeCompare(f.s3),d.s3d=(u,f)=>f.s3.localeCompare(u.s3),r.active){case 1:c=r.sort===">"?"s1d":"s1a";break;case 2:c=r.sort===">"?"s2d":"s2a";break;case 3:c=r.sort===">"?"s3d":"s3a";break}return t.sort(d[c]).forEach(u=>{a++,a<=l||(i++,a=1,o[i]=[]),o[i].push(e[u.id])}),{data:o}}function io(e){Ze.count(e)}const ao={Init:eo,useValue:to,Set:no,Run:ro,Count:io};B.Action=cn,B.Alert=Gi,B.Api=qr,B.Button=qt,B.Component=Hi,B.DataBase=ya,B.Events=Le,B.Filter=Ga,B.Form=$a,B.Format=pe,B.Icon=ea,B.Init=Ri,B.Input=ln,B.Loading=Ma,B.Modal=rt,B.Notice=Ae,B.Notifications=Va,B.Router=se,B.Scrolling=Sa,B.Search=Oa,B.Setting=Ki,B.Sistym=Re,B.Socket=We,B.Store=oe,B.Switch=Xa,B.Tabs=dn,B.Telegram=S,B.Triage=ao,B.User=wa,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
31
+ <%s key={someKey} {...props} />`,kt,we,No,we),An[we+kt]=!0}}return s===i?Eo(W):So(W),W}}function Bo(s,h,w){return qn(s,h,w,!0)}function To(s,h,w){return qn(s,h,w,!1)}var Io=To,$o=Bo;Te.Fragment=i,Te.jsx=Io,Te.jsxs=$o}()),Te}process.env.NODE_ENV==="production"?Qe.exports=Wr():Qe.exports=Zr();var n=Qe.exports;const Lt={notice:"_notice_q5jau_1",error:"_error_q5jau_10",success:"_success_q5jau_13",warning:"_warning_q5jau_16",copy:"_copy_q5jau_19","show-notice":"_show-notice_q5jau_1","hide-notice":"_hide-notice_q5jau_1"};let ue={};function Ur(){let[e,t]=b.useState([]);return ue.set=r=>{t([...e,r])},ue.del=r=>{t(e.filter(i=>i.key!==r))},e.length===0?"":n.jsx("ul",{className:Lt.notice,children:e.map(r=>r.item)})}function Ie({data:e}){let[t,r]=b.useState("show");b.useEffect(()=>{setTimeout(function(){r("hide")},1800),setTimeout(function(){ue.del(e.key)},2500)},[e.key]);let i;switch(e.type){case"error":i=n.jsx(ge.error,{});break;case"success":i=n.jsx(ge.success,{});break;case"copy":i=n.jsx(ge.success,{});break;case"remark":i=n.jsx(ge.success,{});break;default:i=n.jsx(ge.success,{});break}return n.jsxs("li",{className:"item "+Lt[e.type],"data-status":t,children:[i,n.jsx("p",{children:e.text})]})}function Yr(e){let t=Date.now(),r={key:t,...e};ue.set({item:n.jsx(Ie,{data:r},t),key:t})}function Kr(e){let t=Date.now(),r={key:t,text:e,type:"error"};ue.set({item:n.jsx(Ie,{data:r},t),key:t})}function Hr(e){let t=Date.now(),r={key:t,text:e,type:"success"};ue.set({item:n.jsx(Ie,{data:r},t),key:t})}function Gr(e){let t=Date.now(),r={key:t,text:e,type:"remark"};ue.set({item:n.jsx(Ie,{data:r},t),key:t})}function Vr(e){let t=Date.now(),r={key:t,text:e,type:"copy"};ue.set({item:n.jsx(Ie,{data:r},t),key:t})}const ge={};ge.error=()=>n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22Z",fill:"#fff"}),n.jsx("path",{d:"M8.96967 8.96967C9.26256 8.67678 9.73744 8.67678 10.0303 8.96967L12 10.9394L13.9697 8.96969C14.2626 8.6768 14.7374 8.6768 15.0303 8.96969C15.3232 9.26258 15.3232 9.73746 15.0303 10.0303L13.0607 12L15.0303 13.9697C15.3232 14.2625 15.3232 14.7374 15.0303 15.0303C14.7374 15.3232 14.2625 15.3232 13.9696 15.0303L12 13.0607L10.0304 15.0303C9.73746 15.3232 9.26258 15.3232 8.96969 15.0303C8.6768 14.7374 8.6768 14.2626 8.96969 13.9697L10.9394 12L8.96967 10.0303C8.67678 9.73744 8.67678 9.26256 8.96967 8.96967Z",fill:"#bb2014"})]}),ge.success=()=>n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22Z",fill:"#fff"}),n.jsx("path",{d:"M16.0303 8.96967C16.3232 9.26256 16.3232 9.73744 16.0303 10.0303L11.0303 15.0303C10.7374 15.3232 10.2626 15.3232 9.96967 15.0303L7.96967 13.0303C7.67678 12.7374 7.67678 12.2626 7.96967 11.9697C8.26256 11.6768 8.73744 11.6768 9.03033 11.9697L10.5 13.4393L14.9697 8.96967C15.2626 8.67678 15.7374 8.67678 16.0303 8.96967Z",fill:"#367738"})]});const et={alerts:"_alerts_1pds5_1",menuAnimation:"_menuAnimation_1pds5_1",menuItemAnimation:"_menuItemAnimation_1pds5_1","--body":"_--body_1pds5_103",allert:"_allert_1pds5_111","--form":"_--form_1pds5_111",al:"_al_1pds5_1"};let $e={};function Xr(){let[e,t]=b.useState("");return $e.set=r=>t(r),$e.del=()=>t(""),n.jsx(n.Fragment,{children:e})}const Jr=({data:e,callback:t})=>(e.button=e.button===void 0?"Подтвердить":e.button,n.jsxs("div",{className:et.alerts,children:[n.jsxs("dl",{children:[n.jsx("dt",{children:e.title}),n.jsx("dd",{children:e.text}),n.jsx("ul",{children:n.jsx("button",{"data-color":e.color||"blue",onClick:()=>{t(),$e.del()},children:e.button})})]}),n.jsx("div",{className:et["--body"],onClick:$e.del})]}));function Qr(e,t){$e.set(n.jsx(Jr,{data:e,callback:t}))}const At={btn:"_btn_1hz2s_6",confirm:"_confirm_1hz2s_19"};function qt({onClick:e,onSend:t,label:r,onRef:i}){let[a,o]=b.useState(!1);const l=()=>{if(e)return e();a||(o(!0),t&&t(o))};return n.jsx("button",{ref:i,className:[At.btn,At.confirm].join(" "),onClick:l,children:a?"Ожидайте":r})}const te={white:"_white_11p39_14",black:"_black_11p39_26",shake:"_shake_11p39_1",modal:"_modal_11p39_73",o:"_o_11p39_83",w:"_w_11p39_14",h:"_h_11p39_107",l:"_l_11p39_121",t:"_t_11p39_159",m:"_m_11p39_73",x:"_x_11p39_167",s:"_s_11p39_177",c:"_c_11p39_182",f:"_f_11p39_187",btn:"_btn_11p39_230",g:"_g_11p39_243","size-a":"_size-a_11p39_296","size-s":"_size-s_11p39_300","size-m":"_size-m_11p39_304","size-l":"_size-l_11p39_308","size-x":"_size-x_11p39_312","size-f":"_size-f_11p39_316",confirm:"_confirm_11p39_322",cancel:"_cancel_11p39_327",disabled:"_disabled_11p39_332",await:"_await_11p39_339",active:"_active_11p39_389",coincidence:"_coincidence_11p39_395",sa:"_sa_11p39_431",ss:"_ss_11p39_435",sm:"_sm_11p39_439",sl:"_sl_11p39_443",sx:"_sx_11p39_447",sf:"_sf_11p39_451"};let me={};function ei({config:e}){let[t,r]=b.useState([]);return me.x=i=>{i||r([])},me.config=e,me.add=i=>{r([...t,i])},n.jsx(n.Fragment,{children:t.map(i=>i)})}function ti({title:e,children:t,button:r,tabs:i,size:a="m",menu:o}){const[l,d]=b.useState(!0),c=b.useRef(),u=p=>{if(r){if(r.onClick)return p(!1),r.onClick({setOpen:d});if(r.onSend)return r.onSend({setOpen:d,disabled:p})}},f=()=>{c.current.setAttribute("shake",!0),setTimeout(()=>{c.current.setAttribute("shake",!1)},1e3)};return n.jsx(n.Fragment,{children:l?n.jsxs("div",{className:`${te.modal} ${te.white}`,children:[n.jsx("div",{className:te.o,onClick:f}),n.jsxs("div",{className:[te.w,te[`s${a}`]].join(" "),ref:c,children:[n.jsxs("div",{className:te.h,children:[n.jsx("div",{className:te.t,children:e}),n.jsxs("div",{className:te.m,children:[i&&n.jsx("nav",{children:i.map((p,m)=>n.jsx("span",{onClick:p.onClick,className:p.active?"active":"",children:p.name},m))}),o]}),n.jsx("div",{className:te.x,onClick:()=>{d(!1)},children:n.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:n.jsx("path",{d:"M19.0005 4.99988L5.00045 18.9999M5.00045 4.99988L19.0005 18.9999",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),t,r!==void 0?n.jsx(qt,{label:r.label,onSend:u}):""]})]}):""})}function ni(e){me.add(n.jsx(ri,{children:e},String(Date.now())))}function ri({children:e}){return n.jsx(n.Fragment,{children:e})}function ii(e){if(e.target.classList[0]!=="modal")return;let t=e.target.children[0];t.setAttribute("shake",!0),setTimeout(()=>{t.setAttribute("shake",!1)},1e3)}function ai({type:e,name:t,params:r}){let[i,a]=b.useState(null);return b.useEffect(()=>{me.config(e,t,r,a)},[r.id]),n.jsx(n.Fragment,{children:i})}function oi(e,t){me.config(e,t)}function si(e){me.x(e)}const tt={};function li(e,t){tt[e]=t}function di(e,t){tt[e]!==void 0&&tt[e](t)}const fe={};function ci(e,t){const[r,i]=b.useState(t);return b.useEffect(()=>{if(fe[e])return fe[e].push(i);fe[e]=[i]},[]),[r]}function ui(e,t){if(fe[e])return fe[e].push(t);fe[e]=[t]}function fi(e,t){fe[e]&&fe[e].forEach(r=>r(t))}const Le={setListener:di,useListener:li,setEmitter:fi,useEmitter:ci,subEmitter:ui};function pi(){let[e,t]=b.useState([]);return Le.useListener("form",r=>{t([r])}),n.jsx(n.Fragment,{children:e.map(r=>r)})}const se={Path:ur,setPage:Qn,getPage:St,usePage:Jn,isPage:er,setModule:nr,getModule:Et,useModule:tr,isModule:rr,setTabs:ar,getTabs:Pe,useTabs:ir,isTabs:or,useId:sr,setId:dr,subId:lr,getId:Bt,isId:cr},Ae={Send:Yr,Error:Kr,Remark:Gr,Success:Hr,Copy:Vr},Wt=({onClick:e,active:t})=>(t=!!t,n.jsx("div",{role:"switch",onClick:()=>e,"aria-checked":`${t?"true":"false"}`}));function Zt({onClick:e,onSend:t,name:r,onRef:i}){let[a,o]=b.useState(!1);const l=()=>{if(e)return e();a||(o(!0),t&&t(o))};return n.jsx("button",{ref:i,"data-form":"button",className:a?"btn await":"btn confirm pointer",onClick:l,children:a?"Ожидайте":r})}function Ut({value:e,onValue:t,onActive:r,data:i,name:a,view:o,edit:l=!0,active:d=!0,placeholder:c="Введите сообщение"}){const u=b.useRef({value:e,timerId:null,shift:!1,send:!0}),f=()=>{u.current.value.length>0?u.current.send&&(r(!0),u.current.send=!1,u.current.timerId=setTimeout(()=>{u.current.send=!0},3e3)):r(!1)},p=y=>{u.current.value=y.target.textContent,f()},m=y=>{y.keyCode===16&&(u.current.shift=!0),y.keyCode===13&&!u.current.shift&&(y.preventDefault(),u.current.value.length!==0&&(y.target.textContent="",i&&i(u.current.value),t&&t(u.current.value),u.current.value="",r(!1)))},x=y=>{y.keyCode===16&&(u.current.shift=!1)},g=y=>{y.preventDefault(),navigator.clipboard.readText().then(k=>{window.document.execCommand("insertText",!1,k)}).catch(k=>{})},v=()=>{r(!1)},_={spellCheck:"true"};return c&&(_.placeholder=c),l&&d&&(_.contentEditable="plaintext-only"),n.jsx("dl",{"data-form":"message",children:n.jsx("dd",{onPaste:g,onInput:p,onKeyUp:x,onKeyDown:m,onBlur:v,..._,suppressContentEditableWarning:!0,children:e})})}function Yt(e){let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=e.edit!==void 0?e.edit:!0,i=e.active!==void 0?e.active:!0,a=e.placeholder!==void 0?e.placeholder:"",o=c=>{e.onValue({value:c.target.textContent,name:e.name})},l=c=>{c.key==="Enter"&&c.preventDefault()},d=c=>{c.preventDefault(),navigator.clipboard.readText().then(u=>{window.document.execCommand("insertText",!1,u)}).catch(u=>{})};return n.jsxs("dl",{"data-form":"input","type-data":"generator",children:[t(),n.jsx("dd",{onPaste:d,onInput:o,onKeyDown:l,contentEditable:r&&i?"plaintext-only":"false","data-placeholder":a,suppressContentEditableWarning:!0,children:e.value})]})}let _e={};_e.KeyDown=e=>{e.key==="Enter"&&e.preventDefault()},_e.PasteOne=e=>{e.preventDefault(),navigator.clipboard.readText().then(t=>{t=t.replace(/^\s*/,"").replace(/\s*$/,""),window.document.execCommand("insertText",!1,t)}).catch(t=>{})},_e.Focus=e=>{e.target.textContent.length===0&&(e.target.innerHTML="<br>")},_e.Blur=e=>{e.target.scrollLeft=0,e.target.querySelector("br")!==null&&e.target.querySelector("br").remove()};function Kt({value:e,onValue:t,placeholder:r="",name:i}){let a=(x,g)=>Number(Math.round(x+Math.random()*(g-x))),o=b.useRef(null),l=b.useRef(null),d=a(1e4,99999),c=x=>{x.key!=="Backspace"&&(x.key==="Enter"&&x.preventDefault(),x.target.textContent.length===5&&x.preventDefault(),/\d/.test(x.key)||x.preventDefault())},u=x=>{t({value:Number(x.target.textContent)===d,name:i})},f=x=>{x.preventDefault(),navigator.clipboard.readText().then(g=>{window.document.execCommand("insertText",!1,g.replace(/(\r\n|\n|\r)/gm," ").replace(/[^0-9]/g,"").substring(0,5))}).catch(g=>{})};b.useEffect(()=>{const x=o.current,g=x.getContext("2d");g.clearRect(0,0,x.width,x.height),g.font="30px brush script mt",g.fillStyle="#eee",g.textAlign="center",g.fillText(d,50,27),l.current.textContent=""},[d]);const p={};p.field="captcha";const m={};return r&&(m.placeholder=r),n.jsxs("dl",{...p,children:[n.jsx("dd",{ref:l,onPaste:f,onInput:u,onBlur:_e.Blur,onKeyDown:c,contentEditable:"plaintext-only",suppressContentEditableWarning:!0,...m}),n.jsx("canvas",{ref:o,width:"100",height:"35"})]})}function Ht(e){let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=()=>e.error?n.jsx("em",{children:e.error}):"",i={n1:"",n2:"",n3:"",n4:"",n5:"",n6:"",code:""},a=u=>{u.preventDefault(),u.target.textContent=u.target.textContent.slice(-1).replace(/[^+\d]/g,"");let f=window.getSelection(),p=u.target.textContent.length;if(i[u.target.id]=u.target.textContent,i.code=i.n1+""+i.n2+i.n3+i.n4+i.n5+i.n6,f.collapse(u.target.firstChild,1),p===0){u.target.blur(),u.target.focus();return}u.target.nextSibling!=null&&u.target.nextSibling.focus()},o=u=>{if(u.key==="Enter"&&u.preventDefault(),u.key==="Backspace"){if(u.preventDefault(),u.target.textContent="",i[u.target.id]="",u.target.previousSibling!=null){let f=u.target.previousSibling.id.slice(1);u.target.previousSibling.textContent="",i["n"+f]="",u.target.previousSibling.focus()}i.code=i.n1+""+i.n2+i.n3+i.n4+i.n5+i.n6}},l=u=>{if(e.real)e.onValue({value:i.code,name:e.name});else if(i.code.length===6&&(e.onValue({value:i.code,name:e.name}),e.empty)){i={n1:"",n2:"",n3:"",n4:"",n5:"",n6:"",code:""};for(let f=1;f<=6;f++){let p=document.getElementById("n"+f);p&&(p.textContent="")}}},d=u=>{u.target.textContent=""},c=u=>{u.preventDefault()};return n.jsxs("dl",{"data-form":"code",children:[t(),n.jsxs("div",{children:[n.jsx("dd",{id:"n1",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0}),n.jsx("dd",{id:"n2",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0}),n.jsx("dd",{id:"n3",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0}),n.jsx("dd",{id:"n4",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0}),n.jsx("dd",{id:"n5",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0}),n.jsx("dd",{id:"n6",onKeyDown:o,onKeyUp:l,onFocus:d,onPaste:c,onInput:a,contentEditable:!0})]}),r()]})}function Gt(e){let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=()=>e.error?n.jsx("em",{children:e.error}):"";e.edit!==void 0&&e.edit,e.active!==void 0&&e.active;let[i,a]=b.useState(e.value),o=l=>{let d=l.target.getAttribute("set-color");a(d),e.onValue({value:d,name:e.name})};return n.jsx(n.Fragment,{children:e.view==="icon"?n.jsx("i",{"data-icon":"F043"}):n.jsxs("dl",{children:[t(),n.jsxs("dd",{"el-val":i,children:[n.jsx("em",{onClick:o,"set-color":"0"}),n.jsx("em",{onClick:o,"set-color":"1"}),n.jsx("em",{onClick:o,"set-color":"2"}),n.jsx("em",{onClick:o,"set-color":"3"}),n.jsx("em",{onClick:o,"set-color":"4"}),n.jsx("em",{onClick:o,"set-color":"5"})]}),r()]})})}function xi(e,t){t===void 0?(t=e,e=new Date):e=new Date(e);let r={yyyy:e.getFullYear(),yy:(""+e.getFullYear()).slice(-2),mm:("0"+(e.getMonth()+1)).slice(-2),dd:("0"+e.getDate()).slice(-2),HH:("0"+e.getHours()).slice(-2),MM:("0"+e.getMinutes()).slice(-2),SS:("0"+e.getSeconds()).slice(-2),__:"      ",_:"    "};for(const i in r)t=t.replace(i,r[i]);return t}function hi(e){let t=["Января","Февраля","Марта","Апреля","Мая","Июня","Июля","Августа","Сентября","Октября","Ноября","Декабря"],r=new Date(e);return{day:(""+r.getFullYear()).slice(-2)+""+("0"+(r.getMonth()+1)).slice(-2)+("0"+r.getDate()).slice(-2),name:r.getDate()+" "+t[r.getMonth()]}}const gi=e=>{function t(T,$){var M,U,q;T=T??"",$=$??1;for(var M=[],q=0,U=T.length;q<U;)M.push(T.slice(q,q+=$));return M}function r(T,$){var M=[2,0,1,1,1,2];return $[T>4&&T<20?2:M[Math.min(T,5)]]}var i={null:"ноль",a1:["один","два","три","четыре","пять","шесть","семь","восемь","девять"],a2:["одна","две","три","четыре","пять","шесть","семь","восемь","девять"],a10:["десять","одиннадцать","двенадцать","тринадцать","четырнадцать","пятнадцать","шестнадцать","семнадцать","восемнадцать","девятнадцать"],a20:["двадцать","тридцать","сорок","пятьдесят","шестьдесят","семьдесят","восемьдесят","девяносто"],a100:["сто","двести","триста","четыреста","пятьсот","шестьсот","семьсот","восемьсот","девятьсот"],uc:["копейка","копейки","копеек"],ur:["рубль","рубля","рублей"],u3:["тысяча","тысячи","тысяч"],u2:["миллион","миллиона","миллионов"],u1:["миллиард","миллиарда","миллиардов"]},a,o,l,d,_,c,u,v,f,p,m,x;f=parseFloat(e).toFixed(2).split("."),c=f[0],d=f[1];var g=12-c.length;if(g<0)return!1;for(var v=[];g--;)v.push("0");c=v.join("")+c;var _=[];if(c>0){p=t(c,3);for(var y=-1;y<p.length;y++)if(u=p[y],u>0&&(m=t(u,1),a=parseInt(m[0]),o=parseInt(m[1]),l=parseInt(m[2]),_.push(i.a100[a-1]),x=y+1==3?"a2":"a1",o>1?_.push(i.a20[o-2]+(l>0?" "+i[x][l-1]:"")):_.push(o>0?i.a10[l]:i[x][l-1]),p.length>y+1)){var k=i["u"+(y+1)];_.push(r(u,k))}}else _.push(i.null);return _.push(r(c,i.ur)),_.push(d+" "+r(d,i.uc)),_.join(" ").replace(RegExp(" {2,}","g")," ").trimLeft()};function mi(e){let t=-1,r=[" kB"," MB"," GB"," TB","PB","EB","ZB","YB"];do e=e/1024,t++;while(e>1024);return Math.max(e,.1).toFixed(1)+r[t]}function _i(e){let t={};return t["application/atom+xml"]="atom",t["application/json"]="json",t["application/javascript"]="js",t["application/ogg"]="ogg",t["application/pdf"]="pdf",t["application/soap+xml"]="soap",t["application/font-woff"]="woff",t["application/xhtml+xml"]="xml",t["application/xml-dtd"]="dtd",t["application/xop+xml"]="xop",t["application/zip"]="zip",t["application/gzip"]="gzip",t["application/x-bittorrent"]="bittorrent",t["application/x-tex"]="tex",t["application/xml"]="xml",t["application/msword"]="doc",t["image/svg+xml"]="svg",t[e]}function bi(e,t,r,i){let a={sexM:"m",sexF:"f",gcaseIm:"nominative",gcaseNom:"nominative",gcaseRod:"genitive",gcaseGen:"genitive",gcaseDat:"dative",gcaseVin:"accusative",gcaseAcc:"accusative",gcaseTvor:"instrumentative",gcaseIns:"instrumentative",gcasePred:"prepositional",gcasePos:"prepositional",rules:{lastName:{exceptions:[" дюма,тома,дега,люка,ферма,гамарра,петипа,шандра . . . . ."," гусь,ремень,камень,онук,богода,нечипас,долгопалец,маненок,рева,кива . . . . ."," вий,сой,цой,хой -я -ю -я -ем -е"],suffixes:["f б,в,г,д,ж,з,й,к,л,м,н,п,р,с,т,ф,х,ц,ч,ш,щ,ъ,ь . . . . .","f ска,цка -ой -ой -ую -ой -ой","f ая --ой --ой --ую --ой --ой"," ская --ой --ой --ую --ой --ой","f на -ой -ой -у -ой -ой"," иной -я -ю -я -ем -е"," уй -я -ю -я -ем -е"," ца -a -е -у -ей -е"," рих а у а ом е"," ия . . . . ."," иа,аа,оа,уа,ыа,еа,юа,эа . . . . ."," их,ых . . . . ."," о,е,э,и,ы,у,ю . . . . ."," ова,ева -ой -ой -у -ой -ой"," га,ка,ха,ча,ща,жа -и -е -у -ой -е"," ца -и -е -у -ей -е"," а -ы -е -у -ой -е"," ь -я -ю -я -ем -е"," ия -и -и -ю -ей -и"," я -и -е -ю -ей -е"," ей -я -ю -я -ем -е"," ян,ан,йн а у а ом е"," ынец,обец --ца --цу --ца --цем --це"," онец,овец --ца --цу --ца --цом --це"," ц,ч,ш,щ а у а ем е"," ай -я -ю -я -ем -е"," гой,кой -го -му -го --им -м"," ой -го -му -го --ым -м"," ах,ив а у а ом е"," ший,щий,жий,ний --его --ему --его -м --ем"," кий,ый --ого --ому --ого -м --ом"," ий -я -ю -я -ем -и"," ок --ка --ку --ка --ком --ке"," ец --ца --цу --ца --цом --це"," в,н а у а ым е"," б,г,д,ж,з,к,л,м,п,р,с,т,ф,х а у а ом е"]},firstName:{exceptions:[" лев --ьва --ьву --ьва --ьвом --ьве"," павел --ла --лу --ла --лом --ле","m шота . . . . .","m пётр ---етра ---етру ---етра ---етром ---етре","f рашель,нинель,николь,габриэль,даниэль . . . . ."],suffixes:[" е,ё,и,о,у,ы,э,ю . . . . .","f б,в,г,д,ж,з,й,к,л,м,н,п,р,с,т,ф,х,ц,ч,ш,щ,ъ . . . . .","f ь -и -и . ю -и","m ь -я -ю -я -ем -е"," га,ка,ха,ча,ща,жа -и -е -у -ой -е"," ша -и -е -у -ей -е"," а -ы -е -у -ой -е"," ия -и -и -ю -ей -и"," я -и -е -ю -ей -е"," ей -я -ю -я -ем -е"," ий -я -ю -я -ем -и"," й -я -ю -я -ем -е"," б,в,г,д,ж,з,к,л,м,н,п,р,с,т,ф,х,ц,ч а у а ом е"]},middleName:{suffixes:[" ич а у а ем е"," на -ы -е -у -ой -е"]}},initialized:!1,init:function(){this.initialized||(this.prepareRules(),this.initialized=!0)},prepareRules:function(){for(var l in this.rules)for(var d in this.rules[l])for(var c=0,u=this.rules[l][d].length;c<u;c++)this.rules[l][d][c]=this.rule(this.rules[l][d][c])},rule:function(l){var d=l.match(/^\s*([fm]?)\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*$/);return d?{sex:d[1],test:d[2].split(","),mods:[d[3],d[4],d[5],d[6],d[7]]}:!1},word:function(l,d,c,u){if(u===this.gcaseNom)return l;if(l.match(/[-]/)){for(var f=l.split("-"),p=0,m=f.length;p<m;p++)f[p]=this.word(f[p],d,c,u);return f.join("-")}if(l.match(/^[А-ЯЁ]\.?$/i))return l;this.init();var x=this.rules[c];let g;return x.exceptions&&(g=this.pick(l,d,u,x.exceptions,!0),g)?g:(g=this.pick(l,d,u,x.suffixes,!1),g||l)},pick:function(l,d,c,u,f){let p=l.toLowerCase();for(var m=0,x=u.length;m<x;m++)if(this.ruleMatch(p,d,u[m],f))return this.applyMod(l,c,u[m]);return!1},ruleMatch:function(l,d,c,u){if(c.sex===this.sexM&&d===this.sexF||c.sex===this.sexF&&d!==this.sexF)return!1;for(var f=0,p=c.test.length;f<p;f++){var m=u?l:l.substr(Math.max(l.length-c.test[f].length,0));if(m===c.test[f])return!0}return!1},applyMod:function(l,d,c){let u;switch(d){case this.gcaseNom:u=".";break;case this.gcaseGen:u=c.mods[0];break;case this.gcaseDat:u=c.mods[1];break;case this.gcaseAcc:u=c.mods[2];break;case this.gcaseIns:u=c.mods[3];break;case this.gcasePos:u=c.mods[4];break}for(var f=0,p=u.length;f<p;f++){var m=u.substr(f,1);switch(m){case".":break;case"-":l=l.substr(0,l.length-1);break;default:l+=m}}return l},getSex:()=>{if(a.mn.length>2)switch(a.mn.substr(a.mn.length-2)){case"ич":return"m";case"на":return"f"}return""},fullName:l=>((a.fullNameSurnameLast?"":a.lastName(l)+" ")+a.firstName(l)+" "+a.middleName(l)+(a.fullNameSurnameLast?" "+a.lastName(l):"")).replace(/^ +| +$/g,""),lastName:l=>a.word(a.ln,a.sex,"lastName",l),firstName:l=>a.word(a.fn,a.sex,"firstName",l),middleName:l=>a.word(a.mn,a.sex,"middleName",l)};if(typeof t>"u"){var o=e.match(/^\s*(\S+)(\s+(\S+)(\s+(\S+))?)?\s*$/);if(!o)return"Cannot parse supplied name";o[5]&&o[3].match(/(ич|на)$/)&&!o[5].match(/(ич|на)$/)?(e=o[5],t=o[1],r=o[3],a.fullNameSurnameLast=!0):(e=o[1],t=o[3],r=o[5])}return a.ln=e,a.fn=t||"",a.mn=r||"",a.sex=i||a.getSex(),a}function vi(e){let t=e.split(" ");switch(t.length){case 2:return t[0]+" "+t[1].substring(0,1)+".";case 3:return t[0]+" "+t[1].substring(0,1)+"."+t[2].substring(0,1)+".";default:return e}}function yi(e){return{1:{val:"01",name:"Январь",names:"Января",abc:"Янв"},2:{val:"02",name:"Февраль",names:"Февраля",abc:"Февр"},3:{val:"03",name:"Март",names:"Марта",abc:"Март"},4:{val:"04",name:"Апрель",names:"Апреля",abc:"Апр"},5:{val:"05",name:"Май",names:"Мая",abc:"Май"},6:{val:"06",name:"Июнь",names:"Июня",abc:"Июнь"},7:{val:"07",name:"Июль",names:"Июля",abc:"Июль"},8:{val:"08",name:"Август",names:"Августа",abc:"Авг"},9:{val:"09",name:"Сентябрь",names:"Сентебря",abc:"Сент"},10:{val:"10",name:"Октябрь",names:"Октября",abc:"Окт"},11:{val:"11",name:"Ноябрь",names:"Ноября",abc:"Нояб"},12:{val:"12",name:"Декабрь",names:"Декабря",abc:"Дек"}}[e]}function wi(e){return parseFloat(e).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g,"$1 ")}function ki(e,t){let r=t+"";for(;r.length<e;)r="0"+r;return r}function ji(e,t,r){let i=t/e*r;return(typeof i!="number"||i===1/0)&&(i=0),parseFloat(i).toFixed(1)}function Ci(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Si(e,t){e=Math.abs(e)%100;let r=e%10;return e>10&&e<20?t[2]:r>1&&r<5?t[1]:r===1?t[0]:t[2]}function Ei(e,t,r){return he(e,t)?he(e,t).n:r||""}function Bi(e,t){return e.reduce(function(r,i){let a=t instanceof Function?t(i):i[t];return r[a]!==void 0||(r[a]={}),r[a][i.id]=i,r},{})}function Ti(e){return parseInt((Date.now()-new Date(e).getTime())/31536e6+"")+""}const pe={Age:Ti,Date:xi,MoneyString:gi,DateSort:hi,Size:mi,TypeFiles:_i,Cases:bi,Initials:vi,Month:yi,Money:wi,Number:ki,Percent:ji,CapitalizeFirstLetter:Ci,DeclensionWord:Si,Select:Ei,ObjectByArray:Bi};function nt({label:e,value:t,placeholder:r,onValue:i,name:a}){const o="__.__.____",l=new Set("_"),d=(g=>Array.from(o,(v,_)=>l.has(v)?g=_+1:g))(0),c=[...o].findIndex(g=>l.has(g)),u=new RegExp("\\d","g"),f=g=>(g=g.match(u)||[],Array.from(o,v=>(g[0]===v||l.has(v))&&g.shift()||v)),p=g=>{const[v,_]=[g.target.selectionStart,g.target.selectionEnd].map(y=>(y=f(g.target.value.slice(0,y)).findIndex(k=>l.has(k)),y<0?d[d.length-1]:m?d[y-1]||c:y));g.target.value=f(g.target.value).join(""),g.target.setSelectionRange(v,_),m=!1,i==null||i({name:a,value:g.target.value})};let m=!1;const x={};return x.field="input",n.jsxs("dl",{...x,children:[n.jsx("dt",{}),n.jsx("dd",{children:n.jsx("input",{type:"tel",placeholder:r,onChange:p,inputMode:"numeric",onKeyDown:g=>m=g.key==="Backspace",onFocus:p,defaultValue:pe.Date(t,"dd.mm.yyyy"),onBlur:g=>g.target.value===o&&(g.target.value="")})})]})}function Ii({children:e}){return n.jsx("div",{className:"l",children:n.jsx("ul",{children:e})})}function $i({children:e}){return n.jsx("div",{className:te.s,children:e})}function Ni({children:e,className:t}){let r={};return t&&(r.className=t),n.jsx("div",{"data-form":"outline",...r,children:n.jsx("ul",{children:e})})}function Di({children:e}){return n.jsx("div",{className:te.c,children:e})}const rt={List:Ii,Scroll:$i,Main:ti,Add:ni,Icon:ai,Open:oi,Shake:ii,Form:Ni,Center:Di,Close:si};function it({value:e,onValue:t,name:r,placeholder:i="",title:a,error:o,hide:l=!1,edit:d=!0,show:c=!0,active:u=!0,after:f="",view:p,modal:m,module:x,options:g,className:v}){let[_,y]=b.useState(e),k=M=>{if(!(d&&u)||!m)return;let q=m.split(".");rt.Open(q[1],{callback:U=>{t&&t({value:U,name:r}),y(U)},onValue:t,options:g,name:r,value:e})};const T={};T.field="input",v&&(T.className=v);const $={};return i&&($.placeholder=i),l?n.jsx(n.Fragment,{}):n.jsxs("dl",{...T,children:[a&&n.jsx("dt",{children:a}),n.jsx("dd",{...$,onClick:k,edit:(d&&u)+"","data-after":f,children:_}),o&&n.jsx("em",{children:o})]})}function at(e){let t=e.value,r=p=>e.type==="multi"?p.replace(/[^+\d.+-]/g,""):p.replace(/[^+\d.]/g,""),i=(p,m)=>{let x=document.createRange(),g=window.getSelection();x.setStart(m.childNodes[0],p),x.collapse(!0),g.removeAllRanges(),g.addRange(x),m.focus()},a=p=>{e.onValue({value:r(p.target.textContent),name:e.name}),p.target.textContent=r(p.target.textContent),p.target.textContent.length>0&&i(p.target.textContent.length,p.target)},o=p=>{p.target.textContent===""&&(p.target.textContent=0),e.onValue({value:r(p.target.textContent),name:e.name}),p.target.textContent=pe.Money(p.target.textContent)},l=p=>{p.target.textContent=r(p.target.textContent)},d=p=>{p.key==="Enter"&&p.preventDefault()},c=p=>{p.preventDefault(),navigator.clipboard.readText().then(m=>{m=m.replace(/^\s*/,"").replace(/\s*$/,""),window.document.execCommand("insertText",!1,m)}).catch(m=>{})},u=()=>e.title?n.jsx("dt",{children:e.title}):"",f=()=>e.error?n.jsx("em",{children:e.error}):"";return n.jsxs("dl",{"data-form":"input",children:[u(),n.jsx("dd",{onInput:a,onPaste:c,onBlur:o,onKeyDown:d,onFocus:l,contentEditable:!0,suppressContentEditableWarning:!0,"e-after":e.after,children:pe.Money(t)}),f()]})}const Vt={o:"_o_1kqkq_1",c:"_c_1kqkq_11"};function Xt({value:e,onValue:t,name:r,view:i,error:a,edit:o=!0,active:l=!0,title:d,placeholder:c="",after:u}){let[f,p]=b.useState(e);b.useEffect(()=>{p(e)},[e]);let m=v=>{p(v),t&&t({value:v,name:r})},x=v=>{if(!o||!l)return;const _=v.target.getBoundingClientRect(),y=_.left,k=_.top;Le.setListener("form",n.jsx(Mi,{position:{x:y,y:k},onValue:m,date:f},new Date().getTime()))};const g={};return c&&(g.placeholder=c),n.jsx(n.Fragment,{children:i==="icon"?n.jsx("i",{"data-icon":"F043",onClick:x}):n.jsxs("dl",{children:[d&&n.jsx("dt",{children:d}),n.jsx("dd",{onClick:x,...g,children:pe.Date(f,"mm.yyyy")}),a&&n.jsx("em",{children:a})]})})}const Mi=e=>{let[t,r]=b.useState(!0),i=new Date,a=new Date(e.date),o={y:parseInt(i.getFullYear()),m:parseInt(i.getMonth())+1},l={y:parseInt(a.getFullYear()),m:parseInt(a.getMonth())+1},[d,c]=b.useState(l.y),u=()=>{r(!1)},f=()=>{c(d+1)},p=()=>{c(d-1)},m=y=>{e.onValue(d+"-"+pe.Number(2,y)),u()},x=y=>o.y===l.y&&o.m===y?"_FFEB3B":"",g=Array(12).fill("").map((y,k)=>k+1),v=window.innerHeight-e.position.y+33<320?e.position.y-312:e.position.y+33,_=window.innerWidth-e.position.x<265?e.position.x-235:e.position.x;return n.jsx(n.Fragment,{children:t?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:Vt.o,onClick:()=>u()},new Date().getTime()),n.jsxs("div",{className:Vt.c,style:{top:v+"px",left:_+"px"},children:[n.jsxs("s",{children:[n.jsx("i",{"data-icon":"F021",onClick:()=>p()}),n.jsx("h2",{children:d}),n.jsx("i",{"data-icon":"F022",onClick:()=>f()})]}),n.jsx("div",{children:g.map((y,k)=>n.jsx("span",{onClick:()=>{m(y)},color:x(y),children:n.jsx("b",{children:pe.Month(y).abc})},k))})]})]}):""})};function Jt(e){let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=()=>e.error?n.jsx("em",{children:e.error}):"",[i,a]=b.useState(!1),o=e.edit!==void 0?e.edit:!0,l=e.active!==void 0?e.active:!0,c=!!(e.hide&&(e.value===""||e.value===void 0))&&!(o&&l);i=o?!0:i;let u=e.placeholder!==void 0?e.placeholder:"Заметка пуста",f=_=>{e.onValue&&e.onValue({value:_.target.innerText,name:e.name})},p=_=>{_.preventDefault(),navigator.clipboard.readText().then(y=>{window.document.execCommand("insertText",!1,y)}).catch(y=>{})},m=_=>{o||a(!i)};const x=_=>{e.onSave&&e.onSave({value:_.target.innerText,name:e.name})},g={};g.field="notes",e.className&&(g.className=e.className);const v={};return u&&(v.placeholder=u),i&&(v.open=""),o&&l&&(v.edit=""),c?n.jsx(n.Fragment,{}):n.jsxs("dl",{...g,children:[t(),n.jsx("dd",{onPaste:p,onInput:f,onBlur:x,contentEditable:o&&l?"plaintext-only":"false",...v,onDoubleClick:m,suppressContentEditableWarning:!0,children:e.value}),r()]})}function ot({onValue:e,onSave:t,value:r,name:i,active:a,max:o,edit:l,title:d,error:c,show:u,hide:f,placeholder:p,className:m,after:x,view:g}){l=l!==void 0?l:!0,a=a!==void 0?a:!0,f=!!(f&&(r===""||r===void 0))&&!(l&&a),p=p!==void 0?p:"",o=o!==void 0?o:99;let _=T=>{e==null||e({name:i,value:T.currentTarget.value})};const y=T=>{t==null||t({name:i,value:T.currentTarget.value})},k={};return k.field="input",m&&(k.className=m),f?n.jsx(n.Fragment,{}):n.jsxs("dl",{...k,children:[d&&n.jsx("dt",{children:d}),n.jsx("dd",{children:n.jsx("input",{name:i,type:"tel",inputMode:"numeric",onChange:_,onBlur:y,placeholder:p,defaultValue:r})}),c&&n.jsx("em",{children:c})]})}function Qt({value:e,onValue:t,name:r,placeholder:i="",className:a,title:o,error:l,edit:d=!0,active:c=!0,reload:u=!1,after:f=""}){let p=_=>{t&&t({value:_.target.textContent,name:r,reload:u})},m=_=>{_.key==="Enter"&&_.preventDefault()},x=_=>{_.preventDefault(),navigator.clipboard.readText().then(y=>{window.document.execCommand("insertText",!1,y.replace(/(\r\n|\n|\r)/gm," "))}).catch(y=>{})};const g={};g.field="password",a&&(g.className=a);const v={};return i&&(v.placeholder=i),n.jsxs("dl",{...g,children:[o?n.jsx("dt",{children:o}):"",n.jsx("dd",{onPaste:x,onInput:p,onKeyDown:m,onBlur:_e.Blur,contentEditable:d&&c?"plaintext-only":"false",...v,suppressContentEditableWarning:!0,children:e}),l?n.jsx("em",{children:l}):""]})}function st({onValue:e,onSave:t,value:r,name:i,active:a,max:o,edit:l,title:d,error:c,show:u,hide:f,placeholder:p,className:m,after:x,view:g}){l=l!==void 0?l:!0,a=a!==void 0?a:!0,f=!!(f&&(r===""||r===void 0))&&!(l&&a),p=p||"";const _="+7__________",y=new Set("_"),k=(C=>Array.from(_,(R,Q)=>y.has(R)?C=Q+1:C))(0),T=[..._].findIndex(C=>y.has(C)),$=new RegExp("\\d","g"),M=C=>(C=C.match($)||[],Array.from(_,R=>(C[0]===R||y.has(R))&&C.shift()||R)),q=C=>{const[R,Q]=[C.target.selectionStart,C.target.selectionEnd].map(F=>(F=M(C.target.value.slice(0,F)).findIndex(X=>y.has(X)),F<0?k[k.length-1]:re?k[F-1]||T:F));C.target.value=M(C.target.value).join(""),C.target.setSelectionRange(R,Q),re=!1,e==null||e({name:i,value:C.target.value})},U=C=>{const[R,Q]=[C.target.selectionStart,C.target.selectionEnd].map(F=>(F=M(C.target.value.slice(0,F)).findIndex(X=>y.has(X)),F<0?k[k.length-1]:re?k[F-1]||T:F));C.target.value=M(C.target.value).join(""),C.target.setSelectionRange(R,Q),re=!1,e==null||e({name:i,value:C.target.value})};let re=!1;const L={};return L.field="input",m&&(L.className=m),f?n.jsx(n.Fragment,{}):n.jsxs("dl",{...L,children:[d&&n.jsx("dt",{children:d}),n.jsx("dd",{children:n.jsx("input",{name:i,type:"tel",inputMode:"numeric",onChange:q,onBlur:U,placeholder:p,defaultValue:r})}),c&&n.jsx("em",{children:c})]})}const en=e=>{let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=e.edit!==void 0?e.edit:!0,i=e.active!==void 0?e.active:!0,a=e.placeholder!==void 0?e.placeholder:"",o=0,l=()=>{clearTimeout(o),o=setTimeout(()=>{},1e3)},d=f=>{f.key==="Enter"&&f.preventDefault()},c=f=>{f.preventDefault(),navigator.clipboard.readText().then(p=>{window.document.execCommand("insertText",!1,p)}).catch(p=>{})};const u={};return a&&(u.placeholder=a),n.jsxs("dl",{"data-form":"input",children:[t(),n.jsx("dd",{onPaste:c,onInput:l,onKeyDown:d,contentEditable:r&&i?"plaintext-only":"false",...u,suppressContentEditableWarning:!0,children:e.value})]})};function lt({title:e,error:t,edit:r=!0,active:i=!0,hide:a,value:o="0",onValue:l,options:d,placeholder:c="",name:u,after:f,view:p,className:m}){var k;const x=b.useId(),[g,v]=b.useState((k=d[parseInt(o)])==null?void 0:k.n);let _=T=>{v(d[T.target.value].n),l==null||l({name:u,value:T.target.value})};const y={};return y.field="select",m&&(y.className=m),n.jsxs("dl",{...y,children:[e?n.jsx("dt",{children:e}):"",n.jsxs("dd",{children:[g,n.jsx("select",{name:u,id:x,defaultValue:o+"",onChange:_,children:Object.keys(d).map(T=>n.jsx("option",{value:T,children:d[T].n},T))})]})]})}function dt({value:e,onValue:t,name:r,placeholder:i="",title:a="",error:o="",hide:l=!1,edit:d=!0,active:c=!0,after:u="",show:f=!0,view:p,onSave:m,className:x=""}){let g=!!(l&&(e===""||e===void 0)),v=$=>{t==null||t({value:$.target.value,name:r})},_=$=>{$.preventDefault(),navigator.clipboard.readText().then(M=>{window.document.execCommand("insertText",!1,M.replace(/(\r\n|\n|\r)/gm," "))}).catch(M=>{})},y=$=>{$.preventDefault(),navigator.clipboard.writeText($.target.value).then(function(){Ae.Copy("Данные в буфер обмене")},function(M){})};if(!(d&&c)&&!f||!(d&&c)&&g)return"";const k={};k.field="input",x&&(k.className=x);const T=$=>{m==null||m({value:$.target.value,name:r})};return n.jsxs("dl",{...k,children:[a?n.jsx("dt",{children:a}):"",n.jsx("dd",{children:n.jsx("input",{name:r,autoComplete:"off",type:"text",onChange:v,onPaste:_,onBlur:T,onContextMenu:y,placeholder:i,defaultValue:e,spellCheck:"false"})}),o?n.jsx("em",{children:o}):""]})}function ct(e){let t=()=>e.title?n.jsx("dt",{children:e.title}):"",r=()=>e.error?n.jsx("em",{children:e.error}):"",i=e.edit!==void 0?e.edit:!0,a=e.active!==void 0?e.active:!0,l=!!(e.hide&&(e.default===""||e.options[e.default]===void 0))&&!(i&&a),d=e.placeholder!==void 0?e.placeholder:"",c=x=>{f(e.options[x]),e.onValue({value:x,name:e.name})},[u,f]=b.useState(e.default!==void 0?e.options[e.default]:e.default),p=x=>{if(!(i&&a))return;const g=x.target.getBoundingClientRect();Le.setListener("form",n.jsx(zi,{parent:g,onValue:c,view:e.view,options:e.options},new Date().getTime()))};const m={};return d&&(m.placeholder=d),l?n.jsx(n.Fragment,{}):n.jsxs("dl",{"data-form":"select",children:[t(),n.jsx("dd",{onClick:p,"data-edit":(i&&a)+"",...m,children:u}),r()]})}const zi=({onValue:e,parent:t,view:r,options:i})=>{let[a,o]=b.useState(!0),l=()=>{o(!1)},d=p=>{o(!1),e(p)},c=Object.keys(i).length*36,u=window.innerHeight-t.y+t.height<c?t.y-(c-33):t.y+33,f=window.innerWidth-t.x<265?t.x-235:t.x;return n.jsx(n.Fragment,{children:a?n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-select":"backdrop",onClick:l},new Date().getTime()),n.jsx("div",{"data-select":"background "+r,style:{top:u+"px",left:f+"px",width:t.width},children:n.jsx("ul",{children:Object.keys(i).map((p,m)=>n.jsx("li",{onClick:()=>{d(p)},children:i[p]},m))})})]}):""})};function ut({set:e,value:t,onValue:r,name:i,placeholder:a="",title:o="",error:l="",hide:d=!1,edit:c=!0,show:u=!0,active:f=!0,after:p="",view:m,module:x,item:g,className:v=""}){let _={};switch(e){case"String":return n.jsx(dt,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v});case"Select":return g&&(_=oe.getSelect(parseInt(g))?oe.getSelect(parseInt(g)):{0:{s:"1",n:"не известно"}}),n.jsx(lt,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v,options:_});case"Users":return oe.getSelect("user"),n.jsx(ct,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v,options:_});case"Date":return n.jsx(nt,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v});case"Phone":return n.jsx(st,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v});case"Number":return n.jsx(ot,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v});case"Money":return n.jsx(at,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i,placeholder:a,className:v});case"Modal":return n.jsx(it,{title:o,show:u,hide:d,view:m,edit:c,active:f,value:t,onValue:r,name:i||"",placeholder:a,className:v,options:_,module:x||""})}}function tn({value:e,onValue:t,name:r,placeholder:i="",title:a="",error:o="",hide:l=!1,edit:d=!0,active:c=!0,after:u="",show:f=!0,view:p,onBlur:m,onSave:x,className:g=""}){let v=!!(l&&(e===""||e===void 0));if(!(d&&c)&&!f||!(d&&c)&&v)return"";let _=$=>{t&&t({value:$.target.innerText,name:r})},y=$=>{x&&x({value:$.target.innerText,name:r})},k=$=>{$.preventDefault(),navigator.clipboard.readText().then(M=>{window.document.execCommand("insertText",!1,M)}).catch(M=>{})};const T={};return i&&(T.placeholder=i),n.jsxs("dl",{children:[a??n.jsx("dt",{children:a}),n.jsx("dd",{onPaste:k,onBlur:y,onInput:_,contentEditable:d&&c?"plaintext-only":"false",...T,suppressContentEditableWarning:!0,children:e}),o??n.jsx("em",{children:o})]})}function nn({value:e,onValue:t,name:r,placeholder:i="",title:a="",error:o="",hide:l=!1,edit:d=!0,active:c=!0,after:u="",show:f=!0,view:p,onBlur:m,onSave:x,className:g=""}){let v=!!(l&&(e===""||e===void 0));if(pe.Date(e===void 0?new Date:e,"HH:MM"),b.useRef(null),!(d&&c)&&!f||!(d&&c)&&v)return"";const _="__:__",y=new Set("_"),k=(C=>Array.from(_,(R,Q)=>y.has(R)?C=Q+1:C))(0),T=[..._].findIndex(C=>y.has(C)),$=new RegExp("\\d","g"),M=C=>(C=C.match($)||[],Array.from(_,R=>(C[0]===R||y.has(R))&&C.shift()||R)),q=C=>{const[R,Q]=[C.target.selectionStart,C.target.selectionEnd].map(F=>(F=M(C.target.value.slice(0,F)).findIndex(X=>y.has(X)),F<0?k[k.length-1]:L?k[F-1]||T:F));C.target.value=M(C.target.value).join(""),C.target.setSelectionRange(R,Q),t==null||t({name:r,value:C.target.value})},U={};U.field="input",g&&(U.className=g);const re={};i&&(re.placeholder=i);let L=!1;return n.jsx(n.Fragment,{children:n.jsxs("dl",{...U,children:[a?n.jsx("dt",{children:a}):"",n.jsx("dd",{...re,children:n.jsx("input",{type:"tel",placeholder:i,onChange:q,inputMode:"numeric",onKeyDown:C=>L=C.key==="Backspace",onFocus:q,onBlur:C=>C.target.value===_&&(C.target.value="")})}),o?n.jsx("em",{children:o}):""]})})}function rn({onValue:e,label:t,value:r,className:i,name:a,reload:o}){r=!!r;const[l,d]=b.useState(r),c=()=>{let p=!l;e({name:a,value:p,reload:o}),d(p)},u={};u.field="check",i&&(u.className=i);const f={};return l&&(f.active=""),n.jsxs("dl",{...u,children:[t?n.jsx("dt",{children:t}):"",n.jsx("dd",{...f,onClick:c})]})}const an=({onValue:e,value:t,name:r,item:i})=>{const[a,o]=b.useState(!!t);b.useEffect(()=>{o(!!t)},[t]);let l=()=>{let d=parseInt(a)===0?1:0;o(d),e({value:d,name:r,key:i,item:i})};return n.jsx("div",{role:"switch",onClick:l,"aria-checked":`${a?"true":"false"}`})};function on({value:e,onValue:t,name:r,placeholder:i="",title:a="",error:o="",hide:l=!1,edit:d=!0,active:c=!0,after:u="",show:f=!0,view:p,onBlur:m,onSave:x,className:g=""}){const[v,_]=b.useState(e!==void 0?e.split(","):[]);b.useEffect(()=>{e!==void 0&&_(e!==void 0?e.split(","):[])},[e]);let y=()=>{_([...v,""])},k=L=>{v.splice(L,1),v.length===0&&v.push(""),_([...v]),m!==void 0&&m({value:v.join(","),name:r})},T=!!(l&&(e===""||e===void 0)),$=L=>{};if(!(d&&c)&&!f||!(d&&c)&&T)return"";const M={};M.field="group",g&&(M.className=g);const q=L=>{_e.Blur(L),x&&x({value:L.target.textContent,name:r})};let U=(L,C)=>{v[C]=L.target.textContent,t!==void 0&&t({value:v.join(","),name:r})},re=L=>{L.key==="Enter"&&L.preventDefault()};return n.jsxs("dl",{...M,children:[n.jsxs("dt",{children:[a,n.jsx("i",{onClick:y,children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",children:[n.jsx("path",{d:"M12 5.25v13.5"}),n.jsx("path",{d:"M18.75 12H5.25"})]})})]}),n.jsx("dd",{children:v.map((L,C)=>n.jsxs("li",{className:"field_group_item",children:[n.jsx("span",{onInput:R=>U(R,C),edit:"true",name:r,placeholder:i,onPaste:$,contentEditable:!0,onKeyDown:re,onBlur:q,suppressContentEditableWarning:!0,children:v[C]}),n.jsx("i",{onClick:()=>{k(C)},children:n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",children:[n.jsx("path",{d:"M17.25 17.25 6.75 6.75"}),n.jsx("path",{d:"m17.25 6.75-10.5 10.5"})]})})]},C))}),o?n.jsx("em",{children:o}):""]})}const Fi=e=>(e=e!==void 0&&e!==""?e.split(","):[],e.reduce((t,r)=>(t[r]=!0,t),{}));function sn({value:e,onValue:t,name:r,placeholder:i="",title:a,error:o,hide:l=!1,edit:d=!0,show:c=!0,active:u=!0,after:f="",view:p,modal:m,module:x,options:g,className:v}){const[_,y]=b.useState(Fi(e)),k=M=>{if(!(d&&u)||!m)return;let q=m.split(".");rt.Open(q[1],{callback:U=>{t&&t({value:U,name:r}),y(U)},onValue:t,options:g,name:r,value:_})},T={};T.field="group",v&&(T.className=v);const $={};return i&&($.placeholder=i),l?n.jsx(n.Fragment,{}):n.jsxs("dl",{...T,children:[n.jsxs("dt",{children:[a,n.jsx("i",{onClick:k,children:n.jsxs("svg",{width:"20",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M12 5.25v13.5"}),n.jsx("path",{d:"M18.75 12H5.25"})]})})]}),n.jsx("dd",{...$,onClick:open,edit:(d&&u)+"","data-after":f,children:Object.keys(_).map(M=>{var q;return n.jsx("div",{className:"field_group_item",children:(q=g[M])==null?void 0:q.label},M)})}),o&&n.jsx("em",{children:o})]})}const ln={Color:Gt,Date:nt,Code:Ht,Check:rn,Switch:Wt,Button:Zt,Message:Ut,Generator:Yt,Captcha:Kt,Modal:it,Money:at,Month:Xt,Notes:Jt,Number:ot,Password:Qt,Phone:st,Search:en,Select:lt,Set:ut,Textarea:tn,Time:nn,Users:ct,String:dt,Toogle:an,Group:on,Options:sn},be={debug:"_debug_ug20b_34",b:"_b_ug20b_46",o:"_o_ug20b_50",mb:"_mb_ug20b_55",tm:"_tm_ug20b_66",ta:"_ta_ug20b_133","--body":"_--body_ug20b_143"},S=window.Telegram.WebApp,le={is:!1,MainButton:{},BackButton:{}};let ve={};ve.dark={"--tg-theme-bg-color":"#212121","--tg-theme-text-color":"#ffffff","--tg-theme-hint-color":"#aaaaaa","--tg-theme-link-color":"#8774e1","--tg-theme-button-color":"#8774e1","--tg-theme-button-text-color":"#ffffff","--tg-theme-secondary-bg-color":"#0f0f0f","--tg-theme-header-bg-color":"#212121","--tg-theme-accent-text-color":"#8774e1","--tg-theme-section-bg-color":"#212121","--tg-theme-section-header-text-color":"#aaaaaa","--tg-theme-subtitle-text-color":"#aaaaaa","--tg-theme-destructive-text-color":"#e53935"},ve.light={"--tg-theme-bg-color":"#ffffff","--tg-theme-text-color":"#000000","--tg-theme-hint-color":"#999999","--tg-theme-link-color":"#2481cc","--tg-theme-button-color":"#2481cc","--tg-theme-button-text-color":"#ffffff","--tg-theme-secondary-bg-color":"#efeff3"},ve.users={"--tg-theme-bg-color":"#000000","--tg-theme-text-color":"#ffffff","--tg-theme-hint-color":"#98989e","--tg-theme-link-color":"#ffffff","--tg-theme-button-color":"#ffffff","--tg-theme-button-text-color":"#000000","--tg-theme-secondary-bg-color":"#000000"},S.getUser=()=>{var e;return((e=S.initDataUnsafe)==null?void 0:e.user)===void 0?{}:S.initDataUnsafe},S.MainButton.callback=[],S.MainButton.set=e=>{le.is?le.MainButton.set(e):(S.MainButton.callback.forEach(t=>{S.MainButton.offClick(t)}),S.MainButton.callback=[],typeof e=="boolean"?S.MainButton.isVisible=!1:(S.MainButton.text=e.text,e.color&&(S.MainButton.color=e.color),e.textColor&&(S.MainButton.textColor=e.textColor),S.MainButton.isVisible=!0,S.MainButton.isActive=e.isActive===void 0?!0:e.isActive,S.MainButton.callback.push(()=>{var t;e.page===void 0?(t=e.callback)==null||t.call(e):se.setPage(e.page)}),S.MainButton.onClick(S.MainButton.callback[0])))},S.BackButton.state=[!1],S.BackButton.listen=[],S.BackButton.router=e=>{e===!1?(S.BackButton.isVisible=!1,S.BackButton.offClick(S.BackButton.listen[0]),S.BackButton.listen.shift(),S.BackButton.state.length!==1&&S.BackButton.state.pop()):(S.BackButton.isVisible=!0,S.BackButton.offClick(S.BackButton.listen[0]),S.BackButton.listen.shift(),S.BackButton.listen.push(()=>{let t=S.BackButton.state.pop();if(t.page!==void 0)se.setPage(t.page);else{let r=S.BackButton.state[S.BackButton.state.length-1];S.BackButton.router(r)}}),S.BackButton.onClick(S.BackButton.listen[0]))},S.BackButton.set=e=>{le.is?le.BackButton.set(e):(S.BackButton.state.push(e),S.BackButton.router(e))},S.Notice=(e,t)=>{t!==void 0?(Ae.Send({type:e,text:t}),le.is||S.HapticFeedback.notificationOccurred(e)):(Ae.Send(e),le.is||S.HapticFeedback.notificationOccurred(e.type))},S.Init=({dev:e})=>{if(e){let[t,r]=b.useState(!1),[i,a]=b.useState(!1),[o,l]=b.useState("dark"),[d,c]=b.useState(!1),[u,f]=b.useState(!1);le.is=!0,le.MainButton.set=r,le.BackButton.set=a,b.useEffect(()=>{for(let x in ve[o])document.documentElement.style.setProperty(x,ve[o][x])},[]);let p=x=>{for(let g in ve[x])document.documentElement.style.setProperty(g,ve[x][g]);l(x),c(!1)},m=()=>{c(!1),f(!0)};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:be.debug,children:[i===!1?n.jsx("div",{className:be.b,children:"Отмена"}):n.jsx("div",{onClick:()=>{i.page===void 0||se.setPage(i.page)},className:be.b,children:"Назад"}),n.jsx("div",{className:be.o,onClick:()=>c(!d),children:"Меню"})]}),t&&n.jsx("div",{className:be.mb,children:n.jsx("button",{onClick:()=>{t.page&&se.setPage(t.page),t.callback&&t.callback()},children:t.text})}),d?n.jsxs("div",{className:be.tm,children:[n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("button",{onClick:m,children:"Authorization"})}),n.jsx("li",{children:n.jsx("button",{onClick:()=>se.setPage("Add"),children:"Add Page"})})]}),n.jsxs("ul",{children:[n.jsxs("li",{children:[n.jsx("button",{children:"Thema"}),n.jsxs("ol",{children:[n.jsx("li",{children:n.jsx("button",{onClick:()=>p("dark"),children:"Dark"})}),n.jsx("li",{children:n.jsx("button",{onClick:()=>p("light"),children:"Light"})}),n.jsx("li",{children:n.jsx("button",{onClick:()=>p("users"),children:"Users"})})]})]}),n.jsx("li",{children:n.jsx("button",{onClick:()=>c(!d),children:"Closed"})})]})]}):"",u?n.jsx(Pi,{setAuthorization:f}):""]})}else return n.jsx(n.Fragment,{})};const Pi=({setAuthorization:e})=>{let t={},r=a=>{t=a.value},i=a=>{localStorage.setItem("auth",t)};return n.jsx("div",{className:be.ta,children:n.jsxs("div",{className:"--body",children:[n.jsx("fieldset",{children:n.jsx(ln.Notes,{label:"Data JSON",name:"description",onValue:r,placeholder:""})}),n.jsx("div",{onClick:i,children:" Сщхранить "})]})})},Ri=({children:e,config:t})=>(window.location.pathname==="/clear"&&(window.history.pushState({},"","/"),V()),N.New(t.crypto),t.defaultModule&&Wn(t.defaultModule),Un(n.jsxs(n.Fragment,{children:[n.jsx(S.Init,{dev:t.dev}),n.jsx(ei,{config:t.modal}),n.jsx(Ur,{}),n.jsx(Xr,{}),n.jsx(pi,{}),e]}))),dn=({list:e,onClick:t,active:r,size:i,view:a})=>n.jsx("nav",{children:n.jsx("ul",{className:[i,a].join(" "),children:e.map(o=>n.jsx(Oi,{onClick:t,active:r,label:o.label,link:o.link},o.link))})}),Oi=({onClick:e,label:t,link:r,active:i})=>n.jsx("li",{"tabs-active":String(i===r),onClick:()=>e(r),children:t});dn.defaultProps={size:"M",view:"H"};const Li=({title:e="",button:t,description:r="",children:i})=>n.jsxs("fieldset",{children:[e&&n.jsxs("legend",{children:[e,t&&n.jsx("div",{role:"button-outline",onClick:()=>t.onClick(),children:t.label})," "]}),n.jsx("ul",{children:i}),r&&n.jsx("article",{children:r})]}),Ai={setting:"_setting_dva4m_2"},qi=({children:e})=>n.jsx("div",{className:Ai.setting,children:e}),Wi=({label:e,children:t})=>{let[r,i]=b.useState(!1);return n.jsxs("li",{"data-item":"accordion",children:[n.jsxs("dl",{onClick:()=>i(!r),children:[n.jsx("dt",{children:e}),n.jsx("dd",{children:n.jsx("div",{"data-close":String(r)})})]}),r&&n.jsx("div",{children:t})]})},Zi=({label:e,onClick:t,button:r})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{role:"button",onClick:()=>t(),children:r})]})}),cn={Switch:({active:e,onClick:t})=>(e=typeof e=="number"?!!e:e,n.jsx("div",{role:"switch",onClick:()=>{t()},"aria-checked":e?"true":"false"}))},Ui={Accordion:Wi,Button:Zi,Switch:({label:e,onClick:t,active:r})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{children:n.jsx(cn.Switch,{onClick:t,active:r})})]})}),Info:({label:e,info:t})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{role:"info",children:t})]})}),Select:({label:e,active:t,options:r})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{role:"info",children:t})]})}),Component:({label:e,children:t})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{children:t})]})}),Node:({label:e,children:t})=>n.jsx("li",{children:n.jsxs("dl",{children:[n.jsx("dt",{children:e}),n.jsx("dd",{children:t})]})})};function un({list:e,onClick:t,active:r,size:i,view:a}){return n.jsx("nav",{children:n.jsx("ul",{className:[i,a].join(" "),children:e.map(o=>n.jsx(Yi,{onClick:t,active:r,label:o.label,link:o.link},o.link))})})}const Yi=({onClick:e,label:t,link:r,active:i})=>n.jsx("li",{"tabs-active":String(i===r),onClick:()=>e(r),children:t});un.defaultProps={size:"M",view:"H"};const Ki={Section:Li,Main:qi,Item:Ui,Tabs:un};function fn({text:e,type:t,button:r}){let[i,a]=b.useState(!1),o={active:t};const l=()=>{if(r){if(r.onClick)return r.onClick({});if(r.onSend)return i?void 0:(a(!0),r.onSend(a))}};return n.jsxs("div",{className:et.al,...o,children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",fillRule:"evenodd",clipRule:"evenodd",children:n.jsx("path",{fill:"#fff",d:"M10.362 2.015C11.4264 1.66167 12.5736 1.66167 13.638 2.015C14.6981 2.36687 15.5304 3.20141 16.3665 4.37395C17.1999 5.5426 18.1208 7.17206 19.3078 9.2725L19.3544 9.35496C20.5417 11.4557 21.4625 13.0851 22.0364 14.4065C22.613 15.7343 22.9002 16.8807 22.6711 17.9821C22.4403 19.0911 21.8714 20.0995 21.0428 20.8617C20.2162 21.622 19.0907 21.9428 17.6736 22.0968C16.2645 22.25 14.4212 22.25 12.0488 22.25H11.9513C9.57882 22.25 7.73554 22.25 6.32642 22.0968C4.90927 21.9428 3.78379 21.622 2.95722 20.8617C2.12862 20.0995 1.55968 19.0911 1.32895 17.9821C1.0998 16.8807 1.387 15.7343 1.96365 14.4065C2.53752 13.0851 3.45835 11.4557 4.64558 9.35495L4.69218 9.2725L4.69218 9.27249C5.87921 7.17206 6.80008 5.5426 7.63347 4.37395C8.46963 3.20141 9.30194 2.36687 10.362 2.015ZM11 17C11 16.4477 11.4457 16 11.9955 16H12.0045C12.5543 16 13 16.4477 13 17C13 17.5523 12.5543 18 12.0045 18H11.9955C11.4457 18 11 17.5523 11 17ZM11 13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V9C13 8.44772 12.5523 8 12 8C11.4477 8 11 8.44772 11 9V13Z"})}),n.jsx("span",{children:e}),r&&n.jsx("button",{onClick:l,children:r.label})]})}const H={h:"_h_1usnu_1",g:"_g_1usnu_11",hr:"_hr_1usnu_16",hl:"_hl_1usnu_28",t:"_t_1usnu_40",s:"_s_1usnu_60",u:"_u_1usnu_69",o:"_o_1usnu_76",l:"_l_1usnu_105",hh:"_hh_1usnu_115",c:"_c_1usnu_128",loadingB:"_loadingB_1usnu_1",m:"_m_1usnu_180",ul:"_ul_1usnu_196",f:"_f_1usnu_226"},pn=({title:e,left:t,right:r,children:i})=>n.jsxs("div",{className:H.h,children:[n.jsx("div",{className:H.t,children:e}),t&&n.jsx("div",{className:H.hl,children:t}),r&&n.jsx("div",{className:H.hr,children:r}),i]}),xn=({children:e,...t})=>n.jsx("div",{className:H.l,children:e}),hn=({children:e})=>n.jsx("div",{className:H.s,children:e}),gn=({children:e,edit:t})=>{const r={};return t&&(r.edit=""),n.jsx("div",{...r,className:H.f,children:e})};function mn({children:e}){return n.jsx("div",{className:H.g,children:e})}const Hi={Header:pn,Section:hn,Group:mn,Form:gn,List:xn,A:fn,U:({children:e})=>n.jsx("div",{className:H.u,children:e}),G:mn,C:({children:e})=>n.jsx("div",{className:H.c,children:e}),L:xn,O:({children:e,className:t,title:r})=>n.jsxs("div",{className:[H.o,t].join(" "),children:[r&&n.jsx("div",{className:H.hh,children:r}),e]}),S:hn,H:pn,M:({children:e})=>n.jsx("div",{className:H.m,children:e}),F:gn},Gi={Send:Qr,Line:fn};function Vi(){return n.jsx("svg",{viewBox:"0 0 462.86 359.96",children:n.jsx("path",{d:"M210.5,307.78c-27,35.41-58.14,58-120.55,50.84-1-.12-1.58-.39-1.58-2V327.87c0-1.32.51-2.12,1.85-2,100.39-1,88.17-63.46,74.8-90.94-47.3-97.28-14.46-166.27,20.26-205.14,14.1-16.37,50.53-42,128.07-23.24,9.1,2,30.51,7.8,24.46,11.38C317.5,30,297.66,68.33,295,73.12c-3.62,6.59-6.26,13.17-4.57,14.13,2.37,1.35,3.5-1.56,6.58-7.91C319.78,34.41,366-22.76,402.78,37.68a1.14,1.14,0,0,1,.09.26c9.3,56.05,30.57,228.62-97.76,224.22-23.38-2-28.82-22-32.57-18.89-3.36,3,10,21.4,32.76,23.19C448.18,270.75,411.55,66.74,407.79,41.91a1.41,1.41,0,0,1,0-.3c2-7.32,129.15,17.47,112.77,158.08,4.82,6.57,10.89,10,18.7,16.08l.13.07c8.9,3.67,10.46,12.06,11.43,18.88a63.15,63.15,0,0,1-.14,15.49c-10.48-4.62-22.74-10.11-22.26-22.53.43-12,7.35-5.21-8.8-14.22a.69.69,0,0,0-1,.57c-.33,3.87-2.7,14.69-3,16.59v0c-4.64,17-16.59,86-18.41,99.58-.77,5.7-4.94,10.41-11.4,10.39l-56.71.18c-7.73.22-9.57-7.9-10.27-11.89-2.7-15.31-4.08-29.7-4.18-29.67-20.24,9.26-108.69,3.08-108.69,3.27V330c-.29,7.56-4.51,15.26-11.74,15.32l-52.87,1c-10.36.1-13.85-1.67-15.5-11.87-2.08-13.08-1-34.26-5.32-37.43-2,1.84-8.33,8.11-10,10.83M196.16,203q9.57,0,11.42-7.72c2.18-9.07-5.66-17.7-14.77-15.68-4.95,1.11-7.53,4.94-7.53,11.53C185.28,199,188.94,203,196.16,203Z",transform:"translate(-88.37 0)"})})}const Xi={};function Ji(e){Xi.add(e)}function Qi({color:e,size:t,name:r}){return n.jsx("svg",{width:t,height:t,color:e,children:n.jsx("use",{href:`#${r}`})})}const ea={Logo:Vi,Sprite:Ji,Symbol:Qi};function ta(){return n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M5.15837 11.491C5.08489 12.887 5.16936 14.373 3.92213 15.3084C3.34164 15.7438 3 16.427 3 17.1527C3 18.1508 3.7818 19 4.8 19H19.2C20.2182 19 21 18.1508 21 17.1527C21 16.427 20.6584 15.7438 20.0779 15.3084C18.8306 14.373 18.9151 12.887 18.8416 11.491C18.6501 7.85223 15.6438 5 12 5C8.35617 5 5.34988 7.85222 5.15837 11.491Z",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),n.jsx("path",{d:"M10.5 3.125C10.5 3.95343 11.1716 5 12 5C12.8284 5 13.5 3.95343 13.5 3.125C13.5 2.29657 12.8284 2 12 2C11.1716 2 10.5 2.29657 10.5 3.125Z",stroke:"currentColor",strokeWidth:"1",fill:"none"}),n.jsx("path",{d:"M15 19C15 20.6569 13.6569 22 12 22C10.3431 22 9 20.6569 9 19",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})}function na(){return n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[n.jsx("path",{d:"M4.4094 11.4516C4.62188 7.41446 7.95728 4.25 12 4.25C16.0427 4.25 19.3781 7.41446 19.5906 11.4516C19.5997 11.6241 19.6064 11.7893 19.6129 11.9485C19.6351 12.49 19.6544 12.9615 19.7525 13.4133C19.8698 13.9531 20.0867 14.3775 20.5279 14.7084C21.2972 15.2854 21.75 16.191 21.75 17.1527C21.75 18.534 20.6628 19.75 19.2 19.75H4.8C3.33719 19.75 2.25 18.534 2.25 17.1527C2.25 16.191 2.70278 15.2854 3.47213 14.7084C3.91329 14.3775 4.13025 13.9531 4.24749 13.4133C4.34561 12.9615 4.3649 12.49 4.38705 11.9485V11.9485L4.38705 11.9485C4.39356 11.7893 4.40032 11.6241 4.4094 11.4516Z",fill:"#141B34"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5286 1.37434C10.9737 1.08296 11.517 1 12 1C12.483 1 13.0263 1.08296 13.4714 1.37434C13.9652 1.69759 14.25 2.22083 14.25 2.875C14.25 3.47116 14.017 4.09375 13.6626 4.57057C13.3138 5.03989 12.7415 5.5 12 5.5C11.2585 5.5 10.6862 5.03989 10.3374 4.57057C9.98299 4.09375 9.75 3.47116 9.75 2.875C9.75 2.22083 10.0348 1.69759 10.5286 1.37434Z",fill:"#141B34"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 18C9.55228 18 10 18.4477 10 19C10 20.1046 10.8954 21 12 21C13.1046 21 14 20.1046 14 19C14 18.4477 14.4477 18 15 18C15.5523 18 16 18.4477 16 19C16 21.2091 14.2091 23 12 23C9.79086 23 8 21.2091 8 19C8 18.4477 8.44772 18 9 18Z",fill:"#141B34"})]})}function ra(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:n.jsx("path",{d:"M8.85746 12.5061C6.36901 10.6456 4.59564 8.59915 3.62734 7.44867C3.3276 7.09253 3.22938 6.8319 3.17033 6.3728C2.96811 4.8008 2.86701 4.0148 3.32795 3.5074C3.7889 3 4.60404 3 6.23433 3H17.7657C19.396 3 20.2111 3 20.672 3.5074C21.133 4.0148 21.0319 4.8008 20.8297 6.37281C20.7706 6.83191 20.6724 7.09254 20.3726 7.44867C19.403 8.60062 17.6261 10.6507 15.1326 12.5135C14.907 12.6821 14.7583 12.9567 14.7307 13.2614C14.4837 15.992 14.2559 17.4876 14.1141 18.2442C13.8853 19.4657 12.1532 20.2006 11.226 20.8563C10.6741 21.2466 10.0043 20.782 9.93278 20.1778C9.79643 19.0261 9.53961 16.6864 9.25927 13.2614C9.23409 12.9539 9.08486 12.6761 8.85746 12.5061Z",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})})}const ia={n:"_n_euuvm_1"};let Ne={},De=[];const aa=(e,t)=>{switch(t.type){case"open":return{...e,open:t.open};case"view":return{...e,view:e.view===t.view?null:t.view};case"add":return{...e,news:[...e.news,t.data],active:!0};case"news":return{...e,news:t.data,active:t.data.length!==0};case"hide":let r=e.news.filter(a=>a.id!==t.id);return{...e,news:r,active:r.length!==0};case"size":return{...e,size:t.size};case"take":let i={[t.list]:t.take};i={...e.take,...i},e.active=!1;for(let a in i)i[a]!=="999"&&(e.active=!0);return Ne.get(i,e.active),{...e,take:i,active:e.active};case"exit":return e;default:throw new Error}};function oa(e){Ne.fn({action:"add",data:e})}function sa(e){Ne.fn({action:"add",data:e})}function la(e){Ne.fn({action:"new",data:e})}function da(e){Ne.fn=e}function ca(){const[e,t]=b.useReducer(aa,{open:!1,active:!1,news:[],take:{}});We.useListener("bell",async i=>{}),da(async i=>{switch(i.action){case"add":De.push(i.data);break}}),b.useEffect(()=>{(async()=>{let i=await We.Send({type:"module",module:"M00",query:"x0054",array:["M01","M02"]});for(let a in i)switch(a){case"news":t({type:"news",data:i.news});break;case"M01":i[a].forEach(o=>{De.push({module:"M01",type:1,id:o.id,datetime:new Date(o.tDate).getTime(),txt:o.p01})});break;case"M02":i[a].forEach(o=>{De.push({module:"M02",type:117,id:o.id,datetime:new Date(o.tDate).getTime(),txt:o.p01})});break}})(),setInterval(()=>{De.forEach((i,a)=>{t({type:"add",data:{module:i.module,type:i.type,id:i.id,datetime:i.datetime,txt:i.title}}),i.datetime<new Date().getTime()&&De.splice(a,1)})},6e4)},[]);let r=async i=>{t({type:"hide",id:i.id})};return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:ia.n,onClick:()=>{t({type:"open",open:!0})},children:e.active?n.jsx(na,{}):n.jsx(ta,{})}),e.open?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"notify-o",onClick:()=>{t({type:"open",open:!1})}}),n.jsxs("div",{className:"notify-m",children:[n.jsx("div",{className:"notify-l",children:e.news.map((i,a)=>n.jsx(ua,{data:i,dispatch:t},a))}),n.jsx("div",{className:"notify-b",onClick:r,children:"История"})]})]}):""]})}const ua=({data:e,dispatch:t})=>{let r=async i=>{t({type:"hide",id:i.id}),await We.Send({type:"module",module:"M00",query:"x0055",data:{id:i.id,type:i.type,db:i.db}})};return n.jsxs("div",{className:"notify-i",children:[n.jsx("div",{className:"--icon","data-icon":e.type}),n.jsxs("div",{className:"--body",children:[n.jsx("div",{className:"--name",children:e.type}),n.jsx("div",{className:"--text",children:e.txt})]}),n.jsx("div",{className:"--hide","data-icon":"F038",onClick:()=>r(e),children:" "})]})},fa="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2xldCBhPVtdLHM9bnVsbDtvbmNvbm5lY3Q9ZnVuY3Rpb24obCl7dmFyIHQ9bC5zb3VyY2U7YS5wdXNoKHQpO2NvbnN0IG49ZT0+e3MhPT1udWxsJiZzLnJlYWR5U3RhdGU9PT0xP3Muc2VuZChKU09OLnN0cmluZ2lmeShlKSk6dC5wb3N0TWVzc2FnZSh7dHlwZToibm9TZW5kIn0pfTtsZXQgcj1lPT57aWYocyE9PW51bGwmJnMucmVhZHlTdGF0ZT09PTEpcmV0dXJuIHQucG9zdE1lc3NhZ2Uoe3R5cGU6InRydWUifSk7ZS5say5hZGRyZXNzPT09ImxvY2FsaG9zdCI/cz1uZXcgV2ViU29ja2V0KGB3czovL2xvY2FsaG9zdDoke2UubGsuc29ja2V0KzF9YCk6cz1uZXcgV2ViU29ja2V0KCJ3c3M6Ly8iK2UubGsuYWRkcmVzcysiOiIrKGUubGsuc29ja2V0KzEpKSxzLm9uZXJyb3I9KCk9PnQucG9zdE1lc3NhZ2Uoe3R5cGU6ImVycm9yIn0pLHMub25vcGVuPSgpPT57bih7dHlwZToiY29ubmVjdCIsdWtleTplLnVrZXl9KX0scy5vbm1lc3NhZ2U9bz0+e2xldCBjPUpTT04ucGFyc2Uoby5kYXRhKTthLmZvckVhY2goZD0+e2QucG9zdE1lc3NhZ2UoYyl9KX0scy5vbmNsb3NlPSgpPT50LnBvc3RNZXNzYWdlKHt0eXBlOiJjbG9zZWQifSl9O3Qub25tZXNzYWdlPWZ1bmN0aW9uKGUpe3N3aXRjaChlLmRhdGEudHlwZSl7Y2FzZSJsZW5ndGgiOnJldHVybiB0LnBvc3RNZXNzYWdlKGEubGVuZ3RoKTtjYXNlImFsbCI6cmV0dXJuIGEuZm9yRWFjaChvPT5vLnBvc3RNZXNzYWdlKHthbGw6YS5sZW5ndGh9KSk7Y2FzZSJzZW5kIjpyZXR1cm4gbihlLmRhdGEuanNvbik7Y2FzZSJjb25uZWN0IjpyZXR1cm4gcihlLmRhdGEpO2RlZmF1bHQ6dC5wb3N0TWVzc2FnZSh7dHlwZToiZGVmYXVsdCIsZGF0YTplLmRhdGEuanNvbn0pfX19fSkoKTsK";function pa(e){return new SharedWorker("data:text/javascript;base64,"+fa,{name:e==null?void 0:e.name})}function xa(e){let t={},r={};e.data.forEach(a=>{t[a.id]={s:a.v,n:a.a},r[a.id]=a});let i={...he(),901:t};$t(r),Ee(i)}let ne={},Y={},qe=["filter","online","users","company","select","setting","info","job"];function ha(){const[e,t]=b.useState(!1),[r,i]=b.useState(!1);function a(o){const l=new pa;ne.laodData=d=>{let c=qe.indexOf(d);c>=0&&qe.splice(c,1),qe.length===0&&t(!0)},ne.send=d=>{l.port.postMessage({type:"send",json:d})},l.port.onmessage=d=>{let c=d.data;c.type==="error"&&i(!0),c.type==="true"&&t(!0),c.type==="closed"&&l.port.postMessage({type:"connect",ukey:o,lk:Xe()}),qe.length!==0&&ne.laodData(c.type),Y[c.type]&&Y[c.type](c)},l.port.postMessage({type:"connect",ukey:o,lk:Xe()})}return[a,e,r]}Y.module=e=>{ne[e.listen]!==void 0&&(ne[e.listen](e),delete ne[e.listen])},Y.bell=la,Y.company=xa,Y.info=e=>{let t={};t.db=e.db,t.id=e.data.id,t.job=e.data.job,t.login=e.data.login,t.name=e.data.p02,t.patronymic=e.data.p03,t.surname=e.data.p01,t.email=e.data.email,t.admin=e.data.menu.includes("99"),Nt(t),Tt(e.data.menu)},Y.version=async e=>{Re.version.Server(e.data)},Y.online=async e=>{},Y.offline=async e=>{},Y.chat=e=>{switch(e.data.action){case"new_message":se.getModule();break;case"view_message":se.getModule();break;case"write_message":se.getModule();break}},Y.users=e=>{let t={};e.data.forEach(i=>{let a=i.p01+" "+i.p02+" "+i.p03,o=i.p01+" "+i.p02.substring(0,1)+"."+i.p03.substring(0,1)+".",l=i.p01.substring(0,1)+""+i.p02.substring(0,1)+i.p03.substring(0,1);t[i.id]={id:i.id,admin:i.m.includes("99"),ava:JSON.parse(i.a),job:i.j,login:"",online:{time:i.o,status:0},sts:i.s,nameFull:a,name:o,number:l}});let r={...he(),user:t};Ee(r)},Y.api=e=>{let t={};e.data.forEach(r=>{t[r.api]={key:r.key,p01:r.p01,p02:r.p02}})},Y.delete=()=>{V()},Y.select=e=>{let t={...he()};e.data.forEach(r=>{t[r.n]=JSON.parse(r.s)}),Ee(t)},Y.job=e=>{let t={...he()},r={};Object.keys(e.data).forEach(i=>{r[i]={s:1,n:e.data[i]}}),t[1]=r,Ee(t)},Y.setting=e=>{fr(e.data)},Y.app=()=>{};const ga=(e,t)=>{ne[e]=t},ma=(e,t)=>{ne[e](t)};function _a(e){let t="_"+String(Math.random()).substring(2,7);return new Promise(r=>{ne[t]=i=>{i.error!==void 0?r({error:i.error}):r(i.data),delete ne[t]},e={...e,listen:t},e.type="modules",ne.send(e)})}const We={useConnect:ha,useListener:ga,setListener:ma,Send:_a};class ba{constructor(t="el",r="db"){jt(this,"storeName");jt(this,"_dbp");this.storeName=r,this._dbp=new Promise((i,a)=>{const o=indexedDB.open(t,1);o.onerror=()=>a(o.error),o.onsuccess=()=>i(o.result),o.onupgradeneeded=()=>{o.result.createObjectStore(r)}})}_withIDBStore(t,r){return this._dbp.then(i=>new Promise((a,o)=>{const l=i.transaction(this.storeName,t);l.oncomplete=()=>a(),l.onabort=l.onerror=()=>o(l.error),r(l.objectStore(this.storeName))}))}}let ft,O={};const je=()=>(ft||(ft=new ba),ft),xe=(e,t,r=je())=>r._withIDBStore("readwrite",i=>{O[e]=t,i.put(N.enCode(t),e)}),ae=(e,t=je())=>O[e]===void 0?new Promise((r,i)=>{let a;t._withIDBStore("readonly",o=>{a=o.get(e)}).then(()=>{if(a.result!==void 0){let o=N.deCode(a.result);O[e]=o,r(o)}else r({})})}):O[e],va=(e,t=je())=>t._withIDBStore("readwrite",r=>{r.delete(e)}),pt=(e=je())=>e._withIDBStore("readwrite",t=>{t.clear()}),ya={id:async(e,t,r)=>{let i=await ae(t);if(r!==void 0)r({type:"load",base:i});else return i[e]},get:ae,set:xe,add:async(e,t,r,i)=>{let a,o;o=await ae(r),o[e.id]=e,await xe(r,o),a!==null&&(a=await ae(t),a[e.id]=e.eDate,await xe(t,a)),i!==void 0&&i({type:"load",page:a,base:o})},del:va,upd:(e,t,r,i=je())=>{if(O[e]===void 0)return new Promise((a,o)=>{let l;i._withIDBStore("readonly",d=>{l=d.get(e)}).then(()=>{if(l.result!==void 0){let d=N.deCode(l.result);O[e]=d,O[e][t.id]={...O[e][t.id],...t.data},i.put(N.enCode(O[e]),e),a({})}else a({})})});if(O[e][t.id]!==void 0)return O[e][t.id]={...O[e][t.id],...t.data},r!==void 0&&O[r]!==void 0?O[r][t.id]!==void 0&&(O[r][t.id]=t.data.eDate):O[r]=[],delete O[e][t.id].$_item,delete O[e][t.id].$_send,i._withIDBStore("readwrite",a=>{a.put(N.enCode(O[e]),e),r!==void 0&&a.put(N.enCode(O[r]),r)})},key:(e=je())=>{const t=[];return e._withIDBStore("readonly",r=>{(r.openKeyCursor||r.openCursor).call(r).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)},load:e=>O[e],split:(e,t,r=[],i={})=>{let a=r.length!==0,o=[],l=i.sort,d=Object.keys(i).length!==0,c=Object.keys(i),u=Object.keys(e),f=[],p=x=>{let g="";if(r.forEach(v=>{g+=t[x][v]}),d){let v={};c.forEach(_=>{v[_]=t[x][_]});for(let _ in l)t[x][l[_]]===void 0&&(pt(),location.reload()),_==="s1"&&(v[_]=new Date(t[x][l[_]]).getTime()),_==="s2"&&(v[_]=t[x][l[_]]),_==="s3"&&(v[_]=t[x][l[_]].replace(/[^a-zа-яё]/gi,"").substring(0,1));o.push({id:x,text:g,...v})}else o.push({id:x,text:g})},m=x=>{};return u.forEach(x=>{f.push(t[x])}),f.forEach(x=>{x===void 0?(pt(),location.reload()):(a&&p(x.id),d&&m(x.id))}),{list:f,search:o,filter:i}},clear:pt,updAll:async(e,t,r,i)=>{let a=await ae(t),o=await ae(r);for(let l in e)o[l]=e[l],a[l]=e[l].eDate;await xe(t,a),await xe(r,o),i!==void 0&&i({type:"load",page:a,base:o})},delAll:async(e,t,r,i)=>{let a=await ae(t),o=await ae(r);e.forEach(l=>delete a[l]),await xe(t,a),i!==void 0&&i({type:"load",page:a,base:o})},delList:async(e,t,r)=>{let i=await ae(t);e.forEach(a=>delete i[a]),await xe(t,i)},addList:async(e,t,r)=>{let i=await ae(t);e.forEach(a=>i[a.id]=a.eDate),await xe(t,i)}},wa={setSetting:pr,getSetting:xr},ka={s:"_s_18bde_1",loadingB:"_loadingB_18bde_1",ul:"_ul_18bde_31"};function ja({children:e}){return n.jsx("ul",{className:H.ul,children:e})}function Ca(e,t){switch(t.type){case"load":return{...e,load:t.load,wait:!1,item:1,data:t.data,list:t.data[1],size:Object.keys(t.data).length};case"update":let r=Object.keys(e.data).length,i=e.item+1;return i=r<i?1:i,e.item===i?e:{...e,wait:e.size===i,item:i,list:[...e.list,...e.data[i]]};case"clear":return{load:!1,list:[],data:{},item:1,wait:!1,size:0};default:throw new Error}}function Sa({list:e,load:t,className:r,...i}){const a=b.useRef(null),[o,l]=b.useReducer(Ca,{load:!1,list:[],data:{},item:1,wait:!1,size:0});b.useEffect(()=>{a.current.scrollTop=0,e!==null&&l({type:"load",load:!0,data:e})},[t]);let d=()=>{a.current.scrollHeight-a.current.scrollTop-300<=a.current.clientHeight&&!o.wait&&l({type:"update"})};return n.jsx("div",{className:[ka.s,r].join(" "),ref:a,onScroll:d,children:n.jsx(ja,{"el-empty":"Данные не найдены",children:o.load&&o.list!==void 0?o.list.map(c=>n.jsx(i.item,{data:c},c.id)):n.jsxs("div",{"data-load":"load",children:[n.jsx("i",{}),n.jsx("i",{}),n.jsx("i",{})]})})})}const Ea=({label:e,onValue:t,value:r,name:i,item:a})=>{const[o,l]=b.useState(!!r);b.useEffect(()=>{l(!!r)},[r]);let d=()=>{let c=parseInt(o)===0?1:0;l(c),t({value:c,name:i,key:a,item:a})};return n.jsx("div",{role:"switch",onClick:d,"aria-checked":`${o?"true":"false"}`})},ye={};function Ba(e){const[t,r]=b.useState({}),i=b.useRef(e);ye.u=o=>{i.current={...i.current,[o.name]:o.value}},ye.r=()=>{r(Date.now())};const a=o=>{i.current[o.name]=o.value,o.reload&&ye.r()};return[i.current,a]}function Ta(e){ye.u(e),e.reload&&ye.r()}function Ia(){ye.r&&ye.r()}const $a={Color:Gt,Date:nt,Code:Ht,Check:rn,Switch:Wt,Button:Zt,Message:Ut,Generator:Yt,Captcha:Kt,Modal:it,Money:at,Month:Xt,Notes:Jt,Number:ot,Password:Qt,Phone:st,Search:en,Select:lt,Set:ut,Textarea:tn,Time:nn,Users:ct,String:dt,Form:ut,runReload:Ia,useData:Ba,setValue:Ta,Palette:Ea,Toogle:an,Group:on,Options:sn},_n={spinner:"_spinner_1ul0m_1",l:"_l_1ul0m_75",loadingB:"_loadingB_1ul0m_1"};function Na(){return n.jsx("div",{className:_n.spinner,children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 483 484",children:n.jsx("path",{d:"M264,492a22.2,22.2,0,0,0,22-22V411a22.2,22.2,0,0,0-22-22H236a22.2,22.2,0,0,0-22,22v59a22.2,22.2,0,0,0,22,22Zm74-134a23.9,23.9,0,0,0-6,16,20.35,20.35,0,0,0,6,15l42,42q7,7,16,7,10,0,16-7l20-20a20.35,20.35,0,0,0,6-15,23.9,23.9,0,0,0-6-16l-42-42q-7-7-16-7-8,0-15,7ZM163,389a18.94,18.94,0,0,0,7-15q0-9-7-16l-20-20q-7-7-16-7-8,0-15,7L70,380q-7,7-7,16a18.94,18.94,0,0,0,7,15l20,20q7,7,16,7a18.94,18.94,0,0,0,15-7ZM112,237a22.2,22.2,0,0,0-22-22H31a21.17,21.17,0,0,0-15.5,6.5A21.17,21.17,0,0,0,9,237v28a21.17,21.17,0,0,0,6.5,15.5A21.17,21.17,0,0,0,31,287H90a22.2,22.2,0,0,0,22-22Zm358,50a22.2,22.2,0,0,0,22-22V237a22.2,22.2,0,0,0-22-22H411a22.2,22.2,0,0,0-22,22v28a22.2,22.2,0,0,0,22,22ZM163,142q7-7,7-15.5T163,111L121,69q-7-7-15-7-7,0-16,7L70,89q-7,7-7,16a18.94,18.94,0,0,0,7,15l42,42a18.94,18.94,0,0,0,15,7q10,0,16-7Zm269-22a20.35,20.35,0,0,0,6-15,23.9,23.9,0,0,0-6-16L412,69q-7-7-16-7-7,0-16,7l-42,42q-7,8-7,16t7,15l21,20a18.94,18.94,0,0,0,15,7q10,0,16-7Zm-168-9a22.06,22.06,0,0,0,15.5-6q6.5-6,6.5-16V30a21.17,21.17,0,0,0-6.5-15.5A21.17,21.17,0,0,0,264,8H236a21.17,21.17,0,0,0-15.5,6.5A21.17,21.17,0,0,0,214,30V89q0,10,6.5,16a22.06,22.06,0,0,0,15.5,6Z",transform:"translate(-9 -8)"})})})}function Da(){return n.jsxs("div",{className:_n.l,children:[n.jsx("i",{}),n.jsx("i",{}),n.jsx("i",{})]})}const Ma={Spinner:Na,Inline:Da},bn={s:"_s_t9swc_1"};let xt;function za({className:e,placeholder:t}){let r=l=>{xt(l.target.textContent)},i=l=>{l.key==="Enter"&&l.preventDefault()},a=l=>{l.preventDefault(),navigator.clipboard.readText().then(d=>{window.document.execCommand("insertText",!1,d)}).catch(d=>{})};const o={};return t&&(o.placeholder=t),o.className=e?[bn.s,e].join(" "):bn.s,n.jsx("div",{onPaste:a,onInput:r,onKeyDown:i,contentEditable:"true",...o,suppressContentEditableWarning:!0})}function Fa(e,t,r){let i=[],a=1,o=0,l={},d=50;return l[a]=[],e.forEach(c=>{c.text.toLowerCase().indexOf(t)>-1&&i.push(c.id)}),i.forEach(c=>{o++,o<=d||(a++,o=1,l[a]=[]),l[a].push(r[c])}),l}function Pa(e){xt=e}function Ra(e){xt=e}const Oa={Field:za,Run:Fa,Get:Pa,useValue:Ra},La={f:"_f_q3r0i_1"};let J={};function Aa(e,t){switch(t.type){case"open":return{...e,open:t.open};case"view":return{...e,view:e.view===t.view?null:t.view};case"data":let r={};return Object.keys(t.data).forEach(a=>{a!=="sort"&&(r[a]=t.data[a],e.take[a]="999")}),{...e,data:r,take:e.take};case"size":return{...e,size:t.size};case"take":let i={[t.list]:t.take};i={...e.take,...i},e.active=!1;for(let a in i)i[a]!=="999"&&(e.active=!0);return J.get(i,e.active),{...e,take:i,active:e.active};case"exit":for(let a in e.take)e.take[a]="999";return J.get&&J.get([],!1),{...e,size:0,active:!1,take:e.take,open:!1};default:throw new Error}}function qa(){const[e,t]=b.useReducer(Aa,{open:!1,view:null,data:{},take:{},size:0,active:!1});return J.set=r=>{t({type:"data",data:r})},J.count=r=>{t({type:"size",size:r})},J.reset=()=>{t({type:"exit"})},n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:La.f,onClick:()=>{t({type:"open",open:!0})},children:[n.jsx(ra,{}),e.active&&n.jsxs("i",{children:[e.size,"1"]})]}),e.open?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"filter o",onClick:()=>{t({type:"open",open:!1})}}),n.jsxs("div",{className:"filter m",children:[n.jsx("div",{className:"filter l",children:Object.keys(e.data).map(r=>n.jsx(Ka,{data:r,dispatch:t,state:e},r))}),n.jsx("div",{className:"filter b",onClick:()=>{t({type:"exit"})},children:"Убрать фильтер"})]})]}):n.jsx(n.Fragment,{})]})}function Wa(e){J.get=e}function Za(e){J.set!==void 0&&J.set(e)}function Ua(e){J.reset!==void 0&&J.reset(e)}function Ya(e,t,r,i){let a=[],o=1,l=0,d={},c=50;return d[o]=[],i===!0&&(Object.keys(t).forEach(u=>{Number.parseInt(t[u])!==999&&(e=e.filter(f=>Number.parseInt(f[u])===Number.parseInt(t[u])))}),vn(e.length)),e.forEach(u=>{a.push(u.id)}),a.forEach(u=>{l++,l<=c||(o++,l=1,d[o]=[]),d[o].push(r[u])}),d}function vn(e){J.count(e)}function Ka({data:e,state:t,dispatch:r}){let i=()=>{r({type:"view",view:e})},a=()=>{r({type:"take",list:e,take:"999"})};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"filter s",children:[n.jsxs("div",{onClick:i,children:[" ",t.data[e].name," "]}),t.take[e]!=="999"?n.jsx("div",{onClick:a,className:"filter x","data-icon":"F038"}):""]}),n.jsx("div",{className:"filter u","set-active":(t.view===e)+"",children:Object.keys(t.data[e].list).map((o,l)=>n.jsx(Ha,{data:t.data[e].list[o],head:e,type:o,dispatch:r,state:t},l))})]})}function Ha({data:e,head:t,state:r,dispatch:i,type:a}){if(a!=="999"&&e.count===void 0)return"";const o=()=>{i({type:"take",list:t,take:a})};return n.jsxs("div",{className:"filter a",onClick:o,"set-active":(r.take[t]===a)+"",children:[e.name,n.jsx("div",{className:"filter e",children:e.count})]})}const Ga={Button:qa,useValue:Wa,Set:Za,Run:Ya,Count:vn,Reset:Ua},Va={Bell:ca,Send:sa,Add:oa};function Xa({active:e,onActive:t,id:r,name:i}){const[a,o]=b.useState(!!e);b.useEffect(()=>{o(!!e)},[e]);let l=()=>{let d=parseInt(a)===0?1:0;o(d),t&&t({value:d,name:i,id:r})};return n.jsx("div",{role:"switch",onClick:l,"aria-checked":`${a?"true":"false"}`})}const Ja={sort:"_sort_1yrvt_1"};let Ze={};function Qa(e,t){switch(t.type){case"active":let r="<";return e.active===t.data&&(r=e.sort==="<"?">":"<"),Ze.get({active:t.data,sort:r},!1),It({active:t.data,sort:r}),{...e,active:t.data,sort:r};default:throw new Error}}function eo(){const[e,t]=b.useReducer(Qa,Je()===void 0?{active:1,sort:"<"}:Je());return n.jsxs("div",{className:Ja.sort,children:[n.jsx("i",{"data-color":e.active===1?"_506290":"_b5b9cc","data-icon":e.active===1?e.sort==="<"?"F073":"F072":"F071",onClick:()=>t({type:"active",data:1})}),n.jsx("i",{"data-color":e.active===2?"_506290":"_b5b9cc","data-icon":e.active===2?e.sort==="<"?"F066":"F067":"F074",onClick:()=>t({type:"active",data:2})}),n.jsx("i",{"data-color":e.active===3?"_506290":"_b5b9cc","data-icon":e.active===3?e.sort==="<"?"F068":"F069":"F070",onClick:()=>t({type:"active",data:3})})]})}function to(e){Ze.get=e}function no(e){Ze.set(e)}function ro(e,t,r){let i=1,a=0,o={},l=50;o[i]=[];let d={},c="s1a";switch(d.s1a=(u,f)=>f.s1-u.s1,d.s1d=(u,f)=>u.s1-f.s1,d.s2a=(u,f)=>u.s2-f.s2,d.s2d=(u,f)=>f.s2-u.s2,d.s3a=(u,f)=>u.s3.localeCompare(f.s3),d.s3d=(u,f)=>f.s3.localeCompare(u.s3),r.active){case 1:c=r.sort===">"?"s1d":"s1a";break;case 2:c=r.sort===">"?"s2d":"s2a";break;case 3:c=r.sort===">"?"s3d":"s3a";break}return t.sort(d[c]).forEach(u=>{a++,a<=l||(i++,a=1,o[i]=[]),o[i].push(e[u.id])}),{data:o}}function io(e){Ze.count(e)}const ao={Init:eo,useValue:to,Set:no,Run:ro,Count:io};B.Action=cn,B.Alert=Gi,B.Api=qr,B.Button=qt,B.Component=Hi,B.DataBase=ya,B.Events=Le,B.Filter=Ga,B.Form=$a,B.Format=pe,B.Icon=ea,B.Init=Ri,B.Input=ln,B.Loading=Ma,B.Modal=rt,B.Notice=Ae,B.Notifications=Va,B.Router=se,B.Scrolling=Sa,B.Search=Oa,B.Setting=Ki,B.Sistym=Re,B.Socket=We,B.Store=oe,B.Switch=Xa,B.Tabs=dn,B.Telegram=S,B.Triage=ao,B.User=wa,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elcrm/telegram",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "description": "React framework for creating mini-apps for elCRM",
5
5
  "type": "module",
6
6
  "author": "MaSkal <dev@elcrm.online>",