1import{a as d}from"./chunk-W65CXF5J.js";import{a as l,b as c}from"./chunk-NALFLB2L.js";import u from"/assets/js/chat/index.js";var h=["recommended"],n=class{constructor(t){this.el=t,this.elements={content:t.querySelector("#message-content"),author:t.querySelector("#message-author")},this.history={},this.render("To start chatting, tap anywhere."),l(this)}generate(t){this.dragging||t.target.closest("a")||[this.select,this.require,this.extract,this.render].reduce((e,s)=>s.call(this,e),null)}select(){return this.random(h,"data")}require(t){return u[t]}extract({phrasings:t,inventory:i,thesaurus:e}){let s=this.random(t,h[this.history.data]),o=i.map(r=>{if(typeof e[r]=="function")return e[r];if(typeof e[r]=="object"){let a=e[r];return Array.isArray(a)?this.random(a,r):a}});return s(...o,r=>(r.match(/^[aeiou]/)?"an ":"a ")+r)}render(t){t=d(t,400,null,700),this.el.classList.add("leave"),this.el.classList.remove("enter"),clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.el.classList.remove("leave"),this.elements.content.innerHTML=t,this.elements.author.innerHTML=this.history.data!=null?this.require(h[this.history.data]).signature:"The Computer",this.el.offsetWidth,this.el.classList.add("enter"),clearTimeout(this.timeout)},800)}random(t,i){let e=(this.history[i]+1)%t.length||0;if(e===0){let s=t.pop(),o=1+Math.floor(Math.random()*t.length);t.sort(()=>-1+2*Math.random()),t.splice(o,0,s)}return this.history[i]=e,t[e]}pointerMove(t){this.dragging=!0}pointerDown(t){this.dragging=!1}destroy(){c(this)}};n.prototype.events={click:"generate",pointermove:"pointerMove",pointerdown:"pointerDown"};var y=n;export{y as default};
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.