PageSourceSearch

https://portal.edcompass.ru/js/124.js?1662970488

js edcompass.ru collected 2026-10-06 05:53:36 UTC 15,140 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkfront_end=self.webpackChunkfront_end||[]).push([[124],{45840:function(e){!function(n){function t(e){return window.btoa([].slice.call(new Uint8Array(e)).map((function(e){return String.fromCharCode(e)})).join(""))}e.exports=function(e,n){return"fetch"in window&&"Promise"in window?fetch(e,n||{}).then((function(e){return e.arrayBuffer()})).then(t):Promise.reject("[*] image-to-base64 is not compatible with your browser.")}}()},41124:(e,n,t)=>{t.r(n),t.d(n,{default:()=>k});var o=t(87757),r=t.n(o),a=t(67294),l=t(39704),s=(t(45840),t(94184),t(41054)),i=(t(9669),t(30514)),c=t(60878),u=t(50567),d=(t(46925),t(16282)),p=(t(19330),t(48491)),h=t(80741),f=t(85893);function g(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?g(Object(t),!0).forEach((function(n){y(e,n,t[
1n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function y(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var v={option:function(e,n){return m(m({},e),{},{borderBottom:"none",color:n.isSelected?"#fff":"#000",background:n.isSelected?"#0096fb":"#fff",padding:10})},singleValue:function(e,n){var t=n.isDisabled?.5:1;return m(m({},e),{},{opacity:t,transition:"opacity 300ms"})}},b=function(e){var n=e.callback,t=e.handleChangeVisible,o=e.handleChangeType,r=e.handleChangeText,a=e.text,p=e.visible,g=e.type,y=e.errorVisible,b=e.errorType,j=e.handleImage,x=e.images,w=e.removeImg,S=e.group,O=e.student,C=e.groups,T=e.students,_=e.handleChangeStudent,k=e.handleRemoveStudent,A=e.handleChangeGroup,P=e.handleRemoveGroup,E=e.errorGroup,L=e.errorStudent,N=e.keyboardEventsStudent,J=e.keyboardEventsGroup;(0,l.I0)(),(0,l.v9)((function(e){return m({},e.auth)})).payload;return(0,f.jsx)(s.J9,{initialValues:{visible:p,type:g,text:a},validateOnBlur:!0,onSubmit:function(e){return function(e){n({text:e.text})}(e)},validationSchema:h.jg,enableReinitialize:!0,children:function(e){var n=e.handleSubmit,a=e.handleBlur,l=e.handleChange,s=e.isValid,h=e.values,g=e.dirty;return(0,f.jsx)("form",{className:"add__news",style:{maxWidth:"500px"},children:(0,f.jsxs)("fieldset",{children:[(0,f.jsx)("span",{children:"Добавить новость"}),(0,f.jsx)(i.ZP,{className:"search-select",options:u.XC,styles:v,name:"visible",placeholder:"Кто будет видеть новость",value:h.visible,onChange:t}),y?(0,f.jsx)("p",{style:{color:"red",marginBottom:"10px"},children:"Обязательное поле"}):null,null!=p&&"class"==p.value?(0,f.jsx)(c.default,{options:C,selectedValues:S,onSelect:A,onRemove:P,onSearch:J,displayValue:"name",placeholder:"Класс",emptyRecordMsg:"Нет записей",selectionLimit:1}):null,E?(0,f.jsx)("p",{style:{color:"red",marginBottom:"10px"},children:"Обязательное поле"}):null,null!=p&&"student"==p.value?(0,f.jsx)(c.default,{options:T,selectedValues:O,onSelect:_,onRemove:k,onSearch:N,displayValue:"name",placeholder:"Ученик",emptyRecordMsg:"Нет записей",selectionLimit:1}):null,L?(0,f.jsx)("p",{style:{color:"red",marginBottom:"10px"},children:"Обязательное поле"}):null,(0,f.jsx)(i.ZP,{className:"search-select",options:u.sd,styles:v,name:"type",placeholder:"Тип новости (Событие, Питание, Объявление)",value:h.type,onChange:o}),b?(0,f.jsx)("p",{style:{color:"red",marginBottom:"10px"},children:"Обязательное поле"}):null,(0,f.jsx)(d.nv,{name:"text",as:"textarea",placeholder:"Текст новости",onChange:function(e){l(e),r(e)},onBlur:a,value:h.text}),(0,f.jsx)("div",{className:"added__list",children:x.map((function(e){return(0,f.jsxs)("div",{className:"item",id:"img-item-"+e.id,children:[(0,f.jsx)("span",{children:e.name}),(0,f.jsx)("span",{className:"remove",onClick:w,children:(0,f.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 7 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,f.jsx)("path",{d:"M6 0.5L1 5.5M1 0.5L6 5.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},e.id)}))}),(0,f.jsxs)("label",{className:"add__photo",children:[(0,f.jsx)("input",{type:"file",accept:"image/jpeg,image/png",onChange:j,onBlur:a,style:{display:"none"}}),(0,f.jsxs)("span",{className:"add__btn",children:["добавить Фото",(0,f.jsx)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,f.jsx)("path",{d:"M0.294956 1.41L4.87496 6L0.294956 10.59L1.70496 12L7.70496 6L1.70496 0L0.294956 1.41Z"})})]})]}),(0,f.jsxs)("button",{type:"submit",disabled:!g&&!s,onClick:n,children:["добавить новость",(0,f.jsx)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,f.jsx)("path",{d:"M0.294956 1.41L4.87496 6L0.294956 10.59L1.70496 12L7.70496 6L1.70496 0L0.294956 1.41Z"})})]})]})})}})};function j(e,n,t,o,r,a,l){try{var s=e[a](l),i=s.value}catch(e){return void t(e)}s.done?n(i):Promise.resolve(i).then(o,r)}function x(e){return function(){var n=this,t=arguments;return new Promise((function(o,r){var a=e.apply(n,t);function l(e){j(a,o,r,l,s,"next",e)}function s(e){j(a,o,r,l,s,"throw",e)}l(void 0)}))}}function w(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var o,r,a=[],l=!0,s=!1;try{for(t=t.call(e);!(l=(o=t.next()).done)&&(a.push(o.value),!n||a.length!==n);l=!0);}catch(e){s=!0,r=e}finally{try{l||null==t.return||t.return()}finally{if(s)throw r}}return a}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return S(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return S(e,n)}
1(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function O(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function C(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var T={all:"Для всех",students:"Для всех учеников",parallel:"Для параллели",class:"Для всех",student:"Для ученика",parents:"Только для родителей",teachers:"Только для учителей"},_={all:"#EAFFE2",students:"#EAFFE2",parallel:"#EAFFE2",class:"#F6DFEC",student:"#F6DFEC",parents:"#F6DFEC",teachers:"#F6DFEC"};const k=function(){(0,l.I0)();var e=(0,l.v9)((function(e){return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?O(Object(t),!0).forEach((function(n){C(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}({},e)})),n=e.auth,o=w((0,a.useState)(0),2),s=o[0],i=o[1],c=w((0,a.useState)([]),2),u=c[0],d=c[1],h=w((0,a.useState)(!0),2),g=(h[0],h[1],w((0,a.useState)(null),2)),m=g[0],y=g[1],v=w((0,a.useState)(null),2),j=v[0],S=v[1],k=w((0,a.useState)(!1),2),A=k[0],P=k[1],E=w((0,a.useState)(!1),2),L=E[0],N=E[1],J=w((0,a.useState)([]),2),F=J[0],R=J[1],D=w((0,a.useState)([]),2),B=D[0],G=D[1],V=w((0,a.useState)([]),2),I=V[0],Z=V[1],M=w((0,a.useState)([]),2),z=M[0],W=M[1],H=w((0,a.useState)([]),2),U=H[0],X=H[1],$=w((0,a.useState)([]),2),q=$[0],K=$[1],Q=w((0,a.useState)(!1),2),Y=Q[0],ee=Q[1],ne=w((0,a.useState)(!1),2),te=ne[0],oe=ne[1],re=w((0,a.useState)(""),2),ae=re[0],le=re[1],se=w((0,a.useState)([]),2),ie=se[0],ce=se[1];(0,a.useEffect)((function(){i(n.payload.school_id),ue(),de(n.payload.school_id),pe(n.payload.school_id)}),[]);var ue=function(){var e=x(r().mark((function e(){var o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o="".concat(t.g.HOST,"/api/news/").concat(n.payload.school_id),fetch(o,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"JWT "+n.payload.token}}).then((function(e){return e.json()})).then((function(e){if(console.log("responseJson:"),console.log(e),e.status){d(e.payload);for(var n=[],t=0;t<e.payload.length;t++)1!=e.payload[t].viewed&&n.push(e.payload[t].id);n.length>0&&he(n)}else d([])})).catch((function(e){console.log("error:"),console.log(e),d([])}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),de=function(e){var o="".concat(t.g.HOST,"/api/school/").concat(e,"/students");fetch(o,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"JWT "+n.payload.token}}).then((function(e){return e.json()})).then((function(e){if(console.log("responseJson:"),console.log(e),e.status){for(var n=[],t=0;t<e.payload.length;t++)n.push({id:e.payload[t].id,name:[e.payload[t].last_name,e.payload[t].first_name,e.payload[t].middle_name].join(" ")});W(n)}else W([])})).catch((function(e){console.log("error:"),console.log(e),W([])}))},pe=function(e){var o="".concat(t.g.HOST,"/api/school/").concat(e,"/classes");fetch(o,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"JWT "+n.payload.token}}).then((function(e){return e.json()})).then((function(e){if(console.log("responseJson:"),console.log(e),e.status){for(var n=[],t=0;t<e.payload.length;t++)n.push({id:e.payload[t].id,name:e.payload[t].name});Z(n)}else Z([])})).catch((function(e){console.log("error:"),console.log(e),Z([])}))},he=function(e){console.log("sendViewed:"),console.log(e);var o="".concat(t.g.HOST,"/api/news/view");fetch(o,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"JWT "+n.payload.token},body:JSON.stringify({id:e})}).then((function(e){return e.json()})).then((function(e){console.log("responseJson:"),console.log(e)})).catch((function(e){console.log("error:"),console.log(e)}))},fe=function(e){return T[e]},ge=function(){var e=x(r().mark((function e(n){var t,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{console.log(n.target.files),t=n.target.files[0],(
1o=new FileReader).readAsDataURL(t),o.onload=function(e){me(e.target.result,n.target.files[0].name)}}catch(e){(0,p.Z)({type:"error",title:"",message:"Ошибка загрузки"})}case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),me=function(e,o){var r="".concat(t.g.HOST,"/api/news/image");fetch(r,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"JWT "+n.payload.token},body:JSON.stringify({name:o,file:e})}).then((function(e){return e.json()})).then((function(e){if(console.log("responseJson:"),console.log(e),e.status){var n=Array.from(ie);n.push({id:e.payload.id,name:e.payload.name}),ce(n)}else(0,p.Z)({type:"error",title:"",message:e.message})})).catch((function(e){console.log("error:"),console.log(e),(0,p.Z)({type:"error",title:"",message:"Не удалось загрузить файл"})}))};return(0,f.jsxs)("main",{className:"news__page",children:[(0,f.jsx)("div",{className:"main__head",children:(0,f.jsx)("h1",{children:"Новости"})}),(0,f.jsxs)("div",{className:"main__body",children:[(0,f.jsx)("div",{className:"news__list",children:u.map((function(e){return(0,f.jsxs)("div",{className:"news__item forAll "+(1!=e.viewed?"new":""),children:[(0,f.jsxs)("div",{className:"info__box",children:[(0,f.jsx)("time",{children:e.created}),(0,f.jsx)("span",{className:"forMark",style:{background:(n=e.type,_[n])},children:fe(e.type)})]}),(0,f.jsx)("p",{children:e.message})]},e.id);var n}))}),(0,f.jsx)(b,{callback:function(e){console.log("callback:"),console.log(e),console.log("visible:"),console.log(m);var o=0,r=0,a=!1;if(null==m?(a=!0,P(!0)):P(!1),null==j?(a=!0,N(!0)):N(!1),ee(!1),"class"==m.value&&U.length<1&&(a=!0,ee(!0)),oe(!1),"student"==m.value&&q.length<1&&(a=!0,oe(!0)),!a){console.log("visible:"),console.log(m),console.log("type:"),console.log(j);for(var l=[],i=0;i<ie.length;i++)l.push(ie[i].id);o=0,r=0;"class"==m.value?o=U[0].id:"student"==m.value&&(r=q[0].id);var c="".concat(t.g.HOST,"/api/news/").concat(s,"/add");fetch(c,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"JWT "+n.payload.token},body:JSON.stringify({type:j.value,visibility:m.value,class_id:o,student_id:r,text:e.text,imgs:l})}).then((function(e){return e.json()})).then((function(e){if(console.log("responseJson:"),console.log(e),e.status){ce([]),y(null),S(null),le(""),R([]),G([]),ee(!1),oe(!1);var n=[];n.push(e.payload);for(var t=0;t<u.length;t++)n.push(u[t]);d(n)}else(0,p.Z)({type:"error",title:"",message:e.message})})).catch((function(e){console.log("error:"),console.log(e),(0,p.Z)({type:"error",title:"",message:"Не удалось добавить новость"})}))}},handleChangeVisible:function(e){y(e),P(!1),ee(!1),oe(!1),X([]),K([])},handleChangeType:function(e){S(e),N(!1)},text:ae,handleChangeText:function(e){le(e.target.value)},visible:m,type:j,errorVisible:A,errorType:L,handleImage:ge,images:ie,removeImg:function(e){var n=e.target.closest(".item").getAttribute("id").split("-");n=n[2];for(var t=[],o=0;o<ie.length;o++)ie[o].id!=n&&t.push(ie[o]);ce(t)},group:U,student:q,groups:F,students:B,handleChangeStudent:function(e,n){console.log("handleChangeStudent:"),console.log(n),K([n])},handleChangeGroup:function(e,n){console.log("handleChangeGroup:"),console.log(n),X([n])},handleRemoveStudent:function(e,n){console.log("handleRemoveStudent:"),console.log(n);var t=Array.from(q);t=t.filter((function(e){return e.id!=n.id})),K(t)},handleRemoveGroup:function(e,n){console.log("handleRemoveGroup:"),console.log(n);var t=Array.from(U);t=t.filter((function(e){return e.id!=n.id})),X(t)},errorGroup:Y,errorStudent:te,keyboardEventsStudent:function(e){var n=[];if(e.length>1)for(var t=e.replace("(","\\(").replace(")","\\)").replace("[","\\[").replace("]","\\]").replace("/","\\/").replace("-","\\-"),o=new RegExp(t,"i"),r=0;r<z.length;r++)-1!=z[r].name.search(o)&&n.push(z[r]);G(n)},keyboardEventsGroup:function(e){var n=[];if(e.length>1)for(var t=e.replace("(","\\(").replace(")","\\)").replace("[","\\[").replace("]","\\]").replace("/","\\/").replace("-","\\-"),o=new RegExp(t,"i"),r=0;r<I.length;r++)-1!=I[r].name.search(o)&&n.push(I[r]);R(n)}})]})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.