vgapp 0.0.9 → 0.1.0

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.
@@ -6,6 +6,7 @@ import {isObject, makeRandomString, mergeDeepObject, normalizeData} from "../../
6
6
  import Selectors from "../../../utils/js/dom/selectors";
7
7
  import VGCollapse from "../../vgcollapse/js/vgcollapse";
8
8
  import {getSVG} from "../../module-fn";
9
+ import Backdrop from "../../../utils/js/components/backdrop";
9
10
 
10
11
  /**
11
12
  * Constants
@@ -262,11 +263,25 @@ class VGFormSender extends BaseModule {
262
263
  }
263
264
  });
264
265
 
265
- let $modal = Selectors.find('.' + _this._params.classes.alertModal);
266
- if ($modal) $modal.remove();
266
+ let m = document.querySelector('.vg-modal'),
267
+ id = _this._params.classes.general + '-' + makeRandomString();
268
+
269
+ m?.addEventListener('vg.modal.hidden', function () {
270
+ showModal();
271
+ });
267
272
 
268
273
  setTimeout(() => {
269
- let id = _this._params.classes.general + '-' + makeRandomString();
274
+ const newModal = document.getElementById(id);
275
+ if (!newModal) {
276
+ console.log('asd');
277
+ showModal(false);
278
+ }
279
+ }, 500);
280
+
281
+ function showModal(isBackDrop = true) {
282
+ let $modal = Selectors.find('.' + _this._params.classes.alertModal);
283
+ if ($modal) $modal.remove();
284
+
270
285
  VGModal.init(id, {
271
286
  classes: {
272
287
  alert: _this._params.classes.alertModal
@@ -279,8 +294,14 @@ class VGFormSender extends BaseModule {
279
294
  if ($body) $body.append(_this.setDataRelationStatus(element, status, data, 'modal'));
280
295
 
281
296
  self.toggle();
297
+
298
+ if (isBackDrop) {
299
+ setTimeout(() => {
300
+ Backdrop.show();
301
+ }, 50)
302
+ }
282
303
  });
283
- }, 175)
304
+ }
284
305
  }
285
306
 
286
307
  _alertCollapse(data, status) {
@@ -291,7 +291,7 @@ class VGModal extends BaseModule {
291
291
  }, this._dialog);
292
292
  }, this._dialog);
293
293
 
294
- this._element.focus();
294
+ //this._element.focus();
295
295
  }
296
296
 
297
297
  _addFieldsInModal(relatedTarget) {
@@ -330,10 +330,10 @@ EventHandler.on(document, EVENT_KEY_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, functi
330
330
 
331
331
  EventHandler.one(target, EVENT_KEY_SHOW, showEvent => {
332
332
  if (showEvent.defaultPrevented) return;
333
-
333
+ /*
334
334
  EventHandler.one(target, EVENT_KEY_HIDDEN, () => {
335
335
  if (isVisible(this)) this.focus();
336
- });
336
+ });*/
337
337
  });
338
338
 
339
339
  const alreadyOpen = Selectors.find(OPEN_SELECTOR);
@@ -47,7 +47,7 @@ class Backdrop {
47
47
 
48
48
  setTimeout(() => {
49
49
  element.remove();
50
- }, 500);
50
+ }, 50);
51
51
  }
52
52
  }
53
53
 
