PageSourceSearch

https://www.sonicstadium.org/uploads/javascript_chatpro/front_front_media.js?v=94ddf6c0791790887771

js sonicstadium.org collected 2026-10-02 10:01:34 UTC 26,972 bytes, 6 lines download raw bytes

1!function(t,e){"use strict";window.chatpro=window.chatpro||{},window.chatpro.editor=window.chatpro.editor||{extraExtensions:[],extraSerializers:{},extraInsertHandlers:[],extraSyncCleanups:[],extraLibraries:[]};const o=!0,r=!0,i=!0,n=!0,s=!0,a=!0,d=!0,c=!0,l=!0,h=!0,p=!1,u="chatpro_editor_inner ipsRichText",m="is-editor-empty";ips.controller.register("chatpro.front.core.editor",{_editor:null,_roomId:null,initialize:function(){this._roomId=this.scope.data("room-id")||null,this.setupEditor(),this.on("click",'[data-role="editorContent"]',this.focusEditor),t(document).on("chatpro:insertContent."+this.controllerID,e.bind(this.handleExternalInsert,this)),t(document).on("chatpro:messageSent."+this.controllerID,e.bind(this.handleMessageSent,this)),t(document).on("chatpro:focusEditor."+this.controllerID,e.bind(this.handleFocusEditor,this))},setupEditor:async function(){if(!this._editor&&0!==this.scope.find('[data-role="editorContent"]').length)if(window._chatproTiptapLoading)setTimeout(()=>this.setupEditor(),100);else try{const t=await this._loadLibraries();await chatpro.utils.updateEmojiStore();const e=chatpro.db.get("emoji_"+ips.getSetting("emoji_cache")),o={};e&&Object.values(e).forEach(t=>{t.forEach(t=>{if(t.unicode&&t.image){const e=t.image.image2x||t.image.image;e&&(o[t.unicode]=e.split("/").pop().split("?")[0])}})});const r=this._getExtensions(t,o),i=this._getEditorProps(),n=this._getInitialContent();this._editor=new t.Editor({element:this.scope.find('[data-role="editorContent"]')[0],extensions:r,content:n,editorProps:i,onUpdate:()=>this.syncValue(),autofocus:p})}catch(t){window._chatproTiptapLoading=!1,console.error("ChatEditor: Initialization failed",t)}},_loadLibraries:async function(){if(window._chatproTiptapLibrary)return window._chatproTiptapLibrary;window._chatproTiptapLoading=!0;try{const e=[{key:"modCore",url:"https://esm.sh/@tiptap/[email protected][email protected]&target=es2017"},{key:"modStarter",url:"https://esm.sh/@tiptap/[email protected][email protected]&target=es2017"},{key:"modPlaceholder",url:"https://esm.sh/@tiptap/[email protected][email protected]&target=es2017"},{key:"modLink",url:"https://esm.sh/@tiptap/[email protected][email protected]&target=es2017",export:"Link"},{key:"modCode",url:"https://esm.sh/@tiptap/[email protected][email protected]&target=es2017",export:"Code"},{key:"modMarkdown",url:"https://esm.sh/[email protected][email protected]&target=es2017"},{key:"modChar",url:"https://esm.sh/@tiptap/[email protected][email protected]&target=es2017"},{key:"modTippy",url:"https://esm.sh/[email protected]"},...window.chatpro.editor.extraLibraries],o=await Promise.all(e.map(t=>import(t.url))),r={};e.forEach((t,e)=>{const i=o[e];r[t.key]=i.default||i[t.export]||i});const{modCore:i,modStarter:n,modPlaceholder:s,modLink:a,modCode:d,modMarkdown:c,modChar:l,modTippy:h}=r,p=i.Editor,u=i.Node,m=i.mergeAttributes,f=n.StarterKit||n,g=s.Placeholder||s,w=a.Link||a,y=d.Code||d,_=c.Markdown||c,k=l.CharacterCount||l,x=h;return t('link[href*="tippy.js"]').length||t("head").append('<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tippy.css">'),window._chatproTiptapLibrary={...r,Editor:p,Node:u,mergeAttributes:m,StarterKit:f,Placeholder:g,Link:w,Code:y,Markdown:_,CharacterCount:k,tippy:x},window._chatproTiptapLoading=!1,window._chatproTiptapLibrary}catch(t){throw window._chatproTiptapLoading=!1,t}},_getExtensions:function(t,e){const l=[t.StarterKit.configure({heading:!1,blockquote:!1,
1codeBlock:!1,bold:!!o&&{},italic:!!r&&{},strike:!!i&&{},code:!!n&&{},horizontalRule:!1,bulletList:!1,orderedList:!1,paragraph:{},text:{},document:{},history:!!a&&{},image:!1})];return d&&l.push(t.Placeholder.configure({placeholder:this.scope.data("placeholder"),emptyEditorClass:m})),s&&l.push(t.Link.configure({openOnClick:!1,autolink:!0})),c&&l.push(t.CharacterCount),l.push(t.Markdown.configure({html:!0,tightLists:!0,bulletListMarker:"-",transformPastedText:!1,transformCopiedText:!1,serializer:this._getMarkdownSerializers()})),window.chatpro.editor.extraExtensions.length&&window.chatpro.editor.extraExtensions.forEach(e=>{"function"==typeof e&&l.push(e(t))}),l},_getEditorProps:function(){return{attributes:{class:u,style:"outline: none; display: block;"},transformPastedHTML:t=>t.replace(/<(?!\/?a(?=>|\s.*>))[^>]*>?/gm,""),handleKeyDown:(e,o)=>{const r=o.ctrlKey||o.metaKey;return l&&"Enter"===o.key&&!o.shiftKey?!t(".chatproMention_list").length&&(o.preventDefault(),this.submitForm(),!0):("Enter"===o.key&&o.shiftKey&&!h||r&&o.shiftKey&&"x"===o.key.toLowerCase()&&this._editor.commands.toggleStrike()||!!(r&&("e"===o.key.toLowerCase()||o.shiftKey&&"e"===o.key.toLowerCase())&&this._editor.commands.toggleCode()))&&(o.preventDefault(),!0)}}},_getInitialContent:function(){const t=this.scope.find('[data-role="actualValue"]').val();return chatpro.parser.content({content:t})},syncValue:e.debounce(function(){this.syncValueNow()},200),syncValueNow:function(){if(!this._editor||!this.scope)return"";const e=this.scope.find('[data-role="actualValue"]');let o="";try{if(this._editor.storage.markdown){let t=this._editor.storage.markdown.getMarkdown();o=t.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&nbsp;/g," "),window.chatpro.editor.extraSyncCleanups.length&&window.chatpro.editor.extraSyncCleanups.forEach(t=>{"function"==typeof t&&(o=t(o))})}else o=this._editor.getText()}catch(t){o=this._editor.getText()}return o=o.trim()||this._editor.isEmpty?o:this._editor.getText(),e.val(o),t(document).trigger("chatpro:editorChange",[this._roomId,o,o.length]),o},handleExternalInsert:function(t,e){if(!this._editor||!e.content)return;if(void 0!==e.targetRoomId&&null!==e.targetRoomId&&e.targetRoomId!=this._roomId)return;let o=this._editor.chain().focus(),r=!1;if(window.chatpro.editor.extraInsertHandlers.length)for(const t of window.chatpro.editor.extraInsertHandlers)if("function"==typeof t&&t(o,e.content)){r=!0;break}r||o.insertContent(e.content),o.insertContent(" ").run(),this.syncValueNow(),e.submit&&this.submitForm()},handleMessageSent:function(t,e){this._roomId==e&&this._editor&&(this._editor.commands.clearContent(),this.syncValueNow())},handleFocusEditor:function(t,e){this._roomId==e&&this._editor&&this.focusEditor()},submitForm:function(){const t=this.scope.closest("form");if(!t.length||!this._editor)return;this.syncValue.cancel();const e=this.syncValueNow(),o=t.find(".ipsAttach_done").length>0;(e.trim().length>0||o)&&(t.trigger("submit"),setTimeout(()=>{this._editor&&(this._editor.commands.clearContent(),this.scope.find('[data-role="actualValue"]').val(""),this.scope.closest(".room__editor").find("form textarea").not('[data-role="actualValue"]').val("").trigger("input"))},50))},focusEditor:function(){this._editor&&this._editor.chain().focus().run()},_getMarkdownSerializers:function(){return{...window.chatpro.editor.extraSerializers,marks:{bold:{open:"**",close:"**",mixable:!0,expellable:!0},italic:{open:"_",close:"_",mixable:!0,expellable:!0},strike:{open:"~~",close:"~~",mixable:!0,expellable:!0},...window.chatpro.editor.extraSerializers.marks}}},destruct:function(){t(document).off("chatpro:insertContent."+this.controllerID),t(document).off("chatpro:messageSent."+this.controllerID),t(document).off("chatpro:focusEditor."+this.controllerID),this._editor&&this._editor.destroy()}})}(jQuery,_);;
2!function(){"use strict";const e=chatpro.parser,t=t=>{const a=e.escapeHTML(decodeURIComponent(t)),i=`${ips.getSetting("baseURL")}/uploads/emoticons/${a}`,n=a.replace(/@2x\.(png|gif|jpg|jpeg|webp|svg)$/,"").replace(/\.(png|gif|jpg|jpeg|webp|svg)$/,"");return`<img class="ipsEmoji" src="${i}" alt="${e.escapeHTML(n)}" data-filename="${a}" loading="lazy">`},a=e=>`<span class="ipsEmoji">${e}</span>`;e.setRenderer("emoji",t),e.setRenderer("nativeEmoji",a),e.addRule({name:"emoji",regex:/!\[emoji\]\(([^)]+)\)/gi,render:(e,a)=>a?t(e[1]):ips.getString("chatpro_parse_emoji")}),e.addRule({name:"native_emoji",regex:/:emoji:([a-z0-9_-]+):/gi,render:(e,a)=>t(e[1])}),e.addRule({name:"native_emoji_legacy",regex:/:emoji:(.*?):\/emoji:/gi,render:(e,t)=>a(e[1])}),window.chatpro.editor.extraExtensions.push(e=>{const t=e.Node,a=chatpro.db.get("emoji_"+ips.getSetting("emoji_cache")),i={};
2return a&&Object.values(a).forEach(e=>{e.forEach(e=>{if(e.unicode&&e.image){const t=e.image.image2x||e.image.image;if(t){const a=t.split("/").pop().split("?")[0];i[e.unicode]=a}}})}),t.create({name:"customEmoji",group:"inline",inline:!0,atom:!0,addAttributes:()=>({filename:{default:null,parseHTML:e=>e.getAttribute("data-filename"),renderHTML:e=>({"data-filename":e.filename})}}),parseHTML:()=>[{tag:"img[data-filename]"}],renderHTML:({node:e})=>{const t=e.attrs.filename;return["img",{src:`${ips.getSetting("baseURL")}/uploads/emoticons/${t}`,alt:t.split(".")[0].replace(/@2x$/,""),class:"ipsEmoji","data-filename":t,loading:"lazy"}]},addInputRules:function(){const e=[{find:/!\[emoji\]\(([^)]+)\)/,handler:({state:e,range:t,match:a})=>{e.tr.replaceWith(t.from,t.to,this.type.create({filename:decodeURIComponent(a[1])}))}}];return i&&Object.entries(i).forEach(([t,a])=>{var i;e.push({find:new RegExp(`(?:^|\\s)(${i=t,i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}) $`),handler:({state:e,range:t,match:i})=>{const{tr:n}=e,o=t.from+i[0].indexOf(i[1]),r=t.to;n.replaceWith(o,r,this.type.create({filename:a}))}})}),e}})}),window.chatpro.editor.extraSerializers.customEmoji=(e,t)=>{e.write(`![emoji](${encodeURIComponent(t.attrs.filename)})`)},window.chatpro.editor.extraInsertHandlers.push((e,t)=>{const a=t.match(/^!\[emoji\]\(([^)]+)\)$/);return!!a&&(e.insertContent({type:"customEmoji",attrs:{filename:decodeURIComponent(a[1])}}),!0)}),window.chatpro.editor.extraSyncCleanups.push(e=>e.replace(/<(?:div|span|img)[^>]*data-filename="([^"]+)"[^>]*>[\s\S]*?(?:<\/(?:div|span)>|)/g,(e,t)=>`![emoji](${encodeURIComponent(t)})`))}(jQuery,_);;
3!function(){"use strict";const t=chatpro.parser,e=(e,a,r="image")=>{const i=t.escapeHTML(e);return`<img class="chatproImg" src="${t.escapeHTML(a)}" alt="${t.escapeHTML(r)}" data-full-image="${i}" loading="lazy">`};t.setRenderer("image",e),t.addRule({name:"markdown_image",regex:/!\[image\]\((https?:\/\/[^\s)]+)\)/gi,render:(t,a)=>a?e(t[1],t[1],"image"):ips.getString("chatpro_parse_image")}),window.chatpro.editor.extraExtensions.push(t=>t.Node.create({name:"markdownImage",group:"inline",inline:!0,atom:!0,addAttributes:()=>({url:{default:null,parseHTML:t=>(t.getAttribute("data-full-image")||t.getAttribute("src")||"").trim(),renderHTML:t=>({"data-full-image":t.url})},alt:{default:"image",parseHTML:t=>t.getAttribute("alt"),renderHTML:t=>({alt:t.alt})}}),parseHTML:()=>[{tag:"img[data-full-image]"}],renderHTML:({node:t})=>["img",{src:t.attrs.url,alt:t.attrs.alt,class:"chatproImg","data-full-image":t.attrs.url,loading:"lazy"}],addInputRules:function(){return[{find:/!\[image\]\((https?:\/\/[^\s)]+)\)/i,handler:({state:t,range:e,match:a})=>{t.tr.replaceWith(e.from,e.to,this.type.create({url:a[1].trim(),alt:"image"}))}}]},addPasteRules:function(){return[{find:/(https?:\/\/[^\s]+?\.(?:gif|jpg|jpeg|png|webp|svg)(?:\?[^\s]*)?)/gi,handler:({state:t,range:e,match:a})=>{t.tr.replaceWith(e.from,e.to,this.type.create({url:a[1].trim(),alt:"image"}))}}]}})),window.chatpro.editor.extraSerializers.markdownImage=(t,e)=>{t.write(`![image](${e.attrs.url})`)},window.chatpro.editor.extraInsertHandlers.push((t,e)=>{const a=e.match(/^!\[image\]\((https?:\/\/[^\s)]+)\)$/i)||e.match(/^(https?:\/\/[^\s]+?\.(?:gif|jpg|jpeg|png|webp|svg)(?:\?[^\s]*)?)$/i);return!!a&&(t.insertContent({type:"markdownImage",attrs:{url:(a[1]||a[0]).trim(),alt:"image"}}),!0)}),window.chatpro.editor.extraSyncCleanups.push(t=>t.replace(/<(?:img|div|span)[^>]*data-full-image="([^"]+)"[^>]*>[\s\S]*?(?:<\/(?:div|span)>|)/g,(t,e)=>`![image](${e.trim()})`))}(jQuery,_);;
4!function(e){"use strict";const t=chatpro.parser,r=e=>{try{const t=new URL(e),r=t.hostname.toLowerCase(),a=t.pathname;if(r.includes("youtube.com")||r.includes("youtu.be")){let i="";return i=r.includes("youtu.be")?a.split("/")[1]?.split("?")[0]:a.includes("/shorts/")?a.split("/shorts/")[1]?.split("?")[0]:a.includes("/embed/")?a.split("/embed/")[1]?.split("?")[0]:t.searchParams.get("v")||a.split("/").pop()?.split("?")[0],i?{embedUrl:`https://www.youtube.com/embed/${i}?rel=0&showinfo=0`,thumbUrl:`https://img.youtube.com/vi/${i}/mqdefault.jpg`,isShorts:e.includes("/shorts/")||e.includes("shorts")}:null}if(r.includes("vimeo.com")){const e=a.split("/").pop()?.split("?")[0];return e?{embedUrl:`https://player.vimeo.com/video/${e}`,isShorts:!1}:null}if(r.includes("twitch.tv")){const e=location.hostname;if(a.includes("/videos/"))return{embedUrl:`https://player.twitch.tv/?video=${a.split("/videos/")[1]?.split("?")[0]}&parent=${e}`,isShorts:!1};const t=a.split("/")[1]?.split("?")[0];return t?{embedUrl:`https://player.twitch.tv/?channel=${t}&parent=${e}`,isShorts:!1}:null}}catch(e){return null}return null},a=e=>{try{const t=new URL(e),r=t.pathname.toLowerCase();if(r.match(/\.(mp3|wav|ogg|m4a|aac)$/))return"audio";if(r.match(/\.(mp4|webm|ogv|mov)$/))return"video";if(r.match(/\.(jpg|jpeg|png|gif|webp|svg)$/))return"image";const a=t.hostname.toLowerCase();if(["youtube.com","youtu.be","vimeo.com","twitch.tv","dailymotion.com"].some(e=>a.includes(e)))return"embed"}catch(e){}return"link"},i=e=>{const t=ips.getSetting("baseURL")+"applications/chatpro/interface/static/waveform.svg";return ips.templates.render("chatpro.parseAudio",{url:e,waveform:t})},d=e=>{const a=r(e);return a?`<div class="chatproEmbed" data-embed-url="${e}">${ips.templates.render("chatpro.parseMediaIframe",{embedUrl:a.embedUrl,isShorts:a.isShorts})}</div>`:`<a href='${t.escapeHTML(e)}' target='_blank' rel='noopener noreferrer'>${t.truncateURL(e)}</a>`},o=e=>{const t=a(e);return"embed"===t?d(e):"audio"===t?i(e):`<div class="chatproVideo" data-video-url="${e}">${ips.templates.render("chatpro.parseVideo",{url:e})}</div>`};t.setRenderer("audio",i),t.setRenderer("video",o),t.setRenderer("embed",d),t.setHelper("parseEmbedURL",r),t.setHelper("detectMediaType",a),t.addRule({name:"media_audio",regex:/!\[audio\]\(([^)\s]+)\)/gi,render:(e,t)=>t?i(e[1]):ips.getString("chatpro_parse_audio")}),t.addRule({name:"media_video",regex:/!\[video\]\(([^)\s]+)\)/gi,render:(e,t)=>t?o(e[1]):ips.getString("chatpro_parse_video")}),window.chatpro.editor.extraExtensions.push(t=>t.Node.create({name:"audioNode",group:"inline",inline:!0,atom:!0,addAttributes:()=>({url:{default:null,parseHTML:e=>e.getAttribute("data-audio-url")||e.getAttribute("data-url"),renderHTML:e=>({"data-audio-url":e.url})}}),parseHTML:()=>[{tag:"span[data-audio-url]"},{tag:"div.chatproAudio[data-url]"}],renderHTML:({node:e})=>["span",{class:"chatpro_editor_audio_preview","data-audio-url":e.attrs.url,contenteditable:!1},"Audio Player"],addNodeView:()=>({node:t})=>{const r=document.createElement("span");return r.classList.add("chatpro_editor_audio_preview"),r.setAttribute("data-audio-url",t.attrs.url),r.setAttribute("contenteditable","false"),r.innerHTML=i(t.attrs.url),setTimeout(()=>window.chatpro?.utils?.initMedia?.(e(r)),10),{dom:r}},addInputRules:function(){return[{find:/!\[audio\]\(([^)\s]+?)\)/i,handler:({state:e,range:t,match:r})=>{e.tr.replaceWith(t.from,t.to,this.type.create({url:r[1]}))}}]},addPasteRules:function(){return[{find:/(https?:\/\/[^\s]+?\.(?:mp3|wav|ogg|m4a|aac)(?:\?[^\
4s]*)?)/gi,handler:({state:e,range:t,match:r})=>{e.tr.replaceWith(t.from,t.to,this.type.create({url:r[1]}))}}]}})),window.chatpro.editor.extraExtensions.push(e=>e.Node.create({name:"videoNode",group:"inline",inline:!0,atom:!0,addAttributes:()=>({url:{default:null,parseHTML:e=>e.getAttribute("data-video-url"),renderHTML:e=>({"data-video-url":e.url})}}),parseHTML:()=>[{tag:"span[data-video-url]"},{tag:"div.chatproVideo[data-video-url]"}],renderHTML:({node:e})=>["span",{class:"chatpro_editor_media_card video","data-video-url":e.attrs.url,contenteditable:!1}],addInputRules:function(){return[{find:/!\[video\]\(([^)\s]+?)\)/i,handler:({state:e,range:t,match:r})=>{e.tr.replaceWith(t.from,t.to,this.type.create({url:r[1]}))}}]},addPasteRules:function(){return[{find:/(https?:\/\/[^\s]+?\.(?:mp4|webm|ogv|mov)(?:\?[^\s]*)?)/gi,handler:({state:e,range:t,match:r})=>{e.tr.replaceWith(t.from,t.to,this.type.create({url:r[1]}))}}]}})),window.chatpro.editor.extraExtensions.push(e=>e.Node.create({name:"embedNode",group:"inline",inline:!0,atom:!0,addAttributes:()=>({url:{default:null,parseHTML:e=>e.getAttribute("data-embed-url"),renderHTML:e=>({"data-embed-url":e.url})}}),parseHTML:()=>[{tag:"span[data-embed-url]"},{tag:"div.chatproEmbed[data-embed-url]"}],renderHTML:({node:e})=>{const t=e.attrs.url,a=r(t);return a?["span",{class:"chatpro_editor_media_card embed","data-embed-url":t,style:a.thumbUrl?`background-image: url(${a.thumbUrl})`:"",contenteditable:!1}]:["div",{class:"chatpro_editor_embed_error"},t]},addPasteRules:function(){return[{find:/(https?:\/\/(?:www\.)?(?:youtube\.com|youtu\.be|vimeo\.com|twitch\.tv|dailymotion\.com)[^\s]+)/gi,handler:({state:e,range:t,match:r})=>{e.tr.replaceWith(t.from,t.to,this.type.create({url:r[1]}))}}]}})),window.chatpro.editor.extraSerializers.audioNode=(e,t)=>e.write(`![audio](${t.attrs.url})`),window.chatpro.editor.extraSerializers.videoNode=(e,t)=>e.write(`![video](${t.attrs.url})`),window.chatpro.editor.extraSerializers.embedNode=(e,t)=>e.write(`![video](${t.attrs.url})`),window.chatpro.editor.extraInsertHandlers.push((e,t)=>{const r=t.match(/^!\[audio\]\(([^)\s]+?)\)$/i);if(r)return e.insertContent({type:"audioNode",attrs:{url:r[1]}}),!0;const a=t.match(/^!\[video\]\(([^)\s]+?)\)$/i);return!!a&&(e.insertContent({type:"videoNode",attrs:{url:a[1]}}),!0)}),window.chatpro.editor.extraSyncCleanups.push(e=>(e=(e=e.replace(/<(?:div|span)[^>]*data-audio-url="([^"]+)"[^>]*>[\s\S]*?<\/(?:div|span)>/g,(e,t)=>`![audio](${t})`)).replace(/<(?:div|span)[^>]*data-video-url="([^"]+)"[^>]*>[\s\S]*?<\/(?:div|span)>/g,(e,t)=>`![video](${t})`)).replace(/<(?:div|span)[^>]*data-embed-url="([^"]+)"[^>]*>[\s\S]*?<\/(?:div|span)>/g,(e,t)=>`![video](${t})`))}(jQuery,_);;
5!function(){"use strict";const e=chatpro.parser;window.chatpro.editor.extraLibraries.push({key:"modMention",url:"https://esm.sh/@tiptap/[email protected][email protected]",export:"Mention"});const t=(t,n,r=!0)=>{if(!r)return`@${e.escapeHTML(n)}`;const o=String(n).replace(/\s+/g,"-").toLowerCase(),i=`${ips.getSetting("baseURL").replace(/\/$/,"")}/profile/${t}-${o}`;return ips.templates.render("chatpro.parseMention",{link:i,id:t,name:e.escapeHTML(n)})};e.setRenderer("mention",t),e.addRule({name:"mention",regex:/@\[(\d+):([^\]]+)\]/gi,render:(e,n)=>t(e[1],e[2],n)});const n=(e,t)=>{e.innerHTML="",t.items.forEach((n,r)=>{const o=document.createElement("div");o.classList.add("chatproMention_item"),o.setAttribute("data-id",n.id),0===r&&o.classList.add("chatproMention_item-active"),o.innerHTML=`\n                <img src="${n.photo}">\n                <span>${n.name}</span>\n            `,o.onmouseenter=()=>{e.querySelectorAll(".chatproMention_item-active").forEach(e=>e.classList.remove("chatproMention_item-active")),o.classList.add("chatproMention_item-active")},o.onclick=()=>{t.command({id:n.id,label:n.name})},e.appendChild(o)})},r=(e,t)=>{e.forEach(e=>e.classList.remove("chatproMention_item-active")),e[t]&&(e[t].classList.add("chatproMention_item-active"),e[t].scrollIntoView({block:"nearest"}))};window.chatpro.editor.extraExtensions.push(e=>{const t="chatpro-mention-style";if(!document.getElementById(t)){const e=document.createElement("style");e.id=t,e.textContent='.ipsMention[contenteditable="false"]::before { content: "@"; pointer-events: none; user-select: none; }',document.head.appendChild(e)}const o=e.modMention.Mention||e.modMention,i=e.modCore.mergeAttributes;return o.extend({name:"mention",atom:!0,selectable:!0,renderHTML({node:e,HTMLAttributes:t}){const n=e.attrs.id,r=e.attrs.label||n;return["span",i(this.options.HTMLAttributes,t,{"data-id":n,"data-label":r,"data-type":"mention",contenteditable:"false"}),r]}}).configure({deleteTrigger:!0,HTMLAttributes:{class:"ipsMention"},suggestion:{char:"@",allowSpaces:!0,command:({editor:e,range:t,props:n})=>{e.chain().focus().insertContentAt(t,[{type:"mention",attrs:n}]).run()},async items({query:e}){if(e.length<2)return[];try{const t=chatpro.config.url.media;return await ips.fetch(`${t}&do=memberSearch&q=${encodeURIComponent(e)}`)}catch(e){return[]}},render:()=>{let t,o,i;return{onStart:r=>{i=r,t=document.createElement("div"),t.classList.add("chatproMention_list");
5const a=e.tippy.default||e.tippy;a&&(o=a(document.body,{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:t,showOnCreate:!1,interactive:!0,trigger:"manual",placement:"top-start",zIndex:1e4,maxWidth:"none",animation:!1,theme:"chatpro",arrow:!1,offset:[0,5]}),Array.isArray(o)&&(o=o[0]),r.items.length&&(n(t,r),o.show()))},onUpdate(e){i=e,o&&(e.items.length?(n(t,e),o.setProps({getReferenceClientRect:e.clientRect}),o.show()):o.hide())},onKeyDown(e){if(!o||!o.state.isVisible)return!1;if("Escape"===e.event.key)return e.event.preventDefault(),e.event.stopPropagation(),o.hide(),!0;const n=t.querySelectorAll(".chatproMention_item"),a=t.querySelector(".chatproMention_item-active");let s=Array.from(n).indexOf(a);if("ArrowUp"===e.event.key)return e.event.preventDefault(),e.event.stopPropagation(),s=(s+n.length-1)%n.length,r(n,s),!0;if("ArrowDown"===e.event.key)return e.event.preventDefault(),e.event.stopPropagation(),s=(s+1)%n.length,r(n,s),!0;if("Enter"===e.event.key){if(e.event.preventDefault(),e.event.stopPropagation(),a){const t=a.getAttribute("data-id"),n=((i?i.items:[])||[]).find(e=>e.id==t),r=e.command||(i?i.command:null);n&&"function"==typeof r&&r({id:n.id,label:n.name})}return!0}return!1},onExit(){o&&o.destroy()}}}}})}),window.chatpro.editor.extraSerializers.mention=(e,t)=>{e.write(`@[${t.attrs.id}:${t.attrs.label}]`)},window.chatpro.editor.extraInsertHandlers.push((e,t)=>{const n=t.match(/^@\[(\d+):(.*?)\]$/);return!!n&&(e.insertContent({type:"mention",attrs:{id:n[1],label:n[2]}}),!0)}),window.chatpro.editor.extraSyncCleanups.push(e=>e.replace(/<span[^>]*data-type="mention"[^>]*>([\s\S]*?)<\/span>/g,(e,t)=>`@[${e.match(/data-id="(\d+)"/)?.[1]||""}:${t.replace(/<[^>]*>/g,"").replace(/^@/,"").trim()}]`))}(jQuery,_);;
6!function(t,e,i){"use strict";ips.controller.register("chatpro.emoji",{_emojiStore:i,_customEmojiStore:i,_categoryList:null,_searchEl:null,_iconArea:null,_typeTimer:null,_lastVal:"",_isInit:!1,initialize:function(){this.on("click",'[data-action="selectEmoji"]',this.selectEmoji),this.on("click",'[data-action="selectCategory"]',this.selectCategory),this.on("focus",'[data-role="searchEmoji"]',this.searchEmoticons),this.on("blur",'[data-role="searchEmoji"]',this.stopSearchEmoticons),this.setup()},setup:function(){this.scope.html(ips.templates.render("chatpro.emoji.tab.content")),this._categoryList=this.scope.find(".categoryList"),this._iconArea=this.scope.find("[data-role='icons']"),this._searchEl=this.scope.find('[data-role="searchEmoji"]');const t=this.scope.closest(".ipsMenu_innerContent"),e=t.find(".ipsTabs"),i=e.is(":visible")?e.outerHeight():0;this.scope.height(t.height()-i),this.initStore()},initStore:async function(){this._isInit||(await this.loadEmojiStore(),await this.loadEmojis(),this._isInit=!0)},loadEmojiStore:async function(){try{const t=chatpro.db.get("emoji_"+ips.getSetting("emoji_cache"));this._customEmojiStore=t||await chatpro.fetch.emojiCustom(),this._emojiStore={};for(const t in this._customEmojiStore)this._emojiStore[t]={name:t,emojis:Object.values(this._customEmojiStore[t])};const e=await chatpro.fetch.emojiNative();for(let[t,{emojis:i}]of Object.entries(e)){for(const t in i){const e=Number("0x"+t.split(/\s+/)[0]);128107<=e&&e<=128109&&delete i[t]}t=ips.getString(`iconpicker_category--${t.trim().toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("_")}`),this._emojiStore[t]?Object.assign(this._emojiStore[t].emojis,i):this._emojiStore[t]={name:t,emojis:i}}this.renderCategorySelectors()}catch(t){Debug.error(t)}},loadEmojis:async function(t=""){const e=await this.search(t);let i="";for(const[t,o]of Object.entries(e))o.length&&(i+=ips.templates.render("chatpro.emoji.list",{name:t,icons:o.map(t=>({...t,title:t.title}))}));this._iconArea[0].innerHTML=i},search:async function(t=""){if(!this._emojiStore||!Object.keys(this._emojiStore).length)return{};const e={},i={"Search Result":[]},o=t.trim().length>0,s=t=>({raw:t.image?null:this.codePointsToString(t.unicode),image:t.image?.image2x||t.image?.image,key:t.image?t.unicode||t.description:t.unicode,title:t.title||t.description||""});for(const r in this._emojiStore){const n=Object.values(this._emojiStore[r].emojis).map(s);if(o){const e=t.trim().toLowerCase().split(/\s+/),o=n.filter(t=>e.every(e=>t.title.toLowerCase().includes(e)));o.length>0&&i["Search Result"].push(...o)}else e[r]=n}return o?i:e},hex2dec:function(t){return"string"==typeof t?Number("0x"+t):t},_emojiMap:{}
6,codePointsToString:function(t){Array.isArray(t)||(t=t.split(" "));const e=JSON.stringify([t]);return e in this._emojiMap||(this._emojiMap[e]=String.fromCodePoint(...t.map(t=>this.hex2dec(t)).flat().filter(t=>!!t))),this._emojiMap[e]},selectEmoji:function(e){e.preventDefault();const i=t(e.currentTarget),o=i.find("img"),s=o.length>0;let r="";if(s){const t=o.attr("src");if(t){const e=t.split("/").pop().split("?")[0];r=`![emoji](${encodeURIComponent(e)})`}}else r=i.text().trim();if(r){const e=this.scope.closest("[data-room-id]").data("room-id")||null;t(document).trigger("chatpro:insertContent",{content:r,isEmoji:!0,isCustom:s,targetRoomId:e})}this.scope.trigger("closeMenu")},renderCategorySelectors:function(){if(!this._categoryList||!this._categoryList[0])return;let t="";for(const e in this._emojiStore)t+=ips.templates.render("chatpro.emoji.category",{title:e});this._categoryList[0].innerHTML=t},updateCategorySelector:function(t){this._categoryList&&this._categoryList[0]&&this._categoryList.append(ips.templates.render("chatpro.emoji.category",{title:t}))},selectCategory:function(e){e.preventDefault();const i=t(e.currentTarget).attr("data-title"),o=this.scope.find(`section[data-icon-category="${i}"]`);if(o.length&&this._iconArea.length){const t=o.offset().top-this._iconArea.offset().top+this._iconArea.scrollTop();this._iconArea.scrollTop(t)}return!1},searchEmoticons:function(){this._typeTimer=setInterval(e.bind(this._typing,this),200)},stopSearchEmoticons:function(){this._typeTimer&&(clearInterval(this._typeTimer),this._typeTimer=null)},_typing:function(){this._lastVal!==this._searchEl.val()&&(""===this._searchEl.val()?this._clearSearch():this._doSearch(this._searchEl.val()),this._lastVal=this._searchEl.val())},_clearSearch:function(){this.loadEmojis()},_doSearch:async function(t){await this.loadEmojis(t)}})}(jQuery,_);;

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.