diff --git a/assets/css/joe.census.min.css b/assets/css/joe.census.min.css
index f6c3bc3..c605c7f 100644
--- a/assets/css/joe.census.min.css
+++ b/assets/css/joe.census.min.css
@@ -1 +1 @@
-.joe_census__basic{display:grid;grid-template-columns:repeat(4, 1fr);gap:15px}.joe_census__basic-item{display:flex;align-items:center;justify-content:space-between;background:var(--background);box-shadow:var(--box-shadow);border-radius:var(--radius-inner) var(--radius-wrap) var(--radius-wrap) var(--radius-inner);padding:12px 15px}.joe_census__basic-item .count h6{font-size:12px;margin-bottom:10px;color:var(--seat)}.joe_census__basic-item .count p{font-size:22px;font-weight:700}.joe_census__basic-item .icon{fill:var(--classA)}.joe_census__basic-item:nth-child(1){border-left:5px solid #1cc88a;color:#1cc88a}.joe_census__basic-item:nth-child(2){border-left:5px solid #36b9cc;color:#36b9cc}.joe_census__basic-item:nth-child(3){border-left:5px solid #2196f3;color:#2196f3}.joe_census__basic-item:nth-child(4){border-left:5px solid #9c27b0;color:#9c27b0}
+.joe_census__basic{display:grid;grid-template-columns:repeat(4, 1fr);gap:15px;margin-bottom:15px}.joe_census__basic-item{display:flex;align-items:center;justify-content:space-between;background:var(--background);box-shadow:var(--box-shadow);border-radius:var(--radius-inner) var(--radius-wrap) var(--radius-wrap) var(--radius-inner);padding:12px 15px}.joe_census__basic-item .count h6{font-size:12px;margin-bottom:10px;color:var(--seat)}.joe_census__basic-item .count p{font-size:22px;font-weight:700}.joe_census__basic-item .icon{fill:var(--classA)}.joe_census__basic-item:nth-child(1){border-left:5px solid #1cc88a;color:#1cc88a}.joe_census__basic-item:nth-child(2){border-left:5px solid #36b9cc;color:#36b9cc}.joe_census__basic-item:nth-child(3){border-left:5px solid #2196f3;color:#2196f3}.joe_census__basic-item:nth-child(4){border-left:5px solid #9c27b0;color:#9c27b0}.joe_census__server{display:grid;grid-template-columns:repeat(2, 1fr);gap:15px}.joe_census__server-item{background:var(--background);box-shadow:var(--box-shadow);border-radius:var(--radius-wrap)}.joe_census__server-item .title{display:flex;align-items:center;height:45px;padding:0 12px;border-bottom:1px solid var(--classD);color:var(--main);justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.joe_census__server-item .title .count{color:var(--minor);font-size:12px}.joe_census__server-item .title .count .split{margin:0 5px}.joe_census__server-item .content{padding:15px}.joe_census__server-item .content #work,.joe_census__server-item .content #flow{height:348px}
diff --git a/assets/css/joe.census.min.scss b/assets/css/joe.census.min.scss
index 9dc91b1..ca3d8dd 100644
--- a/assets/css/joe.census.min.scss
+++ b/assets/css/joe.census.min.scss
@@ -3,6 +3,7 @@
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 15px;
+ margin-bottom: 15px;
&-item {
display: flex;
align-items: center;
@@ -43,4 +44,38 @@
}
}
}
+ &__server {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 15px;
+ &-item {
+ background: var(--background);
+ box-shadow: var(--box-shadow);
+ border-radius: var(--radius-wrap);
+ .title {
+ display: flex;
+ align-items: center;
+ height: 45px;
+ padding: 0 12px;
+ border-bottom: 1px solid var(--classD);
+ color: var(--main);
+ justify-content: space-between;
+ user-select: none;
+ .count {
+ color: var(--minor);
+ font-size: 12px;
+ .split {
+ margin: 0 5px;
+ }
+ }
+ }
+ .content {
+ padding: 15px;
+ #work,
+ #flow {
+ height: 348px;
+ }
+ }
+ }
+ }
}
diff --git a/assets/js/joe.census.js b/assets/js/joe.census.js
index 504590b..44d66f9 100644
--- a/assets/js/joe.census.js
+++ b/assets/js/joe.census.js
@@ -1,3 +1,209 @@
document.addEventListener('DOMContentLoaded', () => {
- console.log(1);
-})
\ No newline at end of file
+ /* 转换字节 */
+ const bytesToSize = bytes => {
+ const k = 1024,
+ sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
+ i = Math.floor(Math.log(bytes) / Math.log(k));
+ return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
+ };
+
+ const categories = [];
+ const upSeries = [];
+ const downSeries = [];
+
+ const flowDom = document.querySelector('#flow');
+ const workDom = document.querySelector('#work');
+ const flowChart = flowDom && echarts.init(flowDom);
+ const workChart = workDom && echarts.init(workDom);
+ if (flowDom && workDom) initChart();
+
+ function initChart() {
+ $.ajax({
+ url: Joe.BASE_API,
+ type: 'POST',
+ dataType: 'json',
+ data: {
+ routeType: 'server_status'
+ },
+ success(res) {
+ {
+ $('.joe_census__server-item .count .up').html(`总发送:${bytesToSize(res.upTotal)}`);
+ $('.joe_census__server-item .count .down').html(`总接收:${bytesToSize(res.downTotal)}`);
+ const stamp = new Date();
+ const hours = String(stamp.getHours()).padStart(2, 0);
+ const minutes = String(stamp.getMinutes()).padStart(2, 0);
+ const seconds = String(stamp.getSeconds()).padStart(2, 0);
+ const time = `${hours}:${minutes}:${seconds}`;
+ categories.push(time);
+ upSeries.push(res.up);
+ downSeries.push(res.down);
+ if (categories.length > 5) categories.shift();
+ if (upSeries.length > 5) upSeries.shift();
+ if (downSeries.length > 5) downSeries.shift();
+ flowChart.setOption({
+ title: {
+ subtext: '单位 KB/s'
+ },
+ grid: {
+ left: '3%',
+ right: '4%',
+ bottom: '0',
+ containLabel: true
+ },
+ tooltip: {
+ trigger: 'axis',
+ axisPointer: {
+ type: 'cross',
+ label: {
+ backgroundColor: '#6a7985'
+ }
+ }
+ },
+ xAxis: {
+ axisTick: {
+ show: false
+ },
+ type: 'category',
+ boundaryGap: false,
+ data: categories
+ },
+ yAxis: {
+ type: 'value'
+ },
+ series: [
+ {
+ type: 'line',
+ name: '上行',
+ smooth: true,
+ showSymbol: false,
+ itemStyle: {
+ normal: {
+ color: '#f39494',
+ areaStyle: {
+ color: '#f39494'
+ },
+ lineStyle: {
+ width: 2,
+ color: '#f39494'
+ }
+ }
+ },
+ stack: '总量',
+ data: upSeries
+ },
+ {
+ type: 'line',
+ name: '下行',
+ smooth: true,
+ showSymbol: false,
+ itemStyle: {
+ normal: {
+ color: '#9dd3e8',
+ areaStyle: {
+ color: '#9dd3e8'
+ },
+ lineStyle: {
+ width: 2,
+ color: '#9dd3e8'
+ }
+ }
+ },
+ stack: '总量',
+ data: downSeries
+ }
+ ]
+ });
+ }
+ {
+ /* CPU占用 */
+ const cpuUse = res.cpu[0];
+ /* 内存占用 */
+ const memoryRealUse = Math.round((res.memory.memRealUsed / res.memory.memTotal) * 1000) / 10;
+ /* 内存缓冲 */
+ const memoryCacheUse = Math.round((res.memory.memCached / res.memory.memTotal) * 1000) / 10;
+ /* 系统缓冲 */
+ const memoryBufferUse = Math.round((res.memory.memBuffers / res.memory.memTotal) * 1000) / 10;
+ /* 系统负载 */
+ const systemLoad = Math.round((res.load.one / res.load.max) * 100) > 100 ? 100 : Math.round((res.load.one / res.load.max) * 100);
+ workChart.setOption({
+ title: {
+ subtext: '单位 百分比'
+ },
+ tooltip: {
+ trigger: 'axis',
+ axisPointer: {
+ type: 'shadow'
+ }
+ },
+ grid: {
+ left: '3%',
+ right: '3%',
+ bottom: '3%',
+ containLabel: true
+ },
+ xAxis: {
+ type: 'category',
+ axisTick: {
+ show: false
+ },
+ data: ['CPU占用', '内存占用', '系统缓冲', '内存缓冲', '系统负载']
+ },
+ yAxis: {
+ type: 'value'
+ },
+ series: {
+ data: [
+ {
+ name: 'CPU占用',
+ value: cpuUse,
+ itemStyle: {
+ color: '#b3c25a'
+ }
+ },
+ {
+ name: '内存占用',
+ value: memoryRealUse,
+ itemStyle: {
+ color: '#67b580'
+ }
+ },
+ {
+ name: '系统缓冲',
+ value: memoryBufferUse,
+ itemStyle: {
+ color: '#86ba71'
+ }
+ },
+ {
+ name: '内存缓冲',
+ value: memoryCacheUse,
+ itemStyle: {
+ color: '#feb041'
+ }
+ },
+ {
+ name: '系统负载',
+ value: systemLoad,
+ itemStyle: {
+ color: '#fd7e55'
+ }
+ }
+ ],
+ type: 'bar',
+ showBackground: true,
+ label: {
+ show: true,
+ color: '#ffffff',
+ formatter: params => `${params.data.value} %`
+ },
+ backgroundStyle: {
+ color: 'rgba(180, 180, 180, 0.2)'
+ }
+ }
+ });
+ }
+ setTimeout(initChart, 2000);
+ }
+ });
+ }
+});
diff --git a/assets/js/joe.census.min.js b/assets/js/joe.census.min.js
index 1e36e93..07a62d6 100644
--- a/assets/js/joe.census.min.js
+++ b/assets/js/joe.census.min.js
@@ -1 +1 @@
-document.addEventListener("DOMContentLoaded",()=>{console.log(1)});
\ No newline at end of file
+document.addEventListener("DOMContentLoaded",()=>{function e(){$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"server_status"},success(l){{$(".joe_census__server-item .count .up").html(`总发送:${t(l.upTotal)}`),$(".joe_census__server-item .count .down").html(`总接收:${t(l.downTotal)}`);const e=new Date,n=String(e.getHours()).padStart(2,0),i=String(e.getMinutes()).padStart(2,0),m=String(e.getSeconds()).padStart(2,0),d=`${n}:${i}:${m}`;o.push(d),a.push(l.up),r.push(l.down),o.length>5&&o.shift(),a.length>5&&a.shift(),r.length>5&&r.shift(),s.setOption({title:{subtext:"单位 KB/s"},grid:{left:"3%",right:"4%",bottom:"0",containLabel:!0},tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},xAxis:{axisTick:{show:!1},type:"category",boundaryGap:!1,data:o},yAxis:{type:"value"},series:[{type:"line",name:"上行",smooth:!0,showSymbol:!1,itemStyle:{normal:{color:"#f39494",areaStyle:{color:"#f39494"},lineStyle:{width:2,color:"#f39494"}}},stack:"总量",data:a},{type:"line",name:"下行",smooth:!0,showSymbol:!1,itemStyle:{normal:{color:"#9dd3e8",areaStyle:{color:"#9dd3e8"},lineStyle:{width:2,color:"#9dd3e8"}}},stack:"总量",data:r}]})}{const e=l.cpu[0],t=Math.round(l.memory.memRealUsed/l.memory.memTotal*1e3)/10,o=Math.round(l.memory.memCached/l.memory.memTotal*1e3)/10,a=Math.round(l.memory.memBuffers/l.memory.memTotal*1e3)/10,r=Math.round(l.load.one/l.load.max*100)>100?100:Math.round(l.load.one/l.load.max*100);i.setOption({title:{subtext:"单位 百分比"},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{left:"3%",right:"3%",bottom:"3%",containLabel:!0},xAxis:{type:"category",axisTick:{show:!1},data:["CPU占用","内存占用","系统缓冲","内存缓冲","系统负载"]},yAxis:{type:"value"},series:{data:[{name:"CPU占用",value:e,itemStyle:{color:"#b3c25a"}},{name:"内存占用",value:t,itemStyle:{color:"#67b580"}},{name:"系统缓冲",value:a,itemStyle:{color:"#86ba71"}},{name:"内存缓冲",value:o,itemStyle:{color:"#feb041"}},{name:"系统负载",value:r,itemStyle:{color:"#fd7e55"}}],type:"bar",showBackground:!0,label:{show:!0,color:"#ffffff",formatter:e=>`${e.data.value} %`},backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}})}setTimeout(e,2e3)}})}const t=e=>{const t=1024,o=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],a=Math.floor(Math.log(e)/Math.log(t));return(e/Math.pow(t,a)).toPrecision(3)+" "+o[a]},o=[],a=[],r=[],l=document.querySelector("#flow"),n=document.querySelector("#work"),s=l&&echarts.init(l),i=n&&echarts.init(n);l&&n&&e()});
\ No newline at end of file
diff --git a/assets/js/joe.global.js b/assets/js/joe.global.js
index 8d3e7a1..1e197b5 100644
--- a/assets/js/joe.global.js
+++ b/assets/js/joe.global.js
@@ -327,6 +327,7 @@ document.addEventListener('DOMContentLoaded', () => {
const type = $('.joe_comment__respond-form').attr('data-type');
const parent = $('.joe_comment__respond-form').attr('data-coid');
const author = $(".joe_comment__respond-form .head input[name='author']").val();
+ const _ = $(".joe_comment__respond-form input[name='_']").val();
const mail = $(".joe_comment__respond-form .head input[name='mail']").val();
let text = $(".joe_comment__respond-form .body textarea[name='text']").val();
if (author.trim() === '') return Qmsg.info('请输入昵称!');
@@ -346,7 +347,7 @@ document.addEventListener('DOMContentLoaded', () => {
$.ajax({
url,
type: 'POST',
- data: { author, mail, text, parent, captcha },
+ data: { author, mail, text, parent, captcha, _ },
dataType: 'text',
success(res) {
let arr = [],
@@ -364,9 +365,9 @@ document.addEventListener('DOMContentLoaded', () => {
}
},
error() {
- isSubmit = false
+ isSubmit = false;
$('.joe_comment__respond-form .foot .submit button').html('发表评论');
- Qmsg.warning('发送失败!请刷新重试!')
+ Qmsg.warning('发送失败!请刷新重试!');
}
});
});
diff --git a/assets/js/joe.global.min.js b/assets/js/joe.global.min.js
index 20661be..950ae3a 100644
--- a/assets/js/joe.global.min.js
+++ b/assets/js/joe.global.min.js
@@ -1 +1 @@
-document.addEventListener("DOMContentLoaded",()=>{localStorage.getItem("data-night")?($(".joe_action_item.mode .icon-1").addClass("active"),$(".joe_action_item.mode .icon-2").removeClass("active")):($("html").removeAttr("data-night"),$(".joe_action_item.mode .icon-1").removeClass("active"),$(".joe_action_item.mode .icon-2").addClass("active")),$(".joe_action_item.mode").on("click",()=>{localStorage.getItem("data-night")?($(".joe_action_item.mode .icon-1").removeClass("active"),$(".joe_action_item.mode .icon-2").addClass("active"),$("html").removeAttr("data-night"),localStorage.removeItem("data-night")):($(".joe_action_item.mode .icon-1").addClass("active"),$(".joe_action_item.mode .icon-2").removeClass("active"),$("html").attr("data-night","night"),localStorage.setItem("data-night","night"))}),Joe.IS_MOBILE||"off"===Joe.DYNAMIC_BACKGROUND||!Joe.DYNAMIC_BACKGROUND||Joe.WALLPAPER_BACKGROUND_PC||$.getScript(window.Joe.THEME_URL+`assets/backdrop/${Joe.DYNAMIC_BACKGROUND}`);{$(".joe_header__above-search .input").on("click",e=>{e.stopPropagation(),$(".joe_header__above-search .result").addClass("active")}),$(document).on("click",function(){$(".joe_header__above-search .result").removeClass("active")});const e=()=>{$(".joe_header__above-search .result").hasClass("active")&&$(".joe_header__above-search .result").removeClass("active")};$(document).on("scroll",()=>{window.requestAnimationFrame?window.requestAnimationFrame(e):e()})}$(".joe_dropdown").each(function(e,t){const o=$(this).find(".joe_dropdown__menu"),a=$(t).attr("trigger")||"click",n=$(t).attr("placement")||$(this).height()||0;o.css("top",n),"hover"===a?$(this).hover(()=>$(this).addClass("active"),()=>$(this).removeClass("active")):($(this).on("click",function(e){$(this).toggleClass("active"),$(document).one("click",()=>$(this).removeClass("active")),e.stopPropagation()}),o.on("click",e=>e.stopPropagation()))});{const e=()=>(document.documentElement.scrollTop||document.body.scrollTop)>300?$(".joe_action_item.scroll").addClass("active"):$(".joe_action_item.scroll").removeClass("active");e(),$(document).on("scroll",()=>{window.requestAnimationFrame?window.requestAnimationFrame(e):e()}),$(".joe_action_item.scroll").on("click",()=>window.scrollTo({top:0,behavior:"smooth"}))}if($(".joe_aside__item.timelife").length){let e=[{title:"今日已经过去",endTitle:"小时",num:0,percent:"0%"},{title:"这周已经过去",endTitle:"天",num:0,percent:"0%"},{title:"本月已经过去",endTitle:"天",num:0,percent:"0%"},{title:"今年已经过去",endTitle:"个月",num:0,percent:"0%"}];{let t=+new Date,o=new Date((new Date).toLocaleDateString()).getTime(),a=(t-o)/1e3/60/60,n=a/24*100;e[0].num=parseInt(a),e[0].percent=parseInt(n)+"%"}{let t={0:7,1:1,2:2,3:3,4:4,5:5,6:6},o=t[(new Date).getDay()],a=o/7*100;e[1].num=parseInt(o),e[1].percent=parseInt(a)+"%"}{let t=(new Date).getFullYear(),o=(new Date).getDate(),a=(new Date).getMonth()+1,n=new Date(t,a,0).getDate(),i=o/n*100;e[2].num=o,e[2].percent=parseInt(i)+"%"}{let t=(new Date).getMonth()+1,o=t/12*100;e[3].num=t,e[3].percent=parseInt(o)+"%"}let t="";e.forEach((e,o)=>{t+=`\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t${e.title}\n\t\t\t\t\t\t\t\t${e.num}\n\t\t\t\t\t\t\t\t${e.endTitle}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
${e.percent}
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
`}),$(".joe_aside__item.timelife .joe_aside__item-contain").html(t)}if($(".joe_aside__item.weather").length){const e=$(".joe_aside__item.weather").attr("data-key"),t=$(".joe_aside__item.weather").attr("data-style"),o={1:"FFFFFF",2:"4A4A4A",3:"FFFFFF"};window.WIDGET={CONFIG:{layout:2,width:"220",height:"270",background:t,dataColor:o[t],language:"zh",key:e}},$.getScript("https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0")}if($(".joe_aside__item.tags").length){const e=[],t=["#F8D800","#0396FF","#EA5455","#7367F0","#32CCBC","#F6416C","#28C76F","#9F44D3","#F55555","#736EFE","#E96D71","#DE4313","#D939CD","#4C83FF","#F072B6","#C346C2","#5961F9","#FD6585","#465EFB","#FFC600","#FA742B","#5151E5","#BB4E75","#FF52E5","#49C628","#00EAFF","#F067B4","#F067B4","#ff9a9e","#00f2fe","#4facfe","#f093fb","#6fa3ef","#bc99c4","#46c47c","#f9bb3c","#e8583d","#f68e5f"],o=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e);$(".joe_aside__item-contain .list li").each((a,n)=>{e.push({label:$(n).attr("data-label"),url:$(n).attr("data-url"),target:"_blank",fontColor:t[o(0,t.length-1)],fontSize:15})}),$(".joe_aside__item-contain .tag").svg3DTagCloud({entries:e,width:220,height:220,radius:"65%",radiusMin:75,bgDraw:!1,fov:800,speed:.5,fontWeight:500})}if($(".joe_aside__item:last-child").css("top",$(".joe_header").height()+15),$(".joe_aside__item.flatterer").length){const e=["你昨天晚上又没回我信息,我却看见你的游戏在线,在我再一次孜孜不倦的骚扰你的情况下,你终于跟我说了一句最长的话“**你他妈是不是有病**”,我又陷入了沉思,这一定有什么含义,我想了很久,你竟然提到了我的妈妈,原来你已经想得那么长远了,想和我结婚见我的父母,我太感动了,真的。那你现在在干嘛,我好想你,我妈妈说她也很喜欢你。","今天我观战了一天你和别人打游戏,**你们玩的很开心**;我给你发了200多条消息,你说没流量就不回;晚上发说说没有人爱你,我连滚带爬评论了句有“我在”,你把我拉黑了,我给你打电话也无人接听。对不起,我不该打扰你,我求求你再给我一次当好友的机会吧!","我爸说再敢网恋就打断我的腿,幸好不是胳膊,这样我还能继续**和你打字聊天**,就算连胳膊也打断了,我的心里也会有你位置。","你说你情侣头像是一个人用的,空间上锁是因为你不喜欢玩空间,情侣空间是和闺蜜开的,找你连麦时你说你在忙工作,每次聊天你都说在忙,你真是一个**上进的好女孩**,你真好,我好喜欢你!","你跟他已经醒了吧?我今天捡垃圾挣了一百多,明天给你打过去。你快点休息吧,我明天叫你起床,给你点外卖买烟,给你点你最喜欢的奶茶。晚上我会继续去摆地摊的,你不用担心我,你床只有那么大睡不下三个。**你要好好照顾好自己,不要让他抢你被子**。我永远爱你!","她三天没回我的消息了,在我孜孜不倦地骚扰下她终于舍得回我“**nmsl**”,我想这一定是有什么含义吧,噢!我恍然大悟原来是**尼美舒利颗粒**,她知道我有关节炎让我吃尼美舒利颗粒,她还是关心我的,但是又不想显现的那么热情。天啊!她好高冷,我好像更喜欢她了!","你想我了吧?可以回我消息了吗?我买了万通筋骨贴,你**运动一个晚上腰很疼**吧?今晚早点回家,我炖了排骨汤,我永远在家等你。","昨晚你和朋友打了一晚上游戏,你破天荒的给我看了战绩,虽然我看不懂但是我相信你一定是最厉害的、最棒的。我给你发了好多消息夸你,告诉你我多崇拜你,你回了我一句“**啥B**”,我翻来覆去思考这是什么意思,Sha[傻],噢你是说我傻,那B就是Baby的意思了吧,原来你是在叫我**傻宝**,这么宠溺的语气,我竟一时不敢相信,其实你也是喜欢我的对吧。","今天我还是照常给你发消息,汇报日常工作,你终于回了我四个字:“**嗯嗯,好的。**”。你开始愿意敷衍我了,我太感动了,受宠若惊。我愿意天天给你发消息,就算你天天骂我,我也不觉得烦。","你昨天晚上又没回我的消息,在我孜孜不倦的骚扰下,你终于舍得回我了,你说“**滚**”,这其中一定有什么含义,我想了很久,滚是三点水,这代表你对我的思念也如**滚滚流水**一样汹涌,我感动哭了,不知道你现在在干嘛,我很想你。","听说你想要一套化妆品,我算了算,明天我去工地上**搬一天砖**,就可以拿到200块钱,再加上我上个月攒下来的零花钱,刚好给你买一套迪奥。","今天表白被拒绝了,她对我说能不能脱下裤子**撒泡尿照照自己**。当我脱下裤子,她咽了口水,说我们可以试一下。","刚从派出所出来,原因前几天14号情人节,我想送你礼物,我去偷东西的时候被抓了。我本来想反抗,警察说了一句老实点别动,我立刻就放弃了反抗,因为我记得你说过,你喜欢**老实人**。","疫情不能出门,现在是早上八点,你肯定饿了吧。我早起做好了早餐来到你小区,保安大哥不让进。我给你打了三个电话你终于接了“**有病啊,我还睡觉呢,你小区门口等着吧**”。啊,我高兴坏了!你终于愿意吃我做的早餐了,还让我等你,啊!啊!啊!好幸福噢!","我存了两个月钱,给你买了一双**北卡蓝**,你对我说一句“谢谢”,我好开心。这是你第一次对我说两个字,以前你都只对我说滚。今天晚上逛**闲鱼**,看到了你把我送你的北卡蓝发布上去了。我想你一定是在考验我,再次送给你,给你一个惊喜,我爱你。","昨天**你领完红包就把我删了**,我陷入久久地沉思。我想这其中一定有什么含义,原来你是在欲擒故纵,嫌我不够爱你。无理取闹的你变得更加可爱了,我会坚守我对你的爱的。你放心好啦!今天发工资了,发了1850,给你微信转了520,支付宝1314,还剩下16。给你发了很多消息你没回。剩下16块我在小卖部买了你爱吃的老坛酸菜牛肉面,给你寄过去了。希望你保护好食欲,我去上班了爱你~~","在保安亭内看完了最新一集的梨泰院,曾经多么倔强的朴世路因为伊瑞给张大熙跪下了,亭外的树也许感受到了**我的悲伤**,枯了。我连树都保护不了,怎么保护你,或许保安才是真的需要被保护的吧。我难受,我想你。over","难以言喻的下午。说不想你是假的,说爱你是真的。昨天他们骂**我是你的舔狗**,我不相信,因为我知道你肯定也是爱我的,你一定是在考验我对你的感情,只要我坚持下去你一定会被我的真诚所打动,加油!不过我要批评你一下,昨晚你说**去酒店跟人斗地主**,我寻思两个人也玩不了呀。算了,不想了,毕竟打牌是赌博行为,不太好。","明天就周六了我知道你不上班,但是我怕你睡懒觉不吃早饭饿坏自己。我早晨4点去菜市场买了新鲜活鸡**给你炖鸡汤**,阿姨给我用箱子装了起来,我骑上我280买的电动车哼着小调回家,心想你一定会被我感动的,箱子半路开了,鸡跑了,拐到了一个胡同里,凌晨4点的胡同还有穿超短裙和大叔聊天的美女,不禁感叹这个世界变了,她问我找什么,…………。对不起,我爱你","12点队长过来准时交班,出去的车辆按喇叭我也没听到,只因我在监控中看到了穿睡衣出来倒垃圾的你,**望你望的入神**不由的傻笑了起来,队长过来骂我扣了我一天工资。我委屈,想抱你。你送的泡面真好吃。","今天的我排位输了好多把,我将这些事情分享给你,但是你一个字都没有讲,我在想你是不是在忙?我头痛欲裂,终于在我给你发了几十条消息之后,你回了我一个“**脑子是不是有病?**”,原来你还是关心我的,看到这句话,我的脑子一下就不疼了,今天也是爱你的一天。","我存了半年的工资,给你买了一只LV,你对我说了一句“**你真好**”,我好开心,这是你第一次这么认可我,以前你都只对我说滚。今天晚上逛闲鱼,看到你把我送你的LV发布上去了。我想,你一定是在考验我,于是我用借呗里的钱把它买了下来,再次送给你,给你一个惊喜,我爱你。","其实我每月工资6000,但我只给你转2000,你以为我给你了全部。才不是,我一共舔了3个啦,**我要舔的雨露均沾**,才不会把你当成唯一。","昨天你把我拉黑了,我看着红色感叹号陷入了久久的沉思,我想这其中一定有什么含义?红色红色?我明白了!红色代表热情,你对我很热情,你想和我结婚,我愿意。","今天你问我借了两千块钱,说要做个手术,你果然还是爱我的,**不是我的孩子,你不要**。 ","中午你无故扇了我一巴掌,我握着你的手说“手怎么这么凉,都怪我没有照顾好你,一定要更加对你好”。","我给你打了几通电话,你终于接了。听到了**你发出啊啊啊啊的声音**,你说你肚子痛,我想你一定是很难受吧。电话还有个男的对你说“来换个姿势”,一定是**在做理疗**了。期待你早日康复,我好担心。","昨天晚上好冷,本来以为街上没人,结果刚刚**偷电动车**的时候被抓了,本来想反抗,但警察说了一句老实点别动,我立刻就放弃了抵抗,因为我记得你说过,你喜欢**老实人**。","找你连麦时你说你在忙工作,每次聊天你都说在忙,你真是一个**上进的好女孩**,你真好,发现我越来越喜欢这样优秀的你。","你从来没说过爱我,聊天记录搜索了一下“爱”,唯一的一条是:**你好像乡村爱情里的刘能啊**。","今天好开心啊,和你一起在峡谷嬉戏,打完一波团战之后看到你在打大龙,残血的我跳过去直接被龙爪拍死,但这一刻我觉得好浪漫,**死在你的脚旁边,这是我离你最近的一次**。","哥们,求你和她说句话吧,这样她就不会那么难过了。","今天你把我的微信拉黑了,这下我终于解放了!以前我总担心太多消息会打扰你,现在我终于不用顾忌,不管我怎么给你发消息,都不会让你不开心了。等我**攒够5201314条**我就拿给你看,你一定会震惊得说不出话然后哭着说会爱我一辈子。哈哈。","昨天你把我删了,我陷入了久久的沉思 。我想这其中一定有什么含义,你应该是欲擒故纵吧,嫌我不够爱你。突然觉得**无理取闹的你变得更加可爱**了,我会坚守我对你的爱的 你放心好啦!这么一想,突然对我俩的未来更有期望了呢。","今天上班不是太忙,百无聊赖,又翻出了你的相片,看了又看。今天是我认识你的第302天,也是我爱你的第302天,可是这些你并不知道,也许**你知道了,也不会在意**吧。 此刻的我好想你! ","今天你跟我说我很丑,让我不要骚扰你了。我听了很高兴,小说里的主角都像你这样,最开始表现的很厌恶,但最后**总会被我的真心打动**。你现在有多讨厌我,以后就会有多爱我。嘻嘻。","我坐在窗边给你发了99条消息,你终于肯回我了,你说“**发你妈啊**”,我一下子就哭了。原来努力真的有用,你已经开始考虑想见我的妈妈了,你也是挺喜欢我的。","刚才我找你说话,你回了一个滚,我陷入了沉思,你还是如此的关心我,知道我腿受伤了,让我这样走,好感动!看来你还是爱我的!","今天下雨了,我去你公司接你下班。看见我你不耐烦的说“**烦不烦啊,不要再找我了**”,一头冲进雨里就跑开了。我心里真高兴啊,你宁愿自己淋雨,都不愿让我也淋湿一点,你果然还是爱我的。","晚上和你聊天,10点钟不到,你就说“**困了,去睡觉了**”。现在凌晨1点钟,看到你给他的朋友圈点赞评论,约他明天去吃火锅,一定是你微信被盗了吧。","今天我主动给你发了游戏邀请,邀请你和我单挑安琪拉,虽然我安琪拉很菜,可是为了和你打游戏,我还是毅然决然给你发了邀请。你说你不接受,你在打其他游戏。联想到我自己很菜,我突然明白,原来你还是在乎我的,只是不想一遍遍连招一套的在泉水送我走。我再一次感动哭了,因此,我好像更喜欢你了,你可真是一个宝藏男孩!","你的头像是一个女孩子左手边牵着一条秋田犬,犬=狗,而**我是一条舔狗**。是不是代表你的小手在牵着我呢?","今天发工资了,我一个月工资3000,你猜我会给你多少,是不是觉得我会给你2500,自己留500吃饭?你想多了,我3000都给你,因为厂里包吃包住。","昨天就为你充了710点卷,虽然知道你不会玩不知去向,但你说好看,你刚才说小号想要还想要一个,爱你的我还是满心欢喜的把剩下的100元伙食费又给你充了710,然后看到你小号并没有买,而是你送给了你的一个弟弟,你对弟弟真好,好有爱心,我感觉对你陷得很深了。","今天我给你发消息,你回复我“**nmsl**”,我想了半天才知道你是在夸我,原来是**你美死了**,你嘴真甜,我爱你。","你说你想买口红,今天我去了叔叔的口罩厂做了一天的打包。拿到了两百块钱,加上我这几天**省下的钱刚好能给你买一根小金条**。即没有给我自己剩下一分钱,但你不用担心,因为厂里包吃包住。对了打包的时候,满脑子都是你,想着你哪天突然就接受我的橄榄枝了呢。而且今天我很棒呢,主管表扬我很能干,其实也有你的功劳啦,是你给了我无穷的力量。今天我比昨天多想你一点,比明天少想你一点。","在我一如既往的每天跟她问早安的时候,她今天终于回我了。我激动地问她我是不是今天第一个跟她说话的人,她说不是,是**她男朋友把她叫起来退房**的。","听说你朋友说今天出门了,我打扮成精神小伙来找你,没想到你竟然对我说“**给我爬,别过来**”我当场就哭了,原来真心真的会感动人,你一定是知道,穿豆豆鞋走路脚会很累,让我爬是因为这样不会累着脚,其实你是喜欢我的吧","今天把你的备注改成了「**对方正在输入...**」,这样我就知道你不是不想回我,刚又给你发了消息,看到你在思考怎么回我,我就知道你和我一样,心里有我。","今天在楼上窗户上看见你和他在公园里接吻,我看见哭了出来,并打电话给你,想问问你为什么?但你说怎么了,声音是那么好听。于是我说“**以后你和他接吻的时候,能不能用我送给你的口红啊?**”","我退了无关紧要的群,唯独这个群我没有退,因为这里有一个对我来说很特别的女孩子,我们不是好友,**我每天只能通过群名片看看她**,虽然一张照片也看不到,我也知足了,我不敢说她的名字,但我知道她是群里面最美的女孩子,她说我们这样会距离产生美~ 我想想发现她说的挺对的,我心里很开心。","今天早上我告诉你我想你了,你没理我。今天中午我给你打电话,你不接,打第二个你就关机。晚上我在你公司楼下等你,你对我说的第一句话就是滚“**滚,别烦我,别浪费时间了**”,我真的好感动,你居然为我考虑了,怕我浪费时间。呜呜呜,这是我爱你的第74天。","我坐在窗边给你发了99条消息,你终于肯回我了你说“**发你妈啊**”,我一下子就哭了,原来努力真的有用,你已经开始考虑想见我的妈妈了,你其实也是挺喜欢我的。","你一个小时没回我的消息,在我孜孜不倦地骚扰下你终于舍得回我了“**在做爱**”,这其中一定有什么含义,我想了很久,“在做爱”这简简单单的三个字肯定是三句话,分别是**我在忙、做你女朋友、我爱你**,想到这里我不禁流下了眼泪,我这么长时间的喜欢没有白费,不知道你现在忙干嘛,但我很想你。","最近我暗恋的女生每天都和不同的男生约会,我想总有一天会轮到我,我问她什么时候能见见我?她说**下辈子吧**。她真好,下辈子还要和我在一起。","你好像从来没有对我说过晚安,我在我们的聊天记录里搜索了关键字:“晚安”,你说过一次:**我早晚安排人弄死你**。"],t=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),o=()=>{$(".joe_aside__item.flatterer .content").html(e[t(0,e.length-1)].replace(/\*\*(.*?)\*\*/g,"$1")),$(".joe_aside__item.flatterer .content").attr("class","content type"+t(1,6))};o(),$(".joe_aside__item.flatterer .change").on("click",()=>o())}"off"!==Joe.LIVE2D&&Joe.LIVE2D&&$.getScript("https://cdn.jsdelivr.net/npm/live2d-widget@3.1.4/lib/L2Dwidget.min.js",()=>{L2Dwidget.init({model:{jsonPath:Joe.LIVE2D,scale:1},mobile:{show:!1},display:{position:"right",width:160,height:200,hOffset:70,vOffset:0}})});{const e=()=>{let e=$(window).scrollTop(),t=$(document).height(),o=$(window).height(),a=parseInt(e/(t-o)*100);a<=0&&(a=0),a>=100&&(a=100),$(".joe_header__below-progress").css("width",a+"%")};e(),$(document).on("scroll",()=>{window.requestAnimationFrame?window.requestAnimationFrame(e):e()})}if($(".joe_comment").length&&$(".joe_comment__respond-type .item").on("click",function(){$(this).addClass("active").siblings().removeClass("active"),"draw"===$(this).attr("data-type")?($(".joe_comment__respond-form .body .draw").show().siblings().hide(),$("#joe_comment_draw").prop("width",$(".joe_comment__respond-form .body").width()),$(".joe_comment__respond-form").attr("data-type","draw")):($(".joe_comment__respond-form .body .text").show().siblings().hide(),$(".joe_comment__respond-form").attr("data-type","text"))}),$("#joe_comment_draw").length&&(window.sketchpad=new Sketchpad({element:"#joe_comment_draw",height:300,penSize:5,color:"303133"}),$(".joe_comment__respond-form .body .draw .icon-undo").on("click",()=>window.sketchpad.undo()),$(".joe_comment__respond-form .body .draw .icon-animate").on("click",()=>window.sketchpad.animate(10)),$(".joe_comment__respond-form .body .draw .line li").on("click",function(){window.sketchpad.penSize=$(this).attr("data-line"),$(this).addClass("active").siblings().removeClass("active")}),$(".joe_comment__respond-form .body .draw .color li").on("click",function(){window.sketchpad.color=$(this).attr("data-color"),$(this).addClass("active").siblings().removeClass("active")})),$(".joe_comment__respond").length){const e=$(".joe_comment__respond");$(".joe_comment__reply").on("click",function(){const t=$(this).attr("data-coid"),o=$("#"+$(this).attr("data-id"));e.find(".joe_comment__respond-form").attr("data-coid",t),o.append(e),$(".joe_comment__respond-type .item[data-type='text']").click(),$(".joe_comment__cancle").show(),window.scrollTo({top:o.offset().top-$(".joe_header").height()-15,behavior:"smooth"})}),$(".joe_comment__cancle").on("click",function(){e.find(".joe_comment__respond-form").removeAttr("data-coid"),$(".joe_comment__cancle").hide(),$(".joe_comment__title").after(e),$(".joe_comment__respond-type .item[data-type='text']").click(),window.scrollTo({top:$(".joe_comment").offset().top-$(".joe_header").height()-15,behavior:"smooth"})})}if($(".joe_comment").length){let e=!1;$(".joe_comment__respond-form").on("submit",function(t){t.preventDefault();const o=$(".joe_comment__respond-form").attr("action")+"?time="+ +new Date,a=$(".joe_comment__respond-form").attr("data-type"),n=$(".joe_comment__respond-form").attr("data-coid"),i=$(".joe_comment__respond-form .head input[name='author']").val(),s=$(".joe_comment__respond-form .head input[name='mail']").val();let r=$(".joe_comment__respond-form .body textarea[name='text']").val();if(""===i.trim())return Qmsg.info("请输入昵称!");if(!/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(s))return Qmsg.info("请输入正确的邮箱!");const c=$(".joe_comment__respond-form .head input[name='captcha']").val();if(""===c.trim())return Qmsg.info("请输入验证码!");if("text"===a&&""===r.trim())return Qmsg.info("请输入评论内容!");if("draw"===a){const e=$("#joe_comment_draw")[0].toDataURL("image/webp",.1);r="{!{"+e+"}!} "}e||(e=!0,$(".joe_comment__respond-form .foot .submit button").html("发送中..."),$.ajax({url:o,type:"POST",data:{author:i,mail:s,text:r,parent:n,captcha:c},dataType:"text",success(t){let o=[],a="";o=$(t).contents(),Array.from(o).forEach(e=>{"container"===e.parentNode.className&&(a=e)}),/Joe/.test(t)?window.location.reload():(Qmsg.warning(a.textContent.trim()||""),e=!1,$(".joe_comment__respond-form .foot .submit button").html("发表评论"))},error(){e=!1,$(".joe_comment__respond-form .foot .submit button").html("发表评论"),Qmsg.warning("发送失败!请刷新重试!")}}))})}if(Joe.DOCUMENT_TITLE){const e=document.title;document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState?document.title=Joe.DOCUMENT_TITLE:document.title=e})}$(".joe_header__above-slideicon").on("click",function(){$(".joe_header__searchout").removeClass("active"),$(".joe_header__slideout").hasClass("active")?($("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__slideout").removeClass("active")):($("body").css("overflow","hidden"),$(".joe_header__mask").addClass("active slideout"),$(".joe_header__slideout").addClass("active"))}),$(".joe_header__above-searchicon").on("click",function(){$(".joe_header__slideout").removeClass("active"),$(".joe_header__searchout").hasClass("active")?($("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__searchout").removeClass("active")):($("body").css("overflow","hidden"),$(".joe_header__mask").addClass("active"),$(".joe_header__searchout").addClass("active"))}),$(".joe_header__mask").on("click",function(){$("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__searchout").removeClass("active"),$(".joe_header__slideout").removeClass("active")}),$(".joe_header__slideout-menu .current").parents(".panel-body").show().siblings(".panel").addClass("in"),$(".joe_header__slideout-menu .panel").on("click",function(){const e=$(this).parent().parent();e.find(".panel").not($(this)).removeClass("in"),e.find(".panel-body").not($(this).siblings(".panel-body")).stop().hide("fast"),$(this).toggleClass("in").siblings(".panel-body").stop().toggle("fast")});{const e=()=>{const e=new Date(Joe.BIRTHDAY),t=+new Date,o=t-e.getTime();let a=o/864e5,n=Math.floor(a),i=24*(a-n),s=Math.floor(i),r=60*(i-s),c=Math.floor(r),d=60*(r-c),_=Math.floor(d);a=String(n).padStart(2,0),i=String(s).padStart(2,0),r=String(c).padStart(2,0),d=String(_).padStart(2,0),$(".joe_run__day").html(a),$(".joe_run__hour").html(i),$(".joe_run__minute").html(r),$(".joe_run__second").html(d)};Joe.BIRTHDAY&&/(\d{4})\/(\d{1,2})\/(\d{1,2}) (\d{1,2})\:(\d{1,2})\:(\d{1,2})/.test(Joe.BIRTHDAY)&&(e(),setInterval(e,1e3))}$(".joe_owo__contain").length&&$(".joe_owo__target").length&&$.ajax({url:window.Joe.THEME_URL+"assets/json/joe.owo.json",dataType:"json",success(e){let t="",o="";for(let a in e){const n=e[a];t+=`${a}
`,o+=`\n \n `}$(".joe_owo__contain").html(`\n OωO
\n \n `),$(document).on("click",function(){$(".joe_owo__contain .box").stop().slideUp("fast")}),$(".joe_owo__contain .seat").on("click",function(e){e.stopPropagation(),$(this).siblings(".box").stop().slideToggle("fast")}),$(".joe_owo__contain .box .bar .item").on("click",function(e){e.stopPropagation(),$(this).addClass("active").siblings().removeClass("active");const t='.joe_owo__contain .box .scroll[data-type="'+$(this).attr("data-type")+'"]';$(t).show().siblings(".scroll").hide()}),$(".joe_owo__contain .scroll .item").on("click",function(){const e=$(this).attr("data-text");$(".joe_owo__target").insertContent(e)}),$(".joe_owo__contain .box .bar .item").first().click()}});{let e=Joe.MOTTO;e||(e="有钱终成眷属,没钱亲眼目睹"),e.includes("http")?$.ajax({url:e,dataType:"text",success:e=>$(".joe_motto").html(e)}):$(".joe_motto").html(e)}});
\ No newline at end of file
+document.addEventListener("DOMContentLoaded",()=>{localStorage.getItem("data-night")?($(".joe_action_item.mode .icon-1").addClass("active"),$(".joe_action_item.mode .icon-2").removeClass("active")):($("html").removeAttr("data-night"),$(".joe_action_item.mode .icon-1").removeClass("active"),$(".joe_action_item.mode .icon-2").addClass("active")),$(".joe_action_item.mode").on("click",()=>{localStorage.getItem("data-night")?($(".joe_action_item.mode .icon-1").removeClass("active"),$(".joe_action_item.mode .icon-2").addClass("active"),$("html").removeAttr("data-night"),localStorage.removeItem("data-night")):($(".joe_action_item.mode .icon-1").addClass("active"),$(".joe_action_item.mode .icon-2").removeClass("active"),$("html").attr("data-night","night"),localStorage.setItem("data-night","night"))}),Joe.IS_MOBILE||"off"===Joe.DYNAMIC_BACKGROUND||!Joe.DYNAMIC_BACKGROUND||Joe.WALLPAPER_BACKGROUND_PC||$.getScript(window.Joe.THEME_URL+`assets/backdrop/${Joe.DYNAMIC_BACKGROUND}`);{$(".joe_header__above-search .input").on("click",e=>{e.stopPropagation(),$(".joe_header__above-search .result").addClass("active")}),$(document).on("click",function(){$(".joe_header__above-search .result").removeClass("active")});const e=()=>{$(".joe_header__above-search .result").hasClass("active")&&$(".joe_header__above-search .result").removeClass("active")};$(document).on("scroll",()=>{window.requestAnimationFrame?window.requestAnimationFrame(e):e()})}$(".joe_dropdown").each(function(e,t){const o=$(this).find(".joe_dropdown__menu"),a=$(t).attr("trigger")||"click",n=$(t).attr("placement")||$(this).height()||0;o.css("top",n),"hover"===a?$(this).hover(()=>$(this).addClass("active"),()=>$(this).removeClass("active")):($(this).on("click",function(e){$(this).toggleClass("active"),$(document).one("click",()=>$(this).removeClass("active")),e.stopPropagation()}),o.on("click",e=>e.stopPropagation()))});{const e=()=>(document.documentElement.scrollTop||document.body.scrollTop)>300?$(".joe_action_item.scroll").addClass("active"):$(".joe_action_item.scroll").removeClass("active");e(),$(document).on("scroll",()=>{window.requestAnimationFrame?window.requestAnimationFrame(e):e()}),$(".joe_action_item.scroll").on("click",()=>window.scrollTo({top:0,behavior:"smooth"}))}if($(".joe_aside__item.timelife").length){let e=[{title:"今日已经过去",endTitle:"小时",num:0,percent:"0%"},{title:"这周已经过去",endTitle:"天",num:0,percent:"0%"},{title:"本月已经过去",endTitle:"天",num:0,percent:"0%"},{title:"今年已经过去",endTitle:"个月",num:0,percent:"0%"}];{let t=+new Date,o=new Date((new Date).toLocaleDateString()).getTime(),a=(t-o)/1e3/60/60,n=a/24*100;e[0].num=parseInt(a),e[0].percent=parseInt(n)+"%"}{let t={0:7,1:1,2:2,3:3,4:4,5:5,6:6},o=t[(new Date).getDay()],a=o/7*100;e[1].num=parseInt(o),e[1].percent=parseInt(a)+"%"}{let t=(new Date).getFullYear(),o=(new Date).getDate(),a=(new Date).getMonth()+1,n=new Date(t,a,0).getDate(),i=o/n*100;e[2].num=o,e[2].percent=parseInt(i)+"%"}{let t=(new Date).getMonth()+1,o=t/12*100;e[3].num=t,e[3].percent=parseInt(o)+"%"}let t="";e.forEach((e,o)=>{t+=`\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t${e.title}\n\t\t\t\t\t\t\t\t${e.num}\n\t\t\t\t\t\t\t\t${e.endTitle}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
${e.percent}
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
`}),$(".joe_aside__item.timelife .joe_aside__item-contain").html(t)}if($(".joe_aside__item.weather").length){const e=$(".joe_aside__item.weather").attr("data-key"),t=$(".joe_aside__item.weather").attr("data-style"),o={1:"FFFFFF",2:"4A4A4A",3:"FFFFFF"};window.WIDGET={CONFIG:{layout:2,width:"220",height:"270",background:t,dataColor:o[t],language:"zh",key:e}},$.getScript("https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0")}if($(".joe_aside__item.tags").length){const e=[],t=["#F8D800","#0396FF","#EA5455","#7367F0","#32CCBC","#F6416C","#28C76F","#9F44D3","#F55555","#736EFE","#E96D71","#DE4313","#D939CD","#4C83FF","#F072B6","#C346C2","#5961F9","#FD6585","#465EFB","#FFC600","#FA742B","#5151E5","#BB4E75","#FF52E5","#49C628","#00EAFF","#F067B4","#F067B4","#ff9a9e","#00f2fe","#4facfe","#f093fb","#6fa3ef","#bc99c4","#46c47c","#f9bb3c","#e8583d","#f68e5f"],o=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e);$(".joe_aside__item-contain .list li").each((a,n)=>{e.push({label:$(n).attr("data-label"),url:$(n).attr("data-url"),target:"_blank",fontColor:t[o(0,t.length-1)],fontSize:15})}),$(".joe_aside__item-contain .tag").svg3DTagCloud({entries:e,width:220,height:220,radius:"65%",radiusMin:75,bgDraw:!1,fov:800,speed:.5,fontWeight:500})}if($(".joe_aside__item:last-child").css("top",$(".joe_header").height()+15),$(".joe_aside__item.flatterer").length){const e=["你昨天晚上又没回我信息,我却看见你的游戏在线,在我再一次孜孜不倦的骚扰你的情况下,你终于跟我说了一句最长的话“**你他妈是不是有病**”,我又陷入了沉思,这一定有什么含义,我想了很久,你竟然提到了我的妈妈,原来你已经想得那么长远了,想和我结婚见我的父母,我太感动了,真的。那你现在在干嘛,我好想你,我妈妈说她也很喜欢你。","今天我观战了一天你和别人打游戏,**你们玩的很开心**;我给你发了200多条消息,你说没流量就不回;晚上发说说没有人爱你,我连滚带爬评论了句有“我在”,你把我拉黑了,我给你打电话也无人接听。对不起,我不该打扰你,我求求你再给我一次当好友的机会吧!","我爸说再敢网恋就打断我的腿,幸好不是胳膊,这样我还能继续**和你打字聊天**,就算连胳膊也打断了,我的心里也会有你位置。","你说你情侣头像是一个人用的,空间上锁是因为你不喜欢玩空间,情侣空间是和闺蜜开的,找你连麦时你说你在忙工作,每次聊天你都说在忙,你真是一个**上进的好女孩**,你真好,我好喜欢你!","你跟他已经醒了吧?我今天捡垃圾挣了一百多,明天给你打过去。你快点休息吧,我明天叫你起床,给你点外卖买烟,给你点你最喜欢的奶茶。晚上我会继续去摆地摊的,你不用担心我,你床只有那么大睡不下三个。**你要好好照顾好自己,不要让他抢你被子**。我永远爱你!","她三天没回我的消息了,在我孜孜不倦地骚扰下她终于舍得回我“**nmsl**”,我想这一定是有什么含义吧,噢!我恍然大悟原来是**尼美舒利颗粒**,她知道我有关节炎让我吃尼美舒利颗粒,她还是关心我的,但是又不想显现的那么热情。天啊!她好高冷,我好像更喜欢她了!","你想我了吧?可以回我消息了吗?我买了万通筋骨贴,你**运动一个晚上腰很疼**吧?今晚早点回家,我炖了排骨汤,我永远在家等你。","昨晚你和朋友打了一晚上游戏,你破天荒的给我看了战绩,虽然我看不懂但是我相信你一定是最厉害的、最棒的。我给你发了好多消息夸你,告诉你我多崇拜你,你回了我一句“**啥B**”,我翻来覆去思考这是什么意思,Sha[傻],噢你是说我傻,那B就是Baby的意思了吧,原来你是在叫我**傻宝**,这么宠溺的语气,我竟一时不敢相信,其实你也是喜欢我的对吧。","今天我还是照常给你发消息,汇报日常工作,你终于回了我四个字:“**嗯嗯,好的。**”。你开始愿意敷衍我了,我太感动了,受宠若惊。我愿意天天给你发消息,就算你天天骂我,我也不觉得烦。","你昨天晚上又没回我的消息,在我孜孜不倦的骚扰下,你终于舍得回我了,你说“**滚**”,这其中一定有什么含义,我想了很久,滚是三点水,这代表你对我的思念也如**滚滚流水**一样汹涌,我感动哭了,不知道你现在在干嘛,我很想你。","听说你想要一套化妆品,我算了算,明天我去工地上**搬一天砖**,就可以拿到200块钱,再加上我上个月攒下来的零花钱,刚好给你买一套迪奥。","今天表白被拒绝了,她对我说能不能脱下裤子**撒泡尿照照自己**。当我脱下裤子,她咽了口水,说我们可以试一下。","刚从派出所出来,原因前几天14号情人节,我想送你礼物,我去偷东西的时候被抓了。我本来想反抗,警察说了一句老实点别动,我立刻就放弃了反抗,因为我记得你说过,你喜欢**老实人**。","疫情不能出门,现在是早上八点,你肯定饿了吧。我早起做好了早餐来到你小区,保安大哥不让进。我给你打了三个电话你终于接了“**有病啊,我还睡觉呢,你小区门口等着吧**”。啊,我高兴坏了!你终于愿意吃我做的早餐了,还让我等你,啊!啊!啊!好幸福噢!","我存了两个月钱,给你买了一双**北卡蓝**,你对我说一句“谢谢”,我好开心。这是你第一次对我说两个字,以前你都只对我说滚。今天晚上逛**闲鱼**,看到了你把我送你的北卡蓝发布上去了。我想你一定是在考验我,再次送给你,给你一个惊喜,我爱你。","昨天**你领完红包就把我删了**,我陷入久久地沉思。我想这其中一定有什么含义,原来你是在欲擒故纵,嫌我不够爱你。无理取闹的你变得更加可爱了,我会坚守我对你的爱的。你放心好啦!今天发工资了,发了1850,给你微信转了520,支付宝1314,还剩下16。给你发了很多消息你没回。剩下16块我在小卖部买了你爱吃的老坛酸菜牛肉面,给你寄过去了。希望你保护好食欲,我去上班了爱你~~","在保安亭内看完了最新一集的梨泰院,曾经多么倔强的朴世路因为伊瑞给张大熙跪下了,亭外的树也许感受到了**我的悲伤**,枯了。我连树都保护不了,怎么保护你,或许保安才是真的需要被保护的吧。我难受,我想你。over","难以言喻的下午。说不想你是假的,说爱你是真的。昨天他们骂**我是你的舔狗**,我不相信,因为我知道你肯定也是爱我的,你一定是在考验我对你的感情,只要我坚持下去你一定会被我的真诚所打动,加油!不过我要批评你一下,昨晚你说**去酒店跟人斗地主**,我寻思两个人也玩不了呀。算了,不想了,毕竟打牌是赌博行为,不太好。","明天就周六了我知道你不上班,但是我怕你睡懒觉不吃早饭饿坏自己。我早晨4点去菜市场买了新鲜活鸡**给你炖鸡汤**,阿姨给我用箱子装了起来,我骑上我280买的电动车哼着小调回家,心想你一定会被我感动的,箱子半路开了,鸡跑了,拐到了一个胡同里,凌晨4点的胡同还有穿超短裙和大叔聊天的美女,不禁感叹这个世界变了,她问我找什么,…………。对不起,我爱你","12点队长过来准时交班,出去的车辆按喇叭我也没听到,只因我在监控中看到了穿睡衣出来倒垃圾的你,**望你望的入神**不由的傻笑了起来,队长过来骂我扣了我一天工资。我委屈,想抱你。你送的泡面真好吃。","今天的我排位输了好多把,我将这些事情分享给你,但是你一个字都没有讲,我在想你是不是在忙?我头痛欲裂,终于在我给你发了几十条消息之后,你回了我一个“**脑子是不是有病?**”,原来你还是关心我的,看到这句话,我的脑子一下就不疼了,今天也是爱你的一天。","我存了半年的工资,给你买了一只LV,你对我说了一句“**你真好**”,我好开心,这是你第一次这么认可我,以前你都只对我说滚。今天晚上逛闲鱼,看到你把我送你的LV发布上去了。我想,你一定是在考验我,于是我用借呗里的钱把它买了下来,再次送给你,给你一个惊喜,我爱你。","其实我每月工资6000,但我只给你转2000,你以为我给你了全部。才不是,我一共舔了3个啦,**我要舔的雨露均沾**,才不会把你当成唯一。","昨天你把我拉黑了,我看着红色感叹号陷入了久久的沉思,我想这其中一定有什么含义?红色红色?我明白了!红色代表热情,你对我很热情,你想和我结婚,我愿意。","今天你问我借了两千块钱,说要做个手术,你果然还是爱我的,**不是我的孩子,你不要**。 ","中午你无故扇了我一巴掌,我握着你的手说“手怎么这么凉,都怪我没有照顾好你,一定要更加对你好”。","我给你打了几通电话,你终于接了。听到了**你发出啊啊啊啊的声音**,你说你肚子痛,我想你一定是很难受吧。电话还有个男的对你说“来换个姿势”,一定是**在做理疗**了。期待你早日康复,我好担心。","昨天晚上好冷,本来以为街上没人,结果刚刚**偷电动车**的时候被抓了,本来想反抗,但警察说了一句老实点别动,我立刻就放弃了抵抗,因为我记得你说过,你喜欢**老实人**。","找你连麦时你说你在忙工作,每次聊天你都说在忙,你真是一个**上进的好女孩**,你真好,发现我越来越喜欢这样优秀的你。","你从来没说过爱我,聊天记录搜索了一下“爱”,唯一的一条是:**你好像乡村爱情里的刘能啊**。","今天好开心啊,和你一起在峡谷嬉戏,打完一波团战之后看到你在打大龙,残血的我跳过去直接被龙爪拍死,但这一刻我觉得好浪漫,**死在你的脚旁边,这是我离你最近的一次**。","哥们,求你和她说句话吧,这样她就不会那么难过了。","今天你把我的微信拉黑了,这下我终于解放了!以前我总担心太多消息会打扰你,现在我终于不用顾忌,不管我怎么给你发消息,都不会让你不开心了。等我**攒够5201314条**我就拿给你看,你一定会震惊得说不出话然后哭着说会爱我一辈子。哈哈。","昨天你把我删了,我陷入了久久的沉思 。我想这其中一定有什么含义,你应该是欲擒故纵吧,嫌我不够爱你。突然觉得**无理取闹的你变得更加可爱**了,我会坚守我对你的爱的 你放心好啦!这么一想,突然对我俩的未来更有期望了呢。","今天上班不是太忙,百无聊赖,又翻出了你的相片,看了又看。今天是我认识你的第302天,也是我爱你的第302天,可是这些你并不知道,也许**你知道了,也不会在意**吧。 此刻的我好想你! ","今天你跟我说我很丑,让我不要骚扰你了。我听了很高兴,小说里的主角都像你这样,最开始表现的很厌恶,但最后**总会被我的真心打动**。你现在有多讨厌我,以后就会有多爱我。嘻嘻。","我坐在窗边给你发了99条消息,你终于肯回我了,你说“**发你妈啊**”,我一下子就哭了。原来努力真的有用,你已经开始考虑想见我的妈妈了,你也是挺喜欢我的。","刚才我找你说话,你回了一个滚,我陷入了沉思,你还是如此的关心我,知道我腿受伤了,让我这样走,好感动!看来你还是爱我的!","今天下雨了,我去你公司接你下班。看见我你不耐烦的说“**烦不烦啊,不要再找我了**”,一头冲进雨里就跑开了。我心里真高兴啊,你宁愿自己淋雨,都不愿让我也淋湿一点,你果然还是爱我的。","晚上和你聊天,10点钟不到,你就说“**困了,去睡觉了**”。现在凌晨1点钟,看到你给他的朋友圈点赞评论,约他明天去吃火锅,一定是你微信被盗了吧。","今天我主动给你发了游戏邀请,邀请你和我单挑安琪拉,虽然我安琪拉很菜,可是为了和你打游戏,我还是毅然决然给你发了邀请。你说你不接受,你在打其他游戏。联想到我自己很菜,我突然明白,原来你还是在乎我的,只是不想一遍遍连招一套的在泉水送我走。我再一次感动哭了,因此,我好像更喜欢你了,你可真是一个宝藏男孩!","你的头像是一个女孩子左手边牵着一条秋田犬,犬=狗,而**我是一条舔狗**。是不是代表你的小手在牵着我呢?","今天发工资了,我一个月工资3000,你猜我会给你多少,是不是觉得我会给你2500,自己留500吃饭?你想多了,我3000都给你,因为厂里包吃包住。","昨天就为你充了710点卷,虽然知道你不会玩不知去向,但你说好看,你刚才说小号想要还想要一个,爱你的我还是满心欢喜的把剩下的100元伙食费又给你充了710,然后看到你小号并没有买,而是你送给了你的一个弟弟,你对弟弟真好,好有爱心,我感觉对你陷得很深了。","今天我给你发消息,你回复我“**nmsl**”,我想了半天才知道你是在夸我,原来是**你美死了**,你嘴真甜,我爱你。","你说你想买口红,今天我去了叔叔的口罩厂做了一天的打包。拿到了两百块钱,加上我这几天**省下的钱刚好能给你买一根小金条**。即没有给我自己剩下一分钱,但你不用担心,因为厂里包吃包住。对了打包的时候,满脑子都是你,想着你哪天突然就接受我的橄榄枝了呢。而且今天我很棒呢,主管表扬我很能干,其实也有你的功劳啦,是你给了我无穷的力量。今天我比昨天多想你一点,比明天少想你一点。","在我一如既往的每天跟她问早安的时候,她今天终于回我了。我激动地问她我是不是今天第一个跟她说话的人,她说不是,是**她男朋友把她叫起来退房**的。","听说你朋友说今天出门了,我打扮成精神小伙来找你,没想到你竟然对我说“**给我爬,别过来**”我当场就哭了,原来真心真的会感动人,你一定是知道,穿豆豆鞋走路脚会很累,让我爬是因为这样不会累着脚,其实你是喜欢我的吧","今天把你的备注改成了「**对方正在输入...**」,这样我就知道你不是不想回我,刚又给你发了消息,看到你在思考怎么回我,我就知道你和我一样,心里有我。","今天在楼上窗户上看见你和他在公园里接吻,我看见哭了出来,并打电话给你,想问问你为什么?但你说怎么了,声音是那么好听。于是我说“**以后你和他接吻的时候,能不能用我送给你的口红啊?**”","我退了无关紧要的群,唯独这个群我没有退,因为这里有一个对我来说很特别的女孩子,我们不是好友,**我每天只能通过群名片看看她**,虽然一张照片也看不到,我也知足了,我不敢说她的名字,但我知道她是群里面最美的女孩子,她说我们这样会距离产生美~ 我想想发现她说的挺对的,我心里很开心。","今天早上我告诉你我想你了,你没理我。今天中午我给你打电话,你不接,打第二个你就关机。晚上我在你公司楼下等你,你对我说的第一句话就是滚“**滚,别烦我,别浪费时间了**”,我真的好感动,你居然为我考虑了,怕我浪费时间。呜呜呜,这是我爱你的第74天。","我坐在窗边给你发了99条消息,你终于肯回我了你说“**发你妈啊**”,我一下子就哭了,原来努力真的有用,你已经开始考虑想见我的妈妈了,你其实也是挺喜欢我的。","你一个小时没回我的消息,在我孜孜不倦地骚扰下你终于舍得回我了“**在做爱**”,这其中一定有什么含义,我想了很久,“在做爱”这简简单单的三个字肯定是三句话,分别是**我在忙、做你女朋友、我爱你**,想到这里我不禁流下了眼泪,我这么长时间的喜欢没有白费,不知道你现在忙干嘛,但我很想你。","最近我暗恋的女生每天都和不同的男生约会,我想总有一天会轮到我,我问她什么时候能见见我?她说**下辈子吧**。她真好,下辈子还要和我在一起。","你好像从来没有对我说过晚安,我在我们的聊天记录里搜索了关键字:“晚安”,你说过一次:**我早晚安排人弄死你**。"],t=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),o=()=>{$(".joe_aside__item.flatterer .content").html(e[t(0,e.length-1)].replace(/\*\*(.*?)\*\*/g,"$1")),$(".joe_aside__item.flatterer .content").attr("class","content type"+t(1,6))};o(),$(".joe_aside__item.flatterer .change").on("click",()=>o())}"off"!==Joe.LIVE2D&&Joe.LIVE2D&&$.getScript("https://cdn.jsdelivr.net/npm/live2d-widget@3.1.4/lib/L2Dwidget.min.js",()=>{L2Dwidget.init({model:{jsonPath:Joe.LIVE2D,scale:1},mobile:{show:!1},display:{position:"right",width:160,height:200,hOffset:70,vOffset:0}})});{const e=()=>{let e=$(window).scrollTop(),t=$(document).height(),o=$(window).height(),a=parseInt(e/(t-o)*100);a<=0&&(a=0),a>=100&&(a=100),$(".joe_header__below-progress").css("width",a+"%")};e(),$(document).on("scroll",()=>{window.requestAnimationFrame?window.requestAnimationFrame(e):e()})}if($(".joe_comment").length&&$(".joe_comment__respond-type .item").on("click",function(){$(this).addClass("active").siblings().removeClass("active"),"draw"===$(this).attr("data-type")?($(".joe_comment__respond-form .body .draw").show().siblings().hide(),$("#joe_comment_draw").prop("width",$(".joe_comment__respond-form .body").width()),$(".joe_comment__respond-form").attr("data-type","draw")):($(".joe_comment__respond-form .body .text").show().siblings().hide(),$(".joe_comment__respond-form").attr("data-type","text"))}),$("#joe_comment_draw").length&&(window.sketchpad=new Sketchpad({element:"#joe_comment_draw",height:300,penSize:5,color:"303133"}),$(".joe_comment__respond-form .body .draw .icon-undo").on("click",()=>window.sketchpad.undo()),$(".joe_comment__respond-form .body .draw .icon-animate").on("click",()=>window.sketchpad.animate(10)),$(".joe_comment__respond-form .body .draw .line li").on("click",function(){window.sketchpad.penSize=$(this).attr("data-line"),$(this).addClass("active").siblings().removeClass("active")}),$(".joe_comment__respond-form .body .draw .color li").on("click",function(){window.sketchpad.color=$(this).attr("data-color"),$(this).addClass("active").siblings().removeClass("active")})),$(".joe_comment__respond").length){const e=$(".joe_comment__respond");$(".joe_comment__reply").on("click",function(){const t=$(this).attr("data-coid"),o=$("#"+$(this).attr("data-id"));e.find(".joe_comment__respond-form").attr("data-coid",t),o.append(e),$(".joe_comment__respond-type .item[data-type='text']").click(),$(".joe_comment__cancle").show(),window.scrollTo({top:o.offset().top-$(".joe_header").height()-15,behavior:"smooth"})}),$(".joe_comment__cancle").on("click",function(){e.find(".joe_comment__respond-form").removeAttr("data-coid"),$(".joe_comment__cancle").hide(),$(".joe_comment__title").after(e),$(".joe_comment__respond-type .item[data-type='text']").click(),window.scrollTo({top:$(".joe_comment").offset().top-$(".joe_header").height()-15,behavior:"smooth"})})}if($(".joe_comment").length){let e=!1;$(".joe_comment__respond-form").on("submit",function(t){t.preventDefault();const o=$(".joe_comment__respond-form").attr("action")+"?time="+ +new Date,a=$(".joe_comment__respond-form").attr("data-type"),n=$(".joe_comment__respond-form").attr("data-coid"),i=$(".joe_comment__respond-form .head input[name='author']").val(),s=$(".joe_comment__respond-form input[name='_']").val(),r=$(".joe_comment__respond-form .head input[name='mail']").val();let c=$(".joe_comment__respond-form .body textarea[name='text']").val();if(""===i.trim())return Qmsg.info("请输入昵称!");if(!/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(r))return Qmsg.info("请输入正确的邮箱!");const d=$(".joe_comment__respond-form .head input[name='captcha']").val();if(""===d.trim())return Qmsg.info("请输入验证码!");if("text"===a&&""===c.trim())return Qmsg.info("请输入评论内容!");if("draw"===a){const e=$("#joe_comment_draw")[0].toDataURL("image/webp",.1);c="{!{"+e+"}!} "}e||(e=!0,$(".joe_comment__respond-form .foot .submit button").html("发送中..."),$.ajax({url:o,type:"POST",data:{author:i,mail:r,text:c,parent:n,captcha:d,_:s},dataType:"text",success(t){let o=[],a="";o=$(t).contents(),Array.from(o).forEach(e=>{"container"===e.parentNode.className&&(a=e)}),/Joe/.test(t)?window.location.reload():(Qmsg.warning(a.textContent.trim()||""),e=!1,$(".joe_comment__respond-form .foot .submit button").html("发表评论"))},error(){e=!1,$(".joe_comment__respond-form .foot .submit button").html("发表评论"),Qmsg.warning("发送失败!请刷新重试!")}}))})}if(Joe.DOCUMENT_TITLE){const e=document.title;document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState?document.title=Joe.DOCUMENT_TITLE:document.title=e})}$(".joe_header__above-slideicon").on("click",function(){$(".joe_header__searchout").removeClass("active"),$(".joe_header__slideout").hasClass("active")?($("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__slideout").removeClass("active")):($("body").css("overflow","hidden"),$(".joe_header__mask").addClass("active slideout"),$(".joe_header__slideout").addClass("active"))}),$(".joe_header__above-searchicon").on("click",function(){$(".joe_header__slideout").removeClass("active"),$(".joe_header__searchout").hasClass("active")?($("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__searchout").removeClass("active")):($("body").css("overflow","hidden"),$(".joe_header__mask").addClass("active"),$(".joe_header__searchout").addClass("active"))}),$(".joe_header__mask").on("click",function(){$("body").css("overflow",""),$(".joe_header__mask").removeClass("active slideout"),$(".joe_header__searchout").removeClass("active"),$(".joe_header__slideout").removeClass("active")}),$(".joe_header__slideout-menu .current").parents(".panel-body").show().siblings(".panel").addClass("in"),$(".joe_header__slideout-menu .panel").on("click",function(){const e=$(this).parent().parent();e.find(".panel").not($(this)).removeClass("in"),e.find(".panel-body").not($(this).siblings(".panel-body")).stop().hide("fast"),$(this).toggleClass("in").siblings(".panel-body").stop().toggle("fast")});{const e=()=>{const e=new Date(Joe.BIRTHDAY),t=+new Date,o=t-e.getTime();let a=o/864e5,n=Math.floor(a),i=24*(a-n),s=Math.floor(i),r=60*(i-s),c=Math.floor(r),d=60*(r-c),_=Math.floor(d);a=String(n).padStart(2,0),i=String(s).padStart(2,0),r=String(c).padStart(2,0),d=String(_).padStart(2,0),$(".joe_run__day").html(a),$(".joe_run__hour").html(i),$(".joe_run__minute").html(r),$(".joe_run__second").html(d)};Joe.BIRTHDAY&&/(\d{4})\/(\d{1,2})\/(\d{1,2}) (\d{1,2})\:(\d{1,2})\:(\d{1,2})/.test(Joe.BIRTHDAY)&&(e(),setInterval(e,1e3))}$(".joe_owo__contain").length&&$(".joe_owo__target").length&&$.ajax({url:window.Joe.THEME_URL+"assets/json/joe.owo.json",dataType:"json",success(e){let t="",o="";for(let a in e){const n=e[a];t+=`${a}
`,o+=`\n \n `}$(".joe_owo__contain").html(`\n OωO
\n \n `),$(document).on("click",function(){$(".joe_owo__contain .box").stop().slideUp("fast")}),$(".joe_owo__contain .seat").on("click",function(e){e.stopPropagation(),$(this).siblings(".box").stop().slideToggle("fast")}),$(".joe_owo__contain .box .bar .item").on("click",function(e){e.stopPropagation(),$(this).addClass("active").siblings().removeClass("active");const t='.joe_owo__contain .box .scroll[data-type="'+$(this).attr("data-type")+'"]';$(t).show().siblings(".scroll").hide()}),$(".joe_owo__contain .scroll .item").on("click",function(){const e=$(this).attr("data-text");$(".joe_owo__target").insertContent(e)}),$(".joe_owo__contain .box .bar .item").first().click()}});{let e=Joe.MOTTO;e||(e="有钱终成眷属,没钱亲眼目睹"),e.includes("http")?$.ajax({url:e,dataType:"text",success:e=>$(".joe_motto").html(e)}):$(".joe_motto").html(e)}});
\ No newline at end of file
diff --git a/census.php b/census.php
index ff9d154..c244d57 100644
--- a/census.php
+++ b/census.php
@@ -25,6 +25,7 @@
to($item); ?>
+
+ options->JBTPanel && $this->options->JBTKey) : ?>
+
+
+
+
+
实时流量
+
+ 总发送:0 B
+ /
+ 总接收:0 B
+
+
+
+
+
+
need('public/footer.php'); ?>
diff --git a/core/core.php b/core/core.php
index 8b192d9..14e2bf7 100644
--- a/core/core.php
+++ b/core/core.php
@@ -21,8 +21,6 @@ _startCountTime();
/* 主题初始化 */
function themeInit($self)
{
- /* 强制用户关闭反垃圾保护 */
- Helper::options()->commentsAntiSpam = false;
/* 强制用户要求填写邮箱 */
Helper::options()->commentsRequireMail = true;
/* 强制用户要求无需填写url */
@@ -63,6 +61,9 @@ function themeInit($self)
case 'huya_list':
_getHuyaList($self);
break;
+ case 'server_status':
+ _getServerStatus($self);
+ break;
};
}
diff --git a/core/function.php b/core/function.php
index c114447..0cb7d09 100644
--- a/core/function.php
+++ b/core/function.php
@@ -2,7 +2,7 @@
/* 获取主题当前版本号 */
function _getVersion()
{
- return "6.9.8";
+ return "6.9.9";
};
/* 判断是否是手机 */
@@ -157,7 +157,7 @@ function _endCountTime($precision = 3)
/* 通过邮箱生成头像地址 */
function _getAvatarByMail($mail)
{
- $gravatarsUrl = Helper::options()->JCustomAvatarSource ? Helper::options()->JCustomAvatarSource : 'https://gravatar.helingqi.com/wavatar/';
+ $gravatarsUrl = Helper::options()->JCustomAvatarSource ? Helper::options()->JCustomAvatarSource : 'https://gravatar.ihuan.me/avatar/';
$mailLower = strtolower($mail);
$md5MailLower = md5($mailLower);
$qqMail = str_replace('@qq.com', '', $mailLower);
diff --git a/core/route.php b/core/route.php
index e91fe9b..90f1a70 100644
--- a/core/route.php
+++ b/core/route.php
@@ -3,7 +3,7 @@
/* 获取文章列表 已测试 √ */
function _getPost($self)
{
- header("HTTP/1.1 200 OK");
+ header("HTTP/1.1 200 OK");
header('Access-Control-Allow-Origin:*');
header("Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type, Accept");
@@ -293,3 +293,49 @@ function _getHuyaList($self)
]);
}
}
+
+function _getServerStatus($self)
+{
+ header("HTTP/1.1 200 OK");
+ header('Access-Control-Allow-Origin:*');
+ header("Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type, Accept");
+ $api_panel = Helper::options()->JBTPanel;
+ $api_sk = Helper::options()->JBTKey;
+ if (!$api_panel) return $self->response->throwJson([
+ "code" => 0,
+ "data" => "宝塔面板地址未填写!"
+ ]);
+ if (!$api_sk) return $self->response->throwJson([
+ "code" => 0,
+ "data" => "宝塔接口密钥未填写!"
+ ]);
+ $request_time = time();
+ $request_token = md5($request_time . '' . md5($api_sk));
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $api_panel . '/system?action=GetNetWork');
+ curl_setopt($ch, CURLOPT_TIMEOUT, 5);
+ curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, array("request_time" => $request_time, "request_token" => $request_token));
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_HEADER, 0);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ $response = json_decode(curl_exec($ch), true);
+ curl_close($ch);
+ $self->response->throwJson(array(
+ /* 上行流量KB */
+ "up" => $response["up"],
+ /* 下行流量KB */
+ "down" => $response["down"],
+ /* 总发送(字节数) */
+ "upTotal" => $response["upTotal"],
+ /* 总接收(字节数) */
+ "downTotal" => $response["downTotal"],
+ /* 内存占用 */
+ "memory" => $response["mem"],
+ /* CPU */
+ "cpu" => $response["cpu"],
+ /* 系统负载 */
+ "load" => $response["load"],
+ ));
+}
diff --git a/functions.php b/functions.php
index fc5508f..f649e13 100644
--- a/functions.php
+++ b/functions.php
@@ -351,8 +351,8 @@ function themeConfig($form)
NULL,
'自定义头像源(非必填)',
'介绍:用于修改全站头像源地址
- 例如:https://gravatar.ihuan.me/avatar/
- 其他:非必填,默认头像源为禾令奇
+ 例如:https://gravatar.helingqi.com/wavatar/
+ 其他:非必填,默认头像源为gravatar.ihuan.me
注意:填写时,务必保证最后有一个/字符,否则不起作用!'
);
$JCustomAvatarSource->setAttribute('class', 'joe_content joe_global');
@@ -836,6 +836,30 @@ function themeConfig($form)
$JSiteMap->setAttribute('class', 'joe_content joe_other');
$form->addInput($JSiteMap->multiMode());
+ $JBTPanel = new Typecho_Widget_Helper_Form_Element_Text(
+ 'JBTPanel',
+ NULL,
+ NULL,
+ '宝塔面板地址',
+ '介绍:用于统计页面获取服务器状态使用
+ 例如:http://192.168.1.245:8888/
+ 注意:结尾需要带有一个 / 字符!
+ 该功能需要去宝塔面板开启开放API,并添加白名单才可使用'
+ );
+ $JBTPanel->setAttribute('class', 'joe_content joe_other');
+ $form->addInput($JBTPanel->multiMode());
+
+ $JBTKey = new Typecho_Widget_Helper_Form_Element_Text(
+ 'JBTKey',
+ NULL,
+ NULL,
+ '宝塔开放接口密钥',
+ '介绍:用于统计页面获取服务器状态使用
+ 例如:thVLXFtUCCNzBShBweKTPBmw8296q8R8
+ 该功能需要去宝塔面板开启开放API,并添加白名单才可使用'
+ );
+ $JBTKey->setAttribute('class', 'joe_content joe_other');
+ $form->addInput($JBTKey->multiMode());
/* 评论发信 */
$JCommentMail = new Typecho_Widget_Helper_Form_Element_Select(
@@ -849,7 +873,7 @@ function themeConfig($form)
);
$JCommentMail->setAttribute('class', 'joe_content joe_other');
$form->addInput($JCommentMail->multiMode());
-
+
$JCommentMailHost = new Typecho_Widget_Helper_Form_Element_Text(
'JCommentMailHost',
NULL,
diff --git a/package.json b/package.json
index 430cd23..49c026c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "typecho-joe-next",
- "version": "6.9.8",
+ "version": "6.9.9",
"description": "A Theme Of Typecho",
"main": "index.php",
"keywords": [
diff --git a/public/comment.php b/public/comment.php
index a9d8701..407c32c 100644
--- a/public/comment.php
+++ b/public/comment.php
@@ -12,7 +12,7 @@
allow('comment')) : ?>
-
h&&S(a,t-h,-1),S(a,e-t,n),P(l,a,r),h=e)}}(t),c(!i),i}static empty(t){return new k(t?[t,-1]:[],[])}static fromJSON(i){if(!Array.isArray(i))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let e=0;ee&&"string"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==t.length)n.push(t[0],0);else{for(;r.length>1;if(n>1])),!(c||a==l.sections.length||l.sections[a+1]<0);)n=l.sections[a++],r=l.sections[a++];h(s,t,o,e,i),s=t,o=e}}}function W(t,e,r,i=!1){var s=[],o=i?[]:null;let a=new X(t),l=new X(e);for(let i=0,n=0;;)if(-1==a.ins)i+=a.len,a.next();else if(-1==l.ins&&nn&&!a.done&&i+a.leni&&n+l.lenl||0<=o.ins&&o.len>l)&&(t||h>1;return e>=t.length?d.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?d.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class R{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){var t=3&this.flags;return 3==t?null:t}get goalColumn(){var t=this.flags>>5;return 33554431==t?void 0:t}map(t,e=-1){var i=t.mapPos(this.from,e),e=t.mapPos(this.to,e);return i==this.from&&e==this.to?this:new R(i,e,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return _.range(t,e);e=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return _.range(this.anchor,e)}eq(t){return this.anchor==t.anchor&&this.head==t.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return _.range(t.anchor,t.head)}}class _{constructor(t,e=0){this.ranges=t,this.mainIndex=e}map(e,i=-1){return e.empty?this:_.create(this.ranges.map(t=>t.map(e,i)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;tt.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new _(t.ranges.map(t=>R.fromJSON(t)),t.main)}static single(t,e=t){return new _([_.range(t,e)],0)}static create(i,n=0){if(0==i.length)throw new RangeError("A selection needs at least one range");for(let t=0,e=0;et.from-e.from),i=e.indexOf(t);for(let t=1;tr.head?_.range(s,n):_.range(n,s)))}return new _(e,i)}(i.slice(),n);t=r.to}return new _(i,n)}static cursor(t,e=0,i,n){return new R(t,t,(0==e?0:e<0?4:8)|(null==i?3:Math.min(2,i))|(null!=n?n:33554431)<<5)}static range(t,e,i){i=(null!=i?i:33554431)<<5;return ee)throw new RangeError("Selection points outside of document")}let A=0;class L{constructor(t,e,i,n,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.extensions=r,this.id=A++,this.default=t([])}static define(t={}){return new L(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:z),!!t.static,t.enables)}of(t){return new q([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,2,e)}from(e,i){return i=i||(t=>t),this.compute([e],t=>i(t.field(e)))}}function z(t,i){return t==i||t.length==i.length&&t.every((t,e)=>t===i[e])}class q{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=A++}dynamicSlot(t){var e,i;let n=this.value,r=this.facet.compareInput,s=t[this.id]>>1,o=2==this.type,a=!1,l=!1,h=[];for(i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:0==(1&(null!==(e=t[i.id])&&void 0!==e?e:1))&&h.push(t[i.id]);return(e,t)=>{if(!t||t.reconfigured)return e.values[s]=n(e),1;if(!(a&&t.docChanged||l&&(t.docChanged||t.selection)||h.some(t=>0<(1&G(e,t)))))return 0;var i=n(e),t=t.startState.values[s];return(o?function(e,i,n){if(e.length!=i.length)return!1;for(let t=0;t>1}const Y=L.define({static:!0});class M{constructor(t,e,i,n,r){this.id=t,this.createF=e,this.updateF=i,this.compareF=n,this.spec=r,this.provides=void 0}static define(t){let e=new M(A++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(Y).find(t=>t.field==this);return((null===e||void 0===e?void 0:e.create)||this.createF)(t)}slot(t){let r=t[this.id]>>1;return(t,e)=>{if(!e||e.reconfigured&&null==V(e.startState,this.id))return t.values[r]=this.create(t),1;let i,n=0;e.reconfigured?(i=e.startState.values[V(e.startState,this.id)],n=1):i=e.startState.values[r];e=this.updateF(i,e);return n||this.compareF(i,e)||(n=1),n&&(t.values[r]=e),n}}init(t){return[this,Y.of({field:this,create:t})]}get extension(){return this}}const Z={fallback:3,default:2,extend:1,override:0};function t(e){return t=>new D(t,e)}const E={fallback:t(Z.fallback),default:t(Z.default),extend:t(Z.extend),override:t(Z.override)};class D{constructor(t,e){this.inner=t,this.prec=e}}class j{of(t){return new H(this,t)}reconfigure(t){return j.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class H{constructor(t,e){this.compartment=t,this.inner=e}}class I{constructor(t,e,i,n,r){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,n){let i=[],r=Object.create(null);var s,o,a=new Map;for(s of function(t,a,l){let h=[[],[],[],[]],c=new Map;return function t(e,i){var n=c.get(e);if(null!=n){if(i<=n)return;var r=h[n].indexOf(e);-1t.concat(e))}(t,e,a))(s instanceof M?i:r[s.facet.id]||(r[s.facet.id]=[])).push(s);let l=Object.create(null),h=[],c=[];for(let e of i)l[e.id]=c.length<<1,c.push(t=>e.slot(t));for(o in r){let i=r[o],e=i[0].facet;if(i.every(t=>0==t.type)){l[e.id]=h.length<<1|1;let t=e.combine(i.map(t=>t.value));var O=n?n.config.address[e.id]:null;null!=O&&(O=B(n,O),e.compare(t,O)&&(t=O)),h.push(t)}else{for(let e of i)0==e.type?(l[e.id]=h.length<<1|1,h.push(e.value)):(l[e.id]=c.length<<1,c.push(t=>e.dynamicSlot(t)));l[e.id]=c.length<<1,c.push(t=>function(e,h,t){let c=t.map(t=>e[t.id]),O=t.map(t=>t.type),d=c.filter(t=>!(1&t)),u=e[h.id]>>1;return(e,t)=>{var i,n=t?t.reconfigured?t.startState.config.address[h.id]:u<<1:null;let r=null==n;for(i of d)1&G(e,i)&&(r=!0);if(!r)return 0;let s=[];for(let t=0;tt(l)),l,h)}}function G(t,e){if(1&e)return 2;var i=e>>1,e=t.status[i];if(4==e)throw new Error("Cyclic dependency between fields and/or facets");if(2&e)return e;t.status[i]=4;e=t.config.dynamicSlots[i](t,t.applying);return t.status[i]=2|e}function B(t,e){return(1&e?t.config.staticValues:t.values)[e>>1]}const N=L.define(),U=L.define({combine:t=>t.some(t=>t),static:!0}),F=L.define({combine:t=>t.length?t[0]:void 0,static:!0}),J=L.define(),K=L.define(),tt=L.define();class et{constructor(t,e){this.type=t,this.value=e}static define(){return new it}}class it{of(t){return new et(this,t)}}class nt{constructor(t){this.map=t}of(t){return new rt(this,t)}}class rt{constructor(t,e){this.type=t,this.value=e}map(t){t=this.type.map(this.value,t);return void 0===t?void 0:t==this.value?this:new rt(this.type,t)}is(t){return this.type==t}static define(t={}){return new nt(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(var n of t){n=n.map(e);n&&i.push(n)}return i}}rt.reconfigure=rt.define(),rt.appendConfig=rt.define();class st{constructor(t,e,i,n,r,s){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=s,this._doc=null,this._state=null,i&&C(i,e.newLength),r.some(t=>t.type==st.time)||(this.annotations=r.concat(st.time.of(Date.now())))}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(var e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}}function ot(t,e,i){let n,r,s;return s=i?(n=e.changes,r=k.empty(e.changes.length),t.changes.compose(e.changes)):(n=e.changes.map(t.changes),r=t.changes.mapDesc(e.changes,!0),t.changes.compose(n)),{changes:s,selection:e.selection?e.selection.map(r):null===(i=t.selection)||void 0===i?void 0:i.map(n),effects:rt.mapEffects(t.effects,n).concat(rt.mapEffects(e.effects,r)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function at(t,e,i){var n=e.selection;return{changes:e.changes instanceof k?e.changes:k.of(e.changes||[],i,t.facet(F)),selection:n&&(n instanceof _?n:_.single(n.anchor,n.head)),effects:ct(e.effects),annotations:ct(e.annotations),scrollIntoView:!!e.scrollIntoView}}function lt(e,i,n){let r=at(e,i.length?i[0]:{},e.doc.length);i.length&&!1===i[0].filter&&(n=!1);for(let t=1;t=r[i]))t=r[i++],e=r[i++];else{if(!(n{if(!/\S/.test(e))return Ot.Space;if(function(i){if(ut)return ut.test(i);for(let e=0;enull),n)for(var r in t.address){var s=t.address[r],r=n.startState.config.address[r];null!=r&&0==(1&s)&&(this.values[s>>1]=B(n.startState,r))}(this.applying=n)&&(n._state=this);for(let t=0;tn.set(e,t)),e=null),n.set(r.value.compartment,r.value.extension)):r.is(rt.reconfigure)?(e=null,i=r.value):r.is(rt.appendConfig)&&(e=null,i=ct(i).concat(r.value));new pt(e||I.resolve(i,n,this),t.newDoc,t.newSelection,t)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:_.cursor(t.from+e.length)}))}changeByRange(r){var s=this.selection,t=r(s.ranges[0]);let o=this.changes(t.changes),a=[t.range],l=ct(t.effects);for(let n=1;ne.spec.fromJSON(i,t)))}return pt.create({doc:t.doc,selection:_.fromJSON(t.selection),extensions:e.extensions?r.concat([e.extensions]):r})}static create(t={}){let e=I.resolve(t.extensions||[],new Map);var i=t.doc instanceof d?t.doc:d.of((t.doc||"").split(e.staticFacet(pt.lineSeparator)||Q));let n=t.selection?t.selection instanceof _?t.selection:_.single(t.selection.anchor,t.selection.head):_.single(0);return C(n,i.length),e.staticFacet(U)||(n=n.asSingle()),new pt(e,i,n)}get tabSize(){return this.facet(pt.tabSize)}get lineBreak(){return this.facet(pt.lineSeparator)||"\n"}phrase(t){for(var e of this.facet(pt.phrases))if(Object.prototype.hasOwnProperty.call(e,t))return e[t];return t}languageDataAt(t,e){let i=[];for(var n of this.facet(N))for(var r of n(this,e))Object.prototype.hasOwnProperty.call(r,t)&&i.push(r[t]);return i}charCategorizer(t){return ft(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),r=this.charCategorizer(t),s=t-i,o=t-i;for(;0 t.length?t[0]:4}),pt.lineSeparator=F,pt.phrases=L.define(),pt.languageData=N,pt.changeFilter=J,pt.transactionFilter=K,pt.transactionExtender=tt,j.reconfigure=rt.define();const gt="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),vt="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class wt{constructor(t,e){this.rules=[];let{finish:c}=e||{};function O(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}for(var i in t)!function t(i,e,n,r){let s=[],o=/^@(\w+)\b/.exec(i[0]),a=o&&"keyframes"==o[1];if(o&&null==e)return n.push(i[0]+";");for(var l in e){var h=e[l];if(/&/.test(l))t(l.split(/,\s*/).map(e=>i.map(t=>e.replace(/&/,t))).reduce((t,e)=>t.concat(e)),h,n);else if(h&&"object"==typeof h){if(!o)throw new RangeError("The value of a property ("+l+") should be a primitive value.");t(O(l),h,s,a)}else null!=h&&s.push(l.replace(/_.*/,"").replace(/[A-Z]/g,t=>"-"+t.toLowerCase())+": "+h+";")}(s.length||a)&&n.push((!c||o||r?i:i.map(c)).join(", ")+" {"+s.join(" ")+"}")}(O(i),t[i],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=Qt[gt]||1;return Qt[gt]=t+1,"ͼ"+t.toString(36)}static mount(t,e){(t[vt]||new yt(t)).mount(Array.isArray(e)?e:[e])}}let $t=null;class yt{constructor(e){if(!e.head&&e.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if($t)return e.adoptedStyleSheets=[$t.sheet].concat(e.adoptedStyleSheets),e[vt]=$t;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),$t=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[vt]=this}mount(n){let r=this.sheet,s=0,o=0;for(let i=0;i>1,l=o[a]-i||(n<0?this.value[a].startSide:this.value[a].endSide)-r;if(a==t)return 0<=l?t:e;0<=l?e=a:t=1+a}}between(i,n,r,s){for(let t=this.findIndex(n,-1),e=this.findIndex(r,1,void 0,t);tr||n==r&&0this.chunkEnd(o.chunkIndex)||ro.to||r500<=t.maxPoint||t!=Pt.empty&&i.indexOf(t)<0&&t.maxPoint>=r),o=i.filter(t=>500<=t.maxPoint||t!=Pt.empty&&e.indexOf(t)<0&&t.maxPoint>=r),a=function(t,e){let i=new Map;for(var n of t)for(let t=0;tCt(l,t,h,e,i,n)),t.empty&&0==t.length&&Ct(l,0,h,0,0,n)}static spans(t,e,i,n,r=-1){let s=new _t(t,null,r).goto(e),o=e,a=s.openStart;for(;;){var l=Math.min(s.to,i);if(s.point?(n.point(o,l,s.point,s.activeForPoint(s.to),a),a=s.openEnd(l)+(s.to>l?1:0)):l>o&&(n.span(o,l,s.active,a),a=s.openEnd(l)),s.to>i)break;o=s.to,s.next()}return a}static of(t,e=!1){let i=new Tt;for(var n of t instanceof xt?[t]:e?t.slice().sort(kt):t)i.add(n.from,n.to,n.value);return i.finish()}}Pt.empty=new Pt([],[],null,-1),Pt.empty.nextLayer=Pt.empty;class Tt{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(t){this.chunks.push(new St(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Tt)).add(t,e,i)}addInner(t,e,i){var n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);var i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(Pt.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;t=new Pt(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,t}}class Wt{constructor(t,e,i,n=0){this.layer=t,this.skip=e,this.minPoint=i,this.rank=n}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,i){for(;this.chunkIndex=this.minPoint)break}}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.to-t.to||this.endSide-t.endSide}}class Xt{constructor(t){this.heap=t}static from(i,n=null,r=-1){let s=[];for(let e=0;e=r&&s.push(new Wt(t,n,r,e));return 1==s.length?s[0]:new Xt(s)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(var i of this.heap)i.goto(t,e);for(let t=this.heap.length>>1;0<=t;t--)Rt(this.heap,t);return this.next(),this}forward(t,e){for(var i of this.heap)i.forward(t,e);for(let t=this.heap.length>>1;0<=t;t--)Rt(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Rt(this.heap,0)}}}function Rt(n,r){for(let i=n[r];;){let t=1+(r<<1);if(t>=n.length)break;let e=n[t];if(t+1e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&At(i,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}r=this.cursor.value;if(r.point){if(!(t&&this.cursor.to==this.to&&this.cursor.frome&&this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(i),this.cursor.next()}}if(i){let t=0;for(;tthis.pointRank);t++)(this.activeTo[t]>e||this.activeTo[t]==e&&this.active[t].endSide>this.point.endSide)&&i.push(this.active[t]);return i}openEnd(t){let e=0;for(;et;)e++;return e}}function Ct(t,e,i,n,r,s){t.goto(e),i.goto(n);var o=n+r;let a=n,l=n-e;for(;;){var h=t.to+l-i.to||t.endSide-i.endSide,c=h<0?t.to+l:i.to,O=Math.min(c,o);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))||s.comparePoint(a,O,t.point,i.point):O>a&&!function(e,i){if(e.length!=i.length)return!1;for(let t=0;t=i;t--)e[t+1]=e[t];e[i]=t}function zt(e,i){let n=-1,r=1e9;for(let t=0;t",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Yt="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Mt="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Zt="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Et="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Dt="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),jt=Yt&&(Et||+Yt[1]<57)||Zt&&Et,Ht=0;Ht<10;Ht++)qt[48+Ht]=qt[96+Ht]=String(Ht);for(Ht=1;Ht<=24;Ht++)qt[Ht+111]="F"+Ht;for(var It,Ht=65;Ht<=90;Ht++)qt[Ht]=String.fromCharCode(Ht+32),Vt[Ht]=String.fromCharCode(Ht);for(It in qt)Vt.hasOwnProperty(It)||(Vt[It]=qt[It]);function Gt(t){return(t.getSelection?t:document).getSelection()}function Bt(t,e){return!!e&&t.contains(1!=e.nodeType?e.parentNode:e)}function Nt(t,e){if(!e.anchorNode)return!1;try{return Bt(t,e.anchorNode)}catch(t){return!1}}function Ut(t){return 3==t.nodeType?ae(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function Ft(t,e,i,n){return i&&(Kt(t,e,i,n,-1)||Kt(t,e,i,n,1))}function Jt(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function Kt(t,e,i,n,r){for(;;){if(t==i&&e==n)return!0;if(e==(r<0?0:te(t))){if("DIV"==t.nodeName)return!1;var s=t.parentNode;if(!s||1!=s.nodeType)return!1;e=Jt(t)+(r<0?0:1),t=s}else{if(1!=t.nodeType)return!1;t=t.childNodes[e+(r<0?-1:0)],e=r<0?te(t):0}}}function te(t){return(3==t.nodeType?t.nodeValue:t.childNodes).length}const ee={left:0,right:0,top:0,bottom:0};function ie(t,e){e=e?t.left:t.right;return{left:e,right:e,top:t.top,bottom:t.bottom}}class ne{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}}let re=null;function se(e){if(e.setActive)return e.setActive();if(re)return e.focus(re);let r=[];for(let t=e;t&&(r.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(e.focus(null==re?{get preventScroll(){return re={preventScroll:!0},!0}}:void 0),!re){re=!1;for(let n=0;no&&t.dom.parentNode==this.dom){h=i,c=r;break}r=e,n=e+t.breakAfter}return{from:l,to:c<0?t+this.length:c,startDOM:(a?this.children[a-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:hthis.pos||t==this.pos&&(0t.width)||a),o?ie(a,o<0):a}class We extends ke{constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i}static create(t,e,i){return new(t.customView||We)(t,e,i)}slice(t){return We.create(this.widget,this.length-t,this.side)}sync(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(t,e,i,n,r){return!(i&&(!(i instanceof We&&this.widget.compare(i.widget))||0i&&st?i[r]=Math.max(i[r],e):i.push(t,e)}Ee.prototype.point=!0;class He extends ce{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,n,r,s){if(i){if(!(i instanceof He))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),Re(this,t,e,i?i.children:Ie,r,s),!0}split(t){let e=new He;if(e.breakAfter=this.breakAfter,0==this.length)return e;let{i,off:n}=this.childPos(t);n&&(e.append(this.children[i].slice(n),0),this.children[i].merge(n,this.children[i].length,null,0,0),i++);for(let t=i;t!t.length||t[0]});class si{constructor(t,e){this.field=t,this.get=e}}class oi{from(t){return new si(this,t)}static define(){return new oi}}oi.decorations=oi.define(),oi.scrollMargins=oi.define();let ai=0;const li=L.define();class hi{constructor(t,e,i){this.id=t,this.create=e,this.fields=i,this.extension=li.of(this)}static define(t,e){let{eventHandlers:i,provide:n,decorations:r}=e||{},s=[];if(n)for(var o of Array.isArray(n)?n:[n])s.push(o);return i&&s.push(ci.from(t=>({plugin:t,handlers:i}))),r&&s.push(oi.decorations.from(r)),new hi(ai++,t,s)}static fromClass(e,t){return hi.define(t=>new e(t),t)}}const ci=oi.define();class Oi{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}takeField(t,e){for(var{field:i,get:n}of this.spec.fields)i==t&&e.push(n(this.value))}update(e){if(this.value){if(this.mustUpdate){var i=this.mustUpdate;if(this.mustUpdate=null,!this.value.update)return this;try{this.value.update(i)}catch(t){if(ni(i.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}return Oi.dummy}}}else try{this.value=this.spec.create(e)}catch(t){return ni(e.state,t,"CodeMirror plugin crashed"),Oi.dummy}return this}destroy(e){var t;if(null!==(t=this.value)&&void 0!==t&&t.destroy)try{this.value.destroy()}catch(t){ni(e.state,t,"CodeMirror plugin crashed")}}}Oi.dummy=new Oi(hi.define(()=>({})));const di=L.define({combine:t=>t.reduce((t,e)=>Ae(e,t),{})}),ui=L.define({combine:t=>t.reduce((t,e)=>Ae(e,t),{})}),fi=L.define(),pi=L.define();class mi{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new mi(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;0i.toA)){if(n.toAr.push(new mi(t,e,i,n))),this.changedRanges=r;i=t.hasFocus;i!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=i,this.flags|=1),this.docChanged&&(this.flags|=2)}get viewportChanged(){return 0<(4&this.flags)}get heightChanged(){return 0<(2&this.flags)}get geometryChanged(){return this.docChanged||0<(18&this.flags)}get focusChanged(){return 0<(1&this.flags)}get docChanged(){return this.transactions.some(t=>t.docChanged)}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}class vi extends ce{constructor(t){super(),this.view=t,this.compositionDeco=Ye.none,this.decorations=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.setDOM(t.contentDOM),this.children=[new He],this.children[0].setParent(this),this.updateInner([new mi(0,0,0,t.state.doc.length)],this.updateDeco(),0)}get root(){return this.view.root}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(t){let e=t.changedRanges;0ethis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),this.view.inputState.composing<0?this.compositionDeco=Ye.none:t.transactions.length&&(this.compositionDeco=function(t,e){var i=t.observer.selectionRange,i=i.focusNode&&$i(i.focusNode,i.focusOffset,0);if(!i)return Ye.none;let n=t.docView.nearest(i),r,s,o=i;if(n instanceof ke){for(;n.parent instanceof ke;)n=n.parent;r=n.posAtStart,s=r+n.length,o=n.dom}else{if(!(n instanceof He))return Ye.none;{for(;o.parentNode!=n.dom;)o=o.parentNode;let t=o.previousSibling;for(;t&&!ce.get(t);)t=t.previousSibling;r=s=t?ce.get(t).posAtEnd:n.posAtStart}}let a=e.mapPos(r,1),l=Math.max(a,e.mapPos(s,-1)),h=i.nodeValue,{state:c}=t;if(l-a"pointerselection"==t.annotation(st.userEvent));return 0==this.dirty&&0==e.length&&!(12&t.flags)&&t.state.selection.main.from>=this.view.viewport.from&&t.state.selection.main.to<=this.view.viewport.to?(this.updateSelection(s,o),!1):(this.updateInner(e,a,t.startState.doc.length,s,o),!0)}updateInner(t,e,i,n=!1,r=!1){this.updateChildren(t,e,i),this.view.observer.ignore(()=>{this.dom.style.height=this.view.viewState.domHeight+"px",this.dom.style.minWidth=this.minWidth?this.minWidth+"px":"";var t=be.chrome?{node:Gt(this.view.root).focusNode,written:!1}:void 0;this.sync(t),this.dirty=0,null!=t&&t.written&&(n=!0),this.updateSelection(n,r),this.dom.style.height=""})}updateChildren(e,i,t){let n=this.childCursor(t);for(let t=e.length-1;;t--){var r=0<=t?e[t]:null;if(!r)break;var{fromA:s,toA:o,fromB:a,toB:l}=r,{content:h,breakAtStart:c,openStart:O,openEnd:r}=Be.build(this.view.state.doc,a,l,i),{i:a,off:l}=n.findPos(o,1),{i:o,off:s}=n.findPos(s,-1);this.replaceRange(o,s,a,l,h,c,O,r)}}replaceRange(e,i,n,r,s,o,a,l){let h=this.children[e],c=s.length?s[s.length-1]:null;var O=c?c.breakAfter:o;if(e!=n||o||O||!(s.length<2)||!h.merge(i,r,s.length?c:null,0==i,a,l)){let t=this.children[n];for(rr.node.insertBefore(t,r.node.childNodes[r.offset]||null)),r=s=new le(t,0),e=!0}let o=this.view.observer.selectionRange;!(e||!o.focusNode||be.gecko&&n.empty&&yi(o.focusNode,o.focusOffset)||be.safari&&n.empty&&1==s.node.childNodes.length&&"BR"==s.node.firstChild.nodeName&&this.view.inputState.lastIOSBackspace>Date.now()-225)&&Ft(r.node,r.offset,o.anchorNode,o.anchorOffset)&&Ft(s.node,s.offset,o.focusNode,o.focusOffset)||(this.view.observer.ignore(()=>{let e=Gt(this.root);var t,i;if(n.empty)be.gecko&&(!(t=yi(r.node,r.offset))||3==t||(i=$i(r.node,r.offset,1==t?1:-1))&&(r=new le(i,1==t?0:i.nodeValue.length))),e.collapse(r.node,r.offset),null!=n.bidiLevel&&null!=o.cursorBidiLevel&&(o.cursorBidiLevel=n.bidiLevel);else if(e.extend)e.collapse(r.node,r.offset),e.extend(s.node,s.offset);else{let t=document.createRange();n.anchor>n.head&&([r,s]=[s,r]),t.setEnd(s.node,s.offset),t.setStart(r.node,r.offset),e.removeAllRanges(),e.addRange(t)}}),this.view.observer.setSelectionRange(r,s)),this.impreciseAnchor=r.precise?null:new le(o.anchorNode,o.anchorOffset),this.impreciseHead=s.precise?null:new le(o.focusNode,o.focusOffset)}}enforceCursorAssoc(){var t,e,i=this.view.state.selection.main;let n=Gt(this.root);i.empty&&i.assoc&&n.modify&&((e=He.find(this,i.head))&&(t=e.posAtStart,i.head!=t&&i.head!=t+e.length&&(t=this.coordsAt(i.head,-1),e=this.coordsAt(i.head,1),!t||!e||t.bottom>e.top||(e=this.domAtPos(i.head+i.assoc),n.collapse(e.node,e.offset),n.modify("move",i.assoc<0?"forward":"backward","lineboundary")))))}mayControlSelection(){return this.view.state.facet(ri)?this.root.activeElement==this.dom:Nt(this.dom,this.view.observer.selectionRange)}nearest(e){for(let t=e;t;){var i=ce.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e=s&&(r.push(t.dom.getBoundingClientRect().height),(l=t.dom.scrollWidth)>a&&(this.minWidth=a=l,this.minWidthFrom=i,this.minWidthTo=e)),i=e+t.breakAfter}return r}measureTextSize(){for(var t of this.children)if(t instanceof He){t=t.measureTextSize();if(t)return t}let e=document.createElement("div"),i,n;return e.className="cm-line",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);var t=Ut(e.firstChild)[0];i=e.getBoundingClientRect().height,n=t?t.width/27:7,e.remove()}),{lineHeight:i,charWidth:n}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new de(this.children,t,e)}computeBlockGapDeco(){let i=[],n=this.view.viewState;for(let t=0,e=0;;e++){var r,s=e==n.viewports.length?null:n.viewports[e],o=s?s.from-1:this.length;if(o>t&&(r=n.lineAt(o,0).bottom-n.lineAt(t,0).top,i.push(Ye.replace({widget:new Qi(r),block:!0,inclusive:!0}).range(t,o))),!s)break;t=s.to+1}return Ye.set(i)}updateDeco(){return this.decorations=[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco,this.compositionDeco,...this.view.state.facet(fi),...this.view.pluginField(oi.decorations)]}scrollPosIntoView(t,r){var s,o,a,r=this.coordsAt(t,r);if(r){let t=0,e=0,i=0,n=0;for(var l of this.view.pluginField(oi.scrollMargins))l&&({left:s,right:o,top:a,bottom:l}=l,null!=s&&(t=Math.max(t,s)),null!=o&&(e=Math.max(e,o)),null!=a&&(i=Math.max(i,a)),null!=l&&(n=Math.max(n,l)));!function(t,s){let e=t.ownerDocument,o=e.defaultView;for(let r=t.parentNode;r;)if(1==r.nodeType){let t,e=r==document.body;if(e)t={left:0,right:(l=o).innerWidth,top:0,bottom:l.innerHeight};else{if(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth){r=r.parentNode;continue}l=r.getBoundingClientRect();t={left:l.left,right:l.left+r.clientWidth,top:l.top,bottom:l.top+r.clientHeight}}let i=0,n=0;var a;if(s.topt.bottom&&(n=s.bottom-t.bottom+5),s.leftt.right&&(i=s.right-t.right+5),(i||n)&&(e?o.scrollBy(i,n):(n&&(a=r.scrollTop,r.scrollTop+=n,n=r.scrollTop-a),i&&(a=r.scrollLeft,r.scrollLeft+=i,i=r.scrollLeft-a),s={left:s.left-i,top:s.top-n,right:s.right-i,bottom:s.bottom-n})),e)break;r=r.assignedSlot||r.parentNode}else{if(11!=r.nodeType)break;r=r.host}var l}(this.dom,{left:r.left-t,top:r.top-i,right:r.right+e,bottom:r.bottom+n})}}}class Qi extends qe{constructor(t){super(),this.height=t}toDOM(){var t=document.createElement("div");return this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}}class wi extends qe{constructor(t,e){super(),this.top=t,this.text=e}eq(t){return this.top==t.top&&this.text==t.text}toDOM(){return this.top}ignoreEvent(){return!1}get customView(){return Xe}}function $i(t,e,i){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&0=i){if(o.level==n)return t;(s<0||(0!=r?r<0?o.fromi:e[s].level>o.level))&&(s=t)}}if(s<0)throw new RangeError("Index out of range");return s}}const qi=[];function Vi(o,t){var r,a=o.length,l=t==Si?1:2,h=t==Si?2:1;if(!o||1==l&&!Li.test(o))return Yi(a);for(let e=0,i=l,n=l;ef;){for(var m=t,g=2!=qi[--t];t>f&&g==(2!=qi[t-1]);)t--;i.push(new zi(t,m,g?2:1))}else i.push(new zi(f,e,0))}else for(let t=0;te.top+1}function Ei(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function ji(t,n,r){let s,o,a,l,h,c,O,d;for(let i=t.firstChild;i;i=i.nextSibling){var u=Ut(i);for(let e=0;em?p.left-m:Math.max(0,m-p.right)),p=(m=r,(p=t).top>m?p.top-m:Math.max(0,m-p.bottom));if(0==f&&0==p)return(3==i.nodeType?Hi:ji)(i,n,r);(!s||l>p||l==p&&a>f)&&(s=i,o=t,a=f,l=p),0==f?r>t.bottom&&(!O||O.bottomt.top)&&(c=i,d=t):O&&Zi(O,t)?O=Di(O,t.bottom):d&&Zi(d,t)&&(d=Ei(d,t.top))}}var m,p;if(O&&O.bottom>=r?(s=h,o=O):d&&d.top<=r&&(s=c,o=d),!s)return{node:t,offset:0};var e=Math.max(o.left,Math.min(o.right,n));return 3==s.nodeType?Hi(s,e,r):a||"true"!=s.contentEditable?{node:t,offset:Array.prototype.indexOf.call(t.childNodes,s)+(n>=(o.left+o.right)/2?1:0)}:ji(s,e,r)}function Hi(n,r,e){var t=n.nodeValue.length;let s=-1,o=1e9,a=0;for(let i=0;ie?h.top-e:e-h.bottom)-1;if(h.left-1<=r&&h.right+1>=r&&c=(h.left+h.right)/2,e=t;if((be.chrome||be.gecko)&&ae(n,i).getBoundingClientRect().left==h.right&&(e=!t),c<=0)return{node:n,offset:i+(e?1:0)};s=i+(e?1:0),o=c}}}}return{node:n,offset:-1 i||s.bottomi?-1:1,i=Math.min(s.bottom-o,Math.max(s.top+o,i)),t)return-1;t=!0}if(s.type==Ve.Text)break;i=0e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:null;t=Math.max(r.left+1,Math.min(r.right-1,t));let h=e.root,c=h.elementFromPoint(t,i),O,d=-1;return!c||!e.contentDOM.contains(c)||e.docView.nearest(c)instanceof We||(h.caretPositionFromPoint?(a=h.caretPositionFromPoint(t,i))&&({offsetNode:O,offset:d}=a):!h.caretRangeFromPoint||(a=h.caretRangeFromPoint(t,i))&&({startContainer:O,startOffset:d}=a,be.safari&&function(e,t,i){let n;if(3!=e.nodeType||t!=(n=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=e.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return ae(e,n-1,n).getBoundingClientRect().left>i}(O,d,t)&&(O=void 0))),O&&e.docView.dom.contains(O)||(l=He.find(e.docView,l),{node:O,offset:d}=ji(l.dom,t,i)),e.docView.posFromDOM(O,d)}function Gi(r,t,s,o){let a=r.state.doc.lineAt(t.head),l=r.bidiSpans(a);for(let i=t,n=null;;){let t=function(t,e,i,n,r){let s=n.head-t.from,o=-1;if(0==s){if(!r||!t.length)return null;e[0].level!=i&&(s=e[0].side(!1,i),o=0)}else if(s==t.length){if(r)return null;let t=e[e.length-1];t.level!=i&&(s=t.side(!0,i),o=e.length-1)}o<0&&(o=zi.find(e,s,null!==(l=n.bidiLevel)&&void 0!==l?l:-1,n.assoc));let a=e[o];s==a.side(r,i)&&(a=e[o+=r?1:-1],s=a.side(!r,i));var l=r==(a.dir==i),n=b(t.text,s,l);if(Mi=t.text.slice(Math.min(s,n),Math.max(s,n)),n!=a.side(r,i))return _.cursor(n+t.from,l?-1:1,a.level);let h=o==(r?e.length-1:0)?null:e[o+(r?1:-1)];return h||a.level==i?h&&h.level>1;for(let t=s<0?o.top:o.bottom,e=0;e<50;e+=10){var O=Ii(i,{x:h,y:t+(c+e)*s},s);if(null==O)break;if(O!=r)return _.cursor(O,void 0,void 0,l)}}let{doc:d}=i.state,u=d.lineAt(r),f=i.state.tabSize,p=t.goalColumn,m=0;if(null==p){for(const $=d.iterRange(u.from,r);!$.next().done;)m=x($.value,m,f);p=m*i.defaultCharacterWidth}else m=Math.round(p/i.defaultCharacterWidth);if(s<0&&0==u.from)return _.cursor(0);if(0 =m&&!y.next().done;){var{offset:Q,leftOver:w}=function(e,i,n,r){for(let t=0;t{"keydown"==i&&this.keydown(n,t)||Ji(n,t)&&!this.ignoreDuringComposition(t)&&(this.mustFlushObserver(t)&&n.observer.forceFlush(),this.runCustomHandlers(i,n,t)?t.preventDefault():e(n,t))}),this.registeredEvents.push(i)}this.notifiedFocused=n.hasFocus,this.ensureHandlers(n),be.safari&&n.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}ensureHandlers(i){var t;for(t of this.customHandlers=i.pluginField(ci))for(let e in t.handlers)this.registeredEvents.indexOf(e)<0&&"scroll"!=e&&(this.registeredEvents.push(e),i.contentDOM.addEventListener(e,t=>{Ji(i,t)&&this.runCustomHandlers(e,i,t)&&t.preventDefault()}))}runCustomHandlers(i,n,r){for(var s of this.customHandlers){let t=s.handlers[i],e=!1;if(t){try{e=t.call(s.plugin,r,n)}catch(t){ni(n.state,t)}if(e||r.defaultPrevented)return be.android&&"keydown"==i&&13==r.keyCode&&n.observer.flushSoon(),!0}}return!1}runScrollHandlers(e,i){for(var n of this.customHandlers){let t=n.handlers.scroll;if(t)try{t.call(n.plugin,i,e)}catch(t){ni(e.state,t)}}}keydown(t,e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!this.screenKeyEvent(t,e))return!(!be.ios||13!=e.keyCode&&8!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey||e.synthetic)&&(this[13==e.keyCode?"lastIOSEnter":"lastIOSBackspace"]=Date.now(),!0)}ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(0=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}(e,i)&&null,!1===this.dragging&&(i.preventDefault(),this.select(i))}move(t){if(0==t.buttons)return this.destroy();!1===this.dragging&&this.select(t)}up(t){null==this.dragging&&this.select(this.startEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}select(t){let e=this.style.get(t,this.extend,this.multiple);e.eq(this.view.state.selection)&&e.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:e,annotations:st.userEvent.of("pointerselection"),scrollIntoView:!0})}update(t){t.docChanged&&this.dragging&&(this.dragging=this.dragging.map(t.changes)),this.style.update(t)}}function Ji(i,n){if(!n.bubbles)return 1;if(!n.defaultPrevented){for(let t=n.target,e;t!=i.contentDOM;t=t.parentNode)if(!t||11==t.nodeType||(e=ce.get(t))&&e.ignoreEvent(n))return;return 1}}const Ki=Object.create(null),tn=be.ie&&be.ie_version<15||be.ios&&be.webkit_version<604;function en(t,r){let{state:s}=t,e,o=1,a=s.toText(r),l=a.lines==s.selection.ranges.length;if(dn&&s.selection.ranges.every(t=>t.empty)&&dn==a.toString()){let n=-1;e=s.changeByRange(t=>{var e=s.doc.lineAt(t.from);if(e.from==n)return{range:t};n=e.from;var i=s.toText((l?a.line(o++).text:r)+s.lineBreak);return{changes:{from:e.from,insert:i},range:_.cursor(t.from+i.length)}})}else e=l?s.changeByRange(t=>{var e=a.line(o++);return{changes:{from:t.from,to:t.to,insert:e.text},range:_.cursor(t.from+e.length)}}):s.replaceSelection(a);t.dispatch(e,{annotations:st.userEvent.of("paste"),scrollIntoView:!0})}Ki.keydown=(t,e)=>{t.inputState.setSelectionOrigin("keyboardselection")};let nn=0;function rn(i,n,r,t){if(1==t)return _.cursor(n,r);if(2==t)return function(t,e,i=1){let n=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(0==r.length)return _.cursor(e);0==s?i=1:s==r.length&&(i=-1);let o=s,a=s;i<0?o=b(r.text,s,!1):a=b(r.text,s);for(var l=n(r.text.slice(o,a));0{nn=Date.now(),t.inputState.setSelectionOrigin("pointerselection")},Ki.touchmove=t=>{t.inputState.setSelectionOrigin("pointerselection")},Ki.mousedown=(e,i)=>{if(e.observer.flush(),!(nn>Date.now()-2e3)){let t=null;for(var n of e.state.facet(Ke))if(t=n(e,i),t)break;t||0!=i.button||(t=function(o,t){let a=an(o,t),l=function(t){if(!ln)return t.detail;var e=hn,i=On;return hn=t,On=Date.now(),cn=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(cn+1)%3:1}(t),h=o.state.selection,c=a,O=t;return{update(t){t.changes&&(a&&(a.pos=t.changes.mapPos(a.pos)),h=h.map(t.changes))},get(t,e,i){let n;if(t.clientX==O.clientX&&t.clientY==O.clientY?n=c:(n=c=an(o,t),O=t),!n||!a)return h;let r=rn(o,n.pos,n.bias,l);var s;return a.pos==n.pos||e||(s=rn(o,a.pos,a.bias,l),t=Math.min(s.from,r.from),s=Math.max(s.to,r.to),r=tse(e.contentDOM)),e.inputState.startMouseSelection(e,i,t))}};let sn=(t,e)=>t>=e.top&&t<=e.bottom,on=(t,e,i)=>sn(e,i)&&t>=i.left&&t<=i.right;function an(t,e){var i=t.posAtCoords({x:e.clientX,y:e.clientY});return null==i?null:{pos:i,bias:function(t,e,i,n){let r=He.find(t.docView,e);return r&&0!=(t=e-r.posAtStart)&&(t==r.length||(e=r.coordsAt(t,-1))&&on(i,n,e)||(!(t=r.coordsAt(t,1))||!on(i,n,t))&&e&&sn(n,e))?-1:1}(t,i,e.clientX,e.clientY)}}const ln=be.ie&&be.ie_version<=11;let hn=null,cn=0,On=0;Ki.dragstart=(t,e)=>{var{selection:{main:i}}=t.state;let{mouseSelection:n}=t.inputState;n&&(n.dragging=i),e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(i.from,i.to)),e.dataTransfer.effectAllowed="copyMove")},Ki.drop=(e,i)=>{if(i.dataTransfer&&e.state.facet(ri)){var n=e.posAtCoords({x:i.clientX,y:i.clientY}),r=i.dataTransfer.getData("Text");if(null!=n&&r){i.preventDefault();var{mouseSelection:i}=e.inputState,i=i&&i.dragging&&i.dragMove?{from:i.dragging.from,to:i.dragging.to}:null,r={from:n,insert:r};let t=e.state.changes(i?[i,r]:r);e.focus(),e.dispatch({changes:t,selection:{anchor:t.mapPos(n,-1),head:t.mapPos(n,1)},annotations:st.userEvent.of("drop")})}}},Ki.paste=(e,i)=>{if(e.state.facet(ri)){e.observer.flush();let t=tn?null:i.clipboardData;var n=t&&t.getData("text/plain");n?(en(e,n),i.preventDefault()):function(e){let i=e.dom.parentNode;if(i){let t=i.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{e.focus(),t.remove(),en(e,t.value)},50)}}(e)}};let dn=null;function un(t){t.docView.compositionDeco.size&&t.update([])}Ki.copy=Ki.cut=(e,i)=>{var{text:n,ranges:r,linewise:s}=function(e){let i=[],n=[],r=!1;for(var t of e.selection.ranges)t.empty||(i.push(e.sliceDoc(t.from,t.to)),n.push(t));if(!i.length){let t=-1;for(var{from:s}of e.selection.ranges){s=e.doc.lineAt(s);s.number>t&&(i.push(s.text),n.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),t=s.number}r=!0}return{text:i.join(e.lineBreak),ranges:n,linewise:r}}(e.state);if(n){dn=s?n:null;let t=tn?null:i.clipboardData;t?(i.preventDefault(),t.clearData(),t.setData("text/plain",n)):function(e,i){let n=e.dom.parentNode;if(n){let t=n.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.value=i,t.focus(),t.selectionEnd=i.length,t.selectionStart=0,setTimeout(()=>{t.remove(),e.focus()},50)}}(e,n),"cut"==i.type&&e.state.facet(ri)&&e.dispatch({changes:r,scrollIntoView:!0,annotations:st.userEvent.of("cut")})}},Ki.focus=Ki.blur=t=>{setTimeout(()=>{t.hasFocus!=t.inputState.notifiedFocused&&t.update([])},10)},Ki.beforeprint=t=>{t.viewState.printing=!0,t.requestMeasure(),setTimeout(()=>{t.viewState.printing=!1,t.requestMeasure()},2e3)},Ki.compositionstart=Ki.compositionupdate=t=>{t.inputState.composing<0&&(t.docView.compositionDeco.size&&(t.observer.flush(),un(t)),t.inputState.composing=0)},Ki.compositionend=t=>{t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),setTimeout(()=>{t.inputState.composing<0&&un(t)},50)},Ki.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};const fn=["pre-wrap","normal","pre-line"];class pn{constructor(){this.doc=d.empty,this.lineWrapping=!1,this.direction=ki.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength)),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefresh(e,t,i){let n=!1;for(let t=0;t=e?r:c.lineAt(e,vn.ByPosNoHeight,a,0,0);for(n+=O.to-e,e=O.to;0 2*r){var o=t[e-1];o.break?t.splice(--e,1,o.left,null,o.right):t.splice(--e,1,o.left,o.right),i+=1+o.break,n-=o.size}else{if(!(r>2*n))break;o=t[i];o.break?t.splice(i,1,o.left,null,o.right):t.splice(i,1,o.left,o.right),i+=2+o.break,r-=o.size}else nt&&e.push(new yn(r.from-t-1).updateHeight(n,t));i<=s&&r.more;){var o=n.doc.lineAt(i).length;e.length&&e.push(null);let t=new $n(o,r.heights[r.index++]);t.outdated=!1,e.push(t),i+=o+1}return i<=s&&e.push(null,new yn(s-i).updateHeight(n,i)),n.heightChanged=!0,Qn.of(e)}return(e||this.outdated)&&(this.setHeight(n,n.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class bn extends Qn{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,n){var r=i+this.left.height;return to))return l;e=e==vn.ByPosNoHeight?vn.ByPosNoHeight:vn.ByPos;return a?l.join(this.right.lineAt(o,e,i,s,o)):this.left.lineAt(o,e,i,n,r).join(l)}forEachLine(t,e,i,n,r,s){var o,a=n+this.left.height,l=r+this.left.length+this.break;this.break?(t=t&&o.from<=e&&s(o),e>o.to&&this.right.forEachLine(o.to+1,e,i,a,l,s))}replace(t,e,i){var n=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let r=[];0=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){var i=this.left.length,n=i+this.break;if(n<=t)return this.right.decomposeRight(t-n,e);t2*e.size||e.size>2*t.size?Qn.of(this.break?[t,null,e]:[t,e]):(this.left=t,this.right=e,this.height=t.height+e.height,this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:r,right:s}=this,o=e+r.length+this.break,a=null;return n&&n.from<=e+r.length&&n.more?a=r=r.updateHeight(t,e,i,n):r.updateHeight(t,e,i),n&&n.from<=o+s.length&&n.more?a=s=s.updateHeight(t,o,i,n):s.updateHeight(t,o,i),a?this.balanced(r,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function xn(t,e){let i,n;null==t[e]&&(i=t[e-1])instanceof yn&&(n=t[e+1])instanceof yn&&t.splice(e-1,3,new yn(i.length+1+n.length))}class kn{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,i){if(-1this.pos||!this.isCovered)&&this.nodes.push(new $n(t-this.pos,-1)),(this.writtenTo=t)t&&this.nodes.push(new $n(this.pos-t,-1)),this.writtenTo=this.pos)}blankContent(t,e){let i=new yn(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();var t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof $n)return t;t=new $n(0,-1);return this.nodes.push(t),t}addBlock(t){this.enterLine(),t.type!=Ve.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,t.type!=Ve.WidgetBefore&&(this.covering=t)}addLineDeco(t,e){let i=this.ensureLine();i.length+=e,i.collapsed+=e,i.widgetHeight=Math.max(i.widgetHeight,t),this.writtenTo=this.pos=this.pos+e}finish(t){var e,i=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(-1t.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let t=0;t<=1;t++){let i=t?n.head:n.anchor;var r,s;e.some(({from:t,to:e})=>i>=t&&i<=e)||({from:r,to:s}=this.lineAt(i,0),e.push(new Xn(r,s)))}this.viewports=e.sort((t,e)=>t.from-e.from),this.scaler=this.heightMap.height<=7e6?An:new Ln(this.heightOracle.doc,this.heightMap,this.viewports)}update(t,e=null){var i=this.state;this.state=t.state;var n,r,s,o=this.state.facet(fi),a=t.changedRanges,s=mi.extendWithRanges(a,(n=t.startState.facet(fi),r=o,s=t?t.changes:k.empty(this.state.doc.length),a=new Sn,Pt.compare(n,r,s,a,0),a.changes)),a=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(o,i.doc,this.heightOracle.setDoc(this.state.doc),s),this.heightMap.height!=a&&(t.flags|=2);let l=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,e)),l.eq(this.viewport)||(this.viewport=l,t.flags|=4),this.updateForViewport(),(this.lineGaps.length||15e3t.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=l.overflow&&(a=t.getBoundingClientRect(),n=Math.max(n,a.left),r=Math.min(r,a.right),s=Math.max(s,a.top),o=Math.min(o,a.bottom)),t="absolute"==l.position||"fixed"==l.position?t.offsetParent:t.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:n-i.left,right:r-i.left,top:s-(i.top+t),bottom:o-(i.top+t)}}(i,this.paddingTop),o=s.top-this.pixelViewport.top,a=s.bottom-this.pixelViewport.bottom;if(this.pixelViewport=s,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var l,h=t.measureVisibleLineHeights();let c=!1,O=0,d=0,u=this.heightOracle;return e||(l=t.dom.clientWidth,(u.mustRefresh(h,n,r)||u.lineWrapping&&Math.abs(l-this.contentWidth)>u.charWidth)&&({lineHeight:s,charWidth:e}=t.measureTextSize(),c=u.refresh(n,r,s,e,l/e,h),c&&(t.minWidth=0,d|=16)),this.contentWidth!=l&&(this.contentWidth=l,d|=16),0this.viewport.to))&&((h=this.getViewport(O,this.scrollTo)).from==this.viewport.from&&h.to==this.viewport.to||(this.viewport=h,d|=4)),this.updateForViewport(),(this.lineGaps.length||15e3o.to&&({bottom:e}=i.lineAt(e.head,vn.ByPos,n,0,0),o=new Xn(i.lineAt(e-(s-r)-500,vn.ByHeight,n,0,0).from,i.lineAt(e+500,vn.ByHeight,n,0,0).to))),o}mapViewport(t,e){var i=e.mapPos(t.from,-1),t=e.mapPos(t.to,1);return new Xn(this.heightMap.lineAt(i,vn.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(t,vn.ByPos,this.state.doc,0,0).to)}viewportIsAppropriate({from:t,to:e},i=0){var{top:n}=this.heightMap.lineAt(t,vn.ByPos,this.state.doc,0,0),{bottom:r}=this.heightMap.lineAt(e,vn.ByPos,this.state.doc,0,0),{visibleTop:s,visibleBottom:o}=this;return(0==t||n<=s-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||r>=o+Math.max(10,Math.min(i,250)))&&s-2e3{if(!(r.length<1e4)){var s=function(t,e,i){let n=[],r=t,s=0;Pt.spans(i.facet(fi),t,e,{span(){},point(t,e){t>r&&(n.push({from:r,to:t}),s+=t-r),r=e}},20),r=r.from&&(t=o.from),o.from<=r.to&&o.to>=e&&(e=o.to);let i=t-1e4,n=e+1e4;i>r.from+5e3&&l.push(Cn(a,t=>t.from==r.from&&t.to>i-5e3&&t.to<5e3+i)||new Pn(r.from,i,this.gapSize(r,i,!0,s))),nt.to==r.to&&t.from>n-5e3&&t.fromt.draw(this.heightOracle.lineWrapping))),8)}computeVisibleRanges(){let t=this.state.facet(fi);this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];Pt.spans(t,this.viewport.from,this.viewport.to,{span(t,e){i.push({from:t,to:e})},point(){}},20),this.visibleRanges=i}lineAt(t,e){return e+=this.paddingTop,zn(this.heightMap.lineAt(t,vn.ByPos,this.state.doc,e,0),this.scaler,e)}lineAtHeight(t,e){return e+=this.paddingTop,zn(this.heightMap.lineAt(this.scaler.fromDOM(t,e),vn.ByHeight,this.state.doc,e,0),this.scaler,e)}blockAtHeight(t,e){return e+=this.paddingTop,zn(this.heightMap.blockAt(this.scaler.fromDOM(t,e),this.state.doc,e,0),this.scaler,e)}forEachLine(t,e,i,n){return n+=this.paddingTop,this.heightMap.forEachLine(t,e,this.state.doc,n,0,1==this.scaler.scale?i:t=>i(zn(t,this.scaler,n)))}get contentHeight(){return this.domHeight+this.paddingTop+this.paddingBottom}get domHeight(){return this.scaler.toDOM(this.heightMap.height,this.paddingTop)}}class Xn{constructor(t,e){this.from=t,this.to=e}eq(t){return this.from==t.from&&this.to==t.to}}function Rn({total:t,ranges:e},i){if(i<=0)return e[0].from;if(1<=i)return e[e.length-1].to;let n=Math.floor(t*i);for(let t=0;;t++){var{from:r,to:s}=e[t],s=s-r;if(n<=s)return r+n;n-=s}}function _n(t,e){let i=0;for(var{from:n,to:r}of t.ranges){if(e<=r){i+=e-n;break}i+=r-n}return i/t.total}function Cn(t,e){for(var i of t)if(e(i))return i}const An={toDOM(t){return t},fromDOM(t){return t},scale:1};class Ln{constructor(r,s,t){let o=0,e=0,i=0;this.viewports=t.map(({from:t,to:e})=>{var i=s.lineAt(t,vn.ByPos,r,0,0).top,n=s.lineAt(e,vn.ByPos,r,0,0).bottom;return o+=n-i,{from:t,to:e,top:i,bottom:n,domTop:0,domBottom:0}}),this.scale=(7e6-o)/(s.height-o);for(var n of this.viewports)n.domTop=i+(n.top-e)*this.scale,i=n.domBottom=n.domTop+(n.bottom-n.top),e=n.bottom}toDOM(n,r){n-=r;for(let t=0,e=0,i=0;;t++){var s=tzn(t,e,i)):t.type)}const qn=L.define({combine:t=>t.join(" ")}),Vn=L.define({combine:t=>-1{if("&"==t)return e;if(!i||!i[t])throw new RangeError(`Unsupported selector: ${t}`);return i[t]}):e+" "+t}})}const jn=Dn("."+Yn,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none"},".cm-lineWrapping":{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},".cm-cursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none",display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-placeholder":{color:"#888",display:"inline-block"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},En),Hn={childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0},In=be.ie&&be.ie_version<=11;class Gn{constructor(i,t,e){this.view=i,this.onChange=t,this.onScrollChanged=e,this.active=!1,this.ignoreSelection=new ne,this.delayedFlush=-1,this.queue=[],this.lastFlush=0,this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this._selectionRange=null,this.parentCheck=-1,this.dom=i.contentDOM,this.observer=new MutationObserver(t=>{for(var e of t)this.queue.push(e);this._selectionRange=null,(be.ie&&be.ie_version<=11||be.ios&&i.composing)&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),In&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),0{this.delayedFlush=-1,this.flush()},20))}forceFlush(){0<=this.delayedFlush&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}flush(){if(!(0<=this.delayedFlush)){this.lastFlush=Date.now();let n=this.queue;for(var t of this.observer.takeRecords())n.push(t);n.length&&(this.queue=[]);var r=this.selectionRange,s=!this.ignoreSelection.eq(r)&&Nt(this.dom,r);if(0!=n.length||s){let t=-1,e=-1,i=!1;for(var o of n){o=this.readMutation(o);o&&(o.typeOver&&(i=!0),-1==t?{from:t,to:e}=o:(t=Math.min(o.from,t),e=Math.max(o.to,e)))}r=this.view.state;(-1this.view.docView.sync()),this.view.docView.dirty=0),this.view.docView.updateSelection()),this.clearSelection()}}}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(),"childList"!=t.type)return{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue};var i=Bn(e,t.previousSibling||t.target.previousSibling,-1),t=Bn(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:t?e.posBefore(t):e.posAtEnd,typeOver:!1}}destroy(){this.stop(),this.intersection&&this.intersection.disconnect();for(var t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}function Bn(t,e,i){for(;e;){var n=ce.get(e);if(n&&n.parent==t)return n;n=e.parentNode;e=n!=t.dom?n:0Date.now()-100||be.android&&t.text.length=o?s-i:0,s-=l,a=s+(a-o),o=s):a =a?s-i:0,s-=i,o=s+(o-a),a=s)}return{from:s,toA:o,toB:a}}(n.state.sliceDoc(h,c),t.text,e-h,i);O&&(s={from:h+O.from,to:h+O.toA,insert:n.state.toText(t.text.slice(O.from,O.toB))})}else!n.hasFocus&&n.state.facet(ri)||(c=n.observer.selectionRange,{impreciseHead:h,impreciseAnchor:O}=n.docView,h=h&&h.node==c.focusNode&&h.offset==c.focusOffset||!Bt(n.contentDOM,c.focusNode)?n.state.selection.main.head:n.docView.posFromDOM(c.focusNode,c.focusOffset),c=O&&O.node==c.anchorNode&&O.offset==c.anchorOffset||!Bt(n.contentDOM,c.anchorNode)?n.state.selection.main.anchor:n.docView.posFromDOM(c.anchorNode,c.anchorOffset),h==a.head&&c==a.anchor||(o=_.single(c,h)));if(s||o)if(!s&&r&&!a.empty&&o&&o.main.empty?s={from:a.from,to:a.to,insert:n.state.doc.slice(a.from,a.to)}:s&&s.from>=a.from&&s.to<=a.to&&(s.from!=a.from||s.to!=a.to)&&a.to-a.from-(s.to-s.from)<=4&&(s={from:a.from,to:a.to,insert:n.state.doc.slice(a.from,s.from).append(s.insert).append(n.state.doc.slice(s.to,a.to))}),s){let i=n.state;if(!(be.android&&(s.from==a.from&&s.to==a.to&&1==s.insert.length&&2==s.insert.lines&&Kn(n,"Enter",13)||s.from==a.from-1&&s.to==a.to&&0==s.insert.length&&Kn(n,"Backspace",8)||s.from==a.from&&s.to==a.to+1&&0==s.insert.length&&Kn(n,"Delete",46))||be.ios&&(n.inputState.lastIOSEnter>Date.now()-225&&1Date.now()-225&&!s.insert.length&&Kn(n,"Backspace",8)))){let e=s.insert.toString();if(!n.state.facet(ii).some(t=>t(n,s.from,s.to,e))){0<=n.inputState.composing&&n.inputState.composing++;let t;var d;t=s.from>=a.from&&s.to<=a.to&&s.to-s.from>=(a.to-a.from)/3&&(!o||o.main.empty&&o.main.from==s.from+s.insert.length)?(r=a.froms.to?i.sliceDoc(s.to,a.to):"",i.replaceSelection(n.state.toText(r+s.insert.sliceString(0,void 0,n.state.lineBreak)+d))):{changes:d=i.changes(s),selection:o&&!i.selection.main.eq(o.main)&&o.main.to<=d.newLength?i.selection.replaceRange(o.main):void 0},n.dispatch(t,{scrollIntoView:!0,annotations:st.userEvent.of("input")})}}}else if(o&&!o.main.eq(a)){let t=!1,e;n.inputState.lastSelectionTime>Date.now()-50&&("keyboardselection"==n.inputState.lastSelectionOrigin?t=!0:e=st.userEvent.of(n.inputState.lastSelectionOrigin)),n.dispatch({selection:o,scrollIntoView:t,annotations:e})}}class Un{constructor(t,e){this.points=t,this.view=e,this.text="",this.lineBreak=e.state.lineBreak}readRange(e,i){if(e){var n=e.parentNode;for(let t=e;;){this.findPointBefore(n,t),this.readNode(t);var r=t.nextSibling;if(r==i)break;var s=ce.get(t),o=ce.get(r);((s?s.breakAfter:Fn(t))||(o?o.breakAfter:Fn(r))&&("BR"!=t.nodeName||t.cmIgnore))&&(this.text+=this.lineBreak),t=r}this.findPointBefore(n,i)}}readNode(i){if(!i.cmIgnore){var n=ce.get(i);let t=n&&n.overrideDOMText,e;null!=t?e=t.sliceString(0,void 0,this.lineBreak):3==i.nodeType?e=i.nodeValue:"BR"==i.nodeName?e=i.nextSibling?this.lineBreak:"":1==i.nodeType&&this.readRange(i.firstChild,null),null!=e&&(this.findPointIn(i,e.length),this.text+=e,be.chrome&&13==this.view.inputState.lastKeyCode&&!i.nextSibling&&/\n\n$/.test(this.text)&&(this.text=this.text.slice(0,-1)))}}findPointBefore(t,e){for(var i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointIn(t,e){for(var i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e))}}function Fn(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}class Jn{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}function Kn(t,e,i){i={key:e,code:e,keyCode:i,which:i,cancelable:!0};let n=new KeyboardEvent("keydown",i);n.synthetic=!0,t.contentDOM.dispatchEvent(n);let r=new KeyboardEvent("keyup",i);return r.synthetic=!0,t.contentDOM.dispatchEvent(r),n.defaultPrevented||r.defaultPrevented}class tr{constructor(t={}){this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=t.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this.root=t.root||document,this.viewState=new Wn(t.state||pt.create()),this.plugins=this.state.facet(li).map(t=>new Oi(t).update(this)),this.observer=new Gn(this,(t,e,i)=>{Nn(this,t,e,i)},t=>{this.inputState.runScrollHandlers(this,t),this.observer.intersecting&&this.measure()}),this.inputState=new Ni(this),this.docView=new vi(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,window.addEventListener("resize",()=>{-1==nr&&(nr=setTimeout(rr,50))}),this.requestMeasure(),t.parent&&t.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return 0t.scrollIntoView)?n.selection.main:null;this.viewState.update(i,s),this.bidiCache=or.update(this.bidiCache,i.changes),i.empty||this.updatePlugins(i),e=this.docView.update(i),this.state.facet(pi)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(t)}finally{this.updateState=0}if((e||scrollTo||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure(),!i.empty)for(var o of this.state.facet(ei))o(i)}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");this.updateState=2;try{for(var e of this.plugins)e.destroy(this);this.viewState=new Wn(t),this.plugins=t.facet(li).map(t=>new Oi(t).update(this)),this.docView=new vi(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}this.requestMeasure()}updatePlugins(i){let t=i.startState.facet(li),n=i.state.facet(li);if(t!=n){let e=[];for(var r of n){var s=t.indexOf(r);if(s<0)e.push(new Oi(r));else{let t=this.plugins[s];t.mustUpdate=i,e.push(t)}}for(var o of this.plugins)o.mustUpdate!=i&&o.destroy(this);this.plugins=e,this.inputState.ensureHandlers(this)}else for(var e of this.plugins)e.mustUpdate=i;for(let t=0;t{try{return t.read(this)}catch(t){return ni(this.state,t),sr}});let t=new gi(this,this.state);t.flags|=r,n?n.flags|=r:n=t,this.updateState=2,t.empty||this.updatePlugins(t),this.updateAttrs(),r&&this.docView.update(t);for(let t=0;tthis.measure())),e){if(null!=e.key)for(let t=0;tfunction(t,e,i){let n=t.state.charCategorizer(e),r=n(i);return t=>{t=n(t);return r==Ot.Space&&(r=t),r==t}}(this,e.head,t))}moveToLineBoundary(t,e,i=!0){return function(t,e,i,n){var r=t.state.doc.lineAt(e.head),s=n&&t.lineWrapping?t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head):null;if(s){n=t.dom.getBoundingClientRect(),s=t.posAtCoords({x:i==(t.textDirection==ki.LTR)?n.right-1:n.left+1,y:(s.top+s.bottom)/2});if(null!=s)return _.cursor(s,i?-1:1)}return e=He.find(t.docView,e.head),r=e?i?e.posAtEnd:e.posAtStart:i?r.to:r.from,_.cursor(r,i?-1:1)}(this,t,e,i)}moveVertically(t,e,i){return Bi(this,t,e,i)}scrollPosIntoView(t){this.viewState.scrollTo=_.cursor(t),this.requestMeasure()}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t){return this.readMeasured(),Ii(this,t)}coordsAtPos(t,e=1){this.readMeasured();var i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;var n=this.state.doc.lineAt(t),r=this.bidiSpans(n);return ie(i,r[zi.find(r,t-n.from,-1,e)].dir==ki.LTR==0er)return Yi(t.length);var e,i=this.textDirection;for(e of this.bidiCache)if(e.from==t.from&&e.dir==i)return e.order;var n=Vi(t.text,this.textDirection);return this.bidiCache.push(new or(t.from,t.to,i,n)),n}get hasFocus(){var t;return(document.hasFocus()||be.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{se(this.contentDOM),this.docView.updateSelection()})}destroy(){for(var t of this.plugins)t.destroy(this);this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),-1({}),{eventHandlers:t})}static theme(t,e){var i=wt.newName();let n=[qn.of(i),pi.of(Dn(`.${i}`,t))];return e&&e.dark&&n.push(Vn.of(!0)),n}static baseTheme(t){return E.fallback(pi.of(Dn("."+Yn,t,En)))}}tr.styleModule=pi,tr.inputHandler=ii,tr.exceptionSink=ti,tr.updateListener=ei,tr.editable=ri,tr.mouseSelectionStyle=Ke,tr.dragMovesSelection=Je,tr.clickAddsSelectionRange=Fe,tr.decorations=fi,tr.contentAttributes=ui,tr.editorAttributes=di,tr.lineWrapping=tr.contentAttributes.of({class:"cm-lineWrapping"}),tr.announce=rt.define();const er=4096;function ir(t,e){return null==t?e.getBoundingClientRect().top:t}let nr=-1;function rr(){nr=-1;var i=document.querySelectorAll(".cm-content");for(let e=0;e{if(t){for(var e of t.commands)if(e(i))return!0;t.preventDefault&&(a=!0)}return!1},h=t[n],c;if(h){if(l(h[o+lr(r,e,!s)]))return!0;if(s&&(e.shiftKey||e.altKey||e.metaKey)&&(c=qt[e.keyCode])&&c!=r){if(l(h[o+lr(c,e,!0)]))return!0}else if(s&&e.shiftKey&&l(h[o+lr(r,e,!0)]))return!0}return a}(function(t){let e=t.facet(hr),i=cr.get(e);i||cr.set(e,i=function(t,a=ar){let l=Object.create(null),n=Object.create(null),h=(t,e)=>{var i=n[t];if(null==i)n[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},e=(n,t,e,i)=>{let r=l[n]||(l[n]=Object.create(null)),s=t.split(/ (?!$)/).map(t=>function(t,e){var i=t.split(/-(?!$)/);let n=i[i.length-1];"Space"==n&&(n=" ");let r,s,o,a;for(let t=0;t{let e=Or={view:t,prefix:i,scope:n};return setTimeout(()=>{Or==e&&(Or=null)},dr),!0}]})}t=s.join(" ");h(t,!1);let o=r[t]||(r[t]={preventDefault:!1,commands:[]});o.commands.push(e),i&&(o.preventDefault=!0)};for(var i of t){var r=i[a]||i.key;if(r)for(var s of i.scope?i.scope.split(" "):["editor"])e(s,r,i.run,i.preventDefault),i.shift&&e(s,"Shift-"+r,i.shift,i.preventDefault)}return l}(e.reduce((t,e)=>t.concat(e),[])));return i}(e.state),t,e,"editor")}})}),cr=new WeakMap;let Or=null;const dr=4e3;be.ios;let ur=0;const fr=new WeakMap;class pr{constructor({deserialize:t}={}){this.id=ur++,this.deserialize=t||(()=>{throw new Error("This node type doesn't define a deserialize function")})}static string(){return new pr({deserialize:t=>t})}static number(){return new pr({deserialize:Number})}static flag(){return new pr({deserialize:()=>!0})}set(t,e){return t[this.id]=e,t}add(e){return"function"!=typeof e&&(e=gr.match(e)),t=>{t=e(t);return void 0===t?null:[this,t]}}}pr.closedBy=new pr({deserialize:t=>t.split(" ")}),pr.openedBy=new pr({deserialize:t=>t.split(" ")}),pr.group=new pr({deserialize:t=>t.split(" ")});const mr=Object.create(null);class gr{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){var e=t.props&&t.props.length?Object.create(null):mr,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),n=new gr(t.name||"",e,t.id,i);if(t.props)for(var r of t.props)Array.isArray(r)||(r=r(n)),r&&r[0].set(e,r[1]);return n}prop(t){return this.props[t.id]}get isTop(){return 0<(1&this.flags)}get isSkipped(){return 0<(2&this.flags)}get isError(){return 0<(4&this.flags)}get isAnonymous(){return 0<(8&this.flags)}is(e){if("string"!=typeof e)return this.id==e;{if(this.name==e)return!0;let t=this.prop(pr.group);return!!t&&-1{for(let t=i.prop(pr.group),e=-1;e<(t?t.length:0);e++){var n=r[e<0?i.name:t[e]];if(n)return n}}}}gr.none=new gr("",Object.create(null),0,8);class vr{constructor(e){this.types=e;for(let t=0;tt.toString()).join();return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(t,e=0){var i=null!=t&&fr.get(this)||this.topNode;let n=new Sr(i);return null!=t&&(n.moveTo(t,e),fr.set(this,n._tree)),n}fullCursor(){return new Sr(this.topNode,!0)}get topNode(){return new yr(this,0,0,null)}resolve(t,e=0){return this.cursor(t,e).node}iterate(t){let{enter:i,leave:n,from:r=0,to:s=this.length}=t;for(let e=this.cursor();;){let t=!1;if(e.from<=s&&e.to>=r&&(e.type.isAnonymous||!1!==i(e.type,e.from,e.to))){if(e.firstChild())continue;e.type.isAnonymous||(t=!0)}for(;t&&n&&n(e.type,e.from,e.to),t=e.type.isAnonymous,!e.nextSibling();){if(!e.parent())return;t=!0}}}balance(t=1024){return this.children.length<=Wr?this:Xr(this.type,gr.none,this.children,this.positions,0,this.children.length,0,t,this.length,0)}static build(t){let{buffer:e,nodeSet:m,topID:i=0,maxBufferLength:g=1024,reused:v=[],minRepeatType:Q=m.types.length}=t,w=Array.isArray(e)?new Tr(e,e.length):e,$=m.types,y=0;function b(i,t,e,n,r){var{id:s,start:o,end:a,size:l}=w;let h=o-i;if(l<0)return-1==l?(e.push(v[s]),n.push(h)):y=s,void w.next();let c=$[s],O,d;if(a-o<=g&&(d=function(t,e){let i=w.fork(),n=0,r=0,s=0,o=i.end-g,a={size:0,start:0,skip:0};t:for(var l=i.pos-t;i.pos>l;)if(i.id!=e){var h=i.size,c=i.pos-h;if(h<0||c=Q?4:0;var O=i.start;for(i.next();i.pos>c;){if(i.size<0)break t;i.id>=Q&&(t+=4),i.next()}r=O,n+=h,s+=t}else a.size=n,a.start=r,a.skip=s,s+=4,n+=4,i.next();(e<0||n==t)&&(a.size=n,a.start=r,a.skip=s);return 4t;)e=function t(e,i,n,r){var{id:s,start:o,end:a,size:l}=w;w.next();if(s==r)return n;var h=n;if(4c;)n=t(e,i,n,r);s