function pug_attr(t,e,n,f){return!1!==e&&null!=e&&(e||"class"!==t&&"style"!==t)?!0===e?" "+(f?t:t+'="'+t+'"'):("function"==typeof e.toJSON&&(e=e.toJSON()),"string"==typeof e||(e=JSON.stringify(e),n||-1===e.indexOf('"'))?(n&&(e=pug_escape(e))," "+t+'="'+e+'"'):" "+t+"='"+e.replace(/'/g,"'")+"'"):""} function pug_escape(e){var a=""+e,t=pug_match_html.exec(a);if(!t)return e;var r,c,n,s="";for(r=t.index,c=0;r]/; function pug_rethrow(n,e,r,t){if(!(n instanceof Error))throw n;if(!("undefined"==typeof window&&e||t))throw n.message+=" on line "+r,n;try{t=t||require("fs").readFileSync(e,"utf8")}catch(e){pug_rethrow(n,null,r)}var i=3,a=t.split("\n"),o=Math.max(r-i,0),h=Math.min(a.length,r+i),i=a.slice(o,h).map(function(n,e){var t=e+o+1;return(t==r?" > ":" ")+t+"| "+n}).join("\n");throw n.path=e,n.message=(e||"Pug")+":"+r+"\n"+i+"\n\n"+n.message,n}function emitWordHtml(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_debug_filename, pug_debug_line;try {;var locals_for_with = (locals || {});(function (aabb, after, before, image_path, line_num, page_name, word) {;pug_debug_line = 1;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["transcript"] = pug_interp = function(text){ var block = (this && this.block), attributes = (this && this.attributes) || {}; ;pug_debug_line = 2;pug_debug_filename = "views\u002Ftext-parser.pug"; var segments = (function() { var last_pos = 0 var segments = [] function parsePairedTags(str) { var nodes = []; // we're not actually using the replacement, but we DO need that callback str.replace(/<([^>]+)>(.*?)<\/\1>/g, function(match, tag, inner, start_pos, str) { var pre = str.substr(last_pos, start_pos-last_pos); nodes.push({text: pre}) nodes.push({ tag: tag, children: parsePairedTags(inner), }) last_pos = start_pos + match.length }) if (last_pos != str.length) { nodes.push({text: str.substr(last_pos)}) } return nodes; } var segments = parsePairedTags(text); function parseSingleTags(arr) { return [].concat(...arr.map(function(seg) { if (seg.children) { //console.log(seg.children); seg.children = parseSingleTags(seg.children); //console.log(seg.children); } if (seg.text) { var last_pos = 0 var tmp = []; seg.text.replace(/<([^>]+)>/g, function(match, tag, start_pos, str) { var pre = str.substr(last_pos, start_pos-last_pos); tmp.push({text: pre}); tmp.push({tag:tag, children:[]}); last_pos = start_pos + match.length }) if (last_pos != seg.text.length) { tmp.push({text: seg.text.substr(last_pos)}) } return tmp; } return seg; })) } segments = parseSingleTags(segments); return segments; })() ;pug_debug_line = 62;pug_debug_filename = "views\u002Ftext-parser.pug"; // iterate segments.filter(s => s.tag || s.text) ;(function(){ var $$obj = segments.filter(s => s.tag || s.text); if ('number' == typeof $$obj.length) { for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) { var segment = $$obj[pug_index0]; ;pug_debug_line = 63;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](segment); } } else { var $$l = 0; for (var pug_index0 in $$obj) { $$l++; var segment = $$obj[pug_index0]; ;pug_debug_line = 63;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](segment); } } }).call(this); }; ;pug_debug_line = 66;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"] = pug_interp = function(segment){ var block = (this && this.block), attributes = (this && this.attributes) || {}; ;pug_debug_line = 67;pug_debug_filename = "views\u002Ftext-parser.pug"; if (segment.tag == 'sup') { ;pug_debug_line = 68;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + "\u003Csup\u003E"; ;pug_debug_line = 69;pug_debug_filename = "views\u002Ftext-parser.pug"; // iterate segment.children ;(function(){ var $$obj = segment.children; if ('number' == typeof $$obj.length) { for (var pug_index1 = 0, $$l = $$obj.length; pug_index1 < $$l; pug_index1++) { var child = $$obj[pug_index1]; ;pug_debug_line = 70;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } else { var $$l = 0; for (var pug_index1 in $$obj) { $$l++; var child = $$obj[pug_index1]; ;pug_debug_line = 70;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } }).call(this); pug_html = pug_html + "\u003C\u002Fsup\u003E"; } else if (segment.tag == 'add') { ;pug_debug_line = 72;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + "\u003Csup class=\"addition\"\u003E"; ;pug_debug_line = 73;pug_debug_filename = "views\u002Ftext-parser.pug"; // iterate segment.children ;(function(){ var $$obj = segment.children; if ('number' == typeof $$obj.length) { for (var pug_index2 = 0, $$l = $$obj.length; pug_index2 < $$l; pug_index2++) { var child = $$obj[pug_index2]; ;pug_debug_line = 74;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } else { var $$l = 0; for (var pug_index2 in $$obj) { $$l++; var child = $$obj[pug_index2]; ;pug_debug_line = 74;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } }).call(this); pug_html = pug_html + "\u003C\u002Fsup\u003E"; } else if (segment.tag == 'del') { ;pug_debug_line = 76;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + "\u003Cstrike\u003E"; ;pug_debug_line = 77;pug_debug_filename = "views\u002Ftext-parser.pug"; // iterate segment.children ;(function(){ var $$obj = segment.children; if ('number' == typeof $$obj.length) { for (var pug_index3 = 0, $$l = $$obj.length; pug_index3 < $$l; pug_index3++) { var child = $$obj[pug_index3]; ;pug_debug_line = 78;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } else { var $$l = 0; for (var pug_index3 in $$obj) { $$l++; var child = $$obj[pug_index3]; ;pug_debug_line = 78;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } }).call(this); pug_html = pug_html + "\u003C\u002Fstrike\u003E"; } else if (segment.tag == 'und') { ;pug_debug_line = 80;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + "\u003Cu\u003E"; ;pug_debug_line = 81;pug_debug_filename = "views\u002Ftext-parser.pug"; // iterate segment.children ;(function(){ var $$obj = segment.children; if ('number' == typeof $$obj.length) { for (var pug_index4 = 0, $$l = $$obj.length; pug_index4 < $$l; pug_index4++) { var child = $$obj[pug_index4]; ;pug_debug_line = 82;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } else { var $$l = 0; for (var pug_index4 in $$obj) { $$l++; var child = $$obj[pug_index4]; ;pug_debug_line = 82;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } }).call(this); pug_html = pug_html + "\u003C\u002Fu\u003E"; } else if (segment.tag == 'note') { ;pug_debug_line = 84;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + "\u003Cspan" + (" class=\"transcription_note\""+pug_attr("data-note", segment.text, true, false)) + "\u003E"; ;pug_debug_line = 85;pug_debug_filename = "views\u002Ftext-parser.pug"; // nothing in the span, currently pug_html = pug_html + "\u003C\u002Fspan\u003E"; } else if (segment.tag == 'p-bgn') { ;pug_debug_line = 87;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + (null == (pug_interp = " ".repeat(5)) ? "" : pug_interp); } else if (segment.tag == 'p-end') { ;pug_debug_line = 89;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + "\u003Cbr\u002F\u003E"; } else if (segment.tag == 'unclear' || segment.tag == 'ill') { ;pug_debug_line = 91;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + "\u003Cspan class=\"unclear\"\u003E"; ;pug_debug_line = 92;pug_debug_filename = "views\u002Ftext-parser.pug"; // iterate segment.children ;(function(){ var $$obj = segment.children; if ('number' == typeof $$obj.length) { for (var pug_index5 = 0, $$l = $$obj.length; pug_index5 < $$l; pug_index5++) { var child = $$obj[pug_index5]; ;pug_debug_line = 93;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } else { var $$l = 0; for (var pug_index5 in $$obj) { $$l++; var child = $$obj[pug_index5]; ;pug_debug_line = 93;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } }).call(this); ;pug_debug_line = 94;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + (pug_escape(null == (pug_interp = "[?]") ? "" : pug_interp)) + "\u003C\u002Fspan\u003E"; } else if (segment.tag == 'sic') { ;pug_debug_line = 96;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + "\u003Cspan class=\"sic\"\u003E"; ;pug_debug_line = 97;pug_debug_filename = "views\u002Ftext-parser.pug"; // iterate segment.children ;(function(){ var $$obj = segment.children; if ('number' == typeof $$obj.length) { for (var pug_index6 = 0, $$l = $$obj.length; pug_index6 < $$l; pug_index6++) { var child = $$obj[pug_index6]; ;pug_debug_line = 98;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } else { var $$l = 0; for (var pug_index6 in $$obj) { $$l++; var child = $$obj[pug_index6]; ;pug_debug_line = 98;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } }).call(this); ;pug_debug_line = 99;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + (pug_escape(null == (pug_interp = "[sic]") ? "" : pug_interp)) + "\u003C\u002Fspan\u003E"; } else if (segment.tag == 'for') { ;pug_debug_line = 101;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + "\u003Ci class=\"foreign\"\u003E"; ;pug_debug_line = 102;pug_debug_filename = "views\u002Ftext-parser.pug"; // iterate segment.children ;(function(){ var $$obj = segment.children; if ('number' == typeof $$obj.length) { for (var pug_index7 = 0, $$l = $$obj.length; pug_index7 < $$l; pug_index7++) { var child = $$obj[pug_index7]; ;pug_debug_line = 103;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } else { var $$l = 0; for (var pug_index7 in $$obj) { $$l++; var child = $$obj[pug_index7]; ;pug_debug_line = 103;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_mixins["emit_transcript_segment"](child); } } }).call(this); pug_html = pug_html + "\u003C\u002Fi\u003E"; } else { ;pug_debug_line = 105;pug_debug_filename = "views\u002Ftext-parser.pug"; pug_html = pug_html + (pug_escape(null == (pug_interp = segment.text) ? "" : pug_interp)); } }; ;pug_debug_line = 3;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_html = pug_html + "\u003Cspan class=\"transcript\"\u003E"; ;pug_debug_line = 4;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_mixins["transcript"](before); ;pug_debug_line = 5;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_html = pug_html + "\u003Cspan style=\"text-decoration: underline;\"\u003E"; ;pug_debug_line = 6;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_mixins["transcript"](word); pug_html = pug_html + "\u003C\u002Fspan\u003E"; ;pug_debug_line = 7;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_mixins["transcript"](after); ;pug_debug_line = 8;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_html = pug_html + "\u003Cspan" + (" class=\"source-line-indicator\""+pug_attr("data-image_path", image_path, true, false)) + "\u003E"; ;pug_debug_line = 9;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_html = pug_html + (pug_escape(null == (pug_interp = ` [line ${line_num} / page `) ? "" : pug_interp)); ;pug_debug_line = 10;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_html = pug_html + "\u003Ca" + (pug_attr("href", "https://image-store.tpen-demo.americanpaleography.org/" + image_path, true, false)) + "\u003E"; ;pug_debug_line = 11;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_html = pug_html + (pug_escape(null == (pug_interp = page_name) ? "" : pug_interp)) + "\u003C\u002Fa\u003E"; ;pug_debug_line = 12;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_html = pug_html + "]"; ;pug_debug_line = 13;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_html = pug_html + "\u003Cbutton" + (" class=\"show-line-image\""+pug_attr("data-aabb", aabb, true, false)) + "\u003E"; ;pug_debug_line = 14;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_html = pug_html + "toggle line image\u003C\u002Fbutton\u003E"; ;pug_debug_line = 15;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_html = pug_html + "\u003Cbutton class=\"show-page-image\"\u003E"; ;pug_debug_line = 16;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-line.pug"; pug_html = pug_html + "toggle page image\u003C\u002Fbutton\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E";}.call(this,"aabb" in locals_for_with?locals_for_with.aabb:typeof aabb!=="undefined"?aabb:undefined,"after" in locals_for_with?locals_for_with.after:typeof after!=="undefined"?after:undefined,"before" in locals_for_with?locals_for_with.before:typeof before!=="undefined"?before:undefined,"image_path" in locals_for_with?locals_for_with.image_path:typeof image_path!=="undefined"?image_path:undefined,"line_num" in locals_for_with?locals_for_with.line_num:typeof line_num!=="undefined"?line_num:undefined,"page_name" in locals_for_with?locals_for_with.page_name:typeof page_name!=="undefined"?page_name:undefined,"word" in locals_for_with?locals_for_with.word:typeof word!=="undefined"?word:undefined));} catch (err) {pug_rethrow(err, pug_debug_filename, pug_debug_line);};return pug_html;} function pug_attr(t,e,n,f){return!1!==e&&null!=e&&(e||"class"!==t&&"style"!==t)?!0===e?" "+(f?t:t+'="'+t+'"'):("function"==typeof e.toJSON&&(e=e.toJSON()),"string"==typeof e||(e=JSON.stringify(e),n||-1===e.indexOf('"'))?(n&&(e=pug_escape(e))," "+t+'="'+e+'"'):" "+t+"='"+e.replace(/'/g,"'")+"'"):""} function pug_escape(e){var a=""+e,t=pug_match_html.exec(a);if(!t)return e;var r,c,n,s="";for(r=t.index,c=0;r]/; function pug_rethrow(n,e,r,t){if(!(n instanceof Error))throw n;if(!("undefined"==typeof window&&e||t))throw n.message+=" on line "+r,n;try{t=t||require("fs").readFileSync(e,"utf8")}catch(e){pug_rethrow(n,null,r)}var i=3,a=t.split("\n"),o=Math.max(r-i,0),h=Math.min(a.length,r+i),i=a.slice(o,h).map(function(n,e){var t=e+o+1;return(t==r?" > ":" ")+t+"| "+n}).join("\n");throw n.path=e,n.message=(e||"Pug")+":"+r+"\n"+i+"\n\n"+n.message,n}function emitLexiconIndexHtml(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_debug_filename, pug_debug_line;try {;var locals_for_with = (locals || {});(function (dict, glossary_terms) {;pug_debug_line = 1;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; pug_html = pug_html + "\u003Cul\u003E"; ;pug_debug_line = 2;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; // iterate glossary_terms ;(function(){ var $$obj = glossary_terms; if ('number' == typeof $$obj.length) { for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) { var term = $$obj[pug_index0]; ;pug_debug_line = 3;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; pug_html = pug_html + "\u003Cli" + (" class=\"glossary-entry\""+pug_attr("data-word", term, true, false)) + "\u003E"; ;pug_debug_line = 4;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; pug_html = pug_html + "\u003Cstrong\u003E"; ;pug_debug_line = 5;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; pug_html = pug_html + (pug_escape(null == (pug_interp = term) ? "" : pug_interp)) + "\u003C\u002Fstrong\u003E"; ;pug_debug_line = 6;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; pug_html = pug_html + "\u003Cbr\u002F\u003E"; ;pug_debug_line = 7;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; pug_html = pug_html + (pug_escape(null == (pug_interp = `${dict[term].length} entries`) ? "" : pug_interp)) + "\u003C\u002Fli\u003E"; } } else { var $$l = 0; for (var pug_index0 in $$obj) { $$l++; var term = $$obj[pug_index0]; ;pug_debug_line = 3;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; pug_html = pug_html + "\u003Cli" + (" class=\"glossary-entry\""+pug_attr("data-word", term, true, false)) + "\u003E"; ;pug_debug_line = 4;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; pug_html = pug_html + "\u003Cstrong\u003E"; ;pug_debug_line = 5;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; pug_html = pug_html + (pug_escape(null == (pug_interp = term) ? "" : pug_interp)) + "\u003C\u002Fstrong\u003E"; ;pug_debug_line = 6;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; pug_html = pug_html + "\u003Cbr\u002F\u003E"; ;pug_debug_line = 7;pug_debug_filename = ".\u002Fviews\u002Fold-concordance-summary.pug"; pug_html = pug_html + (pug_escape(null == (pug_interp = `${dict[term].length} entries`) ? "" : pug_interp)) + "\u003C\u002Fli\u003E"; } } }).call(this); pug_html = pug_html + "\u003C\u002Ful\u003E";}.call(this,"dict" in locals_for_with?locals_for_with.dict:typeof dict!=="undefined"?dict:undefined,"glossary_terms" in locals_for_with?locals_for_with.glossary_terms:typeof glossary_terms!=="undefined"?glossary_terms:undefined));} catch (err) {pug_rethrow(err, pug_debug_filename, pug_debug_line);};return pug_html;}