text: !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).compromiseParagraphs=n()}(this,(function(){"use strict";var t=function(t,n){var r={sentences:function(t){var r=[];this.paragraphs.forEach((function(t){t.forEach((function(t){r=r.concat(t.list)}))}));var e=new n(r,this.parent,this.world);return"number"==typeof t?e.eq(t):e},terms:function(t){var r=[];this.paragraphs.forEach((function(t){t.forEach((function(t){r=r.concat(t.terms().list)}))}));var e=new n(r,this.parent,this.world);return"number"==typeof t?e.eq(t):e},json:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.paragraphs.map((function(n){var r={text:n.map((function(t){return t.text()})).join(""),sentences:n.map((function(n){return n.json(t)}))};return t.normal&&(r.normal=n.map((function(t){return t.text("normal")})).join("")),r}))},text:function(t){var n="";return this.paragraphs.forEach((function(r){r.forEach((function(r){n+=r.text(t)}))})),n},eq:function(n){var r=[this.paragraphs[n]];return r=r.filter((function(t){return t})),new t(r,this,this.world)},first:function(){return this.eq(0)},last:function(){var t=this.length;return this.eq(t-1)},debug:function(){this.paragraphs.forEach((function(t){console.log("\n=-=-=-=-"),t.forEach((function(t){t.debug()}))}))},match:function(t){var r=[];return this.paragraphs.forEach((function(n){n.forEach((function(n){var e=n.match(t);e.found&&(r=r.concat(e.list))}))})),new n(r,this.parent,this.world)},not:function(t){var r=[];return this.paragraphs.forEach((function(n){n.forEach((function(n){var e=n.not(t);e.found&&(r=r.concat(e.list))}))})),new n(r,this.parent,this.world)},if:function(n){var r=this.paragraphs.filter((function(t){return t.some((function(t){return t.has(n)}))}));return new t(r,this,this.world)},ifNo:function(n){var r=this.paragraphs.filter((function(t){return t.some((function(t){return!1===t.has(n)}))}));return new t(r,this,this.world)},has:function(t){return this.paragraphs.some((function(n){return n.some((function(n){return n.has(t)}))}))},forEach:function(n){var r=this;return this.paragraphs.forEach((function(e){var a=new t([e],r,r.world);n(a)})),this},map:function(n){var r=this,e=this.paragraphs.map((function(e){var a=new t([e],r,r.world);return n(a)}));new t(e,this,this.world)},filter:function(t){return this.paragraphs=this.paragraphs.filter((function(n){return n.some(t)})),this}};r.get=r.eq,Object.keys(r).forEach((function(n){t.prototype[n]=r[n]}))},n=/\n\n/;return function(r){var e=function t(n,r,e){var a=this;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),Object.defineProperty(this,"paragraphs",{enumerable:!1,writable:!0,value:n}),this.parent=r,this.world=e,Object.defineProperty(this,"found",{get:function(){return a.paragraphs.length>0}}),Object.defineProperty(this,"length",{get:function(){return a.paragraphs.length}})};t(e,r),r.prototype.paragraphs=function(t){var r=this.all(),a=[],o=[];return r.forEach((function(t){o.push(t),n.test(t.post()[0])&&(a.push(o),o=[])})),o.length>0&&a.push(o),"number"==typeof t&&(a=a[t]?[a[t]]:[]),new e(a,this,this.world)}}}));
  