1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[22524],{524(t,e,i){i.r(e),i.d(e,{default:()=>s});class s extends window.PluginBaseClass{static #t=this.options={swipeThreshold:40};init(){this.track=this.el.querySelector(".doccheck-js-emoji-track"),this.slides=Array.from(this.el.querySelectorAll(".doccheck-js-emoji-slide")),this.dots=Array.from(this.el.querySelectorAll(".doccheck-js-emoji-dot")),this.prevButton=this.el.querySelector(".doccheck-js-emoji-prev"),this.nextButton=this.el.querySelector(".doccheck-js-emoji-next"),this.viewport=this.el.querySelector(".doccheck-js-emoji-viewport"),this.input=document.querySelector(this.el.getAttribute("data-emoji-picker-input")),this.currentIndex=0,this._touchStartX=null,this._registerEvents(),this._update()}_registerEvents(){this.prevButton&&this.prevButton.addEventListener("click",()=>this._goTo(this.currentIndex-1)),this.nextButton&&this.nextButton.addEventListener("click",()=>this._goTo(this.currentIndex+1)),this.dots.forEach(t=>{t.addEventListener("click",()=>{this._goTo(parseInt(t.getAttribute("data-slide-to"),10))})}),this.el.querySelectorAll(".doccheck-js-emoji").forEach(t=>{t.addEventListener("click",this._onEmojiClick.bind(this))}),this.viewport.addEventListener("touchstart",this._onTouchStart.bind(this),{passive:!0}),this.viewport.addEventListener("touchend",this._onTouchEnd.bind(this),{passive:!0})}_onTouchStart(t){this._touchStartX=t.changedTouches[0].clientX}_onTouchEnd(t){if(null===this._touchStartX)return;let e=t.changedTouches[0].clientX-this._touchStartX;this._touchStartX=null,Math.abs(e)<this.options.swipeThreshold||this._goTo(e<0?this.currentIndex+1:this.currentIndex-1)}_onEmojiClick(t){let e=t.currentTarget.getAttribute("data-emoji");if(!this.input||!e)return;let i=parseInt(this.input.getAttribute("data-text-field-maxlength"),10)||0;if(i>0&&[...this.input.value].length+1>i)return;let s=this.input.selectionStart??this.input.value.length,n=this.input.selectionEnd??this.input.value.length;this.input.value=this.input.value.slice(0,s)+e+this.input.value.slice(n);let h=s+e.length;this.input.focus(),this.input.setSelectionRange(h,h),this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0}))}_goTo(t){this.currentIndex=Math.max(0,Math.min(t,this.slides.length-1)),this._update()}_update(){this.track.style.transform=`translateX(-${100*this.currentIndex}%)`,this.dots.forEach((t,e)=>{t.classList.toggle("is-active",e===this.currentIndex)}),this.prevButton&&(this.prevButton.disabled=0===this.currentIndex),this.nextButton&&(this.nextButton.disabled=this.currentIndex===this.slides.length-1)}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.