proskomma-core 0.9.20 → 0.9.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- var e=require("xregexp"),n=require("@graphql-tools/schema"),t=require("async-mutex"),s=require("easy-crc32"),r=require("graphql"),o=require("bitset"),i=require("utf8-string-bytes"),c=require("base64-js"),a=require("pure-uuid"),l=require("base-64"),u=require("proskomma-json-tools"),S=require("sax"),h=require("deep-copy-all");function p(e,n,t,s){Object.defineProperty(e,n,{get:t,set:s,enumerable:!0,configurable:!0})}p(module.exports,"Proskomma",(()=>m.Proskomma)),p(module.exports,"lexingRegexes",(()=>m.lexingRegexes)),p(module.exports,"blocksSpecUtils",(()=>m.blocksSpecUtils)),p(module.exports,"resolvers",(()=>m.resolvers)),p(module.exports,"typeDefs",(()=>m.typeDefs));var d,f,m={},g=n.makeExecutableSchema,A=t.Mutex,E=r.graphql,b=r.graphqlSync;f=JSON.parse('{"name":"proskomma-core","version":"0.9.20","description":"A Scripture Runtime Engine","main":"dist/index.cjs","browser":"dist/bundle.js","module":"dist/module.mjs","source":"esm/wrapper.mjs","scripts":{"build":"rm -fr dist && parcel build --no-source-maps","test":"export PKSRC=dist && bash -c \\"tape -r @babel/register test/code/**/*.cjs | node_modules/tap-summary/bin/cmd.js\\"","rawTest":"export PKSRC=dist && bash -c \\"tape -r @babel/register test/code/*.cjs\\"","oneTest":"bash -c \\"tape -r @babel/register test/code/$TESTSCRIPT.cjs\\"","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/Proskomma/proskomma-core.git"},"keywords":["USFM","USX","Scripture","parser","lexer","Proskomma"],"author":"Mark Howe","license":"MIT","bugs":{"url":"https://github.com/Proskomma/proskomma-core/issues"},"homepage":"https://github.com/Proskomma/proskomma-core#readme","dependencies":{"@graphql-tools/schema":"^9.0.3","async-mutex":"^0.4.0","base-64":"^1.0.0","base64-js":"^1.5.1","bitset":"^5.1.1","buffer":"^6.0.3","deep-copy-all":"^1.3.4","deep-equal":"^2.0.5","easy-crc32":"^0.0.2","fs-extra":"^11.1.0","graphql":"^v16.6.0","proskomma-json-tools":"^0.6.5","pure-uuid":"^1.6.2","sax":"^1.2.4","stream":"0.0.2","string_decoder":"^1.3.0","utf8-string-bytes":"^1.0.3","util":"^0.12.4","xregexp":"^5.1.1"},"devDependencies":{"@babel/eslint-parser":"^7.19.1","@babel/register":"^7.18.9","events":"^3.3.0","parcel":"^2.8.3","process":"^0.11.10","stream-browserify":"^3.0.0","tap-summary":"^4.0.0","tape":"^5.6.0"},"targets":{"main":{"optimize":true},"browser":{"optimize":true},"module":{"optimize":true}}}');var y={},P={},k=i.utf8ByteArrayToString,I=i.stringToUtf8ByteArray;const w=(e,n,t)=>{if("number"!=typeof e)throw new Error(`Argument ${t} of ${n} should be a number, not '${e}' (${typeof e})`)};P=class{constructor(e,n){e=e||64,n=n||0,this.growMax=16384,this.length=n,this.byteArray=new Uint8Array(e)}byte(e){if(w(e,"byte","n"),e>this.length-1)throw Error(`Attempt to read byte ${e} of ByteArray of length ${this.length}`);return this.byteArray[e]}bytes(e,n){if(w(e,"bytes","n"),w(n,"bytes","l"),e+n>this.length)throw Error(`Attempt to read ${n} bytes from start ${e} of ByteArray of length ${this.length}`);return this.byteArray.subarray(e,e+n)}setByte(e,n){if(w(e,"setByte","n"),w(n,"setByte","v"),e>this.length-1)throw Error(`Attempt to set byte ${e} of ByteArray of length ${this.length}`);if("number"!=typeof n||n<0||n>255)throw Error(`Expected value 0-255 when setting ByteArray, found ${n}`);this.byteArray[e]=n}setBytes(e,n){if(w(e,"setBytes","n"),e+n.length>this.length)throw Error(`Attempt to set ${n.length} bytes from start ${e} of ByteArray of length ${this.length}`);this.byteArray.set(n,e)}pushByte(e){if("number"!=typeof e||e<0||e>255)throw Error(`Expected value 0-255 when pushing to ByteArray, found ${e}`);this.length===this.byteArray.length&&this.grow(),this.byteArray[this.length]=e,this.length++}grow(e){const n=new Uint8Array(Math.max(e||0,this.byteArray.length+Math.min(this.growMax,Math.max(16,this.byteArray.length))));n.set(this.byteArray),this.byteArray=n}trim(){const e=new Uint8Array(this.length);e.set(this.byteArray.subarray(0,this.length)),this.byteArray=e}pushBytes(e){for(const n of e)this.pushByte(n)}pushNByte(e){if(w(e,"pushNByte","v"),"number"!=typeof e||e<0)throw Error(`Expected positive number in pushNByte, found ${e}`);if(e<128)this.pushByte(e+128);else{const n=e%128;this.pushByte(n),this.pushNByte(e>>7)}}pushNBytes(e){for(const n of e)try{this.pushNByte(n)}catch(n){throw Error(`Error from pushNByte, called as pushNBytes(${JSON.stringify(e)})`)}}nByte(e){if(w(e,"nByte","n"),e>this.length-1)throw Error(`Attempt to read nByte ${e} of ByteArray of length ${this.length}`);const n=this.byteArray[e];return n>127?n-128:n+128*this.nByte(e+1)}nBytes(e,n){w(e,"nBytes","n"),w(n,"nBytes","nValues");const t=[];for(;n>0;){let s=!1,r=0,o=1;do{if(e>this.length-1)throw Error(`Attempt to read nByte ${e} of ByteArray of length ${this.length} in nBytes(${e}, ${n})`);const i=this.byteArray[e];i>127?(r+=(i-128)*o,t.push(r),r=0,s=!0):(r+=i*o,o*=128),e++}while(!s);n--}return t}nByteLength(e){if(w(e,"nByteLength","v"),e>=128**4)throw new Error("> 4 bytes found in nByteLength");let n=1;for(;e>127;)e>>=7,n+=1;return n}pushCountedString(e){const n=I(e);this.pushByte(n.length),this.pushBytes(n)}countedString(e){w(e,"countedString","n");const n=this.byte(e);return k(this.bytes(e+1,n))}clear(){this.byteArray.fill(0),this.length=0}base64(){return c.fromByteArray(this.byteArray)}fromBase64(e){this.byteArray=c.toByteArray(e),this.length=this.byteArray.length}deleteItem(e){w(e,"deleteItem","n");const n=63&this.byte(e);if(this.length-=n,this.length>e){const t=this.byteArray.slice(e+n);this.byteArray.set(t,e)}}insert(e,n){w(e,"insert","n");const t=n.length,s=this.length+t;if(s>=this.byteArray.length+t&&this.grow(s),e<s){const n=this.byteArray.slice(e,this.length);this.byteArray.set(n,e+t)}this.byteArray.set(n.byteArray.slice(0,n.length),e),this.length=s}};var T;const v=[{code:"GEN",categories:["ot","pentateuch"]},{code:"EXO",categories:["ot","pentateuch"]},{code:"LEV",categories:["ot","pentateuch"]},{code:"NUM",categories:["ot","pentateuch"]},{code:"DEU",categories:["ot","pentateuch"]},{code:"JOS",categories:["ot","history"]},{code:"JDG",categories:["ot","history"]},{code:"RUT",categories:["ot","history"]},{code:"1SA",categories:["ot","history"]},{code:"2SA",categories:["ot","history"]},{code:"1KI",categories:["ot","history"]},{code:"2KI",categories:["ot","history"]},{code:"1CH",categories:["ot","history"]},{code:"2CH",categories:["ot","history"]},{code:"EZR",categories:["ot","history"]},{code:"NEH",categories:["ot","history"]},{code:"EST",categories:["ot","history"]},{code:"JOB",categories:["ot","wisdom"]},{code:"PSA",categories:["ot","wisdom"]},{code:"PRO",categories:["ot","wisdom"]},{code:"ECC",categories:["ot","wisdom"]},{code:"SNG",categories:["ot","wisdom"]},{code:"ISA",categories:["ot","prophecy"]},{code:"JER",categories:["ot","prophecy"]},{code:"LAM",categories:["ot","prophecy"]},{code:"EZK",categories:["ot","prophecy"]},{code:"DAN",categories:["ot","prophecy"]},{code:"HOS",categories:["ot","prophecy"]},{code:"JOL",categories:["ot","prophecy"]},{code:"AMO",categories:["ot","prophecy"]},{code:"OBA",categories:["ot","prophecy"]},{code:"JON",categories:["ot","prophecy"]},{code:"MIC",categories:["ot","prophecy"]},{code:"NAM",categories:["ot","prophecy"]},{code:"HAB",categories:["ot","prophecy"]},{code:"ZEP",categories:["ot","prophecy"]},{code:"HAG",categories:["ot","prophecy"]},{code:"ZEC",categories:["ot","prophecy"]},{code:"MAL",categories:["ot","prophecy"]},{code:"MAT",categories:["nt","gospel","synoptic"]},{code:"MRK",categories:["nt","gospel","synoptic"]},{code:"LUK",categories:["nt","gospel","synoptic"]},{code:"JHN",categories:["nt","gospel"]},{code:"ACT",categories:["nt","gospel"]},{code:"ROM",categories:["nt","epistle"]},{code:"1CO",categories:["nt","epistle"]},{code:"2CO",categories:["nt","epistle"]},{code:"GAL",categories:["nt","epistle"]},{code:"EPH",categories:["nt","epistle"]},{code:"PHP",categories:["nt","epistle"]},{code:"COL",categories:["nt","epistle"]},{code:"1TH",categories:["nt","epistle"]},{code:"2TH",categories:["nt","epistle"]},{code:"1TI",categories:["nt","epistle"]},{code:"2TI",categories:["nt","epistle"]},{code:"TIT",categories:["nt","epistle"]},{code:"PHM",categories:["nt","epistle"]},{code:"HEB",categories:["nt","epistle"]},{code:"JAS",categories:["nt","epistle"]},{code:"1PE",categories:["nt","epistle"]},{code:"2PE",categories:["nt","epistle"]},{code:"1JN",categories:["nt","epistle"]},{code:"2JN",categories:["nt","epistle"]},{code:"3JN",categories:["nt","epistle"]},{code:"JUD",categories:["nt","epistle"]},{code:"REV",categories:["nt","epistle"]},{code:"TOB",categories:["dc"]},{code:"JDT",categories:["dc"]},{code:"ESG",categories:["dc","history"]},{code:"WIS",categories:["dc","wisdom"]},{code:"SIR",categories:["dc","wisdom"]},{code:"BAR",categories:["dc","prophecy"]},{code:"LJE",categories:["dc"]},{code:"S3Y",categories:["dc"]},{code:"SUS",categories:["dc"]},{code:"BEL",categories:["dc"]},{code:"1MA",categories:["dc"]},{code:"2MA",categories:["dc"]},{code:"3MA",categories:["dc"]},{code:"4MA",categories:["dc"]},{code:"1ES",categories:["dc"]},{code:"2ES",categories:["dc"]},{code:"MAN",categories:["dc"]},{code:"PS2",categories:["dc"]},{code:"ODA",categories:["dc"]},{code:"PSS",categories:["dc"]},{code:"JSA",categories:["dc"]},{code:"JDB",categories:["dc"]},{code:"TBS",categories:["dc"]},{code:"SST",categories:["dc"]},{code:"DNT",categories:["dc"]},{code:"BLT",categories:["dc"]},{code:"EZA",categories:["dc"]},{code:"5EZ",categories:["dc"]},{code:"6EZ",categories:["dc"]},{code:"DAG",categories:["dc"]},{code:"PS3",categories:["dc"]},{code:"2BA",categories:["dc"]},{code:"LBA",categories:["dc"]},{code:"JUB",categories:["dc"]},{code:"ENO",categories:["dc"]},{code:"1MQ",categories:["dc"]},{code:"2MQ",categories:["dc"]},{code:"3MQ",categories:["dc"]},{code:"REP",categories:["dc"]},{code:"4BA",categories:["dc"]},{code:"LAO",categories:["dc"]}];let B={};for(const e of v.entries())B[e[1].code]={...e[1],position:e[0]};T={ptBookArray:v,ptBooks:B};var O;O={enumStringIndex:(e,n)=>{let t=0,s=0;for(;t<e.length;){const r=e.byte(t);if(e.countedString(t)===n)return s;t+=r+1,s+=1}return-1},enumRegexIndexTuples:(n,t)=>{let s=0,r=0;const o=[];for(;s<n.length;){const i=n.byte(s),c=n.countedString(s);e.exec(c,e(t,"i"))&&o.push([r,c]),s+=i+1,r+=1}return o}};var x,G={generateId:()=>l.encode(new a(4)).substring(0,12)}.generateId;x={graftLocation:{heading:"block",title:"block",endTitle:"block",remark:"block",footnote:"inline",xref:"inline",noteCaller:"inline",esbCat:"inline",table:"block",tree:"block",kv:"block"}};var C,N,q;const R={wordLike:0,punctuation:1,lineSpace:2,eol:3,softLineBreak:4,noBreakSpace:5,bareSlash:6,unknown:7},M=Object.entries(R).sort(((e,n)=>e[1]-n[1])).map((e=>e[0]));q={tokenEnum:R,tokenEnumLabels:M,tokenCategory:{wordLike:"wordLike",punctuation:"notWordLike",lineSpace:"notWordLike",eol:"notWordLike",softLineBreak:"notWordLike",noBreakSpace:"notWordLike",bareSlash:"notWordLike",unknown:"notWordLike"}};var D;const $={blockTag:0,inline:1,chapter:2,pubChapter:3,altChapter:4,verses:5,verse:6,pubVerse:7,altVerse:8,esbCat:9,span:10,table:11,cell:12,milestone:13,spanWithAtts:14,attribute:15,hangingGraft:16,orphanTokens:17,tTableRow:18,tTableCol:19,tTreeNode:20,tTreeParent:21,tTreeChild:22,tTreeContent:23,kvPrimary:24,kvSecondary:25,kvField:26},J=Object.entries($).sort(((e,n)=>e[1]-n[1])).map((e=>e[0])),H=n=>{const t={th:{type:"colHeading",align:"left"},thr:{type:"colHeading",align:"right"},tc:{type:"body",align:"left"},tcr:{type:"body",align:"right"}},[s,r]=(n=>{const t=e.exec(n,e("([^1-9]+)(.*)"));return[t[1],t[2].length>0?t[2]:"1"]})(n);let o="1";if(r.includes("-")){const[e,n]=r.split("-");o=""+(parseInt(n)-parseInt(e)+1)}return`cell/${t[s].type}/${t[s].align}/${o}`};D={scopeEnum:$,scopeEnumLabels:J,labelForScope:(e,n)=>{switch(e){case"blockTag":return`blockTag/${n[0]}`;case"inline":return`inline/${n[0]}`;case"chapter":return`chapter/${n[0]}`;case"verses":return`verses/${n[0]}`;case"verse":return`verse/${n[0]}`;case"span":return`span/${n[0]}`;case"table":return"table";case"cell":return H(n[0]);case"milestone":return`milestone/${n[0]}`;case"spanWithAtts":return`spanWithAtts/${n[0]}`;case"attribute":return`attribute/${n[0]}/${n[1]}/${n[2]}/${n[3]}`;case"orphanTokens":return"orphanTokens";case"hangingGraft":return"hangingGraft";case"pubChapter":return`pubChapter/${n[0]}`;case"pubVerse":return`pubVerse/${n[0]}`;case"altChapter":return`altChapter/${n[0]}`;case"altVerse":return`altVerse/${n[0]}`;case"esbCat":return`esbCat/${n[0]}`;case"tTableRow":return`tTableRow/${n[0]}`;case"tTableCol":return`tTableCol/${n[0]}`;case"tTreeNode":return`tTreeNode/${n[0]}`;case"tTreeParent":return`tTreeParent/${n[0]}`;case"tTreeChild":return`tTreeChild/${n[0]}/${n[1]}`;case"tTreeContent":return`tTreeContent/${n[0]}`;case"kvPrimary":return`kvPrimary/${n[0]}`;case"kvSecondary":return`kvSecondary/${n[0]}/${n[1]}`;case"kvField":return`kvField/${n[0]}`;default:throw new Error(`Unknown scope type '${e}' in labelForScope`)}},nComponentsForScope:e=>{switch(e){case"orphanTokens":case"hangingGraft":case"table":return 1;case"blockTag":case"inline":case"chapter":case"verses":case"verse":case"span":case"milestone":case"spanWithAtts":case"pubChapter":case"altChapter":case"pubVerse":case"altVerse":case"esbCat":case"tTableRow":case"tTableCol":case"tTreeNode":case"tTreeParent":case"tTreeContent":case"kvPrimary":case"kvField":return 2;case"tTreeChild":case"kvSecondary":return 3;case"cell":return 4;case"attribute":return 6;default:throw new Error(`Unknown scope type '${e}' in nComponentsForScope`)}}};var L;const V={token:0,graft:1,startScope:2,endScope:3},K=Object.entries(V).sort(((e,n)=>e[1]-n[1])).map((e=>e[0])),U=e=>({type:e[0],subType:e[1],payload:e[2]}),X=e=>[e.type,e.subType,e.payload],j=(e,n)=>{const t=new Uint32Array(n.length);let s=0,r=0;for(;s<n.length;){t[r]=s;s+=n.byte(s)+1,r+=1}return t},W=(e,n)=>{throw new Error(`Undefined or null argument '${n}' in '${e}'`)};N={enumIndex:j,enumIndexes:e=>{const n={};for(const[t,s]of Object.entries(e))n[t]=j(t,s);return n},headerBytes:(e,n)=>{const t=e.byte(n);return[63&t,t>>6,e.byte(n+1)]},pushSuccinctTokenBytes:(e,n,t)=>{null==n&&W("pushSuccinctTokenBytes","tokenEnumIndex"),null==t&&W("pushSuccinctTokenBytes","charsEnumIndex");const s=e.length;e.pushByte(0),e.pushByte(n),e.pushNByte(t),e.setByte(s,e.length-s|L.itemEnum.token<<6)},pushSuccinctGraftBytes:(e,n,t)=>{null==n&&W("pushSuccinctGraftBytes","graftTypeEnumIndex"),null==t&&W("pushSuccinctGraftBytes","seqEnumIndex");const s=e.length;e.pushByte(0),e.pushByte(n),e.pushNByte(t),e.setByte(s,e.length-s|L.itemEnum.graft<<6)},pushSuccinctScopeBytes:(e,n,t,s)=>{null==n&&W("pushSuccinctScopeBytes","itemTypeByte"),null==t&&W("pushSuccinctScopeBytes","scopeTypeByte"),null==s&&W("pushSuccinctScopeBytes","scopeBitBytes");const r=e.length;e.pushByte(0),e.pushByte(t);for(const n of s)e.pushNByte(n);e.setByte(r,e.length-r|n<<6)},succinctTokenChars:(e,n,t,s,r)=>{const o=q.tokenCategory[q.tokenEnumLabels[s]],i=n[o][t.nByte(r+2)];return e[o].countedString(i)},succinctScopeLabel:(e,n,t,s,r)=>{const o=D.scopeEnumLabels[s];let i=D.nComponentsForScope(o),c=2,a="";for(;i>1;){const s=t.nByte(r+c),o=n.scopeBits[s];a+=`/${e.scopeBits.countedString(o)}`,c+=t.nByteLength(s),i--}return`${o}${a}`},succinctGraftName:(e,n,t)=>{const s=n.graftTypes[t];return e.graftTypes.countedString(s)},succinctGraftSeqId:(e,n,t,s)=>{const r=n.ids[t.nByte(s+2)];return e.ids.countedString(r)},unpackEnum:(e,n)=>{n||(n=!1);let t=0,s=0;const r=[];for(;t<e.length;){const o=e.byte(t),i=e.countedString(t);r.push(n?[s,i]:i),t+=o+1,s++}return r}};C={inspectEnum:e=>{const n=new P;n.fromBase64(e);const t=[];t.push(`* Char length ${n.length} *`);for(const[e,s]of N.unpackEnum(n,!0))t.push(`${e}\t"${s}"`);return t.join("\n")},inspectSuccinct:(e,n)=>{const t=new P;t.fromBase64(e);const s={};for(const[e,t]of Object.entries(n))s[e]=new P,s[e].fromBase64(t);const r=N.enumIndexes(s),o=[];o.push(`* Char length ${t.length} *`);let i=0;for(;i<t.length;){const[e,n,c]=N.headerBytes(t,i);let a=c,l="";switch(L.itemEnumLabels[n]){case"token":a=q.tokenEnumLabels[c],l=`"${N.succinctTokenChars(s,r,t,c,i)}"`;break;case"startScope":case"endScope":a=D.scopeEnumLabels[c],l=N.succinctScopeLabel(s,r,t,c,i);break;case"graft":a=N.succinctGraftName(s,r,c),l=N.succinctGraftSeqId(s,r,t,i)}o.push(`${L.itemEnumLabels[n]}\t${a}\t(${e})\t${l}`),i+=e}return o.join("\n")}};const Z=n=>{if(!e.exec(n,/^[a-z][A-za-z0-9]*(:.+)?$/))throw new Error(`Tag '${n}' is not valid (should be [a-z][A-za-z0-9]*(:.+)?)`)};const F=["GEN","EXO","LEV","NUM","DEU","JOS","JDG","RUT","1SA","2SA","1KI","2KI","1CH","2CH","EZR","NEH","EST","JOB","PSA","PRO","ECC","SNG","ISA","JER","LAM","EZK","DAN","HOS","JOL","AMO","OBA","JON","MIC","NAM","HAB","ZEP","HAG","ZEC","MAL","MAT","MRK","LUK","JHN","ACT","ROM","1CO","2CO","GAL","EPH","PHP","COL","1TH","2TH","1TI","2TI","TIT","PHM","HEB","JAS","1PE","2PE","1JN","2JN","3JN","JUD","REV","TOB","JDT","ESG","WIS","SIR","BAR","LJE","S3Y","SUS","BEL","1MA","2MA","3MA","4MA","1ES","2ES","MAN","PS2","ODA","PSS","JSA","JDB","TBS","SST","DNT","BLT","EZA","5EZ","6EZ","DAG","PS3","2BA","LBA","JUB","ENO","1MQ","2MQ","3MQ","REP","4BA","LAO"],z=()=>{const e={};for(const[n,t]of Object.entries(F))e[t]=parseInt(n);return e},Y=e=>{const n={};for(let[t,s]of Object.entries(e)){"string"==typeof s&&(s=[s]);const[e,r]=t.split(" "),o=s[0].split(" ")[0],i=o===e?["cv"]:["bcv"];let[c,a]=r.split(":"),l=a;if(a.includes("-")){const e=a.split("-");a=e[0],l=e[1]}i.push([parseInt(a),parseInt(l)]),i.push([]);for(const e of s.map((e=>e.split(" ")[1]))){let[n,t]=e.split(":"),s=t;if(t.includes("-")){const e=t.split("-");t=e[0],s=e[1]}"cv"===i[0]?i[2].push([parseInt(n),parseInt(t),parseInt(s)]):i[2].push([parseInt(n),parseInt(t),parseInt(s),o])}e in n||(n[e]={}),c in n[e]||(n[e][c]=[]),n[e][c].push(i)}return n},_=(e,n)=>{const t=(e,n)=>n+64*e,s=new P(64);for(const[r,[o,i],c]of e){const e=s.length,a="bcv"===r?3:2;if(s.pushNBytes([0,o,i]),3===a){const e=n[c[0][3]];s.pushNByte(e)}s.pushNByte(c.length);for(const[e,n]of c)s.pushNBytes([e,n]);const l=s.length-e;if(l>63)throw new Error(`Mapping in succinctifyVerseMapping ${JSON.stringify(c)} is too long (${l} bytes)`);s.setByte(e,t(a,l))}return s.trim(),s},Q=(e,n)=>{const t=e.byte(n);return[t>>6,t%64]};const ee=(y={ByteArray:P,canons:T,enums:O,generateId:G,graftDefs:x,inspect:C,itemDefs:L={itemEnum:V,itemEnumLabels:K,itemArray2Object:U,itemObject2Array:X,itemArrays2Objects:e=>e.map((e=>U(e))),itemObjects2Arrays:e=>e.map((e=>X(e)))},parserConstants:{usfm:{baseSequenceTypes:{main:"1",introduction:"*",introTitle:"?",introEndTitle:"?",title:"?",endTitle:"?",heading:"*",header:"*",remark:"*",sidebar:"*",table:"*",tree:"*",kv:"*"},inlineSequenceTypes:{footnote:"*",noteCaller:"*",xref:"*",pubNumber:"*",altNumber:"*",esbCat:"*",fig:"*",temp:"?"}}},scopeDefs:D,succinct:N,tags:{validateTags:e=>{for(const n of e)Z(n)},validateTag:Z,addTag:(e,n)=>{Z(n),e.add(n)},removeTag:(e,n)=>{Z(n),e.delete(n)}},tokenDefs:q,versification:{vrs2json:n=>{const t={};for(const s of n.split(/[\n\r]+/).map((e=>e.trim())).map((n=>e.exec(n,e("^([A-Z1-6]{3} [0-9]+:[0-9]+(-[0-9]+)?) = ([A-Z1-6]{3} [0-9]+:[0-9]+[a-z]?(-[0-9]+)?)$")))))s&&(s[1]in t||(t[s[1]]=[]),t[s[1]].push(s[3]));return{mappedVerses:t}},reverseVersification:e=>{const n={};for(const[t,s]of Object.entries(e.mappedVerses))for(const e of s)e in n?n[e].push(t):n[e]=[t];return{reverseMappedVerses:n}},preSuccinctVerseMapping:Y,bookCodes:F,succinctifyVerseMapping:_,succinctifyVerseMappings:e=>{const n={},t=z();for(const[s,r]of Object.entries(Y(e))){n[s]={};for(const[e,o]of Object.entries(r))n[s][e]=_(o,t)}return n},unsuccinctifyVerseMapping:(e,n,t)=>{const s=[];let r=0;for(;r<e.length;){let t=r;const o={},[i,c]=Q(e,r);if(t++,o.fromVerseStart=e.nByte(t),t+=e.nByteLength(o.fromVerseStart),o.fromVerseEnd=e.nByte(t),t+=e.nByteLength(o.fromVerseEnd),o.bookCode=n,3===i){const n=e.nByte(t);o.bookCode=F[n],t+=e.nByteLength(n)}const a=e.nByte(t);t+=e.nByteLength(a);const l=[];for(;l.length<a;){const n={};n.ch=e.nByte(t),t+=e.nByteLength(n.ch),n.verseStart=e.nByte(t),t+=e.nByteLength(n.verseStart),l.push(n)}o.mapping=l,s.push(o),r+=c}return s},bookCodeIndex:z,mapVerse:(e,n,t,s)=>{let r=null,o=0;for(;o<e.length;){let t=o;const[i,c]=Q(e,o);t++;const a=e.nByte(t);t+=e.nByteLength(a);const l=e.nByte(t);if(t+=e.nByteLength(l),s<a||s>l){o+=c;continue}let u=n;if(3===i){const n=e.nByte(t);u=F[n],t+=e.nByteLength(n)}r=[u,[]];const S=e.nByte(t);for(t+=e.nByteLength(S);r[1].length<S;){const n=e.nByte(t);t+=e.nByteLength(n);const o=e.nByte(t);t+=e.nByteLength(o),r[1].push([n,s-a+o])}break}return r||[n,[[t,s]]]}}}).ByteArray,{addTag:ne,removeTag:te,validateTags:se}=y.tags,{succinctGraftName:re,succinctGraftSeqId:oe,succinctScopeLabel:ie,succinctTokenChars:ce,headerBytes:ae,enumIndex:le,enumIndexes:ue}=y.succinct,{itemEnum:Se}=y.itemDefs,{tokenEnumLabels:he}=y.tokenDefs;var pe,de={validateSelectors:(n,t)=>{if("object"!=typeof t)throw new Error("DocSet constructor expects selectors to be object, found "+typeof n.selectors);const s={};for(const e of n.processor.selectors)s[e.name]=e;for(const[n,r]of Object.entries(t)){if(!(n in s))throw new Error(`Unexpected selector '${n}' (expected one of [${Object.keys(s).join(", ")}])`);if("string"==typeof r&&"string"!==s[n].type||"number"==typeof r&&"integer"!==s[n].type)throw new Error(`Selector '${n}' is of type ${typeof r} (expected ${s[n].type})`);if("number"==typeof r){if(!Number.isInteger(r))throw new Error(`Value '${r}' of integer selector '${n}' is not an integer`);if("min"in s[n]&&r<s[n].min)throw new Error(`Value '${r}' is less than ${s[n].min}`);if("max"in s[n]&&r>s[n].max)throw new Error(`Value '${r}' is greater than ${s[n].max}`)}else if("regex"in s[n]&&!e.exec(r,e(s[n].regex),0))throw new Error(`Value '${r}' does not match regex '${s[n].regex}'`);if("enum"in s[n]&&!s[n].enum.includes(r))throw new Error(`Value '${r}' of selector '${n}' is not in enum`)}for(const e of Object.keys(s))if(!(e in t))throw new Error(`Expected selector '${e}' not found`);return t}}.validateSelectors;var fe,me=(pe={blocksWithScriptureCV:(n,t,s)=>{if(e.exec(s,e("^[1-9][0-9]*$"))){const e=[`chapter/${s}`];return t.filter((t=>n.allScopesInBlock(t,e)))}if(e.exec(s,e("^[1-9][0-9]*-[1-9][0-9]*$"))){const[e,r]=s.split("-").map((e=>parseInt(e)));if(e>r)throw new Error(`Chapter range must be from min to max, not '${s}'`);const o=[...Array(r-e+1).keys()].map((n=>`chapter/${n+e}`));return t.filter((e=>n.anyScopeInBlock(e,o)))}if(e.exec(s,e("^[1-9][0-9]*:[0-9]+$"))){const[e,r]=s.split(":").map((e=>parseInt(e)));if(0===r){const s=[`chapter/${e}`];return t.filter((e=>n.allScopesInBlock(e,s))).filter((e=>0===[...n.allBlockScopes(e)].filter((e=>e.startsWith("verse"))).length))}{const s=[`chapter/${e}`,`verse/${r}`];return t.filter((e=>n.allScopesInBlock(e,s)))}}if(e.exec(s,e("^[1-9][0-9]*:[0-9]+-[1-9][0-9]*$"))){const[e,r]=s.split(":"),[o,i]=r.split("-").map((e=>parseInt(e)));if(o>i)throw new Error(`Verse range must be from min to max, not '${r}'`);const c=[`chapter/${e}`],a=[...Array(i-o+1).keys()].map((e=>`verse/${e+o}`));return t.filter((e=>n.allScopesInBlock(e,c))).filter((e=>n.anyScopeInBlock(e,a)||0===o&&0===[...n.allBlockScopes(e)].filter((e=>e.startsWith("verse"))).length))}if(e.exec(s,e("^[1-9][0-9]*:[0-9]+-[1-9][0-9]*:[0-9]+$"))){const[e,r]=s.split("-"),[o,i]=e.split(":").map((e=>parseInt(e))),[c,a]=r.split(":").map((e=>parseInt(e)));if(o>c)throw new Error(`Chapter range must be from min to max, not '${o}-${a}'`);const l=[...Array(c-o+1).keys()].map((e=>`chapter/${e+o}`));return t.filter((e=>n.anyScopeInBlock(e,l))).filter((e=>((e,t,s)=>[...n.unsuccinctifyScopes(e.os).map((e=>e[2])),...n.unsuccinctifyScopes(e.is).map((e=>e[2]))].filter((e=>e.startsWith("chapter/"))).map((e=>parseInt(e.split("/")[1]))).filter((e=>e>t&&e<s)).length>0)(e,o,c)||((e,t,s)=>[...n.unsuccinctifyScopes(e.os).map((e=>e[2])),...n.unsuccinctifyScopes(e.is).map((e=>e[2]))].includes(`chapter/${t}`)&&n.blockHasMatchingItem(e,((e,n)=>!!n.has(`chapter/${t}`)&&(Array.from(n).filter((e=>e.startsWith("verse/"))).filter((e=>parseInt(e.split("/")[1])>=s)).length>0||0===s&&"token"===e[0]&&e[2]&&0===Array.from(n).filter((e=>e.startsWith("verse"))).length)),{}))(e,o,i)||((e,t,s)=>[...n.unsuccinctifyScopes(e.os).map((e=>e[2])),...n.unsuccinctifyScopes(e.is).map((e=>e[2]))].includes(`chapter/${t}`)&&n.blockHasMatchingItem(e,((e,n)=>!!n.has(`chapter/${t}`)&&(Array.from(n).filter((e=>e.startsWith("verse/"))).filter((e=>parseInt(e.split("/")[1])<=s)).length>0||0===s&&"token"===e[0]&&e[2]&&0===Array.from(n).filter((e=>e.startsWith("verse"))).length)),{}))(e,c,a)))}throw new Error(`Bad cv reference '${s}'`)},allBlockScopes:(e,n)=>{const[t,s,r]=y.succinct.headerBytes(n.bs,0),o=e.unsuccinctifyScope(n.bs,s,r,0);return new Set([...e.unsuccinctifyScopes(n.os).map((e=>e[2])),...e.unsuccinctifyScopes(n.is).map((e=>e[2])),o[2]])},anyScopeInBlock:(e,n,t)=>{const s=e.allBlockScopes(n);for(const e of t)if(s.has(e))return!0;return!1},allScopesInBlock:(e,n,t)=>{const s=e.allBlockScopes(n);for(const e of t)if(!s.has(e))return!1;return!0},blockHasBlockScope:(e,n,t)=>{const[s,r,o]=y.succinct.headerBytes(n.bs,0);return e.unsuccinctifyScope(n.bs,r,o,0)[2]===t},blockHasChars:(e,n,t)=>{let s=!1,r=0;const o=n.c;if(t.includes(-1))return!1;for(;!s&&r<o.length;){const[e,n]=y.succinct.headerBytes(o,r);n===y.itemDefs.itemEnum.token&&t.includes(o.nByte(r+2))&&(s=!0),r+=e}return s},blockHasMatchingItem:(e,n,t,s)=>{const r=new Set(e.unsuccinctifyScopes(n.os).map((e=>e[2])));for(const o of e.unsuccinctifyItems(n.c,s,0)){if("scope"===o[0]&&"start"===o[1]&&r.add(o[2]),t(o,r))return!0;"scope"===o[0]&&"end"===o[1]&&r.delete(o[2])}return!1}}).blocksWithScriptureCV,ge=pe.allBlockScopes,Ae=pe.anyScopeInBlock,Ee=pe.allScopesInBlock,be=pe.blockHasBlockScope,ye=pe.blockHasChars,Pe=pe.blockHasMatchingItem;var ke,Ie=(fe={unsuccinctifyBlock:(e,n,t)=>{e.maybeBuildEnumIndexes();const s=n.bs,[r,o,i]=y.succinct.headerBytes(s,0),c=e.unsuccinctifyScope(s,o,i,0),a=e.unsuccinctifyGrafts(n.bg),l=e.unsuccinctifyScopes(n.os),u=e.unsuccinctifyScopes(n.is),S=n.nt.nByte(0);return{bs:c,bg:a,c:e.unsuccinctifyItems(n.c,t||{},S),os:l,is:u,nt:S}},unsuccinctifyItem:(e,n,t,s)=>{let r=null;const[o,i,c]=y.succinct.headerBytes(n,t);switch(i){case y.itemDefs.itemEnum.token:(0===Object.keys(s).length||s.tokens)&&(r=e.unsuccinctifyToken(n,c,t));break;case y.itemDefs.itemEnum.startScope:case y.itemDefs.itemEnum.endScope:(0===Object.keys(s).length||s.scopes)&&(r=e.unsuccinctifyScope(n,i,c,t));break;case y.itemDefs.itemEnum.graft:(0===Object.keys(s).length||s.grafts)&&(r=e.unsuccinctifyGraft(n,c,t))}return[r,o]},unsuccinctifyItems:(e,n,t,s,r)=>{if(void 0===s)throw new Error("nextToken (previously includeContext) must now be provided to unsuccinctifyItems");if(null!==s&&"number"!=typeof s)throw new Error(`nextToken (previously includeContext) must be null or an integer, not ${typeof s} '${JSON.stringify(s)}' in unsuccinctifyItems`);const o=[];let i=0,c=s||0;const a=new Set(r||[]);for(;i<n.length;){const[r,l]=e.unsuccinctifyItem(n,i,{});"token"===r[0]?(0===Object.keys(t).length||t.tokens)&&(null!==s&&(r.push("token"===r[0]&&"wordLike"===r[1]?c++:null),r.push([...a])),o.push(r)):"scope"===r[0]&&"start"===r[1]?(a.add(r[2]),(0===Object.keys(t).length||t.scopes)&&o.push(r)):"scope"===r[0]&&"end"===r[1]?(a.delete(r[2]),(0===Object.keys(t).length||t.scopes)&&o.push(r)):"graft"===r[0]&&(0===Object.keys(t).length||t.grafts)&&o.push(r),i+=l}return o},unsuccinctifyItemsWithScriptureCV:(n,t,s,r)=>{r=r||{};const o=new Set(n.unsuccinctifyScopes(t.os).map((e=>e[2]))),i=(()=>{if(e.exec(s,e("^[1-9][0-9]*$")))return()=>o.has(`chapter/${s}`);if(e.exec(s,e("^[1-9][0-9]*-[1-9][0-9]*$")))return()=>{const[e,n]=s.split("-").map((e=>parseInt(e)));if(e>n)throw new Error(`Chapter range must be from min to max, not '${s}'`);for(const t of[...Array(n-e+1).keys()].map((n=>`chapter/${n+e}`)))if(o.has(t))return!0;return!1};if(e.exec(s,e("^[1-9][0-9]*:[0-9]+$")))return()=>{const[e,n]=s.split(":").map((e=>parseInt(e)));if(0===n)return o.has(`chapter/${e}`)&&0===[...o].filter((e=>e.startsWith("verse"))).length;for(const t of[`chapter/${e}`,`verse/${n}`])if(!o.has(t))return!1;return!0};if(e.exec(s,e("^[1-9][0-9]*:[0-9]+-[1-9][0-9]*$")))return()=>{const[e,n]=s.split(":"),[t,r]=n.split("-").map((e=>parseInt(e)));if(t>r)throw new Error(`Verse range must be from min to max, not '${n}'`);const i=`chapter/${e}`,c=[...Array(r-t+1).keys()].map((e=>`verse/${e+t}`));if(!o.has(i))return!1;for(const e of c)if(o.has(e))return!0;return 0===t&&0===[...o].filter((e=>e.startsWith("verse"))).length};if(e.exec(s,e("^[1-9][0-9]*:[0-9]+-[1-9][0-9]*:[0-9]+$")))return()=>{const[e,n]=s.split("-"),[t,r]=e.split(":").map((e=>parseInt(e))),[i,c]=n.split(":").map((e=>parseInt(e)));if(t>i)throw new Error(`Chapter range must be from min to max, not '${t}-${c}'`);const a=[...o],l=a.filter((e=>e.startsWith("chapter/")));if(l.length>1)throw new Error(`Expected zero or one chapter for item, found ${l.length}`);const u=parseInt(l[0].split("/")[1]);return!(u<t||u>i)&&(u===t?a.filter((e=>e.startsWith("verse/")&&parseInt(e.split("/")[1])>=r)).length>0||0===r&&0===a.filter((e=>e.startsWith("verse"))).length:u!==i||(a.filter((e=>e.startsWith("verse/")&&parseInt(e.split("/")[1])<=c)).length>0||0===c&&0===a.filter((e=>e.startsWith("verse"))).length))};throw new Error(`Bad cv reference '${s}'`)})(),c=e=>{if(r&&0!==Object.keys(r).length){const n=e[0];return"token"===n&&"tokens"in r||"graft"===n&&"grafts"in r||"scope"===n&&"scopes"in r}return!0},a=[];for(const e of n.unsuccinctifyItems(t.c,{},t.nt.nByte(0)))"scope"===e[0]&&"start"===e[1]&&o.add(e[2]),i()&&c(e)&&a.push(e),"scope"===e[0]&&"end"===e[1]&&o.delete(e[2]);return a},unsuccinctifyPrunedItems:(e,n,t)=>{const s=new Set(e.unsuccinctifyScopes(n.os).map((e=>e[2]))),r=t.requiredScopes||[],o=t.anyScope||!1?()=>{for(const e of r)if(s.has(e))return!0;return 0===r.length}:()=>{for(const e of r)if(!s.has(e))return!1;return!0},i=e=>!t.withChars||0===t.withChars.length||"token"===e[0]&&t.withChars.includes(e[2]),c=[];for(const r of e.unsuccinctifyItems(n.c,t,n.nt.nByte(0),s))"scope"===r[0]&&"start"===r[1]&&s.add(r[2]),o()&&i(r)&&c.push(r),"scope"===r[0]&&"end"===r[1]&&s.delete(r[2]);return c}}).unsuccinctifyBlock,we=fe.unsuccinctifyItems,Te=fe.unsuccinctifyItem,ve=fe.unsuccinctifyPrunedItems,Be=fe.unsuccinctifyItemsWithScriptureCV;var Oe,xe=(ke={buildPreEnum:(e,n)=>{const t=new Map;let s=0,r=0;for(;s<n.length;)t.set(n.countedString(s),{enum:r++,frequency:0}),s+=n.byte(s)+1;return t},recordPreEnum:(e,n,t)=>{if(!(n in e.preEnums))throw new Error(`Unknown category ${n} in recordPreEnum. Maybe call buildPreEnums()?`);t.length>255&&console.log("Value length of",t.length,"in recordPreEnum"),e.preEnums[n].has(t)?e.preEnums[n].get(t).frequency++:e.preEnums[n].set(t,{enum:e.preEnums[n].size,frequency:1})},buildEnum:(e,n,t)=>{const s=new Map([...t.entries()]);for(const t of s.keys())t.length>255&&console.log("enum text for",n,"has length",t.length,"in buildEnum - truncating"),e.enums[n].pushCountedString(t.substring(0,255));e.enums[n].trim()},enumForCategoryValue:(e,n,t,s)=>{if(s||(s=!1),!(n in e.preEnums))throw new Error(`Unknown category ${n} in preEnums. Maybe call buildPreEnums()?`);if(e.preEnums[n].has(t))return e.preEnums[n].get(t).enum;if(s)return e.preEnums[n].set(t,{enum:e.preEnums[n].size,frequency:1}),e.enums[n].pushCountedString(t),e.buildEnumIndex(n),e.preEnums[n].get(t).enum;throw new Error(`Unknown value '${t}' for category ${n} in enumForCategoryValue. Maybe call buildPreEnums()?`)}}).buildPreEnum,Ge=ke.recordPreEnum,Ce=ke.buildEnum,Ne=ke.enumForCategoryValue;var qe,Re=(Oe={countItems:(e,n)=>{let t=0,s=0;for(;s<n.length;){t++;s+=63&n.byte(s)}return t},itemsByIndex:(e,n,t,s)=>{let r=[];if(!t)return r;let o=t.startBlock,i=t.nextToken;for(;o<=t.endBlock;){let c=e.unsuccinctifyItems(n.blocks[o].c,{},i);const a=e.unsuccinctifyScopes(n.blocks[o].bs)[0],l=e.unsuccinctifyGrafts(n.blocks[o].bg);if(o===t.startBlock&&o===t.endBlock?c=c.slice(t.startItem,t.endItem+1):o===t.startBlock?c=c.slice(t.startItem):o===t.endBlock&&(c=c.slice(0,t.endItem+1)),s){let e=[];for(const n of c)e.push(n.concat(["token"===n[0]&&"wordLike"===n[1]?i++:null]));c=e}r.push([...l,["scope","start",a[2]],...c,["scope","end",a[2]]]),o++}return r},sequenceItemsByMilestones:(e,n,t)=>{let s=new Set([]);const r=e=>"scope"===e[0]&&"start"===e[1]&&t.includes(e[2]);e.maybeBuildEnumIndexes();const o=[[[],[]]];for(const i of n){const[n,c,a]=y.succinct.headerBytes(i.bs,0),l=e.unsuccinctifyScope(i.bs,c,a,0)[2],u=e.unsuccinctifyGrafts(i.bg);s.add(l),e.unsuccinctifyScopes(i.os).forEach((e=>s.add(e[2])));const S=u.concat([l].concat(e.unsuccinctifyItems(i.c,{},i.nt.nByte(0))));for(const e of S){if("scope"===e[0]&&"start"===e[1]&&s.add(e[2]),r(e)){o[o.length-1][0]=[...s].sort(),o.push([[],[]]);for(const e of[...s].filter((e=>["blockTag","verse","verses","chapter"].includes(e.split("/")[0])||t.includes(e))))s.delete(e);s.add(l)}o[o.length-1][1].push(e)}o[o.length-1][1].push(["scope","end",l]),o[o.length-1][1].push(["token","punctuation","\n"])}return o[o.length-1][0]=[...s].sort(),o},sequenceItemsByScopes:(e,n,t)=>{let s=[];const r=()=>{for(const e of t)if(!o(e))return!1;return!0},o=e=>{for(const n of s)if(n.startsWith(e))return n;return null};e.maybeBuildEnumIndexes();const i=[];let c=new Set([]),a=!0;for(const[t,o]of n.entries()){const[l,u,S]=y.succinct.headerBytes(o.bs,0),h=e.unsuccinctifyScope(o.bs,u,S,0)[2],p=["scope","start",h],d=["scope","end",h],f=e.unsuccinctifyGrafts(o.bg);s=new Set(e.unsuccinctifyScopes(o.os).map((e=>e[2])).concat([h]));for(const l of f.concat([p,...e.unsuccinctifyItems(o.c,{},o.nt.nByte(0),s),d]).concat(t!==n.length-1?[["token","lineSpace"," "]]:[])){if("scope"===l[0]&&"start"===l[1]&&c.add(l[2]),"token"===l[0]&&c.size>0){for(const e of Array.from(c))s.add(e);c.clear()}r()?(a&&i.push([[...s],[]]),i[i.length-1][1].push(l),a=!1):a=!0,"scope"===l[0]&&"end"===l[1]&&(s.delete(l[2]),c.delete(l[2]))}}return i}}).countItems,Me=Oe.itemsByIndex,De=Oe.sequenceItemsByScopes,$e=Oe.sequenceItemsByMilestones;var Je,He=(qe={rehash:e=>{e.preEnums={};for(const n of Object.keys(e.enums))e.preEnums[n]=new Map;e.maybeBuildEnumIndexes();for(const n of e.documents())for(const t of Object.values(n.sequences))n.rerecordPreEnums(e,t);e.sortPreEnums();const n=e.makeRehashEnumMap();for(const t of e.documents())for(const e of Object.values(t.sequences))t.rewriteSequenceBlocks(e.id,n);return e.buildEnums(),e.buildEnumIndexes(),!0},makeRehashEnumMap:e=>{const n={};for(const[t,s]of Object.entries(e.enums)){n[t]=[];let r=0;for(;r<s.length;){const o=s.byte(r),i=s.countedString(r);e.preEnums[t].has(i)?n[t].push(e.preEnums[t].get(i).enum):n[t].push(null),r+=o+1}}return n}}).rehash,Le=qe.makeRehashEnumMap;const Ve=y.ByteArray,{pushSuccinctGraftBytes:Ke,pushSuccinctScopeBytes:Ue,pushSuccinctTokenBytes:Xe}=y.succinct,{itemEnum:je}=y.itemDefs,{scopeEnum:We}=y.scopeDefs,{tokenCategory:Ze,tokenEnum:Fe}=y.tokenDefs,ze=(e,n,t,s,r,o)=>{const i=e.processor.documents[n];if(!i)throw new Error(`Document '${n}' not found`);let c;if(t){if(c=i.sequences[t],!c)throw new Error(`Sequence '${t}' not found`)}else c=i.sequences[i.mainId];if(c.blocks.length<=s)throw new Error(`Could not find block ${s} (length=${c.blocks.length})`);const a=c.blocks[s],l=new Ve(o.length);e.maybeBuildPreEnums();let u=0;s<0&&(u=c.blocks[s-1].nt.nByte(0));let S,h,p,d,f,m=null;for(const n of o)switch(n.type){case"token":S=e.enumForCategoryValue(Ze[n.subType],n.payload,!0),Xe(l,Fe[n.subType],S),u++;break;case"graft":h=e.enumForCategoryValue("graftTypes",n.subType,!0),p=e.enumForCategoryValue("ids",n.payload,!0),Ke(l,h,p);break;case"scope":if(d=n.payload.split("/"),f=We[d[0]],!f&&0!==f)throw new Error(`"${d[0]}" is not a scope type`);m=d.slice(1).map((n=>e.enumForCategoryValue("scopeBits",n,!0))),Ue(l,je[`${n.subType}Scope`],f,m)}return l.trim(),a[r]=l,"c"===r&&(a.nt.clear(),a.nt.pushNByte(u)),!0};var Ye=(Je={updateItems:(e,n,t,s,r)=>ze(e,n,t,s,"c",r),updateBlockGrafts:(e,n,t,s,r)=>ze(e,n,t,s,"bg",r),updateBlockScope:(e,n,t,s,r)=>ze(e,n,t,s,"bs",[r]),updateOpenScopes:(e,n,t,s,r)=>ze(e,n,t,s,"os",r),updateIncludedScopes:(e,n,t,s,r)=>ze(e,n,t,s,"is",r),updateBlockIndexesAfterEdit:(e,n,t)=>{const s=(e,n,t)=>{const s=t.split("/"),r=We[s[0]];if(!r&&0!==r)throw new Error(`"${s[0]}" is not a scope type`);const o=s.slice(1).map((n=>e.enumForCategoryValue("scopeBits",n,!0)));Ue(n,je.startScope,r,o)},r=n.blocks[t],o=new Set,i=new Set;for(const n of e.unsuccinctifyScopes(r.os))i.add(n[2]);for(const n of e.unsuccinctifyItems(r.c,{scopes:!0},null))"start"===n[1]?(o.add(n[2]),i.add(n[2])):i.delete(n[2]);const c=Array.from(o),a=new Ve(c.length);for(const n of c)s(e,a,n);if(a.trim(),r.is=a,t<n.blocks.length-1){const r=n.blocks[t+1],o=r.os,c=new Set(e.unsuccinctifyScopes(o).map((e=>e[2])));if(!((e,n)=>{for(const t of Array.from(e))if(!n.has(t))return!1;for(const t of Array.from(n))if(!e.has(t))return!1;return!0})(i,c)){const o=new Ve(c.length);for(const n of Array.from(i))s(e,o,n);o.trim(),r.os=o,e.updateBlockIndexesAfterEdit(n,t+1)}}},updateBlockIndexesAfterFilter:(e,n)=>{const t=(e,n,t)=>{const s=t.split("/"),r=We[s[0]];if(!r&&0!==r)throw new Error(`"${s[0]}" is not a scope type`);const o=s.slice(1).map((n=>e.enumForCategoryValue("scopeBits",n,!0)));Ue(n,je.startScope,r,o)},s=new Set;for(const r of n.blocks){const n=Array.from(s),o=new Ve(n.length);for(const s of n)t(e,o,s);o.trim(),r.os=o;const i=new Set;for(const n of e.unsuccinctifyItems(r.c,{scopes:!0},null))"start"===n[1]?(i.add(n[2]),s.add(n[2])):s.delete(n[2]);const c=Array.from(i),a=new Ve(c.length);for(const n of c)t(e,a,n);a.trim(),r.is=a}}}).updateItems,_e=Je.updateBlockGrafts,Qe=Je.updateBlockScope,en=Je.updateOpenScopes,nn=Je.updateIncludedScopes,tn=Je.updateBlockIndexesAfterEdit,sn=Je.updateBlockIndexesAfterFilter;var rn={serializeSuccinct:e=>{const n={id:e.id,metadata:{selectors:e.selectors},enums:{},docs:{},tags:Array.from(e.tags)};for(const[t,s]of Object.entries(e.enums))s.trim(),n.enums[t]=s.base64();n.docs={};for(const t of e.docIds)n.docs[t]=e.processor.documents[t].serializeSuccinct();return n}}.serializeSuccinct;var on,cn,an={DocSet:class{constructor(e,n,t,s){this.processor=e,this.preEnums={},this.enumIndexes={},this.docIds=[],s?this.fromSuccinct(e,s):this.fromScratch(e,n,t),se(this.tags)}fromScratch(e,n,t){const s=n||e.selectors;this.selectors=de(this,s),this.id=this.selectorString(),this.tags=new Set(t||[]),this.enums={ids:new ee(512),wordLike:new ee(8192),notWordLike:new ee(256),scopeBits:new ee(256),graftTypes:new ee(10)}}fromSuccinct(e,n){const t=e=>{const n=new ee(256);return n.fromBase64(e),n.trim(),n};this.id=n.id,this.selectors=de(this,n.metadata.selectors),this.tags=new Set(n.tags),se(this.tags),this.preEnums={},this.enums={ids:t(n.enums.ids),wordLike:t(n.enums.wordLike),notWordLike:t(n.enums.notWordLike),scopeBits:t(n.enums.scopeBits),graftTypes:t(n.enums.graftTypes)},this.enumIndexes={},this.docIds=[]}addTag(e){ne(this.tags,e)}removeTag(e){te(this.tags,e)}selectorString(){return this.processor.selectorString(this.selectors)}documents(){return this.docIds.map((e=>this.processor.documents[e]))}documentWithBook(e){const n=Object.values(this.documents()).filter((n=>"bookCode"in n.headers&&n.headers.bookCode===e));return 1===n.length?n[0]:null}maybeBuildPreEnums(){0===Object.keys(this.preEnums).length&&this.buildPreEnums()}buildPreEnums(){for(const[e,n]of Object.entries(this.enums))this.preEnums[e]=xe(this,n)}recordPreEnum(e,n){Ge(this,e,n)}sortPreEnums(){for(const e of Object.keys(this.preEnums)){this.preEnums[e]=new Map([...this.preEnums[e].entries()].sort(((e,n)=>n[1].frequency-e[1].frequency)));let n=0;for(const[t,s]of this.preEnums[e])s.enum=n++}}enumForCategoryValue(e,n,t){return Ne(this,e,n,t)}buildEnums(){for(const[e,n]of Object.entries(this.preEnums))this.enums[e].clear(),this.buildEnum(e,n)}buildEnum(e,n){Ce(this,e,n)}maybeBuildEnumIndexes(){0===Object.keys(this.enumIndexes).length&&this.buildEnumIndexes()}buildEnumIndexes(){this.enumIndexes=ue(this.enums)}buildEnumIndex(e){this.enumIndexes[e]=le(e,this.enums[e])}unsuccinctifyBlock(e,n){return Ie(this,e,n)}unsuccinctifyItems(e,n,t,s){return we(this,e,n,t,s)}unsuccinctifyItem(e,n,t){return Te(this,e,n,t)}unsuccinctifyPrunedItems(e,n){return ve(this,e,n)}unsuccinctifyScopes(e){const n=[];let t=0;for(;t<e.length;){const[s,r,o]=ae(e,t);n.push(this.unsuccinctifyScope(e,r,o,t)),t+=s}return n}unsuccinctifyGrafts(e){const n=[];let t=0;for(;t<e.length;){const[s,r,o]=ae(e,t);n.push(this.unsuccinctifyGraft(e,o,t)),t+=s}return n}unsuccinctifyToken(e,n,t){try{return["token",he[n],this.succinctTokenChars(e,n,t)]}catch(e){throw new Error(`Error from unsuccinctifyToken: ${e}`)}}unsuccinctifyScope(e,n,t,s){try{return["scope",n===Se.startScope?"start":"end",this.succinctScopeLabel(e,t,s)]}catch(e){throw new Error(`Error from unsuccinctifyScope: ${e}`)}}unsuccinctifyGraft(e,n,t){try{return["graft",this.succinctGraftName(n),this.succinctGraftSeqId(e,t)]}catch(e){throw new Error(`Error from unsuccinctifyGraft: ${e}`)}}unsuccinctifyBlockScopeLabelsSet(e){const[n,t,s]=ae(e.bs,0),r=this.unsuccinctifyScope(e.bs,t,s,0);return new Set(this.unsuccinctifyScopes(e.os).concat(this.unsuccinctifyScopes(e.is)).concat([r]).map((e=>e[2])))}unsuccinctifyItemsWithScriptureCV(e,n,t){return Be(this,e,n,t)}succinctTokenChars(e,n,t){return ce(this.enums,this.enumIndexes,e,n,t)}succinctScopeLabel(e,n,t){return ie(this.enums,this.enumIndexes,e,n,t)}succinctGraftName(e){return re(this.enums,this.enumIndexes,e)}succinctGraftSeqId(e,n){return oe(this.enums,this.enumIndexes,e,n)}countItems(e){return Re(this,e)}itemsByIndex(e,n,t){return Me(this,e,n,t)}blocksWithScriptureCV(e,n){return me(this,e,n)}allBlockScopes(e){return ge(this,e)}allScopesInBlock(e,n){return Ee(this,e,n)}anyScopeInBlock(e,n){return Ae(this,e,n)}blockHasBlockScope(e,n){return be(this,e,n)}blockHasChars(e,n){return ye(this,e,n)}blockHasMatchingItem(e,n,t){return Pe(this,e,n,t)}sequenceItemsByScopes(e,n){return De(this,e,n)}sequenceItemsByMilestones(e,n){return $e(this,e,n)}rehash(){return He(this)}makeRehashEnumMap(){return Le(this)}updateItems(e,n,t,s){return Ye(this,e,n,t,s)}updateBlockGrafts(e,n,t,s){return _e(this,e,n,t,s)}updateBlockScope(e,n,t,s){return Qe(this,e,n,t,s)}updateOpenScopes(e,n,t,s){return en(this,e,n,t,s)}updateIncludedScopes(e,n,t,s){return nn(this,e,n,t,s)}updateBlockIndexesAfterEdit(e,n){tn(this,e,n)}updateBlockIndexesAfterFilter(e){sn(this,e)}serializeSuccinct(){return rn(this)}checksum(){const e=[...this.docIds].sort().join(" ");return s.calculate(e)}}}.DocSet,ln=u.PerfRenderFromProskomma,un=u.SofriaRenderFromProskomma,Sn=u.render,hn=u.PipelineHandler;const pn=[["chapter","chapter",e("([\\r\\n]*\\\\c[ \\t]+(\\d+)[ \\t\\r\\n]*)")],["pubchapter","pubchapter",e("([\\r\\n]*\\\\cp[ \\t]+([^\\r\\n]+)[ \\t\\r\\n]*)")],["verses","verses",e("(\\\\v[ \\t]+([\\d\\-]+)[ \\t\\r\\n]*)")],["attribute","attribute",e('([ \\t]*\\|?[ \\t]*([A-Za-z0-9\\-]+)="([^"]*)"[ \\t]?)')],["attribute","defaultAttribute",e("([ \\t]*\\|[ \\t]*([^\\|\\\\]*))")],["milestone","emptyMilestone",e("(\\\\([a-z1-9]+)\\\\[*])")],["milestone","startMilestoneTag",e("(\\\\([a-z1-9]+)-([se]))")],["milestone","endMilestoneMarker",e("(\\\\([*]))")],["tag","endTag",e("(\\\\([+]?[a-z\\-]+)([1-9]?(-([1-9]))?)[*])")],["tag","startTag",e("(\\\\([+]?[a-z\\-]+)([1-9]?(-([1-9]))?)[ \\t]?)")],["bad","bareSlash",e("(\\\\)")],["printable","eol",e("([ \\t]*[\\r\\n]+[ \\t]*)")],["break","noBreakSpace",e("~")],["break","softLineBreak",e("//")],["printable","wordLike",e("([\\p{Letter}\\p{Number}\\p{Mark}\\u2060]{1,127})")],["printable","lineSpace",e("([\\p{Separator}\t]{1,127})")],["printable","punctuation",e("([\\p{Punctuation}\\p{Math_Symbol}\\p{Currency_Symbol}\\p{Modifier_Symbol}\\p{Other_Symbol}])")],["bad","unknown",e("(.)")]],dn=e.union(pn.map((e=>e[2])));var fn,mn=(cn={lexingRegexes:pn,mainRegex:dn}).lexingRegexes,gn=cn.mainRegex;const An=(e,n)=>({subclass:e,printValue:n[0]}),En={printable:An,chapter:(e,n)=>({subclass:e,numberString:n[2],number:parseInt(n[2]),printValue:`\\c ${n[2]}\n`}),pubchapter:(e,n)=>({subclass:e,numberString:n[2],printValue:`\\cp ${n[2]}\n`}),verses:(e,n)=>{const t={subclass:e,numberString:n[2],printValue:`\\v ${n[2]}\n`};if(t.numberString.includes("-")){const[e,n]=t.numberString.split("-").map((e=>parseInt(e)));t.numbers=Array.from(Array(n-e+1).keys()).map((n=>n+e))}else t.numbers=[parseInt(t.numberString)];return t},tag:(e,n)=>{const t={subclass:e,tagName:n[2],isNested:!1};return t.tagName.startsWith("+")&&(t.isNested=!0,t.tagName=t.tagName.substring(1)),t.tagLevel=""!==n[3]?parseInt(n[3]):1,t.fullTagName=`${t.tagName}${"1"===n[3]?"":n[3]}`,t.printValue="startTag"===e?`\\${t.fullTagName} `:`\\${t.fullTagName}*`,t},break:An,milestone:(e,n)=>{const t={subclass:e,sOrE:null};return"endMilestoneMarker"===e?t.printValue="\\*":(t.tagName=n[2],"emptyMilestone"===e?t.printValue=`\\${t.tagName}\\*`:(t.printValue=`\\${t.tagName}`,t.sOrE=n[3])),t},attribute:(e,n)=>{let t;return t="defaultAttribute"===e?{subclass:e,key:"default",valueString:n[2].trim().replace(/\//g,"÷")}:{subclass:e,key:n[2],valueString:n[3].trim().replace(/\//g,"÷")},t.values=t.valueString.split(",").map((e=>e.trim())),t.printValue=`| ${t.key}="${t.valueString}"`,t},bad:An};var bn=(fn={constructorForFragment:En,preTokenObjectForFragment:(n,t)=>{for(let s=0;s<t.length;s++){let[r,o,i]=t[s],c=e.exec(n,i,0,"sticky");if(c)return En[r](o,c)}throw new Error(`Could not match preToken fragment '${n}'`)}}).preTokenObjectForFragment;var yn={parseUsfm:(n,t)=>{const s=e.match(n,gn,"all");for(let e=0;e<s.length;e++)t.parseItem(bn(s[e],mn))}}.parseUsfm,Pn=cn.lexingRegexes,kn=cn.mainRegex,In=fn.preTokenObjectForFragment,wn=fn.constructorForFragment;var Tn={UsxLexer:class{constructor(){this.sax=S.parser(!0),this.sax.ontext=e=>this.handleSaxText(e),this.sax.onopentag=e=>this.handleSaxOpenTag(e),this.sax.onclosetag=e=>this.handleSaxCloseTag(e),this.lexed=[],this.elementStack=[],this.currentText="",this.openTagHandlers={usx:this.ignoreHandler,book:this.handleBookOpen,chapter:this.handleChapter,verse:this.handleVerses,para:this.handleParaOpen,table:this.ignoreHandler,row:this.handleRowOpen,cell:this.handleCellOpen,char:this.handleCharOpen,ms:this.handleMSOpen,note:this.handleNoteOpen,sidebar:this.handleSidebarOpen,periph:this.notHandledHandler,figure:this.handleFigureOpen,optbreak:this.handleOptBreakOpen,ref:this.ignoreHandler},this.closeTagHandlers={usx:this.ignoreHandler,book:this.handleBookClose,chapter:this.ignoreHandler,verse:this.ignoreHandler,para:this.handleParaClose,table:this.ignoreHandler,row:this.handleRowClose,cell:this.handleCellClose,char:this.handleCharClose,ms:this.handleMSClose,note:this.handleNoteClose,sidebar:this.handleSidebarClose,periph:this.notHandledHandler,figure:this.handleFigureClose,optbreak:this.handleOptBreakClose,ref:this.ignoreHandler}}lexAndParse(e,n){this.parser=n,this.lexed=[],this.elementStack=[],this.sax.write(e).close()}handleSaxText(n){this.currentText=this.replaceEntities(n),e.match(this.currentText,kn,"all").map((e=>In(e,Pn))).forEach((e=>this.parser.parseItem(e)))}replaceEntities(e){return e.replace("&lt;","<").replace("&gt;",">").replace("&apos;","'").replace("&quot;",'"').replace("&amp;","&")}handleSaxOpenTag(e){const n=e.name,t=e.attributes;if(!(n in this.openTagHandlers))throw new Error(`Unexpected open element tag '${n}' in UsxParser`);this.openTagHandlers[n](this,"open",n,t)}handleSaxCloseTag(e){this.closeTagHandlers[e](this,"close",e)}notHandledHandler(e,n,t){console.error(`WARNING: ${n} element tag '${t}' is not handled by UsxParser`)}stackPush(e,n){this.elementStack.push([e,n])}stackPop(){return this.elementStack.pop()}splitTagNumber(n){const t=e.exec(n,e("([^1-9]+)(.*)"));return[t[1],t[2].length>0?t[2]:"1"]}ignoreHandler(e,n,t){}handleParaOpen(e,n,t,s){e.currentText="";const[r,o]=e.splitTagNumber(s.style);["cp"].includes(r)||e.parser.parseItem(wn.tag("startTag",[null,null,r,o])),e.stackPush(t,s)}handleParaClose(e){const n=e.stackPop()[1],[t,s]=e.splitTagNumber(n.style);["cp"].includes(t)?e.parser.parseItem(wn.pubchapter("pubchapter",[null,null,e.currentText])):e.parser.parseItem(wn.tag("endTag",[null,null,t,s])),e.currentText=""}handleCharOpen(e,n,t,s){const[r,o]=e.splitTagNumber(s.style);e.parser.parseItem(wn.tag("startTag",[null,null,`+${r}`,o]));const i=["sid","eid","style","srcloc","link-href","link-title","link-id","closed"];for(const[n,t]of Object.entries(s))i.includes(n)||e.parser.parseItem(wn.attribute("attribute",[null,null,n,t]));e.stackPush(t,s)}handleCharClose(e){const n=e.stackPop()[1],[t,s]=e.splitTagNumber(n.style);e.parser.parseItem(wn.tag("endTag",[null,null,`+${t}`,s]))}handleRefOpen(e){e.parser.parseItem(wn.tag("startTag",[null,null,"xt",""]))}handleRefClose(e){e.parser.parseItem(wn.tag("endTag",[null,null,"xt",""]))}handleRowOpen(e,n,t,s){const[r,o]=e.splitTagNumber(s.style);e.parser.parseItem(wn.tag("startTag",[null,null,r,o])),e.stackPush(t,s)}handleRowClose(e){const n=e.stackPop()[1],[t,s]=e.splitTagNumber(n.style);e.parser.parseItem(wn.tag("endTag",[null,null,t,s]))}handleCellOpen(e,n,t,s){const[r,o]=e.splitTagNumber(s.style);e.parser.parseItem(wn.tag("startTag",[null,null,r,o])),e.stackPush(t,s)}handleCellClose(e){const n=e.stackPop()[1],[t,s]=e.splitTagNumber(n.style);e.parser.parseItem(wn.tag("endTag",[null,null,t,s]))}handleBookOpen(e,n,t,s){e.parser.parseItem(wn.tag("startTag",[null,null,"id",""])),e.parser.parseItem(wn.printable("wordLike",[s.code])),e.parser.parseItem(wn.printable("lineSpace",[" "])),e.stackPush(t,s)}handleBookClose(e){e.stackPop(),e.parser.parseItem(wn.tag("endTag",[null,null,"id",""]))}handleChapter(e,n,t,s){s.number&&(e.parser.parseItem(wn.chapter("chapter",[null,null,s.number])),s.pubnumber&&e.parser.parseItem(wn.pubchapter("pubchapter",[null,null,s.pubnumber])),s.altnumber&&(e.parser.parseItem(wn.tag("startTag",[null,null,"+ca",""])),e.parser.parseItem(wn.printable("wordLike",[s.altnumber])),e.parser.parseItem(wn.tag("endTag",[null,null,"+ca",""]))))}handleVerses(e,n,t,s){s.number&&(e.parser.parseItem(wn.verses("verses",[null,null,s.number])),s.pubnumber&&(e.parser.parseItem(wn.tag("startTag",[null,null,"+vp",""])),e.parser.parseItem(wn.printable("wordLike",[s.pubnumber])),e.parser.parseItem(wn.tag("endTag",[null,null,"+vp",""]))),s.altnumber&&(e.parser.parseItem(wn.tag("startTag",[null,null,"+va",""])),e.parser.parseItem(wn.printable("wordLike",[s.altnumber])),e.parser.parseItem(wn.tag("endTag",[null,null,"+va",""]))))}handleNoteOpen(e,n,t,s){e.parser.parseItem(wn.tag("startTag",[null,null,s.style,""])),e.parser.parseItem(wn.printable("punctuation",[s.caller])),e.stackPush(t,s)}handleNoteClose(e){const n=e.stackPop()[1];e.parser.parseItem(wn.tag("endTag",[null,null,n.style,""]))}handleSidebarOpen(e,n,t,s){e.parser.parseItem(wn.tag("startTag",[null,null,"esb",""])),"category"in s&&(e.parser.parseItem(wn.tag("startTag",[null,null,"cat",""])),e.parser.parseItem(wn.printable("wordLike",[s.category])),e.parser.parseItem(wn.tag("endTag",[null,null,"cat",""]))),e.stackPush(t,s)}handleSidebarClose(e){e.stackPop(),e.parser.parseItem(wn.tag("startTag",[null,null,"esbe",""]))}handleMSOpen(n,t,s,r){let o=e.exec(r.style,e("(([a-z1-9]+)-([se]))"));if(o){const e=wn.milestone("startMilestoneTag",[null,null,o[2],o[3]]);n.parser.parseItem(e);const t=["sid","eid","style","srcloc","link-href","link-title","link-id"];for(const[e,s]of Object.entries(r))t.includes(e)||n.parser.parseItem(wn.attribute("attribute",[null,null,e,s]));n.parser.parseItem(wn.milestone("endMilestoneMarker"))}else{const e=wn.milestone("emptyMilestone",[null,null,r.style,""]);n.parser.parseItem(e)}n.stackPush(s,r)}handleMSClose(e){e.stackPop()}handleFigureOpen(e,n,t,s){e.parser.parseItem(wn.tag("startTag",[null,null,"+fig",""]));for(const[n,t]of Object.entries(s)){if("style"===n)continue;const s="file"===n?"src":n;e.parser.parseItem(wn.attribute("attribute",[null,null,s,t]))}e.stackPush(t,s)}handleFigureClose(e){e.stackPop()[1];e.parser.parseItem(wn.tag("endTag",[null,null,"+fig",""]))}handleOptBreakOpen(e,n,t,s){e.parser.parseItem(wn.printable("softLineBreak",["//"])),e.stackPush(t,s)}handleOptBreakClose(e){e.stackPop()}}}.UsxLexer;var vn={parseUsx:(e,n)=>{(new Tn).lexAndParse(e,n)}}.parseUsx;const{labelForScope:Bn}=y.scopeDefs;var On;const xn=y.ByteArray,{pushSuccinctGraftBytes:Gn,pushSuccinctScopeBytes:Cn,pushSuccinctTokenBytes:Nn}=y.succinct,{addTag:qn}=y.tags,{labelForScope:Rn}=y.scopeDefs,{itemEnum:Mn}=y.itemDefs,{scopeEnum:Dn}=y.scopeDefs,{tokenCategory:$n,tokenEnum:Jn}=y.tokenDefs,Hn=class{constructor(e){this.id=y.generateId(),this.type=e,this.tags=new Set([]),this.blocks=[],this.activeScopes=[]}addTag(e){qn(this.tags,e)}plainText(){return this.blocks.map((e=>e.plainText())).join("").trim()}addItem(e){this.lastBlock().addItem(e)}addBlockGraft(e){this.newBlock("hangingGraft"),this.lastBlock().bg.push(e)}lastBlock(){return 0===this.blocks.length&&this.newBlock("orphanTokens"),this.blocks[this.blocks.length-1]}newBlock(e){this.blocks.length>0&&["orphanTokens","hangingGraft"].includes(this.blocks[this.blocks.length-1].bs.payload)?this.lastBlock().bs={type:"scope",subType:"start",payload:e}:this.blocks.push(new Ln(e))}trim(){this.blocks.forEach((e=>e.trim()))}reorderSpanWithAtts(){this.blocks.forEach((e=>e.reorderSpanWithAtts()))}makeNoteGrafts(e){this.blocks.forEach((n=>n.makeNoteGrafts(e)))}close(e){for(const n of this.activeScopes.filter((()=>!0)).reverse())this.closeActiveScope(e,n);this.activeScopes=[]}closeActiveScope(e,n){this.addItem({type:"scope",subType:"end",payload:n.label}),n.onEnd&&n.onEnd(e,n.label)}filterGrafts(e){return this.blocks.map((n=>n.filterGrafts(e))).reduce(((e,n)=>e.concat(n)),[])}filterScopes(e){this.blocks.forEach((n=>n.filterScopes(e)))}text(){return this.blocks.map((e=>e.text())).join("")}addTableScopes(){let e=!1;for(const[n,t]of this.blocks.entries())e||"blockTag/tr"!==t.bs.payload?e&&"blockTag/tr"!==t.bs.payload&&(e=!1,this.blocks[n-1].items.push({type:"scope",subType:"end",payload:Rn("table",[])})):(e=!0,this.blocks[n].items.unshift({type:"scope",subType:"start",payload:Rn("table",[])}));e&&this.lastBlock().items.push({type:"scope",subType:"end",payload:Rn("table",[])})}graftifyIntroductionHeadings(e){let n=[...this.blocks.entries()];n.reverse();const t=["iot","is"].concat(e.customTags.introHeading);for(const[s,r]of n){const n=r.bs.payload.split("/")[1].replace(/[0-9]/g,"");if(t.includes(n)){const n=new Hn("heading");e.sequences.heading.push(n),n.blocks.push(r);const t={type:"graft",subType:"heading",payload:n.id};this.blocks.length<s+2&&this.newBlock("blockTag/hangingGraft"),this.blocks[s+1].bg.unshift(t),this.blocks.splice(s,1)}else if(n.startsWith("imt")){const t=n.startsWith("imte")?"introEndTitle":"introTitle";let o;if(e.sequences[t])o=e.sequences[t];else{const r=n.startsWith("imte")?"endTitle":"title";o=new Hn(r),e.sequences[t]=o;const i={type:"graft",subType:r,payload:o.id};this.blocks.length<s+2&&this.newBlock("blockTag/hangingGraft"),this.blocks[s+1].bg.unshift(i)}this.blocks.splice(s,1),o.blocks.unshift(r)}}}moveOrphanScopes(){this.blocks.length>1&&(this.moveOrphanStartScopes(),this.moveOrphanEndScopes())}moveOrphanStartScopes(){for(const[e,n]of this.blocks.entries())if(!(e>=this.blocks.length-1))for(const t of[...n.items].reverse()){if("start"!==t.subType||t.payload.startsWith("altChapter"))break;this.blocks[e+1].items.unshift(this.blocks[e].items.pop())}}moveOrphanStartScopes2(){for(const[e,n]of this.blocks.entries())if(!(e>=this.blocks.length-1))for(const t of[...n.items].reverse()){if("start"!==t.subType)break;this.blocks[e+1].items.unshift(this.blocks[e].items.pop())}}moveOrphanEndScopes(){for(const[e,n]of this.blocks.entries())if(0!==e)for(const t of[...n.items]){if("end"!==t.subType)break;this.blocks[e-1].items.push(this.blocks[e].items.shift())}}removeEmptyBlocks(e){const n=["blockTag/b","blockTag/ib"].concat(e),t=[];let s=!1;for(const e of this.blocks.entries())0!==e[1].tokens().length||n.includes(e[1].bs.payload)||t.push(e);for(const[e,n]of t.reverse())if(e<this.blocks.length-1){for(const t of[...n.bg].reverse())this.blocks[e+1].bg.unshift(t);for(const t of n.items.reverse())this.blocks[e+1].items.unshift(t);this.blocks.splice(e,1),s=!0}else 0===n.bg.length&&0===n.items.length&&(this.blocks.splice(e,1),s=!0);s&&this.removeEmptyBlocks(e)}removeGraftsToEmptySequences(e){this.blocks.forEach((n=>n.removeGraftsToEmptySequences(e)))}succinctifyBlocks(e){const n=[];let t=[];const s=e=>{if("start"===e.subType){0===t.filter((n=>n.payload===e.payload)).length&&t.push(e)}else t=t.filter((n=>n.payload!==e.payload))};let r=0;for(const o of this.blocks){const i=new xn(o.length),c=new xn(1),a=new xn(1),l=new xn(1),u=new xn(1);u.pushNByte(r);for(const n of o.bg)this.pushSuccinctGraft(c,e,n);for(const n of t)this.pushSuccinctScope(a,e,n);const S=[];for(const n of o.items)switch(n.type){case"token":this.pushSuccinctToken(i,e,n),"wordLike"===n.subType&&r++;break;case"graft":this.pushSuccinctGraft(i,e,n);break;case"scope":this.pushSuccinctScope(i,e,n),s(n),"start"===n.subType&&S.push(n);break;default:throw new Error(`Item type ${n.type} is not handled in succinctifyBlocks`)}const h=new xn(10);this.pushSuccinctScope(h,e,o.bs);for(const n of S)this.pushSuccinctScope(l,e,n);i.trim(),c.trim(),h.trim(),a.trim(),l.trim(),n.push({c:i,bs:h,bg:c,os:a,is:l,nt:u})}return n}pushSuccinctToken(e,n,t){const s=n.enumForCategoryValue($n[t.subType],t.payload);Nn(e,Jn[t.subType],s)}pushSuccinctGraft(e,n,t){const s=n.enumForCategoryValue("graftTypes",t.subType),r=n.enumForCategoryValue("ids",t.payload);Gn(e,s,r)}pushSuccinctScope(e,n,t){const s=t.payload.split("/"),r=Dn[s[0]],o=s.slice(1).map((e=>n.enumForCategoryValue("scopeBits",e)));Cn(e,Mn[`${t.subType}Scope`],r,o)}},Ln=class{constructor(e){this.id=y.generateId(),this.items=[],this.bg=[],this.bs={type:"scope",subType:"start",payload:e},this.os=[]}addItem(e){this.items.push(e)}plainText(){return this.items.filter((e=>"token"===e.type)).map((e=>e.payload)).join("")}trim(){this.items=this.trimEnd(this.trimStart(this.items))}reorderSpanWithAtts(){const e=[];for(const[n,t]of this.items.entries())"start"===t.subType&&t.payload.startsWith("spanWithAtts")&&e.push(n+1);for(const n of e){let e=n,t=[],s=[];for(;!(e>=this.items.length);){const n=this.items[e];if("token"===n.type)t.push(n);else{if("start"!==n.subType||!n.payload.startsWith("attribute/spanWithAtts"))break;s.push(n)}e++}if(0!==t.length&&0!==s.length){let e=n;for(const n of s)this.items[e]=n,e++;for(const n of t)this.items[e]=n,e++}}}inlineToEnd(){let e=null;for(const[n,t]of this.items.entries())if("end"===t.subType&&["inline/f","inline/fe","inline/x"].includes(t.payload)){e=t,this.items.splice(n,1);break}e&&this.addItem(e)}makeNoteGrafts(e){const n=[];for(const[e,t]of this.items.entries())"start"===t.subType&&(t.payload.startsWith("inline/f")||t.payload.startsWith("inline/x"))&&n.push(e);for(const t of n){const n=this.items[t].payload,s=this.items[t+1];if("token"===s.type&&1===s.payload.length){const r=new Hn("noteCaller");r.newBlock(n),r.addItem(s),e.sequences.noteCaller.push(r),this.items[t+1]={type:"graft",subType:"noteCaller",payload:r.id}}}}trimStart(e){if(0===e.length)return e;const n=e[0];return["lineSpace","eol"].includes(n.subType)?this.trimStart(e.slice(1)):"token"===n.type?e:[n,...this.trimStart(e.slice(1))]}trimEnd(e){if(0===e.length)return e;const n=e[e.length-1];return["lineSpace","eol"].includes(n.subType)?this.trimEnd(e.slice(0,e.length-1)):"token"===n.type?e:[...this.trimEnd(e.slice(0,e.length-1)),n]}filterGrafts(e){const n=[];let t=[];for(const[s,r]of this.grafts())this.graftPassesOptions(r,e)?n.push(r.payload):t.push(s);for(const[e,n]of Array.from(t.entries()))this.items.splice(n-e,1);t=[];for(const[s,r]of this.bg.entries())this.graftPassesOptions(r,e)?n.push(r.payload):t.push(s);for(const[e,n]of Array.from(t.entries()))this.bg.splice(n-e,1);return n}filterScopes(e){const n=[];for(const[t,s]of this.scopes())this.scopePassesOptions(s,e)||n.push(t);for(const[e,t]of Array.from(n.entries()))this.items.splice(t-e,1)}graftPassesOptions(e,n){return(!("includeGrafts"in n)||n.includeGrafts.includes(e.subType))&&(!("excludeGrafts"in n)||!n.excludeGrafts.includes(e.subType))}scopePassesOptions(e,n){return(!("includeScopes"in n)||this.scopeMatchesOptionArray(e.payload,n.includeScopes))&&(!("excludeScopes"in n)||!this.scopeMatchesOptionArray(e.payload,n.excludeScopes))}scopeMatchesOptionArray(e,n){for(const t of n)if(e.startsWith(t))return!0;return!1}removeGraftsToEmptySequences(e){let n=[];for(const[t,s]of this.grafts())e.includes(s.payload)&&n.push(t);for(const[e,t]of Array.from(n.entries()))this.items.splice(t-e,1);n=[];for(const[t,s]of this.bg.entries())e.includes(s.payload)&&n.push(t);for(const[e,t]of Array.from(n.entries()))this.bg.splice(t-e,1);return[]}grafts(){return Array.from(this.items.entries()).filter((e=>"graft"===e[1].type))}scopes(){return Array.from(this.items.entries()).filter((e=>"scope"===e[1].type))}tokens(){return Array.from(this.items.entries()).filter((e=>!["scope","graft"].includes(e[1].type)))}text(){return this.tokens().map((e=>e[1].payload)).join("")}};var Vn,Kn=(On={Sequence:Hn,Block:Ln}).Sequence,Un=cn.lexingRegexes;const Xn={},jn=[];for(const n of Un)["wordLike","eol","lineSpace","punctuation","unknown"].includes(n[1])&&(Xn[n[1]]=e(`^${n[2].xregexp.source}$`),jn.push(n[2]));var Wn=(Vn={tokenizeString:n=>{const t=e.union(jn),s=[];for(const r of e.match(n,t,"all")){let n;n=e.test(r,Xn.wordLike)?"wordLike":e.test(r,Xn.punctuation)?"punctuation":e.test(r,Xn.lineSpace)?"lineSpace":e.test(r,Xn.eol)?"eol":"unknown",s.push([r,n])}return s}}).tokenizeString;var Zn,Fn={parseTableToDocument:(e,n,t)=>{const{rows:s}=JSON.parse(e);n.headers.id=t,n.headers.bookCode=t;const r=new Kn("table");for(const[e,n]of s.entries())for(const[t,s]of n.entries()){r.newBlock(Bn("tTableRow",[`${e}`]));const n=r.lastBlock();n.addItem({type:"scope",subType:"start",payload:`tTableCol/${t}`});for(const[e,t]of Wn(s))n.addItem({type:"token",subType:t,payload:e});n.addItem({type:"scope",subType:"end",payload:`tTableCol/${t}`})}n.sequences.table.push(r),n.sequences.main.addBlockGraft({type:"graft",subType:"table",payload:r.id})}}.parseTableToDocument;const{labelForScope:zn}=y.scopeDefs;var Yn=On.Sequence,_n=Vn.tokenizeString;let Qn=0;const et=(e,n)=>{"number"!=typeof n&&(Qn=0);const t={...e,id:Qn,parentId:"number"==typeof n?n:"none"};return Qn++,e.children&&(t.children=e.children.map((e=>et(e,t.id)))),t},nt=e=>{const n=[{}];if(n[0].id=e.id,n[0].parentId=e.parentId,e.content&&(n[0].content=e.content),e.children){n[0].children=[];for(const t of e.children)n[0].children.push(t.id),nt(t).forEach((e=>n.push(e)))}return n};var tt,st=(on={parseUsfm:yn,parseUsx:vn,parseTableToDocument:Fn,parseNodes:(Zn={flattenNodes:nt,numberNodes:et,parseNodes:(e,n,t)=>{n.headers.id=t,n.headers.bookCode=t;const s=new Yn("tree");for(const n of nt(et(JSON.parse(e)))){s.newBlock(zn("tTreeNode",[`${n.id}`]));const e=zn("tTreeParent",[`${n.parentId}`]);if(s.lastBlock().items.push({type:"scope",subType:"start",payload:e}),n.content)for(const[e,t]of Object.entries(n.content)){const r=s.lastBlock().items.length,o=_n(t),i=zn("tTreeContent",[e,n.id,`${r}`,`${o.length}`]);s.lastBlock().items.push({type:"scope",subType:"start",payload:i});for(const[e,n]of o)s.lastBlock().items.push({type:"token",subType:n,payload:e});s.lastBlock().items.push({type:"scope",subType:"end",payload:i})}if(n.children)for(const[e,t]of n.children.entries()){const n=zn("tTreeChild",[e,t]);s.lastBlock().items.push({type:"scope",subType:"start",payload:n}),s.lastBlock().items.push({type:"scope",subType:"end",payload:n})}s.lastBlock().items.push({type:"scope",subType:"end",payload:e})}n.sequences.tree.push(s),n.sequences.main.addBlockGraft({type:"graft",subType:"tree",payload:s.id})}}).parseNodes}).parseUsfm,rt=on.parseUsx,ot=on.parseTableToDocument,it=on.parseNodes,ct=On.Sequence;const{labelForScope:at}=y.scopeDefs;var lt=fn.constructorForFragment;var ut=(tt={specs:e=>[{contexts:[["startTag","tagName",["id","usfm","ide","sts","h","toc","toca","cl"]]],parser:{baseSequenceType:"header",forceNewSequence:!0,newBlock:!0,useTempSequence:!0,newScopes:[{label:e=>e.fullTagName,endedBy:["baseSequenceChange"],onEnd:(e,n)=>{if(e.headers[n]=e.current.sequence.plainText(),"id"===n&&(3===e.headers[n].length||e.headers[n].length>3&&" "===e.headers[n].substring(3,4))){const t=e.headers[n].substring(0,3);e.headers.bookCode=t}}}]}},{contexts:[["startTag","tagName",["ms","mr","s","sr","r","qa","sp","sd"].concat(e.customTags.heading)]],parser:{baseSequenceType:"heading",forceNewSequence:!0,newBlock:!0,newScopes:[]}},{contexts:[["startTag","tagName",["mt"]]],parser:{baseSequenceType:"title",newBlock:!0,newScopes:[]}},{contexts:[["startTag","tagName",["mte"]]],parser:{baseSequenceType:"endTitle",newBlock:!0,newScopes:[]}},{contexts:[["startTag","tagName",["imt","is","ip","ipi","im","imi","ipq","imq","ipr","iq","ib","ili","iot","io","iex","imte"].concat(e.customTags.intro)]],parser:{baseSequenceType:"introduction",newBlock:!0,newScopes:[]}},{contexts:[["startTag","tagName",["esb"]]],parser:{baseSequenceType:"sidebar",newBlock:!0,newScopes:[],after:e=>{e.mainLike=e.current.sequence}}},{contexts:[["startTag","tagName",["esbe"]]],parser:{baseSequenceType:"main",newBlock:!0,newScopes:[],after:e=>{e.mainLike=e.sequences.main}}},{contexts:[["startTag","tagName",["cat"]]],parser:{inlineSequenceType:"esbCat",forceNewSequence:!0,newScopes:[{label:e=>at("inline",[e.fullTagName]),endedBy:["endTag/cat","endBlock","implicitEnd"],onEnd:e=>e.returnToBaseSequence()}],during:(e,n)=>{const t=y.generateId(),s={label:()=>at("esbCat",[t]),endedBy:["startTag/esbe"]};e.openNewScope(n,s,!0,e.mainLike)}}},{contexts:[["startTag","tagName",["rem"]]],parser:{baseSequenceType:"remark",forceNewSequence:!0,newScopes:[]}},{contexts:[["startTag","tagName",["cd","p","m","po","pr","cls","pmo","pm","pmc","pmr","pi","mi","nb","pc","ph","b","q","qr","qc","qa","qm","qd","lh","li","lf","lim","d"].concat(e.customTags.paragraph)]],parser:{baseSequenceType:"mainLike",newBlock:!0,newScopes:[]}},{contexts:[["startTag","tagName",["tr"]]],parser:{newBlock:!0,newScopes:[]}},{contexts:[["startTag","tagName",["f","fe"]]],parser:{inlineSequenceType:"footnote",forceNewSequence:!0,newScopes:[{label:e=>at("inline",[e.fullTagName]),endedBy:["endTag/f","endTag/fe","endBlock"],onEnd:e=>e.returnToBaseSequence()}]}},{contexts:[["startTag","tagName",["x"]]],parser:{inlineSequenceType:"xref",forceNewSequence:!0,newScopes:[{label:e=>at("inline",[e.fullTagName]),endedBy:["endTag/x","endBlock"],onEnd:e=>e.returnToBaseSequence()}]}},{contexts:[["startTag","tagName",["fig"]]],parser:{inlineSequenceType:"fig",forceNewSequence:!0,newScopes:[{label:e=>at("spanWithAtts",[e.tagName]),endedBy:["endBlock","endTag/$tagName$"],onEnd:e=>e.clearAttributeContext()}],during:(e,n)=>{e.setAttributeContext(at("spanWithAtts",[n.tagName]))}}},{contexts:[["chapter"]],parser:{mainSequence:!0,newScopes:[{label:e=>at("chapter",[e.number]),endedBy:["chapter"]}]}},{contexts:[["pubchapter"]],parser:{mainSequence:!0,newScopes:[{label:e=>at("pubChapter",[e.numberString]),endedBy:["pubchapter","chapter"]}]}},{contexts:[["startTag","tagName",["ca"]]],parser:{inlineSequenceType:"altNumber",forceNewSequence:!0,newScopes:[{label:e=>at("inline",[e.fullTagName]),endedBy:["endTag/ca","endBlock","implicitEnd"],onEnd:e=>e.returnToBaseSequence()}],during:(e,n)=>{const t=y.generateId(),s={label:()=>at("altChapter",[t]),endedBy:["startTag/ca","chapter"]};e.openNewScope(n,s,!0,e.sequences.main)}}},{contexts:[["verses"]],parser:{mainSequence:!0,newScopes:[{label:e=>at("verses",[e.numberString]),endedBy:["verses","chapter","pubchapter"]}],during:(e,n)=>{n.numbers.forEach((t=>{const s={label:()=>at("verse",[t]),endedBy:["verses","chapter","pubchapter"]};e.openNewScope(n,s,!0,e.sequences.main)}))}}},{contexts:[["startTag","tagName",["vp"]]],parser:{inlineSequenceType:"pubNumber",forceNewSequence:!0,newScopes:[{label:e=>at("inline",[e.fullTagName]),endedBy:["endTag/vp","endBlock","implicitEnd"],onEnd:e=>e.returnToBaseSequence()}],during:(e,n)=>{const t=y.generateId(),s={label:()=>at("pubVerse",[t]),endedBy:["startTag/vp","verses","chapter","pubchapter"]};e.openNewScope(n,s,!0,e.sequences.main)}}},{contexts:[["startTag","tagName",["va"]]],parser:{inlineSequenceType:"altNumber",forceNewSequence:!0,newScopes:[{label:e=>at("inline",[e.fullTagName]),endedBy:["endTag/va","endBlock","implicitEnd"],onEnd:e=>e.returnToBaseSequence()}],during:(e,n)=>{const t=y.generateId(),s={label:()=>at("altVerse",[t]),endedBy:["startTag/va","verses","chapter","pubchapter"]};e.openNewScope(n,s,!0,e.sequences.main)}}},{contexts:[["startTag","tagName",["qs","qac","litl","lik","liv","fr","fq","fqa","fk","fl","fw","fp","fv","ft","fdc","fm","xo","xk","xq","xt","xta","xop","xot","xnt","xdc","rq","add","bk","dc","k","nd","ord","pn","png","qt","sig","sls","tl","wj","em","bd","it","bdit","no","sc","sup","ior","iqt"].concat(e.customTags.char)]],parser:{newScopes:[{label:e=>at("span",[e.fullTagName]),endedBy:["endBlock","endTag/$fullTagName$","implicitEnd"]}]}},{contexts:[["startTag","tagName",["th","thr","tc","tcr"]]],parser:{newScopes:[{label:e=>at("cell",[e.fullTagName]),endedBy:["startTag/th","startTag/thr","startTag/tc","startTag/tcr","startTag/th2","startTag/thr2","startTag/tc2","startTag/tcr2","startTag/th3","startTag/thr3","startTag/tc3","startTag/tcr3","endBlock","endTag/$fullTagName$"]}]}},{contexts:[["emptyMilestone"]],parser:{during:(e,n)=>e.addEmptyMilestone(at("milestone",[n.tagName]))}},{contexts:[["startMilestoneTag","sOrE","s"]],parser:{newScopes:[{label:e=>at("milestone",[e.tagName]),endedBy:["endMilestone/$tagName$"]}],during:(e,n)=>{e.setAttributeContext(at("milestone",[n.tagName]))}}},{contexts:[["endMilestoneMarker"]],parser:{during:e=>e.clearAttributeContext()}},{contexts:[["attribute"],["defaultAttribute"]],parser:{during:(e,n)=>{const t={w:"lemma",rb:"gloss",xt:"link-href"};if(e.current.attributeContext){const s=e.current.attributeContext.split("/");"default"===n.key&&2===s.length&&(n.key=t[s[1]]||`unknownDefault_${s[1]}`,n.printValue=n.printValue.replace(/default/,n.key)),[...n.values.entries()].forEach((t=>{const s={label:n=>at("attribute",[e.current.attributeContext,n.key,t[0],t[1]]),endedBy:["$attributeContext$"]};e.openNewScope(n,s)}))}else e.addToken(lt.printable("unknown",[n.printValue]))}}},{contexts:[["startTag","tagName",["w","rb"].concat(e.customTags.word)]],parser:{newScopes:[{label:e=>at("spanWithAtts",[e.tagName]),endedBy:["endBlock","endTag/$tagName$"],onEnd:e=>e.clearAttributeContext()}],during:(e,n)=>{e.setAttributeContext(at("spanWithAtts",[n.tagName]))}}},{contexts:[["wordLike"],["lineSpace"],["punctuation"],["eol"]],parser:{during:(e,n)=>e.addToken(n)}},{contexts:[["noBreakSpace"]],parser:{during:e=>{e.addToken(lt.printable("lineSpace",[" "]))}}},{contexts:[["softLineBreak"]],parser:{during:e=>{e.addToken(lt.printable("softLineBreak",["//"]))}}},{contexts:[["bareSlash"]],parser:{during:e=>{e.addToken(lt.printable("bareSlash",["\\"]))}}},{contexts:[["unknown"]],parser:{during:(e,n)=>{e.addToken(lt.printable("unknown",[n.printValue]))}}}],buildSpecLookup:e=>{const n={};for(const t of e)for(const e of t.contexts){e[0]in n||(n[e[0]]={});const s=e[1];if(s){s in n[e[0]]||(n[e[0]][s]={});for(const r of e[2])n[e[0]][s][r]=t.parser}else n[e[0]]._noAccessor=t.parser}return n}}).specs,St=tt.buildSpecLookup;const{labelForScope:ht}=y.scopeDefs,pt=y.parserConstants;var dt,ft,mt={Parser:class{constructor(e,n,t){this.filterOptions=e,this.customTags=n,this.emptyBlocks=t,this.specs=ut(this),this.specLookup=St(this.specs),this.headers={},this.baseSequenceTypes=pt.usfm.baseSequenceTypes,this.inlineSequenceTypes=pt.usfm.inlineSequenceTypes,this.setSequences(),this.setCurrent()}setSequences(){this.sequences={};for(const[e,n]of Object.entries({...this.baseSequenceTypes,...this.inlineSequenceTypes}))switch(n){case"1":this.sequences[e]=new ct(e);break;case"?":this.sequences[e]=null;break;case"*":this.sequences[e]=[];break;default:throw new Error(`Unexpected sequence arity '${n}' for '${e}'`)}this.mainLike=this.sequences.main}setCurrent(){this.current={sequence:this.sequences.main,parentSequence:null,baseSequenceType:"main",inlineSequenceType:null,attributeContext:null}}parseItem(e){let n=!1;["startTag"].includes(e.subclass)&&(this.closeActiveScopes(`startTag/${e.fullTagName}`),e.isNested||this.closeActiveScopes("implicitEnd")),["endTag"].includes(e.subclass)&&this.closeActiveScopes(`endTag/${e.fullTagName}`),["startMilestoneTag"].includes(e.subclass)&&"e"===e.sOrE&&this.closeActiveScopes(`endMilestone/${e.tagName}`),["chapter","pubchapter","verses"].includes(e.subclass)&&this.closeActiveScopes(e.subclass,this.sequences.main);const t=this.specForItem(e);if(t){if("before"in t.parser&&t.parser.before(this,e),n=!1,t.parser.baseSequenceType){n=("mainLike"===t.parser.baseSequenceType?this.mainLike.type:t.parser.baseSequenceType)!==this.current.baseSequenceType||t.parser.forceNewSequence}n?(this.closeActiveScopes("baseSequenceChange"),this.changeBaseSequence(t.parser),"newBlock"in t.parser&&t.parser.newBlock&&(this.closeActiveScopes("endBlock"),this.current.sequence.newBlock(ht("blockTag",[e.fullTagName])))):t.parser.inlineSequenceType?(this.current.inlineSequenceType=t.parser.inlineSequenceType,this.current.parentSequence=this.current.sequence,"header"===this.current.parentSequence.type&&(this.current.parentSequence=this.sequences.main),this.current.sequence=new ct(this.current.inlineSequenceType),this.current.sequence.newBlock(ht("inline",t.parser.inlineSequenceType)),this.sequences[this.current.inlineSequenceType].push(this.current.sequence),this.current.parentSequence.addItem({type:"graft",subType:this.current.inlineSequenceType,payload:this.current.sequence.id})):"newBlock"in t.parser&&t.parser.newBlock&&this.current.sequence.newBlock(ht("blockTag",[e.fullTagName])),"during"in t.parser&&t.parser.during(this,e),this.openNewScopes(t.parser,e),"after"in t.parser&&t.parser.after(this,e)}}tidy(){for(const e of this.sequences.introduction)e.graftifyIntroductionHeadings(this);const e=this.allSequences();for(const n of e)n.trim(),n.reorderSpanWithAtts(),n.makeNoteGrafts(this),n.moveOrphanScopes(),n.removeEmptyBlocks(this.emptyBlocks);const n=this.emptySequences(e);for(const t of e)n&&t.removeGraftsToEmptySequences(n),t.addTableScopes(),t.close(this),this.substitutePubNumberScopes(t),t.moveOrphanStartScopes2(),"sidebar"===t.type&&this.substituteEsbCatScopes(t),["footnote","xref"].includes(t.type)&&t.lastBlock().inlineToEnd()}emptySequences(e){return e.filter((e=>0===e.blocks.length)).map((e=>e.id))}substitutePubNumberScopes(e){const n={},t=this.sequenceById();for(const s of e.blocks){let e=0;const r=[...s.items];for(const[o,i]of r.entries())if("graft"===i.type&&["pubNumber","altNumber"].includes(i.subType)){const c=t[i.payload].text().trim();n[r[o+1].payload.split("/")[1]]=c,s.items.splice(o-e,1),e++}}if(Object.keys(n).length>0)for(const t of e.blocks)for(const e of t.items.filter((e=>"scope"===e.type))){const t=e.payload.split("/");["altChapter","pubVerse","altVerse"].includes(t[0])&&(e.payload=`${t[0]}/${n[t[1]]}`)}}substituteEsbCatScopes(e){const n={},t=this.sequenceById();for(const s of e.blocks){let e=0;const r=[...s.items];for(const[o,i]of r.entries())if("graft"===i.type&&"esbCat"===i.subType){const c=t[i.payload].text().trim();n[r[1].payload.split("/")[1]]=c,s.items.splice(o-e,1),e++}}if(Object.keys(n).length>0)for(const t of e.blocks)for(const e of t.items.filter((e=>"scope"===e.type))){const t=e.payload.split("/");"esbCat"===t[0]&&(e.payload=`${t[0]}/${n[t[1]]}`)}}allSequences(){const e=[];for(const[n,t]of Object.entries({...this.baseSequenceTypes,...this.inlineSequenceTypes}))switch(t){case"1":case"?":this.sequences[n]&&e.push(this.sequences[n]);break;case"*":this.sequences[n].forEach((n=>{e.push(n)}));break;default:throw new Error(`Unexpected sequence arity '${t}' for '${n}'`)}return e}sequenceById(){const e={};return this.allSequences().forEach((n=>{e[n.id]=n})),e}filter(){const e=[],n=this.sequenceById();this.filterGrafts(this.sequences.main.id,n,e,this.filterOptions),this.removeUnusedSequences(e),this.filterScopes(Object.values(n),this.filterOptions)}filterGrafts(e,n,t,s){t.push(e);const r=n[e].filterGrafts(s);for(const o of r){if("main"===n[o].type)throw new Error("MAIN is child!",JSON.stringify(n[e],null,2));this.filterGrafts(o,n,t,s)}}removeUnusedSequences(e){for(const n of this.allSequences())if(!e.includes(n.id)){const e={...this.baseSequenceTypes,...this.inlineSequenceTypes}[n.type];switch(e){case"1":throw new Error("Attempting to remove sequence with arity of 1");case"?":this.sequences[n.type]=null;break;case"*":this.sequences[n.type]=this.sequences[n.type].filter((e=>e.id!==n.id));break;default:throw new Error(`Unexpected sequence arity '${e}' for '${n.type}'`)}}}filterScopes(e,n){e.forEach((e=>e.filterScopes(n)))}specForItem(e){const n=e.subclass;if(!(n in this.specLookup))return null;for(const t of["tagName","sOrE"])if(t in e&&t in this.specLookup[n]&&e[t]in this.specLookup[n][t])return{parser:this.specLookup[n][t][e[t]]};return"_noAccessor"in this.specLookup[n]?{parser:this.specLookup[n]._noAccessor}:null}closeActiveScopes(e,n){void 0===n&&(n=this.current.sequence);const t=n.activeScopes.filter((n=>n.endedBy.includes(e))).reverse();n.activeScopes=n.activeScopes.filter((n=>!n.endedBy.includes(e))),t.forEach((e=>this.closeActiveScope(e,n)))}closeActiveScope(e,n){this.addScope("end",e.label,n),e.onEnd&&e.onEnd(this,e.label)}changeBaseSequence(e){const n=e.baseSequenceType;if("mainLike"===n)return void(this.current.sequence=this.mainLike);this.current.baseSequenceType=n;const t=this.baseSequenceTypes[n];switch(t){case"1":this.current.sequence=this.sequences[n];break;case"?":this.sequences[n]||(this.sequences[n]=new ct(n)),this.current.sequence=this.sequences[n];break;case"*":this.current.sequence=new ct(n),e.useTempSequence||this.sequences[n].push(this.current.sequence);break;default:throw new Error(`Unexpected base sequence arity '${t}' for '${n}'`)}e.useTempSequence||"main"===this.current.sequence.type||this.mainLike.addBlockGraft({type:"graft",subType:this.current.baseSequenceType,payload:this.current.sequence.id})}returnToBaseSequence(){this.current.inlineSequenceType=null,this.current.sequence=this.current.parentSequence,this.current.parentSequence=null}openNewScopes(e,n){if(e.newScopes){let t=this.current.sequence;"mainSequence"in e&&e.mainSequence&&(t=this.sequences.main),e.newScopes.forEach((e=>this.openNewScope(n,e,!0,t)))}}openNewScope(e,n,t,s){void 0===t&&(t=!0),void 0===s&&(s=this.current.sequence),t&&s.addItem({type:"scope",subType:"start",payload:n.label(e)});const r={label:n.label(e),endedBy:this.substituteEndedBys(n.endedBy,e)};"onEnd"in n&&(r.onEnd=n.onEnd),s.activeScopes.push(r)}substituteEndedBys(e,n){return e.map((e=>{let t=e.replace("$fullTagName$",n.fullTagName).replace("$tagName$",n.tagName);return this.current.attributeContext&&(t=t.replace("$attributeContext$",this.current.attributeContext.replace("milestone","endMilestone").replace("spanWithAtts","endTag"))),t}))}addToken(e){this.current.sequence.addItem({type:"token",subType:e.subclass,payload:e.printValue})}addScope(e,n,t){void 0===t&&(t=this.current.sequence),t.addItem({type:"scope",subType:e,payload:n})}addEmptyMilestone(e){this.mainLike.addItem({type:"scope",subType:"start",payload:e}),this.mainLike.addItem({type:"scope",subType:"end",payload:e})}setAttributeContext(e){this.current.attributeContext=e}clearAttributeContext(){this.current.attributeContext=null}}}.Parser;ft=JSON.parse('[{"id":0,"type":"Inputs","inputs":{"perf":"json"}},{"id":1,"title":"Generate report","name":"calculateUsfmChapterPositions","type":"Transform","inputs":[{"name":"perf","type":"json","source":"Input perf"}],"outputs":[{"name":"report","type":"json"}],"description":"Generate report from perf to calculate the position of the chapters"},{"id":2,"title":"PERF to USFM","name":"perf2usfm","type":"Transform","inputs":[{"name":"perf","type":"json","source":"Input perf"},{"name":"report","type":"json","source":"Transform 1 report"}],"outputs":[{"name":"usfm","type":"text"}],"description":"PERF=>USFM: Conversion via Proskomma"},{"id":999,"type":"Outputs","outputs":[{"name":"usfm","type":"text","source":"Transform 2 usfm"}]}]');var gt;gt=JSON.parse('[{"id":0,"type":"Inputs","inputs":{"perf":"json"}},{"id":1,"title":"PERF to PkJSON","name":"perf2PkJson","type":"Transform","inputs":[{"name":"perf","type":"json","source":"Input perf"}],"outputs":[{"name":"pkJson","type":"json"}],"documentation":"","description":"PERF=>JSON: Converts PERF to current Proskomma input format"},{"id":999,"type":"Outputs","outputs":[{"name":"pkJson","type":"json","source":"Transform 1 pkJson"}]}]'),dt={perf2usfmPipeline:ft,perf2PkJsonPipeline:gt};var At,Et,bt=u.PerfRenderFromJson;const yt=e=>({type:e.sequences[0].block.type,subType:e.sequences[0].block.subType,pos:e.sequences[0].block.blockN,perfChapter:null}),Pt={startDocument:[{description:"Set up storage",test:()=>!0,action:({workspace:e,output:n})=>{e.blockRecords=[],n.report={}}}],startParagraph:[{description:"Set up block record",test:()=>!0,action:({context:e,workspace:n})=>{n.blockRecords.push(yt(e))}}],blockGraft:[{description:"Set up block record",test:()=>!0,action:({context:e,workspace:n})=>{n.blockRecords.push(yt(e))}}],mark:[{description:"Add chapter number to block record",test:({context:e})=>"chapter"===e.sequences[0].element.subType,action:({context:e,workspace:n})=>{n.blockRecords[n.blockRecords.length-1].perfChapter=e.sequences[0].element.atts.number}}],endDocument:[{description:"Populate report",test:()=>!0,action:({workspace:e,output:n})=>{for(const[t,s]of Object.entries(e.blockRecords)){if(!s.perfChapter)continue;let r=t,o=!1;for(;r>0&&!o;)"paragraph"===e.blockRecords[r-1].type||"title"===e.blockRecords[r-1].subType?o=!0:r--;n.report[r.toString()]=s.perfChapter}}}]};Et={name:"calculateUsfmChapterPositions",type:"Transform",description:"PERF=>JSON: Generates positions for inserting chapter numbers into USFM",inputs:[{name:"perf",type:"json",source:""}],outputs:[{name:"report",type:"json"}],code:function({perf:e}){const n={};return new bt({srcJson:e,actions:Pt}).renderDocument({docId:"",config:{maxLength:60},output:n}),{report:n.report}}};var kt,It=u.PerfRenderFromJson;const wt=e=>["toc","toca","mt","imt","s","ms","mte","sd"].includes(e)?e+"1":e,Tt={startDocument:[{description:"Set up environment",test:()=>!0,action:({context:e,workspace:n})=>{n.usfmBits=[""],n.nestedWrapper=0;for(let[t,s]of Object.entries(e.document.metadata.document).filter((e=>!["tags","properties","bookCode","cl"].includes(e[0]))))n.usfmBits.push(`\\${wt(t)} ${s}\n`)}}],blockGraft:[{description:"Follow block grafts",test:({context:e})=>["title","heading","introduction"].includes(e.sequences[0].block.subType),action:e=>{let n=e.context.sequences[0],t=e.config.report[n.block.blockN.toString()];const s=n.block.target;t&&"main"===n.type&&e.workspace.usfmBits.push(`\n\\c ${t}\n`),s&&e.context.renderer.renderSequenceId(e,s)}}],inlineGraft:[{description:"Follow inline grafts",test:()=>!0,action:e=>{const n=e.context.sequences[0].element.target;n&&e.context.renderer.renderSequenceId(e,n)}}],startParagraph:[{description:"Output footnote paragraph tag (footnote)",test:({context:e})=>"usfm:f"===e.sequences[0].block.subType&&"footnote"===e.sequences[0].type||"usfm:x"===e.sequences[0].block.subType&&"xref"===e.sequences[0].type,action:({context:e,workspace:n})=>{n.nestedWrapper=0;let t=e.sequences[0];n.usfmBits.push(`\\${wt(t.block.subType.split(":")[1])} `)}},{description:"Output footnote note_caller tag (footnote)",test:({context:e})=>"usfm:f"===e.sequences[0].block.subType||"usfm:x"===e.sequences[0].block.subType,action:({workspace:e})=>{e.nestedWrapper=0}},{description:"Output paragraph tag (main)",test:()=>!0,action:({context:e,workspace:n,config:t})=>{n.nestedWrapper=0;let s=e.sequences[0],r=t.report[s.block.blockN.toString()];r&&"main"===s.type&&n.usfmBits.push(`\n\\c ${r}\n`),n.usfmBits.push(`\n\\${wt(s.block.subType.split(":")[1])}\n`)}}],endParagraph:[{description:"Output footnote paragraph tag (footnote)",test:({context:e})=>"usfm:f"===e.sequences[0].block.subType&&"footnote"===e.sequences[0].type||"usfm:x"===e.sequences[0].block.subType&&"xref"===e.sequences[0].type,action:({context:e,workspace:n})=>{let t=e.sequences[0];n.usfmBits.push(`\\${wt(t.block.subType.split(":")[1])}*`)}},{description:"Output footnote note_caller tag (footnote)",test:({context:e})=>"usfm:f"===e.sequences[0].block.subType||"usfm:x"===e.sequences[0].block.subType,action:()=>{}},{description:"Output nl",test:()=>!0,action:({workspace:e})=>{e.usfmBits.push("\n")}}],startMilestone:[{description:"Output start milestone",test:()=>!0,action:({context:e,workspace:n})=>{let t=e.sequences[0].element,s=((e,n)=>{let t=`\\${n}-s |`;for(let[n,s]of Object.entries(e))t="x-morph"===n?t+wt(n)+'="'+s.join(",")+'" ':t+wt(n)+'="'+s+'" ';return t+"\\*"})(t.atts,wt(t.subType.split(":")[1]));n.usfmBits.push(s)}}],endMilestone:[{description:"Output end milestone",test:()=>!0,action:({context:e,workspace:n})=>{n.usfmBits.push(`\\${wt(e.sequences[0].element.subType.split(":")[1])}-e\\*`)}}],text:[{description:"Output text",test:()=>!0,action:({context:e,workspace:n})=>{const t=e.sequences[0].element.text;n.usfmBits.push(t)}}],mark:[{description:"Output chapter or verses",test:()=>!0,action:({context:e,workspace:n})=>{const t=e.sequences[0].element;"verses"===t.subType&&n.usfmBits.push(`\n\\v ${t.atts.number}\n`)}}],endSequence:[{description:"Output \\cl",test:({context:e})=>e.document.metadata.document.cl&&"title"===e.sequences[0].type,action:({context:e,workspace:n})=>{n.usfmBits.push(`\n\\cl ${e.document.metadata.document.cl}\n`)}}],startWrapper:[{description:"Output start tag",test:()=>!0,action:({workspace:e,context:n})=>{let t=n.sequences[0];e.nestedWrapper>0?e.usfmBits.push(`\\+${wt(t.element.subType.split(":")[1])} `):e.usfmBits.push(`\\${wt(t.element.subType.split(":")[1])} `),e.nestedWrapper+=1}}],endWrapper:[{description:"Output end tag",test:({context:e})=>!["fr","fq","fqa","fk","fl","fw","fp","ft","xo","xk","xq","xt","xta"].includes(e.sequences[0].element.subType.split(":")[1]),action:({workspace:e,context:n})=>{e.nestedWrapper-=1;let t=n.sequences[0],s=t.element.subType.split(":")[1],r=e.nestedWrapper>0;if("w"===s){let n=((e,n,t=!1)=>{let s="|";for(let[n,t]of Object.entries(e))s=s+wt(n)+'="'+t+'" ';return s+="\\",t&&(s+="+"),s+n+"*"})(t.element.atts,wt(s),r);e.usfmBits.push(n)}else r?e.usfmBits.push(`\\+${wt(t.element.subType.split(":")[1])}*`):e.usfmBits.push(`\\${wt(t.element.subType.split(":")[1])}*`)}},{description:"Do NOT output end tag",test:()=>!0,action:({workspace:e})=>{e.nestedWrapper-=1}}],endDocument:[{description:"Build output",test:()=>!0,action:({workspace:e,output:n})=>{n.usfm=e.usfmBits.join("").replace(/(\s*)\n(\s*)/gm,"\n")}}]};kt={name:"perf2usfm",type:"Transform",description:"PERF=>USFM",inputs:[{name:"perf",type:"json",source:""},{name:"report",type:"json",source:""}],outputs:[{name:"usfm",type:"text"}],code:function({perf:e,report:n}){const t={};return new It({srcJson:e,actions:Tt}).renderDocument({docId:"",config:{report:n},output:t}),{usfm:t.usfm}}};var vt=u.PerfRenderFromJson,Bt=cn.lexingRegexes;const Ot=Bt.filter((e=>"wordLike"===e[1]))[0][2],xt=Bt.filter((e=>"lineSpace"===e[1]))[0][2],Gt=Bt.filter((e=>"punctuation"===e[1]))[0][2],Ct=e=>{[...e.os.filter((e=>["verse","verses"].includes(e.split("/")[0])))].reverse().forEach((n=>{e.block.items.push({type:"scope",subType:"end",payload:n}),e.os=[...e.os.filter((e=>e!==n))]}))},Nt={startDocument:[{description:"Set up word object",test:()=>!0,action:({workspace:e,output:n})=>{n.pkJson={},e.sequenceId=null,e.block=null,e.os=[],e.waitingBlockGrafts=[]}}],startSequence:[{description:"Add sequence array to output",test:()=>!0,action:e=>{e.output.pkJson[e.context.sequences[0].id]=[],e.workspace.sequenceId=e.context.sequences[0].id}}],endSequence:[{description:"Reset sequenceId pointer",test:()=>!0,action:e=>{var n;[...(n=e.workspace).os].reverse().forEach((e=>{n.block.items.push({type:"scope",subType:"end",payload:e})})),n.os=[],e.workspace.sequenceId=e.context.sequences[1]?.id}}],unresolvedBlockGraft:[{description:"Stash for next para",test:()=>!0,action:({context:e,workspace:n})=>{e.sequences[0].block.target&&n.waitingBlockGrafts.push({type:"graft",subType:e.sequences[0].block.subType,payload:e.sequences[0].block.target})}}],unresolvedInlineGraft:[{description:"Follow inline grafts",test:()=>!0,action:({context:e,workspace:n})=>{e.sequences[0].element.target&&n.block.items.push({type:"graft",subType:e.sequences[0].element.subType,payload:e.sequences[0].element.target})}}],startParagraph:[{description:"Add object for paragraph block",test:()=>!0,action:({context:e,workspace:n,output:t})=>{n.block={os:[...n.os],is:[],bs:{type:"scope",subType:"start",payload:`blockTag/${e.sequences[0].block.subType.split(":")[1]}`},bg:[...n.waitingBlockGrafts],items:[]},t.pkJson[n.sequenceId].push(n.block)}}],endParagraph:[{description:"Close open scopes",test:()=>!0,action:({workspace:e})=>{(e=>{[...e.os.filter((e=>["span"].includes(e.split("/")[1])))].reverse().forEach((n=>{e.block.items.push({type:"scope",subType:"end",payload:n}),e.os=[...e.os.filter((e=>e!==n))]}))})(e),e.waitingBlockGrafts=[]}}],mark:[{description:"ts mark as milestone",test:({context:e})=>["usfm:ts"].includes(e.sequences[0].element.subType),action:({workspace:e})=>{const n="milestone/ts";e.block.is.includes(n)||e.block.is.push(n),e.os.push(n),e.block.items.push({type:"scope",subType:"start",payload:n}),e.block.items.push({type:"scope",subType:"end",payload:n})}},{description:"Chapter",test:({context:e})=>["chapter"].includes(e.sequences[0].element.subType),action:({context:e,workspace:n})=>{Ct(n),(e=>{[...e.os.filter((e=>["chapter"].includes(e.split("/")[0])))].reverse().forEach((n=>{e.block.items.push({type:"scope",subType:"end",payload:n}),e.os=[...e.os.filter((e=>e!==n))]}))})(n);const t=`chapter/${e.sequences[0].element.atts.number}`;n.block.is.includes(t)||n.block.is.push(t),n.os.push(t),n.block.items.push({type:"scope",subType:"start",payload:t})}},{description:"Verses",test:({context:e})=>["verses"].includes(e.sequences[0].element.subType),action:({context:e,workspace:n})=>{Ct(n);const t=e.sequences[0].element,s=t.atts.number;let r=[parseInt(s)];if(s.includes("-")){let[e,n]=s.split("-").map((e=>parseInt(e)));for(r=[e];e<=n;)e++,r.push(e)}for(const e of r){const t=`verse/${e}`;n.os.push(t),n.block.is.includes(t)||n.block.is.push(t),n.block.items.push({type:"scope",subType:"start",payload:t})}const o=`verses/${t.atts.number}`;n.block.is.includes(o)||n.block.is.push(o),n.os.push(o),n.block.items.push({type:"scope",subType:"start",payload:o})}}],startMilestone:[{description:"Add scope and update state",test:()=>!0,action:({context:e,workspace:n})=>{const t=e.sequences[0].element,s=`milestone/${t.subType.split(":")[1]}`;n.block.is.includes(s)||n.block.is.push(s),n.os.push(s),n.block.items.push({type:"scope",subType:"start",payload:s});for(const[e,s]of Object.entries(t.atts||{})){const r=s.toString().split(",");for(const[s,o]of r.entries()){const r=`attribute/milestone/${t.subType.split(":")[1]}/${e}/${s}/${o}`;n.block.is.includes(r)||n.block.is.push(r),n.os.push(r),n.block.items.push({type:"scope",subType:"start",payload:r})}}}}],endMilestone:[{description:"Remove scope and update state",test:()=>!0,action:({context:e,workspace:n})=>{const t=e.sequences[0].element,s=`attribute/milestone/${t.subType.split(":")[1]}`;for(const e of[...n.os.filter((e=>e.startsWith(s)))].reverse())n.os=n.os.filter((n=>n!==e)),n.block.items.push({type:"scope",subType:"end",payload:e});const r=`milestone/${t.subType.split(":")[1]}`;n.os=n.os.filter((e=>e!==r)),n.block.items.push({type:"scope",subType:"end",payload:r})}}],startWrapper:[{description:"Add scope and update state",test:()=>!0,action:({context:e,workspace:n})=>{const t=e.sequences[0].element,s=`${"usfm:w"===t.subType?"spanWithAtts":"span"}/${t.subType.split(":")[1]}`;n.block.is.includes(s)||n.block.is.push(s),n.os.push(s),n.block.items.push({type:"scope",subType:"start",payload:s});for(const[e,s]of Object.entries(t.atts||{})){const t=s.toString().split(",");for(const[s,r]of t.entries()){const t=`attribute/spanWithAtts/w/${e}/${s}/${r}`;n.block.is.includes(t)||n.block.is.push(t),n.os.push(t),n.block.items.push({type:"scope",subType:"start",payload:t})}}}}],endWrapper:[{description:"Remove scope and update state",test:()=>!0,action:({context:e,workspace:n})=>{const t=e.sequences[0].element;for(const[e,s]of[...Object.entries(t.atts||{})].reverse()){const t=s.toString().split(",");for(const[s,r]of[...t.entries()].reverse()){const t=`attribute/spanWithAtts/w/${e}/${s}/${r}`;n.os=n.os.filter((e=>e!==t)),n.block.items.push({type:"scope",subType:"end",payload:t})}}const s=`${"usfm:w"===t.subType?"spanWithAtts":"span"}/${t.subType.split(":")[1]}`;n.os=n.os.filter((e=>e!==s)),n.block.items.push({type:"scope",subType:"end",payload:s})}}],text:[{description:"Log occurrences",test:()=>!0,action:({context:n,workspace:t})=>{const s=n.sequences[0].element.text,r=e.union(Bt.map((e=>e[2]))),o=e.match(s,r,"all");for(const n of o){let s;e.test(n,Ot)?s="wordLike":e.test(n,xt)?s="lineSpace":e.test(n,Gt)&&(s="punctuation"),t.block.items.push({type:"token",subType:s,payload:n})}}}],endDocument:[{description:"Rework hanging end cv scopes",test:()=>!0,action:({output:e})=>{const n=Object.values(e.pkJson)[0];for(let e=1;e<n.length;e++){let t=n[e].items;const s=n[e-1].items;let r=0;for(;r<t.length;){const e=t[r];if("scope"!==e.type||"end"!==e.subType)break;r++}for(;r>0;){const o=t.shift();s.push(o),n[e].os=n[e].os.filter((e=>e!==o.payload)),r--}}}}]};At={calculateUsfmChapterPositions:Et,perf2usfm:kt,perf2PkJson:{name:"perf2PkJson",type:"Transform",description:"PERF=>JSON: Converts PERF to current Proskomma input format",documentation:"",inputs:[{name:"perf",type:"json",source:""}],outputs:[{name:"pkJson",type:"json"}],code:function({perf:e}){const n={};return new vt({srcJson:e,ignoreMissingSequences:!0,actions:Nt}).renderDocument({docId:"",config:{},output:n}),{pkJson:n.pkJson}}}};var qt;const Rt=y.ByteArray,{itemEnum:Mt}=y.itemDefs,{tokenEnum:Dt}=y.tokenDefs,$t=(e,n,t)=>t+(n?32:0)+64*e,Jt=(e,n)=>{const t=e.byte(n);return[t>>6,(t>>5)%2==1,t%32]};var Ht=(qt={buildChapterVerseIndex:e=>{const n=e.sequences[e.mainId],t=e.processor.docSets[e.docSetId];t.buildPreEnums(),t.buildEnumIndexes();const s={},r={};let i="0",c="0",a="1",l=0;if(n.chapterVerses={},0===t.enums.wordLike.length)throw new Error("No wordLike content in docSet - probably a USFM issue, maybe missing \\mt?");n.tokensPresent=new o(new Array(t.enums.wordLike.length).fill(0).map((e=>e.toString())).join(""));for(const[e,o]of n.blocks.entries()){let u=0,S=o.c,h=-1;for(;u<S.length;){h++;const[o,p,d]=y.succinct.headerBytes(S,u);if(p===Mt.startScope){let n=t.succinctScopeLabel(S,d,u);n.startsWith("chapter/")?(i=n.split("/")[1],s[i]={},r[i]={startBlock:e,startItem:h,nextToken:l}):n.startsWith("verse/")?(c=n.split("/")[1],"1"!==c||"0"in s[i]||r[i].nextToken<l&&(s[i][0]=[{startBlock:r[i].startBlock,startItem:r[i].startItem,endBlock:e,endItem:Math.max(h-1,0),nextToken:r[i].nextToken,verses:"0"}]),c in s[i]||(s[i][c]=[]),s[i][c].push({startBlock:e,startItem:h,nextToken:l})):n.startsWith("verses/")&&(a=n.split("/")[1])}else if(p===Mt.endScope){let n=t.succinctScopeLabel(S,d,u);if(n.startsWith("chapter/")){i=n.split("/")[1];let t=r[i];t&&(t.endBlock=e,t.endItem=h)}else if(n.startsWith("verse/")){if(c=n.split("/")[1],s[i][c]){const n=s[i][c][s[i][c].length-1];n.endBlock=e,n.endItem=h,n.verses=a}}}else p===Mt.token&&d===Dt.wordLike&&(n.tokensPresent.set(S.nByte(u+2),1),l++);u+=o}}for(const[e,r]of Object.entries(s)){const s=new Rt;n.chapterVerses[e]=s;const o=Object.keys(r).map((e=>parseInt(e))).sort(((e,n)=>e-n));if(0===o.length)continue;const i=o[o.length-1],c=Array.from(Array(i+1).keys());let a=0;for(const e of c){const n=`${e}`;if(n in r){const o=r[n],i=o.length;for(const[n,r]of o.entries()){if(!r.verses){console.log(`** VerseElement without verses for ${e} in buildChapterVerseIndex`);continue}const o=t.enumForCategoryValue("scopeBits",r.verses),c=r.startBlock===r.endBlock?2:3;s.pushByte(0),2===c?s.pushNBytes([r.startBlock,r.startItem,r.endItem,r.nextToken,o]):s.pushNBytes([r.startBlock,r.endBlock,r.startItem,r.endItem,r.nextToken,o]),s.setByte(a,$t(c,n===i-1,s.length-a)),a=s.length}}else s.pushByte($t(0,!0,1)),a++}s.trim()}n.chapters={};for(const[e,t]of Object.entries(r)){if(!("startBlock"in t)||!("endBlock"in t))continue;const s=new Rt;n.chapters[e]=s;const r=t.startBlock===t.endBlock?2:3;s.pushByte(0),2===r?s.pushNBytes([t.startBlock,t.startItem,t.endItem,t.nextToken]):s.pushNBytes([t.startBlock,t.endBlock,t.startItem,t.endItem,t.nextToken]),s.setByte(0,$t(r,!0,s.length)),s.trim()}},chapterVerseIndex:(e,n)=>{const t=e.processor.docSets[e.docSetId];t.buildEnumIndexes();const s=[],r=e.sequences[e.mainId].chapterVerses[n];if(r){let e=0,n=[];for(;e<r.length;){const[o,i,c]=Jt(r,e);if(2===o){const s=r.nBytes(e+1,5);n.push({startBlock:s[0],endBlock:s[0],startItem:s[1],endItem:s[2],nextToken:s[3],verses:t.enums.scopeBits.countedString(t.enumIndexes.scopeBits[s[4]])})}else if(3===o){const s=r.nBytes(e+1,6);n.push({startBlock:s[0],endBlock:s[1],startItem:s[2],endItem:s[3],nextToken:s[4],verses:t.enums.scopeBits.countedString(t.enumIndexes.scopeBits[s[5]])})}i&&(s.push(n),n=[]),e+=c}}return s},chapterIndex:(e,n)=>{const t=e.sequences[e.mainId].chapters[n];if(t){const e=Jt(t,0)[0];if(2===e){const e=t.nBytes(1,4);return{startBlock:e[0],endBlock:e[0],startItem:e[1],endItem:e[2],nextToken:e[3]}}if(3===e){const e=t.nBytes(1,5);return{startBlock:e[0],endBlock:e[1],startItem:e[2],endItem:e[3],nextToken:e[4]}}}}}).buildChapterVerseIndex,Lt=qt.chapterVerseIndex,Vt=qt.chapterIndex,Kt={};const Ut=(e,n,t)=>{const s=e.processor.docSets[e.docSetId];for(const r of Object.values(e.sequences))for(const e of r.blocks){const r="block"===n?e.bg:e.c;let o=0;for(;o<r.length;){const[e,n]=y.succinct.headerBytes(r,o);if(n!==y.itemDefs.itemEnum.graft)o+=e;else{y.succinct.succinctGraftSeqId(s.enums,s.enumIndexes,r,o)===t?r.deleteItem(o):o+=e}}}},Xt=(e,n,t,s,r,o)=>{t=t||((e,n,t)=>!!t),s=s||((e,n,t,s,r,o,i)=>!!t||i),r=r||((e,n,t)=>t),o=o||((e,n,t,s,r,o,i,c,a)=>{for(let e=0;e<o;e++)s.c.pushByte(t.c.byte(a+e))}),n.blocks=[];for(const[i,c]of e.blocks.entries())if(t(e,i,c)){const t=r(e,i,h(c));t.c.clear(),jt(e,i,c,t,s,o),n.blocks.push(t)}},jt=(e,n,t,s,r,o)=>{let i=0,c=-1;for(;i<t.c.length;){c++;const[a,l,u]=y.succinct.headerBytes(t.c,i);r(e,n,t,c,l,u,i)&&o(e,n,t,s,c,a,l,u,i),i+=a}};var Wt=(Kt={newSequence:(e,n,t)=>{const s=y.generateId();return e.sequences[s]={id:s,type:n,tags:new Set(t||[]),isBaseType:n in e.baseSequenceTypes,blocks:[]},s},gcSequences:e=>{const n=new Set,t=e.processor.docSets[e.docSetId];t.maybeBuildEnumIndexes();const s=(e,n,r)=>{r.add(n.id);for(const o of n.blocks){for(const n of t.unsuccinctifyGrafts(o.bg))r.has(n[2])||s(e,e.sequences[n[2]],r);for(const n of t.unsuccinctifyItems(o.c,{grafts:!0},0))r.has(n[2])||s(e,e.sequences[n[2]],r)}};s(e,e.sequences[e.mainId],n);let r=!1;for(const t of Object.keys(e.sequences))n.has(t)||(delete e.sequences[t],r=!0);return r},deleteSequence:(e,n)=>{if(!(n in e.sequences))return!1;if("main"===e.sequences[n].type)throw new Error("Cannot delete main sequence");return e.sequences[n].type in e.baseSequenceTypes?Ut(e,"block",n):Ut(e,"inline",n),delete e.sequences[n],e.buildChapterVerseIndex(Kt),e.gcSequences(),!0},modifySequence:(e,n,t,s,r,o,i)=>{e.processor.docSets[e.docSetId].maybeBuildEnumIndexes(),t=t||(e=>e);const c=e.sequences[n],a=t({id:n,type:c.type,tags:c.tags,isBaseType:c.isBaseType,verseMapping:c.verseMapping});return Xt(c,a,s,r,o,i),e.sequences[n]=a,"main"===a.type&&e.buildChapterVerseIndex(),a}}).modifySequence,Zt=Kt.deleteSequence,Ft=Kt.gcSequences,zt=Kt.newSequence,Yt={};const _t=y.ByteArray,{pushSuccinctGraftBytes:Qt,pushSuccinctScopeBytes:es,pushSuccinctTokenBytes:ns}=y.succinct,{itemEnum:ts}=y.itemDefs,{scopeEnum:ss,scopeEnumLabels:rs,nComponentsForScope:os}=y.scopeDefs,{tokenCategory:is,tokenEnum:cs}=y.tokenDefs,{headerBytes:as}=y.succinct;var ls=Je.updateBlockGrafts;var us=(Yt={newBlock:(e,n,t,s,r,o)=>{if(!1!==o&&(o=!0),!(n in e.sequences))return!1;const i=e.sequences[n];if(t<0||t>i.blocks.length)return!1;const c=e.processor.docSets[e.docSetId];c.maybeBuildPreEnums();const a={bs:new _t(0),bg:new _t(0),c:new _t(0),os:new _t(0),is:new _t(0),nt:new _t(0)},l=s.split("/"),u=ss[l[0]],S=os(l[0]);if(l.length!==S)throw new Error(`Scope ${s} has ${l.length} component(s) (expected ${S}`);const h=l.slice(1).map((e=>c.enumForCategoryValue("scopeBits",e,!0)));return es(a.bs,ts.startScope,u,h),a.bs.trim(),r&&ls(c,e.id,n,t,r),i.blocks.splice(t,0,a),o&&e.buildChapterVerseIndex(),!0},deleteBlock:(e,n,t,s)=>{if(!1!==s&&(s=!0),!(n in e.sequences))return!1;const r=e.sequences[n];return!(t<0||t>=r.blocks.length)&&(r.blocks.splice(t,1),s&&e.buildChapterVerseIndex(Yt),!0)},rewriteBlock:(e,n)=>{for(const t of["bs","bg","c","is","os"]){const s=e[t],r=new _t(s.length);let o=0;for(;o<s.length;){const[e,t,i]=as(s,o);if(t===ts.token)i===cs.wordLike?ns(r,i,n.wordLike[s.nByte(o+2)]):ns(r,i,n.notWordLike[s.nByte(o+2)]);else if(t===ts.graft)Qt(r,n.graftTypes[i],n.ids[s.nByte(o+2)]);else{let e=os(rs[i]);const c=[];let a=2;for(;e>1;){const t=n.scopeBits[s.nByte(o+a)];c.push(t),a+=s.nByteLength(t),e--}es(r,t,i,c)}o+=e}r.trim(),e[t]=r}}}).deleteBlock,Ss=Yt.newBlock,hs=Yt.rewriteBlock;const ps=y.ByteArray,{itemEnum:ds}=y.itemDefs;var fs={succinctFilter:(e,n)=>{if(!n||0===Object.keys(n).length)return;const t=e.processor.docSets[e.docSetId],s=(e,s,r,o,i,c,a)=>{if(i===ds.token)return!0;if(i===ds.startScope||i===ds.endScope){if(n.includeScopes||n.excludeScopes){const e=t.unsuccinctifyScope(r.c,i,c,a);return(!n.includeScopes||n.includeScopes.filter((n=>e[2].startsWith(n))).length>0)&&(!n.excludeScopes||0===n.excludeScopes.filter((n=>e[2].startsWith(n))).length)}return!0}{if(!n.includeGrafts&&!n.excludeGrafts)return!0;const e=t.unsuccinctifyGraft(r.c,c,a);return(!n.includeGrafts||n.includeGrafts.filter((n=>e[1].startsWith(n))).length>0)&&(!n.excludeGrafts||0===n.excludeGrafts.filter((n=>e[1].startsWith(n))).length)}},r=(e,s,r)=>{const o=new ps(r.bg.length);let i=0;for(;i<r.bg.length;){const[e,s,c]=y.succinct.headerBytes(r.bg,i),a=t.unsuccinctifyGraft(r.bg,c,i);if((!n.includeGrafts||n.includeGrafts.filter((e=>a[1].startsWith(e))).length>0)&&(!n.excludeGrafts||0===n.excludeGrafts.filter((e=>a[1].startsWith(e))).length))for(let n=0;n<e;n++)o.pushByte(r.bg.byte(i+n));i+=e}return o.trim(),r.bg=o,r};Object.keys(e.sequences).forEach((n=>{e.modifySequence(n,null,null,s,r,null)})),Object.values(e.sequences).forEach((e=>t.updateBlockIndexesAfterFilter(e))),e.gcSequences()}}.succinctFilter;const ms=e=>{const n={type:e.type,blocks:e.blocks.map((e=>gs(e))),tags:Array.from(e.tags)};if("main"===e.type){n.chapters={};for(const[t,s]of Object.entries(e.chapters||{}))s.trim(),n.chapters[t]=s.base64();n.chapterVerses={};for(const[t,s]of Object.entries(e.chapterVerses||{}))s.trim(),n.chapterVerses[t]=s.base64();"tokensPresent"in e&&(n.tokensPresent="0x"+e.tokensPresent.toString(16))}return n},gs=e=>{for(const n of["bs","bg","c","is","os","nt"])e[n].trim();return{bs:e.bs.base64(),bg:e.bg.base64(),c:e.c.base64(),is:e.is.base64(),os:e.os.base64(),nt:e.nt.base64()}};var As,Es={serializeSuccinct:e=>{const n={sequences:{}};n.headers=e.headers,n.mainId=e.mainId,n.tags=Array.from(e.tags);for(const[t,s]of Object.entries(e.sequences))n.sequences[t]=ms(s);return n}}.serializeSuccinct;const bs=(e,n)=>{for(const t of e.unsuccinctifyItems(n,{},0))if("token"===t[0])"wordLike"===t[1]?e.recordPreEnum("wordLike",t[2]):e.recordPreEnum("notWordLike",t[2]);else if("graft"===t[0])e.recordPreEnum("graftTypes",t[1]);else if("scope"===t[0]&&"start"===t[1]){const n=t[2].split("/");if(n.length!==y.scopeDefs.nComponentsForScope(n[0]))throw new Error(`Scope ${t[2]} has unexpected number of components`);for(const t of n.slice(1))e.recordPreEnum("scopeBits",t)}};var ys=(As={recordPreEnums:(e,n)=>{e.recordPreEnum("scopeBits","0");for(const[t,s]of n.blocks.entries())for(const[n,t]of[...s.items,s.bs,...s.bg].entries())if("wordLike"===t.subType)e.recordPreEnum("wordLike",t.payload);else if(["lineSpace","eol","punctuation","softLineBreak","bareSlash","unknown"].includes(t.subType))e.recordPreEnum("notWordLike",t.payload);else if("graft"===t.type)e.recordPreEnum("graftTypes",t.subType);else if("start"===t.subType){const n=t.payload.split("/");if(n.length!==y.scopeDefs.nComponentsForScope(n[0]))throw new Error(`Scope ${t.payload} has unexpected number of components`);for(const t of n.slice(1))e.recordPreEnum("scopeBits",t)}},rerecordPreEnums:(e,n)=>{e.recordPreEnum("scopeBits","0"),e.recordPreEnum("ids",n.id);for(const t of n.blocks)for(const n of["bs","bg","c","is","os"])bs(e,t[n])}}).recordPreEnums,Ps=As.rerecordPreEnums;const{addTag:ks,removeTag:Is,validateTags:ws}=y.tags,Ts=y.parserConstants;var vs,Bs,Os={Document:class{constructor(e,n,t,s,r,o,i,c){if(this.processor=e,this.docSetId=n,this.baseSequenceTypes=Ts.usfm.baseSequenceTypes,t)switch(this.id=y.generateId(),this.filterOptions=r,this.customTags=o,this.emptyBlocks=i,this.tags=new Set(c||[]),ws(this.tags),this.headers={},this.mainId=null,this.sequences={},t.toLowerCase()){case"usfm":case"sfm":this.processUsfm(s);break;case"usx":this.processUsx(s);break;case"tsv":this.processTSV(s);break;case"nodes":this.processNodes(s);break;default:throw new Error(`Unknown document contentType '${t}'`)}}addTag(e){ks(this.tags,e)}removeTag(e){Is(this.tags,e)}makeParser(){return new mt(this.filterOptions,this.customTags,this.emptyBlocks)}processUsfm(e){const n=this.makeParser();Date.now();st(e,n);Date.now();this.postParseScripture(n),Date.now(),Date.now()}processUsx(e){const n=this.makeParser();Date.now();rt(e,n);Date.now();this.postParseScripture(n),Date.now(),Date.now()}processTSV(e){const n=this.makeParser(),t=`T${this.processor.nextTable>9?this.processor.nextTable:"0"+this.processor.nextTable}`;this.processor.nextTable++,ot(e,n,t),this.headers=n.headers,this.succinctPass1(n),this.succinctPass2(n),Ht(this);const s=Object.values(this.sequences).filter((e=>"table"===e.type))[0];for(const[n,t]of JSON.parse(e).headings.entries())s.tags.add(`col${n}:${t}`)}processNodes(e){const n=this.makeParser(),t=`N${this.processor.nextNodes>9?this.processor.nextNodes:"0"+this.processor.nextNodes}`;this.processor.nextNodes++,it(e,n,t),this.headers=n.headers,this.succinctPass1(n),this.succinctPass2(n),Ht(this)}postParseScripture(e){let n=Date.now();e.tidy(),Date.now(),n=Date.now();const t=e.filterOptions;this.headers=e.headers,this.succinctPass1(e),Date.now(),n=Date.now(),this.succinctPass2(e),Date.now(),n=Date.now(),this.succinctFilter(t),Date.now(),n=Date.now(),Ht(this),Date.now()}succinctFilter(e){fs(this,e)}succinctPass1(e){const n=this.processor.docSets[this.docSetId];let t=Date.now();for(const t of e.allSequences())n.recordPreEnum("ids",t.id),this.recordPreEnums(n,t);Date.now(),t=Date.now(),0===n.enums.wordLike.length&&(n.sortPreEnums(),Date.now(),t=Date.now()),n.buildEnums(),Date.now()}recordPreEnums(e,n){ys(e,n)}rerecordPreEnums(e,n){Ps(e,n)}succinctPass2(e){const n=this.processor.docSets[this.docSetId];this.mainId=e.sequences.main.id;for(const t of e.allSequences())this.sequences[t.id]={id:t.id,type:t.type,tags:new Set(t.tags),isBaseType:t.type in e.baseSequenceTypes,blocks:t.succinctifyBlocks(n)};this.sequences[this.mainId].verseMapping={}}modifySequence(e,n,t,s,r,o){Wt(this,e,n,t,s,r,o)}buildChapterVerseIndex(){Ht(this)}chapterVerseIndexes(){const e={};for(const n of Object.keys(this.sequences[this.mainId].chapterVerses))e[n]=Lt(this,n);return e}chapterVerseIndex(e){return Lt(this,e)}chapterIndexes(){const e={};for(const n of Object.keys(this.sequences[this.mainId].chapters))e[n]=Vt(this,n);return e}chapterIndex(e){return Vt(this,e)}rewriteSequenceBlocks(e,n){const t=this.sequences[e];for(const e of t.blocks)this.rewriteSequenceBlock(e,n)}rewriteSequenceBlock(e,n){hs(e,n)}serializeSuccinct(){return Es(this)}gcSequences(){return Ft(this)}newSequence(e,n){return zt(this,e,n)}deleteSequence(e){return Zt(this,e)}deleteBlock(e,n,t){return us(this,e,n,t)}newBlock(e,n,t,s,r){return Ss(this,e,n,t,s,r)}perf(e){const n={};return new ln({proskomma:this.processor,actions:Sn.perfToPerf.renderActions.identityActions}).renderDocument({docId:this.id,config:{},output:n}),e?JSON.stringify(n.perf,null,e):JSON.stringify(n.perf)}async usfm(){const e=JSON.parse(this.perf());try{const n=new hn({pipelines:dt,transforms:At,proskomma:this.processor});return(await n.runPipeline("perf2usfmPipeline",{perf:e})).usfm}catch(e){console.error("pipelineHandler Error :\n",e)}}sofria(e,n){const t=new un({proskomma:this.processor,actions:Sn.sofriaToSofria.renderActions.identityActions}),s={},r={};n&&(r.chapters=[`${n}`]);try{t.renderDocument({docId:this.id,config:r,output:s})}catch(e){throw console.log(e),e}return e?JSON.stringify(s.sofria,null,e):JSON.stringify(s.sofria)}}}.Document;var xs,Gs=(Bs={keyValueSchemaString:'\n"""Key/Value tuple"""\ntype KeyValue {\n """The key"""\n key: String!\n """The value"""\n value: String!\n}',keyValueResolvers:{key:e=>e[0],value:e=>e[1]}}).keyValueSchemaString,Cs=Bs.keyValueResolvers;var Ns,qs=(xs={cvSchemaString:'\n"""A chapter-verse reference"""\ntype cv {\n """The chapter number"""\n chapter: Int\n """The verse number"""\n verse: Int\n}\n',cvResolvers:{chapter:e=>e[0],verse:e=>e[1]}}).cvSchemaString,Rs=xs.cvResolvers;var Ms=(Ns={idPartsSchemaString:'\n"""Type-dependent parts of the ID header"""\ntype idParts {\n """The type of the ID"""\n type: String\n """An array of parts of the ID"""\n parts: [String]\n """A part of the ID, by index"""\n part(\n """The numeric index of the part"""\n index: Int!\n ): String\n}\n',idPartsResolvers:{type:e=>e[0],parts:e=>e[1],part:(e,n)=>!e[1]||n.index<0||n.index>=e[1].length?null:e[1][n.index]}}).idPartsSchemaString,Ds=Ns.idPartsResolvers;var $s={inputAttSpecSchemaString:'\n"""Attribute Specification"""\ninput AttSpec {\n"""The type of attribute, ie what type of thing it\'s connected to"""\nattType: String!\n"""The name of the USFM tag to which the attribute is connected"""\ntagName: String!\n"""The attribute key (ie the bit to the left of the equals sign in USX)"""\nattKey: String!\n"""The position of the value (which is 0 except for attributes with multiple values)"""\nvalueN: Int!\n}'}.inputAttSpecSchemaString;var Js={keyMatchesSchemaString:'\n"""Key/Regex tuple"""\ninput KeyMatches {\n """The key"""\n key: String!\n """The regex to match"""\n matches: String!\n}\n'}.keyMatchesSchemaString;var Hs={inputKeyValueSchemaString:'\n"""Input Key/Value Object"""\ninput InputKeyValue {\n """The key"""\n key: String!\n """The value"""\n value: String!\n}\n'}.inputKeyValueSchemaString;var Ls={keyValuesSchemaString:'\n"""Input Key/Values Object"""\ninput KeyValues {\n """The key"""\n key: String!\n """The values"""\n values: [String!]!\n}\n'}.keyValuesSchemaString;var Vs,Ks={inputItemObjectSchemaString:'\n"""Item for arguments"""\ninput InputItemObject {\n """The basic item type (token, scope or graft)\'"""\n type: String!\n """The type-dependent subtype of the item"""\n subType: String!\n """The content of the item (the text for tokens, the label for scopes and the sequence id for grafts)"""\n payload: String!\n}'}.inputItemObjectSchemaString;var Us,Xs,js=(Vs={itemSchemaString:'\n"""Item"""\ntype Item {\n """The basic item type (token, scope or graft)"""\n type: String!\n """The type-dependent subtype of the item"""\n subType: String!\n """The content of the item (the text for tokens, the label for scopes and the sequence id for grafts)"""\n payload(\n """If true, turn all whitespace into a normal space"""\n normalizeSpace: Boolean\n """A whitelist of characters to include"""\n includeChars: [String!]\n """A blacklist of characters to exclude"""\n excludeChars: [String!],\n ): String!\n """If \'includeContext\' was selected, and for tokens, the index of the token from the start of the sequence"""\n position(\n """Only include scopes that begin with this value"""\n startsWith: [String!]\n ): Int\n """If \'includeContext\' was selected, a list of scopes that are open around the item"""\n scopes(\n """Only include scopes that begin with this value"""\n startsWith: [String!]\n ): [String!]\n}\n',itemResolvers:{type:e=>e[0],subType:e=>e[1],payload:(e,n)=>{let t=e[2];if("token"===e[0]&&(n.normalizeSpace&&(t=e[2].replace(/[ \t\n\r]+/g," ")),n.includeChars||n.excludeChars)){let e=t.split("");e=e.filter((e=>!n.includeChars||n.includeChars.includes(e))),e=e.filter((e=>!n.excludeChars||!n.excludeChars.includes(e))),t=e.join("")}return t},position:e=>e[3],scopes:(e,n)=>e[4]?e[4].filter((e=>!n.startsWith||((e,n)=>{if(0===e.length)return!0;for(const t of e)if(n.startsWith(t))return!0;return!1})(n.startsWith,e))):[]}}).itemSchemaString,Ws=Vs.itemResolvers;const Zs=e=>{let n;switch(e[0]){case"token":return`|${e[2]}`;case"scope":return n="start"===e[1]?"+":"-",`${n}${e[2]}${n}`;case"graft":return`>${e[1]}<`}},Fs=e=>e.map((e=>Zs(e))).join("");var zs=(Xs={dumpBlock:e=>{const n=["Block:"];return e.bg.length>0&&e.bg.forEach((e=>n.push(` ${e[1]} graft to ${e[2]}`))),n.push(` Scope ${e.bs[2]}`),n.push(` ${Fs(e.c)}`),n.join("\n")},dumpItemGroup:e=>{const n=["ItemGroup:"];return n.push(` Open Scopes ${e[0].join(", ")}`),n.push(` ${Fs(e[1])}`),n.join("\n")},dumpItems:Fs,dumpItem:Zs}).dumpItemGroup;var Ys,_s=(Us={itemGroupSchemaString:'\n"""A collection of items, with scope context"""\ntype ItemGroup {\n """Items for this itemGroup"""\n items: [Item!]!\n """Tokens for this itemGroup"""\n tokens(\n """Return tokens whose payload is an exact match to one of the specified strings"""\n withChars: [String!]\n """Return tokens with one of the specified subTypes"""\n withSubTypes: [String!]\n ): [Item!]!\n """The text of the itemGroup as a single string"""\n text(\n """If true, converts each whitespace character to a single space"""\n normalizeSpace: Boolean\n ): String!\n """The labels of scopes that were open at the beginning of the itemGroup"""\n scopeLabels(\n """Only include scopes that begin with this value"""\n startsWith: [String!]\n ): [String!]!\n """The itemGroup content as a string in a compact eyeballable format"""\n dump: String!\n """A list of scopes from the items of the itemGroup"""\n includedScopes: [String!]!\n} \n',itemGroupResolvers:{items:e=>e[1],tokens:(e,n)=>e[1].filter((e=>"token"===e[0]&&(!n.withChars||n.withChars.includes(e[2]))&&(!n.withSubTypes||n.withSubTypes.includes(e[1])))),text:(e,n)=>{const t=e[1].filter((e=>"token"===e[0])).map((e=>e[2])).join("");return n.normalizeSpace?t.replace(/[ \t\n\r]+/g," "):t},scopeLabels:(e,n)=>e[0].filter((e=>!n.startsWith||((e,n)=>{if(0===e.length)return!0;for(const t of e)if(n.startsWith(t))return!0;return!1})(n.startsWith,e))),dump:e=>zs(e),includedScopes:e=>Array.from(new Set(e[1].filter((e=>"scope"===e[0]&&"start"===e[1])).map((e=>e[2]))))}}).itemGroupSchemaString,Qs=Us.itemGroupResolvers;var er,nr=(Ys={kvEntrySchemaString:'\n"""Key/Items tuple"""\ntype kvEntry {\n """The key"""\n key: String!\n """The secondary keys"""\n secondaryKeys: [KeyValue!]\n """The fields as itemGroups"""\n itemGroups: [ItemGroup]!\n}',kvEntryResolvers:{key:e=>e[0],secondaryKeys:e=>e[1],itemGroups:e=>e[2]}}).kvEntrySchemaString,tr=Ys.kvEntryResolvers;var sr=(er={regexIndexSchemaString:'\n"""Information about a regex match on an enum"""\ntype regexIndex {\n """The index in the enum"""\n index: String!\n """The string in the enum that matched"""\n matched: String!\n}',regexIndexResolvers:{index:e=>e[0],matched:e=>e[1]}}).regexIndexSchemaString,rr=er.regexIndexResolvers;var or={rowEqualsSpecSchemaString:'\n"""Row Equals Specification"""\ninput rowEqualsSpec {\n """The position of the column in which to search a match"""\n colN: Int!\n """The values to match"""\n values: [String!]!\n}\n'}.rowEqualsSpecSchemaString;var ir={rowMatchSpecSchemaString:'\n"""Row Match Specification"""\ninput rowMatchSpec {\n """The position of the column in which to search a match"""\n colN: Int!\n """The regex to match"""\n matching: String!\n}\n'}.rowMatchSpecSchemaString;var cr={verseRangeSchemaString:'\n"""Information about a verse range (which may only cover one verse)"""\ntype verseRange {\n """The range, as it would be printed in a Bible"""\n range: String!\n """A list of verse numbers for this range"""\n numbers: [Int!]!\n}\n'}.verseRangeSchemaString;var ar,lr={origSchemaString:'\n"""Mapped verse information"""\ntype orig {\n """The book code"""\n book: String\n """A list of chapter-verse references"""\n cvs: [cv!]!\n}\n'}.origSchemaString;var ur,Sr=(ar={verseNumberSchemaString:'\n"""Information about a verse number (which may be part of a verse range)"""\ntype verseNumber {\n """The verse number"""\n number: Int!\n """The verse range to which the verse number belongs"""\n range: String!\n """The reference for this verse when mapped to \'original\' versification"""\n orig: orig!\n}\n',verseNumberResolvers:{orig:(e,n,t)=>{const s=t.doc.headers.bookCode,r=t.cvIndex[0],o=e.number,i=t.doc.sequences[t.doc.mainId];if(i.verseMapping&&"forward"in i.verseMapping&&`${r}`in i.verseMapping.forward){const e=y.versification.mapVerse(i.verseMapping.forward[`${r}`],s,r,o);return{book:e[0],cvs:e[1]}}return{book:s,cvs:[[r,o]]}}}}).verseNumberSchemaString,hr=ar.verseNumberResolvers;var pr,dr=(ur={cellSchemaString:'\n"""A table cell"""\ntype cell {\n """The row numbers"""\n rows: [Int!]!\n """The column numbers"""\n columns: [Int!]!\n """A list of items from the c (content) field of the cell"""\n items: [Item!]!\n """A list of tokens from the c (content) field of the cell"""\n tokens: [Item!]!\n """The text of the cell as a single string"""\n text(\n """If true, converts each whitespace character to a single space"""\n normalizeSpace: Boolean\n ): String!\n}\n',cellResolvers:{rows:e=>e[0],columns:e=>e[1],items:e=>e[2],tokens:e=>e[2].filter((e=>"token"===e[0])),text:(e,n)=>{let t=e[2].filter((e=>"token"===e[0])).map((e=>e[2])).join("").trim();return n.normalizeSpace&&(t=t.replace(/[ \t\n\r]+/g," ")),t}}}).cellSchemaString,fr=ur.cellResolvers,mr=Xs.dumpItems;var gr,Ar=(pr={cIndexSchemaString:'\n"""A chapter index entry"""\ntype cIndex {\n """The chapter number"""\n chapter: Int!\n """The zero-indexed number of the block where the chapter starts"""\n startBlock: Int\n """The zero-indexed number of the block where the chapter ends"""\n endBlock: Int\n """The zero-indexed position of the item where the chapter starts"""\n startItem: Int\n """The zero-indexed position of the item where the chapter ends"""\n endItem: Int\n """The value of nextToken at the beginning of the chapter"""\n nextToken: Int\n """A list of items for this chapter"""\n items(\n """If true, adds scope and nextToken information to each token"""\n includeContext: Boolean\n ): [Item]!\n """The items as a string in a compact eyeballable format"""\n dumpItems: String\n """A list of tokens for this chapter"""\n tokens(\n """If true, adds scope and nextToken information to each token"""\n includeContext: Boolean\n """Return tokens whose payload is an exact match to one of the specified strings"""\n withChars: [String!]\n """Return tokens with one of the specified subTypes"""\n withSubTypes: [String!]\n ): [Item]!\n """The text of the chapter as a single string"""\n text(\n """If true, converts each whitespace character to a single space"""\n normalizeSpace: Boolean\n ): String!\n}\n',cIndexResolvers:{chapter:e=>e[0],startBlock:e=>e[1].startBlock,endBlock:e=>e[1].endBlock,startItem:e=>e[1].startItem,endItem:e=>e[1].endItem,nextToken:e=>e[1].nextToken,items:(e,n,t)=>t.docSet.itemsByIndex(t.doc.sequences[t.doc.mainId],e[1],n.includeContext).reduce(((e,n)=>e.concat([["token","lineSpace"," "]].concat(n))),[]),dumpItems:(e,n,t)=>{const s=t.docSet.itemsByIndex(t.doc.sequences[t.doc.mainId],e[1],!1);return s.length>0?mr(s.reduce(((e,n)=>e.concat([["token","lineSpace"," ",null]].concat(n))))):""},tokens:(e,n,t)=>t.docSet.itemsByIndex(t.doc.sequences[t.doc.mainId],e[1],n.includeContext).reduce(((e,n)=>e.concat([["token","lineSpace"," "]].concat(n))),[]).filter((e=>"token"===e[0]&&(!n.withChars||n.withChars.includes(e[2]))&&(!n.withSubTypes||n.withSubTypes.includes(e[1])))),text:(e,n,t)=>{let s=t.docSet.itemsByIndex(t.doc.sequences[t.doc.mainId],e[1]).reduce(((e,n)=>e.concat([["token","lineSpace"," "]].concat(n))),[]).filter((e=>"token"===e[0])).map((e=>"lineSpace"===e[1]?" ":e[2])).join("").trim();return n.normalizeSpace&&(s=s.replace(/[ \t\n\r]+/g," ")),s}}}).cIndexSchemaString,Er=pr.cIndexResolvers,br=Xs.dumpItems;var yr,Pr=(gr={cvVerseElementSchemaString:'\n""""""\ntype cvVerseElement {\n """The zero-indexed number of the block where the verse starts"""\n startBlock: Int\n """The zero-indexed number of the block where the verse ends"""\n endBlock: Int\n """The zero-indexed position of the item where the verse starts"""\n startItem: Int\n """The zero-indexed position of the item where the verse ends"""\n endItem: Int\n """The value of nextToken at the beginning of the verse"""\n nextToken: Int\n """The verse range for this verse as it would be printed in a Bible"""\n verseRange: String\n """A list of items for this verse"""\n items(\n """If true, adds scope and nextToken information to each token"""\n includeContext: Boolean\n ): [Item]!\n """The items as a string in a compact eyeballable format"""\n dumpItems: String\n """A list of tokens for this verse"""\n tokens(\n """If true, adds scope and nextToken information to each token"""\n includeContext: Boolean\n """Return tokens whose payload is an exact match to one of the specified strings"""\n withChars: [String!]\n """Return tokens with one of the specified subTypes"""\n withSubTypes: [String!]\n ): [Item]!\n """The text of the verse as a single string"""\n text(\n """If true, converts each whitespace character to a single space"""\n normalizeSpace: Boolean\n ): String!\n}\n',cvVerseElementResolvers:{startBlock:e=>e.startBlock,endBlock:e=>e.endBlock,startItem:e=>e.startItem,endItem:e=>e.endItem,nextToken:e=>e.nextToken,verseRange:e=>e.verses,items:(e,n,t)=>t.docSet.itemsByIndex(t.doc.sequences[t.doc.mainId],e,n.includeContext).reduce(((e,n)=>e.concat([["token","lineSpace"," ",null]].concat(n)))),dumpItems:(e,n,t)=>br(t.docSet.itemsByIndex(t.doc.sequences[t.doc.mainId],e,n.includeContext).reduce(((e,n)=>e.concat([["token","lineSpace"," ",null]].concat(n))))),tokens:(e,n,t)=>t.docSet.itemsByIndex(t.doc.sequences[t.doc.mainId],e,n.includeContext).reduce(((e,n)=>e.concat([["token","lineSpace"," ",null]].concat(n)))).filter((e=>"token"===e[0]&&(!n.withChars||n.withChars.includes(e[2]))&&(!n.withSubTypes||n.withSubTypes.includes(e[1])))),text:(e,n,t)=>{let s=t.docSet.itemsByIndex(t.doc.sequences[t.doc.mainId],e).reduce(((e,n)=>e.concat([["token","lineSpace"," ",null]].concat(n)))).filter((e=>"token"===e[0])).map((e=>"lineSpace"===e[1]?" ":e[2])).join("").trim();return n.normalizeSpace&&(s=s.replace(/[ \t\n\r]+/g," ")),s}}}).cvVerseElementSchemaString,kr=gr.cvVerseElementResolvers;var Ir,wr=(yr={cvVersesSchemaString:'\n"""Information about a verse in the chapter, which may be split into several pieces"""\ntype cvVerses {\n """The pieces of verse"""\n verse: [cvVerseElement]\n}\n',cvVersesResolvers:{verse:e=>e}}).cvVersesSchemaString,Tr=yr.cvVersesResolvers;var vr,Br=(Ir={cvIndexSchemaString:'\n"""A chapterVerse index entry"""\ntype cvIndex {\n """The chapter number"""\n chapter: Int!\n """Information about the verses in the chapter"""\n verses: [cvVerses]\n """A list of verse number and range information, organized by verse number"""\n verseNumbers: [verseNumber!]\n """A list of verse number and range information, organized by verse range"""\n verseRanges: [verseRange!]\n}\n',cvIndexResolvers:{chapter:e=>e[0],verses:e=>e[1],verseNumbers:(e,n,t)=>(t.cvIndex=e,[...e[1].entries()].filter((e=>e[1].length>0)).map((e=>({number:e[0],range:e[1][e[1].length-1].verses})))),verseRanges:e=>{const n=[];for(const[t,s]of[...e[1].entries()].filter((e=>e[1].length>0)))0===n.length||n[n.length-1].range!==s[s.length-1].verses?n.push({range:s[s.length-1].verses,numbers:[t]}):n[n.length-1].numbers.push(t);return n}}}).cvIndexSchemaString,Or=Ir.cvIndexResolvers;const xr=(e,n)=>{const t=parseInt(e[0]),s=parseInt(e[1]);if(e[3].length<=s||0===e[3][s].length)return null;let r=null,o=t,i=s,c=e[3],a=c[s][0].verses,l=!1;for(;!r;)if(i+=1,i>=c.length){if(l||!e[4])break;i=-1,o+=1,c=e[4],l=!0}else c[i].length>0&&(!n||l||c[i][0].verses!==a)&&(r=[o,i]);return r},Gr=(e,n)=>{const t=parseInt(e[0]),s=parseInt(e[1]);if(e[3].length<=s||0===e[3][s].length)return null;let r=null,o=t,i=s,c=e[3],a=c[s][0].verses,l=!1;for(;!r;)if(i-=1,i<0){if(l||!e[2])break;i=e[2].length,o-=1,c=e[2],l=!0}else c[i].length>0&&(!n||l||c[i][0].verses!==a)&&(r=[o,i]);return r};var Cr=(vr={cvNavigationSchemaString:'\n"""Various answers to \'previous\' and \'next\' with respect to a verse"""\ntype cvNavigation {\n """The verse number for the next verse"""\n nextVerse: cv\n """The verse number for the previous verse"""\n previousVerse: cv\n """The verse number for the next verse range"""\n nextVerseRangeVerse: cv\n """The verse number for the previous verse range"""\n previousVerseRangeVerse: cv\n """The next chapter number (as a string)"""\n nextChapter: String\n """The previous chapter number (as a string)"""\n previousChapter: String\n}\n',cvNavigationResolvers:{nextVerse:e=>xr(e,!1),previousVerse:e=>Gr(e,!1),nextVerseRangeVerse:e=>xr(e,!0),previousVerseRangeVerse:e=>Gr(e,!0),nextChapter:e=>e[3].length>0&&e[4].length>0?(parseInt(e[0])+1).toString():null,previousChapter:e=>e[2].length>0&&e[3].length>0?(parseInt(e[0])-1).toString():null}}).cvNavigationSchemaString,Nr=vr.cvNavigationResolvers;var qr,Rr={inputBlockSpecSchemaString:'\n"""A specification to create or update a block"""\ninput inputBlockSpec {\n """The block scope as an item"""\n bs: InputItemObject!\n """The block grafts as items"""\n bg: [InputItemObject!]!\n """The open scopes as items"""\n os: [InputItemObject!]!\n """The included scopes as items"""\n is: [InputItemObject!]!\n """The items"""\n items: [InputItemObject!]!\n}\n'}.inputBlockSpecSchemaString;var Mr,Dr=(qr={nodeSchemaString:'\n"""A tree node"""\ntype node {\n """The node id"""\n id: String!\n """The node parent id"""\n parentId: String\n """The keys for content"""\n keys: [String!]!\n """The content as itemGroups"""\n itemGroups(\n """If true, adds scope and nextToken information to each token"""\n includeContext: Boolean\n ): [ItemGroup!]!\n """The node children ids"""\n childIds: [String!]!\n}\n',nodeResolvers:{id:(e,n,t)=>{const[s,r,o]=y.succinct.headerBytes(e.bs,0);return t.docSet.unsuccinctifyScope(e.bs,r,o,0)[2].split("/")[1]},parentId:(e,n,t)=>{const s=t.docSet.unsuccinctifyScopes(e.is).filter((e=>e[2].startsWith("tTreeParent")))[0][2].split("/")[1];return"none"===s?null:s},keys:(e,n,t)=>t.docSet.unsuccinctifyScopes(e.is).filter((e=>e[2].startsWith("tTreeContent"))).map((e=>e[2].split("/")[1])),itemGroups:(e,n,t)=>t.docSet.sequenceItemsByScopes([e],["tTreeContent/"],n.includeContext||!1),childIds:(e,n,t)=>t.docSet.unsuccinctifyScopes(e.is).filter((e=>e[2].startsWith("tTreeChild"))).map((e=>e[2].split("/")[2]))}}).nodeSchemaString,$r=qr.nodeResolvers;var Jr,Hr=(Mr={kvSequenceSchemaString:'\n"""A contiguous flow of content for key-values"""\ntype kvSequence {\n """The id of the sequence"""\n id: String!\n """The number of entries in the key-value sequence"""\n nEntries: Int!\n """The entries in the key-value sequence"""\n entries(\n """Only return entries whose key matches the specification"""\n keyMatches: String\n """Only return entries whose key equals one of the values in the specification"""\n keyEquals: [String!]\n """Only return entries whose secondary keys match the specification"""\n secondaryMatches: [KeyMatches!]\n """Only return entries whose secondary keys equal one of the values in the specification"""\n secondaryEquals: [KeyValues!]\n """Only return entries whose content matches the specification"""\n contentMatches: [KeyMatches!]\n """Only return entries whose content equals one of the values in the specification"""\n contentEquals: [KeyValues!]\n ): [kvEntry!]\n """A list of the tags of this sequence"""\n tags: [String!]!\n """A list of the tags of this sequence as key/value tuples"""\n tagsKv: [KeyValue!]!\n """Whether or not the sequence has the specified tag"""\n hasTag(\n """The tag name"""\n tagName: String\n ): Boolean!\n}\n',kvSequenceResolvers:{nEntries:e=>e.blocks.length,entries:(n,t,s)=>{let r=n.blocks.map((e=>[s.docSet.unsuccinctifyScopes(e.bs).map((e=>e[2].split("/")[1]))[0],s.docSet.unsuccinctifyScopes(e.is).filter((e=>e[2].startsWith("kvSecondary/"))).map((e=>[e[2].split("/")[1],e[2].split("/")[2]])),s.docSet.sequenceItemsByScopes([e],["kvField/"],!1)]));if(t.keyMatches&&(r=r.filter((n=>e.test(n[0],e(t.keyMatches))))),t.keyEquals&&(r=r.filter((e=>t.keyEquals.includes(e[0])))),t.secondaryMatches){const n={};t.secondaryMatches.forEach((e=>n[e.key]=e.matches)),r=r.filter((t=>{const s={};t[1].forEach((e=>s[e[0]]=e[1]));for(const t of Object.entries(n)){const n=s[t[0]];if(!n||!e.test(n,e(t[1])))return!1}return!0}))}if(t.secondaryEquals){const e={};t.secondaryEquals.forEach((n=>e[n.key]=n.values)),r=r.filter((n=>{const t={};n[1].forEach((e=>t[e[0]]=e[1]));for(const n of Object.entries(e)){const e=t[n[0]];if(!e||!n[1].includes(e))return!1}return!0}))}if(t.contentMatches){const n={};t.contentMatches.forEach((e=>n[e.key]=e.matches)),r=r.filter((t=>{const s={};t[2].forEach((e=>s[e[0].filter((e=>e.startsWith("kvField")))[0].split("/")[1]]=e[1].filter((e=>"token"===e[0])).map((e=>e[2])).join("")));for(const t of Object.entries(n)){const n=s[t[0]];if(!n||!e.test(n,e(t[1])))return!1}return!0}))}if(t.contentEquals){const e={};t.contentEquals.forEach((n=>e[n.key]=n.values)),r=r.filter((n=>{const t={};n[2].forEach((e=>t[e[0].filter((e=>e.startsWith("kvField")))[0].split("/")[1]]=e[1].filter((e=>"token"===e[0])).map((e=>e[2])).join("")));for(const n of Object.entries(e)){const e=t[n[0]];if(!e||!e.includes(n[1]))return!1}return!0}))}return r},tags:e=>Array.from(e.tags),tagsKv:e=>Array.from(e.tags).map((e=>e.includes(":")?[e.substring(0,e.indexOf(":")),e.substring(e.indexOf(":")+1)]:[e,""])),hasTag:(e,n)=>e.tags.has(n.tagName)}}).kvSequenceSchemaString,Lr=Mr.kvSequenceResolvers;var Vr,Kr,Ur=(Jr={tableSequenceSchemaString:'\n"""A contiguous flow of content for a table"""\ntype tableSequence {\n """The id of the sequence"""\n id: String!\n """The number of cells in the table sequence"""\n nCells: Int!\n """The number of rows in the table sequence"""\n nRows: Int!\n """The number of columns in the table sequence"""\n nColumns: Int!\n """The cells in the table sequence"""\n cells: [cell!]!\n """The rows in the table sequence"""\n rows(\n """Only return rows whose zero-indexed position is in the list"""\n positions: [Int!]\n """Only return columns whose zero-indexed position is in the list"""\n columns: [Int!]\n """Only return rows whose cells match the specification"""\n matches: [rowMatchSpec!]\n """\'Only return rows whose cells contain one of the values in the specification"""\n equals: [rowEqualsSpec!]\n ): [[cell!]!]!\n """A list of the tags of this sequence"""\n tags: [String!]!\n """A list of the tags of this sequence as key/value tuples"""\n tagsKv: [KeyValue!]!\n """Whether or not the sequence has the specified tag"""\n hasTag(\n """The tag name"""\n tagName: String\n ): Boolean!\n """A list of column headings for this tableSequence, derived from the sequence tags"""\n headings: [String!]!\n}\n',tableSequenceResolvers:{nCells:e=>e.blocks.length,nRows:(e,n,t)=>{const s=new Set([]);for(const n of e.blocks){const[e,r,o]=y.succinct.headerBytes(n.bs,0),i=t.docSet.unsuccinctifyScope(n.bs,r,o,0)[2];s.add(i.split("/")[1])}return s.size},nColumns:(e,n,t)=>{const s=new Set([]);for(const n of e.blocks)for(const e of t.docSet.unsuccinctifyScopes(n.is).map((e=>e[2])))e.startsWith("tTableCol")&&s.add(e.split("/")[1]);return s.size},cells:(e,n,t)=>{const s=[];for(const n of e.blocks)s.push([t.docSet.unsuccinctifyScopes(n.bs).map((e=>parseInt(e[2].split("/")[1]))),Array.from(new Set(t.docSet.unsuccinctifyScopes(n.is).filter((e=>e[2].startsWith("tTableCol"))).map((e=>parseInt(e[2].split("/")[1]))))),t.docSet.unsuccinctifyItems(n.c,{},0)]);return s},rows:(n,t,s)=>{const r=(n,t)=>0===t.length||!!((n,t)=>{if(void 0===n[t.colN])return!1;const s=n[t.colN][2].filter((e=>"token"===e[0])).map((e=>e[2])).join("");return e.test(s,e(t.matching))})(n,t[0])&&r(n,t.slice(1)),o=(e,n)=>0===n.length||!!((e,n)=>{if(void 0===e[n.colN])return!1;const t=e[n.colN][2].filter((e=>"token"===e[0])).map((e=>e[2])).join("");return n.values.includes(t)})(e,n[0])&&o(e,n.slice(1));let i=[],c=-1;for(const e of n.blocks){const n=s.docSet.unsuccinctifyScopes(e.bs).map((e=>parseInt(e[2].split("/")[1])));t.positions&&!t.positions.includes(n[0])||(n[0]!==c&&(i.push([]),c=n[0]),i[i.length-1].push([n,Array.from(new Set(s.docSet.unsuccinctifyScopes(e.is).filter((e=>e[2].startsWith("tTableCol"))).map((e=>parseInt(e[2].split("/")[1]))))),s.docSet.unsuccinctifyItems(e.c,{},0)]))}return t.matches&&(i=i.filter((e=>r(e,t.matches)))),t.equals&&(i=i.filter((e=>o(e,t.equals)))),t.columns&&(i=i.map((e=>[...e.entries()].filter((e=>t.columns.includes(e[0]))).map((e=>e[1]))))),i},tags:e=>Array.from(e.tags),tagsKv:e=>Array.from(e.tags).map((e=>e.includes(":")?[e.substring(0,e.indexOf(":")),e.substring(e.indexOf(":")+1)]:[e,""])),hasTag:(e,n)=>e.tags.has(n.tagName),headings:e=>Array.from(e.tags).filter((e=>e.startsWith("col"))).sort(((e,n)=>parseInt(e.split(":")[0].substring(3))-parseInt(n.split(":")[0].substring(3)))).map((e=>e.split(":")[1]))}}).tableSequenceSchemaString,Xr=Jr.tableSequenceResolvers,jr={};const Wr={equals:(e,n,t,s)=>t===s,notEqual:(e,n,t,s)=>t!==s,and:(e,n,...t)=>0===t.filter((e=>!e)).length,or:(e,n,...t)=>t.filter((e=>e)).length>0,not:(e,n,t)=>!t,idRef:(e,n)=>e.unsuccinctifyScopes(n.bs)[0][2].split("/")[1],parentIdRef:(e,n)=>e.unsuccinctifyScopes(n.is).filter((e=>e[2].startsWith("tTreeParent")))[0][2].split("/")[1],nChildren:(e,n)=>e.unsuccinctifyScopes(n.is).filter((e=>e[2].startsWith("tTreeChild"))).length,contentRef:(e,n,t)=>{const s=e.sequenceItemsByScopes([n],["tTreeContent/"],!1).filter((e=>e[0].filter((e=>e.startsWith("tTreeContent")))[0].split("/")[1]===t));return s[0]?s[0][1].filter((e=>"token"===e[0])).map((e=>e[2])).join(""):""},hasContent:(e,n,t)=>e.sequenceItemsByScopes([n],["tTreeContent/"],!1).filter((e=>e[0].filter((e=>e.startsWith("tTreeContent")))[0].split("/")[1]===t)).length>0,concat:(e,n,...t)=>t.join(""),startsWith:(e,n,t,s)=>t.startsWith(s),endsWith:(e,n,t,s)=>t.endsWith(s),contains:(e,n,t,s)=>t.includes(s),matches:(n,t,s,r)=>e.test(s,e(r)),int:(e,n,t)=>parseInt(t),string:(e,n,t)=>`${t}`,left:(e,n,t,s)=>t.substring(0,s),right:(e,n,t,s)=>t.substring(t.length-s),length:(e,n,t)=>t.length,indexOf:(e,n,t,s)=>t.indexOf(s),add:(e,n,...t)=>t.reduce(((e,n)=>e+n)),mul:(e,n,...t)=>t.reduce(((e,n)=>e*n)),sub:(e,n,t,s)=>t-s,div:(e,n,t,s)=>Math.floor(t/s),mod:(e,n,t,s)=>t%s,gt:(e,n,t,s)=>t>s,lt:(e,n,t,s)=>t<s,ge:(e,n,t,s)=>t>=s,le:(e,n,t,s)=>t<=s},Zr={quotedString:e=>e.substring(1,e.length-1),int:e=>parseInt(e),true:()=>!0,false:()=>!1},Fr={expression:{oneOf:["stringExpression","intExpression","booleanExpression"]},booleanExpression:{oneOf:["booleanPrimitive","equals","notEqual","and","or","not","contains","startsWith","endsWith","matches","gt","lt","ge","le","hasContent"]},stringExpression:{oneOf:["concat","left","right","string","idRef","parentIdRef","contentRef","stringPrimitive"]},intExpression:{oneOf:["length","indexOf","int","nChildren","intPrimitive","add","sub","mul","div","mod"]},equals:{regex:e("^==\\((.+)\\)$"),doc:{operator:"==",args:["expression","expression"],result:"boolean",description:"Are the arguments strictly equal?"},argStructure:[["expression",[2,2]]]},notEqual:{regex:e("^!=\\((.+)\\)$"),doc:{operator:"!=",args:["expression","expression"],result:"boolean",description:"Are the arguments not strictly equal?"},argStructure:[["expression",[2,2]]]},and:{regex:e("^and\\((.+)\\)$"),doc:{operator:"and",args:["boolean","boolean","..."],result:"boolean",description:"Are all the arguments true?"},breakOn:!1,argStructure:[["booleanExpression",[2,null]]]},or:{regex:e("^or\\((.+)\\)$"),doc:{operator:"or",args:["boolean","boolean"],result:"boolean",description:"Are any arguments true?"},breakOn:!0,argStructure:[["booleanExpression",[2,null]]]},concat:{regex:e("^concat\\((.+)\\)$"),doc:{operator:"concat",args:["string","string","..."],result:"string",description:"Concatenates string arguments"},argStructure:[["stringExpression",[2,null]]]},contentRef:{regex:e("^content\\((.+)\\)$"),doc:{operator:"content",args:["string"],result:"string",description:"String value of the specified content for the node"},argStructure:[["stringExpression",[1,1]]]},hasContent:{regex:e("^hasContent\\((.+)\\)$"),doc:{operator:"hasContent",args:["string"],result:"boolean",description:"Does the node have this content?"},argStructure:[["stringExpression",[1,1]]]},contains:{regex:e("^contains\\((.+)\\)$"),doc:{operator:"contains",args:["string","string"],result:"boolean",description:"Does the first string contain the second string?"},argStructure:[["stringExpression",[2,2]]]},startsWith:{regex:e("^startsWith\\((.+)\\)$"),doc:{operator:"startsWith",args:["string","string"],result:"boolean",description:"Does the first string start with the second string?"},argStructure:[["stringExpression",[2,2]]]},endsWith:{regex:e("^endsWith\\((.+)\\)$"),doc:{operator:"endsWith",args:["string","string"],result:"boolean",description:"Does the first string end with the second string?"},argStructure:[["stringExpression",[2,2]]]},matches:{regex:e("^matches\\((.+)\\)$"),doc:{operator:"matches",args:["string","regex"],result:"boolean",description:"Does the first string match the regex in the second string?"},argStructure:[["stringExpression",[2,2]]]},left:{regex:e("^left\\((.+)\\)$"),doc:{operator:"left",args:["string","integer"],result:"string",description:"The first n characters of the string"},argStructure:[["stringExpression",[1,1]],["intExpression",[1,1]]]},right:{regex:e("^right\\((.+)\\)$"),doc:{operator:"right",args:["string","integer"],result:"string",description:"The last n characters of the string"},argStructure:[["stringExpression",[1,1]],["intExpression",[1,1]]]},length:{regex:e("^length\\((.+)\\)$"),doc:{operator:"length",args:["string"],result:"integer",description:"The number of characters in the string"},argStructure:[["stringExpression",[1,1]]]},indexOf:{regex:e("^indexOf\\((.+)\\)$"),doc:{operator:"indexOf",args:["string","string"],result:"number",description:"The integer position at which the second string starts in the first string"},argStructure:[["stringExpression",[2,2]]]},not:{regex:e("^not\\((.+)\\)$"),doc:{operator:"not",args:["boolean"],result:"boolean",description:"The inverse boolean value of the argument"},argStructure:[["booleanExpression",[1,1]]]},int:{regex:e("^int\\((.+)\\)$"),doc:{operator:"int",args:["string"],result:"integer",description:"The integer value of the string"},argStructure:[["stringExpression",[1,1]]]},string:{regex:e("^string\\((.+)\\)$"),doc:{operator:"string",args:["integer"],result:"string",description:"The string value of the integer"},argStructure:[["intExpression",[1,1]]]},idRef:{regex:e("^id$"),doc:{operator:"id",args:[],result:"string",description:"The node ID"},argStructure:[]},parentIdRef:{regex:e("^parentId$"),doc:{operator:"parentId",args:[],result:"string",description:"The node's parent ID"},argStructure:[]},nChildren:{regex:e("^nChildren$"),doc:{operator:"nChildren",args:[],result:"int",description:"The number of children of the node"},argStructure:[]},add:{regex:e("^add\\((.+)\\)$"),doc:{operator:"add",args:["integer","..."],result:"integer",description:"The numeric sum of the arguments"},argStructure:[["intExpression",[2,null]]]},mul:{regex:e("^mul\\((.+)\\)$"),doc:{operator:"mul",args:["integer","..."],result:"integer",description:"The numeric product of the arguments"},argStructure:[["intExpression",[2,null]]]},sub:{regex:e("^sub\\((.+)\\)$"),doc:{operator:"sub",args:["integer","integer"],result:"integer",description:"The first integer minus the second"},argStructure:[["intExpression",[2,2]]]},div:{regex:e("^div\\((.+)\\)$"),doc:{operator:"div",args:["integer","integer"],result:"integer",description:"The first integer divided by the second"},argStructure:[["intExpression",[2,2]]]},mod:{regex:e("^mod\\((.+)\\)$"),doc:{operator:"mod",args:["integer","integer"],result:"integer",description:"The modulus of the first integer when divided by the second"},argStructure:[["intExpression",[2,2]]]},gt:{regex:e("^>\\((.+)\\)$"),doc:{operator:">",args:["integer","integer"],result:"boolean",description:"Is the first integer numerically greater than the second?"},argStructure:[["intExpression",[2,2]]]},lt:{regex:e("^<\\((.+)\\)$"),doc:{operator:"<",args:["integer","integer"],result:"boolean",description:"Is the first integer numerically less than the second?"},argStructure:[["intExpression",[2,2]]]},ge:{regex:e("^>=\\((.+)\\)$"),doc:{operator:">=",args:["integer","integer"],result:"boolean",description:"Is the first integer numerically greater than or equal to the second?"},argStructure:[["intExpression",[2,2]]]},le:{regex:e("^<=\\((.+)\\)$"),doc:{operator:"<=",args:["integer","integer"],result:"boolean",description:"Is the first integer numerically less than or equal to the second?"},argStructure:[["intExpression",[2,2]]]},stringPrimitive:{regex:e("^('([^']|\\\\')*')$"),parseFunctions:[null,"quotedString"]},intPrimitive:{regex:e("^(-?[0-9]+)$"),parseFunctions:[null,"int"]},booleanPrimitive:{regex:e("^(true)|(false)$"),parseFunctions:[null,"true","false"]}},zr=(n,t,s,r)=>{const o=Fr[r];if(!o)throw new Error(`Unknown expression ${r} for predicate ${s}`);if(o.oneOf){let e=null;for(const r of o.oneOf){const o=zr(n,t,s,r);if(!o.errors)return o;(!e||o.errors.length<e.length)&&(e=o.errors)}return{errors:e}}{const i=e.exec(s,o.regex);if(i){const e=((e,n,t,s,r)=>{const o=Fr[s];if(!o)throw new Error(`Unknown expression ${s} for predicate ${t}`);if(!o.parseFunctions){const t=(e=>{const n=[[]];let t=0,s=0,r=!1;for(;e&&t<e.length;){switch(e[t]){case"\\":n[n.length-1].push(e[t]),"'"===e[t+1]&&(n[n.length-1].push(e[t+1]),t++);break;case"'":n[n.length-1].push(e[t]),r=!r;break;case"(":r?n[n.length-1].push(e[t]):(n[n.length-1].push(e[t]),s++);break;case")":r?n[n.length-1].push(e[t]):(n[n.length-1].push(e[t]),s--);break;case",":if(r||0!==s)n[n.length-1].push(e[t]);else for(n.push([]);" "===e[t+1];)t++;break;default:n[n.length-1].push(e[t])}t++}return n.map((e=>e.join("")))})(r[1]),c=o.argStructure,a=[];if(c.length>0){const r=[(i=c).map((e=>e[1][0])).reduce(((e,n)=>e+n)),i.filter((e=>null===e[1][1])).length>0];if(t.length<r[0])return{errors:`Expected at least ${r[0]} args for '${s}', found ${t.length}`};if(!r[1]&&t.length>r[0])return{errors:`Expected at most ${r[0]} args for '${s}', found ${t.length}`};let l=0,u=0,S=0;for(;l<t.length;){const s=t[l],r=zr(e,n,s,c[u][0]);if("breakOn"in o&&!s.errors&&r.data===o.breakOn)return r;a.push(r),l++,S++,c[u][1][1]&&S>=c[u][1][1]&&(u++,S=0)}}if(0===a.filter((e=>e.errors)).length){const t=a.map((e=>e.data));return{data:Wr[s](e,n,...t)}}return{errors:`Could not parse arguments to ${s}: ${t.filter((e=>e.errors)).map((e=>e.errors)).join("; ")}`}}{let e=!1;for(const[n,t]of o.parseFunctions.entries())if(t&&r[n])return e=!0,{data:Zr[t](r[n])};if(!e)return{errors:`Could not parse predicate ${t}`}}var i})(n,t,s,r,i);return e}return{errors:`Could not match ${s}`}}};var Yr=(Kr={expressions:Fr,doPredicate:(e,n,t)=>({data:n.data.filter((n=>{const s=zr(e,n,t,"booleanExpression");if(s.errors)throw new Error(`Predicate - ${s.errors}`);return s.data}))})}).expressions,_r=Kr.doPredicate;const Qr="(\\[(([^\\]']|'([^']|\\\\')*')+)\\])*",eo=(e,n,t,s,r,o)=>{const i={};(0===r.size||r.has("id"))&&(i.id=e.unsuccinctifyScopes(n.bs)[0][2].split("/")[1]),(0===r.size||r.has("parentId"))&&(i.parentId=e.unsuccinctifyScopes(n.is).filter((e=>e[2].startsWith("tTreeParent"))).map((e=>e[2].split("/")[1]))[0]);const c={};for(const[t,s]of e.sequenceItemsByScopes([n],["tTreeContent/"],!1)){const e=t.filter((e=>e.startsWith("tTreeContent")))[0].split("/")[1];(0===r.size||r.has("content")||r.has(`@${e}`))&&(c[e]=s.filter((e=>"token"===e[0])).map((e=>e[2])).join(""))}Object.keys(c).length>0&&(i.content=c);const a=[];if(r.has("children"))for(const t of e.unsuccinctifyScopes(n.is).filter((e=>e[2].startsWith("tTreeChild"))).map((e=>e[2].split("/")[2])))a.push(t);return a.length>0&&(i.children=o?a.map((e=>t[s.get(e)])).map((n=>eo(e,n,t,s,r,!0))):a),i};var no={stepActions:[{regex:e(`^#\\{([^}]+)\\}${Qr}$`),doc:{title:"Nodes by Id",syntax:"#(id, id, ...)",description:"Returns nodes whose id is listed"},predicateCapture:3,inputType:null,outputType:"nodes",function:(e,n,t,s,r,o)=>{const i=o[1].split(",").map((e=>e.trim()));return{data:Array.from(i).map((e=>n[t.get(e)]))}}},{regex:e(`^root${Qr}$`),doc:{title:"Root Node",syntax:"root",description:"Returns the root node"},predicateCapture:2,inputType:null,outputType:"nodes",function:(e,n)=>({data:[n[0]]})},{regex:e(`^nodes${Qr}$`),doc:{title:"Nodes",syntax:"nodes",description:"Returns all the nodes"},predicateCapture:2,function:(e,n)=>({data:n}),inputType:null,outputType:"nodes"},{regex:e(`^children(\\((\\d+)\\))?${Qr}$`),doc:{title:"Children",syntax:"children; children(pos)",description:"Returns the children of the current node(s), optionally filtered by position within the parent node"},predicateCapture:4,inputType:"nodes",outputType:"nodes",function:(e,n,t,s,r,o)=>{const i=o[2],c=new Set([]);for(const n of s.data){const t=e.unsuccinctifyScopes(n.is).map((e=>e[2].split("/"))).filter((e=>"tTreeChild"===e[0])).filter((e=>!i||e[1]===i)).map((e=>e[2]));for(const e of t)c.add(e)}return{data:Array.from(c).map((e=>n[t.get(e)]))}}},{regex:e(`^descendants((\\((\\d+)(,\\s*(\\d+))?\\))?)${Qr}$`),doc:{title:"Descendants",syntax:"descendants; descendants(depth); descendants(depth, pos)",description:"Returns the descendants of the current node(s), optionally at the specified level, optionally filtered by position"},predicateCapture:7,inputType:"nodes",outputType:"nodes",function:(e,n,t,s,r,o)=>{const i=new Set([]),c=(s,r)=>{const o=e.unsuccinctifyScopes(s.is).filter((e=>e[2].startsWith("tTreeChild"))).map((e=>e[2].split("/")[2]));(r<=1||null===r)&&o.forEach((e=>i.add(e))),(null===r||r>1)&&o.map((e=>n[t.get(e)])).forEach((e=>c(e,r-1)))};let a=null;o[3]&&(a=parseInt(o[3]));let l=-1;o[5]&&(l=parseInt(o[5]));for(const e of s.data)c(e,a);return{data:[...Array.from(i).entries()].filter((e=>l<0||e[0]===l)).map((e=>e[1])).map((e=>n[t.get(e)]))}}},{regex:e(`^leaves${Qr}$`),doc:{title:"Leaves",syntax:"leaves",description:"Returns the leaves (ie the nodes with no children) below the current node"},predicateCapture:2,inputType:"nodes",outputType:"nodes",function:(e,n,t,s)=>{const r=new Set([]),o=s=>{const i=e.unsuccinctifyScopes(s.is).filter((e=>e[2].startsWith("tTreeChild"))).map((e=>e[2].split("/")[2]));0===i.length?r.add(e.unsuccinctifyScopes(s.bs)[0][2].split("/")[1]):i.map((e=>n[t.get(e)])).forEach((e=>o(e)))};for(const e of s.data)o(e);return{data:Array.from(r).map((e=>n[t.get(e)]))}}},{regex:e(`^parent${Qr}$`),doc:{title:"Parent",syntax:"parent",description:"Returns the parent of the current node"},predicateCapture:2,inputType:"nodes",outputType:"nodes",function:(e,n,t,s)=>{const r=new Set([]);for(const n of s.data){const t=e.unsuccinctifyScopes(n.is).filter((e=>e[2].startsWith("tTreeParent"))).map((e=>e[2].split("/")[1]))[0];r.add(t)}return{data:Array.from(r).map((e=>n[t.get(e)]))}}},{regex:e(`^ancestor(\\((\\d+)\\))${Qr}$`),doc:{title:"Ancestor",syntax:"ancestor(depth)",description:"Returns the nth ancestor of the node"},predicateCapture:5,inputType:"nodes",outputType:"nodes",function:(e,n,t,s,r,o)=>{let i=parseInt(o[2]);if(i<1)return{errors:`Expected a positive integer argument for ancestor, found ${r}`};let c=s.data;for(;i>0;){const s=new Set([]);for(const n of c){const t=e.unsuccinctifyScopes(n.is).filter((e=>e[2].startsWith("tTreeParent"))).map((e=>e[2].split("/")[1]))[0];s.add(t)}c=Array.from(s).map((e=>n[t.get(e)])),i--}return{data:c}}},{regex:e(`^siblings${Qr}$`),doc:{title:"Siblings",syntax:"siblings",description:"Returns the children of the parent of the current node"},predicateCapture:2,inputType:"nodes",outputType:"nodes",function:(e,n,t,s)=>{const r=new Set([]);for(const n of s.data){const t=e.unsuccinctifyScopes(n.is).filter((e=>e[2].startsWith("tTreeParent"))).map((e=>e[2].split("/")[1]))[0];r.add(t)}const o=n.filter((n=>r.has(e.unsuccinctifyScopes(n.bs)[0][2].split("/")[1]))),i=new Set([]);for(const n of o){const t=e.unsuccinctifyScopes(n.is).filter((e=>e[2].startsWith("tTreeChild"))).map((e=>e[2].split("/")[2]));for(const e of t)i.add(e)}return{data:Array.from(i).map((e=>n[t.get(e)]))}}},{regex:e(`^node(\\{([^}]+)\\})?${Qr}$`),doc:{title:"Node Details",syntax:"node; node{ id, parentId, content, children, @foo }",description:"Returns an object containing the specified content"},predicateCapture:4,inputType:"nodes",outputType:"node",function:(e,n,t,s,r,o)=>{const i=[];let c=new Set([]);o[2]&&(c=new Set(o[2].split(",").map((e=>e.trim()))));for(const r of s.data)i.push(eo(e,r,n,t,c,!1));return{data:i}}},{regex:e(`^branch(\\{([^}]+)\\})?${Qr}$`),doc:{title:"Branch",syntax:"branch; branch{ id, parentId, content, children, @foo }",description:"Returns nested objects containing the specified content"},predicateCapture:4,inputType:"nodes",outputType:"node",function:(e,n,t,s,r,o)=>{const i=[];let c=new Set([]);o[2]&&(c=new Set(o[2].split(",").map((e=>e.trim()))));for(const r of s.data)i.push(eo(e,r,n,t,c,!0));return{data:i}}},{regex:e(`^values(\\{([^}]+)\\})?${Qr}$`),doc:{title:"Values",syntax:"values{ @foo ... }",description:"Returns all values across nodes for the specified fields"},predicateCapture:4,inputType:"nodes",outputType:"values",function:(e,n,t,s,r,o)=>{const i=[];let c=new Set([]);o[2]&&(c=new Set(o[2].split(",").map((e=>e.trim())).filter((e=>e.startsWith("@")))));for(const r of s.data)i.push(eo(e,r,n,t,c,!0));const a={};for(const e of Array.from(c).map((e=>e.substring(1))))a[e]=Array.from(new Set(i.filter((e=>e.content)).map((e=>e.content)).filter((n=>e in n)).map((n=>n[e])).sort()));return{data:a}}}]}.stepActions;jr=class{constructor(){this.currentStepType=null}doStep(n,t,s,r,o){for(const i of no){const c=e.exec(o,i.regex);if(c&&i.inputType===this.currentStepType){let e=i.function(n,t,s,r,o,c);return c[i.predicateCapture]&&(e=_r(n,e,c[i.predicateCapture])),this.currentStepType=i.outputType,e}}return{errors:`Unable to match step ${o}`}}parse1(e,n,t,s,r){if(r.length>0){const o=this.doStep(e,n,t,s,r[0]);return o.errors||0===o.data.length?o:this.parse1(e,n,t,o,r.slice(1))}return s}queryArray(e){const n=[];for(const t of e.split("/"))n.push(t);return n}indexNodes(e,n){const t=new Map;for(const[s,r]of n.entries()){const n=e.unsuccinctifyScopes(r.bs)[0][2].split("/")[1];t.set(n,s)}return t}doc(){return"** Steps **\n\n"+no.map((e=>e.doc)).map((e=>`* ${e.title} *\n${e.syntax}\n${e.description}`)).join("\n\n")+"** Predicate Operators **\n\n"+Object.values(Yr).filter((e=>e.doc)).map((e=>`${e.doc.operator}(${e.doc.args.map((e=>"<"+e+">")).join(", ")}) => ${e.doc.result}\n${e.doc.description}`)).join("\n\n")}parse(e,n,t){const s=this.parse1(e,n,this.indexNodes(e,n),{data:n},this.queryArray(t));if(s.data&&"nodes"===this.currentStepType)s.data=s.data.map((n=>({id:e.unsuccinctifyScopes(n.bs)[0][2].split("/")[1]})));return JSON.stringify(s,null,2)}};var to,so=(Vr={treeSequenceSchemaString:'\n"""The nodes of a tree"""\ntype treeSequence {\n """The id of the sequence"""\n id: String!\n """The number of nodes in the tree sequence"""\n nNodes: Int!\n """The nodes in the tree sequence"""\n nodes: [node!]!\n """The JSON result for a Tribos query, as a string"""\n tribos(\n """The Tribos query string"""\n query: String!\n ): String!\n """The JSON results for the Tribos queries, as an array of strings"""\n triboi(\n """The Tribos query strings"""\n queries: [String!]!\n ): [String!]!\n """Tribos documentation"""\n tribosDoc: String!\n """A list of the tags of this sequence"""\n tags: [String!]!\n """A list of the tags of this sequence as key/value tuples"""\n tagsKv: [KeyValue!]!\n """Whether or not the sequence has the specified tag"""\n hasTag(\n """The tag name"""\n tagName: String\n ): Boolean!\n}\n',treeSequenceResolvers:{nNodes:e=>e.blocks.length,nodes:e=>e.blocks,tribos:(e,n,t)=>(new jr).parse(t.docSet,e.blocks,n.query),triboi:(e,n,t)=>n.queries.map((n=>(new jr).parse(t.docSet,e.blocks,n))),tribosDoc:()=>(new jr).doc(),tags:e=>Array.from(e.tags),tagsKv:e=>Array.from(e.tags).map((e=>e.includes(":")?[e.substring(0,e.indexOf(":")),e.substring(e.indexOf(":")+1)]:[e,""])),hasTag:(e,n)=>e.tags.has(n.tagName)}}).treeSequenceSchemaString,ro=Vr.treeSequenceResolvers,oo=Xs.dumpBlock;var io,co,ao=(to={blockSchemaString:'\n"""Part of a sequence, roughly equivalent to a USFM paragraph"""\ntype Block {\n """The length in bytes of the succinct representation of c (block items)"""\n cBL: Int!\n """The length in bytes of the succinct representation of bg (block grafts)"""\n bgBL: Int!\n """The length in bytes of the succinct representation of os (open scopes)"""\n osBL: Int!\n """The length in bytes of the succinct representation of is (included scopes)"""\n isBL: Int!\n """The length in bytes of the succinct representation of nt (nextToken at the start of the block)"""\n ntBL: Int!\n """The number of items in the succinct representation of c (block items)"""\n cL: Int!\n """The number of items in the succinct representation of bg (block grafts)"""\n bgL: Int!\n """The number of items in the succinct representation of os (open scopes)"""\n osL: Int!\n """The number of items in the succinct representation of is (included scopes)"""\n isL: Int!\n """A list of included scopes for this block"""\n is: [Item!]!\n """A list of open scopes for this block"""\n os: [Item!]!\n """The block scope for this block"""\n bs: Item!\n """A list of block grafts for this block"""\n bg: [Item!]!\n """The value of nextToken at the start of this block"""\n nt: Int!\n """A list of items from the c (content) field of the block"""\n items(\n """Only return items that are within specific scopes"""\n withScopes: [String!]\n """If true, withScopes filtering matches items within at least one of the specified scopes"""\n anyScope: Boolean\n """Only return items that are within a chapterVerse range (ch or ch:v or ch:v-v or ch:v-ch:v)"""\n withScriptureCV: String\n """If true, adds scope and nextToken information to each token"""\n includeContext: Boolean\n ) : [Item!]! \n """A list of tokens from the c (content) field of the block"""\n tokens(\n """Only return tokens that are within specific scopes"""\n withScopes: [String!]\n """If true, withScopes filtering matches tokens within at least one of the specified scopes"""\n anyScope: Boolean\n """Only return tokens that are within a chapterVerse range (ch or ch:v or ch:v-v or ch:v-ch:v)"""\n withScriptureCV: String\n """If true, adds scope and nextToken information to each token"""\n includeContext: Boolean\n """Return tokens whose payload is an exact match to one of the specified strings"""\n withChars: [String!]\n """Return tokens whose payload matches one of the specified regexes"""\n withMatchingChars: [String!]\n """Return tokens with one of the specified subTypes"""\n withSubTypes: [String!]\n ) : [Item!]!\n """The text of the block as a single string"""\n text(\n """Only return text that is within a chapterVerse range (ch or ch:v or ch:v-v or ch:v-ch:v)"""\n withScriptureCV: String\n """If true, converts each whitespace character to a single space"""\n normalizeSpace: Boolean\n ): String!\n """\'Block items grouped by scopes or milestones"""\n itemGroups(\n """Produce one itemGroup for every match of the list of scopes"""\n byScopes: [String!]\n """Start a new itemGroup whenever a milestone in the list is encountered"""\n byMilestones: [String!]\n ): [ItemGroup]!\n """The block content as a string in a compact eyeballable format"""\n dump: String!\n """A list of the labels for the block\\\'s bs, os and is scopes"""\n scopeLabels(\n """Only include scopes that begin with this value"""\n startsWith: [String!]\n ): [String!]!\n}\n',blockResolvers:{cBL:e=>e.c.length,bgBL:e=>e.bg.length,osBL:e=>e.os.length,isBL:e=>e.is.length,ntBL:e=>e.nt.length,cL:(e,n,t)=>t.docSet.countItems(e.c),bgL:(e,n,t)=>t.docSet.countItems(e.bg),osL:(e,n,t)=>t.docSet.countItems(e.os),isL:(e,n,t)=>t.docSet.countItems(e.is),is:(e,n,t)=>t.docSet.unsuccinctifyScopes(e.is),os:(e,n,t)=>t.docSet.unsuccinctifyScopes(e.os),bs:(e,n,t)=>{const[s,r,o]=y.succinct.headerBytes(e.bs,0);return t.docSet.unsuccinctifyScope(e.bs,r,o,0)},bg:(e,n,t)=>t.docSet.unsuccinctifyGrafts(e.bg),nt:e=>e.nt.nByte(0),items:(e,n,t)=>{if(n.withScopes&&n.withScriptureCV)throw new Error("Cannot specify both withScopes and withScriptureCV");return n.withScriptureCV?t.docSet.unsuccinctifyItemsWithScriptureCV(e,n.withScriptureCV,{},n.includeContext||!1):t.docSet.unsuccinctifyPrunedItems(e,{tokens:!0,scopes:!0,grafts:!0,requiredScopes:n.withScopes||[],anyScope:n.anyScope||!1})},tokens:(n,t,s)=>{if(Object.keys(t).filter((e=>e.includes("Chars"))).length>1)throw new Error('Only one of "withChars", "withAnyCaseChars" and "withCharsMatchingRegex" may be specified');let r;return r=t.withScriptureCV?s.docSet.unsuccinctifyItemsWithScriptureCV(n,t.withScriptureCV,{tokens:!0},t.includeContext||!1):s.docSet.unsuccinctifyPrunedItems(n,{tokens:!0,scopes:!0,requiredScopes:t.withScopes||[],anyScope:t.anyScope||!1}),t.withSubTypes&&(r=r.filter((e=>t.withSubTypes.includes(e[1])))),t.withChars?r=r.filter((e=>t.withChars.includes(e[2]))):t.withMatchingChars&&(r=r.filter((n=>{for(const s of t.withMatchingChars)if(e.test(n,e(s)))return!0;return!1}))),r.filter((e=>"token"===e[0]))},text:(e,n,t)=>{let s=(n.withScriptureCV?t.docSet.unsuccinctifyItemsWithScriptureCV(e,n.withScriptureCV,{tokens:!0},!1):t.docSet.unsuccinctifyItems(e.c,{tokens:!0},null)).map((e=>e[2])).join("").trim();return n.normalizeSpace&&(s=s.replace(/[ \t\n\r]+/g," ")),s},itemGroups:(e,n,t)=>{if(n.byScopes&&n.byMilestones)throw new Error("Cannot specify both byScopes and byMilestones");if(!n.byScopes&&!n.byMilestones)throw new Error("Must specify either byScopes or byMilestones");return n.byScopes?t.docSet.sequenceItemsByScopes([e],n.byScopes):t.docSet.sequenceItemsByMilestones([e],n.byMilestones)},dump:(e,n,t)=>oo(t.docSet.unsuccinctifyBlock(e,{},null)),scopeLabels:(e,n,t)=>[...t.docSet.unsuccinctifyBlockScopeLabelsSet(e)].filter((e=>!n.startsWith||((e,n)=>{if(0===e.length)return!0;for(const t of e)if(n.startsWith(t))return!0;return!1})(n.startsWith,e)))}}).blockSchemaString,lo=to.blockResolvers;const uo=(e,n,t)=>{let s=[n.map((n=>[y.enums.enumStringIndex(e.enums.wordLike,n)]))];return s=t?s[0]:s.map((e=>e.reduce(((e,n)=>e.concat(n))))),s},So=(e,n,t)=>{let s=[n.map((n=>y.enums.enumRegexIndexTuples(e.enums.wordLike,n).map((e=>e[0]))))];return s=t?s[0]:s.map((e=>e.reduce(((e,n)=>e.concat(n))))),s},ho=(e,n,t)=>{if(t&&n.filter((e=>0===e.length)).length>0)return!1;if(0===(n=n.filter((e=>e.length>0))).length)return!1;for(const s of n){let n=!1;for(const t of s){if(t>=0&&e.tokensPresent.get(t)>0){n=!0;break}}if(t&&!n)return!1;if(!t&&n)return!0}return t};var po=(co={sequenceHasChars:(e,n,t,s)=>{let r=uo(e,t,s);return ho(n,r,s)},sequenceHasMatchingChars:(e,n,t,s)=>{let r=So(e,t,s);return ho(n,r,s)},regexSearchTermIndexes:So,exactSearchTermIndexes:uo}).sequenceHasChars,fo=co.sequenceHasMatchingChars,mo=co.regexSearchTermIndexes,go=co.exactSearchTermIndexes;const Ao={tokens:!1,scopes:!0,grafts:!1,requiredScopes:[]};var Eo,bo=(io={sequenceSchemaString:'\n"""A contiguous flow of content"""\ntype Sequence {\n """The id of the sequence"""\n id: String!\n """The type of the sequence (main, heading...)"""\n type: String!\n """The number of blocks in the sequence"""\n nBlocks: Int!\n """The blocks in the sequence"""\n blocks(\n """Only return blocks where the list of scopes is open"""\n withScopes: [String!]\n """Only return blocks whose zero-indexed position is in the list"""\n positions: [Int!]\n """Only return blocks with the specified block scope (eg \'blockScope/p\'"""\n withBlockScope: String\n """Only return blocks that contain items within the specified chapter, verse or chapterVerse range"""\n withScriptureCV: String\n """Ordered list of attribute specs whose values must match those in \'attValues\'"""\n attSpecs: [[AttSpec!]!]\n """Ordered list of attribute values, used in conjunction with \\\'attSpecs\\\'"""\n attValues: [[String!]!]\n """If true, blocks where all attSpecs match will be included"""\n allAtts: Boolean\n """Return blocks containing a token whose payload is an exact match to one of the specified strings"""\n withChars: [String!]\n """Return blocks containing a token whose payload matches the specified regexes"""\n withMatchingChars: [String!]\n """If true, blocks where all regexes match will be included"""\n allChars: Boolean\n ): [Block!]!\n """The items for each block in the sequence"""\n blocksItems: [[Item!]!]\n """The tokens for each block in the sequence"""\n blocksTokens: [[Item!]!]\n """The text for each block in the sequence"""\n blocksText(\n """If true, converts each whitespace character to a single space"""\n normalizeSpace: Boolean\n ): [String!]\n """The text for the sequence"""\n text(\n """If true, converts each whitespace character to a single space"""\n normalizeSpace: Boolean\n ) : String!\n """Sequence content grouped by scopes or milestones"""\n itemGroups(\n """Produce one itemGroup for every different match of the list of scopes"""\n byScopes: [String!]\n """Start a new itemGroup whenever a milestone in the list is encountered"""\n byMilestones: [String!]\n ) : [ItemGroup!]!\n """A list of the tags of this sequence"""\n tags: [String!]!\n """A list of the tags of this sequence as key/value tuples"""\n tagsKv: [KeyValue!]!\n """Whether or not the sequence has the specified tag"""\n hasTag(\n """The specified tag"""\n tagName: String!\n ): Boolean!\n """A list of wordLike token strings in a main sequence"""\n wordLikes(\n """Whether to coerce the strings (toLower|toUpper|none)"""\n coerceCase: String\n ) : [String!]!\n """Returns true if a main sequence contains the specified tokens"""\n hasChars(\n """Token strings to be matched exactly"""\n chars: [String!]\n """If true all tokens must match"""\n allChars: Boolean\n ): Boolean!\n """Returns true if a main sequence contains a match for specified regexes"""\n hasMatchingChars(\n """Regexes to be matched"""\n chars: [String!]\n """If true all regexes must match"""\n allChars: Boolean\n ): Boolean!\n}\n',sequenceResolvers:{nBlocks:e=>e.blocks.length,blocks:(e,n,t)=>{if(t.docSet.maybeBuildEnumIndexes(),n.withScopes&&n.withScriptureCV)throw new Error("Cannot specify both withScopes and withScriptureCV");if(n.attSpecs&&!n.attValues)throw new Error("Cannot specify attSpecs without attValues");if(!n.attSpecs&&n.attValues)throw new Error("Cannot specify attValues without attSpecs");if(n.attSpecs&&n.attValues&&n.attSpecs.length!==n.attValues.length)throw new Error("attSpecs and attValues must be same length");if(n.withChars&&n.withMatchingChars)throw new Error("Cannot specify both withChars and withMatchingChars");let s=e.blocks;if(n.positions&&(s=Array.from(s.entries()).filter((e=>n.positions.includes(e[0]))).map((e=>e[1]))),n.withScopes&&(s=s.filter((e=>t.docSet.allScopesInBlock(e,n.withScopes)))),n.withScriptureCV&&(s=t.docSet.blocksWithScriptureCV(s,n.withScriptureCV)),n.attSpecs&&(s=s.filter((e=>((e,n,t,s,r)=>{let o=new Set([]);for(const i of e.unsuccinctifyPrunedItems(n,Ao,!1)){const[e,n,c,a,l,u]=i[2].split("/");for(const[e,i]of t.entries()){for(const t of i)if(n===t.attType&&c===t.tagName&&a===t.attKey&&parseInt(l)===t.valueN&&s[e].includes(u)){if(!r)return!0;o.add(e);break}if(o.size===t.length)return!0}}return!1})(t.docSet,e,n.attSpecs,n.attValues,n.allAtts||!1)))),n.withBlockScope&&(s=s.filter((e=>t.docSet.blockHasBlockScope(e,n.withBlockScope)))),n.withChars){if("main"===e.type&&!po(t.docSet,e,n.withChars,n.allChars))return[];let r=go(t.docSet,n.withChars,n.allChars);for(const e of r)s=s.filter((n=>t.docSet.blockHasChars(n,e)))}if(n.withMatchingChars){if("main"===e.type&&!fo(t.docSet,e,n.withMatchingChars,n.allChars))return[];let r=mo(t.docSet,n.withMatchingChars,n.allChars);for(const e of r)s=s.filter((n=>t.docSet.blockHasChars(n,e)))}return s},blocksItems:(e,n,t)=>e.blocks.map((e=>t.docSet.unsuccinctifyItems(e.c,{},null))),blocksTokens:(e,n,t)=>e.blocks.map((e=>t.docSet.unsuccinctifyItems(e.c,{tokens:!0},null))),blocksText:(e,n,t)=>e.blocks.map((e=>{let s=t.docSet.unsuccinctifyItems(e.c,{tokens:!0},null).map((e=>e[2])).join("");return n.normalizeSpace&&(s=s.replace(/[ \t\n\r]+/g," ")),s})),text:(e,n,t)=>{let s=e.blocks.map((e=>t.docSet.unsuccinctifyItems(e.c,{tokens:!0},null).map((e=>e[2])).join(""))).join("\n");return n.normalizeSpace&&(s=s.replace(/[ \t\n\r]+/g," ")),s},itemGroups:(e,n,t)=>{if(n.byScopes&&n.byMilestones)throw new Error("Cannot specify both byScopes and byMilestones");if(!n.byScopes&&!n.byMilestones)throw new Error("Must specify either byScopes or byMilestones");return n.byScopes?t.docSet.sequenceItemsByScopes(e.blocks,n.byScopes):t.docSet.sequenceItemsByMilestones(e.blocks,n.byMilestones)},tags:e=>Array.from(e.tags),tagsKv:e=>Array.from(e.tags).map((e=>e.includes(":")?[e.substring(0,e.indexOf(":")),e.substring(e.indexOf(":")+1)]:[e,""])),hasTag:(e,n)=>e.tags.has(n.tagName),wordLikes:(e,n,t)=>{if("main"!==e.type)throw new Error(`Only available for the main sequence, not ${e.type}`);if(n.coerceCase&&!["toLower","toUpper","none"].includes(n.coerceCase))throw new Error(`coerceCase, when present, must be 'toLower', 'toUpper' or 'none', not '${n.coerceCase}'`);t.docSet.maybeBuildEnumIndexes();let s=new Set,r=0;for(const o of e.tokensPresent){if(o){const e=t.docSet.enumIndexes.wordLike[r];let o=t.docSet.enums.wordLike.countedString(e);"toLower"===n.coerceCase&&(o=o.toLowerCase()),"toUpper"===n.coerceCase&&(o=o.toUpperCase()),s.add(o)}r++}return Array.from(s).sort()},hasChars:(e,n,t)=>{if("main"!==e.type)throw new Error(`Only available for the main sequence, not ${e.type}`);return po(t.docSet,e,n.chars,n.allChars||!1)},hasMatchingChars:(e,n,t)=>{if("main"!==e.type)throw new Error(`Only available for the main sequence, not ${e.type}`);return fo(t.docSet,e,n.chars,n.allChars)}}}).sequenceSchemaString,yo=io.sequenceResolvers;const Po=(e,n)=>{let t=e;for(const e of n)if("scope"===e[0])if("start"===e[1]){0===t.filter((n=>n===e[2])).length&&t.push(e[2])}else t=t.filter((n=>n!==e[2]));return t},ko=(e,n)=>0!==n.length&&(!(!e.includes(`chapter/${n[0][0]}`)||n[0][1]&&!(e.filter((e=>e.startsWith("verse/")&&parseInt(e.split("/")[1])>=n[0][1])).length>0)||n[0][2]&&!(e.filter((e=>e.startsWith("verse/")&&parseInt(e.split("/")[1])<=n[0][2])).length>0))||ko(e,n.slice(1))),Io=(e,n,t,s,r,o)=>{const[i,c]=s.split(":").map((e=>parseInt(e))),[a,l]=r.split(":").map((e=>parseInt(e)));if(a<i)throw new Error(`cv chapterVerses requires fromChapter <= toChapter, not ${i} to ${a}`);const u=[];let S=i;for(;S<=a;)u.push([S,S===i?c:null,S===a?l:null]),S++;return n.docSet.sequenceItemsByScopes(t.blocks,["chapter/","verse/"],o).filter((e=>ko(e[0],u)))},wo=(e,n,t,s,r,o)=>{if(n.chapter&&!n.verses)return((e,n,t,s,r)=>{const o=e.chapterIndex(s);if(o){const e=t.blocks[o.startBlock];return[[Po(n.docSet.unsuccinctifyScopes(e.os).map((e=>e[2])),n.docSet.unsuccinctifyItems(e.c,{},0,[]).slice(0,o.startItem+1).filter((e=>"scope"===e[0]))),n.docSet.itemsByIndex(t,o,r||!1).reduce(((e,n)=>e.concat([["token","lineSpace"," "]].concat(n))))]]}return[]})(e,t,s,n.chapter,n.includeContext);if(n.verses)return((e,n,t,s,r,o,i,c)=>{let a=n.docSet,l=e.headers.bookCode,u=r.map((e=>[parseInt(s),parseInt(e)]));if(i){const n=e.processor.docSets[c];if(n&&(a=n),"forward"in t.verseMapping&&s in t.verseMapping.forward){let n=[];for(const o of r)n.push(y.versification.mapVerse(t.verseMapping.forward[s],e.headers.bookCode,s,o));const o=n[0];l=o[0],u=o[1]}const o=a.documentWithBook(l);if(o){const e=o.sequences[o.mainId];if(e.verseMapping&&"reversed"in e.verseMapping){const n=[];for(const[t,s]of u)`${t}`in e.verseMapping.reversed?n.push(y.versification.mapVerse(e.verseMapping.reversed[`${t}`],l,t,s)):n.push([l,[[t,s]]]),l=n[0][0],u=n.map((e=>e[1])).reduce(((e,n)=>e.concat(n)))}}}const S={},h=a.documentWithBook(l);if(!h)return[];const p=h.sequences[h.mainId];for(const e of u.map((e=>e[0])))e in S||(S[e]=h.chapterVerseIndex(e));const d=[];for(const[e,n]of u)if(S[e]){let t,s,r=[];if(S[e][n]){for(const i of S[e][n])t||(t=i.startBlock,s=i.startItem),r=r.concat(a.itemsByIndex(p,i,o||null).reduce(((e,n)=>e.concat([["token","lineSpace"," "]].concat(n)))));const i=p.blocks[t];d.push([Po(a.unsuccinctifyScopes(i.os).map((e=>e[2])),a.unsuccinctifyItems(i.c,{},0,[]).slice(0,s+1).filter((e=>"scope"===e[0]))),r])}}return d})(e,t,s,n.chapter,n.verses,n.includeContext,r,o);throw new Error("Unexpected args to do_cv_separate_args")};var To={do_cv:(n,t,s,r,o)=>{s.docSet=n.processor.docSets[n.docSetId];const i=n.sequences[n.mainId];if(!t.chapter&&!t.chapterVerses)throw new Error("Must specify either chapter or chapterVerses for cv");if(t.chapter&&t.chapterVerses)throw new Error("Must not specify both chapter and chapterVerses for cv");if(t.chapterVerses&&t.verses)throw new Error("Must not specify both chapterVerses and verses for cv");return t.chapter?wo(n,t,s,i,r,o):((n,t,s,r)=>{if(e.test(t.chapterVerses,e("^[0-9]+:[0-9]+-[0-9]+:[0-9]+$"))){const[e,n]=t.chapterVerses.split("-");return Io(0,s,r,e,n,t.includeContext)}if(e.test(t.chapterVerses,e("^[0-9]+:[0-9]+-[0-9]+$"))){const[e,n]=t.chapterVerses.split(":"),[o,i]=n.split("-");return Io(0,s,r,`${e}:${o}`,`${e}:${i}`,t.includeContext)}if(e.test(t.chapterVerses,e("^[0-9]+:[0-9]+$"))){const[e,n]=t.chapterVerses.split(":");return Io(0,s,r,`${e}:${n}`,`${e}:${n}`,t.includeContext)}if(e.test(t.chapterVerses,e("^[0-9]+$"))){const e=t.chapterVerses,o=n.chapterVerseIndex(e);if(!o)throw new Error(`No chapter ${e} found`);const i=o.map(((e,n)=>[n,e])).filter((e=>e[1].length>0)).map((e=>e[0]));return Io(0,s,r,`${e}:${Math.min(i)}`,`${e}:${Math.max(i)}`,t.includeContext)}throw new Error(`Could not parse chapterVerses string '${t.chapterVerses}'`)})(n,t,s,i)}}.do_cv;const vo=(e,n)=>n in e.headers?e.headers[n]:null;var Bo,Oo,xo=(Eo={documentSchemaString:'\n"""A document, typically corresponding to USFM for one book"""\ntype Document {\n """The id of the document"""\n id: String!\n """A parsed version of the id header"""\n idParts: idParts!\n """The id of the docSet to which this document belongs"""\n docSetId: String!\n """USFM header information such as TOC"""\n headers: [KeyValue!]!\n """One USFM header"""\n header(\n """The header id, corresponding to the tag name minus any trailing \'1\'"""\n id: String!\n ): String\n """The main sequence"""\n mainSequence: Sequence!\n """The number of sequences"""\n nSequences: Int!\n """A list of sequences for this document"""\n sequences(\n """ids of sequences to include, if found"""\n ids: [String!]\n """types of sequences to include, if found"""\n types: [String!]\n """Only return sequences with all the specified tags"""\n withTags: [String!]\n """Only return sequences with none of the specified tags"""\n withoutTags: [String!]\n ): [Sequence!]!\n """A list of table sequences for this document"""\n tableSequences(\n """ids of sequences to include, if found"""\n ids: [String!]\n """Only return sequences with all the specified tags"""\n withTags: [String!]\n """Only return sequences with none of the specified tags"""\n withoutTags: [String!]\n ): [tableSequence!]!\n """A list of tree sequences for this document"""\n treeSequences(\n """ids of sequences to include, if found"""\n ids: [String!]\n """Only return sequences with all the specified tags"""\n withTags: [String!]\n """Only return sequences with none of the specified tags"""\n withoutTags: [String!]\n ): [treeSequence!]!\n """A list of key-value sequences for this document"""\n kvSequences(\n """ids of sequences to include, if found"""\n ids: [String!]\n """Only return sequences with all the specified tags"""\n withTags: [String!]\n """Only return sequences with none of the specified tags"""\n withoutTags: [String!]\n ): [kvSequence!]!\n """A list of text (ie non-table, non-tree, non-kv) sequences for this document"""\n textSequences(\n """ids of sequences to include, if found"""\n ids: [String!]\n """Only return sequences with all the specified tags"""\n withTags: [String!]\n """Only return sequences with none of the specified tags"""\n withoutTags: [String!]\n ): [Sequence!]!\n """The sequence with the specified id"""\n sequence(\n """id of the sequence"""\n id: String!\n ): Sequence\n """The table sequence with the specified id"""\n tableSequence(\n """id of the sequence"""\n id: String!\n ): tableSequence\n """The tree sequence with the specified id"""\n treeSequence(\n """id of the sequence"""\n id: String!\n ): treeSequence\n """The key-value sequence with the specified id"""\n kvSequence(\n """id of the sequence"""\n id: String!\n ): kvSequence\n """The blocks of the main sequence"""\n mainBlocks: [Block!]!\n """The items for each block of the main sequence"""\n mainBlocksItems: [[Item!]!]!\n """The tokens for each block of the main sequence"""\n mainBlocksTokens: [[Item!]!]!\n """The text for each block of the main sequence"""\n mainBlocksText(\n """If true, converts each whitespace character to a single space"""\n normalizeSpace: Boolean\n ): [String!]!\n """The text for the main sequence"""\n mainText(\n """If true, converts each whitespace character to a single space"""\n normalizeSpace: Boolean\n ): String!\n """A list of the tags of this document"""\n tags: [String!]!\n """A list of the tags of this document as key/value tuples"""\n tagsKv: [KeyValue!]!\n """\'Whether or not the document has the specified tag"""\n hasTag(\n tagName: String!\n ): Boolean!\n """Content for a Scripture reference within this document, using local versification"""\n cv(\n """The chapter number (as a string)"""\n chapter: String\n """\'A list of verse numbers (as strings)"""\n verses: [String!]\n """A chapterVerse Reference (ch:v-ch:v)"""\n chapterVerses: String\n """If true, adds scope and nextToken information to each token"""\n includeContext: Boolean\n ): [ItemGroup!]!\n """Content for a Scripture reference within this document, using the versification of the specified docSet"""\n mappedCv(\n """The chapter number (as a string)"""\n chapter: String!\n """The id of the mapped docSet"""\n mappedDocSetId: String!\n """A list of verse numbers (as strings)"""\n verses: [String!]!\n """If true, adds scope and nextToken information to each token"""\n includeContext: Boolean\n ): [ItemGroup!]!\n """Content for each verse of a chapter within this document, using the versification of the specified docSet"""\n mappedCvs(\n """The chapter number (as a string)"""\n chapter: String!\n """The id of the mapped docSet"""\n mappedDocSetId: String!\n """If true, adds scope and nextToken information to each token"""\n includeContext: Boolean\n ): [[ItemGroup!]!]!\n """What\'s previous and next with respect to the specified verse"""\n cvNavigation(\n """The chapter number (as a string)"""\n chapter: String!\n """A verse number (as a string)"""\n verse: String!\n ): cvNavigation\n """The content of the main sequence indexed by chapterVerse"""\n cvIndexes: [cvIndex]!\n """The content of the specified chapter indexed by chapterVerse"""\n cvIndex(\n """The chapter number"""\n chapter: Int!\n ): cvIndex!\n """The content of the main sequence indexed by chapter"""\n cIndexes: [cIndex]!\n """The content of a chapter"""\n cIndex(\n """\'The chapter number"""\n chapter: Int!\n ): cIndex!\n """Verses matching the arguments"""\n cvMatching(\n """Return verses containing a token whose payload is an exact match to one of the specified strings"""\n withChars: [String!]\n """Return verses containing a token whose payload matches the specified regexes"""\n withMatchingChars: [String!]\n """Only return blocks where the list of scopes is open"""\n withScopes: [String!]\n """If true, verses where all regexes match will be included"""\n allChars: Boolean\n """If true, verses where all scopes match will be included"""\n allScopes: Boolean\n ): [ItemGroup!]!\n """A string of PERF JSON for this document"""\n perf(\n """Format JSON string with this indent"""\n indent: Int\n ): String! \n """A string of USFM for this document"""\n usfm: String! \n """A string of SOFRIA JSON for this document"""\n sofria(\n """Format JSON string with this indent"""\n indent: Int\n """Return SOFRIA for this chapter only"""\n chapter: Int\n ): String! \n}\n',documentResolvers:{idParts:n=>{const t=vo(n,"id");if(!t)return[null,null];const s=e.exec(t,/^(P\d\d)\s+([A-Z0-6]{3})\s+(\S+)\s+-\s+(.*)/);if(s)return["periph",s.slice(1)];const r=e.exec(t,/^([A-Z0-6]{3})\s+(.*)/);return r?["book",r.slice(1)]:[null,[t]]},headers:e=>Object.entries(e.headers),header:(e,n)=>vo(e,n.id),mainSequence:(e,n,t)=>(t.docSet=e.processor.docSets[e.docSetId],e.sequences[e.mainId]),nSequences:(e,n,t)=>(t.docSet=e.processor.docSets[e.docSetId],Object.keys(e.sequences).length),sequences:(e,n,t)=>{t.docSet=e.processor.docSets[e.docSetId];let s=Object.values(e.sequences);return n.ids&&(s=s.filter((e=>n.ids.includes(e.id)))),n.types&&(s=s.filter((e=>n.types.includes(e.type)))),n.withTags&&(s=s.filter((e=>n.withTags.filter((n=>e.tags.has(n))).length===n.withTags.length))),n.withoutTags&&(s=s.filter((e=>0===n.withoutTags.filter((n=>e.tags.has(n))).length))),s},tableSequences:(e,n,t)=>{t.docSet=e.processor.docSets[e.docSetId];let s=Object.values(e.sequences);return s=s.filter((e=>"table"===e.type)),n.ids&&(s=s.filter((e=>n.ids.includes(e.id)))),n.withTags&&(s=s.filter((e=>n.withTags.filter((n=>e.tags.has(n))).length===n.withTags.length))),n.withoutTags&&(s=s.filter((e=>0===n.withoutTags.filter((n=>e.tags.has(n))).length))),s},treeSequences:(e,n,t)=>{t.docSet=e.processor.docSets[e.docSetId];let s=Object.values(e.sequences);return s=s.filter((e=>"tree"===e.type)),n.ids&&(s=s.filter((e=>n.ids.includes(e.id)))),n.withTags&&(s=s.filter((e=>n.withTags.filter((n=>e.tags.has(n))).length===n.withTags.length))),n.withoutTags&&(s=s.filter((e=>0===n.withoutTags.filter((n=>e.tags.has(n))).length))),s},kvSequences:(e,n,t)=>{t.docSet=e.processor.docSets[e.docSetId];let s=Object.values(e.sequences);return s=s.filter((e=>"kv"===e.type)),n.ids&&(s=s.filter((e=>n.ids.includes(e.id)))),n.withTags&&(s=s.filter((e=>n.withTags.filter((n=>e.tags.has(n))).length===n.withTags.length))),n.withoutTags&&(s=s.filter((e=>0===n.withoutTags.filter((n=>e.tags.has(n))).length))),s},textSequences:(e,n,t)=>{t.docSet=e.processor.docSets[e.docSetId];let s=Object.values(e.sequences);return s=s.filter((e=>"tree"!==e.type&&"table"!==e.type&&"kv"!==e.type)),n.ids&&(s=s.filter((e=>n.ids.includes(e.id)))),n.withTags&&(s=s.filter((e=>n.withTags.filter((n=>e.tags.has(n))).length===n.withTags.length))),n.withoutTags&&(s=s.filter((e=>0===n.withoutTags.filter((n=>e.tags.has(n))).length))),s},sequence:(e,n,t)=>{t.docSet=e.processor.docSets[e.docSetId];let s=Object.values(e.sequences);return s=s.filter((e=>n.id.includes(e.id))),s[0]||null},tableSequence:(e,n,t)=>{t.docSet=e.processor.docSets[e.docSetId];let s=Object.values(e.sequences);if(s=s.filter((e=>n.id.includes(e.id))),s[0]&&"table"!==s[0].type)throw new Error(`Expected sequence id ${s[0].id} to be of type 'table', not '${s[0].type}'`);return s[0]||null},treeSequence:(e,n,t)=>{t.docSet=e.processor.docSets[e.docSetId];let s=Object.values(e.sequences);if(s=s.filter((e=>n.id.includes(e.id))),s[0]&&"tree"!==s[0].type)throw new Error(`Expected sequence id ${s[0].id} to be of type 'tree', not '${s[0].type}'`);return s[0]||null},kvSequence:(e,n,t)=>{t.docSet=e.processor.docSets[e.docSetId];let s=Object.values(e.sequences);if(s=s.filter((e=>n.id.includes(e.id))),s[0]&&"vk"!==s[0].type)throw new Error(`Expected sequence id ${s[0].id} to be of type 'kv', not '${s[0].type}'`);return s[0]||null},mainBlocks:(e,n,t)=>(t.docSet=e.processor.docSets[e.docSetId],e.sequences[e.mainId].blocks),mainBlocksItems:(e,n,t)=>(t.docSet=e.processor.docSets[e.docSetId],e.sequences[e.mainId].blocks.map((e=>t.docSet.unsuccinctifyItems(e.c,{},null)))),mainBlocksTokens:(e,n,t)=>(t.docSet=e.processor.docSets[e.docSetId],e.sequences[e.mainId].blocks.map((e=>t.docSet.unsuccinctifyItems(e.c,{tokens:!0},null)))),mainBlocksText:(e,n,t)=>(t.docSet=e.processor.docSets[e.docSetId],e.sequences[e.mainId].blocks.map((e=>{let s=t.docSet.unsuccinctifyItems(e.c,{tokens:!0},null).map((e=>e[2])).join("").trim();return n.normalizeSpace&&(s=s.replace(/[ \t\n\r]+/g," ")),s}))),mainText:(e,n,t)=>(t.docSet=e.processor.docSets[e.docSetId],e.sequences[e.mainId].blocks.map((e=>{let s=t.docSet.unsuccinctifyItems(e.c,{tokens:!0},null).map((e=>e[2])).join("").trim();return n.normalizeSpace&&(s=s.replace(/[ \t\n\r]+/g," ")),s})).join("\n")),tags:e=>Array.from(e.tags),tagsKv:e=>Array.from(e.tags).map((e=>e.includes(":")?[e.substring(0,e.indexOf(":")),e.substring(e.indexOf(":")+1)]:[e,""])),hasTag:(e,n)=>e.tags.has(n.tagName),cv:(e,n,t)=>To(e,n,t,!1),mappedCv:(e,n,t)=>{if(1!==n.verses.length)throw new Error(`mappedCv expects exactly one verse, not ${n.verses.length}`);return To(e,n,t,!0,n.mappedDocSetId)},mappedCvs:(e,n,t)=>{const s=e.chapterVerseIndex(n.chapter).filter((e=>e.length>0)).map((e=>e[0].verses));let r=[];for(const o of s)r.push(To(e,{...n,verses:[o]},t,!0,n.mappedDocSetId).map((e=>[[`fromChapter/${n.chapter}`,`fromVerse/${o}`,...e[0]],e[1]])));return r},cvNavigation:(e,n)=>[n.chapter,n.verse,e.chapterVerseIndex((parseInt(n.chapter)-1).toString()),e.chapterVerseIndex(n.chapter),e.chapterVerseIndex((parseInt(n.chapter)+1).toString())],cvIndexes:(e,n,t)=>(t.docSet=e.processor.docSets[e.docSetId],t.doc=e,Object.entries(e.chapterVerseIndexes())),cvIndex:(e,n,t)=>(t.docSet=e.processor.docSets[e.docSetId],t.doc=e,[n.chapter,e.chapterVerseIndex(n.chapter)||[]]),cIndexes:(e,n,t)=>(t.docSet=e.processor.docSets[e.docSetId],t.doc=e,Object.entries(e.chapterIndexes())),cIndex:(e,n,t)=>{t.docSet=e.processor.docSets[e.docSetId],t.doc=e;const s=e.chapterIndex(n.chapter);return[n.chapter,s||{}]},cvMatching:(n,t,s)=>{if(!t.withChars&&!t.withMatchingChars&&!t.withScopes)throw new Error("Must specify at least one of withChars or withMatchingChars or withScopes");if(t.withChars&&t.withMatchingChars)throw new Error("Must not specify both withChars and withMatchingChars");let r;s.docSet=n.processor.docSets[n.docSetId],t.withChars&&t.allChars?r=t.withChars.map((n=>e(`^${n}$`))):t.withChars?r=[e.union(t.withChars.map((n=>e(`^${n}$`,"i"))))]:t.withMatchingChars&&t.allChars?r=t.withMatchingChars.map((n=>e(n,"i"))):t.withMatchingChars&&(r=[e.union(t.withMatchingChars.map((n=>e(n,"i"))))]);const o=e=>{for(const n of t.withScopes||[])if(!e.includes(n))return!1;return!0},i=e=>{const n=t.withScopes||[];for(const t of n)if(e.includes(t))return!0;return 0===n.length};return s.docSet.sequenceItemsByScopes(n.sequences[n.mainId].blocks,["chapter/","verses/"]).filter((n=>(t.allScopes?o:i)(n[1].filter((e=>"scope"===e[0]&&"start"===e[1])).map((e=>e[2])))&&(n=>{for(const t of r||[]){let s=!1;for(const r of n)if(e.test(r[2],t)){s=!0;break}if(!s)return!1}return!0})(n[1])))},perf:(e,n)=>e.perf(n.indent),usfm:e=>e.usfm(),sofria:(e,n)=>e.sofria(n.indent,n.chapter)}}).documentSchemaString,Go=Eo.documentResolvers;var Co=(Oo={bookCodeCompareFunctions:{paratext:(e,n)=>{const t=e.headers.bookCode||"GEN",s=n.headers.bookCode||"GEN";return(y.canons.ptBooks[t]?y.canons.ptBooks[t].position:999)-(y.canons.ptBooks[s]?y.canons.ptBooks[s].position:999)},alpha:(e,n)=>{const t=e.headers.bookCode||"GEN",s=n.headers.bookCode||"GEN";return t.localeCompare(s)},alpha2:(e,n)=>{const t=[1,2,3,4,5,6];let s=e.headers.bookCode||"GEN";t.includes(s[0])&&(s=s.substring(1)+s[0]);let r=n.headers.bookCode||"GEN";return t.includes(r[0])&&(r=r.substring(1)+r[0]),s.localeCompare(r)}}}).bookCodeCompareFunctions,No=co.sequenceHasChars,qo=co.sequenceHasMatchingChars;var Ro,Mo,Do=(Bo={docSetSchemaString:`\n"""A collection of documents that share the same set of selector values"""\ntype DocSet {\n """The id of the docSet, which is formed by concatenating the docSet's selector values"""\n id: String!\n """The selectors of the docSet"""\n selectors: [KeyValue!]!\n """A selector for this docSet"""\n selector(\n """The id of the selector"""\n id: String!\n ): String!\n """A list of the tags of this docSet"""\n tags: [String!]!\n """A list of the tags of this docSet as key/value tuples"""\n tagsKv: [KeyValue!]!\n """Whether or not the docSet has the specified tag"""\n hasTag(\n """The tag"""\n tagName: String!\n ): Boolean!\n """The documents in the docSet"""\n documents(\n """A whitelist of ids of documents to include"""\n ids: [String!]\n """A whitelist of ids of documents to include"""\n withChars: [String!]\n """Return documents whose main sequence contains a token whose payload is an exact match to one of the specified strings"""\n withMatchingChars: [String!]\n """If true, documents where all search terms match will be included"""\n allChars: Boolean\n """Only return documents where the list of scopes is used"""\n withScopes: [String!]\n """If true, documents where all scopes are found will be included"""\n allScopes: Boolean\n """Only return documents with the specified header key/values"""\n withHeaderValues: [InputKeyValue!]\n """Only return documents with all the specified tags"""\n withTags: [String!]\n """Only return documents with none of the specified tags"""\n withoutTags: [String!]\n """Sort returned documents by the designated method (currently ${Object.keys(Co).join(", ")})\`"""\n sortedBy: String\n ): [Document!]!\n """The number of documents in the docSet"""\n nDocuments: Int!\n """A document in the docSet, if present"""\n document(\n """The book code of the required document"""\n bookCode: String!\n ): Document\n """Whether the docSet has versification information loaded"""\n hasMapping: Boolean!\n """The internal index number corresponding to a string in a given docSet enum"""\n enumIndexForString(\n """The enum to be searched"""\n enumType: String!\n """The string to match"""\n searchString: String!\n ): Int!\n """Information about internal indexes matching the case-insensitive regex in a given docSet enum"""\n enumRegexIndexesForString(\n """The enum to be searched"""\n enumType: String!\n """The regex to match"""\n searchRegex: String!\n ): [regexIndex!]!\n """A list of wordLike token strings in the docSet"""\n wordLikes(\n """Whether to coerce the strings (toLower|toUpper|none)"""\n coerceCase: String\n ): [String!]!\n """A list of unique characters in the docSet"""\n uniqueChars: [String!]!\n """A string containing the unique characters in the docSet"""\n uniqueCharsString: String!\n }\n`,docSetResolvers:{selectors:e=>Object.entries(e.selectors),selector:(e,n)=>e.selectors[n.id],tags:e=>Array.from(e.tags),tagsKv:e=>Array.from(e.tags).map((e=>e.includes(":")?[e.substring(0,e.indexOf(":")),e.substring(e.indexOf(":")+1)]:[e,""])),hasTag:(e,n)=>e.tags.has(n.tagName),documents:(e,n,t)=>{if(n.withChars&&n.withMatchingChars)throw new Error("Cannot specify both withChars and withMatchingChars");t.docSet=e;let s=e.documents();if(n.ids&&(s=s.filter((e=>n.ids.includes(e.id)))),n.withChars&&(s=s.filter((t=>No(e,t.sequences[t.mainId],n.withChars,n.allChars)))),n.withMatchingChars&&(s=s.filter((t=>qo(e,t.sequences[t.mainId],n.withMatchingChars,n.allChars)))),n.withScopes){const e=e=>new Set(e.sequences[e.mainId].blocks.map((e=>t.docSet.unsuccinctifyBlockScopeLabelsSet(e))).map((e=>Array.from(e))).reduce(((e,n)=>e.concat(n))));s=s.filter((t=>{const s=e(t),r=n.allScopes?n.withScopes.length:1;return n.withScopes.filter((e=>s.has(e))).length>=r}))}if(n.withHeaderValues&&(s=s.filter((e=>((e,n)=>{for(const t of n||[])if(!(t.key in e)||e[t.key]!==t.value)return!1;return!0})(e.headers,n.withHeaderValues)))),n.withTags&&(s=s.filter((e=>n.withTags.filter((n=>e.tags.has(n))).length===n.withTags.length))),n.withoutTags&&(s=s.filter((e=>0===n.withoutTags.filter((n=>e.tags.has(n))).length))),n.sortedBy){if(!(n.sortedBy in Co))throw new Error(`sortedBy value must be one of [${Object.keys(Co)}], not ${n.sortedBy}`);s.sort(Co[n.sortedBy])}return s},nDocuments:(e,n,t)=>(t.docSet=e,e.documents().length),document:(e,n)=>e.documentWithBook(n.bookCode),hasMapping:e=>e.tags.has("hasMapping"),enumIndexForString:(e,n)=>y.enums.enumStringIndex(e.enums[n.enumType],n.searchString),enumRegexIndexesForString:(e,n)=>y.enums.enumRegexIndexTuples(e.enums[n.enumType],n.searchRegex),wordLikes:(e,n)=>{if(n.coerceCase&&!["toLower","toUpper","none"].includes(n.coerceCase))throw new Error(`coerceCase, when present, must be 'toLower', 'toUpper' or 'none', not '${n.coerceCase}'`);let t=y.succinct.unpackEnum(e.enums.wordLike);return"toLower"===n.coerceCase&&(t=t.map((e=>e.toLowerCase()))),"toUpper"===n.coerceCase&&(t=t.map((e=>e.toUpperCase()))),Array.from(new Set(t))},uniqueChars:e=>{const n=new Set([]);for(const t of[...y.succinct.unpackEnum(e.enums.wordLike),...y.succinct.unpackEnum(e.enums.notWordLike)])for(const e of t.split(""))n.add(e);return Array.from(n).sort()},uniqueCharsString:e=>{const n=new Set([]);for(const t of[...y.succinct.unpackEnum(e.enums.wordLike),...y.succinct.unpackEnum(e.enums.notWordLike)])for(const e of t.split(""))n.add(e);return Array.from(n).sort().join("")}}}).docSetSchemaString,$o=Bo.docSetResolvers,Jo=Oo.bookCodeCompareFunctions;const Ho={eng:{raw:'# Versification "English"\n# Version=2.0\n#\n# modifications by Reinier de Blois 13/March/2012\n# modified mappings Psalms by adding verse #0 to the mappings\n# many of the subscripts that are part of verses 1,2 in the original text end up as verse #0 in English translations\n\n# modifications by Studge 26/June/2009\n# book definitions are for all books printed in any English of Spanish Bible\n# this includes books for Protestant, Catholic and Protestant-Catholic-EasternOrthodox Interconfessional editions\n#\n# This is the versification used by most English (e.g. RSV) and Spanish Bibles (e.g. RVR)\n#\n# List of books, chapters, verses\n# One line per book.\n# One entry for each chapter.\n# Verse number is the maximum verse number for that chapter.\n# See the lines containing =\'s below for verse mappings.\n#\n#--------------------------------------------------\n# Old Testament\nGEN 1:31 2:25 3:24 4:26 5:32 6:22 7:24 8:22 9:29 10:32 11:32 12:20 13:18 14:24 15:21 16:16 17:27 18:33 19:38 20:18 21:34 22:24 23:20 24:67 25:34 26:35 27:46 28:22 29:35 30:43 31:55 32:32 33:20 34:31 35:29 36:43 37:36 38:30 39:23 40:23 41:57 42:38 43:34 44:34 45:28 46:34 47:31 48:22 49:33 50:26\nEXO 1:22 2:25 3:22 4:31 5:23 6:30 7:25 8:32 9:35 10:29 11:10 12:51 13:22 14:31 15:27 16:36 17:16 18:27 19:25 20:26 21:36 22:31 23:33 24:18 25:40 26:37 27:21 28:43 29:46 30:38 31:18 32:35 33:23 34:35 35:35 36:38 37:29 38:31 39:43 40:38\nLEV 1:17 2:16 3:17 4:35 5:19 6:30 7:38 8:36 9:24 10:20 11:47 12:8 13:59 14:57 15:33 16:34 17:16 18:30 19:37 20:27 21:24 22:33 23:44 24:23 25:55 26:46 27:34\nNUM 1:54 2:34 3:51 4:49 5:31 6:27 7:89 8:26 9:23 10:36 11:35 12:16 13:33 14:45 15:41 16:50 17:13 18:32 19:22 20:29 21:35 22:41 23:30 24:25 25:18 26:65 27:23 28:31 29:40 30:16 31:54 32:42 33:56 34:29 35:34 36:13\nDEU 1:46 2:37 3:29 4:49 5:33 6:25 7:26 8:20 9:29 10:22 11:32 12:32 13:18 14:29 15:23 16:22 17:20 18:22 19:21 20:20 21:23 22:30 23:25 24:22 25:19 26:19 27:26 28:68 29:29 30:20 31:30 32:52 33:29 34:12\nJOS 1:18 2:24 3:17 4:24 5:15 6:27 7:26 8:35 9:27 10:43 11:23 12:24 13:33 14:15 15:63 16:10 17:18 18:28 19:51 20:9 21:45 22:34 23:16 24:33\nJDG 1:36 2:23 3:31 4:24 5:31 6:40 7:25 8:35 9:57 10:18 11:40 12:15 13:25 14:20 15:20 16:31 17:13 18:31 19:30 20:48 21:25\nRUT 1:22 2:23 3:18 4:22\n1SA 1:28 2:36 3:21 4:22 5:12 6:21 7:17 8:22 9:27 10:27 11:15 12:25 13:23 14:52 15:35 16:23 17:58 18:30 19:24 20:42 21:15 22:23 23:29 24:22 25:44 26:25 27:12 28:25 29:11 30:31 31:13\n2SA 1:27 2:32 3:39 4:12 5:25 6:23 7:29 8:18 9:13 10:19 11:27 12:31 13:39 14:33 15:37 16:23 17:29 18:33 19:43 20:26 21:22 22:51 23:39 24:25\n1KI 1:53 2:46 3:28 4:34 5:18 6:38 7:51 8:66 9:28 10:29 11:43 12:33 13:34 14:31 15:34 16:34 17:24 18:46 19:21 20:43 21:29 22:53\n2KI 1:18 2:25 3:27 4:44 5:27 6:33 7:20 8:29 9:37 10:36 11:21 12:21 13:25 14:29 15:38 16:20 17:41 18:37 19:37 20:21 21:26 22:20 23:37 24:20 25:30\n1CH 1:54 2:55 3:24 4:43 5:26 6:81 7:40 8:40 9:44 10:14 11:47 12:40 13:14 14:17 15:29 16:43 17:27 18:17 19:19 20:8 21:30 22:19 23:32 24:31 25:31 26:32 27:34 28:21 29:30\n2CH 1:17 2:18 3:17 4:22 5:14 6:42 7:22 8:18 9:31 10:19 11:23 12:16 13:22 14:15 15:19 16:14 17:19 18:34 19:11 20:37 21:20 22:12 23:21 24:27 25:28 26:23 27:9 28:27 29:36 30:27 31:21 32:33 33:25 34:33 35:27 36:23\nEZR 1:11 2:70 3:13 4:24 5:17 6:22 7:28 8:36 9:15 10:44\nNEH 1:11 2:20 3:32 4:23 5:19 6:19 7:73 8:18 9:38 10:39 11:36 12:47 13:31\nEST 1:22 2:23 3:15 4:17 5:14 6:14 7:10 8:17 9:32 10:3\nJOB 1:22 2:13 3:26 4:21 5:27 6:30 7:21 8:22 9:35 10:22 11:20 12:25 13:28 14:22 15:35 16:22 17:16 18:21 19:29 20:29 21:34 22:30 23:17 24:25 25:6 26:14 27:23 28:28 29:25 30:31 31:40 32:22 33:33 34:37 35:16 36:33 37:24 38:41 39:30 40:24 41:34 42:17\nPSA 1:6 2:12 3:8 4:8 5:12 6:10 7:17 8:9 9:20 10:18 11:7 12:8 13:6 14:7 15:5 16:11 17:15 18:50 19:14 20:9 21:13 22:31 23:6 24:10 25:22 26:12 27:14 28:9 29:11 30:12 31:24 32:11 33:22 34:22 35:28 36:12 37:40 38:22 39:13 40:17 41:13 42:11 43:5 44:26 45:17 46:11 47:9 48:14 49:20 50:23 51:19 52:9 53:6 54:7 55:23 56:13 57:11 58:11 59:17 60:12 61:8 62:12 63:11 64:10 65:13 66:20 67:7 68:35 69:36 70:5 71:24 72:20 73:28 74:23 75:10 76:12 77:20 78:72 79:13 80:19 81:16 82:8 83:18 84:12 85:13 86:17 87:7 88:18 89:52 90:17 91:16 92:15 93:5 94:23 95:11 96:13 97:12 98:9 99:9 100:5 101:8 102:28 103:22 104:35 105:45 106:48 107:43 108:13 109:31 110:7 111:10 112:10 113:9 114:8 115:18 116:19 117:2 118:29 119:176 120:7 121:8 122:9 123:4 124:8 125:5 126:6 127:5 128:6 129:8 130:8 131:3 132:18 133:3 134:3 135:21 136:26 137:9 138:8 139:24 140:13 141:10 142:7 143:12 144:15 145:21 146:10 147:20 148:14 149:9 150:6\nPRO 1:33 2:22 3:35 4:27 5:23 6:35 7:27 8:36 9:18 10:32 11:31 12:28 13:25 14:35 15:33 16:33 17:28 18:24 19:29 20:30 21:31 22:29 23:35 24:34 25:28 26:28 27:27 28:28 29:27 30:33 31:31\nECC 1:18 2:26 3:22 4:16 5:20 6:12 7:29 8:17 9:18 10:20 11:10 12:14\nSNG 1:17 2:17 3:11 4:16 5:16 6:13 7:13 8:14\nISA 1:31 2:22 3:26 4:6 5:30 6:13 7:25 8:22 9:21 10:34 11:16 12:6 13:22 14:32 15:9 16:14 17:14 18:7 19:25 20:6 21:17 22:25 23:18 24:23 25:12 26:21 27:13 28:29 29:24 30:33 31:9 32:20 33:24 34:17 35:10 36:22 37:38 38:22 39:8 40:31 41:29 42:25 43:28 44:28 45:25 46:13 47:15 48:22 49:26 50:11 51:23 52:15 53:12 54:17 55:13 56:12 57:21 58:14 59:21 60:22 61:11 62:12 63:19 64:12 65:25 66:24\nJER 1:19 2:37 3:25 4:31 5:31 6:30 7:34 8:22 9:26 10:25 11:23 12:17 13:27 14:22 15:21 16:21 17:27 18:23 19:15 20:18 21:14 22:30 23:40 24:10 25:38 26:24 27:22 28:17 29:32 30:24 31:40 32:44 33:26 34:22 35:19 36:32 37:21 38:28 39:18 40:16 41:18 42:22 43:13 44:30 45:5 46:28 47:7 48:47 49:39 50:46 51:64 52:34\nLAM 1:22 2:22 3:66 4:22 5:22\nEZK 1:28 2:10 3:27 4:17 5:17 6:14 7:27 8:18 9:11 10:22 11:25 12:28 13:23 14:23 15:8 16:63 17:24 18:32 19:14 20:49 21:32 22:31 23:49 24:27 25:17 26:21 27:36 28:26 29:21 30:26 31:18 32:32 33:33 34:31 35:15 36:38 37:28 38:23 39:29 40:49 41:26 42:20 43:27 44:31 45:25 46:24 47:23 48:35\nDAN 1:21 2:49 3:30 4:37 5:31 6:28 7:28 8:27 9:27 10:21 11:45 12:13\nHOS 1:11 2:23 3:5 4:19 5:15 6:11 7:16 8:14 9:17 10:15 11:12 12:14 13:16 14:9\nJOL 1:20 2:32 3:21\nAMO 1:15 2:16 3:15 4:13 5:27 6:14 7:17 8:14 9:15\nOBA 1:21\nJON 1:17 2:10 3:10 4:11\nMIC 1:16 2:13 3:12 4:13 5:15 6:16 7:20\nNAM 1:15 2:13 3:19\nHAB 1:17 2:20 3:19\nZEP 1:18 2:15 3:20\nHAG 1:15 2:23\nZEC 1:21 2:13 3:10 4:14 5:11 6:15 7:14 8:23 9:17 10:12 11:17 12:14 13:9 14:21\nMAL 1:14 2:17 3:18 4:6\n#-----------------------------------------------\n# New Testament\nMAT 1:25 2:23 3:17 4:25 5:48 6:34 7:29 8:34 9:38 10:42 11:30 12:50 13:58 14:36 15:39 16:28 17:27 18:35 19:30 20:34 21:46 22:46 23:39 24:51 25:46 26:75 27:66 28:20\nMRK 1:45 2:28 3:35 4:41 5:43 6:56 7:37 8:38 9:50 10:52 11:33 12:44 13:37 14:72 15:47 16:20\nLUK 1:80 2:52 3:38 4:44 5:39 6:49 7:50 8:56 9:62 10:42 11:54 12:59 13:35 14:35 15:32 16:31 17:37 18:43 19:48 20:47 21:38 22:71 23:56 24:53\nJHN 1:51 2:25 3:36 4:54 5:47 6:71 7:53 8:59 9:41 10:42 11:57 12:50 13:38 14:31 15:27 16:33 17:26 18:40 19:42 20:31 21:25\nACT 1:26 2:47 3:26 4:37 5:42 6:15 7:60 8:40 9:43 10:48 11:30 12:25 13:52 14:28 15:41 16:40 17:34 18:28 19:41 20:38 21:40 22:30 23:35 24:27 25:27 26:32 27:44 28:31\nROM 1:32 2:29 3:31 4:25 5:21 6:23 7:25 8:39 9:33 10:21 11:36 12:21 13:14 14:23 15:33 16:27\n1CO 1:31 2:16 3:23 4:21 5:13 6:20 7:40 8:13 9:27 10:33 11:34 12:31 13:13 14:40 15:58 16:24\n#2CO 1:24 2:17 3:18 4:18 5:21 6:18 7:16 8:24 9:15 10:18 11:33 12:21 13:14\n# Note sometimes 2CO 13 has 14 verses e.g. KJV. but 13 verses in modern translations\n2CO 1:24 2:17 3:18 4:18 5:21 6:18 7:16 8:24 9:15 10:18 11:33 12:21 13:14\nGAL 1:24 2:21 3:29 4:31 5:26 6:18\nEPH 1:23 2:22 3:21 4:32 5:33 6:24\nPHP 1:30 2:30 3:21 4:23\nCOL 1:29 2:23 3:25 4:18\n1TH 1:10 2:20 3:13 4:18 5:28\n2TH 1:12 2:17 3:18\n1TI 1:20 2:15 3:16 4:16 5:25 6:21\n2TI 1:18 2:26 3:17 4:22\nTIT 1:16 2:15 3:15\nPHM 1:25\nHEB 1:14 2:18 3:19 4:16 5:14 6:20 7:28 8:13 9:28 10:39 11:40 12:29 13:25\nJAS 1:27 2:26 3:18 4:17 5:20\n1PE 1:25 2:25 3:22 4:19 5:14\n2PE 1:21 2:22 3:18\n1JN 1:10 2:29 3:24 4:21 5:21\n2JN 1:13\n3JN 1:15\nJUD 1:25\nREV 1:20 2:29 3:22 4:11 5:14 6:17 7:17 8:13 9:21 10:11 11:19 12:18 13:18 14:20 15:8 16:21 17:18 18:24 19:21 20:15 21:27 22:21\n# sometimes called the Apocalypse\n#---------------------------------------------------------\n# Deuterocanonical books\nTOB 1:22 2:14 3:17 4:21 5:21 6:17 7:18 8:21 9:6 10:13 11:19 12:22 13:18 14:15\nJDT 1:16 2:28 3:10 4:15 5:24 6:21 7:32 8:36 9:14 10:23 11:23 12:20 13:20 14:19 15:13 16:25\n#-----------------------\n# This is the definition for "Additions to Daniel" as in the KJV [Studge]\n# ESG 1:13 2:12 3:6 4:18 5:19 6:16 7:24\n# more commonly UBS Bibles have ESG which is the full Esther Greek for modern Bibles e.g. RSV, CEV, GNB etc\nESG 1:39 2:23 3:22 4:47 5:28 6:14 7:10 8:39 9:32 10:13\n#-----------------------\nWIS 1:16 2:24 3:19 4:20 5:23 6:25 7:30 8:21 9:18 10:21 11:26 12:27 13:19 14:31 15:19 16:29 17:21 18:25 19:22\nSIR 1:30 2:18 3:31 4:31 5:15 6:37 7:36 8:19 9:18 10:31 11:34 12:18 13:26 14:27 15:20 16:30 17:32 18:33 19:30 20:32 21:28 22:27 23:27 24:34 25:26 26:29 27:30 28:26 29:28 30:25 31:31 32:24 33:31 34:26 35:20 36:26 37:31 38:34 39:35 40:30 41:23 42:25 43:33 44:23 45:26 46:20 47:25 48:25 49:16 50:29 51:30\n#\n# In English Bibles Baruch sometimes has 5 chapters and sometimes 6 in Catholic Bibles [Studge]\nBAR 1:21 2:35 3:37 4:37 5:9 6:73\n#\nLJE 1:73\nS3Y 1:68\nSUS 1:64\nBEL 1:42\n1MA 1:64 2:70 3:60 4:61 5:68 6:63 7:50 8:32 9:73 10:89 11:74 12:53 13:53 14:49 15:41 16:24\n2MA 1:36 2:32 3:40 4:50 5:27 6:31 7:42 8:36 9:29 10:38 11:38 12:45 13:26 14:46 15:39\n#-----------------------------------------------------\n# Additional Orthodox Books in Interconfessional Bibles e.g. RSV, NRSV\n3MA 1:29 2:33 3:30 4:21 5:51 6:41 7:23\n4MA 1:35 2:24 3:21 4:26 5:38 6:35 7:23 8:29 9:32 10:21 11:27 12:19 13:27 14:20 15:32 16:25 17:24 18:24\n1ES 1:58 2:30 3:24 4:63 5:73 6:34 7:15 8:96 9:55\n2ES 1:40 2:48 3:36 4:52 5:56 6:59 7:140 8:63 9:47 10:59 11:46 12:51 13:58 14:48 15:63 16:78\nMAN 1:15\nPS2 1:7\n#-----------------------------------------------------\n# ODA and PSS are only used in LXX and SYR projects and are not needed here\n# ODA 1:19 2:43 3:10 4:19 5:12 6:8 7:20 8:37 9:22 10:9 11:11 12:15 13:4 14:46\n# PSS 1:8 2:37 3:12 4:25 5:19 6:6 7:10 8:34 9:11 10:8 11:9 12:6 13:12 14:10 15:13 16:15 17:46 18:12\n#-----------------------------------------------------\n# Obselete books used for LXX variant texts, in LXX only in PT 6, and obselete in PT 7, not used in English, Spanish or any other Bibles. If these codes were used they were used for the wrong books and these definitions were not relevant\nJSA 1:18 2:24 3:17 4:24 5:15 6:27 7:26 8:35 9:27 10:43 11:23 12:24 13:33 14:15 15:63 16:10 17:18 18:28 19:51 20:9 21:45 22:34 23:16 24:33\nJDB 1:36 2:23 3:31 4:24 5:31 6:40 7:25 8:35 9:57 10:18 11:40 12:15 13:25 14:20 15:20 16:31 17:13 18:31 19:30 20:48 21:25\nTBS 1:22 2:14 3:17 4:21 5:23 6:19 7:17 8:21 9:6 10:14 11:19 12:22 13:18 14:15\nSST 1:64\nDNT 1:21 2:49 3:97 4:37 5:30 6:29 7:28 8:27 9:27 10:21 11:45 12:13\nBLT 1:42\n#------------------------------------------------------\n# Daniel Greek used in some English Catholic Bibles\nDAG 1:21 2:49 3:97 4:37 5:31 6:28 7:28 8:27 9:27 10:21 11:45 12:13 13:64 14:42\n# Letter to the Laodiceans which was in the John Wycliffe Bible\nLAO 1:20\n#\n#-----------------------------------------------------\n# Mapping\n#-----------------------------------------------------\n# English = BHS (see org.vrs)\n#\n# (Note: ranges must not span a chapter, e.g. 4:10-5:11 is illegal)\n#\nGEN 31:55 = GEN 32:1\nGEN 32:1-32 = GEN 32:2-33\nEXO 8:1-4 = EXO 7:26-29\nEXO 8:5-32 = EXO 8:1-28\nEXO 22:1 = EXO 21:37\nEXO 22:2-31 = EXO 22:1-30\nLEV 6:1-7 = LEV 5:20-26\nLEV 6:8-30 = LEV 6:1-23\nNUM 16:36-50 = NUM 17:1-15\nNUM 17:1-13 = NUM 17:16-28\n# NUM 26:1a = NUM 25:19b # no support for splits yet\n# NUM 26:1b = NUM 26:1 # no support for splits yet\nNUM 29:40 = NUM 30:1\nNUM 30:1-16 = NUM 30:2-17\nDEU 12:32 = DEU 13:1\nDEU 13:1-18 = DEU 13:2-19\nDEU 22:30 = DEU 23:1\nDEU 23:1-25 = DEU 23:2-26\nDEU 29:1 = DEU 28:69\nDEU 29:2-29 = DEU 29:1-28\n#\n# removed see PTSIL-113\n#1SA 20:42 = 1SA 20:41\n#\n1SA 20:42 = 1SA 21:1\n1SA 21:1-15 = 1SA 21:2-16\n1SA 23:29 = 1SA 24:1\n1SA 24:1-22 = 1SA 24:2-23\n2SA 18:33 = 2SA 19:1\n2SA 19:1-43 = 2SA 19:2-44\n1KI 4:21-34 = 1KI 5:1-14\n1KI 5:1-18 = 1KI 5:15-32\n# 1KI 18:33a = 1KI 18:33 # no support for splits yet\n# 1KI 18:33b = 1KI 18:34 # no support for splits yet\n# 1KI 22:43a = 1KI 22:43b # no support for splits yet\n1KI 22:43-53 = 1KI 22:44-54\n2KI 11:21 = 2KI 12:1\n2KI 12:1-21 = 2KI 12:2-22\n1CH 6:1-15 = 1CH 5:27-41\n1CH 6:16-81 = 1CH 6:1-66\n# 1CH 12:4b = 1CH 12:4 # no support for splits yet\n1CH 12:4-40 = 1CH 12:5-41\n2CH 2:1 = 2CH 1:18\n2CH 2:2-18 = 2CH 2:1-17\n2CH 14:1 = 2CH 13:23\n2CH 14:2-15 = 2CH 14:1-14\nNEH 4:1-6 = NEH 3:33-38\nNEH 4:7-23 = NEH 4:1-17\nNEH 7:69-73 = NEH 7:68-72\nNEH 9:38 = NEH 10:1\nNEH 10:1-39 = NEH 10:2-40\nJOB 41:1-8 = JOB 40:25-32\nJOB 41:9-34 = JOB 41:1-26\nPSA 3:0-8 = PSA 3:1-9\nPSA 4:0-8 = PSA 4:1-9\nPSA 5:0-12 = PSA 5:1-13\nPSA 6:0-10 = PSA 6:1-11\nPSA 7:0-17 = PSA 7:1-18\nPSA 8:0-9 = PSA 8:1-10\nPSA 9:0-20 = PSA 9:1-21\nPSA 12:0-8 = PSA 12:1-9\nPSA 13:0-5 = PSA 13:1-6\nPSA 18:0-50 = PSA 18:1-51\nPSA 19:0-14 = PSA 19:1-15\nPSA 20:0-9 = PSA 20:1-10\nPSA 21:0-13 = PSA 21:1-14\nPSA 22:0-31 = PSA 22:1-32\nPSA 30:0-12 = PSA 30:1-13\nPSA 31:0-24 = PSA 31:1-25\nPSA 34:0-22 = PSA 34:1-23\nPSA 36:0-12 = PSA 36:1-13\nPSA 38:0-22 = PSA 38:1-23\nPSA 39:0-13 = PSA 39:1-14\nPSA 40:0-17 = PSA 40:1-18\nPSA 41:0-13 = PSA 41:1-14\nPSA 42:0-11 = PSA 42:1-12\nPSA 44:0-26 = PSA 44:1-27\nPSA 45:0-17 = PSA 45:1-18\nPSA 46:0-11 = PSA 46:1-12\nPSA 47:0-9 = PSA 47:1-10\nPSA 48:0-14 = PSA 48:1-15\nPSA 49:0-20 = PSA 49:1-21\nPSA 51:0 = PSA 51:1\nPSA 51:0 = PSA 51:2\nPSA 51:1-19 = PSA 51:3-21\nPSA 52:0 = PSA 52:1\nPSA 52:0 = PSA 52:2\nPSA 52:1-9 = PSA 52:3-11\nPSA 53:0-6 = PSA 53:1-7\nPSA 54:0 = PSA 54:1\nPSA 54:0 = PSA 54:2\nPSA 54:1-7 = PSA 54:3-9\nPSA 55:0-23 = PSA 55:1-24\nPSA 56:0-13 = PSA 56:1-14\nPSA 57:0-11 = PSA 57:1-12\nPSA 58:0-11 = PSA 58:1-12\nPSA 59:0-17 = PSA 59:1-18\nPSA 60:0 = PSA 60:1\nPSA 60:0 = PSA 60:2\nPSA 60:1-12 = PSA 60:3-14\nPSA 61:0-8 = PSA 61:1-9\nPSA 62:0-12 = PSA 62:1-13\nPSA 63:0-11 = PSA 63:1-12\nPSA 64:0-10 = PSA 64:1-11\nPSA 65:0-13 = PSA 65:1-14\nPSA 67:0-7 = PSA 67:1-8\nPSA 68:0-35 = PSA 68:1-36\nPSA 69:0-36 = PSA 69:1-37\nPSA 70:0-5 = PSA 70:1-6\nPSA 75:0-10 = PSA 75:1-11\nPSA 76:0-12 = PSA 76:1-13\nPSA 77:0-20 = PSA 77:1-21\nPSA 80:0-19 = PSA 80:1-20\nPSA 81:0-16 = PSA 81:1-17\nPSA 83:0-18 = PSA 83:1-19\nPSA 84:0-12 = PSA 84:1-13\nPSA 85:0-13 = PSA 85:1-14\nPSA 88:0-18 = PSA 88:1-19\nPSA 89:0-52 = PSA 89:1-53\nPSA 92:0-15 = PSA 92:1-16\nPSA 102:0-28 = PSA 102:1-29\nPSA 108:0-13 = PSA 108:1-14\nPSA 140:0-13 = PSA 140:1-14\nPSA 142:0-7 = PSA 142:1-8\nECC 5:1 = ECC 4:17\nECC 5:2-20 = ECC 5:1-19\nSNG 6:13 = SNG 7:1\nSNG 7:1-13 = SNG 7:2-14\nISA 9:1 = ISA 8:23\nISA 9:2-21 = ISA 9:1-20\nISA 64:2-12 = ISA 64:1-11\nJER 9:1 = JER 8:23\nJER 9:2-26 = JER 9:1-25\nEZK 20:45-46 = EZK 21:1-2\nEZK 20:47 = EZK 21:3\nEZK 20:48-49 = EZK 21:4-5\nEZK 21:1-32 = EZK 21:6-37\nDAN 4:1-3 = DAN 3:31-33\nDAN 4:4-37 = DAN 4:1-34\nDAN 5:31 = DAN 6:1\nDAN 6:1-28 = DAN 6:2-29\nHOS 1:10-11 = HOS 2:1-2\nHOS 2:1-23 = HOS 2:3-25\nHOS 11:12 = HOS 12:1\nHOS 12:1-14 = HOS 12:2-15\nHOS 13:16 = HOS 14:1\nHOS 14:1-9 = HOS 14:2-10\nJOL 2:28-32 = JOL 3:1-5\nJOL 3:1-21 = JOL 4:1-21\nJON 1:17 = JON 2:1\nJON 2:1-10 = JON 2:2-11\nMIC 5:1 = MIC 4:14\nMIC 5:2-15 = MIC 5:1-14\nNAM 1:15 = NAM 2:1\nNAM 2:1-13 = NAM 2:2-14\nZEC 1:18-21 = ZEC 2:1-4\nZEC 2:1-13 = ZEC 2:5-17\nMAL 4:1-6 = MAL 3:19-24\n# 40 + 41 -> 40 (per Peter Kirk)\n#! &ACT 19:40-41 = ACT 19:40\n#\n#---------------------------------\n# map Baruch 6 onto Letter of Jeremiah [Studge]\nBAR 6:1-73 = LJE 1:1-73\n#\n#------------------------------\n# Susanna\nDAG 13:1-63 = SUS 1:1-63\n# Bel and the Dragon\nDAG 14:1-42 = BEL 1:1-42\n#----------------------------------\n# Mapping Esther Greek onto LXX Esther Greek\n#\n# This maps the standard verses generated by Create Book\n# to the actual verse numbers and segments found in the LXX\n# ESG chapter 1\nESG 1:1 = ESG 1:1a\nESG 1:2 = ESG 1:1b\nESG 1:3 = ESG 1:1c\nESG 1:4 = ESG 1:1d\nESG 1:5 = ESG 1:1e\nESG 1:6 = ESG 1:1f\nESG 1:7 = ESG 1:1g\nESG 1:8 = ESG 1:1h\nESG 1:9 = ESG 1:1i\nESG 1:10 = ESG 1:1k\nESG 1:11 = ESG 1:1l\nESG 1:12 = ESG 1:1m\nESG 1:13 = ESG 1:1n\nESG 1:14 = ESG 1:1o\nESG 1:15 = ESG 1:1p\nESG 1:16 = ESG 1:1q\nESG 1:17 = ESG 1:1r\nESG 1:18 = ESG 1:1s\nESG 1:19-39 = ESG 1:2-22\n# ESG chapter 3\nESG 3:14 = ESG 3:13a\nESG 3:15 = ESG 3:13b\nESG 3:16 = ESG 3:13c\nESG 3:17 = ESG 3:13d\nESG 3:18 = ESG 3:13e\nESG 3:19 = ESG 3:13f\nESG 3:20 = ESG 3:13g\nESG 3:21 = ESG 3:14\nESG 3:22 = ESG 3:15\n# ESG chapter 4\nESG 4:18 = ESG 4:17a\nESG 4:19 = ESG 4:17b\nESG 4:20 = ESG 4:17c\nESG 4:21 = ESG 4:17c\nESG 4:22 = ESG 4:17d\nESG 4:23 = ESG 4:17d\nESG 4:24 = ESG 4:17e\nESG 4:25 = ESG 4:17f\nESG 4:26 = ESG 4:17g\nESG 4:27 = ESG 4:17h\nESG 4:28 = ESG 4:17i\nESG 4:29 = ESG 4:17k\nESG 4:30 = ESG 4:17k\nESG 4:31 = ESG 4:17k\nESG 4:32 = ESG 4:17l\nESG 4:33 = ESG 4:17m\nESG 4:34 = ESG 4:17n\nESG 4:35 = ESG 4:17n\nESG 4:36 = ESG 4:17o\nESG 4:37 = ESG 4:17o\nESG 4:38 = ESG 4:17p\nESG 4:39 = ESG 4:17q\nESG 4:40 = ESG 4:17r\nESG 4:41 = ESG 4:17s\nESG 4:42 = ESG 4:17t\nESG 4:43 = ESG 4:17u\nESG 4:44 = ESG 4:17w\nESG 4:45 = ESG 4:17x\nESG 4:46 = ESG 4:17y\nESG 4:47 = ESG 4:17z\n# ESG chapter 5\nESG 5:2 = ESG 5:1a\nESG 5:3 = ESG 5:1a\nESG 5:4 = ESG 5:1a\nESG 5:5 = ESG 5:1b\nESG 5:6 = ESG 5:1c\nESG 5:7 = ESG 5:1d\nESG 5:8 = ESG 5:1e\nESG 5:9 = ESG 5:1f\nESG 5:10 = ESG 5:1f\nESG 5:11 = ESG 5:2\nESG 5:12 = ESG 5:2\nESG 5:13 = ESG 5:2a\nESG 5:14 = ESG 5:2a\nESG 5:15 = ESG 5:2b\nESG 5:16 = ESG 5:2b\nESG 5:17-28 = ESG 5:3-14\n# ESG chapter 8\nESG 8:13 = ESG 8:12a\nESG 8:14 = ESG 8:12b\nESG 8:15 = ESG 8:12c\nESG 8:16 = ESG 8:12d\nESG 8:17 = ESG 8:12e\nESG 8:18 = ESG 8:12f\nESG 8:19 = ESG 8:12g\nESG 8:20 = ESG 8:12h\nESG 8:21 = ESG 8:12i\nESG 8:22 = ESG 8:12k\nESG 8:23 = ESG 8:12l\nESG 8:24 = ESG 8:12m\nESG 8:25 = ESG 8:12n\nESG 8:26 = ESG 8:12o\nESG 8:27 = ESG 8:12p\nESG 8:28 = ESG 8:12q\nESG 8:29 = ESG 8:12r\nESG 8:30 = ESG 8:12s\nESG 8:31 = ESG 8:12t\nESG 8:32 = ESG 8:12u\nESG 8:33 = ESG 8:12x\nESG 8:34 = ESG 8:12y\nESG 8:35 = ESG 8:12y\nESG 8:36 = ESG 8:12y\nESG 8:37-41 = ESG 8:13-17\n# ESG chapter 10\nESG 10:4 = ESG 10:3a\nESG 10:5 = ESG 10:3b\nESG 10:6 = ESG 10:3c\nESG 10:7 = ESG 10:3d\nESG 10:8 = ESG 10:3e\nESG 10:9 = ESG 10:3f\nESG 10:10 = ESG 10:3g\nESG 10:11 = ESG 10:3h\nESG 10:12 = ESG 10:3i\nESG 10:13 = ESG 10:3k\nESG 10:14 = ESG 10:3l\n# S3Y is a small section of the DAG LXX pulled out and translated as a separate book.\n# Map it back to the LXX. This section allow\'s texts such as TOB (French) which do\n# this to scroll correctly with the LXX.\n# S3Y is not present in the GRK, HEB, or LXX(Ralphs) text.\n# If a text has DAG present, this section must NOT be included in its versification file because\n# that would cause references in other texts to DAG to be redirected to a non-existant S3Y.\nS3Y 1:1-29 = DAG 3:24-52\nS3Y 1:30-31 = DAG 3:52-53\nS3Y 1:33 = DAG 3:54\nS3Y 1:32 = DAG 3:55\nS3Y 1:34-35 = DAG 3:56-57\nS3Y 1:37 = DAG 3:58\nS3Y 1:36 = DAG 3:59\nS3Y 1:38-68 = DAG 3:60-90\n'},lxx:{raw:"# Versification \"Septuagint\"\n# Version=1.7\n# \n# modifications by Studge 26/ June/ 2009\n# This should include the versifications for Bibles which follow LXX versificatio mainly Orthodox Bibles. [Studge]\n#\n# List of books, chapters, verses\n# One line per book.\n# One entry for each chapter.\n# Verse number is the maximum verse number for that chapter.\n# See the lines containing ='s below for verse mappings.\n#\n# modifications by Reinier 20/ April/ 2010\n# all data that are not part of the LXX itself have been commented out with ##\n#\n# modifications by Michael Lothers 1/ June/ 2011\n# added verse segment information in the format: *GEN 1:22,-,a,b\n# which indicates GEN 1:22 has three segments, the first has no marking followed by two segments: 1a and 1b\n# The lines are preceded by #! so that versions of Paratext prior to 7.3 will ignore them rather than crash.\n#\n# modifications by Tim Steenwyk 15/ September/ 2011\n# removed mapping references to PS3 since they shouldn't be in LXX (Septuagint)\n#------------------------------------------------\n# Old Testament\nGEN 1:31 2:25 3:24 4:26 5:32 6:22 7:24 8:22 9:29 10:32 11:32 12:20 13:18 14:24 15:21 16:16 17:27 18:33 19:38 20:18 21:34 22:24 23:20 24:67 25:34 26:35 27:46 28:22 29:35 30:43 31:54 32:33 33:20 34:31 35:29 36:43 37:36 38:30 39:23 40:23 41:57 42:38 43:34 44:34 45:28 46:34 47:31 48:22 49:33 50:26\nEXO 1:22 2:25 3:22 4:31 5:23 6:30 7:29 8:28 9:35 10:29 11:10 12:51 13:22 14:31 15:27 16:36 17:16 18:27 19:25 20:26 21:37 22:30 23:33 24:18 25:40 26:37 27:21 28:43 29:46 30:38 31:18 32:35 33:23 34:35 35:35 36:38 37:21 38:27 39:23 40:38\nLEV 1:17 2:16 3:17 4:35 5:26 6:23 7:38 8:36 9:24 10:20 11:47 12:8 13:59 14:57 15:33 16:34 17:16 18:30 19:37 20:27 21:24 22:33 23:44 24:23 25:55 26:46 27:34\nNUM 1:54 2:34 3:51 4:49 5:31 6:26 7:89 8:26 9:23 10:36 11:35 12:16 13:33 14:45 15:41 16:35 17:28 18:32 19:22 20:29 21:35 22:41 23:30 24:25 25:18 26:65 27:23 28:31 29:39 30:17 31:54 32:42 33:56 34:29 35:34 36:13\nDEU 1:46 2:37 3:29 4:49 5:33 6:25 7:26 8:20 9:29 10:22 11:32 12:31 13:19 14:29 15:23 16:22 17:20 18:22 19:21 20:20 21:23 22:29 23:26 24:22 25:19 26:19 27:26 28:69 29:28 30:20 31:30 32:52 33:29 34:12\nJOS 1:18 2:24 3:17 4:24 5:15 6:27 7:26 8:29 9:27 10:42 11:23 12:24 13:32 14:15 15:63 16:10 17:18 18:28 19:51 20:9 21:45 22:34 23:16 24:33\nJDG 1:36 2:23 3:31 4:24 5:31 6:40 7:25 8:35 9:57 10:18 11:40 12:15 13:25 14:20 15:20 16:31 17:13 18:31 19:30 20:48 21:25\nRUT 1:22 2:23 3:18 4:22\n1SA 1:28 2:36 3:21 4:22 5:12 6:21 7:17 8:22 9:27 10:27 11:15 12:25 13:23 14:52 15:35 16:23 17:54 18:29 19:24 20:42 21:16 22:23 23:28 24:23 25:44 26:25 27:12 28:25 29:11 30:31 31:13\n# 1SA called 1 Kings in the Orthodox tradition\n2SA 1:27 2:32 3:39 4:12 5:25 6:23 7:29 8:18 9:13 10:19 11:27 12:31 13:39 14:33 15:37 16:23 17:29 18:32 19:44 20:26 21:22 22:51 23:39 24:25\n# 2SA called 2 Kings in the Orthodox tradition\n1KI 1:53 2:46 3:28 4:19 5:32 6:36 7:50 8:66 9:28 10:29 11:43 12:33 13:34 14:31 15:34 16:34 17:24 18:46 19:21 20:29 21:43 22:54\n# 1KI called 3 Kings in the Orthodox tradition\n2KI 1:18 2:25 3:27 4:44 5:27 6:33 7:20 8:29 9:37 10:36 11:20 12:22 13:25 14:29 15:38 16:20 17:41 18:37 19:37 20:21 21:26 22:20 23:37 24:20 25:30\n# 2KI called 4 Kings in the Orthodox tradition\n1CH 1:54 2:55 3:24 4:43 5:41 6:66 7:40 8:40 9:44 10:14 11:47 12:41 13:14 14:17 15:29 16:43 17:27 18:17 19:19 20:8 21:30 22:19 23:32 24:31 25:31 26:32 27:34 28:21 29:30\n2CH 1:18 2:17 3:17 4:22 5:14 6:42 7:22 8:18 9:31 10:19 11:23 12:16 13:23 14:14 15:19 16:14 17:19 18:34 19:11 20:37 21:20 22:12 23:21 24:27 25:28 26:23 27:9 28:27 29:36 30:27 31:21 32:33 33:25 34:33 35:27 36:23\n#\n# Edited by Studge\n# Added EZR which is Ezra-Nehemiah, which had been put under 2ES by mistake\n# Edited chapters 13 and 20 / SS 14.6.2014\nEZR 1:11 2:70 3:13 4:24 5:17 6:22 7:28 8:36 9:15 10:44 11:11 12:20 13:37 14:23 15:19 16:19 17:73 18:18 19:38 20:40 21:36 22:47 23:31\n#\n# most projects based on LXX will use Nehemiah so we ought to add it in.\n##NEH 1:11 2:20 3:32 4:23 5:19 6:19 7:73 8:18 9:38 10:39 11:36 12:47 13:31\n#\n# Edited by Studge\n# should not have ESG here but amongst the Deuterocanonical books for PT order\n# ESG 1:22 2:23 3:15 4:17 5:14 6:14 7:10 8:17 9:32 10:3\n#\nJOB 1:22 2:13 3:26 4:21 5:27 6:30 7:21 8:22 9:35 10:22 11:20 12:25 13:28 14:22 15:35 16:22 17:16 18:21 19:29 20:29 21:34 22:30 23:17 24:25 25:6 26:14 27:23 28:28 29:25 30:31 31:40 32:22 33:33 34:37 35:16 36:33 37:24 38:41 39:30 40:32 41:26 42:17\nPSA 1:6 2:12 3:9 4:9 5:13 6:11 7:18 8:10 9:39 10:7 11:9 12:6 13:7 14:5 15:11 16:15 17:51 18:15 19:10 20:14 21:32 22:6 23:10 24:22 25:12 26:14 27:9 28:11 29:13 30:25 31:11 32:22 33:23 34:28 35:13 36:40 37:23 38:14 39:18 40:14 41:12 42:5 43:27 44:18 45:12 46:10 47:15 48:21 49:23 50:21 51:11 52:7 53:9 54:24 55:14 56:12 57:12 58:18 59:14 60:9 61:13 62:12 63:11 64:14 65:20 66:8 67:36 68:37 69:6 70:24 71:20 72:28 73:23 74:11 75:13 76:21 77:72 78:13 79:20 80:17 81:8 82:19 83:13 84:14 85:17 86:7 87:19 88:53 89:17 90:16 91:16 92:5 93:23 94:11 95:13 96:12 97:9 98:9 99:5 100:8 101:29 102:22 103:35 104:45 105:48 106:43 107:14 108:31 109:7 110:10 111:10 112:9 113:26 114:9 115:10 116:2 117:29 118:176 119:7 120:8 121:9 122:4 123:8 124:5 125:6 126:5 127:6 128:8 129:8 130:3 131:18 132:3 133:3 134:21 135:26 136:9 137:8 138:24 139:14 140:10 141:8 142:12 143:15 144:21 145:10 146:11 147:9 148:14 149:9 150:6 151:7\n# Psalms has 151 psalms in the Septuagint tradition\nPRO 1:33 2:22 3:35 4:27 5:23 6:35 7:27 8:36 9:18 10:32 11:31 12:28 13:25 14:35 15:33 16:33 17:28 18:22 19:29 20:30 21:31 22:29 23:35 24:34 25:28 26:28 27:27 28:28 29:27 30:33 31:31\nECC 1:18 2:26 3:22 4:17 5:19 6:12 7:29 8:17 9:18 10:20 11:10 12:14\nSNG 1:17 2:17 3:11 4:16 5:16 6:12 7:14 8:14\nISA 1:31 2:21 3:26 4:6 5:30 6:13 7:25 8:23 9:20 10:34 11:16 12:6 13:22 14:32 15:9 16:14 17:14 18:7 19:25 20:6 21:17 22:25 23:18 24:23 25:12 26:21 27:13 28:29 29:24 30:33 31:9 32:20 33:24 34:17 35:10 36:22 37:38 38:22 39:8 40:31 41:29 42:25 43:28 44:28 45:25 46:13 47:15 48:22 49:26 50:11 51:23 52:15 53:12 54:17 55:13 56:11 57:21 58:14 59:21 60:22 61:11 62:12 63:19 64:11 65:25 66:24\n#\n# Edited by SS 25.3.2003\n# Original: JER 1:19 2:37 3:25 4:31 5:31 6:30 7:34 8:23 9:25 10:25 11:23 12:17 13:27 14:22 15:21 16:21 17:27 18:23 19:15 20:18 21:14 22:30 23:40 24:10 25:38 26:24 27:22 28:17 29:32 30:24 31:40 32:44 33:26 34:22 35:19 36:32 37:21 38:28 39:18 40:16 41:18 42:22 43:13 44:30 45:5 46:28 47:7 48:47 49:39 50:46 51:64 52:34\n#\nJER 1:19 2:37 3:25 4:31 5:31 6:30 7:34 8:23 9:25 10:25 11:23 12:17 13:27 14:22 15:21 16:21 17:27 18:23 19:15 20:18 21:14 22:30 23:40 24:10 25:20 26:28 27:46 28:64 29:7 30:33 31:44 32:38 33:24 34:22 35:17 36:32 37:24 38:40 39:44 40:13 41:22 42:19 43:32 44:21 45:28 46:18 47:16 48:18 49:22 50:13 51:35 52:34\nLAM 1:22 2:22 3:66 4:22 5:22\nEZK 1:28 2:10 3:27 4:17 5:17 6:14 7:27 8:18 9:11 10:22 11:25 12:28 13:23 14:23 15:8 16:63 17:24 18:32 19:14 20:44 21:37 22:31 23:49 24:27 25:17 26:21 27:36 28:26 29:21 30:26 31:18 32:32 33:33 34:31 35:15 36:38 37:28 38:23 39:29 40:49 41:26 42:20 43:27 44:31 45:25 46:24 47:23 48:35\n#\n# There really should not be an entry for DAN in the LXX.vrs. All this material should be in DAG to match Ralhfs.\n# However, there are no doubt many projects that incorrectly but the material in DAN so we leave this here\n# for backward compatibility\n# Following line commented out and DAG-DAN mapping brought up from end of file to allow DAG text to sychronize with HEB where they match\n# Edited by Sarah Lind Oct 6 2015\n# DAN 1:21 2:49 3:97 4:37 5:30 6:29 7:28 8:27 9:27 10:21 11:45 12:13\nDAG 1:1-21 = DAN 1:1-21 \nDAG 2:1-49 = DAN 2:1-49\nDAG 3:1-23 = DAN 3:1-23\nDAG 3:91-97 = DAN 3:24-30\nDAG 4:1-3 = DAN 3:31-33\nDAG 4:4-37 = DAN 4:1-34\nDAG 4:1-2 = DAN 4:4-5\nDAG 5:1-30 = DAN 5:1-30\nDAG 6:1-29 = DAN 6:1-29\nDAG 7:1-28 = DAN 7:1-28\nDAG 8:1-27 = DAN 8:1-27\nDAG 9:1-27 = DAN 9:1-27\nDAG 10:1-21 = DAN 10:1-21\nDAG 11:1-45 = DAN 11:1-45\nDAG 12:1-13 = DAN 12:1-13\n#\nHOS 1:9 2:25 3:5 4:19 5:15 6:11 7:16 8:14 9:17 10:15 11:11 12:15 13:15 14:10\nJOL 1:20 2:27 3:5 4:21\nAMO 1:15 2:16 3:15 4:13 5:27 6:14 7:17 8:14 9:15\nOBA 1:21\nJON 1:16 2:11 3:10 4:11\nMIC 1:16 2:13 3:12 4:14 5:14 6:16 7:20\nNAM 1:14 2:14 3:19\nHAB 1:17 2:20 3:19\nZEP 1:18 2:15 3:20\nHAG 1:15 2:23\nZEC 1:17 2:17 3:10 4:14 5:11 6:15 7:14 8:23 9:17 10:12 11:17 12:14 13:9 14:21\nMAL 1:14 2:17 3:24\n#\n# It feels a bit odd to include NT in \"Septuagint\" but I think there are\n# Bibles that follow the _versification_ of OT LXX but also have a NT.\n#\n# ------------------------------------------------------\n# New Testament books\nMAT 1:25 2:23 3:17 4:25 5:48 6:34 7:29 8:34 9:38 10:42 11:30 12:50 13:58 14:36 15:39 16:28 17:27 18:35 19:30 20:34 21:46 22:46 23:39 24:51 25:46 26:75 27:66 28:20\nMRK 1:45 2:28 3:35 4:41 5:43 6:56 7:37 8:38 9:50 10:52 11:33 12:44 13:37 14:72 15:47 16:20\nLUK 1:80 2:52 3:38 4:44 5:39 6:49 7:50 8:56 9:62 10:42 11:54 12:59 13:35 14:35 15:32 16:31 17:37 18:43 19:48 20:47 21:38 22:71 23:56 24:53\nJHN 1:51 2:25 3:36 4:54 5:47 6:71 7:53 8:59 9:41 10:42 11:57 12:50 13:38 14:31 15:27 16:33 17:26 18:40 19:42 20:31 21:25\nACT 1:26 2:47 3:26 4:37 5:42 6:15 7:60 8:40 9:43 10:48 11:30 12:25 13:52 14:28 15:41 16:40 17:34 18:28 19:40 20:38 21:40 22:30 23:35 24:27 25:27 26:32 27:44 28:31\nROM 1:32 2:29 3:31 4:25 5:21 6:23 7:25 8:39 9:33 10:21 11:36 12:21 13:14 14:23 15:33 16:27\n1CO 1:31 2:16 3:23 4:21 5:13 6:20 7:40 8:13 9:27 10:33 11:34 12:31 13:13 14:40 15:58 16:24\n2CO 1:24 2:17 3:18 4:18 5:21 6:18 7:16 8:24 9:15 10:18 11:33 12:21 13:13\nGAL 1:24 2:21 3:29 4:31 5:26 6:18\nEPH 1:23 2:22 3:21 4:32 5:33 6:24\nPHP 1:30 2:30 3:21 4:23\nCOL 1:29 2:23 3:25 4:18\n1TH 1:10 2:20 3:13 4:18 5:28\n2TH 1:12 2:17 3:18\n1TI 1:20 2:15 3:16 4:16 5:25 6:21\n2TI 1:18 2:26 3:17 4:22\nTIT 1:16 2:15 3:15\nPHM 1:25\nHEB 1:14 2:18 3:19 4:16 5:14 6:20 7:28 8:13 9:28 10:39 11:40 12:29 13:25\nJAS 1:27 2:26 3:18 4:17 5:20\n1PE 1:25 2:25 3:22 4:19 5:14\n2PE 1:21 2:22 3:18\n1JN 1:10 2:29 3:24 4:21 5:21\n2JN 1:13\n3JN 1:15\nJUD 1:25\nREV 1:20 2:29 3:22 4:11 5:14 6:17 7:17 8:13 9:21 10:11 11:19 12:18 13:18 14:20 15:8 16:21 17:18 18:24 19:21 20:15 21:27 22:21\n#--------------------------------------------------\n# Deuterocanonical Books\nTOB 1:22 2:14 3:17 4:21 5:23 6:19 7:17 8:21 9:6 10:14 11:19 12:22 13:18 14:15\nJDT 1:16 2:28 3:10 4:15 5:24 6:21 7:32 8:36 9:14 10:23 11:23 12:20 13:20 14:19 15:14 16:25\n# added ESG definition in its right PT order\nESG 1:22 2:23 3:15 4:17 5:14 6:14 7:10 8:17 9:32 10:3\n# note chapter 4 v17 is 17a-z\n# note chapter 8 v12 is 12a-x\n# note chapter 10 v3 is 3a-l\nWIS 1:16 2:24 3:19 4:20 5:23 6:25 7:30 8:21 9:18 10:21 11:26 12:27 13:19 14:31 15:19 16:29 17:20 18:25 19:22\nSIR 1:30 2:18 3:31 4:31 5:15 6:37 7:36 8:19 9:18 10:31 11:34 12:18 13:26 14:27 15:20 16:30 17:32 18:33 19:30 20:31 21:28 22:27 23:27 24:34 25:26 26:29 27:30 28:26 29:28 30:25 31:31 32:24 33:33 34:26 35:24 36:27 37:31 38:34 39:35 40:30 41:27 42:25 43:33 44:23 45:26 46:20 47:25 48:25 49:16 50:29 51:30\nBAR 1:22 2:35 3:38 4:37 5:9\nLJE 1:72\n# Edited SUS / SS 14.6.2014\nSUS 1:64\nBEL 1:42\n1MA 1:64 2:70 3:60 4:61 5:68 6:63 7:50 8:32 9:73 10:89 11:74 12:53 13:53 14:49 15:41 16:24\n2MA 1:36 2:32 3:40 4:50 5:27 6:31 7:42 8:36 9:29 10:38 11:38 12:45 13:26 14:46 15:39\n3MA 1:29 2:33 3:30 4:21 5:51 6:41 7:23\n4MA 1:35 2:24 3:21 4:26 5:38 6:35 7:23 8:29 9:32 10:21 11:27 12:19 13:27 14:20 15:32 16:25 17:24 18:24\n# 1ES Ezra (Greek)\n1ES 1:55 2:26 3:24 4:63 5:71 6:33 7:15 8:92 9:55\n#-----------------------------------------------------\n# Edited by Studge - Had the wrong definition of 2ES\n# 2ES 1:11 2:70 3:13 4:24 5:17 6:22 7:28 8:36 9:15 10:44 11:11 12:20 13:37 14:17 15:19 16:19 17:73 18:18 19:37 20:40 21:36 22:47 23:31\n# 2ES is not a LXX book but is from the Vulgate and has 16 chapters\n# edited by Studge added the correct definition of 2ES\n2ES 1:40 2:48 3:36 4:52 5:56 6:59 7:140 8:63 9:47 10:59 11:46 12:51 13:58 14:48 15:63 16:78\n#\n# Edited by Studge\n#MAN and PS2 were not defined which are in LXX\nMAN 1:15\nPS2 1:7\n#-------------------------------------------------------\n# ODA and PSS are in the PT 6 files but now missing from the LXX files in PT 7\nODA 1:19 2:43 3:10 4:19 5:12 6:8 7:20 8:37 9:22 10:9 11:11 12:15 13:4 14:46\nPSS 1:8 2:37 3:12 4:25 5:19 6:6 7:10 8:34 9:11 10:8 11:9 12:6 13:12 14:10 15:13 16:15 17:46 18:12\n#-------------------------------------------------------\n# NR: LXX variant texts now obselete, kep for backward compatability\nJSA 1:18 2:24 3:17 4:24 5:15 6:27 7:26 8:35 9:27 10:43 11:23 12:24 13:33 14:15 15:63 16:10 17:18 18:28 19:45 20:9 21:45 22:34 23:16 24:33\nJDB 1:36 2:23 3:31 4:24 5:31 6:40 7:25 8:35 9:57 10:18 11:40 12:15 13:25 14:20 15:20 16:31 17:13 18:31 19:30 20:48 21:25\nTBS 1:22 2:14 3:17 4:21 5:23 6:19 7:17 8:21 9:6 10:14 11:19 12:22 13:18 14:15\nSST 1:64\nDNT 1:21 2:49 3:97 4:37 5:30 6:29 7:28 8:27 9:27 10:21 11:45 12:13\nBLT 1:42\n#--------------------------------------------------------\n# Greek Daniel\n# Edited chapter 5 and 6 and removed chapters 13 and 14 that are not in Rahlfs / SS 14.6.2014\nDAG 1:21 2:49 3:97 4:37 5:30 6:29 7:28 8:27 9:27 10:21 11:45 12:13\n#--------------------------------------------------------\n# Syriac books for Peshitta projects SYR and SYA\n#\n# Syriac Psalms 152-155\n##PS3 1:17 2:20 3:6 4:6\n#\n# Apocalypse of Baruch\n##2BA 1:5 2:2 3:9 4:7 5:7 6:10 7:2 8:5 9:1 10:19 11:7 12:5 13:12 14:19 15:8 16:1 17:4 18:2 19:8 20:6 21:26 22:8 23:7 24:4 25:4 26:1 27:15 28:7 29:8 30:5 31:5 32:9 33:3 34:1 35:5 36:10 37:1 38:4 39:8 40:4 41:6 42:8 43:3 44:15 45:2 46:7 47:2 48:50 49:3 50:4 51:16 52:8 53:12 54:22 55:8 56:16 57:3 58:2 59:12 60:2 61:8 62:8 63:11 64:10 65:2 66:8 67:9 68:8 69:5 70:10 71:3 72:6 73:7 74:4 75:8 76:5 77:26\n#\n# Letter of Baruch\n##LBA 78:7 79:3 80:7 81:4 82:9 83:23 84:11 85:15 86:3\n#--------------------------------------------------------\n# Books for Ethiopian Canon\n# Jubilees (Ethiopian canon)\n##JUB 1:26 2:17 3:19 4:24 5:36 6:34 7:37 8:40 9:27 10:48 11:39 12:56 13:34 14:55 15:20 16:28 17:30 18:31 19:59 20:66 21:30 22:38 23:59 24:30 25:50 26:48 27:37 28:38 29:27 30:29 31:31 32:24 33:30 34:20\n# Enoch (Ethiopian canon)\n##ENO 1:28 2:42 3:30 4:88 5:40 6:42 7:39 8:46 9:42 10:16 11:19 12:40 13:34 14:35 15:45 16:41 17:69 18:42 19:29 20:53 21:57 22:14 23:26 24:16 25:30 26:37 27:21 28:34 29:28 30:23 31:29 32:82 33:59 34:49 35:36 36:30 37:34 38:36 39:24 40:40 41:22 42:16\n# 1 Meqabyan (Ethiopian canon)\n##1MQ 1:28 2:28 3:38 4:37 5:39 6:38 7:33 8:35 9:10 10:8 11:8 12:44 13:27 14:23 15:20 16:9 17:8 18:12 19:17 20:4 21:31 22:11 23:7 4:22 25:18 26:5 27:20 28:49 29:17 30:16 31:7 32:4 33:11 34:18 35:8 36:46\n# 2 Meqabyan (Ethiopian canon)\n##2MQ 1:13 2:11 3:29 4:32 5:18 6:24 7:9 8:24 9:27 10:28 11:25 12:15 13:14 14:36 15:21 16:15 17:12 18:14 19:15 20:14 \n# 3 Meqabyan (Ethiopian canon)\n##3MQ 1:24 2:23 3:11 4:36 5:16 6:16 7:5 8:12 9:36 10:29\n# Reproof (Ethiopian canon)\n##REP 1:28 2:28 3:27 4:28 5:27 6:22\n# 4 Baruch / Rest of the Words of Baruch (Ethiopian canon)\n##4BA 1:30 2:29 3:30 4:33 5:62\n#---------------------------------------------------------\n# Edited by SS 14.6.2014 added deliberatelly omitted verses\n-GEN 31:51\n-GEN 35:21\n\n-EXO 25:6\n-EXO 28:23\n-EXO 28:24\n-EXO 28:25\n-EXO 28:26\n-EXO 28:27\n-EXO 28:28\n-EXO 32:9\n-EXO 35:8\n-EXO 35:15\n-EXO 35:17\n-EXO 35:18\n-EXO 40:7\n-EXO 40:11\n-EXO 40:28\n-EXO 40:30\n-EXO 40:31\n-EXO 40:32\n\n-JOS 6:4\n-JOS 8:13\n-JOS 8:26\n-JOS 10:15\n-JOS 20:4\n-JOS 20:5\n-JOS 20:6\n\n-1SA 13:1\n-1SA 17:21\n-1SA 17:22\n-1SA 17:23\n-1SA 17:24\n-1SA 17:25\n-1SA 17:26\n-1SA 17:27\n-1SA 17:28\n-1SA 17:29\n-1SA 17:30\n-1SA 17:31\n-1SA 17:41\n-1SA 17:50\n-1SA 18:1\n-1SA 18:2\n-1SA 18:3\n-1SA 18:4\n-1SA 18:5\n-1SA 18:10\n-1SA 18:11\n-1SA 18:17\n-1SA 18:18\n-1SA 18:19\n-1SA 23:12\n\n-1KI 3:1\n-1KI 5:5\n-1KI 5:6\n-1KI 5:7\n-1KI 5:8\n-1KI 5:31\n-1KI 6:11\n-1KI 6:12\n-1KI 6:13\n-1KI 6:14\n-1KI 6:18\n-1KI 8:12\n-1KI 8:13\n-1KI 9:15\n-1KI 9:16\n-1KI 9:17\n-1KI 9:18\n-1KI 9:19\n-1KI 9:20\n-1KI 9:21\n-1KI 9:22\n-1KI 9:23\n-1KI 9:24\n-1KI 9:25\n-1KI 11:3\n-1KI 11:23\n-1KI 11:24\n-1KI 11:39\n-1KI 12:2\n-1KI 12:17\n-1KI 13:27\n-1KI 14:1\n-1KI 14:2\n-1KI 14:3\n-1KI 14:4\n-1KI 14:5\n-1KI 14:6\n-1KI 14:7\n-1KI 14:8\n-1KI 14:9\n-1KI 14:10\n-1KI 14:11\n-1KI 14:12\n-1KI 14:13\n-1KI 14:14\n-1KI 14:15\n-1KI 14:16\n-1KI 14:17\n-1KI 14:18\n-1KI 14:19\n-1KI 14:20\n-1KI 15:6\n-1KI 15:32\n-1KI 22:47\n-1KI 22:48\n-1KI 22:49\n-1KI 22:50\n\n-1SA 17:12\n-1SA 17:13\n-1SA 17:14\n-1SA 17:15\n-1SA 17:16\n-1SA 17:17\n-1SA 17:18\n-1SA 17:19\n-1SA 17:20\n\n-1CH 1:11\n-1CH 1:12\n-1CH 1:13\n-1CH 1:14\n-1CH 1:15\n-1CH 1:16\n-1CH 1:18\n-1CH 1:19\n-1CH 1:20\n-1CH 1:21\n-1CH 1:22\n-1CH 1:23\n-1CH 16:24\n\n-2CH 27:8\n\n-EZR 13:7\n-EZR 14:18\n-EZR 14:19\n-EZR 14:20\n-EZR 14:21\n-EZR 14:22\n-EZR 14:23\n-EZR 19:38\n-EZR 21:16\n-EZR 21:20\n-EZR 21:21\n-EZR 21:28\n-EZR 21:29\n-EZR 21:32\n-EZR 21:33\n-EZR 21:34\n-EZR 21:35\n-EZR 22:4\n-EZR 22:5\n-EZR 22:6\n\n-JOB 23:14\n\n-PSA 115:5\n\n-PRO 4:7\n-PRO 8:33\n-PRO 11:4\n-PRO 15:31\n-PRO 16:1\n-PRO 16:3\n-PRO 16:4\n-PRO 16:6\n-PRO 19:1\n-PRO 19:2\n-PRO 20:14\n-PRO 20:15\n-PRO 20:16\n-PRO 20:17\n-PRO 20:18\n-PRO 20:19\n-PRO 20:20\n-PRO 20:21\n-PRO 20:22\n-PRO 21:5\n-PRO 22:6\n-PRO 23:23\n\n-JER 2:1\n-JER 7:1\n-JER 8:11\n-JER 8:12\n-JER 10:6\n-JER 10:7\n-JER 10:8\n-JER 10:10\n-JER 11:7\n-JER 17:1\n-JER 17:2\n-JER 17:3\n-JER 17:4\n-JER 26:1\n-JER 26:26\n-JER 28:45\n-JER 28:46\n-JER 28:47\n-JER 28:48\n-JER 30:22\n-JER 32:1\n-JER 32:2\n-JER 32:3\n-JER 32:4\n-JER 32:5\n-JER 32:6\n-JER 32:7\n-JER 32:8\n-JER 32:9\n-JER 32:10\n-JER 32:11\n-JER 32:12\n-JER 32:14\n-JER 34:1\n-JER 34:7\n-JER 34:13\n-JER 34:17\n-JER 34:21\n-JER 36:16\n-JER 36:17\n-JER 36:18\n-JER 36:19\n-JER 36:20\n-JER 37:10\n-JER 37:11\n-JER 37:15\n-JER 37:22\n-JER 46:4\n-JER 46:5\n-JER 46:6\n-JER 46:7\n-JER 46:8\n-JER 46:9\n-JER 46:10\n-JER 46:11\n-JER 46:12\n-JER 46:13\n-JER 52:2\n-JER 52:3\n-JER 52:15\n-JER 52:28\n-JER 52:29\n-JER 52:30\n\n-LAM 3:22\n-LAM 3:23\n-LAM 3:24\n-LAM 3:29\n\n-EZK 1:14\n-EZK 10:14\n-EZK 27:31\n-EZK 32:19\n-EZK 33:26\n-EZK 40:30\n\n#------------- DC books ------------\n\n-TOB 4:8\n-TOB 4:9\n-TOB 4:10\n-TOB 4:11\n-TOB 4:12\n-TOB 4:13\n-TOB 4:14\n-TOB 4:15\n-TOB 4:16\n-TOB 4:17\n-TOB 4:18\n-TOB 13:8\n-TOB 13:9\n-TOB 13:10\n\n-ESG 4:6\n-ESG 9:5\n-ESG 9:30\n\n-SIR 1:5\n-SIR 1:7\n-SIR 1:21\n-SIR 3:19\n-SIR 3:25\n-SIR 6:1\n-SIR 10:21\n-SIR 11:15\n-SIR 11:16\n-SIR 13:14\n-SIR 16:15\n-SIR 16:16\n-SIR 17:5\n-SIR 17:9\n-SIR 17:16\n-SIR 17:18\n-SIR 17:21\n-SIR 18:3\n-SIR 19:18\n-SIR 19:19\n-SIR 19:21\n-SIR 22:7\n-SIR 22:8\n-SIR 24:18\n-SIR 24:24\n-SIR 25:12\n-SIR 26:19\n-SIR 26:20\n-SIR 26:21\n-SIR 26:22\n-SIR 26:23\n-SIR 26:24\n-SIR 26:25\n-SIR 26:26\n-SIR 26:27\n\n-4MA 10:4\n-4MA 11:7\n-4MA 11:8\n\n#---------------------------------------------------------\n# Mapping\n# LXX = BHS (see org.vrs)\n#\n# (Note: for performance reasons ranges must not span a chapter, e.g. 4:10-5:11 is illegal)\n#\n# 2ES = EZR and NEH\n#\nEXO 20:13 = EXO 20:14\nEXO 20:14 = EXO 20:15\nEXO 20:15 = EXO 20:13\nEXO 21:16 = EXO 21:17\nEXO 21:17 = EXO 21:16\nEXO 36:9 = EXO 39:2\nEXO 36:10 = EXO 39:3\nEXO 36:11 = EXO 39:4\nEXO 36:12 = EXO 39:5\nEXO 36:13 = EXO 39:6\nEXO 36:14 = EXO 39:7\nEXO 36:15 = EXO 39:8\nEXO 36:16 = EXO 39:9\nEXO 36:17 = EXO 39:10\nEXO 36:20 = EXO 39:13\nEXO 36:21 = EXO 39:14\nEXO 36:22 = EXO 39:15\nEXO 36:23 = EXO 39:16\nEXO 36:25 = EXO 39:17\nEXO 36:26 = EXO 39:18\nEXO 36:27 = EXO 39:19\nEXO 36:28 = EXO 39:20\nEXO 36:29 = EXO 39:21\nEXO 36:30 = EXO 39:22\nEXO 36:31 = EXO 39:23\nEXO 36:32 = EXO 39:24\nEXO 36:33 = EXO 39:25\nEXO 36:34 = EXO 39:26\nEXO 36:35 = EXO 39:27\nEXO 36:36 = EXO 39:28\nEXO 36:37 = EXO 39:29\nEXO 36:38 = EXO 39:30\n\nDEU 5:17 = DEU 5:18\nDEU 5:18 = DEU 5:17\n\n1KI 20:1-29 = 1KI 21:1-29 \n1KI 21:1-43 = 1KI 20:1-43\n\n#\n# Map The Greek versioin of Esther onto the Hebrew version of Esther\n# using the Hebrew version as the reference point.\n# Normally DC material would not have any entries in this part of the lxx.vrs file\n# because the LXX serves as the reference point for DC material.\n# Material which is placed in separate books in HEB and LXX (i.e. EST and ESG)\n# is however placed here and referenced to the HEB reference points.\nESG 1:1-22 = EST 1:1-22\nESG 2:1-23 = EST 2:1-23\nESG 3:1-15 = EST 3:1-15\nESG 4:1-17 = EST 4:1-17\nESG 5:1-14 = EST 5:1-14\nESG 6:1-14 = EST 6:1-14\nESG 7:1-10 = EST 7:1-10\nESG 8:1-17 = EST 8:1-17\nESG 9:1-32 = EST 9:1-32\nESG 10:1-3 = EST 10:1-3\n#\n# PSA 9 = 9+10\nPSA 9:22 = PSA 10:0\nPSA 9:22-39 = PSA 10:1-18\nPSA 10:0-7 = PSA 11:0-7\nPSA 11:0-9 = PSA 12:0-9\nPSA 12:0-6 = PSA 13:0-6\nPSA 13:0-7 = PSA 14:0-7\nPSA 14:0-5 = PSA 15:0-5\nPSA 15:0-11 = PSA 16:0-11\nPSA 16:0-15 = PSA 17:0-15\nPSA 17:0-51 = PSA 18:0-51\nPSA 18:0-15 = PSA 19:0-15\nPSA 19:0-10 = PSA 20:0-10\nPSA 20:0-14 = PSA 21:0-14\nPSA 21:0-32 = PSA 22:0-32\nPSA 22:0-6 = PSA 23:0-6\nPSA 23:0-10 = PSA 24:0-10\nPSA 24:0-22 = PSA 25:0-22\nPSA 25:0-12 = PSA 26:0-12\nPSA 26:0-14 = PSA 27:0-14\nPSA 27:0-9 = PSA 28:0-9\nPSA 28:0-11 = PSA 29:0-11\nPSA 29:0-13 = PSA 30:0-13\nPSA 30:0-25 = PSA 31:0-25\nPSA 31:0-11 = PSA 32:0-11\nPSA 32:0-22 = PSA 33:0-22\nPSA 33:0-23 = PSA 34:0-23\nPSA 34:0-28 = PSA 35:0-28\nPSA 35:0-13 = PSA 36:0-13\nPSA 36:0-40 = PSA 37:0-40\nPSA 37:0-23 = PSA 38:0-23\nPSA 38:0-14 = PSA 39:0-14\nPSA 39:0-18 = PSA 40:0-18\nPSA 40:0-14 = PSA 41:0-14\nPSA 41:0-12 = PSA 42:0-12\nPSA 42:0-5 = PSA 43:0-5\nPSA 43:0-27 = PSA 44:0-27\nPSA 44:0-18 = PSA 45:0-18\nPSA 45:0-12 = PSA 46:0-12\nPSA 46:0-10 = PSA 47:0-10\nPSA 47:0-15 = PSA 48:0-15\nPSA 48:0-21 = PSA 49:0-21\nPSA 49:0-23 = PSA 50:0-23\nPSA 50:0-21 = PSA 51:0-21\nPSA 51:0-11 = PSA 52:0-11\nPSA 52:0-7 = PSA 53:0-7\nPSA 53:0-9 = PSA 54:0-9\nPSA 54:0-24 = PSA 55:0-24\nPSA 55:0-14 = PSA 56:0-14\nPSA 56:0-12 = PSA 57:0-12\nPSA 57:0-12 = PSA 58:0-12\nPSA 58:0-18 = PSA 59:0-18\nPSA 59:0-14 = PSA 60:0-14\nPSA 60:0-9 = PSA 61:0-9\nPSA 61:0-13 = PSA 62:0-13\nPSA 62:0-12 = PSA 63:0-12\nPSA 63:0-11 = PSA 64:0-11\nPSA 64:0-14 = PSA 65:0-14\nPSA 65:0-20 = PSA 66:0-20\nPSA 66:0-8 = PSA 67:0-8\nPSA 67:0-36 = PSA 68:0-36\nPSA 68:0-37 = PSA 69:0-37\nPSA 69:0-6 = PSA 70:0-6\nPSA 70:0-24 = PSA 71:0-24\nPSA 71:0-20 = PSA 72:0-20\nPSA 72:0-28 = PSA 73:0-28\nPSA 73:0-23 = PSA 74:0-23\nPSA 74:0-11 = PSA 75:0-11\nPSA 75:0-13 = PSA 76:0-13\nPSA 76:0-21 = PSA 77:0-21\nPSA 77:0-72 = PSA 78:0-72\nPSA 78:0-13 = PSA 79:0-13\nPSA 79:0-20 = PSA 80:0-20\nPSA 80:0-17 = PSA 81:0-17\nPSA 81:0-8 = PSA 82:0-8\nPSA 82:0-19 = PSA 83:0-19\nPSA 83:0-13 = PSA 84:0-13\nPSA 84:0-14 = PSA 85:0-14\nPSA 85:0-17 = PSA 86:0-17\nPSA 86:0-7 = PSA 87:0-7\nPSA 87:0-19 = PSA 88:0-19\nPSA 88:0-53 = PSA 89:0-53\nPSA 89:0-17 = PSA 90:0-17\nPSA 90:0-16 = PSA 91:0-16\nPSA 91:0-16 = PSA 92:0-16\nPSA 92:0-5 = PSA 93:0-5\nPSA 93:0-23 = PSA 94:0-23\nPSA 94:0-11 = PSA 95:0-11\nPSA 95:0-13 = PSA 96:0-13\nPSA 96:0-12 = PSA 97:0-12\nPSA 97:0-9 = PSA 98:0-9\nPSA 98:0-9 = PSA 99:0-9\nPSA 99:0-5 = PSA 100:0-5\nPSA 100:0-8 = PSA 101:0-8\nPSA 101:0-29 = PSA 102:0-29\nPSA 102:0-22 = PSA 103:0-22\nPSA 103:0-35 = PSA 104:0-35\nPSA 104:0-45 = PSA 105:0-45\nPSA 105:0-48 = PSA 106:0-48\nPSA 106:0-43 = PSA 107:0-43\nPSA 107:0-14 = PSA 108:0-14\nPSA 108:0-31 = PSA 109:0-31\nPSA 109:0-7 = PSA 110:0-7\nPSA 110:0-10 = PSA 111:0-10\nPSA 111:0-10 = PSA 112:0-10\nPSA 112:0-9 = PSA 113:0-9\nPSA 113:0-8 = PSA 114:0-8\nPSA 113:9 = PSA 115:0\nPSA 113:9-26 = PSA 115:1-18\nPSA 114:0-9 = PSA 116:0-9\nPSA 115:0 = PSA 116:10\nPSA 115:1-10 = PSA 116:10-19\t\nPSA 116:0-2 = PSA 117:0-2\nPSA 117:0-29 = PSA 118:0-29\nPSA 118:0-176 = PSA 119:0-176\nPSA 119:0-7 = PSA 120:0-7\nPSA 120:0-8 = PSA 121:0-8\nPSA 121:0-9 = PSA 122:0-9\nPSA 122:0-4 = PSA 123:0-4\nPSA 123:0-8 = PSA 124:0-8\nPSA 124:0-5 = PSA 125:0-5\nPSA 125:0-6 = PSA 126:0-6\nPSA 126:0-5 = PSA 127:0-5\nPSA 127:0-6 = PSA 128:0-6\nPSA 128:0-8 = PSA 129:0-8\nPSA 129:0-8 = PSA 130:0-8\nPSA 130:0-3 = PSA 131:0-3\nPSA 131:0-18 = PSA 132:0-18\nPSA 132:0-3 = PSA 133:0-3\nPSA 133:0-3 = PSA 134:0-3\nPSA 134:0-21 = PSA 135:0-21\nPSA 135:0-26 = PSA 136:0-26\nPSA 136:0-9 = PSA 137:0-9\nPSA 137:0-8 = PSA 138:0-8\nPSA 138:0-24 = PSA 139:0-24\nPSA 139:0-14 = PSA 140:0-14\nPSA 140:0-10 = PSA 141:0-10\nPSA 141:0-8 = PSA 142:0-8\nPSA 142:0-12 = PSA 143:0-12\nPSA 143:0-15 = PSA 144:0-15\nPSA 144:0-21 = PSA 145:0-21\nPSA 145:0-10 = PSA 146:0-10\n# 146 + 147 -> 147\nPSA 146:0-11 = PSA 147:0-11\nPSA 147:0 = PSA 147:12\nPSA 147:1-9 = PSA 147:12-20\n# PSA 151 -> PS2\nPSA 151:0-7 = PS2 1:0-7\n#\n# Jeremiah according to Rahlfs\n# Added by SS 25.3.2003\n#\n# JER 1-25:13 = JER 1-25:13\n# JER 25:14 = part of JER 49:34\n# JER 25:20 = part of JER 49:34\n# JER 52 = JER 52\n#\nJER 25:14-19 = JER 49:34-39\nJER 25:20 = JER 49:34\nJER 26:1-28 = JER 46:1-28\nJER 27:1-46 = JER 50:1-46\nJER 28:1-64 = JER 51:1-64\nJER 29:1-7 = JER 47:1-7\nJER 30:1-16 = JER 49:7-22\nJER 30:17-22 = JER 49:1-6\nJER 30:23-28 = JER 49:28-33\nJER 30:29-33 = JER 49:23-27\nJER 31:1-44 = JER 48:1-44\n# Verses 31:1-13 do not exist\nJER 32:13 = JER 25:13\n# Verse 32:14 does not exist\nJER 32:15-38 = JER 25:15-38\nJER 33:1-24 = JER 26:1-24\nJER 34:1-22 = JER 27:1-22\nJER 35:1-17 = JER 28:1-17\nJER 36:1-32 = JER 29:1-32\nJER 37:1-24 = JER 30:1-24\nJER 38:1-40 = JER 31:1-40\nJER 39:1-44 = JER 32:1-44\nJER 40:1-13 = JER 33:1-13\nJER 41:1-22 = JER 34:1-22\nJER 42:1-19 = JER 35:1-19\nJER 43:1-32 = JER 36:1-32\nJER 44:1-21 = JER 37:1-21\nJER 45:1-28 = JER 38:1-28\nJER 46:1-3 = JER 39:1-3\n# Verses 46:4-13 do not exist\nJER 46:14-18 = JER 39:14-18\nJER 47:1-16 = JER 40:1-16\nJER 48:1-18 = JER 41:1-18\nJER 49:1-22 = JER 42:1-22\nJER 50:1-13 = JER 43:1-13\nJER 51:1-30 = JER 44:1-30\nJER 51:31-35 = JER 45:1-5\n#\n# Map The Greek versioin of Daniel onto the Hebrew version of Daniel\n# using the Hebrew version as the reference point.\n# Normally DC material would not have any entries in this part of the lxx.vrs file\n# because the LXX serves as the reference point for DC material.\n# Material which is placed in separate books in HEB and LXX (i.e. DAN and DAG)\n# is however placed here and referenced to the HEB reference point.\n#\n# If you have a text in which the DAG material has been (incorrectly) placed into DAN\n# you must create a versification file in which DAN appears as the first book in \n# the following section. You cannot have both DAN = DAN and DAG = DAN entries\n# in a single file.\nDAG 1:1-21 = DAN 1:1-21\nDAG 2:1-49 = DAN 2:1-49\nDAG 3:1-23 = DAN 3:1-23\nDAG 3:91-97 = DAN 3:24-30\nDAG 4:1-3 = DAN 3:31-33\nDAG 4:4-37 = DAN 4:1-34\nDAG 5:1-31 = DAN 5:1-31\nDAG 6:1-28 = DAN 6:1-28\nDAG 7:1-28 = DAN 7:1-28\nDAG 8:1-27 = DAN 8:1-27\nDAG 9:1-27 = DAN 9:1-27\nDAG 10:1-21 = DAN 10:1-21\nDAG 11:1-45 = DAN 11:1-45 \nDAG 12:1-13 = DAN 12:1-13\n#\n# No entries present for S3Y because this book would not normally be present in a text based\n# on the LXX versification. The S3Y material would instead start at DAG 3:24.\n#\n# When Ezra-Nehemiah is one book Ezra 11-23 maps onto Nehemiah\n# LXX mapping onto BHS\nEZR 11:1-11 = NEH 1:1-11\nEZR 12:1-20 = NEH 2:1-20\nEZR 13:1-38 = NEH 3:1-38\nEZR 14:1-17 = NEH 4:1-17\nEZR 15:1-19 = NEH 5:1-19\nEZR 16:1-19 = NEH 6:1-19\nEZR 17:1-72 = NEH 7:1-72\nEZR 18:1-18 = NEH 8:1-18\nEZR 19:1-37 = NEH 9:1-37\nEZR 20:1-40 = NEH 10:1-40\nEZR 21:1-36 = NEH 11:1-36\nEZR 22:1-47 = NEH 12:1-47\nEZR 23:1-31 = NEH 13:1-31\n#---------------------------\n# Mapping 2 Esdras onto the older Apocalypse of Ezra [Studge]\n2ES 3:1-36 = EZA 1:1-36\n2ES 4:1-52 = EZA 2:1-52\n2ES 5:1-56 = EZA 3:1-56\n2ES 6:1-59 = EZA 4:1-59\n2ES 7:1-35 = EZA 5:1-35\n2ES 7:106-140 = EZA 5:36-70\n2ES 8:1-63 = EZA 6:1-63\n2ES 9:1-47 = EZA 7:1-47\n2ES 10:1-60 = EZA 8:1-60\n2ES 11:1-46 = EZA 9:1-46\n2ES 12:1-51 = EZA 10:1-51\n2ES 13:1-58 = EZA 11:1-58\n2ES 14:1-48 = EZA 12:1-48\n#----------------------------\n# Some texts (but not LXX) contain SUS and BEL as chapters 13 and 14 of DAG.\n# There should not be any entries for DAG 13 and DAG 14 in the lxx.vrs because these chapters do not \n# exist in the LXX.\n# If you have a text which has DAG 13 and 14 you will need to have a .vrs file that includes the following\n# two mapping.\n#\n# Susanna\n# DAG 13:1-63 = SUS 1:1-63\n# Bel and the Dragon\n# DAG 14:1-42 = BEL 1:1-42\n#\n#----------------------------\n# Verse segment information for the Septuagint.\n# The verse segment information is preceded by a '#!' so that it will be ignored by versions \n# of Paratext prior to Paratext 7.3 (and thus avoid crashing it with an unexpected format). \n#! *EXO 28:29,-,a \n#! *EXO 35:12,-,a \n#! *JOS 9:2,-,a,b,c,d,e,f \n#! *JOS 15:59,-,a \n#! *JOS 19:47,-,a \n#! *JOS 19:48,-,a \n#! *JOS 21:42,-,a,b,c,d \n#! *JOS 24:31,-,a \n#! *JOS 24:33,-,a,b \n#! *1SA 30:28,-,a \n#! *2SA 5:16,-,a \n#! *1KI 2:35,-,a,b,c,d,e,f,g,h,i,k,l,m,n,o \n#! *1KI 2:46,-,a,b,c,d,e,f,g,h,i,k,l \n#! *1KI 5:14,-,a,b \n#! *1KI 6:1,-,a,b,c,d \n#! *1KI 6:36,-,a \n#! *1KI 8:53,-,a \n#! *1KI 9:9,-,a \n#! *1KI 10:22,-,a,b,c \n#! *1KI 10:26,-,a \n#! *1KI 12:24,-,a,b,c,d,e,f,g,h,i,k,l,m,n,o,p,q,r,s,t,u,x,y,z \n#! *1KI 16:28,-,a,b,c,d,e,f,g,h \n#! *2KI 1:18,-,a,b,c,d \n#! *2CH 35:19,-,a,b,c,d \n#! *2CH 36:2,-,a,b,c \n#! *2CH 36:4,-,a \n#! *2CH 36:5,-,a,b,c,d \n#! *JOB 2:9,-,a,b,c,d,e \n#! *JOB 19:4,-,a \n#! *JOB 23:15,-,a \n#! *JOB 36:28,-,a,b \n#! *JOB 42:17,-,a,b,c,d,e \n#! *PSA 144:13,-,a \n#! *PRO 3:16,-,a \n#! *PRO 3:22,-,a \n#! *PRO 4:27,-,a,b \n#! *PRO 6:8,-,a,b,c \n#! *PRO 6:11,-,a \n#! *PRO 7:1,-,a \n#! *PRO 8:21,-,a \n#! *PRO 9:10,-,a \n#! *PRO 9:12,-,a,b,c \n#! *PRO 9:18,-,a,b,c,d \n#! *PRO 10:4,-,a \n#! *PRO 12:11,-,a \n#! *PRO 12:13,-,a \n#! *PRO 13:9,-,a \n#! *PRO 13:13,-,a \n#! *PRO 15:18,-,a \n#! *PRO 15:27,-,a \n#! *PRO 15:28,-,a \n#! *PRO 15:29,-,a,b \n#! *PRO 17:6,-,a \n#! *PRO 17:16,-,a \n#! *PRO 18:22,-,a \n#! *PRO 20:9,-,a,b,c \n#! *PRO 22:8,-,a \n#! *PRO 22:9,-,a \n#! *PRO 22:14,-,a \n#! *PRO 24:22,-,a,b,c,d,e \n#! *PRO 25:10,-,a \n#! *PRO 25:20,-,a \n#! *PRO 26:11,-,a \n#! *PRO 27:20,-,a \n#! *PRO 27:21,-,a \n#! *PRO 28:17,-,a \n#! *ESG 1:1,-,b,c,d,e,f,g,h,i,k,l,m,n,o,p,q,r,s \n#! *ESG 3:13,-,a,b,c,d,e,f,g \n#! *ESG 4:17,-,a,b,c,d,e,f,g,h,i,k,l,m,n,o,p,q,r,s,t,u,w,x,y,z \n#! *ESG 5:1,-,a,b,c,d,e,f \n#! *ESG 5:2,-,a,b \n#! *ESG 8:12,-,a,b,c,d,e,f,g,h,i,k,l,m,n,o,p,q,r,s,t,u,x \n#! *ESG 10:3,-,a,b,c,d,e,f,g,h,i,k,l \n#! *SIR 1:1,-,a,b,c,d,e,f,g,h \n"},org:{raw:'# Versification "Original" \n# Version=1.200\n# (not a very good name but I have not heard a better suggestion)\n#\n# modifications by Studge 26/June/2009\n#\n# BHS versification for OT, UBS GNT versification for NT\n# following the Masoretic order\n# OT translations using Masorteic verse structures should map onto this text\n# NT versifications maps onto Nestle-Aland\n#\n# List of books, chapters, verses\n# One line per book.\n# One entry for each chapter.\n# Verse number is the maximum verse number for that chapter.\n# See the lines containing =\'s below for verse mappings.\n#\n#---------------------------------------------------------------\n# Old Testament\nGEN 1:31 2:25 3:24 4:26 5:32 6:22 7:24 8:22 9:29 10:32 11:32 12:20 13:18 14:24 15:21 16:16 17:27 18:33 19:38 20:18 21:34 22:24 23:20 24:67 25:34 26:35 27:46 28:22 29:35 30:43 31:54 32:33 33:20 34:31 35:29 36:43 37:36 38:30 39:23 40:23 41:57 42:38 43:34 44:34 45:28 46:34 47:31 48:22 49:33 50:26\nEXO 1:22 2:25 3:22 4:31 5:23 6:30 7:29 8:28 9:35 10:29 11:10 12:51 13:22 14:31 15:27 16:36 17:16 18:27 19:25 20:26 21:37 22:30 23:33 24:18 25:40 26:37 27:21 28:43 29:46 30:38 31:18 32:35 33:23 34:35 35:35 36:38 37:29 38:31 39:43 40:38\nLEV 1:17 2:16 3:17 4:35 5:26 6:23 7:38 8:36 9:24 10:20 11:47 12:8 13:59 14:57 15:33 16:34 17:16 18:30 19:37 20:27 21:24 22:33 23:44 24:23 25:55 26:46 27:34\nNUM 1:54 2:34 3:51 4:49 5:31 6:27 7:89 8:26 9:23 10:36 11:35 12:16 13:33 14:45 15:41 16:35 17:28 18:32 19:22 20:29 21:35 22:41 23:30 24:25 25:19 26:65 27:23 28:31 29:39 30:17 31:54 32:42 33:56 34:29 35:34 36:13\nDEU 1:46 2:37 3:29 4:49 5:33 6:25 7:26 8:20 9:29 10:22 11:32 12:31 13:19 14:29 15:23 16:22 17:20 18:22 19:21 20:20 21:23 22:29 23:26 24:22 25:19 26:19 27:26 28:69 29:28 30:20 31:30 32:52 33:29 34:12\nJOS 1:18 2:24 3:17 4:24 5:15 6:27 7:26 8:35 9:27 10:43 11:23 12:24 13:33 14:15 15:63 16:10 17:18 18:28 19:51 20:9 21:45 22:34 23:16 24:33\nJDG 1:36 2:23 3:31 4:24 5:31 6:40 7:25 8:35 9:57 10:18 11:40 12:15 13:25 14:20 15:20 16:31 17:13 18:31 19:30 20:48 21:25\nRUT 1:22 2:23 3:18 4:22\n1SA 1:28 2:36 3:21 4:22 5:12 6:21 7:17 8:22 9:27 10:27 11:15 12:25 13:23 14:52 15:35 16:23 17:58 18:30 19:24 20:42 21:16 22:23 23:28 24:23 25:44 26:25 27:12 28:25 29:11 30:31 31:13\n2SA 1:27 2:32 3:39 4:12 5:25 6:23 7:29 8:18 9:13 10:19 11:27 12:31 13:39 14:33 15:37 16:23 17:29 18:32 19:44 20:26 21:22 22:51 23:39 24:25\n1KI 1:53 2:46 3:28 4:20 5:32 6:38 7:51 8:66 9:28 10:29 11:43 12:33 13:34 14:31 15:34 16:34 17:24 18:46 19:21 20:43 21:29 22:54\n2KI 1:18 2:25 3:27 4:44 5:27 6:33 7:20 8:29 9:37 10:36 11:20 12:22 13:25 14:29 15:38 16:20 17:41 18:37 19:37 20:21 21:26 22:20 23:37 24:20 25:30\n1CH 1:54 2:55 3:24 4:43 5:41 6:66 7:40 8:40 9:44 10:14 11:47 12:41 13:14 14:17 15:29 16:43 17:27 18:17 19:19 20:8 21:30 22:19 23:32 24:31 25:31 26:32 27:34 28:21 29:30\n2CH 1:18 2:17 3:17 4:22 5:14 6:42 7:22 8:18 9:31 10:19 11:23 12:16 13:23 14:14 15:19 16:14 17:19 18:34 19:11 20:37 21:20 22:12 23:21 24:27 25:28 26:23 27:9 28:27 29:36 30:27 31:21 32:33 33:25 34:33 35:27 36:23\nEZR 1:11 2:70 3:13 4:24 5:17 6:22 7:28 8:36 9:15 10:44\nNEH 1:11 2:20 3:38 4:17 5:19 6:19 7:72 8:18 9:37 10:40 11:36 12:47 13:31\nEST 1:22 2:23 3:15 4:17 5:14 6:14 7:10 8:17 9:32 10:3\nJOB 1:22 2:13 3:26 4:21 5:27 6:30 7:21 8:22 9:35 10:22 11:20 12:25 13:28 14:22 15:35 16:22 17:16 18:21 19:29 20:29 21:34 22:30 23:17 24:25 25:6 26:14 27:23 28:28 29:25 30:31 31:40 32:22 33:33 34:37 35:16 36:33 37:24 38:41 39:30 40:32 41:26 42:17\nPSA 1:6 2:12 3:9 4:9 5:13 6:11 7:18 8:10 9:21 10:18 11:7 12:9 13:6 14:7 15:5 16:11 17:15 18:51 19:15 20:10 21:14 22:32 23:6 24:10 25:22 26:12 27:14 28:9 29:11 30:13 31:25 32:11 33:22 34:23 35:28 36:13 37:40 38:23 39:14 40:18 41:14 42:12 43:5 44:27 45:18 46:12 47:10 48:15 49:21 50:23 51:21 52:11 53:7 54:9 55:24 56:14 57:12 58:12 59:18 60:14 61:9 62:13 63:12 64:11 65:14 66:20 67:8 68:36 69:37 70:6 71:24 72:20 73:28 74:23 75:11 76:13 77:21 78:72 79:13 80:20 81:17 82:8 83:19 84:13 85:14 86:17 87:7 88:19 89:53 90:17 91:16 92:16 93:5 94:23 95:11 96:13 97:12 98:9 99:9 100:5 101:8 102:29 103:22 104:35 105:45 106:48 107:43 108:14 109:31 110:7 111:10 112:10 113:9 114:8 115:18 116:19 117:2 118:29 119:176 120:7 121:8 122:9 123:4 124:8 125:5 126:6 127:5 128:6 129:8 130:8 131:3 132:18 133:3 134:3 135:21 136:26 137:9 138:8 139:24 140:14 141:10 142:8 143:12 144:15 145:21 146:10 147:20 148:14 149:9 150:6\nPRO 1:33 2:22 3:35 4:27 5:23 6:35 7:27 8:36 9:18 10:32 11:31 12:28 13:25 14:35 15:33 16:33 17:28 18:24 19:29 20:30 21:31 22:29 23:35 24:34 25:28 26:28 27:27 28:28 29:27 30:33 31:31\nECC 1:18 2:26 3:22 4:17 5:19 6:12 7:29 8:17 9:18 10:20 11:10 12:14\nSNG 1:17 2:17 3:11 4:16 5:16 6:12 7:14 8:14\nISA 1:31 2:22 3:26 4:6 5:30 6:13 7:25 8:23 9:20 10:34 11:16 12:6 13:22 14:32 15:9 16:14 17:14 18:7 19:25 20:6 21:17 22:25 23:18 24:23 25:12 26:21 27:13 28:29 29:24 30:33 31:9 32:20 33:24 34:17 35:10 36:22 37:38 38:22 39:8 40:31 41:29 42:25 43:28 44:28 45:25 46:13 47:15 48:22 49:26 50:11 51:23 52:15 53:12 54:17 55:13 56:12 57:21 58:14 59:21 60:22 61:11 62:12 63:19 64:11 65:25 66:24\nJER 1:19 2:37 3:25 4:31 5:31 6:30 7:34 8:23 9:25 10:25 11:23 12:17 13:27 14:22 15:21 16:21 17:27 18:23 19:15 20:18 21:14 22:30 23:40 24:10 25:38 26:24 27:22 28:17 29:32 30:24 31:40 32:44 33:26 34:22 35:19 36:32 37:21 38:28 39:18 40:16 41:18 42:22 43:13 44:30 45:5 46:28 47:7 48:47 49:39 50:46 51:64 52:34\nLAM 1:22 2:22 3:66 4:22 5:22\nEZK 1:28 2:10 3:27 4:17 5:17 6:14 7:27 8:18 9:11 10:22 11:25 12:28 13:23 14:23 15:8 16:63 17:24 18:32 19:14 20:44 21:37 22:31 23:49 24:27 25:17 26:21 27:36 28:26 29:21 30:26 31:18 32:32 33:33 34:31 35:15 36:38 37:28 38:23 39:29 40:49 41:26 42:20 43:27 44:31 45:25 46:24 47:23 48:35\nDAN 1:21 2:49 3:33 4:34 5:30 6:29 7:28 8:27 9:27 10:21 11:45 12:13\nHOS 1:9 2:25 3:5 4:19 5:15 6:11 7:16 8:14 9:17 10:15 11:11 12:15 13:15 14:10\nJOL 1:20 2:27 3:5 4:21\nAMO 1:15 2:16 3:15 4:13 5:27 6:14 7:17 8:14 9:15\nOBA 1:21\nJON 1:16 2:11 3:10 4:11\nMIC 1:16 2:13 3:12 4:14 5:14 6:16 7:20\nNAM 1:14 2:14 3:19\nHAB 1:17 2:20 3:19\nZEP 1:18 2:15 3:20\nHAG 1:15 2:23\nZEC 1:17 2:17 3:10 4:14 5:11 6:15 7:14 8:23 9:17 10:12 11:17 12:14 13:9 14:21\nMAL 1:14 2:17 3:24\n#---------------------------------------------------------\n# New Testament books\nMAT 1:25 2:23 3:17 4:25 5:48 6:34 7:29 8:34 9:38 10:42 11:30 12:50 13:58 14:36 15:39 16:28 17:27 18:35 19:30 20:34 21:46 22:46 23:39 24:51 25:46 26:75 27:66 28:20\nMRK 1:45 2:28 3:35 4:41 5:43 6:56 7:37 8:38 9:50 10:52 11:33 12:44 13:37 14:72 15:47 16:20\nLUK 1:80 2:52 3:38 4:44 5:39 6:49 7:50 8:56 9:62 10:42 11:54 12:59 13:35 14:35 15:32 16:31 17:37 18:43 19:48 20:47 21:38 22:71 23:56 24:53\nJHN 1:51 2:25 3:36 4:54 5:47 6:71 7:53 8:59 9:41 10:42 11:57 12:50 13:38 14:31 15:27 16:33 17:26 18:40 19:42 20:31 21:25\nACT 1:26 2:47 3:26 4:37 5:42 6:15 7:60 8:40 9:43 10:48 11:30 12:25 13:52 14:28 15:41 16:40 17:34 18:28 19:40 20:38 21:40 22:30 23:35 24:27 25:27 26:32 27:44 28:31\nROM 1:32 2:29 3:31 4:25 5:21 6:23 7:25 8:39 9:33 10:21 11:36 12:21 13:14 14:23 15:33 16:27\n1CO 1:31 2:16 3:23 4:21 5:13 6:20 7:40 8:13 9:27 10:33 11:34 12:31 13:13 14:40 15:58 16:24\n2CO 1:24 2:17 3:18 4:18 5:21 6:18 7:16 8:24 9:15 10:18 11:33 12:21 13:13\nGAL 1:24 2:21 3:29 4:31 5:26 6:18\nEPH 1:23 2:22 3:21 4:32 5:33 6:24\nPHP 1:30 2:30 3:21 4:23\nCOL 1:29 2:23 3:25 4:18\n1TH 1:10 2:20 3:13 4:18 5:28\n2TH 1:12 2:17 3:18\n1TI 1:20 2:15 3:16 4:16 5:25 6:21\n2TI 1:18 2:26 3:17 4:22\nTIT 1:16 2:15 3:15\nPHM 1:25\nHEB 1:14 2:18 3:19 4:16 5:14 6:20 7:28 8:13 9:28 10:39 11:40 12:29 13:25\nJAS 1:27 2:26 3:18 4:17 5:20\n1PE 1:25 2:25 3:22 4:19 5:14\n2PE 1:21 2:22 3:18\n1JN 1:10 2:29 3:24 4:21 5:21\n2JN 1:13\n3JN 1:15\nJUD 1:25\nREV 1:20 2:29 3:22 4:11 5:14 6:17 7:17 8:13 9:21 10:11 11:19 12:18 13:18 14:20 15:8 16:21 17:18 18:24 19:21 20:15 21:27 22:21\n#------------------------------------------------\n# Deuterocanonical books from the LXX which are in the Catholic tradition\nTOB 1:22 2:14 3:17 4:21 5:23 6:19 7:17 8:21 9:6 10:14 11:19 12:22 13:18 14:15\nJDT 1:16 2:28 3:10 4:15 5:24 6:21 7:32 8:36 9:14 10:23 11:23 12:20 13:20 14:19 15:14 16:25\nESG 1:39 2:23 3:22 4:47 5:28 6:14 7:10 8:39 9:32 10:13\nWIS 1:16 2:24 3:19 4:20 5:23 6:25 7:30 8:21 9:18 10:21 11:26 12:27 13:19 14:31 15:19 16:29 17:20 18:25 19:22\nSIR 1:30 2:18 3:31 4:31 5:15 6:37 7:36 8:19 9:18 10:31 11:34 12:18 13:26 14:27 15:20 16:30 17:32 18:33 19:30 20:31 21:28 22:27 23:27 24:34 25:26 26:29 27:30 28:26 29:28 30:25 31:31 32:24 33:33 34:26 35:24 36:27 37:31 38:34 39:35 40:30 41:27 42:25 43:33 44:23 45:26 46:20 47:25 48:25 49:16 50:29 51:30\nBAR 1:22 2:35 3:38 4:37 5:9\nLJE 1:72\nS3Y 1:67\nSUS 1:64\nBEL 1:42\n1MA 1:64 2:70 3:60 4:61 5:68 6:63 7:50 8:32 9:73 10:89 11:74 12:53 13:53 14:49 15:41 16:24\n2MA 1:36 2:32 3:40 4:50 5:27 6:31 7:42 8:36 9:29 10:38 11:38 12:45 13:26 14:46 15:39\n#---------------------------------------------------\n# Additional Orthodox books from the LXX\n3MA 1:29 2:33 3:30 4:21 5:51 6:41 7:23\n4MA 1:35 2:24 3:21 4:26 5:38 6:35 7:23 8:29 9:32 10:21 11:27 12:19 13:27 14:20 15:32 16:25 17:24 18:24\n1ES 1:55 2:26 3:24 4:63 5:71 6:33 7:15 8:92 9:55\n# This was the wrong definition for 2ES\n# 2ES 1:11 2:70 3:13 4:24 5:17 6:22 7:28 8:36 9:15 10:44 11:11 12:20 13:37 14:17 15:19 16:19 17:73 18:18 19:37 20:40 21:36 22:47 23:31\n# This is the correct definition of 2ES, the "original" book was EZA\n2ES 1:40 2:48 3:36 4:52 5:56 6:59 7:140 8:63 9:47 10:59 11:46 12:51 13:58 14:48 15:63 16:78\nMAN 1:15\nPS2 1:7\n#-------------------------------------------------------\n# ODA and PSS are only in the LXX and SYR projects. \nODA 1:19 2:43 3:10 4:19 5:12 6:8 7:20 8:37 9:22 10:9 11:11 12:15 13:4 14:46\nPSS 1:8 2:37 3:12 4:25 5:19 6:6 7:10 8:34 9:11 10:8 11:9 12:6 13:12 14:10 15:13 16:15 17:46 18:12\n#-------------------------------------------------------\n# the following codes are for obselete LXX variants only in LXX and not supported in PT 7\nJSA 1:18 2:24 3:17 4:24 5:15 6:27 7:26 8:35 9:27 10:43 11:23 12:24 13:33 14:15 15:63 16:10 17:18 18:28 19:51 20:9 21:45 22:34 23:16 24:33\nJDB 1:36 2:23 3:31 4:24 5:31 6:40 7:25 8:35 9:57 10:18 11:40 12:15 13:25 14:20 15:20 16:31 17:13 18:31 19:30 20:48 21:25\nTBS 1:22 2:14 3:17 4:21 5:23 6:19 7:17 8:21 9:6 10:14 11:19 12:22 13:18 14:15\nSST 1:64\nDNT 1:21 2:49 3:97 4:37 5:30 6:29 7:28 8:27 9:27 10:21 11:45 12:13\nBLT 1:42\n#\n# No mappings are present for this versification since it represents\n# the "standard" versification to which all OT and NT texts are mapped in these files.\n# (DC texts follow the LXX)\n#\n#-------------------------------------------------------\n# Apocalypse of Ezra [Studge]\nEZA 1:36 2:52 3:56 4:59 5:139 6:63 7:47 8:60 9:46 10:51 11:58 12:48\n#--------------------------------------------------------\n# Jubilees and Enoch have both been found in the Hebrew [Studge]\n# might be needed if we add Dead Sea Scrolls\n# Jubilees (Ethiopian canon)\nJUB 1:26 2:17 3:19 4:24 5:36 6:34 7:37 8:40 9:27 10:48 11:39 12:56 13:34 14:55 15:20 16:28 17:30 18:31 19:59 20:66 21:30 22:38 23:59 24:30 25:50 26:48 27:37 28:38 29:27 30:29 31:31 32:24 33:30 34:20\n# Enoch (Ethiopian canon)\nENO 1:28 2:42 3:30 4:88 5:40 6:42 7:39 8:46 9:42 10:16 11:19 12:40 13:34 14:35 15:45 16:41 17:69 18:42 19:29 20:53 21:57 22:14 23:26 24:16 25:30 26:37 27:21 28:34 29:28 30:23 31:29 32:82 33:59 34:49 35:36 36:30 37:34 38:36 39:24 40:40 41:22 42:16\n#\n# S3Y is a small section of the DAG LXX pulled out and translated as a separate book.\n# Map it back to the LXX. This section allow\'s texts such as TOB (French) which do\n# this to scroll correctly with the LXX.\n# S3Y is not present in the GRK, HEB, or LXX(Ralphs) text.\n# If a text has DAG present, this section must NOT be included in its versification file because\n# that would cause references in other texts to DAG to be redirected to a non-existant S3Y.\nS3Y 1:1-29 = DAG 3:24-52\nS3Y 1:30-31 = DAG 3:52-53\nS3Y 1:33 = DAG 3:54\nS3Y 1:32 = DAG 3:55\nS3Y 1:34-35 = DAG 3:56-57\nS3Y 1:37 = DAG 3:58\nS3Y 1:36 = DAG 3:59\nS3Y 1:38-68 = DAG 3:60-90\n'},rsc:{raw:'# Versification "Russian Protestant"\n# Version=1.4\n#\n# This is the versification used by the "Canonical" (Protestant) edition of the Russian Synodal Bible\n# Initial version provided by Peter_Kirk@sil.org\n# Corrected 27/May/2003 by matjaz.crnivec@drustvo-svds.si:\n# Number of vss: ISA 3; REV 12\n# Mappings: LEV 14; 1KI 22; 1CH 12; NEH 7; ISA 3; 2CO 11; REV 13\n#\n# List of books, chapters, verses\n# One line per book.\n# One entry for each chapter.\n# Verse number is the maximum verse number for that chapter.\n# See the lines containing =\'s below for verse mappings.\n#\n#------------------------------------------------------------\n# Old Testament\nGEN 1:31 2:25 3:24 4:26 5:32 6:22 7:24 8:22 9:29 10:32 11:32 12:20 13:18 14:24 15:21 16:16 17:27 18:33 19:38 20:18 21:34 22:24 23:20 24:67 25:34 26:35 27:46 28:22 29:35 30:43 31:55 32:32 33:20 34:31 35:29 36:43 37:36 38:30 39:23 40:23 41:57 42:38 43:34 44:34 45:28 46:34 47:31 48:22 49:33 50:26\nEXO 1:22 2:25 3:22 4:31 5:23 6:30 7:25 8:32 9:35 10:29 11:10 12:51 13:22 14:31 15:27 16:36 17:16 18:27 19:25 20:26 21:36 22:31 23:33 24:18 25:40 26:37 27:21 28:43 29:46 30:38 31:18 32:35 33:23 34:35 35:35 36:38 37:29 38:31 39:43 40:38\nLEV 1:17 2:16 3:17 4:35 5:19 6:30 7:38 8:36 9:24 10:20 11:47 12:8 13:59 14:56 15:33 16:34 17:16 18:30 19:37 20:27 21:24 22:33 23:44 24:23 25:55 26:46 27:34\nNUM 1:54 2:34 3:51 4:49 5:31 6:27 7:89 8:26 9:23 10:36 11:35 12:15 13:34 14:45 15:41 16:50 17:13 18:32 19:22 20:29 21:35 22:41 23:30 24:25 25:18 26:65 27:23 28:31 29:39 30:17 31:54 32:42 33:56 34:29 35:34 36:13\nDEU 1:46 2:37 3:29 4:49 5:33 6:25 7:26 8:20 9:29 10:22 11:32 12:32 13:18 14:29 15:23 16:22 17:20 18:22 19:21 20:20 21:23 22:30 23:25 24:22 25:19 26:19 27:26 28:68 29:29 30:20 31:30 32:52 33:29 34:12\nJOS 1:18 2:24 3:17 4:24 5:16 6:26 7:26 8:35 9:27 10:43 11:23 12:24 13:33 14:15 15:63 16:10 17:18 18:28 19:51 20:9 21:45 22:34 23:16 24:33\nJDG 1:36 2:23 3:31 4:24 5:31 6:40 7:25 8:35 9:57 10:18 11:40 12:15 13:25 14:20 15:20 16:31 17:13 18:31 19:30 20:48 21:25\nRUT 1:22 2:23 3:18 4:22\n1SA 1:28 2:36 3:21 4:22 5:12 6:21 7:17 8:22 9:27 10:27 11:15 12:25 13:23 14:52 15:35 16:23 17:58 18:30 19:24 20:43 21:15 22:23 23:28 24:23 25:44 26:25 27:12 28:25 29:11 30:31 31:13\n2SA 1:27 2:32 3:39 4:12 5:25 6:23 7:29 8:18 9:13 10:19 11:27 12:31 13:39 14:33 15:37 16:23 17:29 18:33 19:43 20:26 21:22 22:51 23:39 24:25\n1KI 1:53 2:46 3:28 4:34 5:18 6:38 7:51 8:66 9:28 10:29 11:43 12:33 13:34 14:31 15:34 16:34 17:24 18:46 19:21 20:43 21:29 22:53\n2KI 1:18 2:25 3:27 4:44 5:27 6:33 7:20 8:29 9:37 10:36 11:21 12:21 13:25 14:29 15:38 16:20 17:41 18:37 19:37 20:21 21:26 22:20 23:37 24:20 25:30\n1CH 1:54 2:55 3:24 4:43 5:26 6:81 7:40 8:40 9:44 10:14 11:47 12:40 13:14 14:17 15:29 16:43 17:27 18:17 19:19 20:8 21:30 22:19 23:32 24:31 25:31 26:32 27:34 28:21 29:30\n2CH 1:17 2:18 3:17 4:22 5:14 6:42 7:22 8:18 9:31 10:19 11:23 12:16 13:22 14:15 15:19 16:14 17:19 18:34 19:11 20:37 21:20 22:12 23:21 24:27 25:28 26:23 27:9 28:27 29:36 30:27 31:21 32:33 33:25 34:33 35:27 36:23\nEZR 1:11 2:70 3:13 4:24 5:17 6:22 7:28 8:36 9:15 10:44\nNEH 1:11 2:20 3:32 4:23 5:19 6:19 7:73 8:18 9:38 10:39 11:36 12:47 13:31\nEST 1:22 2:23 3:15 4:17 5:14 6:14 7:10 8:17 9:32 10:3\nJOB 1:22 2:13 3:26 4:21 5:27 6:30 7:21 8:22 9:35 10:22 11:20 12:25 13:28 14:22 15:35 16:22 17:16 18:21 19:29 20:29 21:34 22:30 23:17 24:25 25:6 26:14 27:23 28:28 29:25 30:31 31:40 32:22 33:33 34:37 35:16 36:33 37:24 38:41 39:35 40:27 41:26 42:17\nPSA 1:6 2:12 3:9 4:9 5:13 6:11 7:18 8:10 9:39 10:7 11:9 12:6 13:7 14:5 15:11 16:15 17:51 18:15 19:10 20:14 21:32 22:6 23:10 24:22 25:12 26:14 27:9 28:11 29:13 30:25 31:11 32:22 33:23 34:28 35:13 36:40 37:23 38:14 39:18 40:14 41:12 42:5 43:27 44:18 45:12 46:10 47:15 48:21 49:23 50:21 51:11 52:7 53:9 54:24 55:14 56:12 57:12 58:18 59:14 60:9 61:13 62:12 63:11 64:14 65:20 66:8 67:36 68:37 69:6 70:24 71:20 72:28 73:23 74:11 75:13 76:21 77:72 78:13 79:20 80:17 81:8 82:19 83:13 84:14 85:17 86:7 87:19 88:53 89:17 90:16 91:16 92:5 93:23 94:11 95:13 96:12 97:9 98:9 99:5 100:8 101:29 102:22 103:35 104:45 105:48 106:43 107:14 108:31 109:7 110:10 111:10 112:9 113:26 114:9 115:10 116:2 117:29 118:176 119:7 120:8 121:9 122:4 123:8 124:5 125:6 126:5 127:6 128:8 129:8 130:3 131:18 132:3 133:3 134:21 135:26 136:9 137:8 138:24 139:14 140:10 141:7 142:12 143:15 144:21 145:10 146:11 147:9 148:14 149:9 150:6\nPRO 1:33 2:22 3:35 4:27 5:23 6:35 7:27 8:36 9:18 10:32 11:31 12:28 13:25 14:35 15:33 16:33 17:28 18:24 19:29 20:30 21:31 22:29 23:35 24:34 25:28 26:28 27:27 28:28 29:27 30:33 31:31\nECC 1:18 2:26 3:22 4:17 5:19 6:12 7:29 8:17 9:18 10:20 11:10 12:14\nSNG 1:16 2:17 3:11 4:16 5:16 6:12 7:14 8:14\nISA 1:31 2:22 3:25 4:6 5:30 6:13 7:25 8:22 9:21 10:34 11:16 12:6 13:22 14:32 15:9 16:14 17:14 18:7 19:25 20:6 21:17 22:25 23:18 24:23 25:12 26:21 27:13 28:29 29:24 30:33 31:9 32:20 33:24 34:17 35:10 36:22 37:38 38:22 39:8 40:31 41:29 42:25 43:28 44:28 45:25 46:13 47:15 48:22 49:26 50:11 51:23 52:15 53:12 54:17 55:13 56:12 57:21 58:14 59:21 60:22 61:11 62:12 63:19 64:12 65:25 66:24\nJER 1:19 2:37 3:25 4:31 5:31 6:30 7:34 8:22 9:26 10:25 11:23 12:17 13:27 14:22 15:21 16:21 17:27 18:23 19:15 20:18 21:14 22:30 23:40 24:10 25:38 26:24 27:22 28:17 29:32 30:24 31:40 32:44 33:26 34:22 35:19 36:32 37:21 38:28 39:18 40:16 41:18 42:22 43:13 44:30 45:5 46:28 47:7 48:47 49:39 50:46 51:64 52:34\nLAM 1:22 2:22 3:66 4:22 5:22\nEZK 1:28 2:10 3:27 4:17 5:17 6:14 7:27 8:18 9:11 10:22 11:25 12:28 13:23 14:23 15:8 16:63 17:24 18:32 19:14 20:49 21:32 22:31 23:49 24:27 25:17 26:21 27:36 28:26 29:21 30:26 31:18 32:32 33:33 34:31 35:15 36:38 37:28 38:23 39:29 40:49 41:26 42:20 43:27 44:31 45:25 46:24 47:23 48:35\nDAN 1:21 2:49 3:33 4:34 5:31 6:28 7:28 8:27 9:27 10:21 11:45 12:13\nHOS 1:11 2:23 3:5 4:19 5:15 6:11 7:16 8:14 9:17 10:15 11:12 12:14 13:15 14:10\nJOL 1:20 2:32 3:21\nAMO 1:15 2:16 3:15 4:13 5:27 6:14 7:17 8:14 9:15\nOBA 1:21\nJON 1:16 2:11 3:10 4:11\nMIC 1:16 2:13 3:12 4:13 5:15 6:16 7:20\nNAM 1:15 2:13 3:19\nHAB 1:17 2:20 3:19\nZEP 1:18 2:15 3:20\nHAG 1:15 2:23\nZEC 1:21 2:13 3:10 4:14 5:11 6:15 7:14 8:23 9:17 10:12 11:17 12:14 13:9 14:21\nMAL 1:14 2:17 3:18 4:6\n#-------------------------------------------------------\n# New Testament books\nMAT 1:25 2:23 3:17 4:25 5:48 6:34 7:29 8:34 9:38 10:42 11:30 12:50 13:58 14:36 15:39 16:28 17:27 18:35 19:30 20:34 21:46 22:46 23:39 24:51 25:46 26:75 27:66 28:20\nMRK 1:45 2:28 3:35 4:41 5:43 6:56 7:37 8:38 9:50 10:52 11:33 12:44 13:37 14:72 15:47 16:20\nLUK 1:80 2:52 3:38 4:44 5:39 6:49 7:50 8:56 9:62 10:42 11:54 12:59 13:35 14:35 15:32 16:31 17:37 18:43 19:48 20:47 21:38 22:71 23:56 24:53\nJHN 1:51 2:25 3:36 4:54 5:47 6:71 7:53 8:59 9:41 10:42 11:57 12:50 13:38 14:31 15:27 16:33 17:26 18:40 19:42 20:31 21:25\nACT 1:26 2:47 3:26 4:37 5:42 6:15 7:60 8:40 9:43 10:48 11:30 12:25 13:52 14:28 15:41 16:40 17:34 18:28 19:40 20:38 21:40 22:30 23:35 24:27 25:27 26:32 27:44 28:31\nROM 1:32 2:29 3:31 4:25 5:21 6:23 7:25 8:39 9:33 10:21 11:36 12:21 13:14 14:26 15:33 16:24\n1CO 1:31 2:16 3:23 4:21 5:13 6:20 7:40 8:13 9:27 10:33 11:34 12:31 13:13 14:40 15:58 16:24\n2CO 1:24 2:17 3:18 4:18 5:21 6:18 7:16 8:24 9:15 10:18 11:32 12:21 13:13\nGAL 1:24 2:21 3:29 4:31 5:26 6:18\nEPH 1:23 2:22 3:21 4:32 5:33 6:24\nPHP 1:30 2:30 3:21 4:23\nCOL 1:29 2:23 3:25 4:18\n1TH 1:10 2:20 3:13 4:18 5:28\n2TH 1:12 2:17 3:18\n1TI 1:20 2:15 3:16 4:16 5:25 6:21\n2TI 1:18 2:26 3:17 4:22\nTIT 1:16 2:15 3:15\nPHM 1:25\nHEB 1:14 2:18 3:19 4:16 5:14 6:20 7:28 8:13 9:28 10:39 11:40 12:29 13:25\nJAS 1:27 2:26 3:18 4:17 5:20\n1PE 1:25 2:25 3:22 4:19 5:14\n2PE 1:21 2:22 3:18\n1JN 1:10 2:29 3:24 4:21 5:21\n2JN 1:13\n3JN 1:15\nJUD 1:25\nREV 1:20 2:29 3:22 4:11 5:14 6:17 7:17 8:13 9:21 10:11 11:19 12:17 13:18 14:20 15:8 16:21 17:18 18:24 19:21 20:15 21:27 22:21\n#\n#------------------------------------------------------------\n# Mapping\n#-------------------------------------------------------------\n# Russian = BHS (see org.vrs)\n#\n# (Note: ranges must not span a chapter, e.g. 4:10-5:11 is illegal)\n#\nGEN 31:55 = GEN 32:1\nGEN 32:1-32 = GEN 32:2-33\nEXO 8:1-4 = EXO 7:26-29\nEXO 8:5-32 = EXO 8:1-28\nEXO 22:1 = EXO 21:37\nEXO 22:2-31 = EXO 22:1-30\nLEV 6:1-7 = LEV 5:20-26\nLEV 6:8-30 = LEV 6:1-23\n# LEV 14:55b = LEV 14:56 # cant handle split verses yet\nLEV 14:55 = LEV 14:55\nLEV 14:55 = LEV 14:56\nLEV 14:56 = LEV 14:57\nNUM 13:1 = NUM 12:16\nNUM 13:2-34 = NUM 13:1-33\nNUM 16:36-50 = NUM 17:1-15\nNUM 17:1-13 = NUM 17:16-28\nNUM 26:1 = NUM 25:19\nNUM 26:1 = NUM 26:1\nDEU 12:32 = DEU 13:1\nDEU 13:1-18 = DEU 13:2-19\nDEU 22:30 = DEU 23:1\nDEU 23:1-25 = DEU 23:2-26\nDEU 29:1 = DEU 28:69\nDEU 29:2-29 = DEU 29:1-28\nJOS 5:16 = JOS 6:1\nJOS 6:1-26 = JOS 6:2-27\n1SA 20:43 = 1SA 21:1\n1SA 21:1-15 = 1SA 21:2-16\n2SA 18:33 = 2SA 19:1\n2SA 19:1-43 = 2SA 19:2-44\n1KI 4:21-34 = 1KI 5:1-14\n1KI 5:1-18 = 1KI 5:15-32\n#1KI 22:43b = 1KI 22:44 # cant handle split verses yet\n1KI 22:43 = 1KI 22:43\n1KI 22:43 = 1KI 22:44\n1KI 22:44-53 = 1KI 22:45-54\n2KI 11:21 = 2KI 12:1\n2KI 12:1-21 = 2KI 12:2-22\n1CH 6:1-15 = 1CH 5:27-41\n1CH 6:16-81 = 1CH 6:1-66\n# 1CH 12:4b = 1CH 12:5 # cant handle split verses yet\n1CH 12:4 = 1CH 12:4\n1CH 12:4 = 1CH 12:5\n1CH 12:5-40 = 1CH 12:6-41\n2CH 2:1 = 2CH 1:18\n2CH 2:2-18 = 2CH 2:1-17\n2CH 14:1 = 2CH 13:23\n2CH 14:2-15 = 2CH 14:1-14\nNEH 4:1-6 = NEH 3:33-38\nNEH 4:7-23 = NEH 4:1-17\n# NEH 7:68 = NEH 7:67b # cant handle split verses yet\nNEH 7:67 = NEH 7:67\nNEH 7:68 = NEH 7:67\nNEH 7:69-73 = NEH 7:68-72\nNEH 9:38 = NEH 10:1\nNEH 10:1-39 = NEH 10:2-40\nJOB 39:31-35 = JOB 40:1-5\nJOB 40:1-19 = JOB 40:6-24\nJOB 40:20-27 = JOB 40:25-32\n# PSA 9 = 9+10\nPSA 9:22 = PSA 10:0\nPSA 9:22-39 = PSA 10:1-18\nPSA 10:0-7 = PSA 11:0-7\nPSA 11:0-9 = PSA 12:0-9\nPSA 12:0-6 = PSA 13:0-6\nPSA 13:0-7 = PSA 14:0-7\nPSA 14:0-5 = PSA 15:0-5\nPSA 15:0-11 = PSA 16:0-11\nPSA 16:0-15 = PSA 17:0-15\nPSA 17:0-51 = PSA 18:0-51\nPSA 18:0-15 = PSA 19:0-15\nPSA 19:0-10 = PSA 20:0-10\nPSA 20:0-14 = PSA 21:0-14\nPSA 21:0-32 = PSA 22:0-32\nPSA 22:0-6 = PSA 23:0-6\nPSA 23:0-10 = PSA 24:0-10\nPSA 24:0-22 = PSA 25:0-22\nPSA 25:0-12 = PSA 26:0-12\nPSA 26:0-14 = PSA 27:0-14\nPSA 27:0-9 = PSA 28:0-9\nPSA 28:0-11 = PSA 29:0-11\nPSA 29:0-13 = PSA 30:0-13\nPSA 30:0-25 = PSA 31:0-25\nPSA 31:0-11 = PSA 32:0-11\nPSA 32:0-22 = PSA 33:0-22\nPSA 33:0-23 = PSA 34:0-23\nPSA 34:0-28 = PSA 35:0-28\nPSA 35:0-13 = PSA 36:0-13\nPSA 36:0-40 = PSA 37:0-40\nPSA 37:0-23 = PSA 38:0-23\nPSA 38:0-14 = PSA 39:0-14\nPSA 39:0-18 = PSA 40:0-18\nPSA 40:0-14 = PSA 41:0-14\nPSA 41:0-12 = PSA 42:0-12\nPSA 42:0-5 = PSA 43:0-5\nPSA 43:0-27 = PSA 44:0-27\nPSA 44:0-18 = PSA 45:0-18\nPSA 45:0-12 = PSA 46:0-12\nPSA 46:0-10 = PSA 47:0-10\nPSA 47:0-15 = PSA 48:0-15\nPSA 48:0-21 = PSA 49:0-21\nPSA 49:0-23 = PSA 50:0-23\nPSA 50:0-21 = PSA 51:0-21\nPSA 51:0-11 = PSA 52:0-11\nPSA 52:0-7 = PSA 53:0-7\nPSA 53:0-9 = PSA 54:0-9\nPSA 54:0-24 = PSA 55:0-24\nPSA 55:0-14 = PSA 56:0-14\nPSA 56:0-12 = PSA 57:0-12\nPSA 57:0-12 = PSA 58:0-12\nPSA 58:0-18 = PSA 59:0-18\nPSA 59:0-14 = PSA 60:0-14\nPSA 60:0-9 = PSA 61:0-9\nPSA 61:0-13 = PSA 62:0-13\nPSA 62:0-12 = PSA 63:0-12\nPSA 63:0-11 = PSA 64:0-11\nPSA 64:0-14 = PSA 65:0-14\nPSA 65:0-20 = PSA 66:0-20\nPSA 66:0-8 = PSA 67:0-8\nPSA 67:0-36 = PSA 68:0-36\nPSA 68:0-37 = PSA 69:0-37\nPSA 69:0-6 = PSA 70:0-6\nPSA 70:0-24 = PSA 71:0-24\nPSA 71:0-20 = PSA 72:0-20\nPSA 72:0-28 = PSA 73:0-28\nPSA 73:0-23 = PSA 74:0-23\nPSA 74:0-11 = PSA 75:0-11\nPSA 75:0-13 = PSA 76:0-13\nPSA 76:0-21 = PSA 77:0-21\nPSA 77:0-72 = PSA 78:0-72\nPSA 78:0-13 = PSA 79:0-13\nPSA 79:0-20 = PSA 80:0-20\nPSA 80:0-17 = PSA 81:0-17\nPSA 81:0-8 = PSA 82:0-8\nPSA 82:0-19 = PSA 83:0-19\nPSA 83:0-13 = PSA 84:0-13\nPSA 84:0-14 = PSA 85:0-14\nPSA 85:0-17 = PSA 86:0-17\nPSA 86:0-1 = PSA 87:0-1\nPSA 86:2 = PSA 87:1\nPSA 86:2-7 = PSA 87:2-7\nPSA 87:0-19 = PSA 88:0-19\nPSA 88:0-53 = PSA 89:0-53\nPSA 89:0-1 = PSA 90:0\nPSA 89:2-6 = PSA 90:1-5\nPSA 89:6 = PSA 90:6\nPSA 89:7-17 = PSA 90:7-17\nPSA 90:0-16 = PSA 91:0-16\nPSA 91:0-16 = PSA 92:0-16\nPSA 92:0-5 = PSA 93:0-5\nPSA 93:0-23 = PSA 94:0-23\nPSA 94:0-11 = PSA 95:0-11\nPSA 95:0-13 = PSA 96:0-13\nPSA 96:0-12 = PSA 97:0-12\nPSA 97:0-9 = PSA 98:0-9\nPSA 98:0-9 = PSA 99:0-9\nPSA 99:0-5 = PSA 100:0-5\nPSA 100:0-8 = PSA 101:0-8\nPSA 101:0-29 = PSA 102:0-29\nPSA 102:0-22 = PSA 103:0-22\nPSA 103:0-35 = PSA 104:0-35\nPSA 104:0-45 = PSA 105:0-45\nPSA 105:0-48 = PSA 106:0-48\nPSA 106:0-43 = PSA 107:0-43\nPSA 107:0-14 = PSA 108:0-14\nPSA 108:0-31 = PSA 109:0-31\nPSA 109:0-7 = PSA 110:0-7\nPSA 110:0-10 = PSA 111:0-10\nPSA 111:0-10 = PSA 112:0-10\nPSA 112:0-9 = PSA 113:0-9\nPSA 113:0-8 = PSA 114:0-8\nPSA 113:9 = PSA 115:0\nPSA 113:9-26 = PSA 115:1-18\nPSA 114:0-9 = PSA 116:0-9\nPSA 115:0 = PSA 116:10\nPSA 115:1-10 = PSA 116:10-19\t\nPSA 116:0-2 = PSA 117:0-2\nPSA 117:0-29 = PSA 118:0-29\nPSA 118:0-176 = PSA 119:0-176\nPSA 119:0-7 = PSA 120:0-7\nPSA 120:0-8 = PSA 121:0-8\nPSA 121:0-9 = PSA 122:0-9\nPSA 122:0-4 = PSA 123:0-4\nPSA 123:0-8 = PSA 124:0-8\nPSA 124:0-5 = PSA 125:0-5\nPSA 125:0-6 = PSA 126:0-6\nPSA 126:0-5 = PSA 127:0-5\nPSA 127:0-6 = PSA 128:0-6\nPSA 128:0-8 = PSA 129:0-8\nPSA 129:0-8 = PSA 130:0-8\nPSA 130:0-3 = PSA 131:0-3\nPSA 131:0-18 = PSA 132:0-18\nPSA 132:0-3 = PSA 133:0-3\nPSA 133:0-3 = PSA 134:0-3\nPSA 134:0-21 = PSA 135:0-21\nPSA 135:0-26 = PSA 136:0-26\nPSA 136:0-9 = PSA 137:0-9\nPSA 137:0-8 = PSA 138:0-8\nPSA 138:0-24 = PSA 139:0-24\nPSA 139:0-14 = PSA 140:0-14\nPSA 140:0-10 = PSA 141:0-10\nPSA 141:0 = PSA 142:0-1\nPSA 141:1-7 = PSA 142:2-8\nPSA 142:0-12 = PSA 143:0-12\nPSA 143:0-15 = PSA 144:0-15\nPSA 144:0-21 = PSA 145:0-21\nPSA 145:0-10 = PSA 146:0-10\n# 146 + 147 -> 147\nPSA 146:0-11 = PSA 147:0-11\nPSA 147:0 = PSA 147:12\nPSA 147:1-9 = PSA 147:12-20\nSNG 1:1-16 = SNG 1:2-17\n# ISA 3:19b = ISA 3:20 # cant handle split verses yet\nISA 3:19 = ISA 3:19\nISA 3:19 = ISA 3:20\nISA 3:20-25 = ISA 3:21-26\nISA 9:1 = ISA 8:23\nISA 9:2-21 = ISA 9:1-20\nISA 63:19 = ISA 63:19\nISA 64:1 = ISA 63:19\nISA 64:2-12 = ISA 64:1-11\nJER 9:1 = JER 8:23\nJER 9:2-26 = JER 9:1-25\nEZK 20:45-49 = EZK 21:1-5\nEZK 21:1-32 = EZK 21:6-37\nDAN 5:31 = DAN 6:1\nDAN 6:1-28 = DAN 6:2-29\nHOS 1:10-11 = HOS 2:1-2\nHOS 2:1-23 = HOS 2:3-25\nHOS 11:12 = HOS 12:1\nHOS 12:1-14 = HOS 12:2-15\nJOL 2:28-32 = JOL 3:1-5\nJOL 3:1-21 = JOL 4:1-21\nMIC 5:1 = MIC 4:14\nMIC 5:2-15 = MIC 5:1-14\nNAM 1:15 = NAM 2:1\nNAM 2:1-13 = NAM 2:2-14\nZEC 1:18-21 = ZEC 2:1-4\nZEC 2:1-13 = ZEC 2:5-17\nMAL 4:1-6 = MAL 3:19-24\nROM 14:24-26 = ROM 16:25-27\n# 2CO 11:32b = 2CO 11:33 # cant handle split verses yet\n2CO 11:32 = 2CO 11:32\n2CO 11:32 = 2CO 11:33\n# REV 13:1a = REV 12:18 # cant handle split verses yet\n# REV 13:1b = REV 13:1 # cant handle split verses yet\nREV 13:1 = REV 12:18\nREV 13:1 = REV 13:1\n'},rso:{raw:'# Versification "Russian Orthodox"\n# Version=1.3\n#\n# This is the versification used by the Orthodox (or "non-canonical") edition of the Russian Synodal Bible\n# Initial version provided by Peter_Kirk@sil.org\n# Corrected 27/May/2003 by matjaz.crnivec@drustvo-svds.si:\n# Number of vss: 2CH 37; PSA 114; ISA 3; REV 12; 2ES (whole book added),\n# Mappings: LEV 14; 1KI 22; 1CH 12; 2CH 37; NEH 7; PSA 114; ISA 3; 2CO 11; REV 13; 2ES 7; 10\n#\n# modifications by Studge 26/June/2009\n# amended by HAB April 2010\n#\n# List of books, chapters, verses\n# One line per book.\n# One entry for each chapter.\n# Verse number is the maximum verse number for that chapter.\n# See the lines containing =\'s below for verse mappings.\n#\n#----------------------------------------------------------\nGEN 1:31 2:25 3:24 4:26 5:32 6:22 7:24 8:22 9:29 10:32 11:32 12:20 13:18 14:24 15:21 16:16 17:27 18:33 19:38 20:18 21:34 22:24 23:20 24:67 25:34 26:35 27:46 28:22 29:35 30:43 31:55 32:32 33:20 34:31 35:29 36:43 37:36 38:30 39:23 40:23 41:57 42:38 43:34 44:34 45:28 46:34 47:31 48:22 49:33 50:26\nEXO 1:22 2:25 3:22 4:31 5:23 6:30 7:25 8:32 9:35 10:29 11:10 12:51 13:22 14:31 15:27 16:36 17:16 18:27 19:25 20:26 21:36 22:31 23:33 24:18 25:40 26:37 27:21 28:43 29:46 30:38 31:18 32:35 33:23 34:35 35:35 36:38 37:29 38:31 39:43 40:38\nLEV 1:17 2:16 3:17 4:35 5:19 6:30 7:38 8:36 9:24 10:20 11:47 12:8 13:59 14:56 15:33 16:34 17:16 18:30 19:37 20:27 21:24 22:33 23:44 24:23 25:55 26:46 27:34\nNUM 1:54 2:34 3:51 4:49 5:31 6:27 7:89 8:26 9:23 10:36 11:35 12:15 13:34 14:45 15:41 16:50 17:13 18:32 19:22 20:29 21:35 22:41 23:30 24:25 25:18 26:65 27:23 28:31 29:39 30:17 31:54 32:42 33:56 34:29 35:34 36:13\nDEU 1:46 2:37 3:29 4:49 5:33 6:25 7:26 8:20 9:29 10:22 11:32 12:32 13:18 14:29 15:23 16:22 17:20 18:22 19:21 20:20 21:23 22:30 23:25 24:22 25:19 26:19 27:26 28:68 29:29 30:20 31:30 32:52 33:29 34:12\nJOS 1:18 2:24 3:17 4:24 5:16 6:26 7:26 8:35 9:27 10:43 11:23 12:24 13:33 14:15 15:63 16:10 17:18 18:28 19:51 20:9 21:45 22:34 23:16 24:36\nJDG 1:36 2:23 3:31 4:24 5:31 6:40 7:25 8:35 9:57 10:18 11:40 12:15 13:25 14:20 15:20 16:31 17:13 18:31 19:30 20:48 21:25\nRUT 1:22 2:23 3:18 4:22\n1SA 1:28 2:36 3:21 4:22 5:12 6:21 7:17 8:22 9:27 10:27 11:15 12:25 13:23 14:52 15:35 16:23 17:58 18:30 19:24 20:43 21:15 22:23 23:28 24:23 25:44 26:25 27:12 28:25 29:11 30:31 31:13\n2SA 1:27 2:32 3:39 4:12 5:25 6:23 7:29 8:18 9:13 10:19 11:27 12:31 13:39 14:33 15:37 16:23 17:29 18:33 19:43 20:26 21:22 22:51 23:39 24:25\n1KI 1:53 2:46 3:28 4:34 5:18 6:38 7:51 8:66 9:28 10:29 11:43 12:33 13:34 14:31 15:34 16:34 17:24 18:46 19:21 20:43 21:29 22:53\n2KI 1:18 2:25 3:27 4:44 5:27 6:33 7:20 8:29 9:37 10:36 11:21 12:21 13:25 14:29 15:38 16:20 17:41 18:37 19:37 20:21 21:26 22:20 23:37 24:20 25:30\n1CH 1:54 2:55 3:24 4:43 5:26 6:81 7:40 8:40 9:44 10:14 11:47 12:40 13:14 14:17 15:29 16:43 17:27 18:17 19:19 20:8 21:30 22:19 23:32 24:31 25:31 26:32 27:34 28:21 29:30\n2CH 1:17 2:18 3:17 4:22 5:14 6:42 7:22 8:18 9:31 10:19 11:23 12:16 13:22 14:15 15:19 16:14 17:19 18:34 19:11 20:37 21:20 22:12 23:21 24:27 25:28 26:23 27:9 28:27 29:36 30:27 31:21 32:33 33:25 34:33 35:27 36:23 37:12\nEZR 1:11 2:70 3:13 4:24 5:17 6:22 7:28 8:36 9:15 10:44\nNEH 1:11 2:20 3:32 4:23 5:19 6:19 7:73 8:18 9:38 10:39 11:36 12:47 13:31\n#--------------\n# Notes EST is the Greek Esther which should have been under ESG\nEST 1:22 2:23 3:15 4:17 5:14 6:14 7:10 8:17 9:32 10:3\n#--------------\nJOB 1:22 2:13 3:26 4:21 5:27 6:30 7:21 8:22 9:35 10:22 11:20 12:25 13:28 14:22 15:35 16:22 17:16 18:21 19:29 20:29 21:34 22:30 23:17 24:25 25:6 26:14 27:23 28:28 29:25 30:31 31:40 32:22 33:33 34:37 35:16 36:33 37:24 38:41 39:35 40:27 41:26 42:17\nPSA 1:6 2:12 3:9 4:9 5:13 6:11 7:18 8:10 9:39 10:7 11:9 12:6 13:7 14:5 15:11 16:15 17:51 18:15 19:10 20:14 21:32 22:6 23:10 24:22 25:12 26:14 27:9 28:11 29:13 30:25 31:11 32:22 33:23 34:28 35:13 36:40 37:23 38:14 39:18 40:14 41:12 42:5 43:27 44:18 45:12 46:10 47:15 48:21 49:23 50:21 51:11 52:7 53:9 54:24 55:14 56:12 57:12 58:18 59:14 60:9 61:13 62:12 63:11 64:14 65:20 66:8 67:36 68:37 69:6 70:24 71:20 72:28 73:23 74:11 75:13 76:21 77:72 78:13 79:20 80:17 81:8 82:19 83:13 84:14 85:17 86:7 87:19 88:53 89:17 90:16 91:16 92:5 93:23 94:11 95:13 96:12 97:9 98:9 99:5 100:8 101:29 102:22 103:35 104:45 105:48 106:43 107:14 108:31 109:7 110:10 111:10 112:9 113:26 114:8 115:10 116:2 117:29 118:176 119:7 120:8 121:9 122:4 123:8 124:5 125:6 126:5 127:6 128:8 129:8 130:3 131:18 132:3 133:3 134:21 135:26 136:9 137:8 138:24 139:14 140:10 141:7 142:12 143:15 144:21 145:10 146:11 147:9 148:14 149:9 150:6 151:7\nPRO 1:33 2:22 3:35 4:29 5:23 6:35 7:27 8:36 9:18 10:32 11:31 12:28 13:26 14:35 15:33 16:33 17:28 18:25 19:29 20:30 21:31 22:29 23:35 24:34 25:28 26:28 27:27 28:28 29:27 30:33 31:31\nECC 1:18 2:26 3:22 4:17 5:19 6:12 7:29 8:17 9:18 10:20 11:10 12:14\nSNG 1:16 2:17 3:11 4:16 5:16 6:12 7:14 8:14\nISA 1:31 2:22 3:25 4:6 5:30 6:13 7:25 8:22 9:21 10:34 11:16 12:6 13:22 14:32 15:9 16:14 17:14 18:7 19:25 20:6 21:17 22:25 23:18 24:23 25:12 26:21 27:13 28:29 29:24 30:33 31:9 32:20 33:24 34:17 35:10 36:22 37:38 38:22 39:8 40:31 41:29 42:25 43:28 44:28 45:25 46:13 47:15 48:22 49:26 50:11 51:23 52:15 53:12 54:17 55:13 56:12 57:21 58:14 59:21 60:22 61:11 62:12 63:19 64:12 65:25 66:24\nJER 1:19 2:37 3:25 4:31 5:31 6:30 7:34 8:22 9:26 10:25 11:23 12:17 13:27 14:22 15:21 16:21 17:27 18:23 19:15 20:18 21:14 22:30 23:40 24:10 25:38 26:24 27:22 28:17 29:32 30:24 31:40 32:44 33:26 34:22 35:19 36:32 37:21 38:28 39:18 40:16 41:18 42:22 43:13 44:30 45:5 46:28 47:7 48:47 49:39 50:46 51:64 52:34\nLAM 1:22 2:22 3:66 4:22 5:22\nEZK 1:28 2:10 3:27 4:17 5:17 6:14 7:27 8:18 9:11 10:22 11:25 12:28 13:23 14:23 15:8 16:63 17:24 18:32 19:14 20:49 21:32 22:31 23:49 24:27 25:17 26:21 27:36 28:26 29:21 30:26 31:18 32:32 33:33 34:31 35:15 36:38 37:28 38:23 39:29 40:49 41:26 42:20 43:27 44:31 45:25 46:24 47:23 48:35\nDAN 1:21 2:49 3:100 4:34 5:31 6:28 7:28 8:27 9:27 10:21 11:45 12:13 13:64 14:42\nHOS 1:11 2:23 3:5 4:19 5:15 6:11 7:16 8:14 9:17 10:15 11:12 12:14 13:15 14:10\nJOL 1:20 2:32 3:21\nAMO 1:15 2:16 3:15 4:13 5:27 6:14 7:17 8:14 9:15\nOBA 1:21\nJON 1:16 2:11 3:10 4:11\nMIC 1:16 2:13 3:12 4:13 5:15 6:16 7:20\nNAM 1:15 2:13 3:19\nHAB 1:17 2:20 3:19\nZEP 1:18 2:15 3:20\nHAG 1:15 2:23\nZEC 1:21 2:13 3:10 4:14 5:11 6:15 7:14 8:23 9:17 10:12 11:17 12:14 13:9 14:21\nMAL 1:14 2:17 3:18 4:6\n#----------------------------------------------------\nMAT 1:25 2:23 3:17 4:25 5:48 6:34 7:29 8:34 9:38 10:42 11:30 12:50 13:58 14:36 15:39 16:28 17:27 18:35 19:30 20:34 21:46 22:46 23:39 24:51 25:46 26:75 27:66 28:20\nMRK 1:45 2:28 3:35 4:41 5:43 6:56 7:37 8:38 9:50 10:52 11:33 12:44 13:37 14:72 15:47 16:20\nLUK 1:80 2:52 3:38 4:44 5:39 6:49 7:50 8:56 9:62 10:42 11:54 12:59 13:35 14:35 15:32 16:31 17:37 18:43 19:48 20:47 21:38 22:71 23:56 24:53\nJHN 1:51 2:25 3:36 4:54 5:47 6:71 7:53 8:59 9:41 10:42 11:57 12:50 13:38 14:31 15:27 16:33 17:26 18:40 19:42 20:31 21:25\nACT 1:26 2:47 3:26 4:37 5:42 6:15 7:60 8:40 9:43 10:48 11:30 12:25 13:52 14:28 15:41 16:40 17:34 18:28 19:40 20:38 21:40 22:30 23:35 24:27 25:27 26:32 27:44 28:31\nROM 1:32 2:29 3:31 4:25 5:21 6:23 7:25 8:39 9:33 10:21 11:36 12:21 13:14 14:26 15:33 16:24\n1CO 1:31 2:16 3:23 4:21 5:13 6:20 7:40 8:13 9:27 10:33 11:34 12:31 13:13 14:40 15:58 16:24\n2CO 1:24 2:17 3:18 4:18 5:21 6:18 7:16 8:24 9:15 10:18 11:32 12:21 13:13\nGAL 1:24 2:21 3:29 4:31 5:26 6:18\nEPH 1:23 2:22 3:21 4:32 5:33 6:24\nPHP 1:30 2:30 3:21 4:23\nCOL 1:29 2:23 3:25 4:18\n1TH 1:10 2:20 3:13 4:18 5:28\n2TH 1:12 2:17 3:18\n1TI 1:20 2:15 3:16 4:16 5:25 6:21\n2TI 1:18 2:26 3:17 4:22\nTIT 1:16 2:15 3:15\nPHM 1:25\nHEB 1:14 2:18 3:19 4:16 5:14 6:20 7:28 8:13 9:28 10:39 11:40 12:29 13:25\nJAS 1:27 2:26 3:18 4:17 5:20\n1PE 1:25 2:25 3:22 4:19 5:14\n2PE 1:21 2:22 3:18\n1JN 1:10 2:29 3:24 4:21 5:21\n2JN 1:13\n3JN 1:15\nJUD 1:25\nREV 1:20 2:29 3:22 4:11 5:14 6:17 7:17 8:13 9:21 10:11 11:19 12:17 13:18 14:20 15:8 16:21 17:18 18:24 19:21 20:15 21:27 22:21\n#---------------------------------------------\nTOB 1:22 2:14 3:17 4:21 5:22 6:18 7:17 8:21 9:6 10:13 11:18 12:22 13:18 14:15\nJDT 1:16 2:28 3:10 4:15 5:24 6:21 7:32 8:36 9:14 10:23 11:23 12:20 13:20 14:19 15:14 16:25\n# ESG added which ought to replace EST\nESG 1:22 2:23 3:15 4:17 5:14 6:14 7:10 8:17 9:32 10:3\nWIS 1:16 2:24 3:19 4:20 5:24 6:27 7:30 8:21 9:19 10:21 11:27 12:28 13:19 14:31 15:19 16:29 17:20 18:25 19:21\nSIR 1:30 2:18 3:31 4:35 5:18 6:37 7:39 8:22 9:23 10:34 11:34 12:18 13:32 14:27 15:20 16:31 17:31 18:33 19:28 20:31 21:31 22:31 23:37 24:37 25:29 26:27 27:33 28:30 29:31 30:27 31:37 32:25 33:33 34:26 35:23 36:29 37:34 38:39 39:42 40:32 41:29 42:26 43:36 44:27 45:31 46:23 47:31 48:28 49:18 50:31 51:38\nBAR 1:22 2:35 3:38 4:37 5:9\nLJE 1:72\n1MA 1:64 2:70 3:60 4:61 5:68 6:63 7:50 8:32 9:73 10:89 11:74 12:53 13:53 14:49 15:41 16:24\n2MA 1:36 2:33 3:40 4:50 5:27 6:31 7:42 8:36 9:29 10:38 11:38 12:45 13:26 14:46 15:39\n3MA 1:25 2:24 3:22 4:16 5:36 6:37 7:20\n1ES 1:58 2:31 3:24 4:63 5:70 6:34 7:15 8:92 9:55\n# in the Russian tradition the book of 1ES is called 2 Esdras [Studge]\n2ES 1:40 2:48 3:36 4:52 5:56 6:59 7:70 8:63 9:47 10:60 11:46 12:51 13:58 14:48 15:63 16:78\n# in the Russian tradition the book of 2ES is called 3 Esdras [Studge]\n# added Prayer of Manasseh which is appended to 2 Chronicles in RSO\nMAN 1:15\n#\n#----------------------------------------------\n# Mapping\n#----------------------------------------------\n# Russian = BHS (see org.vrs)\n#\n# (Note: ranges must not span a chapter, e.g. 4:10-5:11 is illegal)\n#\nGEN 31:55 = GEN 32:1\nGEN 32:1-32 = GEN 32:2-33\nEXO 8:1-4 = EXO 7:26-29\nEXO 8:5-32 = EXO 8:1-28\nEXO 22:1 = EXO 21:37\nEXO 22:2-31 = EXO 22:1-30\nLEV 6:1-7 = LEV 5:20-26\nLEV 6:8-30 = LEV 6:1-23\n# LEV 14:55 = LEV 14:55-56\nLEV 14:55 = LEV 14:55\nLEV 14:55 = LEV 14:56\nLEV 14:56 = LEV 14:57\nNUM 13:1 = NUM 12:16\nNUM 13:2-34 = NUM 13:1-33\nNUM 16:36-50 = NUM 17:1-15\nNUM 17:1-13 = NUM 17:16-28\nNUM 26:1 = NUM 25:19\nNUM 26:1 = NUM 26:1\nDEU 12:32 = DEU 13:1\nDEU 13:1-18 = DEU 13:2-19\nDEU 22:30 = DEU 23:1\nDEU 23:1-25 = DEU 23:2-26\nDEU 29:1 = DEU 28:69\nDEU 29:2-29 = DEU 29:1-28\nJOS 5:16 = JOS 6:1\nJOS 6:1-26 = JOS 6:2-27\n1SA 20:43 = 1SA 21:1\n1SA 21:1-15 = 1SA 21:2-16\n2SA 18:33 = 2SA 19:1\n2SA 19:1-43 = 2SA 19:2-44\n1KI 4:21-34 = 1KI 5:1-14\n1KI 5:1-18 = 1KI 5:15-32\n# 1KI 22:43 = 1KI 22:43-44\n1KI 22:43 = 1KI 22:43\n1KI 22:43 = 1KI 22:44\n1KI 22:44-53 = 1KI 22:45-54\n2KI 11:21 = 2KI 12:1\n2KI 12:1-21 = 2KI 12:2-22\n1CH 6:1-15 = 1CH 5:27-41\n1CH 6:16-81 = 1CH 6:1-66\n# 1CH 12:4 = 1CH 12:4-5\n1CH 12:4 = 1CH 12:4\n1CH 12:4 = 1CH 12:5\n1CH 12:5-40 = 1CH 12:6-41\n2CH 2:1 = 2CH 1:18\n2CH 2:2-18 = 2CH 2:1-17\n2CH 14:1 = 2CH 13:23\n2CH 14:2-15 = 2CH 14:1-14\n# All the 37th chapter maps across verse boundaries!\n#-----------------------\n# Prayer of Manasseh\n2CH 37:1 = MAN 1:1\n2CH 37:2 = MAN 1:2\n2CH 37:2 = MAN 1:3\n2CH 37:2 = MAN 1:4\n2CH 37:2 = MAN 1:5\n2CH 37:3 = MAN 1:5\n2CH 37:4 = MAN 1:6\n2CH 37:5 = MAN 1:7\n2CH 37:6 = MAN 1:7\n2CH 37:6 = MAN 1:8\n2CH 37:7 = MAN 1:8\n2CH 37:7 = MAN 1:9\n2CH 37:8 = MAN 1:9\n2CH 37:8 = MAN 1:10\n2CH 37:9 = MAN 1:10\n2CH 37:10 = MAN 1:10\n2CH 37:10 = MAN 1:11\n2CH 37:11 = MAN 1:12\n2CH 37:11 = MAN 1:13\n2CH 37:11 = MAN 1:14\n2CH 37:11 = MAN 1:15\n2CH 37:12 = MAN 1:15\n#--------------------------\nNEH 4:1-6 = NEH 3:33-38\nNEH 4:7-23 = NEH 4:1-17\n# NEH 7:67-68 = NEH 7:67\nNEH 7:67 = NEH 7:67\nNEH 7:68 = NEH 7:67\nNEH 7:69-73 = NEH 7:68-72\nNEH 9:38 = NEH 10:1\nNEH 10:1-39 = NEH 10:2-40\nJOB 39:31-35 = JOB 40:1-5\nJOB 40:1-19 = JOB 40:6-24\nJOB 40:20-27 = JOB 40:25-32\n# PSA 9 = 9+10\nPSA 9:22 = PSA 10:0\nPSA 9:22-39 = PSA 10:1-18\nPSA 10:0-7 = PSA 11:0-7\nPSA 11:0-9 = PSA 12:0-9\nPSA 12:0-6 = PSA 13:0-6\nPSA 13:0-7 = PSA 14:0-7\nPSA 14:0-5 = PSA 15:0-5\nPSA 15:0-11 = PSA 16:0-11\nPSA 16:0-15 = PSA 17:0-15\nPSA 17:0-51 = PSA 18:0-51\nPSA 18:0-15 = PSA 19:0-15\nPSA 19:0-10 = PSA 20:0-10\nPSA 20:0-14 = PSA 21:0-14\nPSA 21:0-32 = PSA 22:0-32\nPSA 22:0-6 = PSA 23:0-6\nPSA 23:0-10 = PSA 24:0-10\nPSA 24:0-22 = PSA 25:0-22\nPSA 25:0-12 = PSA 26:0-12\nPSA 26:0-14 = PSA 27:0-14\nPSA 27:0-9 = PSA 28:0-9\nPSA 28:0-11 = PSA 29:0-11\nPSA 29:0-13 = PSA 30:0-13\nPSA 30:0-25 = PSA 31:0-25\nPSA 31:0-11 = PSA 32:0-11\nPSA 32:0-22 = PSA 33:0-22\nPSA 33:0-23 = PSA 34:0-23\nPSA 34:0-28 = PSA 35:0-28\nPSA 35:0-13 = PSA 36:0-13\nPSA 36:0-40 = PSA 37:0-40\nPSA 37:0-23 = PSA 38:0-23\nPSA 38:0-14 = PSA 39:0-14\nPSA 39:0-18 = PSA 40:0-18\nPSA 40:0-14 = PSA 41:0-14\nPSA 41:0-12 = PSA 42:0-12\nPSA 42:0-5 = PSA 43:0-5\nPSA 43:0-27 = PSA 44:0-27\nPSA 44:0-18 = PSA 45:0-18\nPSA 45:0-12 = PSA 46:0-12\nPSA 46:0-10 = PSA 47:0-10\nPSA 47:0-15 = PSA 48:0-15\nPSA 48:0-21 = PSA 49:0-21\nPSA 49:0-23 = PSA 50:0-23\nPSA 50:0-21 = PSA 51:0-21\nPSA 51:0-11 = PSA 52:0-11\nPSA 52:0-7 = PSA 53:0-7\nPSA 53:0-9 = PSA 54:0-9\nPSA 54:0-24 = PSA 55:0-24\nPSA 55:0-14 = PSA 56:0-14\nPSA 56:0-12 = PSA 57:0-12\nPSA 57:0-12 = PSA 58:0-12\nPSA 58:0-18 = PSA 59:0-18\nPSA 59:0-14 = PSA 60:0-14\nPSA 60:0-9 = PSA 61:0-9\nPSA 61:0-13 = PSA 62:0-13\nPSA 62:0-12 = PSA 63:0-12\nPSA 63:0-11 = PSA 64:0-11\nPSA 64:0-14 = PSA 65:0-14\nPSA 65:0-20 = PSA 66:0-20\nPSA 66:0-8 = PSA 67:0-8\nPSA 67:0-36 = PSA 68:0-36\nPSA 68:0-37 = PSA 69:0-37\nPSA 69:0-6 = PSA 70:0-6\nPSA 70:0-24 = PSA 71:0-24\nPSA 71:0-20 = PSA 72:0-20\nPSA 72:0-28 = PSA 73:0-28\nPSA 73:0-23 = PSA 74:0-23\nPSA 74:0-11 = PSA 75:0-11\nPSA 75:0-13 = PSA 76:0-13\nPSA 76:0-21 = PSA 77:0-21\nPSA 77:0-72 = PSA 78:0-72\nPSA 78:0-13 = PSA 79:0-13\nPSA 79:0-20 = PSA 80:0-20\nPSA 80:0-17 = PSA 81:0-17\nPSA 81:0-8 = PSA 82:0-8\nPSA 82:0-19 = PSA 83:0-19\nPSA 83:0-13 = PSA 84:0-13\nPSA 84:0-14 = PSA 85:0-14\nPSA 85:0-17 = PSA 86:0-17\nPSA 86:0-1 = PSA 87:1\nPSA 86:2 = PSA 87:1\nPSA 86:2-7 = PSA 87:2-7\nPSA 87:0-19 = PSA 88:0-19\nPSA 88:0-53 = PSA 89:0-53\nPSA 89:0-1 = PSA 90:0-1\nPSA 89:2-6 = PSA 90:1-6\nPSA 89:7-17 = PSA 90:7-17\nPSA 90:0-16 = PSA 91:0-16\nPSA 91:0-16 = PSA 92:0-16\nPSA 92:0-5 = PSA 93:0-5\nPSA 93:0-23 = PSA 94:0-23\nPSA 94:0-11 = PSA 95:0-11\nPSA 95:0-13 = PSA 96:0-13\nPSA 96:0-12 = PSA 97:0-12\nPSA 97:0-9 = PSA 98:0-9\nPSA 98:0-9 = PSA 99:0-9\nPSA 99:0-5 = PSA 100:0-5\nPSA 100:0-8 = PSA 101:0-8\nPSA 101:0-29 = PSA 102:0-29\nPSA 102:0-22 = PSA 103:0-22\nPSA 103:0-35 = PSA 104:0-35\nPSA 104:0-45 = PSA 105:0-45\nPSA 105:0-48 = PSA 106:0-48\nPSA 106:0-43 = PSA 107:0-43\nPSA 107:0-14 = PSA 108:0-14\nPSA 108:0-31 = PSA 109:0-31\nPSA 109:0-7 = PSA 110:0-7\nPSA 110:0-10 = PSA 111:0-10\nPSA 111:0-10 = PSA 112:0-10\nPSA 112:0-9 = PSA 113:0-9\nPSA 113:0-8 = PSA 114:0-8\nPSA 113:9 = PSA 115:0\nPSA 113:9-26 = PSA 115:1-18\nPSA 114:0-8 = PSA 116:0-8\nPSA 114:8 = PSA 116:9\nPSA 115:0-10 = PSA 116:10-19\t\nPSA 116:0-2 = PSA 117:0-2\nPSA 117:0-29 = PSA 118:0-29\nPSA 118:0-176 = PSA 119:0-176\nPSA 119:0-7 = PSA 120:0-7\nPSA 120:0-8 = PSA 121:0-8\nPSA 121:0-9 = PSA 122:0-9\nPSA 122:0-4 = PSA 123:0-4\nPSA 123:0-8 = PSA 124:0-8\nPSA 124:0-5 = PSA 125:0-5\nPSA 125:0-6 = PSA 126:0-6\nPSA 126:0-5 = PSA 127:0-5\nPSA 127:0-6 = PSA 128:0-6\nPSA 128:0-8 = PSA 129:0-8\nPSA 129:0-8 = PSA 130:0-8\nPSA 130:0-3 = PSA 131:0-3\nPSA 131:0-18 = PSA 132:0-18\nPSA 132:0-3 = PSA 133:0-3\nPSA 133:0-3 = PSA 134:0-3\nPSA 134:0-21 = PSA 135:0-21\nPSA 135:0-26 = PSA 136:0-26\nPSA 136:0-9 = PSA 137:0-9\nPSA 137:0-8 = PSA 138:0-8\nPSA 138:0-24 = PSA 139:0-24\nPSA 139:0-14 = PSA 140:0-14\nPSA 140:0-10 = PSA 141:0-10\nPSA 141:0 = PSA 142:0\nPSA 141:1-7 = PSA 142:2-8\nPSA 142:0-12 = PSA 143:0-12\nPSA 143:0-15 = PSA 144:0-15\nPSA 144:0-21 = PSA 145:0-21\nPSA 145:0-10 = PSA 146:0-10\n# 146 + 147 -> 147\nPSA 146:0-11 = PSA 147:0-11\nPSA 147:0 = PSA 147:12\nPSA 147:1-9 = PSA 147:12-20\n#---------------------------\n# additional LXX Psalm\nPSA 151:1-7 = PS2 1:1-7\n#----------------------------\nPRO 13:15-26 = PRO 13:14-25\nPRO 18:9-25 = PRO 18:8-24\nSNG 1:1-16 = SNG 1:2-17\n# ISA 3:19 = ISA 3:19-20\nISA 3:19 = ISA 3:19\nISA 3:19 = ISA 3:20\nISA 3:20-25 = ISA 3:16-21\nISA 9:1 = ISA 8:23\nISA 9:2-21 = ISA 9:1-20\nISA 63:19 = ISA 63:19\nISA 64:1 = ISA 63:19\nISA 64:2-12 = ISA 64:1-11\nJER 9:1 = JER 8:23\nJER 9:2-26 = JER 9:1-25\nEZK 20:45-49 = EZK 21:1-5\nEZK 21:1-32 = EZK 21:6-37\nHOS 1:10-11 = HOS 2:1-2\nHOS 2:1-23 = HOS 2:3-25\nHOS 11:12 = HOS 12:1\nHOS 12:1-14 = HOS 12:2-15\nJOL 2:28-32 = JOL 3:1-5\nJOL 3:1-21 = JOL 4:1-21\nMIC 5:1 = MIC 4:14\nMIC 5:2-15 = MIC 5:1-14\nNAM 1:15 = NAM 2:1\nNAM 2:1-13 = NAM 2:2-14\nZEC 1:18-21 = ZEC 2:1-4\nZEC 2:1-13 = ZEC 2:5-17\nMAL 4:1-6 = MAL 3:19-24\nROM 14:24-26 = ROM 16:25-27\n# 2CO 11:32 = 2CO 11:32-33\n2CO 11:32 = 2CO 11:32\n2CO 11:32 = 2CO 11:33\n# REV 13:1 = REV 12:18-13:1\nREV 13:1 = REV 12:18\nREV 13:1 = REV 13:1\n#----------------------------\n2ES 7:36-70 = 2ES 7:106-140\n# 2ES 10:59-60 = 2ES 10:59\n2ES 10:59 = 2ES 10:59\n2ES 10:60 = 2ES 10:59\n#---------------------------------------------------------\n# Mapping 2 Esdras onto the older Apocalypse of Ezra [Studge]\n2ES 3:1-36 = EZA 1:1-36\n2ES 4:1-52 = EZA 2:1-52\n2ES 5:1-56 = EZA 3:1-56\n2ES 6:1-59 = EZA 4:1-59\n2ES 7:1-35 = EZA 5:1-35\n2ES 7:106-140 = EZA 5:36-70\n2ES 8:1-63 = EZA 6:1-63\n2ES 9:1-47 = EZA 7:1-47\n2ES 10:1-60 = EZA 8:1-60\n2ES 11:1-46 = EZA 9:1-46\n2ES 12:1-51 = EZA 10:1-51\n2ES 13:1-58 = EZA 11:1-58\n2ES 14:1-48 = EZA 12:1-48\n#----------------------------------------------------\n# Mapping Daniel to Hebrew Daniel and Greek additions [HAB]\nDAN 3:24-90 = DAG 3:24-90\nDAN 3:91-100 = DAN 3:24-33\n# Susanna\nDAN 13:1-64 = SUS 1:1-64\n# Bel and the Dragon\nDAN 14:1-42 = BEL 1:1-42\n#--------------------------------------------------\n# Mapping Esther Greek onto LXX Esther Greek\n#\n# This maps the standard verses generated by Create Book\n# to the actual verse numbers and segments found in the LXX\n# ESG chapter 1\nESG 1:1 = ESG 1:1a\nESG 1:2 = ESG 1:1b\nESG 1:3 = ESG 1:1c\nESG 1:4 = ESG 1:1d\nESG 1:5 = ESG 1:1e\nESG 1:6 = ESG 1:1f\nESG 1:7 = ESG 1:1g\nESG 1:8 = ESG 1:1h\nESG 1:9 = ESG 1:1i\nESG 1:10 = ESG 1:1k\nESG 1:11 = ESG 1:1l\nESG 1:12 = ESG 1:1m\nESG 1:13 = ESG 1:1n\nESG 1:14 = ESG 1:1o\nESG 1:15 = ESG 1:1p\nESG 1:16 = ESG 1:1q\nESG 1:17 = ESG 1:1r\nESG 1:18 = ESG 1:1s\nESG 1:19-39 = ESG 1:2-22\n# ESG chapter 3\nESG 3:14 = ESG 3:13a\nESG 3:15 = ESG 3:13b\nESG 3:16 = ESG 3:13c\nESG 3:17 = ESG 3:13d\nESG 3:18 = ESG 3:13e\nESG 3:19 = ESG 3:13f\nESG 3:20 = ESG 3:13g\nESG 3:21 = ESG 3:14\nESG 3:22 = ESG 3:15\n# ESG chapter 4\nESG 4:18 = ESG 4:17a\nESG 4:19 = ESG 4:17b\nESG 4:20 = ESG 4:17c\nESG 4:21 = ESG 4:17c\nESG 4:22 = ESG 4:17d\nESG 4:23 = ESG 4:17d\nESG 4:24 = ESG 4:17e\nESG 4:25 = ESG 4:17f\nESG 4:26 = ESG 4:17g\nESG 4:27 = ESG 4:17h\nESG 4:28 = ESG 4:17i\nESG 4:29 = ESG 4:17k\nESG 4:30 = ESG 4:17k\nESG 4:31 = ESG 4:17k\nESG 4:32 = ESG 4:17l\nESG 4:33 = ESG 4:17m\nESG 4:34 = ESG 4:17n\nESG 4:35 = ESG 4:17n\nESG 4:36 = ESG 4:17o\nESG 4:37 = ESG 4:17o\nESG 4:38 = ESG 4:17p\nESG 4:39 = ESG 4:17q\nESG 4:40 = ESG 4:17r\nESG 4:41 = ESG 4:17s\nESG 4:42 = ESG 4:17t\nESG 4:43 = ESG 4:17u\nESG 4:44 = ESG 4:17w\nESG 4:45 = ESG 4:17x\nESG 4:46 = ESG 4:17y\nESG 4:47 = ESG 4:17z\n# ESG chapter 5\nESG 5:2 = ESG 5:1a\nESG 5:3 = ESG 5:1a\nESG 5:4 = ESG 5:1a\nESG 5:5 = ESG 5:1b\nESG 5:6 = ESG 5:1c\nESG 5:7 = ESG 5:1d\nESG 5:8 = ESG 5:1e\nESG 5:9 = ESG 5:1f\nESG 5:10 = ESG 5:1f\nESG 5:11 = ESG 5:2\nESG 5:12 = ESG 5:2\nESG 5:13 = ESG 5:2a\nESG 5:14 = ESG 5:2a\nESG 5:15 = ESG 5:2b\nESG 5:16 = ESG 5:2b\nESG 5:17-28 = ESG 5:3-14\n# ESG chapter 8\nESG 8:13 = ESG 8:12a\nESG 8:14 = ESG 8:12b\nESG 8:15 = ESG 8:12c\nESG 8:16 = ESG 8:12d\nESG 8:17 = ESG 8:12e\nESG 8:18 = ESG 8:12f\nESG 8:19 = ESG 8:12g\nESG 8:20 = ESG 8:12h\nESG 8:21 = ESG 8:12i\nESG 8:22 = ESG 8:12k\nESG 8:23 = ESG 8:12l\nESG 8:24 = ESG 8:12m\nESG 8:25 = ESG 8:12n\nESG 8:26 = ESG 8:12o\nESG 8:27 = ESG 8:12p\nESG 8:28 = ESG 8:12q\nESG 8:29 = ESG 8:12r\nESG 8:30 = ESG 8:12s\nESG 8:31 = ESG 8:12t\nESG 8:32 = ESG 8:12u\nESG 8:33 = ESG 8:12x\nESG 8:34 = ESG 8:12y\nESG 8:35 = ESG 8:12y\nESG 8:36 = ESG 8:12y\nESG 8:37-41 = ESG 8:13-17\n# ESG chapter 10\nESG 10:4 = ESG 10:3a\nESG 10:5 = ESG 10:3b\nESG 10:6 = ESG 10:3c\nESG 10:7 = ESG 10:3d\nESG 10:8 = ESG 10:3e\nESG 10:9 = ESG 10:3f\nESG 10:10 = ESG 10:3g\nESG 10:11 = ESG 10:3h\nESG 10:12 = ESG 10:3i\nESG 10:13 = ESG 10:3k\nESG 10:14 = ESG 10:3l\n'},vul:{raw:"# Versification \"Vulgate\"\n# Version=1.5\n# \n# modifications by Studge 26/June/2009\n# this is for Bibles which follow the versification of the Vulgate, mainly Catholic Bibles\n# therefore this includes deuterocanonical books from Vulgate and Latin manuscripts\n# Vulgate projects in Paratext are VUL83 (Stuttgart text) and NVL98 (Nova Vulgata) [Studge]\n#\n# mapping for XXA -> PSA has been deleted [requested by RdB - Barb]\n# XXB has been moved to LAO [Barb] Jan 2011\n#\n# No mapping done for TOB, JDT and SIR, since they seem to follow another 'vorlage' than LXX\n# The versification of 2ES present here should become THE standard/original versification of this book! (Vulgate is 'the original' text of this book)\n#\n# List of books, chapters, verses\n# One line per book.\n# One entry for each chapter.\n# Verse number is the maximum verse number for that chapter.\n# See the lines containing ='s below for verse mappings.\n#\n#-----------------------------------------------------------\n# Old Testament\nGEN 1:31 2:25 3:24 4:26 5:32 6:22 7:24 8:22 9:29 10:32 11:32 12:20 13:18 14:24 15:21 16:16 17:27 18:33 19:38 20:18 21:34 22:24 23:20 24:67 25:34 26:35 27:46 28:22 29:35 30:43 31:55 32:32 33:20 34:31 35:29 36:43 37:36 38:30 39:23 40:23 41:57 42:38 43:34 44:34 45:28 46:34 47:31 48:22 49:32 50:25\nEXO 1:22 2:25 3:22 4:31 5:23 6:30 7:25 8:32 9:35 10:29 11:10 12:51 13:22 14:31 15:27 16:36 17:16 18:27 19:25 20:26 21:36 22:31 23:33 24:18 25:40 26:37 27:21 28:43 29:46 30:38 31:18 32:35 33:23 34:35 35:35 36:38 37:29 38:31 39:43 40:36\nLEV 1:17 2:16 3:17 4:35 5:19 6:30 7:38 8:36 9:24 10:20 11:47 12:8 13:59 14:57 15:33 16:34 17:16 18:30 19:37 20:27 21:24 22:33 23:44 24:23 25:55 26:45 27:34\nNUM 1:54 2:34 3:51 4:49 5:31 6:27 7:89 8:26 9:23 10:36 11:34 12:15 13:34 14:45 15:41 16:50 17:13 18:32 19:22 20:30 21:35 22:41 23:30 24:25 25:18 26:65 27:23 28:31 29:39 30:17 31:54 32:42 33:56 34:29 35:34 36:13\nDEU 1:46 2:37 3:29 4:49 5:33 6:25 7:26 8:20 9:29 10:22 11:32 12:32 13:18 14:29 15:23 16:22 17:20 18:22 19:21 20:20 21:23 22:30 23:25 24:22 25:19 26:19 27:26 28:68 29:29 30:20 31:30 32:52 33:29 34:12\nJOS 1:18 2:24 3:17 4:25 5:16 6:27 7:26 8:35 9:27 10:43 11:23 12:24 13:33 14:15 15:63 16:10 17:18 18:28 19:51 20:9 21:43 22:34 23:16 24:33\nJDG 1:36 2:23 3:31 4:24 5:32 6:40 7:25 8:35 9:57 10:18 11:40 12:15 13:25 14:20 15:20 16:31 17:13 18:31 19:30 20:48 21:24\nRUT 1:22 2:23 3:18 4:22\n1SA 1:28 2:36 3:21 4:22 5:12 6:21 7:17 8:22 9:27 10:27 11:15 12:25 13:23 14:52 15:35 16:23 17:58 18:30 19:24 20:43 21:15 22:23 23:28 24:23 25:44 26:25 27:12 28:25 29:11 30:31 31:13\n2SA 1:27 2:32 3:39 4:12 5:25 6:23 7:29 8:18 9:13 10:19 11:27 12:31 13:39 14:33 15:37 16:23 17:29 18:33 19:43 20:26 21:22 22:51 23:39 24:25\n1KI 1:53 2:46 3:28 4:34 5:18 6:38 7:51 8:66 9:28 10:29 11:43 12:33 13:34 14:31 15:34 16:34 17:24 18:46 19:21 20:43 21:29 22:54\n2KI 1:18 2:25 3:27 4:44 5:27 6:33 7:20 8:29 9:37 10:36 11:21 12:21 13:25 14:29 15:38 16:20 17:41 18:37 19:37 20:21 21:26 22:20 23:37 24:20 25:30\n1CH 1:54 2:55 3:24 4:43 5:26 6:81 7:40 8:40 9:44 10:14 11:46 12:40 13:14 14:17 15:29 16:43 17:27 18:17 19:19 20:7 21:30 22:19 23:32 24:31 25:31 26:32 27:34 28:21 29:30\n2CH 1:17 2:18 3:17 4:22 5:14 6:42 7:22 8:18 9:31 10:19 11:23 12:16 13:22 14:15 15:19 16:14 17:19 18:34 19:11 20:37 21:20 22:12 23:21 24:27 25:28 26:23 27:9 28:27 29:36 30:27 31:21 32:33 33:25 34:33 35:27 36:23\nEZR 1:11 2:70 3:13 4:24 5:17 6:22 7:28 8:36 9:15 10:44\n# EZR is for the Vulgate book called 1 Esdras\nNEH 1:11 2:20 3:31 4:23 5:19 6:19 7:73 8:18 9:38 10:39 11:36 12:46 13:31\n# NEH is for the Vulgate book called 2 Esdras\n#------------------------------------\n# In the Vulgate projects VUL83 Esther is the Greek Esther not Hebrew Esther, this definition is for Greek Esther. The book has been put under EST instead of ESG [Studge]\n# in VUL83 the definition of EST is\n#EST 1:22 2:23 3:15 4:17 5:14 6:14 7:10 8:17 9:32 10:13 11:12 12:6 13:18 14:19 15:19 16:24\n# in NVL98 Nova Vulgata the definition of EST is\nEST 1:32 2:23 3:15 4:47 5:28 6:14 7:10 8:41 9:32 10:13 \n# Note that chapter 3 v 15 is 15a-i\n# Note that chapter 4 v 47 is 17aa-kk\n#-----------------------------------\nJOB 1:22 2:13 3:26 4:21 5:27 6:30 7:21 8:22 9:35 10:22 11:20 12:25 13:28 14:22 15:35 16:23 17:16 18:21 19:29 20:29 21:34 22:30 23:17 24:25 25:6 26:14 27:23 28:28 29:25 30:31 31:40 32:22 33:33 34:37 35:16 36:33 37:24 38:41 39:35 40:28 41:25 42:16\nPSA 1:6 2:13 3:9 4:10 5:13 6:11 7:18 8:10 9:39 10:8 11:9 12:6 13:7 14:5 15:10 16:15 17:51 18:15 19:10 20:14 21:32 22:6 23:10 24:22 25:12 26:14 27:9 28:11 29:13 30:25 31:11 32:22 33:23 34:28 35:13 36:40 37:23 38:14 39:18 40:14 41:12 42:5 43:26 44:18 45:12 46:10 47:15 48:21 49:23 50:21 51:11 52:7 53:9 54:24 55:13 56:12 57:12 58:18 59:14 60:9 61:13 62:12 63:11 64:14 65:20 66:8 67:36 68:37 69:6 70:24 71:20 72:28 73:23 74:11 75:13 76:21 77:72 78:13 79:20 80:17 81:8 82:19 83:13 84:14 85:17 86:7 87:19 88:53 89:17 90:16 91:16 92:5 93:23 94:11 95:13 96:12 97:9 98:9 99:5 100:8 101:29 102:22 103:35 104:45 105:48 106:43 107:14 108:31 109:7 110:10 111:10 112:9 113:26 114:9 115:19 116:2 117:29 118:176 119:7 120:8 121:9 122:4 123:8 124:5 125:6 126:5 127:6 128:8 129:8 130:3 131:18 132:3 133:3 134:21 135:26 136:9 137:8 138:24 139:14 140:10 141:8 142:12 143:15 144:21 145:10 146:11 147:20 148:14 149:9 150:6\nPRO 1:33 2:22 3:35 4:27 5:23 6:35 7:27 8:36 9:18 10:32 11:31 12:28 13:25 14:35 15:33 16:33 17:28 18:24 19:29 20:30 21:31 22:29 23:35 24:34 25:28 26:28 27:27 28:28 29:27 30:33 31:31\nECC 1:18 2:26 3:22 4:17 5:19 6:11 7:30 8:17 9:18 10:20 11:10 12:14\nSNG 1:16 2:17 3:11 4:16 5:17 6:12 7:13 8:14\nISA 1:31 2:22 3:26 4:6 5:30 6:13 7:25 8:22 9:21 10:34 11:16 12:6 13:22 14:32 15:9 16:14 17:14 18:7 19:25 20:6 21:17 22:25 23:18 24:23 25:12 26:21 27:13 28:29 29:24 30:33 31:9 32:20 33:24 34:17 35:10 36:22 37:38 38:22 39:8 40:31 41:29 42:25 43:28 44:28 45:25 46:13 47:15 48:22 49:26 50:11 51:23 52:15 53:12 54:17 55:13 56:12 57:21 58:14 59:21 60:22 61:11 62:12 63:19 64:12 65:25 66:24\nJER 1:19 2:37 3:25 4:31 5:31 6:30 7:34 8:22 9:26 10:25 11:23 12:17 13:27 14:22 15:21 16:21 17:27 18:23 19:15 20:18 21:14 22:30 23:40 24:10 25:38 26:24 27:22 28:17 29:32 30:24 31:40 32:44 33:26 34:22 35:19 36:32 37:20 38:28 39:18 40:16 41:18 42:22 43:13 44:30 45:5 46:28 47:7 48:47 49:39 50:46 51:64 52:34\nLAM 1:22 2:22 3:66 4:22 5:22\nEZK 1:28 2:9 3:27 4:17 5:17 6:14 7:27 8:18 9:11 10:22 11:25 12:28 13:23 14:23 15:8 16:63 17:24 18:32 19:14 20:49 21:32 22:31 23:49 24:27 25:17 26:21 27:36 28:26 29:21 30:26 31:18 32:32 33:33 34:31 35:15 36:38 37:28 38:23 39:29 40:49 41:26 42:20 43:27 44:31 45:25 46:24 47:23 48:35\n#-------------------\n# Daniel in NVL98 has 14 chapters and is Greek LXX Daniel\n# the Additions to Daniel are repeated in S3Y, SUS and BEL in NVL98\n# in NVL98 and VUL83, DAN is used for Greek Daniel and it should be under DAG\nDAN 1:21 2:49 3:100 4:34 5:31 6:28 7:28 8:27 9:27 10:21 11:45 12:13 13:65 14:41\n#\n#--------------------\nHOS 1:11 2:24 3:5 4:19 5:15 6:11 7:16 8:14 9:17 10:15 11:12 12:14 13:15 14:10\nJOL 1:20 2:32 3:21\nAMO 1:15 2:16 3:15 4:13 5:27 6:15 7:17 8:14 9:15\nOBA 1:21\nJON 1:16 2:11 3:10 4:11\nMIC 1:16 2:13 3:12 4:13 5:14 6:16 7:20\nNAM 1:15 2:13 3:19\nHAB 1:17 2:20 3:19\nZEP 1:18 2:15 3:20\nHAG 1:14 2:24\nZEC 1:21 2:13 3:10 4:14 5:11 6:15 7:14 8:23 9:17 10:12 11:17 12:14 13:9 14:21\nMAL 1:14 2:17 3:18 4:6\n#--------------------------------------\n# New Testament books\nMAT 1:25 2:23 3:17 4:25 5:48 6:34 7:29 8:34 9:38 10:42 11:30 12:50 13:58 14:36 15:39 16:28 17:26 18:35 19:30 20:34 21:46 22:46 23:39 24:51 25:46 26:75 27:66 28:20\nMRK 1:45 2:28 3:35 4:40 5:43 6:56 7:37 8:39 9:49 10:52 11:33 12:44 13:37 14:72 15:47 16:20\nLUK 1:80 2:52 3:38 4:44 5:39 6:49 7:50 8:56 9:62 10:42 11:54 12:59 13:35 14:35 15:32 16:31 17:37 18:43 19:48 20:47 21:38 22:71 23:56 24:53\nJHN 1:51 2:25 3:36 4:54 5:47 6:72 7:53 8:59 9:41 10:42 11:57 12:50 13:38 14:31 15:27 16:33 17:26 18:40 19:42 20:31 21:25\nACT 1:26 2:47 3:26 4:37 5:42 6:15 7:59 8:40 9:43 10:48 11:30 12:25 13:52 14:27 15:41 16:40 17:34 18:28 19:40 20:38 21:40 22:30 23:35 24:27 25:27 26:32 27:44 28:31\nROM 1:32 2:29 3:31 4:25 5:21 6:23 7:25 8:39 9:33 10:21 11:36 12:21 13:14 14:23 15:33 16:27\n1CO 1:31 2:16 3:23 4:21 5:13 6:20 7:40 8:13 9:27 10:33 11:34 12:31 13:13 14:40 15:58 16:24\n2CO 1:24 2:17 3:18 4:18 5:21 6:18 7:16 8:24 9:15 10:18 11:33 12:21 13:13\nGAL 1:24 2:21 3:29 4:31 5:26 6:18\nEPH 1:23 2:22 3:21 4:32 5:33 6:24\nPHP 1:30 2:30 3:21 4:23\nCOL 1:29 2:23 3:25 4:18\n1TH 1:10 2:20 3:13 4:18 5:28\n2TH 1:12 2:17 3:18\n1TI 1:20 2:15 3:16 4:16 5:25 6:21\n2TI 1:18 2:26 3:17 4:22\nTIT 1:16 2:15 3:15\nPHM 1:25\nHEB 1:14 2:18 3:19 4:16 5:14 6:20 7:28 8:13 9:28 10:39 11:40 12:29 13:25\nJAS 1:27 2:26 3:18 4:17 5:20\n1PE 1:25 2:25 3:22 4:19 5:14\n2PE 1:21 2:22 3:18\n1JN 1:10 2:29 3:24 4:21 5:21\n2JN 1:13\n3JN 1:15\nJUD 1:25\nREV 1:20 2:29 3:22 4:11 5:14 6:17 7:17 8:13 9:21 10:11 11:19 12:18 13:18 14:20 15:8 16:21 17:18 18:24 19:21 20:15 21:27 22:21\n#-------------------------------------------------\n# Deuterocanonical books in the Catholic tradition\nTOB 1:25 2:23 3:25 4:23 5:28 6:22 7:20 8:24 9:12 10:13 11:21 12:22 13:23 14:17\nJDT 1:12 2:18 3:15 4:17 5:29 6:21 7:25 8:34 9:19 10:20 11:21 12:20 13:31 14:18 15:15 16:31\n#---------\n# ESG for Esther Greek has been put under EST in NVL98, a blank ESG was included in VUL83\n# this definition for ESG is for the full Esther Greek which is in the Vulgate NVL98 [Studge]\nESG 1:39 2:23 3:22 4:47 5:28 6:14 7:10 8:39 9:32 10:13\n#---------\nWIS 1:16 2:25 3:19 4:20 5:24 6:27 7:30 8:21 9:19 10:21 11:27 12:27 13:19 14:31 15:19 16:29 17:20 18:25 19:20\nSIR 1:40 2:23 3:34 4:36 5:18 6:37 7:40 8:22 9:25 10:34 11:36 12:19 13:32 14:27 15:22 16:31 17:31 18:33 19:28 20:33 21:31 22:33 23:38 24:47 25:36 26:28 27:33 28:30 29:35 30:27 31:42 32:28 33:33 34:31 35:26 36:28 37:34 38:39 39:41 40:32 41:28 42:26 43:37 44:27 45:31 46:23 47:31 48:28 49:19 50:31 51:38 52:13\nBAR 1:22 2:35 3:38 4:37 5:9 6:72\nLJE 1:72\n# NB Letter of Jeremiah is chapter 6 of Baruch in the Vulgate tradition [Studge]\n# the 3 additions to Daniel are part of Daniel in the Vulgate tradition [Studge]\nS3Y 1:67\nSUS 1:64\nBEL 1:42\n1MA 1:67 2:70 3:60 4:61 5:68 6:63 7:50 8:32 9:73 10:89 11:74 12:54 13:54 14:49 15:41 16:24\n2MA 1:36 2:33 3:40 4:50 5:27 6:31 7:42 8:36 9:29 10:38 11:38 12:46 13:26 14:46 15:40\n#--------------------------------------------------\n# Note that 3MA and 4MA are in the LXX tradition but not in the Vulgate, and not in VUL83 Latin critical text, but maybe in Interconfessional editions [Studge]\n3MA 1:29 2:33 3:30 4:21 5:51 6:41 7:23\n4MA 1:35 2:24 3:21 4:26 5:38 6:35 7:23 8:29 9:32 10:21 11:27 12:19 13:27 14:20 15:32 16:25 17:24 18:24\n#----------------------------------------------------\n# 1ES, 2ES, MAN and PS2 are in the Vulgate Apocrypha, but not in modern Catholic Bibles, but maybe in Interconfessional editions [Studge]\n1ES 1:58 2:31 3:24 4:63 5:73 6:34 7:15 8:97 9:56\n# 1ES is for the Vulgate book called 3 Esdras\n2ES 1:40 2:48 3:36 4:52 5:55 6:59 7:139 8:63 9:47 10:60 11:46 12:51 13:58 14:47 15:63 16:78\n# 2ES is for the Vulgate book called 4 Esdras\nMAN 1:15\nPS2 1:7\n#-----------------------------------------------------\n# ODA and PSS are only in LXX and SYR and not needed in any Vulgate manuscripts or any Catholic Bibles, I am not convinced they are needed in this versification file [Studge]\n#ODA 1:19 2:43 3:10 4:19 5:12 6:8 7:20 8:37 9:22 10:9 11:11 12:15 13:4 14:46\n#PSS 1:8 2:37 3:12 4:25 5:19 6:6 7:10 8:34 9:11 10:8 11:9 12:6 13:12 14:10 15:13 16:15 17:46 18:12\n#------------------------------------------------------\n# Variant LXX books, only used in LXX, now obselete in Paratext 7, never part of Vulgate\n# if these codes were used in any Vulgate versification projects they used the wrong code, and so the definitions are not relevant [Studge]\n# JSA 1:18 2:24 3:17 4:24 5:15 6:27 7:26 8:35 9:27 10:43 11:23 12:24 13:33 14:15 15:63 16:10 17:18 18:28 19:51 20:9 21:45 22:34 23:16 24:33\n# JDB 1:36 2:23 3:31 4:24 5:31 6:40 7:25 8:35 9:57 10:18 11:40 12:15 13:25 14:20 15:20 16:31 17:13 18:31 19:30 20:48 21:25\n# TBS 1:22 2:14 3:17 4:21 5:23 6:19 7:17 8:21 9:6 10:14 11:19 12:22 13:18 14:15\n# SST 1:64\n# DNT 1:21 2:49 3:97 4:37 5:30 6:29 7:28 8:27 9:27 10:21 11:45 12:13\n# BLT 1:42\n#------------------------------------------------------\n# add in versifications for 4,5 & 6 Ezra which are in Latin manuscripts [Studge]\n5EZ 1:40 2:48 \nEZA 1:36 2:52 3:55 4:59 5:139 6:63 7:47 8:60 9:46 10:51 11:58 12:47 \n6EZ 1:63 12:78\n#------------------------------------------------------\n# XXA and XXB books in project VUL83, left for backward compatability\n# XXA was used for a variant form of Psalms, but should be in a Latin Variant project [Studge]\n# XXA 1:6 2:13 3:9 4:10 5:13 6:11 7:18 8:10 9:39 10:8 11:9 12:6 13:7 14:5 15:10 16:15 17:51 18:15 19:10 20:14 21:32 22:6 23:10 24:22 25:12 26:14 27:9 28:11 29:13 30:25 31:11 32:22 33:23 34:28 35:13 36:40 37:23 38:14 39:18 40:14 41:12 42:5 43:26 44:18 45:12 46:10 47:15 48:21 49:23 50:21 51:11 52:7 53:9 54:24 55:13 56:12 57:12 58:18 59:14 60:9 61:13 62:12 63:11 64:14 65:20 66:8 67:36 68:37 69:6 70:24 71:20 72:28 73:23 74:11 75:13 76:21 77:72 78:13 79:20 80:17 81:8 82:19 83:13 84:14 85:17 86:7 87:19 88:53 89:17 90:16 91:16 92:5 93:23 94:11 95:13 96:12 97:9 98:9 99:5 100:8 101:29 102:22 103:35 104:45 105:48 106:43 107:14 108:31 109:7 110:10 111:10 112:9 113:26 114:9 115:19 116:2 117:29 118:176 119:7 120:8 121:9 122:4 123:8 124:5 125:6 126:5 127:6 128:8 129:8 130:3 131:18 132:3 133:3 134:21 135:26 136:9 137:8 138:24 139:14 140:10 141:8 142:12 143:15 144:21 145:10 146:11 147:20 148:14 149:9 150:6\n# XXB was used for the Letter to the Laodiceans, but should be under LAO [Studge]\n# XXB 1:20\n#----------------------------------------------------------\n# Daniel Greek is currently under DAN [Studge]\nDAG 1:21 2:49 3:97 4:37 5:31 6:28 7:28 8:27 9:27 10:21 11:45 12:13 13:64 14:42\n# Letter to the Laodiceans in the VUL83 and some mediaeval translations of the Vulgate e.g. John Wycliffe's English Bible, appeared after Revelation [Studge]\nLAO 1:20\n#----------------------------------------------------------\n# Mapping\n#----------------------------------------------------------\n# Vulgate = BHS (see org.vrs)\n#\n# (Note: for performance reasons ranges must not span a chapter, e.g. 4:10-5:11 is illegal)\n#\nGEN 31:55 = GEN 32:1\nGEN 32:1-32 = GEN 32:2-33\n# missing <- GEN 49:32\nGEN 49:31 = GEN 49:31\nGEN 49:31 = GEN 49:32\nGEN 49:32 = GEN 49:33\n# GEN 50:22 <- GEN 50:22-23\nGEN 50:22 = GEN 50:22\nGEN 50:22 = GEN 50:23\nGEN 50:23-25 = GEN 50:24-26\nEXO 8:1-4 = EXO 7:26-29\nEXO 8:5-32 = EXO 8:1-28\nEXO 22:1 = EXO 21:37\nEXO 22:2-31 = EXO 22:1-30\n# EXO 40:13 <- EXO 40:13-15\nEXO 40:13 = EXO 40:13\nEXO 40:13 = EXO 40:14\nEXO 40:13 = EXO 40:15\nEXO 40:14-36 = EXO 40:16-38\nLEV 6:1-7 = LEV 5:20-26\nLEV 6:8-30 = LEV 6:1-23\n# LEV 26:45 <- LEV 26:45-46\nLEV 26:45 = LEV 26:45\nLEV 26:45 = LEV 26:46\n# NUM 11:34 <- NUM 11:34-35\nNUM 11:34 = NUM 11:34\nNUM 11:34 = NUM 11:35\nNUM 13:1 = NUM 12:16\nNUM 13:2-34 = NUM 13:1-33\nNUM 16:36-50 = NUM 17:1-15\nNUM 17:1-13 = NUM 17:16-28\n# NUM 20:28-29 -> NUM 20:28\nNUM 20:28 = NUM 20:28\nNUM 20:29 = NUM 20:28\nNUM 20:30 = NUM 20:29\n# NUM 26:1 <- NUM 25:19--26:1\nNUM 26:1 = NUM 25:19\nNUM 26:1 = NUM 26:1\nDEU 12:32 = DEU 13:1\nDEU 13:1-18 = DEU 13:2-19\nDEU 22:30 = DEU 23:1\nDEU 23:1-25 = DEU 23:2-26\nDEU 29:1 = DEU 28:69\nDEU 29:2-29 = DEU 29:1-28\n# JOS 4:23-24 -> JOS 4:23\nJOS 4:23 = JOS 4:23\nJOS 4:24 = JOS 4:23\nJOS 4:25 = JOS 4:24\n# JOS 5:14-15 -> JOS 5:14\nJOS 5:14 = JOS 5:14\nJOS 5:15 = JOS 5:14\nJOS 5:16 = JOS 5:15\n# JOS 21:36 (missing) <- JOS 21:36-37\nJOS 21:36 = JOS 21:36\nJOS 21:36 = JOS 21:37\n# JOS 21:37 <- JOS 21:38-39\nJOS 21:37 = JOS 21:38\nJOS 21:37 = JOS 21:39\nJOS 21:38-43 = JOS 21:40-45\n# JDG 5:31-32 -> JDG 5:31\nJDG 5:31 = JDG 5:31\nJDG 5:32 = JDG 5:31\n# JDG 21:24 <- JDG 21:24-25\nJDG 21:24 = JDG 21:24\nJDG 21:24 = JDG 21:25\n1SA 20:43 = 1SA 21:1\n1SA 21:1-15 = 1SA 21:2-16\n2SA 18:33 = 2SA 19:1\n2SA 19:1-43 = 2SA 19:2-44\n1KI 4:21-34 = 1KI 5:1-14\n1KI 5:1-18 = 1KI 5:15-32\n2KI 11:21 = 2KI 12:1\n2KI 12:1-21 = 2KI 12:2-22\n1CH 6:1-15 = 1CH 5:27-41\n1CH 6:16-81 = 1CH 6:1-66\n# 1CH 11:46 <- 1CH 11:46-47\n1CH 11:46 = 1CH 11:46\n1CH 11:46 = 1CH 11:47\n# 1CH 12:4 <- 1CH 12:4-5\n1CH 12:4 = 1CH 12:4\n1CH 12:4 = 1CH 12:5\n1CH 12:5-40 = 1CH 12:6-41\n# 1CH 20:7 <- 1CH 20:7-8\n1CH 20:7 = 1CH 20:7\n1CH 20:7 = 1CH 20:8\n2CH 2:1 = 2CH 1:18\n2CH 2:2-18 = 2CH 2:1-17\n2CH 14:1 = 2CH 13:23\n2CH 14:2-15 = 2CH 14:1-14\n# NEH 3:30 <- NEH 3:30-31\nNEH 3:30 = NEH 3:30\nNEH 3:30 = NEH 3:31\nNEH 3:31 = NEH 3:32\nNEH 4:1-6 = NEH 3:33-38\nNEH 4:7-23 = NEH 4:1-17\n# NEH 7:68 (missing) -> NEH 7:67b\nNEH 7:67 = NEH 7:67\nNEH 7:68 = NEH 7:67\nNEH 7:69-73 = NEH 7:68-72\nNEH 9:38 = NEH 10:1\nNEH 10:1-39 = NEH 10:2-40\n# NEH 12:33 <- NEH 12:33-34\nNEH 12:33 = NEH 12:33\nNEH 12:33 = NEH 12:34\nNEH 12:34-46 = NEH 12:35-47\n# mapping EST onto ESG, it should map ESG onto EST\n#EST 10:4-13 = ESG 1:4-13\n#EST 11:1-12 = ESG 2:1-12\n#EST 12:1-6 = ESG 3:1-6\n#EST 13:1-18 = ESG 4:1-18\n#EST 14:1-19 = ESG 5:1-19\n#EST 15:1-16 = ESG 6:1-16\n#EST 16:1-24 = ESG 7:1-24\n# JOB 16:4-5 -> JOB 16:4\nJOB 16:4 = JOB 16:4\nJOB 16:5 = JOB 16:4\nJOB 16:6-23 = JOB 16:5-22\nJOB 39:31-35 = JOB 40:1-5\nJOB 40:1-27 = JOB 40:6-32\nJOB 40:28 = JOB 41:1\nJOB 41:1-25 = JOB 41:2-26\n# JOB 42:16 <- JOB 42:16-17\nJOB 42:16 = JOB 42:16\nJOB 42:16 = JOB 42:17\n# In PSA, the equivalent mappings (in chs. 1-9; 147-150) are given too, because XXA is mapped to PSA as well !!!\n# There could still be some errors regarding the irregular mapping of psalm titles (like in PSA 12:1 <- PSA 13:1-2)\nPSA 1:0-6 = PSA 1:0-6\nPSA 2:0-11 = PSA 2:0-11\n# PSA 2:12-13 -> PSA 2:12\nPSA 2:12 = PSA 2:12\nPSA 2:13 = PSA 2:12\nPSA 3:0-9 = PSA 3:0-9\nPSA 4:0-8 = PSA 4:0-8\n# PSA 4:9-10 -> PSA 4:9\nPSA 4:9 = PSA 4:9\nPSA 4:10 = PSA 4:9\nPSA 5:0-13 = PSA 5:0-13\nPSA 6:0-11 = PSA 6:0-11\nPSA 7:0-18 = PSA 7:0-18\nPSA 8:0-10 = PSA 8:0-10\nPSA 9:0-21 = PSA 9:0-21\nPSA 9:22 = PSA 10:0\nPSA 9:22-39 = PSA 10:1-18\n# PSA 10:1-2 -> PSA 11:1\nPSA 10:0-1 = PSA 11:0-1\nPSA 10:2 = PSA 11:1\nPSA 10:3-8 = PSA 11:2-7\nPSA 11:0-9 = PSA 12:0-9\n# PSA 12:1 <- PSA 13:1-2\nPSA 12:0-1 = PSA 13:0-1\nPSA 12:1 = PSA 13:2\n# PSA 12:2-3 -> PSA 13:3\nPSA 12:2 = PSA 13:3\nPSA 12:3 = PSA 13:3\nPSA 12:4-6 = PSA 13:4-6\nPSA 13:0-7 = PSA 14:0-7\nPSA 14:0-1 = PSA 15:0-1\n# PSA 14:3a = PSA 15:2b\nPSA 14:2 = PSA 15:2\nPSA 14:3 = PSA 15:2\nPSA 14:3 = PSA 15:3\nPSA 14:4-5 = PSA 15:4-5\nPSA 15:0-9 = PSA 16:0-9\n# PSA 15:10 <- PSA 16:10-11\nPSA 15:10 = PSA 16:10\nPSA 15:10 = PSA 16:11\nPSA 16:0-15 = PSA 17:0-15\nPSA 17:0-51 = PSA 18:0-51\nPSA 18:0-15 = PSA 19:0-15\nPSA 19:0-10 = PSA 20:0-10\nPSA 20:0-14 = PSA 21:0-14\nPSA 21:0-32 = PSA 22:0-32\nPSA 22:0-6 = PSA 23:0-6\nPSA 23:0-10 = PSA 24:0-10\nPSA 24:0-22 = PSA 25:0-22\nPSA 25:0-12 = PSA 26:0-12\nPSA 26:0-14 = PSA 27:0-14\nPSA 27:0-9 = PSA 28:0-9\nPSA 28:0-11 = PSA 29:0-11\nPSA 29:0-13 = PSA 30:0-13\nPSA 30:0-25 = PSA 31:0-25\nPSA 31:0-11 = PSA 32:0-11\nPSA 32:0-22 = PSA 33:0-22\nPSA 33:0-23 = PSA 34:0-23\nPSA 34:0-28 = PSA 35:0-28\nPSA 35:0-13 = PSA 36:0-13\nPSA 36:0-40 = PSA 37:0-40\nPSA 37:0-23 = PSA 38:0-23\nPSA 38:0-14 = PSA 39:0-14\nPSA 39:0-18 = PSA 40:0-18\nPSA 40:0-14 = PSA 41:0-14\nPSA 41:0-12 = PSA 42:0-12\nPSA 42:0-5 = PSA 43:0-5\nPSA 43:0-21 = PSA 44:0-21\n# PSA 43:22 <- PSA 44:22-23\nPSA 43:22 = PSA 44:22\nPSA 43:22 = PSA 44:23\nPSA 43:23-26 = PSA 44:24-27\nPSA 44:0-18 = PSA 45:0-18\nPSA 45:0-12 = PSA 46:0-12\nPSA 46:0-10 = PSA 47:0-10\nPSA 47:0-15 = PSA 48:0-15\nPSA 48:0-21 = PSA 49:0-21\nPSA 49:0-23 = PSA 50:0-23\nPSA 50:0-21 = PSA 51:0-21\nPSA 51:0-11 = PSA 52:0-11\nPSA 52:0-7 = PSA 53:0-7\nPSA 53:0-9 = PSA 54:0-9\nPSA 54:0-24 = PSA 55:0-24\nPSA 55:0-10 = PSA 56:0-10\n# PSA 55:11 <- PSA 56:11-12\nPSA 55:11 = PSA 56:11\nPSA 55:11 = PSA 56:12\nPSA 55:12-13 = PSA 56:13-14\nPSA 56:0-12 = PSA 57:0-12\nPSA 57:0-12 = PSA 58:0-12\nPSA 58:0-18 = PSA 59:0-18\nPSA 59:0-14 = PSA 60:0-14\nPSA 60:0-9 = PSA 61:0-9\nPSA 61:0-13 = PSA 62:0-13\nPSA 62:0-12 = PSA 63:0-12\nPSA 63:0-11 = PSA 64:0-11\nPSA 64:0-14 = PSA 65:0-14\nPSA 65:0-20 = PSA 66:0-20\nPSA 66:0-8 = PSA 67:0-8\nPSA 67:0-36 = PSA 68:0-36\nPSA 68:0-37 = PSA 69:0-37\nPSA 69:0-6 = PSA 70:0-6\nPSA 70:0-24 = PSA 71:0-24\nPSA 71:0-20 = PSA 72:0-20\nPSA 72:0-28 = PSA 73:0-28\nPSA 73:0-23 = PSA 74:0-23\nPSA 74:0-11 = PSA 75:0-11\nPSA 75:0-13 = PSA 76:0-13\nPSA 76:0-21 = PSA 77:0-21\nPSA 77:0-72 = PSA 78:0-72\nPSA 78:0-13 = PSA 79:0-13\nPSA 79:0-20 = PSA 80:0-20\nPSA 80:0-17 = PSA 81:0-17\nPSA 81:0-8 = PSA 82:0-8\nPSA 82:0-19 = PSA 83:0-19\nPSA 83:0-13 = PSA 84:0-13\nPSA 84:0-14 = PSA 85:0-14\nPSA 85:0-17 = PSA 86:0-17\nPSA 86:0-7 = PSA 87:0-7\nPSA 87:0-19 = PSA 88:0-19\nPSA 88:0-53 = PSA 89:0-53\nPSA 89:0-17 = PSA 90:0-17\nPSA 90:0-16 = PSA 91:0-16\nPSA 91:0-16 = PSA 92:0-16\nPSA 92:0-5 = PSA 93:0-5\nPSA 93:0-23 = PSA 94:0-23\nPSA 94:0-11 = PSA 95:0-11\nPSA 95:0-13 = PSA 96:0-13\nPSA 96:0-12 = PSA 97:0-12\nPSA 97:0-9 = PSA 98:0-9\nPSA 98:0-9 = PSA 99:0-9\nPSA 99:0-5 = PSA 100:0-5\nPSA 100:0-8 = PSA 101:0-8\nPSA 101:0-29 = PSA 102:0-29\nPSA 102:0-22 = PSA 103:0-22\nPSA 103:0-35 = PSA 104:0-35\nPSA 104:0-45 = PSA 105:0-45\nPSA 105:0-48 = PSA 106:0-48\nPSA 106:0-43 = PSA 107:0-43\nPSA 107:0-14 = PSA 108:0-14\nPSA 108:0-31 = PSA 109:0-31\nPSA 109:0-7 = PSA 110:0-7\nPSA 110:0-10 = PSA 111:0-10\nPSA 111:0-10 = PSA 112:0-10\nPSA 112:0-9 = PSA 113:0-9\nPSA 113:0-8 = PSA 114:0-8\nPSA 113:9 = PSA 115:0\nPSA 113:9-26 = PSA 115:1-18\nPSA 114:1-9 = PSA 116:1-9\n# What does 115:1-9 map to? this seems very wrong\nPSA 115:10-19 = PSA 116:10-19\nPSA 116:0-2 = PSA 117:0-2\nPSA 117:0-29 = PSA 118:0-29\nPSA 118:0-176 = PSA 119:0-176\nPSA 119:0-7 = PSA 120:0-7\nPSA 120:0-8 = PSA 121:0-8\nPSA 121:0-9 = PSA 122:0-9\nPSA 122:0-4 = PSA 123:0-4\nPSA 123:0-8 = PSA 124:0-8\nPSA 124:0-5 = PSA 125:0-5\nPSA 125:0-6 = PSA 126:0-6\nPSA 126:0-5 = PSA 127:0-5\nPSA 127:0-6 = PSA 128:0-6\nPSA 128:0-8 = PSA 129:0-8\nPSA 129:0-8 = PSA 130:0-8\nPSA 130:0-3 = PSA 131:0-3\nPSA 131:0-18 = PSA 132:0-18\nPSA 132:0-3 = PSA 133:0-3\nPSA 133:0-3 = PSA 134:0-3\nPSA 134:0-21 = PSA 135:0-21\nPSA 135:0-26 = PSA 136:0-26\nPSA 136:0-9 = PSA 137:0-9\nPSA 137:0-8 = PSA 138:0-8\nPSA 138:0-24 = PSA 139:0-24\nPSA 139:0-14 = PSA 140:0-14\nPSA 140:0-10 = PSA 141:0-10\nPSA 141:0-8 = PSA 142:0-8\nPSA 142:0-12 = PSA 143:0-12\nPSA 143:0-15 = PSA 144:0-15\nPSA 144:0-21 = PSA 145:0-21\n# PSA 145:2a = PSA 146:1b\nPSA 145:0-1 = PSA 146:0-1\nPSA 145:2 = PSA 146:1\nPSA 145:2 = PSA 146:2\nPSA 145:3-10 = PSA 146:3-10\nPSA 146:0-11 = PSA 147:0-11\nPSA 147:12-20 = PSA 147:12-20\nPSA 148:0-14 = PSA 148:0-14\nPSA 149:0-9 = PSA 149:0-9\nPSA 150:0-6 = PSA 150:0-6\nECC 7:1 = ECC 6:12\nECC 7:2-30 = ECC 7:1-29\nSNG 1:1 = SNG 1:1\nSNG 1:1-16 = SNG 1:2-17\nSNG 5:17 = SNG 6:1\nSNG 6:1-11 = SNG 6:2-12\n# SNG 6:12 -> SNG 7:1a\n# SNG 7:1 <- SNG 7:1b-2\n# or: SNG 6:12--7:1 = SNG 7:1-2\nSNG 6:12 = SNG 7:1\nSNG 7:1 = SNG 7:1\nSNG 7:1 = SNG 7:2\nSNG 7:2-13 = SNG 7:3-14\n# ISA 8:22d = ISA 8:23a\nISA 8:22 = ISA 8:22\nISA 8:22 = ISA 8:23\nISA 9:1 = ISA 8:23\nISA 9:2-21 = ISA 9:1-20\n# ISA 9:20d = ISA 9:20ab\nISA 9:20 = ISA 9:19\nISA 9:20 = ISA 9:20\nISA 9:21 = ISA 9:20\n# ISA 64:1 -> ISA 63:19cd\nISA 63:19 = ISA 63:19\nISA 64:1 = ISA 63:19\nISA 64:2-12 = ISA 64:1-11\nJER 9:1 = JER 8:23\nJER 9:2-26 = JER 9:1-25\n# JER 37:4 <- JER 37:4-5\nJER 37:4 = JER 37:4\nJER 37:4 = JER 37:5\nJER 37:5-20 = JER 37:6-21\n# EZK 2:9 <- EZK 2:9-10\nEZK 2:9 = EZK 2:9\nEZK 2:9 = EZK 2:10\nEZK 20:45-49 = EZK 21:1-5\nEZK 21:1-32 = EZK 21:6-37\nDAN 3:24-90 = S3Y 1:1-67\nDAN 3:91-100 = DAN 3:24-33\nDAN 5:31 = DAN 6:1\nDAN 6:1-28 = DAN 6:2-29\nDAN 13:1-64 = SUS 1:1-64\nDAN 13:65 = BEL 1:1\nDAN 14:1 = BEL 1:1\nDAN 14:2-41 = BEL 1:2-41\nHOS 1:10-11 = HOS 2:1-2\nHOS 2:1-22 = HOS 2:3-24\n# HOS 2:23-24 -> HOS 2:25\nHOS 2:23 = HOS 2:25\nHOS 2:24 = HOS 2:25\nHOS 11:12 = HOS 12:1\nHOS 12:1-14 = HOS 12:2-15\nJOL 2:28-32 = JOL 3:1-5\nJOL 3:1-21 = JOL 4:1-21\n# AMO 6:10-11 -> AMO 6:10\nAMO 6:10 = AMO 6:10\nAMO 6:11 = AMO 6:10\nAMO 6:12-15 = AMO 6:11-14\nMIC 5:1 = MIC 4:14\nMIC 5:2-10 = MIC 5:1-9\n# MIC 5:11 <- MIC 5:10-11\nMIC 5:11 = MIC 5:10\nMIC 5:11 = MIC 5:11\n# MIC 5:12-14 = MIC 5:12-14\nJON 1:17 = JON 2:1\nJON 2:1-10 = JON 2:2-11\nNAM 1:15 = NAM 2:1\nNAM 2:1-13 = NAM 2:2-14\nHAG 2:1 = HAG 1:15\nHAG 2:2-24 = HAG 2:1-23\nZEC 1:18-21 = ZEC 2:1-4\nZEC 2:1-13 = ZEC 2:5-17\nMAL 4:1-6 = MAL 3:19-24\n#\n#\n# Mapping\n# Vulgate = UBS GNT\n#\n#\n# MAT 17:14 <- MAT 17:14-15\nMAT 17:15-26 = MAT 17:16-27\n# MRK 4:40 <- MRK 4:40-41\nMRK 4:40 = MRK 4:40\nMRK 4:40 = MRK 4:41\nMRK 8:39 = MRK 9:1\nMRK 9:1-49 = MRK 9:2-50\n# JHN 6:51-52 -> JHN 6:51\nJHN 6:51 = JHN 6:51\nJHN 6:52 = JHN 6:51\nJHN 6:53-72 = JHN 6:52-71\n# ACT 7:55 <- ACT 7:55-56\nACT 7:55 = ACT 7:55\nACT 7:55 = ACT 7:56\nACT 7:56-59 = ACT 7:57-60\n# ACT 14:6 <- ACT 14:6-7\nACT 14:6 = ACT 14:6\nACT 14:6 = ACT 14:7\nACT 14:7-27 = ACT 14:8-28\n#\n#\n#\n# Mapping\n# Vulgate = +/-LXX\n#\n#\n# WIS 2:24-25 -> WIS 2:24\nWIS 2:24 = WIS 2:24\nWIS 2:25 = WIS 2:24\n# WIS 5:13-14 -> WIS 5:13\nWIS 5:13 = WIS 5:13\nWIS 5:14 = WIS 5:13\nWIS 5:15-24 = WIS 5:14-23\n# WIS 6:1 -> missing\nWIS 6:2-21 = WIS 6:1-20\nWIS 6:22 = WIS 6:21\nWIS 6:23 = WIS 6:21\n# WIS 6:23 -> missing\nWIS 6:24-27 = WIS 6:22-25\n# WIS 9:18-19 -> WIS 9:18\nWIS 9:18 = WIS 9:18\nWIS 9:19 = WIS 9:18\n# WIS 11:5-6 -> WIS 11:5\nWIS 11:5 = WIS 11:5\nWIS 11:6 = WIS 11:5\nWIS 11:7-27 = WIS 11:6-26\n# WIS 19:12 <- WIS 19:12-13\nWIS 19:12 = WIS 19:12\nWIS 19:12 = WIS 19:13\nWIS 19:13-19 = WIS 19:14-20\n# WIS 19:20 <- WIS 19:21-22\nWIS 19:20 = WIS 19:21\nWIS 19:20 = WIS 19:22\nBAR 6:1-72 = LJE 1:1-72\n# 1MA 1:4-5 -> 1MA 1:4\n1MA 1:4 = 1MA 1:4\n1MA 1:5 = 1MA 1:4\n1MA 1:6-31 = 1MA 1:5-30\n# 1MA 1:31-32 -> 1MA 1:30\n1MA 1:31 = 1MA 1:30\n1MA 1:32 = 1MA 1:30\n1MA 1:33-35 = 1MA 1:31-33\n# 1MA 1:36ab <- 1MA 1:34\n# 1MA 1:36bc = 1MA 1:35a\n# 1MA 1:37 -> 1MA 1:35b\n1MA 1:36 = 1MA 1:34\n1MA 1:36 = 1MA 1:35\n1MA 1:37 = 1MA 1:35\n1MA 1:38-46 = 1MA 1:36-44\n# 1MA 1:47-48 -> 1MA 1:45\n1MA 1:47 = 1MA 1:45\n1MA 1:48 = 1MA 1:45\n1MA 1:49-67 = 1MA 1:46-64\n# 1MA 12:53-54 -> 1MA 12:53\n1MA 12:53 = 1MA 12:53\n1MA 12:54 = 1MA 12:53\n# 1MA 13:52-53 -> 1MA 13:52\n1MA 13:52 = 1MA 13:52\n1MA 13:53 = 1MA 13:52\n1MA 13:54 = 1MA 13:53\n# 2MA 2:18-19 -> 2MA 2:18\n2MA 2:18 = 2MA 2:18\n2MA 2:19 = 2MA 2:18\n2MA 2:20-33 = 2MA 2:19-32\n# 2MA 12:45-46 -> 2MA 12:45\n2MA 12:45 = 2MA 12:45\n2MA 12:46 = 2MA 12:45\n# 2MA 15:36-37 -> 2MA 15:36\n2MA 15:36 = 2MA 15:36\n2MA 15:37 = 2MA 15:36\n2MA 15:38-40 = 2MA 15:37-39\n#\n#\n# For 1ES the mapping info is taken from the Bible Works program\n# mapping Vulgate onto LXX\n#\n1ES 1:4 = 1ES 1:3\n1ES 1:4 = 1ES 1:4\n1ES 1:5 = 1ES 1:4\n1ES 1:5 = 1ES 1:5\n1ES 1:10 = 1ES 1:10\n1ES 1:10 = 1ES 1:11\n1ES 1:11 = 1ES 1:12\n1ES 1:12 = 1ES 1:13\n1ES 1:13 = 1ES 1:13\n1ES 1:13 = 1ES 1:14\n1ES 1:14 = 1ES 1:14\n1ES 1:15 = 1ES 1:15\n1ES 1:16 = 1ES 1:15\n1ES 1:17 = 1ES 1:16\n1ES 1:18 = 1ES 1:16\n1ES 1:19-50 = 1ES 1:17-48\n1ES 1:51 = 1ES 1:49\n1ES 1:52 = 1ES 1:49\n1ES 1:53-58 = 1ES 1:50-55\n1ES 2:1 = 1ES 2:1\n1ES 2:2 = 1ES 2:1\n1ES 2:3 = 1ES 2:2\n1ES 2:4 = 1ES 2:2\n1ES 2:5 = 1ES 2:3\n1ES 2:6 = 1ES 2:4\n1ES 2:7 = 1ES 2:4\n1ES 2:8 = 1ES 2:5\n1ES 2:9 = 1ES 2:6\n1ES 2:10 = 1ES 2:7\n1ES 2:11 = 1ES 2:8\n1ES 2:12 = 1ES 2:8\n1ES 2:13 = 1ES 2:9\n1ES 2:13 = 1ES 2:10\n1ES 2:14 = 1ES 2:11\n1ES 2:15 = 1ES 2:11\n1ES 2:16-19 = 1ES 2:12-15\n1ES 2:20 = 1ES 2:16\n1ES 2:21 = 1ES 2:16\n1ES 2:22 = 1ES 2:17\n1ES 2:23 = 1ES 2:17\n1ES 2:24 = 1ES 2:18\n1ES 2:25 = 1ES 2:19\n1ES 2:26 = 1ES 2:20\n1ES 2:26 = 1ES 2:21\n1ES 2:27 = 1ES 2:21\n1ES 2:27 = 1ES 2:22\n1ES 2:28 = 1ES 2:23\n1ES 2:29 = 1ES 2:24\n1ES 2:30 = 1ES 2:25\n1ES 2:30 = 1ES 2:26\n1ES 3:14 = 1ES 3:14\n1ES 3:15 = 1ES 3:14\n1ES 3:16 = 1ES 3:15\n1ES 3:17 = 1ES 3:16\n1ES 3:17 = 1ES 3:17\n1ES 4:10 = 1ES 4:10\n1ES 4:10 = 1ES 4:11\n1ES 4:11 = 1ES 4:11\n1ES 4:33 = 1ES 4:33\n1ES 4:33 = 1ES 4:34\n1ES 4:39 = 1ES 4:39\n1ES 4:40 = 1ES 4:39\n1ES 4:40 = 1ES 4:40\n1ES 5:41 = 1ES 5:41\n1ES 5:42 = 1ES 5:41\n1ES 5:43-53 = 1ES 5:42-52\n1ES 5:54 = 1ES 5:53\n1ES 5:55 = 1ES 5:53\n1ES 5:56 = 1ES 5:54\n1ES 5:57 = 1ES 5:55\n1ES 5:58 = 1ES 5:56\n1ES 5:58 = 1ES 5:57\n1ES 5:59 = 1ES 5:57\n1ES 5:60 = 1ES 5:57\n1ES 5:61-72 = 1ES 5:58-69\n1ES 5:73 = 1ES 5:70\n1ES 5:73 = 1ES 5:71\n1ES 6:8 = 1ES 6:8\n1ES 6:9 = 1ES 6:8\n1ES 6:10-34 = 1ES 6:9-33\n1ES 8:5 = 1ES 8:5\n1ES 8:6 = 1ES 8:5\n1ES 8:6 = 1ES 8:6\n1ES 8:13 = 1ES 8:13\n1ES 8:14 = 1ES 8:13\n1ES 8:14 = 1ES 8:14\n1ES 8:19 = 1ES 8:19\n1ES 8:20 = 1ES 8:19\n1ES 8:20 = 1ES 8:20\n1ES 8:43 = 1ES 8:43\n1ES 8:44 = 1ES 8:43\n1ES 8:45-49 = 1ES 8:44-48\n1ES 8:50 = 1ES 8:49\n1ES 8:50 = 1ES 8:50\n1ES 8:56 = 1ES 8:56\n1ES 8:57 = 1ES 8:56\n1ES 8:58-62 = 1ES 8:57-61\n1ES 8:63 = 1ES 8:62\n1ES 8:64 = 1ES 8:62\n1ES 8:65 = 1ES 8:63\n1ES 8:66 = 1ES 8:63\n1ES 8:67-85 = 1ES 8:64-82\n1ES 8:86 = 1ES 8:83\n1ES 8:86 = 1ES 8:84\n1ES 8:87 = 1ES 8:84\n1ES 8:88-92 = 1ES 8:85-89\n1ES 8:93 = 1ES 8:90\n1ES 8:94 = 1ES 8:90\n1ES 8:95 = 1ES 8:91\n1ES 8:96 = 1ES 8:92\n#\n#--------------------------------------------------------------------------\n# mapping XXA onto PSA, XXA should be in a variant Vulgate project [Studge]\n# Both PSA and XXA are synchronized to PSA in the original versification.\n# Is this allowed???\n# by request of RdB, XXA mapping to PSA has been deleted - [Barb] 20110127\n# XXA has been moved to PSA and the old PSA is now the Resource VULGP83 [Barb]\n# There could still be some errors regarding the irregular mapping of psalm titles (like in PSA 12:1 <- PSA 13:1-2)\n#\n#\n#-------------------------------------------------------\n# Removing the following lines (FB 52696)\n#2ES 3:1-36 = EZA 1:1-36\n#2ES 4:1-52 = EZA 2:1-52\n#2ES 5:1-56 = EZA 3:1-56\n#2ES 6:1-59 = EZA 4:1-59\n#2ES 7:1-35 = EZA 5:1-35\n#2ES 7:106-140 = EZA 5:36-70\n#2ES 8:1-63 = EZA 6:1-63\n#2ES 9:1-47 = EZA 7:1-47\n#2ES 10:1-60 = EZA 8:1-60\n#2ES 11:1-46 = EZA 9:1-46\n#2ES 12:1-51 = EZA 10:1-51\n#2ES 13:1-58 = EZA 11:1-58\n#2ES 14:1-48 = EZA 12:1-48\n#-----------------------------------------------------\n# map Letter to the Laodiceans [Studge]\n# XXB 1:1-7 = LAO 1:1-7\n#-----------------------------------------------------\n# map Esther Greek onto Hebrew Esther [Studge]\n# to be added in\n#-----------------------------------------------------\n# Mapping Additions to Daniel onto Hebrew Daniel [Studge]\nDAG 1:1-21 = DAN 1:1-21\nDAG 2:1-49 = DAN 2:1-49\nDAG 3:24-52 = S3Y 1:1-29\nDAG 3:52-23 = S3Y 1:30-31\nDAG 3:54 = S3Y 1:33\nDAG 3:55 = S3Y 1:32\nDAG 3:56-57 = S3Y 1:34-35\nDAG 3:58 = S3Y 1:37\nDAG 3:59 = S3Y 1:36\nDAG 3:60-90 = S3Y 1:38-68\nDAG 3:91-97 = DAN 3:24-30\nDAG 4:1-3 = DAN 3:31-33\nDAG 4:4-37 = DAN 4:1-34\nDAG 5:1-31 = DAN 5:1-31\nDAG 6:1-28 = DAN 6:1-28\nDAG 7:1-28 = DAN 7:1-28\nDAG 8:1-27 = DAN 8:1-27\nDAG 9:1-27 = DAN 9:1-27\nDAG 10:1-21 = DAN 10:1-21\nDAG 11:1-45 = DAN 11:1-45 \nDAG 12:1-13 = DAN 12:1-13\n# Susanna\nDAG 13:1-63 = SUS 1:63\n# Bel and the Dragon\nDAG 14:1-42 = BEL 1:42\n#-------------------------------------------------------\n"}},Lo=/^([A-Z0-9]{3}) (([0-9]+:[0-9]+) ?)*$/;for(const[e,n]of Object.entries(Ho)){n.cv={};const e=n.raw.split("\n").filter((e=>e.match(Lo)));if(e)for(const t of e){const e=t.slice(0,3);n.cv[e]={};for(const s of t.substr(4).split(" ")){const[t,r]=s.split(":");n.cv[e][t]=r}}}Mo=Ho;var Vo,Ko=(Ro={querySchemaString:`\n"""The top level of Proskomma queries"""\ntype Query {\n """The id of the processor, which is different for each Proskomma instance"""\n id: String!\n """A string describing the processor class"""\n processor: String!\n """The NPM package version"""\n packageVersion: String!\n """The selectors used to define docSets"""\n selectors: [selectorSpec!]!\n """The number of docSets"""\n nDocSets: Int!\n """The docSets in the processor"""\n docSets(\n """A whitelist of ids of docSets to include"""\n ids: [String!]\n """Only return docSets that match the list of selector values"""\n withSelectors: [InputKeyValue!]\n """Only return docSets containing a document with the specified bookCode"""\n withBook: String\n """Only return docSets with all the specified tags"""\n withTags: [String!]\n """Only return docSets with none of the specified tags"""\n withoutTags: [String!]\n ): [DocSet!]!\n """The docSet with the specified id"""\n docSet(\n """The id of the docSet"""\n id: String!\n ): DocSet\n """The number of documents in the processor"""\n nDocuments: Int!\n """The documents in the processor"""\n documents(\n """A whitelist of ids of documents to include"""\n ids: [String!]\n """Only return documents with the specified bookCode"""\n withBook: String\n """Only return documents with the specified header key/values"""\n withHeaderValues: [InputKeyValue!]\n """Only return documents with all the specified tags"""\n withTags: [String!]\n """Only return documents with none of the specified tags"""\n withoutTags: [String!]\n """Sort returned documents by the designated method (currently ${Object.keys(Jo).join(", ")})"""\n sortedBy: String\n ): [Document!]!\n """The document with the specified id, or the specified docSet and withBook"""\n document(\n """The id of the document"""\n id: String\n """The docSet of the document (use with withBook)"""\n docSetId: String\n """The book of the document (use with docSetId)"""\n withBook: String\n ) : Document\n """Reference information about standard versifications"""\n versifications: [versification!]!\n """Reference information about a named, standard versification"""\n versification(\n """The id of the versification"""\n id: String!\n ) : versification!\n}\n`,queryResolvers:{id:e=>e.processorId,selectors:e=>e.selectors,docSets:(e,n)=>{let t=("withBook"in n?e.docSetsWithBook(n.withBook):Object.values(e.docSets)).filter((e=>!n.ids||n.ids.includes(e.id)));return n.withSelectors&&(t=t.filter((e=>((e,n)=>{for(const t of n)if(e.selectors[t.key].toString()!==t.value)return!1;return!0})(e,n.withSelectors)))),n.withTags&&(t=t.filter((e=>n.withTags.filter((n=>e.tags.has(n))).length===n.withTags.length))),n.withoutTags&&(t=t.filter((e=>0===n.withoutTags.filter((n=>e.tags.has(n))).length))),t},docSet:(e,n)=>e.docSetById(n.id),documents:(e,n)=>{let t=n.withBook?e.documentsWithBook(n.withBook):e.documentList();if(t=t.filter((e=>!n.ids||n.ids.includes(e.id))),n.withHeaderValues&&(t=t.filter((e=>((e,n)=>{for(const t of n||[])if(!(t.key in e)||e[t.key]!==t.value)return!1;return!0})(e.headers,n.withHeaderValues)))),n.withTags&&(t=t.filter((e=>n.withTags.filter((n=>e.tags.has(n))).length===n.withTags.length))),n.withoutTags&&(t=t.filter((e=>0===n.withoutTags.filter((n=>e.tags.has(n))).length))),n.sortedBy){if(!(n.sortedBy in Jo))throw new Error(`sortedBy value must be one of [${Object.keys(Jo).join(", ")}], not ${n.sortedBy}`);t.sort(Jo[n.sortedBy])}return t},document:(e,n)=>{if(!n.id||n.docSetId||n.withBook){if(!n.id&&n.docSetId&&n.withBook)return e.documentsWithBook(n.withBook).filter((e=>e.docSetId===n.docSetId))[0];throw new Error("document requires either id or both docSetId and withBook (but not all three)")}return e.documentById(n.id)},versifications:()=>Object.entries(Mo),versification:(e,n)=>Object.entries(Mo).filter((e=>e[0]===n.id))[0]}}).querySchemaString,Uo=Ro.queryResolvers;var Xo=(Vo={selectorSpecSchemaString:'\n"""Specification of a selector"""\ntype selectorSpec {\n """Name (ie the key)"""\n name: String!\n """Data type (string or integer)"""\n type: String!\n """Regex for validating string selector"""\n regex: String\n """Inclusive minimum value for integer selector"""\n min: String\n """Inclusive maximum value for integer selector"""\n max: String\n """Enum of permitted string values"""\n enum: [String!]\n}\n',selectorSpecResolvers:{regex:e=>e.regex||null,min:e=>e.min||null,max:e=>e.max||null,enum:e=>e.enum||null}}).selectorSpecSchemaString,jo=Vo.selectorSpecResolvers;var Wo,Zo,Fo,zo={inputSelectorSpecSchemaString:'\n"""Input specification of a selector"""\ninput inputSelectorSpec {\n """Name (ie the key)"""\n name: String!\n """Data type (string or integer)"""\n type: String!\n """Regex for validating string selector"""\n regex: String\n """Inclusive minimum value for integer selector"""\n min: String\n """Inclusive maximum value for integer selector"""\n max: String\n """Enum of permitted string values"""\n enum: [String!]\n}\n'}.inputSelectorSpecSchemaString;var Yo=(Fo={remakeBlocks:(e,n,t,s)=>{const r=t.blocks.length;for(let e=0;e<r;e++)n.deleteBlock(t.id,0,!1);for(let r=0;r<s.length;r++){const o=s[r];n.newBlock(t.id,r,o.bs.payload,null,!1);if(!e.updateBlockGrafts(n.id,t.id,r,o.bg))return!1;if(!e.updateOpenScopes(n.id,t.id,r,o.os))return!1;if(!e.updateIncludedScopes(n.id,t.id,r,o.is))return!1;if(!e.updateItems(n.id,t.id,r,o.items))return!1}}}).remakeBlocks;var _o,Qo=(Zo={addMutationsSchemaString:'\n """Adds a document which will be assigned to an existing or new docSet on the basis of the specified selectors"""\n addDocument(\n """The selectors for this document, the keys of which must match those of the Proskomma instance"""\n selectors: [InputKeyValue!]!\n """The format of the content (probably usfm or usx)"""\n contentType: String!\n """The document content as a string"""\n content: String!\n """A list of tags to be added"""\n tags: [String!]\n ): Boolean!\n """Creates a new, empty sequence"""\n newSequence(\n """The id of the document to which the sequence will be added"""\n documentId: String!\n """The type of the new sequence (main, heading...)"""\n type: String!\n """The JSON describing blocks, if any, for the new sequence"""\n blocksSpec: [inputBlockSpec!]\n """If true, graft to the first block of the main sequence"""\n graftToMain: Boolean\n """\'A list of tags to be added"""\n tags: [String!]\n ): String!\n """Adds a new block to a sequence"""\n newBlock(\n """The id of the document containing the sequence to which the block will be added"""\n documentId: String!\n """The id of the sequence to which the block will be added"""\n sequenceId: String!\n """The zero-indexed position at which to add the block"""\n blockN: Int!\n """The scope to be applied to the block, eg blockScope/p"""\n blockScope: String!\n ): Boolean!\n',addMutationsResolvers:{addDocument:(e,n)=>{const t={};return n.selectors.forEach((e=>{t[e.key]=e.value})),!!e.importDocument(t,n.contentType,n.content,null,null,null,n.tags||[])},newSequence:(e,n)=>{const t=e.documents[n.documentId],s=t.processor.docSets[t.docSetId];if(!t)throw new Error(`Document '${n.documentId}' not found`);const r=t.newSequence(n.type,n.tags);if(n.blocksSpec&&(Yo(s,t,t.sequences[r],n.blocksSpec),t.buildChapterVerseIndex()),n.graftToMain){s.maybeBuildPreEnums();const e=t.sequences[t.mainId].blocks[0].bg,o=s.enumForCategoryValue("graftTypes",n.type,!0),i=s.enumForCategoryValue("ids",r,!0);y.succinct.pushSuccinctGraftBytes(e,o,i)}return r},newBlock:(e,n)=>{const t=e.documents[n.documentId];if(!t)throw new Error(`Document '${n.documentId}' not found`);return t.newBlock(n.sequenceId,n.blockN,n.blockScope)}}}).addMutationsSchemaString,ei=Zo.addMutationsResolvers;var ni,ti=(_o={deleteMutationsSchemaString:'\n """Deletes a docSet"""\n deleteDocSet(\n """The id of the docSet containing the document to be deleted"""\n docSetId: String!\n ): Boolean\n """Deletes a document"""\n deleteDocument(\n """The id of the docSet containing the document to be deleted"""\n docSetId: String!\n """The id of the document to be deleted"""\n documentId: String!\n ): Boolean\n """Deletes a sequence from a document"""\n deleteSequence(\n """The id of the document containing the sequence to be deleted"""\n documentId: String!\n """The id of the sequence to be deleted"""\n sequenceId: String!\n ): Boolean\n """Deletes a block from a sequence"""\n deleteBlock(\n """The id of the document containing the sequence from which the block will be deleted"""\n documentId: String!\n """The id of the sequence from which the block will be deleted"""\n sequenceId: String!\n """The zero-indexed number of the block to be deleted"""\n blockN: Int!\n ): Boolean\n',deleteMutationsResolvers:{deleteDocSet:(e,n)=>e.deleteDocSet(n.docSetId),deleteDocument:(e,n)=>e.deleteDocument(n.docSetId,n.documentId),deleteSequence:(e,n)=>{const t=e.documents[n.documentId];if(!t)throw new Error(`Document '${n.documentId}' not found`);return t.deleteSequence(n.sequenceId)},deleteBlock:(e,n)=>{const t=e.documents[n.documentId];if(!t)throw new Error(`Document '${n.documentId}' not found`);return t.deleteBlock(n.sequenceId,n.blockN)}}}).deleteMutationsSchemaString,si=_o.deleteMutationsResolvers;var ri,oi=(ni={rehashMutationsSchemaString:'\n """Explicitly rebuild the text lookup tables for a docSet. (You probably don\'t need to do this)"""\n rehashDocSet(\n """The id of the docSet"""\n docSetId: String!\n ): Boolean!\n',rehashMutationsResolvers:{rehashDocSet:(e,n)=>e.rehashDocSet(n.docSetId)}}).rehashMutationsSchemaString,ii=ni.rehashMutationsResolvers;var ci,ai=(ri={tagMutationsSchemaString:'\n """Add one or more tags to a docSet, if they are not already present"""\n addDocSetTags(\n """The id of the docSet to which the tags will be added"""\n docSetId: String!\n """A list of tags to be added"""\n tags: [String]!\n ): [String!]!\n """Add one or more tags to a document, if they are not already present"""\n addDocumentTags(\n """The id of the docSet containing the document to which the tags will be added"""\n docSetId: String!\n """The id of the document to which the tags will be added"""\n documentId: String!\n """A list of tags to be added"""\n tags: [String]!\n ): [String!]\n """Add one or more tags to a sequence, if they are not already present"""\n addSequenceTags(\n """The id of the docSet containing the document containing the sequence to which the tags will be added"""\n docSetId: String!\n """The id of the document containing the sequence to which the tags will be added"""\n documentId: String!\n """The id of the sequence to which the tags will be added"""\n sequenceId: String!\n """A list of tags to be added"""\n tags: [String]!\n ) : [String!]\n """Remove one or more tags from a docSet, if they are present"""\n removeDocSetTags(\n """The id of the docSet from which the tags will be removed"""\n docSetId: String!\n """A list of tags to be removed"""\n tags: [String]!\n ): [String!]\n """Remove one or more tags from a document, if they are present"""\n removeDocumentTags(\n """The id of the docSet containing the document from which the tags will be removed"""\n docSetId: String!\n """The id of the document from which the tags will be removed"""\n documentId: String!\n """A list of tags to be removed"""\n tags: [String]!\n ): [String!]\n """Remove one or more tags from a sequence, if they are present"""\n removeSequenceTags(\n """The id of the docSet containing the document containing the sequence from which the tags will be removed"""\n docSetId: String!\n """The id of the document containing the sequence from which the tags will be removed"""\n documentId: String!\n """The id of the sequence from which the tags will be removed"""\n sequenceId: String!\n """A list of tags to be removed"""\n tags: [String]!\n ) : [String!]\n',tagMutationsResolvers:{addDocSetTags:(e,n)=>{const t=e.docSets[n.docSetId];for(const e of n.tags)t.addTag(e);return Array.from(t.tags)},addDocumentTags:(e,n)=>{const t=e.docSets[n.docSetId].processor.documents[n.documentId];for(const e of n.tags)t.addTag(e);return Array.from(t.tags)},addSequenceTags:(e,n)=>{const t=e.docSets[n.docSetId].processor.documents[n.documentId].sequences[n.sequenceId];for(const e of n.tags)y.tags.addTag(t.tags,e);return Array.from(t.tags)},removeDocSetTags:(e,n)=>{const t=e.docSets[n.docSetId];for(const e of n.tags)t.removeTag(e);return Array.from(t.tags)},removeDocumentTags:(e,n)=>{const t=e.docSets[n.docSetId].processor.documents[n.documentId];for(const e of n.tags)t.removeTag(e);return Array.from(t.tags)},removeSequenceTags:(e,n)=>{const t=e.docSets[n.docSetId].processor.documents[n.documentId].sequences[n.sequenceId];for(const e of n.tags)y.tags.removeTag(t.tags,e);return Array.from(t.tags)}}}).tagMutationsSchemaString,li=ri.tagMutationsResolvers,ui=u.PipelineHandler,Si=Fo.remakeBlocks;var hi;var pi;var di;var fi;var mi,gi=(vs={typeDefs:`\n ${Ko}\n ${(Wo={mutationsSchemaString:`\ntype Mutation {\n${Qo}\n${ti}\n${oi}\n${ai}\n${(ci={updateMutationsSchemaString:'\n """Replaces the items of a block with a new set of items"""\n updateItems(\n """The id of the docSet containing the document containing the sequence containing the block for which the items will be updated"""\n docSetId: String!\n """The id of the document containing the sequence containing the block for which the items will be updated"""\n documentId: String!\n """The id of the sequence containing the block for which the items will be updated (defaults to the main sequence)"""\n sequenceId: String\n """The zero-indexed number of the block for which the items will be updated"""\n blockPosition: Int!\n """The new content for the block as item objects"""\n items: [InputItemObject!]\n """BlockGrafts for the block as item objects"""\n blockGrafts: [InputItemObject!]\n """Optional blockScope for the block as an item object"""\n blockScope: InputItemObject\n ): Boolean!\n """Replaces all the blocks of a sequence with a new set of blocks"""\n updateAllBlocks(\n """The id of the docSet containing the document containing the sequence for which the blocks will be updated"""\n docSetId: String!\n """The id of the document containing the sequence for which the blocks will be updated"""\n documentId: String!\n """The id of the sequence for which the blocks will be updated (defaults to the main sequence)"""\n sequenceId: String\n """The JSON describing blocks"""\n blocksSpec: [inputBlockSpec!]!\n ): Boolean!\n """Replaces all the blocks of a sequence with a new set of blocks derived from PERF"""\n updateSequenceFromPerf(\n """The id of the docSet containing the document containing the sequence for which the blocks will be updated"""\n docSetId: String!\n """The id of the document containing the sequence for which the blocks will be updated"""\n documentId: String!\n """The id of the sequence for which the blocks will be updated (defaults to the main sequence)"""\n sequenceId: String\n """The JSON describing blocks"""\n perf: String!\n ): Boolean!\n """Garbage collects unused sequences within a document. (You probably don\\\'t need to do this.)"""\n gcSequences(\n """The id of the docSet containing the document to be garbage collected"""\n docSetId: String!\n """The id of the document to be garbage collected"""\n documentId: String!\n ) : Boolean!\n \n',updateMutationsResolvers:{updateItems:(e,n)=>{const t=e.docSets[n.docSetId];if(!t)throw new Error(`DocSet '${n.docSetId}' not found`);if(!n.items)throw new Error("Must provide items");if(!t.updateItems(n.documentId,n.sequenceId,n.blockPosition,n.items))return!1;if(n.blockGrafts){if(!t.updateBlockGrafts(n.documentId,n.sequenceId,n.blockPosition,n.blockGrafts))return!1}if(n.blockScope){if(!t.updateBlockScope(n.documentId,n.sequenceId,n.blockPosition,n.blockScope))return!1}return!0},updateAllBlocks:(e,n)=>{const t=e.docSets[n.docSetId];if(!t)throw new Error(`DocSet '${n.docSetId}' not found`);const s=e.documents[n.documentId];if(!s)throw new Error(`Document '${n.documentId}' not found`);const r=s.sequences[n.sequenceId||s.mainId];if(!r)throw new Error(`Sequence '${n.sequenceId||s.mainId}' not found`);return Si(t,s,r,n.blocksSpec),s.buildChapterVerseIndex(),!0},updateSequenceFromPerf:async(e,n)=>{const t=e.docSets[n.docSetId];if(!t)throw new Error(`DocSet '${n.docSetId}' not found`);const s=e.documents[n.documentId];if(!s)throw new Error(`Document '${n.documentId}' not found`);const r=s.sequences[n.sequenceId||s.mainId];if(!r)throw new Error(`Sequence '${n.sequenceId||s.mainId}' not found`);const o=JSON.parse(n.perf),i={schema:{structure:"flat",structure_version:"0.3.0",constraints:[{name:"perf",version:"0.3.0"}]},metadata:{translation:{},document:{}},sequences:{},main_sequence_id:n.sequenceId};i.sequences[n.sequenceId]=o;let c={};try{const n=new ui({pipelines:dt,transforms:At,proskomma:e}),t=await n.runPipeline("perf2PkJsonPipeline",{perf:i});c=Object.values(t.pkJson)[0]}catch(e){return console.error("pipelineHandler Error :\n",e),!1}return Si(t,s,r,c),s.buildChapterVerseIndex(),!0},gcSequences:(e,n)=>{const t=e.docSets[n.docSetId];if(!t)throw new Error(`DocSet '${n.docSetId}' not found`);const s=e.documents[n.documentId];if(!s)throw new Error(`Document '${n.documentId}' not found`);return!!s.gcSequences()&&(t.rehash(),!0)}}}).updateMutationsSchemaString}\n${(hi={versificationMutationsSchemaString:'\n """Adds verse mapping tables to the documents in a docSet, where the verse mapping may be provided in legacy .vrs or JSON format"""\n setVerseMapping(\n """the id of the docSet to which the verse mapping will be added"""\n docSetId: String!\n """The verse mapping, in legacy .vrs format (as a string)"""\n vrsSource: String\n """The verse mapping, in JSON format (as a string)"""\n jsonSource: String\n ): Boolean!\n """Removes verse mapping tables from the documents in a docSet"""\n unsetVerseMapping(\n """The id of the docSet from which verse mapping will be removed"""\n docSetId: String!\n ): Boolean!\n',versificationMutationsResolvers:{setVerseMapping:(e,n)=>{if(n.vrsSource&&n.jsonSource)throw new Error("Cannot specify both vrsSource and jsonSource");if(!n.vrsSource&&!n.jsonSource)throw new Error("Must specify either vrsSource or jsonSource");const t=e.docSets[n.docSetId];if(!t)return!1;let s;s=n.vrsSource?y.versification.vrs2json(n.vrsSource):n.jsonSource;const r=y.versification.succinctifyVerseMappings(s.mappedVerses),o=y.versification.reverseVersification(s),i=y.versification.succinctifyVerseMappings(o.reverseMappedVerses);for(const e of t.documents().filter((e=>"bookCode"in e.headers))){const n=e.headers.bookCode,s=t.documentWithBook(n);if(!s)continue;const o=s.sequences[s.mainId];o.verseMapping={},n in r&&(o.verseMapping.forward=r[n]),n in i&&(o.verseMapping.reversed=i[n])}return t.tags.add("hasMapping"),!0},unsetVerseMapping:(e,n)=>{const t=e.docSets[n.docSetId];if(!t)return!1;for(const e of t.documents().filter((e=>"bookCode"in e.headers))){const n=e.headers.bookCode,s=t.documentWithBook(n);if(s){s.sequences[s.mainId].verseMapping={}}}return t.tags.delete("hasMapping"),!0}}}).versificationMutationsSchemaString}\n}`,mutationsResolvers:{...ei,...si,...ii,...li,...ci.updateMutationsResolvers,...hi.versificationMutationsResolvers}}).mutationsSchemaString}\n ${Gs}\n ${qs}\n ${Ms}\n ${$s}\n ${Js}\n ${Hs}\n ${Ls}\n ${Ks}\n ${js}\n ${_s}\n ${nr}\n ${sr}\n ${or}\n ${ir}\n ${cr}\n ${lr}\n ${Sr}\n ${dr}\n ${Ar}\n ${Pr}\n ${wr}\n ${Br}\n ${Cr}\n ${Rr}\n ${Dr}\n ${Hr}\n ${Ur}\n ${so}\n ${ao}\n ${bo}\n ${xo}\n ${Do}\n ${Xo}\n ${zo}\n ${(pi={versificationSchemaString:'\n"""Information about a standard versification scheme"""\ntype versification {\n """id, derived from the Paratext vrs filename"""\n id: String!\n """A string of the original vrs file"""\n vrs: String!\n """Chapter/verse information for each book"""\n cvBooks: [cvBook!]!\n """Chapter/verse information for one book"""\n cvBook(\n """The bookCode"""\n bookCode: String!\n ): cvBook!\n}\n',versificationResolvers:{id:e=>e[0],vrs:e=>e[1].raw,cvBooks:e=>Object.entries(e[1].cv),cvBook:(e,n)=>Object.entries(e[1].cv).filter((e=>e[0]===n.bookCode))[0]}}).versificationSchemaString}\n ${(di={cvBookSchemaString:'\n"""Chapter/verse information for a book"""\ntype cvBook {\n """The bookCode"""\n bookCode: String!\n """The chapter records"""\n chapters: [cvChapter!]!\n}\n',cvBookResolvers:{bookCode:e=>e[0],chapters:e=>Object.entries(e[1])}}).cvBookSchemaString}\n ${(fi={cvChapterSchemaString:'\n"""Information for a chapter"""\ntype cvChapter {\n """The chapter"""\n chapter: Int!\n """The maximum verse number"""\n maxVerse: Int!\n}\n',cvChapterResolvers:{chapter:e=>parseInt(e[0]),maxVerse:e=>parseInt(e[1])}}).cvChapterSchemaString}\n `,resolvers:{Mutation:Wo.mutationsResolvers,Query:Uo,KeyValue:Cs,cv:Rs,idParts:Ds,Item:Ws,ItemGroup:Qs,kvEntry:tr,regexIndex:rr,verseNumber:hr,cell:fr,cIndex:Er,cvVerseElement:kr,cvVerses:Tr,cvIndex:Or,cvNavigation:Nr,node:$r,kvSequence:Lr,tableSequence:Xr,treeSequence:ro,Block:lo,Sequence:yo,Document:Go,DocSet:$o,selectorSpec:jo,versification:pi.versificationResolvers,cvBook:di.cvBookResolvers,cvChapter:fi.cvChapterResolvers}}).typeDefs,Ai=vs.resolvers,Ei=cn.lexingRegexes,bi=y.scopeDefs;const{labelForScope:yi}=bi;var Pi=Vn.tokenizeString,ki=Zn.flattenNodes,Ii=Zn.numberNodes;const wi=e=>e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r"),Ti=e=>"["+e.map((e=>`\n {\n type: "${e.type}" \n subType: "${e.subType}" \n payload: "${wi(e.payload)}"\n }`)).join(",")+"]",vi=e=>`{\n type: "${e.type}" \n subType: "${e.subType}" \n payload: "${wi(e.payload)}"}`;mi={tokenizeString:Pi,tsvToInputBlock:(e,n)=>{const t=[],s=e.split(/[\n\r]+/);for(const[e,r]of s.entries()){if(n&&0===e)continue;const s=r.split("\t");for(const[n,r]of s.entries()){const s={os:[],bg:[],bs:{type:"scope",subType:"start",payload:yi("tTableRow",[`${e}`])},is:[],items:[]},o=`tTableCol/${n}`;s.is.push({type:"scope",subType:"start",payload:o}),s.items.push({type:"scope",subType:"start",payload:o});for(const[e,n]of Pi(r))s.items.push({type:"token",subType:n,payload:e});s.items.push({type:"scope",subType:"end",payload:o}),t.push(s)}}return t},tsvHeadingTags:e=>e.split(/[\n\r]+/)[0].split("\t").map(((e,n)=>`col${n}:${e.trim()}`)),treeToInputBlock:e=>{const n=[];for(const t of ki(Ii(e))){const e={os:[],bg:[],bs:{type:"scope",subType:"start",payload:yi("tTreeNode",[`${t.id}`])},is:[],items:[]},s=yi("tTreeParent",[`${t.parentId}`]);if(e.items.push({type:"scope",subType:"start",payload:s}),e.is.push({type:"scope",subType:"start",payload:s}),t.content)for(const[n,s]of Object.entries(t.content)){const r=e.items.length,o=Pi(s),i=yi("tTreeContent",[n,t.id,`${r}`,`${o.length}`]);e.items.push({type:"scope",subType:"start",payload:i}),e.is.push({type:"scope",subType:"start",payload:i});for(const[n,t]of o)e.items.push({type:"token",subType:t,payload:n});e.items.push({type:"scope",subType:"end",payload:i})}if(t.children)for(const[n,s]of t.children.entries()){const t=yi("tTreeChild",[n,s]);e.items.push({type:"scope",subType:"start",payload:t}),e.is.push({type:"scope",subType:"start",payload:t}),e.items.push({type:"scope",subType:"end",payload:t})}e.items.push({type:"scope",subType:"end",payload:s}),n.push(e)}return n},blocksSpec2Query:e=>"[\n"+e.map((e=>` {\n bs: ${vi(e.bs)}, \n bg: ${Ti(e.bg)}, \n os: ${Ti(e.os)}, \n is: ${Ti(e.is)}, \n items: ${Ti(e.items)}}\n`))+"]",object2Query:Ti,oneObject2Query:vi};var Bi=Zn.flattenNodes,Oi=Zn.numberNodes;const xi=g({typeDefs:gi,resolvers:Ai});m={Proskomma:(d={Proskomma:class{constructor(e){this.processorId=y.generateId(),this.documents={},this.docSetsBySelector={},this.docSets={},this.filters={},this.customTags={heading:[],paragraph:[],char:[],word:[],intro:[],introHeading:[]},this.emptyBlocks=[],this.selectors=e||[{name:"lang",type:"string",regex:"[a-z]{3}"},{name:"abbr",type:"string"}],this.validateSelectorSpec(this.selectors),this.mutex=new A,this.nextPeriph=0,this.nextTable=0,this.nextNodes=0}validateSelectors(){if(0===this.selectors.length)throw new Error("No selectors found");for(const[n,t]of this.selectors.entries()){if(!("name"in t))throw new Error(`Selector ${n} has no name`);if(!("type"in t))throw new Error(`Selector ${n} has no type`);if(!["string","integer"].includes(t.type))throw new Error(`Type for selector ${n} must be string or number, not ${t.type}`);if("string"===t.type){if("min"in t)throw new Error("String selector should not include 'min'");if("max"in t)throw new Error("String selector should not include 'max'");if("regex"in t)try{e(t.regex)}catch(e){throw new Error(`Regex '${t.regex}' is not valid: ${e}`)}if("enum"in t)for(const e of t.enum)if("string"!=typeof e)throw new Error(`Enum values for selector ${t.name} should be strings, not '${e}'`)}else{if("regex"in t)throw new Error("Integer selector should not include 'regex'");if("min"in t&&"number"!=typeof t.min)throw new Error(`'min' must be a number, not '${t.min}'`);if("max"in t&&"number"!=typeof t.max)throw new Error(`'max' must be a number, not '${t.max}'`);if("min"in t&&"max"in t&&t.min>t.max)throw new Error(`'min' cannot be greater than 'max' (${t.min} > ${t.max})`);if("enum"in t)for(const e of t.enum)if("number"!=typeof e)throw new Error(`Enum values for selector ${t.name} should be numbers, not '${e}'`)}for(const e of Object.keys(t))if(!["name","type","regex","min","max","enum"].includes(e))throw new Error(`Unexpected key '${e}' in selector ${n}`)}}validateSelectorSpec(e){for(const n of e){if(!n.name)throw new Error(`name not found in selector spec element '${JSON.stringify(n)}'`);if(!n.type)throw new Error(`type not found in selector spec element '${JSON.stringify(n)}'`);if(!["string","integer"].includes(n.type))throw new Error(`Type for spec element must be string or number, not ${n.type}`);for(const e of Object.keys(n))if(!["name","type","regex","min","max","enum"].includes(e))throw new Error(`Unexpected key '${e}' in selectorSpec`)}}selectorString(e){return this.selectors.map((e=>e.name)).map((n=>`${e[n]}`)).join("_")}processor(){return"Proskomma JS"}packageVersion(){return f.version}docSetList(){return Object.values(this.docSets)}docSetsById(e){return Object.values(this.docSets).filter((n=>e.includes(n.id)))}docSetById(e){return this.docSets[e]}docSetsWithBook(e){const n=Object.values(this.documents).filter((n=>"bookCode"in n.headers&&n.headers.bookCode===e)).map((e=>e.id));return Object.values(this.docSets).filter((e=>(e=>{for(const t of n)if(e.docIds.includes(t))return!0;return!1})(e)))}nDocSets(){return this.docSetList().length}nDocuments(){return this.documentList().length}documentList(){return Object.values(this.documents)}documentById(e){return this.documents[e]}documentsById(e){return Object.values(this.documents).filter((n=>e.includes(n.id)))}documentsWithBook(e){return Object.values(this.documents).filter((n=>"bookCode"in n.headers&&n.headers.bookCode===e))}importDocument(e,n,t,s,r,o,i){return this.importDocuments(e,n,[t],s,r,o,i)[0]}importDocuments(e,n,t,s,r,o,i){s||(s=this.filters),r||(r=this.customTags),o||(o=this.emptyBlocks),i||(i=[]);const c=this.findOrMakeDocSet(e),a=this.docSets[c];a.buildPreEnums();const l=[];for(const e of t){let t=new Os(this,c,n,e,s,r,o,i);const u=t.headers.bookCode;if(Object.values(this.documents).filter((e=>a.docIds.includes(e.id))).map((e=>e.headers.bookCode)).includes(u))throw new Error(`Attempt to import document with bookCode '${u}' which already exists in docSet ${c}`);this.addDocument(t,c),l.push(t)}return a.preEnums={},l}importUsfmPeriph(n,t,s,r,o,i){const c=t.toString().split(/[\n\r]+/),a=c[0].substring(4,7);if(!["FRT","BAK","INT"].includes(a))throw new Error(`importUsfmInt() expected bookCode of FRT, BAK or INT, not '${a}'`);let l=[];for(const n of c)if("\\periph"===n.substring(0,7)){let t=e.exec(n,e('^\\\\periph (.*)\\|\\s*id\\s*=\\s*"([^"]+)"\\s*$'));if(!t)throw new Error(`Unable to parse periph line '${n}'`);const s=t[1],r=t[2],o=`\\id P${this.nextPeriph>9?this.nextPeriph:"0"+this.nextPeriph}`;l.push([`${o} INT ${r} - ${s}`]),this.nextPeriph++}else l.length>0&&"\\id"!==n.substring(0,3)&&l[l.length-1].push(n);this.importDocuments(n,"usfm",l.map((e=>e.join("\n"))),s,r,o,i)}cleanUsfm(e,n){n=n||{};const t=e.toString().split(/[\n\r]+/),s=[];let r=!0;const o=["\\id","\\ide","\\usfm","\\sts","\\rem","\\h","\\toc"];for(const e of t){const t=e.split(" ")[0].replace(/[0-9]+/g,"");if("remove"in n&&n.remove.includes(t))continue;const i=o.includes(t);r&&!i&&"\\mt"!==t&&s.push("\\mt1 USFM"),s.push(e),i||(r=!1)}return s.join("\n")}deleteDocSet(e){if(!(e in this.docSets))return!1;for(const n of Object.entries(this.documents).filter((n=>n[1].docSetId===e)).map((e=>e[0])))this.deleteDocument(e,n,!1,!1);let n=this.docSetsBySelector;const t=this.selectors.slice(0,this.selectors.length-1);for(const s of t)n=n[this.docSets[e].selectors[s.name]];const s=this.selectors[this.selectors.length-1].name,r=this.docSets[e].selectors[s];if(!n[r])throw new Error(`Could not find docSetId '${e}' in docSetsBySelector in deleteDocSet`);return delete n[r],delete this.docSets[e],!0}deleteDocument(e,n,t,s){return t=void 0===t||t,s=void 0===s||s,e in this.docSets&&(n in this.documents&&(delete this.documents[n],this.docSets[e].docIds.length>1?(this.docSets[e].docIds=this.docSets[e].docIds.filter((e=>e!==n)),s&&this.rehashDocSet(e)):t&&this.deleteDocSet(e),!0))}rehashDocSet(e){if(!(e in this.docSets))return!1;return this.docSets[e].rehash()}addDocument(e,n){this.documents[e.id]=e,this.docSets[n].docIds.push(e.id),this.docSets[n].buildEnumIndexes()}loadSuccinctDocSet(e){const n=e.id;if(n in this.docSets)throw new Error(`Attempting to succinct load docSet ${n} which is already loaded`);const t=new an(this,null,null,e),s=t.id;this.docSets[s]=t;let r=this.docSetsBySelector;const o=e.metadata.selectors;for(const e of this.selectors)e.name===this.selectors[this.selectors.length-1].name?o[e.name]in r||(r[o[e.name]]=t,this.docSets[t.id]=t):(o[e.name]in r||(r[o[e.name]]={}),r=r[o[e.name]]);t.buildPreEnums();const i=[];for(const n of Object.keys(e.docs)){let t=this.newDocumentFromSuccinct(n,e);i.push(t)}return t.preEnums={},i}newDocumentFromSuccinct(e,n){const t=new Os(this,n.id);t.id=e;const s=n.docs[e];t.filterOptions={},t.customTags=[],t.emptyBlocks=[],t.tags=new Set(s.tags),t.headers=s.headers,t.mainId=s.mainId,t.sequences={};for(const[e,n]of Object.entries(s.sequences)){if(t.sequences[e]={id:e,type:n.type,tags:new Set(n.tags),blocks:[]},"main"===n.type){if(t.sequences[e].chapters={},!("chapters"in n))throw new Error("chapters not found in main sequence");for(const[s,r]of Object.entries(n.chapters)){const n=new y.ByteArray;n.fromBase64(r),t.sequences[e].chapters[s]=n}if(t.sequences[e].chapterVerses={},!("chapterVerses"in n))throw new Error("chapterVerses not found in main sequence");for(const[s,r]of Object.entries(n.chapterVerses)){const n=new y.ByteArray;n.fromBase64(r),t.sequences[e].chapterVerses[s]=n}if(!("tokensPresent"in n))throw new Error("tokensPresent not found in main sequence");t.sequences[e].tokensPresent=new o(n.tokensPresent)}for(const s of n.blocks){const n={};for(const[e,t]of Object.entries(s)){const s=new y.ByteArray(256);s.fromBase64(t),n[e]=s}t.sequences[e].blocks.push(n)}}return this.addDocument(t,n.id),t}findOrMakeDocSet(e){let n,t=this.docSetsBySelector;for(const s of this.selectors)s.name===this.selectors[this.selectors.length-1].name?e[s.name]in t?n=t[e[s.name]]:(n=new an(this,e),t[e[s.name]]=n,this.docSets[n.id]=n):(e[s.name]in t||(t[e[s.name]]={}),t=t[e[s.name]]);return n.id}async gqlQuery(e,n){const t=await this.mutex.acquire();try{const t=await E({schema:xi,source:e,rootValue:this,contextValue:{}});return n&&n(t),t}finally{t()}}gqlQuerySync(e,n){const t=b({schema:xi,source:e,rootValue:this,contextValue:{}});return n&&n(t),t}serializeSuccinct(e){return this.docSets[e].serializeSuccinct()}checksum(){const e=Object.values(this.docSets).map((e=>e.checksum())).sort().join(" ");return s.calculate(e)}},typeDefs:gi,resolvers:Ai,lexingRegexes:Ei,blocksSpecUtils:mi,tree2nodes:e=>Bi(Oi(e)),utils:y}).Proskomma,lexingRegexes:d.lexingRegexes,blocksSpecUtils:d.blocksSpecUtils,resolvers:d.resolvers,typeDefs:d.typeDefs};