\".concat(this.options.dictFallbackText, \"
\");\n }\n\n fieldsString += \"Image 1 descriptions.
',\r\n * },\r\n * ...\r\n * ],\r\n * });\r\n * $dynamicGallery.addEventListener('click', function () {\r\n * // Starts with third item.(Optional).\r\n * // This is useful if you want use dynamic mode with\r\n * // custom thumbnails (thumbnails outside gallery),\r\n * dynamicGallery.openGallery(2);\r\n * });\r\n *\r\n */\n\n\n LightGallery.prototype.openGallery = function (index, element) {\n var _this = this;\n\n if (index === void 0) {\n index = this.settings.index;\n } // prevent accidental double execution\n\n\n if (this.lgOpened) return;\n this.lgOpened = true;\n this.outer.removeClass('lg-hide-items');\n this.hideScrollbar(); // Add display block, but still has opacity 0\n\n this.$container.addClass('lg-show');\n var itemsToBeInsertedToDom = this.getItemsToBeInsertedToDom(index, index);\n this.currentItemsInDom = itemsToBeInsertedToDom;\n var items = '';\n itemsToBeInsertedToDom.forEach(function (item) {\n items = items + (\"\");\n });\n this.$inner.append(items);\n this.addHtml(index);\n var transform = '';\n this.mediaContainerPosition = this.getMediaContainerPosition();\n var _a = this.mediaContainerPosition,\n top = _a.top,\n bottom = _a.bottom;\n\n if (!this.settings.allowMediaOverlap) {\n this.setMediaContainerPosition(top, bottom);\n }\n\n var __slideVideoInfo = this.galleryItems[index].__slideVideoInfo;\n\n if (this.zoomFromOrigin && element) {\n this.currentImageSize = utils.getSize(element, this.outer, top + bottom, __slideVideoInfo && this.settings.videoMaxSize);\n transform = utils.getTransform(element, this.outer, top, bottom, this.currentImageSize);\n }\n\n if (!this.zoomFromOrigin || !transform) {\n this.outer.addClass(this.settings.startClass);\n this.getSlideItem(index).removeClass('lg-complete');\n }\n\n var timeout = this.settings.zoomFromOrigin ? 100 : this.settings.backdropDuration;\n setTimeout(function () {\n _this.outer.addClass('lg-components-open');\n }, timeout);\n this.index = index;\n this.LGel.trigger(lGEvents.beforeOpen); // add class lg-current to remove initial transition\n\n this.getSlideItem(index).addClass('lg-current');\n this.lGalleryOn = false; // Store the current scroll top value to scroll back after closing the gallery..\n\n this.prevScrollTop = $LG(window).scrollTop();\n setTimeout(function () {\n // Need to check both zoomFromOrigin and transform values as we need to set set the\n // default opening animation if user missed to add the lg-size attribute\n if (_this.zoomFromOrigin && transform) {\n var currentSlide_1 = _this.getSlideItem(index);\n\n currentSlide_1.css('transform', transform);\n setTimeout(function () {\n currentSlide_1.addClass('lg-start-progress lg-start-end-progress').css('transition-duration', _this.settings.startAnimationDuration + 'ms');\n\n _this.outer.addClass('lg-zoom-from-image');\n });\n setTimeout(function () {\n currentSlide_1.css('transform', 'translate3d(0, 0, 0)');\n }, 100);\n }\n\n setTimeout(function () {\n _this.$backdrop.addClass('in');\n\n _this.$container.addClass('lg-show-in');\n }, 10);\n setTimeout(function () {\n if (_this.settings.trapFocus && document.body === _this.settings.container) {\n _this.trapFocus();\n }\n }, _this.settings.backdropDuration + 50); // lg-visible class resets gallery opacity to 1\n\n if (!_this.zoomFromOrigin || !transform) {\n setTimeout(function () {\n _this.outer.addClass('lg-visible');\n }, _this.settings.backdropDuration);\n } // initiate slide function\n\n\n _this.slide(index, false, false, false);\n\n _this.LGel.trigger(lGEvents.afterOpen);\n });\n\n if (document.body === this.settings.container) {\n $LG('html').addClass('lg-on');\n }\n };\n /**\r\n * Note - Changing the position of the media on every slide transition creates a flickering effect.\r\n * Therefore, The height of the caption is calculated dynamically, only once based on the first slide caption.\r\n * if you have dynamic captions for each media,\r\n * you can provide an appropriate height for the captions via allowMediaOverlap option\r\n */\n\n\n LightGallery.prototype.getMediaContainerPosition = function () {\n if (this.settings.allowMediaOverlap) {\n return {\n top: 0,\n bottom: 0\n };\n }\n\n var top = this.$toolbar.get().clientHeight || 0;\n var subHtml = this.outer.find('.lg-components .lg-sub-html').get();\n var captionHeight = this.settings.defaultCaptionHeight || subHtml && subHtml.clientHeight || 0;\n var thumbContainer = this.outer.find('.lg-thumb-outer').get();\n var thumbHeight = thumbContainer ? thumbContainer.clientHeight : 0;\n var bottom = thumbHeight + captionHeight;\n return {\n top: top,\n bottom: bottom\n };\n };\n\n LightGallery.prototype.setMediaContainerPosition = function (top, bottom) {\n if (top === void 0) {\n top = 0;\n }\n\n if (bottom === void 0) {\n bottom = 0;\n }\n\n this.$content.css('top', top + 'px').css('bottom', bottom + 'px');\n };\n\n LightGallery.prototype.hideBars = function () {\n var _this = this; // Hide controllers if mouse doesn't move for some period\n\n\n setTimeout(function () {\n _this.outer.removeClass('lg-hide-items');\n\n if (_this.settings.hideBarsDelay > 0) {\n _this.outer.on('mousemove.lg click.lg touchstart.lg', function () {\n _this.outer.removeClass('lg-hide-items');\n\n clearTimeout(_this.hideBarTimeout); // Timeout will be cleared on each slide movement also\n\n _this.hideBarTimeout = setTimeout(function () {\n _this.outer.addClass('lg-hide-items');\n }, _this.settings.hideBarsDelay);\n });\n\n _this.outer.trigger('mousemove.lg');\n }\n }, this.settings.showBarsAfter);\n };\n\n LightGallery.prototype.initPictureFill = function ($img) {\n if (this.settings.supportLegacyBrowser) {\n try {\n picturefill({\n elements: [$img.get()]\n });\n } catch (e) {\n console.warn('lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.');\n }\n }\n };\n /**\r\n * @desc Create image counter\r\n * Ex: 1/10\r\n */\n\n\n LightGallery.prototype.counter = function () {\n if (this.settings.counter) {\n var counterHtml = \"\").replace(/\\r?\\n/g,\"
\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\" \")).includes(\"
\")||s.includes(\"
\"))&&(s=`
${s}
`),r=s),r=this.editor.data.htmlProcessor.toView(r));const a=new e(this,\"inputTransformation\");this.fire(a,{content:r,dataTransfer:o,targetRanges:n.targetRanges,method:n.method}),a.stop.called&&t.stop(),i.scrollToTheSelection()}),{priority:\"low\"}),this.listenTo(this,\"inputTransformation\",((t,e)=>{if(e.content.isEmpty)return;const i=this.editor.data.toModel(e.content,\"$clipboardHolder\");0!=i.childCount&&(t.stop(),n.change((()=>{this.fire(\"contentInsertion\",{content:i,method:e.method,dataTransfer:e.dataTransfer,targetRanges:e.targetRanges})})))}),{priority:\"low\"}),this.listenTo(this,\"contentInsertion\",((t,e)=>{e.resultRange=n.insertContent(e.content)}),{priority:\"low\"})}_setupCopyCut(){const t=this.editor,e=t.model.document,n=t.editing.view.document;function i(i,o){const r=o.dataTransfer;o.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));n.fire(\"clipboardOutput\",{dataTransfer:r,content:s,method:i.name})}this.listenTo(n,\"copy\",i,{priority:\"low\"}),this.listenTo(n,\"cut\",((e,n)=>{t.isReadOnly?n.preventDefault():i(e,n)}),{priority:\"low\"}),this.listenTo(n,\"clipboardOutput\",((n,i)=>{i.content.isEmpty||(i.dataTransfer.setData(\"text/html\",this.editor.data.htmlProcessor.toData(i.content)),i.dataTransfer.setData(\"text/plain\",rg(i.content))),\"cut\"==i.method&&t.model.deleteContent(e.selection)}),{priority:\"low\"})}}function*ag(t,e){for(const n of e)n&&t.getAttributeProperties(n[0]).copyOnEnter&&(yield n)}class cg extends he{execute(){const t=this.editor.model,e=t.document;t.change((n=>{!function(t,e,n,i){const o=n.isCollapsed,r=n.getFirstRange(),s=r.start.parent,a=r.end.parent;if(i.isLimit(s)||i.isLimit(a))return void(o||s!=a||t.deleteContent(n));if(o){const t=ag(e.model.schema,n.getAttributes());lg(e,r.start),e.setSelectionAttribute(t)}else{const i=!(r.start.isAtStart&&r.end.isAtEnd),o=s==a;t.deleteContent(n,{leaveUnmerged:i}),i&&(o?lg(e,n.focus):e.setSelection(a,0))}}(this.editor.model,n,e.selection,t.schema),this.fire(\"afterExecute\",{writer:n})}))}}function lg(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)}class dg extends as{constructor(t){super(t);const e=this.document;e.on(\"keydown\",((t,n)=>{if(this.isEnabled&&n.keyCode==ir.enter){const i=new jo(e,\"enter\",e.selection.getFirstRange());e.fire(i,new Ts(e,n.domEvent,{isSoft:n.shiftKey})),i.stop.called&&t.stop()}}))}observe(){}}class hg extends le{static get pluginName(){return\"Enter\"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(dg),t.commands.add(\"enter\",new cg(t)),this.listenTo(n,\"enter\",((n,i)=>{i.preventDefault(),i.isSoft||(t.execute(\"enter\"),e.scrollToTheSelection())}),{priority:\"low\"})}}class ug{constructor(t,e=20){this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=(t,e)=>{\"transparent\"!=e.type&&e!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on(\"change\",this._changeCallback),this.model.document.selection.on(\"change:range\",this._selectionChangeCallback),this.model.document.selection.on(\"change:attribute\",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(t){this.size+=t,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off(\"change\",this._changeCallback),this.model.document.selection.off(\"change:range\",this._selectionChangeCallback),this.model.document.selection.off(\"change:attribute\",this._selectionChangeCallback)}_reset(t){this.isLocked&&!t||(this._batch=null,this.size=0)}}class mg extends he{constructor(t,e){super(t),this.direction=e,this._buffer=new ug(t.model,t.config.get(\"typing.undoStep\"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,n=e.document;e.enqueueChange(this._buffer.batch,(i=>{this._buffer.lock();const o=i.createSelection(t.selection||n.selection),r=t.sequence||1,s=o.isCollapsed;if(o.isCollapsed&&e.modifySelection(o,{direction:this.direction,unit:t.unit}),this._shouldEntireContentBeReplacedWithParagraph(r))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(o,r))return void this.editor.execute(\"paragraph\",{selection:o});if(o.isCollapsed)return;let a=0;o.getFirstRange().getMinimalFlatRanges().forEach((t=>{a+=Oo(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),e.deleteContent(o,{doNotResetEntireContent:s,direction:this.direction}),this._buffer.input(a),i.setSelection(o),this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(i)))return!1;if(!e.schema.checkChild(i,\"paragraph\"))return!1;const o=i.getChild(0);return!o||\"paragraph\"!==o.name}_replaceEntireContentWithParagraph(t){const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n),o=t.createElement(\"paragraph\");t.remove(t.createRangeIn(i)),t.insert(o,i),t.setSelection(o,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const n=this.editor.model;if(e>1||\"backward\"!=this.direction)return!1;if(!t.isCollapsed)return!1;const i=t.getFirstPosition(),o=n.schema.getLimitElement(i),r=o.getChild(0);return i.parent==r&&(!!t.containsEntireContent(r)&&(!!n.schema.checkChild(o,\"paragraph\")&&\"paragraph\"!=r.name))}}class gg extends as{constructor(t){super(t);const e=t.document;let n=0;function i(t,n,i){const o=new jo(e,\"delete\",e.selection.getFirstRange());e.fire(o,new Ts(e,n,i)),o.stop.called&&t.stop()}e.on(\"keyup\",((t,e)=>{e.keyCode!=ir.delete&&e.keyCode!=ir.backspace||(n=0)})),e.on(\"keydown\",((t,e)=>{const o={};if(e.keyCode==ir.delete)o.direction=\"forward\",o.unit=\"character\";else{if(e.keyCode!=ir.backspace)return;o.direction=\"backward\",o.unit=\"codePoint\"}const r=tr.isMac?e.altKey:e.ctrlKey;o.unit=r?\"word\":o.unit,o.sequence=++n,i(t,e.domEvent,o)})),tr.isAndroid&&e.on(\"beforeinput\",((e,n)=>{if(\"deleteContentBackward\"!=n.domEvent.inputType)return;const o={unit:\"codepoint\",direction:\"backward\",sequence:1},r=n.domTarget.ownerDocument.defaultView.getSelection();r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset&&(o.selectionToRemove=t.domConverter.domSelectionToView(r)),i(e,n.domEvent,o)}))}observe(){}}class pg extends le{static get pluginName(){return\"Delete\"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(gg);const i=new mg(t,\"forward\");if(t.commands.add(\"deleteForward\",i),t.commands.add(\"forwardDelete\",i),t.commands.add(\"delete\",new mg(t,\"backward\")),this.listenTo(n,\"delete\",((n,i)=>{const o={unit:i.unit,sequence:i.sequence};if(i.selectionToRemove){const e=t.model.createSelection(),n=[];for(const e of i.selectionToRemove.getRanges())n.push(t.editing.mapper.toModelRange(e));e.setTo(n),o.selection=e}t.execute(\"forward\"==i.direction?\"deleteForward\":\"delete\",o),i.preventDefault(),e.scrollToTheSelection()}),{priority:\"low\"}),tr.isAndroid){let t=null;this.listenTo(n,\"delete\",((e,n)=>{const i=n.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}}),{priority:\"lowest\"}),this.listenTo(n,\"keyup\",((e,n)=>{if(t){const e=n.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset),e.extend(t.focusNode,t.focusOffset),t=null}}))}}}class fg{constructor(){this._stack=[]}add(t,e){const n=this._stack,i=n[0];this._insertDescriptor(t);const o=n[0];i===o||kg(i,o)||this.fire(\"change:top\",{oldDescriptor:i,newDescriptor:o,writer:e})}remove(t,e){const n=this._stack,i=n[0];this._removeDescriptor(t);const o=n[0];i===o||kg(i,o)||this.fire(\"change:top\",{oldDescriptor:i,newDescriptor:o,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex((e=>e.id===t.id));if(kg(t,e[n]))return;n>-1&&e.splice(n,1);let i=0;for(;e[i]&&bg(e[i],t);)i++;e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex((e=>e.id===t));n>-1&&e.splice(n,1)}}function kg(t,e){return t&&e&&t.priority==e.priority&&wg(t.classes)==wg(e.classes)}function bg(t,e){return t.priority>e.priority||!(t.priority