2 lines
51 KiB
JavaScript
2 lines
51 KiB
JavaScript
(function(e){function t(t){for(var o,r,i=t[0],c=t[1],l=t[2],d=0,p=[];d<i.length;d++)r=i[d],Object.prototype.hasOwnProperty.call(s,r)&&s[r]&&p.push(s[r][0]),s[r]=0;for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);u&&u(t);while(p.length)p.shift()();return a.push.apply(a,l||[]),n()}function n(){for(var e,t=0;t<a.length;t++){for(var n=a[t],o=!0,i=1;i<n.length;i++){var c=n[i];0!==s[c]&&(o=!1)}o&&(a.splice(t--,1),e=r(r.s=n[0]))}return e}var o={},s={app:0},a=[];function r(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/";var i=window["webpackJsonp"]=window["webpackJsonp"]||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var u=c;a.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"0591":function(e,t,n){"use strict";n("7751")},"07c0":function(e,t,n){"use strict";n("899e")},1665:function(e,t,n){},"3d50":function(e,t,n){"use strict";n("3f87")},"3d57":function(e,t,n){"use strict";n("c25a")},"3ec9":function(e,t,n){},"3f87":function(e,t,n){},5476:function(e,t,n){"use strict";n("a946")},"56d7":function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var o=n("7a23");function s(e,t,n,s,a,r){var i=Object(o["resolveComponent"])("Styles"),c=Object(o["resolveComponent"])("router-view");return Object(o["openBlock"])(),Object(o["createBlock"])("div",{id:"app",class:[{mobile:e.isMobile}]},[Object(o["createVNode"])(i),Object(o["createVNode"])("main",null,[Object(o["createVNode"])(c,null,{default:Object(o["withCtx"])((function(e){var t=e.Component;return[Object(o["createVNode"])(o["Transition"],{name:"component-fade",mode:"out-in"},{default:Object(o["withCtx"])((function(){return[(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["resolveDynamicComponent"])(t)))]})),_:2},1024)]})),_:1})])],2)}var a=n("5530"),r=(n("ac1f"),n("5319"),n("7db0"),n("b0c0"),n("4de4"),n("2ca0"),n("caad"),n("2532"),n("d81d"),n("5502")),i=(n("d3b7"),n("fbb9")),c={username:"pub-bot@chat.hackersanddesigners.nl",apiKey:"m1MDxscGcPQx2RvIfgG4DiSHE1nurxms",realm:"https://chat.hackersanddesigners.nl"},l=function(){return new Promise((function(e,t){i(c).then((function(t){return e(t)})).catch((function(e){return t(e)}))}))},u=function(e){return new Promise((function(t,n){e.streams.retrieve().then((function(e){return t(e)})).catch((function(e){return n(e)}))}))},d=function(e,t,n,o){return new Promise((function(s,a){e.messages.retrieve(o||{anchor:"newest",num_before:100,num_after:0,narrow:[{operator:"stream",operand:t},{operator:"topic",operand:n}]}).then((function(e){return s(e)})).catch((function(e){return a(e)}))}))},p=function(e,t,n){return new Promise((function(o,s){e.messages.retrieve(n||{anchor:"newest",num_before:100,num_after:0,narrow:[{operator:"stream",operand:t}]}).then((function(e){return o(e)})).catch((function(e){return s(e)}))}))},h=function(e,t){e.callOnEachEvent((function(e){return t(e)}),["message"],[{operator:"stream",operand:"chatty"}])},m=function(e){return new Promise((function(t,n){e.streams.subscriptions.retrieve().then((function(e){return t(e)})).catch((function(e){return n(e)}))}))},f=function(e,t){return new Promise((function(n,o){e.users.me.subscriptions.add({subscriptions:JSON.stringify([{name:t}])}).then((function(e){return n(e)})).catch((function(e){return o(e)}))}))},b=function(e,t){return new Promise((function(n,o){e.messages.send(t||{to:"chatty",type:"stream",topic:"content",content:"I come not, friends, to steal away your hearts."}).then((function(e){return n(e)})).catch((function(e){return o(e)}))}))},g={init:l,config:c,getStreams:u,getMsgs:d,getAllMsgs:p,listen:h,sendMsg:b,getSubs:m,addSub:f},y={zulip:g},w=(n("99af"),n("25f0"),n("f5b2"),{methods:{toEmojiCode:function(e){return e.replace(/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])/g,(function(e){return e.codePointAt(0).toString(16)}))},containsEmoji:function(e){var t=/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi;return t.test(e)}}}),v={name:"Styles",mixins:[w],computed:Object(a["a"])({},Object(r["c"])(["rules"])),data:function(){return{el:null}},methods:{generateStyleRules:function(){var e=this,t="";return this.rules.map((function(n){n.className.startsWith("@")?t+=n.className:(t+=".".concat(n.parentClassName," ").concat(n.className),e.containsEmoji(n.className)&&(t+=", .".concat(n.parentClassName," .u").concat(e.toEmojiCode(n.className)))),t+="{",n.rules.map((function(e){t+=e})),t+="}"})),t},createStyleElement:function(){var e=document.createElement("style");return e.innerText=this.generateStyleRules(),e}},mounted:function(){this.el=this.createStyleElement(),document.head.appendChild(this.el)},watch:{rules:function(){console.log("rules!");var e=this.createStyleElement();document.head.replaceChild(e,this.el),this.el=e}}},S=v,j={name:"App",components:{Styles:S},data:function(){return{api:y,zulipClient:null}},computed:Object(a["a"])({},Object(r["c"])(["isMobile","pubStr","currentStream","streams"])),created:function(){var e=this;this.$store.commit("setMobile",this.checkIfMobile()),window.addEventListener("resize",(function(){e.$store.commit("setMobile",e.checkIfMobile())})),this.getStreams(),this.$router.afterEach((function(t){e.$store.commit("setTopics",[]),e.$store.commit("setRules",[]),e.$store.commit("setCurStream",t.path.replace("/","")),""!=e.currentStream&&e.streams.find((function(t){return t.name==e.currentStream}))&&e.setUpDoc(e.currentStream)}))},methods:{checkIfMobile:function(){return window.innerWidth<700},getStreams:function(){var e=this;y.zulip.init().then((function(t){e.zulipClient=t,y.zulip.getStreams(t).then((function(t){e.$store.commit("setStreams",t.streams.filter((function(t){return t.name.startsWith(e.pubStr)})))})),y.zulip.listen(e.zulipClient,e.eventHandler)}))},setUpDoc:function(e){var t=this;y.zulip.getSubs(this.zulipClient).then((function(e){e.subscriptions.map((function(e){return e.name})).includes(t.currentStream)||y.zulip.addSub(t.zulipClient,t.currentStream)})),y.zulip.getAllMsgs(this.zulipClient,e).then((function(e){for(var n=0;n<e.messages.length;n++){var o=e.messages[n];"rules"==o.subject?t.$store.commit("addRule",o):t.$store.commit("addMessage",o)}}))},eventHandler:function(e){switch(console.log(e),e.type){case"message":switch(e.message.subject){case"content":this.$store.commit("addMessage",e.message);break;case"rules":this.$store.commit("addRule",e.message);break}break;case"delete_message":this.$store.commit("deleteMessage",e.message_id);break;case"update_message":this.$store.commit("editMessage",{mid:e.message_id,content:e.rendered_content});break;case"reaction":this.$store.commit("".concat(e.op,"Reaction"),{mid:e.message_id,reaction:{emoji_code:e.emoji_code,emoji_name:e.emoji_name,reaction_type:e.reaction_type}});break;default:console.log("Event type unknown",e.type)}}}};n("0591");j.render=s;var k=j,O=n("bc3a"),C=n.n(O),D=n("d4cd"),_=n.n(D),x=n("f03e"),T=n.n(x),B=n("6c02"),E={class:"controls"},z={for:"msg-data"},F=Object(o["createTextVNode"])(" Show chat message data"),I=Object(o["createVNode"])("p",{class:"notice"},[Object(o["createTextVNode"])(" Regrettably support for "),Object(o["createVNode"])("a",{href:"https://caniuse.com/css-paged-media"},"@page"),Object(o["createTextVNode"])(" is very poor in most browsers. Use Google Chrome for best results when printing or creating PDFs. ")],-1);function N(e,t,n,s,a,r){var i=Object(o["resolveComponent"])("Streams"),c=Object(o["resolveComponent"])("pane"),l=Object(o["resolveComponent"])("Content"),u=Object(o["resolveComponent"])("Rules"),d=Object(o["resolveComponent"])("splitpanes");return Object(o["openBlock"])(),Object(o["createBlock"])("div",{class:["pane-wrapper",r.classes]},[e.show_ui?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])("button",{key:0,onClick:t[1]||(t[1]=function(){return r.toggle_ui&&r.toggle_ui.apply(r,arguments)}),class:"float-btn ui"},Object(o["toDisplayString"])(e.show_ui?"Hide":"Show")+" UI ",1)),Object(o["createVNode"])(d,{class:"default-theme",onResize:r.resizer},{default:Object(o["withCtx"])((function(){return[e.show_ui?(Object(o["openBlock"])(),Object(o["createBlock"])(c,{key:0,class:"controls-pane",size:e.panel_sizes[0],"min-size":"5"},{default:Object(o["withCtx"])((function(){return[Object(o["createVNode"])(i),Object(o["createVNode"])("div",E,[Object(o["createVNode"])("button",{onClick:t[2]||(t[2]=function(){return r.toggle_ui&&r.toggle_ui.apply(r,arguments)})},Object(o["toDisplayString"])(e.show_ui?"Hide":"Show")+" UI",1),Object(o["createVNode"])("button",{onClick:t[3]||(t[3]=function(){return r.print&&r.print.apply(r,arguments)})},"Print"),Object(o["createVNode"])("label",z,[Object(o["withDirectives"])(Object(o["createVNode"])("input",{type:"checkbox",id:"msg-data",value:"1","onUpdate:modelValue":t[4]||(t[4]=function(t){return e.show_message_data=t})},null,512),[[o["vModelCheckbox"],e.show_message_data]]),F]),I])]})),_:1},8,["size"])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(c,{size:e.panel_sizes[1],class:r.currentStream},{default:Object(o["withCtx"])((function(){return[Object(o["createVNode"])(l,{print:!e.show_ui||e.expand_content,show_message_data:e.show_message_data,ref:"content"},null,8,["print","show_message_data"])]})),_:1},8,["size","class"]),e.show_ui?(Object(o["openBlock"])(),Object(o["createBlock"])(c,{key:1,size:e.panel_sizes[2],"min-size":"15"},{default:Object(o["withCtx"])((function(){return[Object(o["createVNode"])(u)]})),_:1},8,["size"])):Object(o["createCommentVNode"])("",!0)]})),_:1},8,["onResize"])],2)}var A=Object(o["withScopeId"])("data-v-4514be34");Object(o["pushScopeId"])("data-v-4514be34");var M={class:"streams"};Object(o["popScopeId"])();var P=A((function(e,t,n,s,a,r){var i=Object(o["resolveComponent"])("Stream");return Object(o["openBlock"])(),Object(o["createBlock"])("section",M,[(Object(o["openBlock"])(!0),Object(o["createBlock"])(o["Fragment"],null,Object(o["renderList"])(e.streams,(function(e){return Object(o["openBlock"])(),Object(o["createBlock"])(i,{key:e.id,stream:e},null,8,["stream"])})),128))])})),V=Object(o["withScopeId"])("data-v-1af39708");Object(o["pushScopeId"])("data-v-1af39708");var W={class:"name"};Object(o["popScopeId"])();var H=V((function(e,t,n,s,a,r){var i=Object(o["resolveComponent"])("router-link");return Object(o["openBlock"])(),Object(o["createBlock"])("div",{class:{selected:r.selected}},[Object(o["createVNode"])("p",W,[Object(o["createVNode"])(i,{to:n.stream.name},{default:V((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(n.stream.name),1)]})),_:1},8,["to"])])],2)})),L={name:"Stream",props:["stream"],computed:{selected:function(){return this.$store.state.currentStream==this.stream.name}}};n("eebe");L.render=H,L.__scopeId="data-v-1af39708";var U=L,R={name:"Streams",components:{Stream:U},computed:Object(a["a"])({},Object(r["c"])(["streams"]))};n("07c0");R.render=P,R.__scopeId="data-v-4514be34";var $=R,Z=Object(o["withScopeId"])("data-v-d26c0b34");Object(o["pushScopeId"])("data-v-d26c0b34");var q={id:"content"},G={class:"title"};Object(o["popScopeId"])();var Y=Z((function(e,t,n,s,a,r){var i=Object(o["resolveComponent"])("Chapter");return Object(o["openBlock"])(),Object(o["createBlock"])("section",q,[Object(o["createVNode"])("h1",G,Object(o["toDisplayString"])(r.title),1),(Object(o["openBlock"])(!0),Object(o["createBlock"])(o["Fragment"],null,Object(o["renderList"])(e.sortedTopics,(function(e){return Object(o["openBlock"])(),Object(o["createBlock"])(i,{key:e.title,topic:e,print:n.print,show_message_data:n.show_message_data},null,8,["topic","print","show_message_data"])})),128))])})),J=Object(o["withScopeId"])("data-v-7e8936f3");Object(o["pushScopeId"])("data-v-7e8936f3");var K={key:0},Q=Object(o["createVNode"])("span",null," ",-1),X=Object(o["createVNode"])("div",{style:{float:"none"}},[Object(o["createVNode"])("div",{style:{"page-break-after":"always"}})],-1);Object(o["popScopeId"])();var ee=J((function(e,t,n,s,a,r){var i=Object(o["resolveComponent"])("Message");return Object(o["openBlock"])(),Object(o["createBlock"])("div",{class:["body",n.topic.title]},[Object(o["createVNode"])("h3",{onClick:t[1]||(t[1]=function(e){return a.desiresContent=!a.desiresContent}),class:"header"},[Object(o["createVNode"])("span",{class:"expandToggle",innerHTML:r.toggleSymbol},null,8,["innerHTML"]),Object(o["createVNode"])("span",null,Object(o["toDisplayString"])(n.topic.title),1)]),a.desiresContent||n.print?(Object(o["openBlock"])(),Object(o["createBlock"])("div",K,[(Object(o["openBlock"])(!0),Object(o["createBlock"])(o["Fragment"],null,Object(o["renderList"])(r.messagesToShow,(function(e){return Object(o["openBlock"])(),Object(o["createBlock"])("span",{key:e.id},[Object(o["createVNode"])(i,{message:e,show_message_data:n.show_message_data},null,8,["message","show_message_data"]),Q])})),128))])):Object(o["createCommentVNode"])("",!0),X],2)})),te=(n("f6d6"),{class:"message-outer"}),ne={key:0,class:"message-data"},oe={class:"from"},se={class:"time"},ae={key:1,class:"message-data-reactions"},re={class:"reactions ui"};function ie(e,t,n,s,a,r){var i=Object(o["resolveComponent"])("vue3-markdown-it");return Object(o["openBlock"])(),Object(o["createBlock"])("div",te,[n.show_message_data?(Object(o["openBlock"])(),Object(o["createBlock"])("div",ne,[Object(o["createVNode"])("div",oe,Object(o["toDisplayString"])(n.message.sender_full_name),1),Object(o["createVNode"])("div",se,Object(o["toDisplayString"])(r.time),1)])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])("div",{class:[r.classes,"message"]},[Object(o["createVNode"])(i,Object(o["mergeProps"])({source:r.content},e.$mdOpts),null,16,["source"])],2),n.show_message_data?(Object(o["openBlock"])(),Object(o["createBlock"])("div",ae,[(Object(o["openBlock"])(!0),Object(o["createBlock"])(o["Fragment"],null,Object(o["renderList"])(n.message.reactions,(function(e){return Object(o["openBlock"])(),Object(o["createBlock"])("span",{class:"reaction",key:e},Object(o["toDisplayString"])(String.fromCodePoint("0x"+e.emoji_code)),1)})),128))])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])("div",re,[(Object(o["openBlock"])(!0),Object(o["createBlock"])(o["Fragment"],null,Object(o["renderList"])(r.reactions,(function(e){return Object(o["openBlock"])(),Object(o["createBlock"])(o["Fragment"],{key:e},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e),1)],64)})),128))])])}n("159b"),n("a15b");var ce=n("edbf"),le=new ce,ue={name:"Message",props:["message","show_message_data"],mixins:[w],computed:{rawJSON:function(){return"```json\n"+JSON.stringify(this.message,null,2)+"\n```"},content:function(){var e=this,t="https://chat.hackersanddesigners.nl",n=this.message.content.replace("\n","<br/>");n=n.replaceAll('src="','src="'+t),n=n.replaceAll('href="/','href="'+t+"/");var o=this.$store.state.topics.find((function(t){return t.title==e.message.subject})).messages.filter((function(t){return t.responseTo&&t.responseTo.id==e.message.id&&t.responseTo.sender_id==e.message.sender_id&&e.message.content.includes(t.responseTo.quote)}));return console.log(n,o),o.forEach((function(e){var t=e.reactions.map((function(e){return"u"+e.emoji_code})).join(" ");n=n.replace(e.responseTo.quote,'<span class="'.concat(t,'">').concat(e.responseTo.quote,"</span>")),console.log(n)})),n},reactions:function(){return this.message.reactions.map((function(e){return le.replace_colons(":"+e.emoji_name+":")}))},classes:function(){return this.message.reactions.map((function(e){return"u"+e.emoji_code}))},time:function(){var e=this.message.timestamp,t=1e3*e,n=new Date(t);return n.toLocaleString()}},created:function(){}};n("c4b5");ue.render=ie;var de=ue,pe={name:"Chapter",components:{Message:de},data:function(){return{desiresContent:!1}},props:["topic","print","show_message_data"],computed:{toggleSymbol:function(){var e="";return this.print||(e=this.desiresContent?"▼ ":"► "),e},messagesToShow:function(){return this.topic.messages.filter((function(e){return!e.responseTo}))}}};n("3d50");pe.render=ee,pe.__scopeId="data-v-7e8936f3";var he=pe,me={name:"Content",components:{Chapter:he},computed:Object(a["a"])(Object(a["a"])(Object(a["a"])({},Object(r["c"])(["currentStream","streams"])),Object(r["b"])(["sortedTopics"])),{},{title:function(){var e=this;return this.streams.find((function(t){return t.name==e.currentStream}))?this.currentStream.replace("pub-",""):"Stream does not exist."}}),methods:{},props:["print","show_message_data"]};n("e8931");me.render=Y,me.__scopeId="data-v-d26c0b34";var fe=me,be=Object(o["withScopeId"])("data-v-16b43aee");Object(o["pushScopeId"])("data-v-16b43aee");var ge={class:"rules"};Object(o["popScopeId"])();var ye=be((function(e,t,n,s,a,r){var i=Object(o["resolveComponent"])("Rule");return Object(o["openBlock"])(),Object(o["createBlock"])("section",ge,[(Object(o["openBlock"])(!0),Object(o["createBlock"])(o["Fragment"],null,Object(o["renderList"])(e.rules,(function(e){return Object(o["openBlock"])(),Object(o["createBlock"])(i,{key:e.id,rule:e},null,8,["rule"])})),128))])})),we=Object(o["withScopeId"])("data-v-497ad388");Object(o["pushScopeId"])("data-v-497ad388");var ve=Object(o["createVNode"])("p",null,"}",-1);Object(o["popScopeId"])();var Se=we((function(e,t,n,s,a,r){return Object(o["openBlock"])(),Object(o["createBlock"])("div",{class:"rule",style:n.rule.rules},[Object(o["createVNode"])("p",{title:e.toEmojiCode(n.rule.className)},Object(o["toDisplayString"])(n.rule.className)+" {",9,["title"]),(Object(o["openBlock"])(!0),Object(o["createBlock"])(o["Fragment"],null,Object(o["renderList"])(n.rule.rules,(function(e){return Object(o["openBlock"])(),Object(o["createBlock"])("p",{key:e}," "+Object(o["toDisplayString"])(e),1)})),128)),ve],4)})),je={name:"Rule",mixins:[w],props:["rule"],computed:{}};n("3d57");je.render=Se,je.__scopeId="data-v-497ad388";var ke=je,Oe={name:"Rules",components:{Rule:ke},computed:Object(a["a"])({},Object(r["c"])(["rules"])),watch:{rules:function(){console.log("rules")}}};n("5476");Oe.render=ye,Oe.__scopeId="data-v-16b43aee";var Ce=Oe,De=n("512e"),_e=(n("c1ea"),n("676e")),xe={name:"Home",components:{Streams:$,Content:fe,Rules:Ce,Splitpanes:De["Splitpanes"],Pane:De["Pane"]},setup:function(){var e=Object(o["ref"])(null);return Object(o["onMounted"])((function(){console.log("preview",e.value)})),{preview:e}},data:function(){return{show_ui:!0,show_message_data:!1,panel_sizes:{0:10,1:55,2:35},expand_content:!1}},computed:{classes:function(){return this.show_ui?"ui":"print"},currentStream:function(){return this.$store.state.currentStream}},methods:{resizer:function(e){for(var t=0;t<e.length;t++)this.panel_sizes[t]=e[t].size},print:function(){var e=this,t=this.show_ui;this.toggle_ui(null,!1),setTimeout((function(){window.print(),t&&e.toggle_ui(null,!0)}),1e3)},print_preview:function(){this.expand_content=!0;var e=document.getElementById("content"),t=new _e["Previewer"];t.preview(e,["path/to/css/file.css"],this.preview).then((function(e){console.log("Rendered",e.total,"pages.")}))},toggle_ui:function(e,t){this.show_ui=void 0!==t?t:!this.show_ui,this.$forceUpdate()}}};n("c06e");xe.render=N;var Te=xe,Be={class:"docs"},Ee=Object(o["createTextVNode"])("Back to Chattypub"),ze={key:0};function Fe(e,t,n,s,a,r){var i=Object(o["resolveComponent"])("router-link"),c=Object(o["resolveComponent"])("vue3-markdown-it");return Object(o["openBlock"])(),Object(o["createBlock"])("div",Be,[Object(o["createVNode"])("ul",null,[Object(o["createVNode"])("li",null,[Object(o["createVNode"])(i,{to:"/"},{default:Object(o["withCtx"])((function(){return[Ee]})),_:1})]),(Object(o["openBlock"])(!0),Object(o["createBlock"])(o["Fragment"],null,Object(o["renderList"])(a.files,(function(e,t){return Object(o["openBlock"])(),Object(o["createBlock"])("li",{key:t},[Object(o["createVNode"])("a",{href:"#"+t,onClick:function(e){return r.select(t)}},Object(o["toDisplayString"])(t),9,["href","onClick"])])})),128))]),a.selected?(Object(o["openBlock"])(),Object(o["createBlock"])("div",ze,[Object(o["createVNode"])(c,{source:r.source,html:!0,onClickCapture:r.clickEvent},null,8,["source","onClickCapture"])])):Object(o["createCommentVNode"])("",!0)])}n("4d63"),n("466d"),n("fb6a");var Ie="# CSS\n\nIn this document we take a look at what CSS is and how it can be applied to a publication in **Chatty-pub**.\n\n- [What is CSS](#what-is-css)\n- [Rules](#rules)\n- [Css in chatty-pub](#css-in-chatty-pub)\n- [Print settings](#print-settings)\n- [Typing Emoji](#typing-emoji)\n\n---\n\n## What is CSS?\n\nCSS (Cascading Style Sheets) is the language that allows you to style and layout HTML web pages. This article explains what CSS is, with some simple syntax examples, and also covers some key terms about the language.\n\nSince this document relates specifically to **Chatty-pub**, the focus is going to be on the parts of the language that are supported by this platform. Because CSS is specifically oriented towards styling HTML (and related languages like SVG and XML) you have to have a basic understanding of HTML.<sup>[1](#footnote1)</sup> Mozilla has an excellent [HTML introduction](https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started).\n\nAt its heart, HTML is a fairly simple language made up of elements, which can be applied to pieces of text to give them different meaning in a document (Is it a paragraph? Is it a bulleted list? Is it part of a table?), structure a document into logical sections (Does it have a header? Three columns of content? A navigation menu?), and embed content such as images and videos into a page.\nBut what HTML does not do is speficy how these elements should look. That is where CSS comes in.\n\nCSS can be used for very basic document text styling — for example changing the color and size of headings and links. It can be used to create layout — for example turning a single column of text into a layout with a main content area and a sidebar for related information. It can even be used for effects such as animation.\nIn Chatty-pub we're mostly interested in the first part.\n\n---\n\n## Rules\n\n#### _Elements and Classes_\n\nIn this section we will talk about CSS in general. Chatty-pub uses a slight variation on it, but let's start with the basics.\n\nCSS is a rule-based language — you define rules specifying groups of styles that should be applied to particular elements or groups of elements on your web page. For example \"I want the main heading on my page to be shown as large red text.\"\n\nThe following code shows a very simple CSS rule that would achieve the styling described above:\n\n```css\nh1 {\n color: red;\n font-size: 20px;\n}\n```\n\nThe rule opens with a selector. This selects the HTML element that we are going to style. In this case we are styling all level one headings (`<h1>`) that appear on the page.\n\nWe then have a set of curly braces `{` `}`. Inside those will be one or more declarations, which take the form of property and value pairs. Each pair specifies a property of the element(s) we are selecting, then a value that we'd like to give the property. Each pair is followed by a semi-colon `;` to indicate the end of the property.\n\nBefore the colon, we have the property, and after the colon, the value. CSS properties have different allowable values, depending on which property is being specified. In our example, we have the color property, which can take various color values. We also have the font-size property. This property can take various size units as a value.\n\nThe example above will style all the `H1` elements on the page. You could also write a selector for all paragraphs (the selector would be `p`), images (`img`) or list items (`li`). This works as long as you want all of the elements of that type in your document to look the same. Most of the time that isn't the case and so you will need to find a way to select a subset of the elements without changing the others. The most common way to do this is to add a class to your HTML element and target that class.\n\nTake this HTML:\n\n```html\n<ul>\n <li>Item one</li>\n <li class=\"special\">Item two</li>\n <li>Item <em>three</em></li>\n</ul>\n```\n\nTo target the class of special you can create a selector that starts with a full stop character.\n\n```css\n.special {\n color: orange;\n font-weight: bold;\n}\n```\n\nThe peroid character in front of special tells the browser that we're creating a class selector.\nYou can apply the class of special to any element on your page that you want to have the same look as this list item.\n\n### Units\n\nIn the `h1` example above, we set the following property: `font-size: 20px;`. This will set the font-size of all H1 headers to 20 pixels. But pixels are not the only units available. Some examples:\n\n- `em` and `rem` - these relative units declare a size dependant on the font-size of the context they get used in. This can be a bit confusing if you're not used to it. Feel free to replace it with on of the values below.\n- `px` - Pixels.\n- `cm` and `in` - centimeters and inches. These units are mostly relevant in print context.\n- `vw` and `vh` - so called viewport units, 100vw is exactly the height of the viewport (the part of the browser that shows the webpage). `vh` is the same, but for the height of the browser.\n- `rgba(r,g,b,a)` strictly speaking not a unit but a function, but it sets the color and transparency of the foreground.\n\n[More information on units](https://www.w3.org/Style/Examples/007/units.en.html).\n\n---\n\n## CSS in Chatty-pub\n\nWhen you react to a message in Zulip with an emoji, this emoji gets turned into a class in **Chatty-pub**. So lets say you responded to a message with the strawberry 🍓 emoji. In **Chatty-Pub** the message will have class with that emoji as selector. (You can confirm this by rolling over the message, the emoji should popup on a overlay.) So now to style that message, you go to the #rules channel and add a message with the following content:\n\n```css\n🍓 {\n color: red;\n}\n```\n\nIt is very similar to the examples above. `🍓` is the selector, so the rule will apply to each message with a strawberry reaction. Then follows the block `{` and `}`. And in the block, there is property, `color: red;`.\n\n_A small difference with regular CSS is that you don't need to add the period in front of the selector **Chatty-pub** will handle that for you._\n\nBecause of the way Zulip handles the emoji reactions, not all emoji are available or sometimes they don't exactly correspond to the emoji you might type in the #rules channel. To help with sorting this out you can roll over a message in **Chatty-pub** and see the reactions that are applied. Sometimes the translation is unavailable, in that case you'll see something like `:working_on_it:` instead of the emoji you expected. In that case remove your reaction and find an other emoji that does work.\n\n### About formatting\n\nYou can't enter a tab character in Zulip and the indentation before the property in the rule isn't absolutely necessary. So feel free to leave it out. If you absolutely want to have the indentation, you could write the rule in your favorite editor and copy and paste it into Zulip. If you only want to style a single property you could have the whole rule on a single line like this: `🌕 { box-shadow: 0 0 20px rgba(255,0,0,0.5); }`,\n\n_Don't forget the semi-colon at the end of the property line!_\n\n### Advanced CSS\n\n**Selecting HTML elements and other style rules**\n\nThe reaction/emoji method described above allows to make quick modifications to the style and layout of your publication. But besides this **Chatty-pub** also allows you to style html elements like in regular CSS. To do this just enter your style rule. This snippet will give all HTML links a pink background color:\n\n```css\na {\n background-color: pink;\n}\n```\n\nYou should be able to enter all regular CSS rules this way.\n\n**Bypassing the parser** -_Work in progress_-\n\nIt is possible to bypass the parser and add arbitrary code to the CSS on the page. This allows you to add, for example, `@key` or media queries. To do this send any message to the #rules channel and wrap the message in three backticks like this:\n\n<code>\n```\n@keyframes example {\n from {background-color: red;}\n to {background-color: yellow;}\n}\n```\n</code>\n\n---\n\n## Print settings\n\nTo set the paper size we can use the special selector `@page`. The following snippet set the page size to A5.\n\n```css\n@page {\n size: 148mm 210mm;\n}\n```\n\nRegrettably [browser support](https://caniuse.com/css-paged-media) for `@page` is spotty. Currently only Google Chrome will allow you to set page sizes etc.\n\n[Pagedmedia.org](https://www.pagedmedia.org/pagedjs-sneak-peeks/) has an excellent explanation on using `@page`. The [Paged media module](https://developer.mozilla.org/en-US/docs/Web/CSS/Paged_Media) at Mozilla also.\n\nIt may be necessary to use the methods described under [Advanced CSS](#advanced-css) above to enter these rules.\n\n## List of common and handy CSS properties\n\nThere are hundreds of CSS properties. Below is a small selection of some basic properties mostly focussed on layout and type representation, grouped by module.\n\n### Backgrounds and borders\n\n- [background-color](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color)\n- [border](https://developer.mozilla.org/en-US/docs/Web/CSS/border) - The border CSS property sets an element's border.\n- [border-radius](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius) - The border-radius CSS property rounds the corners of an element's outer border edge.\n- [box-shadow](https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow) - The box-shadow CSS property adds shadow effects around an element's frame.\n\n### Color\n\n- [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) - The color CSS property sets the foreground color value of an element's text and text decorations.\n- [opacity](https://developer.mozilla.org/en-US/docs/Web/CSS/opacity) - The opacity CSS property sets the opacity of an element. Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency.\n\nA colors value can defined in multiple ways:\n\n- By [name/keyword](http://web.simmons.edu/~grovesd/comm244/notes/week3/css-colors#keywords) - `color: red;` will make your text red.\n- By [hex value](http://web.simmons.edu/~grovesd/comm244/notes/week3/css-colors#hex) - `color: #ff0000;` also red.\n- Or as a [function](http://web.simmons.edu/~grovesd/comm244/notes/week3/css-colors#rgba), which allows transparency. - `color: rgba(255,0,0,0.5);` red, but 50% transparent.\n\n### Box model\n\n- [margin](https://developer.mozilla.org/en-US/docs/Web/CSS/margin) - The margin property sets the margin area on all four sides of an element. Margin refers to space between different elements.\n- [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding) - The padding property sets the padding area on all four sides of an element at once. Padding refers to the spacing inside the border of an element.\n\n### Fonts\n\n- [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) - The font-family CSS property specifies a prioritized list of one or more font family names and/or generic family names for the selected element.\n\nYou can choose one of the following generic fonts. Which exact font will be used is dependant on your computers' settings.\n\n```css\nfont-family: serif;\nfont-family: sans-serif;\nfont-family: monospace;\nfont-family: cursive;\nfont-family: fantasy;\n```\n\nIt is also possible to specify an exact font name, but it will only be used if it is actually available on your system.\nFor example following statement will try to use Helvetica if available, but will fallback on a generic sans-serif font if not.\n\n```css\nfont-family: \"Helvetica Neue\", sans-serif;\n```\n\n(Note the quotes around the font name)\n\nWe have not yet implemented a way to upload and use fonts. Working on it!\n\n- [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size) - The font-size CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative <length> units, such as em, ex, and so forth.\n- [font-style](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style) - The font-style CSS property sets whether a font should be styled with a normal, italic, or oblique face from its font-family.\n- [font-weigh](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight) - The font-weight CSS property sets the weight (or boldness) of the font. The weights available depend on the font-family that is currently set.\n- [line-height](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height) - The line-height CSS property sets the height of a line box. It's commonly used to set the distance between lines of text.\n\n### Text\n\n- [letter-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) - The letter-spacing CSS property sets the horizontal spacing behavior between text characters.\n- [text-align](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) - The text-align CSS property sets the horizontal alignment of the content inside a block element.\n- [text-transform](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform) - The text-transform CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized.\n- [white-space](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space) - The white-space CSS property sets how white space inside an element is handled.\n- [word-break](https://developer.mozilla.org/en-US/docs/Web/CSS/word-break) - The word-break CSS property sets whether line breaks appear wherever the text would otherwise overflow its content box.\n- [word-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/word-spacing) - The word-spacing CSS property sets the length of space between words and between tags.\n\n### Transforms\n\n- [rotate](https://developer.mozilla.org/en-US/docs/Web/CSS/rotate) - The rotate CSS property allows you to specify rotation of elements\n- [scale](https://developer.mozilla.org/en-US/docs/Web/CSS/scale) - The scale CSS property allows you to specify the scale (size) of elements\n- [translate](https://developer.mozilla.org/en-US/docs/Web/CSS/translate) - The translate CSS property allows you to specify translation transforms (position relative to where it originally was) of elements.\n\n## Typing Emoji\n\n- [Windows](https://support.microsoft.com/en-us/windows/windows-10-keyboard-tips-and-tricks-588e0b72-0fff-6d3f-aeee-6e5116097942)\n- [Mac](https://www.howtogeek.com/684025/how-to-type-emoji-on-your-mac-with-a-keyboard-shortcut/)\n- Linux varies per distribution. If you run Linux you're probably capable of finding out how :)\n\n<a name=\"footnote1\">1</a>: I've borrowed shamelessly from Mozilla to make this text: https://developer.mozilla.org/en-US/docs/Learn/CSS/First_steps/What_is_CSS and https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML\n",Ne='# ChattyPub Workshop Script\n\n## Introduction\n\nChattyPub is a design tool in the making – leveraging a chat interface to apply styles and formats to the content of a publication.\n\nThe workshop will explore in a practical manner how the process of co-designing a publication can unfold, specifically when several people are working at the same time using a chat interface as the main design tool. During HDSA2021 we would like to open up the process of making this tool and explore together its possibilities and limitations. The workshop will take place towards the end of the one-week summer academy program. Thus, we will be able to use some of the documentation produced during the week — workshops scripts, prototypes, game cards, recipes, ... as well as conversations we will have on different platforms – synchronously and asynchronously.\n\nCommands allow you to style the texts and images, but someone else can change their appearance again later! How will we negotiate these design decisions synchronously and asynchronously? The outcome could be a zine, posters or a webpage.\n\nThis script aims to provide the necessary instructions to host a workshop around ChattyPub that can accomodate different skills and knowledges in different contexts.\n\n## Goals\n\n- Learn to collaboratively write, design, and print documents using ChattyPub\n- Produce publications of / relating to HDSA2021 (documentation, prototypes, conversations, etc...)\n- Learn and/or practice styling with CSS & Emojis\n\n## Requirements\n\n- a computer, web-browser, and connection to the internet\n- an account for the Hackers & Designers Zulip instance: https://chat.hackersanddesigners.nl/\n- a printer\n\n## Preparation\n\nBefore the summer academy: Most important is for all workshop participants to set up a Zulip account on our server. The H&D zulip instance can be found at https://chat.hackersanddesigners.nl/ (public sign ups are temporariy open).\n\nOn the first day of the summer academy (monday): Participants are introduced to the Zulip interface and instructed to use it for communication during the course of the week. Zulip makes use of a rather unconventional (but powerful) chat-threading logic, so it would be good to spend some time interacting with it and settle into this new environment.\n\nWorkshop hosts and participants are encouraged to think about how they would like to document their processes during the summer academy. What is included and what isn\'t? How is this shared? Is there a regular moment during the day dedicated to documentation or is it more ad-hoc? We suggest using Etherpad for collaborative note taking, and regularly making screenshots or screenrecordings and photos. We have previously compiled a so-called "tool-ecology", a list of tools we have good experiences with and recommend using during the summer academy: https://etherpad.hackersanddesigners.nl/p/hdsa2021-tool-ecology.\n\nTexts, notes, chats, images, and screenshots will make great material for our workshop.\n\n## How It Works\n\n### Zulip\n\nOn Zulip, conversations are categorized into different "Streams", which are comparable to "channels" in other messaging services like Discord. Streams can be public or private and host conversations consisting of text, images, files, reactions, etc..\n\nWhat differentiates Zulip from most messaging platforms is the way streams are sub-threaded. Zulip introduces the concept of "Topics", which, in the plainest terms, means that messages have subjects. When sending a message to a stream in Zulip, you can also specify the topic of the message and the stream automatically filters messages by their shared topics. If your message\'s topic doesn\'t exist yet, it will be created when you send your message.\n\nZulip allows you to react to messages using emoji\'s as well. We will make heavy use of emojis during this workshop.\n\nThere are several ways to engage with Zulip, including a web-client, a desktop app, and a mobile app.\n\n### ChattyPub\n\nhttp://chattypub.hackersanddesigners.nl\n\nChattyPub is a website that acts as a different interface to the same Zulip service. ChattyPub takes a stream from Zulip, combines messages into long-form articles and uses a design system combining Emojis and CSS syntax to style the messages, effectively turning the stream into a (printable!) webpage.\n\n## Making a publication with Zulip & ChattyPub\n\n### Content\n\n1. Create a stream on Zulip\n - Ensure that the stream name starts with `pub-`.\n - Ensure that the stream is public.\n2. Go to [ChattyPub](https://chattypub.hackersanddesigners.nl). The stream you created will be visible on the left-side navigation.\n3. Click on your stream.\n4. The main (middle) section of the website will have:\n - Your stream name (which will be the name of your publication)\n - The topics of your stream (which will act as "Chapters" in your publication)\n - Topics are collapsed by default, click the expand button next to a topic to display it\'s messages as an article.\n5. To create a new topic (chapter), return to Zulip and type a message to your stream, making sure to send it to the topic you want to create.\n\n### Rules\n\nThe right-hand side of the ChattyPub interface is reserved for one topic in your stream: "rules". This topic will house definitions for styles you want to apply to messages in your stream.\n\nGo back to Zulip and create the topic in your stream called "rules".\n\nEvery message you send to this topic should consist of a single emoji followed by a set of styles you\'d like applied to messages. For example:\n\n```CSS\n🍓 {\n color: red;\n text-decoration: underline;\n}\n```\n\nThese messages should be unique and follow the CSS syntax, as described in the [introduction to CSS](https://github.com/hackersanddesigners/chatty-pub/blob/master/front/docs/CSS.md). If you are comfortable with CSS, you can skip to the part of the document that describes [how CSS is used in ChattyPub](https://github.com/hackersanddesigners/chatty-pub/blob/master/front/docs/CSS.md#css-in-chatty-pub).\n\nTo apply these styles to the contents of your publication, head back to any other topic in your stream, select a message you\'d like to style, and react to it with the emoji whose styles you want to apply. On ChattyPub, the message should be rendered with these styles.\n\nIf you\'d like to style only a part of a message, select the message in Zulip and quote and respond to it (in the 3-dot menu). This will produce a text in your input box on the bottom of the interface. Delete the parts of the quoted message that you don\'t want the styles applied to, and send your response. When you react with an emoji to your own response, the part of the message you quoted will inherit the styles defined for that emoji.\n\nKeep in mind that you can edit your own messages! So if you make a mistake (forgetting the semi-colon at the end of a statement is a common one), roll over your message and click the little pen at the top righthand side of the message.\n\n### Printing\n\nTBD\n\n## Workshop\n\nThe workshop is split over two sessions (over two days) of 4 hours each.\n\n_Opening Session: Introductions & first encounters with ChattyPub_\n\n- Introductory presentation ( 1hr ) -- will be livestreamed in the morning / recorded and shared afterwards.\n - Context and background on H&D\'s publishing activities (Anja & Juliette)\n - Introduction to ChattyPub (Karl).\n - Introduction to CSS (Heerko).\n - How it all comes together (emojis ;])(Karl)\n- Experimenting with ChattyPub! ( 2 hrs ) [How are people going to do this asynchronously? it needs maybe more direction and steps from here]+1\n - all levels of technical knowledge should be accommodated\n - general knowledge and detailed instructions about CSS can be found [here](https://github.com/hackersanddesigners/chatty-pub/blob/master/front/docs/CSS.md)\n - it\'s reccommended to group together participants with different levels of experience with CSS\n- Brainstorm Session (1 hr) [also for the brainstorm it would be nice to add some suggestions for how to do this if you are not in Amsterdam and maybe not even togeter in a room.]\n - in groups of 2-3, participants brainstorm publications they will make during the main session [Is this brainstorm about content? or about the negotiation process for the layout? can we come up with a format for the brainstorm or some questions as an aid?]\n - If you are planning to print your publication, take into account the printing limitations of your home printer or local print shop [take into account in what way? regarding the format? will i need to adjust something in the css? or in regards to bw/color? ]\n\n_Main Session: Chat => Print_\n\n- Making publications ( 2 hrs )\n - Groups work on the publications planned in the previous session [how? will there be channels prepared? are people making their own channels?]\n - Organizers are available to help where needed [who are the organizers? in vienna and pittsburgh people will be online on their own.. how do they prepare for that?]\n- Printing Publications ( 1 hr )\n - A printer is required in the space (or easily accessible)\n - Accommodating for different paper sizes is an added bonus\n - Binding could be fun too\n- Sharing outcomes and reflections ( 1 hr ) [add link and time in different time zones]\n - Round of publications\n - Reflection on process\n - Feedback on ChattyPub\n',Ae={name:"Docs",components:[T.a],data:function(){return{files:{Workshop:Ne,CSS:Ie},selected:""}},computed:{source:function(){return this.files[this.selected]}},methods:{select:function(e){this.selected=e},clickEvent:function(e){console.log(e);var t=new RegExp("[^.]+$"),n=e.explicitOriginalTarget.href,o=n.match(t);if(o.includes("md")){var s=this.getFileName(n);s in this.files&&(this.selected=s,e.preventDefault())}return!1},getFileName:function(e,t){var n=e&&"function"===typeof e.match&&e.match(/\/?([^/.]*)\.?([^/]*)$/);return n?t&&n.length>2&&n[2]?n.slice(1).join("."):n[1]:null}}};n("fa5e");Ae.render=Fe;var Me=Ae,Pe="/",Ve=Object(B["a"])({history:Object(B["b"])(Pe),routes:[{path:"/",name:"Home",component:Te},{path:"/docs",name:"Docs",component:Me},{path:"/:pathMatch(.*)*",name:"Home",component:Te}]}),We=n("2909"),He=n("9558"),Le=(n("a1f0"),n("a630"),n("3ca3"),n("1276"),n("a434"),n("0481"),n("4e82"),n("cd8a")),Ue=n("edbf"),Re=new Ue,$e=function(e,t){var n="",o="",s=[],a=t,r=e.id,i=Object(He["a"])(/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]?(.+)[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\n?\{\n?((.*;\n?)+)\}/gm,{selector:1,props:2}),c=Object(Le["stripHtml"])(e.content).result,l=c.matchAll(i);return l=Array.from(l),l.length>0?(n=Re.replace_colons(l[0]["groups"]["selector"]),w.methods.containsEmoji(n)&&(o=w.methods.toEmojiCode(n)),s=l[0]["groups"]["props"].split("\n"),s=s.filter((function(e){return Ze(e)})),{className:n,emoji_code:o,rules:s,parentClassName:a,id:r}):null},Ze=function(e){return e.match(/.+:.+;/gm)},qe=function(e){e.responseTo={id:e.content.replace(/.*\/near\//gm,"").replace(/\):.*[^]+/gm,""),sender_id:e.content.replace(/@_\*\*.*\|/gm,"").replace(/\*\*.\[said\].*[^]+/gm,""),quote:e.content.replace(/[^]+.*```quote\n/gm,"").replace(/ \n```/gm,"")}},Ge=function(e){e.responseTo={id:e.content.replace(/.*\/near\//gm,"").replace(/".*[^]+/gm,""),sender_id:e.content.replace(/[^]+data-user-id="/gm,"").replace(/">[^]+/gm,""),quote:e.content.replace(/.*[^]+<\/p>\n<blockquote>\n<p>/gm,"").replace(/<\/p>\n<\/blockquote>/gm,"")},console.log(e.responseTo)},Ye=Object(r["a"])({strict:!1,state:{isMobile:!1,streams:[],currentStream:"",rules:[],topics:[],pubStr:"pub-"},mutations:{setMobile:function(e,t){return e.isMobile=t},setStreams:function(e,t){return e.streams=t},setCurStream:function(e,t){return e.currentStream=t},setTopics:function(e,t){return e.topics=t},addMessage:function(e,t){if(t.display_recipient==e.currentStream){t.content.startsWith("@_**")?qe(t):t.content.includes("user-mention")&&t.content.includes("blockquote")&&Ge(t);var n=e.topics.find((function(e){return e.title==t.subject}));n?n.messages.push(t):e.topics.push({title:t.subject,messages:[t]})}},deleteMessage:function(e,t){var n=t.mid,o=t.subject,s=e.topics.find((function(e){return e.title==o}));if(s){var a=s.messages.find((function(e){return e.id==n}));a&&s.messages.splice(s.messages.indexOf(a),1)}},addReaction:function(e,t){var n=t.mid,o=t.reaction,s=e.topics.map((function(e){return e.messages})).flat().find((function(e){return e.id==n}));s&&s.reactions.push(o)},removeReaction:function(e,t){var n=t.mid,o=t.reaction,s=e.topics.map((function(e){return e.messages})).flat().find((function(e){return e.id==n}));s&&s.reactions.splice(s.reactions.indexOf(o),1)},setRules:function(e,t){e.rules=t.reduce((function(t,n){var o=$e(n,e.currentStream);return null!==o&&t.push(o),t}),[])},addRule:function(e,t){null!==$e(t)&&(e.rules=[].concat(Object(We["a"])(e.rules),[$e(t,e.currentStream)]))},editMessage:function(e,t){var n=t.mid,o=t.content,s=e.topics.map((function(e){return e.messages})).flat().find((function(e){return e.id==n})),a=e.rules.find((function(e){return e.id==n}));if(s)s.content=o,s.content.startsWith("@_**")?qe(s):s.content.includes("user-mention")&&s.content.includes("blockquote")&&Ge(s);else if(a){var r=[].concat(Object(We["a"])(e.rules),[$e({id:n,content:o},e.currentStream)]);e.rules=r}},updateTopic:function(e,t){var n=t.orig_subject,o=t.subject,s=e.topics.find((function(e){return e.title==n}));s&&(s.title=o,s.messages.forEach((function(e){return e.subject=o})))}},actions:{},getters:{rules:function(e){return e.rules},sortedTopics:function(e){return Object(We["a"])(e.topics).sort((function(e,t){return e.title.localeCompare(t.title)})).filter((function(e){return e.messages.length>0}))}}}),Je=(n("85e4"),Object(o["createApp"])(k)),Ke={html:!0,linkify:!0,typographer:!0};Je.config.globalProperties.$http=C.a,Je.config.globalProperties.$mdOpts=Ke,Je.config.globalProperties.$md=new _.a(Ke),Je.use(T.a).use(Ve).use(Ye).mount("#app")},6338:function(e,t,n){},7751:function(e,t,n){},"899e":function(e,t,n){},"955e":function(e,t,n){},a946:function(e,t,n){},c06e:function(e,t,n){"use strict";n("1665")},c25a:function(e,t,n){},c4b5:function(e,t,n){"use strict";n("955e")},e8931:function(e,t,n){"use strict";n("f8cf")},eebe:function(e,t,n){"use strict";n("6338")},f8cf:function(e,t,n){},fa5e:function(e,t,n){"use strict";n("3ec9")}});
|
||
//# sourceMappingURL=app.43e3dc5f.js.map
|