PageSourceSearch

https://cdn.manulization.com/assets/build/en/9215.22bf4941.js

js manulization.com collected 2026-10-07 15:41:52 UTC 4,822 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunk||=[]).push([[9215],{39215(t,e,i){i.r(e),i.d(e,{EmojiPickerPopup:()=>h});var o=i(19308),n=i(67882);let s=!1;function r(){const t=window.visualViewport;return t?{top:t.offsetTop,left:t.offsetLeft,width:t.width,height:t.height}:{top:0,left:0,width:window.innerWidth,height:window.innerHeight}}class h{constructor(t){this.picker=null,this.popup=null,this.savedRange=null,this.anchor=null,this.naturalHeight=0,this.open_=!1,this.onEmojiClick=t=>{var e;const i=null===(e=t.detail)||void 0===e?void 0:e.unicode;i&&this.insertEmoji(i),this.close()},this.onWindowResize=()=>{this.measureNaturalHeight(),this.reposition()},this.reposition=()=>{if(!this.popup||!this.picker||!this.anchor)return;const{top:t,left:e,height:i}=function({anchor:t,viewport:e,popupWidth:i,naturalHeight:o}){const n=e.top+8,s=e.top+e.height-8,r=Math.max(0,s-n),h=s-Math.max(t.bottom+4,n),a=Math.min(t.top-4,s)-n,l=h<o&&(a>=o||a>h),p=l?a:h,c=Math.min(o,p>=240?p:r),d=l?t.top-4-c:t.bottom+4,u=Math.max(n,Math.min(d,s-c)),v=e.left+8,g=e.left+e.width-8;return{top:u,left:Math.max(v,Math.min(t.left,g-i)),height:c}}({anchor:this.anchor.getBoundingClientRect(),viewport:r(),popupWidth:this.popup.getBoundingClientRect().width,naturalHeight:this.naturalHeight});this.picker.style.height=i<this.naturalHeight?`${Math.floor(i)}px`:"",this.popup.style.top=`${Math.round(t)}px`,this.popup.style.left=`${Math.round(e)}px`},this.onDocumentPointerDown=t=>{var e,i;const o=t.target;(null===(e=this.popup)||void 0===e?void 0:e.contains(o))||(null===(i=this.anchor)||void 0===i?void 0:i.contains(o))||this.close()},this.onKeydown=t=>{"Escape"===t.key&&(t.stopPropagation(),this.close())},this.editorRoot=t.editorRoot,this.locale=t.locale,this.dataSource=t.dataSource,function(){if(s||!("serviceWorker"in navigator))return;s=!0;const{locale:t,dataSource:e}=(0,n.$)();navigator.serviceWorker.ready.then(i=>{var o;null===(o=i.active)||void 0===o||o.postMessage({type:"warm-emoji-data",locale:t,dataSource:e})}).catch(()=>{})}()}get isOpen(){return this.open_}toggle(t){this.open_?this.close():this.open(t)}open(t){this.open_||(this.anchor=t,this.saveSelection(),this.ensurePopup(),this.popup.style.display="",this.open_=!0,this.measureNaturalHeight(),this.reposition(),requestAnimationFrame(()=>{var t,e;this.open_&&(document.addEventListener("pointerdown",this.onDocumentPointerDown,!0),document.addEventListener("keydown",this.onKeydown,!0),window.addEventListener("resize",this.onWindowResize),window.addEventListener("scroll",this.reposition,!0),null===(t=window.visualViewport)||void 0===t||t.addEventListener("resize",this.reposition),null===(e=window.visualViewport)||void 0===e||e.addEventListener("scroll",this.reposition))}))}close(){var t,e;this.open_&&(document.removeEventListener("pointerdown",this.onDocumentPointerDown,!0),document.removeEventListener("keydown",this.onKeydown,!0),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("scroll",this.reposition,!0),null===(t=window.visualViewport)||void 0===t||t.removeEventListener("resize",this.reposition),null===(e=window.visualViewport)||void 0===e||e.removeEventListener("scroll",this.reposition),this.popup&&(this.popup.style.display="none"),this.open_=!1,this.anchor=null,this.savedRange=null)}destroy(){var t,e;this.close(),null===(t=this.picker)||void 0===t||t.removeEventListener("emoji-click",this.onEmojiClick),null===(e=this.popup)||void 0===e||e.remove(),this.popup=null,this.picker=null}ensurePopup(){if(this.popup)return;this.popup=document.createElement("div"),this.popup.className="emoji-picker-popup";const t={};this.locale&&(t.locale=this.locale),this.dataSource&&(t.dataSource=this.dataSource),this.picker=new o.L(t),this.picker.addEventListener("emoji-click",this.onEmojiClick),this.popup.appendChild(this.picker),document.body.appendChild(this.popup)}saveSelection(){const t=window.getSelection();t&&t.rangeCount>0&&this.editorRoot.contains(t.getRangeAt(0).commonAncestorContainer)?this.savedRange=t.getRangeAt(0).cloneRange():this.savedRange=null}insertEmoji(t){var e;const i=window.getSelection();if(!i)return;const o=null!==(e=this.savedRange)&&void 0!==e?e:this.rangeAtEditorEnd();if(!o)return;const n=o.startContainer,s=n.nodeType===Node.TEXT_NODE?n.parentElement:n,r=null==s?void 0:s.closest('[contenteditable="true"]');i.removeAllRanges(),i.addRange(o),null==r||r.focus({preventScroll:!0}),i.removeAllRanges(),i.addRange(o),document.execCommand("insertText",!1,t)}rangeAtEditorEnd(){const t=this.editorRoot.querySelectorAll('[contenteditable="true"]'),e=t[t.length-1];if(!e)return null;e.focus({preventScroll:!0});const i=document.createRange();return i.selectNodeContents(e),i.collapse(!1),i}measureNaturalHeight(){this.picker.style.height="",this.naturalHeight=this.picker.getBoundingClientRect().height}}}}]);

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.