szdl-utils-kit 0.2.9 → 0.2.11

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.js CHANGED
@@ -1072,7 +1072,7 @@ class re {
1072
1072
  duration: 5e3,
1073
1073
  action: () => A.play()
1074
1074
  });
1075
- }), A.style.position = "fixed", A.style.left = -9999, document.querySelector("body").append(A), A.play();
1075
+ }), A.style.position = "fixed", A.style.left = "-9999px", document.querySelector("body").append(A), A.play();
1076
1076
  }
1077
1077
  }
1078
1078
  At = new WeakMap();
@@ -1276,6 +1276,7 @@ class Ee {
1276
1276
  * params: any;
1277
1277
  * updateList: {
1278
1278
  * method: string,
1279
+ * name: string,
1279
1280
  * list: {
1280
1281
  * id: string | number,
1281
1282
  * fields: { [key: string]: string | number | string[] | number[] }
@@ -1285,7 +1286,7 @@ class Ee {
1285
1286
  call({ method: A, params: e, updateList: n }) {
1286
1287
  let i = U.start({
1287
1288
  type: "call",
1288
- data: { method: A, params: e, updateList: n }
1289
+ data: { action, method: A, params: e, updateList: n }
1289
1290
  });
1290
1291
  return new Promise((c) => {
1291
1292
  e || (e = {}), BX24.callMethod(A, e, function(l) {
@@ -1315,13 +1316,16 @@ class Ee {
1315
1316
  /**
1316
1317
  * @param commandList - объект/массив команд
1317
1318
  * @param progressCall - callback(data), в data приходят данные о загрузке данных
1318
- * @param {{ updateList: {
1319
- * method: string,
1320
- * list: {
1321
- * id: string | number,
1322
- * fields: { [key: string]: string | number | string[] | number[] }
1319
+ * @param {{
1320
+ * updateList: {
1321
+ * method: string,
1322
+ * name: string,
1323
+ * list: {
1324
+ * id: string | number,
1325
+ * fields: { [key: string]: string | number | string[] | number[] }
1326
+ * }[]
1323
1327
  * }[]
1324
- * }[] }}
1328
+ * }}
1325
1329
  */
1326
1330
  async batch(A, e, { updateList: n, errorCall: i } = {}) {
1327
1331
  let c = new x(BX24.callBatch), l = U.start({
@@ -1,2 +1,2 @@
1
1
  var ye=Object.defineProperty;var de=(d,E,L)=>E in d?ye(d,E,{enumerable:!0,configurable:!0,writable:!0,value:L}):d[E]=L;var J=(d,E,L)=>(de(d,typeof E!="symbol"?E+"":E,L),L),Zt=(d,E,L)=>{if(!E.has(d))throw TypeError("Cannot "+L)};var h=(d,E,L)=>(Zt(d,E,"read from private field"),L?L.call(d):E.get(d)),N=(d,E,L)=>{if(E.has(d))throw TypeError("Cannot add the same private member more than once");E instanceof WeakSet?E.add(d):E.set(d,L)},R=(d,E,L,ot)=>(Zt(d,E,"write to private field"),ot?ot.call(d,L):E.set(d,L),L);var _=(d,E,L)=>(Zt(d,E,"access private method"),L);(function(d,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(d=typeof globalThis<"u"?globalThis:d||self,E(d["szdl-utils-kit"]={}))})(this,function(d){var K,lt,q,B,j,v,$,U,Z,Ht,tt,F,et,At,ht,kt,ut,Vt,mt,zt,ft,Kt,Nt,qt,_t,vt,Dt,ne,Yt,oe,Ot,$t,yt,te,dt,ee,at,Xt,Et,Ae,Bt,he,st,pt,ct,xt,Tt,se,rt,k,V,It,it,gt,Ut,ae,Rt,re,Gt,ce,wt,le,Ct,ue,Ft,me,Pt,fe;"use strict";var E=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function L(w){return w&&w.__esModule&&Object.prototype.hasOwnProperty.call(w,"default")?w.default:w}var ot={exports:{}};(function(w,r){(function(e){Array.prototype.indexOf||(Array.prototype.indexOf=function(t,A){var o,a;for(o=A||0,a=this.length;o<a;o+=1)if(this[o]===t)return o;return-1});var n=this,i=function(t,A){for(var o=t.toString();o.length<A;)o="0"+o;return o},c=function(t,A){return A!==e?(t.year(A.year()||A.year),t.month(A.month()||A.month),t.day(A.day()||A.day),t.hours(A.hours()||A.hours),t.minutes(A.minutes()||A.minutes),t.seconds(A.seconds()||A.seconds),t.milliseconds(A.milliseconds()||A.milliseconds),t):e},l=function(t,A){var o,a="";return o=t.slice(A,A+1),o!==""&&!isNaN(Number(o))&&(a+="%H"),o=t.charAt(A+2),o!==""&&o===":"&&(a+=o),o=t.slice(A+3,A+4),o!==""&&!isNaN(Number(o))&&(a+="%M"),o=t.charAt(A+5),o!==""&&o===":"&&(a+=o),o=t.slice(A+6,A+7),o!==""&&!isNaN(Number(o))&&(a+="%S"),a},O=function(t,A){var o,a=[t.slice(A,A+1),t.charAt(A+2),t.slice(A+3,A+4),t.charAt(A+5),t.slice(A+6,A+9)],p;return!isNaN(Number(a[0]))&&!isNaN(Number(a[2]))&&!isNaN(Number(a[4]))?(a[1]==="."&&a[3]==="."?o="%d.%m.%Y":a[1]==="-"&&a[3]==="-"?o="%m-%d-%Y":a[1]==="/"&&a[3]==="/"&&(o="%m/%d/%Y"),o):(p=[t.slice(A,A+3),t.charAt(A+4),t.slice(A+5,A+6),t.charAt(A+7),t.slice(A+8,A+9)],!isNaN(Number(p[0]))&&!isNaN(Number(p[2]))&&!isNaN(Number(p[4]))?(p[1]==="-"&&p[3]==="-"&&(o="%Y-%m-%d"),o):"")},m=n.tempus,s,T,M=n.navigator||{},u="en",f={en:{JANUARY_SHORT:"Jan",FEBRUARY_SHORT:"Feb",MARCH_SHORT:"Mar",APRIL_SHORT:"Apr",MAY_SHORT:"May",JUNE_SHORT:"Jun",JULY_SHORT:"Jul",AUGUST_SHORT:"Aug",SEPTEMBER_SHORT:"Sep",OCTOBER_SHORT:"Oct",NOVEMBER_SHORT:"Nov",DECEMBER_SHORT:"Dec",JANUARY_LONG:"January",FEBRUARY_LONG:"February",MARCH_LONG:"March",APRIL_LONG:"April",MAY_LONG:"May",JUNE_LONG:"June",JULY_LONG:"July",AUGUST_LONG:"August",SEPTEMBER_LONG:"September",OCTOBER_LONG:"October",NOVEMBER_LONG:"November",DECEMBER_LONG:"December",SUNDAY_SHORT:"Sun",MONDAY_SHORT:"Mon",TUESDAY_SHORT:"Tue",WEDNESDAY_SHORT:"Wed",THURSDAY_SHORT:"Thu",FRIDAY_SHORT:"Fri",SATURDAY_SHORT:"Sat",SUNDAY_LONG:"Sunday",MONDAY_LONG:"Monday",TUESDAY_LONG:"Tuesday",WEDNESDAY_LONG:"Wednesday",THURSDAY_LONG:"Thursday",FRIDAY_LONG:"Friday",SATURDAY_LONG:"Saturday"},ru:{JANUARY_SHORT:"Янв",FEBRUARY_SHORT:"Фев",MARCH_SHORT:"Мар",APRIL_SHORT:"Апр",MAY_SHORT:"Май",JUNE_SHORT:"Июн",JULY_SHORT:"Июл",AUGUST_SHORT:"Авг",SEPTEMBER_SHORT:"Сен",OCTOBER_SHORT:"Окт",NOVEMBER_SHORT:"Ноя",DECEMBER_SHORT:"Дек",JANUARY_LONG:"Январь",FEBRUARY_LONG:"Февраль",MARCH_LONG:"Март",APRIL_LONG:"Апрель",MAY_LONG:"Май",JUNE_LONG:"Июнь",JULY_LONG:"Июль",AUGUST_LONG:"Август",SEPTEMBER_LONG:"Сентябрь",OCTOBER_LONG:"Октябрь",NOVEMBER_LONG:"Ноябрь",DECEMBER_LONG:"Декабрь",SUNDAY_SHORT:"Вс",MONDAY_SHORT:"Пн",TUESDAY_SHORT:"Вт",WEDNESDAY_SHORT:"Ср",THURSDAY_SHORT:"Чт",FRIDAY_SHORT:"Пт",SATURDAY_SHORT:"Сб",SUNDAY_LONG:"Воскресенье",MONDAY_LONG:"Понедельник",TUESDAY_LONG:"Вторник",WEDNESDAY_LONG:"Среда",THURSDAY_LONG:"Четверг",FRIDAY_LONG:"Пятница",SATURDAY_LONG:"Суббота"},ua:{JANUARY_SHORT:"Січ",FEBRUARY_SHORT:"Лют",MARCH_SHORT:"Берез",APRIL_SHORT:"Квіт",MAY_SHORT:"Трав",JUNE_SHORT:"Черв",JULY_SHORT:"Лип",AUGUST_SHORT:"Серп",SEPTEMBER_SHORT:"Верес",OCTOBER_SHORT:"Жовт",NOVEMBER_SHORT:"Листоп",DECEMBER_SHORT:"Груд",JANUARY_LONG:"Січень",FEBRUARY_LONG:"Лютий",MARCH_LONG:"Березень",APRIL_LONG:"Квітень",MAY_LONG:"Травень",JUNE_LONG:"Червень",JULY_LONG:"Липень",AUGUST_LONG:"Серпень",SEPTEMBER_LONG:"Вересень",OCTOBER_LONG:"Жовтень",NOVEMBER_LONG:"Листопад",DECEMBER_LONG:"Грудень",SUNDAY_SHORT:"Нд",MONDAY_SHORT:"Пн",TUESDAY_SHORT:"Вт",WEDNESDAY_SHORT:"Ср",THURSDAY_SHORT:"Чт",FRIDAY_SHORT:"Пт",SATURDAY_SHORT:"Сб",SUNDAY_LONG:"Неділя",MONDAY_LONG:"Понеділок",TUESDAY_LONG:"Вівторок",WEDNESDAY_LONG:"Середа",THURSDAY_LONG:"Четвер",FRIDAY_LONG:"П’ятниця",SATURDAY_LONG:"Субота"},de:{JANUARY_SHORT:"Jan",FEBRUARY_SHORT:"Feb",MARCH_SHORT:"März",APRIL_SHORT:"Apr",MAY_SHORT:"Mai",JUNE_SHORT:"Juni",JULY_SHORT:"Juli",AUGUST_SHORT:"Aug",SEPTEMBER_SHORT:"Sept",OCTOBER_SHORT:"Okt",NOVEMBER_SHORT:"Nov",DECEMBER_SHORT:"Dez",JANUARY_LONG:"Januar",FEBRUARY_LONG:"Februar",MARCH_LONG:"März",APRIL_LONG:"April",MAY_LONG:"Mai",JUNE_LONG:"Juni",JULY_LONG:"Juli",AUGUST_LONG:"August",SEPTEMBER_LONG:"September",OCTOBER_LONG:"Oktober",NOVEMBER_LONG:"November",DECEMBER_LONG:"Dezember",SUNDAY_SHORT:"So",MONDAY_SHORT:"Mo",TUESDAY_SHORT:"Di",WEDNESDAY_SHORT:"Mi",THURSDAY_SHORT:"Do",FRIDAY_SHORT:"Fr",SATURDAY_SHORT:"Sa",SUNDAY_LONG:"Sonntag",MONDAY_LONG:"Montag",TUESDAY_LONG:"Dienstag",WEDNESDAY_LONG:"Mittwoch",THURSDAY_LONG:"Donnerstag",FRIDAY_LONG:"Freitag",SATURDAY_LONG:"Samstag"}},P=function(){return[f[u].JANUARY_LONG,f[u].FEBRUARY_LONG,f[u].MARCH_LONG,f[u].APRIL_LONG,f[u].MAY_LONG,f[u].JUNE_LONG,f[u].JULY_LONG,f[u].AUGUST_LONG,f[u].SEPTEMBER_LONG,f[u].OCTOBER_LONG,f[u].NOVEMBER_LONG,f[u].DECEMBER_LONG]},St=function(){return[f[u].JANUARY_SHORT,f[u].FEBRUARY_SHORT,f[u].MARCH_SHORT,f[u].APRIL_SHORT,f[u].MAY_SHORT,f[u].JUNE_SHORT,f[u].JULY_SHORT,f[u].AUGUST_SHORT,f[u].SEPTEMBER_SHORT,f[u].OCTOBER_SHORT,f[u].NOVEMBER_SHORT,f[u].DECEMBER_SHORT]},nt=function(){return[f[u].SUNDAY_LONG,f[u].MONDAY_LONG,f[u].TUESDAY_LONG,f[u].WEDNESDAY_LONG,f[u].THURSDAY_LONG,f[u].FRIDAY_LONG,f[u].SATURDAY_LONG]},Q=function(){return[f[u].SUNDAY_SHORT,f[u].MONDAY_SHORT,f[u].TUESDAY_SHORT,f[u].WEDNESDAY_SHORT,f[u].THURSDAY_SHORT,f[u].FRIDAY_SHORT,f[u].SATURDAY_SHORT]},X,Wt,Mt,Lt,Oe=function(t,A,o){var a;n.XMLHttpRequest?a=new XMLHttpRequest:a=new ActiveXObject("Microsoft.XMLHTTP"),a.onreadystatechange=function(){a.readyState===4&&(a.status===200?A&&(n.JSON===e?alert(`Please, include json2 into your project if you want use old browsers!
2
- https://github.com/douglascrockford/JSON-js/blob/master/json2.js`):A(JSON.parse(a.responseText))):o&&o(a))},a.open("GET",t,!1),a.send()},C={"%d":{format:function(t){return i(t.day()||s.MIN_DAY,2)},parse:function(t){var A=Number(t);return{day:isNaN(A)?e:A}},minLength:2,maxLength:2,type:"number"},"%m":{format:function(t){return i(t.month()||s.MIN_MONTH,2)},parse:function(t){var A=Number(t);return{month:isNaN(A)?e:A}},minLength:2,maxLength:2,type:"number"},"%Y":{format:function(t){return i(t.year()||s.MIN_YEAR,4)},parse:function(t){var A=Number(t);return{year:isNaN(A)?e:A}},minLength:4,maxLength:4,type:"number"},"%w":{format:function(t){return t.dayOfWeek()||s.MIN_DAY_OF_WEEK},parse:function(){return{}},minLength:1,maxLength:1,type:"number"},"%a":{format:function(t){var A=t.dayOfWeek();return Lt[A!==e?A:s.MIN_DAY_OF_WEEK]},parse:function(){return{}},minLength:1,maxLength:999,type:"word"},"%A":{format:function(t){var A=t.dayOfWeek();return Mt[A!==e?A:s.MIN_DAY_OF_WEEK]},parse:function(){return{}},minLength:1,maxLength:999,type:"word"},"%b":{format:function(t){var A=s.options("monthFromZero")?t.month():t.month()-1;return Wt[A!==e?A:s.MIN_MONTH]},parse:function(t){var A=s.monthNames().indexOf(t)+(s.options("monthFromZero")?0:1);return{month:A!==-1?A:e}},minLength:1,maxLength:999,type:"word"},"%B":{format:function(t){var A=s.options("monthFromZero")?t.month():t.month()-1;return X[A!==e?A:s.MIN_MONTH]},parse:function(t){var A=s.monthNames(!0).indexOf(t)+(s.options("monthFromZero")?0:1);return{month:A!==-1?A:e}},minLength:1,maxLength:999,type:"word"},"%H":{format:function(t){return i(t.hours()||s.MIN_HOURS,2)},parse:function(t){var A=Number(t);return{hours:isNaN(A)?e:A}},minLength:2,maxLength:2,type:"number"},"%M":{format:function(t){return i(t.minutes()||s.MIN_MINUTES,2)},parse:function(t){var A=Number(t);return{minutes:isNaN(A)?e:A}},minLength:2,maxLength:2,type:"number"},"%S":{format:function(t){return i(t.seconds()||s.MIN_SECONDS,2)},parse:function(t){var A=Number(t);return{seconds:isNaN(A)?e:A}},minLength:2,maxLength:2,type:"number"},"%s":{format:function(t){return t.timestamp()},parse:function(t){return isNaN(Number(t))?{}:s(Number(t)).get()},minLength:1,maxLength:20,type:"number"},"%F":{format:function(t){return i(t.year()||s.MIN_YEAR,4)+"-"+i(t.month()||s.MIN_MONTH,2)+"-"+i(t.day()||s.MIN_DAY,2)},parse:function(t){var A=Number(t.slice(0,4)),o=Number(t.slice(5,7)),a=Number(t.slice(8,10));return{year:A,month:o,day:a}},minLength:10,maxLength:10,type:"string"},"%D":{format:function(t){return i(t.month()||s.MIN_MONTH,2)+"/"+i(t.day()||s.MIN_DAY,2)+"/"+i(t.year()||s.MIN_YEAR,4)},parse:function(t){var A=Number(t.slice(0,2)),o=Number(t.slice(3,5)),a=Number(t.slice(6,10));return{year:a,month:A,day:o}},minLength:10,maxLength:10,type:"string"}},Jt={useMilliseconds:!1,monthFromZero:!1},g;g=function(t,A,o){return this._d=new Date,this._i={year:!1,month:!1,day:!1,hours:!1,minutes:!1,seconds:!1,milliseconds:!1},t!==e&&this.set(t,A,o),this},g.fn=g.prototype,g.fn.dayCount=function(){var t=this.month(),A=s.MAX_DAY_IN_MONTHS[t-(s.options("monthFromZero")?0:1)];return this.leapYear()&&t===(s.options("monthFromZero")?1:2)&&(A+=1),A},g.fn.year=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_YEAR&&Number(t)<=s.MAX_YEAR?(this._d.setFullYear(Number(t)),this._i.year=!1):this._i.year=Number(t):(this._d.setFullYear(s.MIN_YEAR),this._i.year=!1);else return this._i.year===!1?this._d.getFullYear():this._i.year;return this},g.fn.month=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_MONTH&&Number(t)<=s.MAX_MONTH?(this._d.setMonth(s.options("monthFromZero")?Number(t):Number(t)-1),this._i.month=!1):this._i.month=Number(t):(this._d.setMonth(s.options("monthFromZero")?s.MIN_MONTH:s.MIN_MONTH-1),this._i.month=!1);else return this._i.month===!1?s.options("monthFromZero")?this._d.getMonth():this._d.getMonth()+1:this._i.month;return this},g.fn.day=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_DAY&&Number(t)<=this.dayCount()?(this._d.setDate(Number(t)),this._i.day=!1):this._i.day=Number(t):(this._d.setDate(s.MIN_DAY),this._i.day=!1);else return this._i.day===!1?this._d.getDate():this._i.day;return this},g.fn.hours=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_HOURS&&Number(t)<=s.MAX_HOURS?(this._d.setHours(Number(t)),this._i.hours=!1):this._i.hours=Number(t):(this._d.setHours(s.MIN_HOURS),this._i.hours=!1);else return this._i.hours===!1?this._d.getHours():this._i.hours;return this},g.fn.minutes=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_MINUTES&&Number(t)<=s.MAX_MINUTES?(this._d.setMinutes(Number(t)),this._i.minutes=!1):this._i.minutes=Number(t):(this._d.setMinutes(s.MIN_MINUTES),this._i.minutes=!1);else return this._i.minutes===!1?this._d.getMinutes():this._i.minutes;return this},g.fn.seconds=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_SECONDS&&Number(t)<=s.MAX_SECONDS?(this._d.setSeconds(Number(t)),this._i.seconds=!1):this._i.seconds=Number(t):(this._d.setSeconds(s.MIN_SECONDS),this._i.seconds=!1);else return this._i.seconds===!1?this._d.getSeconds():this._i.seconds;return this},g.fn.milliseconds=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_MILLISECONDS&&Number(t)<=s.MAX_MILLISECONDS?(this._d.setMilliseconds(Number(t)),this._i.milliseconds=!1):this._i.milliseconds=Number(t):(this._d.setMilliseconds(s.MIN_MILLISECONDS),this._i.milliseconds=!1);else return this._i.milliseconds===!1?this._d.getMilliseconds():this._i.milliseconds;return this},g.fn.week=function(){var t=new Date(this.year(),0,1),A=s(this.utc()).hours(0).minutes(0).seconds(0).milliseconds(0).utc()*1e3;return Math.ceil(((A-t.getTime())/864e5+t.getDay()+1)/7)},g.fn.set=function(t,A,o){if(this._i={year:!1,month:!1,day:!1,hours:!1,minutes:!1,seconds:!1,milliseconds:!1},t===e)return this._d=new Date,this;if(t instanceof Date)return this._d=t,this;if(typeof t=="number")return this._d=new Date(t*(s.options("useMilliseconds")?1:1e3)),this;if(typeof t=="object"&&(t instanceof Array?(this.day(s.MIN_DAY),this.year(t[0]),this.month(t[1]),this.day(t[2]),this.hours(t[3]),this.minutes(t[4]),this.seconds(t[5]),this.milliseconds(t[6])):(this.day(s.MIN_DAY),this.year(t.year),this.month(t.month),this.day(t.day),this.hours(t.hours),this.minutes(t.minutes),this.seconds(t.seconds),this.milliseconds(t.milliseconds))),typeof t=="string"){var a,p=[],y,S,z=[],Y=0,I=0,b,W,H={},D;if(t===e)return y=c(this,o),y===e&&(this._i={year:-1,month:-1,day:-1,hours:-1,minutes:-1,seconds:-1,milliseconds:-1}),y;for(A===e&&(A=s.detectFormat(t));Y<A.length;){if(A.charAt(Y)==="%"){if(S=A.charAt(Y)+A.charAt(Y+1),C[S]!==e){switch(b=0,W="",C[S].type){case"number":for(;b<C[S].maxLength&&I+b<t.length&&!isNaN(Number(t.charAt(I+b)));)W+=t.charAt(I+b),b+=1;break;case"word":for(;b<C[S].maxLength&&I+b<t.length&&/^[\u00BF-\u1FFF\u2C00-\uD7FF\w]+$/.test(t.charAt(I+b));)W+=t.charAt(I+b),b+=1;break;case"string":for(;b<C[S].maxLength&&I+b<t.length;)W+=t.charAt(I+b),b+=1;break}if(b<C[S].minLength)return y=c(this,o),y===e&&(this._i={year:-1,month:-1,day:-1,hours:-1,minutes:-1,seconds:-1,milliseconds:-1}),y;p.push(S),z.push(W),b-=1,I+=b,Y+=1}}else if(t.charAt(I)!==A.charAt(Y))return y=c(this,o),y===e&&(this._i={year:-1,month:-1,day:-1,hours:-1,minutes:-1,seconds:-1,milliseconds:-1}),y;Y+=1,I+=1}for(a in p)p.hasOwnProperty(a)&&C.hasOwnProperty(p[a])&&(D=C[p[a]].parse(z[a]),H={year:D.year!==e?D.year:H.year,month:D.month!==e?D.month:H.month,day:D.day!==e?D.day:H.day,hours:D.hours!==e?D.hours:H.hours,minutes:D.minutes!==e?D.minutes:H.minutes,seconds:D.seconds!==e?D.seconds:H.seconds});this.day(s.MIN_DAY),this.year(H.year),this.month(H.month),this.day(H.day),this.hours(H.hours),this.minutes(H.minutes),this.seconds(H.seconds),this.milliseconds(H.milliseconds)}return this},g.fn.leapYear=function(){var t=this.year();return t%4===0?t%100===0?t%400===0:!0:!1},g.fn.timestamp=function(t){return arguments.length!==0?(this._d=new Date(Number(t)*(s.options("useMilliseconds")?1:1e3)+this._d.getTimezoneOffset()*6e4),this):s.options("useMilliseconds")?this._d.getTime()-this._d.getTimezoneOffset()*6e4:Math.floor(this._d.getTime()/1e3)-this._d.getTimezoneOffset()*60},g.fn.utc=function(t){return arguments.length!==0?(this._d=new Date(Number(t)*(s.options("useMilliseconds")?1:1e3)),this):s.options("useMilliseconds")?this._d.getTime():Math.floor(this._d.getTime()/1e3)},g.fn.dayOfWeek=function(t){if(t==="long")return Mt[this._d.getDay()];if(t==="short")return Lt[this._d.getDay()];if(t===e)return this._d.getDay();if(t===0||t==="Sunday")return this.calc({day:-this.dayOfWeek()});if(t===1||t==="Monday")return this.calc({day:(this.dayOfWeek()===0?-6:1)-this.dayOfWeek()});if(t===2||t==="Tuesday")return this.calc({day:(this.dayOfWeek()===0?-5:2)-this.dayOfWeek()});if(t===3||t==="Wednesday")return this.calc({day:(this.dayOfWeek()===0?-4:3)-this.dayOfWeek()});if(t===4||t==="Thursday")return this.calc({day:(this.dayOfWeek()===0?-3:4)-this.dayOfWeek()});if(t===5||t==="Friday")return this.calc({day:(this.dayOfWeek()===0?-2:5)-this.dayOfWeek()});if(t===6||t==="Saturday")return this.calc({day:(this.dayOfWeek()===0?-1:6)-this.dayOfWeek()})},g.fn.timezone=function(t){switch(t){case"hours":return Math.floor(this._d.getTimezoneOffset()/60);case"minutes":return this._d.getTimezoneOffset();default:return this._d.getTimezoneOffset()*60}},g.fn.get=function(t){switch(t){case"Date":return new Date(this.year(),this.month()-(s.options("monthFromZero")?0:1),this.day(),this.hours(),this.minutes(),this.seconds(),this.milliseconds());case"DateUTC":return new Date(Date.UTC(this.year(),this.month()-(s.options("monthFromZero")?0:1),this.day(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()));case"Array":return[this.year(),this.month(),this.day(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()];default:return{year:this.year(),month:this.month(),week:this.week(),day:this.day(),hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds(),utc:this.utc(),dayOfWeek:this.dayOfWeek(),dayOfWeekShort:this.dayOfWeek("short"),dayOfWeekLong:this.dayOfWeek("long"),timestamp:this.timestamp()}}},g.fn.format=function(t){for(var A=0,o="",a;A<t.length;)t.charAt(A)==="%"?(a=t.charAt(A)+t.charAt(A+1),C[a]!==e?(o+=C[a].format(this),A+=1):o+="%"):o+=t.charAt(A),A+=1;return o},g.fn.valid=function(){return this._i.year===!1&&this._i.month===!1&&this._i.day===!1&&this._i.hours===!1&&this._i.minutes===!1&&this._i.seconds===!1&&this._i.milliseconds===!1},g.fn.errors=function(){return this._i},g.fn.between=function(t,A){var o=this.timestamp(),a=t.timestamp();switch(A){case"year":return Math.floor((a-o)/31556952);case"month":return Math.floor((a-o)/2629746);case"day":return Math.floor((a-o)/86400);case"hours":return Math.floor((a-o)/3600);case"minutes":return Math.floor((a-o)/60);case"seconds":return a-o;default:return e}},g.fn.calc=function(t){return t.year!==e&&this._d.setFullYear(this._d.getFullYear()+t.year),t.month!==e&&this._d.setMonth(this._d.getMonth()+t.month),t.day!==e&&this._d.setDate(this._d.getDate()+t.day),t.hours!==e&&this._d.setHours(this._d.getHours()+t.hours),t.minutes!==e&&this._d.setMinutes(this._d.getMinutes()+t.minutes),t.seconds!==e&&this._d.setSeconds(this._d.getSeconds()+t.seconds),t.milliseconds!==e&&this._d.setMilliseconds(this._d.getMilliseconds()+t.milliseconds),this},s=function(t,A,o){return new g(t,A,o)},s.MIN_YEAR=1e3,s.MAX_YEAR=3e3,s.MIN_MONTH=1,s.MAX_MONTH=12,s.MIN_DAY=1,s.MAX_DAY_IN_MONTHS=[31,28,31,30,31,30,31,31,30,31,30,31],s.MIN_DAY_OF_WEEK=0,s.MAX_DAY_OF_WEEK=6,s.MIN_HOURS=0,s.MAX_HOURS=23,s.MIN_MINUTES=0,s.MAX_MINUTES=59,s.MIN_SECONDS=0,s.MAX_SECONDS=59,s.MIN_MILLISECONDS=0,s.MAX_MILLISECONDS=999,s.VERSION="0.2.18",s.options=function(t,A){if(t===e)return Jt;if(Jt.hasOwnProperty(t)){if(A===e)return Jt[t];Jt[t]=A,t==="monthFromZero"&&(s.MIN_MONTH=A?0:1,s.MAX_MONTH=A?11:12)}return e},s.noConflict=function(){return n.tempus=m,s},s.generate=function(t){var A,o,a,p,y,S,z,Y;if(typeof t.dateFrom!="number"&&(t.dateFrom instanceof g?A=t.dateFrom.utc():A=s(t.dateFrom,t.formatFrom).utc()),typeof t.dateTo!="number"&&(t.dateTo instanceof g?o=t.dateTo.utc():o=s(t.dateTo,t.formatTo!==e?t.formatTo:t.formatFrom).utc()),typeof t.period=="number"?y={year:0,month:0,day:0,hours:0,minutes:0,seconds:t.period}:typeof t.period=="string"?y={year:t.period==="year"?1:0,month:t.period==="month"?1:0,day:t.period==="day"?1:0,hours:t.period==="hours"?1:0,minutes:t.period==="minutes"?1:0,seconds:t.period==="seconds"?1:0}:typeof t.period=="object"&&(y={year:t.period.year!==e?t.period.year:0,month:t.period.month!==e?t.period.month:0,day:t.period.day!==e?t.period.day:0,hours:t.period.hours!==e?t.period.hours:0,minutes:t.period.minutes!==e?t.period.minutes:0,seconds:t.period.seconds!==e?t.period.seconds:0}),t.groupBy===e?S=t.asObject===!0?{}:[]:(S=[],S.push([]),z=s(A).get()[t.groupBy]),Y=function(W,H,D){return t.asObject===!0?t.format!==e?W[s(H).format(t.format)]={}:W[s(H).format("%F %H:%M:%S")]={}:t.format!==e?W.push(D?null:s(H).format(t.format)):W.push(D?null:s(H)),W},t.groupBy!==e&&t.fillNulls){var I={year:y.year?-y.year:e,month:y.month?-y.month:e,day:y.day?-y.day:e,hours:y.hours?-y.hours:e,minutes:y.minutes?-y.minutes:e,seconds:y.seconds?-y.seconds:e,milliseconds:y.milliseconds?-y.milliseconds:e};for(a=s(A).calc(I).utc();s(a).get()[t.groupBy]===z;)Y(S[S.length-1],a,!0),a=s(a).calc(I).utc();if(t.groupBy==="week"){var b=s(A).dayOfWeek();for(a=s(A).dayOfWeek(0).utc();S[0].length<b&&a<A;)Y(S[S.length-1],a,!0),a=s(a).calc(y).utc()}}for(;A<=o;)t.groupBy===e?Y(S,A):s(A).get()[t.groupBy]===z?Y(S[S.length-1],A):(S.push([]),Y(S[S.length-1],A),z=s(A).get()[t.groupBy]),A=s(A).calc(y).utc();if(t.groupBy!==e&&t.fillNulls)for(p=s(o).calc(y).utc();s(p).get()[t.groupBy]===z;)Y(S[S.length-1],p,!0),p=s(p).calc(y).utc();return S},s.monthNames=function(t){switch(t){case"long":return X;default:return Wt}},s.dayNames=function(t){switch(t){case"long":return Mt;default:return Lt}},s.lang=function(t){if(t!==e)u=t,f[u]===e&&(u="en"),X=P(),Wt=St(),Mt=nt(),Lt=Q();else return u;return e},s.availableLangs=function(){return Object.keys(f)},s.registerFormat=function(t,A,o,a,p,y){C[t]={format:A,parse:o,minLength:a,maxLength:p,type:y}},s.unregisterFormat=function(t){delete C[t]},s.detectFormat=function(t){var A,o,a;return A=O(t,0),A!==""&&(a=10),o=t.charAt(a),(o==="T"||o===" ")&&(A+=o,a+=1),A+=l(t,a),A},T={TempusDate:g},s.classes=function(t,A){if(A===e)return T[t];T[t]=A},s.loadTranslations=function(t){typeof t=="object"?f=t:typeof t=="string"&&Oe(t,function(A){f=A},function(A){})},u=(M.language||M.systemLanguage||M.userLanguage||"en").substr(0,2).toLowerCase(),f[u]===e&&(u="en"),X=P(),Wt=St(),Mt=nt(),Lt=Q(),w.exports&&(r=w.exports=s),r.tempus=s}).call(E)})(ot,ot.exports);var Ne=ot.exports;const bt=L(Ne);class x{constructor(r,e={}){N(this,ht);N(this,ut);N(this,mt);N(this,ft);N(this,Nt);N(this,_t);N(this,Dt);N(this,Yt);N(this,Ot);N(this,yt);N(this,dt);N(this,at);N(this,Et);N(this,Bt);N(this,st);N(this,ct);N(this,Tt);N(this,K,null);N(this,lt,null);N(this,q,[]);N(this,B,{});N(this,j,50);N(this,v,!0);N(this,$,null);N(this,U,null);N(this,Z,null);N(this,Ht,100);N(this,tt,"no");N(this,F,!1);N(this,et,!1);N(this,At,!1);J(this,"errors",{});J(this,"answerData",{});R(this,K,r),R(this,lt,e)}get serial(){return h(this,F)}setSerial(){R(this,F,!0),R(this,et,!0),R(this,At,!1)}setParallel(){R(this,F,!1),R(this,et,!1),R(this,At,!0)}stop(){R(this,v,!1)}async batch(r,e){h(this,Z)&&_(this,ut,Vt).call(this),e&&R(this,$,e),h(this,et)===!1&&R(this,F,!1),Object.keys(r).length>500&&R(this,F,!0),R(this,v,!0),R(this,q,[]),R(this,B,{}),this.errors={},this.answerData={};const n=_(this,ft,Kt).call(this,r);if(Object.keys(r).length<500){const i=n.map((c,l)=>_(this,Nt,qt).call(this,c,n[l]));return Promise.allSettled(i).then(c=>{let l={};for(let O of c)O.status==="fulfilled"&&(l={...l,...O.value});return l})}else{let i={},c=0,l=1,O=Object.keys(r).length||1,m=s=>{c+=Object.keys(s).length,l=Math.round(c/O*100)};for(let[s,T]of Object.entries(n)){let M=await _(this,Nt,qt).call(this,T,n[s],!0);m(T),e&&e({percent:l}),i={...i,...M}}return i}}async batchTotalCount(r,e){R(this,B,{}),this.errors={};let n=1,i=0,c=Object.keys(r).length||1,l=m=>{i+=Object.keys(m).length,n=Math.round(i/c*100)};e&&e({percent:n});const O=_(this,ft,Kt).call(this,r);if(h(this,At)){const m=O.map(s=>_(this,_t,vt).call(this,s).then(T=>(l(s),e&&e({percent:n}),T)));return Promise.allSettled(m).then(s=>{let T={};for(let M of s)M.status==="fulfilled"&&(T={...T,...M.value});return T})}else{let m={};for(let s of O){let T=await _(this,_t,vt).call(this,s);l(s),e&&e({percent:n}),m={...m,...T}}return m}}}K=new WeakMap,lt=new WeakMap,q=new WeakMap,B=new WeakMap,j=new WeakMap,v=new WeakMap,$=new WeakMap,U=new WeakMap,Z=new WeakMap,Ht=new WeakMap,tt=new WeakMap,F=new WeakMap,et=new WeakMap,At=new WeakMap,ht=new WeakSet,kt=function(){let r=0;if(!h(this,U))return Math.round(r);let e=0,n=0;return Object.values(h(this,U)).forEach(i=>{const{total:c,count:l}=i;e+=c??0,n+=l??0}),e?r=n/e*100:r=100,{percent:Math.round(r),allCount:n,allTotal:e}},ut=new WeakSet,Vt=function(){clearInterval(h(this,Z)),R(this,Z,""),R(this,U,""),R(this,$,""),R(this,tt,"no")},mt=new WeakSet,zt=function({key:r,value:e}){const n=_(this,st,pt).call(this,e.data()),i=Array.isArray(n)?n.length:0,c=_(this,ct,xt).call(this,e.total(),i);let l=1;n&&(l=i),h(this,$)&&(h(this,U)||R(this,U,{}),h(this,U)[r]&&h(this,U)[r].count&&(l+=h(this,U)[r].count),h(this,U)[r]={total:c,count:l},h(this,Z)||R(this,Z,setInterval(()=>{const{percent:O,allCount:m,allTotal:s}=h(this,ht,kt);(h(this,tt)==="no"||h(this,tt)<h(this,ht,kt).percent)&&(h(this,$).call(this,{data:h(this,U),percent:O,allCount:m,allTotal:s}),R(this,tt,h(this,ht,kt).percent)),O===100&&_(this,ut,Vt).call(this)},h(this,Ht))))},ft=new WeakSet,Kt=function(r){const e=[],n=Object.entries(r);for(let i=0;i<n.length;i+=h(this,j)){const c=n.slice(i,i+h(this,j));e.push(Object.fromEntries(c))}return e},Nt=new WeakSet,qt=function(r,e,n){return new Promise(i=>{const c=_(this,Et,Ae).call(this,e),l=[];let O=0,m=0;h(this,K).call(this,r,s=>{Object.entries(s).forEach(([T,M])=>{let u={};const f=M.error();if(f){let{query:{method:Q},answer:X}=M;this.errors[T]={error:f,method:Q},O+=1}if(M!=null&&M.answer&&Object.keys(M.answer).length){for(let[Q,X]of Object.entries(M.answer))Q!="result"&&X&&(u[Q]=X);Object.keys(u).length&&(this.answerData[T]=u)}const P=_(this,st,pt).call(this,M.data()),St=Array.isArray(P)?P.length:0,nt=_(this,ct,xt).call(this,M.total(),St);if(Array.isArray(P)?h(this,B)[T]=P:typeof P=="object"&&P!==null&&Object.keys(P).length===0?h(this,B)[T]=[]:h(this,B)[T]=P,m+=nt,n||_(this,mt,zt).call(this,{key:T,value:M}),nt>h(this,j)&&nt>St){const Q=Math.ceil(nt/h(this,j))-1,X=Array.from({length:Q});l.push([T,c[T],X])}}),m>5e3&&h(this,et)===!1&&h(this,At)===!1&&R(this,F,!0),O>0&&_(this,Tt,se).call(this),l.length?(_(this,Dt,ne).call(this,l),_(this,Yt,oe).call(this).then(()=>i(_(this,at,Xt).call(this)))):i(_(this,at,Xt).call(this))})})},_t=new WeakSet,vt=function(r){return new Promise(e=>{const n=_(this,Et,Ae).call(this,r);let i=0;h(this,K).call(this,n,c=>{Object.entries(c).forEach(([l,O])=>{const m=O.error();m&&(this.errors[l]=m,i+=1);const s=_(this,st,pt).call(this,O.data()),T=Array.isArray(s)?s.length:0,M=_(this,ct,xt).call(this,O.total(),T);h(this,B)[l]=M}),i>0&&_(this,Tt,se).call(this),e(_(this,at,Xt).call(this))})})},Dt=new WeakSet,ne=function(r){let e=[];r.forEach(([n,i,c])=>{c.forEach((l,O)=>{const m=O+1,s=h(this,j)*m,M=[[n,m].join("_"),_(this,Bt,he).call(this,i,s)];e.length===h(this,j)?(h(this,q).push(e),e=[M]):e.push(M)})}),e.length&&h(this,q).push(e)},Yt=new WeakSet,oe=function(){const r=[],e=[],n=i=>{Object.entries(i).forEach(([c,l])=>{const[O]=c.split("_"),m=_(this,st,pt).call(this,l.data());Array.isArray(m)&&h(this,B)[O].push(...m),_(this,mt,zt).call(this,{key:O,value:l})})};return h(this,q).forEach((i,c)=>{const l=Object.fromEntries(i),O=()=>new Promise(m=>h(this,K).call(this,l,s=>{h(this,F)?n(s):e[c]=s,m()}));r.push(O)}),h(this,F)?_(this,yt,te).call(this,r):_(this,dt,ee).call(this,r).then(()=>{e.forEach(n)})},Ot=new WeakSet,$t=function(){return new Promise(r=>setTimeout(r,500))},yt=new WeakSet,te=function(r){if(!r.length)return Promise.resolve();const e=r.shift();return Promise.allSettled([e(),_(this,Ot,$t).call(this)]).then(()=>h(this,v)?_(this,yt,te).call(this,r):Promise.resolve())},dt=new WeakSet,ee=function(r){if(!r.length)return Promise.resolve();const e=r.shift();return _(this,Ot,$t).call(this).then(()=>e()).then(()=>h(this,v)?_(this,dt,ee).call(this,r):Promise.resolve())},at=new WeakSet,Xt=function(){return Object.entries(h(this,lt)).forEach(([r,e])=>{h(this,B)[r]&&(h(this,B)[r]=e(h(this,B)[r]))}),h(this,B)},Et=new WeakSet,Ae=function(r){return Object.entries(r).reduce((e,[n,i])=>{if(Array.isArray(i)){const[c,l={}]=i;e[n]=[c,l]}else{const{method:c,params:l={}}=i;e[n]=[c,l]}return e},{})},Bt=new WeakSet,he=function(r,e){const[n,i]=r;return[n,{start:e,...i}]},st=new WeakSet,pt=function(r){return((r==null?void 0:r.items)||(r==null?void 0:r.documents))??r},ct=new WeakSet,xt=function(r,e){return r!==r&&(r=0),r===0&&e===0?0:r||e},Tt=new WeakSet,se=function(){console.group(`${this.constructor.name}: Ошибки в методах!`),Object.entries(this.errors).forEach(([r,e])=>{console.info(`[${r}]`,e.toString())}),console.groupEnd()};class jt{constructor(){N(this,rt,{})}get hash(){return this.createHash(8)}createHash(r){let e="abcdefghijklmnopqrstuvwxyz0123456789",n="";r=r||6;for(let i=0;i<r;i++)n+=e.charAt(Math.floor(Math.random()*e.length));return n}actionFilter({keyTimer:r,duration:e=10,action:n}){h(this,rt)[r]&&(clearTimeout(h(this,rt)[r]),h(this,rt)[r]=null),n&&(h(this,rt)[r]=setTimeout(()=>{n()},e))}noSleep(){let r=document.createElement("video");r.classList.add("no-sleep"),r.src="data:video/mp4;base64,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",r.addEventListener("ended",()=>{this.actionFilter({keyTimer:"no-sleep",duration:5e3,action:()=>r.play()})}),r.style.position="fixed",r.style.left=-9999,document.querySelector("body").append(r),r.play()}}rt=new WeakMap;const Qt=new jt;class ie{constructor(){N(this,Ut);N(this,Rt);N(this,Gt);N(this,wt);N(this,Ct);N(this,k,"logger");N(this,V,!1);N(this,It,2e3);N(this,it,new Map);N(this,gt,{});J(this,"periodClear",3);_(this,Ut,ae).call(this)}async init(){let r=new x(BX24.callBatch),{entityList:e}=await r.batch({entityList:{method:"entity.get"}});if(e!=null&&e.length)if(e.find(i=>i.ENTITY==h(this,k)))R(this,V,!0);else{let{entityAdd:i}=await r.batch({entityAdd:{method:"entity.add",params:{ENTITY:h(this,k),NAME:h(this,k),ACCESS:{AU:"X"}}}});i&&R(this,V,!0)}return _(this,wt,le).call(this),h(this,V)}start({type:r,data:e}){if(!h(this,V)){_(this,Rt,re).call(this,"entity");return}const n=Qt.hash;return h(this,it).set(n,{type:r,data:e,userInfo:h(this,gt),errorList:[],status:"",answer:null,date:new Date().getTime()}),n}stop({key:r,errorList:e,status:n,answer:i}){if(!h(this,V)){_(this,Rt,re).call(this,"entity");return}let c=h(this,it).get(r);e&&(c.errorList=e),n&&(c.status=n),i&&(c.answer=i),Qt.actionFilter({keyTimer:"add.entity.items",duration:h(this,It),action:()=>{_(this,Gt,ce).call(this)}})}async getEntityList(){let r=new x(BX24.callBatch),{entityList:e}=await r.batch({entityList:{method:"entity.item.get",params:{ENTITY:h(this,k),SORT:{ID:"DESC"}}}});return e=e.map(n=>{const{ID:i,DATE_CREATE:c,DETAIL_TEXT:l}=n;return{...JSON.parse(l),id:i,dateCreate:c}}),e}}k=new WeakMap,V=new WeakMap,It=new WeakMap,it=new WeakMap,gt=new WeakMap,Ut=new WeakSet,ae=async function(){const r=new x(BX24.callBatch),e=BX24.isAdmin(),{curUser:n}=await r.batch({curUser:{method:"user.current"}});R(this,gt,{isAdmin:e,curUser:n})},Rt=new WeakSet,re=function(r){r=="entity"&&Qt.actionFilter({keyTimer:"error.logger.entity",duration:500,action:()=>{console.error("Хранилище для логгера не инициализировано")}})},Gt=new WeakSet,ce=async function(){let r={},e=new x(BX24.callBatch);for(let[n,i]of h(this,it).entries())i.status&&(r[n]={method:"entity.item.add",params:{ENTITY:h(this,k),NAME:h(this,k),DETAIL_TEXT:JSON.stringify(i)}});if(Object.keys(r).length){let n=await e.batch(r),{errors:i}=e;for(let[c,l]of Object.entries({...n,...i}))h(this,it).delete(c)}},wt=new WeakSet,le=async function(){let r=new x(BX24.callBatch),e=await this.getEntityList(),{serverTime:n}=await r.batch({serverTime:{method:"server.time"}}),i=e.filter(c=>{let{dateCreate:l}=c;return bt(new Date(l)).between(bt(new Date(n)),"month")>=this.periodClear});_(this,Ct,ue).call(this,i)},Ct=new WeakSet,ue=async function(r){let e=new x(BX24.callBatch),n=r.map(i=>{let{id:c}=i;return{method:"entity.item.delete",params:{ENTITY:h(this,k),ID:c}}});return await e.batch(n)};const G=new ie;class _e{constructor(r){N(this,Ft);N(this,Pt);J(this,"domain","");J(this,"isAdmin",!1);J(this,"appInfo",null);J(this,"appConst",null);J(this,"userInfo",null);J(this,"placeData",null);J(this,"placeInfo",null);this.appConst=r}init(){return new Promise(r=>{let e=setInterval(()=>{window.BX24&&BX24.init(async()=>{console.info("init BX24"),clearInterval(e),this.domain=BX24.getDomain(),this.isAdmin=BX24.isAdmin(),this.placeInfo=BX24.placement.info(),await G.init();const[n,i]=await Promise.all([_(this,Ft,me).call(this),_(this,Pt,fe).call(this)]);this.appInfo=n,this.userInfo=i,new jt().noSleep(),r(!0)})},100)})}userOption(r,e){return e?BX24.userOption.set(r,e):BX24.userOption.get(r)}call({method:r,params:e,updateList:n}){let i=G.start({type:"call",data:{method:r,params:e,updateList:n}});return new Promise(c=>{e||(e={}),BX24.callMethod(r,e,function(l){let O={};if(l!=null&&l.answer)for(let[m,s]of Object.entries(l.answer))m!="result"&&s&&(O[m]=s);if(l.error()){let m=l.error();console.error(m),G.stop({answer:O,key:i,status:"fail",errorList:[m.toSting()]}),c(!1)}else{let m=l.data();m!=null&&m.items&&(m=m.items),G.stop({answer:O,key:i,status:"success"}),c(m)}})})}async batch(r,e,{updateList:n,errorCall:i}={}){let c=new x(BX24.callBatch),l=G.start({type:"batch",data:{commandList:r,updateList:n}});try{let O=await c.batch(r,e);if(Object.keys(c.errors).length){let m=Object.entries(c.errors).map(([s,T])=>({key:s,error:T.toSting()}));i&&i(c.errors),G.stop({key:l,status:"fail",errorList:m,answer:c.answerData})}else G.stop({key:l,status:"success",answer:c.answerData});return O}catch(O){return G.stop({key:l,status:"fail-runtime",errorList:[O.toSting()],answer:c.answerData}),console.error(O),!1}}async batchTotalCount(r,e){let n=new x(BX24.callBatch),i=G.start({type:"batch",data:{commandList:r}});try{let c=await n.batchTotalCount(r,e);if(Object.keys(n.errors).length){let l=Object.entries(n.errors).map(([O,m])=>({key:O,error:m.toSting()}));G.stop({key:i,status:"fail",errorList:l})}else G.stop({key:i,status:"success"});return c}catch(c){return G.stop({key:i,status:"fail",errorList:[c.toSting()]}),console.error(c),!1}}getPlacement(){return this.call({method:"placement.get"}).then(r=>(this.placeData||(this.placeData=r),r))}async placementBind(r){this.placeData||(this.placeData=await this.getPlacement());const{appName:e,pathApp:n}=this.appConst,i=this.placeData.map(l=>l.placement);let c=this.placeData.find(l=>l.placement==r);i.includes(r)?c.handler!=n&&(window.placementUnBind||(window.placementUnBind={}),window.placementUnBind[r]||this.placementUnBind(c).then(()=>{window.placementUnBind[r]||(window.placementUnBind[r]=!0,this.placementBind(r))})):this.call({method:"placement.bind",params:{PLACEMENT:r,HANDLER:n,LANG_ALL:{ru:{TITLE:e}}}}).then(l=>{l?console.info("Приложение успешно встроено в",r):console.warn("Приложение не может быть встроено в",r)})}placementUnBind(r){const{pathApp:e,appName:n}=this.appConst;return this.call({method:"placement.unbind",params:{PLACEMENT:r,HANDLER:e,LANG_ALL:{ru:{TITLE:n}}}}).then(i=>(console.log("Встройка отвязана",r),i))}getBotList(){return this.call({method:"imbot.bot.list",params:{}}).then(r=>{let e=Object.values(r);return console.log("chat-bot list:",e),e})}regBot({code:r,type:e,name:n}){const{appName:i,pathApp:c,chatBotLogo:l}=this.appConst,O=this.appInfo.ID;return this.call({method:"imbot.register",params:{CODE:r??this.appInfo.CODE,TYPE:e??"O",EVENT_HANDLER:c,OPENLINE:"Y",CLIENT_ID:"",PROPERTIES:{NAME:`${n??i} - бот #${O}`,LAST_NAME:"",COLOR:"GREEN",EMAIL:"",PERSONAL_BIRTHDAY:bt().format("%Y-%m-%d"),WORK_POSITION:"Почтальон",PERSONAL_WWW:"",PERSONAL_GENDER:"M",PERSONAL_PHOTO:l??""}}}).then(m=>(console.log("Чат-бот добавлен",m),m))}unRegBot(r){return this.call({method:"imbot.unregister",params:{BOT_ID:r}}).then(e=>(console.log("чат-бот удален",e),e))}}Ft=new WeakSet,me=function(){return this.call({method:"app.info"})},Pt=new WeakSet,fe=function(){return this.call({method:"user.current"})},d.Batch=x,d.BxBoot=_e,d.BxHelper=jt,d.BxLogger=ie,d.tempus=bt,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
2
+ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`):A(JSON.parse(a.responseText))):o&&o(a))},a.open("GET",t,!1),a.send()},C={"%d":{format:function(t){return i(t.day()||s.MIN_DAY,2)},parse:function(t){var A=Number(t);return{day:isNaN(A)?e:A}},minLength:2,maxLength:2,type:"number"},"%m":{format:function(t){return i(t.month()||s.MIN_MONTH,2)},parse:function(t){var A=Number(t);return{month:isNaN(A)?e:A}},minLength:2,maxLength:2,type:"number"},"%Y":{format:function(t){return i(t.year()||s.MIN_YEAR,4)},parse:function(t){var A=Number(t);return{year:isNaN(A)?e:A}},minLength:4,maxLength:4,type:"number"},"%w":{format:function(t){return t.dayOfWeek()||s.MIN_DAY_OF_WEEK},parse:function(){return{}},minLength:1,maxLength:1,type:"number"},"%a":{format:function(t){var A=t.dayOfWeek();return Lt[A!==e?A:s.MIN_DAY_OF_WEEK]},parse:function(){return{}},minLength:1,maxLength:999,type:"word"},"%A":{format:function(t){var A=t.dayOfWeek();return Mt[A!==e?A:s.MIN_DAY_OF_WEEK]},parse:function(){return{}},minLength:1,maxLength:999,type:"word"},"%b":{format:function(t){var A=s.options("monthFromZero")?t.month():t.month()-1;return Wt[A!==e?A:s.MIN_MONTH]},parse:function(t){var A=s.monthNames().indexOf(t)+(s.options("monthFromZero")?0:1);return{month:A!==-1?A:e}},minLength:1,maxLength:999,type:"word"},"%B":{format:function(t){var A=s.options("monthFromZero")?t.month():t.month()-1;return X[A!==e?A:s.MIN_MONTH]},parse:function(t){var A=s.monthNames(!0).indexOf(t)+(s.options("monthFromZero")?0:1);return{month:A!==-1?A:e}},minLength:1,maxLength:999,type:"word"},"%H":{format:function(t){return i(t.hours()||s.MIN_HOURS,2)},parse:function(t){var A=Number(t);return{hours:isNaN(A)?e:A}},minLength:2,maxLength:2,type:"number"},"%M":{format:function(t){return i(t.minutes()||s.MIN_MINUTES,2)},parse:function(t){var A=Number(t);return{minutes:isNaN(A)?e:A}},minLength:2,maxLength:2,type:"number"},"%S":{format:function(t){return i(t.seconds()||s.MIN_SECONDS,2)},parse:function(t){var A=Number(t);return{seconds:isNaN(A)?e:A}},minLength:2,maxLength:2,type:"number"},"%s":{format:function(t){return t.timestamp()},parse:function(t){return isNaN(Number(t))?{}:s(Number(t)).get()},minLength:1,maxLength:20,type:"number"},"%F":{format:function(t){return i(t.year()||s.MIN_YEAR,4)+"-"+i(t.month()||s.MIN_MONTH,2)+"-"+i(t.day()||s.MIN_DAY,2)},parse:function(t){var A=Number(t.slice(0,4)),o=Number(t.slice(5,7)),a=Number(t.slice(8,10));return{year:A,month:o,day:a}},minLength:10,maxLength:10,type:"string"},"%D":{format:function(t){return i(t.month()||s.MIN_MONTH,2)+"/"+i(t.day()||s.MIN_DAY,2)+"/"+i(t.year()||s.MIN_YEAR,4)},parse:function(t){var A=Number(t.slice(0,2)),o=Number(t.slice(3,5)),a=Number(t.slice(6,10));return{year:a,month:A,day:o}},minLength:10,maxLength:10,type:"string"}},Jt={useMilliseconds:!1,monthFromZero:!1},g;g=function(t,A,o){return this._d=new Date,this._i={year:!1,month:!1,day:!1,hours:!1,minutes:!1,seconds:!1,milliseconds:!1},t!==e&&this.set(t,A,o),this},g.fn=g.prototype,g.fn.dayCount=function(){var t=this.month(),A=s.MAX_DAY_IN_MONTHS[t-(s.options("monthFromZero")?0:1)];return this.leapYear()&&t===(s.options("monthFromZero")?1:2)&&(A+=1),A},g.fn.year=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_YEAR&&Number(t)<=s.MAX_YEAR?(this._d.setFullYear(Number(t)),this._i.year=!1):this._i.year=Number(t):(this._d.setFullYear(s.MIN_YEAR),this._i.year=!1);else return this._i.year===!1?this._d.getFullYear():this._i.year;return this},g.fn.month=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_MONTH&&Number(t)<=s.MAX_MONTH?(this._d.setMonth(s.options("monthFromZero")?Number(t):Number(t)-1),this._i.month=!1):this._i.month=Number(t):(this._d.setMonth(s.options("monthFromZero")?s.MIN_MONTH:s.MIN_MONTH-1),this._i.month=!1);else return this._i.month===!1?s.options("monthFromZero")?this._d.getMonth():this._d.getMonth()+1:this._i.month;return this},g.fn.day=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_DAY&&Number(t)<=this.dayCount()?(this._d.setDate(Number(t)),this._i.day=!1):this._i.day=Number(t):(this._d.setDate(s.MIN_DAY),this._i.day=!1);else return this._i.day===!1?this._d.getDate():this._i.day;return this},g.fn.hours=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_HOURS&&Number(t)<=s.MAX_HOURS?(this._d.setHours(Number(t)),this._i.hours=!1):this._i.hours=Number(t):(this._d.setHours(s.MIN_HOURS),this._i.hours=!1);else return this._i.hours===!1?this._d.getHours():this._i.hours;return this},g.fn.minutes=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_MINUTES&&Number(t)<=s.MAX_MINUTES?(this._d.setMinutes(Number(t)),this._i.minutes=!1):this._i.minutes=Number(t):(this._d.setMinutes(s.MIN_MINUTES),this._i.minutes=!1);else return this._i.minutes===!1?this._d.getMinutes():this._i.minutes;return this},g.fn.seconds=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_SECONDS&&Number(t)<=s.MAX_SECONDS?(this._d.setSeconds(Number(t)),this._i.seconds=!1):this._i.seconds=Number(t):(this._d.setSeconds(s.MIN_SECONDS),this._i.seconds=!1);else return this._i.seconds===!1?this._d.getSeconds():this._i.seconds;return this},g.fn.milliseconds=function(t){if(arguments.length!==0)(typeof t=="number"||typeof t=="string")&&!isNaN(Number(t))?Number(t)>=s.MIN_MILLISECONDS&&Number(t)<=s.MAX_MILLISECONDS?(this._d.setMilliseconds(Number(t)),this._i.milliseconds=!1):this._i.milliseconds=Number(t):(this._d.setMilliseconds(s.MIN_MILLISECONDS),this._i.milliseconds=!1);else return this._i.milliseconds===!1?this._d.getMilliseconds():this._i.milliseconds;return this},g.fn.week=function(){var t=new Date(this.year(),0,1),A=s(this.utc()).hours(0).minutes(0).seconds(0).milliseconds(0).utc()*1e3;return Math.ceil(((A-t.getTime())/864e5+t.getDay()+1)/7)},g.fn.set=function(t,A,o){if(this._i={year:!1,month:!1,day:!1,hours:!1,minutes:!1,seconds:!1,milliseconds:!1},t===e)return this._d=new Date,this;if(t instanceof Date)return this._d=t,this;if(typeof t=="number")return this._d=new Date(t*(s.options("useMilliseconds")?1:1e3)),this;if(typeof t=="object"&&(t instanceof Array?(this.day(s.MIN_DAY),this.year(t[0]),this.month(t[1]),this.day(t[2]),this.hours(t[3]),this.minutes(t[4]),this.seconds(t[5]),this.milliseconds(t[6])):(this.day(s.MIN_DAY),this.year(t.year),this.month(t.month),this.day(t.day),this.hours(t.hours),this.minutes(t.minutes),this.seconds(t.seconds),this.milliseconds(t.milliseconds))),typeof t=="string"){var a,p=[],y,S,z=[],Y=0,I=0,b,W,H={},D;if(t===e)return y=c(this,o),y===e&&(this._i={year:-1,month:-1,day:-1,hours:-1,minutes:-1,seconds:-1,milliseconds:-1}),y;for(A===e&&(A=s.detectFormat(t));Y<A.length;){if(A.charAt(Y)==="%"){if(S=A.charAt(Y)+A.charAt(Y+1),C[S]!==e){switch(b=0,W="",C[S].type){case"number":for(;b<C[S].maxLength&&I+b<t.length&&!isNaN(Number(t.charAt(I+b)));)W+=t.charAt(I+b),b+=1;break;case"word":for(;b<C[S].maxLength&&I+b<t.length&&/^[\u00BF-\u1FFF\u2C00-\uD7FF\w]+$/.test(t.charAt(I+b));)W+=t.charAt(I+b),b+=1;break;case"string":for(;b<C[S].maxLength&&I+b<t.length;)W+=t.charAt(I+b),b+=1;break}if(b<C[S].minLength)return y=c(this,o),y===e&&(this._i={year:-1,month:-1,day:-1,hours:-1,minutes:-1,seconds:-1,milliseconds:-1}),y;p.push(S),z.push(W),b-=1,I+=b,Y+=1}}else if(t.charAt(I)!==A.charAt(Y))return y=c(this,o),y===e&&(this._i={year:-1,month:-1,day:-1,hours:-1,minutes:-1,seconds:-1,milliseconds:-1}),y;Y+=1,I+=1}for(a in p)p.hasOwnProperty(a)&&C.hasOwnProperty(p[a])&&(D=C[p[a]].parse(z[a]),H={year:D.year!==e?D.year:H.year,month:D.month!==e?D.month:H.month,day:D.day!==e?D.day:H.day,hours:D.hours!==e?D.hours:H.hours,minutes:D.minutes!==e?D.minutes:H.minutes,seconds:D.seconds!==e?D.seconds:H.seconds});this.day(s.MIN_DAY),this.year(H.year),this.month(H.month),this.day(H.day),this.hours(H.hours),this.minutes(H.minutes),this.seconds(H.seconds),this.milliseconds(H.milliseconds)}return this},g.fn.leapYear=function(){var t=this.year();return t%4===0?t%100===0?t%400===0:!0:!1},g.fn.timestamp=function(t){return arguments.length!==0?(this._d=new Date(Number(t)*(s.options("useMilliseconds")?1:1e3)+this._d.getTimezoneOffset()*6e4),this):s.options("useMilliseconds")?this._d.getTime()-this._d.getTimezoneOffset()*6e4:Math.floor(this._d.getTime()/1e3)-this._d.getTimezoneOffset()*60},g.fn.utc=function(t){return arguments.length!==0?(this._d=new Date(Number(t)*(s.options("useMilliseconds")?1:1e3)),this):s.options("useMilliseconds")?this._d.getTime():Math.floor(this._d.getTime()/1e3)},g.fn.dayOfWeek=function(t){if(t==="long")return Mt[this._d.getDay()];if(t==="short")return Lt[this._d.getDay()];if(t===e)return this._d.getDay();if(t===0||t==="Sunday")return this.calc({day:-this.dayOfWeek()});if(t===1||t==="Monday")return this.calc({day:(this.dayOfWeek()===0?-6:1)-this.dayOfWeek()});if(t===2||t==="Tuesday")return this.calc({day:(this.dayOfWeek()===0?-5:2)-this.dayOfWeek()});if(t===3||t==="Wednesday")return this.calc({day:(this.dayOfWeek()===0?-4:3)-this.dayOfWeek()});if(t===4||t==="Thursday")return this.calc({day:(this.dayOfWeek()===0?-3:4)-this.dayOfWeek()});if(t===5||t==="Friday")return this.calc({day:(this.dayOfWeek()===0?-2:5)-this.dayOfWeek()});if(t===6||t==="Saturday")return this.calc({day:(this.dayOfWeek()===0?-1:6)-this.dayOfWeek()})},g.fn.timezone=function(t){switch(t){case"hours":return Math.floor(this._d.getTimezoneOffset()/60);case"minutes":return this._d.getTimezoneOffset();default:return this._d.getTimezoneOffset()*60}},g.fn.get=function(t){switch(t){case"Date":return new Date(this.year(),this.month()-(s.options("monthFromZero")?0:1),this.day(),this.hours(),this.minutes(),this.seconds(),this.milliseconds());case"DateUTC":return new Date(Date.UTC(this.year(),this.month()-(s.options("monthFromZero")?0:1),this.day(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()));case"Array":return[this.year(),this.month(),this.day(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()];default:return{year:this.year(),month:this.month(),week:this.week(),day:this.day(),hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds(),utc:this.utc(),dayOfWeek:this.dayOfWeek(),dayOfWeekShort:this.dayOfWeek("short"),dayOfWeekLong:this.dayOfWeek("long"),timestamp:this.timestamp()}}},g.fn.format=function(t){for(var A=0,o="",a;A<t.length;)t.charAt(A)==="%"?(a=t.charAt(A)+t.charAt(A+1),C[a]!==e?(o+=C[a].format(this),A+=1):o+="%"):o+=t.charAt(A),A+=1;return o},g.fn.valid=function(){return this._i.year===!1&&this._i.month===!1&&this._i.day===!1&&this._i.hours===!1&&this._i.minutes===!1&&this._i.seconds===!1&&this._i.milliseconds===!1},g.fn.errors=function(){return this._i},g.fn.between=function(t,A){var o=this.timestamp(),a=t.timestamp();switch(A){case"year":return Math.floor((a-o)/31556952);case"month":return Math.floor((a-o)/2629746);case"day":return Math.floor((a-o)/86400);case"hours":return Math.floor((a-o)/3600);case"minutes":return Math.floor((a-o)/60);case"seconds":return a-o;default:return e}},g.fn.calc=function(t){return t.year!==e&&this._d.setFullYear(this._d.getFullYear()+t.year),t.month!==e&&this._d.setMonth(this._d.getMonth()+t.month),t.day!==e&&this._d.setDate(this._d.getDate()+t.day),t.hours!==e&&this._d.setHours(this._d.getHours()+t.hours),t.minutes!==e&&this._d.setMinutes(this._d.getMinutes()+t.minutes),t.seconds!==e&&this._d.setSeconds(this._d.getSeconds()+t.seconds),t.milliseconds!==e&&this._d.setMilliseconds(this._d.getMilliseconds()+t.milliseconds),this},s=function(t,A,o){return new g(t,A,o)},s.MIN_YEAR=1e3,s.MAX_YEAR=3e3,s.MIN_MONTH=1,s.MAX_MONTH=12,s.MIN_DAY=1,s.MAX_DAY_IN_MONTHS=[31,28,31,30,31,30,31,31,30,31,30,31],s.MIN_DAY_OF_WEEK=0,s.MAX_DAY_OF_WEEK=6,s.MIN_HOURS=0,s.MAX_HOURS=23,s.MIN_MINUTES=0,s.MAX_MINUTES=59,s.MIN_SECONDS=0,s.MAX_SECONDS=59,s.MIN_MILLISECONDS=0,s.MAX_MILLISECONDS=999,s.VERSION="0.2.18",s.options=function(t,A){if(t===e)return Jt;if(Jt.hasOwnProperty(t)){if(A===e)return Jt[t];Jt[t]=A,t==="monthFromZero"&&(s.MIN_MONTH=A?0:1,s.MAX_MONTH=A?11:12)}return e},s.noConflict=function(){return n.tempus=m,s},s.generate=function(t){var A,o,a,p,y,S,z,Y;if(typeof t.dateFrom!="number"&&(t.dateFrom instanceof g?A=t.dateFrom.utc():A=s(t.dateFrom,t.formatFrom).utc()),typeof t.dateTo!="number"&&(t.dateTo instanceof g?o=t.dateTo.utc():o=s(t.dateTo,t.formatTo!==e?t.formatTo:t.formatFrom).utc()),typeof t.period=="number"?y={year:0,month:0,day:0,hours:0,minutes:0,seconds:t.period}:typeof t.period=="string"?y={year:t.period==="year"?1:0,month:t.period==="month"?1:0,day:t.period==="day"?1:0,hours:t.period==="hours"?1:0,minutes:t.period==="minutes"?1:0,seconds:t.period==="seconds"?1:0}:typeof t.period=="object"&&(y={year:t.period.year!==e?t.period.year:0,month:t.period.month!==e?t.period.month:0,day:t.period.day!==e?t.period.day:0,hours:t.period.hours!==e?t.period.hours:0,minutes:t.period.minutes!==e?t.period.minutes:0,seconds:t.period.seconds!==e?t.period.seconds:0}),t.groupBy===e?S=t.asObject===!0?{}:[]:(S=[],S.push([]),z=s(A).get()[t.groupBy]),Y=function(W,H,D){return t.asObject===!0?t.format!==e?W[s(H).format(t.format)]={}:W[s(H).format("%F %H:%M:%S")]={}:t.format!==e?W.push(D?null:s(H).format(t.format)):W.push(D?null:s(H)),W},t.groupBy!==e&&t.fillNulls){var I={year:y.year?-y.year:e,month:y.month?-y.month:e,day:y.day?-y.day:e,hours:y.hours?-y.hours:e,minutes:y.minutes?-y.minutes:e,seconds:y.seconds?-y.seconds:e,milliseconds:y.milliseconds?-y.milliseconds:e};for(a=s(A).calc(I).utc();s(a).get()[t.groupBy]===z;)Y(S[S.length-1],a,!0),a=s(a).calc(I).utc();if(t.groupBy==="week"){var b=s(A).dayOfWeek();for(a=s(A).dayOfWeek(0).utc();S[0].length<b&&a<A;)Y(S[S.length-1],a,!0),a=s(a).calc(y).utc()}}for(;A<=o;)t.groupBy===e?Y(S,A):s(A).get()[t.groupBy]===z?Y(S[S.length-1],A):(S.push([]),Y(S[S.length-1],A),z=s(A).get()[t.groupBy]),A=s(A).calc(y).utc();if(t.groupBy!==e&&t.fillNulls)for(p=s(o).calc(y).utc();s(p).get()[t.groupBy]===z;)Y(S[S.length-1],p,!0),p=s(p).calc(y).utc();return S},s.monthNames=function(t){switch(t){case"long":return X;default:return Wt}},s.dayNames=function(t){switch(t){case"long":return Mt;default:return Lt}},s.lang=function(t){if(t!==e)u=t,f[u]===e&&(u="en"),X=P(),Wt=St(),Mt=nt(),Lt=Q();else return u;return e},s.availableLangs=function(){return Object.keys(f)},s.registerFormat=function(t,A,o,a,p,y){C[t]={format:A,parse:o,minLength:a,maxLength:p,type:y}},s.unregisterFormat=function(t){delete C[t]},s.detectFormat=function(t){var A,o,a;return A=O(t,0),A!==""&&(a=10),o=t.charAt(a),(o==="T"||o===" ")&&(A+=o,a+=1),A+=l(t,a),A},T={TempusDate:g},s.classes=function(t,A){if(A===e)return T[t];T[t]=A},s.loadTranslations=function(t){typeof t=="object"?f=t:typeof t=="string"&&Oe(t,function(A){f=A},function(A){})},u=(M.language||M.systemLanguage||M.userLanguage||"en").substr(0,2).toLowerCase(),f[u]===e&&(u="en"),X=P(),Wt=St(),Mt=nt(),Lt=Q(),w.exports&&(r=w.exports=s),r.tempus=s}).call(E)})(ot,ot.exports);var Ne=ot.exports;const bt=L(Ne);class x{constructor(r,e={}){N(this,ht);N(this,ut);N(this,mt);N(this,ft);N(this,Nt);N(this,_t);N(this,Dt);N(this,Yt);N(this,Ot);N(this,yt);N(this,dt);N(this,at);N(this,Et);N(this,Bt);N(this,st);N(this,ct);N(this,Tt);N(this,K,null);N(this,lt,null);N(this,q,[]);N(this,B,{});N(this,j,50);N(this,v,!0);N(this,$,null);N(this,U,null);N(this,Z,null);N(this,Ht,100);N(this,tt,"no");N(this,F,!1);N(this,et,!1);N(this,At,!1);J(this,"errors",{});J(this,"answerData",{});R(this,K,r),R(this,lt,e)}get serial(){return h(this,F)}setSerial(){R(this,F,!0),R(this,et,!0),R(this,At,!1)}setParallel(){R(this,F,!1),R(this,et,!1),R(this,At,!0)}stop(){R(this,v,!1)}async batch(r,e){h(this,Z)&&_(this,ut,Vt).call(this),e&&R(this,$,e),h(this,et)===!1&&R(this,F,!1),Object.keys(r).length>500&&R(this,F,!0),R(this,v,!0),R(this,q,[]),R(this,B,{}),this.errors={},this.answerData={};const n=_(this,ft,Kt).call(this,r);if(Object.keys(r).length<500){const i=n.map((c,l)=>_(this,Nt,qt).call(this,c,n[l]));return Promise.allSettled(i).then(c=>{let l={};for(let O of c)O.status==="fulfilled"&&(l={...l,...O.value});return l})}else{let i={},c=0,l=1,O=Object.keys(r).length||1,m=s=>{c+=Object.keys(s).length,l=Math.round(c/O*100)};for(let[s,T]of Object.entries(n)){let M=await _(this,Nt,qt).call(this,T,n[s],!0);m(T),e&&e({percent:l}),i={...i,...M}}return i}}async batchTotalCount(r,e){R(this,B,{}),this.errors={};let n=1,i=0,c=Object.keys(r).length||1,l=m=>{i+=Object.keys(m).length,n=Math.round(i/c*100)};e&&e({percent:n});const O=_(this,ft,Kt).call(this,r);if(h(this,At)){const m=O.map(s=>_(this,_t,vt).call(this,s).then(T=>(l(s),e&&e({percent:n}),T)));return Promise.allSettled(m).then(s=>{let T={};for(let M of s)M.status==="fulfilled"&&(T={...T,...M.value});return T})}else{let m={};for(let s of O){let T=await _(this,_t,vt).call(this,s);l(s),e&&e({percent:n}),m={...m,...T}}return m}}}K=new WeakMap,lt=new WeakMap,q=new WeakMap,B=new WeakMap,j=new WeakMap,v=new WeakMap,$=new WeakMap,U=new WeakMap,Z=new WeakMap,Ht=new WeakMap,tt=new WeakMap,F=new WeakMap,et=new WeakMap,At=new WeakMap,ht=new WeakSet,kt=function(){let r=0;if(!h(this,U))return Math.round(r);let e=0,n=0;return Object.values(h(this,U)).forEach(i=>{const{total:c,count:l}=i;e+=c??0,n+=l??0}),e?r=n/e*100:r=100,{percent:Math.round(r),allCount:n,allTotal:e}},ut=new WeakSet,Vt=function(){clearInterval(h(this,Z)),R(this,Z,""),R(this,U,""),R(this,$,""),R(this,tt,"no")},mt=new WeakSet,zt=function({key:r,value:e}){const n=_(this,st,pt).call(this,e.data()),i=Array.isArray(n)?n.length:0,c=_(this,ct,xt).call(this,e.total(),i);let l=1;n&&(l=i),h(this,$)&&(h(this,U)||R(this,U,{}),h(this,U)[r]&&h(this,U)[r].count&&(l+=h(this,U)[r].count),h(this,U)[r]={total:c,count:l},h(this,Z)||R(this,Z,setInterval(()=>{const{percent:O,allCount:m,allTotal:s}=h(this,ht,kt);(h(this,tt)==="no"||h(this,tt)<h(this,ht,kt).percent)&&(h(this,$).call(this,{data:h(this,U),percent:O,allCount:m,allTotal:s}),R(this,tt,h(this,ht,kt).percent)),O===100&&_(this,ut,Vt).call(this)},h(this,Ht))))},ft=new WeakSet,Kt=function(r){const e=[],n=Object.entries(r);for(let i=0;i<n.length;i+=h(this,j)){const c=n.slice(i,i+h(this,j));e.push(Object.fromEntries(c))}return e},Nt=new WeakSet,qt=function(r,e,n){return new Promise(i=>{const c=_(this,Et,Ae).call(this,e),l=[];let O=0,m=0;h(this,K).call(this,r,s=>{Object.entries(s).forEach(([T,M])=>{let u={};const f=M.error();if(f){let{query:{method:Q},answer:X}=M;this.errors[T]={error:f,method:Q},O+=1}if(M!=null&&M.answer&&Object.keys(M.answer).length){for(let[Q,X]of Object.entries(M.answer))Q!="result"&&X&&(u[Q]=X);Object.keys(u).length&&(this.answerData[T]=u)}const P=_(this,st,pt).call(this,M.data()),St=Array.isArray(P)?P.length:0,nt=_(this,ct,xt).call(this,M.total(),St);if(Array.isArray(P)?h(this,B)[T]=P:typeof P=="object"&&P!==null&&Object.keys(P).length===0?h(this,B)[T]=[]:h(this,B)[T]=P,m+=nt,n||_(this,mt,zt).call(this,{key:T,value:M}),nt>h(this,j)&&nt>St){const Q=Math.ceil(nt/h(this,j))-1,X=Array.from({length:Q});l.push([T,c[T],X])}}),m>5e3&&h(this,et)===!1&&h(this,At)===!1&&R(this,F,!0),O>0&&_(this,Tt,se).call(this),l.length?(_(this,Dt,ne).call(this,l),_(this,Yt,oe).call(this).then(()=>i(_(this,at,Xt).call(this)))):i(_(this,at,Xt).call(this))})})},_t=new WeakSet,vt=function(r){return new Promise(e=>{const n=_(this,Et,Ae).call(this,r);let i=0;h(this,K).call(this,n,c=>{Object.entries(c).forEach(([l,O])=>{const m=O.error();m&&(this.errors[l]=m,i+=1);const s=_(this,st,pt).call(this,O.data()),T=Array.isArray(s)?s.length:0,M=_(this,ct,xt).call(this,O.total(),T);h(this,B)[l]=M}),i>0&&_(this,Tt,se).call(this),e(_(this,at,Xt).call(this))})})},Dt=new WeakSet,ne=function(r){let e=[];r.forEach(([n,i,c])=>{c.forEach((l,O)=>{const m=O+1,s=h(this,j)*m,M=[[n,m].join("_"),_(this,Bt,he).call(this,i,s)];e.length===h(this,j)?(h(this,q).push(e),e=[M]):e.push(M)})}),e.length&&h(this,q).push(e)},Yt=new WeakSet,oe=function(){const r=[],e=[],n=i=>{Object.entries(i).forEach(([c,l])=>{const[O]=c.split("_"),m=_(this,st,pt).call(this,l.data());Array.isArray(m)&&h(this,B)[O].push(...m),_(this,mt,zt).call(this,{key:O,value:l})})};return h(this,q).forEach((i,c)=>{const l=Object.fromEntries(i),O=()=>new Promise(m=>h(this,K).call(this,l,s=>{h(this,F)?n(s):e[c]=s,m()}));r.push(O)}),h(this,F)?_(this,yt,te).call(this,r):_(this,dt,ee).call(this,r).then(()=>{e.forEach(n)})},Ot=new WeakSet,$t=function(){return new Promise(r=>setTimeout(r,500))},yt=new WeakSet,te=function(r){if(!r.length)return Promise.resolve();const e=r.shift();return Promise.allSettled([e(),_(this,Ot,$t).call(this)]).then(()=>h(this,v)?_(this,yt,te).call(this,r):Promise.resolve())},dt=new WeakSet,ee=function(r){if(!r.length)return Promise.resolve();const e=r.shift();return _(this,Ot,$t).call(this).then(()=>e()).then(()=>h(this,v)?_(this,dt,ee).call(this,r):Promise.resolve())},at=new WeakSet,Xt=function(){return Object.entries(h(this,lt)).forEach(([r,e])=>{h(this,B)[r]&&(h(this,B)[r]=e(h(this,B)[r]))}),h(this,B)},Et=new WeakSet,Ae=function(r){return Object.entries(r).reduce((e,[n,i])=>{if(Array.isArray(i)){const[c,l={}]=i;e[n]=[c,l]}else{const{method:c,params:l={}}=i;e[n]=[c,l]}return e},{})},Bt=new WeakSet,he=function(r,e){const[n,i]=r;return[n,{start:e,...i}]},st=new WeakSet,pt=function(r){return((r==null?void 0:r.items)||(r==null?void 0:r.documents))??r},ct=new WeakSet,xt=function(r,e){return r!==r&&(r=0),r===0&&e===0?0:r||e},Tt=new WeakSet,se=function(){console.group(`${this.constructor.name}: Ошибки в методах!`),Object.entries(this.errors).forEach(([r,e])=>{console.info(`[${r}]`,e.toString())}),console.groupEnd()};class jt{constructor(){N(this,rt,{})}get hash(){return this.createHash(8)}createHash(r){let e="abcdefghijklmnopqrstuvwxyz0123456789",n="";r=r||6;for(let i=0;i<r;i++)n+=e.charAt(Math.floor(Math.random()*e.length));return n}actionFilter({keyTimer:r,duration:e=10,action:n}){h(this,rt)[r]&&(clearTimeout(h(this,rt)[r]),h(this,rt)[r]=null),n&&(h(this,rt)[r]=setTimeout(()=>{n()},e))}noSleep(){let r=document.createElement("video");r.classList.add("no-sleep"),r.src="data:video/mp4;base64,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",r.addEventListener("ended",()=>{this.actionFilter({keyTimer:"no-sleep",duration:5e3,action:()=>r.play()})}),r.style.position="fixed",r.style.left="-9999px",document.querySelector("body").append(r),r.play()}}rt=new WeakMap;const Qt=new jt;class ie{constructor(){N(this,Ut);N(this,Rt);N(this,Gt);N(this,wt);N(this,Ct);N(this,k,"logger");N(this,V,!1);N(this,It,2e3);N(this,it,new Map);N(this,gt,{});J(this,"periodClear",3);_(this,Ut,ae).call(this)}async init(){let r=new x(BX24.callBatch),{entityList:e}=await r.batch({entityList:{method:"entity.get"}});if(e!=null&&e.length)if(e.find(i=>i.ENTITY==h(this,k)))R(this,V,!0);else{let{entityAdd:i}=await r.batch({entityAdd:{method:"entity.add",params:{ENTITY:h(this,k),NAME:h(this,k),ACCESS:{AU:"X"}}}});i&&R(this,V,!0)}return _(this,wt,le).call(this),h(this,V)}start({type:r,data:e}){if(!h(this,V)){_(this,Rt,re).call(this,"entity");return}const n=Qt.hash;return h(this,it).set(n,{type:r,data:e,userInfo:h(this,gt),errorList:[],status:"",answer:null,date:new Date().getTime()}),n}stop({key:r,errorList:e,status:n,answer:i}){if(!h(this,V)){_(this,Rt,re).call(this,"entity");return}let c=h(this,it).get(r);e&&(c.errorList=e),n&&(c.status=n),i&&(c.answer=i),Qt.actionFilter({keyTimer:"add.entity.items",duration:h(this,It),action:()=>{_(this,Gt,ce).call(this)}})}async getEntityList(){let r=new x(BX24.callBatch),{entityList:e}=await r.batch({entityList:{method:"entity.item.get",params:{ENTITY:h(this,k),SORT:{ID:"DESC"}}}});return e=e.map(n=>{const{ID:i,DATE_CREATE:c,DETAIL_TEXT:l}=n;return{...JSON.parse(l),id:i,dateCreate:c}}),e}}k=new WeakMap,V=new WeakMap,It=new WeakMap,it=new WeakMap,gt=new WeakMap,Ut=new WeakSet,ae=async function(){const r=new x(BX24.callBatch),e=BX24.isAdmin(),{curUser:n}=await r.batch({curUser:{method:"user.current"}});R(this,gt,{isAdmin:e,curUser:n})},Rt=new WeakSet,re=function(r){r=="entity"&&Qt.actionFilter({keyTimer:"error.logger.entity",duration:500,action:()=>{console.error("Хранилище для логгера не инициализировано")}})},Gt=new WeakSet,ce=async function(){let r={},e=new x(BX24.callBatch);for(let[n,i]of h(this,it).entries())i.status&&(r[n]={method:"entity.item.add",params:{ENTITY:h(this,k),NAME:h(this,k),DETAIL_TEXT:JSON.stringify(i)}});if(Object.keys(r).length){let n=await e.batch(r),{errors:i}=e;for(let[c,l]of Object.entries({...n,...i}))h(this,it).delete(c)}},wt=new WeakSet,le=async function(){let r=new x(BX24.callBatch),e=await this.getEntityList(),{serverTime:n}=await r.batch({serverTime:{method:"server.time"}}),i=e.filter(c=>{let{dateCreate:l}=c;return bt(new Date(l)).between(bt(new Date(n)),"month")>=this.periodClear});_(this,Ct,ue).call(this,i)},Ct=new WeakSet,ue=async function(r){let e=new x(BX24.callBatch),n=r.map(i=>{let{id:c}=i;return{method:"entity.item.delete",params:{ENTITY:h(this,k),ID:c}}});return await e.batch(n)};const G=new ie;class _e{constructor(r){N(this,Ft);N(this,Pt);J(this,"domain","");J(this,"isAdmin",!1);J(this,"appInfo",null);J(this,"appConst",null);J(this,"userInfo",null);J(this,"placeData",null);J(this,"placeInfo",null);this.appConst=r}init(){return new Promise(r=>{let e=setInterval(()=>{window.BX24&&BX24.init(async()=>{console.info("init BX24"),clearInterval(e),this.domain=BX24.getDomain(),this.isAdmin=BX24.isAdmin(),this.placeInfo=BX24.placement.info(),await G.init();const[n,i]=await Promise.all([_(this,Ft,me).call(this),_(this,Pt,fe).call(this)]);this.appInfo=n,this.userInfo=i,new jt().noSleep(),r(!0)})},100)})}userOption(r,e){return e?BX24.userOption.set(r,e):BX24.userOption.get(r)}call({method:r,params:e,updateList:n}){let i=G.start({type:"call",data:{action,method:r,params:e,updateList:n}});return new Promise(c=>{e||(e={}),BX24.callMethod(r,e,function(l){let O={};if(l!=null&&l.answer)for(let[m,s]of Object.entries(l.answer))m!="result"&&s&&(O[m]=s);if(l.error()){let m=l.error();console.error(m),G.stop({answer:O,key:i,status:"fail",errorList:[m.toSting()]}),c(!1)}else{let m=l.data();m!=null&&m.items&&(m=m.items),G.stop({answer:O,key:i,status:"success"}),c(m)}})})}async batch(r,e,{updateList:n,errorCall:i}={}){let c=new x(BX24.callBatch),l=G.start({type:"batch",data:{commandList:r,updateList:n}});try{let O=await c.batch(r,e);if(Object.keys(c.errors).length){let m=Object.entries(c.errors).map(([s,T])=>({key:s,error:T.toSting()}));i&&i(c.errors),G.stop({key:l,status:"fail",errorList:m,answer:c.answerData})}else G.stop({key:l,status:"success",answer:c.answerData});return O}catch(O){return G.stop({key:l,status:"fail-runtime",errorList:[O.toSting()],answer:c.answerData}),console.error(O),!1}}async batchTotalCount(r,e){let n=new x(BX24.callBatch),i=G.start({type:"batch",data:{commandList:r}});try{let c=await n.batchTotalCount(r,e);if(Object.keys(n.errors).length){let l=Object.entries(n.errors).map(([O,m])=>({key:O,error:m.toSting()}));G.stop({key:i,status:"fail",errorList:l})}else G.stop({key:i,status:"success"});return c}catch(c){return G.stop({key:i,status:"fail",errorList:[c.toSting()]}),console.error(c),!1}}getPlacement(){return this.call({method:"placement.get"}).then(r=>(this.placeData||(this.placeData=r),r))}async placementBind(r){this.placeData||(this.placeData=await this.getPlacement());const{appName:e,pathApp:n}=this.appConst,i=this.placeData.map(l=>l.placement);let c=this.placeData.find(l=>l.placement==r);i.includes(r)?c.handler!=n&&(window.placementUnBind||(window.placementUnBind={}),window.placementUnBind[r]||this.placementUnBind(c).then(()=>{window.placementUnBind[r]||(window.placementUnBind[r]=!0,this.placementBind(r))})):this.call({method:"placement.bind",params:{PLACEMENT:r,HANDLER:n,LANG_ALL:{ru:{TITLE:e}}}}).then(l=>{l?console.info("Приложение успешно встроено в",r):console.warn("Приложение не может быть встроено в",r)})}placementUnBind(r){const{pathApp:e,appName:n}=this.appConst;return this.call({method:"placement.unbind",params:{PLACEMENT:r,HANDLER:e,LANG_ALL:{ru:{TITLE:n}}}}).then(i=>(console.log("Встройка отвязана",r),i))}getBotList(){return this.call({method:"imbot.bot.list",params:{}}).then(r=>{let e=Object.values(r);return console.log("chat-bot list:",e),e})}regBot({code:r,type:e,name:n}){const{appName:i,pathApp:c,chatBotLogo:l}=this.appConst,O=this.appInfo.ID;return this.call({method:"imbot.register",params:{CODE:r??this.appInfo.CODE,TYPE:e??"O",EVENT_HANDLER:c,OPENLINE:"Y",CLIENT_ID:"",PROPERTIES:{NAME:`${n??i} - бот #${O}`,LAST_NAME:"",COLOR:"GREEN",EMAIL:"",PERSONAL_BIRTHDAY:bt().format("%Y-%m-%d"),WORK_POSITION:"Почтальон",PERSONAL_WWW:"",PERSONAL_GENDER:"M",PERSONAL_PHOTO:l??""}}}).then(m=>(console.log("Чат-бот добавлен",m),m))}unRegBot(r){return this.call({method:"imbot.unregister",params:{BOT_ID:r}}).then(e=>(console.log("чат-бот удален",e),e))}}Ft=new WeakSet,me=function(){return this.call({method:"app.info"})},Pt=new WeakSet,fe=function(){return this.call({method:"user.current"})},d.Batch=x,d.BxBoot=_e,d.BxHelper=jt,d.BxLogger=ie,d.tempus=bt,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
@@ -19,6 +19,7 @@ type TCommandParams = Record<string, unknown> | {
19
19
 
20
20
  type TUpdateList = {
21
21
  method: string,
22
+ name: string,
22
23
  list: {
23
24
  id: string | number,
24
25
  fields: { [key: string]: string | number | string[] | number[] }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "szdl-utils-kit",
3
3
  "description": "utils-kit library",
4
4
  "private": false,
5
- "version": "0.2.9",
5
+ "version": "0.2.11",
6
6
  "type": "module",
7
7
  "author": "Stanislav Ovv",
8
8
  "license": "BSD",