package/build/vgapp.js CHANGED
@@ -1,2 +1,2 @@
1
- var vg;(()=>{"use strict";var e={d:(t,s)=>{for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function s(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}e.r(t),e.d(t,{VGCollapse:()=>_e,VGDropdown:()=>Ue,VGFormSender:()=>yt,VGModal:()=>_t,VGNav:()=>je,VGRollup:()=>Et,VGSidebar:()=>ne});const a=e=>!!r(e)&&void 0!==e.nodeType,n=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"));function i(e){if(!a(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),s=e.closest("details:not([open])");if(!s)return t;if(s!==e){const t=e.closest("summary");if(t&&t.parentNode!==s)return!1;if(null===t)return!1}return t}function r(e){return e&&"object"==typeof e}function o(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function l(...e){const t=e=>e&&"object"==typeof e;return e.reduce(((e,s)=>(Object.keys(s).forEach((a=>{const n=e[a],i=s[a];Array.isArray(n)&&Array.isArray(i)?e[a]=n.concat(...i):t(n)&&t(i)?e[a]=l(n,i):e[a]=i})),e)),{})}function d(e,t=[],s=e){return"function"==typeof e?e(...t):s}const c="transitionend",m=e=>{e.offsetHeight},g=()=>{};function h(e=7){let t="";let s=0;for(;s<e;)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random())),s+=1;return t}const u=()=>"rtl"===document.documentElement.dir,p=e=>{let t=e.getAttribute("data-vg-target");if(!t||"#"===t){let s=e.getAttribute("href");if(!s||!s.includes("#")&&!s.startsWith("."))return null;s.includes("#")&&!s.startsWith("#")&&(s=`#${s.split("#")[1]}`),t=s&&"#"!==s?s.trim():null}return t?t.split(",").map((e=>(e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e))(e))).join(","):null},f={find:(e,t=document.documentElement)=>a(e)?e:Element.prototype.querySelector.call(t,e),findAll:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),getSelectorFromElement(e){const t=p(e);return t&&f.find(t)?t:null},getElementFromSelector(e){const t=p(e);return t?f.find(t):null},getMultipleElementsFromSelector(e){const t=p(e);return t?f.findAll(t):[]}},_=f,v=new Map,b={set(e,t,s){v.has(e)||v.set(e,new Map);const a=v.get(e);a.has(t)||0===a.size?a.set(t,s):console.error(`VGApp не допускает более одного экземпляра для каждого элемента. Связанный экземпляр: ${Array.from(a.keys())[0]}.`)},get:(e,t)=>v.has(e)&&v.get(e).get(t)||null,remove(e,t){if(!v.has(e))return;const s=v.get(e);s.delete(t),0===s.size&&v.delete(e)}},w={get(e,t="data",s=!0){if(!e)return{};if("data"===t){let t=["data-vg-toggle","data-vg-target","data-vg-dismiss"],a={},n=[].filter.call(e.attributes,(function(e){return/^data-/.test(e.name)}));return n.length&&n.forEach((function(e){let n=e.name;t.includes(n)||(s&&(n=n.slice(5)),a[n]=o(e.value))})),a}return"all"===t?e.getAttributeNames().reduce(((t,s)=>({...t,[s]:e.getAttribute(s)})),{}):e.getAttribute(t)},has:(e,t)=>e.hasAttribute(t),set(e,t,s){a(e)&&t&&e.setAttribute(t,s)},remove(e,t){a(e)&&t&&e.removeAttribute(t)}},y=class{constructor(e,t=null){this._params=this.merge(e,t)}get(){return this._params}fromElement(e){return a(e)?w.get(e):{}}merge(e,t){let s=l(e,this.fromElement(t));for(let e in s)if(-1!==e.indexOf("-")){let t=e.split("-"),a=o(s[e]);t[0]in s&&t[1]in s[t[0]]&&(s[t[0]][t[1]]=a),delete s[e]}return"params"in s&&(s=l(s,s.params),delete s.params),s}},k=/[^.]*(?=\..*)\.|.*/,x=/\..*/,L=/::\d+$/,E={};let A=1;const S={mouseenter:"mouseover",mouseleave:"mouseout"},T=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","submit","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function C(e,t){return t&&`${t}::${A++}`||e.uidEvent||A++}function M(e){const t=C(e);return e.uidEvent=t,E[t]=E[t]||{},E[t]}function O(e,t,s=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===s))}function $(e,t,s){const a="string"==typeof t,n=a?s:t||s;let i=(r=(r=e).replace(x,""),S[r]||r);var r;return T.has(i)||(i=e),[a,n,i]}function j(e,t,s,a,n){if("string"!=typeof t||!e)return;let[i,r,o]=$(t,s,a);if(t in S){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};r=e(r)}const l=M(e),d=l[o]||(l[o]={}),c=O(d,r,i?s:null);if(c)return void(c.oneOff=c.oneOff&&n);const m=C(r,t.replace(k,"")),g=i?function(e,t,s){return function a(n){const i=e.querySelectorAll(t);for(let{target:r}=n;r&&r!==this;r=r.parentNode)for(const o of i)if(o===r)return q(n,{delegateTarget:r}),a.oneOff&&D.off(e,n.type,t,s),s.apply(r,[n])}}(e,s,r):function(e,t){return function s(a){return q(a,{delegateTarget:e}),s.oneOff&&D.off(e,a.type,t),t.apply(e,[a])}}(e,r);g.delegationSelector=i?s:null,g.callable=r,g.oneOff=n,g.uidEvent=m,d[m]=g,e.addEventListener(o,g,i)}function N(e,t,s,a,n){const i=O(t[s],a,n);i&&(e.removeEventListener(s,i,Boolean(n)),delete t[s][i.uidEvent])}function P(e,t,s,a){const n=t[s]||{};for(const[i,r]of Object.entries(n))i.includes(a)&&N(e,t,s,r.callable,r.delegationSelector)}function q(e,t={}){for(const[s,a]of Object.entries(t))try{e[s]=a}catch{Object.defineProperty(e,s,{configurable:!0,get:()=>a})}return e}const D={on(e,t,s,a){j(e,t,s,a,!1)},one(e,t,s,a){j(e,t,s,a,!0)},off(e,t,s,a){if("string"!=typeof t||!e)return;const[n,i,r]=$(t,s,a),o=r!==t,l=M(e),d=l[r]||{},c=t.startsWith(".");if(void 0===i){if(c)for(const s of Object.keys(l))P(e,l,s,t.slice(1));for(const[s,a]of Object.entries(d)){const n=s.replace(L,"");o&&!t.includes(n)||N(e,l,r,a.callable,a.delegationSelector)}}else{if(!Object.keys(d).length)return;N(e,l,r,i,n?s:null)}},trigger(e,t,s){if("string"!=typeof t||!e)return null;const a=q(new Event(t,{bubbles:!0,cancelable:!0}),s);return e.dispatchEvent(a),a}},I=D,H=e=>({error:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-success" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-2" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(252, 191, 191, .5)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-error-circle" stroke="#F74444" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><path class="ui-error-line1" d="M22.244224,22 L60.4279902,60.1837662" id="Line" stroke="#F74444" stroke-width="3" stroke-linecap="square"></path><path class="ui-error-line2" d="M60.755776,21 L23.244224,59.8443492" id="Line" stroke="#F74444" stroke-width="3" stroke-linecap="square"></path></g></g></svg>',success:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-error" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-3" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(117, 183, 152, 0.4)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-success-circle" id="Oval-2" stroke="#A5DC86" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><polyline class="ui-success-path" id="Path-2" stroke="#A5DC86" stroke-width="4" points="19 38.8036813 31.1020744 54.8046875 63.299221 28"></polyline></g></g></svg>',waiting:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-waiting" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-3" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(255, 218, 106, 0.4)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-waiting-circle" id="Oval-2" stroke="#ffda6a" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><path class="ui-waiting-line1" d="M43 63C54.598 63 64 53.598 64 42C64 30.402 54.598 21 43 21C31.402 21 22 30.402 22 42C22 53.598 31.402 63 43 63Z" stroke-width="3" stroke="#ffda6a" stroke-linecap="round" stroke-linejoin="round"/><path class="ui-waiting-line2" d="M40.6667 32.6641V44.3307H52.3334" stroke="#ffda6a" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></g></g></svg>',dots:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-three-dots-vertical" viewBox="0 0 16 16"><path d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/></svg>',cross:'<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 224.512 224.512" xml:space="preserve"><g><polygon points="224.507,6.997 217.521,0 112.256,105.258 6.998,0 0.005,6.997 105.263,112.254 0.005,217.512 6.998,224.512 112.256,119.24 217.521,224.512 224.507,217.512 119.249,112.254 "/></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g></svg>'}[e]??{}),B=(e,t="hide")=>{const s=`click.dismiss.${e.EVENT_KEY}`,a=e.NAME;I.on(document,s,`[data-vg-dismiss="${a}"]`,(function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),n(this))return;const i=_.getSelectorFromElement(this)||this.closest(`.vg-${a}`);e.getOrCreateInstance(i)[t]()}))},F={x:function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;let e,t=["MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"];for(let s=0;s<t.length;s++)try{e=new ActiveXObject(t[s]);break}catch(e){}return e},send:function(e,t,s,a,n){void 0===n&&(n=!0);let i=F.x();i.open(s,e,n),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.onreadystatechange=function(){4===i.readyState&&(200===i.status?t("success",{text:i.statusText,response:i.responseText,code:i.status}):t("error",{text:i.statusText,response:i.responseText,code:i.status}))},i.send(a)},get:function(e,t,a,n){let i=[];if(!s(t))for(let e of t)i.push(encodeURIComponent(e[0])+"="+encodeURIComponent(e[1]));F.send(e+(i.length?"?"+i.join("&"):""),a,"GET",null,n)},post:function(e,t,s,a){F.send(e,s,"POST",t,a)}},R=class{constructor(e){if(e){if(this._element=_.find(e),!this._element)throw new Error("Товарищ! Первый параметр не должен быть пустым!");this._params={},b.set(this._element,this.constructor.NAME_KEY,this)}}_getParams(e,t){return new y(t,e).get()}dispose(){b.remove(this._element,this.constructor.NAME_KEY),I.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_route(e){const t=this;let s=null;const a=e=>{s&&(s.innerHTML=e)};t._params.hasOwnProperty("ajax")&&t._params.ajax.route&&(!1 in t._params.ajax&&(t._params.ajax.method="get"),"target"in t._params.ajax&&t._params.ajax.target&&(s=_.find(t._params.ajax.target)),"loader"in t._params.ajax&&t._params.ajax.loader&&a('<div class="vg-loader"></div>'),F[t._params.ajax.method](t._params.ajax.route,t._params.ajax.data||{},(function(t,s){a(s.response),d(e,[t,s])})))}_dismissElement(){let e=H("cross"),t=this._element.querySelector(".vg-btn-close");t&&(t.querySelector("svg")||t.insertAdjacentHTML("beforeend",e))}_queueCallback(e,t,s=!0,a){!function(e,t,s=!0,a){if(!s)return void d(e);const n=a||(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:s}=window.getComputedStyle(e);const a=Number.parseFloat(t),n=Number.parseFloat(s);return a||n?(t=t.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(s))):0})(t)+5;let i=!1;const r=({target:s})=>{s===t&&(i=!0,t.removeEventListener(c,r),d(e))};t.addEventListener(c,r),setTimeout((()=>{i||(e=>{e.dispatchEvent(new Event(c))})(t)}),n)}(e,t,s,a)}static getInstance(e){return b.get(_.find(e),this.NAME_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,s(t)?{}:t)}static get DATA_KEY(){return`vg.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}},X=class{static append(){document.body.style.paddingRight=function(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}()+"px",document.body.style.overflow="hidden"}static destroy(){document.body.style.overflow="",document.body.style.paddingRight="",w.get(document.body,"style")||w.remove(document.body,"style")}},z="vg-backdrop",W="fade";class Y{static show(e){Y._append(),d(e)}static hide(e){Y._destroy(),d(e)}static _append(){if(_.find("."+z))return!1;let e=document.createElement("div");e.classList.add(z),document.body.append(e),setTimeout((()=>{e.classList.add(W)}),50),I.on(e,"mousedown.vg.backdrop",(()=>{Y.hide(),X.destroy()}))}static _destroy(){let e=_.find("."+z);e&&(e.classList.remove(W),setTimeout((()=>{e.remove()}),500))}}const V=Y,G="vg.sidebar",K="show",U=`${G}.hide`,J=`${G}.hidden`,Z=`${G}.show`,Q=`${G}.shown`,ee=`keydown.dismiss.${G}`,te=`hidePrevented.${G}`,se=`click.${G}.data.api`;class ae extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({backdrop:!0,overflow:!0,keyboard:!0,ajax:{route:"",target:"",method:"get"}},t)),this._addEventListeners(),this._dismissElement()}static get NAME(){return"sidebar"}static get NAME_KEY(){return G}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){const t=this;n(t._element)||(this._route(),I.trigger(this._element,Z,{relatedTarget:e}).defaultPrevented||(t._params.backdrop&&V.show(),t._params.overflow&&X.append(),t._element.classList.add(K),this._queueCallback((()=>{I.on(_.find(".vg-backdrop"),"mousedown.vg.backdrop",(function(){t.hide()})),I.trigger(this._element,Q,{relatedTarget:e})}),this._element,!0,50)))}hide(){const e=this;n(e._element)||I.trigger(this._element,U).defaultPrevented||(e._params.backdrop&&V.hide((function(){e._params.overflow&&X.destroy()})),e._params.overflow&&X.destroy(),e._element.setAttribute("aria-expanded",!1),e._element.classList.remove(K),this._queueCallback((()=>I.trigger(this._element,J)),this._element,!0))}dispose(){super.dispose()}_isShown(){return this._element.classList.contains(K)}_addEventListeners(){I.on(document,ee,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():I.trigger(this._element,te))}))}}B(ae),I.on(document,se,'[data-vg-toggle="sidebar"]',(function(e){const t=_.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),n(this))return;this.setAttribute("aria-expanded",!0),I.one(t,J,(()=>{this.setAttribute("aria-expanded",!1)}));const s=_.find(".vg-sidebar.show");s&&s!==t&&ae.getInstance(s).hide(),ae.getOrCreateInstance(t).toggle(this)}));const ne=ae,ie="vg.collapse",re="show",oe="vg-collapse",le="vg-collapsing",de=`:scope .${oe} .${oe}`,ce='[data-vg-toggle="collapse"]',me=`${ie}.hide`,ge=`${ie}.hidden`,he=`${ie}.show`,ue=`${ie}.shown`,pe=`click.${ie}.data.api`;class fe extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({toggle:!0,parent:null,ajax:{route:"",target:"",method:"get"}},t)),this._isTransitioning=!1,this._triggerArray=[];const s=_.findAll(ce);for(const e of s){const t=_.getSelectorFromElement(e),s=_.findAll(t).filter((e=>e===this._element));null!==t&&s.length&&this._triggerArray.push(e)}this._initializeChildren(),this._params.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._params.toggle&&this.toggle()}static get NAME(){return"collapse"}static get NAME_KEY(){return ie}toggle(e){return this._isShown()?this.hide():this.show(e)}show(){const e=this;if(e._isTransitioning||e._isShown())return;let t=[];if(!(e._params.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((e=>e!==this._element)).map((e=>fe.getOrCreateInstance(e,{toggle:!1})))),t.length&&t[0]._isTransitioning||I.trigger(e._element,he).defaultPrevented)){for(const e of t)e.hide();e._element.classList.remove(oe),e._element.classList.add(le),e._element.style.height=0,e._addAriaAndCollapsedClass(e._triggerArray,!0),e._isTransitioning=!0,e._route(),e._queueCallback((()=>{e._isTransitioning=!1,e._element.classList.remove(le),e._element.classList.add(oe,re),e._element.style.height="",I.trigger(e._element,ue)}),e._element,!0),e._element.style.height=`${e._element.scrollHeight}px`}}hide(){const e=this;if(!e._isTransitioning&&e._isShown()&&!I.trigger(e._element,me).defaultPrevented){e._element.style.height=`${this._element.getBoundingClientRect().height}px`,m(e._element),e._element.classList.add(le),e._element.classList.remove(oe,re);for(const t of e._triggerArray){const s=_.getElementFromSelector(t);s&&!e._isShown(s)&&e._addAriaAndCollapsedClass([t],!1)}e._isTransitioning=!0,e._element.style.height="",e._queueCallback((()=>{e._isTransitioning=!1,e._element.classList.remove(le),e._element.classList.add(oe),I.trigger(e._element,ge)}),e._element,!0)}}dispose(){super.dispose()}_isShown(e=this._element){return e.classList.contains(re)}_addAriaAndCollapsedClass(e,t){if(e.length)for(const s of e)this._changeStateButton(s,t)}_initializeChildren(){if(!this._params.parent)return;const e=this._getFirstLevelChildren(ce);for(const t of e){const e=_.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=_.find(de,this._params.parent);return _.find(e,this._params.parent).filter((e=>!t.includes(e)))}_changeStateButton(e,t){e.classList.toggle("vg-collapsed",!t),e.setAttribute("aria-expanded",t),e.innerHTML=w.get(e,`data-${t?"hide":"show"}-text`)||e.innerHTML}}I.on(document,pe,ce,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault(),_.getMultipleElementsFromSelector(this).forEach((function(e){fe.getOrCreateInstance(e,{toggle:!1}).toggle()}))}));const _e=fe,ve=class{constructor(){this.breakpoints={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400,xxxl:1600}}static check(e){return(new this).define(e)}static checkMobileOrTablet(){let e=!1;var t;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.slice(0,4)))&&(e=!0),e}define(e){let t=window.innerWidth,s=this._checkResponsiveClass(e),a=this.breakpoints,n=Object.keys(a).find((e=>a[e]===s)),i=Object.keys(a),r=i.indexOf(n);return t>=a[i[r+1]]}_checkResponsiveClass(e){let t=e._element,s=e._params,a=0;return a=t.classList.contains(s.classes.XXXL)?this.breakpoints.xxxl:t.classList.contains(s.classes.XXL)?this.breakpoints.xxl:t.classList.contains(s.classes.XL)?this.breakpoints.xl:t.classList.contains(s.classes.LG)?this.breakpoints.lg:t.classList.contains(s.classes.MD)?this.breakpoints.md:t.classList.contains(s.classes.SM)?this.breakpoints.sm:(t.classList.contains(s.classes.XS),this.breakpoints.xs),a}},be="vg.nav",we="show",ye="fade",ke="active",xe=`${be}.hide`,Le=`${be}.hidden`,Ee=`${be}.show`,Ae=`${be}.shown`,Se=`mouseover.${be}.data.api`,Te=`mouseout.${be}.data.api`,Ce=`click.${be}.data.api`,Me=`keyup.${be}.data.api`,Oe=`resize.${be}.data.api`;class $e extends R{constructor(e,t={}){super(e),this._params=this._getParams(e,l({breakpoint:!1,placement:"horizontal",classes:{hamburgerActive:"vg-nav-hamburger-active",hamburgerAlways:"vg-nav-hamburger-always",hamburger:"vg-nav-hamburger",container:"vg-nav-container",wrapper:"vg-nav-wrapper",active:"vg-nav-active",expand:"vg-nav-expand",cloned:"vg-nav-cloned",hover:"vg-nav-hover",flip:"vg-nav-flip",XXXL:"vg-nav-xxxl",XXL:"vg-nav-xxl",XL:"vg-nav-xl",LG:"vg-nav-lg",MD:"vg-nav-md",SM:"vg-nav-sm",XS:"vg-nav-xs"},expand:!0,hover:!1,position:!0,collapse:!0,toggle:'<span class="default"></span>',hamburger:{enable:!0,always:!1,title:"",body:null},callback:g,animation:!0,timeoutAnimation:300,ajax:{route:"",target:"",method:"get"}},t)),this._navigation=null,this.navigation="."+this._params.classes.wrapper,this.movedLinks=[],this.$links=_.findAll("."+this._params.classes.wrapper+" > li",this.navigation),!1===this._params.animation&&(this._params.timeoutAnimation=10)}static get NAME(){return"nav"}static get NAME_KEY(){return be}get navigation(){return this._navigation}set navigation(e){let t=_.find(e,this._element);t&&(this._navigation=t)}build(){if(!this.navigation)return;let e=this._params;if(this._element.classList.add(e.classes.container),this._element.classList.add("vg-nav-"+e.placement),e.breakpoint||(e.expand=!1),e.hamburger.always?this._element.classList.add(e.classes.hamburgerAlways):e.breakpoint&&e.expand?!1!==e.breakpoint&&this._element.classList.add("vg-nav-"+e.breakpoint):this._element.classList.add(e.classes.expand),e.hover&&(this._element.classList.add(e.classes.hover),ve.checkMobileOrTablet()&&this._element.classList.remove(e.classes.hover)),e.expand&&!e.hamburger.body&&null===_.find("."+e.classes.hamburger,this._element)){let t="",s='<span class="'+e.classes.hamburger+'--lines"><span></span><span></span><span></span></span>';e.hamburger.title&&(t='<span class="'+e.classes.hamburger+'--title">'+e.hamburger.title+"</span>"),null!==e.hamburger.body&&(s=e.hamburger.body),this._element.insertAdjacentHTML("afterbegin",'<a href="#sidebar-nav" class="'+e.classes.hamburger+'" data-vg-toggle="sidebar">'+t+s+"</a>")}if(e.toggle){let t=[..._.findAll(".dropdown-mega > a, .dropdown > a",this._element)],s='<span class="toggle">'+e.toggle+"</span>";t.length&&t.forEach((function(e){e.querySelector(".toggle")||e.closest(".dots")||(e.setAttribute("aria-expanded","false"),e.insertAdjacentHTML("beforeend",s))}))}e.collapse&&ve.check(this)&&"vertical"!==e.placement&&function(e){let t=e.navigation.clientWidth,s=0,a=_.find(".dots",e.navigation),n=H("dots");if(e.$links.length){if(a)s=a.clientWidth;else{let t=_.find("a",e.$links[0]),a=getComputedStyle(t);s=o(a.paddingLeft.slice(0,-2))+o(a.paddingRight.slice(0,-2))+16}for(let n of e.$links)s+=n.getBoundingClientRect().width,t<s?(e.movedLinks.push(n),n.remove()):e.movedLinks.length&&(a?e.navigation.insertBefore(e.movedLinks[0],a):e.navigation.appendChild(e.movedLinks[0]),e.movedLinks.splice(0,1));e.movedLinks.length?a||e.navigation.insertAdjacentHTML("beforeend",'<li class="dropdown dots"><a href="#" aria-expanded="false">'+n+"</a></li>"):a&&a.remove();let i=e.navigation.querySelector(".dots");if(i&&e.movedLinks.length){let t=i.querySelector("ul");if(t)for(let s of e.movedLinks)t.prepend(s);else{let t=document.createElement("ul");t.classList.add("dropdown-content"),t.classList.add("right");for(let s of e.movedLinks)t.prepend(s);i.appendChild(t)}}}}(this),"afterInit"in this._params.callback&&d(this._params.callback.afterInit,[this])}show(e){let t=e.relatedTarget;if(!t||n(t))return;if(t.closest(".dropdown-content")||t.classList.add("first"),I.trigger(t,Ee,{relatedTarget:e}).defaultPrevented)return;let s=_.find(".dropdown-content",t),a=t.firstElementChild;a&&a.setAttribute("aria-expanded","true"),s.classList.add(we),t.classList.add(ke),function(e){let{width:t,right:s}=e.getBoundingClientRect(),a=window.innerWidth-s-t;e.classList.remove("right"),e.classList.remove("left");let n=e.closest("li").querySelectorAll("ul");if(a>t)for(const e of n)e.classList.add("left");else for(const e of n)e.classList.add("right")}(s),this._queueCallback((()=>{s.classList.add(ye),I.trigger(t,Ae,e)}),s,!0,50)}hide(e){const t=this;if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))I.off(e,"mouseover",g);let s=e.relatedTarget;if("elm"in e&&e.elm&&(s=e.elm),s){if(I.trigger(s,xe).defaultPrevented)return;s.classList.remove(ke),s.classList.contains("first")&&s.classList.remove("first"),[..._.findAll("."+we,s)].forEach((function(s,a){s.classList.remove(ye);let n=s.closest(".dropdown");n.classList.contains(ke)&&n.classList.remove(ke);let i=s.previousElementSibling;if(i&&i.setAttribute("aria-expanded","false"),0===a){const a=()=>{s.classList.remove(we),I.trigger(s,Le,e)};t._queueCallback(a,s,!0,500)}}))}}static init(e,t={}){const s=$e.getOrCreateInstance(e,t);s.build();let a=_.findAll(".dropdown",s._navigation);s._params.hover?[...a].forEach((function(e){let t=null;I.on(e,Se,(function(e){if(t)return;$e.hideOpenDrops(e);let a=e.target.closest(".dropdown");if(!a)return;if(!s.navigation.contains(a))return;t=a;let n={relatedTarget:a};s.show(n)})),I.on(e,Te,(function(e){if(!t)return;let a=e.relatedTarget.closest(".dropdown"),n=t;for(;a;){if(a===t)return;a=a.parentNode}t=null,s.hide({relatedTarget:a,elm:n})}))})):(I.on(document,Me,$e.clearDrops),I.on(document,Ce,$e.clearDrops),I.on(document,Ce,".vg-nav a",(function(e){if(!w.has(this,"aria-expanded"))return;"click"in s._params.callback&&d(s._params.callback.click,[this]),e.preventDefault();let t=this.closest(".vg-nav"),a=t.querySelector(".first"),r=this.closest(".dropdown");if(r&&(!n(r)||i(r))){if(a&&this.closest(".first")){if(r.classList.contains("active"))return void s.hide({relatedTarget:r})}else[..._.findAll(".active",t)].forEach((function(e){e&&e!==r&&s.hide({relatedTarget:e})}));s.show({relatedTarget:r})}})));const r=document.getElementById("sidebar-nav");let o=s._element.querySelector("."+s._params.classes.hamburger);r&&o&&(r.addEventListener("vg.sidebar.show",(function(){o.classList.add(s._params.classes.hamburgerActive)})),r.addEventListener("vg.sidebar.hide",(function(){o.classList.remove(s._params.classes.hamburgerActive)})))}static clearDrops(e){2===e.button||"keyup"===e.type&&"Tab"!==e.key||$e.hideOpenDrops(e)}static hideOpenDrops(e){const t=_.findAll(".dropdown:not(.disabled):not(:disabled).active");for(const s of t){const t=$e.getInstance(s.closest(".vg-nav"));if(!t)continue;if(e.target.closest(".first"))return;const a={relatedTarget:s};"click"===e.type&&(a.clickEvent=e),t.hide(a)}}}I.on(window,Oe,(function(e){$e.getOrCreateInstance(".vg-nav",{}).build()}));const je=$e,Ne=class{constructor(e={}){this.params=l({element:null,drop:null},e)}_getPlacement(){const e=this,t=e=>{let s=e.parentNode,a=getComputedStyle(s).overflow;return"BODY"===s.tagName?null:"visible"!==a?s:void t(s)};let s,a,n=!1,i=e.params.drop.getBoundingClientRect(),r=e.params.element.getBoundingClientRect();if(t(e.params.element))n=!0,s=i.top,a=i.left;else{let t=getComputedStyle(e.params.drop);s=o(t.top.slice(0,-2)),a=o(t.left.slice(0,-2))}return i.left+i.width>window.innerWidth&&(a=r.width-i.width),{isFixed:n,top:s,left:a}}},Pe="vg.dropdown",qe="show",De="fade",Ie="vg-dropdown-content",He='[data-vg-toggle="dropdown"]',Be=`${Pe}.hide`,Fe=`${Pe}.hidden`,Re=`${Pe}.show`,Xe=`${Pe}.shown`,ze=`keyup.${Pe}.data.api`,We=`keydown.${Pe}.data.api`,Ye=`click.${Pe}.data.api`,Ve=`mouseover.${Pe}.data.api`,Ge=`mouseout.${Pe}.data.api`;class Ke extends R{constructor(e,t){super(e,t);let s={offset:[0,2],over:!1,backdrop:!0,overflow:!0,keyboard:!0,placement:"bottom",animation:!0,timeoutAnimation:350,hover:!1,ajax:{route:"",target:"",method:"get"}};"offset"in t&&Array.isArray(t.offset)&&(s.offset=t.offset),this._params=this._getParams(e,l(s,t)),this._parent=this._element.parentNode,this._drop=_.find("."+Ie,this._parent),this._isPlacement=!1,!1===this._params.animation&&(this._params.timeoutAnimation=10)}static get NAME(){return"dropdown"}static get NAME_KEY(){return Pe}toggle(){return this._isShown()?this.hide():this.show()}show(){if(n(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!I.trigger(this._element,Re,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))I.on(e,"mouseover",g);this._route(),this._element.setAttribute("aria-expanded",!0),this._element.classList.add(qe),this._drop.classList.add(qe),this._setPlacement(),this._queueCallback((()=>{this._drop.classList.add(De),I.trigger(this._element,Xe,e)}),this._drop,!0,50)}}hide(){if(n(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){return super.dispose()}_isShown(){return this._element.classList.contains(qe)}_completeHide(e){if(!I.trigger(this._element,Be,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))I.off(e,"mouseover",g);this._drop.classList.remove(De),this._element.classList.remove(qe),this._element.setAttribute("aria-expanded","false"),this._queueCallback((()=>{this._drop.classList.remove(qe),I.trigger(this._element,Fe,e)}),this._parent,!0,this._params.timeoutAnimation)}}_setPlacement(){const e=this;if(!e._isPlacement){let t=new Ne({element:this._parent,drop:this._drop})._getPlacement();t.isFixed&&(e._drop.style.position="fixed",e._drop.style.transform="translateY(-20%)"),e._drop.style.left=t.left+"px",e._drop.style.top=t.top+"px"}e._params.offset&&(e._drop.style.paddingTop=e._params.offset[1]+"px",e._drop.style.paddingRight=e._params.offset[0]+"px"),e._isPlacement=!0}static init(e,t={}){const s=Ke.getOrCreateInstance(e,t);if(s._params.hover){let e=null;I.on(s._parent,Ve,(function(t){if(e)return;Ke.hideOpenToggles(t);let a=t.target.closest(".vg-dropdown");a&&s._parent.contains(a)&&(e=a,s.show())})),I.on(s._parent,Ge,(function(t){if(!e)return;let a=t.relatedTarget;for(;a;){if(a===e)return;a=a.parentNode}e=null,s._completeHide({relatedTarget:s._element})}))}else I.on(document,ze,He,Ke.keydownHandler),I.on(document,We,"."+Ie,Ke.keydownHandler),I.on(document,ze,Ke.clearDrops),I.on(document,Ye,Ke.clearDrops),I.on(e,Ye,(function(e){e.preventDefault(),s.toggle()}))}static hideOpenToggles(e){const t=_.findAll('[data-vg-toggle="dropdown"]:not(.disabled):not(:disabled).show');for(const s of t){const t=Ke.getInstance(s);if(!t)continue;if(e.target.closest("."+Ie)===t._drop)return;if(e.composedPath().includes(t._element))continue;const a={relatedTarget:t._element};"click"===e.type&&(a.clickEvent=e),t._completeHide(a)}}static keydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),s="Escape"===e.key,a=["ArrowUp","ArrowDown"].includes(e.key);if(!a&&!s)return;if(t&&!s)return;e.preventDefault();const n=this.matches(He)?this:_.find(He,e.delegateTarget.parentNode),i=Ke.getOrCreateInstance(n);if(a)return e.stopPropagation(),void i.show();i._isShown()&&(e.stopPropagation(),i.hide(),n.focus())}static clearDrops(e){2===e.button||"keyup"===e.type&&"Tab"!==e.key||Ke.hideOpenToggles(e)}}const Ue=Ke,Je=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Ze=".sticky-top",Qe="padding-right",et="margin-right",tt=class{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Qe,(t=>t+e)),this._setElementAttributes(Je,Qe,(t=>t+e)),this._setElementAttributes(Ze,et,(t=>t-e))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Qe),this._resetElementAttributes(Je,Qe),this._resetElementAttributes(Ze,et)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,s){const a=this.getWidth();this._applyManipulationCallback(e,(e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+a)return;this._saveInitialAttribute(e,t);const n=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${s(Number.parseFloat(n))}px`)}))}_saveInitialAttribute(e,t){const s=e.style.getPropertyValue(t);s&&w.get(e,t,s)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,(e=>{const s=w.get(e,t);null!==s?(w.remove(e,t),e.style.setProperty(t,s)):e.style.removeProperty(t)}))}_applyManipulationCallback(e,t){if(a(e))t(e);else for(const s of _.findAll(e,this._element))t(s)}},st="vg.modal",at="vg-modal-open",nt="show",it="vg-modal-static",rt=`${st}.hide`,ot=`${st}.hidden`,lt=`${st}.show`,dt=`${st}.shown`,ct=`${st}.resize`,mt=`keydown.dismiss.${st}`,gt=`hidePrevented.${st}`,ht=`click.${st}.data.api`,ut=`mousedown.dismiss${st}`,pt=`click.dismiss${st}`;class ft extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({backdrop:!0,focus:!0,keyboard:!0,fields:[],ajax:{route:"",target:"",method:"get",loader:!1},animation:{name:["animate__backInUp","animate__backOutUp"],duration:1e3,delay:1e3,repeat:1},classes:{general:"vg-modal",dialog:"vg-modal-dialog",content:"vg-modal-content",header:"vg-modal-header",title:"vg-modal-title",body:"vg-modal-body",footer:"vg-modal-footer",animated:"animate__animated"}},t)),this._button=null,this._dialog=_.find(".vg-modal-dialog",this._element),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new tt,this._addEventListeners(),this._dismissElement()}static get NAME(){return"modal"}static get NAME_KEY(){return st}static init(e,t,s){ft.build(e,t,s)}static build(e,t,s){if("string"!=typeof e)return;let a=document.createElement("div");a.classList.add("vg-modal","fade"),a.id=e;let n=document.createElement("div");n.classList.add("vg-modal-dialog");let i=document.createElement("div");i.classList.add("vg-modal-content");let r=document.createElement("button");w.set(r,"type","button"),w.set(r,"data-vg-dismiss","modal"),w.set(r,"data-vg-target","#"+e),w.set(r,"aria-label","close"),r.classList.add("vg-btn-close"),i.append(r);let o=document.createElement("div");o.classList.add("vg-modal-body"),i.append(o),n.append(i),a.append(n),document.body.append(a),d(s,[ft.getOrCreateInstance(a,t)])}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){n(this._element)||(this._route(),I.trigger(this._element,lt,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(at),this._addFieldsInModal(e),this._adjustDialog(),V.show((()=>this._showElement(e)))))}hide(){this._isShown&&!this._isTransitioning&&(I.trigger(this._element,rt).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._element.classList.remove(nt),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,V.hide((()=>{document.body.classList.remove(at),this._resetAdjustments(),this._scrollBar.reset(),I.trigger(this._element,ot)}))}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=_.find(".vg-modal-body",this._dialog);t&&(t.scrollTop=0),m(this._element),this._element.classList.add(nt),this._queueCallback((()=>{this._params.focus,this._isTransitioning=!1,I.trigger(this._element,dt,{relatedTarget:e})}),this._dialog,this._isAnimated())}_isAnimated(){return this._element.classList.contains("fade")}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),s=t>0;if(s&&!e){const e=u()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!s&&e){const e=u()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}_addEventListeners(){I.on(this._element,mt,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():this._triggerBackdropTransition())})),I.on(window,ct,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),I.on(this._element,ut,(e=>{I.one(this._element,pt,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._params.backdrop?this._params.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_triggerBackdropTransition(){if(I.trigger(this._element,gt).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(it)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(it),this._queueCallback((()=>{this._element.classList.remove(it),this._queueCallback((()=>{this._element.style.overflowY=t}),this._dialog)}),this._dialog),this._element.focus())}_addFieldsInModal(e){this._params=this._getParams(e,this._params),this._params.fields.length&&this._params.fields.forEach((function(e){if(!1 in e&&!1 in e)return;let t=_.findAll("[data-"+e.name+"]");if(t.length)for(const s of t)switch(s.tagName){case"INPUT":s.value=e.value;break;case"IMG":w.set(s,"src",e.value);break;default:s.innerHTML=e.value}}))}}B(ft),I.on(document,ht,'[data-vg-toggle="modal"]',(function(e){const t=_.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),I.one(t,lt,(e=>{e.defaultPrevented||I.one(t,ot,(()=>{i(this)&&this.focus()}))}));const s=_.find(".vg-modal.show");s&&ft.getInstance(s).hide(),ft.getOrCreateInstance(t).toggle(this)}));const _t=ft,vt="vg.fs",bt=`submit.${vt}.data.api`;class wt extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({redirect:"",validate:!1,submit:!1,fields:[],alert:{enabled:!0,type:"modal"},ajax:{route:"",target:"",method:"get"},classes:{general:"vg-form-sender",alertCollapse:"vg-form-sender-collapse",alertModal:"vg-form-sender-modal",validation:"needs-validation",wasValidate:"was-validated"}},t)),this._params.ajax.route=w.get(this._element,"action").toLowerCase(),this._params.ajax.method=w.get(this._element,"method").toLowerCase(),this._button=_.find('[type="submit"]',this._element)||_.find('[form="'+this._element.id+'"]')||null,this._params.isBtnText="false"!==w.get(this._element,"data-btn-text"),this._params.isJsonParse="false"!==w.get(this._element,"data-json-parse"),this._params.isShowPass="true"===w.get(this._element,"data-show-pass")}static get NAME(){return"form-sender"}static get NAME_KEY(){return vt}build(){return this._element.classList.add(this._params.classes.general),this._params.validate&&(w.set(this._element,"novalidate",""),this._element.classList.add(this._params.classes.validation)),this}request(e,t){const s=this;s._alertBefore(),s._params.ajax.data=e,s._route((function(e,a){s._element.classList.remove("was-validated"),s._params.alert.enabled&&("string"==typeof e&&"error"===e?s._alertError(t,a):"string"==typeof e&&"success"===e&&s._alertSuccess(t,a)),s._params.redirect&&(window.location.href=s._params.redirect)}))}_alertBefore(){const e=this;"collapse"===e._params.alert.type&&[...document.getElementsByClassName(e._params.classes.alertCollapse)].forEach((function(e){e&&e.classList.contains("show")&&_e.getOrCreateInstance(e,{toggle:!1}).hide()})),e._statusButton("before"),I.trigger(e._element,"vg.fs.before",e)}_alertError(e,t){const s=this;s._statusButton("after"),s._jsonParse(t,"error"),I.trigger(s._element,"vg.fs.error",[e,s,t])}_alertSuccess(e,t){const s=this;s._statusButton("after"),s._jsonParse(t,"success"),I.trigger(s._element,"vg.fs.success",[e,s,t])}_statusButton(e){const t=this;if(!t._button)return;let s=t._button,a={send:"Отправляем...",text:"Отправить"};if(w.has(t._button,"data-spinner")&&"before"===e&&t._button.insertAdjacentHTML("afterbegin",'<span class="spinner-border spinner-border-sm me-2"></span>'),w.has(t._button,"data-text"))a.text=w.get(t._button,"data-text");else{let e=t._button.querySelector("[data-text]");e&&(a.text=w.get(e,"data-text"),s=e)}if(w.has(t._button,"data-text-send"))a.send=w.get(t._button,"data-text-send");else{let e=t._button.querySelector("[data-text-send]");e&&(a.send=w.get(e,"data-text-send"),s=e)}if("before"===e&&(t._params.isBtnText&&(s.innerHTML=a.send),w.set(t._button,"disabled","disabled")),"after"===e){t._params.isBtnText&&(s.innerHTML=a.text),w.remove(t._button,"disabled");let e=t._button.querySelector(".spinner-border");e&&e.remove()}}_jsonParse(e,t){const s=this;if(s._params.isJsonParse&&"string"==typeof e){let a={};try{a=JSON.parse(e),s.alert(a,t)}catch(a){s.alert(e,t)}}else s.alert(e,t)}alert(e,t){const s=this;if(r(e)&&"code"in e&&e.code&&200===e.code&&"response"in e&&e.response){let s=o(e.response);"string"==typeof s?-1===s.indexOf("Parse error")&&-1===s.indexOf("syntax error")||(t="error",e={response:{title:"Error",message:"Something went wrong, please repeat later"},text:"Something went wrong, please repeat later"}):"errors"in s&&o(s.errors)&&(t=o(s.errors)?"error":"success")}s._params.alert.enabled&&("modal"===s._params.alert.type&&s._alertModal(e,t),"collapse"===s._params.alert.type&&s._alertCollapse(e,t))}_alertModal(e,t){const s=this;[...document.getElementsByClassName("modal")].forEach((function(e){e&&e.classList.contains("show")&&bootstrap.Modal.getOrCreateInstance(e).hide()})),[...document.getElementsByClassName("vg-modal")].forEach((function(e){e&&e.classList.contains("show")&&_t.getOrCreateInstance(e).hide()}));let a=_.find("."+s._params.classes.alertModal);a&&a.remove(),setTimeout((()=>{let a=s._params.classes.general+"-"+h();_t.init(a,{classes:{alert:s._params.classes.alertModal}},(function(a){let n=a._element;n.classList.add(s._params.classes.alertModal);let i=_.find(".vg-modal-body",n);i&&i.append(s.setDataRelationStatus(n,t,e,"modal")),a.toggle()}))}),175)}_alertCollapse(e,t){const s=this;let a=_.find("."+s._params.classes.alertCollapse);a||(a=document.createElement("div"),a.classList.add(s._params.classes.alertCollapse),a.classList.add("vg-collapse"),a.id=s._params.classes.general+"-"+h(),a.append(s.setDataRelationStatus(a,t,e,"collapse")),s._element.prepend(a)),_e.getOrCreateInstance(a,{toggle:!1}).toggle()}setDataRelationStatus(e,t,s,a){let n=_.find(".vg-alert-"+t,e);if(r(s)){if("error"===t&&"code"in s&&200!==s.code&&"text"in s&&!s.text)switch(s.text="Something went wrong, please repeat later",s.code){case 400:s.text="Bad Request";break;case 401:case 403:s.text="Unauthorized";break;case 413:s.text="Forbidden";break;case 404:s.text="Not Found";break;case 422:s.text="Unprocessable Entity";break;case 500:s.text="Internal Server Error";break;case 504:s.text="Gateway Timeout"}if("response"in s){let e=o(s.response),a="",n="",i="";if("string"!=typeof e){if(!("view"in e)){if("title"in e&&(a=e.title),"error"===t&&200!==s.code&&(i=" "+s.text+" ("+s.code+")"),n+='<h4 class="vg-alert-content--title">'+a+i+"</h4>","message"in e&&(n+='<div class="vg-alert-content--message">'+e.message+"</div>"),"errors"in e){let t=o(e.errors)||null;if(r(t))for(const e in t)Array.isArray(t[e])?t[e].forEach((function(e){n+="<div>"+e+"</div>"})):n="<div>"+t[e]+"</div>"}s={view:n}}}else s.view=e}}if(n)_.find(".vg-alert-content--text",n).innerHTML=s.view;else{n=document.createElement("div"),n.classList.add("vg-alert","vg-alert-"+t,"vg-alert-"+a);let e=document.createElement("div");e.classList.add("vg-alert-content");let i=document.createElement("div");i.classList.add("vg-alert-content--icon");let r=document.createElement("i");r.innerHTML=H(t),i.append(r),e.append(i);let o=document.createElement("div");o.classList.add("vg-alert-content--text"),o.innerHTML=s.view,e.append(o),n.append(e)}return n}static init(e,t={}){wt.getOrCreateInstance(e,t).build()}}I.on(document,bt,(function(e){if(!w.has(e.target,"data-vgformsender"))return;const t=wt.getOrCreateInstance(e.target,{});if(t){if(t._params.validate&&!t._element.checkValidity())return e.preventDefault(),e.stopPropagation(),t._element.classList.add(t._params.classes.wasValidate),!1;if(!t._params.submit){e.preventDefault();let s=new FormData(t._element);return t.request(s,e)}}}));const yt=wt,kt="vg.rollup",xt=`click.${kt}.data.api`;class Lt extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({},t))}static get NAME(){return"rollup"}static get NAME_KEY(){return kt}static init(e,t={}){Lt.getOrCreateInstance(e,t).build()}build(){}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){}_isShown(){return this._element.classList.contains("show")}}I.on(document,xt,'[data-vg-toggle="rollup"]',(function(e){const t=_.getElementFromSelector(this);t&&(["A","AREA"].includes(this.tagName)&&e.preventDefault(),n(this)||(this.setAttribute("aria-expanded",!0),Lt.getOrCreateInstance(t).toggle(this)))}));const Et=Lt;vg=t})();
1
+ var vg;(()=>{"use strict";var e={d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function s(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}e.r(t),e.d(t,{VGCollapse:()=>fe,VGDropdown:()=>Ke,VGFormSender:()=>wt,VGModal:()=>ft,VGNav:()=>$e,VGRollup:()=>Lt,VGSidebar:()=>ne});const n=e=>!!i(e)&&void 0!==e.nodeType,a=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"));function i(e){return e&&"object"==typeof e}function r(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function o(...e){const t=e=>e&&"object"==typeof e;return e.reduce(((e,s)=>(Object.keys(s).forEach((n=>{const a=e[n],i=s[n];Array.isArray(a)&&Array.isArray(i)?e[n]=a.concat(...i):t(a)&&t(i)?e[n]=o(a,i):e[n]=i})),e)),{})}function l(e,t=[],s=e){return"function"==typeof e?e(...t):s}const d="transitionend",c=e=>{e.offsetHeight},m=()=>{};function g(e=7){let t="";let s=0;for(;s<e;)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random())),s+=1;return t}const h=()=>"rtl"===document.documentElement.dir,u=e=>{let t=e.getAttribute("data-vg-target");if(!t||"#"===t){let s=e.getAttribute("href");if(!s||!s.includes("#")&&!s.startsWith("."))return null;s.includes("#")&&!s.startsWith("#")&&(s=`#${s.split("#")[1]}`),t=s&&"#"!==s?s.trim():null}return t?t.split(",").map((e=>(e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e))(e))).join(","):null},p={find:(e,t=document.documentElement)=>n(e)?e:Element.prototype.querySelector.call(t,e),findAll:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),getSelectorFromElement(e){const t=u(e);return t&&p.find(t)?t:null},getElementFromSelector(e){const t=u(e);return t?p.find(t):null},getMultipleElementsFromSelector(e){const t=u(e);return t?p.findAll(t):[]}},f=p,_=new Map,v={set(e,t,s){_.has(e)||_.set(e,new Map);const n=_.get(e);n.has(t)||0===n.size?n.set(t,s):console.error(`VGApp не допускает более одного экземпляра для каждого элемента. Связанный экземпляр: ${Array.from(n.keys())[0]}.`)},get:(e,t)=>_.has(e)&&_.get(e).get(t)||null,remove(e,t){if(!_.has(e))return;const s=_.get(e);s.delete(t),0===s.size&&_.delete(e)}},b={get(e,t="data",s=!0){if(!e)return{};if("data"===t){let t=["data-vg-toggle","data-vg-target","data-vg-dismiss"],n={},a=[].filter.call(e.attributes,(function(e){return/^data-/.test(e.name)}));return a.length&&a.forEach((function(e){let a=e.name;t.includes(a)||(s&&(a=a.slice(5)),n[a]=r(e.value))})),n}return"all"===t?e.getAttributeNames().reduce(((t,s)=>({...t,[s]:e.getAttribute(s)})),{}):e.getAttribute(t)},has:(e,t)=>e.hasAttribute(t),set(e,t,s){n(e)&&t&&e.setAttribute(t,s)},remove(e,t){n(e)&&t&&e.removeAttribute(t)}},w=class{constructor(e,t=null){this._params=this.merge(e,t)}get(){return this._params}fromElement(e){return n(e)?b.get(e):{}}merge(e,t){let s=o(e,this.fromElement(t));for(let e in s)if(-1!==e.indexOf("-")){let t=e.split("-"),n=r(s[e]);t[0]in s&&t[1]in s[t[0]]&&(s[t[0]][t[1]]=n),delete s[e]}return"params"in s&&(s=o(s,s.params),delete s.params),s}},y=/[^.]*(?=\..*)\.|.*/,k=/\..*/,x=/::\d+$/,L={};let E=1;const A={mouseenter:"mouseover",mouseleave:"mouseout"},S=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","submit","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function T(e,t){return t&&`${t}::${E++}`||e.uidEvent||E++}function C(e){const t=T(e);return e.uidEvent=t,L[t]=L[t]||{},L[t]}function M(e,t,s=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===s))}function O(e,t,s){const n="string"==typeof t,a=n?s:t||s;let i=(r=(r=e).replace(k,""),A[r]||r);var r;return S.has(i)||(i=e),[n,a,i]}function $(e,t,s,n,a){if("string"!=typeof t||!e)return;let[i,r,o]=O(t,s,n);if(t in A){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};r=e(r)}const l=C(e),d=l[o]||(l[o]={}),c=M(d,r,i?s:null);if(c)return void(c.oneOff=c.oneOff&&a);const m=T(r,t.replace(y,"")),g=i?function(e,t,s){return function n(a){const i=e.querySelectorAll(t);for(let{target:r}=a;r&&r!==this;r=r.parentNode)for(const o of i)if(o===r)return P(a,{delegateTarget:r}),n.oneOff&&q.off(e,a.type,t,s),s.apply(r,[a])}}(e,s,r):function(e,t){return function s(n){return P(n,{delegateTarget:e}),s.oneOff&&q.off(e,n.type,t),t.apply(e,[n])}}(e,r);g.delegationSelector=i?s:null,g.callable=r,g.oneOff=a,g.uidEvent=m,d[m]=g,e.addEventListener(o,g,i)}function j(e,t,s,n,a){const i=M(t[s],n,a);i&&(e.removeEventListener(s,i,Boolean(a)),delete t[s][i.uidEvent])}function N(e,t,s,n){const a=t[s]||{};for(const[i,r]of Object.entries(a))i.includes(n)&&j(e,t,s,r.callable,r.delegationSelector)}function P(e,t={}){for(const[s,n]of Object.entries(t))try{e[s]=n}catch{Object.defineProperty(e,s,{configurable:!0,get:()=>n})}return e}const q={on(e,t,s,n){$(e,t,s,n,!1)},one(e,t,s,n){$(e,t,s,n,!0)},off(e,t,s,n){if("string"!=typeof t||!e)return;const[a,i,r]=O(t,s,n),o=r!==t,l=C(e),d=l[r]||{},c=t.startsWith(".");if(void 0===i){if(c)for(const s of Object.keys(l))N(e,l,s,t.slice(1));for(const[s,n]of Object.entries(d)){const a=s.replace(x,"");o&&!t.includes(a)||j(e,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(d).length)return;j(e,l,r,i,a?s:null)}},trigger(e,t,s){if("string"!=typeof t||!e)return null;const n=P(new Event(t,{bubbles:!0,cancelable:!0}),s);return e.dispatchEvent(n),n}},I=q,D=e=>({error:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-success" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-2" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(252, 191, 191, .5)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-error-circle" stroke="#F74444" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><path class="ui-error-line1" d="M22.244224,22 L60.4279902,60.1837662" id="Line" stroke="#F74444" stroke-width="3" stroke-linecap="square"></path><path class="ui-error-line2" d="M60.755776,21 L23.244224,59.8443492" id="Line" stroke="#F74444" stroke-width="3" stroke-linecap="square"></path></g></g></svg>',success:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-error" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-3" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(117, 183, 152, 0.4)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-success-circle" id="Oval-2" stroke="#A5DC86" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><polyline class="ui-success-path" id="Path-2" stroke="#A5DC86" stroke-width="4" points="19 38.8036813 31.1020744 54.8046875 63.299221 28"></polyline></g></g></svg>',waiting:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-waiting" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-3" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(255, 218, 106, 0.4)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-waiting-circle" id="Oval-2" stroke="#ffda6a" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><path class="ui-waiting-line1" d="M43 63C54.598 63 64 53.598 64 42C64 30.402 54.598 21 43 21C31.402 21 22 30.402 22 42C22 53.598 31.402 63 43 63Z" stroke-width="3" stroke="#ffda6a" stroke-linecap="round" stroke-linejoin="round"/><path class="ui-waiting-line2" d="M40.6667 32.6641V44.3307H52.3334" stroke="#ffda6a" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></g></g></svg>',dots:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-three-dots-vertical" viewBox="0 0 16 16"><path d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/></svg>',cross:'<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 224.512 224.512" xml:space="preserve"><g><polygon points="224.507,6.997 217.521,0 112.256,105.258 6.998,0 0.005,6.997 105.263,112.254 0.005,217.512 6.998,224.512 112.256,119.24 217.521,224.512 224.507,217.512 119.249,112.254 "/></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g></svg>'}[e]??{}),H=(e,t="hide")=>{const s=`click.dismiss.${e.EVENT_KEY}`,n=e.NAME;I.on(document,s,`[data-vg-dismiss="${n}"]`,(function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),a(this))return;const i=f.getSelectorFromElement(this)||this.closest(`.vg-${n}`);e.getOrCreateInstance(i)[t]()}))},B={x:function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;let e,t=["MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"];for(let s=0;s<t.length;s++)try{e=new ActiveXObject(t[s]);break}catch(e){}return e},send:function(e,t,s,n,a){void 0===a&&(a=!0);let i=B.x();i.open(s,e,a),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.onreadystatechange=function(){4===i.readyState&&(200===i.status?t("success",{text:i.statusText,response:i.responseText,code:i.status}):t("error",{text:i.statusText,response:i.responseText,code:i.status}))},i.send(n)},get:function(e,t,n,a){let i=[];if(!s(t))for(let e of t)i.push(encodeURIComponent(e[0])+"="+encodeURIComponent(e[1]));B.send(e+(i.length?"?"+i.join("&"):""),n,"GET",null,a)},post:function(e,t,s,n){B.send(e,s,"POST",t,n)}},F=class{constructor(e){if(e){if(this._element=f.find(e),!this._element)throw new Error("Товарищ! Первый параметр не должен быть пустым!");this._params={},v.set(this._element,this.constructor.NAME_KEY,this)}}_getParams(e,t){return new w(t,e).get()}dispose(){v.remove(this._element,this.constructor.NAME_KEY),I.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_route(e){const t=this;let s=null;const n=e=>{s&&(s.innerHTML=e)};t._params.hasOwnProperty("ajax")&&t._params.ajax.route&&(!1 in t._params.ajax&&(t._params.ajax.method="get"),"target"in t._params.ajax&&t._params.ajax.target&&(s=f.find(t._params.ajax.target)),"loader"in t._params.ajax&&t._params.ajax.loader&&n('<div class="vg-loader"></div>'),B[t._params.ajax.method](t._params.ajax.route,t._params.ajax.data||{},(function(t,s){n(s.response),l(e,[t,s])})))}_dismissElement(){let e=D("cross"),t=this._element.querySelector(".vg-btn-close");t&&(t.querySelector("svg")||t.insertAdjacentHTML("beforeend",e))}_queueCallback(e,t,s=!0,n){!function(e,t,s=!0,n){if(!s)return void l(e);const a=n||(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:s}=window.getComputedStyle(e);const n=Number.parseFloat(t),a=Number.parseFloat(s);return n||a?(t=t.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(s))):0})(t)+5;let i=!1;const r=({target:s})=>{s===t&&(i=!0,t.removeEventListener(d,r),l(e))};t.addEventListener(d,r),setTimeout((()=>{i||(e=>{e.dispatchEvent(new Event(d))})(t)}),a)}(e,t,s,n)}static getInstance(e){return v.get(f.find(e),this.NAME_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,s(t)?{}:t)}static get DATA_KEY(){return`vg.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}},R=class{static append(){document.body.style.paddingRight=function(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}()+"px",document.body.style.overflow="hidden"}static destroy(){document.body.style.overflow="",document.body.style.paddingRight="",b.get(document.body,"style")||b.remove(document.body,"style")}},X="vg-backdrop",z="fade";class W{static show(e){W._append(),l(e)}static hide(e){W._destroy(),l(e)}static _append(){if(f.find("."+X))return!1;let e=document.createElement("div");e.classList.add(X),document.body.append(e),setTimeout((()=>{e.classList.add(z)}),50),I.on(e,"mousedown.vg.backdrop",(()=>{W.hide(),R.destroy()}))}static _destroy(){let e=f.find("."+X);e&&(e.classList.remove(z),setTimeout((()=>{e.remove()}),50))}}const Y=W,V="vg.sidebar",G="show",K=`${V}.hide`,U=`${V}.hidden`,J=`${V}.show`,Z=`${V}.shown`,Q=`keydown.dismiss.${V}`,ee=`hidePrevented.${V}`,te=`click.${V}.data.api`;class se extends F{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({backdrop:!0,overflow:!0,keyboard:!0,ajax:{route:"",target:"",method:"get"}},t)),this._addEventListeners(),this._dismissElement()}static get NAME(){return"sidebar"}static get NAME_KEY(){return V}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){const t=this;a(t._element)||(this._route(),I.trigger(this._element,J,{relatedTarget:e}).defaultPrevented||(t._params.backdrop&&Y.show(),t._params.overflow&&R.append(),t._element.classList.add(G),this._queueCallback((()=>{I.on(f.find(".vg-backdrop"),"mousedown.vg.backdrop",(function(){t.hide()})),I.trigger(this._element,Z,{relatedTarget:e})}),this._element,!0,50)))}hide(){const e=this;a(e._element)||I.trigger(this._element,K).defaultPrevented||(e._params.backdrop&&Y.hide((function(){e._params.overflow&&R.destroy()})),e._params.overflow&&R.destroy(),e._element.setAttribute("aria-expanded",!1),e._element.classList.remove(G),this._queueCallback((()=>I.trigger(this._element,U)),this._element,!0))}dispose(){super.dispose()}_isShown(){return this._element.classList.contains(G)}_addEventListeners(){I.on(document,Q,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():I.trigger(this._element,ee))}))}}H(se),I.on(document,te,'[data-vg-toggle="sidebar"]',(function(e){const t=f.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),a(this))return;this.setAttribute("aria-expanded",!0),I.one(t,U,(()=>{this.setAttribute("aria-expanded",!1)}));const s=f.find(".vg-sidebar.show");s&&s!==t&&se.getInstance(s).hide(),se.getOrCreateInstance(t).toggle(this)}));const ne=se,ae="vg.collapse",ie="show",re="vg-collapse",oe="vg-collapsing",le=`:scope .${re} .${re}`,de='[data-vg-toggle="collapse"]',ce=`${ae}.hide`,me=`${ae}.hidden`,ge=`${ae}.show`,he=`${ae}.shown`,ue=`click.${ae}.data.api`;class pe extends F{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({toggle:!0,parent:null,ajax:{route:"",target:"",method:"get"}},t)),this._isTransitioning=!1,this._triggerArray=[];const s=f.findAll(de);for(const e of s){const t=f.getSelectorFromElement(e),s=f.findAll(t).filter((e=>e===this._element));null!==t&&s.length&&this._triggerArray.push(e)}this._initializeChildren(),this._params.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._params.toggle&&this.toggle()}static get NAME(){return"collapse"}static get NAME_KEY(){return ae}toggle(e){return this._isShown()?this.hide():this.show(e)}show(){const e=this;if(e._isTransitioning||e._isShown())return;let t=[];if(!(e._params.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((e=>e!==this._element)).map((e=>pe.getOrCreateInstance(e,{toggle:!1})))),t.length&&t[0]._isTransitioning||I.trigger(e._element,ge).defaultPrevented)){for(const e of t)e.hide();e._element.classList.remove(re),e._element.classList.add(oe),e._element.style.height=0,e._addAriaAndCollapsedClass(e._triggerArray,!0),e._isTransitioning=!0,e._route(),e._queueCallback((()=>{e._isTransitioning=!1,e._element.classList.remove(oe),e._element.classList.add(re,ie),e._element.style.height="",I.trigger(e._element,he)}),e._element,!0),e._element.style.height=`${e._element.scrollHeight}px`}}hide(){const e=this;if(!e._isTransitioning&&e._isShown()&&!I.trigger(e._element,ce).defaultPrevented){e._element.style.height=`${this._element.getBoundingClientRect().height}px`,c(e._element),e._element.classList.add(oe),e._element.classList.remove(re,ie);for(const t of e._triggerArray){const s=f.getElementFromSelector(t);s&&!e._isShown(s)&&e._addAriaAndCollapsedClass([t],!1)}e._isTransitioning=!0,e._element.style.height="",e._queueCallback((()=>{e._isTransitioning=!1,e._element.classList.remove(oe),e._element.classList.add(re),I.trigger(e._element,me)}),e._element,!0)}}dispose(){super.dispose()}_isShown(e=this._element){return e.classList.contains(ie)}_addAriaAndCollapsedClass(e,t){if(e.length)for(const s of e)this._changeStateButton(s,t)}_initializeChildren(){if(!this._params.parent)return;const e=this._getFirstLevelChildren(de);for(const t of e){const e=f.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=f.find(le,this._params.parent);return f.find(e,this._params.parent).filter((e=>!t.includes(e)))}_changeStateButton(e,t){e.classList.toggle("vg-collapsed",!t),e.setAttribute("aria-expanded",t),e.innerHTML=b.get(e,`data-${t?"hide":"show"}-text`)||e.innerHTML}}I.on(document,ue,de,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault(),f.getMultipleElementsFromSelector(this).forEach((function(e){pe.getOrCreateInstance(e,{toggle:!1}).toggle()}))}));const fe=pe,_e=class{constructor(){this.breakpoints={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400,xxxl:1600}}static check(e){return(new this).define(e)}static checkMobileOrTablet(){let e=!1;var t;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.slice(0,4)))&&(e=!0),e}define(e){let t=window.innerWidth,s=this._checkResponsiveClass(e),n=this.breakpoints,a=Object.keys(n).find((e=>n[e]===s)),i=Object.keys(n),r=i.indexOf(a);return t>=n[i[r+1]]}_checkResponsiveClass(e){let t=e._element,s=e._params,n=0;return n=t.classList.contains(s.classes.XXXL)?this.breakpoints.xxxl:t.classList.contains(s.classes.XXL)?this.breakpoints.xxl:t.classList.contains(s.classes.XL)?this.breakpoints.xl:t.classList.contains(s.classes.LG)?this.breakpoints.lg:t.classList.contains(s.classes.MD)?this.breakpoints.md:t.classList.contains(s.classes.SM)?this.breakpoints.sm:(t.classList.contains(s.classes.XS),this.breakpoints.xs),n}},ve="vg.nav",be="show",we="fade",ye="active",ke=`${ve}.hide`,xe=`${ve}.hidden`,Le=`${ve}.show`,Ee=`${ve}.shown`,Ae=`mouseover.${ve}.data.api`,Se=`mouseout.${ve}.data.api`,Te=`click.${ve}.data.api`,Ce=`keyup.${ve}.data.api`,Me=`resize.${ve}.data.api`;class Oe extends F{constructor(e,t={}){super(e),this._params=this._getParams(e,o({breakpoint:!1,placement:"horizontal",classes:{hamburgerActive:"vg-nav-hamburger-active",hamburgerAlways:"vg-nav-hamburger-always",hamburger:"vg-nav-hamburger",container:"vg-nav-container",wrapper:"vg-nav-wrapper",active:"vg-nav-active",expand:"vg-nav-expand",cloned:"vg-nav-cloned",hover:"vg-nav-hover",flip:"vg-nav-flip",XXXL:"vg-nav-xxxl",XXL:"vg-nav-xxl",XL:"vg-nav-xl",LG:"vg-nav-lg",MD:"vg-nav-md",SM:"vg-nav-sm",XS:"vg-nav-xs"},expand:!0,hover:!1,position:!0,collapse:!0,toggle:'<span class="default"></span>',hamburger:{enable:!0,always:!1,title:"",body:null},callback:m,animation:!0,timeoutAnimation:300,ajax:{route:"",target:"",method:"get"}},t)),this._navigation=null,this.navigation="."+this._params.classes.wrapper,this.movedLinks=[],this.$links=f.findAll("."+this._params.classes.wrapper+" > li",this.navigation),!1===this._params.animation&&(this._params.timeoutAnimation=10)}static get NAME(){return"nav"}static get NAME_KEY(){return ve}get navigation(){return this._navigation}set navigation(e){let t=f.find(e,this._element);t&&(this._navigation=t)}build(){if(!this.navigation)return;let e=this._params;if(this._element.classList.add(e.classes.container),this._element.classList.add("vg-nav-"+e.placement),e.breakpoint||(e.expand=!1),e.hamburger.always?this._element.classList.add(e.classes.hamburgerAlways):e.breakpoint&&e.expand?!1!==e.breakpoint&&this._element.classList.add("vg-nav-"+e.breakpoint):this._element.classList.add(e.classes.expand),e.hover&&(this._element.classList.add(e.classes.hover),_e.checkMobileOrTablet()&&this._element.classList.remove(e.classes.hover)),e.expand&&!e.hamburger.body&&null===f.find("."+e.classes.hamburger,this._element)){let t="",s='<span class="'+e.classes.hamburger+'--lines"><span></span><span></span><span></span></span>';e.hamburger.title&&(t='<span class="'+e.classes.hamburger+'--title">'+e.hamburger.title+"</span>"),null!==e.hamburger.body&&(s=e.hamburger.body),this._element.insertAdjacentHTML("afterbegin",'<a href="#sidebar-nav" class="'+e.classes.hamburger+'" data-vg-toggle="sidebar">'+t+s+"</a>")}if(e.toggle){let t=[...f.findAll(".dropdown-mega > a, .dropdown > a",this._element)],s='<span class="toggle">'+e.toggle+"</span>";t.length&&t.forEach((function(e){e.querySelector(".toggle")||e.closest(".dots")||(e.setAttribute("aria-expanded","false"),e.insertAdjacentHTML("beforeend",s))}))}e.collapse&&_e.check(this)&&"vertical"!==e.placement&&function(e){let t=e.navigation.clientWidth,s=0,n=f.find(".dots",e.navigation),a=D("dots");if(e.$links.length){if(n)s=n.clientWidth;else{let t=f.find("a",e.$links[0]),n=getComputedStyle(t);s=r(n.paddingLeft.slice(0,-2))+r(n.paddingRight.slice(0,-2))+16}for(let a of e.$links)s+=a.getBoundingClientRect().width,t<s?(e.movedLinks.push(a),a.remove()):e.movedLinks.length&&(n?e.navigation.insertBefore(e.movedLinks[0],n):e.navigation.appendChild(e.movedLinks[0]),e.movedLinks.splice(0,1));e.movedLinks.length?n||e.navigation.insertAdjacentHTML("beforeend",'<li class="dropdown dots"><a href="#" aria-expanded="false">'+a+"</a></li>"):n&&n.remove();let i=e.navigation.querySelector(".dots");if(i&&e.movedLinks.length){let t=i.querySelector("ul");if(t)for(let s of e.movedLinks)t.prepend(s);else{let t=document.createElement("ul");t.classList.add("dropdown-content"),t.classList.add("right");for(let s of e.movedLinks)t.prepend(s);i.appendChild(t)}}}}(this),"afterInit"in this._params.callback&&l(this._params.callback.afterInit,[this])}show(e){let t=e.relatedTarget;if(!t||a(t))return;if(t.closest(".dropdown-content")||t.classList.add("first"),I.trigger(t,Le,{relatedTarget:e}).defaultPrevented)return;let s=f.find(".dropdown-content",t),n=t.firstElementChild;n&&n.setAttribute("aria-expanded","true"),s.classList.add(be),t.classList.add(ye),function(e){let{width:t,right:s}=e.getBoundingClientRect(),n=window.innerWidth-s-t;e.classList.remove("right"),e.classList.remove("left");let a=e.closest("li").querySelectorAll("ul");if(n>t)for(const e of a)e.classList.add("left");else for(const e of a)e.classList.add("right")}(s),this._queueCallback((()=>{s.classList.add(we),I.trigger(t,Ee,e)}),s,!0,50)}hide(e){const t=this;if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))I.off(e,"mouseover",m);let s=e.relatedTarget;if("elm"in e&&e.elm&&(s=e.elm),s){if(I.trigger(s,ke).defaultPrevented)return;s.classList.remove(ye),s.classList.contains("first")&&s.classList.remove("first"),[...f.findAll("."+be,s)].forEach((function(s,n){s.classList.remove(we);let a=s.closest(".dropdown");a.classList.contains(ye)&&a.classList.remove(ye);let i=s.previousElementSibling;if(i&&i.setAttribute("aria-expanded","false"),0===n){const n=()=>{s.classList.remove(be),I.trigger(s,xe,e)};t._queueCallback(n,s,!0,500)}}))}}static init(e,t={}){const s=Oe.getOrCreateInstance(e,t);s.build();let i=f.findAll(".dropdown",s._navigation);s._params.hover?[...i].forEach((function(e){let t=null;I.on(e,Ae,(function(e){if(t)return;Oe.hideOpenDrops(e);let n=e.target.closest(".dropdown");if(!n)return;if(!s.navigation.contains(n))return;t=n;let a={relatedTarget:n};s.show(a)})),I.on(e,Se,(function(e){if(!t)return;let n=e.relatedTarget.closest(".dropdown"),a=t;for(;n;){if(n===t)return;n=n.parentNode}t=null,s.hide({relatedTarget:n,elm:a})}))})):(I.on(document,Ce,Oe.clearDrops),I.on(document,Te,Oe.clearDrops),I.on(document,Te,".vg-nav a",(function(e){if(!b.has(this,"aria-expanded"))return;"click"in s._params.callback&&l(s._params.callback.click,[this]),e.preventDefault();let t=this.closest(".vg-nav"),i=t.querySelector(".first"),r=this.closest(".dropdown");if(r&&(!a(r)||function(e){if(!n(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),s=e.closest("details:not([open])");if(!s)return t;if(s!==e){const t=e.closest("summary");if(t&&t.parentNode!==s)return!1;if(null===t)return!1}return t}(r))){if(i&&this.closest(".first")){if(r.classList.contains("active"))return void s.hide({relatedTarget:r})}else[...f.findAll(".active",t)].forEach((function(e){e&&e!==r&&s.hide({relatedTarget:e})}));s.show({relatedTarget:r})}})));const r=document.getElementById("sidebar-nav");let o=s._element.querySelector("."+s._params.classes.hamburger);r&&o&&(r.addEventListener("vg.sidebar.show",(function(){o.classList.add(s._params.classes.hamburgerActive)})),r.addEventListener("vg.sidebar.hide",(function(){o.classList.remove(s._params.classes.hamburgerActive)})))}static clearDrops(e){2===e.button||"keyup"===e.type&&"Tab"!==e.key||Oe.hideOpenDrops(e)}static hideOpenDrops(e){const t=f.findAll(".dropdown:not(.disabled):not(:disabled).active");for(const s of t){const t=Oe.getInstance(s.closest(".vg-nav"));if(!t)continue;if(e.target.closest(".first"))return;const n={relatedTarget:s};"click"===e.type&&(n.clickEvent=e),t.hide(n)}}}I.on(window,Me,(function(e){Oe.getOrCreateInstance(".vg-nav",{}).build()}));const $e=Oe,je=class{constructor(e={}){this.params=o({element:null,drop:null},e)}_getPlacement(){const e=this,t=e=>{let s=e.parentNode,n=getComputedStyle(s).overflow;return"BODY"===s.tagName?null:"visible"!==n?s:void t(s)};let s,n,a=!1,i=e.params.drop.getBoundingClientRect(),o=e.params.element.getBoundingClientRect();if(t(e.params.element))a=!0,s=i.top,n=i.left;else{let t=getComputedStyle(e.params.drop);s=r(t.top.slice(0,-2)),n=r(t.left.slice(0,-2))}return i.left+i.width>window.innerWidth&&(n=o.width-i.width),{isFixed:a,top:s,left:n}}},Ne="vg.dropdown",Pe="show",qe="fade",Ie="vg-dropdown-content",De='[data-vg-toggle="dropdown"]',He=`${Ne}.hide`,Be=`${Ne}.hidden`,Fe=`${Ne}.show`,Re=`${Ne}.shown`,Xe=`keyup.${Ne}.data.api`,ze=`keydown.${Ne}.data.api`,We=`click.${Ne}.data.api`,Ye=`mouseover.${Ne}.data.api`,Ve=`mouseout.${Ne}.data.api`;class Ge extends F{constructor(e,t){super(e,t);let s={offset:[0,2],over:!1,backdrop:!0,overflow:!0,keyboard:!0,placement:"bottom",animation:!0,timeoutAnimation:350,hover:!1,ajax:{route:"",target:"",method:"get"}};"offset"in t&&Array.isArray(t.offset)&&(s.offset=t.offset),this._params=this._getParams(e,o(s,t)),this._parent=this._element.parentNode,this._drop=f.find("."+Ie,this._parent),this._isPlacement=!1,!1===this._params.animation&&(this._params.timeoutAnimation=10)}static get NAME(){return"dropdown"}static get NAME_KEY(){return Ne}toggle(){return this._isShown()?this.hide():this.show()}show(){if(a(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!I.trigger(this._element,Fe,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))I.on(e,"mouseover",m);this._route(),this._element.setAttribute("aria-expanded",!0),this._element.classList.add(Pe),this._drop.classList.add(Pe),this._setPlacement(),this._queueCallback((()=>{this._drop.classList.add(qe),I.trigger(this._element,Re,e)}),this._drop,!0,50)}}hide(){if(a(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){return super.dispose()}_isShown(){return this._element.classList.contains(Pe)}_completeHide(e){if(!I.trigger(this._element,He,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))I.off(e,"mouseover",m);this._drop.classList.remove(qe),this._element.classList.remove(Pe),this._element.setAttribute("aria-expanded","false"),this._queueCallback((()=>{this._drop.classList.remove(Pe),I.trigger(this._element,Be,e)}),this._parent,!0,this._params.timeoutAnimation)}}_setPlacement(){const e=this;if(!e._isPlacement){let t=new je({element:this._parent,drop:this._drop})._getPlacement();t.isFixed&&(e._drop.style.position="fixed",e._drop.style.transform="translateY(-20%)"),e._drop.style.left=t.left+"px",e._drop.style.top=t.top+"px"}e._params.offset&&(e._drop.style.paddingTop=e._params.offset[1]+"px",e._drop.style.paddingRight=e._params.offset[0]+"px"),e._isPlacement=!0}static init(e,t={}){const s=Ge.getOrCreateInstance(e,t);if(s._params.hover){let e=null;I.on(s._parent,Ye,(function(t){if(e)return;Ge.hideOpenToggles(t);let n=t.target.closest(".vg-dropdown");n&&s._parent.contains(n)&&(e=n,s.show())})),I.on(s._parent,Ve,(function(t){if(!e)return;let n=t.relatedTarget;for(;n;){if(n===e)return;n=n.parentNode}e=null,s._completeHide({relatedTarget:s._element})}))}else I.on(document,Xe,De,Ge.keydownHandler),I.on(document,ze,"."+Ie,Ge.keydownHandler),I.on(document,Xe,Ge.clearDrops),I.on(document,We,Ge.clearDrops),I.on(e,We,(function(e){e.preventDefault(),s.toggle()}))}static hideOpenToggles(e){const t=f.findAll('[data-vg-toggle="dropdown"]:not(.disabled):not(:disabled).show');for(const s of t){const t=Ge.getInstance(s);if(!t)continue;if(e.target.closest("."+Ie)===t._drop)return;if(e.composedPath().includes(t._element))continue;const n={relatedTarget:t._element};"click"===e.type&&(n.clickEvent=e),t._completeHide(n)}}static keydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),s="Escape"===e.key,n=["ArrowUp","ArrowDown"].includes(e.key);if(!n&&!s)return;if(t&&!s)return;e.preventDefault();const a=this.matches(De)?this:f.find(De,e.delegateTarget.parentNode),i=Ge.getOrCreateInstance(a);if(n)return e.stopPropagation(),void i.show();i._isShown()&&(e.stopPropagation(),i.hide(),a.focus())}static clearDrops(e){2===e.button||"keyup"===e.type&&"Tab"!==e.key||Ge.hideOpenToggles(e)}}const Ke=Ge,Ue=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Je=".sticky-top",Ze="padding-right",Qe="margin-right",et=class{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Ze,(t=>t+e)),this._setElementAttributes(Ue,Ze,(t=>t+e)),this._setElementAttributes(Je,Qe,(t=>t-e))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Ze),this._resetElementAttributes(Ue,Ze),this._resetElementAttributes(Je,Qe)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,s){const n=this.getWidth();this._applyManipulationCallback(e,(e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+n)return;this._saveInitialAttribute(e,t);const a=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${s(Number.parseFloat(a))}px`)}))}_saveInitialAttribute(e,t){const s=e.style.getPropertyValue(t);s&&b.get(e,t,s)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,(e=>{const s=b.get(e,t);null!==s?(b.remove(e,t),e.style.setProperty(t,s)):e.style.removeProperty(t)}))}_applyManipulationCallback(e,t){if(n(e))t(e);else for(const s of f.findAll(e,this._element))t(s)}},tt="vg.modal",st="vg-modal-open",nt="show",at="vg-modal-static",it=`${tt}.hide`,rt=`${tt}.hidden`,ot=`${tt}.show`,lt=`${tt}.shown`,dt=`${tt}.resize`,ct=`keydown.dismiss.${tt}`,mt=`hidePrevented.${tt}`,gt=`click.${tt}.data.api`,ht=`mousedown.dismiss${tt}`,ut=`click.dismiss${tt}`;class pt extends F{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({backdrop:!0,focus:!0,keyboard:!0,fields:[],ajax:{route:"",target:"",method:"get",loader:!1},animation:{name:["animate__backInUp","animate__backOutUp"],duration:1e3,delay:1e3,repeat:1},classes:{general:"vg-modal",dialog:"vg-modal-dialog",content:"vg-modal-content",header:"vg-modal-header",title:"vg-modal-title",body:"vg-modal-body",footer:"vg-modal-footer",animated:"animate__animated"}},t)),this._button=null,this._dialog=f.find(".vg-modal-dialog",this._element),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new et,this._addEventListeners(),this._dismissElement()}static get NAME(){return"modal"}static get NAME_KEY(){return tt}static init(e,t,s){pt.build(e,t,s)}static build(e,t,s){if("string"!=typeof e)return;let n=document.createElement("div");n.classList.add("vg-modal","fade"),n.id=e;let a=document.createElement("div");a.classList.add("vg-modal-dialog");let i=document.createElement("div");i.classList.add("vg-modal-content");let r=document.createElement("button");b.set(r,"type","button"),b.set(r,"data-vg-dismiss","modal"),b.set(r,"data-vg-target","#"+e),b.set(r,"aria-label","close"),r.classList.add("vg-btn-close"),i.append(r);let o=document.createElement("div");o.classList.add("vg-modal-body"),i.append(o),a.append(i),n.append(a),document.body.append(n),l(s,[pt.getOrCreateInstance(n,t)])}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){a(this._element)||(this._route(),I.trigger(this._element,ot,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(st),this._addFieldsInModal(e),this._adjustDialog(),Y.show((()=>this._showElement(e)))))}hide(){this._isShown&&!this._isTransitioning&&(I.trigger(this._element,it).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._element.classList.remove(nt),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,Y.hide((()=>{document.body.classList.remove(st),this._resetAdjustments(),this._scrollBar.reset(),I.trigger(this._element,rt)}))}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=f.find(".vg-modal-body",this._dialog);t&&(t.scrollTop=0),c(this._element),this._element.classList.add(nt),this._queueCallback((()=>{this._params.focus,this._isTransitioning=!1,I.trigger(this._element,lt,{relatedTarget:e})}),this._dialog,this._isAnimated())}_isAnimated(){return this._element.classList.contains("fade")}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),s=t>0;if(s&&!e){const e=h()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!s&&e){const e=h()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}_addEventListeners(){I.on(this._element,ct,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():this._triggerBackdropTransition())})),I.on(window,dt,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),I.on(this._element,ht,(e=>{I.one(this._element,ut,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._params.backdrop?this._params.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_triggerBackdropTransition(){if(I.trigger(this._element,mt).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(at)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(at),this._queueCallback((()=>{this._element.classList.remove(at),this._queueCallback((()=>{this._element.style.overflowY=t}),this._dialog)}),this._dialog))}_addFieldsInModal(e){this._params=this._getParams(e,this._params),this._params.fields.length&&this._params.fields.forEach((function(e){if(!1 in e&&!1 in e)return;let t=f.findAll("[data-"+e.name+"]");if(t.length)for(const s of t)switch(s.tagName){case"INPUT":s.value=e.value;break;case"IMG":b.set(s,"src",e.value);break;default:s.innerHTML=e.value}}))}}H(pt),I.on(document,gt,'[data-vg-toggle="modal"]',(function(e){const t=f.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),I.one(t,ot,(e=>{e.defaultPrevented}));const s=f.find(".vg-modal.show");s&&pt.getInstance(s).hide(),pt.getOrCreateInstance(t).toggle(this)}));const ft=pt,_t="vg.fs",vt=`submit.${_t}.data.api`;class bt extends F{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({redirect:"",validate:!1,submit:!1,fields:[],alert:{enabled:!0,type:"modal"},ajax:{route:"",target:"",method:"get"},classes:{general:"vg-form-sender",alertCollapse:"vg-form-sender-collapse",alertModal:"vg-form-sender-modal",validation:"needs-validation",wasValidate:"was-validated"}},t)),this._params.ajax.route=b.get(this._element,"action").toLowerCase(),this._params.ajax.method=b.get(this._element,"method").toLowerCase(),this._button=f.find('[type="submit"]',this._element)||f.find('[form="'+this._element.id+'"]')||null,this._params.isBtnText="false"!==b.get(this._element,"data-btn-text"),this._params.isJsonParse="false"!==b.get(this._element,"data-json-parse"),this._params.isShowPass="true"===b.get(this._element,"data-show-pass")}static get NAME(){return"form-sender"}static get NAME_KEY(){return _t}build(){return this._element.classList.add(this._params.classes.general),this._params.validate&&(b.set(this._element,"novalidate",""),this._element.classList.add(this._params.classes.validation)),this}request(e,t){const s=this;s._alertBefore(),s._params.ajax.data=e,s._route((function(e,n){s._element.classList.remove("was-validated"),s._params.alert.enabled&&("string"==typeof e&&"error"===e?s._alertError(t,n):"string"==typeof e&&"success"===e&&s._alertSuccess(t,n)),s._params.redirect&&(window.location.href=s._params.redirect)}))}_alertBefore(){const e=this;"collapse"===e._params.alert.type&&[...document.getElementsByClassName(e._params.classes.alertCollapse)].forEach((function(e){e&&e.classList.contains("show")&&fe.getOrCreateInstance(e,{toggle:!1}).hide()})),e._statusButton("before"),I.trigger(e._element,"vg.fs.before",e)}_alertError(e,t){const s=this;s._statusButton("after"),s._jsonParse(t,"error"),I.trigger(s._element,"vg.fs.error",[e,s,t])}_alertSuccess(e,t){const s=this;s._statusButton("after"),s._jsonParse(t,"success"),I.trigger(s._element,"vg.fs.success",[e,s,t])}_statusButton(e){const t=this;if(!t._button)return;let s=t._button,n={send:"Отправляем...",text:"Отправить"};if(b.has(t._button,"data-spinner")&&"before"===e&&t._button.insertAdjacentHTML("afterbegin",'<span class="spinner-border spinner-border-sm me-2"></span>'),b.has(t._button,"data-text"))n.text=b.get(t._button,"data-text");else{let e=t._button.querySelector("[data-text]");e&&(n.text=b.get(e,"data-text"),s=e)}if(b.has(t._button,"data-text-send"))n.send=b.get(t._button,"data-text-send");else{let e=t._button.querySelector("[data-text-send]");e&&(n.send=b.get(e,"data-text-send"),s=e)}if("before"===e&&(t._params.isBtnText&&(s.innerHTML=n.send),b.set(t._button,"disabled","disabled")),"after"===e){t._params.isBtnText&&(s.innerHTML=n.text),b.remove(t._button,"disabled");let e=t._button.querySelector(".spinner-border");e&&e.remove()}}_jsonParse(e,t){const s=this;if(s._params.isJsonParse&&"string"==typeof e){let n={};try{n=JSON.parse(e),s.alert(n,t)}catch(n){s.alert(e,t)}}else s.alert(e,t)}alert(e,t){const s=this;if(i(e)&&"code"in e&&e.code&&200===e.code&&"response"in e&&e.response){let s=r(e.response);"string"==typeof s?-1===s.indexOf("Parse error")&&-1===s.indexOf("syntax error")||(t="error",e={response:{title:"Error",message:"Something went wrong, please repeat later"},text:"Something went wrong, please repeat later"}):"errors"in s&&r(s.errors)&&(t=r(s.errors)?"error":"success")}s._params.alert.enabled&&("modal"===s._params.alert.type&&s._alertModal(e,t),"collapse"===s._params.alert.type&&s._alertCollapse(e,t))}_alertModal(e,t){const s=this;[...document.getElementsByClassName("modal")].forEach((function(e){e&&e.classList.contains("show")&&bootstrap.Modal.getOrCreateInstance(e).hide()})),[...document.getElementsByClassName("vg-modal")].forEach((function(e){e&&e.classList.contains("show")&&ft.getOrCreateInstance(e).hide()}));let n=document.querySelector(".vg-modal"),a=s._params.classes.general+"-"+g();function i(n=!0){let i=f.find("."+s._params.classes.alertModal);i&&i.remove(),ft.init(a,{classes:{alert:s._params.classes.alertModal}},(function(a){let i=a._element;i.classList.add(s._params.classes.alertModal);let r=f.find(".vg-modal-body",i);r&&r.append(s.setDataRelationStatus(i,t,e,"modal")),a.toggle(),n&&setTimeout((()=>{Y.show()}),50)}))}n?.addEventListener("vg.modal.hidden",(function(){i()})),setTimeout((()=>{document.getElementById(a)||(console.log("asd"),i(!1))}),500)}_alertCollapse(e,t){const s=this;let n=f.find("."+s._params.classes.alertCollapse);n||(n=document.createElement("div"),n.classList.add(s._params.classes.alertCollapse),n.classList.add("vg-collapse"),n.id=s._params.classes.general+"-"+g(),n.append(s.setDataRelationStatus(n,t,e,"collapse")),s._element.prepend(n)),fe.getOrCreateInstance(n,{toggle:!1}).toggle()}setDataRelationStatus(e,t,s,n){let a=f.find(".vg-alert-"+t,e);if(i(s)){if("error"===t&&"code"in s&&200!==s.code&&"text"in s&&!s.text)switch(s.text="Something went wrong, please repeat later",s.code){case 400:s.text="Bad Request";break;case 401:case 403:s.text="Unauthorized";break;case 413:s.text="Forbidden";break;case 404:s.text="Not Found";break;case 422:s.text="Unprocessable Entity";break;case 500:s.text="Internal Server Error";break;case 504:s.text="Gateway Timeout"}if("response"in s){let e=r(s.response),n="",a="",o="";if("string"!=typeof e){if(!("view"in e)){if("title"in e&&(n=e.title),"error"===t&&200!==s.code&&(o=" "+s.text+" ("+s.code+")"),a+='<h4 class="vg-alert-content--title">'+n+o+"</h4>","message"in e&&(a+='<div class="vg-alert-content--message">'+e.message+"</div>"),"errors"in e){let t=r(e.errors)||null;if(i(t))for(const e in t)Array.isArray(t[e])?t[e].forEach((function(e){a+="<div>"+e+"</div>"})):a="<div>"+t[e]+"</div>"}s={view:a}}}else s.view=e}}if(a)f.find(".vg-alert-content--text",a).innerHTML=s.view;else{a=document.createElement("div"),a.classList.add("vg-alert","vg-alert-"+t,"vg-alert-"+n);let e=document.createElement("div");e.classList.add("vg-alert-content");let i=document.createElement("div");i.classList.add("vg-alert-content--icon");let r=document.createElement("i");r.innerHTML=D(t),i.append(r),e.append(i);let o=document.createElement("div");o.classList.add("vg-alert-content--text"),o.innerHTML=s.view,e.append(o),a.append(e)}return a}static init(e,t={}){bt.getOrCreateInstance(e,t).build()}}I.on(document,vt,(function(e){if(!b.has(e.target,"data-vgformsender"))return;const t=bt.getOrCreateInstance(e.target,{});if(t){if(t._params.validate&&!t._element.checkValidity())return e.preventDefault(),e.stopPropagation(),t._element.classList.add(t._params.classes.wasValidate),!1;if(!t._params.submit){e.preventDefault();let s=new FormData(t._element);return t.request(s,e)}}}));const wt=bt,yt="vg.rollup",kt=`click.${yt}.data.api`;class xt extends F{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({},t))}static get NAME(){return"rollup"}static get NAME_KEY(){return yt}static init(e,t={}){xt.getOrCreateInstance(e,t).build()}build(){}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){}_isShown(){return this._element.classList.contains("show")}}I.on(document,kt,'[data-vg-toggle="rollup"]',(function(e){const t=f.getElementFromSelector(this);t&&(["A","AREA"].includes(this.tagName)&&e.preventDefault(),a(this)||(this.setAttribute("aria-expanded",!0),xt.getOrCreateInstance(t).toggle(this)))}));const Lt=xt;vg=t})();
2
2
  //# sourceMappingURL=vgapp.js.map