440 lines
856 KiB
JavaScript
440 lines
856 KiB
JavaScript
/*
|
||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||
if you want to view the source, please visit the github repository of this plugin
|
||
*/
|
||
|
||
var Wc=Object.create;var Ua=Object.defineProperty;var Nc=Object.getOwnPropertyDescriptor;var Hc=Object.getOwnPropertyNames;var Lc=Object.getPrototypeOf,Rc=Object.prototype.hasOwnProperty;var Ns=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports),Bc=(a,e)=>{for(var t in e)Ua(a,t,{get:e[t],enumerable:!0})},Hs=(a,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Hc(e))!Rc.call(a,i)&&i!==t&&Ua(a,i,{get:()=>e[i],enumerable:!(n=Nc(e,i))||n.enumerable});return a};var _a=(a,e,t)=>(t=a!=null?Wc(Lc(a)):{},Hs(e||!a||!a.__esModule?Ua(t,"default",{value:a,enumerable:!0}):t,a)),Fc=a=>Hs(Ua({},"__esModule",{value:!0}),a);var Rs=Ns((Ls,Un)=>{(function(a){"use strict";var e=w(),t=W(),n=E(),i=y(),s={imagePlaceholder:void 0,cacheBust:!1},r={toSvg:c,toPng:l,toJpeg:d,toBlob:u,toPixelData:o,impl:{fontFaces:n,images:i,util:e,inliner:t,options:{}}};typeof Un<"u"?Un.exports=r:a.domtoimage=r;function c(g,p){return p=p||{},m(p),Promise.resolve(g).then(function(M){return b(M,p.filter,!0)}).then(f).then(k).then(v).then(function(M){return C(M,p.width||e.width(g),p.height||e.height(g))});function v(M){return p.bgcolor&&(M.style.backgroundColor=p.bgcolor),p.width&&(M.style.width=p.width+"px"),p.height&&(M.style.height=p.height+"px"),p.style&&Object.keys(p.style).forEach(function(N){M.style[N]=p.style[N]}),M}}function o(g,p){return h(g,p||{}).then(function(v){return v.getContext("2d").getImageData(0,0,e.width(g),e.height(g)).data})}function l(g,p){return h(g,p||{}).then(function(v){return v.toDataURL()})}function d(g,p){return p=p||{},h(g,p).then(function(v){return v.toDataURL("image/jpeg",p.quality||1)})}function u(g,p){return h(g,p||{}).then(e.canvasToBlob)}function m(g){typeof g.imagePlaceholder>"u"?r.impl.options.imagePlaceholder=s.imagePlaceholder:r.impl.options.imagePlaceholder=g.imagePlaceholder,typeof g.cacheBust>"u"?r.impl.options.cacheBust=s.cacheBust:r.impl.options.cacheBust=g.cacheBust}function h(g,p){return c(g,p).then(e.makeImage).then(e.delay(100)).then(function(M){var N=v(g);return N.getContext("2d").drawImage(M,0,0),N});function v(M){var N=document.createElement("canvas");if(N.width=p.width||e.width(M),N.height=p.height||e.height(M),p.bgcolor){var T=N.getContext("2d");T.fillStyle=p.bgcolor,T.fillRect(0,0,N.width,N.height)}return N}}function b(g,p,v){if(!v&&p&&!p(g))return Promise.resolve();return Promise.resolve(g).then(M).then(function(P){return N(g,P,p)}).then(function(P){return T(g,P)});function M(P){return P instanceof HTMLCanvasElement?e.makeImage(P.toDataURL()):P.cloneNode(!1)}function N(P,L,G){var B=P.childNodes;if(B.length===0)return Promise.resolve(L);return te(L,e.asArray(B),G).then(function(){return L});function te(F,fe,oe){var he=Promise.resolve();return fe.forEach(function(pe){he=he.then(function(){return b(pe,oe)}).then(function(we){we&&F.appendChild(we)})}),he}}function T(P,L){if(!(L instanceof Element))return L;return Promise.resolve().then(G).then(B).then(te).then(F).then(function(){return L});function G(){fe(window.getComputedStyle(P),L.style);function fe(oe,he){oe.cssText?he.cssText=oe.cssText:pe(oe,he);function pe(we,qe){e.asArray(we).forEach(function($){qe.setProperty($,we.getPropertyValue($),we.getPropertyPriority($))})}}}function B(){[":before",":after"].forEach(function(oe){fe(oe)});function fe(oe){var he=window.getComputedStyle(P,oe),pe=he.getPropertyValue("content");if(pe===""||pe==="none")return;var we=e.uid();L.className=L.className+" "+we;var qe=document.createElement("style");qe.appendChild($(we,oe,he)),L.appendChild(qe);function $(Q,ce,ne){var ke="."+Q+":"+ce,Ge=ne.cssText?ya(ne):It(ne);return document.createTextNode(ke+"{"+Ge+"}");function ya(st){var Je=st.getPropertyValue("content");return st.cssText+" content: "+Je+";"}function It(st){return e.asArray(st).map(Je).join("; ")+";";function Je(Pt){return Pt+": "+st.getPropertyValue(Pt)+(st.getPropertyPriority(Pt)?" !important":"")}}}}}function te(){P instanceof HTMLTextAreaElement&&(L.innerHTML=P.value),P instanceof HTMLInputElement&&L.setAttribute("value",P.value)}function F(){L instanceof SVGElement&&(L.setAttribute("xmlns","http://www.w3.org/2000/svg"),L instanceof SVGRectElement&&["width","height"].forEach(function(fe){var oe=L.getAttribute(fe);!oe||L.style.setProperty(fe,oe)}))}}}function f(g){return n.resolveAll().then(function(p){var v=document.createElement("style");return g.appendChild(v),v.appendChild(document.createTextNode(p)),g})}function k(g){return i.inlineAll(g).then(function(){return g})}function C(g,p,v){return Promise.resolve(g).then(function(M){return M.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(M)}).then(e.escapeXhtml).then(function(M){return'<foreignObject x="0" y="0" width="100%" height="100%">'+M+"</foreignObject>"}).then(function(M){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+p+'" height="'+v+'">'+M+"</svg>"}).then(function(M){return"data:image/svg+xml;charset=utf-8,"+M})}function w(){return{escape:F,parseExtension:p,mimeType:v,dataAsUrl:te,isDataUrl:M,canvasToBlob:T,resolveUrl:P,getAndEncode:B,uid:L(),delay:fe,asArray:oe,escapeXhtml:he,makeImage:G,width:pe,height:we};function g(){var $="application/font-woff",Q="image/jpeg";return{woff:$,woff2:$,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Q,jpeg:Q,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"}}function p($){var Q=/\.([^\.\/]*?)$/g.exec($);return Q?Q[1]:""}function v($){var Q=p($).toLowerCase();return g()[Q]||""}function M($){return $.search(/^(data:)/)!==-1}function N($){return new Promise(function(Q){for(var ce=window.atob($.toDataURL().split(",")[1]),ne=ce.length,ke=new Uint8Array(ne),Ge=0;Ge<ne;Ge++)ke[Ge]=ce.charCodeAt(Ge);Q(new Blob([ke],{type:"image/png"}))})}function T($){return $.toBlob?new Promise(function(Q){$.toBlob(Q)}):N($)}function P($,Q){var ce=document.implementation.createHTMLDocument(),ne=ce.createElement("base");ce.head.appendChild(ne);var ke=ce.createElement("a");return ce.body.appendChild(ke),ne.href=Q,ke.href=$,ke.href}function L(){var $=0;return function(){return"u"+Q()+$++;function Q(){return("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)}}}function G($){return new Promise(function(Q,ce){var ne=new Image;ne.onload=function(){Q(ne)},ne.onerror=ce,ne.src=$})}function B($){var Q=3e4;return r.impl.options.cacheBust&&($+=(/\?/.test($)?"&":"?")+new Date().getTime()),new Promise(function(ce){var ne=new XMLHttpRequest;ne.onreadystatechange=ya,ne.ontimeout=It,ne.responseType="blob",ne.timeout=Q,ne.open("GET",$,!0),ne.send();var ke;if(r.impl.options.imagePlaceholder){var Ge=r.impl.options.imagePlaceholder.split(/,/);Ge&&Ge[1]&&(ke=Ge[1])}function ya(){if(ne.readyState===4){if(ne.status!==200){ke?ce(ke):st("cannot fetch resource: "+$+", status: "+ne.status);return}var Je=new FileReader;Je.onloadend=function(){var Pt=Je.result.split(/,/)[1];ce(Pt)},Je.readAsDataURL(ne.response)}}function It(){ke?ce(ke):st("timeout of "+Q+"ms occured while fetching resource: "+$)}function st(Je){console.error(Je),ce("")}})}function te($,Q){return"data:"+Q+";base64,"+$}function F($){return $.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")}function fe($){return function(Q){return new Promise(function(ce){setTimeout(function(){ce(Q)},$)})}}function oe($){for(var Q=[],ce=$.length,ne=0;ne<ce;ne++)Q.push($[ne]);return Q}function he($){return $.replace(/#/g,"%23").replace(/\n/g,"%0A")}function pe($){var Q=qe($,"border-left-width"),ce=qe($,"border-right-width");return $.scrollWidth+Q+ce}function we($){var Q=qe($,"border-top-width"),ce=qe($,"border-bottom-width");return $.scrollHeight+Q+ce}function qe($,Q){var ce=window.getComputedStyle($).getPropertyValue(Q);return parseFloat(ce.replace("px",""))}}function W(){var g=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:N,shouldProcess:p,impl:{readUrls:v,inline:M}};function p(T){return T.search(g)!==-1}function v(T){for(var P=[],L;(L=g.exec(T))!==null;)P.push(L[1]);return P.filter(function(G){return!e.isDataUrl(G)})}function M(T,P,L,G){return Promise.resolve(P).then(function(te){return L?e.resolveUrl(te,L):te}).then(G||e.getAndEncode).then(function(te){return e.dataAsUrl(te,e.mimeType(P))}).then(function(te){return T.replace(B(P),"$1"+te+"$3")});function B(te){return new RegExp(`(url\\(['"]?)(`+e.escape(te)+`)(['"]?\\))`,"g")}}function N(T,P,L){if(G())return Promise.resolve(T);return Promise.resolve(T).then(v).then(function(B){var te=Promise.resolve(T);return B.forEach(function(F){te=te.then(function(fe){return M(fe,F,P,L)})}),te});function G(){return!p(T)}}}function E(){return{resolveAll:g,impl:{readAll:p}};function g(){return p(document).then(function(v){return Promise.all(v.map(function(M){return M.resolve()}))}).then(function(v){return v.join(`
|
||
`)})}function p(){return Promise.resolve(e.asArray(document.styleSheets)).then(M).then(v).then(function(T){return T.map(N)});function v(T){return T.filter(function(P){return P.type===CSSRule.FONT_FACE_RULE}).filter(function(P){return t.shouldProcess(P.style.getPropertyValue("src"))})}function M(T){var P=[];return T.forEach(function(L){try{e.asArray(L.cssRules||[]).forEach(P.push.bind(P))}catch(G){console.log("Error while reading CSS rules from "+L.href,G.toString())}}),P}function N(T){return{resolve:function(){var L=(T.parentStyleSheet||{}).href;return t.inlineAll(T.cssText,L)},src:function(){return T.style.getPropertyValue("src")}}}}}function y(){return{inlineAll:p,impl:{newImage:g}};function g(v){return{inline:M};function M(N){return e.isDataUrl(v.src)?Promise.resolve():Promise.resolve(v.src).then(N||e.getAndEncode).then(function(T){return e.dataAsUrl(T,e.mimeType(v.src))}).then(function(T){return new Promise(function(P,L){v.onload=P,v.onerror=L,v.src=T})})}}function p(v){if(!(v instanceof Element))return Promise.resolve(v);return M(v).then(function(){return v instanceof HTMLImageElement?g(v).inline():Promise.all(e.asArray(v.childNodes).map(function(N){return p(N)}))});function M(N){var T=N.style.getPropertyValue("background");return T?t.inlineAll(T).then(function(P){N.style.setProperty("background",P,N.style.getPropertyPriority("background"))}).then(function(){return N}):Promise.resolve(N)}}}})(Ls)});var xa=Ns((Ei,Mi)=>{(function(a,e){typeof Ei=="object"&&typeof Mi<"u"?Mi.exports=e():typeof define=="function"&&define.amd?define(e):(a=typeof globalThis<"u"?globalThis:a||self,a["fast-copy"]=e())})(Ei,function(){"use strict";var a=Function.prototype.toString,e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,r=Object.getPrototypeOf,c=Object.prototype,o=c.hasOwnProperty,l=c.propertyIsEnumerable,d=typeof s=="function",u=typeof WeakMap=="function",m=function(){if(u)return function(){return new WeakMap};var y=function(){function g(){this._keys=[],this._values=[]}return g.prototype.has=function(p){return!!~this._keys.indexOf(p)},g.prototype.get=function(p){return this._values[this._keys.indexOf(p)]},g.prototype.set=function(p,v){this._keys.push(p),this._values.push(v)},g}();return function(){return new y}}(),h=function(y,g){var p=y.__proto__||r(y);if(!p)return e(null);var v=p.constructor;if(v===g.Object)return p===g.Object.prototype?{}:e(p);if(~a.call(v).indexOf("[native code]"))try{return new v}catch{}return e(p)},b=function(y,g,p,v){var M=h(y,g);v.set(y,M);for(var N in y)o.call(y,N)&&(M[N]=p(y[N],v));if(d)for(var T=s(y),P=0,L=T.length,G=void 0;P<L;++P)G=T[P],l.call(y,G)&&(M[G]=p(y[G],v));return M},f=function(y,g,p,v){var M=h(y,g);v.set(y,M);for(var N=d?i(y).concat(s(y)):i(y),T=0,P=N.length,L=void 0,G=void 0;T<P;++T)if(L=N[T],L!=="callee"&&L!=="caller")if(G=n(y,L),G){!G.get&&!G.set&&(G.value=p(y[L],v));try{t(M,L,G)}catch{M[L]=G.value}}else M[L]=p(y[L],v);return M},k=function(y){var g="";return y.global&&(g+="g"),y.ignoreCase&&(g+="i"),y.multiline&&(g+="m"),y.unicode&&(g+="u"),y.sticky&&(g+="y"),g},C=Array.isArray,w=Object.getPrototypeOf,W=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:(console&&console.error&&console.error('Unable to locate global object, returning "this".'),this)}();function E(y,g){var p=!!(g&&g.isStrict),v=g&&g.realm||W,M=p?f:b,N=function(T,P){if(!T||typeof T!="object")return T;if(P.has(T))return P.get(T);var L=T.__proto__||w(T),G=L&&L.constructor;if(!G||G===v.Object)return M(T,v,N,P);var B;if(C(T)){if(p)return f(T,v,N,P);B=new G,P.set(T,B);for(var te=0,F=T.length;te<F;++te)B[te]=N(T[te],P);return B}if(T instanceof v.Date)return new G(T.getTime());if(T instanceof v.RegExp)return B=new G(T.source,T.flags||k(T)),B.lastIndex=T.lastIndex,B;if(v.Map&&T instanceof v.Map)return B=new G,P.set(T,B),T.forEach(function(fe,oe){B.set(oe,N(fe,P))}),B;if(v.Set&&T instanceof v.Set)return B=new G,P.set(T,B),T.forEach(function(fe){B.add(N(fe,P))}),B;if(v.Blob&&T instanceof v.Blob)return T.slice(0,T.size,T.type);if(v.Buffer&&v.Buffer.isBuffer(T))return B=v.Buffer.allocUnsafe?v.Buffer.allocUnsafe(T.length):new G(T.length),P.set(T,B),T.copy(B),B;if(v.ArrayBuffer){if(v.ArrayBuffer.isView(T))return B=new G(T.buffer.slice(0)),P.set(T,B),B;if(T instanceof v.ArrayBuffer)return B=T.slice(0),P.set(T,B),B}return typeof T.then=="function"||T instanceof Error||v.WeakMap&&T instanceof v.WeakMap||v.WeakSet&&T instanceof v.WeakSet?T:M(T,v,N,P)};return N(y,m())}return E.default=E,E.strict=function(g,p){return E(g,{isStrict:!0,realm:p?p.realm:void 0})},E})});var lm={};Bc(lm,{default:()=>qn});module.exports=Fc(lm);var je=require("obsidian"),Mc=_a(Rs());var zc=[{name:"Aboleth",size:"Large",type:"aberration",subtype:"",alignment:"lawful evil",ac:17,hp:135,hit_dice:"18d10 + 36",speed:"10 ft., swim 40 ft.",stats:[21,9,15,18,15,18],saves:[{constitution:6},{intelligence:8},{wisdom:6}],skillsaves:[{history:12},{perception:10}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 20",languages:"Deep Speech, telepathy 120 ft.",cr:"10",traits:[{name:"Amphibious",desc:"The aboleth can breathe air and water.",attack_bonus:0},{name:"Mucous Cloud",desc:"While underwater, the aboleth is surrounded by transformative mucus. A creature that touches the aboleth or that hits it with a melee attack while within 5 ft. of it must make a DC 14 Constitution saving throw. On a failure, the creature is diseased for 1d4 hours. The diseased creature can breathe only underwater.",attack_bonus:0},{name:"Probing Telepathy",desc:"If a creature communicates telepathically with the aboleth, the aboleth learns the creature's greatest desires if the aboleth can see the creature.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The aboleth makes three tentacle attacks.",attack_bonus:0},{name:"Tentacle",desc:"Melee Weapon Attack: +9 to hit, reach 10 ft., one target. Hit: 12 (2d6 + 5) bludgeoning damage. If the target is a creature, it must succeed on a DC 14 Constitution saving throw or become diseased. The disease has no effect for 1 minute and can be removed by any magic that cures disease. After 1 minute, the diseased creature's skin becomes translucent and slimy, the creature can't regain hit points unless it is underwater, and the disease can be removed only by heal or another disease-curing spell of 6th level or higher. When the creature is outside a body of water, it takes 6 (1d12) acid damage every 10 minutes unless moisture is applied to the skin before 10 minutes have passed.",attack_bonus:9,damage_dice:"2d6",damage_bonus:5},{name:"Tail",desc:"Melee Weapon Attack: +9 to hit, reach 10 ft. one target. Hit: 15 (3d6 + 5) bludgeoning damage.",attack_bonus:9,damage_dice:"3d6",damage_bonus:5},{name:"Enslave (3/day)",desc:"The aboleth targets one creature it can see within 30 ft. of it. The target must succeed on a DC 14 Wisdom saving throw or be magically charmed by the aboleth until the aboleth dies or until it is on a different plane of existence from the target. The charmed target is under the aboleth's control and can't take reactions, and the aboleth and the target can communicate telepathically with each other over any distance.\\nWhenever the charmed target takes damage, the target can repeat the saving throw. On a success, the effect ends. No more than once every 24 hours, the target can also repeat the saving throw when it is at least 1 mile away from the aboleth.",attack_bonus:0}],legendary_actions:[{name:"Detect",desc:"The aboleth makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Swipe",desc:"The aboleth makes one tail attack.",attack_bonus:0},{name:"Psychic Drain (Costs 2 Actions)",desc:"One creature charmed by the aboleth takes 10 (3d6) psychic damage, and the aboleth regains hit points equal to the damage the creature takes.",attack_bonus:0}]},{name:"Acolyte",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:10,hp:9,hit_dice:"2d8",speed:"30 ft.",stats:[10,10,10,10,14,11],skillsaves:[{medicine:4},{religion:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 12",languages:"any one language (usually Common)",cr:"1/4",traits:[],actions:[{name:"Club",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one target. Hit: 2 (1d4) bludgeoning damage.",attack_bonus:2,damage_dice:"1d4"}],spells:["The acolyte is a 1st-level spellcaster. Its spellcasting ability is Wisdom (spell save DC 12, +4 to hit with spell attacks). The acolyte has following cleric spells prepared:",{"Cantrips (at will)":"light, sacred flame, thaumaturgy"},{"1st level (3 slots)":"bless, cure wounds, sanctuary"}]},{name:"Adult Black Dragon",size:"Huge",type:"dragon",subtype:"",alignment:"chaotic evil",ac:19,hp:195,hit_dice:"17d12 + 84",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[23,14,21,14,13,17],saves:[{dexterity:7},{constitution:10},{wisdom:6},{charisma:8}],skillsaves:[null,{perception:11},{stealth:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"acid",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 21",languages:"Common, Draconic",cr:"14",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0},{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +11 to hit, reach 10 ft., one target. Hit: 17 (2d10 + 6) piercing damage plus 4 (1d8) acid damage.",attack_bonus:11,damage_dice:"2d10 + 1d8",damage_bonus:6},{name:"Claw",desc:"Melee Weapon Attack: +11 to hit, reach 5 ft., one target. Hit: 13 (2d6 + 6) slashing damage.",attack_bonus:11,damage_dice:"2d6",damage_bonus:6},{name:"Tail",desc:"Melee Weapon Attack: +11 to hit, reach 15 ft., one target. Hit: 15 (2d8 + 6) bludgeoning damage.",attack_bonus:11,damage_dice:"2d8",damage_bonus:6},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 16 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Acid Breath (Recharge 5-6)",desc:"The dragon exhales acid in a 60-foot line that is 5 feet wide. Each creature in that line must make a DC 18 Dexterity saving throw, taking 54 (12d8) acid damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"12d8"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 10 ft. of the dragon must succeed on a DC 19 Dexterity saving throw or take 13 (2d6 + 6) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Adult Blue Dracolich",size:"Huge",type:"undead",subtype:"",alignment:"lawful evil",ac:19,hp:225,hit_dice:"18d12 + 108",speed:"40 ft., burrow 30 ft., fly 80 ft.",stats:[25,10,23,16,15,19],skillsaves:[{perception:12}],damage_vulnerabilities:"",damage_resistances:"necrotic",damage_immunities:"lightning, poison",condition_immunities:"charmed, exhaustion, frightened, paralyzed, poisoned",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 22",languages:"Common, Draconic",cr:"17",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the dracolich fails a saving throw, it can choose to succeed instead.",attack_bonus:0},{name:"Magic Resistance",desc:"The dracolich has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dracolich can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +12 to hit, reach 10 ft., one target. Hit: 18 (2d10 + 7) piercing damage plus 5 (1d10) lightning damage.",attack_bonus:12,damage_dice:"2d10 + 1d10",damage_bonus:7},{name:"Claw",desc:"Melee Weapon Attack: +12 to hit, reach 5 ft., one target. Hit: 14 (2d6 + 7) slashing damage.",attack_bonus:12,damage_dice:"2d6",damage_bonus:7},{name:"Tail",desc:"Melee Weapon Attack: +12 to hit, reach 15 ft., one target. Hit: 16 (2d8 + 7) bludgeoning damage.",attack_bonus:12,damage_dice:"2d8",damage_bonus:7},{name:"Frightful Presence",desc:"Each creature of the dracolich's choice that is within 120 feet of the dracolich and aware of it must succeed on a DC 18 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dracolich's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Lightning Breath (Recharge 5-6)",desc:"The dracolich exhales lightning in a 90-foot line that is 5 feet wide. Each creature in that line must make a DC 20 Dexterity saving throw, taking 66 (12d10) lightning damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"12d10"}],legendary_actions:[{name:"Detect",desc:"The dracolich makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dracolich makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dracolich beats its tattered wings. Each creature within 10 ft. of the dracolich must succeed on a DC 21 Dexterity saving throw or take 14 (2d6 + 7) bludgeoning damage and be knocked prone. After beating its wings this way, the dracolich can fly up to half its flying speed.",attack_bonus:0}]},{name:"Adult Blue Dragon",size:"Huge",type:"dragon",subtype:"",alignment:"lawful evil",ac:19,hp:225,hit_dice:"18d12 + 108",speed:"40 ft., burrow 30 ft., fly 80 ft.",stats:[25,10,23,16,15,19],saves:[{dexterity:5},{constitution:11},{wisdom:7},{charisma:9}],skillsaves:[null,{perception:12},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 22",languages:"Common, Draconic",cr:"16",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +12 to hit, reach 10 ft., one target. Hit: 18 (2d10 + 7) piercing damage plus 5 (1d10) lightning damage.",attack_bonus:12,damage_dice:"2d10 + 1d10",damage_bonus:7},{name:"Claw",desc:"Melee Weapon Attack: +12 to hit, reach 5 ft., one target. Hit: 14 (2d6 + 7) slashing damage.",attack_bonus:12,damage_dice:"2d6",damage_bonus:7},{name:"Tail",desc:"Melee Weapon Attack: +12 to hit, reach 15 ft., one target. Hit: 16 (2d8 + 7) bludgeoning damage.",attack_bonus:12,damage_dice:"2d8",damage_bonus:7},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 ft. of the dragon and aware of it must succeed on a DC 17 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Lightning Breath (Recharge 5-6)",desc:"The dragon exhales lightning in a 90-foot line that is 5 ft. wide. Each creature in that line must make a DC 19 Dexterity saving throw, taking 66 (12d10) lightning damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"12d10"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 10 ft. of the dragon must succeed on a DC 20 Dexterity saving throw or take 14 (2d6 + 7) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Adult Brass Dragon",size:"Huge",type:"dragon",subtype:"",alignment:"chaotic good",ac:18,hp:172,hit_dice:"15d12 + 74",speed:"40 ft., burrow 40 ft., fly 80 ft.",stats:[23,10,21,14,13,17],saves:[{dexterity:5},{constitution:10},{wisdom:6},{charisma:8}],skillsaves:[null,{history:7},{persuasion:8},{perception:11},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 21",languages:"Common, Draconic",cr:"13",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +11 to hit, reach,.0 ft., one target. Hit: 17 (2d10 + 6) piercing damage.",attack_bonus:11,damage_dice:"2d10",damage_bonus:6},{name:"Claw",desc:"Melee Weapon Attack: +11 to hit, reach 5 ft., one target. Hit: 13 (2d6 + 6) slashing damage.",attack_bonus:11,damage_dice:"2d6",damage_bonus:6},{name:"Tail",desc:"Melee Weapon Attack: +11 to hit, reach 15 ft., one target. Hit: 15 (2d8 + 6) bludgeoning damage.",attack_bonus:11,damage_dice:"2d8",damage_bonus:6},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 16 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nFire Breath. The dragon exhales fire in an 60-foot line that is 5 feet wide. Each creature in that line must make a DC 18 Dexterity saving throw, taking 45 (13d6) fire damage on a failed save, or half as much damage on a successful one.\\nSleep Breath. The dragon exhales sleep gas in a 60-foot cone. Each creature in that area must succeed on a DC 18 Constitution saving throw or fall unconscious for 10 minutes. This effect ends for a creature if the creature takes damage or someone uses an action to wake it.",attack_bonus:0,damage_dice:"13d6"}]},{name:"Adult Bronze Dragon",size:"Huge",type:"dragon",subtype:"",alignment:"lawful good",ac:19,hp:212,hit_dice:"17d12 + 101",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[25,10,23,16,15,19],saves:[{dexterity:5},{constitution:11},{wisdom:7},{charisma:9}],skillsaves:[{insight:7},{perception:12},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 22",languages:"Common, Draconic",cr:"15",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0},{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +12 to hit, reach 10 ft., one target. Hit: 18 (2d10 + 7) piercing damage.",attack_bonus:12,damage_dice:"2d10",damage_bonus:7},{name:"Claw",desc:"Melee Weapon Attack: +12 to hit, reach 5 ft., one target. Hit: 14 (2d6 + 7) slashing damage.",attack_bonus:12,damage_dice:"2d6",damage_bonus:7},{name:"Tail",desc:"Melee Weapon Attack: +12 to hit, reach 15 ft., one target. Hit: 16 (2d8 + 7) bludgeoning damage.",attack_bonus:12,damage_dice:"2d8",damage_bonus:7},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 17 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nLightning Breath. The dragon exhales lightning in a 90-foot line that is 5 feet wide. Each creature in that line must make a DC 19 Dexterity saving throw, taking 66 (12d10) lightning damage on a failed save, or half as much damage on a successful one.\\nRepulsion Breath. The dragon exhales repulsion energy in a 30-foot cone. Each creature in that area must succeed on a DC 19 Strength saving throw. On a failed save, the creature is pushed 60 feet away from the dragon.",attack_bonus:0,damage_dice:"12d10"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 10 ft. of the dragon must succeed on a DC 20 Dexterity saving throw or take 14 (2d6 + 7) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Adult Copper Dragon",size:"Huge",type:"dragon",subtype:"",alignment:"chaotic good",ac:18,hp:184,hit_dice:"16d12 + 80",speed:"40 ft., climb 40 ft., fly 80 ft.",stats:[23,12,21,18,15,17],saves:[{dexterity:6},{constitution:10},{wisdom:7},{charisma:8}],skillsaves:[{deception:8},{perception:12},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"acid",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 22",languages:"Common, Draconic",cr:"14",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +11 to hit, reach 10 ft., one target. Hit: 17 (2d10 + 6) piercing damage.",attack_bonus:11,damage_dice:"2d10",damage_bonus:6},{name:"Claw",desc:"Melee Weapon Attack: +11 to hit, reach 5 ft., one target. Hit: 13 (2d6 + 6) slashing damage.",attack_bonus:11,damage_dice:"2d6",damage_bonus:6},{name:"Tail",desc:"Melee Weapon Attack: +11 to hit, reach 15 ft., one target. Hit: 15 (2d8 + 6) bludgeoning damage.",attack_bonus:11,damage_dice:"2d8",damage_bonus:6},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 16 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nAcid Breath. The dragon exhales acid in an 60-foot line that is 5 feet wide. Each creature in that line must make a DC 18 Dexterity saving throw, taking 54 (12d8) acid damage on a failed save, or half as much damage on a successful one.\\nSlowing Breath. The dragon exhales gas in a 60-foot cone. Each creature in that area must succeed on a DC 18 Constitution saving throw. On a failed save, the creature can't use reactions, its speed is halved, and it can't make more than one attack on its turn. In addition, the creature can use either an action or a bonus action on its turn, but not both. These effects last for 1 minute. The creature can repeat the saving throw at the end of each of its turns, ending the effect on itself with a successful save.",attack_bonus:0,damage_dice:"12d8"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 10 ft. of the dragon must succeed on a DC 19 Dexterity saving throw or take 13 (2d6 + 6) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Adult Gold Dragon",size:"Huge",type:"dragon",subtype:"",alignment:"lawful good",ac:19,hp:256,hit_dice:"19d12 + 132",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[27,14,25,16,15,24],saves:[{dexterity:8},{constitution:13},{wisdom:8},{charisma:13}],skillsaves:[{insight:8},{persuasion:13},{perception:14},{stealth:8}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 24",languages:"Common, Draconic",cr:"17",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0},{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +14 to hit, reach 10 ft., one target. Hit: 19 (2d10 + 8) piercing damage.",attack_bonus:14,damage_dice:"2d10",damage_bonus:8},{name:"Claw",desc:"Melee Weapon Attack: +14 to hit, reach 5 ft., one target. Hit: 15 (2d6 + 8) slashing damage.",attack_bonus:14,damage_dice:"2d6",damage_bonus:8},{name:"Tail",desc:"Melee Weapon Attack: +14 to hit, reach 15 ft., one target. Hit: 17 (2d8 + 8) bludgeoning damage.",attack_bonus:14,damage_dice:"2d8",damage_bonus:8},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 21 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nFire Breath. The dragon exhales fire in a 60-foot cone. Each creature in that area must make a DC 21 Dexterity saving throw, taking 66 (12d10) fire damage on a failed save, or half as much damage on a successful one.\\nWeakening Breath. The dragon exhales gas in a 60-foot cone. Each creature in that area must succeed on a DC 21 Strength saving throw or have disadvantage on Strength-based attack rolls, Strength checks, and Strength saving throws for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0,damage_dice:"12d10"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 10 ft. of the dragon must succeed on a DC 22 Dexterity saving throw or take 15 (2d6 + 8) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Adult Green Dragon",size:"Huge",type:"dragon",subtype:"",alignment:"lawful evil",ac:19,hp:207,hit_dice:"18d12 + 90",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[23,12,21,18,15,17],saves:[{dexterity:6},{constitution:10},{wisdom:7},{charisma:8}],skillsaves:[{deception:8},{insight:7},{persuasion:8},{perception:12},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison",condition_immunities:"poisoned",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 22",languages:"Common, Draconic",cr:"15",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0},{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +11 to hit, reach 10 ft., one target. Hit: 17 (2d10 + 6) piercing damage plus 7 (2d6) poison damage.",attack_bonus:11,damage_dice:"2d10 + 2d6",damage_bonus:6},{name:"Claw",desc:"Melee Weapon Attack: +11 to hit, reach 5 ft., one target. Hit: 13 (2d6 + 6) slashing damage.",attack_bonus:11,damage_dice:"2d6",damage_bonus:6},{name:"Tail",desc:"Melee Weapon Attack: +11 to hit, reach 15 ft., one target. Hit: 15 (2d8 + 6) bludgeoning damage.",attack_bonus:11,damage_dice:"2d8",damage_bonus:6},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 16 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours .",attack_bonus:0},{name:"Poison Breath (Recharge 5-6)",desc:"The dragon exhales poisonous gas in a 60-foot cone. Each creature in that area must make a DC 18 Constitution saving throw, taking 56 (16d6) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"16d6"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 10 ft. of the dragon must succeed on a DC 19 Dexterity saving throw or take 13 (2d6 + 6) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Adult Red Dragon",size:"Huge",type:"dragon",subtype:"",alignment:"chaotic evil",ac:19,hp:256,hit_dice:"19d12 + 132",speed:"40 ft., climb 40 ft., fly 80 ft.",stats:[27,10,25,16,13,21],saves:[{dexterity:6},{constitution:13},{wisdom:7},{charisma:11}],skillsaves:[{perception:13},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 23",languages:"Common, Draconic",cr:"17",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +14 to hit, reach 10 ft., one target. Hit: 19 (2d10 + 8) piercing damage plus 7 (2d6) fire damage.",attack_bonus:14,damage_dice:"2d10 + 2d6",damage_bonus:8},{name:"Claw",desc:"Melee Weapon Attack: +14 to hit, reach 5 ft., one target. Hit: 15 (2d6 + 8) slashing damage.",attack_bonus:14,damage_dice:"2d6",damage_bonus:8},{name:"Tail",desc:"Melee Weapon Attack: +14 to hit, reach 15 ft., one target. Hit: 17 (2d8 + 8) bludgeoning damage.",attack_bonus:14,damage_dice:"2d8",damage_bonus:8},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 ft. of the dragon and aware of it must succeed on a DC 19 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Fire Breath (Recharge 5-6)",desc:"The dragon exhales fire in a 60-foot cone. Each creature in that area must make a DC 21 Dexterity saving throw, taking 63 (18d6) fire damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"18d6"},{name:"Lair Actions",desc:"On initiative count 20 (losing initiative ties), the dragon takes a lair action to cause one of the following effects: the dragon can't use the same effect two rounds in a row:\\n\u2022 Magma erupts from a point on the ground the dragon can see within 120 feet of it, creating a 20-foot-high, 5-foot-radius geyser. Each creature in the geyser's area must make a DC 15 Dexterity saving throw, taking 21 (6d6) fire damage on a failed save, or half as much damage on a successful one.\\n\u2022 A tremor shakes the lair in a 60-foot-radius around the dragon. Each creature other than the dragon on the ground in that area must succeed on a DC 15 Dexterity saving throw or be knocked prone.\\n\u2022 Volcanic gases form a cloud in a 20-foot-radius sphere centered on a point the dragon can see within 120 feet of it. The sphere spreads around corners, and its area is lightly obscured. It lasts until initiative count 20 on the next round. Each creature that starts its turn in the cloud must succeed on a DC 13 Constitution saving throw or be poisoned until the end of its turn. While poisoned in this way, a creature is incapacitated.",attack_bonus:0,damage_dice:"6d6"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 10 ft. of the dragon must succeed on a DC 22 Dexterity saving throw or take 15 (2d6 + 8) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Adult Silver Dragon",size:"Huge",type:"dragon",subtype:"",alignment:"lawful good",ac:19,hp:243,hit_dice:"18d12 + 126",speed:"40 ft., fly 80 ft.",stats:[27,10,25,16,13,21],saves:[{dexterity:5},{constitution:12},{wisdom:6},{charisma:10}],skillsaves:[{arcana:8},{history:8},{perception:11},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"cold",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 21",languages:"Common, Draconic",cr:"16",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +13 to hit, reach 10 ft., one target. Hit: 19 (2d10 + 8) piercing damage.",attack_bonus:13,damage_dice:"2d10",damage_bonus:8},{name:"Claw",desc:"Melee Weapon Attack: +13 to hit, reach 5 ft., one target. Hit: 15 (2d6 + 8) slashing damage.",attack_bonus:13,damage_dice:"2d6",damage_bonus:8},{name:"Tail",desc:"Melee Weapon Attack: +13 to hit, reach 15 ft., one target. Hit: 17 (2d8 + 8) bludgeoning damage.",attack_bonus:13,damage_dice:"2d8",damage_bonus:8},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 18 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nCold Breath. The dragon exhales an icy blast in a 60-foot cone. Each creature in that area must make a DC 20 Constitution saving throw, taking 58 (13d8) cold damage on a failed save, or half as much damage on a successful one.\\nParalyzing Breath. The dragon exhales paralyzing gas in a 60-foot cone. Each creature in that area must succeed on a DC 20 Constitution saving throw or be paralyzed for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0,damage_dice:"13d8"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 10 ft. of the dragon must succeed on a DC 22 Dexterity saving throw or take 15 (2d6 + 8) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Adult White Dragon",size:"Huge",type:"dragon",subtype:"",alignment:"chaotic evil",ac:18,hp:200,hit_dice:"16d12 + 96",speed:"40 ft., burrow 30 ft., fly 80 ft., swim 40 ft.",stats:[22,10,22,8,12,12],saves:[{dexterity:5},{constitution:11},{wisdom:6},{charisma:6}],skillsaves:[{perception:11},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"cold",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 21",languages:"Common, Draconic",cr:"13",traits:[{name:"Ice Walk",desc:"The dragon can move across and climb icy surfaces without needing to make an ability check. Additionally, difficult terrain composed of ice or snow doesn't cost it extra moment.",attack_bonus:0},{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +11 to hit, reach 10 ft., one target. Hit: 17 (2d10 + 6) piercing damage plus 4 (1d8) cold damage.",attack_bonus:11,damage_dice:"2d10 + 1d8",damage_bonus:6},{name:"Claw",desc:"Melee Weapon Attack: +11 to hit, reach 5 ft., one target. Hit: 13 (2d6 + 6) slashing damage.",attack_bonus:11,damage_dice:"2d6",damage_bonus:6},{name:"Tail",desc:"Melee Weapon Attack: +11 to hit, reach 15 ft., one target. Hit: 15 (2d8 + 6) bludgeoning damage.",attack_bonus:11,damage_dice:"2d8",damage_bonus:6},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 ft. of the dragon and aware of it must succeed on a DC 14 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Cold Breath (Recharge 5-6)",desc:"The dragon exhales an icy blast in a 60-foot cone. Each creature in that area must make a DC 19 Constitution saving throw, taking 54 (12d8) cold damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"12d8"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 10 ft. of the dragon must succeed on a DC 19 Dexterity saving throw or take 13 (2d6 + 6) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Air Elemental",size:"Large",type:"elemental",subtype:"",alignment:"neutral",ac:15,hp:90,hit_dice:"12d10 + 24",speed:"fly 90 ft. (hover)",stats:[14,20,14,6,10,6],damage_vulnerabilities:"",damage_resistances:"lightning; thunder; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"poison",condition_immunities:"exhaustion, grappled, paralyzed, petrified, poisoned, prone, restrained, unconscious",senses:"darkvision 60 ft., passive Perception 10",languages:"Auran",cr:"5",traits:[{name:"Air Form",desc:"The elemental can enter a hostile creature's space and stop there. It can move through a space as narrow as 1 inch wide without squeezing.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The elemental makes two slam attacks.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +8 to hit, reach 5 ft., one target. Hit: 14 (2d8 + 5) bludgeoning damage.",attack_bonus:8,damage_dice:"2d8",damage_bonus:5},{name:"Whirlwind (Recharge 4-6)",desc:"Each creature in the elemental's space must make a DC 13 Strength saving throw. On a failure, a target takes 15 (3d8 + 2) bludgeoning damage and is flung up 20 feet away from the elemental in a random direction and knocked prone. If a thrown target strikes an object, such as a wall or floor, the target takes 3 (1d6) bludgeoning damage for every 10 feet it was thrown. If the target is thrown at another creature, that creature must succeed on a DC 13 Dexterity saving throw or take the same damage and be knocked prone.\\nIf the saving throw is successful, the target takes half the bludgeoning damage and isn't flung away or knocked prone.",attack_bonus:0}]},{name:"Ancient Black Dragon",size:"Gargantuan",type:"dragon",subtype:"",alignment:"chaotic evil",ac:22,hp:367,hit_dice:"21d20 + 146",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[27,14,25,16,15,19],saves:[{dexterity:9},{constitution:14},{wisdom:9},{charisma:11}],skillsaves:[{perception:16},{stealth:9}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"acid",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 26",languages:"Common, Draconic",cr:"21",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0},{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack:+ 15 to hit, reach 15 ft., one target. Hit: 19 (2d10 + 8) piercing damage plus 9 (2d8) acid damage.",attack_bonus:15,damage_dice:"2d10 + 2d8",damage_bonus:8},{name:"Claw",desc:"Melee Weapon Attack: +15 to hit, reach 10 ft., one target. Hit: 15 (2d6 + 8) slashing damage.",attack_bonus:15,damage_dice:"2d6",damage_bonus:8},{name:"Tail",desc:"Melee Weapon Attack: +15 to hit, reach 20 ft ., one target. Hit: 17 (2d8 + 8) bludgeoning damage.",attack_bonus:15,damage_dice:"2d8",damage_bonus:8},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 19 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Acid Breath (Recharge 5-6)",desc:"The dragon exhales acid in a 90-foot line that is 10 feet wide. Each creature in that line must make a DC 22 Dexterity saving throw, taking 67 (15d8) acid damage on a failed save, or half as much damage on a successful one.",attack_bonus:0}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 15 ft. of the dragon must succeed on a DC 23 Dexterity saving throw or take 15 (2d6 + 8) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Ancient Blue Dragon",size:"Gargantuan",type:"dragon",subtype:"",alignment:"lawful evil",ac:22,hp:481,hit_dice:"26d20 + 208",speed:"40 ft., burrow 40 ft., fly 80 ft.",stats:[29,10,27,18,17,21],saves:[{dexterity:7},{constitution:15},{wisdom:10},{charisma:12}],skillsaves:[{perception:17},{stealth:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 27",languages:"Common, Draconic",cr:"23",actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +16 to hit, reach 15 ft., one target. Hit: 20 (2d10 + 9) piercing damage plus 11 (2d10) lightning damage.",attack_bonus:16,damage_dice:"2d10 + 2d10",damage_bonus:9},{name:"Claw",desc:"Melee Weapon Attack: +16 to hit, reach 10 ft., one target. Hit: 16 (2d6 + 9) slashing damage.",attack_bonus:16,damage_dice:"2d6",damage_bonus:9},{name:"Tail",desc:"Melee Weapon Attack: +16 to hit, reach 20 ft., one target. Hit: 18 (2d8 + 9) bludgeoning damage.",attack_bonus:16,damage_dice:"2d8",damage_bonus:9},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 20 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Lightning Breath (Recharge 5-6)",desc:"The dragon exhales lightning in a 120-foot line that is 10 feet wide. Each creature in that line must make a DC 23 Dexterity saving throw, taking 88 (16d10) lightning damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"16d10"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 15 ft. of the dragon must succeed on a DC 24 Dexterity saving throw or take 16 (2d6 + 9) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Ancient Brass Dragon",size:"Gargantuan",type:"dragon",subtype:"",alignment:"chaotic good",ac:20,hp:297,hit_dice:"17d20 + 118",speed:"40 ft., burrow 40 ft., fly 80 ft.",stats:[27,10,25,16,15,19],saves:[{dexterity:6},{constitution:13},{wisdom:8},{charisma:10}],skillsaves:[{history:9},{persuasion:10},{perception:14},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 24",languages:"Common, Draconic",cr:"20",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +14 to hit, reach 15 ft., one target. Hit: 19 (2d10 + 8) piercing damage.",attack_bonus:14,damage_dice:"2d10",damage_bonus:8},{name:"Claw",desc:"Melee Weapon Attack: +14 to hit, reach 10 ft., one target. Hit: 15 (2d6 + 8) slashing damage.",attack_bonus:14,damage_dice:"2d6",damage_bonus:8},{name:"Tail",desc:"Melee Weapon Attack: +14 to hit, reach 20 ft., one target. Hit: 17 (2d8 + 8) bludgeoning damage.",attack_bonus:14,damage_dice:"2d8",damage_bonus:8},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 18 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons:\\nFire Breath. The dragon exhales fire in an 90-foot line that is 10 feet wide. Each creature in that line must make a DC 21 Dexterity saving throw, taking 56 (16d6) fire damage on a failed save, or half as much damage on a successful one.\\nSleep Breath. The dragon exhales sleep gas in a 90-foot cone. Each creature in that area must succeed on a DC 21 Constitution saving throw or fall unconscious for 10 minutes. This effect ends for a creature if the creature takes damage or someone uses an action to wake it.",attack_bonus:0,damage_dice:"16d6"},{name:"Change Shape",desc:"The dragon magically polymorphs into a humanoid or beast that has a challenge rating no higher than its own, or back into its true form. It reverts to its true form if it dies. Any equipment it is wearing or carrying is absorbed or borne by the new form (the dragon's choice).\\nIn a new form, the dragon retains its alignment, hit points, Hit Dice, ability to speak, proficiencies, Legendary Resistance, lair actions, and Intelligence, Wisdom, and Charisma scores, as well as this action. Its statistics and capabilities are otherwise replaced by those of the new form, except any class features or legendary actions of that form.",attack_bonus:0}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 15 ft. of the dragon must succeed on a DC 22 Dexterity saving throw or take 15 (2d6 + 8) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Ancient Bronze Dragon",size:"Gargantuan",type:"dragon",subtype:"",alignment:"lawful good",ac:22,hp:444,hit_dice:"24d20 + 192",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[29,10,27,18,17,21],saves:[{dexterity:7},{constitution:15},{wisdom:10},{charisma:12}],skillsaves:[{insight:10},{perception:17},{stealth:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 27",languages:"Common, Draconic",cr:"22",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0},{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +16 to hit, reach 15 ft., one target. Hit: 20 (2d10 + 9) piercing damage.",attack_bonus:16,damage_dice:"2d10",damage_bonus:9},{name:"Claw",desc:"Melee Weapon Attack: +16 to hit, reach 10 ft., one target. Hit: 16 (2d6 + 9) slashing damage.",attack_bonus:16,damage_dice:"1d6",damage_bonus:9},{name:"Tail",desc:"Melee Weapon Attack: +16 to hit, reach 20 ft., one target. Hit: 18 (2d8 + 9) bludgeoning damage.",attack_bonus:0,damage_dice:"2d8",damage_bonus:9},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 20 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nLightning Breath. The dragon exhales lightning in a 120-foot line that is 10 feet wide. Each creature in that line must make a DC 23 Dexterity saving throw, taking 88 (16d10) lightning damage on a failed save, or half as much damage on a successful one.\\nRepulsion Breath. The dragon exhales repulsion energy in a 30-foot cone. Each creature in that area must succeed on a DC 23 Strength saving throw. On a failed save, the creature is pushed 60 feet away from the dragon.",attack_bonus:0,damage_dice:"16d10"},{name:"Change Shape",desc:"The dragon magically polymorphs into a humanoid or beast that has a challenge rating no higher than its own, or back into its true form. It reverts to its true form if it dies. Any equipment it is wearing or carrying is absorbed or borne by the new form (the dragon's choice).\\nIn a new form, the dragon retains its alignment, hit points, Hit Dice, ability to speak, proficiencies, Legendary Resistance, lair actions, and Intelligence, Wisdom, and Charisma scores, as well as this action. Its statistics and capabilities are otherwise replaced by those of the new form, except any class features or legendary actions of that form.",attack_bonus:0}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 15 ft. of the dragon must succeed on a DC 24 Dexterity saving throw or take 16 (2d6 + 9) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Ancient Copper Dragon",size:"Gargantuan",type:"dragon",subtype:"",alignment:"chaotic good",ac:21,hp:350,hit_dice:"20d20 + 140",speed:"40 ft., climb 40 ft., fly 80 ft.",stats:[27,12,25,20,17,19],saves:[{dexterity:8},{constitution:14},{wisdom:10},{charisma:11}],skillsaves:[{stealth:8},{perception:17},{deception:11}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"acid",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 27",languages:"Common, Draconic",cr:"21",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +15 to hit, reach 15 ft., one target. Hit: 19 (2d10 + 8) piercing damage.",attack_bonus:15,damage_dice:"2d10",damage_bonus:8},{name:"Claw",desc:"Melee Weapon Attack: +15 to hit, reach 10 ft., one target. Hit: 15 (2d6 + 8) slashing damage.",attack_bonus:15,damage_dice:"2d6",damage_bonus:8},{name:"Tail",desc:"Melee Weapon Attack: +15 to hit, reach 20 ft., one target. Hit: 17 (2d8 + 8) bludgeoning damage.",attack_bonus:15,damage_dice:"2d8",damage_bonus:8},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 19 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nAcid Breath. The dragon exhales acid in an 90-foot line that is 10 feet wide. Each creature in that line must make a DC 22 Dexterity saving throw, taking 63 (14d8) acid damage on a failed save, or half as much damage on a successful one.\\nSlowing Breath. The dragon exhales gas in a 90-foot cone. Each creature in that area must succeed on a DC 22 Constitution saving throw. On a failed save, the creature can't use reactions, its speed is halved, and it can't make more than one attack on its turn. In addition, the creature can use either an action or a bonus action on its turn, but not both. These effects last for 1 minute. The creature can repeat the saving throw at the end of each of its turns, ending the effect on itself with a successful save.",attack_bonus:0,damage_dice:"14d8"},{name:"Change Shape",desc:"The dragon magically polymorphs into a humanoid or beast that has a challenge rating no higher than its own, or back into its true form. It reverts to its true form if it dies. Any equipment it is wearing or carrying is absorbed or borne by the new form (the dragon's choice).\\nIn a new form, the dragon retains its alignment, hit points, Hit Dice, ability to speak, proficiencies, Legendary Resistance, lair actions, and Intelligence, Wisdom, and Charisma scores, as well as this action. Its statistics and capabilities are otherwise replaced by those of the new form, except any class features or legendary actions of that form.",attack_bonus:0}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 15 ft. of the dragon must succeed on a DC 23 Dexterity saving throw or take 15 (2d6 + 8) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Ancient Gold Dragon",size:"Gargantuan",type:"dragon",subtype:"",alignment:"lawful good",ac:22,hp:546,hit_dice:"28d20 + 252",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[30,14,29,18,17,28],saves:[{dexterity:9},{constitution:16},{wisdom:10},{charisma:16}],skillsaves:[{persuasion:16},{stealth:9},{perception:17},{insight:10}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 27",languages:"Common, Draconic",cr:"24",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0},{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +17 to hit, reach 15 ft., one target. Hit: 21 (2d10 + 10) piercing damage.",attack_bonus:17,damage_dice:"2d10",damage_bonus:10},{name:"Claw",desc:"Melee Weapon Attack: +17 to hit, reach 10 ft., one target. Hit: 17 (2d6 + 10) slashing damage.",attack_bonus:17,damage_dice:"2d6",damage_bonus:10},{name:"Tail",desc:"Melee Weapon Attack: +17 to hit, reach 20 ft., one target. Hit: 19 (2d8 + 10) bludgeoning damage.",attack_bonus:17,damage_dice:"2d8",damage_bonus:10},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 24 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nFire Breath. The dragon exhales fire in a 90-foot cone. Each creature in that area must make a DC 24 Dexterity saving throw, taking 71 (13d10) fire damage on a failed save, or half as much damage on a successful one.\\nWeakening Breath. The dragon exhales gas in a 90-foot cone. Each creature in that area must succeed on a DC 24 Strength saving throw or have disadvantage on Strength-based attack rolls, Strength checks, and Strength saving throws for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0,damage_dice:"13d10"},{name:"Change Shape",desc:"The dragon magically polymorphs into a humanoid or beast that has a challenge rating no higher than its own, or back into its true form. It reverts to its true form if it dies. Any equipment it is wearing or carrying is absorbed or borne by the new form (the dragon's choice).\\nIn a new form, the dragon retains its alignment, hit points, Hit Dice, ability to speak, proficiencies, Legendary Resistance, lair actions, and Intelligence, Wisdom, and Charisma scores, as well as this action. Its statistics and capabilities are otherwise replaced by those of the new form, except any class features or legendary actions of that form.",attack_bonus:0}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 15 ft. of the dragon must succeed on a DC 25 Dexterity saving throw or take 17 (2d6 + 10) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Ancient Green Dragon",size:"Gargantuan",type:"dragon",subtype:"",alignment:"lawful evil",ac:21,hp:385,hit_dice:"22d20 + 154",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[27,12,25,20,17,19],saves:[{dexterity:8},{constitution:14},{wisdom:10},{charisma:11}],skillsaves:[{deception:11},{insight:10},{perception:17},{persuasion:11},{stealth:8}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison",condition_immunities:"poisoned",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 27",languages:"Common, Draconic",cr:"22",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0},{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +15 to hit, reach 15 ft., one target. Hit: 19 (2d10 + 8) piercing damage plus 10 (3d6) poison damage.",attack_bonus:15,damage_dice:"2d10 + 3d6",damage_bonus:9},{name:"Claw",desc:"Melee Weapon Attack: +15 to hit, reach 10 ft., one target. Hit: 22 (4d6 + 8) slashing damage.",attack_bonus:15,damage_dice:"4d6",damage_bonus:8},{name:"Tail",desc:"Melee Weapon Attack: +15 to hit, reach 20 ft., one target. Hit: 17 (2d8 + 8) bludgeoning damage.",attack_bonus:16,damage_dice:"2d8",damage_bonus:8},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 19 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Poison Breath (Recharge 5-6)",desc:"The dragon exhales poisonous gas in a 90-foot cone. Each creature in that area must make a DC 22 Constitution saving throw, taking 77 (22d6) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"22d6"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 15 ft. of the dragon must succeed on a DC 23 Dexterity saving throw or take 15 (2d6 + 8) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Ancient Red Dragon",size:"Gargantuan",type:"dragon",subtype:"",alignment:"chaotic evil",ac:22,hp:546,hit_dice:"28d20 + 252",speed:"40 ft., climb 40 ft., fly 80 ft.",stats:[30,10,29,18,15,23],saves:[{dexterity:7},{constitution:16},{wisdom:9},{charisma:13}],skillsaves:[{perception:16},{stealth:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 26",languages:"Common, Draconic",cr:"24",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +17 to hit, reach 15 ft., one target. Hit: 21 (2d10 + 10) piercing damage plus 14 (4d6) fire damage.",attack_bonus:17,damage_dice:"2d10 + 4d6",damage_bonus:10},{name:"Claw",desc:"Melee Weapon Attack: +17 to hit, reach 10 ft., one target. Hit: 17 (2d6 + 10) slashing damage.",attack_bonus:17,damage_dice:"2d6",damage_bonus:10},{name:"Tail",desc:"Melee Weapon Attack: +17 to hit, reach 20 ft., one target. Hit: 19 (2d8 + 10) bludgeoning damage.",attack_bonus:17,damage_dice:"2d8",damage_bonus:10},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 21 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Fire Breath (Recharge 5-6)",desc:"The dragon exhales fire in a 90-foot cone. Each creature in that area must make a DC 24 Dexterity saving throw, taking 91 (26d6) fire damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"26d6"}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 15 ft. of the dragon must succeed on a DC 25 Dexterity saving throw or take 17 (2d6 + 10) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Ancient Silver Dragon",size:"Gargantuan",type:"dragon",subtype:"",alignment:"lawful good",ac:22,hp:487,hit_dice:"25d20 + 224",speed:"40 ft., fly 80 ft.",stats:[30,10,29,18,15,23],saves:[{dexterity:7},{constitution:16},{wisdom:9},{charisma:13}],skillsaves:[{arcana:11},{perception:16},{history:11},{stealth:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"cold",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 26",languages:"Common, Draconic",cr:"23",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +17 to hit, reach 15 ft., one target. Hit: 21 (2d10 + 10) piercing damage.",attack_bonus:17,damage_dice:"2d10",damage_bonus:10},{name:"Claw",desc:"Melee Weapon Attack: +17 to hit, reach 10 ft., one target. Hit: 17 (2d6 + 10) slashing damage.",attack_bonus:17,damage_dice:"2d6",damage_bonus:10},{name:"Tail",desc:"Melee Weapon Attack: +17 to hit, reach 20 ft., one target. Hit: 19 (2d8 + 10) bludgeoning damage.",attack_bonus:17,damage_dice:"2d8",damage_bonus:10},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 21 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nCold Breath. The dragon exhales an icy blast in a 90-foot cone. Each creature in that area must make a DC 24 Constitution saving throw, taking 67 (15d8) cold damage on a failed save, or half as much damage on a successful one.\\nParalyzing Breath. The dragon exhales paralyzing gas in a 90- foot cone. Each creature in that area must succeed on a DC 24 Constitution saving throw or be paralyzed for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0,damage_dice:"15d8"},{name:"Change Shape",desc:"The dragon magically polymorphs into a humanoid or beast that has a challenge rating no higher than its own, or back into its true form. It reverts to its true form if it dies. Any equipment it is wearing or carrying is absorbed or borne by the new form (the dragon's choice).\\nIn a new form, the dragon retains its alignment, hit points, Hit Dice, ability to speak, proficiencies, Legendary Resistance, lair actions, and Intelligence, Wisdom, and Charisma scores, as well as this action. Its statistics and capabilities are otherwise replaced by those of the new form, except any class features or legendary actions of that form.",attack_bonus:0}],legendary_actions:[{name:"Detect",desc:"The dragon makes a Wisdom (Perception) check.",attack_bonus:0},{name:"Tail Attack",desc:"The dragon makes a tail attack.",attack_bonus:0},{name:"Wing Attack (Costs 2 Actions)",desc:"The dragon beats its wings. Each creature within 15 ft. of the dragon must succeed on a DC 25 Dexterity saving throw or take 17 (2d6 + 10) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.",attack_bonus:0}]},{name:"Ancient White Dragon",size:"Gargantuan",type:"dragon",subtype:"",alignment:"chaotic evil",ac:20,hp:333,hit_dice:"18d20 + 144",speed:"40 ft., burrow 40 ft., fly 80 ft., swim 40 ft.",stats:[26,10,26,10,13,14],saves:[{dexterity:6},{constitution:14},{wisdom:7},{charisma:8}],skillsaves:[{perception:13},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"cold",condition_immunities:"",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 23",languages:"Common, Draconic",cr:"20",traits:[{name:"Ice Walk",desc:"The dragon can move across and climb icy surfaces without needing to make an ability check. Additionally, difficult terrain composed of ice or snow doesn't cost it extra moment.",attack_bonus:0},{name:"Legendary Resistance (3/Day)",desc:"If the dragon fails a saving throw, it can choose to succeed instead.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +14 to hit, reach 15 ft., one target. Hit: 19 (2d10 + 8) piercing damage plus 9 (2d8) cold damage.",attack_bonus:14,damage_dice:"2d10 + 2d8",damage_bonus:8},{name:"Claw",desc:"Melee Weapon Attack: +14 to hit, reach 10 ft., one target. Hit: 15 (2d6 + 8) slashing damage.",attack_bonus:14,damage_dice:"2d6",damage_bonus:8},{name:"Tail",desc:"Melee Weapon Attack: +14 to hit, reach 20 ft., one target. Hit: 17 (2d8 + 8) bludgeoning damage.",attack_bonus:14,damage_dice:"2d8",damage_bonus:8},{name:"Frightful Presence",desc:"Each creature of the dragon's choice that is within 120 feet of the dragon and aware of it must succeed on a DC 16 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the dragon's Frightful Presence for the next 24 hours .",attack_bonus:0},{name:"Cold Breath (Recharge 5-6)",desc:"The dragon exhales an icy blast in a 90-foot cone. Each creature in that area must make a DC 22 Constitution saving throw, taking 72 (l6d8) cold damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"16d8"}]},{name:"Androsphinx",size:"Large",type:"monstrosity",subtype:"",alignment:"lawful neutral",ac:17,hp:199,hit_dice:"19d10 + 94",speed:"40 ft., fly 60 ft.",stats:[22,10,20,16,18,23],saves:[{dexterity:6},{constitution:11},{intelligence:9},{wisdom:10}],skillsaves:[{religion:15},{perception:10},{arcana:9}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"psychic; bludgeoning, piercing, and slashing from nonmagical weapons",condition_immunities:"charmed, frightened",senses:"truesight 120 ft., passive Perception 20",languages:"Common, Sphinx",cr:"17",traits:[{name:"Inscrutable",desc:"The sphinx is immune to any effect that would sense its emotions or read its thoughts, as well as any divination spell that it refuses. Wisdom (Insight) checks made to ascertain the sphinx's intentions or sincerity have disadvantage.",attack_bonus:0},{name:"Magic Weapons",desc:"The sphinx's weapon attacks are magical.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The sphinx makes two claw attacks.",attack_bonus:0},{name:"Claw",desc:"Melee Weapon Attack: +12 to hit, reach 5 ft., one target. Hit: 17 (2d10 + 6) slashing damage.",attack_bonus:12,damage_dice:"2d10",damage_bonus:6},{name:"Roar (3/Day)",desc:"The sphinx emits a magical roar. Each time it roars before finishing a long rest, the roar is louder and the effect is different, as detailed below. Each creature within 500 feet of the sphinx and able to hear the roar must make a saving throw.\\n\\nFirst Roar. Each creature that fails a DC 18 Wisdom saving throw is frightened for 1 minute. A frightened creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.\\n\\nSecond Roar. Each creature that fails a DC 18 Wisdom saving throw is deafened and frightened for 1 minute. A frightened creature is paralyzed and can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.\\n\\nThird Roar. Each creature makes a DC 18 Constitution saving throw. On a failed save, a creature takes 44 (8d10) thunder damage and is knocked prone. On a successful save, the creature takes half as much damage and isn't knocked prone.",attack_bonus:0}],legendary_actions:[{name:"Claw Attack",desc:"The sphinx makes one claw attack.",attack_bonus:0},{name:"Teleport (Costs 2 Actions)",desc:"The sphinx magically teleports, along with any equipment it is wearing or carrying, up to 120 feet to an unoccupied space it can see.",attack_bonus:0},{name:"Cast a Spell (Costs 3 Actions)",desc:"The sphinx casts a spell from its list of prepared spells, using a spell slot as normal.",attack_bonus:0}],spells:["The sphinx is a 12th-level spellcaster. Its spellcasting ability is Wisdom (spell save DC 18, +10 to hit with spell attacks). It requires no material components to cast its spells. The sphinx has the following cleric spells prepared:",{"Cantrips (at will)":"sacred flame, spare the dying, thaumaturgy"},{"1st level (4 slots)":"command, detect evil and good, detect magic"},{"2nd level (3 slots)":"lesser restoration, zone of truth"},{"3rd level (3 slots)":"dispel magic, tongues"},{"4th level (3 slots)":"banishment, freedom of movement"},{"5th level (2 slots)":"flame strike, greater restoration"},{"6th level (1 slot)":"heroes' feast"}]},{name:"Animated Armor",size:"Medium",type:"construct",subtype:"",alignment:"unaligned",ac:18,hp:33,hit_dice:"6d8 + 6",speed:"25 ft.",stats:[14,11,13,1,3,1],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison, psychic",condition_immunities:"blinded, charmed, deafened, exhaustion, frightened, paralyzed, petrified, poisoned",senses:"blindsight 60 ft. (blind beyond this radius), passive Perception 6",languages:"",cr:"1",traits:[{name:"Antimagic Susceptibility",desc:"The armor is incapacitated while in the area of an antimagic field. If targeted by dispel magic, the armor must succeed on a Constitution saving throw against the caster's spell save DC or fall unconscious for 1 minute.",attack_bonus:0},{name:"False Appearance",desc:"While the armor remains motionless, it is indistinguishable from a normal suit of armor.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The armor makes two melee attacks.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) bludgeoning damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Ankheg",size:"Large",type:"monstrosity",subtype:"",alignment:"unaligned",ac:14,hp:39,hit_dice:"6d10 + 6",speed:"30 ft., burrow 10 ft.",stats:[17,11,13,1,13,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., tremorsense 60 ft., passive Perception 11",languages:"",cr:"2",actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) slashing damage plus 3 (1d6) acid damage. If the target is a Large or smaller creature, it is grappled (escape DC 13). Until this grapple ends, the ankheg can bite only the grappled creature and has advantage on attack rolls to do so.",attack_bonus:5,damage_dice:"2d6 + 1d6",damage_bonus:3},{name:"Acid Spray (Recharge 6)",desc:"The ankheg spits acid in a line that is 30 ft. long and 5 ft. wide, provided that it has no creature grappled. Each creature in that line must make a DC 13 Dexterity saving throw, taking 10 (3d6) acid damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"3d6"}]},{name:"Ape",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:19,hit_dice:"3d8 + 5",speed:"30 ft., climb 30 ft.",stats:[16,14,14,6,12,7],skillsaves:[{athletics:5},{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"1/2",actions:[{name:"Multiattack",desc:"The ape makes two fist attacks.",attack_bonus:0},{name:"Fist",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) bludgeoning damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3},{name:"Rock",desc:"Ranged Weapon Attack: +5 to hit, range 25/50 ft., one target. Hit: 6 (1d6 + 3) bludgeoning damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3}]},{name:"Archmage",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:12,hp:99,hit_dice:"18d8 + 18",speed:"30 ft.",stats:[10,14,12,20,15,16],saves:[{intelligence:9},{wisdom:6}],skillsaves:[{arcana:13},{history:13}],damage_vulnerabilities:"",damage_resistances:"damage from spells; non magical bludgeoning, piercing, and slashing (from stoneskin)",damage_immunities:"",condition_immunities:"",senses:"passive Perception 12",languages:"any six languages",cr:"12",traits:[{name:"Magic Resistance",desc:"The archmage has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Dagger",desc:"Melee or Ranged Weapon Attack: +6 to hit, reach 5 ft. or range 20/60 ft., one target. Hit: 4 (1d4 + 2) piercing damage.",attack_bonus:6,damage_dice:"1d4",damage_bonus:2}],spells:["The archmage is an 18th-level spellcaster. Its spellcasting ability is Intelligence (spell save DC 17, +9 to hit with spell attacks). The archmage can cast disguise self and invisibility at will and has the following wizard spells prepared:",{"Cantrips (at will)":"fire bolt, light, mage hand, prestidigitation, shocking grasp"},{"1st level (4 slots)":"detect magic, identify, mage armor*, magic missile"},{"2nd level (3 slots)":"detect thoughts, mirror image, misty step"},{"3rd level (3 slots)":"counterspell,fly, lightning bolt"},{"4th level (3 slots)":"banishment, fire shield, stoneskin*"},{"5th level (3 slots)":"cone of cold, scrying, wall of force"},{"6th level (1 slot)":"globe of invulnerability"},{"7th level (1 slot)":"teleport"},{"8th level (1 slot)":"mind blank*"},{"9th level (1 slot)":"time stop"},"* The archmage casts these spells on itself before combat."]},{name:"Assassin",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any non-good alignment",ac:15,hp:78,hit_dice:"12d8 + 24",speed:"30 ft.",stats:[11,16,14,13,11,10],saves:[{dexterity:6},{intelligence:4}],skillsaves:[{acrobatics:6},{deception:3},{perception:3},{stealth:9}],damage_vulnerabilities:"",damage_resistances:"poison",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"Thieves' cant plus any two languages",cr:"8",traits:[{name:"Assassinate",desc:"During its first turn, the assassin has advantage on attack rolls against any creature that hasn't taken a turn. Any hit the assassin scores against a surprised creature is a critical hit.",attack_bonus:0},{name:"Evasion",desc:"If the assassin is subjected to an effect that allows it to make a Dexterity saving throw to take only half damage, the assassin instead takes no damage if it succeeds on the saving throw, and only half damage if it fails.",attack_bonus:0},{name:"Sneak Attack (1/Turn)",desc:"The assassin deals an extra 13 (4d6) damage when it hits a target with a weapon attack and has advantage on the attack roll, or when the target is within 5 ft. of an ally of the assassin that isn't incapacitated and the assassin doesn't have disadvantage on the attack roll.",attack_bonus:0,damage_dice:"4d6"}],actions:[{name:"Multiattack",desc:"The assassin makes two shortsword attacks.",attack_bonus:0},{name:"Shortsword",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) piercing damage, and the target must make a DC 15 Constitution saving throw, taking 24 (7d6) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:6,damage_dice:"1d6",damage_bonus:3},{name:"Light Crossbow",desc:"Ranged Weapon Attack: +6 to hit, range 80/320 ft., one target. Hit: 7 (1d8 + 3) piercing damage, and the target must make a DC 15 Constitution saving throw, taking 24 (7d6) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:6,damage_dice:"1d8",damage_bonus:3}]},{name:"Awakened Shrub",size:"Small",type:"plant",subtype:"",alignment:"unaligned",ac:9,hp:10,hit_dice:"3d6 + -1",speed:"20 ft.",stats:[3,8,11,10,10,6],damage_vulnerabilities:"fire",damage_resistances:"piercing",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"one language known by its creator",cr:"0",traits:[{name:"False Appearance",desc:"While the shrub remains motionless, it is indistinguishable from a normal shrub.",attack_bonus:0}],actions:[{name:"Rake",desc:"Melee Weapon Attack: +1 to hit, reach 5 ft., one target. Hit: 1 (1d4 \u2014 1) slashing damage.",attack_bonus:1,damage_dice:"1d4",damage_bonus:-1}]},{name:"Awakened Tree",size:"Huge",type:"plant",subtype:"",alignment:"unaligned",ac:13,hp:59,hit_dice:"7d12 + 13",speed:"20 ft.",stats:[19,6,15,10,10,7],damage_vulnerabilities:"fire",damage_resistances:"bludgeoning, piercing",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"one language known by its creator",cr:"2",traits:[{name:"False Appearance",desc:"While the tree remains motionless, it is indistinguishable from a normal tree.",attack_bonus:0}],actions:[{name:"Slam",desc:"Melee Weapon Attack: +6 to hit, reach 10 ft., one target. Hit: 14 (3d6 + 4) bludgeoning damage.",attack_bonus:6,damage_dice:"3d6",damage_bonus:4}]},{name:"Axe Beak",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:19,hit_dice:"3d10 + 2",speed:"50 ft.",stats:[14,12,12,2,10,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"1/4",actions:[{name:"Beak",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 6 (1d8 + 2) slashing damage.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2}]},{name:"Azer",size:"Medium",type:"elemental",subtype:"",alignment:"lawful neutral",ac:17,hp:39,hit_dice:"6d8 + 12",speed:"30 ft.",stats:[17,12,15,12,13,10],saves:[{constitution:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"passive Perception 11",languages:"Ignan",cr:"2",traits:[{name:"Heated Body",desc:"A creature that touches the azer or hits it with a melee attack while within 5 ft. of it takes 5 (1d10) fire damage.",attack_bonus:0,damage_dice:"1d10"},{name:"Heated Weapons",desc:"When the azer hits with a metal melee weapon, it deals an extra 3 (1d6) fire damage (included in the attack).",attack_bonus:0},{name:"Illumination",desc:"The azer sheds bright light in a 10-foot radius and dim light for an additional 10 ft..",attack_bonus:0}],actions:[{name:"Warhammer",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) bludgeoning damage, or 8 (1d10 + 3) bludgeoning damage if used with two hands to make a melee attack, plus 3 (1d6) fire damage.",attack_bonus:5,damage_dice:"1d8 + 1d6",damage_bonus:3}]},{name:"Baboon",size:"Small",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:3,hit_dice:"1d6 + -1",speed:"30 ft., climb 30 ft.",stats:[8,14,11,4,12,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 11",languages:"",cr:"0",traits:[{name:"Pack Tactics",desc:"The baboon has advantage on an attack roll against a creature if at least one of the baboon's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +1 to hit, reach 5 ft., one target. Hit: 1 (1d4 \u2014 1) piercing damage.",attack_bonus:1,damage_dice:"1d4",damage_bonus:-1}]},{name:"Badger",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:10,hp:3,hit_dice:"1d4",speed:"20 ft., burrow 5 ft.",stats:[4,11,12,2,12,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 30 ft., passive Perception 11",languages:"",cr:"0",traits:[{name:"Keen Smell",desc:"The badger has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one target. Hit: 1 piercing damage.",attack_bonus:2,damage_bonus:1}]},{name:"Balor",size:"Huge",type:"fiend",subtype:"demon",alignment:"chaotic evil",ac:19,hp:262,hit_dice:"21d12 + 125",speed:"40 ft., fly 80 ft.",stats:[26,15,22,20,16,22],saves:[{strength:14},{constitution:12},{wisdom:9},{charisma:12}],damage_vulnerabilities:"",damage_resistances:"cold, lightning; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"truesight 120 ft., passive Perception 13",languages:"Abyssal, telepathy 120 ft.",cr:"19",traits:[{name:"Death Throes",desc:"When the balor dies, it explodes, and each creature within 30 feet of it must make a DC 20 Dexterity saving throw, taking 70 (20d6) fire damage on a failed save, or half as much damage on a successful one. The explosion ignites flammable objects in that area that aren't being worn or carried, and it destroys the balor's weapons.",attack_bonus:0,damage_dice:"20d6"},{name:"Fire Aura",desc:"At the start of each of the balor's turns, each creature within 5 feet of it takes 10 (3d6) fire damage, and flammable objects in the aura that aren't being worn or carried ignite. A creature that touches the balor or hits it with a melee attack while within 5 feet of it takes 10 (3d6) fire damage.",attack_bonus:0,damage_dice:"3d6"},{name:"Magic Resistance",desc:"The balor has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Magic Weapons",desc:"The balor's weapon attacks are magical.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The balor makes two attacks: one with its longsword and one with its whip.",attack_bonus:0},{name:"Longsword",desc:"Melee Weapon Attack: +14 to hit, reach 10 ft., one target. Hit: 21 (3d8 + 8) slashing damage plus 13 (3d8) lightning damage. If the balor scores a critical hit, it rolls damage dice three times, instead of twice.",attack_bonus:14,damage_dice:"3d8 + 3d8",damage_bonus:8},{name:"Whip",desc:"Melee Weapon Attack: +14 to hit, reach 30 ft., one target. Hit: 15 (2d6 + 8) slashing damage plus 10 (3d6) fire damage, and the target must succeed on a DC 20 Strength saving throw or be pulled up to 25 feet toward the balor.",attack_bonus:14,damage_dice:"2d6 + 3d6",damage_bonus:8},{name:"Teleport",desc:"The balor magically teleports, along with any equipment it is wearing or carrying, up to 120 feet to an unoccupied space it can see.",attack_bonus:0},{name:"Variant: Summon Demon (1/Day)",desc:"The demon chooses what to summon and attempts a magical summoning.\\nA balor has a 50 percent chance of summoning 1d8 vrocks, 1d6 hezrous, 1d4 glabrezus, 1d3 nalfeshnees, 1d2 mariliths, or one goristro.\\nA summoned demon appears in an unoccupied space within 60 feet of its summoner, acts as an ally of its summoner, and can't summon other demons. It remains for 1 minute, until it or its summoner dies, or until its summoner dismisses it as an action.",attack_bonus:0}]},{name:"Bandit",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any non-lawful alignment",ac:12,hp:11,hit_dice:"2d8 + 2",speed:"30 ft.",stats:[11,12,12,10,10,10],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"any one language (usually Common)",cr:"1/8",actions:[{name:"Scimitar",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 4 (1d6 + 1) slashing damage.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1},{name:"Light Crossbow",desc:"Ranged Weapon Attack: +3 to hit, range 80 ft./320 ft., one target. Hit: 5 (1d8 + 1) piercing damage.",attack_bonus:3,damage_dice:"1d8",damage_bonus:1}]},{name:"Bandit Captain",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any non-lawful alignment",ac:15,hp:65,hit_dice:"10d8 + 20",speed:"30 ft.",stats:[15,16,14,14,11,14],saves:[{strength:4},{dexterity:5},{wisdom:2}],skillsaves:[{athletics:4},{deception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"any two languages",cr:"2",actions:[{name:"Multiattack",desc:"The captain makes three melee attacks: two with its scimitar and one with its dagger. Or the captain makes two ranged attacks with its daggers.",attack_bonus:0},{name:"Scimitar",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) slashing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3},{name:"Dagger",desc:"Melee or Ranged Weapon Attack: +5 to hit, reach 5 ft. or range 20/60 ft., one target. Hit: 5 (1d4 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d4",damage_bonus:3}],reactions:[{name:"Parry",desc:"The captain adds 2 to its AC against one melee attack that would hit it. To do so, the captain must see the attacker and be wielding a melee weapon.",attack_bonus:0}]},{name:"Barbed Devil",size:"Medium",type:"fiend",subtype:"devil",alignment:"lawful evil",ac:15,hp:110,hit_dice:"13d8 + 51",speed:"30 ft.",stats:[16,17,18,12,14,14],saves:[{strength:6},{constitution:7},{wisdom:5},{charisma:5}],skillsaves:[{deception:5},{insight:5},{perception:8}],damage_vulnerabilities:"",damage_resistances:"cold; bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"darkvision 120 ft., passive Perception 18",languages:"Infernal, telepathy 120 ft.",cr:"5",traits:[{name:"Barbed Hide",desc:"At the start of each of its turns, the barbed devil deals 5 (1d10) piercing damage to any creature grappling it.",attack_bonus:0,damage_dice:"1d10"},{name:"Devil's Sight",desc:"Magical darkness doesn't impede the devil's darkvision.",attack_bonus:0},{name:"Magic Resistance",desc:"The devil has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The devil makes three melee attacks: one with its tail and two with its claws. Alternatively, it can use Hurl Flame twice.",attack_bonus:0},{name:"Claw",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft ., one target. Hit: 6 (1d6 + 3) piercing damage.",attack_bonus:6,damage_dice:"1d6",damage_bonus:3},{name:"Tail",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) piercing damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:3},{name:"Hurl Flame",desc:"Ranged Spell Attack: +5 to hit, range 150 ft., one target. Hit: 10 (3d6) fire damage. If the target is a flammable object that isn't being worn or carried, it also catches fire.",attack_bonus:5,damage_dice:"3d6"}]},{name:"Basilisk",size:"Medium",type:"monstrosity",subtype:"",alignment:"unaligned",ac:12,hp:52,hit_dice:"8d8 + 16",speed:"20 ft.",stats:[16,8,15,2,8,7],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 9",languages:"",cr:"3",traits:[{name:"Petrifying Gaze",desc:"If a creature starts its turn within 30 ft. of the basilisk and the two of them can see each other, the basilisk can force the creature to make a DC 12 Constitution saving throw if the basilisk isn't incapacitated. On a failed save, the creature magically begins to turn to stone and is restrained. It must repeat the saving throw at the end of its next turn. On a success, the effect ends. On a failure, the creature is petrified until freed by the greater restoration spell or other magic.\\nA creature that isn't surprised can avert its eyes to avoid the saving throw at the start of its turn. If it does so, it can't see the basilisk until the start of its next turn, when it can avert its eyes again. If it looks at the basilisk in the meantime, it must immediately make the save.\\nIf the basilisk sees its reflection within 30 ft. of it in bright light, it mistakes itself for a rival and targets itself with its gaze.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) piercing damage plus 7 (2d6) poison damage.",attack_bonus:5,damage_dice:"2d6 + 2d6",damage_bonus:3}]},{name:"Bat",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:1,hit_dice:"1d4 + -2",speed:"5 ft., fly 30 ft.",stats:[2,15,8,2,12,4],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 60 ft., passive Perception 11",languages:"",cr:"0",traits:[{name:"Echolocation",desc:"The bat can't use its blindsight while deafened.",attack_bonus:0},{name:"Keen Hearing",desc:"The bat has advantage on Wisdom (Perception) checks that rely on hearing.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +0 to hit, reach 5 ft., one creature. Hit: 1 piercing damage.",attack_bonus:0,damage_bonus:1}]},{name:"Bearded Devil",size:"Medium",type:"fiend",subtype:"devil",alignment:"lawful evil",ac:13,hp:52,hit_dice:"8d8 + 16",speed:"30 ft.",stats:[16,15,15,9,11,11],saves:[{strength:5},{constitution:4},{wisdom:2}],damage_vulnerabilities:"",damage_resistances:"cold; bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"darkvision 120 ft., passive Perception 10",languages:"Infernal, telepathy 120 ft.",cr:"3",traits:[{name:"Devil's Sight",desc:"Magical darkness doesn't impede the devil's darkvision.",attack_bonus:0},{name:"Magic Resistance",desc:"The devil has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Steadfast",desc:"The devil can't be frightened while it can see an allied creature within 30 feet of it.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The devil makes two attacks: one with its beard and one with its glaive.",attack_bonus:0},{name:"Beard",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one creature. Hit: 6 (1d8 + 2) piercing damage, and the target must succeed on a DC 12 Constitution saving throw or be poisoned for 1 minute. While poisoned in this way, the target can't regain hit points. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:5,damage_dice:"1d8",damage_bonus:2},{name:"Glaive",desc:"Melee Weapon Attack: +5 to hit, reach 10 ft., one target. Hit: 8 (1d10 + 3) slashing damage. If the target is a creature other than an undead or a construct, it must succeed on a DC 12 Constitution saving throw or lose 5 (1d10) hit points at the start of each of its turns due to an infernal wound. Each time the devil hits the wounded target with this attack, the damage dealt by the wound increases by 5 (1d10). Any creature can take an action to stanch the wound with a successful DC 12 Wisdom (Medicine) check. The wound also closes if the target receives magical healing.",attack_bonus:5,damage_dice:"1d10",damage_bonus:3}]},{name:"Behir",size:"Huge",type:"monstrosity",subtype:"",alignment:"neutral evil",ac:17,hp:168,hit_dice:"16d12 + 64",speed:"50 ft., climb 40 ft.",stats:[23,16,18,7,14,12],skillsaves:[{perception:6},{stealth:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning",condition_immunities:"",senses:"darkvision 90 ft., passive Perception 16",languages:"Draconic",cr:"11",actions:[{name:"Multiattack",desc:"The behir makes two attacks: one with its bite and one to constrict.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +10 to hit, reach 10 ft., one target. Hit: 22 (3d10 + 6) piercing damage.",attack_bonus:10,damage_dice:"3d10",damage_bonus:6},{name:"Constrict",desc:"Melee Weapon Attack: +10 to hit, reach 5 ft., one Large or smaller creature. Hit: 17 (2d10 + 6) bludgeoning damage plus 17 (2d10 + 6) slashing damage. The target is grappled (escape DC 16) if the behir isn't already constricting a creature, and the target is restrained until this grapple ends.",attack_bonus:10,damage_dice:"2d10 + 2d10",damage_bonus:6},{name:"Lightning Breath (Recharge 5-6)",desc:"The behir exhales a line of lightning that is 20 ft. long and 5 ft. wide. Each creature in that line must make a DC 16 Dexterity saving throw, taking 66 (12d10) lightning damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"12d10"},{name:"Swallow",desc:"The behir makes one bite attack against a Medium or smaller target it is grappling. If the attack hits, the target is also swallowed, and the grapple ends. While swallowed, the target is blinded and restrained, it has total cover against attacks and other effects outside the behir, and it takes 21 (6d6) acid damage at the start of each of the behir's turns. A behir can have only one creature swallowed at a time.\\nIf the behir takes 30 damage or more on a single turn from the swallowed creature, the behir must succeed on a DC 14 Constitution saving throw at the end of that turn or regurgitate the creature, which falls prone in a space within 10 ft. of the behir. If the behir dies, a swallowed creature is no longer restrained by it and can escape from the corpse by using 15 ft. of movement, exiting prone.",attack_bonus:0,damage_dice:"6d6"}]},{name:"Berserker",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any chaotic alignment",ac:13,hp:67,hit_dice:"9d8 + 26",speed:"30 ft.",stats:[16,12,17,9,11,9],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"any one language (usually Common)",cr:"2",traits:[{name:"Reckless",desc:"At the start of its turn, the berserker can gain advantage on all melee weapon attack rolls during that turn, but attack rolls against it have advantage until the start of its next turn.",attack_bonus:0}],actions:[{name:"Greataxe",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 9 (1d12 + 3) slashing damage.",attack_bonus:5,damage_dice:"1d12",damage_bonus:3}]},{name:"Black Bear",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:19,hit_dice:"3d8 + 5",speed:"40 ft., climb 30 ft.",stats:[15,10,14,2,12,7],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"1/2",traits:[{name:"Keen Smell",desc:"The bear has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The bear makes two attacks: one with its bite and one with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:3,damage_dice:"1d6",damage_bonus:2},{name:"Claws",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 7 (2d4 + 2) slashing damage.",attack_bonus:3,damage_dice:"2d4",damage_bonus:2}]},{name:"Black Dragon Wyrmling",size:"Medium",type:"dragon",subtype:"",alignment:"chaotic evil",ac:17,hp:33,hit_dice:"6d8 + 6",speed:"30 ft., fly 60 ft., swim 30 ft.",stats:[15,14,13,10,11,13],saves:[{dexterity:4},{constitution:3},{wisdom:2},{charisma:3}],skillsaves:[{perception:4},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"acid",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 14",languages:"Draconic",cr:"2",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (1d10 + 2) piercing damage plus 2 (1d4) acid damage.",attack_bonus:4,damage_dice:"1d10",damage_bonus:2},{name:"Acid Breath (Recharge 5-6)",desc:"The dragon exhales acid in a 15-foot line that is 5 feet wide. Each creature in that line must make a DC 11 Dexterity saving throw, taking 22 (Sd8) acid damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"5d8"}]},{name:"Black Pudding",size:"Large",type:"ooze",subtype:"",alignment:"unaligned",ac:7,hp:85,hit_dice:"10d10 + 30",speed:"20 ft., climb 20 ft.",stats:[16,5,16,1,6,1],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"acid, cold, lightning, slashing",condition_immunities:"blinded, charmed, deafened, exhaustion, frightened, prone",senses:"blindsight 60 ft. (blind beyond this radius), passive Perception 8",languages:"",cr:"4",traits:[{name:"Amorphous",desc:"The pudding can move through a space as narrow as 1 inch wide without squeezing.",attack_bonus:0},{name:"Corrosive Form",desc:"A creature that touches the pudding or hits it with a melee attack while within 5 feet of it takes 4 (1d8) acid damage. Any nonmagical weapon made of metal or wood that hits the pudding corrodes. After dealing damage, the weapon takes a permanent and cumulative -1 penalty to damage rolls. If its penalty drops to -5, the weapon is destroyed. Nonmagical ammunition made of metal or wood that hits the pudding is destroyed after dealing damage. The pudding can eat through 2-inch-thick, nonmagical wood or metal in 1 round.",attack_bonus:0,damage_dice:"1d8"},{name:"Spider Climb",desc:"The pudding can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0}],actions:[{name:"Pseudopod",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) bludgeoning damage plus 18 (4d8) acid damage. In addition, nonmagical armor worn by the target is partly dissolved and takes a permanent and cumulative -1 penalty to the AC it offers. The armor is destroyed if the penalty reduces its AC to 10.",attack_bonus:5,damage_dice:"1d6 + 4d8",damage_bonus:3}],reactions:[{name:"Split",desc:"When a pudding that is Medium or larger is subjected to lightning or slashing damage, it splits into two new puddings if it has at least 10 hit points. Each new pudding has hit points equal to half the original pudding's, rounded down. New puddings are one size smaller than the original pudding.",attack_bonus:0}]},{name:"Blink Dog",size:"Medium",type:"fey",subtype:"",alignment:"lawful good",ac:13,hp:22,hit_dice:"4d8 + 4",speed:"40 ft.",stats:[12,17,12,10,13,11],skillsaves:[{perception:3},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"Blink Dog, understands Sylvan but can't speak it",cr:"1/4",traits:[{name:"Keen Hearing and Smell",desc:"The dog has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 4 (1d6 + 1) piercing damage.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1},{name:"Teleport (Recharge 4-6)",desc:"The dog magically teleports, along with any equipment it is wearing or carrying, up to 40 ft. to an unoccupied space it can see. Before or after teleporting, the dog can make one bite attack.",attack_bonus:0}]},{name:"Blood Hawk",size:"Small",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:7,hit_dice:"2d6",speed:"10 ft., fly 60 ft.",stats:[6,14,10,3,14,5],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 14",languages:"",cr:"1/8",traits:[{name:"Keen Sight",desc:"The hawk has advantage on Wisdom (Perception) checks that rely on sight.",attack_bonus:0},{name:"Pack Tactics",desc:"The hawk has advantage on an attack roll against a creature if at least one of the hawk's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Beak",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 4 (1d4 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}]},{name:"Blue Dragon Wyrmling",size:"Medium",type:"dragon",subtype:"",alignment:"lawful evil",ac:17,hp:52,hit_dice:"8d8 + 16",speed:"30 ft., burrow 15 ft., fly 60 ft.",stats:[17,10,15,12,11,15],saves:[{dexterity:2},{constitution:4},{wisdom:2},{charisma:4}],skillsaves:[{perception:4},{stealth:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 14",languages:"Draconic",cr:"3",actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 8 (1d10 + 3) piercing damage plus 3 (1d6) lightning damage.",attack_bonus:5,damage_dice:"1d10 + 1d6",damage_bonus:3},{name:"Lightning Breath (Recharge 5-6)",desc:"The dragon exhales lightning in a 30-foot line that is 5 feet wide. Each creature in that line must make a DC 12 Dexterity saving throw, taking 22 (4d10) lightning damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"4d10"}]},{name:"Boar",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:11,hit_dice:"2d8 + 2",speed:"40 ft.",stats:[13,11,12,2,9,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 9",languages:"",cr:"1/4",traits:[{name:"Charge",desc:"If the boar moves at least 20 ft. straight toward a target and then hits it with a tusk attack on the same turn, the target takes an extra 3 (1d6) slashing damage. If the target is a creature, it must succeed on a DC 11 Strength saving throw or be knocked prone.",attack_bonus:0,damage_dice:"1d6"},{name:"Relentless (Recharges after a Short or Long Rest)",desc:"If the boar takes 7 damage or less that would reduce it to 0 hit points, it is reduced to 1 hit point instead.",attack_bonus:0}],actions:[{name:"Tusk",desc:"Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 4 (1d6 + 1) slashing damage.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1}]},{name:"Bone Devil",size:"Large",type:"fiend",subtype:"devil",alignment:"lawful evil",ac:19,hp:142,hit_dice:"15d10 + 59",speed:"40 ft., fly 40 ft.",stats:[18,16,18,13,14,16],saves:[{intelligence:5},{wisdom:6},{charisma:7}],skillsaves:[{deception:7},{insight:6}],damage_vulnerabilities:"",damage_resistances:"cold; bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"darkvision 120 ft., passive Perception 9",languages:"Infernal, telepathy 120 ft.",cr:"12",traits:[{name:"Devil's Sight",desc:"Magical darkness doesn't impede the devil's darkvision.",attack_bonus:0},{name:"Magic Resistance",desc:"The devil has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The devil makes three attacks: two with its claws and one with its sting.",attack_bonus:0},{name:"Multiattack",desc:"The devil makes three attacks: two with its claws and one with its sting.",attack_bonus:0},{name:"Claw",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one target. Hit: 8 (1d8 + 4) slashing damage.",attack_bonus:8,damage_dice:"1d8",damage_bonus:4},{name:"Claw",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one target. Hit: 8 (1d8 + 4) slashing damage.",attack_bonus:8,damage_dice:"1d8",damage_bonus:4},{name:"Sting",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one target. Hit: 13 (2d8 + 4) piercing damage plus 17 (5d6) poison damage, and the target must succeed on a DC 14 Constitution saving throw or become poisoned for 1 minute. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success .",attack_bonus:8,damage_dice:"2d8",damage_bonus:4},{name:"Sting",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one target. Hit: 13 (2d8 + 4) piercing damage plus 17 (5d6) poison damage, and the target must succeed on a DC 14 Constitution saving throw or become poisoned for 1 minute. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success .",attack_bonus:8,damage_dice:"2d8",damage_bonus:4}]},{name:"Brass Dragon Wyrmling",size:"Medium",type:"dragon",subtype:"",alignment:"chaotic good",ac:16,hp:16,hit_dice:"3d8 + 2",speed:"30 ft., burrow 15 ft., fly 60 ft.",stats:[15,10,13,10,11,13],saves:[{dexterity:2},{constitution:3},{wisdom:2},{charisma:3}],skillsaves:[{perception:4},{stealth:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 14",languages:"Draconic",cr:"1",actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (1d10 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d10",damage_bonus:2},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nFire Breath. The dragon exhales fire in an 20-foot line that is 5 feet wide. Each creature in that line must make a DC 11 Dexterity saving throw, taking 14 (4d6) fire damage on a failed save, or half as much damage on a successful one.\\nSleep Breath. The dragon exhales sleep gas in a 15-foot cone. Each creature in that area must succeed on a DC 11 Constitution saving throw or fall unconscious for 1 minute. This effect ends for a creature if the creature takes damage or someone uses an action to wake it.",attack_bonus:0,damage_dice:"4d6"}]},{name:"Bronze Dragon Wyrmling",size:"Medium",type:"dragon",subtype:"",alignment:"lawful good",ac:17,hp:32,hit_dice:"5d8 + 9",speed:"30 ft., fly 60 ft., swim 30 ft.",stats:[17,10,15,12,11,15],saves:[{dexterity:2},{constitution:4},{wisdom:2},{charisma:4}],skillsaves:[{perception:4},{stealth:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 14",languages:"Draconic",cr:"2",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 8 (1d10 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d10",damage_bonus:3},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nLightning Breath. The dragon exhales lightning in a 40-foot line that is 5 feet wide. Each creature in that line must make a DC 12 Dexterity saving throw, taking 16 (3d10) lightning damage on a failed save, or half as much damage on a successful one.\\nRepulsion Breath. The dragon exhales repulsion energy in a 30-foot cone. Each creature in that area must succeed on a DC 12 Strength saving throw. On a failed save, the creature is pushed 30 feet away from the dragon.",attack_bonus:0,damage_dice:"3d10"}]},{name:"Brown Bear",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:34,hit_dice:"4d10 + 12",speed:"40 ft., climb 30 ft.",stats:[19,10,16,2,13,7],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"1",traits:[{name:"Keen Smell",desc:"The bear has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The bear makes two attacks: one with its bite and one with its claws.",attack_bonus:0},{name:"Bite",desc:"Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 8 (1d8 + 4) piercing damage.",attack_bonus:5,damage_dice:"1d8",damage_bonus:4},{name:"Claws",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) slashing damage.",attack_bonus:5,damage_dice:"2d6",damage_bonus:4}]},{name:"Bugbear",size:"Medium",type:"humanoid",subtype:"goblinoid",alignment:"chaotic evil",ac:16,hp:27,hit_dice:"5d8 + 4",speed:"30 ft.",stats:[15,14,13,8,11,9],skillsaves:[{stealth:6},{survival:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 10",languages:"Common, Goblin",cr:"1",traits:[{name:"Brute",desc:"A melee weapon deals one extra die of its damage when the bugbear hits with it (included in the attack).",attack_bonus:0},{name:"Surprise Attack",desc:"If the bugbear surprises a creature and hits it with an attack during the first round of combat, the target takes an extra 7 (2d6) damage from the attack.",attack_bonus:0,damage_dice:"2d6"}],actions:[{name:"Morningstar",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 11 (2d8 + 2) piercing damage.",attack_bonus:4,damage_dice:"2d8",damage_bonus:2},{name:"Javelin",desc:"Melee or Ranged Weapon Attack: +4 to hit, reach 5 ft. or range 30/120 ft., one target. Hit: 9 (2d6 + 2) piercing damage in melee or 5 (1d6 + 2) piercing damage at range.",attack_bonus:4,damage_dice:"2d6",damage_bonus:2}]},{name:"Bulette",size:"Large",type:"monstrosity",subtype:"",alignment:"unaligned",ac:17,hp:94,hit_dice:"9d10 + 44",speed:"40 ft., burrow 40 ft.",stats:[19,11,21,2,10,5],skillsaves:[{perception:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., tremorsense 60 ft., passive Perception 16",languages:"",cr:"5",traits:[{name:"Standing Leap",desc:"The bulette's long jump is up to 30 ft. and its high jump is up to 15 ft., with or without a running start.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 30 (4d12 + 4) piercing damage.",attack_bonus:7,damage_dice:"4d12",damage_bonus:4},{name:"Deadly Leap",desc:"If the bulette jumps at least 15 ft. as part of its movement, it can then use this action to land on its ft. in a space that contains one or more other creatures. Each of those creatures must succeed on a DC 16 Strength or Dexterity saving throw (target's choice) or be knocked prone and take 14 (3d6 + 4) bludgeoning damage plus 14 (3d6 + 4) slashing damage. On a successful save, the creature takes only half the damage, isn't knocked prone, and is pushed 5 ft. out of the bulette's space into an unoccupied space of the creature's choice. If no unoccupied space is within range, the creature instead falls prone in the bulette's space.",attack_bonus:0}]},{name:"Camel",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:9,hp:15,hit_dice:"2d10 + 4",speed:"50 ft.",stats:[16,8,14,2,8,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 9",languages:"",cr:"1/8",actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 2 (1d4) bludgeoning damage.",attack_bonus:5,damage_dice:"1d4"}]},{name:"Carrion Crawler",size:"Large",type:"monstrosity",subtype:"",alignment:"unaligned",ac:13,hp:51,hit_dice:"6d10 + 18",speed:"30 ft., climb 30 ft.",stats:[14,13,16,1,12,5],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 13",languages:"",cr:"2",traits:[{name:"Keen Smell",desc:"The carrion crawler has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0},{name:"Spider Climb",desc:"The carrion crawler can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The carrion crawler makes two attacks: one with its tentacles and one with its bite.",attack_bonus:0},{name:"Tentacles",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one creature. Hit: 4 (1d4 + 2) poison damage, and the target must succeed on a DC 13 Constitution saving throw or be poisoned for 1 minute. Until this poison ends, the target is paralyzed. The target can repeat the saving throw at the end of each of its turns, ending the poison on itself on a success.",attack_bonus:8,damage_dice:"1d4",damage_bonus:2},{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (2d4 + 2) piercing damage.",attack_bonus:4,damage_dice:"2d4",damage_bonus:2}]},{name:"Cat",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:2,hit_dice:"1d4 + -1",speed:"40 ft., climb 30 ft.",stats:[3,15,10,3,12,7],skillsaves:[{perception:3},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"0",traits:[{name:"Keen Smell",desc:"The cat has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0}],actions:[{name:"Claws",desc:"Melee Weapon Attack: +0 to hit, reach 5 ft., one target. Hit: 1 slashing damage.",attack_bonus:0,damage_bonus:1}]},{name:"Cave Bear",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:42,hit_dice:"5d10 + 14",speed:"40 ft., swim 30 ft.",stats:[20,10,16,2,13,7],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 13",languages:"",cr:"2",traits:[{name:"Keen Smell",desc:"The bear has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The bear makes two attacks: one with its bite and one with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 9 (1d8 + 5) piercing damage.",attack_bonus:7,damage_dice:"1d8",damage_bonus:5},{name:"Claws",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 12 (2d6 + 5) slashing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:5}]},{name:"Centaur",size:"Large",type:"monstrosity",subtype:"",alignment:"neutral good",ac:12,hp:45,hit_dice:"6d10 + 12",speed:"50 ft.",stats:[18,14,14,9,13,11],skillsaves:[{athletics:6},{perception:3},{survival:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"Elvish, Sylvan",cr:"2",traits:[{name:"Charge",desc:"If the centaur moves at least 30 ft. straight toward a target and then hits it with a pike attack on the same turn, the target takes an extra 10 (3d6) piercing damage.",attack_bonus:0,damage_dice:"3d6"}],actions:[{name:"Multiattack",desc:"The centaur makes two attacks: one with its pike and one with its hooves or two with its longbow.",attack_bonus:0},{name:"Pike",desc:"Melee Weapon Attack: +6 to hit, reach 10 ft., one target. Hit: 9 (1d10 + 4) piercing damage.",attack_bonus:6,damage_dice:"1d10",damage_bonus:4},{name:"Hooves",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) bludgeoning damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:4},{name:"Longbow",desc:"Ranged Weapon Attack: +4 to hit, range 150/600 ft., one target. Hit: 6 (1d8 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2}]},{name:"Chain Devil",size:"Medium",type:"fiend",subtype:"devil",alignment:"lawful evil",ac:16,hp:85,hit_dice:"10d8 + 40",speed:"30 ft.",stats:[18,15,18,11,12,14],damage_vulnerabilities:"",damage_resistances:"cold; bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"darkvision 120 ft., passive Perception 8",languages:"Infernal, telepathy 120 ft.",cr:"11",traits:[{name:"Devil's Sight",desc:"Magical darkness doesn't impede the devil's darkvision.",attack_bonus:0},{name:"Magic Resistance",desc:"The devil has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The devil makes two attacks with its chains.",attack_bonus:0},{name:"Chain",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one target. Hit: 11 (2d6 + 4) slashing damage. The target is grappled (escape DC 14) if the devil isn't already grappling a creature. Until this grapple ends, the target is restrained and takes 7 (2d6) piercing damage at the start of each of its turns.",attack_bonus:8,damage_dice:"2d6",damage_bonus:4},{name:"Animate Chains (Recharges after a Short or Long Rest)",desc:"Up to four chains the devil can see within 60 feet of it magically sprout razor-edged barbs and animate under the devil's control, provided that the chains aren't being worn or carried.\\nEach animated chain is an object with AC 20, 20 hit points, resistance to piercing damage, and immunity to psychic and thunder damage. When the devil uses Multiattack on its turn, it can use each animated chain to make one additional chain attack. An animated chain can grapple one creature of its own but can't make attacks while grappling. An animated chain reverts to its inanimate state if reduced to 0 hit points or if the devil is incapacitated or dies.",attack_bonus:0}],reactions:[{name:"Unnerving Mask",desc:"When a creature the devil can see starts its turn within 30 feet of the devil, the devil can create the illusion that it looks like one of the creature's departed loved ones or bitter enemies. If the creature can see the devil, it must succeed on a DC 14 Wisdom saving throw or be frightened until the end of its turn.",attack_bonus:0}]},{name:"Chimera",size:"Large",type:"monstrosity",subtype:"",alignment:"chaotic evil",ac:14,hp:114,hit_dice:"12d10 + 48",speed:"30 ft., fly 60 ft.",stats:[19,11,19,3,14,10],skillsaves:[{perception:8}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 18",languages:"understands Draconic but can't speak",cr:"6",actions:[{name:"Multiattack",desc:"The chimera makes three attacks: one with its bite, one with its horns, and one with its claws. When its fire breath is available, it can use the breath in place of its bite or horns.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) piercing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Horns",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 10 (1d12 + 4) bludgeoning damage.",attack_bonus:7,damage_dice:"1d12",damage_bonus:4},{name:"Claws",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) slashing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Fire Breath (Recharge 5-6)",desc:"The dragon head exhales fire in a 15-foot cone. Each creature in that area must make a DC 15 Dexterity saving throw, taking 31 (7d8) fire damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"7d8"}]},{name:"Chuul",size:"Large",type:"aberration",subtype:"",alignment:"chaotic evil",ac:16,hp:93,hit_dice:"11d10 + 32",speed:"30 ft., swim 30 ft.",stats:[19,10,16,5,11,5],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 14",languages:"understands Deep Speech but can't speak",cr:"4",traits:[{name:"Amphibious",desc:"The chuul can breathe air and water.",attack_bonus:0},{name:"Sense Magic",desc:"The chuul senses magic within 120 feet of it at will. This trait otherwise works like the detect magic spell but isn't itself magical.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The chuul makes two pincer attacks. If the chuul is grappling a creature, the chuul can also use its tentacles once.",attack_bonus:0},{name:"Pincer",desc:"Melee Weapon Attack: +6 to hit, reach 10 ft., one target. Hit: 11 (2d6 + 4) bludgeoning damage. The target is grappled (escape DC 14) if it is a Large or smaller creature and the chuul doesn't have two other creatures grappled.",attack_bonus:6,damage_dice:"2d6",damage_bonus:4},{name:"Tentacles",desc:"One creature grappled by the chuul must succeed on a DC 13 Constitution saving throw or be poisoned for 1 minute. Until this poison ends, the target is paralyzed. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0}]},{name:"Clay Golem",size:"Large",type:"construct",subtype:"",alignment:"unaligned",ac:14,hp:133,hit_dice:"14d10 + 56",speed:"20 ft.",stats:[20,9,18,3,8,1],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"acid, poison, psychic; bludgeoning, piercing, and slashing from nonmagical weapons that aren't adamantine",condition_immunities:"charmed, exhaustion, frightened, paralyzed, petrified, poisoned",senses:"darkvision 60 ft., passive Perception 9",languages:"understands the languages of its creator but can't speak",cr:"9",traits:[{name:"Acid Absorption",desc:"Whenever the golem is subjected to acid damage, it takes no damage and instead regains a number of hit points equal to the acid damage dealt.",attack_bonus:0},{name:"Berserk",desc:"Whenever the golem starts its turn with 60 hit points or fewer, roll a d6. On a 6, the golem goes berserk. On each of its turns while berserk, the golem attacks the nearest creature it can see. If no creature is near enough to move to and attack, the golem attacks an object, with preference for an object smaller than itself. Once the golem goes berserk, it continues to do so until it is destroyed or regains all its hit points.",attack_bonus:0},{name:"Immutable Form",desc:"The golem is immune to any spell or effect that would alter its form.",attack_bonus:0},{name:"Magic Resistance",desc:"The golem has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Magic Weapons",desc:"The golem's weapon attacks are magical.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The golem makes two slam attacks.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +8 to hit, reach 5 ft., one target. Hit: 16 (2d10 + 5) bludgeoning damage. If the target is a creature, it must succeed on a DC 15 Constitution saving throw or have its hit point maximum reduced by an amount equal to the damage taken. The target dies if this attack reduces its hit point maximum to 0. The reduction lasts until removed by the greater restoration spell or other magic.",attack_bonus:8,damage_dice:"2d10",damage_bonus:5},{name:"Haste (Recharge 5-6)",desc:"Until the end of its next turn, the golem magically gains a +2 bonus to its AC, has advantage on Dexterity saving throws, and can use its slam attack as a bonus action.",attack_bonus:0}]},{name:"Cloaker",size:"Large",type:"aberration",subtype:"",alignment:"chaotic neutral",ac:14,hp:78,hit_dice:"12d10 + 12",speed:"10 ft., fly 40 ft.",stats:[17,15,12,13,12,14],skillsaves:[{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 11",languages:"Deep Speech, Undercommon",cr:"8",traits:[{name:"Damage Transfer",desc:"While attached to a creature, the cloaker takes only half the damage dealt to it (rounded down). and that creature takes the other half.",attack_bonus:0},{name:"False Appearance",desc:"While the cloaker remains motionless without its underside exposed, it is indistinguishable from a dark leather cloak.",attack_bonus:0},{name:"Light Sensitivity",desc:"While in bright light, the cloaker has disadvantage on attack rolls and Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The cloaker makes two attacks: one with its bite and one with its tail.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one creature. Hit: 10 (2d6 + 3) piercing damage, and if the target is Large or smaller, the cloaker attaches to it. If the cloaker has advantage against the target, the cloaker attaches to the target's head, and the target is blinded and unable to breathe while the cloaker is attached. While attached, the cloaker can make this attack only against the target and has advantage on the attack roll. The cloaker can detach itself by spending 5 feet of its movement. A creature, including the target, can take its action to detach the cloaker by succeeding on a DC 16 Strength check.",attack_bonus:6,damage_dice:"2d6",damage_bonus:3},{name:"Tail",desc:"Melee Weapon Attack: +6 to hit, reach 10 ft., one creature. Hit: 7 (1d8 + 3) slashing damage.",attack_bonus:6,damage_dice:"1d8",damage_bonus:3},{name:"Moan",desc:"Each creature within 60 feet of the cloaker that can hear its moan and that isn't an aberration must succeed on a DC 13 Wisdom saving throw or become frightened until the end of the cloaker's next turn. If a creature's saving throw is successful, the creature is immune to the cloaker's moan for the next 24 hours.",attack_bonus:0},{name:"Phantasms (Recharges after a Short or Long Rest)",desc:"The cloaker magically creates three illusory duplicates of itself if it isn't in bright light. The duplicates move with it and mimic its actions, shifting position so as to make it impossible to track which cloaker is the real one. If the cloaker is ever in an area of bright light, the duplicates disappear.\\nWhenever any creature targets the cloaker with an attack or a harmful spell while a duplicate remains, that creature rolls randomly to determine whether it targets the cloaker or one of the duplicates. A creature is unaffected by this magical effect if it can't see or if it relies on senses other than sight.\\nA duplicate has the cloaker's AC and uses its saving throws. If an attack hits a duplicate, or if a duplicate fails a saving throw against an effect that deals damage, the duplicate disappears.",attack_bonus:0}]},{name:"Cloud Giant",size:"Huge",type:"giant",subtype:"",alignment:"neutral good (50%) or neutral evil (50%)",ac:14,hp:200,hit_dice:"16d12 + 96",speed:"40 ft.",stats:[27,10,22,12,16,16],saves:[{constitution:10},{wisdom:7},{charisma:7}],skillsaves:[{insight:7},{perception:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 17",languages:"Common, Giant",cr:"9",traits:[{name:"Keen Smell",desc:"The giant has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The giant's innate spellcasting ability is Charisma. It can innately cast the following spells, requiring no material components:\\n\\nAt will: detect magic, fog cloud, light\\n3/day each: feather fall, fly, misty step, telekinesis\\n1/day each: control weather, gaseous form",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The giant makes two morningstar attacks.",attack_bonus:0},{name:"Morningstar",desc:"Melee Weapon Attack: +12 to hit, reach 10 ft., one target. Hit: 21 (3d8 + 8) piercing damage.",attack_bonus:12,damage_dice:"3d8",damage_bonus:8},{name:"Rock",desc:"Ranged Weapon Attack: +12 to hit, range 60/240 ft., one target. Hit: 30 (4d10 + 8) bludgeoning damage.",attack_bonus:12,damage_dice:"4d10",damage_bonus:8}]},{name:"Cockatrice",size:"Small",type:"monstrosity",subtype:"",alignment:"unaligned",ac:11,hp:27,hit_dice:"6d6 + 6",speed:"20 ft., fly 40 ft.",stats:[6,12,12,2,13,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 11",languages:"",cr:"1/2",actions:[{name:"Bite",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one creature. Hit: 3 (1d4 + 1) piercing damage, and the target must succeed on a DC 11 Constitution saving throw against being magically petrified. On a failed save, the creature begins to turn to stone and is restrained. It must repeat the saving throw at the end of its next turn. On a success, the effect ends. On a failure, the creature is petrified for 24 hours.",attack_bonus:3,damage_dice:"1d4",damage_bonus:1}]},{name:"Commoner",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:10,hp:4,hit_dice:"1d8 + -1",speed:"30 ft.",stats:[10,10,10,10,10,10],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"any one language (usually Common)",cr:"0",actions:[{name:"Club",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one target. Hit: 2 (1d4) bludgeoning damage.",attack_bonus:2,damage_dice:"1d4"}]},{name:"Constrictor Snake",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:13,hit_dice:"2d10 + 2",speed:"30 ft., swim 30 ft.",stats:[15,14,12,1,10,3],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 10 ft., passive Perception 10",languages:"",cr:"1/4",actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Constrict",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 6 (1d8 + 2) bludgeoning damage, and the target is grappled (escape DC 14). Until this grapple ends, the creature is restrained, and the snake can't constrict another target.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2}]},{name:"Copper Dragon Wyrmling",size:"Medium",type:"dragon",subtype:"",alignment:"chaotic good",ac:16,hp:22,hit_dice:"4d8 + 4",speed:"30 ft., climb 30 ft., fly 60 ft.",stats:[15,12,13,14,11,13],saves:[{dexterity:3},{constitution:3},{wisdom:2},{charisma:3}],skillsaves:[{perception:4},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"acid",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 14",languages:"Draconic",cr:"1",actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (1d10 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d10",damage_bonus:2},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nAcid Breath. The dragon exhales acid in an 20-foot line that is 5 feet wide. Each creature in that line must make a DC 11 Dexterity saving throw, taking 18 (4d8) acid damage on a failed save, or half as much damage on a successful one.\\nSlowing Breath. The dragon exhales gas in a 1 5-foot cone. Each creature in that area must succeed on a DC 11 Constitution saving throw. On a failed save, the creature can't use reactions, its speed is halved, and it can't make more than one attack on its turn. In addition, the creature can use either an action or a bonus action on its turn, but not both. These effects last for 1 minute. The creature can repeat the saving throw at the end of each of its turns, ending the effect on itself with a successful save.",attack_bonus:0,damage_dice:"4d8"}]},{name:"Couatl",size:"Medium",type:"celestial",subtype:"",alignment:"lawful good",ac:19,hp:97,hit_dice:"13d8 + 38",speed:"30 ft., fly 90 ft.",stats:[16,20,17,18,20,18],saves:[{constitution:5},{wisdom:7},{charisma:6}],damage_vulnerabilities:"",damage_resistances:"radiant",damage_immunities:"psychic; bludgeoning, piercing, and slashing from nonmagical weapons",condition_immunities:"",senses:"truesight 120 ft., passive Perception 15",languages:"all, telepathy 120 ft.",cr:"4",traits:[{name:"Innate Spellcasting",desc:"The couatl's spellcasting ability is Charisma (spell save DC 14). It can innately cast the following spells, requiring only verbal components:\\n\\nAt will: detect evil and good, detect magic, detect thoughts\\n3/day each: bless, create food and water, cure wounds, lesser restoration, protection from poison, sanctuary, shield\\n1/day each: dream, greater restoration, scrying",attack_bonus:0},{name:"Magic Weapons",desc:"The couatl's weapon attacks are magical.",attack_bonus:0},{name:"Shielded Mind",desc:"The couatl is immune to scrying and to any effect that would sense its emotions, read its thoughts, or detect its location.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +8 to hit, reach 5 ft., one creature. Hit: 8 (1d6 + 5) piercing damage, and the target must succeed on a DC 13 Constitution saving throw or be poisoned for 24 hours. Until this poison ends, the target is unconscious. Another creature can use an action to shake the target awake.",attack_bonus:8,damage_dice:"1d6",damage_bonus:5},{name:"Constrict",desc:"Melee Weapon Attack: +6 to hit, reach 10 ft., one Medium or smaller creature. Hit: 10 (2d6 + 3) bludgeoning damage, and the target is grappled (escape DC 15). Until this grapple ends, the target is restrained, and the couatl can't constrict another target.",attack_bonus:6,damage_dice:"2d6",damage_bonus:3},{name:"Change Shape",desc:"The couatl magically polymorphs into a humanoid or beast that has a challenge rating equal to or less than its own, or back into its true form. It reverts to its true form if it dies. Any equipment it is wearing or carrying is absorbed or borne by the new form (the couatl's choice).\\nIn a new form, the couatl retains its game statistics and ability to speak, but its AC, movement modes, Strength, Dexterity, and other actions are replaced by those of the new form, and it gains any statistics and capabilities (except class features, legendary actions, and lair actions) that the new form has but that it lacks. If the new form has a bite attack, the couatl can use its bite in that form.",attack_bonus:0}]},{name:"Crab",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:2,hit_dice:"1d4",speed:"20 ft., swim 20 ft.",stats:[2,11,10,1,8,2],skillsaves:[{stealth:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 30 ft., passive Perception 9",languages:"",cr:"0",traits:[{name:"Amphibious",desc:"The crab can breathe air and water.",attack_bonus:0}],actions:[{name:"Claw",desc:"Melee Weapon Attack: +0 to hit, reach 5 ft., one target. Hit: 1 bludgeoning damage.",attack_bonus:0,damage_bonus:1}]},{name:"Crocodile",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:19,hit_dice:"3d10 + 2",speed:"20 ft., swim 20 ft.",stats:[15,10,13,2,10,5],skillsaves:[{stealth:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"1/2",traits:[{name:"Hold Breath",desc:"The crocodile can hold its breath for 15 minutes.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 7 (1d10 + 2) piercing damage, and the target is grappled (escape DC 12). Until this grapple ends, the target is restrained, and the crocodile can't bite another target",attack_bonus:4,damage_dice:"1d10",damage_bonus:2}]},{name:"Cult Fanatic",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any non-good alignment",ac:13,hp:22,hit_dice:"6d8 + -5",speed:"30 ft.",stats:[11,14,12,10,13,14],skillsaves:[{deception:4},{persuasion:4},{religion:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 11",languages:"any one language (usually Common)",cr:"2",traits:[{name:"Dark Devotion",desc:"The fanatic has advantage on saving throws against being charmed or frightened.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The fanatic makes two melee attacks.",attack_bonus:0},{name:"Dagger",desc:"Melee or Ranged Weapon Attack: +4 to hit, reach 5 ft. or range 20/60 ft., one creature. Hit: 4 (1d4 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}],spells:["The fanatic is a 4th-level spellcaster. Its spell casting ability is Wisdom (spell save DC 11, +3 to hit with spell attacks). The fanatic has the following cleric spells prepared:","Cantrips (at will): light, sacred flame, thaumaturgy",{"1st level (4 slots)":"command, inflict wounds, shield of faith"},{"2nd level (3 slots)":"hold person, spiritual weapon"}]},{name:"Cultist",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any non-good alignment",ac:12,hp:9,hit_dice:"2d8",speed:"30 ft.",stats:[11,12,10,10,11,10],skillsaves:[{deception:2},{religion:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"any one language (usually Common)",cr:"1/8",traits:[{name:"Dark Devotion",desc:"The cultist has advantage on saving throws against being charmed or frightened.",attack_bonus:0}],actions:[{name:"Scimitar",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one creature. Hit: 4 (1d6 + 1) slashing damage.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1}]},{name:"Darkmantle",size:"Small",type:"monstrosity",subtype:"",alignment:"unaligned",ac:11,hp:22,hit_dice:"5d6 + 4",speed:"10 ft., fly 30 ft.",stats:[16,12,13,2,10,5],skillsaves:[{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 60 ft., passive Perception 10",languages:"",cr:"1/2",traits:[{name:"Echolocation",desc:"The darkmantle can't use its blindsight while deafened.",attack_bonus:0},{name:"False Appearance",desc:"While the darkmantle remains motionless, it is indistinguishable from a cave formation such as a stalactite or stalagmite.",attack_bonus:0}],actions:[{name:"Crush",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one creature. Hit: 6 (1d6 + 3) bludgeoning damage, and the darkmantle attaches to the target. If the target is Medium or smaller and the darkmantle has advantage on the attack roll, it attaches by engulfing the target's head, and the target is also blinded and unable to breathe while the darkmantle is attached in this way.\\nWhile attached to the target, the darkmantle can attack no other creature except the target but has advantage on its attack rolls. The darkmantle's speed also becomes 0, it can't benefit from any bonus to its speed, and it moves with the target.\\nA creature can detach the darkmantle by making a successful DC 13 Strength check as an action. On its turn, the darkmantle can detach itself from the target by using 5 feet of movement.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3},{name:"Darkness Aura (1/day)",desc:"A 15-foot radius of magical darkness extends out from the darkmantle, moves with it, and spreads around corners. The darkness lasts as long as the darkmantle maintains concentration, up to 10 minutes (as if concentrating on a spell). Darkvision can't penetrate this darkness, and no natural light can illuminate it. If any of the darkness overlaps with an area of light created by a spell of 2nd level or lower, the spell creating the light is dispelled.",attack_bonus:0}]},{name:"Death Dog",size:"Medium",type:"monstrosity",subtype:"",alignment:"neutral evil",ac:12,hp:39,hit_dice:"6d8 + 12",speed:"40 ft.",stats:[15,14,14,3,13,6],skillsaves:[{perception:5},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 15",languages:"",cr:"1",traits:[{name:"Two-Headed",desc:"The dog has advantage on Wisdom (Perception) checks and on saving throws against being blinded, charmed, deafened, frightened, stunned, or knocked unconscious.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dog makes two bite attacks.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage. If the target is a creature, it must succeed on a DC 12 Constitution saving throw against disease or become poisoned until the disease is cured. Every 24 hours that elapse, the creature must repeat the saving throw, reducing its hit point maximum by 5 (1d10) on a failure. This reduction lasts until the disease is cured. The creature dies if the disease reduces its hit point maximum to 0.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Deep Gnome (Svirfneblin)",size:"Small",type:"humanoid",subtype:"gnome",alignment:"neutral good",ac:15,hp:16,hit_dice:"3d6 + 5",speed:"20 ft.",stats:[15,14,14,12,10,9],skillsaves:[{perception:2},{investigation:3},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 12",languages:"Gnomish, Terran, Undercommon",cr:"1/2",traits:[{name:"Stone Camouflage",desc:"The gnome has advantage on Dexterity (Stealth) checks made to hide in rocky terrain.",attack_bonus:0},{name:"Gnome Cunning",desc:"The gnome has advantage on Intelligence, Wisdom, and Charisma saving throws against magic.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The gnome's innate spellcasting ability is Intelligence (spell save DC 11). It can innately cast the following spells, requiring no material components:\\nAt will: nondetection (self only)\\n1/day each: blindness/deafness, blur, disguise self",attack_bonus:0}],actions:[{name:"War Pick",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 6 (1d8 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2},{name:"Poisoned Dart",desc:"Ranged Weapon Attack: +4 to hit, range 30/120 ft., one creature. Hit: 4 (1d4 + 2) piercing damage, and the target must succeed on a DC 12 Constitution saving throw or be poisoned for 1 minute. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}]},{name:"Deer",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:4,hit_dice:"1d8 + -1",speed:"50 ft.",stats:[11,16,11,2,14,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 12",languages:"",cr:"0",actions:[{name:"Bite",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one target. Hit: 2 (1d4) piercing damage.",attack_bonus:2,damage_dice:"1d4"}]},{name:"Deva",size:"Medium",type:"celestial",subtype:"",alignment:"lawful good",ac:17,hp:136,hit_dice:"16d8 + 64",speed:"30 ft., fly 90 ft.",stats:[18,18,18,17,20,20],saves:[{wisdom:9},{charisma:9}],skillsaves:[{insight:9},{perception:9}],damage_vulnerabilities:"",damage_resistances:"radiant; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"",condition_immunities:"charmed, exhaustion, frightened",senses:"darkvision 120 ft., passive Perception 19",languages:"all, telepathy 120 ft.",cr:"10",traits:[{name:"Angelic Weapons",desc:"The deva's weapon attacks are magical. When the deva hits with any weapon, the weapon deals an extra 4d8 radiant damage (included in the attack).",attack_bonus:0},{name:"Innate Spellcasting",desc:"The deva's spellcasting ability is Charisma (spell save DC 17). The deva can innately cast the following spells, requiring only verbal components:\\nAt will: detect evil and good\\n1/day each: commune, raise dead",attack_bonus:0},{name:"Magic Resistance",desc:"The deva has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The deva makes two melee attacks.",attack_bonus:0},{name:"Mace",desc:"Melee Weapon Attack: +8 to hit, reach 5 ft., one target. Hit: 7 (1d6 + 4) bludgeoning damage plus 18 (4d8) radiant damage.",attack_bonus:8,damage_dice:"1d6 + 4d8",damage_bonus:4},{name:"Healing Touch (3/Day)",desc:"The deva touches another creature. The target magically regains 20 (4d8 + 2) hit points and is freed from any curse, disease, poison, blindness, or deafness.",attack_bonus:0},{name:"Change Shape",desc:"The deva magically polymorphs into a humanoid or beast that has a challenge rating equal to or less than its own, or back into its true form. It reverts to its true form if it dies. Any equipment it is wearing or carrying is absorbed or borne by the new form (the deva's choice).\\nIn a new form, the deva retains its game statistics and ability to speak, but its AC, movement modes, Strength, Dexterity, and special senses are replaced by those of the new form, and it gains any statistics and capabilities (except class features, legendary actions, and lair actions) that the new form has but that it lacks.",attack_bonus:0}]},{name:"Dire Wolf",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:14,hp:37,hit_dice:"5d10 + 9",speed:"50 ft.",stats:[17,15,15,3,12,7],skillsaves:[{perception:3},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"1",traits:[{name:"Keen Hearing and Smell",desc:"The wolf has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0},{name:"Pack Tactics",desc:"The wolf has advantage on an attack roll against a creature if at least one of the wolf's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) piercing damage. If the target is a creature, it must succeed on a DC 13 Strength saving throw or be knocked prone.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3}]},{name:"Djinni",size:"Large",type:"elemental",subtype:"",alignment:"chaotic good",ac:17,hp:161,hit_dice:"14d10 + 84",speed:"30 ft., fly 90 ft.",stats:[21,15,22,15,16,20],saves:[{dexterity:6},{wisdom:7},{charisma:9}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning, thunder",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 13",languages:"Auran",cr:"11",traits:[{name:"Elemental Demise",desc:"If the djinni dies, its body disintegrates into a warm breeze, leaving behind only equipment the djinni was wearing or carrying.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The djinni's innate spellcasting ability is Charisma (spell save DC 17, +9 to hit with spell attacks). It can innately cast the following spells, requiring no material components:\\n\\nAt will: detect evil and good, detect magic, thunderwave 3/day each: create food and water (can create wine instead of water), tongues, wind walk\\n1/day each: conjure elemental (air elemental only), creation, gaseous form, invisibility, major image, plane shift",attack_bonus:0},{name:"Variant: Genie Powers",desc:"Genies have a variety of magical capabilities, including spells. A few have even greater powers that allow them to alter their appearance or the nature of reality.\\n\\nDisguises.\\nSome genies can veil themselves in illusion to pass as other similarly shaped creatures. Such genies can innately cast the disguise self spell at will, often with a longer duration than is normal for that spell. Mightier genies can cast the true polymorph spell one to three times per day, possibly with a longer duration than normal. Such genies can change only their own shape, but a rare few can use the spell on other creatures and objects as well.\\nWishes.\\nThe genie power to grant wishes is legendary among mortals. Only the most potent genies, such as those among the nobility, can do so. A particular genie that has this power can grant one to three wishes to a creature that isn't a genie. Once a genie has granted its limit of wishes, it can't grant wishes again for some amount of time (usually 1 year). and cosmic law dictates that the same genie can expend its limit of wishes on a specific creature only once in that creature's existence.\\nTo be granted a wish, a creature within 60 feet of the genie states a desired effect to it. The genie can then cast the wish spell on the creature's behalf to bring about the effect. Depending on the genie's nature, the genie might try to pervert the intent of the wish by exploiting the wish's poor wording. The perversion of the wording is usually crafted to be to the genie's benefit.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The djinni makes three scimitar attacks.",attack_bonus:0},{name:"Scimitar",desc:"Melee Weapon Attack: +9 to hit, reach 5 ft., one target. Hit: 12 (2d6 + 5) slashing damage plus 3 (1d6) lightning or thunder damage (djinni's choice).",attack_bonus:9,damage_dice:"2d6 + 1d6",damage_bonus:5},{name:"Create Whirlwind",desc:"A 5-foot-radius, 30-foot-tall cylinder of swirling air magically forms on a point the djinni can see within 120 feet of it. The whirlwind lasts as long as the djinni maintains concentration (as if concentrating on a spell). Any creature but the djinni that enters the whirlwind must succeed on a DC 18 Strength saving throw or be restrained by it. The djinni can move the whirlwind up to 60 feet as an action, and creatures restrained by the whirlwind move with it. The whirlwind ends if the djinni loses sight of it.\\nA creature can use its action to free a creature restrained by the whirlwind, including itself, by succeeding on a DC 18 Strength check. If the check succeeds, the creature is no longer restrained and moves to the nearest space outside the whirlwind.",attack_bonus:0}]},{name:"Doppelganger",size:"Medium",type:"monstrosity",subtype:"shapechanger",alignment:"unaligned",ac:14,hp:52,hit_dice:"8d8 + 16",speed:"30 ft.",stats:[11,18,14,11,12,14],skillsaves:[{deception:6},{insight:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"charmed",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 11",languages:"Common",cr:"3",traits:[{name:"Shapechanger",desc:"The doppelganger can use its action to polymorph into a Small or Medium humanoid it has seen, or back into its true form. Its statistics, other than its size, are the same in each form. Any equipment it is wearing or carrying isn't transformed. It reverts to its true form if it dies.",attack_bonus:0},{name:"Ambusher",desc:"The doppelganger has advantage on attack rolls against any creature it has surprised.",attack_bonus:0},{name:"Surprise Attack",desc:"If the doppelganger surprises a creature and hits it with an attack during the first round of combat, the target takes an extra 10 (3d6) damage from the attack.",attack_bonus:0,damage_dice:"3d6"}],actions:[{name:"Multiattack",desc:"The doppelganger makes two melee attacks.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 7 (1d6 + 4) bludgeoning damage.",attack_bonus:6,damage_dice:"1d6",damage_bonus:4},{name:"Read Thoughts",desc:"The doppelganger magically reads the surface thoughts of one creature within 60 ft. of it. The effect can penetrate barriers, but 3 ft. of wood or dirt, 2 ft. of stone, 2 inches of metal, or a thin sheet of lead blocks it. While the target is in range, the doppelganger can continue reading its thoughts, as long as the doppelganger's concentration isn't broken (as if concentrating on a spell). While reading the target's mind, the doppelganger has advantage on Wisdom (Insight) and Charisma (Deception, Intimidation, and Persuasion) checks against the target.",attack_bonus:0}]},{name:"Draft Horse",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:10,hp:19,hit_dice:"3d10 + 2",speed:"40 ft.",stats:[18,10,12,2,11,7],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"1/4",actions:[{name:"Hooves",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 9 (2d4 + 4) bludgeoning damage.",attack_bonus:6,damage_dice:"2d4",damage_bonus:4}]},{name:"Dragon Turtle",size:"Gargantuan",type:"dragon",subtype:"",alignment:"neutral",ac:20,hp:341,hit_dice:"22d20 + 110",speed:"20 ft., swim 40 ft.",stats:[25,10,20,10,12,12],saves:[{dexterity:6},{constitution:11},{wisdom:7}],damage_vulnerabilities:"",damage_resistances:"fire",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 11",languages:"Aquan, Draconic",cr:"17",traits:[{name:"Amphibious",desc:"The dragon turtle can breathe air and water.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon turtle makes three attacks: one with its bite and two with its claws. It can make one tail attack in place of its two claw attacks.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +13 to hit, reach 15 ft., one target. Hit: 26 (3d12 + 7) piercing damage.",attack_bonus:13,damage_dice:"3d12",damage_bonus:7},{name:"Claw",desc:"Melee Weapon Attack: +13 to hit, reach 10 ft., one target. Hit: 16 (2d8 + 7) slashing damage.",attack_bonus:13,damage_dice:"2d8",damage_bonus:7},{name:"Tail",desc:"Melee Weapon Attack: +13 to hit, reach 15 ft., one target. Hit: 26 (3d12 + 7) bludgeoning damage. If the target is a creature, it must succeed on a DC 20 Strength saving throw or be pushed up to 10 feet away from the dragon turtle and knocked prone.",attack_bonus:13,damage_dice:"3d12",damage_bonus:7},{name:"Steam Breath (Recharge 5-6)",desc:"The dragon turtle exhales scalding steam in a 60-foot cone. Each creature in that area must make a DC 18 Constitution saving throw, taking 52 (15d6) fire damage on a failed save, or half as much damage on a successful one. Being underwater doesn't grant resistance against this damage.",attack_bonus:0,damage_dice:"15d6"}]},{name:"Dretch",size:"Small",type:"fiend",subtype:"demon",alignment:"chaotic evil",ac:11,hp:18,hit_dice:"4d6 + 4",speed:"20 ft.",stats:[11,11,12,5,8,3],damage_vulnerabilities:"",damage_resistances:"cold, fire, lightning",damage_immunities:"poison",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 9",languages:"Abyssal, telepathy 60 ft. (works only with creatures that understand Abyssal)",cr:"1/4",actions:[{name:"Multiattack",desc:"The dretch makes two attacks: one with its bite and one with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one target. Hit: 3 (1d6) piercing damage.",attack_bonus:2,damage_dice:"1d6"},{name:"Claws",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one target. Hit: 5 (2d4) slashing damage.",attack_bonus:2,damage_dice:"2d4"},{name:"Fetid Cloud (1/Day)",desc:"A 10-foot radius of disgusting green gas extends out from the dretch. The gas spreads around corners, and its area is lightly obscured. It lasts for 1 minute or until a strong wind disperses it. Any creature that starts its turn in that area must succeed on a DC 11 Constitution saving throw or be poisoned until the start of its next turn. While poisoned in this way, the target can take either an action or a bonus action on its turn, not both, and can't take reactions.",attack_bonus:0}]},{name:"Drider",size:"Large",type:"monstrosity",subtype:"",alignment:"chaotic evil",ac:19,hp:123,hit_dice:"13d10 + 51",speed:"30 ft., climb 30 ft.",stats:[16,16,18,13,14,12],skillsaves:[{perception:5},{stealth:9}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 15",languages:"Elvish, Undercommon",cr:"6",traits:[{name:"Fey Ancestry",desc:"The drider has advantage on saving throws against being charmed, and magic can't put the drider to sleep.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The drider's innate spellcasting ability is Wisdom (spell save DC 13). The drider can innately cast the following spells, requiring no material components:\\nAt will: dancing lights\\n1/day each: darkness, faerie fire",attack_bonus:0},{name:"Spider Climb",desc:"The drider can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0},{name:"Sunlight Sensitivity",desc:"While in sunlight, the drider has disadvantage on attack rolls, as well as on Wisdom (Perception) checks that rely on sight.",attack_bonus:0},{name:"Web Walker",desc:"The drider ignores movement restrictions caused by webbing.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The drider makes three attacks, either with its longsword or its longbow. It can replace one of those attacks with a bite attack.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one creature. Hit: 2 (1d4) piercing damage plus 9 (2d8) poison damage.",attack_bonus:6,damage_dice:"1d4",damage_bonus:2},{name:"Longsword",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) slashing damage, or 8 (1d10 + 3) slashing damage if used with two hands.",attack_bonus:6,damage_dice:"1d8",damage_bonus:3},{name:"Longbow",desc:"Ranged Weapon Attack: +6 to hit, range 150/600 ft., one target. Hit: 7 (1d8 + 3) piercing damage plus 4 (1d8) poison damage.",attack_bonus:6,damage_dice:"1d8",damage_bonus:3}]},{name:"Drow",size:"Medium",type:"humanoid",subtype:"elf",alignment:"neutral evil",ac:15,hp:13,hit_dice:"3d8 + -1",speed:"30 ft.",stats:[10,14,10,11,11,12],skillsaves:[{perception:2},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 12",languages:"Elvish, Undercommon",cr:"1/4",traits:[{name:"Fey Ancestry",desc:"The drow has advantage on saving throws against being charmed, and magic can't put the drow to sleep.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The drow's spellcasting ability is Charisma (spell save DC 11). It can innately cast the following spells, requiring no material components:\\nAt will: dancing lights\\n1/day each: darkness, faerie fire",attack_bonus:0},{name:"Sunlight Sensitivity",desc:"While in sunlight, the drow has disadvantage on attack rolls, as well as on Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Shortsword",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Hand Crossbow",desc:"Ranged Weapon Attack: +4 to hit, range 30/120 ft., one target. Hit: 5 (1d6 + 2) piercing damage, and the target must succeed on a DC 13 Constitution saving throw or be poisoned for 1 hour. If the saving throw fails by 5 or more, the target is also unconscious while poisoned in this way. The target wakes up if it takes damage or if another creature takes an action to shake it awake.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Druid",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:11,hp:27,hit_dice:"5d8 + 4",speed:"30 ft.",stats:[10,12,13,12,15,11],skillsaves:[{nature:3},{medicine:4},{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 14",languages:"Druidic plus any two languages",cr:"2",traits:[],actions:[{name:"Quarterstaff",desc:"Melee Weapon Attack: +2 to hit (+4 to hit with shillelagh), reach 5 ft., one target. Hit: 3 (1d6) bludgeoning damage, or 6 (1d8 + 2) bludgeoning damage with shillelagh or if wielded with two hands.",attack_bonus:2,damage_dice:"1d6"}],spells:["The druid is a 4th-level spellcaster. Its spellcasting ability is Wisdom (spell save DC 12, +4 to hit with spell attacks). It has the following druid spells prepared:",{"Cantrips (at will)":"druidcraft, produce flame, shillelagh"},{"1st level (4 slots)":"entangle, longstrider, speak with animals, thunderwave"},{"2nd level (3 slots)":"animal messenger, barkskin"}]},{name:"Dryad",size:"Medium",type:"fey",subtype:"",alignment:"neutral",ac:11,hp:22,hit_dice:"5d8 + -1",speed:"30 ft.",stats:[10,12,11,14,15,18],skillsaves:[{perception:4},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 14",languages:"Elvish, Sylvan",cr:"1",traits:[{name:"Innate Spellcasting",desc:"The dryad's innate spellcasting ability is Charisma (spell save DC 14). The dryad can innately cast the following spells, requiring no material components:\\n\\nAt will: druidcraft\\n3/day each: entangle, goodberry\\n1/day each: barkskin, pass without trace, shillelagh",attack_bonus:0},{name:"Magic Resistance",desc:"The dryad has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Speak with Beasts and Plants",desc:"The dryad can communicate with beasts and plants as if they shared a language.",attack_bonus:0},{name:"Tree Stride",desc:"Once on her turn, the dryad can use 10 ft. of her movement to step magically into one living tree within her reach and emerge from a second living tree within 60 ft. of the first tree, appearing in an unoccupied space within 5 ft. of the second tree. Both trees must be large or bigger.",attack_bonus:0}],actions:[{name:"Club",desc:"Melee Weapon Attack: +2 to hit (+6 to hit with shillelagh), reach 5 ft., one target. Hit: 2 (1 d4) bludgeoning damage, or 8 (1d8 + 4) bludgeoning damage with shillelagh.",attack_bonus:2,damage_dice:"1d4"},{name:"Fey Charm",desc:"The dryad targets one humanoid or beast that she can see within 30 feet of her. If the target can see the dryad, it must succeed on a DC 14 Wisdom saving throw or be magically charmed. The charmed creature regards the dryad as a trusted friend to be heeded and protected. Although the target isn't under the dryad's control, it takes the dryad's requests or actions in the most favorable way it can.\\nEach time the dryad or its allies do anything harmful to the target, it can repeat the saving throw, ending the effect on itself on a success. Otherwise, the effect lasts 24 hours or until the dryad dies, is on a different plane of existence from the target, or ends the effect as a bonus action. If a target's saving throw is successful, the target is immune to the dryad's Fey Charm for the next 24 hours.\\nThe dryad can have no more than one humanoid and up to three beasts charmed at a time.",attack_bonus:0}]},{name:"Duergar",size:"Medium",type:"humanoid",subtype:"dwarf",alignment:"lawful evil",ac:16,hp:26,hit_dice:"4d8 + 8",speed:"25 ft.",stats:[14,11,14,11,10,9],damage_vulnerabilities:"",damage_resistances:"poison",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 10",languages:"Dwarvish, Undercommon",cr:"1",traits:[{name:"Duergar Resilience",desc:"The duergar has advantage on saving throws against poison, spells, and illusions, as well as to resist being charmed or paralyzed.",attack_bonus:0},{name:"Sunlight Sensitivity",desc:"While in sunlight, the duergar has disadvantage on attack rolls, as well as on Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Enlarge (Recharges after a Short or Long Rest)",desc:"For 1 minute, the duergar magically increases in size, along with anything it is wearing or carrying. While enlarged, the duergar is Large, doubles its damage dice on Strength-based weapon attacks (included in the attacks), and makes Strength checks and Strength saving throws with advantage. If the duergar lacks the room to become Large, it attains the maximum size possible in the space available.",attack_bonus:0},{name:"War Pick",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 6 (1d8 + 2) piercing damage, or 11 (2d8 + 2) piercing damage while enlarged.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2},{name:"Javelin",desc:"Melee or Ranged Weapon Attack: +4 to hit, reach 5 ft. or range 30/120 ft., one target. Hit: 5 (1d6 + 2) piercing damage, or 9 (2d6 + 2) piercing damage while enlarged.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Invisibility (Recharges after a Short or Long Rest)",desc:"The duergar magically turns invisible until it attacks, casts a spell, or uses its Enlarge, or until its concentration is broken, up to 1 hour (as if concentrating on a spell). Any equipment the duergar wears or carries is invisible with it .",attack_bonus:0}]},{name:"Dust Mephit",size:"Small",type:"elemental",subtype:"",alignment:"neutral evil",ac:12,hp:17,hit_dice:"5d6 + -1",speed:"30 ft., fly 30 ft.",stats:[5,14,10,9,11,10],skillsaves:[{perception:2},{stealth:4}],damage_vulnerabilities:"fire",damage_resistances:"",damage_immunities:"poison",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 12",languages:"Auran, Terran",cr:"1/2",traits:[{name:"Death Burst",desc:"When the mephit dies, it explodes in a burst of dust. Each creature within 5 ft. of it must then succeed on a DC 10 Constitution saving throw or be blinded for 1 minute. A blinded creature can repeat the saving throw on each of its turns, ending the effect on itself on a success.",attack_bonus:0},{name:"Innate Spellcasting (1/Day)",desc:"The mephit can innately cast sleep, requiring no material components. Its innate spellcasting ability is Charisma.",attack_bonus:0}],actions:[{name:"Claws",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 4 (1d4 + 2) slashing damage.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2},{name:"Blinding Breath (Recharge 6)",desc:"The mephit exhales a 15-foot cone of blinding dust. Each creature in that area must succeed on a DC 10 Dexterity saving throw or be blinded for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0},{name:"Variant: Summon Mephits (1/Day)",desc:"The mephit has a 25 percent chance of summoning 1d4 mephits of its kind. A summoned mephit appears in an unoccupied space within 60 feet of its summoner, acts as an ally of its summoner, and can't summon other mephits. It remains for 1 minute, until it or its summoner dies, or until its summoner dismisses it as an action.",attack_bonus:0}]},{name:"Eagle",size:"Small",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:3,hit_dice:"1d6 + -1",speed:"10 ft., fly 60 ft.",stats:[6,15,10,2,14,7],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 14",languages:"",cr:"0",traits:[{name:"Keen Sight",desc:"The eagle has advantage on Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Talons",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 4 (1d4 + 2) slashing damage.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}]},{name:"Earth Elemental",size:"Large",type:"elemental",subtype:"",alignment:"neutral",ac:17,hp:126,hit_dice:"12d10 + 60",speed:"30 ft., burrow 30 ft.",stats:[20,8,20,5,10,5],damage_vulnerabilities:"thunder",damage_resistances:"bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"poison",condition_immunities:"exhaustion, paralyzed, petrified, poisoned, unconscious",senses:"darkvision 60 ft., tremorsense 60 ft., passive Perception 10",languages:"Terran",cr:"5",traits:[{name:"Earth Glide",desc:"The elemental can burrow through nonmagical, unworked earth and stone. While doing so, the elemental doesn't disturb the material it moves through.",attack_bonus:0},{name:"Siege Monster",desc:"The elemental deals double damage to objects and structures.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The elemental makes two slam attacks.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one target. Hit: 14 (2d8 + 5) bludgeoning damage.",attack_bonus:8,damage_dice:"2d8",damage_bonus:5}]},{name:"Efreeti",size:"Large",type:"elemental",subtype:"",alignment:"lawful evil",ac:17,hp:200,hit_dice:"16d10 + 112",speed:"40 ft., fly 60 ft.",stats:[22,12,24,16,15,16],saves:[{intelligence:7},{wisdom:6},{charisma:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 12",languages:"Ignan",cr:"11",traits:[{name:"Elemental Demise",desc:"If the efreeti dies, its body disintegrates in a flash of fire and puff of smoke, leaving behind only equipment the djinni was wearing or carrying.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The efreeti's innate spell casting ability is Charisma (spell save DC 15, +7 to hit with spell attacks). It can innately cast the following spells, requiring no material components:\\n\\nAt will: detect magic\\n3/day: enlarge/reduce, tongues\\n1/day each: conjure elemental (fire elemental only), gaseous form, invisibility, major image, plane shift, wall of fire",attack_bonus:0},{name:"Variant: Genie Powers",desc:"Genies have a variety of magical capabilities, including spells. A few have even greater powers that allow them to alter their appearance or the nature of reality.\\n\\nDisguises.\\nSome genies can veil themselves in illusion to pass as other similarly shaped creatures. Such genies can innately cast the disguise self spell at will, often with a longer duration than is normal for that spell. Mightier genies can cast the true polymorph spell one to three times per day, possibly with a longer duration than normal. Such genies can change only their own shape, but a rare few can use the spell on other creatures and objects as well.\\nWishes.\\nThe genie power to grant wishes is legendary among mortals. Only the most potent genies, such as those among the nobility, can do so. A particular genie that has this power can grant one to three wishes to a creature that isn't a genie. Once a genie has granted its limit of wishes, it can't grant wishes again for some amount of time (usually 1 year). and cosmic law dictates that the same genie can expend its limit of wishes on a specific creature only once in that creature's existence.\\nTo be granted a wish, a creature within 60 feet of the genie states a desired effect to it. The genie can then cast the wish spell on the creature's behalf to bring about the effect. Depending on the genie's nature, the genie might try to pervert the intent of the wish by exploiting the wish's poor wording. The perversion of the wording is usually crafted to be to the genie's benefit.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The efreeti makes two scimitar attacks or uses its Hurl Flame twice.",attack_bonus:0},{name:"Scimitar",desc:"Melee Weapon Attack: +10 to hit, reach 5 ft., one target. Hit: 13 (2d6 + 6) slashing damage plus 7 (2d6) fire damage.",attack_bonus:10,damage_dice:"2d6 + 2d6",damage_bonus:6},{name:"Hurl Flame",desc:"Ranged Spell Attack: +7 to hit, range 120 ft., one target. Hit: 17 (5d6) fire damage.",attack_bonus:7,damage_dice:"5d6"}]},{name:"Elephant",size:"Huge",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:76,hit_dice:"8d12 + 24",speed:"40 ft.",stats:[22,9,17,3,11,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"4",traits:[{name:"Trampling Charge",desc:"If the elephant moves at least 20 ft. straight toward a creature and then hits it with a gore attack on the same turn, that target must succeed on a DC 12 Strength saving throw or be knocked prone. If the target is prone, the elephant can make one stomp attack against it as a bonus action.",attack_bonus:0}],actions:[{name:"Gore",desc:"Melee Weapon Attack: +8 to hit, reach 5 ft., one target. Hit: 19 (3d8 + 6) piercing damage.",attack_bonus:8,damage_dice:"3d8",damage_bonus:6},{name:"Stomp",desc:"Melee Weapon Attack: +8 to hit, reach 5 ft., one prone creature. Hit: 22 (3d10 + 6) bludgeoning damage.",attack_bonus:8,damage_dice:"3d10",damage_bonus:6}]},{name:"Elk",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:10,hp:13,hit_dice:"2d10 + 2",speed:"50 ft.",stats:[16,10,12,2,10,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"1/4",traits:[{name:"Charge",desc:"If the elk moves at least 20 ft. straight toward a target and then hits it with a ram attack on the same turn, the target takes an extra 7 (2d6) damage. If the target is a creature, it must succeed on a DC 13 Strength saving throw or be knocked prone.",attack_bonus:0,damage_dice:"2d6"}],actions:[{name:"Ram",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) bludgeoning damage.",attack_bonus:0},{name:"Hooves",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one prone creature. Hit: 8 (2d4 + 3) bludgeoning damage.",attack_bonus:0}]},{name:"Erinyes",size:"Medium",type:"fiend",subtype:"devil",alignment:"lawful evil",ac:18,hp:153,hit_dice:"18d8 + 72",speed:"30 ft., fly 60 ft.",stats:[18,16,18,14,14,18],saves:[{dexterity:7},{constitution:8},{wisdom:6},{charisma:8}],damage_vulnerabilities:"",damage_resistances:"cold; bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"truesight 120 ft., passive Perception 12",languages:"Infernal, telepathy 120 ft.",cr:"12",traits:[{name:"Hellish Weapons",desc:"The erinyes's weapon attacks are magical and deal an extra 13 (3d8) poison damage on a hit (included in the attacks).",attack_bonus:0},{name:"Magic Resistance",desc:"The erinyes has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The erinyes makes three attacks",attack_bonus:0},{name:"Longsword",desc:"Melee Weapon Attack: +8 to hit, reach 5 ft., one target. Hit: 8 (1d8 + 4) slashing damage, or 9 (1d10 + 4) slashing damage if used with two hands, plus 13 (3d8) poison damage.",attack_bonus:8,damage_dice:"1d8 + 3d8",damage_bonus:4},{name:"Longbow",desc:"Ranged Weapon Attack: +7 to hit, range 150/600 ft., one target. Hit: 7 (1d8 + 3) piercing damage plus 13 (3d8) poison damage, and the target must succeed on a DC 14 Constitution saving throw or be poisoned. The poison lasts until it is removed by the lesser restoration spell or similar magic.",attack_bonus:7,damage_dice:"1d8 + 3d8",damage_bonus:3},{name:"Variant: Rope of Entanglement",desc:"Some erinyes carry a rope of entanglement (detailed in the Dungeon Master's Guide). When such an erinyes uses its Multiattack, the erinyes can use the rope in place of two of the attacks.",attack_bonus:0}],reactions:[{name:"Parry",desc:"The erinyes adds 4 to its AC against one melee attack that would hit it. To do so, the erinyes must see the attacker and be wielding a melee weapon.",attack_bonus:0}]},{name:"Ettercap",size:"Medium",type:"monstrosity",subtype:"",alignment:"neutral evil",ac:13,hp:44,hit_dice:"8d8 + 8",speed:"30 ft., climb 30 ft.",stats:[14,15,13,7,12,8],skillsaves:[{perception:3},{stealth:4},{survival:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 13",languages:"",cr:"2",traits:[{name:"Spider Climb",desc:"The ettercap can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0},{name:"Web Sense",desc:"While in contact with a web, the ettercap knows the exact location of any other creature in contact with the same web.",attack_bonus:0},{name:"Web Walker",desc:"The ettercap ignores movement restrictions caused by webbing.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The ettercap makes two attacks: one with its bite and one with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 6 (1d8 + 2) piercing damage plus 4 (1d8) poison damage. The target must succeed on a DC 11 Constitution saving throw or be poisoned for 1 minute. The creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2},{name:"Claws",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (2d4 + 2) slashing damage.",attack_bonus:4,damage_dice:"2d4",damage_bonus:2},{name:"Web (Recharge 5-6)",desc:"Ranged Weapon Attack: +4 to hit, range 30/60 ft., one Large or smaller creature. Hit: The creature is restrained by webbing. As an action, the restrained creature can make a DC 11 Strength check, escaping from the webbing on a success. The effect ends if the webbing is destroyed. The webbing has AC 10, 5 hit points, is vulnerable to fire damage and immune to bludgeoning damage.",attack_bonus:0},{name:"Variant: Web Garrote",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one Medium or Small creature against which the ettercap has advantage on the attack roll. Hit: 4 (1d4 + 2) bludgeoning damage, and the target is grappled (escape DC 12). Until this grapple ends, the target can't breathe, and the ettercap has advantage on attack rolls against it.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}]},{name:"Ettin",size:"Large",type:"giant",subtype:"",alignment:"chaotic evil",ac:12,hp:85,hit_dice:"10d10 + 30",speed:"40 ft.",stats:[21,8,17,6,10,8],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 14",languages:"Giant, Orc",cr:"4",traits:[{name:"Two Heads",desc:"The ettin has advantage on Wisdom (Perception) checks and on saving throws against being blinded, charmed, deafened, frightened, stunned, and knocked unconscious.",attack_bonus:0},{name:"Wakeful",desc:"When one of the ettin's heads is asleep, its other head is awake.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The ettin makes two attacks: one with its battleaxe and one with its morningstar.",attack_bonus:0},{name:"Battleaxe",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 14 (2d8 + 5) slashing damage.",attack_bonus:7,damage_dice:"2d8",damage_bonus:5},{name:"Morningstar",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 14 (2d8 + 5) piercing damage.",attack_bonus:7,damage_dice:"2d8",damage_bonus:5}]},{name:"Fire Elemental",size:"Large",type:"elemental",subtype:"",alignment:"neutral",ac:13,hp:102,hit_dice:"12d10 + 36",speed:"50 ft.",stats:[10,17,16,6,10,7],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"fire, poison",condition_immunities:"exhaustion, grappled, paralyzed, petrified, poisoned, prone, restrained, unconscious",senses:"darkvision 60 ft., passive Perception 10",languages:"Ignan",cr:"5",traits:[{name:"Fire Form",desc:"The elemental can move through a space as narrow as 1 inch wide without squeezing. A creature that touches the elemental or hits it with a melee attack while within 5 ft. of it takes 5 (1d10) fire damage. In addition, the elemental can enter a hostile creature's space and stop there. The first time it enters a creature's space on a turn, that creature takes 5 (1d10) fire damage and catches fire; until someone takes an action to douse the fire, the creature takes 5 (1d10) fire damage at the start of each of its turns.",attack_bonus:0,damage_dice:"5d10"},{name:"Illumination",desc:"The elemental sheds bright light in a 30-foot radius and dim light in an additional 30 ft..",attack_bonus:0},{name:"Water Susceptibility",desc:"For every 5 ft. the elemental moves in water, or for every gallon of water splashed on it, it takes 1 cold damage.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The elemental makes two touch attacks.",attack_bonus:0},{name:"Touch",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) fire damage. If the target is a creature or a flammable object, it ignites. Until a creature takes an action to douse the fire, the target takes 5 (1d10) fire damage at the start of each of its turns.",attack_bonus:6,damage_dice:"2d6",damage_bonus:3}]},{name:"Fire Giant",size:"Huge",type:"giant",subtype:"",alignment:"lawful evil",ac:18,hp:162,hit_dice:"13d12 + 77",speed:"30 ft.",stats:[25,9,23,10,14,13],saves:[{dexterity:3},{constitution:10},{charisma:5}],skillsaves:[{athletics:11},{perception:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"passive Perception 16",languages:"Giant",cr:"9",actions:[{name:"Multiattack",desc:"The giant makes two greatsword attacks.",attack_bonus:0},{name:"Greatsword",desc:"Melee Weapon Attack: +11 to hit, reach 10 ft., one target. Hit: 28 (6d6 + 7) slashing damage.",attack_bonus:11,damage_dice:"6d6",damage_bonus:7},{name:"Rock",desc:"Ranged Weapon Attack: +11 to hit, range 60/240 ft., one target. Hit: 29 (4d10 + 7) bludgeoning damage.",attack_bonus:11,damage_dice:"4d10",damage_bonus:7}]},{name:"Flesh Golem",size:"Medium",type:"construct",subtype:"",alignment:"neutral",ac:9,hp:93,hit_dice:"11d8 + 43",speed:"30 ft.",stats:[19,9,18,6,10,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning, poison; bludgeoning, piercing, and slashing from nonmagical weapons that aren't adamantine",condition_immunities:"charmed, exhaustion, frightened, paralyzed, petrified, poisoned",senses:"darkvision 60 ft., passive Perception 10",languages:"understands the languages of its creator but can't speak",cr:"5",traits:[{name:"Berserk",desc:"Whenever the golem starts its turn with 40 hit points or fewer, roll a d6. On a 6, the golem goes berserk. On each of its turns while berserk, the golem attacks the nearest creature it can see. If no creature is near enough to move to and attack, the golem attacks an object, with preference for an object smaller than itself. Once the golem goes berserk, it continues to do so until it is destroyed or regains all its hit points.\\nThe golem's creator, if within 60 feet of the berserk golem, can try to calm it by speaking firmly and persuasively. The golem must be able to hear its creator, who must take an action to make a DC 15 Charisma (Persuasion) check. If the check succeeds, the golem ceases being berserk. If it takes damage while still at 40 hit points or fewer, the golem might go berserk again.",attack_bonus:0},{name:"Aversion of Fire",desc:"If the golem takes fire damage, it has disadvantage on attack rolls and ability checks until the end of its next turn.",attack_bonus:0},{name:"Immutable Form",desc:"The golem is immune to any spell or effect that would alter its form.",attack_bonus:0},{name:"Lightning Absorption",desc:"Whenever the golem is subjected to lightning damage, it takes no damage and instead regains a number of hit points equal to the lightning damage dealt.",attack_bonus:0},{name:"Magic Resistance",desc:"The golem has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Magic Weapons",desc:"The golem's weapon attacks are magical.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The golem makes two slam attacks.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) bludgeoning damage.",attack_bonus:7,damage_dice:"2d8",damage_bonus:4}]},{name:"Flying Snake",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:14,hp:5,hit_dice:"2d4",speed:"30 ft., fly 60 ft., swim 30 ft.",stats:[4,18,11,2,12,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 10 ft., passive Perception 11",languages:"",cr:"1/8",traits:[{name:"Flyby",desc:"The snake doesn't provoke opportunity attacks when it flies out of an enemy's reach.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 1 piercing damage plus 7 (3d4) poison damage.",attack_bonus:6,damage_bonus:1}]},{name:"Flying Sword",size:"Small",type:"construct",subtype:"",alignment:"unaligned",ac:17,hp:17,hit_dice:"5d6 + -1",speed:"0 ft., fly 50 ft. It can hover.",stats:[12,15,11,1,5,1],saves:[{dexterity:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison, psychic",condition_immunities:"blinded, charmed, deafened, frightened, paralyzed, petrified, poisoned",senses:"blindsight 60 ft. (blind beyond this radius), passive Perception 7",languages:"",cr:"1/4",traits:[{name:"Antimagic Susceptibility",desc:"The sword is incapacitated while in the area of an antimagic field. If targeted by dispel magic, the sword must succeed on a Constitution saving throw against the caster's spell save DC or fall unconscious for 1 minute.",attack_bonus:0},{name:"False Appearance",desc:"While the sword remains motionless and isn't flying, it is indistinguishable from a normal sword.",attack_bonus:0}],actions:[{name:"Longsword",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 5 (1d8 + 1) slashing damage.",attack_bonus:3,damage_dice:"1d8",damage_bonus:1}]},{name:"Frog",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:1,hit_dice:"1d4 + -2",speed:"20 ft., swim 20 ft.",stats:[1,13,8,1,8,3],skillsaves:[{perception:1},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 30 ft., passive Perception 11",languages:"",cr:"0",traits:[{name:"Amphibious",desc:"The frog can breathe air and water",attack_bonus:0},{name:"Standing Leap",desc:"The frog's long jump is up to 10 ft. and its high jump is up to 5 ft., with or without a running start.",attack_bonus:0}]},{name:"Frost Giant",size:"Huge",type:"giant",subtype:"",alignment:"neutral evil",ac:15,hp:138,hit_dice:"12d12 + 60",speed:"40 ft.",stats:[23,9,21,9,10,12],saves:[{constitution:8},{wisdom:3},{charisma:4}],skillsaves:[{athletics:9},{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"cold",condition_immunities:"",senses:"passive Perception 13",languages:"Giant",cr:"8",actions:[{name:"Multiattack",desc:"The giant makes two greataxe attacks.",attack_bonus:0},{name:"Greataxe",desc:"Melee Weapon Attack: +9 to hit, reach 10 ft., one target. Hit: 25 (3d12 + 6) slashing damage.",attack_bonus:9,damage_dice:"3d12",damage_bonus:6},{name:"Rock",desc:"Ranged Weapon Attack: +9 to hit, range 60/240 ft., one target. Hit: 28 (4d10 + 6) bludgeoning damage.",attack_bonus:9,damage_dice:"4d10",damage_bonus:6}]},{name:"Gargoyle",size:"Medium",type:"elemental",subtype:"",alignment:"chaotic evil",ac:15,hp:52,hit_dice:"7d8 + 20",speed:"30 ft., fly 60 ft.",stats:[15,11,16,6,11,7],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, and slashing from nonmagical weapons that aren't adamantine",damage_immunities:"poison",condition_immunities:"exhaustion, petrified, poisoned",senses:"darkvision 60 ft., passive Perception 10",languages:"Terran",cr:"2",traits:[{name:"False Appearance",desc:"While the gargoyle remains motion less, it is indistinguishable from an inanimate statue.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The gargoyle makes two attacks: one with its bite and one with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Claws",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) slashing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Gelatinous Cube",size:"Large",type:"ooze",subtype:"",alignment:"unaligned",ac:6,hp:84,hit_dice:"8d10 + 40",speed:"15 ft.",stats:[14,3,20,1,6,1],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"blinded, charmed, deafened, exhaustion, frightened, prone",senses:"blindsight 60 ft. (blind beyond this radius), passive Perception 8",languages:"",cr:"2",traits:[{name:"Ooze Cube",desc:"The cube takes up its entire space. Other creatures can enter the space, but a creature that does so is subjected to the cube's Engulf and has disadvantage on the saving throw.\\nCreatures inside the cube can be seen but have total cover.\\nA creature within 5 feet of the cube can take an action to pull a creature or object out of the cube. Doing so requires a successful DC 12 Strength check, and the creature making the attempt takes 10 (3d6) acid damage.\\nThe cube can hold only one Large creature or up to four Medium or smaller creatures inside it at a time.",attack_bonus:0},{name:"Transparent",desc:"Even when the cube is in plain sight, it takes a successful DC 15 Wisdom (Perception) check to spot a cube that has neither moved nor attacked. A creature that tries to enter the cube's space while unaware of the cube is surprised by the cube.",attack_bonus:0}],actions:[{name:"Pseudopod",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 10 (3d6) acid damage.",attack_bonus:4,damage_dice:"3d6"},{name:"Engulf",desc:"The cube moves up to its speed. While doing so, it can enter Large or smaller creatures' spaces. Whenever the cube enters a creature's space, the creature must make a DC 12 Dexterity saving throw.\\nOn a successful save, the creature can choose to be pushed 5 feet back or to the side of the cube. A creature that chooses not to be pushed suffers the consequences of a failed saving throw.\\nOn a failed save, the cube enters the creature's space, and the creature takes 10 (3d6) acid damage and is engulfed. The engulfed creature can't breathe, is restrained, and takes 21 (6d6) acid damage at the start of each of the cube's turns. When the cube moves, the engulfed creature moves with it.\\nAn engulfed creature can try to escape by taking an action to make a DC 12 Strength check. On a success, the creature escapes and enters a space of its choice within 5 feet of the cube.",attack_bonus:0}]},{name:"Ghast",size:"Medium",type:"undead",subtype:"",alignment:"chaotic evil",ac:13,hp:36,hit_dice:"8d8",speed:"30 ft.",stats:[16,17,10,11,10,8],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"necrotic",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 10",languages:"Common",cr:"2",traits:[{name:"Stench",desc:"Any creature that starts its turn within 5 ft. of the ghast must succeed on a DC 10 Constitution saving throw or be poisoned until the start of its next turn. On a successful saving throw, the creature is immune to the ghast's Stench for 24 hours.",attack_bonus:0},{name:"Turn Defiance",desc:"The ghast and any ghouls within 30 ft. of it have advantage on saving throws against effects that turn undead.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one creature. Hit: 12 (2d8 + 3) piercing damage.",attack_bonus:3,damage_dice:"2d8",damage_bonus:3},{name:"Claws",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) slashing damage. If the target is a creature other than an undead, it must succeed on a DC 10 Constitution saving throw or be paralyzed for 1 minute. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3}]},{name:"Ghost",size:"Medium",type:"undead",subtype:"",alignment:"any alignment",ac:11,hp:45,hit_dice:"10d8",speed:"0 ft., fly 40 ft. It can hover.",stats:[7,13,10,10,12,17],damage_vulnerabilities:"",damage_resistances:"acid, fire, lightning, thunder; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"cold, necrotic, poison",condition_immunities:"charmed, exhaustion, frightened, grappled, paralyzed, petrified, poisoned, prone, restrained",senses:"darkvision 60 ft., passive Perception 11",languages:"any languages it knew in life",cr:"4",traits:[{name:"Ethereal Sight",desc:"The ghost can see 60 ft. into the Ethereal Plane when it is on the Material Plane, and vice versa.",attack_bonus:0},{name:"Incorporeal Movement",desc:"The ghost can move through other creatures and objects as if they were difficult terrain. It takes 5 (1d10) force damage if it ends its turn inside an object.",attack_bonus:0}],actions:[{name:"Withering Touch",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 17 (4d6 + 3) necrotic damage.",attack_bonus:5,damage_dice:"4d6",damage_bonus:3},{name:"Etherealness",desc:"The ghost enters the Ethereal Plane from the Material Plane, or vice versa. It is visible on the Material Plane while it is in the Border Ethereal, and vice versa, yet it can't affect or be affected by anything on the other plane.",attack_bonus:0},{name:"Horrifying Visage",desc:"Each non-undead creature within 60 ft. of the ghost that can see it must succeed on a DC 13 Wisdom saving throw or be frightened for 1 minute. If the save fails by 5 or more, the target also ages 1d4 _ 10 years. A frightened target can repeat the saving throw at the end of each of its turns, ending the frightened condition on itself on a success. If a target's saving throw is successful or the effect ends for it, the target is immune to this ghost's Horrifying Visage for the next 24 hours. The aging effect can be reversed with a greater restoration spell, but only within 24 hours of it occurring.",attack_bonus:0},{name:"Possession (Recharge 6)",desc:"One humanoid that the ghost can see within 5 ft. of it must succeed on a DC 13 Charisma saving throw or be possessed by the ghost; the ghost then disappears, and the target is incapacitated and loses control of its body. The ghost now controls the body but doesn't deprive the target of awareness. The ghost can't be targeted by any attack, spell, or other effect, except ones that turn undead, and it retains its alignment, Intelligence, Wisdom, Charisma, and immunity to being charmed and frightened. It otherwise uses the possessed target's statistics, but doesn't gain access to the target's knowledge, class features, or proficiencies.\\nThe possession lasts until the body drops to 0 hit points, the ghost ends it as a bonus action, or the ghost is turned or forced out by an effect like the dispel evil and good spell. When the possession ends, the ghost reappears in an unoccupied space within 5 ft. of the body. The target is immune to this ghost's Possession for 24 hours after succeeding on the saving throw or after the possession ends.",attack_bonus:0}]},{name:"Ghoul",size:"Medium",type:"undead",subtype:"",alignment:"chaotic evil",ac:12,hp:22,hit_dice:"5d8 + -1",speed:"30 ft.",stats:[13,15,10,7,10,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 10",languages:"Common",cr:"1",actions:[{name:"Bite",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one creature. Hit: 9 (2d6 + 2) piercing damage.",attack_bonus:2,damage_dice:"2d6",damage_bonus:2},{name:"Claws",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (2d4 + 2) slashing damage. If the target is a creature other than an elf or undead, it must succeed on a DC 10 Constitution saving throw or be paralyzed for 1 minute. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0}]},{name:"Giant Ape",size:"Huge",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:157,hit_dice:"15d12 + 59",speed:"40 ft., climb 40 ft.",stats:[23,14,18,7,12,7],skillsaves:[{athletics:9},{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 14",languages:"",cr:"7",actions:[{name:"Multiattack",desc:"The ape makes two fist attacks.",attack_bonus:0},{name:"Fist",desc:"Melee Weapon Attack: +9 to hit, reach 10 ft., one target. Hit: 22 (3d10 + 6) bludgeoning damage.",attack_bonus:9,damage_dice:"3d10",damage_bonus:6},{name:"Rock",desc:"Ranged Weapon Attack: +9 to hit, range 50/100 ft., one target. Hit: 30 (7d6 + 6) bludgeoning damage.",attack_bonus:9,damage_dice:"7d6",damage_bonus:6}]},{name:"Giant Badger",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:10,hp:13,hit_dice:"2d8 + 4",speed:"30 ft., burrow 10 ft.",stats:[13,10,15,2,12,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 30 ft., passive Perception 11",languages:"",cr:"1/4",traits:[{name:"Keen Smell",desc:"The badger has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The badger makes two attacks: one with its bite and one with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 4 (1d6 + 1) piercing damage.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1},{name:"Claws",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 6 (2d4 + 1) slashing damage.",attack_bonus:3,damage_dice:"2d4",damage_bonus:1}]},{name:"Giant Bat",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:22,hit_dice:"4d10",speed:"10 ft., fly 60 ft.",stats:[15,16,11,2,12,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 60 ft., passive Perception 11",languages:"",cr:"1/4",traits:[{name:"Echolocation",desc:"The bat can't use its blindsight while deafened.",attack_bonus:0},{name:"Keen Hearing",desc:"The bat has advantage on Wisdom (Perception) checks that rely on hearing.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Giant Boar",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:42,hit_dice:"5d10 + 14",speed:"40 ft.",stats:[17,10,16,2,7,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 8",languages:"",cr:"2",traits:[{name:"Charge",desc:"If the boar moves at least 20 ft. straight toward a target and then hits it with a tusk attack on the same turn, the target takes an extra 7 (2d6) slashing damage. If the target is a creature, it must succeed on a DC 13 Strength saving throw or be knocked prone.",attack_bonus:0,damage_dice:"2d6"},{name:"Relentless (Recharges after a Short or Long Rest)",desc:"If the boar takes 10 damage or less that would reduce it to 0 hit points, it is reduced to 1 hit point instead.",attack_bonus:0}],actions:[{name:"Tusk",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) slashing damage.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3}]},{name:"Giant Centipede",size:"Small",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:4,hit_dice:"1d6",speed:"30 ft., climb 30 ft.",stats:[5,14,12,1,7,3],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 30 ft., passive Perception 8",languages:"",cr:"1/4",actions:[{name:"Bite",desc:"Bite. Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 4 (1d4 + 2) piercing damage, and the target must succeed on a DC 11 Constitution saving throw or take 10 (3d6) poison damage. If the poison damage reduces the target to 0 hit points, the target is stable but poisoned for 1 hour, even after regaining hit points, and is paralyzed while poisoned in this way.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}]},{name:"Giant Constrictor Snake",size:"Huge",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:60,hit_dice:"8d12 + 8",speed:"30 ft., swim 30 ft.",stats:[19,14,12,1,10,3],skillsaves:[{perception:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 10 ft., passive Perception 12",languages:"",cr:"2",actions:[{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 10 ft., one creature. Hit: 11 (2d6 + 4) piercing damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:4},{name:"Constrict",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one creature. Hit: 13 (2d8 + 4) bludgeoning damage, and the target is grappled (escape DC 16). Until this grapple ends, the creature is restrained, and the snake can't constrict another target.",attack_bonus:6,damage_dice:"2d8",damage_bonus:4}]},{name:"Giant Crab",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:15,hp:13,hit_dice:"3d8 + -1",speed:"30 ft., swim 30 ft.",stats:[13,15,11,1,9,3],skillsaves:[{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 30 ft., passive Perception 9",languages:"",cr:"1/8",traits:[{name:"Amphibious",desc:"The crab can breathe air and water.",attack_bonus:0}],actions:[{name:"Claw",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 4 (1d6 + 1) bludgeoning damage, and the target is grappled (escape DC 11). The crab has two claws, each of which can grapple only one target.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1}]},{name:"Giant Crocodile",size:"Huge",type:"beast",subtype:"",alignment:"unaligned",ac:14,hp:85,hit_dice:"9d12 + 26",speed:"30 ft., swim 50 ft.",stats:[21,9,17,2,10,7],skillsaves:[{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"5",traits:[{name:"Hold Breath",desc:"The crocodile can hold its breath for 30 minutes.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The crocodile makes two attacks: one with its bite and one with its tail.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +8 to hit, reach 5 ft., one target. Hit: 21 (3d10 + 5) piercing damage, and the target is grappled (escape DC 16). Until this grapple ends, the target is restrained, and the crocodile can't bite another target.",attack_bonus:8,damage_dice:"3d10",damage_bonus:5},{name:"Tail",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one target not grappled by the crocodile. Hit: 14 (2d8 + 5) bludgeoning damage. If the target is a creature, it must succeed on a DC 16 Strength saving throw or be knocked prone.",attack_bonus:8,damage_dice:"2d8",damage_bonus:5}]},{name:"Giant Eagle",size:"Large",type:"beast",subtype:"",alignment:"neutral good",ac:13,hp:26,hit_dice:"4d10 + 4",speed:"10 ft., fly 80 ft.",stats:[16,17,13,8,14,10],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 14",languages:"Giant Eagle, understands Common and Auran but can't speak",cr:"1",traits:[{name:"Keen Sight",desc:"The eagle has advantage on Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The eagle makes two attacks: one with its beak and one with its talons.",attack_bonus:0},{name:"Beak",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3},{name:"Talons",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) slashing damage.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3}]},{name:"Giant Elk",size:"Huge",type:"beast",subtype:"",alignment:"unaligned",ac:15,hp:42,hit_dice:"5d12 + 9",speed:"60 ft.",stats:[19,16,14,7,14,10],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 14",languages:"Giant Elk, understands Common, Elvish, and Sylvan but can't speak",cr:"2",traits:[{name:"Charge",desc:"If the elk moves at least 20 ft. straight toward a target and then hits it with a ram attack on the same turn, the target takes an extra 7 (2d6) damage. If the target is a creature, it must succeed on a DC 14 Strength saving throw or be knocked prone.",attack_bonus:0,damage_dice:"2d6"}],actions:[{name:"Ram",desc:"Melee Weapon Attack: +6 to hit, reach 10 ft., one target. Hit: 11 (2d6 + 4) bludgeoning damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:4},{name:"Hooves",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one prone creature. Hit: 22 (4d8 + 4) bludgeoning damage.",attack_bonus:6,damage_dice:"4d8",damage_bonus:4}]},{name:"Giant Fire Beetle",size:"Small",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:4,hit_dice:"1d6",speed:"30 ft.",stats:[8,10,12,1,7,3],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 30 ft., passive Perception 8",languages:"",cr:"0",traits:[{name:"Illumination",desc:"The beetle sheds bright light in a 10-foot radius and dim light for an additional 10 ft..",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +1 to hit, reach 5 ft., one target. Hit: 2 (1d6 \u2014 1) slashing damage.",attack_bonus:1,damage_dice:"1d6",damage_bonus:-1}]},{name:"Giant Frog",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:18,hit_dice:"4d8",speed:"30 ft., swim 30 ft.",stats:[12,13,11,2,10,3],skillsaves:[{perception:2},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 30 ft., passive Perception 12",languages:"",cr:"1/4",traits:[{name:"Amphibious",desc:"The frog can breathe air and water",attack_bonus:0},{name:"Standing Leap",desc:"The frog's long jump is up to 20 ft. and its high jump is up to 10 ft., with or without a running start.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 4 (1d6 + 1) piercing damage, and the target is grappled (escape DC 11). Until this grapple ends, the target is restrained, and the frog can't bite another target.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1},{name:"Swallow",desc:"The frog makes one bite attack against a Small or smaller target it is grappling. If the attack hits, the target is swallowed, and the grapple ends. The swallowed target is blinded and restrained, it has total cover against attacks and other effects outside the frog, and it takes 5 (2d4) acid damage at the start of each of the frog's turns. The frog can have only one target swallowed at a time. If the frog dies, a swallowed creature is no longer restrained by it and can escape from the corpse using 5 ft. of movement, exiting prone.",attack_bonus:0}]},{name:"Giant Goat",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:19,hit_dice:"3d10 + 2",speed:"40 ft.",stats:[17,11,12,3,12,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 11",languages:"",cr:"1/2",traits:[{name:"Charge",desc:"If the goat moves at least 20 ft. straight toward a target and then hits it with a ram attack on the same turn, the target takes an extra 5 (2d4) bludgeoning damage. If the target is a creature, it must succeed on a DC 13 Strength saving throw or be knocked prone.",attack_bonus:0,damage_dice:"2d4"},{name:"Sure-Footed",desc:"The goat has advantage on Strength and Dexterity saving throws made against effects that would knock it prone.",attack_bonus:0}],actions:[{name:"Ram",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 8 (2d4 + 3) bludgeoning damage.",attack_bonus:5,damage_dice:"2d4",damage_bonus:3}]},{name:"Giant Hyena",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:45,hit_dice:"6d10 + 12",speed:"50 ft.",stats:[16,14,14,2,12,7],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"1",traits:[{name:"Rampage",desc:"When the hyena reduces a creature to 0 hit points with a melee attack on its turn, the hyena can take a bonus action to move up to half its speed and make a bite attack.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3}]},{name:"Giant Lizard",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:19,hit_dice:"3d10 + 2",speed:"30 ft., climb 30 ft.",stats:[15,12,13,2,10,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 30 ft., passive Perception 10",languages:"",cr:"1/4",traits:[{name:"Variant: Hold Breath",desc:"The lizard can hold its breath for 15 minutes. (A lizard that has this trait also has a swimming speed of 30 feet.)",attack_bonus:0},{name:"Variant: Spider Climb",desc:"The lizard can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 6 (1d8 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2}]},{name:"Giant Octopus",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:52,hit_dice:"8d10 + 8",speed:"10 ft., swim 60 ft.",stats:[17,13,13,4,10,4],skillsaves:[{perception:4},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 14",languages:"",cr:"1",traits:[{name:"Hold Breath",desc:"While out of water, the octopus can hold its breath for 1 hour.",attack_bonus:0},{name:"Underwater Camouflage",desc:"The octopus has advantage on Dexterity (Stealth) checks made while underwater.",attack_bonus:0},{name:"Water Breathing",desc:"The octopus can breathe only underwater.",attack_bonus:0}],actions:[{name:"Tentacles",desc:"Melee Weapon Attack: +5 to hit, reach 15 ft., one target. Hit: 10 (2d6 + 3) bludgeoning damage. If the target is a creature, it is grappled (escape DC 16). Until this grapple ends, the target is restrained, and the octopus can't use its tentacles on another target.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3},{name:"Ink Cloud (Recharges after a Short or Long Rest)",desc:"A 20-foot-radius cloud of ink extends all around the octopus if it is underwater. The area is heavily obscured for 1 minute, although a significant current can disperse the ink. After releasing the ink, the octopus can use the Dash action as a bonus action.",attack_bonus:0}]},{name:"Giant Owl",size:"Large",type:"beast",subtype:"",alignment:"neutral",ac:12,hp:19,hit_dice:"3d10 + 2",speed:"5 ft., fly 60 ft.",stats:[13,15,12,8,13,10],skillsaves:[{perception:5},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 15",languages:"Giant Owl, understands Common, Elvish, and Sylvan but can't speak",cr:"1/4",traits:[{name:"Flyby",desc:"The owl doesn't provoke opportunity attacks when it flies out of an enemy's reach.",attack_bonus:0},{name:"Keen Hearing and Sight",desc:"The owl has advantage on Wisdom (Perception) checks that rely on hearing or sight.",attack_bonus:0}],actions:[{name:"Talons",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 8 (2d6 + 1) slashing damage.",attack_bonus:3,damage_dice:"2d6",damage_bonus:1}]},{name:"Giant Poisonous Snake",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:14,hp:11,hit_dice:"2d8 + 2",speed:"30 ft., swim 30 ft.",stats:[10,18,13,2,10,3],skillsaves:[{perception:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 10 ft., passive Perception 12",languages:"",cr:"1/4",actions:[{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 10 ft., one target. Hit: 6 (1d4 + 4) piercing damage, and the target must make a DC 11 Constitution saving throw, taking 10 (3d6) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:6,damage_dice:"1d4",damage_bonus:4}]},{name:"Giant Rat",size:"Small",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:7,hit_dice:"2d6",speed:"30 ft.",stats:[7,15,11,2,10,4],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 10",languages:"",cr:"1/8",traits:[{name:"Keen Smell",desc:"The rat has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0},{name:"Pack Tactics",desc:"The rat has advantage on an attack roll against a creature if at least one of the rat's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 4 (1d4 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}]},{name:"Giant Rat (Diseased)",size:"Small",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:7,hit_dice:"2d6",speed:"30 ft.",stats:[7,15,11,2,10,4],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 10",languages:"",cr:"1/8",actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 3 (1d4 + 2) piercing damage. If the target is a creature, it must succeed on a DC 10 Constitution saving throw or contract a disease. Until the disease is cured, the target can't regain hit points except by magical means, and the target's hit point maximum decreases by 3 (1d6) every 24 hours. If the target's hit point maximum drops to 0 as a result of this disease, the target dies.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}]},{name:"Giant Scorpion",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:15,hp:52,hit_dice:"7d10 + 13",speed:"40 ft.",stats:[15,13,15,1,9,3],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 60 ft., passive Perception 9",languages:"",cr:"3",actions:[{name:"Claw",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 6 (1d8 + 2) bludgeoning damage, and the target is grappled (escape DC 12). The scorpion has two claws, each of which can grapple only one target.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2},{name:"Multiattack",desc:"The scorpion makes three attacks: two with its claws and one with its sting.",attack_bonus:0},{name:"Sting",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 7 (1d10 + 2) piercing damage, and the target must make a DC 12 Constitution saving throw, taking 22 (4d10) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:4,damage_dice:"1d10",damage_bonus:2}]},{name:"Giant Sea Horse",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:16,hit_dice:"3d10 + -1",speed:"0 ft., swim 40 ft.",stats:[12,15,11,2,12,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 11",languages:"",cr:"1/2",traits:[{name:"Charge",desc:"If the sea horse moves at least 20 ft. straight toward a target and then hits it with a ram attack on the same turn, the target takes an extra 7 (2d6) bludgeoning damage. If the target is a creature, it must succeed on a DC 11 Strength saving throw or be knocked prone.",attack_bonus:0,damage_dice:"2d6"},{name:"Water Breathing",desc:"The sea horse can breathe only underwater.",attack_bonus:0}],actions:[{name:"Ram",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 4 (1d6 + 1) bludgeoning damage.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1}]},{name:"Giant Shark",size:"Huge",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:126,hit_dice:"11d12 + 54",speed:"swim 50 ft.",stats:[23,11,21,1,10,5],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 60 ft., passive Perception 13",languages:"",cr:"5",traits:[{name:"Blood Frenzy",desc:"The shark has advantage on melee attack rolls against any creature that doesn't have all its hit points.",attack_bonus:0},{name:"Water Breathing",desc:"The shark can breathe only underwater.",attack_bonus:0}],actions:[{name:"Bite",desc:"Weapon Attack: +9 to hit, reach 5 ft., one target. Hit: 22 (3d10 + 6) piercing damage.",attack_bonus:9,damage_dice:"3d10",damage_bonus:6}]},{name:"Giant Spider",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:14,hp:26,hit_dice:"4d10 + 4",speed:"30 ft., climb 30 ft.",stats:[14,16,12,2,11,4],skillsaves:[{stealth:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 10",languages:"",cr:"1",traits:[{name:"Spider Climb",desc:"The spider can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0},{name:"Web Sense",desc:"While in contact with a web, the spider knows the exact location of any other creature in contact with the same web.",attack_bonus:0},{name:"Web Walker",desc:"The spider ignores movement restrictions caused by webbing.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one creature. Hit: 7 (1d8 + 3) piercing damage, and the target must make a DC 11 Constitution saving throw, taking 9 (2d8) poison damage on a failed save, or half as much damage on a successful one. If the poison damage reduces the target to 0 hit points, the target is stable but poisoned for 1 hour, even after regaining hit points, and is paralyzed while poisoned in this way.",attack_bonus:5,damage_dice:"1d8",damage_bonus:3},{name:"Web (Recharge 5-6)",desc:"Ranged Weapon Attack: +5 to hit, range 30/60 ft., one creature. Hit: The target is restrained by webbing. As an action, the restrained target can make a DC 12 Strength check, bursting the webbing on a success. The webbing can also be attacked and destroyed (AC 10; hp 5; vulnerability to fire damage; immunity to bludgeoning, poison, and psychic damage).",attack_bonus:5}]},{name:"Giant Toad",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:39,hit_dice:"6d10 + 6",speed:"20 ft., swim 40 ft.",stats:[15,13,13,2,10,3],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 30 ft., passive Perception 10",languages:"",cr:"1",traits:[{name:"Amphibious",desc:"The toad can breathe air and water",attack_bonus:0},{name:"Standing Leap",desc:"The toad's long jump is up to 20 ft. and its high jump is up to 10 ft., with or without a running start.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (1d10 + 2) piercing damage plus 5 (1d10) poison damage, and the target is grappled (escape DC 13). Until this grapple ends, the target is restrained, and the toad can't bite another target.",attack_bonus:4,damage_dice:"1d10",damage_bonus:2},{name:"Swallow",desc:"The toad makes one bite attack against a Medium or smaller target it is grappling. If the attack hits, the target is swallowed, and the grapple ends. The swallowed target is blinded and restrained, it has total cover against attacks and other effects outside the toad, and it takes 10 (3d6) acid damage at the start of each of the toad's turns. The toad can have only one target swallowed at a time.\\nIf the toad dies, a swallowed creature is no longer restrained by it and can escape from the corpse using 5 feet of movement, exiting prone.",attack_bonus:0}]},{name:"Giant Vulture",size:"Large",type:"beast",subtype:"",alignment:"neutral evil",ac:10,hp:22,hit_dice:"3d10 + 5",speed:"10 ft., fly 60 ft.",stats:[15,10,15,6,12,7],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"understands Common but can't speak",cr:"1",traits:[{name:"Keen Sight and Smell",desc:"The vulture has advantage on Wisdom (Perception) checks that rely on sight or smell.",attack_bonus:0},{name:"Pack Tactics",desc:"The vulture has advantage on an attack roll against a creature if at least one of the vulture's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The vulture makes two attacks: one with its beak and one with its talons.",attack_bonus:0},{name:"Beak",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (2d4 + 2) piercing damage.",attack_bonus:4,damage_dice:"2d4",damage_bonus:2},{name:"Talons",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 9 (2d6 + 2) slashing damage.",attack_bonus:4,damage_dice:"2d6",damage_bonus:2}]},{name:"Giant Wasp",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:13,hit_dice:"3d8 + -1",speed:"10 ft., fly 50 ft., swim 50 ft.",stats:[10,14,10,1,10,3],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"1/2",actions:[{name:"Sting",desc:"Sting. Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 5 (1d6 + 2) piercing damage, and the target must make a DC 11 Constitution saving throw, taking 10 (3d6) poison damage on a failed save, or half as much damage on a successful one. If the poison damage reduces the target to 0 hit points, the target is stable but poisoned for 1 hour, even after regaining hit points, and is paralyzed while poisoned in this way.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Giant Weasel",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:9,hit_dice:"2d8",speed:"40 ft.",stats:[11,16,10,4,12,5],skillsaves:[{perception:3},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 13",languages:"",cr:"1/8",traits:[{name:"Keen Hearing and Smell",desc:"The weasel has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0}],actions:[{name:"Bite",desc:"Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 5 (1d4 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d4",damage_bonus:3}]},{name:"Giant Wolf Spider",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:11,hit_dice:"2d8 + 2",speed:"40 ft., climb 40 ft.",stats:[12,16,13,3,12,4],skillsaves:[{perception:3},{stealth:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 13",languages:"",cr:"1/4",traits:[{name:"Spider Climb",desc:"The spider can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0},{name:"Web Sense",desc:"While in contact with a web, the spider knows the exact location of any other creature in contact with the same web.",attack_bonus:0},{name:"Web Walker",desc:"The spider ignores movement restrictions caused by webbing.",attack_bonus:0}],actions:[{name:"Bite",desc:"Weapon Attack: +3 to hit, reach 5 ft., one creature. Hit: 4 (1d6 + 1) piercing damage, and the target must make a DC 11 Constitution saving throw, taking 7 (2d6) poison damage on a failed save, or half as much damage on a successful one. If the poison damage reduces the target to 0 hit points, the target is stable but poisoned for 1 hour, even after regaining hit points, and is paralyzed while poisoned in this way.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1}]},{name:"Gibbering Mouther",size:"Medium",type:"aberration",subtype:"",alignment:"neutral",ac:9,hp:67,hit_dice:"9d8 + 26",speed:"10 ft., swim 10 ft.",stats:[10,8,16,3,10,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"prone",senses:"darkvision 60 ft., passive Perception 10",languages:"",cr:"2",traits:[{name:"Aberrant Ground",desc:"The ground in a 10-foot radius around the mouther is doughlike difficult terrain. Each creature that starts its turn in that area must succeed on a DC 10 Strength saving throw or have its speed reduced to 0 until the start of its next turn.",attack_bonus:0},{name:"Gibbering",desc:"The mouther babbles incoherently while it can see any creature and isn't incapacitated. Each creature that starts its turn within 20 feet of the mouther and can hear the gibbering must succeed on a DC 10 Wisdom saving throw. On a failure, the creature can't take reactions until the start of its next turn and rolls a d8 to determine what it does during its turn. On a 1 to 4, the creature does nothing. On a 5 or 6, the creature takes no action or bonus action and uses all its movement to move in a randomly determined direction. On a 7 or 8, the creature makes a melee attack against a randomly determined creature within its reach or does nothing if it can't make such an attack.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The gibbering mouther makes one bite attack and, if it can, uses its Blinding Spittle.",attack_bonus:0},{name:"Bites",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one creature. Hit: 17 (5d6) piercing damage. If the target is Medium or smaller, it must succeed on a DC 10 Strength saving throw or be knocked prone. If the target is killed by this damage, it is absorbed into the mouther.",attack_bonus:2,damage_dice:"5d6"},{name:"Blinding Spittle (Recharge 5-6)",desc:"The mouther spits a chemical glob at a point it can see within 15 feet of it. The glob explodes in a blinding flash of light on impact. Each creature within 5 feet of the flash must succeed on a DC 13 Dexterity saving throw or be blinded until the end of the mouther's next turn.",attack_bonus:0}]},{name:"Glabrezu",size:"Large",type:"fiend",subtype:"demon",alignment:"chaotic evil",ac:17,hp:157,hit_dice:"15d10 + 74",speed:"40 ft.",stats:[20,15,21,19,17,16],saves:[{strength:9},{constitution:9},{wisdom:7},{charisma:7}],damage_vulnerabilities:"",damage_resistances:"cold, fire, lightning; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"poison",condition_immunities:"poisoned",senses:"truesight 120 ft., passive Perception 13",languages:"Abyssal, telepathy 120 ft.",cr:"9",traits:[{name:"Innate Spellcasting",desc:"The glabrezu's spellcasting ability is Intelligence (spell save DC 16). The glabrezu can innately cast the following spells, requiring no material components:\\nAt will: darkness, detect magic, dispel magic\\n1/day each: confusion, fly, power word stun",attack_bonus:0},{name:"Magic Resistance",desc:"The glabrezu has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The glabrezu makes four attacks: two with its pincers and two with its fists. Alternatively, it makes two attacks with its pincers and casts one spell.",attack_bonus:0},{name:"Pincer",desc:"Melee Weapon Attack: +9 to hit, reach 10 ft., one target. Hit: 16 (2d10 + 5) bludgeoning damage. If the target is a Medium or smaller creature, it is grappled (escape DC 15). The glabrezu has two pincers, each of which can grapple only one target.",attack_bonus:9,damage_dice:"2d10",damage_bonus:5},{name:"Fist",desc:"Melee Weapon Attack: +9 to hit, reach 5 ft., one target. Hit: 7 (2d4 + 2) bludgeoning damage.",attack_bonus:9,damage_dice:"2d4",damage_bonus:2},{name:"Variant: Summon Demon (1/Day)",desc:"The demon chooses what to summon and attempts a magical summoning.\\nA glabrezu has a 30 percent chance of summoning 1d3 vrocks, 1d2 hezrous, or one glabrezu.\\nA summoned demon appears in an unoccupied space within 60 feet of its summoner, acts as an ally of its summoner, and can't summon other demons. It remains for 1 minute, until it or its summoner dies, or until its summoner dismisses it as an action.",attack_bonus:0}]},{name:"Gladiator",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:16,hp:112,hit_dice:"15d8 + 44",speed:"30 ft.",stats:[18,15,16,10,12,15],saves:[{strength:7},{dexterity:5},{constitution:6}],skillsaves:[{intimidation:5},{athletics:10}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 11",languages:"any one language (usually Common)",cr:"5",traits:[{name:"Brave",desc:"The gladiator has advantage on saving throws against being frightened.",attack_bonus:0},{name:"Brute",desc:"A melee weapon deals one extra die of its damage when the gladiator hits with it (included in the attack).",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The gladiator makes three melee attacks or two ranged attacks.",attack_bonus:0},{name:"Spear",desc:"Melee or Ranged Weapon Attack: +7 to hit, reach 5 ft. and range 20/60 ft., one target. Hit: 11 (2d6 + 4) piercing damage, or 13 (2d8 + 4) piercing damage if used with two hands to make a melee attack.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Shield Bash",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one creature. Hit: 9 (2d4 + 4) bludgeoning damage. If the target is a Medium or smaller creature, it must succeed on a DC 15 Strength saving throw or be knocked prone.",attack_bonus:7,damage_dice:"2d4",damage_bonus:4}],reactions:[{name:"Parry",desc:"The gladiator adds 3 to its AC against one melee attack that would hit it. To do so, the gladiator must see the attacker and be wielding a melee weapon.",attack_bonus:0}]},{name:"Gnoll",size:"Medium",type:"humanoid",subtype:"gnoll",alignment:"chaotic evil",ac:15,hp:22,hit_dice:"5d8 + -1",speed:"30 ft.",stats:[14,12,11,6,10,7],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 10",languages:"Gnoll",cr:"1/2",traits:[{name:"Rampage",desc:"When the gnoll reduces a creature to 0 hit points with a melee attack on its turn, the gnoll can take a bonus action to move up to half its speed and make a bite attack.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 4 (1d4 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2},{name:"Spear",desc:"Melee or Ranged Weapon Attack: +4 to hit, reach 5 ft. or range 20/60 ft., one target. Hit: 5 (1d6 + 2) piercing damage, or 6 (1d8 + 2) piercing damage if used with two hands to make a melee attack.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Longbow",desc:"Ranged Weapon Attack: +3 to hit, range 150/600 ft., one target. Hit: 5 (1d8 + 1) piercing damage.",attack_bonus:3,damage_dice:"1d8",damage_bonus:1}]},{name:"Goat",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:10,hp:4,hit_dice:"1d8 + -1",speed:"40 ft.",stats:[12,10,11,2,10,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"0",traits:[{name:"Charge",desc:"If the goat moves at least 20 ft. straight toward a target and then hits it with a ram attack on the same turn, the target takes an extra 2 (1d4) bludgeoning damage. If the target is a creature, it must succeed on a DC 10 Strength saving throw or be knocked prone.",attack_bonus:0,damage_dice:"1d4"},{name:"Sure-Footed",desc:"The goat has advantage on Strength and Dexterity saving throws made against effects that would knock it prone.",attack_bonus:0}],actions:[{name:"Ram",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 3 (1d4 + 1) bludgeoning damage.",attack_bonus:3,damage_dice:"1d4",damage_bonus:1}]},{name:"Goblin",size:"Small",type:"humanoid",subtype:"goblinoid",alignment:"neutral evil",ac:15,hp:7,hit_dice:"2d6",speed:"30 ft.",stats:[8,14,10,10,8,8],skillsaves:[{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 9",languages:"Common, Goblin",cr:"1/4",traits:[{name:"Nimble Escape",desc:"The goblin can take the Disengage or Hide action as a bonus action on each of its turns.",attack_bonus:0}],actions:[{name:"Scimitar",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) slashing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Shortbow",desc:"Ranged Weapon Attack: +4 to hit, range 80/320 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Gold Dragon Wyrmling",size:"Medium",type:"dragon",subtype:"",alignment:"lawful good",ac:17,hp:60,hit_dice:"8d8 + 24",speed:"30 ft., fly 60 ft., swim 30 ft.",stats:[19,14,17,14,11,16],saves:[{dexterity:4},{constitution:5},{wisdom:2},{charisma:5}],skillsaves:[{perception:4},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 14",languages:"Draconic",cr:"3",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 9 (1d10 + 4) piercing damage.",attack_bonus:6,damage_dice:"1d10",damage_bonus:4},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nFire Breath. The dragon exhales fire in a 15-foot cone. Each creature in that area must make a DC 13 Dexterity saving throw, taking 22 (4d10) fire damage on a failed save, or half as much damage on a successful one.\\nWeakening Breath. The dragon exhales gas in a 15-foot cone. Each creature in that area must succeed on a DC 13 Strength saving throw or have disadvantage on Strength-based attack rolls, Strength checks, and Strength saving throws for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0,damage_dice:"4d10"}]},{name:"Gorgon",size:"Large",type:"monstrosity",subtype:"",alignment:"unaligned",ac:19,hp:114,hit_dice:"12d10 + 48",speed:"40 ft.",stats:[20,11,18,2,12,7],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"petrified",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 14",languages:"",cr:"5",traits:[{name:"Trampling Charge",desc:"If the gorgon moves at least 20 feet straight toward a creature and then hits it with a gore attack on the same turn, that target must succeed on a DC 16 Strength saving throw or be knocked prone. If the target is prone, the gorgon can make one attack with its hooves against it as a bonus action.",attack_bonus:0}],actions:[{name:"Gore",desc:"Melee Weapon Attack: +8 to hit, reach 5 ft., one target. Hit: 18 (2d12 + 5) piercing damage.",attack_bonus:8,damage_dice:"2d12",damage_bonus:5},{name:"Hooves",desc:"Melee Weapon Attack: +8 to hit, reach 5 ft., one target. Hit: 16 (2d10 + 5) bludgeoning damage.",attack_bonus:8,damage_dice:"2d10",damage_bonus:5},{name:"Petrifying Breath (Recharge 5-6)",desc:"The gorgon exhales petrifying gas in a 30-foot cone. Each creature in that area must succeed on a DC 13 Constitution saving throw. On a failed save, a target begins to turn to stone and is restrained. The restrained target must repeat the saving throw at the end of its next turn. On a success, the effect ends on the target. On a failure, the target is petrified until freed by the greater restoration spell or other magic.",attack_bonus:0}]},{name:"Gray Ooze",size:"Medium",type:"ooze",subtype:"",alignment:"unaligned",ac:8,hp:22,hit_dice:"3d8 + 8",speed:"10 ft., climb 10 ft.",stats:[12,6,16,1,6,2],skillsaves:[{stealth:2}],damage_vulnerabilities:"",damage_resistances:"acid, cold, fire",damage_immunities:"",condition_immunities:"blinded, charmed, deafened, exhaustion, frightened, prone",senses:"blindsight 60 ft. (blind beyond this radius), passive Perception 8",languages:"",cr:"1/2",traits:[{name:"Amorphous",desc:"The ooze can move through a space as narrow as 1 inch wide without squeezing.",attack_bonus:0},{name:"Corrode Metal",desc:"Any nonmagical weapon made of metal that hits the ooze corrodes. After dealing damage, the weapon takes a permanent and cumulative -1 penalty to damage rolls. If its penalty drops to -5, the weapon is destroyed. Nonmagical ammunition made of metal that hits the ooze is destroyed after dealing damage.\\nThe ooze can eat through 2-inch-thick, nonmagical metal in 1 round.",attack_bonus:0},{name:"False Appearance",desc:"While the ooze remains motionless, it is indistinguishable from an oily pool or wet rock.",attack_bonus:0}],actions:[{name:"Pseudopod",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 4 (1d6 + 1) bludgeoning damage plus 7 (2d6) acid damage, and if the target is wearing nonmagical metal armor, its armor is partly corroded and takes a permanent and cumulative -1 penalty to the AC it offers. The armor is destroyed if the penalty reduces its AC to 10.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1}]},{name:"Green Dragon Wyrmling",size:"Medium",type:"dragon",subtype:"",alignment:"lawful evil",ac:17,hp:38,hit_dice:"7d8 + 6",speed:"30 ft., fly 60 ft., swim 30 ft.",stats:[15,12,13,14,11,13],saves:[{dexterity:3},{constitution:3},{wisdom:2},{charisma:3}],skillsaves:[{perception:4},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison",condition_immunities:"poisoned",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 14",languages:"Draconic",cr:"2",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (1d10 + 2) piercing damage plus 3 (1d6) poison damage.",attack_bonus:4,damage_dice:"1d10 + 1d6",damage_bonus:3},{name:"Poison Breath (Recharge 5-6)",desc:"The dragon exhales poisonous gas in a 15-foot cone. Each creature in that area must make a DC 11 Constitution saving throw, taking 21 (6d6) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"6d6"}]},{name:"Green Hag",size:"Medium",type:"fey",subtype:"",alignment:"neutral evil",ac:17,hp:82,hit_dice:"11d8 + 32",speed:"30 ft.",stats:[18,12,16,13,14,14],skillsaves:[{arcana:3},{deception:4},{perception:4},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 14",languages:"Common, Draconic, Sylvan",cr:"3",traits:[{name:"Amphibious",desc:"The hag can breathe air and water.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The hag's innate spellcasting ability is Charisma (spell save DC 12). She can innately cast the following spells, requiring no material components:\\n\\nAt will: dancing lights, minor illusion, vicious mockery",attack_bonus:0},{name:"Mimicry",desc:"The hag can mimic animal sounds and humanoid voices. A creature that hears the sounds can tell they are imitations with a successful DC 14 Wisdom (Insight) check.",attack_bonus:0},{name:"Hag Coven",desc:"When hags must work together, they form covens, in spite of their selfish natures. A coven is made up of hags of any type, all of whom are equals within the group. However, each of the hags continues to desire more personal power.\\nA coven consists of three hags so that any arguments between two hags can be settled by the third. If more than three hags ever come together, as might happen if two covens come into conflict, the result is usually chaos.",attack_bonus:0},{name:"Shared Spellcasting (Coven Only)",desc:"While all three members of a hag coven are within 30 feet of one another, they can each cast the following spells from the wizard's spell list but must share the spell slots among themselves:\\n\\n\u2022 1st level (4 slots): identify, ray of sickness\\n\u2022 2nd level (3 slots): hold person, locate object\\n\u2022 3rd level (3 slots): bestow curse, counterspell, lightning bolt\\n\u2022 4th level (3 slots): phantasmal killer, polymorph\\n\u2022 5th level (2 slots): contact other plane, scrying\\n\u2022 6th level (1 slot): eye bite\\n\\nFor casting these spells, each hag is a 12th-level spellcaster that uses Intelligence as her spellcasting ability. The spell save DC is 12+the hag's Intelligence modifier, and the spell attack bonus is 4+the hag's Intelligence modifier.",attack_bonus:0},{name:"Hag Eye (Coven Only)",desc:"A hag coven can craft a magic item called a hag eye, which is made from a real eye coated in varnish and often fitted to a pendant or other wearable item. The hag eye is usually entrusted to a minion for safekeeping and transport. A hag in the coven can take an action to see what the hag eye sees if the hag eye is on the same plane of existence. A hag eye has AC 10, 1 hit point, and darkvision with a radius of 60 feet. If it is destroyed, each coven member takes 3d10 psychic damage and is blinded for 24 hours.\\nA hag coven can have only one hag eye at a time, and creating a new one requires all three members of the coven to perform a ritual. The ritual takes 1 hour, and the hags can't perform it while blinded. During the ritual, if the hags take any action other than performing the ritual, they must start over.",attack_bonus:0}],actions:[{name:"Claws",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) slashing damage.",attack_bonus:6,damage_dice:"2d8",damage_bonus:4},{name:"Illusory Appearance",desc:"The hag covers herself and anything she is wearing or carrying with a magical illusion that makes her look like another creature of her general size and humanoid shape. The illusion ends if the hag takes a bonus action to end it or if she dies.\\nThe changes wrought by this effect fail to hold up to physical inspection. For example, the hag could appear to have smooth skin, but someone touching her would feel her rough flesh. Otherwise, a creature must take an action to visually inspect the illusion and succeed on a DC 20 Intelligence (Investigation) check to discern that the hag is disguised.",attack_bonus:0},{name:"Invisible Passage",desc:"The hag magically turns invisible until she attacks or casts a spell, or until her concentration ends (as if concentrating on a spell). While invisible, she leaves no physical evidence of her passage, so she can be tracked only by magic. Any equipment she wears or carries is invisible with her.",attack_bonus:0}]},{name:"Grick",size:"Medium",type:"monstrosity",subtype:"",alignment:"neutral",ac:14,hp:27,hit_dice:"6d8",speed:"30 ft., climb 30 ft.",stats:[14,14,11,3,14,5],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, and slashing damage from nonmagical weapons",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 12",languages:"",cr:"2",traits:[{name:"Stone Camouflage",desc:"The grick has advantage on Dexterity (Stealth) checks made to hide in rocky terrain.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The grick makes one attack with its tentacles. If that attack hits, the grick can make one beak attack against the same target.",attack_bonus:0},{name:"Tentacles",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 9 (2d6 + 2) slashing damage.",attack_bonus:4,damage_dice:"2d6",damage_bonus:2},{name:"Beak",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Griffon",size:"Large",type:"monstrosity",subtype:"",alignment:"unaligned",ac:12,hp:59,hit_dice:"7d10 + 20",speed:"30 ft., fly 80 ft.",stats:[18,15,16,2,13,8],skillsaves:[{perception:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 15",languages:"",cr:"2",traits:[{name:"Keen Sight",desc:"The griffon has advantage on Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The griffon makes two attacks: one with its beak and one with its claws.",attack_bonus:0},{name:"Beak",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 8 (1d8 + 4) piercing damage.",attack_bonus:6,damage_dice:"1d8",damage_bonus:4},{name:"Claws",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) slashing damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:4}]},{name:"Grimlock",size:"Medium",type:"humanoid",subtype:"grimlock",alignment:"neutral evil",ac:11,hp:11,hit_dice:"2d8 + 2",speed:"30 ft.",stats:[16,12,12,9,8,6],skillsaves:[{athletics:5},{perception:3},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"blinded",condition_immunities:"",senses:"blindsight 30 ft. or 10 ft. while deafened (blind beyond this radius), passive Perception 13",languages:"Undercommon",cr:"1/4",traits:[{name:"Blind Senses",desc:"The grimlock can't use its blindsight while deafened and unable to smell.",attack_bonus:0},{name:"Keen Hearing and Smell",desc:"The grimlock has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0},{name:"Stone Camouflage",desc:"The grimlock has advantage on Dexterity (Stealth) checks made to hide in rocky terrain.",attack_bonus:0}],actions:[{name:"Spiked Bone Club",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 5 (1d4 + 3) bludgeoning damage plus 2 (1d4) piercing damage.",attack_bonus:5,damage_dice:"1d4 + 1d4",damage_bonus:5}]},{name:"Guard",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:16,hp:11,hit_dice:"2d8 + 2",speed:"30 ft.",stats:[13,12,12,10,11,10],skillsaves:[{perception:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 12",languages:"any one language (usually Common)",cr:"1/8",actions:[{name:"Spear",desc:"Melee or Ranged Weapon Attack: +3 to hit, reach 5 ft. or range 20/60 ft., one target. Hit: 4 (1d6 + 1) piercing damage or 5 (1d8 + 1) piercing damage if used with two hands to make a melee attack.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1}]},{name:"Guardian Naga",size:"Large",type:"monstrosity",subtype:"",alignment:"lawful good",ac:18,hp:127,hit_dice:"15d10 + 44",speed:"40 ft.",stats:[19,18,16,16,19,18],saves:[{dexterity:8},{constitution:7},{intelligence:7},{wisdom:8},{charisma:8}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison",condition_immunities:"charmed, poisoned",senses:"darkvision 60 ft., passive Perception 14",languages:"Celestial, Common",cr:"10",traits:[{name:"Rejuvenation",desc:"If it dies, the naga returns to life in 1d6 days and regains all its hit points. Only a wish spell can prevent this trait from functioning.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one creature. Hit: 8 (1d8 + 4) piercing damage, and the target must make a DC 15 Constitution saving throw, taking 45 (10d8) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:8,damage_dice:"1d8",damage_bonus:4},{name:"Spit Poison",desc:"Ranged Weapon Attack: +8 to hit, range 15/30 ft., one creature. Hit: The target must make a DC 15 Constitution saving throw, taking 45 (10d8) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:8,damage_dice:"10d8"}],spells:["The naga is an 11th-level spellcaster. Its spellcasting ability is Wisdom (spell save DC 16, +8 to hit with spell attacks), and it needs only verbal components to cast its spells. It has the following cleric spells prepared:",{"Cantrips (at will)":"mending, sacred flame, thaumaturgy"},{"1st level (4 slots)":"command, cure wounds, shield of faith"},{"2nd level (3 slots)":"calm emotions, hold person"},{"3rd level (3 slots)":"bestow curse, clairvoyance"},{"4th level (3 slots)":"banishment, freedom of movement"},{"5th level (2 slots)":"flame strike, geas"},{"6th level (1 slot)":"true seeing"}]},{name:"Gynosphinx",size:"Large",type:"monstrosity",subtype:"",alignment:"lawful neutral",ac:17,hp:136,hit_dice:"16d10 + 48",speed:"40 ft., fly 60 ft.",stats:[18,15,16,18,18,18],skillsaves:[{arcana:12},{history:12},{perception:8},{religion:8}],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"psychic",condition_immunities:"charmed, frightened",senses:"truesight 120 ft., passive Perception 18",languages:"Common, Sphinx",cr:"11",traits:[{name:"Inscrutable",desc:"The sphinx is immune to any effect that would sense its emotions or read its thoughts, as well as any divination spell that it refuses. Wisdom (Insight) checks made to ascertain the sphinx's intentions or sincerity have disadvantage.",attack_bonus:0},{name:"Magic Weapons",desc:"The sphinx's weapon attacks are magical.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The sphinx makes two claw attacks.",attack_bonus:0},{name:"Claw",desc:"Melee Weapon Attack: +9 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) slashing damage.",attack_bonus:9,damage_dice:"2d8",damage_bonus:4}],legendary_actions:[{name:"Claw Attack",desc:"The sphinx makes one claw attack.",attack_bonus:0},{name:"Teleport (Costs 2 Actions)",desc:"The sphinx magically teleports, along with any equipment it is wearing or carrying, up to 120 feet to an unoccupied space it can see.",attack_bonus:0},{name:"Cast a Spell (Costs 3 Actions)",desc:"The sphinx casts a spell from its list of prepared spells, using a spell slot as normal.",attack_bonus:0}],spells:["The sphinx is a 9th-level spellcaster. Its spellcasting ability is Intelligence (spell save DC 16, +8 to hit with spell attacks). It requires no material components to cast its spells. The sphinx has the following wizard spells prepared:",{"Cantrips (at will)":"mage hand, minor illusion, prestidigitation"},{"1st level (4 slots)":"detect magic, identify, shield"},{"2nd level (3 slots)":"darkness, locate object, suggestion"},{"3rd level (3 slots)":"dispel magic, remove curse, tongues"},{"4th level (3 slots)":"banishment, greater invisibility"},{"5th level (1 slot)":"legend lore"}]},{name:"Half-Red Dragon Veteran",size:"Medium",type:"humanoid",subtype:"human",alignment:"any alignment",ac:18,hp:65,hit_dice:"10d8 + 20",speed:"30 ft.",stats:[16,13,14,10,11,10],damage_vulnerabilities:"",damage_resistances:"fire",damage_immunities:"",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 12",languages:"Common, Draconic",cr:"5",actions:[{name:"Multiattack",desc:"The veteran makes two longsword attacks. If it has a shortsword drawn, it can also make a shortsword attack.",attack_bonus:0},{name:"Longsword",desc:"Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) slashing damage, or 8 (1d10 + 3) slashing damage if used with two hands.",attack_bonus:5,damage_dice:"1d8",damage_bonus:3},{name:"Shortsword",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3},{name:"Heavy Crossbow",desc:"Ranged Weapon Attack: +3 to hit, range 100/400 ft., one target. Hit: 6 (1d10 + 1) piercing damage.",attack_bonus:3,damage_dice:"1d10",damage_bonus:1},{name:"Fire Breath (Recharge 5-6)",desc:"The veteran exhales fire in a 15-foot cone. Each creature in that area must make a DC 15 Dexterity saving throw, taking 24 (7d6) fire damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"7d6"}]},{name:"Harpy",size:"Medium",type:"monstrosity",subtype:"",alignment:"chaotic evil",ac:11,hp:38,hit_dice:"7d8 + 6",speed:"20 ft., fly 40 ft.",stats:[12,13,12,7,10,13],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"Common",cr:"1",actions:[{name:"Multiattack",desc:"The harpy makes two attacks: one with its claws and one with its club.",attack_bonus:0},{name:"Claws",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 6 (2d4 + 1) slashing damage.",attack_bonus:3,damage_dice:"2d4",damage_bonus:1},{name:"Club",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 3 (1d4 + 1) bludgeoning damage.",attack_bonus:3,damage_dice:"1d4",damage_bonus:1},{name:"Luring Song",desc:"The harpy sings a magical melody. Every humanoid and giant within 300 ft. of the harpy that can hear the song must succeed on a DC 11 Wisdom saving throw or be charmed until the song ends. The harpy must take a bonus action on its subsequent turns to continue singing. It can stop singing at any time. The song ends if the harpy is incapacitated.\\nWhile charmed by the harpy, a target is incapacitated and ignores the songs of other harpies. If the charmed target is more than 5 ft. away from the harpy, the must move on its turn toward the harpy by the most direct route. It doesn't avoid opportunity attacks, but before moving into damaging terrain, such as lava or a pit, and whenever it takes damage from a source other than the harpy, a target can repeat the saving throw. A creature can also repeat the saving throw at the end of each of its turns. If a creature's saving throw is successful, the effect ends on it.\\nA target that successfully saves is immune to this harpy's song for the next 24 hours.",attack_bonus:0}]},{name:"Hawk",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:1,hit_dice:"1d4 + -2",speed:"10 ft., fly 60 ft.",stats:[5,16,8,2,14,6],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 14",languages:"",cr:"0",traits:[{name:"Keen Sight",desc:"The hawk has advantage on Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Talons",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 1 slashing damage.",attack_bonus:5,damage_bonus:1}]},{name:"Hell Hound",size:"Medium",type:"fiend",subtype:"",alignment:"lawful evil",ac:15,hp:45,hit_dice:"7d8 + 13",speed:"50 ft.",stats:[17,12,14,6,13,6],skillsaves:[{perception:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 15",languages:"understands Infernal but can't speak it",cr:"3",traits:[{name:"Keen Hearing and Smell",desc:"The hound has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0},{name:"Pack Tactics",desc:"The hound has advantage on an attack roll against a creature if at least one of the hound's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) piercing damage plus 7 (2d6) fire damage.",attack_bonus:5,damage_dice:"1d8",damage_bonus:3},{name:"Fire Breath (Recharge 5-6)",desc:"The hound exhales fire in a 15-foot cone. Each creature in that area must make a DC 12 Dexterity saving throw, taking 21 (6d6) fire damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"6d6"}]},{name:"Hezrou",size:"Large",type:"fiend",subtype:"demon",alignment:"chaotic evil",ac:16,hp:136,hit_dice:"13d10 + 64",speed:"30 ft.",stats:[19,17,20,5,12,13],saves:[{strength:7},{constitution:8},{wisdom:4}],damage_vulnerabilities:"",damage_resistances:"cold, fire, lightning; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"poison",condition_immunities:"poisoned",senses:"darkvision 120 ft., passive Perception 11",languages:"Abyssal, telepathy 120 ft.",cr:"8",traits:[{name:"Magic Resistance",desc:"The hezrou has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Stench",desc:"Any creature that starts its turn within 10 feet of the hezrou must succeed on a DC 14 Constitution saving throw or be poisoned until the start of its next turn. On a successful saving throw, the creature is immune to the hezrou's stench for 24 hours.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The hezrou makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 15 (2d10 + 4) piercing damage.",attack_bonus:7,damage_dice:"2d10",damage_bonus:4},{name:"Claws",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) slashing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Variant: Summon Demon (1/Day)",desc:"The demon chooses what to summon and attempts a magical summoning.\\nA hezrou has a 30 percent chance of summoning 2d6 dretches or one hezrou.\\nA summoned demon appears in an unoccupied space within 60 feet of its summoner, acts as an ally of its summoner, and can't summon other demons. It remains for 1 minute, until it or its summoner dies, or until its summoner dismisses it as an action.",attack_bonus:0}]},{name:"Hill Giant",size:"Huge",type:"giant",subtype:"",alignment:"chaotic evil",ac:13,hp:105,hit_dice:"10d12 + 40",speed:"40 ft.",stats:[21,8,19,5,9,6],skillsaves:[{perception:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 12",languages:"Giant",cr:"5",actions:[{name:"Multiattack",desc:"The giant makes two greatclub attacks.",attack_bonus:0},{name:"Greatclub",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one target. Hit: 18 (3d8 + 5) bludgeoning damage.",attack_bonus:8,damage_dice:"3d8",damage_bonus:5},{name:"Rock",desc:"Ranged Weapon Attack: +8 to hit, range 60/240 ft., one target. Hit: 21 (3d10 + 5) bludgeoning damage.",attack_bonus:8,damage_dice:"3d10",damage_bonus:5}]},{name:"Hippogriff",size:"Large",type:"monstrosity",subtype:"",alignment:"unaligned",ac:11,hp:19,hit_dice:"3d10 + 2",speed:"40 ft, fly 60 ft.",stats:[17,13,13,2,12,8],skillsaves:[{perception:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 15",languages:"",cr:"1",traits:[{name:"Keen Sight",desc:"The hippogriff has advantage on Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The hippogriff makes two attacks: one with its beak and one with its claws.",attack_bonus:0},{name:"Beak",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 8 (1d10 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d10",damage_bonus:3},{name:"Claws",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) slashing damage.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3}]},{name:"Hobgoblin",size:"Medium",type:"humanoid",subtype:"goblinoid",alignment:"lawful evil",ac:18,hp:11,hit_dice:"2d8 + 2",speed:"30 ft.",stats:[13,12,12,10,10,9],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 10",languages:"Common, Goblin",cr:"1/2",traits:[{name:"Martial Advantage",desc:"Once per turn, the hobgoblin can deal an extra 7 (2d6) damage to a creature it hits with a weapon attack if that creature is within 5 ft. of an ally of the hobgoblin that isn't incapacitated.",attack_bonus:0,damage_dice:"2d6"}],actions:[{name:"Longsword",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 5 (1d8 + 1) slashing damage, or 6 (1d10 + 1) slashing damage if used with two hands.",attack_bonus:3,damage_dice:"1d8",damage_bonus:1},{name:"Longbow",desc:"Ranged Weapon Attack: +3 to hit, range 150/600 ft., one target. Hit: 5 (1d8 + 1) piercing damage.",attack_bonus:3,damage_dice:"1d8",damage_bonus:1}]},{name:"Homunculus",size:"Tiny",type:"construct",subtype:"",alignment:"neutral",ac:13,hp:5,hit_dice:"2d4",speed:"20 ft., fly 40 ft.",stats:[4,15,11,10,10,7],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison",condition_immunities:"charmed, poisoned",senses:"darkvision 60 ft., passive Perception 10",languages:"understands the languages of its creator but can't speak",cr:"0",traits:[{name:"Telepathic Bond",desc:"While the homunculus is on the same plane of existence as its master, it can magically convey what it senses to its master, and the two can communicate telepathically.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 1 piercing damage, and the target must succeed on a DC 10 Constitution saving throw or be poisoned for 1 minute. If the saving throw fails by 5 or more, the target is instead poisoned for 5 (1d10) minutes and unconscious while poisoned in this way.",attack_bonus:4,damage_bonus:1}]},{name:"Horned Devil",size:"Large",type:"fiend",subtype:"devil",alignment:"lawful evil",ac:18,hp:148,hit_dice:"17d10 + 54",speed:"20 ft., fly 60 ft.",stats:[22,17,21,12,16,17],saves:[{strength:10},{dexterity:7},{wisdom:7},{charisma:7}],damage_vulnerabilities:"",damage_resistances:"cold; bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"darkvision 120 ft., passive Perception 13",languages:"Infernal, telepathy 120 ft.",cr:"11",traits:[{name:"Devil's Sight",desc:"Magical darkness doesn't impede the devil's darkvision.",attack_bonus:0},{name:"Magic Resistance",desc:"The devil has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The devil makes three melee attacks: two with its fork and one with its tail. It can use Hurl Flame in place of any melee attack.",attack_bonus:0},{name:"Fork",desc:"Melee Weapon Attack: +10 to hit, reach 10 ft., one target. Hit: 15 (2d8 + 6) piercing damage.",attack_bonus:10,damage_dice:"2d8",damage_bonus:6},{name:"Tail",desc:"Melee Weapon Attack: +10 to hit, reach 10 ft., one target. Hit: 10 (1d8 + 6) piercing damage. If the target is a creature other than an undead or a construct, it must succeed on a DC 17 Constitution saving throw or lose 10 (3d6) hit points at the start of each of its turns due to an infernal wound. Each time the devil hits the wounded target with this attack, the damage dealt by the wound increases by 10 (3d6). Any creature can take an action to stanch the wound with a successful DC 12 Wisdom (Medicine) check. The wound also closes if the target receives magical healing.",attack_bonus:10,damage_dice:"1d8",damage_bonus:6},{name:"Hurl Flame",desc:"Ranged Spell Attack: +7 to hit, range 150 ft., one target. Hit: 14 (4d6) fire damage. If the target is a flammable object that isn't being worn or carried, it also catches fire.",attack_bonus:7,damage_dice:"4d6"}]},{name:"Hunter Shark",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:45,hit_dice:"6d10 + 12",speed:"swim 40 ft.",stats:[18,13,15,1,10,4],skillsaves:[{perception:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 30 ft., passive Perception 12",languages:"",cr:"2",traits:[{name:"Blood Frenzy",desc:"The shark has advantage on melee attack rolls against any creature that doesn't have all its hit points.",attack_bonus:0},{name:"Water Breathing",desc:"The shark can breathe only underwater.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) piercing damage.",attack_bonus:6,damage_dice:"2d8",damage_bonus:4}]},{name:"Hydra",size:"Huge",type:"monstrosity",subtype:"",alignment:"unaligned",ac:15,hp:172,hit_dice:"15d12 + 74",speed:"30 ft., swim 30 ft.",stats:[20,12,20,2,10,7],skillsaves:[{perception:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 16",languages:"",cr:"8",traits:[{name:"Hold Breath",desc:"The hydra can hold its breath for 1 hour.",attack_bonus:0},{name:"Multiple Heads",desc:"The hydra has five heads. While it has more than one head, the hydra has advantage on saving throws against being blinded, charmed, deafened, frightened, stunned, and knocked unconscious.\\nWhenever the hydra takes 25 or more damage in a single turn, one of its heads dies. If all its heads die, the hydra dies.\\nAt the end of its turn, it grows two heads for each of its heads that died since its last turn, unless it has taken fire damage since its last turn. The hydra regains 10 hit points for each head regrown in this way.",attack_bonus:0},{name:"Reactive Heads",desc:"For each head the hydra has beyond one, it gets an extra reaction that can be used only for opportunity attacks.",attack_bonus:0},{name:"Wakeful",desc:"While the hydra sleeps, at least one of its heads is awake.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The hydra makes as many bite attacks as it has heads.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one target. Hit: 10 (1d10 + 5) piercing damage.",attack_bonus:8,damage_dice:"1d10",damage_bonus:5}]},{name:"Hyena",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:5,hit_dice:"1d8",speed:"50 ft.",stats:[11,13,12,2,12,5],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"0",traits:[{name:"Pack Tactics",desc:"The hyena has advantage on an attack roll against a creature if at least one of the hyena's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Bite",desc:"Weapon Attack: +2 to hit, reach 5 ft., one target. Hit: 3 (1d6) piercing damage.",attack_bonus:2,damage_dice:"1d6"}]},{name:"Ice Devil",size:"Large",type:"fiend",subtype:"devil",alignment:"lawful evil",ac:18,hp:180,hit_dice:"19d10 + 75",speed:"40 ft.",stats:[21,14,18,18,15,18],saves:[{dexterity:7},{constitution:9},{wisdom:7},{charisma:9}],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"blindsight 60 ft., darkvision 120 ft., passive Perception 12",languages:"Infernal, telepathy 120 ft.",cr:"14",traits:[{name:"Devil's Sight",desc:"Magical darkness doesn't impede the devil's darkvision.",attack_bonus:0},{name:"Magic Resistance",desc:"The devil has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The devil makes three attacks: one with its bite, one with its claws, and one with its tail.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +10 to hit, reach 5 ft., one target. Hit: 12 (2d6 + 5) piercing damage plus 10 (3d6) cold damage.",attack_bonus:10,damage_dice:"2d6 + 3d6",damage_bonus:5},{name:"Claws",desc:"Melee Weapon Attack: +10 to hit, reach 5 ft., one target. Hit: 10 (2d4 + 5) slashing damage plus 10 (3d6) cold damage.",attack_bonus:10,damage_dice:"2d4 + 3d6",damage_bonus:5},{name:"Tail",desc:"Melee Weapon Attack:+10 to hit, reach 10 ft., one target. Hit: 12 (2d6 + 5) bludgeoning damage plus 10 (3d6) cold damage.",attack_bonus:10,damage_dice:"2d6 + 3d6",damage_bonus:5},{name:"Wall of Ice",desc:"The devil magically forms an opaque wall of ice on a solid surface it can see within 60 feet of it. The wall is 1 foot thick and up to 30 feet long and 10 feet high, or it's a hemispherical dome up to 20 feet in diameter.\\nWhen the wall appears, each creature in its space is pushed out of it by the shortest route. The creature chooses which side of the wall to end up on, unless the creature is incapacitated. The creature then makes a DC 17 Dexterity saving throw, taking 35 (10d6) cold damage on a failed save, or half as much damage on a successful one.\\nThe wall lasts for 1 minute or until the devil is incapacitated or dies. The wall can be damaged and breached; each 10-foot section has AC 5, 30 hit points, vulnerability to fire damage, and immunity to acid, cold, necrotic, poison, and psychic damage. If a section is destroyed, it leaves behind a sheet of frigid air in the space the wall occupied. Whenever a creature finishes moving through the frigid air on a turn, willingly or otherwise, the creature must make a DC 17 Constitution saving throw, taking 17 (5d6) cold damage on a failed save, or half as much damage on a successful one. The frigid air dissipates when the rest of the wall vanishes.",attack_bonus:0}]},{name:"Ice Mephit",size:"Small",type:"elemental",subtype:"",alignment:"neutral evil",ac:11,hp:21,hit_dice:"6d6",speed:"30 ft., fly 30 ft.",stats:[7,13,10,9,11,12],skillsaves:[{perception:2},{stealth:3}],damage_vulnerabilities:"bludgeoning, fire",damage_resistances:"",damage_immunities:"cold, poison",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 12",languages:"Aquan, Auran",cr:"1/2",traits:[{name:"Death Burst",desc:"When the mephit dies, it explodes in a burst of jagged ice. Each creature within 5 ft. of it must make a DC 10 Dexterity saving throw, taking 4 (1d8) slashing damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"1d8"},{name:"False Appearance",desc:"While the mephit remains motionless, it is indistinguishable from an ordinary shard of ice.",attack_bonus:0},{name:"Innate Spellcasting (1/Day)",desc:"The mephit can innately cast fog cloud, requiring no material components. Its innate spellcasting ability is Charisma.",attack_bonus:0}],actions:[{name:"Claws",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one creature. Hit: 3 (1d4 + 1) slashing damage plus 2 (1d4) cold damage.",attack_bonus:3,damage_dice:"1d4",damage_bonus:1},{name:"Frost Breath (Recharge 6)",desc:"The mephit exhales a 15-foot cone of cold air. Each creature in that area must succeed on a DC 10 Dexterity saving throw, taking 5 (2d4) cold damage on a failed save, or half as much damage on a successful one.",attack_bonus:0},{name:"Variant: Summon Mephits (1/Day)",desc:"The mephit has a 25 percent chance of summoning 1d4 mephits of its kind. A summoned mephit appears in an unoccupied space within 60 feet of its summoner, acts as an ally of its summoner, and can't summon other mephits. It remains for 1 minute, until it or its summoner dies, or until its summoner dismisses it as an action.",attack_bonus:0}]},{name:"Imp",size:"Tiny",type:"fiend",subtype:"devil",alignment:"lawful evil",ac:13,hp:10,hit_dice:"3d4 + 2",speed:"20 ft., fly 40 ft.",stats:[6,17,13,11,12,14],skillsaves:[{deception:4},{insight:3},{persuasion:4},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"cold; bludgeoning, piercing, and slashing from nonmagical/nonsilver weapons",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"darkvision 120 ft., passive Perception 11",languages:"Infernal, Common",cr:"1",traits:[{name:"Shapechanger",desc:"The imp can use its action to polymorph into a beast form that resembles a rat (speed 20 ft.), a raven (20 ft., fly 60 ft.), or a spider (20 ft., climb 20 ft.), or back into its true form. Its statistics are the same in each form, except for the speed changes noted. Any equipment it is wearing or carrying isn't transformed. It reverts to its true form if it dies.",attack_bonus:0},{name:"Devil's Sight",desc:"Magical darkness doesn't impede the imp's darkvision.",attack_bonus:0},{name:"Magic Resistance",desc:"The imp has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Variant: Familiar",desc:"The imp can serve another creature as a familiar, forming a telepathic bond with its willing master. While the two are bonded, the master can sense what the quasit senses as long as they are within 1 mile of each other. While the imp is within 10 feet of its master, the master shares the quasit's Magic Resistance trait. At any time and for any reason, the imp can end its service as a familiar, ending the telepathic bond.",attack_bonus:0}],actions:[{name:"Sting (Bite in Beast Form)",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft ., one target. Hit: 5 (1d4 + 3) piercing damage, and the target must make on a DC 11 Constitution saving throw, taking 10 (3d6) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:5,damage_dice:"1d4",damage_bonus:3},{name:"Invisibility",desc:"The imp magically turns invisible until it attacks, or until its concentration ends (as if concentrating on a spell). Any equipment the imp wears or carries is invisible with it.",attack_bonus:0}]},{name:"Invisible Stalker",size:"Medium",type:"elemental",subtype:"",alignment:"neutral",ac:14,hp:104,hit_dice:"16d8 + 32",speed:"50 ft., fly 50 ft. (hover)",stats:[16,19,14,10,15,11],skillsaves:[{perception:8},{stealth:10}],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"poison",condition_immunities:"exhaustion, grappled, paralyzed, petrified, poisoned, prone, restrained, unconscious",senses:"darkvision 60 ft., passive Perception 18",languages:"Auran, understands Common but doesn't speak it",cr:"6",traits:[{name:"Invisibility",desc:"The stalker is invisible.",attack_bonus:0},{name:"Faultless Tracker",desc:"The stalker is given a quarry by its summoner. The stalker knows the direction and distance to its quarry as long as the two of them are on the same plane of existence. The stalker also knows the location of its summoner.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The stalker makes two slam attacks.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) bludgeoning damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:3}]},{name:"Iron Golem",size:"Large",type:"construct",subtype:"",alignment:"unaligned",ac:20,hp:210,hit_dice:"20d10 + 100",speed:"30 ft.",stats:[24,9,20,3,11,1],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire, poison, psychic; bludgeoning, piercing, and slashing from nonmagical weapons that aren't adamantine",condition_immunities:"charmed, exhaustion, frightened, paralyzed, petrified, poisoned",senses:"darkvision 120 ft., passive Perception 10",languages:"understands the languages of its creator but can't speak",cr:"16",traits:[{name:"Fire Absorption",desc:"Whenever the golem is subjected to fire damage, it takes no damage and instead regains a number of hit points equal to the fire damage dealt.",attack_bonus:0},{name:"Immutable Form",desc:"The golem is immune to any spell or effect that would alter its form.",attack_bonus:0},{name:"Magic Resistance",desc:"The golem has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Magic Weapons",desc:"The golem's weapon attacks are magical.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The golem makes two melee attacks.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +13 to hit, reach 5 ft., one target. Hit: 20 (3d8 + 7) bludgeoning damage.",attack_bonus:13,damage_dice:"3d8",damage_bonus:7},{name:"Sword",desc:"Melee Weapon Attack: +13 to hit, reach 10 ft., one target. Hit: 23 (3d10 + 7) slashing damage.",attack_bonus:13,damage_dice:"3d10",damage_bonus:7},{name:"Poison Breath (Recharge 5-6)",desc:"The golem exhales poisonous gas in a 15-foot cone. Each creature in that area must make a DC 19 Constitution saving throw, taking 45 (l0d8) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"10d8"}]},{name:"Jackal",size:"Small",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:3,hit_dice:"1d6 + -1",speed:"40 ft.",stats:[8,15,11,3,12,6],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"0",traits:[{name:"Keen Hearing and Smell",desc:"The jackal has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0},{name:"Pack Tactics",desc:"The jackal has advantage on an attack roll against a creature if at least one of the jackal's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +1 to hit, reach 5 ft., one target. Hit: 1 (1d4 \u2014 1) piercing damage.",attack_bonus:1,damage_dice:"1d4",damage_bonus:-1}]},{name:"Killer Whale",size:"Huge",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:90,hit_dice:"12d12 + 12",speed:"swim 60 ft.",stats:[19,10,13,3,12,7],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 120 ft., passive Perception 13",languages:"",cr:"3",traits:[{name:"Echolocation",desc:"The whale can't use its blindsight while deafened.",attack_bonus:0},{name:"Hold Breath",desc:"The whale can hold its breath for 30 minutes",attack_bonus:0},{name:"Keen Hearing",desc:"The whale has advantage on Wisdom (Perception) checks that rely on hearing.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 21 (5d6 + 4) piercing damage.",attack_bonus:0}]},{name:"Knight",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:18,hp:52,hit_dice:"8d8 + 16",speed:"30 ft.",stats:[16,11,14,11,11,15],saves:[{constitution:4},{wisdom:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"any one language (usually Common)",cr:"3",traits:[{name:"Brave",desc:"The knight has advantage on saving throws against being frightened.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The knight makes two melee attacks.",attack_bonus:0},{name:"Greatsword",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) slashing damage.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3},{name:"Heavy Crossbow",desc:"Ranged Weapon Attack: +2 to hit, range 100/400 ft., one target. Hit: 5 (1d10) piercing damage.",attack_bonus:2,damage_dice:"1d10"},{name:"Leadership (Recharges after a Short or Long Rest)",desc:"For 1 minute, the knight can utter a special command or warning whenever a nonhostile creature that it can see within 30 ft. of it makes an attack roll or a saving throw. The creature can add a d4 to its roll provided it can hear and understand the knight. A creature can benefit from only one Leadership die at a time. This effect ends if the knight is incapacitated.",attack_bonus:0}],reactions:[{name:"Parry",desc:"The knight adds 2 to its AC against one melee attack that would hit it. To do so, the knight must see the attacker and be wielding a melee weapon.",attack_bonus:0}]},{name:"Kobold",size:"Small",type:"humanoid",subtype:"kobold",alignment:"lawful evil",ac:12,hp:5,hit_dice:"2d6 + -2",speed:"30 ft.",stats:[7,15,9,8,7,8],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 8",languages:"Common, Draconic",cr:"1/8",traits:[{name:"Sunlight Sensitivity",desc:"While in sunlight, the kobold has disadvantage on attack rolls, as well as on Wisdom (Perception) checks that rely on sight.",attack_bonus:0},{name:"Pack Tactics",desc:"The kobold has advantage on an attack roll against a creature if at least one of the kobold's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Dagger",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 4 (1d4 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2},{name:"Sling",desc:"Ranged Weapon Attack: +4 to hit, range 30/120 ft., one target. Hit: 4 (1d4 + 2) bludgeoning damage.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}]},{name:"Kraken",size:"Gargantuan",type:"monstrosity",subtype:"titan",alignment:"chaotic evil",ac:18,hp:472,hit_dice:"27d20 + 188",speed:"20 ft., swim 60 ft.",stats:[30,11,25,22,18,20],saves:[{strength:17},{dexterity:7},{constitution:14},{intelligence:13},{wisdom:11}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning; bludgeoning, piercing, and slashing from nonmagical weapons",condition_immunities:"frightened, paralyzed",senses:"truesight 120 ft., passive Perception 14",languages:"understands Abyssal, Celestial, Infernal, and Primordial but can't speak, telepathy 120 ft.",cr:"23",traits:[{name:"Amphibious",desc:"The kraken can breathe air and water.",attack_bonus:0},{name:"Freedom of Movement",desc:"The kraken ignores difficult terrain, and magical effects can't reduce its speed or cause it to be restrained. It can spend 5 feet of movement to escape from nonmagical restraints or being grappled.",attack_bonus:0},{name:"Siege Monster",desc:"The kraken deals double damage to objects and structures.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The kraken makes three tentacle attacks, each of which it can replace with one use of Fling.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 23 (3d8 + 10) piercing damage. If the target is a Large or smaller creature grappled by the kraken, that creature is swallowed, and the grapple ends. While swallowed, the creature is blinded and restrained, it has total cover against attacks and other effects outside the kraken, and it takes 42 (12d6) acid damage at the start of each of the kraken's turns. If the kraken takes 50 damage or more on a single turn from a creature inside it, the kraken must succeed on a DC 25 Constitution saving throw at the end of that turn or regurgitate all swallowed creatures, which fall prone in a space within 10 feet of the kraken. If the kraken dies, a swallowed creature is no longer restrained by it and can escape from the corpse using 15 feet of movement, exiting prone.",attack_bonus:7,damage_dice:"3d8",damage_bonus:10},{name:"Tentacle",desc:"Melee Weapon Attack: +7 to hit, reach 30 ft., one target. Hit: 20 (3d6 + 10) bludgeoning damage, and the target is grappled (escape DC 18). Until this grapple ends, the target is restrained. The kraken has ten tentacles, each of which can grapple one target.",attack_bonus:7,damage_dice:"3d6",damage_bonus:10},{name:"Fling",desc:"One Large or smaller object held or creature grappled by the kraken is thrown up to 60 feet in a random direction and knocked prone. If a thrown target strikes a solid surface, the target takes 3 (1d6) bludgeoning damage for every 10 feet it was thrown. If the target is thrown at another creature, that creature must succeed on a DC 18 Dexterity saving throw or take the same damage and be knocked prone.",attack_bonus:0},{name:"Lightning Storm",desc:"The kraken magically creates three bolts of lightning, each of which can strike a target the kraken can see within 120 feet of it. A target must make a DC 23 Dexterity saving throw, taking 22 (4d10) lightning damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"4d10"}],legendary_actions:[{name:"Tentacle Attack or Fling",desc:"The kraken makes one tentacle attack or uses its Fling.",attack_bonus:0},{name:"Lightning Storm (Costs 2 Actions)",desc:"The kraken uses Lightning Storm.",attack_bonus:0},{name:"Ink Cloud (Costs 3 Actions)",desc:"While underwater, the kraken expels an ink cloud in a 60-foot radius. The cloud spreads around corners, and that area is heavily obscured to creatures other than the kraken. Each creature other than the kraken that ends its turn there must succeed on a DC 23 Constitution saving throw, taking 16 (3d10) poison damage on a failed save, or half as much damage on a successful one. A strong current disperses the cloud, which otherwise disappears at the end of the kraken's next turn.",attack_bonus:0}]},{name:"Lamia",size:"Large",type:"monstrosity",subtype:"",alignment:"chaotic evil",ac:13,hp:97,hit_dice:"13d10 + 25",speed:"30 ft.",stats:[16,13,15,14,15,16],skillsaves:[{deception:7},{insight:4},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 12",languages:"Abyssal, Common",cr:"4",traits:[{name:"Innate Spellcasting",desc:"The lamia's innate spellcasting ability is Charisma (spell save DC 13). It can innately cast the following spells, requiring no material components. At will: disguise self (any humanoid form), major image 3/day each: charm person, mirror image, scrying, suggestion 1/day: geas",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The lamia makes two attacks: one with its claws and one with its dagger or Intoxicating Touch.",attack_bonus:0},{name:"Claws",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 14 (2d10 + 3) slashing damage.",attack_bonus:5,damage_dice:"2d10",damage_bonus:3},{name:"Dagger",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 5 (1d4 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d4",damage_bonus:3},{name:"Intoxicating Touch",desc:"Melee Spell Attack: +5 to hit, reach 5 ft., one creature. Hit: The target is magically cursed for 1 hour. Until the curse ends, the target has disadvantage on Wisdom saving throws and all ability checks.",attack_bonus:0}]},{name:"Lemure",size:"Medium",type:"fiend",subtype:"devil",alignment:"lawful evil",ac:7,hp:13,hit_dice:"3d8 + -1",speed:"15 ft.",stats:[10,5,11,1,11,3],damage_vulnerabilities:"",damage_resistances:"cold",damage_immunities:"fire, poison",condition_immunities:"charmed, frightened, poisoned",senses:"darkvision 120 ft., passive Perception 10",languages:"understands infernal but can't speak",cr:"0",traits:[{name:"Devil's Sight",desc:"Magical darkness doesn't impede the lemure's darkvision.",attack_bonus:0},{name:"Hellish Rejuvenation",desc:"A lemure that dies in the Nine Hells comes back to life with all its hit points in 1d10 days unless it is killed by a good-aligned creature with a bless spell cast on that creature or its remains are sprinkled with holy water.",attack_bonus:0}],actions:[{name:"Fist",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 2 (1d4) bludgeoning damage",attack_bonus:3,damage_dice:"1d4"}]},{name:"Lich",size:"Medium",type:"undead",subtype:"",alignment:"any evil alignment",ac:17,hp:135,hit_dice:"18d8 + 54",speed:"30 ft.",stats:[11,16,16,20,14,16],saves:[{constitution:10},{intelligence:12},{wisdom:9}],skillsaves:[{arcana:18},{history:12},{insight:9},{perception:9}],damage_vulnerabilities:"",damage_resistances:"cold, lightning, necrotic",damage_immunities:"poison; bludgeoning, piercing, and slashing from nonmagical weapons",condition_immunities:"charmed, exhaustion, frightened, paralyzed, poisoned",senses:"truesight 120 ft., passive Perception 19",languages:"Common plus up to five other languages",cr:"21",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the lich fails a saving throw, it can choose to succeed instead.",attack_bonus:0},{name:"Rejuvenation",desc:"If it has a phylactery, a destroyed lich gains a new body in 1d10 days, regaining all its hit points and becoming active again. The new body appears within 5 feet of the phylactery.",attack_bonus:0},{name:"Turn Resistance",desc:"The lich has advantage on saving throws against any effect that turns undead.",attack_bonus:0}],actions:[{name:"Paralyzing Touch",desc:"Melee Spell Attack: +12 to hit, reach 5 ft., one creature. Hit: 10 (3d6) cold damage. The target must succeed on a DC 18 Constitution saving throw or be paralyzed for 1 minute. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:12,damage_dice:"3d6"}],legendary_actions:[{name:"Cantrip",desc:"The lich casts a cantrip.",attack_bonus:0},{name:"Paralyzing Touch (Costs 2 Actions)",desc:"The lich uses its Paralyzing Touch.",attack_bonus:0},{name:"Frightening Gaze (Costs 2 Actions)",desc:"The lich fixes its gaze on one creature it can see within 10 feet of it. The target must succeed on a DC 18 Wisdom saving throw against this magic or become frightened for 1 minute. The frightened target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a target's saving throw is successful or the effect ends for it, the target is immune to the lich's gaze for the next 24 hours.",attack_bonus:0},{name:"Disrupt Life (Costs 3 Actions)",desc:"Each living creature within 20 feet of the lich must make a DC 18 Constitution saving throw against this magic, taking 21 (6d6) necrotic damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"6d6"}],spells:["The lich is an 18th-level spellcaster. Its spellcasting ability is Intelligence (spell save DC 20, +12 to hit with spell attacks). The lich has the following wizard spells prepared:",{"Cantrips (at will)":"mage hand, prestidigitation, ray of frost"},{"1st level (4 slots)":"detect magic, magic missile, shield, thunderwave"},{"2nd level (3 slots)":"detect thoughts, invisibility, Melf's acid arrow, mirror image"},{"3rd level (3 slots)":"animate dead, counterspell, dispel magic, fireball"},{"4th level (3 slots)":"blight, dimension door"},{"5th level (3 slots)":"cloudkill, scrying"},{"6th level (1 slot)":"disintegrate, globe of invulnerability"},{"7th level (1 slot)":"finger of death, plane shift"},{"8th level (1 slot)":"dominate monster, power word stun"},{"9th level (1 slot)":"power word kill"}]},{name:"Lion",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:26,hit_dice:"4d10 + 4",speed:"50 ft.",stats:[17,15,13,3,12,8],skillsaves:[{perception:3},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"1",traits:[{name:"Keen Smell",desc:"The lion has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0},{name:"Pack Tactics",desc:"The lion has advantage on an attack roll against a creature if at least one of the lion's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0},{name:"Pounce",desc:"If the lion moves at least 20 ft. straight toward a creature and then hits it with a claw attack on the same turn, that target must succeed on a DC 13 Strength saving throw or be knocked prone. If the target is prone, the lion can make one bite attack against it as a bonus action.",attack_bonus:0},{name:"Running Leap",desc:"With a 10-foot running start, the lion can long jump up to 25 ft..",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d8",damage_bonus:3},{name:"Claw",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) slashing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3}]},{name:"Lizard",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:10,hp:2,hit_dice:"1d4 + -1",speed:"20 ft., climb 20 ft.",stats:[2,11,10,1,8,3],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 30 ft., passive Perception 9",languages:"",cr:"0",actions:[{name:"Bite",desc:"Melee Weapon Attack: +0 to hit, reach 5 ft., one target. Hit: 1 piercing damage.",attack_bonus:0,damage_bonus:1}]},{name:"Lizardfolk",size:"Medium",type:"humanoid",subtype:"lizardfolk",alignment:"neutral",ac:15,hp:22,hit_dice:"4d8 + 4",speed:"30 ft., swim 30 ft.",stats:[15,10,13,7,12,7],skillsaves:[{perception:3},{stealth:4},{survival:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"Draconic",cr:"1/2",traits:[{name:"Hold Breath",desc:"The lizardfolk can hold its breath for 15 minutes.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The lizardfolk makes two melee attacks, each one with a different weapon.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Heavy Club",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) bludgeoning damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Javelin",desc:"Melee or Ranged Weapon Attack: +4 to hit, reach 5 ft. or range 30/120 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Spiked Shield",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Mage",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:12,hp:40,hit_dice:"9d8 + -1",speed:"30 ft.",stats:[9,14,11,17,12,11],saves:[{intelligence:6},{wisdom:4}],skillsaves:[{arcana:6},{history:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 11",languages:"any four languages",cr:"6",traits:[],actions:[{name:"Dagger",desc:"Melee or Ranged Weapon Attack: +5 to hit, reach 5 ft. or range 20/60 ft., one target. Hit: 4 (1d4 + 2) piercing damage.",attack_bonus:5,damage_dice:"1d4",damage_bonus:2}],spells:["The mage is a 9th-level spellcaster. Its spellcasting ability is Intelligence (spell save DC 14, +6 to hit with spell attacks). The mage has the following wizard spells prepared:",{"Cantrips (at will)":"fire bolt, light, mage hand, prestidigitation"},{"1st level (4 slots)":"detect magic, mage armor, magic missile, shield"},{"2nd level (3 slots)":"misty step, suggestion"},{"3rd level (3 slots)":"counterspell, fireball, fly"},{"4th level (3 slots)":"greater invisibility, ice storm"},{"5th level (1 slot)":"cone of cold"}]},{name:"Magma Mephit",size:"Small",type:"elemental",subtype:"",alignment:"neutral evil",ac:11,hp:22,hit_dice:"5d6 + 4",speed:"30 ft., fly 30 ft.",stats:[8,12,12,7,10,10],skillsaves:[{stealth:3}],damage_vulnerabilities:"cold",damage_resistances:"",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 10",languages:"Ignan, Terran",cr:"1/2",traits:[{name:"Death Burst",desc:"When the mephit dies, it explodes in a burst of lava. Each creature within 5 ft. of it must make a DC 11 Dexterity saving throw, taking 7 (2d6) fire damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"2d6"},{name:"False Appearance",desc:"While the mephit remains motionless, it is indistinguishable from an ordinary mound of magma.",attack_bonus:0},{name:"Innate Spellcasting (1/Day)",desc:"The mephit can innately cast heat metal (spell save DC 10), requiring no material components. Its innate spellcasting ability is Charisma.",attack_bonus:0}],actions:[{name:"Claws",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft ., one creature. Hit: 3 (1d4 + 1) slashing damage plus 2 (1d4) fire damage.",attack_bonus:3,damage_dice:"1d4",damage_bonus:1},{name:"Fire Breath (Recharge 6)",desc:"The mephit exhales a 15-foot cone of fire. Each creature in that area must make a DC 11 Dexterity saving throw, taking 7 (2d6) fire damage on a failed save, or half as much damage on a successful one.",attack_bonus:0},{name:"Variant: Summon Mephits (1/Day)",desc:"The mephit has a 25 percent chance of summoning 1d4 mephits of its kind. A summoned mephit appears in an unoccupied space within 60 feet of its summoner, acts as an ally of its summoner, and can't summon other mephits. It remains for 1 minute, until it or its summoner dies, or until its summoner dismisses it as an action.",attack_bonus:0}]},{name:"Magmin",size:"Small",type:"elemental",subtype:"",alignment:"chaotic neutral",ac:14,hp:9,hit_dice:"2d6 + 2",speed:"30 ft.",stats:[7,15,12,8,11,10],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"fire",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 10",languages:"Ignan",cr:"1/2",traits:[{name:"Death Burst",desc:"When the magmin dies, it explodes in a burst of fire and magma. Each creature within 10 ft. of it must make a DC 11 Dexterity saving throw, taking 7 (2d6) fire damage on a failed save, or half as much damage on a successful one. Flammable objects that aren't being worn or carried in that area are ignited.",attack_bonus:0,damage_dice:"2d6"},{name:"Ignited Illumination",desc:"As a bonus action, the magmin can set itself ablaze or extinguish its flames. While ablaze, the magmin sheds bright light in a 10-foot radius and dim light for an additional 10 ft.",attack_bonus:0}],actions:[{name:"Touch",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (2d6) fire damage. If the target is a creature or a flammable object, it ignites. Until a target takes an action to douse the fire, the target takes 3 (1d6) fire damage at the end of each of its turns.",attack_bonus:4,damage_dice:"2d6"}]},{name:"Mammoth",size:"Huge",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:126,hit_dice:"11d12 + 54",speed:"40 ft.",stats:[24,9,21,3,11,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"6",traits:[{name:"Trampling Charge",desc:"If the mammoth moves at least 20 ft. straight toward a creature and then hits it with a gore attack on the same turn, that target must succeed on a DC 18 Strength saving throw or be knocked prone. If the target is prone, the mammoth can make one stomp attack against it as a bonus action.",attack_bonus:0}],actions:[{name:"Gore",desc:"Melee Weapon Attack: +10 to hit, reach 10 ft., one target. Hit: 25 (4d8 + 7) piercing damage.",attack_bonus:10,damage_dice:"4d8",damage_bonus:7},{name:"Stomp",desc:"Melee Weapon Attack: +10 to hit, reach 5 ft., one prone creature. Hit: 29 (4d10 + 7) bludgeoning damage.",attack_bonus:10,damage_dice:"4d10",damage_bonus:7}]},{name:"Manticore",size:"Large",type:"monstrosity",subtype:"",alignment:"lawful evil",ac:14,hp:68,hit_dice:"8d10 + 24",speed:"30 ft., fly 50 ft.",stats:[17,16,17,7,12,8],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 11",languages:"",cr:"3",traits:[{name:"Tail Spike Regrowth",desc:"The manticore has twenty-four tail spikes. Used spikes regrow when the manticore finishes a long rest.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The manticore makes three attacks: one with its bite and two with its claws or three with its tail spikes.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d8",damage_bonus:3},{name:"Claw",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) slashing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3},{name:"Tail Spike",desc:"Ranged Weapon Attack: +5 to hit, range 100/200 ft., one target. Hit: 7 (1d8 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d8",damage_bonus:3}]},{name:"Marilith",size:"Large",type:"fiend",subtype:"demon",alignment:"chaotic evil",ac:18,hp:189,hit_dice:"18d10 + 90",speed:"40 ft.",stats:[18,20,20,18,16,20],saves:[{strength:9},{constitution:10},{wisdom:8},{charisma:10}],damage_vulnerabilities:"",damage_resistances:"cold, fire, lightning; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"poison",condition_immunities:"poisoned",senses:"truesight 120 ft., passive Perception 13",languages:"Abyssal, telepathy 120 ft.",cr:"16",traits:[{name:"Magic Resistance",desc:"The marilith has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Magic Weapons",desc:"The marilith's weapon attacks are magical.",attack_bonus:0},{name:"Reactive",desc:"The marilith can take one reaction on every turn in combat.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The marilith can make seven attacks: six with its longswords and one with its tail.",attack_bonus:0},{name:"Longsword",desc:"Melee Weapon Attack: +9 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) slashing damage.",attack_bonus:9,damage_dice:"2d8",damage_bonus:4},{name:"Tail",desc:"Melee Weapon Attack: +9 to hit, reach 10 ft., one creature. Hit: 15 (2d10 + 4) bludgeoning damage. If the target is Medium or smaller, it is grappled (escape DC 19). Until this grapple ends, the target is restrained, the marilith can automatically hit the target with its tail, and the marilith can't make tail attacks against other targets.",attack_bonus:9,damage_dice:"2d10",damage_bonus:4},{name:"Teleport",desc:"The marilith magically teleports, along with any equipment it is wearing or carrying, up to 120 feet to an unoccupied space it can see.",attack_bonus:0},{name:"Variant: Summon Demon (1/Day)",desc:"The demon chooses what to summon and attempts a magical summoning.\\nA marilith has a 50 percent chance of summoning 1d6 vrocks, 1d4 hezrous, 1d3 glabrezus, 1d2 nalfeshnees, or one marilith.\\nA summoned demon appears in an unoccupied space within 60 feet of its summoner, acts as an ally of its summoner, and can't summon other demons. It remains for 1 minute, until it or its summoner dies, or until its summoner dismisses it as an action.",attack_bonus:0}],reactions:[{name:"Parry",desc:"The marilith adds 5 to its AC against one melee attack that would hit it. To do so, the marilith must see the attacker and be wielding a melee weapon.",attack_bonus:0}]},{name:"Mastiff",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:5,hit_dice:"1d8",speed:"40 ft.",stats:[13,14,12,3,12,7],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"1/8",traits:[{name:"Keen Hearing and Smell",desc:"The mastiff has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 4 (1d6 + 1) piercing damage. If the target is a creature, it must succeed on a DC 11 Strength saving throw or be knocked prone.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1}]},{name:"Medusa",size:"Medium",type:"monstrosity",subtype:"",alignment:"lawful evil",ac:15,hp:127,hit_dice:"17d8 + 50",speed:"30 ft.",stats:[10,15,16,12,13,15],skillsaves:[{deception:5},{insight:4},{perception:4},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 14",languages:"Common",cr:"6",traits:[{name:"Petrifying Gaze",desc:"When a creature that can see the medusa's eyes starts its turn within 30 ft. of the medusa, the medusa can force it to make a DC 14 Constitution saving throw if the medusa isn't incapacitated and can see the creature. If the saving throw fails by 5 or more, the creature is instantly petrified. Otherwise, a creature that fails the save begins to turn to stone and is restrained. The restrained creature must repeat the saving throw at the end of its next turn, becoming petrified on a failure or ending the effect on a success. The petrification lasts until the creature is freed by the greater restoration spell or other magic.\\nUnless surprised, a creature can avert its eyes to avoid the saving throw at the start of its turn. If the creature does so, it can't see the medusa until the start of its next turn, when it can avert its eyes again. If the creature looks at the medusa in the meantime, it must immediately make the save.\\nIf the medusa sees itself reflected on a polished surface within 30 ft. of it and in an area of bright light, the medusa is, due to its curse, affected by its own gaze.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The medusa makes either three melee attacks \u2014 one with its snake hair and two with its shortsword \u2014 or two ranged attacks with its longbow.",attack_bonus:0},{name:"Snake Hair",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one creature. Hit: 4 (1d4 + 2) piercing damage plus 14 (4d6) poison damage.",attack_bonus:5,damage_dice:"1d4",damage_bonus:2},{name:"Shortsword",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:2},{name:"Longbow",desc:"Ranged Weapon Attack: +5 to hit, range 150/600 ft., one target. Hit: 6 (1d8 + 2) piercing damage plus 7 (2d6) poison damage.",attack_bonus:5,damage_dice:"2d6"}]},{name:"Merfolk",size:"Medium",type:"humanoid",subtype:"merfolk",alignment:"neutral",ac:11,hp:11,hit_dice:"2d8 + 2",speed:"10 ft., swim 40 ft.",stats:[10,13,12,11,11,12],skillsaves:[{perception:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 12",languages:"Aquan, Common",cr:"1/8",traits:[{name:"Amphibious",desc:"The merfolk can breathe air and water.",attack_bonus:0}],actions:[{name:"Spear",desc:"Melee or Ranged Weapon Attack: +2 to hit, reach 5 ft. or range 20/60 ft., one target. Hit: 3 (1d6) piercing damage, or 4 (1d8) piercing damage if used with two hands to make a melee attack.",attack_bonus:2,damage_dice:"1d6"}]},{name:"Merrow",size:"Large",type:"monstrosity",subtype:"",alignment:"chaotic evil",ac:13,hp:45,hit_dice:"6d10 + 12",speed:"10 ft., swim 40 ft.",stats:[18,10,15,8,10,9],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 10",languages:"Abyssal, Aquan",cr:"2",traits:[{name:"Amphibious",desc:"The merrow can breathe air and water.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The merrow makes two attacks: one with its bite and one with its claws or harpoon.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 8 (1d8 + 4) piercing damage.",attack_bonus:6,damage_dice:"1d8",damage_bonus:4},{name:"Claws",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 9 (2d4 + 4) slashing damage.",attack_bonus:6,damage_dice:"2d4",damage_bonus:4},{name:"Harpoon",desc:"Melee or Ranged Weapon Attack: +6 to hit, reach 5 ft. or range 20/60 ft., one target. Hit: 11 (2d6 + 4) piercing damage. If the target is a Huge or smaller creature, it must succeed on a Strength contest against the merrow or be pulled up to 20 feet toward the merrow.",attack_bonus:6,damage_dice:"2d6",damage_bonus:4}]},{name:"Mimic",size:"Medium",type:"monstrosity",subtype:"shapechanger",alignment:"neutral",ac:12,hp:58,hit_dice:"9d8 + 17",speed:"15 ft.",stats:[17,12,15,5,13,8],skillsaves:[{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"acid",condition_immunities:"prone",senses:"darkvision 60 ft., passive Perception 11",languages:"",cr:"2",traits:[{name:"Shapechanger",desc:"The mimic can use its action to polymorph into an object or back into its true, amorphous form. Its statistics are the same in each form. Any equipment it is wearing or carrying isn 't transformed. It reverts to its true form if it dies.",attack_bonus:0},{name:"Adhesive (Object Form Only)",desc:"The mimic adheres to anything that touches it. A Huge or smaller creature adhered to the mimic is also grappled by it (escape DC 13). Ability checks made to escape this grapple have disadvantage.",attack_bonus:0},{name:"False Appearance (Object Form Only)",desc:"While the mimic remains motionless, it is indistinguishable from an ordinary object.",attack_bonus:0},{name:"Grappler",desc:"The mimic has advantage on attack rolls against any creature grappled by it.",attack_bonus:0}],actions:[{name:"Pseudopod",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) bludgeoning damage. If the mimic is in object form, the target is subjected to its Adhesive trait.",attack_bonus:5,damage_dice:"1d8",damage_bonus:3},{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) piercing damage plus 4 (1d8) acid damage.",attack_bonus:5,damage_dice:"1d8 + 1d8",damage_bonus:3}]},{name:"Minotaur",size:"Large",type:"monstrosity",subtype:"",alignment:"chaotic evil",ac:14,hp:76,hit_dice:"9d10 + 26",speed:"40 ft.",stats:[18,11,16,6,16,9],skillsaves:[{perception:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 17",languages:"Abyssal",cr:"3",traits:[{name:"Charge",desc:"If the minotaur moves at least 10 ft. straight toward a target and then hits it with a gore attack on the same turn, the target takes an extra 9 (2d8) piercing damage. If the target is a creature, it must succeed on a DC 14 Strength saving throw or be pushed up to 10 ft. away and knocked prone.",attack_bonus:0,damage_dice:"2d8"},{name:"Labyrinthine Recall",desc:"The minotaur can perfectly recall any path it has traveled.",attack_bonus:0},{name:"Reckless",desc:"At the start of its turn, the minotaur can gain advantage on all melee weapon attack rolls it makes during that turn, but attack rolls against it have advantage until the start of its next turn.",attack_bonus:0}],actions:[{name:"Greataxe",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 17 (2d12 + 4) slashing damage.",attack_bonus:6,damage_dice:"2d12",damage_bonus:4},{name:"Gore",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) piercing damage.",attack_bonus:6,damage_dice:"2d8",damage_bonus:4}]},{name:"Minotaur Skeleton",size:"Large",type:"undead",subtype:"",alignment:"lawful evil",ac:12,hp:67,hit_dice:"9d10 + 17",speed:"40 ft.",stats:[18,11,15,6,8,5],damage_vulnerabilities:"bludgeoning",damage_resistances:"",damage_immunities:"poison",condition_immunities:"exhaustion, poisoned",senses:"darkvision 60 ft., passive Perception 9",languages:"understands Abyssal but can't speak",cr:"2",traits:[{name:"Charge",desc:"If the skeleton moves at least 10 feet straight toward a target and then hits it with a gore attack on the same turn, the target takes an extra 9 (2d8) piercing damage. If the target is a creature, it must succeed on a DC 14 Strength saving throw or be pushed up to 10 feet away and knocked prone.",attack_bonus:0,damage_dice:"2d8"}],actions:[{name:"Greataxe",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 17 (2d12 + 4) slashing damage.",attack_bonus:6,damage_dice:"2d12",damage_bonus:4},{name:"Gore",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) piercing damage.",attack_bonus:6,damage_dice:"2d8",damage_bonus:4}]},{name:"Mule",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:10,hp:11,hit_dice:"2d8 + 2",speed:"40 ft.",stats:[14,10,13,2,10,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"1/8",traits:[{name:"Beast of Burden",desc:"The mule is considered to be a Large animal for the purpose of determining its carrying capacity.",attack_bonus:0},{name:"Sure-Footed",desc:"The mule has advantage on Strength and Dexterity saving throws made against effects that would knock it prone.",attack_bonus:0}],actions:[{name:"Hooves",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one target. Hit: 4 (1d4 + 2) bludgeoning damage.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}]},{name:"Mummy",size:"Medium",type:"undead",subtype:"",alignment:"lawful evil",ac:11,hp:58,hit_dice:"9d8 + 17",speed:"20 ft.",stats:[16,8,15,6,10,12],saves:[{wisdom:2}],damage_vulnerabilities:"fire",damage_resistances:"",damage_immunities:"bludgeoning, piercing, and slashing from nonmagical weapons",condition_immunities:"necrotic, poisoned",senses:"darkvision 60 ft., passive Perception 10",languages:"the languages it knew in life",cr:"3",actions:[{name:"Multiattack",desc:"The mummy can use its Dreadful Glare and makes one attack with its rotting fist.",attack_bonus:0},{name:"Rotting Fist",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) bludgeoning damage plus 10 (3d6) necrotic damage. If the target is a creature, it must succeed on a DC 12 Constitution saving throw or be cursed with mummy rot. The cursed target can't regain hit points, and its hit point maximum decreases by 10 (3d6) for every 24 hours that elapse. If the curse reduces the target's hit point maximum to 0, the target dies, and its body turns to dust. The curse lasts until removed by the remove curse spell or other magic.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3},{name:"Dreadful Glare",desc:"The mummy targets one creature it can see within 60 ft. of it. If the target can see the mummy, it must succeed on a DC 11 Wisdom saving throw against this magic or become frightened until the end of the mummy's next turn. If the target fails the saving throw by 5 or more, it is also paralyzed for the same duration. A target that succeeds on the saving throw is immune to the Dreadful Glare of all mummies (but not mummy lords) for the next 24 hours.",attack_bonus:0}]},{name:"Mummy Lord",size:"Medium",type:"undead",subtype:"",alignment:"lawful evil",ac:17,hp:97,hit_dice:"13d8 + 38",speed:"20 ft.",stats:[18,10,17,11,18,16],saves:[{constitution:8},{intelligence:5},{wisdom:9},{charisma:8}],skillsaves:[{history:5},{religion:5}],damage_vulnerabilities:"bludgeoning",damage_resistances:"",damage_immunities:"necrotic, poison; bludgeoning, piercing, and slashing from nonmagical weapons",condition_immunities:"charmed, exhaustion, frightened, paralyzed, poisoned",senses:"darkvision 60 ft., passive Perception 14",languages:"the languages it knew in life",cr:"15",traits:[{name:"Magic Resistance",desc:"The mummy lord has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Rejuvenation",desc:"A destroyed mummy lord gains a new body in 24 hours if its heart is intact, regaining all its hit points and becoming active again. The new body appears within 5 feet of the mummy lord's heart.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The mummy can use its Dreadful Glare and makes one attack with its rotting fist.",attack_bonus:0},{name:"Rotting Fist",desc:"Melee Weapon Attack: +9 to hit, reach 5 ft., one target. Hit: 14 (3d6 + 4) bludgeoning damage plus 21 (6d6) necrotic damage. If the target is a creature, it must succeed on a DC 16 Constitution saving throw or be cursed with mummy rot. The cursed target can't regain hit points, and its hit point maximum decreases by 10 (3d6) for every 24 hours that elapse. If the curse reduces the target's hit point maximum to 0, the target dies, and its body turns to dust. The curse lasts until removed by the remove curse spell or other magic.",attack_bonus:9,damage_dice:"3d6 + 6d6",damage_bonus:4},{name:"Dreadful Glare",desc:"The mummy lord targets one creature it can see within 60 feet of it. If the target can see the mummy lord, it must succeed on a DC 16 Wisdom saving throw against this magic or become frightened until the end of the mummy's next turn. If the target fails the saving throw by 5 or more, it is also paralyzed for the same duration. A target that succeeds on the saving throw is immune to the Dreadful Glare of all mummies and mummy lords for the next 24 hours.",attack_bonus:0}],legendary_actions:[{name:"Attack",desc:"The mummy lord makes one attack with its rotting fist or uses its Dreadful Glare.",attack_bonus:0},{name:"Blinding Dust",desc:"Blinding dust and sand swirls magically around the mummy lord. Each creature within 5 feet of the mummy lord must succeed on a DC 16 Constitution saving throw or be blinded until the end of the creature's next turn.",attack_bonus:0},{name:"Blasphemous Word (Costs 2 Actions)",desc:"The mummy lord utters a blasphemous word. Each non-undead creature within 10 feet of the mummy lord that can hear the magical utterance must succeed on a DC 16 Constitution saving throw or be stunned until the end of the mummy lord's next turn.",attack_bonus:0},{name:"Channel Negative Energy (Costs 2 Actions)",desc:"The mummy lord magically unleashes negative energy. Creatures within 60 feet of the mummy lord, including ones behind barriers and around corners, can't regain hit points until the end of the mummy lord's next turn.",attack_bonus:0},{name:"Whirlwind of Sand (Costs 2 Actions)",desc:"The mummy lord magically transforms into a whirlwind of sand, moves up to 60 feet, and reverts to its normal form. While in whirlwind form, the mummy lord is immune to all damage, and it can't be grappled, petrified, knocked prone, restrained, or stunned. Equipment worn or carried by the mummy lord remain in its possession.",attack_bonus:0}],spells:["The mummy lord is a 10th-level spellcaster. Its spellcasting ability is Wisdom (spell save DC 17, +9 to hit with spell attacks). The mummy lord has the following cleric spells prepared:",{"Cantrips (at will)":"sacred flame, thaumaturgy"},{"1st level (4 slots)":"command, guiding bolt, shield of faith"},{"2nd level (3 slots)":"hold person, silence, spiritual weapon"},{"3rd level (3 slots)":"animate dead, dispel magic"},{"4th level (3 slots)":"divination, guardian of faith"},{"5th level (2 slots)":"contagion, insect plague"},{"6th level (1 slot)":"harm"}]},{name:"Nalfeshnee",size:"Large",type:"fiend",subtype:"demon",alignment:"chaotic evil",ac:18,hp:184,hit_dice:"16d10 + 96",speed:"20 ft., fly 30 ft.",stats:[21,10,22,19,12,15],saves:[{constitution:11},{intelligence:9},{wisdom:6},{charisma:7}],damage_vulnerabilities:"",damage_resistances:"cold, fire, lightning; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"poison",condition_immunities:"poisoned",senses:"truesight 120 ft., passive Perception 11",languages:"Abyssal, telepathy 120 ft.",cr:"13",traits:[{name:"Magic Resistance",desc:"The nalfeshnee has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The nalfeshnee uses Horror Nimbus if it can. It then makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +10 to hit, reach 5 ft., one target. Hit: 32 (5d10 + 5) piercing damage.",attack_bonus:10,damage_dice:"5d10",damage_bonus:5},{name:"Claw",desc:"Melee Weapon Attack: +10 to hit, reach 10 ft., one target. Hit: 15 (3d6 + 5) slashing damage.",attack_bonus:10,damage_dice:"3d6",damage_bonus:5},{name:"Horror Nimbus (Recharge 5-6)",desc:"The nalfeshnee magically emits scintillating, multicolored light. Each creature within 15 feet of the nalfeshnee that can see the light must succeed on a DC 15 Wisdom saving throw or be frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the nalfeshnee's Horror Nimbus for the next 24 hours.",attack_bonus:0},{name:"Teleport",desc:"The nalfeshnee magically teleports, along with any equipment it is wearing or carrying, up to 120 feet to an unoccupied space it can see.",attack_bonus:0},{name:"Variant: Summon Demon (1/Day)",desc:"The demon chooses what to summon and attempts a magical summoning.\\nA nalfeshnee has a 50 percent chance of summoning 1d4 vrocks, 1d3 hezrous, 1d2 glabrezus, or one nalfeshnee.\\nA summoned demon appears in an unoccupied space within 60 feet of its summoner, acts as an ally of its summoner, and can't summon other demons. It remains for 1 minute, until it or its summoner dies, or until its summoner dismisses it as an action.",attack_bonus:0}]},{name:"Night Hag",size:"Medium",type:"fiend",subtype:"",alignment:"neutral evil",ac:17,hp:112,hit_dice:"15d8 + 44",speed:"30 ft.",stats:[18,15,16,16,14,16],skillsaves:[{deception:7},{insight:6},{perception:6},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"cold, fire; bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered",damage_immunities:"",condition_immunities:"charmed",senses:"darkvision 120 ft., passive Perception 16",languages:"Abyssal, Common, Infernal, Primordial",cr:"5",traits:[{name:"Innate Spellcasting",desc:"The hag's innate spellcasting ability is Charisma (spell save DC 14, +6 to hit with spell attacks). She can innately cast the following spells, requiring no material components:\\n\\nAt will: detect magic, magic missile\\n2/day each: plane shift (self only), ray of enfeeblement, sleep",attack_bonus:0},{name:"Magic Resistance",desc:"The hag has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Night Hag Items",desc:"A night hag carries two very rare magic items that she must craft for herself If either object is lost, the night hag will go to great lengths to retrieve it, as creating a new tool takes time and effort.\\nHeartstone: This lustrous black gem allows a night hag to become ethereal while it is in her possession. The touch of a heartstone also cures any disease. Crafting a heartstone takes 30 days.\\nSoul Bag: When an evil humanoid dies as a result of a night hag's Nightmare Haunting, the hag catches the soul in this black sack made of stitched flesh. A soul bag can hold only one evil soul at a time, and only the night hag who crafted the bag can catch a soul with it. Crafting a soul bag takes 7 days and a humanoid sacrifice (whose flesh is used to make the bag).",attack_bonus:0},{name:"Hag Coven",desc:"When hags must work together, they form covens, in spite of their selfish natures. A coven is made up of hags of any type, all of whom are equals within the group. However, each of the hags continues to desire more personal power.\\nA coven consists of three hags so that any arguments between two hags can be settled by the third. If more than three hags ever come together, as might happen if two covens come into conflict, the result is usually chaos.",attack_bonus:0},{name:"Shared Spellcasting (Coven Only)",desc:"While all three members of a hag coven are within 30 feet of one another, they can each cast the following spells from the wizard's spell list but must share the spell slots among themselves:\\n\\n\u2022 1st level (4 slots): identify, ray of sickness\\n\u2022 2nd level (3 slots): hold person, locate object\\n\u2022 3rd level (3 slots): bestow curse, counterspell, lightning bolt\\n\u2022 4th level (3 slots): phantasmal killer, polymorph\\n\u2022 5th level (2 slots): contact other plane, scrying\\n\u2022 6th level (1 slot): eye bite\\n\\nFor casting these spells, each hag is a 12th-level spellcaster that uses Intelligence as her spellcasting ability. The spell save DC is 12+the hag's Intelligence modifier, and the spell attack bonus is 4+the hag's Intelligence modifier.",attack_bonus:0},{name:"Hag Eye (Coven Only)",desc:"A hag coven can craft a magic item called a hag eye, which is made from a real eye coated in varnish and often fitted to a pendant or other wearable item. The hag eye is usually entrusted to a minion for safekeeping and transport. A hag in the coven can take an action to see what the hag eye sees if the hag eye is on the same plane of existence. A hag eye has AC 10, 1 hit point, and darkvision with a radius of 60 feet. If it is destroyed, each coven member takes 3d10 psychic damage and is blinded for 24 hours.\\nA hag coven can have only one hag eye at a time, and creating a new one requires all three members of the coven to perform a ritual. The ritual takes 1 hour, and the hags can't perform it while blinded. During the ritual, if the hags take any action other than performing the ritual, they must start over.",attack_bonus:0}],actions:[{name:"Claws (Hag Form Only)",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) slashing damage.",attack_bonus:7,damage_dice:"2d8",damage_bonus:4},{name:"Change Shape",desc:"The hag magically polymorphs into a Small or Medium female humanoid, or back into her true form. Her statistics are the same in each form. Any equipment she is wearing or carrying isn't transformed. She reverts to her true form if she dies.",attack_bonus:0},{name:"Etherealness",desc:"The hag magically enters the Ethereal Plane from the Material Plane, or vice versa. To do so, the hag must have a heartstone in her possession.",attack_bonus:0},{name:"Nightmare Haunting (1/Day)",desc:"While on the Ethereal Plane, the hag magically touches a sleeping humanoid on the Material Plane. A protection from evil and good spell cast on the target prevents this contact, as does a magic circle. As long as the contact persists, the target has dreadful visions. If these visions last for at least 1 hour, the target gains no benefit from its rest, and its hit point maximum is reduced by 5 (1d10). If this effect reduces the target's hit point maximum to 0, the target dies, and if the target was evil, its soul is trapped in the hag's soul bag. The reduction to the target's hit point maximum lasts until removed by the greater restoration spell or similar magic.",attack_bonus:0}]},{name:"Nightmare",size:"Large",type:"fiend",subtype:"",alignment:"neutral evil",ac:13,hp:68,hit_dice:"8d10 + 24",speed:"60 ft., fly 90 ft.",stats:[18,15,16,10,13,15],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"passive Perception 11",languages:"understands Abyssal, Common, and Infernal but can't speak",cr:"3",traits:[{name:"Confer Fire Resistance",desc:"The nightmare can grant resistance to fire damage to anyone riding it.",attack_bonus:0},{name:"Illumination",desc:"The nightmare sheds bright light in a 10-foot radius and dim light for an additional 10 feet.",attack_bonus:0}],actions:[{name:"Hooves",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) bludgeoning damage plus 7 (2d6) fire damage.",attack_bonus:6,damage_dice:"2d8 + 2d6",damage_bonus:4},{name:"Ethereal Stride",desc:"The nightmare and up to three willing creatures within 5 feet of it magically enter the Ethereal Plane from the Material Plane, or vice versa.",attack_bonus:0}]},{name:"Noble",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:15,hp:9,hit_dice:"2d8",speed:"30 ft.",stats:[11,12,11,12,14,16],skillsaves:[{deception:5},{insight:4},{persuasion:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 12",languages:"any two languages",cr:"1/8",actions:[{name:"Rapier",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 5 (1d8 + 1) piercing damage.",attack_bonus:3,damage_dice:"1d8",damage_bonus:1}],reactions:[{name:"Parry",desc:"The noble adds 2 to its AC against one melee attack that would hit it. To do so, the noble must see the attacker and be wielding a melee weapon.",attack_bonus:0}]},{name:"Ochre Jelly",size:"Large",type:"ooze",subtype:"",alignment:"unaligned",ac:8,hp:45,hit_dice:"6d10 + 12",speed:"10 ft., climb 10 ft.",stats:[15,6,14,2,6,1],damage_vulnerabilities:"",damage_resistances:"acid",damage_immunities:"lightning, slashing",condition_immunities:"blinded, charmed, deafened, exhaustion, frightened, prone",senses:"blindsight 60 ft. (blind beyond this radius), passive Perception 8",languages:"",cr:"2",traits:[{name:"Amorphous",desc:"The jelly can move through a space as narrow as 1 inch wide without squeezing.",attack_bonus:0},{name:"Spider Climb",desc:"The jelly can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0}],actions:[{name:"Pseudopod",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 9 (2d6 + 2) bludgeoning damage plus 3 (1d6) acid damage.",attack_bonus:4,damage_dice:"2d6",damage_bonus:2}],reactions:[{name:"Split",desc:"When a jelly that is Medium or larger is subjected to lightning or slashing damage, it splits into two new jellies if it has at least 10 hit points. Each new jelly has hit points equal to half the original jelly's, rounded down. New jellies are one size smaller than the original jelly.",attack_bonus:0}]},{name:"Octopus",size:"Small",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:3,hit_dice:"1d6 + -1",speed:"5 ft., swim 30 ft.",stats:[4,15,11,3,10,4],skillsaves:[{perception:2},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 30 ft., passive Perception 12",languages:"",cr:"0",traits:[{name:"Hold Breath",desc:"While out of water, the octopus can hold its breath for 30 minutes.",attack_bonus:0},{name:"Underwater Camouflage",desc:"The octopus has advantage on Dexterity (Stealth) checks made while underwater.",attack_bonus:0},{name:"Water Breathing",desc:"The octopus can breathe only underwater.",attack_bonus:0}],actions:[{name:"Tentacles",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 1 bludgeoning damage, and the target is grappled (escape DC 10). Until this grapple ends, the octopus can't use its tentacles on another target.",attack_bonus:4,damage_bonus:1},{name:"Ink Cloud (Recharges after a Short or Long Rest)",desc:"A 5-foot-radius cloud of ink extends all around the octopus if it is underwater. The area is heavily obscured for 1 minute, although a significant current can disperse the ink. After releasing the ink, the octopus can use the Dash action as a bonus action.",attack_bonus:0}]},{name:"Ogre",size:"Large",type:"giant",subtype:"",alignment:"chaotic evil",ac:11,hp:59,hit_dice:"7d10 + 20",speed:"40 ft.",stats:[19,8,16,5,7,7],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 8",languages:"Common, Giant",cr:"2",actions:[{name:"Greatclub",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) bludgeoning damage.",attack_bonus:6,damage_dice:"2d8",damage_bonus:4},{name:"Javelin",desc:"Melee or Ranged Weapon Attack: +6 to hit, reach 5 ft. or range 30/120 ft., one target. Hit: 11 (2d6 + 4) piercing damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:4}]},{name:"Ogre Zombie",size:"Large",type:"undead",subtype:"",alignment:"neutral evil",ac:8,hp:85,hit_dice:"9d10 + 35",speed:"30 ft.",stats:[19,6,18,3,6,5],saves:[{wisdom:0}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 8",languages:"understands Common and Giant but can't speak",cr:"2",traits:[{name:"Undead Fortitude",desc:"If damage reduces the zombie to 0 hit points, it must make a Constitution saving throw with a DC of 5+the damage taken, unless the damage is radiant or from a critical hit. On a success, the zombie drops to 1 hit point instead.",attack_bonus:0}],actions:[{name:"Morningstar",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) bludgeoning damage.",attack_bonus:6,damage_dice:"2d8",damage_bonus:4}]},{name:"Oni",size:"Large",type:"giant",subtype:"",alignment:"lawful evil",ac:16,hp:110,hit_dice:"13d10 + 38",speed:"30 ft., fly 30 ft.",stats:[19,11,16,14,12,15],saves:[{dexterity:3},{constitution:6},{wisdom:4},{charisma:5}],skillsaves:[{arcana:5},{deception:8},{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 14",languages:"Common, Giant",cr:"7",traits:[{name:"Innate Spellcasting",desc:"The oni's innate spellcasting ability is Charisma (spell save DC 13). The oni can innately cast the following spells, requiring no material components:\\n\\nAt will: darkness, invisibility\\n1/day each: charm person, cone of cold, gaseous form, sleep",attack_bonus:0},{name:"Magic Weapons",desc:"The oni's weapon attacks are magical.",attack_bonus:0},{name:"Regeneration",desc:"The oni regains 10 hit points at the start of its turn if it has at least 1 hit point.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The oni makes two attacks, either with its claws or its glaive.",attack_bonus:0},{name:"Claw (Oni Form Only)",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 8 (1d8 + 4) slashing damage.",attack_bonus:7,damage_dice:"1d8",damage_bonus:4},{name:"Glaive",desc:"Melee Weapon Attack: +7 to hit, reach 10 ft., one target. Hit: 15 (2d10 + 4) slashing damage, or 9 (1d10 + 4) slashing damage in Small or Medium form.",attack_bonus:7,damage_dice:"2d10",damage_bonus:4},{name:"Change Shape",desc:"The oni magically polymorphs into a Small or Medium humanoid, into a Large giant, or back into its true form. Other than its size, its statistics are the same in each form. The only equipment that is transformed is its glaive, which shrinks so that it can be wielded in humanoid form. If the oni dies, it reverts to its true form, and its glaive reverts to its normal size.",attack_bonus:0}]},{name:"Orc",size:"Medium",type:"humanoid",subtype:"orc",alignment:"chaotic evil",ac:13,hp:15,hit_dice:"2d8 + 6",speed:"30 ft.",stats:[16,12,16,7,11,10],skillsaves:[{intimidation:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 10",languages:"Common, Orc",cr:"1/2",traits:[{name:"Aggressive",desc:"As a bonus action, the orc can move up to its speed toward a hostile creature that it can see.",attack_bonus:0}],actions:[{name:"Greataxe",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 9 (1d12 + 3) slashing damage.",attack_bonus:5,damage_dice:"1d12",damage_bonus:3},{name:"Javelin",desc:"Melee or Ranged Weapon Attack: +5 to hit, reach 5 ft. or range 30/120 ft., one target. Hit: 6 (1d6 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3}]},{name:"Otyugh",size:"Large",type:"aberration",subtype:"",alignment:"neutral",ac:14,hp:114,hit_dice:"12d10 + 48",speed:"30 ft.",stats:[16,11,19,6,13,6],saves:[{constitution:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 11",languages:"Otyugh",cr:"5",traits:[{name:"Limited Telepathy",desc:"The otyugh can magically transmit simple messages and images to any creature within 120 ft. of it that can understand a language. This form of telepathy doesn't allow the receiving creature to telepathically respond.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The otyugh makes three attacks: one with its bite and two with its tentacles.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 12 (2d8 + 3) piercing damage. If the target is a creature, it must succeed on a DC 15 Constitution saving throw against disease or become poisoned until the disease is cured. Every 24 hours that elapse, the target must repeat the saving throw, reducing its hit point maximum by 5 (1d10) on a failure. The disease is cured on a success. The target dies if the disease reduces its hit point maximum to 0. This reduction to the target's hit point maximum lasts until the disease is cured.",attack_bonus:6,damage_dice:"2d8",damage_bonus:3},{name:"Tentacle",desc:"Melee Weapon Attack: +6 to hit, reach 10 ft., one target. Hit: 7 (1d8 + 3) bludgeoning damage plus 4 (1d8) piercing damage. If the target is Medium or smaller, it is grappled (escape DC 13) and restrained until the grapple ends. The otyugh has two tentacles, each of which can grapple one target.",attack_bonus:6,damage_dice:"1d8",damage_bonus:3},{name:"Tentacle Slam",desc:"The otyugh slams creatures grappled by it into each other or a solid surface. Each creature must succeed on a DC 14 Constitution saving throw or take 10 (2d6 + 3) bludgeoning damage and be stunned until the end of the otyugh's next turn. On a successful save, the target takes half the bludgeoning damage and isn't stunned.",attack_bonus:0}]},{name:"Owl",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:1,hit_dice:"1d4 + -2",speed:"5 ft., fly 60 ft.",stats:[3,13,8,2,12,7],skillsaves:[{perception:3},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 13",languages:"",cr:"0",traits:[{name:"Flyby",desc:"The owl doesn't provoke opportunity attacks when it flies out of an enemy's reach.",attack_bonus:0},{name:"Keen Hearing and Sight",desc:"The owl has advantage on Wisdom (Perception) checks that rely on hearing or sight.",attack_bonus:0}],actions:[{name:"Talons",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 1 slashing damage.",attack_bonus:3,damage_bonus:1}]},{name:"Owlbear",size:"Large",type:"monstrosity",subtype:"",alignment:"unaligned",ac:13,hp:59,hit_dice:"7d10 + 20",speed:"40 ft.",stats:[20,12,17,3,12,7],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 13",languages:"",cr:"3",traits:[{name:"Keen Sight and Smell",desc:"The owlbear has advantage on Wisdom (Perception) checks that rely on sight or smell.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The owlbear makes two attacks: one with its beak and one with its claws.",attack_bonus:0},{name:"Beak",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one creature. Hit: 10 (1d10 + 5) piercing damage.",attack_bonus:7,damage_dice:"1d10",damage_bonus:5},{name:"Claws",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 14 (2d8 + 5) slashing damage.",attack_bonus:7,damage_dice:"2d8",damage_bonus:5}]},{name:"Panther",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:13,hit_dice:"3d8 + -1",speed:"50 ft., climb 40 ft.",stats:[14,15,10,3,14,7],skillsaves:[{perception:4},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 14",languages:"",cr:"1/4",traits:[{name:"Keen Smell",desc:"The panther has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0},{name:"Pounce",desc:"If the panther moves at least 20 ft. straight toward a creature and then hits it with a claw attack on the same turn, that target must succeed on a DC 12 Strength saving throw or be knocked prone. If the target is prone, the panther can make one bite attack against it as a bonus action.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Claw",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 4 (1d4 + 2) slashing damage.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}]},{name:"Pegasus",size:"Large",type:"celestial",subtype:"",alignment:"chaotic good",ac:12,hp:59,hit_dice:"7d10 + 20",speed:"60 ft., fly 90 ft.",stats:[18,15,16,10,15,13],saves:[{dexterity:4},{wisdom:4},{charisma:3}],skillsaves:[{perception:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 16",languages:"understands Celestial, Common, Elvish, and Sylvan but can't speak",cr:"2",actions:[{name:"Hooves",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) bludgeoning damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:4}]},{name:"Phase Spider",size:"Large",type:"monstrosity",subtype:"",alignment:"unaligned",ac:13,hp:32,hit_dice:"5d10 + 4",speed:"30 ft., climb 30 ft.",stats:[15,15,12,6,10,6],skillsaves:[{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 10",languages:"",cr:"3",traits:[{name:"Ethereal Jaunt",desc:"As a bonus action, the spider can magically shift from the Material Plane to the Ethereal Plane, or vice versa.",attack_bonus:0},{name:"Spider Climb",desc:"The spider can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0},{name:"Web Walker",desc:"The spider ignores movement restrictions caused by webbing.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 7 (1d10 + 2) piercing damage, and the target must make a DC 11 Constitution saving throw, taking 18 (4d8) poison damage on a failed save, or half as much damage on a successful one. If the poison damage reduces the target to 0 hit points, the target is stable but poisoned for 1 hour, even after regaining hit points, and is paralyzed while poisoned in this way.",attack_bonus:4,damage_dice:"1d10",damage_bonus:2}]},{name:"Pit Fiend",size:"Large",type:"fiend",subtype:"devil",alignment:"lawful evil",ac:19,hp:300,hit_dice:"24d10 + 168",speed:"30 ft., fly 60 ft.",stats:[26,14,24,22,18,24],saves:[{dexterity:8},{constitution:13},{wisdom:10}],damage_vulnerabilities:"",damage_resistances:"cold; bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"truesight 120 ft., passive Perception 14",languages:"Infernal, telepathy 120 ft.",cr:"20",traits:[{name:"Fear Aura",desc:"Any creature hostile to the pit fiend that starts its turn within 20 feet of the pit fiend must make a DC 21 Wisdom saving throw, unless the pit fiend is incapacitated. On a failed save, the creature is frightened until the start of its next turn. If a creature's saving throw is successful, the creature is immune to the pit fiend's Fear Aura for the next 24 hours.",attack_bonus:0},{name:"Magic Resistance",desc:"The pit fiend has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Magic Weapons",desc:"The pit fiend's weapon attacks are magical.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The pit fiend's spellcasting ability is Charisma (spell save DC 21). The pit fiend can innately cast the following spells, requiring no material components:\\nAt will: detect magic, fireball\\n3/day each: hold monster, wall of fire",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The pit fiend makes four attacks: one with its bite, one with its claw, one with its mace, and one with its tail.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +14 to hit, reach 5 ft., one target. Hit: 22 (4d6 + 8) piercing damage. The target must succeed on a DC 21 Constitution saving throw or become poisoned. While poisoned in this way, the target can't regain hit points, and it takes 21 (6d6) poison damage at the start of each of its turns. The poisoned target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:14,damage_dice:"4d6",damage_bonus:8},{name:"Claw",desc:"Melee Weapon Attack: +14 to hit, reach 10 ft. , one target. Hit: 17 (2d8 + 8) slashing damage.",attack_bonus:14,damage_dice:"2d8",damage_bonus:8},{name:"Mace",desc:"Melee Weapon Attack: +14 to hit, reach 10ft., one target. Hit: 15 (2d6 + 8) bludgeoning damage plus 21 (6d6) fire damage.",attack_bonus:14,damage_dice:"2d6",damage_bonus:8},{name:"Tail",desc:"Melee Weapon Attack: +14 to hit, reach 10ft., one target. Hit: 24 (3d1O + 8) bludgeoning damage.",attack_bonus:14,damage_dice:"3d10",damage_bonus:8}]},{name:"Planetar",size:"Large",type:"celestial",subtype:"",alignment:"lawful good",ac:19,hp:200,hit_dice:"16d10 + 112",speed:"40 ft., fly 120 ft.",stats:[24,20,24,19,22,25],saves:[{constitution:12},{wisdom:11},{charisma:12}],skillsaves:[{perception:11}],damage_vulnerabilities:"",damage_resistances:"radiant; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"",condition_immunities:"charmed, exhaustion, frightened",senses:"truesight 120 ft., passive Perception 21",languages:"all, telepathy 120 ft.",cr:"16",traits:[{name:"Angelic Weapons",desc:"The planetar's weapon attacks are magical. When the planetar hits with any weapon, the weapon deals an extra 5d8 radiant damage (included in the attack).",attack_bonus:0},{name:"Divine Awareness",desc:"The planetar knows if it hears a lie.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The planetar's spellcasting ability is Charisma (spell save DC 20). The planetar can innately cast the following spells, requiring no material components:\\nAt will: detect evil and good, invisibility (self only)\\n3/day each: blade barrier, dispel evil and good, flame strike, raise dead\\n1/day each: commune, control weather, insect plague",attack_bonus:0},{name:"Magic Resistance",desc:"The planetar has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The planetar makes two melee attacks.",attack_bonus:0},{name:"Greatsword",desc:"Melee Weapon Attack: +12 to hit, reach 5 ft., one target. Hit: 21 (4d6 + 7) slashing damage plus 22 (5d8) radiant damage.",attack_bonus:12,damage_dice:"4d6 + 5d8",damage_bonus:7},{name:"Healing Touch (4/Day)",desc:"The planetar touches another creature. The target magically regains 30 (6d8 + 3) hit points and is freed from any curse, disease, poison, blindness, or deafness.",attack_bonus:0}]},{name:"Plesiosaurus",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:68,hit_dice:"8d10 + 24",speed:"20 ft., swim 40 ft.",stats:[18,15,16,2,12,5],skillsaves:[{perception:3},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"2",traits:[{name:"Hold Breath",desc:"The plesiosaurus can hold its breath for 1 hour.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 10 ft., one target. Hit: 14 (3d6 + 4) piercing damage.",attack_bonus:6,damage_dice:"3d6",damage_bonus:4}]},{name:"Poisonous Snake",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:2,hit_dice:"1d4 + -1",speed:"30 ft., swim 30 ft.",stats:[2,16,11,1,10,3],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 10 ft., passive Perception 10",languages:"",cr:"1/8",actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 1 piercing damage, and the target must make a DC 10 Constitution saving throw, taking 5 (2d4) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:5,damage_bonus:1}]},{name:"Polar Bear",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:42,hit_dice:"5d10 + 14",speed:"40 ft., swim 30 ft.",stats:[20,10,16,2,13,7],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"2",traits:[{name:"Keen Smell",desc:"The bear has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The bear makes two attacks: one with its bite and one with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 9 (1d8 + 5) piercing damage.",attack_bonus:7,damage_dice:"1d8",damage_bonus:5},{name:"Claws",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 12 (2d6 + 5) slashing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:5}]},{name:"Pony",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:10,hp:11,hit_dice:"2d8 + 2",speed:"40 ft.",stats:[15,10,13,2,11,7],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"1/8",actions:[{name:"Hooves",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (2d4 + 2) bludgeoning damage.",attack_bonus:4,damage_dice:"2d4",damage_bonus:2}]},{name:"Priest",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:13,hp:27,hit_dice:"5d8 + 4",speed:"25 ft.",stats:[10,10,12,13,16,13],skillsaves:[{medicine:7},{persuasion:3},{religion:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"any two languages",cr:"2",traits:[{name:"Divine Eminence",desc:"As a bonus action, the priest can expend a spell slot to cause its melee weapon attacks to magically deal an extra 10 (3d6) radiant damage to a target on a hit. This benefit lasts until the end of the turn. If the priest expends a spell slot of 2nd level or higher, the extra damage increases by 1d6 for each level above 1st.",attack_bonus:0,damage_dice:"3d6"}],actions:[{name:"Mace",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one target. Hit: 3 (1d6) bludgeoning damage.",attack_bonus:2,damage_dice:"1d6"}],spells:["The priest is a 5th-level spellcaster. Its spellcasting ability is Wisdom (spell save DC 13, +5 to hit with spell attacks). The priest has the following cleric spells prepared:",{"Cantrips (at will)":"light, sacred flame, thaumaturgy"},{"1st level (4 slots)":"cure wounds, guiding bolt, sanctuary"},{"2nd level (3 slots)":"lesser restoration, spiritual weapon"},{"3rd level (2 slots)":"dispel magic, spirit guardians"}]},{name:"Pseudodragon",size:"Tiny",type:"dragon",subtype:"",alignment:"neutral good",ac:13,hp:7,hit_dice:"2d4 + 2",speed:"15 ft., fly 60 ft.",stats:[6,15,13,10,12,10],skillsaves:[{perception:3},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 13",languages:"understands Common and Draconic but can't speak",cr:"1/4",traits:[{name:"Keen Senses",desc:"The pseudodragon has advantage on Wisdom (Perception) checks that rely on sight, hearing, or smell.",attack_bonus:0},{name:"Magic Resistance",desc:"The pseudodragon has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Limited Telepathy",desc:"The pseudodragon can magically communicate simple ideas, emotions, and images telepathically with any creature within 100 ft. of it that can understand a language.",attack_bonus:0},{name:"Variant: Familiar",desc:"The pseudodragon can serve another creature as a familiar, forming a magic, telepathic bond with that willing companion. While the two are bonded, the companion can sense what the pseudodragon senses as long as they are within 1 mile of each other. While the pseudodragon is within 10 feet of its companion, the companion shares the pseudodragon's Magic Resistance trait. At any time and for any reason, the pseudodragon can end its service as a familiar, ending the telepathic bond.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 4 (1d4 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2},{name:"Sting",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 4 (1d4 + 2) piercing damage, and the target must succeed on a DC 11 Constitution saving throw or become poisoned for 1 hour. If the saving throw fails by 5 or more, the target falls unconscious for the same duration, or until it takes damage or another creature uses an action to shake it awake.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2}]},{name:"Purple Worm",size:"Gargantuan",type:"monstrosity",subtype:"",alignment:"unaligned",ac:18,hp:247,hit_dice:"15d20 + 89",speed:"50 ft., burrow 30 ft.",stats:[28,7,22,1,8,4],saves:[{constitution:11},{wisdom:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 30 ft., tremorsense 60 ft., passive Perception 9",languages:"",cr:"15",traits:[{name:"Tunneler",desc:"The worm can burrow through solid rock at half its burrow speed and leaves a 10-foot-diameter tunnel in its wake.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The worm makes two attacks: one with its bite and one with its stinger.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +9 to hit, reach 10 ft., one target. Hit: 22 (3d8 + 9) piercing damage. If the target is a Large or smaller creature, it must succeed on a DC 19 Dexterity saving throw or be swallowed by the worm. A swallowed creature is blinded and restrained, it has total cover against attacks and other effects outside the worm, and it takes 21 (6d6) acid damage at the start of each of the worm's turns.\\nIf the worm takes 30 damage or more on a single turn from a creature inside it, the worm must succeed on a DC 21 Constitution saving throw at the end of that turn or regurgitate all swallowed creatures, which fall prone in a space within 10 feet of the worm. If the worm dies, a swallowed creature is no longer restrained by it and can escape from the corpse by using 20 feet of movement, exiting prone.",attack_bonus:9,damage_dice:"3d8",damage_bonus:9},{name:"Tail Stinger",desc:"Melee Weapon Attack: +9 to hit, reach 10 ft., one creature. Hit: 19 (3d6 + 9) piercing damage, and the target must make a DC 19 Constitution saving throw, taking 42 (12d6) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:9,damage_dice:"3d6",damage_bonus:9}]},{name:"Quasit",size:"Tiny",type:"fiend",subtype:"demon",alignment:"chaotic evil",ac:13,hp:7,hit_dice:"3d4 + -1",speed:"40 ft.",stats:[5,17,10,7,10,10],skillsaves:[{stealth:5}],damage_vulnerabilities:"",damage_resistances:"cold; fire; lightning; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"poison",condition_immunities:"poisoned",senses:"darkvision 120 ft., passive Perception 10",languages:"Abyssal, Common",cr:"1",traits:[{name:"Shapechanger",desc:"The quasit can use its action to polymorph into a beast form that resembles a bat (speed 10 ft. fly 40 ft.), a centipede (40 ft., climb 40 ft.), or a toad (40 ft., swim 40 ft.), or back into its true form . Its statistics are the same in each form, except for the speed changes noted. Any equipment it is wearing or carrying isn't transformed . It reverts to its true form if it dies.",attack_bonus:0},{name:"Magic Resistance",desc:"The quasit has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Variant: Familiar",desc:"The quasit can serve another creature as a familiar, forming a telepathic bond with its willing master. While the two are bonded, the master can sense what the quasit senses as long as they are within 1 mile of each other. While the quasit is within 10 feet of its master, the master shares the quasit's Magic Resistance trait. At any time and for any reason, the quasit can end its service as a familiar, ending the telepathic bond.",attack_bonus:0}],actions:[{name:"Claw (Bite in Beast Form)",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft ., one target. Hit: 5 (1d4 + 3) piercing damage, and the target must succeed on a DC 10 Constitution saving throw or take 5 (2d4) poison damage and become poisoned for 1 minute. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:4,damage_dice:"1d4",damage_bonus:3},{name:"Scare (1/day)",desc:"One creature of the quasit's choice within 20 ft. of it must succeed on a DC 10 Wisdom saving throw or be frightened for 1 minute. The target can repeat the saving throw at the end of each of its turns, with disadvantage if the quasit is within line of sight, ending the effect on itself on a success.",attack_bonus:0},{name:"Invisibility",desc:"The quasit magically turns invisible until it attacks or uses Scare, or until its concentration ends (as if concentrating on a spell). Any equipment the quasit wears or carries is invisible with it.",attack_bonus:0}]},{name:"Quipper",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:1,hit_dice:"1d4 + -2",speed:"swim 40 ft.",stats:[2,16,9,1,7,2],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 8",languages:"",cr:"0",traits:[{name:"Blood Frenzy",desc:"The quipper has advantage on melee attack rolls against any creature that doesn't have all its hit points.",attack_bonus:0},{name:"Water Breathing",desc:"The quipper can breathe only underwater.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 1 piercing damage.",attack_bonus:5,damage_bonus:1}]},{name:"Rakshasa",size:"Medium",type:"fiend",subtype:"",alignment:"lawful evil",ac:16,hp:110,hit_dice:"13d8 + 51",speed:"40 ft.",stats:[14,17,18,13,16,20],skillsaves:[{deception:10},{insight:8}],damage_vulnerabilities:"piercing from magic weapons wielded by good creatures",damage_resistances:"",damage_immunities:"bludgeoning, piercing, and slashing from nonmagical weapons",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 13",languages:"Common, Infernal",cr:"13",traits:[{name:"Limited Magic Immunity",desc:"The rakshasa can't be affected or detected by spells of 6th level or lower unless it wishes to be. It has advantage on saving throws against all other spells and magical effects.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The rakshasa's innate spellcasting ability is Charisma (spell save DC 18, +10 to hit with spell attacks). The rakshasa can innately cast the following spells, requiring no material components:\\n\\nAt will: detect thoughts, disguise self, mage hand, minor illusion\\n3/day each: charm person, detect magic, invisibility, major image, suggestion\\n1/day each: dominate person, fly, plane shift, true seeing",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The rakshasa makes two claw attacks",attack_bonus:0},{name:"Claw",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 9 (2d6 + 2) slashing damage, and the target is cursed if it is a creature. The magical curse takes effect whenever the target takes a short or long rest, filling the target's thoughts with horrible images and dreams. The cursed target gains no benefit from finishing a short or long rest. The curse lasts until it is lifted by a remove curse spell or similar magic.",attack_bonus:7,damage_dice:"2d6",damage_bonus:2}]},{name:"Rat",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:10,hp:1,hit_dice:"1d4 + -2",speed:"20 ft.",stats:[2,11,9,2,10,4],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 30 ft., passive Perception 10",languages:"",cr:"0",traits:[{name:"Keen Smell",desc:"The rat has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +0 to hit, reach 5 ft., one target. Hit: 1 piercing damage.",attack_bonus:0,damage_bonus:1}]},{name:"Raven",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:1,hit_dice:"1d4 + -2",speed:"10 ft., fly 50 ft.",stats:[2,14,8,2,12,6],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"0",traits:[{name:"Mimicry",desc:"The raven can mimic simple sounds it has heard, such as a person whispering, a baby crying, or an animal chittering. A creature that hears the sounds can tell they are imitations with a successful DC 10 Wisdom (Insight) check.",attack_bonus:0}],actions:[{name:"Beak",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 1 piercing damage.",attack_bonus:0}]},{name:"Red Dragon Wyrmling",size:"Medium",type:"dragon",subtype:"",alignment:"chaotic evil",ac:17,hp:75,hit_dice:"10d8 + 30",speed:"30 ft., climb 30 ft., fly 60 ft.",stats:[19,10,17,12,11,15],saves:[{dexterity:2},{constitution:5},{wisdom:2},{charisma:4}],skillsaves:[{perception:4},{stealth:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 14",languages:"Draconic",cr:"4",actions:[{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 9 (1d10 + 4) piercing damage plus 3 (1d6) fire damage.",attack_bonus:6,damage_dice:"1d10 + 1d6",damage_bonus:4},{name:"Fire Breath (Recharge 5-6)",desc:"The dragon exhales fire in a 15-foot cone. Each creature in that area must make a DC 13 Dexterity saving throw, taking 24 (7d6) fire damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"7d6"}]},{name:"Reef Shark",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:22,hit_dice:"4d8 + 4",speed:"swim 40 ft.",stats:[14,13,13,1,10,4],skillsaves:[{perception:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 30 ft., passive Perception 12",languages:"",cr:"1/2",traits:[{name:"Pack Tactics",desc:"The shark has advantage on an attack roll against a creature if at least one of the shark's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0},{name:"Water Breathing",desc:"The shark can breathe only underwater.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 6 (1d8 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2}]},{name:"Remorhaz",size:"Huge",type:"monstrosity",subtype:"",alignment:"unaligned",ac:17,hp:195,hit_dice:"17d12 + 84",speed:"30 ft., burrow 20 ft.",stats:[24,13,21,4,10,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"cold, fire",condition_immunities:"",senses:"darkvision 60 ft., tremorsense 60 ft., passive Perception 10",languages:"",cr:"11",traits:[{name:"Heated Body",desc:"A creature that touches the remorhaz or hits it with a melee attack while within 5 feet of it takes 10 (3d6) fire damage.",attack_bonus:0,damage_dice:"3d6"}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +11 to hit, reach 10 ft., one target. Hit: 40 (6d10 + 7) piercing damage plus 10 (3d6) fire damage. If the target is a creature, it is grappled (escape DC 17). Until this grapple ends, the target is restrained, and the remorhaz can't bite another target.",attack_bonus:11,damage_dice:"6d10 + 3d6",damage_bonus:7},{name:"Swallow",desc:"The remorhaz makes one bite attack against a Medium or smaller creature it is grappling. If the attack hits, that creature takes the bite's damage and is swallowed, and the grapple ends. While swallowed, the creature is blinded and restrained, it has total cover against attacks and other effects outside the remorhaz, and it takes 21 (6d6) acid damage at the start of each of the remorhaz's turns.\\nIf the remorhaz takes 30 damage or more on a single turn from a creature inside it, the remorhaz must succeed on a DC 15 Constitution saving throw at the end of that turn or regurgitate all swallowed creatures, which fall prone in a space within 10 feet oft he remorhaz. If the remorhaz dies, a swallowed creature is no longer restrained by it and can escape from the corpse using 15 feet of movement, exiting prone.",attack_bonus:0}]},{name:"Rhinoceros",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:45,hit_dice:"6d10 + 12",speed:"40 ft.",stats:[21,8,15,2,12,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 11",languages:"",cr:"2",traits:[{name:"Charge",desc:"If the rhinoceros moves at least 20 ft. straight toward a target and then hits it with a gore attack on the same turn, the target takes an extra 9 (2d8) bludgeoning damage. If the target is a creature, it must succeed on a DC 15 Strength saving throw or be knocked prone.",attack_bonus:0,damage_dice:"2d8"}],actions:[{name:"Gore",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 14 (2d8 + 5) bludgeoning damage.",attack_bonus:7,damage_dice:"2d8",damage_bonus:5}]},{name:"Riding Horse",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:10,hp:13,hit_dice:"2d10 + 2",speed:"60 ft.",stats:[16,10,12,2,11,7],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"1/4",actions:[{name:"Hooves",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 8 (2d4 + 3) bludgeoning damage.",attack_bonus:5,damage_dice:"2d4",damage_bonus:3}]},{name:"Roc",size:"Gargantuan",type:"monstrosity",subtype:"",alignment:"unaligned",ac:15,hp:248,hit_dice:"16d20 + 80",speed:"20 ft., fly 120 ft.",stats:[28,10,20,3,10,9],saves:[{dexterity:4},{constitution:9},{wisdom:4},{charisma:3}],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 14",languages:"",cr:"11",traits:[{name:"Keen Sight",desc:"The roc has advantage on Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The roc makes two attacks: one with its beak and one with its talons.",attack_bonus:0},{name:"Beak",desc:"Melee Weapon Attack: +13 to hit, reach 10 ft., one target. Hit: 27 (4d8 + 9) piercing damage.",attack_bonus:13,damage_dice:"4d8",damage_bonus:9},{name:"Talons",desc:"Melee Weapon Attack: +13 to hit, reach 5 ft., one target. Hit: 23 (4d6 + 9) slashing damage, and the target is grappled (escape DC 19). Until this grapple ends, the target is restrained, and the roc can't use its talons on another target.",attack_bonus:13,damage_dice:"4d6",damage_bonus:9}]},{name:"Roper",size:"Large",type:"monstrosity",subtype:"",alignment:"neutral evil",ac:20,hp:93,hit_dice:"11d10 + 32",speed:"10 ft., climb 10 ft.",stats:[18,8,17,7,16,6],skillsaves:[{perception:6},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 16",languages:"",cr:"5",traits:[{name:"False Appearance",desc:"While the roper remains motionless, it is indistinguishable from a normal cave formation, such as a stalagmite.",attack_bonus:0},{name:"Grasping Tendrils",desc:"The roper can have up to six tendrils at a time. Each tendril can be attacked (AC 20; 10 hit points; immunity to poison and psychic damage). Destroying a tendril deals no damage to the roper, which can extrude a replacement tendril on its next turn. A tendril can also be broken if a creature takes an action and succeeds on a DC 15 Strength check against it.",attack_bonus:0},{name:"Spider Climb",desc:"The roper can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The roper makes four attacks with its tendrils, uses Reel, and makes one attack with its bite.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 22 (4d8 + 4) piercing damage.",attack_bonus:7,damage_dice:"4d8",damage_bonus:4},{name:"Tendril",desc:"Melee Weapon Attack: +7 to hit, reach 50 ft., one creature. Hit: The target is grappled (escape DC 15). Until the grapple ends, the target is restrained and has disadvantage on Strength checks and Strength saving throws, and the roper can't use the same tendril on another target.",attack_bonus:7},{name:"Reel",desc:"The roper pulls each creature grappled by it up to 25 ft. straight toward it.",attack_bonus:0}]},{name:"Rug of Smothering",size:"Large",type:"construct",subtype:"",alignment:"unaligned",ac:12,hp:33,hit_dice:"6d10",speed:"10 ft.",stats:[17,14,10,1,3,1],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison, psychic",condition_immunities:"blinded, charmed, deafened, frightened, paralyzed, petrified, poisoned",senses:"blindsight 60 ft. (blind beyond this radius), passive Perception 6",languages:"",cr:"2",traits:[{name:"Antimagic Susceptibility",desc:"The rug is incapacitated while in the area of an antimagic field. If targeted by dispel magic, the rug must succeed on a Constitution saving throw against the caster's spell save DC or fall unconscious for 1 minute.",attack_bonus:0},{name:"Damage Transfer",desc:"While it is grappling a creature, the rug takes only half the damage dealt to it, and the creature grappled by the rug takes the other half.",attack_bonus:0},{name:"False Appearance",desc:"While the rug remains motionless, it is indistinguishable from a normal rug.",attack_bonus:0}],actions:[{name:"Smother",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one Medium or smaller creature. Hit: The creature is grappled (escape DC 13). Until this grapple ends, the target is restrained, blinded, and at risk of suffocating, and the rug can't smother another target. In addition, at the start of each of the target's turns, the target takes 10 (2d6 + 3) bludgeoning damage.",attack_bonus:0,damage_dice:"2d6",damage_bonus:3}]},{name:"Rust Monster",size:"Medium",type:"monstrosity",subtype:"",alignment:"unaligned",ac:14,hp:27,hit_dice:"5d8 + 4",speed:"40 ft.",stats:[13,12,13,2,13,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 11",languages:"",cr:"1/2",traits:[{name:"Iron Scent",desc:"The rust monster can pinpoint, by scent, the location of ferrous metal within 30 feet of it.",attack_bonus:0},{name:"Rust Metal",desc:"Any nonmagical weapon made of metal that hits the rust monster corrodes. After dealing damage, the weapon takes a permanent and cumulative -1 penalty to damage rolls. If its penalty drops to -5, the weapon is destroyed. Non magical ammunition made of metal that hits the rust monster is destroyed after dealing damage.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 5 (1d8 + 1) piercing damage.",attack_bonus:3,damage_dice:"1d8",damage_bonus:1},{name:"Antennae",desc:"The rust monster corrodes a nonmagical ferrous metal object it can see within 5 feet of it. If the object isn't being worn or carried, the touch destroys a 1-foot cube of it. If the object is being worn or carried by a creature, the creature can make a DC 11 Dexterity saving throw to avoid the rust monster's touch.\\nIf the object touched is either metal armor or a metal shield being worn or carried, its takes a permanent and cumulative -1 penalty to the AC it offers. Armor reduced to an AC of 10 or a shield that drops to a +0 bonus is destroyed. If the object touched is a held metal weapon, it rusts as described in the Rust Metal trait.",attack_bonus:0}]},{name:"Saber-Toothed Tiger",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:52,hit_dice:"7d10 + 13",speed:"40 ft.",stats:[18,14,15,3,12,8],skillsaves:[{perception:3},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"2",traits:[{name:"Keen Smell",desc:"The tiger has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0},{name:"Pounce",desc:"If the tiger moves at least 20 ft. straight toward a creature and then hits it with a claw attack on the same turn, that target must succeed on a DC 14 Strength saving throw or be knocked prone. If the target is prone, the tiger can make one bite attack against it as a bonus action.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 10 (1d10 + 5) piercing damage.",attack_bonus:6,damage_dice:"1d10",damage_bonus:5},{name:"Claw",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 12 (2d6 + 5) slashing damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:5}]},{name:"Sahuagin",size:"Medium",type:"humanoid",subtype:"sahuagin",alignment:"lawful evil",ac:12,hp:22,hit_dice:"4d8 + 4",speed:"30 ft., swim 40 ft.",stats:[13,11,12,12,13,9],skillsaves:[{perception:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 15",languages:"Sahuagin",cr:"1/2",traits:[{name:"Blood Frenzy",desc:"The sahuagin has advantage on melee attack rolls against any creature that doesn't have all its hit points.",attack_bonus:0},{name:"Limited Amphibiousness",desc:"The sahuagin can breathe air and water, but it needs to be submerged at least once every 4 hours to avoid suffocating.",attack_bonus:0},{name:"Shark Telepathy",desc:"The sahuagin can magically command any shark within 120 feet of it, using a limited telepathy.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The sahuagin makes two melee attacks: one with its bite and one with its claws or spear.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 3 (1d4 + 1) piercing damage.",attack_bonus:3,damage_dice:"1d4",damage_bonus:1},{name:"Claws",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 3 (1d4 + 1) slashing damage.",attack_bonus:3,damage_dice:"1d4",damage_bonus:1},{name:"Spear",desc:"Melee or Ranged Weapon Attack: +3 to hit, reach 5 ft. or range 20/60 ft., one target. Hit: 4 (1d6 + 1) piercing damage, or 5 (1d8 + 1) piercing damage if used with two hands to make a melee attack.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1}]},{name:"Salamander",size:"Large",type:"elemental",subtype:"",alignment:"neutral evil",ac:15,hp:90,hit_dice:"12d10 + 24",speed:"30 ft.",stats:[18,14,15,11,10,12],damage_vulnerabilities:"cold",damage_resistances:"bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"fire",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 10",languages:"Ignan",cr:"5",traits:[{name:"Heated Body",desc:"A creature that touches the salamander or hits it with a melee attack while within 5 ft. of it takes 7 (2d6) fire damage.",attack_bonus:0,damage_dice:"2d6"},{name:"Heated Weapons",desc:"Any metal melee weapon the salamander wields deals an extra 3 (1d6) fire damage on a hit (included in the attack).",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The salamander makes two attacks: one with its spear and one with its tail.",attack_bonus:0},{name:"Spear",desc:"Melee or Ranged Weapon Attack: +7 to hit, reach 5 ft. or range 20 ft./60 ft., one target. Hit: 11 (2d6 + 4) piercing damage, or 13 (2d8 + 4) piercing damage if used with two hands to make a melee attack, plus 3 (1d6) fire damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Tail",desc:"Melee Weapon Attack: +7 to hit, reach 10 ft., one target. Hit: 11 (2d6 + 4) bludgeoning damage plus 7 (2d6) fire damage, and the target is grappled (escape DC 14). Until this grapple ends, the target is restrained, the salamander can automatically hit the target with its tail, and the salamander can't make tail attacks against other targets.",attack_bonus:7,damage_dice:"2d6 + 2d6",damage_bonus:4}]},{name:"Satyr",size:"Medium",type:"fey",subtype:"",alignment:"chaotic neutral",ac:14,hp:31,hit_dice:"7d8 + -1",speed:"40 ft.",stats:[12,16,11,12,10,14],skillsaves:[{perception:2},{performance:6},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 12",languages:"Common, Elvish, Sylvan",cr:"1/2",traits:[{name:"Magic Resistance",desc:"The satyr has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Ram",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 6 (2d4 + 1) bludgeoning damage.",attack_bonus:3,damage_dice:"2d4",damage_bonus:1},{name:"Shortsword",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1 d6 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3},{name:"Shortbow",desc:"Ranged Weapon Attack: +5 to hit, range 80/320 ft., one target. Hit: 6 (1d6 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3},{name:"Variant: Panpipes",desc:"Gentle Lullaby. The creature falls asleep and is unconscious for 1 minute. The effect ends if the creature takes damage or if someone takes an action to shake the creature awake.",attack_bonus:0}]},{name:"Scorpion",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:1,hit_dice:"1d4 + -2",speed:"10 ft.",stats:[2,11,8,1,8,2],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"blindsight 10 ft., passive Perception 9",languages:"",cr:"0",actions:[{name:"Sting",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one creature. Hit: 1 piercing damage, and the target must make a DC 9 Constitution saving throw, taking 4 (1d8) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:2,damage_bonus:1}]},{name:"Scout",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:13,hp:16,hit_dice:"3d8 + 2",speed:"30 ft.",stats:[11,14,12,11,13,11],skillsaves:[{nature:4},{perception:5},{stealth:6},{survival:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 15",languages:"any one language (usually Common)",cr:"1/2",traits:[{name:"Keen Hearing and Sight",desc:"The scout has advantage on Wisdom (Perception) checks that rely on hearing or sight.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The scout makes two melee attacks or two ranged attacks.",attack_bonus:0},{name:"Shortsword",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Longbow",desc:"Ranged Weapon Attack: +4 to hit, ranged 150/600 ft., one target. Hit: 6 (1d8 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2}]},{name:"Sea Hag",size:"Medium",type:"fey",subtype:"",alignment:"chaotic evil",ac:14,hp:52,hit_dice:"7d8 + 20",speed:"30 ft., swim 40 ft.",stats:[16,13,16,12,12,13],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 11",languages:"Aquan, Common, Giant",cr:"2",traits:[{name:"Amphibious",desc:"The hag can breathe air and water.",attack_bonus:0},{name:"Horrific Appearance",desc:"Any humanoid that starts its turn within 30 feet of the hag and can see the hag's true form must make a DC 11 Wisdom saving throw. On a failed save, the creature is frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, with disadvantage if the hag is within line of sight, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the hag's Horrific Appearance for the next 24 hours.\\nUnless the target is surprised or the revelation of the hag's true form is sudden, the target can avert its eyes and avoid making the initial saving throw. Until the start of its next turn, a creature that averts its eyes has disadvantage on attack rolls against the hag.",attack_bonus:0},{name:"Hag Coven",desc:"When hags must work together, they form covens, in spite of their selfish natures. A coven is made up of hags of any type, all of whom are equals within the group. However, each of the hags continues to desire more personal power.\\nA coven consists of three hags so that any arguments between two hags can be settled by the third. If more than three hags ever come together, as might happen if two covens come into conflict, the result is usually chaos.",attack_bonus:0},{name:"Shared Spellcasting (Coven Only)",desc:"While all three members of a hag coven are within 30 feet of one another, they can each cast the following spells from the wizard's spell list but must share the spell slots among themselves:\\n\\n\u2022 1st level (4 slots): identify, ray of sickness\\n\u2022 2nd level (3 slots): hold person, locate object\\n\u2022 3rd level (3 slots): bestow curse, counterspell, lightning bolt\\n\u2022 4th level (3 slots): phantasmal killer, polymorph\\n\u2022 5th level (2 slots): contact other plane, scrying\\n\u2022 6th level (1 slot): eye bite\\n\\nFor casting these spells, each hag is a 12th-level spellcaster that uses Intelligence as her spellcasting ability. The spell save DC is 12+the hag's Intelligence modifier, and the spell attack bonus is 4+the hag's Intelligence modifier.",attack_bonus:0},{name:"Hag Eye (Coven Only)",desc:"A hag coven can craft a magic item called a hag eye, which is made from a real eye coated in varnish and often fitted to a pendant or other wearable item. The hag eye is usually entrusted to a minion for safekeeping and transport. A hag in the coven can take an action to see what the hag eye sees if the hag eye is on the same plane of existence. A hag eye has AC 10, 1 hit point, and darkvision with a radius of 60 feet. If it is destroyed, each coven member takes 3d10 psychic damage and is blinded for 24 hours.\\nA hag coven can have only one hag eye at a time, and creating a new one requires all three members of the coven to perform a ritual. The ritual takes 1 hour, and the hags can't perform it while blinded. During the ritual, if the hags take any action other than performing the ritual, they must start over.",attack_bonus:0}],actions:[{name:"Claws",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) slashing damage.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3},{name:"Death Glare",desc:"The hag targets one frightened creature she can see within 30 ft. of her. If the target can see the hag, it must succeed on a DC 11 Wisdom saving throw against this magic or drop to 0 hit points.",attack_bonus:0},{name:"Illusory Appearance",desc:"The hag covers herself and anything she is wearing or carrying with a magical illusion that makes her look like an ugly creature of her general size and humanoid shape. The effect ends if the hag takes a bonus action to end it or if she dies.\\nThe changes wrought by this effect fail to hold up to physical inspection. For example, the hag could appear to have no claws, but someone touching her hand might feel the claws. Otherwise, a creature must take an action to visually inspect the illusion and succeed on a DC 16 Intelligence (Investigation) check to discern that the hag is disguised.",attack_bonus:0}]},{name:"Sea Horse",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:1,hit_dice:"1d4 + -2",speed:"swim 20 ft.",stats:[1,12,8,1,10,2],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"0",traits:[{name:"Water Breathing",desc:"The sea horse can breathe only underwater.",attack_bonus:0}]},{name:"Shadow",size:"Medium",type:"undead",subtype:"",alignment:"chaotic evil",ac:12,hp:16,hit_dice:"3d8 + 2",speed:"40 ft.",stats:[6,14,13,6,10,8],skillsaves:[{stealth:4}],damage_vulnerabilities:"radiant",damage_resistances:"acid, cold, fire, lightning, thunder; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"necrotic, poison",condition_immunities:"exhaustion, frightened, grappled, paralyzed, petrified, poisoned, prone, restrained",senses:"darkvision 60 ft., passive Perception 10",languages:"",cr:"1/2",traits:[{name:"Amorphous",desc:"The shadow can move through a space as narrow as 1 inch wide without squeezing.",attack_bonus:0},{name:"Shadow Stealth",desc:"While in dim light or darkness, the shadow can take the Hide action as a bonus action. Its stealth bonus is also improved to +6.",attack_bonus:0},{name:"Sunlight Weakness",desc:"While in sunlight, the shadow has disadvantage on attack rolls, ability checks, and saving throws.",attack_bonus:0}],actions:[{name:"Strength Drain",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 9 (2d6 + 2) necrotic damage, and the target's Strength score is reduced by 1d4. The target dies if this reduces its Strength to 0. Otherwise, the reduction lasts until the target finishes a short or long rest.\\nIf a non-evil humanoid dies from this attack, a new shadow rises from the corpse 1d4 hours later.",attack_bonus:4,damage_dice:"2d6",damage_bonus:2}]},{name:"Shambling Mound",size:"Large",type:"plant",subtype:"",alignment:"unaligned",ac:15,hp:136,hit_dice:"16d10 + 48",speed:"20 ft., swim 20 ft.",stats:[18,8,16,5,10,5],skillsaves:[{stealth:2}],damage_vulnerabilities:"",damage_resistances:"cold, fire",damage_immunities:"lightning",condition_immunities:"blinded, deafened, exhaustion",senses:"blindsight 60 ft. (blind beyond this radius), passive Perception 10",languages:"",cr:"5",traits:[{name:"Lightning Absorption",desc:"Whenever the shambling mound is subjected to lightning damage, it takes no damage and regains a number of hit points equal to the lightning damage dealt.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The shambling mound makes two slam attacks. If both attacks hit a Medium or smaller target, the target is grappled (escape DC 14), and the shambling mound uses its Engulf on it.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) bludgeoning damage.",attack_bonus:7,damage_dice:"2d8",damage_bonus:4},{name:"Engulf",desc:"The shambling mound engulfs a Medium or smaller creature grappled by it. The engulfed target is blinded, restrained, and unable to breathe, and it must succeed on a DC 14 Constitution saving throw at the start of each of the mound's turns or take 13 (2d8 + 4) bludgeoning damage. If the mound moves, the engulfed target moves with it. The mound can have only one creature engulfed at a time.",attack_bonus:0}]},{name:"Shield Guardian",size:"Large",type:"construct",subtype:"",alignment:"unaligned",ac:17,hp:142,hit_dice:"15d10 + 59",speed:"30 ft.",stats:[18,8,18,7,10,3],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison",condition_immunities:"charmed, exhaustion, frightened, paralyzed, poisoned",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 10",languages:"understands commands given in any language but can't speak",cr:"7",traits:[{name:"Bound",desc:"The shield guardian is magically bound to an amulet. As long as the guardian and its amulet are on the same plane of existence, the amulet's wearer can telepathically call the guardian to travel to it, and the guardian knows the distance and direction to the amulet. If the guardian is within 60 feet of the amulet's wearer, half of any damage the wearer takes (rounded up) is transferred to the guardian.",attack_bonus:0},{name:"Regeneration",desc:"The shield guardian regains 10 hit points at the start of its turn if it has at least 1 hit. point.",attack_bonus:0},{name:"Spell Storing",desc:"A spellcaster who wears the shield guardian's amulet can cause the guardian to store one spell of 4th level or lower. To do so, the wearer must cast the spell on the guardian. The spell has no effect but is stored within the guardian. When commanded to do so by the wearer or when a situation arises that was predefined by the spellcaster, the guardian casts the stored spell with any parameters set by the original caster, requiring no components. When the spell is cast or a new spell is stored, any previously stored spell is lost.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The guardian makes two fist attacks.",attack_bonus:0},{name:"Fist",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) bludgeoning damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4}],reactions:[{name:"Shield",desc:"When a creature makes an attack against the wearer of the guardian's amulet, the guardian grants a +2 bonus to the wearer's AC if the guardian is within 5 feet of the wearer.",attack_bonus:0}]},{name:"Shrieker",size:"Medium",type:"plant",subtype:"",alignment:"unaligned",ac:5,hp:13,hit_dice:"3d8 + -1",speed:"0 ft.",stats:[1,1,10,1,3,1],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"blinded, deafened, frightened",senses:"blindsight 30 ft. (blind beyond this radius), passive Perception 6",languages:"",cr:"0",traits:[{name:"False Appearance",desc:"While the shrieker remains motionless, it is indistinguishable from an ordinary fungus.",attack_bonus:0}],actions:[{name:"Shriek",desc:"When bright light or a creature is within 30 feet of the shrieker, it emits a shriek audible within 300 feet of it. The shrieker continues to shriek until the disturbance moves out of range and for 1d4 of the shrieker's turns afterward",attack_bonus:0}]},{name:"Silver Dragon Wyrmling",size:"Medium",type:"dragon",subtype:"",alignment:"lawful good",ac:17,hp:45,hit_dice:"6d8 + 18",speed:"30 ft., fly 60 ft.",stats:[19,10,17,12,11,15],saves:[{dexterity:2},{constitution:5},{wisdom:2},{charisma:4}],skillsaves:[{perception:4},{stealth:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"cold",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 14",languages:"Draconic",cr:"2",actions:[{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 9 (1d10 + 4) piercing damage.",attack_bonus:6,damage_dice:"1d10",damage_bonus:4},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nCold Breath. The dragon exhales an icy blast in a 15-foot cone. Each creature in that area must make a DC 13 Constitution saving throw, taking 18 (4d8) cold damage on a failed save, or half as much damage on a successful one.\\nParalyzing Breath. The dragon exhales paralyzing gas in a 15-foot cone. Each creature in that area must succeed on a DC 13 Constitution saving throw or be paralyzed for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0,damage_dice:"4d8"}]},{name:"Skeleton",size:"Medium",type:"undead",subtype:"",alignment:"lawful evil",ac:13,hp:13,hit_dice:"2d8 + 4",speed:"30 ft.",stats:[10,14,15,6,8,5],damage_vulnerabilities:"bludgeoning",damage_resistances:"",damage_immunities:"",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 9",languages:"understands all languages it spoke in life but can't speak",cr:"1/4",actions:[{name:"Shortsword",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Shortbow",desc:"Ranged Weapon Attack: +4 to hit, range 80/320 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Solar",size:"Large",type:"celestial",subtype:"",alignment:"lawful good",ac:21,hp:243,hit_dice:"18d10 + 144",speed:"50 ft., fly 150 ft.",stats:[26,22,26,25,25,30],saves:[{intelligence:14},{wisdom:14},{charisma:17}],skillsaves:[{perception:14}],damage_vulnerabilities:"",damage_resistances:"radiant; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"necrotic, poison",condition_immunities:"charmed, exhaustion, frightened, poisoned",senses:"truesight 120 ft., passive Perception 24",languages:"all, telepathy 120 ft.",cr:"21",traits:[{name:"Angelic Weapons",desc:"The solar's weapon attacks are magical. When the solar hits with any weapon, the weapon deals an extra 6d8 radiant damage (included in the attack).",attack_bonus:0},{name:"Divine Awareness",desc:"The solar knows if it hears a lie.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The solar's spell casting ability is Charisma (spell save DC 25). It can innately cast the following spells, requiring no material components:\\nAt will: detect evil and good, invisibility (self only)\\n3/day each: blade barrier, dispel evil and good, resurrection\\n1/day each: commune, control weather",attack_bonus:0},{name:"Magic Resistance",desc:"The solar has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The solar makes two greatsword attacks.",attack_bonus:0},{name:"Greatsword",desc:"Melee Weapon Attack: +15 to hit, reach 5 ft., one target. Hit: 22 (4d6 + 8) slashing damage plus 27 (6d8) radiant damage.",attack_bonus:15,damage_dice:"4d6 + 6d8",damage_bonus:8},{name:"Slaying Longbow",desc:"Ranged Weapon Attack: +13 to hit, range 150/600 ft., one target. Hit: 15 (2d8 + 6) piercing damage plus 27 (6d8) radiant damage. If the target is a creature that has 190 hit points or fewer, it must succeed on a DC 15 Constitution saving throw or die.",attack_bonus:13,damage_dice:"2d8 + 6d8",damage_bonus:6},{name:"Flying Sword",desc:"The solar releases its greatsword to hover magically in an unoccupied space within 5 ft. of it. If the solar can see the sword, the solar can mentally command it as a bonus action to fly up to 50 ft. and either make one attack against a target or return to the solar's hands. If the hovering sword is targeted by any effect, the solar is considered to be holding it. The hovering sword falls if the solar dies.",attack_bonus:0},{name:"Healing Touch (4/Day)",desc:"The solar touches another creature. The target magically regains 40 (8d8 + 4) hit points and is freed from any curse, disease, poison, blindness, or deafness.",attack_bonus:0}],legendary_actions:[{name:"Teleport",desc:"The solar magically teleports, along with any equipment it is wearing or carrying, up to 120 ft. to an unoccupied space it can see.",attack_bonus:0},{name:"Searing Burst (Costs 2 Actions)",desc:"The solar emits magical, divine energy. Each creature of its choice in a 10 -foot radius must make a DC 23 Dexterity saving throw, taking 14 (4d6) fire damage plus 14 (4d6) radiant damage on a failed save, or half as much damage on a successful one.",attack_bonus:0},{name:"Blinding Gaze (Costs 3 Actions)",desc:"The solar targets one creature it can see within 30 ft. of it. If the target can see it, the target must succeed on a DC 15 Constitution saving throw or be blinded until magic such as the lesser restoration spell removes the blindness.",attack_bonus:0}]},{name:"Specter",size:"Medium",type:"undead",subtype:"",alignment:"chaotic evil",ac:12,hp:22,hit_dice:"5d8 + -1",speed:"0 ft., fly 50 ft. (hover)",stats:[1,14,11,10,10,11],damage_vulnerabilities:"",damage_resistances:"acid, cold, fire, lightning, thunder; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"necrotic, poison",condition_immunities:"charmed, exhaustion, grappled, paralyzed, petrified, poisoned, prone, restrained, unconscious",senses:"darkvision 60 ft., passive Perception 10",languages:"understands all languages it knew in life but can't speak",cr:"1",traits:[{name:"Incorporeal Movement",desc:"The specter can move through other creatures and objects as if they were difficult terrain. It takes 5 (1d10) force damage if it ends its turn inside an object.",attack_bonus:0},{name:"Sunlight Sensitivity",desc:"While in sunlight, the specter has disadvantage on attack rolls, as well as on Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Life Drain",desc:"Melee Spell Attack: +4 to hit, reach 5 ft., one creature. Hit: 10 (3d6) necrotic damage. The target must succeed on a DC 10 Constitution saving throw or its hit point maximum is reduced by an amount equal to the damage taken. This reduction lasts until the creature finishes a long rest. The target dies if this effect reduces its hit point maximum to 0.",attack_bonus:4,damage_dice:"3d6"}]},{name:"Spider",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:1,hit_dice:"1d4 + -2",speed:"20 ft., climb 20 ft.",stats:[2,14,8,1,10,2],skillsaves:[{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 30 ft., passive Perception 12",languages:"",cr:"0",traits:[{name:"Spider Climb",desc:"The spider can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0},{name:"Web Sense",desc:"While in contact with a web, the spider knows the exact location of any other creature in contact with the same web.",attack_bonus:0},{name:"Web Walker",desc:"The spider ignores movement restrictions caused by webbing.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 1 piercing damage, and the target must succeed on a DC 9 Constitution saving throw or take 2 (1d4) poison damage.",attack_bonus:4,damage_bonus:1}]},{name:"Spirit Naga",size:"Large",type:"monstrosity",subtype:"",alignment:"chaotic evil",ac:15,hp:75,hit_dice:"10d10 + 20",speed:"40 ft.",stats:[18,17,14,16,15,16],saves:[{dexterity:6},{constitution:5},{wisdom:5},{charisma:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison",condition_immunities:"charmed, poisoned",senses:"darkvision 60 ft., passive Perception 12",languages:"Abyssal, Common",cr:"8",traits:[{name:"Rejuvenation",desc:"If it dies, the naga returns to life in 1d6 days and regains all its hit points. Only a wish spell can prevent this trait from functioning.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 10 ft., one creature. Hit: 7 (1d6 + 4) piercing damage, and the target must make a DC 13 Constitution saving throw, taking 31 (7d8) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:7,damage_dice:"1d6",damage_bonus:4}],spells:["The naga is a 10th-level spellcaster. Its spellcasting ability is Intelligence (spell save DC 14, +6 to hit with spell attacks), and it needs only verbal components to cast its spells. It has the following wizard spells prepared:",{"Cantrips (at will)":"mage hand, minor illusion, ray of frost"},{"1st level (4 slots)":"charm person, detect magic, sleep"},{"2nd level (3 slots)":"detect thoughts, hold person"},{"3rd level (3 slots)":"lightning bolt, water breathing"},{"4th level (3 slots)":"blight, dimension door"},{"5th level (2 slots)":"dominate person"}]},{name:"Sprite",size:"Tiny",type:"fey",subtype:"",alignment:"neutral good",ac:15,hp:2,hit_dice:"1d4 + -1",speed:"10 ft., fly 40 ft.",stats:[3,18,10,14,13,11],skillsaves:[{perception:3},{stealth:8}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"Common, Elvish, Sylvan",cr:"1/4",actions:[{name:"Longsword",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one target. Hit: 1 slashing damage.",attack_bonus:2,damage_bonus:1},{name:"Shortbow",desc:"Ranged Weapon Attack: +6 to hit, range 40/160 ft., one target. Hit: 1 piercing damage, and the target must succeed on a DC 10 Constitution saving throw or become poisoned for 1 minute. If its saving throw result is 5 or lower, the poisoned target falls unconscious for the same duration, or until it takes damage or another creature takes an action to shake it awake.",attack_bonus:6,damage_bonus:1},{name:"Heart Sight",desc:"The sprite touches a creature and magically knows the creature's current emotional state. If the target fails a DC 10 Charisma saving throw, the sprite also knows the creature's alignment. Celestials, fiends, and undead automatically fail the saving throw.",attack_bonus:0},{name:"Invisibility",desc:"The sprite magically turns invisible until it attacks or casts a spell, or until its concentration ends (as if concentrating on a spell). Any equipment the sprite wears or carries is invisible with it.",attack_bonus:0}]},{name:"Spy",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:12,hp:27,hit_dice:"6d8",speed:"30 ft.",stats:[10,15,10,12,14,16],skillsaves:[{deception:5},{insight:4},{investigation:5},{perception:6},{persuasion:5},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 16",languages:"any two languages",cr:"1",traits:[{name:"Cunning Action",desc:"On each of its turns, the spy can use a bonus action to take the Dash, Disengage, or Hide action.",attack_bonus:0},{name:"Sneak Attack (1/Turn)",desc:"The spy deals an extra 7 (2d6) damage when it hits a target with a weapon attack and has advantage on the attack roll, or when the target is within 5 ft. of an ally of the spy that isn't incapacitated and the spy doesn't have disadvantage on the attack roll.",attack_bonus:0,damage_dice:"2d6"}],actions:[{name:"Multiattack",desc:"The spy makes two melee attacks.",attack_bonus:0},{name:"Shortsword",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Hand Crossbow",desc:"Ranged Weapon Attack: +4 to hit, range 30/120 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Steam Mephit",size:"Small",type:"elemental",subtype:"",alignment:"neutral evil",ac:10,hp:21,hit_dice:"6d6",speed:"30 ft., fly 30 ft.",stats:[5,11,10,11,10,12],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire, poison",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 10",languages:"Aquan, Ignan",cr:"1/4",traits:[{name:"Death Burst",desc:"When the mephit dies, it explodes in a cloud of steam. Each creature within 5 ft. of the mephit must succeed on a DC 10 Dexterity saving throw or take 4 (1d8) fire damage.",attack_bonus:0,damage_dice:"1d8"},{name:"Innate Spellcasting (1/Day)",desc:"The mephit can innately cast blur, requiring no material components. Its innate spellcasting ability is Charisma.",attack_bonus:0}],actions:[{name:"Claws",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one creature. Hit: 2 (1d4) slashing damage plus 2 (1d4) fire damage.",attack_bonus:2,damage_dice:"2d4"},{name:"Steam Breath (Recharge 6)",desc:"The mephit exhales a 15-foot cone of scalding steam. Each creature in that area must succeed on a DC 10 Dexterity saving throw, taking 4 (1d8) fire damage on a failed save, or half as much damage on a successful one.",attack_bonus:0},{name:"Variant: Summon Mephits (1/Day)",desc:"The mephit has a 25 percent chance of summoning 1d4 mephits of its kind. A summoned mephit appears in an unoccupied space within 60 feet of its summoner, acts as an ally of its summoner, and can't summon other mephits. It remains for 1 minute, until it or its summoner dies, or until its summoner dismisses it as an action.",attack_bonus:0}]},{name:"Stirge",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:14,hp:2,hit_dice:"1d4 + -1",speed:"10 ft., fly 40 ft.",stats:[4,16,11,2,8,6],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 9",languages:"",cr:"1/8",actions:[{name:"Blood Drain",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one creature. Hit: 5 (1d4 + 3) piercing damage, and the stirge attaches to the target. While attached, the stirge doesn't attack. Instead, at the start of each of the stirge's turns, the target loses 5 (1d4 + 3) hit points due to blood loss.\\nThe stirge can detach itself by spending 5 feet of its movement. It does so after it drains 10 hit points of blood from the target or the target dies. A creature, including the target, can use its action to detach the stirge.",attack_bonus:5,damage_dice:"1d4",damage_bonus:3}]},{name:"Stone Giant",size:"Huge",type:"giant",subtype:"",alignment:"neutral",ac:17,hp:126,hit_dice:"11d12 + 54",speed:"40 ft.",stats:[23,15,20,10,12,9],saves:[{dexterity:5},{constitution:8},{wisdom:4}],skillsaves:[{athletics:12},{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 14",languages:"Giant",cr:"7",traits:[{name:"Stone Camouflage",desc:"The giant has advantage on Dexterity (Stealth) checks made to hide in rocky terrain.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The giant makes two greatclub attacks.",attack_bonus:0},{name:"Greatclub",desc:"Melee Weapon Attack: +9 to hit, reach 15 ft., one target. Hit: 19 (3d8 + 6) bludgeoning damage.",attack_bonus:9,damage_dice:"3d8",damage_bonus:6},{name:"Rock",desc:"Ranged Weapon Attack: +9 to hit, range 60/240 ft., one target. Hit: 28 (4d10 + 6) bludgeoning damage. If the target is a creature, it must succeed on a DC 17 Strength saving throw or be knocked prone.",attack_bonus:9,damage_dice:"4d10",damage_bonus:6}],reactions:[{name:"Rock Catching",desc:"If a rock or similar object is hurled at the giant, the giant can, with a successful DC 10 Dexterity saving throw, catch the missile and take no bludgeoning damage from it.",attack_bonus:0}]},{name:"Stone Golem",size:"Large",type:"construct",subtype:"",alignment:"unaligned",ac:17,hp:178,hit_dice:"17d10 + 84",speed:"30 ft.",stats:[22,9,20,3,11,1],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison, psychic; bludgeoning, piercing, and slashing from nonmagical weapons that aren't adamantine",condition_immunities:"charmed, exhaustion, frightened, paralyzed, petrified, poisoned",senses:"darkvision 120 ft., passive Perception 10",languages:"understands the languages of its creator but can't speak",cr:"10",traits:[{name:"Immutable Form",desc:"The golem is immune to any spell or effect that would alter its form.",attack_bonus:0},{name:"Magic Resistance",desc:"The golem has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Magic Weapons",desc:"The golem's weapon attacks are magical.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The golem makes two slam attacks.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +10 to hit, reach 5 ft., one target. Hit: 19 (3d8 + 6) bludgeoning damage.",attack_bonus:10,damage_dice:"3d8",damage_bonus:6},{name:"Slow (Recharge 5-6)",desc:"The golem targets one or more creatures it can see within 10 ft. of it. Each target must make a DC 17 Wisdom saving throw against this magic. On a failed save, a target can't use reactions, its speed is halved, and it can't make more than one attack on its turn. In addition, the target can take either an action or a bonus action on its turn, not both. These effects last for 1 minute. A target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0}]},{name:"Storm Giant",size:"Huge",type:"giant",subtype:"",alignment:"chaotic good",ac:16,hp:230,hit_dice:"20d12 + 100",speed:"50 ft., swim 50 ft.",stats:[29,14,20,16,18,18],saves:[{strength:14},{constitution:10},{wisdom:9},{charisma:9}],skillsaves:[{arcana:8},{athletics:14},{history:8},{perception:9}],damage_vulnerabilities:"",damage_resistances:"cold",damage_immunities:"lightning, thunder",condition_immunities:"",senses:"passive Perception 19",languages:"Common, Giant",cr:"13",traits:[{name:"Amphibious",desc:"The giant can breathe air and water.",attack_bonus:0},{name:"Innate Spellcasting",desc:"The giant's innate spellcasting ability is Charisma (spell save DC 17). It can innately cast the following spells, requiring no material components:\\n\\nAt will: detect magic, feather fall, levitate, light\\n3/day each: control weather, water breathing",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The giant makes two greatsword attacks.",attack_bonus:0},{name:"Greatsword",desc:"Melee Weapon Attack: +14 to hit, reach 10 ft., one target. Hit: 30 (6d6 + 9) slashing damage.",attack_bonus:14,damage_dice:"6d6",damage_bonus:9},{name:"Rock",desc:"Ranged Weapon Attack: +14 to hit, range 60/240 ft., one target. Hit: 35 (4d12 + 9) bludgeoning damage.",attack_bonus:14,damage_dice:"4d12",damage_bonus:9},{name:"Lightning Strike (Recharge 5-6)",desc:"The giant hurls a magical lightning bolt at a point it can see within 500 feet of it. Each creature within 10 feet of that point must make a DC 17 Dexterity saving throw, taking 54 (12d8) lightning damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"12d8"}]},{name:"Succubus/Incubus",size:"Medium",type:"fiend",subtype:"shapechanger",alignment:"neutral evil",ac:15,hp:66,hit_dice:"12d8 + 12",speed:"30 ft., fly 60 ft.",stats:[8,17,13,15,12,20],skillsaves:[{deception:9},{insight:5},{perception:5},{persuasion:9},{stealth:7}],damage_vulnerabilities:"",damage_resistances:"cold, fire, lightning, poison; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 15",languages:"Abyssal, Common, Infernal, telepathy 60 ft.",cr:"4",traits:[{name:"Telepathic Bond",desc:"The fiend ignores the range restriction on its telepathy when communicating with a creature it has charmed. The two don't even need to be on the same plane of existence.",attack_bonus:0},{name:"Shapechanger",desc:"The fiend can use its action to polymorph into a Small or Medium humanoid, or back into its true form. Without wings, the fiend loses its flying speed. Other than its size and speed, its statistics are the same in each form. Any equipment it is wearing or carrying isn't transformed. It reverts to its true form if it dies.",attack_bonus:0}],actions:[{name:"Claw (Fiend Form Only)",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) slashing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3},{name:"Charm",desc:"One humanoid the fiend can see within 30 feet of it must succeed on a DC 15 Wisdom saving throw or be magically charmed for 1 day. The charmed target obeys the fiend's verbal or telepathic commands. If the target suffers any harm or receives a suicidal command, it can repeat the saving throw, ending the effect on a success. If the target successfully saves against the effect, or if the effect on it ends, the target is immune to this fiend's Charm for the next 24 hours.\\nThe fiend can have only one target charmed at a time. If it charms another, the effect on the previous target ends.",attack_bonus:0},{name:"Draining Kiss",desc:"The fiend kisses a creature charmed by it or a willing creature. The target must make a DC 15 Constitution saving throw against this magic, taking 32 (5d10 + 5) psychic damage on a failed save, or half as much damage on a successful one. The target's hit point maximum is reduced by an amount equal to the damage taken. This reduction lasts until the target finishes a long rest. The target dies if this effect reduces its hit point maximum to 0.",attack_bonus:0,damage_dice:"5d10",damage_bonus:5},{name:"Etherealness",desc:"The fiend magically enters the Ethereal Plane from the Material Plane, or vice versa.",attack_bonus:0}]},{name:"Swarm of Bats",size:"Medium",type:"swarm of Tiny beasts",subtype:"",alignment:"unaligned",ac:12,hp:22,hit_dice:"5d8 + -1",speed:"0 ft., fly 30 ft.",stats:[5,15,10,2,12,4],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, slashing",damage_immunities:"",condition_immunities:"charmed, frightened, grappled, paralyzed, petrified, prone, restrained, stunned",senses:"blindsight 60 ft., passive Perception 11",languages:"",cr:"1/4",traits:[{name:"Echolocation",desc:"The swarm can't use its blindsight while deafened.",attack_bonus:0},{name:"Keen Hearing",desc:"The swarm has advantage on Wisdom (Perception) checks that rely on hearing.",attack_bonus:0},{name:"Swarm",desc:"The swarm can occupy another creature's space and vice versa, and the swarm can move through any opening large enough for a Tiny bat. The swarm can't regain hit points or gain temporary hit points.",attack_bonus:0}],actions:[{name:"Bites",desc:"Melee Weapon Attack: +4 to hit, reach 0 ft., one creature in the swarm's space. Hit: 5 (2d4) piercing damage, or 2 (1d4) piercing damage if the swarm has half of its hit points or fewer.",attack_bonus:4,damage_dice:"2d4"}]},{name:"Swarm of Beetles",size:"Medium",type:"swarm of Tiny beasts",subtype:"",alignment:"unaligned",ac:12,hp:22,hit_dice:"5d8 + -1",speed:"20 ft., burrow 5 ft., climb 20 ft.",stats:[3,13,10,1,7,1],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, slashing",damage_immunities:"",condition_immunities:"charmed, frightened, grappled, paralyzed, petrified, prone, restrained, stunned",senses:"blindsight 10 ft., passive Perception 8",languages:"",cr:"1/2",traits:[{name:"Swarm",desc:"The swarm can occupy another creature's space and vice versa, and the swarm can move through any opening large enough for a Tiny insect. The swarm can't regain hit points or gain temporary hit points.",attack_bonus:0}],actions:[{name:"Bites",desc:"Melee Weapon Attack: +3 to hit, reach 0 ft., one target in the swarm's space. Hit: 10 (4d4) piercing damage, or 5 (2d4) piercing damage if the swarm has half of its hit points or fewer.",attack_bonus:3,damage_dice:"4d4"}]},{name:"Swarm of Centipedes",size:"Medium",type:"swarm of Tiny beasts",subtype:"",alignment:"unaligned",ac:12,hp:22,hit_dice:"5d8 + -1",speed:"20 ft., climb 20 ft.",stats:[3,13,10,1,7,1],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, slashing",damage_immunities:"",condition_immunities:"charmed, frightened, grappled, paralyzed, petrified, prone, restrained, stunned",senses:"blindsight 10 ft., passive Perception 8",languages:"",cr:"1/2",traits:[{name:"Swarm",desc:"The swarm can occupy another creature's space and vice versa, and the swarm can move through any opening large enough for a Tiny insect. The swarm can't regain hit points or gain temporary hit points.",attack_bonus:0}],actions:[{name:"Bites",desc:"Melee Weapon Attack: +3 to hit, reach 0 ft., one target in the swarm's space. Hit: 10 (4d4) piercing damage, or 5 (2d4) piercing damage if the swarm has half of its hit points or fewer.\\nA creature reduced to 0 hit points by a swarm of centipedes is stable but poisoned for 1 hour, even after regaining hit points, and paralyzed while poisoned in this way.",attack_bonus:3,damage_dice:"4d4"}]},{name:"Swarm of Insects",size:"Medium",type:"swarm of Tiny beasts",subtype:"",alignment:"unaligned",ac:12,hp:22,hit_dice:"5d8 + -1",speed:"20 ft., climb 20 ft.",stats:[3,13,10,1,7,1],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, slashing",damage_immunities:"",condition_immunities:"charmed, frightened, grappled, paralyzed, petrified, prone, restrained, stunned",senses:"blindsight 10 ft., passive Perception 8",languages:"",cr:"1/2",traits:[{name:"Swarm",desc:"The swarm can occupy another creature's space and vice versa, and the swarm can move through any opening large enough for a Tiny insect. The swarm can't regain hit points or gain temporary hit points.",attack_bonus:0}],actions:[{name:"Bites",desc:"Melee Weapon Attack: +3 to hit, reach 0 ft., one target in the swarm's space. Hit: 10 (4d4) piercing damage, or 5 (2d4) piercing damage if the swarm has half of its hit points or fewer.",attack_bonus:3,damage_dice:"4d4"}]},{name:"Swarm of Poisonous Snakes",size:"Medium",type:"swarm of Tiny beasts",subtype:"",alignment:"unaligned",ac:14,hp:36,hit_dice:"8d8",speed:"30 ft., swim 30 ft.",stats:[8,18,11,1,10,3],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, slashing",damage_immunities:"",condition_immunities:"charmed, frightened, grappled, paralyzed, petrified, prone, restrained, stunned",senses:"blindsight 10 ft., passive Perception 10",languages:"",cr:"2",traits:[{name:"Swarm",desc:"The swarm can occupy another creature's space and vice versa, and the swarm can move through any opening large enough for a Tiny snake. The swarm can't regain hit points or gain temporary hit points.",attack_bonus:0}],actions:[{name:"Bites",desc:"Melee Weapon Attack: +6 to hit, reach 0 ft., one creature in the swarm's space. Hit: 7 (2d6) piercing damage, or 3 (1d6) piercing damage if the swarm has half of its hit points or fewer. The target must make a DC 10 Constitution saving throw, taking 14 (4d6) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:6,damage_dice:"2d6"}]},{name:"Swarm of Quippers",size:"Medium",type:"swarm of Tiny beasts",subtype:"",alignment:"unaligned",ac:13,hp:28,hit_dice:"8d8 + -8",speed:"0 ft., swim 40 ft.",stats:[13,16,9,1,7,2],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, slashing",damage_immunities:"",condition_immunities:"charmed, frightened, grappled, paralyzed, petrified, prone, restrained, stunned",senses:"darkvision 60 ft., passive Perception 8",languages:"",cr:"1",traits:[{name:"Blood Frenzy",desc:"The swarm has advantage on melee attack rolls against any creature that doesn't have all its hit points.",attack_bonus:0},{name:"Swarm",desc:"The swarm can occupy another creature's space and vice versa, and the swarm can move through any opening large enough for a Tiny quipper. The swarm can't regain hit points or gain temporary hit points.",attack_bonus:0},{name:"Water Breathing",desc:"The swarm can breathe only underwater.",attack_bonus:0}],actions:[{name:"Bites",desc:"Melee Weapon Attack: +5 to hit, reach 0 ft., one creature in the swarm's space. Hit: 14 (4d6) piercing damage, or 7 (2d6) piercing damage if the swarm has half of its hit points or fewer.",attack_bonus:5,damage_dice:"4d6"}]},{name:"Swarm of Rats",size:"Medium",type:"swarm of Tiny beasts",subtype:"",alignment:"unaligned",ac:10,hp:24,hit_dice:"7d8 + -8",speed:"30 ft.",stats:[9,11,9,2,10,3],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, slashing",damage_immunities:"",condition_immunities:"charmed, frightened, grappled, paralyzed, petrified, prone, restrained, stunned",senses:"darkvision 30 ft., passive Perception 10",languages:"",cr:"1/4",traits:[{name:"Keen Smell",desc:"The swarm has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0},{name:"Swarm",desc:"The swarm can occupy another creature's space and vice versa, and the swarm can move through any opening large enough for a Tiny rat. The swarm can't regain hit points or gain temporary hit points.",attack_bonus:0}],actions:[{name:"Bites",desc:"Melee Weapon Attack: +2 to hit, reach 0 ft., one target in the swarm's space. Hit: 7 (2d6) piercing damage, or 3 (1d6) piercing damage if the swarm has half of its hit points or fewer.",attack_bonus:2,damage_dice:"2d6"}]},{name:"Swarm of Ravens",size:"Medium",type:"swarm of Tiny beasts",subtype:"",alignment:"unaligned",ac:12,hp:24,hit_dice:"7d8 + -8",speed:"10 ft., fly 50 ft.",stats:[6,14,8,3,12,6],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, slashing",damage_immunities:"",condition_immunities:"charmed, frightened, grappled, paralyzed, petrified, prone, restrained, stunned",senses:"passive Perception 15",languages:"",cr:"1/4",traits:[{name:"Swarm",desc:"The swarm can occupy another creature's space and vice versa, and the swarm can move through any opening large enough for a Tiny raven. The swarm can't regain hit points or gain temporary hit points.",attack_bonus:0}],actions:[{name:"Beaks",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target in the swarm's space. Hit: 7 (2d6) piercing damage, or 3 (1d6) piercing damage if the swarm has half of its hit points or fewer.",attack_bonus:4,damage_dice:"2d6"}]},{name:"Swarm of Spiders",size:"Medium",type:"swarm of Tiny beasts",subtype:"",alignment:"unaligned",ac:12,hp:22,hit_dice:"5d8 + -1",speed:"20 ft., climb 20 ft.",stats:[3,13,10,1,7,1],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, slashing",damage_immunities:"",condition_immunities:"charmed, frightened, paralyzed, petrified, prone, restrained, stunned",senses:"blindsight 10 ft., passive Perception 8",languages:"",cr:"1/2",traits:[{name:"Swarm",desc:"The swarm can occupy another creature's space and vice versa, and the swarm can move through any opening large enough for a Tiny insect. The swarm can't regain hit points or gain temporary hit points.",attack_bonus:0},{name:"Spider Climb",desc:"The swarm can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0},{name:"Web Sense",desc:"While in contact with a web, the swarm knows the exact location of any other creature in contact with the same web.",attack_bonus:0},{name:"Web Walker",desc:"The swarm ignores movement restrictions caused by webbing.",attack_bonus:0}],actions:[{name:"Bites",desc:"Melee Weapon Attack: +3 to hit, reach 0 ft., one target in the swarm's space. Hit: 10 (4d4) piercing damage, or 5 (2d4) piercing damage if the swarm has half of its hit points or fewer.",attack_bonus:3,damage_dice:"4d4"}]},{name:"Swarm of Wasps",size:"Medium",type:"swarm of Tiny beasts",subtype:"",alignment:"unaligned",ac:12,hp:22,hit_dice:"5d8 + -1",speed:"5 ft., fly 30 ft.",stats:[3,13,10,1,7,1],damage_vulnerabilities:"",damage_resistances:"bludgeoning, piercing, slashing",damage_immunities:"",condition_immunities:"charmed, frightened, grappled, paralyzed, petrified, prone, restrained, stunned",senses:"blindsight 10 ft., passive Perception 8",languages:"",cr:"1/2",traits:[{name:"Swarm",desc:"The swarm can occupy another creature's space and vice versa, and the swarm can move through any opening large enough for a Tiny insect. The swarm can't regain hit points or gain temporary hit points.",attack_bonus:0}],actions:[{name:"Bites",desc:"Melee Weapon Attack: +3 to hit, reach 0 ft., one target in the swarm's space. Hit: 10 (4d4) piercing damage, or 5 (2d4) piercing damage if the swarm has half of its hit points or fewer.",attack_bonus:3,damage_dice:"4d4"}]},{name:"Tarrasque",size:"Gargantuan",type:"monstrosity",subtype:"titan",alignment:"unaligned",ac:25,hp:676,hit_dice:"33d20 + 329",speed:"40 ft.",stats:[30,11,30,3,11,11],saves:[{intelligence:5},{wisdom:9},{charisma:9}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire, poison; bludgeoning, piercing, and slashing from nonmagical weapons",condition_immunities:"charmed, frightened, paralyzed, poisoned",senses:"blindsight 120 ft., passive Perception 10",languages:"",cr:"30",traits:[{name:"Legendary Resistance (3/Day)",desc:"If the tarrasque fails a saving throw, it can choose to succeed instead.",attack_bonus:0},{name:"Magic Resistance",desc:"The tarrasque has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Reflective Carapace",desc:"Any time the tarrasque is targeted by a magic missile spell, a line spell, or a spell that requires a ranged attack roll, roll a d6. On a 1 to 5, the tarrasque is unaffected. On a 6, the tarrasque is unaffected, and the effect is reflected back at the caster as though it originated from the tarrasque, turning the caster into the target.",attack_bonus:0},{name:"Siege Monster",desc:"The tarrasque deals double damage to objects and structures.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The tarrasque can use its Frightful Presence. It then makes five attacks: one with its bite, two with its claws, one with its horns, and one with its tai l. It can use its Swallow instead of its bite.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +19 to hit, reach 10 ft., one target. Hit: 36 (4d12 + 10) piercing damage. If the target is a creature, it is grappled (escape DC 20). Until this grapple ends, the target is restrained, and the tarrasque can't bite another target.",attack_bonus:19,damage_dice:"4d12",damage_bonus:10},{name:"Claw",desc:"Melee Weapon Attack: +19 to hit, reach 15 ft., one target. Hit: 28 (4d8 + 10) slashing damage.",attack_bonus:19,damage_dice:"4d8",damage_bonus:10},{name:"Horns",desc:"Melee Weapon Attack: +19 to hit, reach 10 ft., one target. Hit: 32 (4d10 + 10) piercing damage.",attack_bonus:19,damage_dice:"4d10",damage_bonus:10},{name:"Tail",desc:"Melee Weapon Attack: +19 to hit, reach 20 ft., one target. Hit: 24 (4d6 + 10) bludgeoning damage. If the target is a creature, it must succeed on a DC 20 Strength saving throw or be knocked prone.",attack_bonus:19,damage_dice:"4d6",damage_bonus:10},{name:"Frightful Presence",desc:"Each creature of the tarrasque's choice within 120 feet of it and aware of it must succeed on a DC 17 Wisdom saving throw or become frightened for 1 minute. A creature can repeat the saving throw at the end of each of its turns, with disadvantage if the tarrasque is within line of sight, ending the effect on itself on a success. If a creature's saving throw is successful or the effect ends for it, the creature is immune to the tarrasque's Frightful Presence for the next 24 hours.",attack_bonus:0},{name:"Swallow",desc:"The tarrasque makes one bite attack against a Large or smaller creature it is grappling. If the attack hits, the target takes the bite's damage, the target is swallowed, and the grapple ends. While swallowed, the creature is blinded and restrained, it has total cover against attacks and other effects outside the tarrasque, and it takes 56 (16d6) acid damage at the start of each of the tarrasque's turns.\\nIf the tarrasque takes 60 damage or more on a single turn from a creature inside it, the tarrasque must succeed on a DC 20 Constitution saving throw at the end of that turn or regurgitate all swallowed creatures, which fall prone in a space within 10 feet of the tarrasque. If the tarrasque dies, a swallowed creature is no longer restrained by it and can escape from the corpse by using 30 feet of movement, exiting prone.",attack_bonus:0}],legendary_actions:[{name:"Attack",desc:"The tarrasque makes one claw attack or tail attack.",attack_bonus:0},{name:"Move",desc:"The tarrasque moves up to half its speed.",attack_bonus:0},{name:"Chomp (Costs 2 Actions)",desc:"The tarrasque makes one bite attack or uses its Swallow.",attack_bonus:0}]},{name:"Thug",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any non-good alignment",ac:11,hp:32,hit_dice:"5d8 + 9",speed:"30 ft.",stats:[15,11,14,10,10,11],skillsaves:[{intimidation:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"any one language (usually Common)",cr:"1/2",traits:[{name:"Pack Tactics",desc:"The thug has advantage on an attack roll against a creature if at least one of the thug's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The thug makes two melee attacks.",attack_bonus:0},{name:"Mace",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 5 (1d6 + 2) bludgeoning damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Heavy Crossbow",desc:"Ranged Weapon Attack: +2 to hit, range 100/400 ft., one target. Hit: 5 (1d10) piercing damage.",attack_bonus:2,damage_dice:"1d10"}]},{name:"Tiger",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:12,hp:37,hit_dice:"5d10 + 9",speed:"40 ft.",stats:[17,15,14,3,12,8],skillsaves:[{perception:3},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 13",languages:"",cr:"1",traits:[{name:"Keen Smell",desc:"The tiger has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0},{name:"Pounce",desc:"If the tiger moves at least 20 ft. straight toward a creature and then hits it with a claw attack on the same turn, that target must succeed on a DC 13 Strength saving throw or be knocked prone. If the target is prone, the tiger can make one bite attack against it as a bonus action.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 8 (1d10 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d10",damage_bonus:3},{name:"Claw",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) slashing damage.",attack_bonus:0}]},{name:"Treant",size:"Huge",type:"plant",subtype:"",alignment:"chaotic good",ac:16,hp:138,hit_dice:"12d12 + 60",speed:"30 ft.",stats:[23,8,21,12,16,12],damage_vulnerabilities:"fire",damage_resistances:"bludgeoning, piercing",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"Common, Druidic, Elvish, Sylvan",cr:"9",traits:[{name:"False Appearance",desc:"While the treant remains motionless, it is indistinguishable from a normal tree.",attack_bonus:0},{name:"Siege Monster",desc:"The treant deals double damage to objects and structures.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The treant makes two slam attacks.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +10 to hit, reach 5 ft., one target. Hit: 16 (3d6 + 6) bludgeoning damage.",attack_bonus:10,damage_dice:"3d6",damage_bonus:6},{name:"Rock",desc:"Ranged Weapon Attack: +10 to hit, range 60/180 ft., one target. Hit: 28 (4d10 + 6) bludgeoning damage.",attack_bonus:10,damage_dice:"4d10",damage_bonus:6},{name:"Animate Trees (1/Day)",desc:"The treant magically animates one or two trees it can see within 60 feet of it. These trees have the same statistics as a treant, except they have Intelligence and Charisma scores of 1, they can't speak, and they have only the Slam action option. An animated tree acts as an ally of the treant. The tree remains animate for 1 day or until it dies; until the treant dies or is more than 120 feet from the tree; or until the treant takes a bonus action to turn it back into an inanimate tree. The tree then takes root if possible.",attack_bonus:0}]},{name:"Tribal Warrior",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:12,hp:11,hit_dice:"2d8 + 2",speed:"30 ft.",stats:[13,11,12,8,11,8],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"any one language",cr:"1/8",traits:[{name:"Pack Tactics",desc:"The warrior has advantage on an attack roll against a creature if at least one of the warrior's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Spear",desc:"Melee or Ranged Weapon Attack: +3 to hit, reach 5 ft. or range 20/60 ft., one target. Hit: 4 (1d6 + 1) piercing damage, or 5 (1d8 + 1) piercing damage if used with two hands to make a melee attack.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1}]},{name:"Triceratops",size:"Huge",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:95,hit_dice:"10d12 + 30",speed:"50 ft.",stats:[22,9,17,2,11,5],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 10",languages:"",cr:"5",traits:[{name:"Trampling Charge",desc:"If the triceratops moves at least 20 ft. straight toward a creature and then hits it with a gore attack on the same turn, that target must succeed on a DC 13 Strength saving throw or be knocked prone. If the target is prone, the triceratops can make one stomp attack against it as a bonus action.",attack_bonus:0}],actions:[{name:"Gore",desc:"Melee Weapon Attack: +9 to hit, reach 5 ft., one target. Hit: 24 (4d8 + 6) piercing damage.",attack_bonus:9,damage_dice:"4d8",damage_bonus:6},{name:"Stomp",desc:"Melee Weapon Attack: +9 to hit, reach 5 ft., one prone creature. Hit: 22 (3d10 + 6) bludgeoning damage",attack_bonus:9,damage_dice:"3d10",damage_bonus:6}]},{name:"Troll",size:"Large",type:"giant",subtype:"",alignment:"chaotic evil",ac:15,hp:84,hit_dice:"8d10 + 40",speed:"30 ft.",stats:[18,13,20,7,9,7],skillsaves:[{perception:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 12",languages:"Giant",cr:"5",traits:[{name:"Keen Smell",desc:"The troll has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0},{name:"Regeneration",desc:"The troll regains 10 hit points at the start of its turn. If the troll takes acid or fire damage, this trait doesn't function at the start of the troll's next turn. The troll dies only if it starts its turn with 0 hit points and doesn't regenerate.",attack_bonus:0},{name:"Variant: Loathsome Limbs",desc:"Whenever the troll takes at least 15 slashing damage at one time, roll a d20 to determine what else happens to it:\\n1-10: Nothing else happens.\\n11-14: One leg is severed from the troll if it has any legs left.\\n15- 18: One arm is severed from the troll if it has any arms left.\\n19-20: The troll is decapitated, but the troll dies only if it can't regenerate. If it dies, so does the severed head.\\nIf the troll finishes a short or long rest without reattaching a severed limb or head, the part regrows. At that point, the severed part dies. Until then, a severed part acts on the troll's initiative and has its own action and movement. A severed part has AC 13, 10 hit points, and the troll's Regeneration trait.\\nA severed leg is unable to attack and has a speed of 5 feet.\\nA severed arm has a speed of 5 feet and can make one claw attack on its turn, with disadvantage on the attack roll unless the troll can see the arm and its target. Each time the troll loses an arm, it loses a claw attack.\\nIf its head is severed, the troll loses its bite attack and its body is blinded unless the head can see it. The severed head has a speed of 0 feet and the troll's Keen Smell trait. It can make a bite attack but only against a target in its space.\\nThe troll's speed is halved if it's missing a leg. If it loses both legs, it falls prone. If it has both arms, it can crawl. With only one arm, it can still crawl, but its speed is halved. With no arms or legs, its speed is 0, and it can't benefit from bonuses to speed.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The troll makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 7 (1d6 + 4) piercing damage.",attack_bonus:7,damage_dice:"1d6",damage_bonus:4},{name:"Claw",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) slashing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4}]},{name:"Tyrannosaurus Rex",size:"Huge",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:136,hit_dice:"13d12 + 51",speed:"50 ft.",stats:[25,10,19,2,12,9],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 14",languages:"",cr:"8",actions:[{name:"Multiattack",desc:"The tyrannosaurus makes two attacks: one with its bite and one with its tail. It can't make both attacks against the same target.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +10 to hit, reach 10 ft., one target. Hit: 33 (4d12 + 7) piercing damage. If the target is a Medium or smaller creature, it is grappled (escape DC 17). Until this grapple ends, the target is restrained, and the tyrannosaurus can't bite another target.",attack_bonus:10,damage_dice:"4d12",damage_bonus:7},{name:"Tail",desc:"Melee Weapon Attack: +10 to hit, reach 10 ft., one target. Hit: 20 (3d8 + 7) bludgeoning damage.",attack_bonus:10,damage_dice:"3d8",damage_bonus:7}]},{name:"Unicorn",size:"Large",type:"celestial",subtype:"",alignment:"lawful good",ac:12,hp:67,hit_dice:"9d10 + 17",speed:"50 ft.",stats:[18,14,15,11,17,16],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison",condition_immunities:"charmed, paralyzed, poisoned",senses:"darkvision 60 ft., passive Perception 13",languages:"Celestial, Elvish, Sylvan, telepathy 60 ft.",cr:"5",traits:[{name:"Charge",desc:"If the unicorn moves at least 20 ft. straight toward a target and then hits it with a horn attack on the same turn, the target takes an extra 9 (2d8) piercing damage. If the target is a creature, it must succeed on a DC 15 Strength saving throw or be knocked prone.",attack_bonus:0,damage_dice:"2d8"},{name:"Innate Spellcasting",desc:"The unicorn's innate spellcasting ability is Charisma (spell save DC 14). The unicorn can innately cast the following spells, requiring no components:\\n\\nAt will: detect evil and good, druidcraft, pass without trace\\n1/day each: calm emotions, dispel evil and good, entangle",attack_bonus:0},{name:"Magic Resistance",desc:"The unicorn has advantage on saving throws against spells and other magical effects.",attack_bonus:0},{name:"Magic Weapons",desc:"The unicorn's weapon attacks are magical.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The unicorn makes two attacks: one with its hooves and one with its horn.",attack_bonus:0},{name:"Hooves",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft ., one target. Hit: 11 (2d6 + 4) bludgeoning damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Horn",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft ., one target. Hit: 8 (1d8 + 4) piercing damage.",attack_bonus:7,damage_dice:"1d8",damage_bonus:4},{name:"Healing Touch (3/Day)",desc:"The unicorn touches another creature with its horn. The target magically regains 11 (2d8 + 2) hit points. In addition, the touch removes all diseases and neutralizes all poisons afflicting the target.",attack_bonus:0},{name:"Teleport (1/Day)",desc:"The unicorn magically teleports itself and up to three willing creatures it can see within 5 ft. of it, along with any equipment they are wearing or carrying, to a location the unicorn is familiar with, up to 1 mile away.",attack_bonus:0}],legendary_actions:[{name:"Hooves",desc:"The unicorn makes one attack with its hooves.",attack_bonus:0},{name:"Shimmering Shield (Costs 2 Actions)",desc:"The unicorn creates a shimmering, magical field around itself or another creature it can see within 60 ft. of it. The target gains a +2 bonus to AC until the end of the unicorn's next turn.",attack_bonus:0},{name:"Heal Self (Costs 3 Actions)",desc:"The unicorn magically regains 11 (2d8 + 2) hit points.",attack_bonus:0}]},{name:"Vampire",size:"Medium",type:"undead",subtype:"shapechanger",alignment:"lawful evil",ac:16,hp:144,hit_dice:"17d8 + 67",speed:"30 ft.",stats:[18,18,18,17,15,18],saves:[{dexterity:9},{wisdom:7},{charisma:9}],skillsaves:[{perception:7},{stealth:9}],damage_vulnerabilities:"",damage_resistances:"necrotic; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"",condition_immunities:"",senses:"darkvision 120 ft., passive Perception 17",languages:"the languages it knew in life",cr:"13",traits:[{name:"Shapechanger",desc:"If the vampire isn't in sun light or running water, it can use its action to polymorph into a Tiny bat or a Medium cloud of mist, or back into its true form.\\nWhile in bat form, the vampire can't speak, its walking speed is 5 feet, and it has a flying speed of 30 feet. Its statistics, other than its size and speed, are unchanged. Anything it is wearing transforms with it, but nothing it is carrying does. It reverts to its true form if it dies.\\nWhile in mist form, the vampire can't take any actions, speak, or manipulate objects. It is weightless, has a flying speed of 20 feet, can hover, and can enter a hostile creature's space and stop there. In addition, if air can pass through a space, the mist can do so without squeezing, and it can't pass through water. It has advantage on Strength, Dexterity, and Constitution saving throws, and it is immune to all nonmagical damage, except the damage it takes from sunlight.",attack_bonus:0},{name:"Legendary Resistance (3/Day)",desc:"If the vampire fails a saving throw, it can choose to succeed instead.",attack_bonus:0},{name:"Misty Escape",desc:"When it drops to 0 hit points outside its resting place, the vampire transforms into a cloud of mist (as in the Shapechanger trait) instead of falling unconscious, provided that it isn't in sunlight or running water. If it can't transform, it is destroyed.\\nWhile it has 0 hit points in mist form, it can't revert to its vampire form, and it must reach its resting place within 2 hours or be destroyed. Once in its resting place, it reverts to its vampire form. It is then paralyzed until it regains at least 1 hit point. After spending 1 hour in its resting place with 0 hit points, it regains 1 hit point.",attack_bonus:0},{name:"Regeneration",desc:"The vampire regains 20 hit points at the start of its turn if it has at least 1 hit point and isn't in sunlight or running water. If the vampire takes radiant damage or damage from holy water, this trait doesn't function at the start of the vampire's next turn.",attack_bonus:0},{name:"Spider Climb",desc:"The vampire can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0},{name:"Vampire Weaknesses",desc:"The vampire has the following flaws:\\nForbiddance. The vampire can't enter a residence without an invitation from one of the occupants.\\nHarmed by Running Water. The vampire takes 20 acid damage if it ends its turn in running water.\\nStake to the Heart. If a piercing weapon made of wood is driven into the vampire's heart while the vampire is incapacitated in its resting place, the vampire is paralyzed until the stake is removed.\\nSunlight Hypersensitivity. The vampire takes 20 radiant damage when it starts its turn in sunlight. While in sunlight, it has disadvantage on attack rolls and ability checks.",attack_bonus:0}],actions:[{name:"Multiattack (Vampire Form Only)",desc:"The vampire makes two attacks, only one of which can be a bite attack.",attack_bonus:0},{name:"Unarmed Strike (Vampire Form Only)",desc:"Melee Weapon Attack: +9 to hit, reach 5 ft., one creature. Hit: 8 (1d8 + 4) bludgeoning damage. Instead of dealing damage, the vampire can grapple the target (escape DC 18).",attack_bonus:9,damage_dice:"1d8",damage_bonus:4},{name:"Bite (Bat or Vampire Form Only)",desc:"Melee Weapon Attack: +9 to hit, reach 5 ft., one willing creature, or a creature that is grappled by the vampire, incapacitated, or restrained. Hit: 7 (1d6 + 4) piercing damage plus 10 (3d6) necrotic damage. The target's hit point maximum is reduced by an amount equal to the necrotic damage taken, and the vampire regains hit points equal to that amount. The reduction lasts until the target finishes a long rest. The target dies if this effect reduces its hit point maximum to 0. A humanoid slain in this way and then buried in the ground rises the following night as a vampire spawn under the vampire's control.",attack_bonus:9,damage_dice:"1d6 + 3d6",damage_bonus:4},{name:"Charm",desc:"The vampire targets one humanoid it can see within 30 ft. of it. If the target can see the vampire, the target must succeed on a DC 17 Wisdom saving throw against this magic or be charmed by the vampire. The charmed target regards the vampire as a trusted friend to be heeded and protected. Although the target isn't under the vampire's control, it takes the vampire's requests or actions in the most favorable way it can, and it is a willing target for the vampire's bit attack.\\nEach time the vampire or the vampire's companions do anything harmful to the target, it can repeat the saving throw, ending the effect on itself on a success. Otherwise, the effect lasts 24 hours or until the vampire is destroyed, is on a different plane of existence than the target, or takes a bonus action to end the effect.",attack_bonus:0},{name:"Children of the Night (1/Day)",desc:"The vampire magically calls 2d4 swarms of bats or rats, provided that the sun isn't up. While outdoors, the vampire can call 3d6 wolves instead. The called creatures arrive in 1d4 rounds, acting as allies of the vampire and obeying its spoken commands. The beasts remain for 1 hour, until the vampire dies, or until the vampire dismisses them as a bonus action.",attack_bonus:0}],legendary_actions:[{name:"Move",desc:"The vampire moves up to its speed without provoking opportunity attacks.",attack_bonus:0},{name:"Unarmed Strike",desc:"The vampire makes one unarmed strike.",attack_bonus:0},{name:"Bite (Costs 2 Actions)",desc:"The vampire makes one bite attack.",attack_bonus:0}]},{name:"Vampire Spawn",size:"Medium",type:"undead",subtype:"",alignment:"neutral evil",ac:15,hp:82,hit_dice:"11d8 + 32",speed:"30 ft.",stats:[16,16,16,11,10,12],saves:[{dexterity:6},{wisdom:3}],skillsaves:[{perception:3},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"necrotic; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 13",languages:"the languages it knew in life",cr:"5",traits:[{name:"Regeneration",desc:"The vampire regains 10 hit points at the start of its turn if it has at least 1 hit point and isn't in sunlight or running water. If the vampire takes radiant damage or damage from holy water, this trait doesn't function at the start of the vampire's next turn.",attack_bonus:0},{name:"Spider Climb",desc:"The vampire can climb difficult surfaces, including upside down on ceilings, without needing to make an ability check.",attack_bonus:0},{name:"Vampire Weaknesses",desc:"The vampire has the following flaws:\\nForbiddance. The vampire can't enter a residence without an invitation from one of the occupants.\\nHarmed by Running Water. The vampire takes 20 acid damage when it ends its turn in running water.\\nStake to the Heart. The vampire is destroyed if a piercing weapon made of wood is driven into its heart while it is incapacitated in its resting place.\\nSunlight Hypersensitivity. The vampire takes 20 radiant damage when it starts its turn in sunlight. While in sunlight, it has disadvantage on attack rolls and ability checks.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The vampire makes two attacks, only one of which can be a bite attack.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one willing creature, or a creature that is grappled by the vampire, incapacitated, or restrained. Hit: 6 (1d6 + 3) piercing damage plus 7 (2d6) necrotic damage. The target's hit point maximum is reduced by an amount equal to the necrotic damage taken, and the vampire regains hit points equal to that amount. The reduction lasts until the target finishes a long rest. The target dies if this effect reduces its hit point maximum to 0.",attack_bonus:61},{name:"Claws",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one creature. Hit: 8 (2d4 + 3) slashing damage. Instead of dealing damage, the vampire can grapple the target (escape DC 13).",attack_bonus:6,damage_dice:"2d4",damage_bonus:3}]},{name:"Veteran",size:"Medium",type:"humanoid",subtype:"any race",alignment:"any alignment",ac:17,hp:58,hit_dice:"9d8 + 17",speed:"30 ft.",stats:[16,13,14,10,11,10],skillsaves:[{athletics:5},{perception:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 12",languages:"any one language (usually Common)",cr:"3",actions:[{name:"Multiattack",desc:"The veteran makes two longsword attacks. If it has a shortsword drawn, it can also make a shortsword attack.",attack_bonus:0},{name:"Longsword",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) slashing damage, or 8 (1d10 + 3) slashing damage if used with two hands.",attack_bonus:5,damage_dice:"1d8",damage_bonus:3},{name:"Shortsword",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) piercing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3},{name:"Heavy Crossbow",desc:"Ranged Weapon Attack: +3 to hit, range 100/400 ft., one target. Hit: 6 (1d10 + 1) piercing damage.",attack_bonus:3,damage_dice:"1d10",damage_bonus:1}]},{name:"Violet Fungus",size:"Medium",type:"plant",subtype:"",alignment:"unaligned",ac:5,hp:18,hit_dice:"4d8",speed:"5 ft.",stats:[3,1,10,1,3,1],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"blinded, deafened, frightened",senses:"blindsight 30 ft. (blind beyond this radius), passive Perception 6",languages:"",cr:"1/4",traits:[{name:"False Appearance",desc:"While the violet fungus remains motionless, it is indistinguishable from an ordinary fungus.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The fungus makes 1d4 Rotting Touch attacks.",attack_bonus:0},{name:"Rotting Touch",desc:"Melee Weapon Attack: +2 to hit, reach 10 ft., one creature. Hit: 4 (1d8) necrotic damage.",attack_bonus:2,damage_dice:"1d8"}]},{name:"Vrock",size:"Large",type:"fiend",subtype:"demon",alignment:"chaotic evil",ac:15,hp:104,hit_dice:"11d10 + 43",speed:"40 ft., fly 60 ft.",stats:[17,15,18,8,13,8],saves:[{dexterity:5},{wisdom:4},{charisma:2}],damage_vulnerabilities:"",damage_resistances:"cold, fire, lightning; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"poison",condition_immunities:"poisoned",senses:"darkvision 120 ft., passive Perception 11",languages:"Abyssal, telepathy 120 ft.",cr:"6",traits:[{name:"Magic Resistance",desc:"The vrock has advantage on saving throws against spells and other magical effects.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The vrock makes two attacks: one with its beak and one with its talons.",attack_bonus:0},{name:"Beak",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) piercing damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:3},{name:"Talons",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 14 (2d10 + 3) slashing damage.",attack_bonus:6,damage_dice:"2d10",damage_bonus:3},{name:"Spores (Recharge 6)",desc:"A 15-foot-radius cloud of toxic spores extends out from the vrock. The spores spread around corners. Each creature in that area must succeed on a DC 14 Constitution saving throw or become poisoned. While poisoned in this way, a target takes 5 (1d10) poison damage at the start of each of its turns. A target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. Emptying a vial of holy water on the target also ends the effect on it.",attack_bonus:0},{name:"Stunning Screech (1/Day)",desc:"The vrock emits a horrific screech. Each creature within 20 feet of it that can hear it and that isn't a demon must succeed on a DC 14 Constitution saving throw or be stunned until the end of the vrock's next turn .",attack_bonus:0},{name:"Variant: Summon Demon (1/Day)",desc:"The demon chooses what to summon and attempts a magical summoning.\\nA vrock has a 30 percent chance of summoning 2d4 dretches or one vrock.\\nA summoned demon appears in an unoccupied space within 60 feet of its summoner, acts as an ally of its summoner, and can't summon other demons. It remains for 1 minute, until it or its summoner dies, or until its summoner dismisses it as an action.",attack_bonus:0}]},{name:"Vulture",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:10,hp:5,hit_dice:"1d8",speed:"10 ft., fly 50 ft.",stats:[7,10,13,2,12,4],skillsaves:[{perception:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"0",traits:[{name:"Keen Sight and Smell",desc:"The vulture has advantage on Wisdom (Perception) checks that rely on sight or smell.",attack_bonus:0},{name:"Pack Tactics",desc:"The vulture has advantage on an attack roll against a creature if at least one of the vulture's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Beak",desc:"Melee Weapon Attack: +2 to hit, reach 5 ft., one target. Hit: 2 (1d4) piercing damage.",attack_bonus:2,damage_dice:"1d4"}]},{name:"Warhorse",size:"Large",type:"beast",subtype:"",alignment:"unaligned",ac:11,hp:19,hit_dice:"3d10 + 2",speed:"60 ft.",stats:[18,12,13,2,12,7],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 11",languages:"",cr:"1/2",traits:[{name:"Trampling Charge",desc:"If the horse moves at least 20 ft. straight toward a creature and then hits it with a hooves attack on the same turn, that target must succeed on a DC 14 Strength saving throw or be knocked prone. If the target is prone, the horse can make another attack with its hooves against it as a bonus action.",attack_bonus:0}],actions:[{name:"Hooves",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) bludgeoning damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:4}]},{name:"Warhorse Skeleton",size:"Large",type:"undead",subtype:"",alignment:"lawful evil",ac:13,hp:22,hit_dice:"3d10 + 5",speed:"60 ft.",stats:[18,12,15,2,8,5],damage_vulnerabilities:"bludgeoning",damage_resistances:"",damage_immunities:"poison",condition_immunities:"exhaustion, poisoned",senses:"darkvision 60 ft., passive Perception 9",languages:"",cr:"1/2",actions:[{name:"Hooves",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) bludgeoning damage.",attack_bonus:6,damage_dice:"2d6",damage_bonus:4}]},{name:"Water Elemental",size:"Large",type:"elemental",subtype:"",alignment:"neutral",ac:14,hp:114,hit_dice:"12d10 + 48",speed:"30 ft., swim 90 ft.",stats:[18,14,18,5,10,8],damage_vulnerabilities:"",damage_resistances:"acid; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"poison",condition_immunities:"exhaustion, grappled, paralyzed, petrified, poisoned, prone, restrained, unconscious",senses:"darkvision 60 ft., passive Perception 10",languages:"Aquan",cr:"5",traits:[{name:"Water Form",desc:"The elemental can enter a hostile creature's space and stop there. It can move through a space as narrow as 1 inch wide without squeezing.",attack_bonus:0},{name:"Freeze",desc:"If the elemental takes cold damage, it partially freezes; its speed is reduced by 20 ft. until the end of its next turn.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The elemental makes two slam attacks.",attack_bonus:0},{name:"Slam",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) bludgeoning damage.",attack_bonus:7,damage_dice:"2d8",damage_bonus:4},{name:"Whelm (Recharge 4-6)",desc:"Each creature in the elemental's space must make a DC 15 Strength saving throw. On a failure, a target takes 13 (2d8 + 4) bludgeoning damage. If it is Large or smaller, it is also grappled (escape DC 14). Until this grapple ends, the target is restrained and unable to breathe unless it can breathe water. If the saving throw is successful, the target is pushed out of the elemental's space.\\nThe elemental can grapple one Large creature or up to two Medium or smaller creatures at one time. At the start of each of the elemental's turns, each target grappled by it takes 13 (2d8 + 4) bludgeoning damage. A creature within 5 feet of the elemental can pull a creature or object out of it by taking an action to make a DC 14 Strength and succeeding.",attack_bonus:0}]},{name:"Weasel",size:"Tiny",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:1,hit_dice:"1d4 + -2",speed:"30 ft.",stats:[3,16,8,2,12,3],skillsaves:[{perception:3},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"0",traits:[{name:"Keen Hearing and Smell",desc:"The weasel has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one creature. Hit: 1 piercing damage.",attack_bonus:5,damage_bonus:1}]},{name:"Werebear",size:"Medium",type:"humanoid",subtype:"human",alignment:"neutral good",ac:10,hp:135,hit_dice:"18d8 + 54",speed:"30 ft. (40 ft., climb 30 ft. in bear or hybrid form)",stats:[19,10,17,11,12,12],skillsaves:[{perception:7}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"bludgeoning, piercing, and slashing damage from nonmagical weapons that aren't silvered",condition_immunities:"",senses:"passive Perception 17",languages:"Common (can't speak in bear form)",cr:"5",traits:[{name:"Shapechanger",desc:"The werebear can use its action to polymorph into a Large bear-humanoid hybrid or into a Large bear, or back into its true form, which is humanoid. Its statistics, other than its size and AC, are the same in each form. Any equipment it. is wearing or carrying isn't transformed. It reverts to its true form if it dies.",attack_bonus:0},{name:"Keen Smell",desc:"The werebear has advantage on WisGlom (Perception) checks that rely on smell.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"In bear form, the werebear makes two claw attacks. In humanoid form, it makes two greataxe attacks. In hybrid form, it can attack like a bear or a humanoid.",attack_bonus:0},{name:"Bite (Bear or Hybrid Form Only)",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 15 (2d10 + 4) piercing damage. If the target is a humanoid, it must succeed on a DC 14 Constitution saving throw or be cursed with were bear lycanthropy.",attack_bonus:7,damage_dice:"2d10",damage_bonus:4},{name:"Claw (Bear or Hybrid Form Only)",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) slashing damage.",attack_bonus:7,damage_dice:"2d8",damage_bonus:4},{name:"Greataxe (Humanoid or Hybrid Form Only)",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 10 (1d12 + 4) slashing damage.",attack_bonus:7,damage_dice:"1d12",damage_bonus:4}]},{name:"Wereboar",size:"Medium",type:"humanoid",subtype:"human",alignment:"neutral evil",ac:10,hp:78,hit_dice:"12d8 + 24",speed:"30 ft. (40 ft. in boar form)",stats:[17,10,15,10,11,8],skillsaves:[{perception:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"bludgeoning, piercing, and slashing damage from nonmagical weapons that aren't silvered",condition_immunities:"",senses:"passive Perception 12",languages:"Common (can't speak in boar form)",cr:"4",traits:[{name:"Shapechanger",desc:"The wereboar can use its action to polymorph into a boar-humanoid hybrid or into a boar, or back into its true form, which is humanoid. Its statistics, other than its AC, are the same in each form. Any equipment it is wearing or carrying isn't transformed. It reverts to its true form if it dies.",attack_bonus:0},{name:"Charge (Boar or Hybrid Form Only)",desc:"If the wereboar moves at least 15 feet straight toward a target and then hits it with its tusks on the same turn, the target takes an extra 7 (2d6) slashing damage. If the target is a creature, it must succeed on a DC 13 Strength saving throw or be knocked prone.",attack_bonus:0,damage_dice:"2d6"},{name:"Relentless (Recharges after a Short or Long Rest)",desc:"If the wereboar takes 14 damage or less that would reduce it to 0 hit points, it is reduced to 1 hit point instead.",attack_bonus:0}],actions:[{name:"Multiattack (Humanoid or Hybrid Form Only)",desc:"The wereboar makes two attacks, only one of which can be with its tusks.",attack_bonus:0},{name:"Maul (Humanoid or Hybrid Form Only)",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) bludgeoning damage.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3},{name:"Tusks (Boar or Hybrid Form Only)",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) slashing damage. If the target is a humanoid, it must succeed on a DC 12 Constitution saving throw or be cursed with wereboar lycanthropy.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3}]},{name:"Wererat",size:"Medium",type:"humanoid",subtype:"human",alignment:"lawful evil",ac:12,hp:33,hit_dice:"6d8 + 6",speed:"30 ft.",stats:[10,15,12,11,10,8],skillsaves:[{perception:2},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"bludgeoning, piercing, and slashing damage from nonmagical weapons that aren't silvered",condition_immunities:"",senses:"darkvision 60 ft. (rat form only), passive Perception 12",languages:"Common (can't speak in rat form)",cr:"2",traits:[{name:"Shapechanger",desc:"The wererat can use its action to polymorph into a rat-humanoid hybrid or into a giant rat, or back into its true form, which is humanoid. Its statistics, other than its size, are the same in each form. Any equipment it is wearing or carrying isn't transformed. It reverts to its true form if it dies.",attack_bonus:0},{name:"Keen Smell",desc:"The wererat has advantage on Wisdom (Perception) checks that rely on smell.",attack_bonus:0}],actions:[{name:"Multiattack (Humanoid or Hybrid Form Only)",desc:"The wererat makes two attacks, only one of which can be a bite.",attack_bonus:0},{name:"Bite (Rat or Hybrid Form Only).",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 4 (1d4 + 2) piercing damage. If the target is a humanoid, it must succeed on a DC 11 Constitution saving throw or be cursed with wererat lycanthropy.",attack_bonus:4,damage_dice:"1d4",damage_bonus:2},{name:"Shortsword (Humanoid or Hybrid Form Only)",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Hand Crossbow (Humanoid or Hybrid Form Only)",desc:"Ranged Weapon Attack: +4 to hit, range 30/120 ft., one target. Hit: 5 (1d6 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2}]},{name:"Weretiger",size:"Medium",type:"humanoid",subtype:"human",alignment:"neutral",ac:12,hp:120,hit_dice:"16d8 + 48",speed:"30 ft. (40 ft. in tiger form)",stats:[17,15,16,10,13,11],skillsaves:[{perception:5},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"bludgeoning, piercing, and slashing damage from nonmagical weapons that aren't silvered",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 15",languages:"Common (can't speak in tiger form)",cr:"4",traits:[{name:"Shapechanger",desc:"The weretiger can use its action to polymorph into a tiger-humanoid hybrid or into a tiger, or back into its true form, which is humanoid. Its statistics, other than its size, are the same in each form. Any equipment it is wearing or carrying isn't transformed. It reverts to its true form if it dies.",attack_bonus:0},{name:"Keen Hearing and Smell",desc:"The weretiger has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0},{name:"Pounce (Tiger or Hybrid Form Only)",desc:"If the weretiger moves at least 15 feet straight toward a creature and then hits it with a claw attack on the same turn, that target must succeed on a DC 14 Strength saving throw or be knocked prone. If the target is prone, the weretiger can make one bite attack against it as a bonus action.",attack_bonus:0}],actions:[{name:"Multiattack (Humanoid or Hybrid Form Only)",desc:"In humanoid form, the weretiger makes two scimitar attacks or two longbow attacks. In hybrid form, it can attack like a humanoid or make two claw attacks.",attack_bonus:0},{name:"Bite (Tiger or Hybrid Form Only)",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 8 (1d10 + 3) piercing damage. If the target is a humanoid, it must succeed on a DC 13 Constitution saving throw or be cursed with weretiger lycanthropy.",attack_bonus:5,damage_dice:"1d10",damage_bonus:3},{name:"Claw (Tiger or Hybrid Form Only)",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) slashing damage.",attack_bonus:5,damage_dice:"1d8",damage_bonus:3},{name:"Scimitar (Humanoid or Hybrid Form Only)",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) slashing damage.",attack_bonus:5,damage_dice:"1d6",damage_bonus:3},{name:"Longbow (Humanoid or Hybrid Form Only)",desc:"Ranged Weapon Attack: +4 to hit, range 150/600 ft., one target. Hit: 6 (1d8 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2}]},{name:"Werewolf",size:"Medium",type:"humanoid",subtype:"human",alignment:"chaotic evil",ac:11,hp:58,hit_dice:"9d8 + 17",speed:"30 ft. (40 ft. in wolf form)",stats:[15,13,14,10,11,10],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"bludgeoning, piercing, and slashing damage from nonmagical weapons that aren't silvered",condition_immunities:"",senses:"passive Perception 14",languages:"Common (can't speak in wolf form)",cr:"3",traits:[{name:"Shapechanger",desc:"The werewolf can use its action to polymorph into a wolf-humanoid hybrid or into a wolf, or back into its true form, which is humanoid. Its statistics, other than its AC, are the same in each form. Any equipment it is wearing or carrying isn't transformed. It reverts to its true form if it dies.",attack_bonus:0},{name:"Keen Hearing and Smell",desc:"The werewolf has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0}],actions:[{name:"Multiattack (Humanoid or Hybrid Form Only)",desc:"The werewolf makes two attacks: one with its bite and one with its claws or spear.",attack_bonus:0},{name:"Bite (Wolf or Hybrid Form Only)",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 6 (1d8 + 2) piercing damage. If the target is a humanoid, it must succeed on a DC 12 Constitution saving throw or be cursed with werewolf lycanthropy.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2},{name:"Claws (Hybrid Form Only)",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 7 (2d4 + 2) slashing damage.",attack_bonus:4,damage_dice:"2d4",damage_bonus:2},{name:"Spear (Humanoid Form Only)",desc:"Melee or Ranged Weapon Attack: +4 to hit, reach 5 ft. or range 20/60 ft., one creature. Hit: 5 (1d6 + 2) piercing damage, or 6 (1d8 + 2) piercing damage if used with two hands to make a melee attack.",attack_bonus:4,damage_dice:"1d6",damage_bonus:-2}]},{name:"White Dragon Wyrmling",size:"Medium",type:"dragon",subtype:"",alignment:"chaotic evil",ac:16,hp:32,hit_dice:"5d8 + 9",speed:"30 ft., burrow 15 ft., fly 60 ft., swim 30 ft.",stats:[14,10,14,5,10,11],saves:[{dexterity:2},{constitution:4},{wisdom:2},{charisma:2}],skillsaves:[{perception:4},{stealth:2}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"cold",condition_immunities:"",senses:"blindsight 10 ft., darkvision 60 ft., passive Perception 14",languages:"Draconic",cr:"2",actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (1d10 + 2) piercing damage plus 2 (1d4) cold damage.",attack_bonus:4,damage_dice:"1d10 + 1d4",damage_bonus:2},{name:"Cold Breath (Recharge 5-6)",desc:"The dragon exhales an icy blast of hail in a 15-foot cone. Each creature in that area must make a DC 12 Constitution saving throw, taking 22 (5d8) cold damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"5d8"}]},{name:"Wight",size:"Medium",type:"undead",subtype:"",alignment:"neutral evil",ac:14,hp:45,hit_dice:"6d8 + 18",speed:"30 ft.",stats:[15,14,16,10,13,15],skillsaves:[{perception:3},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"necrotic; bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 13",languages:"the languages it knew in life",cr:"3",traits:[{name:"Sunlight Sensitivity",desc:"While in sunlight, the wight has disadvantage on attack rolls, as well as on Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The wight makes two longsword attacks or two longbow attacks. It can use its Life Drain in place of one longsword attack.",attack_bonus:0},{name:"Life Drain",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one creature. Hit: 5 (1d6 + 2) necrotic damage. The target must succeed on a DC 13 Constitution saving throw or its hit point maximum is reduced by an amount equal to the damage taken. This reduction lasts until the target finishes a long rest. The target dies if this effect reduces its hit point maximum to 0.\\nA humanoid slain by this attack rises 24 hours later as a zombie under the wight's control, unless the humanoid is restored to life or its body is destroyed. The wight can have no more than twelve zombies under its control at one time.",attack_bonus:4,damage_dice:"1d6",damage_bonus:2},{name:"Longsword",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 6 (1d8 + 2) slashing damage, or 7 (1d10 + 2) slashing damage if used with two hands.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2},{name:"Longbow",desc:"Ranged Weapon Attack: +4 to hit, range 150/600 ft., one target. Hit: 6 (1d8 + 2) piercing damage.",attack_bonus:4,damage_dice:"1d8",damage_bonus:2}]},{name:"Will-o'-Wisp",size:"Tiny",type:"undead",subtype:"",alignment:"chaotic evil",ac:19,hp:22,hit_dice:"9d4 + -1",speed:"0 ft., fly 50 ft. (hover)",stats:[1,28,10,13,14,11],damage_vulnerabilities:"",damage_resistances:"acid, cold, fire, necrotic, thunder; bludgeoning, piercing, and slashing from nonmagical weapons",damage_immunities:"lightning, poison",condition_immunities:"exhaustion, grappled, paralyzed, poisoned, prone, restrained, unconscious",senses:"darkvision 120 ft., passive Perception 12",languages:"the languages it knew in life",cr:"2",traits:[{name:"Consume Life",desc:"As a bonus action, the will-o'-wisp can target one creature it can see within 5 ft. of it that has 0 hit points and is still alive. The target must succeed on a DC 10 Constitution saving throw against this magic or die. If the target dies, the will-o'-wisp regains 10 (3d6) hit points.",attack_bonus:0},{name:"Ephemeral",desc:"The will-o'-wisp can't wear or carry anything.",attack_bonus:0},{name:"Incorporeal Movement",desc:"The will-o'-wisp can move through other creatures and objects as if they were difficult terrain. It takes 5 (1d10) force damage if it ends its turn inside an object.",attack_bonus:0},{name:"Variable Illumination",desc:"The will-o'-wisp sheds bright light in a 5- to 20-foot radius and dim light for an additional number of ft. equal to the chosen radius. The will-o'-wisp can alter the radius as a bonus action.",attack_bonus:0}],actions:[{name:"Shock",desc:"Melee Spell Attack: +4 to hit, reach 5 ft., one creature. Hit: 9 (2d8) lightning damage.",attack_bonus:4,damage_dice:"2d8"},{name:"Invisibility",desc:"The will-o'-wisp and its light magically become invisible until it attacks or uses its Consume Life, or until its concentration ends (as if concentrating on a spell).",attack_bonus:0}]},{name:"Winter Wolf",size:"Large",type:"monstrosity",subtype:"",alignment:"neutral evil",ac:13,hp:75,hit_dice:"10d10 + 20",speed:"50 ft.",stats:[18,13,14,7,12,8],skillsaves:[{perception:5},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"cold",condition_immunities:"",senses:"passive Perception 15",languages:"Common, Giant, Winter Wolf",cr:"3",traits:[{name:"Keen Hearing and Smell",desc:"The wolf has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0},{name:"Pack Tactics",desc:"The wolf has advantage on an attack roll against a creature if at least one of the wolf's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0},{name:"Snow Camouflage",desc:"The wolf has advantage on Dexterity (Stealth) checks made to hide in snowy terrain.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) piercing damage. If the target is a creature, it must succeed on a DC 14 Strength saving throw or be knocked prone.",attack_bonus:6,damage_dice:"2d6",damage_bonus:4},{name:"Cold Breath (Recharge 5-6)",desc:"The wolf exhales a blast of freezing wind in a 15-foot cone. Each creature in that area must make a DC 12 Dexterity saving throw, taking 18 (4d8) cold damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"4d8"}]},{name:"Wolf",size:"Medium",type:"beast",subtype:"",alignment:"unaligned",ac:13,hp:11,hit_dice:"2d8 + 2",speed:"40 ft.",stats:[12,15,12,3,12,6],skillsaves:[{perception:3},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"passive Perception 13",languages:"",cr:"1/4",traits:[{name:"Keen Hearing and Smell",desc:"The wolf has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0},{name:"Pack Tactics",desc:"The wolf has advantage on an attack roll against a creature if at least one of the wolf's allies is within 5 ft. of the creature and the ally isn't incapacitated.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 7 (2d4 + 2) piercing damage. If the target is a creature, it must succeed on a DC 11 Strength saving throw or be knocked prone.",attack_bonus:4,damage_dice:"2d4",damage_bonus:2}]},{name:"Worg",size:"Large",type:"monstrosity",subtype:"",alignment:"neutral evil",ac:13,hp:26,hit_dice:"4d10 + 4",speed:"50 ft.",stats:[16,13,13,7,11,8],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 14",languages:"Goblin, Worg",cr:"1/2",traits:[{name:"Keen Hearing and Smell",desc:"The worg has advantage on Wisdom (Perception) checks that rely on hearing or smell.",attack_bonus:0}],actions:[{name:"Bite",desc:"Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 10 (2d6 + 3) piercing damage. If the target is a creature, it must succeed on a DC 13 Strength saving throw or be knocked prone.",attack_bonus:5,damage_dice:"2d6",damage_bonus:3}]},{name:"Wraith",size:"Medium",type:"undead",subtype:"",alignment:"neutral evil",ac:13,hp:67,hit_dice:"9d8 + 26",speed:"0 ft., fly 60 ft. (hover)",stats:[6,16,16,12,14,15],damage_vulnerabilities:"",damage_resistances:"acid, cold, fire, lightning, thunder; bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered",damage_immunities:"necrotic, poison",condition_immunities:"charmed, exhaustion, grappled, paralyzed, petrified, poisoned, prone, restrained",senses:"darkvision 60 ft., passive Perception 12",languages:"the languages it knew in life",cr:"5",traits:[{name:"Incorporeal Movement",desc:"The wraith can move through other creatures and objects as if they were difficult terrain. It takes 5 (1d10) force damage if it ends its turn inside an object.",attack_bonus:0},{name:"Sunlight Sensitivity",desc:"While in sunlight, the wraith has disadvantage on attack rolls, as well as on Wisdom (Perception) checks that rely on sight.",attack_bonus:0}],actions:[{name:"Life Drain",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one creature. Hit: 21 (4d8 + 3) necrotic damage. The target must succeed on a DC 14 Constitution saving throw or its hit point maximum is reduced by an amount equal to the damage taken. This reduction lasts until the target finishes a long rest. The target dies if this effect reduces its hit point maximum to 0.",attack_bonus:6,damage_dice:"4d8",damage_bonus:3},{name:"Create Specter",desc:"The wraith targets a humanoid within 10 feet of it that has been dead for no longer than 1 minute and died violently. The target's spirit rises as a specter in the space of its corpse or in the nearest unoccupied space. The specter is under the wraith's control. The wraith can have no more than seven specters under its control at one time.",attack_bonus:0}]},{name:"Wyvern",size:"Large",type:"dragon",subtype:"",alignment:"unaligned",ac:13,hp:110,hit_dice:"13d10 + 38",speed:"20 ft., fly 80 ft.",stats:[19,10,16,5,12,6],skillsaves:[{perception:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., passive Perception 14",languages:"",cr:"6",actions:[{name:"Multiattack",desc:"The wyvern makes two attacks: one with its bite and one with its stinger. While flying, it can use its claws in place of one other attack.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 10 ft., one creature. Hit: 11 (2d6 + 4) piercing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Claws",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 13 (2d8 + 4) slashing damage.",attack_bonus:7,damage_dice:"2d8",damage_bonus:4},{name:"Stinger",desc:"Melee Weapon Attack: +7 to hit, reach 10 ft., one creature. Hit: 11 (2d6 + 4) piercing damage. The target must make a DC 15 Constitution saving throw, taking 24 (7d6) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4}]},{name:"Xorn",size:"Medium",type:"elemental",subtype:"",alignment:"neutral",ac:19,hp:73,hit_dice:"7d8 + 41",speed:"20 ft., burrow 20 ft.",stats:[17,10,22,11,10,11],skillsaves:[{perception:6},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"piercing and slashing from nonmagical weapons that aren't adamantine",damage_immunities:"",condition_immunities:"",senses:"darkvision 60 ft., tremorsense 60 ft., passive Perception 16",languages:"Terran",cr:"5",traits:[{name:"Earth Glide",desc:"The xorn can burrow through nonmagical, unworked earth and stone. While doing so, the xorn doesn't disturb the material it moves through.",attack_bonus:0},{name:"Stone Camouflage",desc:"The xorn has advantage on Dexterity (Stealth) checks made to hide in rocky terrain.",attack_bonus:0},{name:"Treasure Sense",desc:"The xorn can pinpoint, by scent, the location of precious metals and stones, such as coins and gems, within 60 ft. of it.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The xorn makes three claw attacks and one bite attack.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 13 (3d6 + 3) piercing damage.",attack_bonus:6,damage_dice:"3d6",damage_bonus:3},{name:"Claw",desc:"Melee Weapon Attack: +6 to hit, reach 5 ft., one target. Hit: 6 (1d6 + 3) slashing damage.",attack_bonus:6,damage_dice:"1d6",damage_bonus:3}]},{name:"Young Black Dragon",size:"Large",type:"dragon",subtype:"",alignment:"chaotic evil",ac:18,hp:127,hit_dice:"15d10 + 44",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[19,14,17,12,11,15],saves:[{dexterity:5},{constitution:6},{wisdom:3},{charisma:5}],skillsaves:[{perception:6},{stealth:5}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"acid",condition_immunities:"",senses:"blindsight 30 ft., darkvision 120 ft., passive Perception 16",languages:"Common, Draconic",cr:"7",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 10 ft., one target. Hit: 15 (2d10 + 4) piercing damage plus 4 (1d8) acid damage.",attack_bonus:7,damage_dice:"2d10 + 1d8",damage_bonus:4},{name:"Claw",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) slashing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Acid Breath (Recharge 5-6)",desc:"The dragon exhales acid in a 30-foot line that is 5 feet wide. Each creature in that line must make a DC 14 Dexterity saving throw, taking 49 (11d8) acid damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"11d8"}]},{name:"Young Blue Dragon",size:"Large",type:"dragon",subtype:"",alignment:"lawful evil",ac:18,hp:152,hit_dice:"16d10 + 64",speed:"40 ft., burrow 40 ft., fly 80 ft.",stats:[21,10,19,14,13,17],saves:[{dexterity:4},{constitution:8},{wisdom:5},{charisma:7}],skillsaves:[{perception:9},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning",condition_immunities:"",senses:"blindsight 30 ft., darkvision 120 ft., passive Perception 19",languages:"Common, Draconic",cr:"9",actions:[{name:"Multiattack",desc:"The dragon makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +9 to hit, reach 10 ft., one target. Hit: 16 (2d10 + 5) piercing damage plus 5 (1d10) lightning damage.",attack_bonus:9,damage_dice:"2d10 + 1d10",damage_bonus:5},{name:"Claw",desc:"Melee Weapon Attack: +9 to hit, reach 5 ft., one target. Hit: 12 (2d6 + 5) slashing damage.",attack_bonus:9,damage_dice:"2d6",damage_bonus:5},{name:"Lightning Breath (Recharge 5-6)",desc:"The dragon exhales lightning in an 60-foot line that is 5 feet wide. Each creature in that line must make a DC 16 Dexterity saving throw, taking 55 (10d10) lightning damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"10d10"}]},{name:"Young Brass Dragon",size:"Large",type:"dragon",subtype:"",alignment:"chaotic good",ac:17,hp:110,hit_dice:"13d10 + 38",speed:"40 ft., burrow 20 ft., fly 80 ft.",stats:[19,10,17,12,11,15],saves:[{dexterity:3},{constitution:6},{wisdom:3},{charisma:5}],skillsaves:[{perception:6},{persuasion:5},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 30 ft., darkvision 120 ft., passive Perception 16",languages:"Common, Draconic",cr:"6",actions:[{name:"Multiattack",desc:"The dragon makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 10 ft., one target. Hit: 15 (2d10 + 4) piercing damage.",attack_bonus:7,damage_dice:"2d10",damage_bonus:4},{name:"Claw",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) slashing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nFire Breath. The dragon exhales fire in a 40-foot line that is 5 feet wide. Each creature in that line must make a DC 14 Dexterity saving throw, taking 42 (12d6) fire damage on a failed save, or half as much damage on a successful one.\\nSleep Breath. The dragon exhales sleep gas in a 30-foot cone. Each creature in that area must succeed on a DC 14 Constitution saving throw or fall unconscious for 5 minutes. This effect ends for a creature if the creature takes damage or someone uses an action to wake it.",attack_bonus:0,damage_dice:"12d6"}]},{name:"Young Bronze Dragon",size:"Large",type:"dragon",subtype:"",alignment:"lawful good",ac:18,hp:142,hit_dice:"15d10 + 59",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[21,10,19,14,13,17],saves:[{dexterity:3},{constitution:7},{wisdom:4},{charisma:6}],skillsaves:[{insight:4},{perception:7},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"lightning",condition_immunities:"",senses:"blindsight 30 ft., darkvision 120 ft., passive Perception 17",languages:"Common, Draconic",cr:"8",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +8 to hit, reach 10 ft., one target. Hit: 16 (2d10 + 5) piercing damage.",attack_bonus:8,damage_dice:"2d10",damage_bonus:5},{name:"Claw",desc:"Melee Weapon Attack: +8 to hit, reach 5 ft., one target. Hit: 12 (2d6 + 5) slashing damage.",attack_bonus:8,damage_dice:"2d6",damage_bonus:5},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nLightning Breath. The dragon exhales lightning in a 60-foot line that is 5 feet wide. Each creature in that line must make a DC 15 Dexterity saving throw, taking 55 (10d10) lightning damage on a failed save, or half as much damage on a successful one.\\nRepulsion Breath. The dragon exhales repulsion energy in a 30-foot cone. Each creature in that area must succeed on a DC 15 Strength saving throw. On a failed save, the creature is pushed 40 feet away from the dragon.",attack_bonus:0,damage_dice:"10d10"}]},{name:"Young Copper Dragon",size:"Large",type:"dragon",subtype:"",alignment:"chaotic good",ac:17,hp:119,hit_dice:"14d10 + 42",speed:"40 ft., climb 40 ft., fly 80 ft.",stats:[19,12,17,16,13,15],saves:[{dexterity:4},{constitution:6},{wisdom:4},{charisma:5}],skillsaves:[{deception:5},{perception:7},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"acid",condition_immunities:"",senses:"blindsight 30 ft., darkvision 120 ft., passive Perception 17",languages:"Common, Draconic",cr:"7",actions:[{name:"Multiattack",desc:"The dragon makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 10 ft., one target. Hit: 15 (2d10 + 4) piercing damage.",attack_bonus:7,damage_dice:"2d10",damage_bonus:4},{name:"Claw",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) slashing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nAcid Breath. The dragon exhales acid in an 40-foot line that is 5 feet wide. Each creature in that line must make a DC 14 Dexterity saving throw, taking 40 (9d8) acid damage on a failed save, or half as much damage on a successful one.\\nSlowing Breath. The dragon exhales gas in a 30-foot cone. Each creature in that area must succeed on a DC 14 Constitution saving throw. On a failed save, the creature can't use reactions, its speed is halved, and it can't make more than one attack on its turn. In addition, the creature can use either an action or a bonus action on its turn, but not both. These effects last for 1 minute. The creature can repeat the saving throw at the end of each of its turns, ending the effect on itself with a successful save.",attack_bonus:0,damage_dice:"9d8"}]},{name:"Young Gold Dragon",size:"Large",type:"dragon",subtype:"",alignment:"lawful good",ac:18,hp:178,hit_dice:"17d10 + 84",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[23,14,21,16,13,20],saves:[{dexterity:6},{constitution:9},{wisdom:5},{charisma:9}],skillsaves:[{insight:5},{perception:9},{persuasion:9},{stealth:6}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 30 ft., darkvision 120 ft., passive Perception 19",languages:"Common, Draconic",cr:"10",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +10 to hit, reach 10 ft., one target. Hit: 17 (2d10 + 6) piercing damage.",attack_bonus:10,damage_dice:"2d10",damage_bonus:6},{name:"Claw",desc:"Melee Weapon Attack: +10 to hit, reach 5 ft., one target. Hit: 13 (2d6 + 6) slashing damage.",attack_bonus:10,damage_dice:"2d6",damage_bonus:6},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nFire Breath. The dragon exhales fire in a 30-foot cone. Each creature in that area must make a DC 17 Dexterity saving throw, taking 55 (10d10) fire damage on a failed save, or half as much damage on a successful one.\\nWeakening Breath. The dragon exhales gas in a 30-foot cone. Each creature in that area must succeed on a DC 17 Strength saving throw or have disadvantage on Strength-based attack rolls, Strength checks, and Strength saving throws for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0,damage_dice:"10d10"}]},{name:"Young Green Dragon",size:"Large",type:"dragon",subtype:"",alignment:"lawful evil",ac:18,hp:136,hit_dice:"16d10 + 48",speed:"40 ft., fly 80 ft., swim 40 ft.",stats:[19,12,17,16,13,15],saves:[{dexterity:4},{constitution:6},{wisdom:4},{charisma:5}],skillsaves:[{deception:5},{perception:7},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"poison",condition_immunities:"poisoned",senses:"blindsight 30 ft., darkvision 120 ft., passive Perception 17",languages:"Common, Draconic",cr:"8",traits:[{name:"Amphibious",desc:"The dragon can breathe air and water.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 10 ft., one target. Hit: 15 (2d10 + 4) piercing damage plus 7 (2d6) poison damage.",attack_bonus:7,damage_dice:"2d10 + 2d6",damage_bonus:4},{name:"Claw",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) slashing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Poison Breath (Recharge 5-6)",desc:"The dragon exhales poisonous gas in a 30-foot cone. Each creature in that area must make a DC 14 Constitution saving throw, taking 42 (12d6) poison damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"12d6"}]},{name:"Young Red Dragon",size:"Large",type:"dragon",subtype:"",alignment:"chaotic evil",ac:18,hp:178,hit_dice:"17d10 + 84",speed:"40 ft., climb 40 ft., fly 80 ft.",stats:[23,10,21,14,11,19],saves:[{dexterity:4},{constitution:9},{wisdom:4},{charisma:8}],skillsaves:[{perception:8},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"fire",condition_immunities:"",senses:"blindsight 30 ft., darkvision 120 ft., passive Perception 18",languages:"Common, Draconic",cr:"10",actions:[{name:"Multiattack",desc:"The dragon makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +10 to hit, reach 10 ft., one target. Hit: 17 (2d10 + 6) piercing damage plus 3 (1d6) fire damage.",attack_bonus:10,damage_dice:"2d10 + 1d6",damage_bonus:6},{name:"Claw",desc:"Melee Weapon Attack: +10 to hit, reach 5 ft., one target. Hit: 13 (2d6 + 6) slashing damage.",attack_bonus:10,damage_dice:"2d6",damage_bonus:6},{name:"Fire Breath (Recharge 5-6)",desc:"The dragon exhales fire in a 30-foot cone. Each creature in that area must make a DC 17 Dexterity saving throw, taking 56 (16d6) fire damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"16d6"}]},{name:"Young Silver Dragon",size:"Large",type:"dragon",subtype:"",alignment:"lawful good",ac:18,hp:168,hit_dice:"16d10 + 80",speed:"40 ft., fly 80 ft.",stats:[23,10,21,14,11,19],saves:[{dexterity:4},{constitution:9},{wisdom:4},{charisma:8}],skillsaves:[{arcana:6},{history:6},{perception:8},{stealth:4}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"cold",condition_immunities:"",senses:"blindsight 30 ft., darkvision 120 ft., passive Perception 18",languages:"Common, Draconic",cr:"9",actions:[{name:"Multiattack",desc:"The dragon makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +10 to hit, reach 10 ft., one target. Hit: 17 (2d10 + 6) piercing damage.",attack_bonus:10,damage_dice:"2d10",damage_bonus:6},{name:"Claw",desc:"Melee Weapon Attack: +10 to hit, reach 5 ft., one target. Hit: 13 (2d6 + 6) slashing damage.",attack_bonus:10,damage_dice:"2d6",damage_bonus:6},{name:"Breath Weapons (Recharge 5-6)",desc:"The dragon uses one of the following breath weapons.\\nCold Breath. The dragon exhales an icy blast in a 30-foot cone. Each creature in that area must make a DC 17 Constitution saving throw, taking 54 (12d8) cold damage on a failed save, or half as much damage on a successful one.\\nParalyzing Breath. The dragon exhales paralyzing gas in a 30-foot cone. Each creature in that area must succeed on a DC 17 Constitution saving throw or be paralyzed for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.",attack_bonus:0,damage_dice:"12d8"}]},{name:"Young White Dragon",size:"Large",type:"dragon",subtype:"",alignment:"chaotic evil",ac:17,hp:133,hit_dice:"14d10 + 56",speed:"40 ft., burrow 20 ft., fly 80 ft., swim 40 ft.",stats:[18,10,18,6,11,12],saves:[{dexterity:3},{constitution:7},{wisdom:3},{charisma:4}],skillsaves:[{perception:6},{stealth:3}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"cold",condition_immunities:"",senses:"blindsight 30 ft., darkvision 120 ft., passive Perception 16",languages:"Common, Draconic",cr:"6",traits:[{name:"Ice Walk",desc:"The dragon can move across and climb icy surfaces without needing to make an ability check. Additionally, difficult terrain composed of ice or snow doesn't cost it extra moment.",attack_bonus:0}],actions:[{name:"Multiattack",desc:"The dragon makes three attacks: one with its bite and two with its claws.",attack_bonus:0},{name:"Bite",desc:"Melee Weapon Attack: +7 to hit, reach 10 ft., one target. Hit: 15 (2d10 + 4) piercing damage plus 4 (1d8) cold damage.",attack_bonus:7,damage_dice:"2d10 + 1d8",damage_bonus:4},{name:"Claw",desc:"Melee Weapon Attack: +7 to hit, reach 5 ft., one target. Hit: 11 (2d6 + 4) slashing damage.",attack_bonus:7,damage_dice:"2d6",damage_bonus:4},{name:"Cold Breath (Recharge 5-6)",desc:"The dragon exhales an icy blast in a 30-foot cone. Each creature in that area must make a DC 15 Constitution saving throw, taking 45 (10d8) cold damage on a failed save, or half as much damage on a successful one.",attack_bonus:0,damage_dice:"10d8"}]},{name:"Zombie",size:"Medium",type:"undead",subtype:"",alignment:"neutral evil",ac:8,hp:22,hit_dice:"3d8 + 8",speed:"20 ft.",stats:[13,6,16,3,6,5],saves:[{wisdom:0}],damage_vulnerabilities:"",damage_resistances:"",damage_immunities:"",condition_immunities:"poisoned",senses:"darkvision 60 ft., passive Perception 8",languages:"understands all languages it spoke in life but can't speak",cr:"1/4",traits:[{name:"Undead Fortitude",desc:"If damage reduces the zombie to 0 hit points, it must make a Constitution saving throw with a DC of 5+the damage taken, unless the damage is radiant or from a critical hit. On a success, the zombie drops to 1 hit point instead.",attack_bonus:0}],actions:[{name:"Slam",desc:"Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 4 (1d6 + 1) bludgeoning damage.",attack_bonus:3,damage_dice:"1d6",damage_bonus:1}]}];function wa(a){return a?new Map:$c}var $c=new Map(zc.map(a=>[a.name,a]));var Ht=require("obsidian");function pt(a){return a?a.toLowerCase().replace(/[^A-Za-z0-9\s]/g,"").replace(/\s+/g,"-"):""}function Va(a){return a[0].toUpperCase()+a.slice(1).toLowerCase()}function z(){return"xyxyxyxyxyxy".replace(/[xy]/g,function(a){var e=Math.random()*16|0,t=a=="x"?e:e&3|8;return t.toString(16)})}function Z(a,e=0,t=" ",n=!0){let i=[];if(e==5||a==null)return"";if(typeof a=="string")return a;if(typeof a=="number")return`${a}`;if(Array.isArray(a))i.push(`${n?"(":""}${a.map(s=>Z(s,e++)).join(t)}${n?")":""}`);else if(typeof a=="object")for(let s of Object.values(a))i.push(Z(s,e++));return i.join(" ")}var Ta=(a,e=0)=>{let t=[];if(e==5||!a||a==null)return"";if(typeof a=="string")return a;if(typeof a=="number")return`${a}`;if(Array.isArray(a))t.push(`${a.map(n=>Ta(n,e++)).join(" ")}`);else if(typeof a=="object")for(let[n,i]of Object.entries(a))t.push(Ta(n,e++),Ta(i,e++));return t.join(" ")};function Bs(a=[],e=[]){a||(a=[]),Array.isArray(a)||(a=[a]),e||(e=[]),Array.isArray(e)||(e=[e]);for(let t of e??[])if(!!t)if(Array.isArray(t)){let n=Ta(t.slice(1));a=a.filter(i=>i.name!=t[0]&&i.desc!=n),a.push({name:t[0],desc:n})}else typeof t=="object"&&("name"in t||"desc"in t)&&(a=a.filter(n=>n.name!=t.name||n.desc!=t.desc),a.push({name:t.name,desc:Ta(t.desc)}));return a}var jc=[{type:"inline",id:z(),properties:[],hasRule:!0,nested:[{type:"group",id:z(),properties:["name","size","type","subtype","alignment"],nested:[{type:"heading",id:z(),properties:["name"],conditioned:!0,size:1},{type:"subheading",id:z(),properties:["size","type","subtype","alignment"],conditioned:!0}],conditioned:!0},{type:"image",id:z(),properties:["image"]}]},{type:"group",id:z(),properties:["ac","hp","speed"],nested:[{type:"property",id:z(),properties:["ac"],display:"Armor Class",conditioned:!0},{type:"property",id:z(),properties:["hp"],display:"Hit Points",dice:!0,diceProperty:"hit_dice",diceCallback:'return [{ text: monster["hit_dice"] }]',conditioned:!0},{type:"property",id:z(),display:"Speed",properties:["speed"],conditioned:!0}],hasRule:!0,conditioned:!0},{type:"table",id:z(),properties:["stats"],headers:["Str","Dex","Con","Int","Wis","Cha"],calculate:!0,hasRule:!0,conditioned:!0},{type:"table",id:z(),properties:["fage_stats"],headers:["Accuracy","Communication","Constitution","Dexterity","Fighting","Intelligence","Perception","Strength","Willpower"],calculate:!1,hasRule:!0,conditioned:!0},{type:"group",id:z(),properties:["saves","skillsaves","damage_immunities","damage_resistances","damage_vulnerabilities","condition_immunities","cr","languages","senses"],nested:[{type:"saves",id:z(),display:"Saves",properties:["saves"],conditioned:!0},{type:"saves",id:z(),display:"Skills",properties:["skillsaves"],conditioned:!0},{type:"property",id:z(),display:"Damage Resistances",properties:["damage_resistances"],conditioned:!0},{type:"property",id:z(),display:"Damage Immunities",properties:["damage_immunities"],conditioned:!0},{type:"property",id:z(),display:"Condition Immunities",properties:["condition_immunities"],conditioned:!0},{type:"property",id:z(),display:"Damage Vulnerabilities",properties:["damage_vulnerabilities"],conditioned:!0},{type:"property",id:z(),display:"Senses",properties:["senses"],conditioned:!0},{type:"property",id:z(),display:"Languages",properties:["languages"],fallback:"-"},{type:"inline",id:z(),properties:[],conditioned:!0,nested:[{type:"property",id:z(),display:"Challenge",properties:["cr"],callback:`const CR = {
|
||
"0": {
|
||
cr: "0",
|
||
value: 0,
|
||
xp: 0
|
||
},
|
||
"1/8": {
|
||
cr: "1/8",
|
||
value: 0.125,
|
||
xp: 25
|
||
},
|
||
"1/4": {
|
||
cr: "1/4",
|
||
|
||
value: 0.25,
|
||
xp: 50
|
||
},
|
||
"1/2": {
|
||
cr: "1/2",
|
||
value: 0.5,
|
||
xp: 100
|
||
},
|
||
"0.125": {
|
||
cr: "1/8",
|
||
value: 0.125,
|
||
xp: 25
|
||
},
|
||
"0.25": {
|
||
cr: "1/4",
|
||
|
||
value: 0.25,
|
||
xp: 50
|
||
},
|
||
"0.5": {
|
||
cr: "1/2",
|
||
value: 0.5,
|
||
xp: 100
|
||
},
|
||
"1": {
|
||
cr: "1",
|
||
value: 1,
|
||
xp: 200
|
||
},
|
||
"2": {
|
||
cr: "2",
|
||
value: 2,
|
||
xp: 450
|
||
},
|
||
"3": {
|
||
cr: "3",
|
||
value: 3,
|
||
xp: 700
|
||
},
|
||
"4": {
|
||
cr: "4",
|
||
value: 4,
|
||
xp: 1100
|
||
},
|
||
"5": {
|
||
cr: "5",
|
||
value: 5,
|
||
xp: 1800
|
||
},
|
||
"6": {
|
||
cr: "6",
|
||
value: 6,
|
||
xp: 2300
|
||
},
|
||
"7": {
|
||
cr: "7",
|
||
value: 7,
|
||
xp: 2900
|
||
},
|
||
"8": {
|
||
cr: "8",
|
||
value: 8,
|
||
xp: 3900
|
||
},
|
||
"9": {
|
||
cr: "9",
|
||
value: 9,
|
||
xp: 5000
|
||
},
|
||
"10": {
|
||
cr: "10",
|
||
value: 10,
|
||
xp: 5900
|
||
},
|
||
"11": {
|
||
cr: "11",
|
||
value: 11,
|
||
xp: 7200
|
||
},
|
||
"12": {
|
||
cr: "12",
|
||
value: 12,
|
||
xp: 8400
|
||
},
|
||
"13": {
|
||
cr: "13",
|
||
value: 13,
|
||
xp: 10000
|
||
},
|
||
"14": {
|
||
cr: "14",
|
||
value: 14,
|
||
xp: 11500
|
||
},
|
||
"15": {
|
||
cr: "15",
|
||
value: 15,
|
||
xp: 13000
|
||
},
|
||
"16": {
|
||
cr: "16",
|
||
value: 16,
|
||
xp: 15000
|
||
},
|
||
"17": {
|
||
cr: "17",
|
||
value: 17,
|
||
xp: 18000
|
||
},
|
||
"18": {
|
||
cr: "18",
|
||
value: 18,
|
||
xp: 20000
|
||
},
|
||
"19": {
|
||
cr: "19",
|
||
value: 19,
|
||
xp: 22000
|
||
},
|
||
"20": {
|
||
cr: "20",
|
||
value: 20,
|
||
xp: 25000
|
||
},
|
||
"21": {
|
||
cr: "21",
|
||
value: 21,
|
||
xp: 33000
|
||
},
|
||
"22": {
|
||
cr: "22",
|
||
value: 22,
|
||
xp: 41000
|
||
},
|
||
"23": {
|
||
cr: "23",
|
||
value: 23,
|
||
xp: 50000
|
||
},
|
||
"24": {
|
||
cr: "24",
|
||
value: 24,
|
||
xp: 62000
|
||
},
|
||
"25": {
|
||
cr: "25",
|
||
value: 25,
|
||
xp: 75000
|
||
},
|
||
"26": {
|
||
cr: "26",
|
||
value: 26,
|
||
xp: 90000
|
||
},
|
||
"27": {
|
||
cr: "27",
|
||
value: 27,
|
||
xp: 105000
|
||
},
|
||
"28": {
|
||
cr: "28",
|
||
value: 28,
|
||
xp: 120000
|
||
},
|
||
"29": {
|
||
cr: "29",
|
||
value: 29,
|
||
xp: 135000
|
||
},
|
||
"30": {
|
||
cr: "30",
|
||
value: 30,
|
||
xp: 155000
|
||
}
|
||
};
|
||
if ("cr" in monster && monster.cr in CR) {
|
||
return \`\${CR[
|
||
monster.cr
|
||
].cr} (\${CR[
|
||
monster.cr
|
||
].xp.toLocaleString()} XP)\`;
|
||
}
|
||
return "";`},{type:"property",id:z(),display:"Proficiency Bonus",properties:["cr"],callback:`const CR = {
|
||
"0": {
|
||
cr: "0",
|
||
value: 0,
|
||
xp: 0
|
||
},
|
||
"1/8": {
|
||
cr: "1/8",
|
||
value: 0.125,
|
||
xp: 25
|
||
},
|
||
"1/4": {
|
||
cr: "1/4",
|
||
|
||
value: 0.25,
|
||
xp: 50
|
||
},
|
||
"1/2": {
|
||
cr: "1/2",
|
||
value: 0.5,
|
||
xp: 100
|
||
},
|
||
"0.125": {
|
||
cr: "1/8",
|
||
value: 0.125,
|
||
xp: 25
|
||
},
|
||
"0.25": {
|
||
cr: "1/4",
|
||
|
||
value: 0.25,
|
||
xp: 50
|
||
},
|
||
"0.5": {
|
||
cr: "1/2",
|
||
value: 0.5,
|
||
xp: 100
|
||
},
|
||
"1": {
|
||
cr: "1",
|
||
value: 1,
|
||
xp: 200
|
||
},
|
||
"2": {
|
||
cr: "2",
|
||
value: 2,
|
||
xp: 450
|
||
},
|
||
"3": {
|
||
cr: "3",
|
||
value: 3,
|
||
xp: 700
|
||
},
|
||
"4": {
|
||
cr: "4",
|
||
value: 4,
|
||
xp: 1100
|
||
},
|
||
"5": {
|
||
cr: "5",
|
||
value: 5,
|
||
xp: 1800
|
||
},
|
||
"6": {
|
||
cr: "6",
|
||
value: 6,
|
||
xp: 2300
|
||
},
|
||
"7": {
|
||
cr: "7",
|
||
value: 7,
|
||
xp: 2900
|
||
},
|
||
"8": {
|
||
cr: "8",
|
||
value: 8,
|
||
xp: 3900
|
||
},
|
||
"9": {
|
||
cr: "9",
|
||
value: 9,
|
||
xp: 5000
|
||
},
|
||
"10": {
|
||
cr: "10",
|
||
value: 10,
|
||
xp: 5900
|
||
},
|
||
"11": {
|
||
cr: "11",
|
||
value: 11,
|
||
xp: 7200
|
||
},
|
||
"12": {
|
||
cr: "12",
|
||
value: 12,
|
||
xp: 8400
|
||
},
|
||
"13": {
|
||
cr: "13",
|
||
value: 13,
|
||
xp: 10000
|
||
},
|
||
"14": {
|
||
cr: "14",
|
||
value: 14,
|
||
xp: 11500
|
||
},
|
||
"15": {
|
||
cr: "15",
|
||
value: 15,
|
||
xp: 13000
|
||
},
|
||
"16": {
|
||
cr: "16",
|
||
value: 16,
|
||
xp: 15000
|
||
},
|
||
"17": {
|
||
cr: "17",
|
||
value: 17,
|
||
xp: 18000
|
||
},
|
||
"18": {
|
||
cr: "18",
|
||
value: 18,
|
||
xp: 20000
|
||
},
|
||
"19": {
|
||
cr: "19",
|
||
value: 19,
|
||
xp: 22000
|
||
},
|
||
"20": {
|
||
cr: "20",
|
||
value: 20,
|
||
xp: 25000
|
||
},
|
||
"21": {
|
||
cr: "21",
|
||
value: 21,
|
||
xp: 33000
|
||
},
|
||
"22": {
|
||
cr: "22",
|
||
value: 22,
|
||
xp: 41000
|
||
},
|
||
"23": {
|
||
cr: "23",
|
||
value: 23,
|
||
xp: 50000
|
||
},
|
||
"24": {
|
||
cr: "24",
|
||
value: 24,
|
||
xp: 62000
|
||
},
|
||
"25": {
|
||
cr: "25",
|
||
value: 25,
|
||
xp: 75000
|
||
},
|
||
"26": {
|
||
cr: "26",
|
||
value: 26,
|
||
xp: 90000
|
||
},
|
||
"27": {
|
||
cr: "27",
|
||
value: 27,
|
||
xp: 105000
|
||
},
|
||
"28": {
|
||
cr: "28",
|
||
value: 28,
|
||
xp: 120000
|
||
},
|
||
"29": {
|
||
cr: "29",
|
||
value: 29,
|
||
xp: 135000
|
||
},
|
||
"30": {
|
||
cr: "30",
|
||
value: 30,
|
||
xp: 155000
|
||
}
|
||
};
|
||
if ("cr" in monster && monster.cr in CR) {
|
||
return \`+\${Math.max(
|
||
Math.floor(2 + ((CR[monster.cr]?.value ?? 0) - 1) / 4),
|
||
2
|
||
)}\`;
|
||
}
|
||
return "";`}]}],conditioned:!0,hasRule:!0},{type:"traits",id:z(),properties:["traits"],conditioned:!0,dice:!0},{type:"spells",id:z(),properties:["spells"],conditioned:!0,dice:!0},{type:"text",id:z(),properties:["spellsNotes"],conditioned:!0,text:null},{type:"traits",id:z(),properties:["actions"],heading:"Actions",conditioned:!0,dice:!0},{type:"traits",id:z(),properties:["bonus_actions"],heading:"Bonus Actions",conditioned:!0,dice:!0},{type:"traits",id:z(),properties:["legendary_actions"],heading:"Legendary Actions",conditioned:!0,dice:!0},{type:"traits",id:z(),properties:["reactions"],heading:"Reactions",conditioned:!0,dice:!0},{type:"traits",id:z(),properties:["lair_actions"],heading:"Lair Actions",conditioned:!0,dice:!0}],bt={blocks:jc,name:"Basic 5e Layout"};var Gr=require("obsidian");function H(){}var zs=a=>a;function qc(a){return!!a&&(typeof a=="object"||typeof a=="function")&&typeof a.then=="function"}function Xn(a){return a()}function Fs(){return Object.create(null)}function me(a){a.forEach(Xn)}function ze(a){return typeof a=="function"}function j(a,e){return a!=a?e==e:a!==e||a&&typeof a=="object"||typeof a=="function"}var Ka;function $s(a,e){return Ka||(Ka=document.createElement("a")),Ka.href=e,a===Ka.href}function js(a){return Object.keys(a).length===0}function qs(a){return a??""}function ae(a){return a&&ze(a.destroy)?a.destroy:H}var Gs=typeof window<"u",Gc=Gs?()=>window.performance.now():()=>Date.now(),Zn=Gs?a=>requestAnimationFrame(a):H;var ta=new Set;function Us(a){ta.forEach(e=>{e.c(a)||(ta.delete(e),e.f())}),ta.size!==0&&Zn(Us)}function Uc(a){let e;return ta.size===0&&Zn(Us),{promise:new Promise(t=>{ta.add(e={c:a,f:t})}),abort(){ta.delete(e)}}}var Vs=!1;function Vc(){Vs=!0}function Kc(){Vs=!1}function D(a,e){a.appendChild(e)}function K(a,e,t){let n=Qn(a);if(!n.getElementById(e)){let i=A("style");i.id=e,i.textContent=t,Ks(n,i)}}function Qn(a){if(!a)return document;let e=a.getRootNode?a.getRootNode():a.ownerDocument;return e&&e.host?e:a.ownerDocument}function Yc(a){let e=A("style");return Ks(Qn(a),e),e.sheet}function Ks(a,e){return D(a.head||a,e),e.sheet}function x(a,e,t){a.insertBefore(e,t||null)}function S(a){a.parentNode&&a.parentNode.removeChild(a)}function Ve(a,e){for(let t=0;t<a.length;t+=1)a[t]&&a[t].d(e)}function A(a){return document.createElement(a)}function de(a){return document.createTextNode(a)}function R(){return de(" ")}function re(){return de("")}function ue(a,e,t,n){return a.addEventListener(e,t,n),()=>a.removeEventListener(e,t,n)}function _(a,e,t){t==null?a.removeAttribute(e):a.getAttribute(e)!==t&&a.setAttribute(e,t)}function Jc(a){return Array.from(a.childNodes)}function ve(a,e){e=""+e,a.wholeText!==e&&(a.data=e)}function ei(a,e){a.value=e??""}function ti(a,e,t,n){t===null?a.style.removeProperty(e):a.style.setProperty(e,t,n?"important":"")}function Re(a,e,t){a.classList[t?"add":"remove"](e)}function Xc(a,e,{bubbles:t=!1,cancelable:n=!1}={}){let i=document.createEvent("CustomEvent");return i.initCustomEvent(a,t,n,e),i}var Xa=new Map,Za=0;function Zc(a){let e=5381,t=a.length;for(;t--;)e=(e<<5)-e^a.charCodeAt(t);return e>>>0}function Qc(a,e){let t={stylesheet:Yc(e),rules:{}};return Xa.set(a,t),t}function el(a,e,t,n,i,s,r,c=0){let o=16.666/n,l=`{
|
||
`;for(let k=0;k<=1;k+=o){let C=e+(t-e)*s(k);l+=k*100+`%{${r(C,1-C)}}
|
||
`}let d=l+`100% {${r(t,1-t)}}
|
||
}`,u=`__svelte_${Zc(d)}_${c}`,m=Qn(a),{stylesheet:h,rules:b}=Xa.get(m)||Qc(m,a);b[u]||(b[u]=!0,h.insertRule(`@keyframes ${u} ${d}`,h.cssRules.length));let f=a.style.animation||"";return a.style.animation=`${f?`${f}, `:""}${u} ${n}ms linear ${i}ms 1 both`,Za+=1,u}function tl(a,e){let t=(a.style.animation||"").split(", "),n=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),i=t.length-n.length;i&&(a.style.animation=n.join(", "),Za-=i,Za||al())}function al(){Zn(()=>{Za||(Xa.forEach(a=>{let{ownerNode:e}=a.stylesheet;e&&S(e)}),Xa.clear())})}function Qa(a,e,t,n){if(!e)return H;let i=a.getBoundingClientRect();if(e.left===i.left&&e.right===i.right&&e.top===i.top&&e.bottom===i.bottom)return H;let{delay:s=0,duration:r=300,easing:c=zs,start:o=Gc()+s,end:l=o+r,tick:d=H,css:u}=t(a,{from:e,to:i},n),m=!0,h=!1,b;function f(){u&&(b=el(a,0,1,r,s,c,u)),s||(h=!0)}function k(){u&&tl(a,b),m=!1}return Uc(C=>{if(!h&&C>=o&&(h=!0),h&&C>=l&&(d(1,0),k()),!m)return!1;if(h){let w=C-o,W=0+1*c(w/r);d(W,1-W)}return!0}),f(),d(0,1),k}function en(a){let e=getComputedStyle(a);if(e.position!=="absolute"&&e.position!=="fixed"){let{width:t,height:n}=e,i=a.getBoundingClientRect();a.style.position="absolute",a.style.width=t,a.style.height=n,nl(a,i)}}function nl(a,e){let t=a.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){let n=getComputedStyle(a),i=n.transform==="none"?"":n.transform;a.style.transform=`${i} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}var Aa;function kt(a){Aa=a}function Nt(){if(!Aa)throw new Error("Function called outside component initialization");return Aa}function Ca(a){Nt().$$.on_mount.push(a)}function ai(a){Nt().$$.on_destroy.push(a)}function We(){let a=Nt();return(e,t,{cancelable:n=!1}={})=>{let i=a.$$.callbacks[e];if(i){let s=Xc(e,t,{cancelable:n});return i.slice().forEach(r=>{r.call(a,s)}),!s.defaultPrevented}return!0}}function gt(a,e){return Nt().$$.context.set(a,e),e}function ge(a){return Nt().$$.context.get(a)}function ni(){return Nt().$$.context}function ii(a,e){let t=a.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}var ea=[];var rt=[],Ya=[],Kn=[],il=Promise.resolve(),Yn=!1;function sl(){Yn||(Yn=!0,il.then(ri))}function Jn(a){Ya.push(a)}function si(a){Kn.push(a)}var Vn=new Set,Qt=0;function ri(){if(Qt!==0)return;let a=Aa;do{try{for(;Qt<ea.length;){let e=ea[Qt];Qt++,kt(e),rl(e.$$)}}catch(e){throw ea.length=0,Qt=0,e}for(kt(null),ea.length=0,Qt=0;rt.length;)rt.pop()();for(let e=0;e<Ya.length;e+=1){let t=Ya[e];Vn.has(t)||(Vn.add(t),t())}Ya.length=0}while(ea.length);for(;Kn.length;)Kn.pop()();Yn=!1,Vn.clear(),kt(a)}function rl(a){if(a.fragment!==null){a.update(),me(a.before_update);let e=a.dirty;a.dirty=[-1],a.fragment&&a.fragment.p(a.ctx,e),a.after_update.forEach(Jn)}}var Ja=new Set,Wt;function ie(){Wt={r:0,c:[],p:Wt}}function se(){Wt.r||me(Wt.c),Wt=Wt.p}function I(a,e){a&&a.i&&(Ja.delete(a),a.i(e))}function O(a,e,t,n){if(a&&a.o){if(Ja.has(a))return;Ja.add(a),Wt.c.push(()=>{Ja.delete(a),n&&(t&&a.d(1),n())}),a.o(e)}else n&&n()}function Ys(a,e){let t=e.token={};function n(i,s,r,c){if(e.token!==t)return;e.resolved=c;let o=e.ctx;r!==void 0&&(o=o.slice(),o[r]=c);let l=i&&(e.current=i)(o),d=!1;e.block&&(e.blocks?e.blocks.forEach((u,m)=>{m!==s&&u&&(ie(),O(u,1,1,()=>{e.blocks[m]===u&&(e.blocks[m]=null)}),se())}):e.block.d(1),l.c(),I(l,1),l.m(e.mount(),e.anchor),d=!0),e.block=l,e.blocks&&(e.blocks[s]=l),d&&ri()}if(qc(a)){let i=Nt();if(a.then(s=>{kt(i),n(e.then,1,e.value,s),kt(null)},s=>{if(kt(i),n(e.catch,2,e.error,s),kt(null),!e.hasCatch)throw s}),e.current!==e.pending)return n(e.pending,0),!0}else{if(e.current!==e.then)return n(e.then,1,e.value,a),!0;e.resolved=a}}function Js(a,e,t){let n=e.slice(),{resolved:i}=a;a.current===a.then&&(n[a.value]=i),a.current===a.catch&&(n[a.error]=i),a.block.p(n,t)}var fm=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function oi(a,e){a.d(1),e.delete(a.key)}function ol(a,e){O(a,1,1,()=>{e.delete(a.key)})}function Xs(a,e){a.f(),oi(a,e)}function Zs(a,e){a.f(),ol(a,e)}function aa(a,e,t,n,i,s,r,c,o,l,d,u){let m=a.length,h=s.length,b=m,f={};for(;b--;)f[a[b].key]=b;let k=[],C=new Map,w=new Map;for(b=h;b--;){let g=u(i,s,b),p=t(g),v=r.get(p);v?n&&v.p(g,e):(v=l(p,g),v.c()),C.set(p,k[b]=v),p in f&&w.set(p,Math.abs(b-f[p]))}let W=new Set,E=new Set;function y(g){I(g,1),g.m(c,d),r.set(g.key,g),d=g.first,h--}for(;m&&h;){let g=k[h-1],p=a[m-1],v=g.key,M=p.key;g===p?(d=g.first,m--,h--):C.has(M)?!r.has(v)||W.has(v)?y(g):E.has(M)?m--:w.get(v)>w.get(M)?(E.add(v),y(g)):(W.add(M),m--):(o(p,r),m--)}for(;m--;){let g=a[m];C.has(g.key)||o(g,r)}for(;h;)y(k[h-1]);return k}function ci(a,e,t){let n=a.$$.props[e];n!==void 0&&(a.$$.bound[n]=t,t(a.$$.ctx[n]))}function X(a){a&&a.c()}function J(a,e,t,n){let{fragment:i,after_update:s}=a.$$;i&&i.m(e,t),n||Jn(()=>{let r=a.$$.on_mount.map(Xn).filter(ze);a.$$.on_destroy?a.$$.on_destroy.push(...r):me(r),a.$$.on_mount=[]}),s.forEach(Jn)}function Y(a,e){let t=a.$$;t.fragment!==null&&(me(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function cl(a,e){a.$$.dirty[0]===-1&&(ea.push(a),sl(),a.$$.dirty.fill(0)),a.$$.dirty[e/31|0]|=1<<e%31}function U(a,e,t,n,i,s,r,c=[-1]){let o=Aa;kt(a);let l=a.$$={fragment:null,ctx:[],props:s,update:H,not_equal:i,bound:Fs(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(o?o.$$.context:[])),callbacks:Fs(),dirty:c,skip_bound:!1,root:e.target||o.$$.root};r&&r(l.root);let d=!1;if(l.ctx=t?t(a,e.props||{},(u,m,...h)=>{let b=h.length?h[0]:m;return l.ctx&&i(l.ctx[u],l.ctx[u]=b)&&(!l.skip_bound&&l.bound[u]&&l.bound[u](b),d&&cl(a,u)),m}):[],l.update(),d=!0,me(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){Vc();let u=Jc(e.target);l.fragment&&l.fragment.l(u),u.forEach(S)}else l.fragment&&l.fragment.c();e.intro&&I(a.$$.fragment),J(a,e.target,e.anchor,e.customElement),Kc(),ri()}kt(o)}var ll;typeof HTMLElement=="function"&&(ll=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:a}=this.$$;this.$$.on_disconnect=a.map(Xn).filter(ze);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(a,e,t){this[a]=t}disconnectedCallback(){me(this.$$.on_disconnect)}$destroy(){Y(this,1),this.$destroy=H}$on(a,e){if(!ze(e))return H;let t=this.$$.callbacks[a]||(this.$$.callbacks[a]=[]);return t.push(e),()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)}}$set(a){this.$$set&&!js(a)&&(this.$$.skip_bound=!0,this.$$set(a),this.$$.skip_bound=!1)}});var q=class{$destroy(){Y(this,1),this.$destroy=H}$on(e,t){if(!ze(t))return H;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!js(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var ot=require("obsidian"),rf=require("querystring");var Qs='<svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="save" class="svg-inline--fa fa-save fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM272 80v80H144V80h128zm122 352H54a6 6 0 0 1-6-6V86a6 6 0 0 1 6-6h42v104c0 13.255 10.745 24 24 24h176c13.255 0 24-10.745 24-24V83.882l78.243 78.243a6 6 0 0 1 1.757 4.243V426a6 6 0 0 1-6 6zM224 232c-48.523 0-88 39.477-88 88s39.477 88 88 88 88-39.477 88-88-39.477-88-88-88zm0 128c-22.056 0-40-17.944-40-40s17.944-40 40-40 40 17.944 40 40-17.944 40-40 40z"></path></svg>',tn="statblock-save",er='<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="download" class="svg-inline--fa fa-download fa-w-16" role="img" viewBox="0 0 512 512"><path fill="currentColor" d="M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"/></svg>',an="statblock-export-as-png";var na=[];function tr(a,e=H){let t,n=new Set;function i(c){if(j(a,c)&&(a=c,t)){let o=!na.length;for(let l of n)l[1](),na.push(l,a);if(o){for(let l=0;l<na.length;l+=2)na[l][0](na[l+1]);na.length=0}}}function s(c){i(c(a))}function r(c,o=H){let l=[c,o];return n.add(l),n.size===1&&(t=e(i)||H),c(a),()=>{n.delete(l),n.size===0&&(t(),t=null)}}return{set:i,update:s,subscribe:r}}function dl(a){K(a,"svelte-ilp5y8",`.bar.svelte-ilp5y8{height:5px;background:var(--statblock-bar-color);border:var(--statblock-bar-border-size) solid
|
||
var(--statblock-bar-border-color);z-index:1;width:auto}`)}function ul(a){let e;return{c(){e=A("div"),_(e,"class","bar svelte-ilp5y8")},m(t,n){x(t,e,n)},p:H,i:H,o:H,d(t){t&&S(e)}}}var li=class extends q{constructor(e){super(),U(this,e,null,ul,j,{},dl)}},di=li;function hl(a){K(a,"svelte-1lnliuc",".inline.svelte-1lnliuc{display:inline}")}function ar(a,e,t){let n=a.slice();return n[5]=e[t],n}function ml(a){let e,t=a[2](a[0]),n=[];for(let i=0;i<t.length;i+=1)n[i]=nr(ar(a,t,i));return{c(){for(let i=0;i<n.length;i+=1)n[i].c();e=re()},m(i,s){for(let r=0;r<n.length;r+=1)n[r].m(i,s);x(i,e,s)},p(i,s){if(s&5){t=i[2](i[0]);let r;for(r=0;r<t.length;r+=1){let c=ar(i,t,r);n[r]?n[r].p(c,s):(n[r]=nr(c),n[r].c(),n[r].m(e.parentNode,e))}for(;r<n.length;r+=1)n[r].d(1);n.length=t.length}},d(i){Ve(n,i),i&&S(e)}}}function gl(a){let e;return{c(){e=de(a[0])},m(t,n){x(t,e,n)},p(t,n){n&1&&ve(e,t[0])},d(t){t&&S(e)}}}function fl(a){let e=a[5].text+"",t;return{c(){t=de(e)},m(n,i){x(n,t,i)},p(n,i){i&1&&e!==(e=n[5].text+"")&&ve(t,e)},d(n){n&&S(t)}}}function pl(a){let e;function t(s,r){return s[5].isAlias?kl:bl}let n=t(a,-1),i=n(a);return{c(){i.c(),e=re()},m(s,r){i.m(s,r),x(s,e,r)},p(s,r){n===(n=t(s,r))&&i?i.p(s,r):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},d(s){i.d(s),s&&S(e)}}}function bl(a){let e,t=a[5].text+"",n,i,s,r;return{c(){e=A("a"),n=de(t),i=R(),_(e,"data-href",s=a[5].href),_(e,"href",r=a[5].href),_(e,"class","internal-link"),_(e,"target","_blank"),_(e,"rel","noopener")},m(c,o){x(c,e,o),D(e,n),D(e,i)},p(c,o){o&1&&t!==(t=c[5].text+"")&&ve(n,t),o&1&&s!==(s=c[5].href)&&_(e,"data-href",s),o&1&&r!==(r=c[5].href)&&_(e,"href",r)},d(c){c&&S(e)}}}function kl(a){let e,t=a[5].title+"",n,i,s,r,c;return{c(){e=A("a"),n=de(t),i=R(),_(e,"data-href",s=a[5].href),_(e,"href",r=a[5].href),_(e,"class","internal-link"),_(e,"target","_blank"),_(e,"rel","noreferrer"),_(e,"aria-label",c=a[5].href),_(e,"aria-label-position","top")},m(o,l){x(o,e,l),D(e,n),D(e,i)},p(o,l){l&1&&t!==(t=o[5].title+"")&&ve(n,t),l&1&&s!==(s=o[5].href)&&_(e,"data-href",s),l&1&&r!==(r=o[5].href)&&_(e,"href",r),l&1&&c!==(c=o[5].href)&&_(e,"aria-label",c)},d(o){o&&S(e)}}}function nr(a){let e;function t(s,r){return s[5].isLink?pl:fl}let n=t(a,-1),i=n(a);return{c(){i.c(),e=re()},m(s,r){i.m(s,r),x(s,e,r)},p(s,r){n===(n=t(s,r))&&i?i.p(s,r):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},d(s){i.d(s),s&&S(e)}}}function vl(a){let e;function t(s,r){return s[1]?ml:gl}let i=t(a,-1)(a);return{c(){e=A("div"),i.c(),_(e,"class","statblock-rendered-text-content inline svelte-1lnliuc")},m(s,r){x(s,e,r),i.m(e,null)},p(s,[r]){i.p(s,r)},i:H,o:H,d(s){s&&S(e),i.d()}}}function yl(a,e,t){let{textToRender:n}=e,i=ge("tryToRenderLinks"),s=ge("context"),r=o=>{let l="",d=o.indexOf("|");return d>0?(l=o.slice(d+1),o=o.slice(0,d)):l=o.split("#").filter(function(u){return!!u}).join(" > "),o.endsWith("\\")&&(o=o.slice(0,o.length-1)),{href:o=o.replace(/\u00A0/g," "),title:l,isAlias:d>0}},c=o=>o.split(/(<STATBLOCK-LINK>[\s\S]+?<\/STATBLOCK-LINK>)/).filter(l=>l&&l.length).map(l=>{if(/<STATBLOCK-LINK>([\s\S]+?)<\/STATBLOCK-LINK>/.test(l)){let d=l.match(/<STATBLOCK-LINK>([\s\S]+?)<\/STATBLOCK-LINK>/)[1],{href:u,title:m,isAlias:h}=r(d);return{isLink:!0,text:d,href:u,isAlias:h,title:m}}return{isLink:!1,text:l}});return a.$$set=o=>{"textToRender"in o&&t(0,n=o.textToRender)},[n,i,c]}var ui=class extends q{constructor(e){super(),U(this,e,yl,vl,j,{textToRender:0},hl)}},Be=ui;var lr=require("obsidian");function _l(a){K(a,"svelte-l05x30",".roller-result.svelte-l05x30{font-weight:var(--statblock-font-weight)}")}function wl(a){let e,t,n,i,s,r,c=(typeof a[1]=="number"||a[1]&&a[1].length)&&ir(a);return{c(){e=A("span"),n=R(),c&&c.c(),i=re(),_(e,"class","roller-result svelte-l05x30")},m(o,l){x(o,e,l),x(o,n,l),c&&c.m(o,l),x(o,i,l),s||(r=ae(t=a[4].call(null,e)),s=!0)},p(o,l){typeof o[1]=="number"||o[1]&&o[1].length?c?c.p(o,l):(c=ir(o),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null)},d(o){o&&S(e),o&&S(n),c&&c.d(o),o&&S(i),s=!1,r()}}}function Tl(a){let e;return{c(){e=de(a[0])},m(t,n){x(t,e,n)},p(t,n){n&1&&ve(e,t[0])},d(t){t&&S(e)}}}function ir(a){let e,t,n,i;return{c(){e=A("span"),t=de("("),n=de(a[1]),i=de(")"),_(e,"class","dice-original")},m(s,r){x(s,e,r),D(e,t),D(e,n),D(e,i)},p(s,r){r&2&&ve(n,s[1])},d(s){s&&S(e)}}}function sr(a){let e;function t(s,r){return s[2]||!s[3]?Tl:wl}let n=t(a,-1),i=n(a);return{c(){i.c(),e=re()},m(s,r){i.m(s,r),x(s,e,r)},p(s,r){n===(n=t(s,r))&&i?i.p(s,r):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},d(s){i.d(s),s&&S(e)}}}function Al(a){let e=a[2],t,n=sr(a);return{c(){n.c(),t=re()},m(i,s){n.m(i,s),x(i,t,s)},p(i,[s]){s&4&&j(e,e=i[2])?(n.d(1),n=sr(i),n.c(),n.m(t.parentNode,t)):n.p(i,s)},i:H,o:H,d(i){i&&S(t),n.d(i)}}}function Cl(a,e,t){let{text:n}=e,{original:i=n}=e,s=ge("dice"),r=ge("plugin"),c=ge("render");ge("reset").subscribe(async h=>{h&&await l.applyResult({type:"dice",result:u,tooltip:"Average"})});let l=null,d=!1;if(!l&&s)try{l=r.getRoller(`${n}`)}catch(h){console.error(h),d=!0}let u=0;Ca(async()=>{if(l)try{await l.roll(),u=l.dice.reduce((h,b)=>h+(b.static?b.result:Math.floor((b.faces.min+b.faces.max)/2*b.rolls)),0),await l.applyResult({type:"dice",result:u,tooltip:"Average"}),l.shouldRender=c}catch{t(2,d=!0)}});let m=h=>{!l||!l.containerEl?h.setText(`${i}`):h.appendChild(l.containerEl)};return a.$$set=h=>{"text"in h&&t(0,n=h.text),"original"in h&&t(1,i=h.original)},[n,i,d,s,m]}var hi=class extends q{constructor(e){super(),U(this,e,Cl,Al,j,{text:0,original:1},_l)}},rr=hi;function Sl(a){K(a,"svelte-12rzfyk",".property-text.svelte-12rzfyk{display:inline;white-space:pre-line;text-indent:0}.property-text.svelte-12rzfyk{display:inline;margin:0}")}function or(a,e,t){let n=a.slice();return n[6]=e[t],n}function xl(a){let e,t,n=a[1],i=[];for(let r=0;r<n.length;r+=1)i[r]=cr(or(a,n,r));let s=r=>O(i[r],1,1,()=>{i[r]=null});return{c(){for(let r=0;r<i.length;r+=1)i[r].c();e=re()},m(r,c){for(let o=0;o<i.length;o+=1)i[o].m(r,c);x(r,e,c),t=!0},p(r,c){if(c&3){n=r[1];let o;for(o=0;o<n.length;o+=1){let l=or(r,n,o);i[o]?(i[o].p(l,c),I(i[o],1)):(i[o]=cr(l),i[o].c(),I(i[o],1),i[o].m(e.parentNode,e))}for(ie(),o=n.length;o<i.length;o+=1)s(o);se()}},i(r){if(!t){for(let c=0;c<n.length;c+=1)I(i[c]);t=!0}},o(r){i=i.filter(Boolean);for(let c=0;c<i.length;c+=1)O(i[c]);t=!1},d(r){Ve(i,r),r&&S(e)}}}function Dl(a){let e,t,n;return t=new Be({props:{textToRender:a[0]}}),{c(){e=A("span"),X(t.$$.fragment),_(e,"class","property-text svelte-12rzfyk")},m(i,s){x(i,e,s),J(t,e,null),n=!0},p(i,s){let r={};s&1&&(r.textToRender=i[0]),t.$set(r)},i(i){n||(I(t.$$.fragment,i),n=!0)},o(i){O(t.$$.fragment,i),n=!1},d(i){i&&S(e),Y(t)}}}function El(a){let e,t,n,i;return t=new Be({props:{textToRender:a[6]}}),{c(){e=A("span"),X(t.$$.fragment),n=R(),_(e,"class","property-text svelte-12rzfyk")},m(s,r){x(s,e,r),J(t,e,null),D(e,n),i=!0},p(s,r){let c={};r&2&&(c.textToRender=s[6]),t.$set(c)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){O(t.$$.fragment,s),i=!1},d(s){s&&S(e),Y(t)}}}function Ml(a){let e,t;return e=new rr({props:{text:a[6]?.text??a[0],original:a[6]?.original??a[6]?.text??a[0]}}),{c(){X(e.$$.fragment)},m(n,i){J(e,n,i),t=!0},p(n,i){let s={};i&3&&(s.text=n[6]?.text??n[0]),i&3&&(s.original=n[6]?.original??n[6]?.text??n[0]),e.$set(s)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){O(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function cr(a){let e,t,n,i,s=[Ml,El],r=[];function c(o,l){return typeof o[6]!="string"&&typeof o[6]=="object"&&"text"in o[6]?0:1}return e=c(a,-1),t=r[e]=s[e](a),{c(){t.c(),n=re()},m(o,l){r[e].m(o,l),x(o,n,l),i=!0},p(o,l){let d=e;e=c(o,l),e===d?r[e].p(o,l):(ie(),O(r[d],1,1,()=>{r[d]=null}),se(),t=r[e],t?t.p(o,l):(t=r[e]=s[e](o),t.c()),I(t,1),t.m(n.parentNode,n))},i(o){i||(I(t),i=!0)},o(o){O(t),i=!1},d(o){r[e].d(o),o&&S(n)}}}function Il(a){let e,t,n,i,s=[Dl,xl],r=[];function c(o,l){return o[2]?1:0}return e=c(a,-1),t=r[e]=s[e](a),{c(){t.c(),n=re()},m(o,l){r[e].m(o,l),x(o,n,l),i=!0},p(o,[l]){t.p(o,l)},i(o){i||(I(t),i=!0)},o(o){O(t),i=!1},d(o){r[e].d(o),o&&S(n)}}}function Pl(a,e,t){let{property:n}=e,i=ge("item"),s=ge("dice")&&i.dice,r=ge("monster"),c=ge("plugin"),o=[n];if(s)if(i.diceProperty&&i.diceProperty in r&&typeof r[i.diceProperty]=="string")o=[{text:r[i.diceProperty]}];else if(i.diceCallback)try{let l=document.body.createEl("iframe"),d=l.contentWindow.Function,m=new d("monster","property",i.diceCallback).call(void 0,r,n)??n;document.body.removeChild(l),Array.isArray(m)?o=m:o=[m]}catch(l){new lr.Notice(`There was an error executing the provided dice callback for [${i.properties.join(", ")}]
|
||
|
||
${l.message}`),console.error(l)}else{let l=c.parseForDice(n);Array.isArray(l)?o=l:o=[l]}return a.$$set=l=>{"property"in l&&t(0,n=l.property)},[n,o,s]}var mi=class extends q{constructor(e){super(),U(this,e,Pl,Il,j,{property:0},Sl)}},dr=mi;var nn=require("obsidian");function Ol(a){K(a,"svelte-4lp5jt",".statblock-markdown.svelte-4lp5jt{display:inline}.statblock-markdown.svelte-4lp5jt p{display:inline}")}function Wl(a){let e,t,n,i;return{c(){e=A("div"),_(e,"class","statblock-markdown svelte-4lp5jt")},m(s,r){x(s,e,r),n||(i=ae(t=a[0].call(null,e)),n=!0)},p:H,i:H,o:H,d(s){s&&S(e),n=!1,i()}}}function Nl(a,e,t){let{property:n}=e;n=n.replace(/<STATBLOCK-LINK>/g,"[[").replace(/<\/STATBLOCK-LINK>/g,"]]");let i=ge("context"),s=ge("renderer"),r=ge("item"),c=ge("dice")&&r.dice,o=ge("monster"),l=ge("plugin"),d=[n];if(c)if(r.diceProperty&&r.diceProperty in o&&typeof o[r.diceProperty]=="string")d=[{text:o[r.diceProperty]}];else if(r.diceCallback)try{let h=document.body.createEl("iframe"),b=h.contentWindow.Function,k=new b("monster","property",r.diceCallback).call(void 0,o,n)??n;document.body.removeChild(h),Array.isArray(k)?d=k:d=[k]}catch(h){new nn.Notice(`There was an error executing the provided dice callback for [${r.properties.join(", ")}]
|
||
|
||
${h.message}`),console.error(h)}else{let h=l.parseForDice(n);Array.isArray(h)?d=h:d=[h]}let u=0;for(let h of d)if(typeof h!="string"){let b=h.original??h.text,f;h.original?f=`${h.original} (\`dice: ${h.text}\`)`:f=`\`dice: ${h.text}\``;let k=n.slice(u).indexOf(b);n=n.slice(0,u)+n.slice(u).replace(b,f),u=n.slice(0,u).length+k+f.length+1}else u+=h.length;let m=h=>{nn.MarkdownRenderer.renderMarkdown(n,h,i,s)};return a.$$set=h=>{"property"in h&&t(1,n=h.property)},[m,n]}var gi=class extends q{constructor(e){super(),U(this,e,Nl,Wl,j,{property:1},Ol)}},ur=gi;function Hl(a){let e,t;return e=new dr({props:{property:a[0]}}),{c(){X(e.$$.fragment)},m(n,i){J(e,n,i),t=!0},p(n,i){let s={};i&1&&(s.property=n[0]),e.$set(s)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){O(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Ll(a){let e,t;return e=new ur({props:{property:a[0]}}),{c(){X(e.$$.fragment)},m(n,i){J(e,n,i),t=!0},p(n,i){let s={};i&1&&(s.property=n[0]),e.$set(s)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){O(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Rl(a){let e,t,n,i,s=[Ll,Hl],r=[];function c(o,l){return o[1]?0:1}return e=c(a,-1),t=r[e]=s[e](a),{c(){t.c(),n=re()},m(o,l){r[e].m(o,l),x(o,n,l),i=!0},p(o,[l]){let d=e;e=c(o,l),e===d?r[e].p(o,l):(ie(),O(r[d],1,1,()=>{r[d]=null}),se(),t=r[e],t?t.p(o,l):(t=r[e]=s[e](o),t.c()),I(t,1),t.m(n.parentNode,n))},i(o){i||(I(t),i=!0)},o(o){O(t),i=!1},d(o){r[e].d(o),o&&S(n)}}}function Bl(a,e,t){let{property:n}=e,{render:i=!1}=e;return a.$$set=s=>{"property"in s&&t(0,n=s.property),"render"in s&&t(1,i=s.render)},[n,i]}var fi=class extends q{constructor(e){super(),U(this,e,Bl,Rl,j,{property:0,render:1})}},Xe=fi;function Fl(a){K(a,"svelte-17sj2ks",".property-name.svelte-17sj2ks{margin:0;margin-right:0.25em;display:inline;font-weight:var(--statblock-traits-font-weight);font-style:var(--statblock-traits-font-style)}")}function hr(a){let e,t,n;return t=new Be({props:{textToRender:a[0]}}),{c(){e=A("div"),X(t.$$.fragment),_(e,"class","property-name svelte-17sj2ks")},m(i,s){x(i,e,s),J(t,e,null),n=!0},p(i,s){let r={};s&1&&(r.textToRender=i[0]),t.$set(r)},i(i){n||(I(t.$$.fragment,i),n=!0)},o(i){O(t.$$.fragment,i),n=!1},d(i){i&&S(e),Y(t)}}}function zl(a){let e,t,n,i,s,r=a[0]&&hr(a);return n=new Xe({props:{render:a[3],property:a[1]}}),{c(){e=A("div"),r&&r.c(),t=R(),X(n.$$.fragment),_(e,"class",i="property "+pt(a[0])+" "+pt(a[2])+" svelte-17sj2ks")},m(c,o){x(c,e,o),r&&r.m(e,null),D(e,t),J(n,e,null),s=!0},p(c,[o]){c[0]?r?(r.p(c,o),o&1&&I(r,1)):(r=hr(c),r.c(),I(r,1),r.m(e,t)):r&&(ie(),O(r,1,1,()=>{r=null}),se());let l={};o&8&&(l.render=c[3]),o&2&&(l.property=c[1]),n.$set(l),(!s||o&5&&i!==(i="property "+pt(c[0])+" "+pt(c[2])+" svelte-17sj2ks"))&&_(e,"class",i)},i(c){s||(I(r),I(n.$$.fragment,c),s=!0)},o(c){O(r),O(n.$$.fragment,c),s=!1},d(c){c&&S(e),r&&r.d(),Y(n)}}}function $l(a,e,t){let{name:n}=e,{desc:i}=e,{property:s=""}=e,{render:r=!1}=e;return a.$$set=c=>{"name"in c&&t(0,n=c.name),"desc"in c&&t(1,i=c.desc),"property"in c&&t(2,s=c.property),"render"in c&&t(3,r=c.render)},[n,i,s,r]}var pi=class extends q{constructor(e){super(),U(this,e,$l,zl,j,{name:0,desc:1,property:2,render:3},Fl)}},Sa=pi;var ig=require("obsidian");function jl(a){K(a,"svelte-1kk02hm",".spell-line.svelte-1kk02hm .spells.svelte-1kk02hm{font-style:var(--statblock-spells-font-style)}")}function mr(a,e,t){let n=a.slice();return n[5]=e[t],n[7]=t,n}function gr(a,e,t){let n=a.slice();return n[8]=e[t],n[10]=t,n}function ql(a){let e,t;return e=new Sa({props:{name:"",desc:a[5].header,property:a[1]}}),{c(){X(e.$$.fragment)},m(n,i){J(e,n,i),t=!0},p(n,i){let s={};i&2&&(s.property=n[1]),e.$set(s)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){O(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Gl(a){let e,t;return e=new Sa({props:{name:"Spellcasting",desc:a[5].header,property:a[1]}}),{c(){X(e.$$.fragment)},m(n,i){J(e,n,i),t=!0},p(n,i){let s={};i&2&&(s.property=n[1]),e.$set(s)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){O(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Ul(a){let e,t,n,i,s,r,c;return n=new Xe({props:{render:a[0],property:`${a[8].level}:`}}),r=new Xe({props:{render:a[0],property:a[8].spells}}),{c(){e=A("li"),t=A("span"),X(n.$$.fragment),i=R(),s=A("span"),X(r.$$.fragment),_(t,"class","spell-level"),_(s,"class","spells svelte-1kk02hm"),_(e,"class","spell-line svelte-1kk02hm")},m(o,l){x(o,e,l),D(e,t),J(n,t,null),D(e,i),D(e,s),J(r,s,null),c=!0},p(o,l){let d={};l&1&&(d.render=o[0]),n.$set(d);let u={};l&1&&(u.render=o[0]),r.$set(u)},i(o){c||(I(n.$$.fragment,o),I(r.$$.fragment,o),c=!0)},o(o){O(n.$$.fragment,o),O(r.$$.fragment,o),c=!1},d(o){o&&S(e),Y(n),Y(r)}}}function Vl(a){let e,t,n;return t=new Xe({props:{render:a[0],property:a[8].spells}}),{c(){e=A("span"),X(t.$$.fragment),_(e,"class","spell-line")},m(i,s){x(i,e,s),J(t,e,null),n=!0},p(i,s){let r={};s&1&&(r.render=i[0]),t.$set(r)},i(i){n||(I(t.$$.fragment,i),n=!0)},o(i){O(t.$$.fragment,i),n=!1},d(i){i&&S(e),Y(t)}}}function fr(a){let e,t,n,i,s=[Vl,Ul],r=[];function c(o,l){return o[8].level?1:0}return e=c(a,-1),t=r[e]=s[e](a),{c(){t.c(),n=re()},m(o,l){r[e].m(o,l),x(o,n,l),i=!0},p(o,l){t.p(o,l)},i(o){i||(I(t),i=!0)},o(o){O(t),i=!1},d(o){r[e].d(o),o&&S(n)}}}function pr(a){let e,t,n,i,s,r,c=[Gl,ql],o=[];function l(h,b){return h[7]===0?0:1}e=l(a,-1),t=o[e]=c[e](a);let d=a[5].spells,u=[];for(let h=0;h<d.length;h+=1)u[h]=fr(gr(a,d,h));let m=h=>O(u[h],1,1,()=>{u[h]=null});return{c(){t.c(),n=R(),i=A("ul");for(let h=0;h<u.length;h+=1)u[h].c();s=R(),_(i,"class","spell-list")},m(h,b){o[e].m(h,b),x(h,n,b),x(h,i,b);for(let f=0;f<u.length;f+=1)u[f].m(i,null);D(i,s),r=!0},p(h,b){if(t.p(h,b),b&5){d=h[5].spells;let f;for(f=0;f<d.length;f+=1){let k=gr(h,d,f);u[f]?(u[f].p(k,b),I(u[f],1)):(u[f]=fr(k),u[f].c(),I(u[f],1),u[f].m(i,s))}for(ie(),f=d.length;f<u.length;f+=1)m(f);se()}},i(h){if(!r){I(t);for(let b=0;b<d.length;b+=1)I(u[b]);r=!0}},o(h){O(t),u=u.filter(Boolean);for(let b=0;b<u.length;b+=1)O(u[b]);r=!1},d(h){o[e].d(h),h&&S(n),h&&S(i),Ve(u,h)}}}function Kl(a){let e,t,n=a[2],i=[];for(let r=0;r<n.length;r+=1)i[r]=pr(mr(a,n,r));let s=r=>O(i[r],1,1,()=>{i[r]=null});return{c(){e=A("div");for(let r=0;r<i.length;r+=1)i[r].c();_(e,"class","spellcasting")},m(r,c){x(r,e,c);for(let o=0;o<i.length;o+=1)i[o].m(e,null);t=!0},p(r,[c]){if(c&7){n=r[2];let o;for(o=0;o<n.length;o+=1){let l=mr(r,n,o);i[o]?(i[o].p(l,c),I(i[o],1)):(i[o]=pr(l),i[o].c(),I(i[o],1),i[o].m(e,null))}for(ie(),o=n.length;o<i.length;o+=1)s(o);se()}},i(r){if(!t){for(let c=0;c<n.length;c+=1)I(i[c]);t=!0}},o(r){i=i.filter(Boolean);for(let c=0;c<i.length;c+=1)O(i[c]);t=!1},d(r){r&&S(e),Ve(i,r)}}}function Yl(a,e,t){let{render:n=!1}=e,{monster:i}=e,{property:s}=e,r=o=>/[^a-zA-Z0-9]$/.test(o)?o:`${o}:`,c=i.spells.reduce((o,l)=>{if(typeof l=="string"&&(l.charAt(l.length-1)==":"||!l.includes(":"))){let m={header:r(l),spells:[]};return o.push(m),o}let d=o[o.length-1],u;if(typeof l=="string")u={spells:l};else try{u={level:Object.keys(l).shift(),spells:Z(Object.values(l).shift())}}catch{return o}if(d)d.spells.push(u);else{let m={header:`${i.name} knows the following spells:`,spells:[u]};o.push(m)}return o},[]);return a.$$set=o=>{"render"in o&&t(0,n=o.render),"monster"in o&&t(3,i=o.monster),"property"in o&&t(1,s=o.property)},[n,s,c,i]}var bi=class extends q{constructor(e){super(),U(this,e,Yl,Kl,j,{render:0,monster:3,property:1},jl)}},br=bi;function Jl(a){K(a,"svelte-1hofvsi",".flex-container.svelte-1hofvsi{display:flex;justify-content:space-between;align-items:center}.heading.svelte-1hofvsi{font-family:var(--statblock-heading-font);color:var(--statblock-heading-font-color);font-weight:var(--statblock-heading-font-weight);margin:0px;letter-spacing:1px;font-variant:var(--statblock-heading-font-variant);display:flex;justify-content:space-between;align-items:center;line-height:var(--statblock-heading-line-height)}")}function kr(a,e,t){let n=a.slice();return n[2]=e[t],n}function vr(a){let e,t,n,i,s=[ad,td,ed,Ql,Zl,Xl],r=[];function c(o,l){return!o[1].size||o[1].size==1?0:o[1].size==2?1:o[1].size==3?2:o[1].size==4?3:o[1].size==5?4:5}return e=c(a,-1),t=r[e]=s[e](a),{c(){t.c(),n=re()},m(o,l){r[e].m(o,l),x(o,n,l),i=!0},p(o,l){let d=e;e=c(o,l),e===d?r[e].p(o,l):(ie(),O(r[d],1,1,()=>{r[d]=null}),se(),t=r[e],t?t.p(o,l):(t=r[e]=s[e](o),t.c()),I(t,1),t.m(n.parentNode,n))},i(o){i||(I(t),i=!0)},o(o){O(t),i=!1},d(o){r[e].d(o),o&&S(n)}}}function Xl(a){let e,t,n,i,s;return t=new Be({props:{textToRender:Z(a[0][a[2]])}}),{c(){e=A("h6"),X(t.$$.fragment),n=R(),_(e,"class",i="heading statblock-heading "+Z(a[2])+" svelte-1hofvsi")},m(r,c){x(r,e,c),J(t,e,null),D(e,n),s=!0},p(r,c){let o={};c&3&&(o.textToRender=Z(r[0][r[2]])),t.$set(o),(!s||c&2&&i!==(i="heading statblock-heading "+Z(r[2])+" svelte-1hofvsi"))&&_(e,"class",i)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){O(t.$$.fragment,r),s=!1},d(r){r&&S(e),Y(t)}}}function Zl(a){let e,t,n,i,s;return t=new Be({props:{textToRender:Z(a[0][a[2]])}}),{c(){e=A("h5"),X(t.$$.fragment),n=R(),_(e,"class",i="heading statblock-heading "+Z(a[2])+" svelte-1hofvsi")},m(r,c){x(r,e,c),J(t,e,null),D(e,n),s=!0},p(r,c){let o={};c&3&&(o.textToRender=Z(r[0][r[2]])),t.$set(o),(!s||c&2&&i!==(i="heading statblock-heading "+Z(r[2])+" svelte-1hofvsi"))&&_(e,"class",i)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){O(t.$$.fragment,r),s=!1},d(r){r&&S(e),Y(t)}}}function Ql(a){let e,t,n,i,s;return t=new Be({props:{textToRender:Z(a[0][a[2]])}}),{c(){e=A("h4"),X(t.$$.fragment),n=R(),_(e,"class",i="heading statblock-heading "+Z(a[2])+" svelte-1hofvsi")},m(r,c){x(r,e,c),J(t,e,null),D(e,n),s=!0},p(r,c){let o={};c&3&&(o.textToRender=Z(r[0][r[2]])),t.$set(o),(!s||c&2&&i!==(i="heading statblock-heading "+Z(r[2])+" svelte-1hofvsi"))&&_(e,"class",i)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){O(t.$$.fragment,r),s=!1},d(r){r&&S(e),Y(t)}}}function ed(a){let e,t,n,i,s;return t=new Be({props:{textToRender:Z(a[0][a[2]])}}),{c(){e=A("h3"),X(t.$$.fragment),n=R(),_(e,"class",i="heading statblock-heading "+Z(a[2])+" svelte-1hofvsi")},m(r,c){x(r,e,c),J(t,e,null),D(e,n),s=!0},p(r,c){let o={};c&3&&(o.textToRender=Z(r[0][r[2]])),t.$set(o),(!s||c&2&&i!==(i="heading statblock-heading "+Z(r[2])+" svelte-1hofvsi"))&&_(e,"class",i)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){O(t.$$.fragment,r),s=!1},d(r){r&&S(e),Y(t)}}}function td(a){let e,t,n,i,s;return t=new Be({props:{textToRender:Z(a[0][a[2]])}}),{c(){e=A("h2"),X(t.$$.fragment),n=R(),_(e,"class",i="heading statblock-heading "+Z(a[2])+" svelte-1hofvsi")},m(r,c){x(r,e,c),J(t,e,null),D(e,n),s=!0},p(r,c){let o={};c&3&&(o.textToRender=Z(r[0][r[2]])),t.$set(o),(!s||c&2&&i!==(i="heading statblock-heading "+Z(r[2])+" svelte-1hofvsi"))&&_(e,"class",i)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){O(t.$$.fragment,r),s=!1},d(r){r&&S(e),Y(t)}}}function ad(a){let e,t,n,i,s;return t=new Be({props:{textToRender:Z(a[0][a[2]])}}),{c(){e=A("h1"),X(t.$$.fragment),n=R(),_(e,"class",i="heading statblock-heading "+Z(a[2])+" svelte-1hofvsi")},m(r,c){x(r,e,c),J(t,e,null),D(e,n),s=!0},p(r,c){let o={};c&3&&(o.textToRender=Z(r[0][r[2]])),t.$set(o),(!s||c&2&&i!==(i="heading statblock-heading "+Z(r[2])+" svelte-1hofvsi"))&&_(e,"class",i)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){O(t.$$.fragment,r),s=!1},d(r){r&&S(e),Y(t)}}}function yr(a){let e,t,n=a[2]in a[0]&&vr(a);return{c(){n&&n.c(),e=re()},m(i,s){n&&n.m(i,s),x(i,e,s),t=!0},p(i,s){i[2]in i[0]?n?(n.p(i,s),s&3&&I(n,1)):(n=vr(i),n.c(),I(n,1),n.m(e.parentNode,e)):n&&(ie(),O(n,1,1,()=>{n=null}),se())},i(i){t||(I(n),t=!0)},o(i){O(n),t=!1},d(i){n&&n.d(i),i&&S(e)}}}function nd(a){let e,t,n=a[1].properties,i=[];for(let r=0;r<n.length;r+=1)i[r]=yr(kr(a,n,r));let s=r=>O(i[r],1,1,()=>{i[r]=null});return{c(){e=A("div");for(let r=0;r<i.length;r+=1)i[r].c();_(e,"class","flex-container svelte-1hofvsi")},m(r,c){x(r,e,c);for(let o=0;o<i.length;o+=1)i[o].m(e,null);t=!0},p(r,[c]){if(c&3){n=r[1].properties;let o;for(o=0;o<n.length;o+=1){let l=kr(r,n,o);i[o]?(i[o].p(l,c),I(i[o],1)):(i[o]=yr(l),i[o].c(),I(i[o],1),i[o].m(e,null))}for(ie(),o=n.length;o<i.length;o+=1)s(o);se()}},i(r){if(!t){for(let c=0;c<n.length;c+=1)I(i[c]);t=!0}},o(r){i=i.filter(Boolean);for(let c=0;c<i.length;c+=1)O(i[c]);t=!1},d(r){r&&S(e),Ve(i,r)}}}function id(a,e,t){let{monster:n}=e,{item:i}=e;return a.$$set=s=>{"monster"in s&&t(0,n=s.monster),"item"in s&&t(1,i=s.item)},[n,i]}var ki=class extends q{constructor(e){super(),U(this,e,id,nd,j,{monster:0,item:1},Jl)}},_r=ki;var Tr=require("obsidian");function sd(a){K(a,"svelte-151kcqm",".line.svelte-151kcqm{line-height:var(--statblock-property-line-height);display:block;color:var(--statblock-property-font-color)}.property-name.svelte-151kcqm{margin:0;margin-right:0.25em;display:inline;color:var(--statblock-property-name-font-color);font-weight:var(--statblock-property-name-font-weight)}")}function wr(a){let e,t,n,i,s,r;return i=new Xe({props:{render:a[0].markdown,property:a[1]}}),{c(){e=A("div"),t=A("span"),t.textContent=`${a[2]}`,n=R(),X(i.$$.fragment),_(t,"class","property-name svelte-151kcqm"),_(e,"class",s="line "+a[0].properties[0]+" svelte-151kcqm")},m(c,o){x(c,e,o),D(e,t),D(e,n),J(i,e,null),r=!0},p(c,o){let l={};o&1&&(l.render=c[0].markdown),o&2&&(l.property=c[1]),i.$set(l),(!r||o&1&&s!==(s="line "+c[0].properties[0]+" svelte-151kcqm"))&&_(e,"class",s)},i(c){r||(I(i.$$.fragment,c),r=!0)},o(c){O(i.$$.fragment,c),r=!1},d(c){c&&S(e),Y(i)}}}function rd(a){let e,t,n=(!a[0].conditioned||a[0].conditioned&&`${a[1]}`.length)&&wr(a);return{c(){n&&n.c(),e=re()},m(i,s){n&&n.m(i,s),x(i,e,s),t=!0},p(i,[s]){!i[0].conditioned||i[0].conditioned&&`${i[1]}`.length?n?(n.p(i,s),s&3&&I(n,1)):(n=wr(i),n.c(),I(n,1),n.m(e.parentNode,e)):n&&(ie(),O(n,1,1,()=>{n=null}),se())},i(i){t||(I(n),t=!0)},o(i){O(n),t=!1},d(i){n&&n.d(i),i&&S(e)}}}function od(a,e,t){let{monster:n}=e,{item:i}=e,s=Z(n[i.properties[0]]),r=i.display??i.properties[0];if(i.callback)try{let c=document.body.createEl("iframe"),o=c.contentWindow.Function;s=new o("monster",i.callback).call(void 0,n)??s,document.body.removeChild(c)}catch(c){new Tr.Notice(`There was an error executing the provided callback for [${i.properties.join(", ")}]
|
||
|
||
${c.message}`),console.error(c)}return!i.conditioned&&!`${s}`.length&&(s=i.fallback??"-"),a.$$set=c=>{"monster"in c&&t(3,n=c.monster),"item"in c&&t(0,i=c.item)},[i,s,r,n]}var vi=class extends q{constructor(e){super(),U(this,e,od,rd,j,{monster:3,item:0},sd)}},Ar=vi;function cd(a){K(a,"svelte-sujd32",`.tapered-rule.svelte-sujd32{width:auto;margin:0.5em 0;height:5px;background:-webkit-linear-gradient(
|
||
0deg,
|
||
var(--statblock-rule-color) 0%,
|
||
var(--statblock-rule-color) 50%,
|
||
var(--statblock-background-color) 95%,
|
||
var(--statblock-background-color) 100%
|
||
);clip-path:polygon(0 0, 0 100%, 95% 50%);-webkit-clip-path:polygon(0 0, 0 100%, 95% 50%)}`)}function ld(a){let e;return{c(){e=A("div"),_(e,"class","tapered-rule svelte-sujd32")},m(t,n){x(t,e,n)},p:H,i:H,o:H,d(t){t&&S(e)}}}var yi=class extends q{constructor(e){super(),U(this,e,null,ld,j,{},cd)}},sn=yi;function dd(a){K(a,"svelte-sgnocl",".line.svelte-sgnocl{line-height:var(--statblock-saves-line-height);display:block;color:var(--statblock-font-color)}.property-name.svelte-sgnocl{margin:0;margin-right:0.25em;display:inline;font-weight:bold}.property-text.svelte-sgnocl{display:inline;margin:0}")}function ud(a){let e,t,n,i=(a[0].display??Va(a[0].properties[0]))+"",s,r,c,o,l;return o=new Xe({props:{render:a[0].markdown,property:a[1]}}),{c(){e=A("div"),t=A("div"),n=A("span"),s=de(i),r=R(),c=A("div"),X(o.$$.fragment),_(n,"class","property-name svelte-sgnocl"),_(c,"class","property-text svelte-sgnocl"),_(t,"class","line svelte-sgnocl"),_(e,"class","info")},m(d,u){x(d,e,u),D(e,t),D(t,n),D(n,s),D(t,r),D(t,c),J(o,c,null),l=!0},p(d,[u]){(!l||u&1)&&i!==(i=(d[0].display??Va(d[0].properties[0]))+"")&&ve(s,i);let m={};u&1&&(m.render=d[0].markdown),o.$set(m)},i(d){l||(I(o.$$.fragment,d),l=!0)},o(d){O(o.$$.fragment,d),l=!1},d(d){d&&S(e),Y(o)}}}function hd(a){return`${a>0?"+":""}${a}`}function md(a,e,t){let{monster:n}=e,{item:i}=e,s=n[i.properties[0]];Array.isArray(s)||(s=[]);let r=s.map(o=>{if(typeof o!="object"||o==null)return null;let l=Object.keys(o)[0];if(!l)return null;let d=Object.values(o)[0];return!d||isNaN(Number(d))?null:`${Va(l)} ${hd(d)}`}).filter(o=>o).join(", "),c=ge("dice");return a.$$set=o=>{"monster"in o&&t(2,n=o.monster),"item"in o&&t(0,i=o.item)},[i,r,n]}var _i=class extends q{constructor(e){super(),U(this,e,md,ud,j,{monster:2,item:0},dd)}},Cr=_i;function gd(a){K(a,"svelte-1x5mdf",`.section-header.svelte-1x5mdf{border-bottom:var(--statblock-section-heading-border-size) solid
|
||
var(--statblock-section-heading-border-color);color:var(--statblock-section-heading-font-color);font-size:var(--statblock-section-heading-font-size);font-variant:var(--statblock-section-heading-font-variant);font-weight:var(--statblock-section-heading-font-weight);letter-spacing:1px;margin:0;margin-bottom:0.3em;break-inside:avoid-column;break-after:avoid-column}`)}function Sr(a){let e,t,n,i;return t=new Be({props:{textToRender:a[0]}}),{c(){e=A("h3"),X(t.$$.fragment),_(e,"class",n="section-header "+a[1](a[0])+" svelte-1x5mdf")},m(s,r){x(s,e,r),J(t,e,null),i=!0},p(s,r){let c={};r&1&&(c.textToRender=s[0]),t.$set(c),(!i||r&1&&n!==(n="section-header "+s[1](s[0])+" svelte-1x5mdf"))&&_(e,"class",n)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){O(t.$$.fragment,s),i=!1},d(s){s&&S(e),Y(t)}}}function fd(a){let e,t,n=a[0]&&a[0].length&&Sr(a);return{c(){n&&n.c(),e=re()},m(i,s){n&&n.m(i,s),x(i,e,s),t=!0},p(i,[s]){i[0]&&i[0].length?n?(n.p(i,s),s&1&&I(n,1)):(n=Sr(i),n.c(),I(n,1),n.m(e.parentNode,e)):n&&(ie(),O(n,1,1,()=>{n=null}),se())},i(i){t||(I(n),t=!0)},o(i){O(n),t=!1},d(i){n&&n.d(i),i&&S(e)}}}function pd(a,e,t){let{monster:n}=e,{item:i}=e,s;if(i.headingProp){if(i.heading in n){let c=Z(n[i.heading]);c.length&&(s=c)}}else i.heading?.length&&(s=i.heading);let r=c=>c.toLowerCase().replace(/[^A-Za-z0-9\s]/g,"").replace(/\s+/g,"-");return a.$$set=c=>{"monster"in c&&t(2,n=c.monster),"item"in c&&t(3,i=c.item)},[s,r,n,i]}var wi=class extends q{constructor(e){super(),U(this,e,pd,fd,j,{monster:2,item:3},gd)}},rn=wi;function bd(a){K(a,"svelte-1186gko",".subheading.svelte-1186gko{font-weight:var(--statblock-subheading-font-weight);font-style:var(--statblock-subheading-font-style);font-size:var(--statblock-subheading-font-size);margin:0}")}function kd(a){let e,t,n;return t=new Be({props:{textToRender:a[1].join(a[0].separator??" ")}}),{c(){e=A("div"),X(t.$$.fragment),_(e,"class","subheading svelte-1186gko")},m(i,s){x(i,e,s),J(t,e,null),n=!0},p(i,s){let r={};s&1&&(r.textToRender=i[1].join(i[0].separator??" ")),t.$set(r)},i(i){n||(I(t.$$.fragment,i),n=!0)},o(i){O(t.$$.fragment,i),n=!1},d(i){i&&S(e),Y(t)}}}function vd(a){let e,t,n=a[1].length&&kd(a);return{c(){n&&n.c(),e=re()},m(i,s){n&&n.m(i,s),x(i,e,s),t=!0},p(i,[s]){i[1].length&&n.p(i,s)},i(i){t||(I(n),t=!0)},o(i){O(n),t=!1},d(i){n&&n.d(i),i&&S(e)}}}function yd(a,e,t){let{monster:n}=e,{item:i}=e,s=[];for(let r of i.properties)r in n&&s.push(`${Z(n[r])}`);return a.$$set=r=>{"monster"in r&&t(2,n=r.monster),"item"in r&&t(0,i=r.item)},[i,s,n]}var Ti=class extends q{constructor(e){super(),U(this,e,yd,vd,j,{monster:2,item:0},bd)}},xr=Ti;function _d(a){K(a,"svelte-18uixe9",".statblock-table-header.svelte-18uixe9{font-weight:var(--statblock-table-header-font-weight)}.table.svelte-18uixe9{display:flex;justify-content:space-evenly;align-items:center;flex-wrap:wrap}.table-item.svelte-18uixe9{display:flex;justify-content:center;align-items:center;flex-flow:column nowrap}")}function Dr(a,e,t){let n=a.slice();return n[6]=e[t],n[8]=t,n}function Er(a){let e,t=a[2](a[6])+"",n;return{c(){e=A("span"),n=de(t)},m(i,s){x(i,e,s),D(e,n)},p(i,s){s&2&&t!==(t=i[2](i[6])+"")&&ve(n,t)},d(i){i&&S(e)}}}function Mr(a){let e,t,n=`${a[3][a[8]]}`.toUpperCase()+"",i,s,r,c=Z(a[6])+"",o,l,d,u=a[0].calculate&&Er(a);return{c(){e=A("div"),t=A("span"),i=de(n),s=R(),r=A("span"),o=de(c),l=R(),u&&u.c(),d=R(),_(t,"class","statblock-table-header svelte-18uixe9"),_(e,"class","table-item svelte-18uixe9")},m(m,h){x(m,e,h),D(e,t),D(t,i),D(e,s),D(e,r),D(r,o),D(r,l),u&&u.m(r,null),D(e,d)},p(m,h){h&2&&c!==(c=Z(m[6])+"")&&ve(o,c),m[0].calculate?u?u.p(m,h):(u=Er(m),u.c(),u.m(r,null)):u&&(u.d(1),u=null)},d(m){m&&S(e),u&&u.d()}}}function wd(a){let e,t=a[1].slice(0,a[3].length),n=[];for(let i=0;i<t.length;i+=1)n[i]=Mr(Dr(a,t,i));return{c(){e=A("div");for(let i=0;i<n.length;i+=1)n[i].c();_(e,"class","table svelte-18uixe9")},m(i,s){x(i,e,s);for(let r=0;r<n.length;r+=1)n[r].m(e,null)},p(i,[s]){if(s&15){t=i[1].slice(0,i[3].length);let r;for(r=0;r<t.length;r+=1){let c=Dr(i,t,r);n[r]?n[r].p(c,s):(n[r]=Mr(c),n[r].c(),n[r].m(e,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=t.length}},i:H,o:H,d(i){i&&S(e),Ve(n,i)}}}function Td(a,e,t){let{monster:n}=e,{item:i}=e,s=new Function("stat",`return ${i.modifier}`);function r(l){if(typeof l!="number")return"";let d=i.modifier==null||!i.modifier.length||i.modifier==""?Math.floor(((l??10)-10)/2):s(l);return`(${d>=0?"+":"-"}${Math.abs(d)})`}let c=n[i.properties[0]];Array.isArray(c)||(c=[]);let o=i.headers??[...Array(c.length>0?c.length:1).keys()];return a.$$set=l=>{"monster"in l&&t(4,n=l.monster),"item"in l&&t(0,i=l.item)},[i,c,r,o,n]}var Ai=class extends q{constructor(e){super(),U(this,e,Td,wd,j,{monster:4,item:0},_d)}},Ir=Ai;function Pr(a){let e,t,n,i,s=a[1].heading&&Or(a);return n=new Xe({props:{render:a[1].markdown,property:a[2]}}),{c(){s&&s.c(),e=R(),t=A("div"),X(n.$$.fragment),_(t,"class","line")},m(r,c){s&&s.m(r,c),x(r,e,c),x(r,t,c),J(n,t,null),i=!0},p(r,c){r[1].heading?s?(s.p(r,c),c&2&&I(s,1)):(s=Or(r),s.c(),I(s,1),s.m(e.parentNode,e)):s&&(ie(),O(s,1,1,()=>{s=null}),se());let o={};c&2&&(o.render=r[1].markdown),c&4&&(o.property=r[2]),n.$set(o)},i(r){i||(I(s),I(n.$$.fragment,r),i=!0)},o(r){O(s),O(n.$$.fragment,r),i=!1},d(r){s&&s.d(r),r&&S(e),r&&S(t),Y(n)}}}function Or(a){let e,t;return e=new rn({props:{item:a[1],monster:a[0]}}),{c(){X(e.$$.fragment)},m(n,i){J(e,n,i),t=!0},p(n,i){let s={};i&2&&(s.item=n[1]),i&1&&(s.monster=n[0]),e.$set(s)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){O(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Ad(a){let e,t,n=(!a[1].conditioned||a[1].conditioned&&`${a[2]}`.length)&&Pr(a);return{c(){n&&n.c(),e=re()},m(i,s){n&&n.m(i,s),x(i,e,s),t=!0},p(i,[s]){!i[1].conditioned||i[1].conditioned&&`${i[2]}`.length?n?(n.p(i,s),s&6&&I(n,1)):(n=Pr(i),n.c(),I(n,1),n.m(e.parentNode,e)):n&&(ie(),O(n,1,1,()=>{n=null}),se())},i(i){t||(I(n),t=!0)},o(i){O(n),t=!1},d(i){n&&n.d(i),i&&S(e)}}}function Cd(a,e,t){let{monster:n}=e,{item:i}=e,s=i.text&&i.text.length?i.text:Z(n[i.properties[0]]);return!i.conditioned&&!`${s}`.length&&(s=i.fallback??"-"),a.$$set=r=>{"monster"in r&&t(0,n=r.monster),"item"in r&&t(1,i=r.item)},[n,i,s]}var Ci=class extends q{constructor(e){super(),U(this,e,Cd,Ad,j,{monster:0,item:1})}},Wr=Ci;var Br=require("obsidian");function Sd(a){K(a,"svelte-gdz2l0",".image.svelte-gdz2l0{width:var(--statblock-image-width);height:var(--statblock-image-height)}.image.pointer.svelte-gdz2l0{cursor:pointer}img.svelte-gdz2l0{object-fit:cover;width:100%;height:100%;border-radius:100%;border:var(--statblock-image-border-size) solid var(--statblock-image-border-color);object-position:center}")}function Nr(a,e,t){let n=a.slice();return n[13]=e[t],n}function Hr(a){let e,t,n={ctx:a,current:null,token:null,hasCatch:!1,pending:Md,then:Dd,catch:xd,value:16};return Ys(t=a[3],n),{c(){e=re(),n.block.c()},m(i,s){x(i,e,s),n.block.m(i,n.anchor=s),n.mount=()=>e.parentNode,n.anchor=e},p(i,s){a=i,Js(n,a,s)},d(i){i&&S(e),n.block.d(i),n.token=null,n=null}}}function xd(a){return{c:H,m:H,p:H,d:H}}function Dd(a){let e,t=a[16]&&Ed(a);return{c(){t&&t.c(),e=R()},m(n,i){t&&t.m(n,i),x(n,e,i)},p(n,i){n[16]&&t.p(n,i)},d(n){t&&t.d(n),n&&S(e)}}}function Ed(a){let e,t,n,i,s,r;return{c(){e=A("div"),t=A("img"),$s(t.src,n=a[16])||_(t,"src",n),_(t,"alt",i=a[0].name),_(t,"class","svelte-gdz2l0"),_(e,"class","image svelte-gdz2l0"),Re(e,"pointer",a[2]!=null)},m(c,o){x(c,e,o),D(e,t),s||(r=[ue(e,"click",a[6]),ue(e,"mouseenter",a[7])],s=!0)},p(c,o){o&1&&i!==(i=c[0].name)&&_(t,"alt",i),o&4&&Re(e,"pointer",c[2]!=null)},d(c){c&&S(e),s=!1,me(r)}}}function Md(a){return{c:H,m:H,p:H,d:H}}function Lr(a){let e,t=a[13]in a[0]&&Hr(a);return{c(){t&&t.c(),e=re()},m(n,i){t&&t.m(n,i),x(n,e,i)},p(n,i){n[13]in n[0]?t?t.p(n,i):(t=Hr(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(n){t&&t.d(n),n&&S(e)}}}function Id(a){let e,t=a[1].properties,n=[];for(let i=0;i<t.length;i+=1)n[i]=Lr(Nr(a,t,i));return{c(){for(let i=0;i<n.length;i+=1)n[i].c();e=re()},m(i,s){for(let r=0;r<n.length;r+=1)n[r].m(i,s);x(i,e,s)},p(i,[s]){if(s&63){t=i[1].properties;let r;for(r=0;r<t.length;r+=1){let c=Nr(i,t,r);n[r]?n[r].p(c,s):(n[r]=Lr(c),n[r].c(),n[r].m(e.parentNode,e))}for(;r<n.length;r+=1)n[r].d(1);n.length=t.length}},i:H,o:H,d(i){Ve(n,i),i&&S(e)}}}function Rr(a){return a?.replace(/(\[|\])/g,"")}function Pd(a,e,t){let{monster:n}=e,{item:i}=e,s=ge("plugin"),r=ge("context"),c;async function o(k){k=decodeURIComponent(k);let C;try{if(/https?:/.test(k)){let[w]=Rr(k).split("|");C=w}else{let[w]=Rr(k).split("|");if(t(2,c=s.app.metadataCache.getFirstLinkpathDest(w.replace(/<\/?STATBLOCK-LINK>/g,""),r)),!c)throw new Error;C=s.app.vault.getResourcePath(c)}}catch(w){console.error(w)}return C}let d=(async()=>{if(i.properties.length&&i.properties.some(k=>k in n&&typeof n[k]=="string")){let k=i.properties.filter(w=>w in n&&typeof n[w]=="string");k.length>1&&console.log("TTRPG Statblocks: Multiple image properties provided, using first.");let C=n[k[0]];return o(C)}})(),u=Br.Platform.isMacOS?"Meta":"Control";function m(k){if(!c)return;s.app.workspace.getLeaf(k.getModifierState(u)?"window":"split").openFile(c)}function h(k){s.app.workspace.trigger("link-hover",{},k.currentTarget,c.path,r)}let b=k=>m(k),f=k=>h(k);return a.$$set=k=>{"monster"in k&&t(0,n=k.monster),"item"in k&&t(1,i=k.item)},[n,i,c,d,m,h,b,f]}var Si=class extends q{constructor(e){super(),U(this,e,Pd,Id,j,{monster:0,item:1},Sd)}},Fr=Si;function Od(a){K(a,"svelte-9gi3x8",`.statblock-content.svelte-9gi3x8{font-family:var(--statblock-content-font);font-size:var(--statblock-content-font-size);color:var(--statblock-font-color);background-color:var(--statblock-background-color);padding:0.5em;border:var(--statblock-border-size) var(--statblock-border-color) solid;box-shadow:var(--statblock-box-shadow-x-offset)
|
||
var(--statblock-box-shadow-y-offset)
|
||
var(--statblock-box-shadow-blur) var(--statblock-box-shadow-color);margin-left:2px;margin-right:2px;display:flex;gap:1rem}.statblock-content.svelte-9gi3x8>.column{width:var(--statblock-column-width)}@media screen and (max-width: 400px){.statblock-content.svelte-9gi3x8>.column{width:75vw}}.statblock-item-container{margin-bottom:0.25rem}.statblock-detached{position:absolute;top:-9999px}.statblock-item-inline{display:flex;justify-content:space-between}`)}function Wd(a){let e,t;return{c(){e=A("div"),t=A("div"),_(t,"class","statblock-content svelte-9gi3x8"),_(e,"class","statblock-content-container"),ti(e,"--statblock-column-width",a[1])},m(n,i){x(n,e,i),D(e,t),a[6](t)},p(n,[i]){i&2&&ti(e,"--statblock-column-width",n[1])},i:H,o:H,d(n){n&&S(e),a[6](null)}}}function Nd(a,e,t){let n,i=We(),{statblock:s}=e,{columns:r=1}=e,{ready:c}=e,{maxColumns:o=r}=e,l=ge("monster"),d=w=>w.conditioned==null||!w.conditioned?!0:"nested"in w?w.nested.some(W=>d(W)):w.properties.length?w.properties.some(W=>!!(W in l&&(Array.isArray(l[W])&&l[W].length||typeof l[W]=="string"&&l[W].length||typeof l[W]=="number"))):!0,u=ni(),m=(w,W)=>{if(!d(w))return[];let E=[],y=W?W.createDiv(`statblock-item-container ${pt(w.type)}-container`):createDiv(`statblock-item-container ${pt(w.type)}-container`);switch(u.set("item",w),E.push(y),w.type){case"group":{for(let g of w.nested??[]){let p=m(g,y);E.push(...p)}break}case"heading":{let g=new _r({target:y,props:{monster:l,item:w},context:u});g.$on("save",p=>i("save",p.detail)),g.$on("export",p=>i("export",p.detail));break}case"inline":{let g=y.createDiv("statblock-item-inline");for(let p of w.nested??[])m(p,g.createDiv(`statblock-inline-item ${pt(p.type)}-container`));E.push(g);break}case"image":{new Fr({target:y,props:{monster:l,item:w},context:u});break}case"property":{new Ar({target:y,props:{monster:l,item:w},context:u});break}case"saves":{new Cr({target:y,props:{monster:l,item:w},context:u});break}case"spells":{let g=l[w.properties[0]];if(!Array.isArray(g)||!g.length)return;new br({target:y,props:{property:w.properties[0],monster:l,render:w.markdown},context:u});break}case"subheading":{new xr({target:y,props:{monster:l,item:w},context:u});break}case"table":{new Ir({target:y,props:{monster:l,item:w},context:u});break}case"text":{new Wr({target:y,props:{monster:l,item:w}});break}case"traits":{let g=l[w.properties[0]];if(!Array.isArray(g)||!g.length)return[];w.heading&&new rn({target:y,props:{monster:l,item:w},context:u});try{for(let p of g){let v=createDiv("statblock-item-container statblock-trait-prop");new Sa({target:v,props:{name:p.name,desc:p.desc,property:w.properties[0],render:w.markdown},context:u}),E.push(v)}}catch{return[]}break}}if(w.hasRule){let g=createDiv("statblock-item-container rule-container");new sn({target:g}),E.push(g)}return E},h=[];for(let w of s){let W=m(w);h.push(...W)}let b=w=>{w.empty();let W=w.createDiv("column");if(r==1){h.forEach(p=>W.appendChild(p));return}let E=document.body.createDiv("statblock-detached"),y=new Map;for(let p of h)E.appendChild(p),y.set(p,Math.floor(p.clientHeight));E.style.width=k;let g;l.forceColumns?g=E.clientHeight/o:l.columns&&l.columns>0?g=Math.max(E.clientHeight/l.columns,E.clientHeight/r):g=Math.max(600,Math.min(E.clientHeight/r,n)),E.empty(),E.detach();for(let p of h)w.childElementCount<r&&W.clientHeight+y.get(p)>g&&(W=w.createDiv("column")),W.appendChild(p)},f,k="400px";l.columnWidth&&(typeof l.columnWidth=="number"&&(k=`${l.columnWidth}px`),typeof l.columnWidth=="string"&&(k=l.columnWidth));function C(w){rt[w?"unshift":"push"](()=>{f=w,t(0,f)})}a.$$set=w=>{"statblock"in w&&t(2,s=w.statblock),"columns"in w&&t(3,r=w.columns),"ready"in w&&t(4,c=w.ready),"maxColumns"in w&&t(5,o=w.maxColumns)},a.$$.update=()=>{if(a.$$.dirty&17){e:c&&f&&b(f)}};e:n=!isNaN(Number(l.columnHeight))&&l.columnHeight>0?l.columnHeight:1/0;return[f,k,s,r,c,o,C]}var xi=class extends q{constructor(e){super(),U(this,e,Nd,Wd,j,{statblock:2,columns:3,ready:4,maxColumns:5},Od)}},zr=xi;function Hd(a){K(a,"svelte-1r5gl1g",".container.svelte-1r5gl1g{display:flex;width:100%;margin:0.25rem 0}.statblock.svelte-1r5gl1g{margin:0 auto;position:relative}.icons.svelte-1r5gl1g{position:absolute;right:0}")}function $r(a){let e,t,n,i,s,r,c,o,l,d,u=[Rd,Ld],m=[];function h(b,f){return b[0]?0:1}return t=h(a,-1),n=m[t]=u[t](a),{c(){e=A("div"),n.c(),s=R(),r=A("div"),_(e,"class",i=qs(a[8].join(" "))+" svelte-1r5gl1g"),Re(e,"obsidian-statblock-plugin",!0),Re(e,"statblock",!0),_(r,"class","icons svelte-1r5gl1g")},m(b,f){x(b,e,f),m[t].m(e,null),x(b,s,f),x(b,r,f),o=!0,l||(d=[ae(c=a[6].call(null,r)),ue(r,"keypress",a[7]),ue(r,"click",a[7])],l=!0)},p(b,f){let k=t;t=h(b,f),t===k?m[t].p(b,f):(ie(),O(m[k],1,1,()=>{m[k]=null}),se(),n=m[t],n?n.p(b,f):(n=m[t]=u[t](b),n.c()),I(n,1),n.m(e,null))},i(b){o||(I(n),o=!0)},o(b){O(n),o=!1},d(b){b&&S(e),m[t].d(),b&&S(s),b&&S(r),l=!1,me(d)}}}function Ld(a){let e;return{c(){e=A("span"),e.textContent="Invalid monster."},m(t,n){x(t,e,n)},p:H,i:H,o:H,d(t){t&&S(e)}}}function Rd(a){let e,t,n=a[3],i,s,r;e=new di({});let c=jr(a);return s=new di({}),{c(){X(e.$$.fragment),t=R(),c.c(),i=R(),X(s.$$.fragment)},m(o,l){J(e,o,l),x(o,t,l),c.m(o,l),x(o,i,l),J(s,o,l),r=!0},p(o,l){l&8&&j(n,n=o[3])?(ie(),O(c,1,1,H),se(),c=jr(o),c.c(),I(c,1),c.m(i.parentNode,i)):c.p(o,l)},i(o){r||(I(e.$$.fragment,o),I(c),I(s.$$.fragment,o),r=!0)},o(o){O(e.$$.fragment,o),O(c),O(s.$$.fragment,o),r=!1},d(o){Y(e,o),o&&S(t),c.d(o),o&&S(i),Y(s,o)}}}function jr(a){let e,t;return e=new zr({props:{columns:a[3],maxColumns:a[5],statblock:a[1],ready:a[4]}}),e.$on("save",a[15]),e.$on("export",a[16]),{c(){X(e.$$.fragment)},m(n,i){J(e,n,i),t=!0},p(n,i){let s={};i&8&&(s.columns=n[3]),i&2&&(s.statblock=n[1]),i&16&&(s.ready=n[4]),e.$set(s)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){O(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Bd(a){let e,t,n=a[4]&&$r(a);return{c(){e=A("div"),n&&n.c(),_(e,"class","container svelte-1r5gl1g")},m(i,s){x(i,e,s),n&&n.m(e,null),a[17](e),t=!0},p(i,[s]){i[4]?n?(n.p(i,s),s&16&&I(n,1)):(n=$r(i),n.c(),I(n,1),n.m(e,null)):n&&(ie(),O(n,1,1,()=>{n=null}),se())},i(i){t||(I(n),t=!0)},o(i){O(n),t=!1},d(i){i&&S(e),n&&n.d(),a[17](null)}}}function Fd(a,e,t){let n,i,s=We(),{monster:r}=e,{context:c}=e,{plugin:o}=e,{statblock:l}=e,{renderer:d}=e,{layout:u}=e,{canSave:m=!0}=e,h=!isNaN(Number(r.columns))&&Number(r.columns)>0?Number(r.columns):2,b=r.export??o.settings.export,f=o.canUseDiceRoller&&(r.dice??o.settings.useDice),k=r.render??o.settings.renderDice;gt("plugin",o),gt("tryToRenderLinks",o.settings.tryToRenderLinks),gt("context",c),gt("monster",r),gt("dice",f),gt("render",k),gt("renderer",d);let C=tr(!1);gt("reset",C);let w,W=h,E=!1,y=()=>{if(r.forceColumns){t(3,W=h),p.disconnect();return}let F=w.clientWidth;t(3,W=Math.min(Math.max(Math.floor(F/i),1),h))},g=(0,ot.debounce)(()=>{y(),E||t(4,E=!0)},100,!1),p=new ResizeObserver(g);Ca(()=>{y(),p.observe(w)}),ai(()=>{p.disconnect()});let v=F=>{new ot.ExtraButtonComponent(F).setIcon("vertical-three-dots")},M=new ot.Menu;M.addItem(F=>F.setIcon(tn).setTitle("Save to Bestiary").setDisabled(!m).onClick(()=>s("save"))),M.addItem(F=>{F.setTitle("Copy YAML").setIcon("code").onClick(async()=>{try{await navigator.clipboard.writeText((0,ot.stringifyYaml)(r)),new ot.Notice("Creature YAML copied to clipboard")}catch(fe){new ot.Notice(`There was an issue copying the yaml:
|
||
|
||
${fe.message}`)}})}),b&&M.addItem(F=>F.setIcon(an).setTitle("Export as PNG").onClick(()=>s("export"))),f&&M.addItem(F=>F.setIcon("reset").setTitle("Reset Dice").onClick(()=>{C.set(!0),C.set(!1)}));let N=F=>{M.showAtMouseEvent(F)},T=r?.name?.toLowerCase().replace(/[^A-Za-z0-9\s]/g,"").replace(/\s+/g,"-")??"no-name",P=u.toLowerCase().replace(/[^A-Za-z0-9\s]/g,"").replace(/\s+/g,"-")??"no-layout",L=[T,P].filter(F=>F?.length);function G(F){ii.call(this,a,F)}function B(F){ii.call(this,a,F)}function te(F){rt[F?"unshift":"push"](()=>{w=F,t(2,w)})}return a.$$set=F=>{"monster"in F&&t(0,r=F.monster),"context"in F&&t(9,c=F.context),"plugin"in F&&t(10,o=F.plugin),"statblock"in F&&t(1,l=F.statblock),"renderer"in F&&t(11,d=F.renderer),"layout"in F&&t(12,u=F.layout),"canSave"in F&&t(13,m=F.canSave)},a.$$.update=()=>{if(a.$$.dirty&1){e:t(14,n=Number(`${r.columnWidth}`.replace(/\D/g,"")))}if(a.$$.dirty&16384){e:i=!isNaN(n)&&n>0?n:400}},[r,l,w,W,E,h,v,N,L,c,o,d,u,m,n,G,B,te]}var Di=class extends q{constructor(e){super(),U(this,e,Fd,Bd,j,{monster:0,context:9,plugin:10,statblock:1,renderer:11,layout:12,canSave:13},Hd)}},qr=Di;var on=_a(xa());var Tt=class extends Gr.MarkdownRenderChild{constructor(t){super(t.container);this.rendererParameters=t;this.loaded=!1;this.container=t.container,this.plugin=t.plugin,this.context=t.context??"","params"in t?(this.params=t.params,this.monster=Object.assign({},this.plugin.bestiary.get(this.params.monster)??this.plugin.bestiary.get(this.params.creature))):(this.params={},this.monster=t.monster),this.setLayout(),this.init()}setLayout(){this.layout=this.plugin.layouts.find(t=>t.name==(this.params.layout??this.monster.layout)||t.name==(this.params.statblock??this.monster.statblock))??this.plugin.defaultLayout}get canSave(){return"name"in this.params}async build(){let t=Object.assign({},this.monster??{},this.params??{});if(Object.values(t).length||(t=Object.assign({},t,{note:this.context})),t.note){let n=Array.isArray(t.note)?t.note.flat(1/0).pop():t.note,i=await app.metadataCache.getFirstLinkpathDest(`${n}`,this.context??"");if(i&&i instanceof Ht.TFile){let s=await app.metadataCache.getFileCache(i);Object.assign(t,(0,on.default)(s.frontmatter)??{})}}"image"in t&&Array.isArray(t.image)&&(t.image=t.image.flat(2).join(""));for(let n of this.getBlocksToTransform(this.layout.blocks))for(let i of n.properties){if(!(i in t))continue;let s=t[i];n.type=="traits"?s=Bs([],t[i]??[]):n.type=="saves"&&!Array.isArray(t[i])&&typeof t[i]=="object"&&(s=Object.entries(t[i]??{}).map(([r,c])=>({[r]:c}))),Object.assign(t,{[i]:s})}return t=JSON.parse(JSON.stringify(t).replace(/\\#/g,"#").replace(/\[\["(.+?)"\]\]/g,'"<STATBLOCK-LINK>$1</STATBLOCK-LINK>"').replace(/\[\[([^"]+?)\]\]/g,(n,i)=>`<STATBLOCK-LINK>${i}</STATBLOCK-LINK>`).replace(/\[([^"]*?)\]\(([^"]+?)\)/g,(n,i,s)=>i.length?`<STATBLOCK-LINK>${s}|${i}</STATBLOCK-LINK>`:`<STATBLOCK-LINK>${s}</STATBLOCK-LINK>`)),this.monster=t,t}getBlocksToTransform(t){let n=[];for(let i of t)switch(i.type){case"group":case"inline":{n.push(...this.getBlocksToTransform(i.nested));break}case"saves":case"traits":{n.push(i);break}default:continue}return n}async init(){let t=new qr({target:this.containerEl,props:{context:this.context,monster:await this.build(),statblock:this.layout.blocks,layout:this.layout.name,plugin:this.plugin,renderer:this,canSave:this.canSave}});t.$on("save",async()=>{this.plugin.bestiary.has(this.monster.name)&&!await zd(this.plugin.app,"This will overwrite an existing monster in settings. Are you sure?")||this.plugin.saveMonster({...(0,on.default)(this.monster),source:"Homebrew",layout:this.layout.name})}),t.$on("export",()=>{this.plugin.exportAsPng(this.monster.name,this.containerEl.firstElementChild)})}transform(){if(!("extends"in this.monster)||!(Array.isArray(this.monster.extends)||typeof this.monster.extends=="string")||!this.monster.extends.length)return this.monster;let t=this.getExtensions(this.monster);return Object.assign({},...t,this.monster)}getExtensions(t){let n=[(0,on.default)(t)];if(t.extends&&t.extends.length)for(let i of[t.extends].flat()){let s=this.plugin.bestiary.get(i);!s||n.push(...this.getExtensions(s))}return n}};async function zd(a,e,t={cta:"Yes",secondary:"No"}){return new Promise((n,i)=>{let s=new Ii(a,e,t);s.onClose=()=>{n(s.confirmed)},s.open()})}var Ii=class extends Ht.Modal{constructor(t,n,i){super(t);this.text=n;this.buttons=i;this.confirmed=!1}async display(){new Promise(t=>{this.contentEl.empty(),this.contentEl.addClass("confirm-modal"),this.contentEl.createEl("p",{text:this.text});let n=this.contentEl.createDiv("fantasy-calendar-confirm-buttons");new Ht.ButtonComponent(n).setButtonText(this.buttons.cta).setCta().onClick(()=>{this.confirmed=!0,this.close()}),new Ht.ButtonComponent(n).setButtonText(this.buttons.secondary).onClick(()=>{this.close()})})}onOpen(){this.display()}};var V=require("obsidian");var et=require("obsidian");var Da=[["group","Group"],["heading","Heading"],["image","Image"],["inline","Inline Group"],["property","Property Line"],["saves","Saves"],["spells","Spells"],["subheading","Subheading"],["table","Table"],["text","Text"],["traits","Traits"]],Ur=["property","traits","spells","text","saves"];var $d=require("obsidian");function cn(a){switch(a){case"inline":case"group":return{type:a,id:z(),properties:[],nested:[]};case"heading":return{type:"heading",id:z(),properties:[],size:1};case"property":return{type:"property",id:z(),properties:[]};case"saves":return{type:"saves",id:z(),properties:[]};case"traits":return{type:"traits",id:z(),properties:[]};case"spells":return{type:"spells",id:z(),properties:[]};case"subheading":return{type:"subheading",id:z(),properties:[]};case"image":return{type:"image",id:z(),properties:[]};case"table":return{type:"table",id:z(),properties:[],headers:[],calculate:!0};case"text":return{type:"text",id:z(),properties:[],text:null}}}function Vr(a){let e=a-1;return e*e*e+1}function ln(a,{from:e,to:t},n={}){let i=getComputedStyle(a),s=i.transform==="none"?"":i.transform,[r,c]=i.transformOrigin.split(" ").map(parseFloat),o=e.left+e.width*r/t.width-(t.left+r),l=e.top+e.height*c/t.height-(t.top+c),{delay:d=0,duration:u=h=>Math.sqrt(h)*120,easing:m=Vr}=n;return{delay:d,duration:ze(u)?u(Math.sqrt(o*o+l*l)):u,easing:m,css:(h,b)=>{let f=b*o,k=b*l,C=h+b*e.width/t.width,w=h+b*e.height/t.height;return`transform: ${s} translate(${f}px, ${k}px) scale(${C}, ${w});`}}}function Kr(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,n)}return t}function Rt(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Kr(Object(t),!0).forEach(function(n){Ia(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Kr(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function hn(a){return hn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hn(a)}function Ia(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function jd(a,e){if(a==null)return{};var t={},n=Object.keys(a),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(t[i]=a[i]);return t}function qd(a,e){if(a==null)return{};var t=jd(a,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);for(i=0;i<s.length;i++)n=s[i],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(a,n)||(t[n]=a[n]))}return t}function Gd(a,e){return Vd(a)||Yd(a,e)||Fi(a,e)||Xd()}function sa(a){return Ud(a)||Kd(a)||Fi(a)||Jd()}function Ud(a){if(Array.isArray(a))return Oi(a)}function Vd(a){if(Array.isArray(a))return a}function Kd(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Yd(a,e){var t=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(t!=null){var n=[],i=!0,s=!1,r,c;try{for(t=t.call(a);!(i=(r=t.next()).done)&&(n.push(r.value),!(e&&n.length===e));i=!0);}catch(o){s=!0,c=o}finally{try{!i&&t.return!=null&&t.return()}finally{if(s)throw c}}return n}}function Fi(a,e){if(!!a){if(typeof a=="string")return Oi(a,e);var t=Object.prototype.toString.call(a).slice(8,-1);if(t==="Object"&&a.constructor&&(t=a.constructor.name),t==="Map"||t==="Set")return Array.from(a);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Oi(a,e)}}function Oi(a,e){(e==null||e>a.length)&&(e=a.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=a[t];return n}function Jd(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yn(a,e){var t=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(!t){if(Array.isArray(a)||(t=Fi(a))||e&&a&&typeof a.length=="number"){t&&(a=t);var n=0,i=function(){};return{s:i,n:function(){return n>=a.length?{done:!0}:{done:!1,value:a[n++]}},e:function(o){throw o},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,r=!1,c;return{s:function(){t=t.call(a)},n:function(){var o=t.next();return s=o.done,o},e:function(o){r=!0,c=o},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(r)throw c}}}}var Zd="finalize",Qd="consider";function ra(a,e,t){a.dispatchEvent(new CustomEvent(Zd,{detail:{items:e,info:t}}))}function St(a,e,t){a.dispatchEvent(new CustomEvent(Qd,{detail:{items:e,info:t}}))}var _n="draggedEntered",Wa="draggedLeft",wn="draggedOverIndex",zi="draggedLeftDocument",mn={LEFT_FOR_ANOTHER:"leftForAnother",OUTSIDE_OF_ANY:"outsideOfAny"};function eu(a,e,t){a.dispatchEvent(new CustomEvent(_n,{detail:{indexObj:e,draggedEl:t}}))}function tu(a,e,t){a.dispatchEvent(new CustomEvent(Wa,{detail:{draggedEl:e,type:mn.LEFT_FOR_ANOTHER,theOtherDz:t}}))}function au(a,e){a.dispatchEvent(new CustomEvent(Wa,{detail:{draggedEl:e,type:mn.OUTSIDE_OF_ANY}}))}function nu(a,e,t){a.dispatchEvent(new CustomEvent(wn,{detail:{indexObj:e,draggedEl:t}}))}function iu(a){window.dispatchEvent(new CustomEvent(zi,{detail:{draggedEl:a}}))}var De={DRAG_STARTED:"dragStarted",DRAGGED_ENTERED:_n,DRAGGED_ENTERED_ANOTHER:"dragEnteredAnother",DRAGGED_OVER_INDEX:wn,DRAGGED_LEFT:Wa,DRAGGED_LEFT_ALL:"draggedLeftAll",DROPPED_INTO_ZONE:"droppedIntoZone",DROPPED_INTO_ANOTHER:"droppedIntoAnother",DROPPED_OUTSIDE_OF_ANY:"droppedOutsideOfAny",DRAG_STOPPED:"dragStopped"},Se={POINTER:"pointer",KEYBOARD:"keyboard"},Tn="isDndShadowItem",$i="data-is-dnd-shadow-item",xt="id:dnd-shadow-placeholder-0000",su="dnd-action-dragged-el",Ie="id",Wi=0;function ro(){Wi++}function oo(){if(Wi===0)throw new Error("Bug! trying to decrement when there are no dropzones");Wi--}var ji=typeof window>"u",ee=function(){};function co(a){var e,t=a.getBoundingClientRect(),n=getComputedStyle(a),i=n.transform;if(i){var s,r,c,o;if(i.startsWith("matrix3d("))e=i.slice(9,-1).split(/, /),s=+e[0],r=+e[5],c=+e[12],o=+e[13];else if(i.startsWith("matrix("))e=i.slice(7,-1).split(/, /),s=+e[0],r=+e[3],c=+e[4],o=+e[5];else return t;var l=n.transformOrigin,d=t.x-c-(1-s)*parseFloat(l),u=t.y-o-(1-r)*parseFloat(l.slice(l.indexOf(" ")+1)),m=s?t.width/s:a.offsetWidth,h=r?t.height/r:a.offsetHeight;return{x:d,y:u,width:m,height:h,top:u,right:d+m,bottom:u+h,left:d}}else return t}function lo(a){var e=co(a);return{top:e.top+window.scrollY,bottom:e.bottom+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX}}function qi(a){var e=a.getBoundingClientRect();return{top:e.top+window.scrollY,bottom:e.bottom+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX}}function uo(a){return{x:(a.left+a.right)/2,y:(a.top+a.bottom)/2}}function ru(a,e){return Math.sqrt(Math.pow(a.x-e.x,2)+Math.pow(a.y-e.y,2))}function Gi(a,e){return a.y<=e.bottom&&a.y>=e.top&&a.x>=e.left&&a.x<=e.right}function Pa(a){return uo(qi(a))}function Yr(a,e){var t=Pa(a),n=lo(e);return Gi(t,n)}function ou(a,e){var t=Pa(a),n=Pa(e);return ru(t,n)}function cu(a){var e=qi(a);return e.right<0||e.left>document.documentElement.scrollWidth||e.bottom<0||e.top>document.documentElement.scrollHeight}function lu(a,e){var t=qi(e);return Gi(a,t)?{top:a.y-t.top,bottom:t.bottom-a.y,left:a.x-t.left,right:Math.min(t.right,document.documentElement.clientWidth)-a.x}:null}var zt;function Ui(){ee(function(){return"resetting indexes cache"}),zt=new Map}Ui();function du(a){ee(function(){return"resetting indexes cache for dz"}),zt.delete(a)}function uu(a){var e=Array.from(a.children).findIndex(function(t){return t.getAttribute($i)});if(e>=0)return zt.has(a)||zt.set(a,new Map),zt.get(a).set(e,lo(a.children[e])),e}function hu(a,e){if(!Yr(a,e))return null;var t=e.children;if(t.length===0)return{index:0,isProximityBased:!0};for(var n=uu(e),i=0;i<t.length;i++)if(Yr(a,t[i])){var s=zt.has(e)&&zt.get(e).get(i);return s&&!Gi(Pa(a),s)?{index:n,isProximityBased:!1}:{index:i,isProximityBased:!1}}for(var r=Number.MAX_VALUE,c=void 0,o=0;o<t.length;o++){var l=ou(a,t[o]);l<r&&(r=l,c=o)}return{index:c,isProximityBased:!0}}var Ea=25;function ho(){var a;function e(){a={directionObj:void 0,stepPx:0}}e();function t(s){var r=a,c=r.directionObj,o=r.stepPx;c&&(s.scrollBy(c.x*o,c.y*o),window.requestAnimationFrame(function(){return t(s)}))}function n(s){return Ea-s}function i(s,r){if(!r)return!1;var c=lu(s,r);if(c===null)return e(),!1;var o=!!a.directionObj,l=!1,d=!1;return r.scrollHeight>r.clientHeight&&(c.bottom<Ea?(l=!0,a.directionObj={x:0,y:1},a.stepPx=n(c.bottom)):c.top<Ea&&(l=!0,a.directionObj={x:0,y:-1},a.stepPx=n(c.top)),!o&&l)||r.scrollWidth>r.clientWidth&&(c.right<Ea?(d=!0,a.directionObj={x:1,y:0},a.stepPx=n(c.right)):c.left<Ea&&(d=!0,a.directionObj={x:-1,y:0},a.stepPx=n(c.left)),!o&&d)?(t(r),!0):(e(),!1)}return{scrollIfNeeded:i,resetScrolling:e}}function vt(a){return JSON.stringify(a,null,2)}function Jr(a){if(!a)throw new Error("cannot get depth of a falsy node");return mo(a,0)}function mo(a){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return a.parentElement?mo(a.parentElement,e+1):e-1}function mu(a,e){if(Object.keys(a).length!==Object.keys(e).length)return!1;for(var t in a)if(!{}.hasOwnProperty.call(e,t)||e[t]!==a[t])return!1;return!0}function gu(a,e){if(a.length!==e.length)return!1;for(var t=0;t<a.length;t++)if(a[t]!==e[t])return!1;return!0}var fu=200,Xr=10,go=ho(),pu=go.scrollIfNeeded,bu=go.resetScrolling,Ni;function ku(a,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fu,n,i,s=!1,r,c=Array.from(e).sort(function(l,d){return Jr(d)-Jr(l)});function o(){var l=Pa(a),d=pu(l,n);if(!d&&r&&Math.abs(r.x-l.x)<Xr&&Math.abs(r.y-l.y)<Xr){Ni=window.setTimeout(o,t);return}if(cu(a)){ee(function(){return"off document"}),iu(a);return}r=l;var u=!1,m=yn(c),h;try{for(m.s();!(h=m.n()).done;){var b=h.value;d&&du(n);var f=hu(a,b);if(f!==null){var k=f.index;u=!0,b!==n?(n&&tu(n,a,b),eu(b,f,a),n=b):k!==i&&(nu(b,f,a),i=k);break}}}catch(C){m.e(C)}finally{m.f()}!u&&s&&n?(au(n,a),n=void 0,i=void 0,s=!1):s=!0,Ni=window.setTimeout(o,t)}o()}function vu(){ee(function(){return"unobserving"}),clearTimeout(Ni),bu(),Ui()}var yu=300,gn;function fn(a){var e=a.touches?a.touches[0]:a;gn={x:e.clientX,y:e.clientY}}var fo=ho(),_u=fo.scrollIfNeeded,wu=fo.resetScrolling,po;function bo(){if(gn){var a=_u(gn,document.documentElement);a&&Ui()}po=window.setTimeout(bo,yu)}function Tu(){ee(function(){return"arming window scroller"}),window.addEventListener("mousemove",fn),window.addEventListener("touchmove",fn),bo()}function Au(){ee(function(){return"disarming window scroller"}),window.removeEventListener("mousemove",fn),window.removeEventListener("touchmove",fn),gn=void 0,window.clearTimeout(po),wu()}function Cu(a){var e=a.cloneNode(!0),t=[],n=a.tagName==="SELECT",i=n?[a]:sa(a.querySelectorAll("select")),s=yn(i),r;try{for(s.s();!(r=s.n()).done;){var c=r.value;t.push(c.value)}}catch(h){s.e(h)}finally{s.f()}if(i.length<=0)return e;for(var o=n?[e]:sa(e.querySelectorAll("select")),l=0;l<o.length;l++){var d=o[l],u=t[l],m=d.querySelector('option[value="'.concat(u,'"'));m&&m.setAttribute("selected",!0)}return e}var Su=.2;function Lt(a){return"".concat(a," ").concat(Su,"s ease")}function xu(a,e){var t=a.getBoundingClientRect(),n=Cu(a);ko(a,n),n.id=su,n.style.position="fixed";var i=t.top,s=t.left;if(n.style.top="".concat(i,"px"),n.style.left="".concat(s,"px"),e){var r=uo(t);i-=r.y-e.y,s-=r.x-e.x,window.setTimeout(function(){n.style.top="".concat(i,"px"),n.style.left="".concat(s,"px")},0)}return n.style.margin="0",n.style.boxSizing="border-box",n.style.height="".concat(t.height,"px"),n.style.width="".concat(t.width,"px"),n.style.transition="".concat(Lt("top"),", ").concat(Lt("left"),", ").concat(Lt("background-color"),", ").concat(Lt("opacity"),", ").concat(Lt("color")," "),window.setTimeout(function(){return n.style.transition+=", ".concat(Lt("width"),", ").concat(Lt("height"))},0),n.style.zIndex="9999",n.style.cursor="grabbing",n}function Du(a){a.style.cursor="grab"}function Eu(a,e,t,n){ko(e,a);var i=e.getBoundingClientRect(),s=a.getBoundingClientRect(),r=i.width-s.width,c=i.height-s.height;if(r||c){var o={left:(t-s.left)/s.width,top:(n-s.top)/s.height};a.style.height="".concat(i.height,"px"),a.style.width="".concat(i.width,"px"),a.style.left="".concat(parseFloat(a.style.left)-o.left*r,"px"),a.style.top="".concat(parseFloat(a.style.top)-o.top*c,"px")}}function ko(a,e){var t=window.getComputedStyle(a);Array.from(t).filter(function(n){return n.startsWith("background")||n.startsWith("padding")||n.startsWith("font")||n.startsWith("text")||n.startsWith("align")||n.startsWith("justify")||n.startsWith("display")||n.startsWith("flex")||n.startsWith("border")||n==="opacity"||n==="color"||n==="list-style-type"}).forEach(function(n){return e.style.setProperty(n,t.getPropertyValue(n),t.getPropertyPriority(n))})}function Mu(a,e){a.draggable=!1,a.ondragstart=function(){return!1},e?(a.style.userSelect="",a.style.WebkitUserSelect="",a.style.cursor=""):(a.style.userSelect="none",a.style.WebkitUserSelect="none",a.style.cursor="grab")}function vo(a){a.style.display="none",a.style.position="fixed",a.style.zIndex="-5"}function Iu(a){a.style.visibility="hidden",a.setAttribute($i,"true")}function Pu(a){a.style.visibility="",a.removeAttribute($i)}function un(a){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){return[]};a.forEach(function(n){var i=e(n);Object.keys(i).forEach(function(s){n.style[s]=i[s]}),t(n).forEach(function(s){return n.classList.add(s)})})}function pn(a){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){return[]};a.forEach(function(n){var i=e(n);Object.keys(i).forEach(function(s){n.style[s]=""}),t(n).forEach(function(s){return n.classList.contains(s)&&n.classList.remove(s)})})}function Ou(a){var e=a.style.minHeight;a.style.minHeight=window.getComputedStyle(a).getPropertyValue("height");var t=a.style.minWidth;return a.style.minWidth=window.getComputedStyle(a).getPropertyValue("width"),function(){a.style.minHeight=e,a.style.minWidth=t}}var Wu="--any--",Nu=100,Zr=3,Qr={outline:"rgba(255, 255, 102, 0.7) solid 2px"},ft,He,Ke,An,Ce,Cn,oa,Ue,At,Ze,Ft=!1,Vi=!1,Ki,Na=!1,Ma=[],dt=new Map,Ae=new Map,Pi=new WeakMap;function Hu(a,e){ee(function(){return"registering drop-zone if absent"}),dt.has(e)||dt.set(e,new Set),dt.get(e).has(a)||(dt.get(e).add(a),ro())}function eo(a,e){dt.get(e).delete(a),oo(),dt.get(e).size===0&&dt.delete(e)}function Lu(){ee(function(){return"watching dragged element"}),Tu();var a=dt.get(An),e=yn(a),t;try{for(e.s();!(t=e.n()).done;){var n=t.value;n.addEventListener(_n,yo),n.addEventListener(Wa,_o),n.addEventListener(wn,wo)}}catch(s){e.e(s)}finally{e.f()}window.addEventListener(zi,ca);var i=Math.max.apply(Math,[Nu].concat(sa(Array.from(a.keys()).map(function(s){return Ae.get(s).dropAnimationDurationMs}))));ku(He,a,i*1.07)}function Ru(){ee(function(){return"unwatching dragged element"}),Au();var a=dt.get(An),e=yn(a),t;try{for(e.s();!(t=e.n()).done;){var n=t.value;n.removeEventListener(_n,yo),n.removeEventListener(Wa,_o),n.removeEventListener(wn,wo)}}catch(i){e.e(i)}finally{e.f()}window.removeEventListener(zi,ca),vu()}function Bu(a){return a.findIndex(function(e){return e[Ie]===xt})}function Sn(a){return a.findIndex(function(e){return!!e[Tn]&&e[Ie]!==xt})}function yo(a){ee(function(){return["dragged entered",a.currentTarget,a.detail]});var e=Ae.get(a.currentTarget),t=e.items,n=e.dropFromOthersDisabled;if(n&&a.currentTarget!==Ce){ee(function(){return"ignoring dragged entered because drop is currently disabled"});return}if(Na=!1,t=t.filter(function(u){return u[Ie]!==oa[Ie]}),ee(function(){return"dragged entered items ".concat(vt(t))}),Ce!==a.currentTarget){var i=Ae.get(Ce).items,s=i.filter(function(u){return!u[Tn]});St(Ce,s,{trigger:De.DRAGGED_ENTERED_ANOTHER,id:Ke[Ie],source:Se.POINTER})}else{var r=Bu(t);r!==-1&&(ee(function(){return"removing placeholder item from origin dz"}),t.splice(r,1))}var c=a.detail.indexObj,o=c.index,l=c.isProximityBased,d=l&&o===a.currentTarget.children.length-1?o+1:o;Ue=a.currentTarget,t.splice(d,0,oa),St(a.currentTarget,t,{trigger:De.DRAGGED_ENTERED,id:Ke[Ie],source:Se.POINTER})}function _o(a){if(!!Ft){ee(function(){return["dragged left",a.currentTarget,a.detail]});var e=Ae.get(a.currentTarget),t=e.items,n=e.dropFromOthersDisabled;if(n&&a.currentTarget!==Ce&&a.currentTarget!==Ue){ee(function(){return"drop is currently disabled"});return}var i=Sn(t),s=t.splice(i,1)[0];Ue=void 0;var r=a.detail,c=r.type,o=r.theOtherDz;if(c===mn.OUTSIDE_OF_ANY||c===mn.LEFT_FOR_ANOTHER&&o!==Ce&&Ae.get(o).dropFromOthersDisabled){ee(function(){return"dragged left all, putting shadow element back in the origin dz"}),Na=!0,Ue=Ce;var l=Ae.get(Ce).items;l.splice(Cn,0,s),St(Ce,l,{trigger:De.DRAGGED_LEFT_ALL,id:Ke[Ie],source:Se.POINTER})}St(a.currentTarget,t,{trigger:De.DRAGGED_LEFT,id:Ke[Ie],source:Se.POINTER})}}function wo(a){ee(function(){return["dragged is over index",a.currentTarget,a.detail]});var e=Ae.get(a.currentTarget),t=e.items,n=e.dropFromOthersDisabled;if(n&&a.currentTarget!==Ce){ee(function(){return"drop is currently disabled"});return}Na=!1;var i=a.detail.indexObj.index,s=Sn(t);t.splice(s,1),t.splice(i,0,oa),St(a.currentTarget,t,{trigger:De.DRAGGED_OVER_INDEX,id:Ke[Ie],source:Se.POINTER})}function bn(a){a.preventDefault();var e=a.touches?a.touches[0]:a;Ze={x:e.clientX,y:e.clientY},He.style.transform="translate3d(".concat(Ze.x-At.x,"px, ").concat(Ze.y-At.y,"px, 0)")}function ca(){ee(function(){return"dropped"}),Vi=!0,window.removeEventListener("mousemove",bn),window.removeEventListener("touchmove",bn),window.removeEventListener("mouseup",ca),window.removeEventListener("touchend",ca),Ru(),Du(He),Ue||(ee(function(){return"element was dropped right after it left origin but before entering somewhere else"}),Ue=Ce),ee(function(){return["dropped in dz",Ue]});var a=Ae.get(Ue),e=a.items,t=a.type;pn(dt.get(t),function(s){return Ae.get(s).dropTargetStyle},function(s){return Ae.get(s).dropTargetClasses});var n=Sn(e);n===-1&&(n=Cn),e=e.map(function(s){return s[Tn]?Ke:s});function i(){Ki(),ra(Ue,e,{trigger:Na?De.DROPPED_OUTSIDE_OF_ANY:De.DROPPED_INTO_ZONE,id:Ke[Ie],source:Se.POINTER}),Ue!==Ce&&ra(Ce,Ae.get(Ce).items,{trigger:De.DROPPED_INTO_ANOTHER,id:Ke[Ie],source:Se.POINTER}),Pu(Ue.children[n]),$u()}Fu(n,i)}function Fu(a,e){var t=co(Ue.children[a]),n={x:t.left-parseFloat(He.style.left),y:t.top-parseFloat(He.style.top)},i=Ae.get(Ue),s=i.dropAnimationDurationMs,r="transform ".concat(s,"ms ease");He.style.transition=He.style.transition?He.style.transition+","+r:r,He.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),window.setTimeout(e,s)}function zu(a,e){Ma.push({dz:a,destroy:e}),window.requestAnimationFrame(function(){vo(a),document.body.appendChild(a)})}function $u(){He.remove(),ft.remove(),Ma.length&&(ee(function(){return["will destroy zones that were removed during drag",Ma]}),Ma.forEach(function(a){var e=a.dz,t=a.destroy;t(),e.remove()}),Ma=[]),He=void 0,ft=void 0,Ke=void 0,An=void 0,Ce=void 0,Cn=void 0,oa=void 0,Ue=void 0,At=void 0,Ze=void 0,Ft=!1,Vi=!1,Ki=void 0,Na=!1}function ju(a,e){var t=!1,n={items:void 0,type:void 0,flipDurationMs:0,dragDisabled:!1,morphDisabled:!1,dropFromOthersDisabled:!1,dropTargetStyle:Qr,dropTargetClasses:[],transformDraggedElement:function(){},centreDraggedOnCursor:!1};ee(function(){return["dndzone good to go options: ".concat(vt(e),", config: ").concat(vt(n)),{node:a}]});var i=new Map;function s(){window.addEventListener("mousemove",o,{passive:!1}),window.addEventListener("touchmove",o,{passive:!1,capture:!1}),window.addEventListener("mouseup",c,{passive:!1}),window.addEventListener("touchend",c,{passive:!1})}function r(){window.removeEventListener("mousemove",o),window.removeEventListener("touchmove",o),window.removeEventListener("mouseup",c),window.removeEventListener("touchend",c)}function c(){r(),ft=void 0,At=void 0,Ze=void 0}function o(m){m.preventDefault();var h=m.touches?m.touches[0]:m;Ze={x:h.clientX,y:h.clientY},(Math.abs(Ze.x-At.x)>=Zr||Math.abs(Ze.y-At.y)>=Zr)&&(r(),d())}function l(m){if(m.target!==m.currentTarget&&(m.target.value!==void 0||m.target.isContentEditable)){ee(function(){return"won't initiate drag on a nested input element"});return}if(m.button){ee(function(){return"ignoring none left click button: ".concat(m.button)});return}if(Ft){ee(function(){return"cannot start a new drag before finalizing previous one"});return}m.stopPropagation();var h=m.touches?m.touches[0]:m;At={x:h.clientX,y:h.clientY},Ze=Rt({},At),ft=m.currentTarget,s()}function d(){ee(function(){return["drag start config: ".concat(vt(n)),ft]}),Ft=!0;var m=i.get(ft);Cn=m,Ce=ft.parentElement;var h=Ce.getRootNode(),b=h.body||h,f=n.items,k=n.type,C=n.centreDraggedOnCursor;Ke=Rt({},f[m]),An=k,oa=Rt(Rt({},Ke),{},Ia({},Tn,!0));var w=Rt(Rt({},oa),{},Ia({},Ie,xt));He=xu(ft,C&&Ze);function W(){He.parentElement?window.requestAnimationFrame(W):(b.appendChild(He),He.focus(),Lu(),vo(ft),b.appendChild(ft))}window.requestAnimationFrame(W),un(Array.from(dt.get(n.type)).filter(function(E){return E===Ce||!Ae.get(E).dropFromOthersDisabled}),function(E){return Ae.get(E).dropTargetStyle},function(E){return Ae.get(E).dropTargetClasses}),f.splice(m,1,w),Ki=Ou(Ce),St(Ce,f,{trigger:De.DRAG_STARTED,id:Ke[Ie],source:Se.POINTER}),window.addEventListener("mousemove",bn,{passive:!1}),window.addEventListener("touchmove",bn,{passive:!1,capture:!1}),window.addEventListener("mouseup",ca,{passive:!1}),window.addEventListener("touchend",ca,{passive:!1})}function u(m){var h=m.items,b=h===void 0?void 0:h,f=m.flipDurationMs,k=f===void 0?0:f,C=m.type,w=C===void 0?Wu:C,W=m.dragDisabled,E=W===void 0?!1:W,y=m.morphDisabled,g=y===void 0?!1:y,p=m.dropFromOthersDisabled,v=p===void 0?!1:p,M=m.dropTargetStyle,N=M===void 0?Qr:M,T=m.dropTargetClasses,P=T===void 0?[]:T,L=m.transformDraggedElement,G=L===void 0?function(){}:L,B=m.centreDraggedOnCursor,te=B===void 0?!1:B;n.dropAnimationDurationMs=k,n.type&&w!==n.type&&eo(a,n.type),n.type=w,Hu(a,w),n.items=sa(b),n.dragDisabled=E,n.morphDisabled=g,n.transformDraggedElement=G,n.centreDraggedOnCursor=te,t&&Ft&&!Vi&&(!mu(N,n.dropTargetStyle)||!gu(P,n.dropTargetClasses))&&(pn([a],function(){return n.dropTargetStyle},function(){return P}),un([a],function(){return N},function(){return P})),n.dropTargetStyle=N,n.dropTargetClasses=sa(P);function F(pe,we){return Ae.get(pe)?Ae.get(pe)[we]:n[we]}t&&Ft&&n.dropFromOthersDisabled!==v&&(v?pn([a],function(pe){return F(pe,"dropTargetStyle")},function(pe){return F(pe,"dropTargetClasses")}):un([a],function(pe){return F(pe,"dropTargetStyle")},function(pe){return F(pe,"dropTargetClasses")})),n.dropFromOthersDisabled=v,Ae.set(a,n);for(var fe=Sn(n.items),oe=0;oe<a.children.length;oe++){var he=a.children[oe];if(Mu(he,E),oe===fe){n.transformDraggedElement(He,Ke,oe),g||Eu(He,he,Ze.x,Ze.y),Iu(he);continue}he.removeEventListener("mousedown",Pi.get(he)),he.removeEventListener("touchstart",Pi.get(he)),E||(he.addEventListener("mousedown",l),he.addEventListener("touchstart",l),Pi.set(he,l)),i.set(he,oe),t||(t=!0)}}return u(e),{update:function(h){ee(function(){return"pointer dndzone will update newOptions: ".concat(vt(h))}),u(h)},destroy:function(){function h(){ee(function(){return"pointer dndzone will destroy"}),eo(a,Ae.get(a).type),Ae.delete(a)}Ft?(ee(function(){return"pointer dndzone will be scheduled for destruction"}),zu(a,h)):h()}}}var dn,Hi={DND_ZONE_ACTIVE:"dnd-zone-active",DND_ZONE_DRAG_DISABLED:"dnd-zone-drag-disabled"},To=(dn={},Ia(dn,Hi.DND_ZONE_ACTIVE,"Tab to one the items and press space-bar or enter to start dragging it"),Ia(dn,Hi.DND_ZONE_DRAG_DISABLED,"This is a disabled drag and drop list"),dn),qu="dnd-action-aria-alert",Te;function Li(){Te||(Te=document.createElement("div"),function(){Te.id=qu,Te.style.position="fixed",Te.style.bottom="0",Te.style.left="0",Te.style.zIndex="-5",Te.style.opacity="0",Te.style.height="0",Te.style.width="0",Te.setAttribute("role","alert")}(),document.body.prepend(Te),Object.entries(To).forEach(function(a){var e=Gd(a,2),t=e[0],n=e[1];return document.body.prepend(Vu(t,n))}))}function Gu(){return ji?null:(document.readyState==="complete"?Li():window.addEventListener("DOMContentLoaded",Li),Rt({},Hi))}function Uu(){ji||!Te||(Object.keys(To).forEach(function(a){var e;return(e=document.getElementById(a))===null||e===void 0?void 0:e.remove()}),Te.remove(),Te=void 0)}function Vu(a,e){var t=document.createElement("div");return t.id=a,t.innerHTML="<p>".concat(e,"</p>"),t.style.display="none",t.style.position="fixed",t.style.zIndex="-5",t}function ia(a){if(!ji){Te||Li(),Te.innerHTML="";var e=document.createTextNode(a);Te.appendChild(e),Te.style.display="none",Te.style.display="inline"}}var Ku="--any--",to={outline:"rgba(255, 255, 102, 0.7) solid 2px"},Qe=!1,Ri,Fe,$t="",Bt,ct,Ct="",kn=new WeakSet,ao=new WeakMap,no=new WeakMap,Bi=new Map,Ne=new Map,lt=new Map,vn;function Yu(a,e){ee(function(){return"registering drop-zone if absent"}),lt.size===0&&(ee(function(){return"adding global keydown and click handlers"}),vn=Gu(),window.addEventListener("keydown",Ao),window.addEventListener("click",Co)),lt.has(e)||lt.set(e,new Set),lt.get(e).has(a)||(lt.get(e).add(a),ro())}function io(a,e){ee(function(){return"unregistering drop-zone"}),Fe===a&&Oa(),lt.get(e).delete(a),oo(),lt.get(e).size===0&<.delete(e),lt.size===0&&(ee(function(){return"removing global keydown and click handlers"}),window.removeEventListener("keydown",Ao),window.removeEventListener("click",Co),vn=void 0,Uu())}function Ao(a){if(!!Qe)switch(a.key){case"Escape":{Oa();break}}}function Co(){!Qe||kn.has(document.activeElement)||(ee(function(){return"clicked outside of any draggable"}),Oa())}function Ju(a){if(ee(function(){return"zone focus"}),!!Qe){var e=a.currentTarget;if(e!==Fe){$t=e.getAttribute("aria-label")||"";var t=Ne.get(Fe),n=t.items,i=n.find(function(u){return u[Ie]===ct}),s=n.indexOf(i),r=n.splice(s,1)[0],c=Ne.get(e),o=c.items,l=c.autoAriaDisabled;e.getBoundingClientRect().top<Fe.getBoundingClientRect().top||e.getBoundingClientRect().left<Fe.getBoundingClientRect().left?(o.push(r),l||ia("Moved item ".concat(Ct," to the end of the list ").concat($t))):(o.unshift(r),l||ia("Moved item ".concat(Ct," to the beginning of the list ").concat($t)));var d=Fe;ra(d,n,{trigger:De.DROPPED_INTO_ANOTHER,id:ct,source:Se.KEYBOARD}),ra(e,o,{trigger:De.DROPPED_INTO_ZONE,id:ct,source:Se.KEYBOARD}),Fe=e}}}function So(){Bi.forEach(function(a,e){var t=a.update;return t(Ne.get(e))})}function Oa(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;ee(function(){return"drop"}),Ne.get(Fe).autoAriaDisabled||ia("Stopped dragging item ".concat(Ct)),kn.has(document.activeElement)&&document.activeElement.blur(),a&&St(Fe,Ne.get(Fe).items,{trigger:De.DRAG_STOPPED,id:ct,source:Se.KEYBOARD}),pn(lt.get(Ri),function(e){return Ne.get(e).dropTargetStyle},function(e){return Ne.get(e).dropTargetClasses}),Bt=null,ct=null,Ct="",Ri=null,Fe=null,$t="",Qe=!1,So()}function Xu(a,e){var t={items:void 0,type:void 0,dragDisabled:!1,zoneTabIndex:0,dropFromOthersDisabled:!1,dropTargetStyle:to,dropTargetClasses:[],autoAriaDisabled:!1};function n(d,u,m){d.length<=1||d.splice(m,1,d.splice(u,1,d[m])[0])}function i(d){switch(ee(function(){return["handling key down",d.key]}),d.key){case"Enter":case" ":{if((d.target.disabled!==void 0||d.target.href||d.target.isContentEditable)&&!kn.has(d.target))return;d.preventDefault(),d.stopPropagation(),Qe?Oa():s(d);break}case"ArrowDown":case"ArrowRight":{if(!Qe)return;d.preventDefault(),d.stopPropagation();var u=Ne.get(a),m=u.items,h=Array.from(a.children),b=h.indexOf(d.currentTarget);ee(function(){return["arrow down",b]}),b<h.length-1&&(t.autoAriaDisabled||ia("Moved item ".concat(Ct," to position ").concat(b+2," in the list ").concat($t)),n(m,b,b+1),ra(a,m,{trigger:De.DROPPED_INTO_ZONE,id:ct,source:Se.KEYBOARD}));break}case"ArrowUp":case"ArrowLeft":{if(!Qe)return;d.preventDefault(),d.stopPropagation();var f=Ne.get(a),k=f.items,C=Array.from(a.children),w=C.indexOf(d.currentTarget);ee(function(){return["arrow up",w]}),w>0&&(t.autoAriaDisabled||ia("Moved item ".concat(Ct," to position ").concat(w," in the list ").concat($t)),n(k,w,w-1),ra(a,k,{trigger:De.DROPPED_INTO_ZONE,id:ct,source:Se.KEYBOARD}));break}}}function s(d){ee(function(){return"drag start"}),c(d.currentTarget),Fe=a,Ri=t.type,Qe=!0;var u=Array.from(lt.get(t.type)).filter(function(h){return h===Fe||!Ne.get(h).dropFromOthersDisabled});if(un(u,function(h){return Ne.get(h).dropTargetStyle},function(h){return Ne.get(h).dropTargetClasses}),!t.autoAriaDisabled){var m="Started dragging item ".concat(Ct,". Use the arrow keys to move it within its list ").concat($t);u.length>1&&(m+=", or tab to another list in order to move the item into it"),ia(m)}St(a,Ne.get(a).items,{trigger:De.DRAG_STARTED,id:ct,source:Se.KEYBOARD}),So()}function r(d){!Qe||d.currentTarget!==Bt&&(d.stopPropagation(),Oa(!1),s(d))}function c(d){var u=Ne.get(a),m=u.items,h=Array.from(a.children),b=h.indexOf(d);Bt=d,Bt.tabIndex=0,ct=m[b][Ie],Ct=h[b].getAttribute("aria-label")||""}function o(d){var u=d.items,m=u===void 0?[]:u,h=d.type,b=h===void 0?Ku:h,f=d.dragDisabled,k=f===void 0?!1:f,C=d.zoneTabIndex,w=C===void 0?0:C,W=d.dropFromOthersDisabled,E=W===void 0?!1:W,y=d.dropTargetStyle,g=y===void 0?to:y,p=d.dropTargetClasses,v=p===void 0?[]:p,M=d.autoAriaDisabled,N=M===void 0?!1:M;t.items=sa(m),t.dragDisabled=k,t.dropFromOthersDisabled=E,t.zoneTabIndex=w,t.dropTargetStyle=g,t.dropTargetClasses=v,t.autoAriaDisabled=N,t.type&&b!==t.type&&io(a,t.type),t.type=b,Yu(a,b),N||(a.setAttribute("aria-disabled",k),a.setAttribute("role","list"),a.setAttribute("aria-describedby",k?vn.DND_ZONE_DRAG_DISABLED:vn.DND_ZONE_ACTIVE)),Ne.set(a,t),Qe?a.tabIndex=a===Fe||Bt.contains(a)||t.dropFromOthersDisabled||Fe&&t.type!==Ne.get(Fe).type?-1:0:a.tabIndex=t.zoneTabIndex,a.addEventListener("focus",Ju);for(var T=function(G){var B=a.children[G];kn.add(B),B.tabIndex=Qe?-1:0,N||B.setAttribute("role","listitem"),B.removeEventListener("keydown",ao.get(B)),B.removeEventListener("click",no.get(B)),k||(B.addEventListener("keydown",i),ao.set(B,i),B.addEventListener("click",r),no.set(B,r)),Qe&&t.items[G][Ie]===ct&&(ee(function(){return["focusing on",{i:G,focusedItemId:ct}]}),Bt=B,Bt.tabIndex=0,B.focus())},P=0;P<a.children.length;P++)T(P)}o(e);var l={update:function(u){ee(function(){return"keyboard dndzone will update newOptions: ".concat(vt(u))}),o(u)},destroy:function(){ee(function(){return"keyboard dndzone will destroy"}),io(a,t.type),Ne.delete(a),Bi.delete(a)}};return Bi.set(a,l),l}var Zu=["items","flipDurationMs","type","dragDisabled","morphDisabled","dropFromOthersDisabled","zoneTabIndex","dropTargetStyle","dropTargetClasses","transformDraggedElement","autoAriaDisabled","centreDraggedOnCursor"];function la(a,e){so(e);var t=ju(a,e),n=Xu(a,e);return{update:function(s){so(s),t.update(s),n.update(s)},destroy:function(){t.destroy(),n.destroy()}}}function so(a){var e=a.items,t=a.flipDurationMs,n=a.type,i=a.dragDisabled,s=a.morphDisabled,r=a.dropFromOthersDisabled,c=a.zoneTabIndex,o=a.dropTargetStyle,l=a.dropTargetClasses,d=a.transformDraggedElement,u=a.autoAriaDisabled,m=a.centreDraggedOnCursor,h=qd(a,Zu);if(Object.keys(h).length>0&&console.warn("dndzone will ignore unknown options",h),!e)throw new Error("no 'items' key provided to dndzone");var b=e.find(function(f){return!{}.hasOwnProperty.call(f,Ie)});if(b)throw new Error("missing '".concat(Ie,"' property for item ").concat(vt(b)));if(l&&!Array.isArray(l))throw new Error("dropTargetClasses should be an array but instead it is a ".concat(hn(l),", ").concat(vt(l)));if(c&&!Qu(c))throw new Error("zoneTabIndex should be a number but instead it is a ".concat(hn(c),", ").concat(vt(c)))}function Qu(a){return!isNaN(a)&&function(e){return(e|0)===e}(parseFloat(a))}var da=require("obsidian");function eh(a){K(a,"svelte-r3p86y",".property-block-container.svelte-r3p86y{display:flex;justify-content:space-between;align-items:center}.info.svelte-r3p86y{display:flex;flex-flow:column}.context.svelte-r3p86y{display:flex;align-items:center;gap:0.25rem;color:var(--text-muted)}.context-item.svelte-r3p86y{display:flex;align-items:center}")}function xo(a){let e,t,n=a[0].size+"",i,s;return{c(){e=A("span"),t=de("(H"),i=de(n),s=de(")")},m(r,c){x(r,e,c),D(e,t),D(e,i),D(e,s)},p(r,c){c&1&&n!==(n=r[0].size+"")&&ve(i,n)},d(r){r&&S(e)}}}function Do(a){let e,t,n=a[0].headers.join(" | ")+"",i,s;return{c(){e=A("strong"),t=de("("),i=de(n),s=de(")")},m(r,c){x(r,e,c),D(e,t),D(e,i),D(e,s)},p(r,c){c&1&&n!==(n=r[0].headers.join(" | ")+"")&&ve(i,n)},d(r){r&&S(e)}}}function Eo(a){let e,t,n,i;return{c(){e=A("div"),_(e,"class","context-item heading svelte-r3p86y"),_(e,"aria-label","Has Heading")},m(s,r){x(s,e,r),n||(i=ae(t=a[5].call(null,e)),n=!0)},d(s){s&&S(e),n=!1,i()}}}function Mo(a){let e,t,n,i;return{c(){e=A("div"),_(e,"class","context-item conditioned svelte-r3p86y"),_(e,"aria-label","Conditioned")},m(s,r){x(s,e,r),n||(i=ae(t=a[2].call(null,e)),n=!0)},d(s){s&&S(e),n=!1,i()}}}function Io(a){let e,t,n,i;return{c(){e=A("div"),_(e,"class","context-item callback svelte-r3p86y"),_(e,"aria-label","Has Callback")},m(s,r){x(s,e,r),n||(i=ae(t=a[6].call(null,e)),n=!0)},d(s){s&&S(e),n=!1,i()}}}function Po(a){let e,t,n,i;return{c(){e=A("div"),_(e,"class","context-item dice svelte-r3p86y"),_(e,"aria-label","Will Parse for Dice Rolls")},m(s,r){x(s,e,r),n||(i=ae(t=a[3].call(null,e)),n=!0)},d(s){s&&S(e),n=!1,i()}}}function Oo(a){let e,t,n,i;return{c(){e=A("div"),_(e,"class","context-item dice svelte-r3p86y"),_(e,"aria-label","Render markdown enabled")},m(s,r){x(s,e,r),n||(i=ae(t=a[4].call(null,e)),n=!0)},d(s){s&&S(e),n=!1,i()}}}function th(a){let e,t,n,i,s=a[1](a[0].type)+"",r,c,o,l,d,u,m=a[0].properties.join(", ")+"",h,b,f,k,C,w,W,E=a[0].type=="heading"&&xo(a),y=a[0].type=="table"&&a[0].headers?.length&&Do(a),g="heading"in a[0]&&Eo(a),p=a[0].conditioned&&Mo(a),v="callback"in a[0]&&Io(a),M="dice"in a[0]&&a[0].dice&&Po(a),N="markdown"in a[0]&&a[0].markdown&&Oo(a);return{c(){e=A("div"),t=A("div"),n=A("div"),i=A("span"),r=de(s),c=R(),E&&E.c(),o=R(),y&&y.c(),l=R(),d=A("small"),u=A("em"),h=de(m),b=R(),f=A("small"),g&&g.c(),k=R(),p&&p.c(),C=R(),v&&v.c(),w=R(),M&&M.c(),W=R(),N&&N.c(),_(t,"class","info svelte-r3p86y"),_(f,"class","context svelte-r3p86y"),_(e,"class","property-block-container svelte-r3p86y")},m(T,P){x(T,e,P),D(e,t),D(t,n),D(n,i),D(i,r),D(n,c),E&&E.m(n,null),D(n,o),y&&y.m(n,null),D(t,l),D(t,d),D(d,u),D(u,h),D(e,b),D(e,f),g&&g.m(f,null),D(f,k),p&&p.m(f,null),D(f,C),v&&v.m(f,null),D(f,w),M&&M.m(f,null),D(f,W),N&&N.m(f,null)},p(T,[P]){P&1&&s!==(s=T[1](T[0].type)+"")&&ve(r,s),T[0].type=="heading"?E?E.p(T,P):(E=xo(T),E.c(),E.m(n,o)):E&&(E.d(1),E=null),T[0].type=="table"&&T[0].headers?.length?y?y.p(T,P):(y=Do(T),y.c(),y.m(n,null)):y&&(y.d(1),y=null),P&1&&m!==(m=T[0].properties.join(", ")+"")&&ve(h,m),"heading"in T[0]?g||(g=Eo(T),g.c(),g.m(f,k)):g&&(g.d(1),g=null),T[0].conditioned?p||(p=Mo(T),p.c(),p.m(f,C)):p&&(p.d(1),p=null),"callback"in T[0]?v||(v=Io(T),v.c(),v.m(f,w)):v&&(v.d(1),v=null),"dice"in T[0]&&T[0].dice?M||(M=Po(T),M.c(),M.m(f,W)):M&&(M.d(1),M=null),"markdown"in T[0]&&T[0].markdown?N||(N=Oo(T),N.c(),N.m(f,null)):N&&(N.d(1),N=null)},i:H,o:H,d(T){T&&S(e),E&&E.d(),y&&y.d(),g&&g.d(),p&&p.d(),v&&v.d(),M&&M.d(),N&&N.d()}}}function ah(a,e,t){let{block:n}=e;n.type=="heading"&&!n.size&&(n.size=1);let i=d=>"display"in n?`${n.display} (${d[0].toUpperCase()+d.slice(1).toLowerCase()})`:d[0].toUpperCase()+d.slice(1).toLowerCase(),s=d=>{(0,da.setIcon)(d,"statblock-conditioned")},r=d=>{(0,da.setIcon)(d,"dice-roller-dice")},c=d=>{(0,da.setIcon)(d,"markdown-icon")},o=d=>{(0,da.setIcon)(d,"heading-glyph")},l=d=>{(0,da.setIcon)(d,"code-glyph")};return a.$$set=d=>{"block"in d&&t(0,n=d.block)},[n,i,s,r,c,o,l]}var Yi=class extends q{constructor(e){super(),U(this,e,ah,th,j,{block:0},eh)}},Wo=Yi;var Qi=require("obsidian");var $o=_a(xa()),le=require("obsidian");var xn=require("obsidian");function nh(a){K(a,"svelte-1blh0v3",".creator-zone.svelte-1blh0v3{display:flex;justify-content:space-evenly;gap:1rem;flex-flow:row wrap}.header-container.svelte-1blh0v3{display:flex;align-items:center}")}function No(a,e,t){let n=a.slice();return n[12]=e[t],n}function Ho(a,e){let t,n,i=e[12].name+"",s,r,c,o,l,d,u=H,m,h;function b(){return e[8](e[12])}return{key:a,first:null,c(){t=A("div"),n=A("span"),s=de(i),r=R(),c=A("div"),l=R(),_(n,"class","table-header"),_(t,"class","header-container svelte-1blh0v3"),this.first=t},m(f,k){x(f,t,k),D(t,n),D(n,s),D(t,r),D(t,c),D(t,l),m||(h=[ae(o=e[5].call(null,c)),ue(c,"click",b)],m=!0)},p(f,k){e=f,k&1&&i!==(i=e[12].name+"")&&ve(s,i)},r(){d=t.getBoundingClientRect()},f(){en(t),u()},a(){u(),u=Qa(t,d,ln,{duration:Ji})},d(f){f&&S(t),m=!1,me(h)}}}function ih(a){let e,t,n=[],i=new Map,s,r,c,o=a[0].filter(a[7]),l=d=>d[12].id;for(let d=0;d<o.length;d+=1){let u=No(a,o,d),m=l(u);i.set(m,n[d]=Ho(m,u))}return{c(){e=A("div"),t=A("section");for(let d=0;d<n.length;d+=1)n[d].c();_(t,"class","creator-zone svelte-1blh0v3"),_(e,"class","table-header-container")},m(d,u){x(d,e,u),D(e,t);for(let m=0;m<n.length;m+=1)n[m].m(t,null);r||(c=[ae(s=la.call(null,t,{items:a[0],flipDurationMs:Ji,dragDisabled:a[1],type:"table_headers"})),ue(t,"consider",a[2]),ue(t,"finalize",a[3])],r=!0)},p(d,[u]){if(u&17){o=d[0].filter(d[7]);for(let m=0;m<n.length;m+=1)n[m].r();n=aa(n,u,l,1,d,o,i,t,Xs,Ho,null,No);for(let m=0;m<n.length;m+=1)n[m].a()}s&&ze(s.update)&&u&3&&s.update.call(null,{items:d[0],flipDurationMs:Ji,dragDisabled:d[1],type:"table_headers"})},i:H,o:H,d(d){d&&S(e);for(let u=0;u<n.length;u+=1)n[u].d();r=!1,me(c)}}}var Ji=300;function sh(a,e,t){let n=We(),{headers:i}=e,s=i.map(f=>({name:f,id:z()})),r=!1;function c(f){let{items:k,info:{source:C,trigger:w}}=f.detail;t(0,s=[...k])}function o(f){let{items:k,info:{source:C}}=f.detail;t(0,s=[...k]),n("sorted",s)}let l=f=>{(0,xn.setIcon)(f,"dropzone-grip")};function d(f){f.preventDefault(),t(1,r=!1)}let u=f=>{t(0,s=s.filter(k=>k.id!=f.id)),n("sorted",s)},m=f=>{new xn.ExtraButtonComponent(f).setIcon("cross-in-box")},h=f=>f.id!==xt,b=f=>u(f);return a.$$set=f=>{"headers"in f&&t(6,i=f.headers)},[s,r,c,o,u,m,i,h,b]}var Xi=class extends q{constructor(e){super(),U(this,e,sh,ih,j,{headers:6},nh)}},Lo=Xi;var ua=require("obsidian");function rh(a){K(a,"svelte-mn2hp8",".setting-item.svelte-mn2hp8{align-items:center}.icon.svelte-mn2hp8{display:flex;align-items:center}")}function Ro(a,e,t){let n=a.slice();return n[19]=e[t],n[20]=e,n[21]=t,n}function oh(a){let e,t=a[19].prop+"",n;return{c(){e=A("div"),n=de(t),_(e,"class","setting-item-name")},m(i,s){x(i,e,s),D(e,n)},p(i,s){s&4&&t!==(t=i[19].prop+"")&&ve(n,t)},d(i){i&&S(e)}}}function ch(a){let e,t,n,i;function s(){a[14].call(e,a[20],a[21])}return{c(){e=A("input"),_(e,"type","text"),_(e,"placeholder",t=a[19].prop)},m(r,c){x(r,e,c),ei(e,a[19].prop),n||(i=ue(e,"input",s),n=!0)},p(r,c){a=r,c&4&&t!==(t=a[19].prop)&&_(e,"placeholder",t),c&4&&e.value!==a[19].prop&&ei(e,a[19].prop)},d(r){r&&S(e),n=!1,i()}}}function lh(a){let e,t,n,i;function s(){return a[16](a[19])}return{c(){e=A("div"),_(e,"class","edit")},m(r,c){x(r,e,c),n||(i=[ue(e,"click",s),ae(t=a[11].call(null,e))],n=!0)},p(r,c){a=r},d(r){r&&S(e),n=!1,me(i)}}}function dh(a){let e,t,n,i;function s(){return a[15](a[19])}return{c(){e=A("div"),_(e,"class","done")},m(r,c){x(r,e,c),n||(i=[ue(e,"click",s),ae(t=a[12].call(null,e))],n=!0)},p(r,c){a=r},d(r){r&&S(e),n=!1,me(i)}}}function Bo(a,e){let t,n,i,s,r,c,o,l,d,u,m,h,b,f;function k(p,v){return p[1]==p[19].id?ch:oh}let C=k(e,-1),w=C(e);function W(p,v){return p[1]==p[19].id?dh:lh}let E=W(e,-1),y=E(e);function g(){return e[17](e[19])}return{key:a,first:null,c(){t=A("div"),n=A("div"),r=R(),c=A("div"),w.c(),o=R(),l=A("div"),y.c(),d=R(),u=A("div"),h=R(),_(n,"class","icon svelte-mn2hp8"),_(n,"style",i=e[0]?"cursor: grab":"cursor: grabbing"),_(c,"class","setting-item-info"),_(u,"class","delete"),_(l,"class","setting-item-control"),_(t,"class","setting-item svelte-mn2hp8"),this.first=t},m(p,v){x(p,t,v),D(t,n),D(t,r),D(t,c),w.m(c,null),D(t,o),D(t,l),y.m(l,null),D(l,d),D(l,u),D(t,h),b||(f=[ae(s=e[5].call(null,n)),ue(n,"mousedown",e[6]),ue(n,"touchstart",e[6]),ue(u,"click",g),ae(m=e[8].call(null,u))],b=!0)},p(p,v){e=p,v&1&&i!==(i=e[0]?"cursor: grab":"cursor: grabbing")&&_(n,"style",i),C===(C=k(e,v))&&w?w.p(e,v):(w.d(1),w=C(e),w&&(w.c(),w.m(c,null))),E===(E=W(e,v))&&y?y.p(e,v):(y.d(1),y=E(e),y&&(y.c(),y.m(l,d)))},d(p){p&&S(t),w.d(),y.d(),b=!1,me(f)}}}function uh(a){let e,t=[],n=new Map,i,s,r,c=a[2],o=l=>l[19].id;for(let l=0;l<c.length;l+=1){let d=Ro(a,c,l),u=o(d);n.set(u,t[l]=Bo(u,d))}return{c(){e=A("section");for(let l=0;l<t.length;l+=1)t[l].c();_(e,"class","subheading-zone")},m(l,d){x(l,e,d);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s||(r=[ae(i=la.call(null,e,{items:a[2],flipDurationMs:Fo,dragDisabled:a[0],type:"subheading"})),ue(e,"consider",a[3]),ue(e,"finalize",a[4])],s=!0)},p(l,[d]){d&1735&&(c=l[2],t=aa(t,d,o,1,l,c,n,e,oi,Bo,null,Ro)),i&&ze(i.update)&&d&5&&i.update.call(null,{items:l[2],flipDurationMs:Fo,dragDisabled:l[0],type:"subheading"})},i:H,o:H,d(l){l&&S(e);for(let d=0;d<t.length;d+=1)t[d].d();s=!1,me(r)}}}var Fo=300;function hh(a,e,t){let n,{properties:i=[]}=e,s=We(),r=!0;function c(g){let{items:p,info:{source:v,trigger:M}}=g.detail;t(2,n=[...p]),v===Se.KEYBOARD&&M===De.DRAG_STOPPED&&t(0,r=!0)}function o(g){let{items:p,info:{source:v}}=g.detail;t(2,n=[...p]),s("sorted",n.map(({prop:M})=>M)),v===Se.POINTER&&t(0,r=!0)}let l=g=>{(0,ua.setIcon)(g,"dropzone-grip")};function d(g){g.preventDefault(),t(0,r=!1)}let u=g=>{t(2,n=n.filter(p=>p.id!=g.id)),s("sorted",n.map(({prop:p})=>p))},m=g=>{new ua.ExtraButtonComponent(g).setIcon("trash")},h,b=g=>{t(1,h=g.id)},f=g=>{t(2,n=n.map(p=>p.id==g.id?{id:g.id,prop:g.prop}:p)),t(1,h=null),s("sorted",n.map(({prop:p})=>p))},k=g=>{new ua.ExtraButtonComponent(g).setIcon("pencil")},C=g=>{new ua.ExtraButtonComponent(g).setIcon("check")};function w(g,p){g[p].prop=this.value,t(2,n),t(13,i)}let W=g=>f(g),E=g=>b(g),y=g=>u(g);return a.$$set=g=>{"properties"in g&&t(13,i=g.properties)},a.$$.update=()=>{if(a.$$.dirty&8192){e:t(2,n=[...i])}},[r,h,n,c,o,l,d,u,m,b,f,k,C,i,w,W,E,y]}var Zi=class extends q{constructor(e){super(),U(this,e,hh,uh,j,{properties:13},rh)}},zo=Zi;var ha=class extends le.Modal{constructor(t,n){super(t.app);this.plugin=t;this.advanced=this.plugin.settings.showAdvanced,n&&(this.block=(0,$o.default)(n)),this.containerEl.addClass("statblock-edit-block")}get group(){return["group","inline"].contains(this.block.type)}onOpen(){this.titleEl.setText("Edit Block"),this.display()}buildProperties(t){if(t.empty(),!this.group){if(this.block.type=="subheading"){let n=t.createDiv("statblock-additional-container"),i="";new le.Setting(n).setHeading().setName("Link Monster Properties").addText(c=>c.setPlaceholder("property").setValue(i).onChange(o=>i=o)).addExtraButton(c=>c.setIcon("plus-with-circle").onClick(()=>{if(!i||!i.length){new le.Notice("A valid property must be supplied.");return}this.block.properties.push(i),this.buildProperties(t)}));let s=n.createDiv("additional");new zo({target:s,props:{properties:this.block.properties.map(c=>({prop:c,id:z()}))}}).$on("sorted",c=>{this.block.properties=[...c.detail]})}else new le.Setting(t).setName("Link Monster Property").addText(n=>n.setValue(this.block.properties[0]).onChange(i=>{this.block.properties[0]=i}));if((this.block.type=="property"||this.block.type=="saves")&&new le.Setting(this.contentEl).setName("Display Text").setDesc("This text will be used for the property name.").addText(n=>{n.setValue(this.block.display).onChange(i=>this.block.display=i)}),(this.block.type=="traits"||this.block.type=="text")&&(new le.Setting(this.contentEl).setName("Use Monster Property for Heading").setDesc("The Section heading will be set to the value of the specified property.").addToggle(n=>{n.setValue(this.block.headingProp).onChange(i=>{this.block.headingProp=i,this.display()})}),new le.Setting(this.contentEl).setName("Section Heading").setDesc(this.block.headingProp?"The section will use this property for the section heading. If the property does not exist or is blank, the section heading will not appear.":"This text will be used for the section heading. Can be left blank.").addText(n=>{n.setValue(this.block.heading).onChange(i=>this.block.heading=i)})),this.block.type=="table"){let n=t.createDiv("statblock-additional-container"),i="";new le.Setting(n).setHeading().setName("Table Headers").addText(r=>r.setPlaceholder("header").setValue(i).onChange(c=>i=c)).addExtraButton(r=>r.setIcon("plus-with-circle").onClick(()=>{if(!i||!i.length){new le.Notice("A valid property must be supplied.");return}this.block.headers.push(i),this.buildProperties(t)}));let s=n.createDiv("additional");new Lo({target:s,props:{headers:this.block.headers}}).$on("sorted",r=>{this.block.headers=[...r.detail?.map(c=>c.name)??[]]}),new le.Setting(t).setName("Calculate Modifiers").setDesc("The block will not attempt to calculate modifiers for table values.").addToggle(r=>{r.setValue(this.block.calculate).onChange(c=>{this.block.calculate=c})})}if(this.block.type=="heading"&&new le.Setting(this.contentEl).setName("Header Size").setDesc("The heading will use this size.").addDropdown(n=>{this.block.size||this.block.size==1,n.addOptions({1:"H1",2:"H2",3:"H3",4:"H4",5:"H5",6:"H6"}).setValue(`${this.block.size}`).onChange(i=>this.block.size=Number(i))}),!this.advanced)return;Ur.includes(this.block.type)&&new le.Setting(t).setName("Render as Markdown").setDesc(createFragment(n=>{n.createSpan({text:"The block will attempt to render as markdown."})})).addToggle(n=>{n.setValue(this.block.markdown).onChange(i=>{this.block.markdown=i})}),this.block.type=="text"&&(new le.Setting(t).setHeading().setName("Text to Show").setDesc(createFragment(n=>{n.createSpan({text:"The block will "}),n.createEl("strong",{text:"always"}),n.createSpan({text:" display the text entered here."})})),new le.TextAreaComponent(t).setValue(this.block.text).onChange(n=>{this.block.text=n})),this.block.type=="property"&&(new le.Setting(t).setHeading().setName("Callback").setDesc(createFragment(n=>{n.createSpan({text:"The block will run the callback and use the returned string as the property."}),n.createEl("br"),n.createSpan({text:"The callback will receive the "}),n.createEl("code",{text:"monster"}),n.createSpan({text:" parameter."})})),new le.TextAreaComponent(t).setValue(this.block.callback).onChange(n=>{this.block.callback=n})),this.block.type=="table"&&(new le.Setting(t).setHeading().setName("Ability Modifier Calculation").setDesc(createFragment(n=>{n.createSpan({text:"Allows a custom modifier for the stat."}),n.createEl("br"),n.createSpan({text:"Variable "}),n.createEl("code",{text:"stat"}),n.createSpan({text:"is accessible, use this to calculate the modifier."})})),new le.TextAreaComponent(t).setValue(this.block.modifier).onChange(n=>{this.block.modifier=n}))}}buildSeparator(t){t.empty(),this.block.type=="subheading"&&new le.Setting(t).setName("Separator").setDesc("Text separating properties").addText(n=>{this.block.type=="subheading"&&(this.block.separator||(this.block.separator=" "),n.setValue(this.block.separator).onChange(i=>{this.block.type=="subheading"&&(this.block.separator=i)}))})}buildConditions(t){t.empty(),new le.Setting(t).setName("Conditional").setDesc("The block will not be added if the associated properties are not present.").addToggle(n=>{n.setValue(this.block.conditioned).onChange(i=>{this.block.conditioned=i,this.buildConditions(t)})}),!this.block.conditioned&&!this.group&&new le.Setting(t).setName("Fallback").setDesc("If not present, this text will be displayed.").addText(n=>{this.block.fallback||(this.block.fallback="-"),n.setValue(this.block.fallback).onChange(i=>{this.block.fallback=i})}),new le.Setting(t).setName("Has Rule").setDesc("If present, the block will have a horizontal rule placed after it.").addToggle(n=>{n.setValue(this.block.hasRule).onChange(i=>this.block.hasRule=i)})}buildDice(t){t.empty(),!this.group&&this.plugin.canUseDiceRoller&&(new le.Setting(t).setName("Parse for Dice").setDesc("The plugin will attempt to add dice rollers as specified.").addToggle(n=>n.setValue(this.block.dice).onChange(i=>{this.block.dice=i,this.buildDice(t)})),this.block.dice&&new le.Setting(t.createDiv()).setName("Link Dice to Property").setDesc("The dice roller will parse this property instead of the original.").addText(n=>{n.setValue(this.block.diceProperty).onChange(i=>{this.block.diceProperty=i})})),this.advanced&&(new le.Setting(t).setHeading().setName("Dice Callback").setDesc(createFragment(n=>{n.createSpan({text:"The block will run the callback and use the returned values for the dice strings."}),n.createEl("br"),n.createSpan({text:"The callback will receive the "}),n.createEl("code",{text:"monster"}),n.createSpan({text:" and "}),n.createEl("code",{text:"property"}),n.createSpan({text:"parameters."})})),new le.TextAreaComponent(t).setValue(this.block.diceCallback).onChange(n=>{this.block.diceCallback=n}))}async display(){this.contentEl.empty(),new le.Setting(this.contentEl).setName("Show Advanced Options").addToggle(t=>{t.setValue(this.advanced??this.plugin.settings.showAdvanced).onChange(n=>{this.advanced=n,this.display()})}),this.buildProperties(this.contentEl.createDiv()),this.buildSeparator(this.contentEl.createDiv()),this.buildConditions(this.contentEl.createDiv()),this.buildDice(this.contentEl.createDiv()),this.buildButtons(this.contentEl.createDiv())}buildButtons(t){t.empty(),new le.Setting(t).addButton(n=>n.setCta().setIcon("checkmark").setTooltip("Save").onClick(()=>{this.saved=!0,this.close()})).addExtraButton(n=>n.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.close()}))}buildProperty(t){}};function mh(a){K(a,"svelte-e4nza4",".statblock-creator-container.svelte-e4nza4.svelte-e4nza4{display:flex;justify-content:space-between;width:100%;height:100%}body:not(.is-mobile) .statblock-creator-container.svelte-e4nza4:not(:hover)>.icons.svelte-e4nza4{visibility:hidden}.statblock-creator-block.svelte-e4nza4.svelte-e4nza4{width:100%}.icons.svelte-e4nza4.svelte-e4nza4{display:flex;justify-content:flex-end}.statblock-creator-container.svelte-e4nza4 .icons.svelte-e4nza4{align-items:center}.icon.svelte-e4nza4:not(:first-child) .clickable-icon{margin-left:0}")}function jo(a){let e,t,n;return t=new Wo({props:{block:a[0]}}),{c(){e=A("div"),X(t.$$.fragment),_(e,"class","statblock-creator-block svelte-e4nza4")},m(i,s){x(i,e,s),J(t,e,null),n=!0},p(i,s){let r={};s&1&&(r.block=i[0]),t.$set(r)},i(i){n||(I(t.$$.fragment,i),n=!0)},o(i){O(t.$$.fragment,i),n=!1},d(i){i&&S(e),Y(t)}}}function gh(a){let e,t=a[0],n,i,s,r,c,o,l,d,u,m,h=jo(a);return{c(){e=A("div"),h.c(),n=R(),i=A("div"),s=A("div"),c=R(),o=A("div"),_(s,"class","icon svelte-e4nza4"),_(o,"class","icon svelte-e4nza4"),_(i,"class","icons svelte-e4nza4"),_(e,"class","statblock-creator-container svelte-e4nza4")},m(b,f){x(b,e,f),h.m(e,null),D(e,n),D(e,i),D(i,s),D(i,c),D(i,o),d=!0,u||(m=[ae(r=a[1].call(null,s)),ae(l=a[2].call(null,o))],u=!0)},p(b,[f]){f&1&&j(t,t=b[0])?(ie(),O(h,1,1,H),se(),h=jo(b),h.c(),I(h,1),h.m(e,n)):h.p(b,f)},i(b){d||(I(h),d=!0)},o(b){O(h),d=!1},d(b){b&&S(e),h.d(b),u=!1,me(m)}}}function fh(a,e,t){let{block:n}=e,{plugin:i}=e,s=We(),r=()=>{let l=new ha(i,n);l.onClose=()=>{!l.saved||s("edited",l.block)},l.open()},c=l=>{new Qi.ExtraButtonComponent(l).setIcon("pencil").setTooltip("Edit Block").onClick(()=>{r()})},o=l=>{new Qi.ExtraButtonComponent(l).setIcon("trash").setTooltip("Delete Block").onClick(()=>s("trash",n))};return a.$$set=l=>{"block"in l&&t(0,n=l.block),"plugin"in l&&t(3,i=l.plugin)},[n,c,o,i]}var es=class extends q{constructor(e){super(),U(this,e,fh,gh,j,{block:0,plugin:3},mh)}},qo=es;var jt=require("obsidian");function ph(a){K(a,"svelte-fhevgs","body:not(.is-mobile) .creator-zone.svelte-fhevgs:not(.nested){max-width:75vw;max-height:65vh;overflow:auto}.inline.svelte-fhevgs{display:flex;justify-content:space-between}.block.svelte-fhevgs{display:flex;justify-content:flex-start;align-items:center}.item.svelte-fhevgs{display:flex;flex-flow:column;width:100%;padding:2px;margin:2px}.group.svelte-fhevgs{display:grid;grid-template-columns:1fr;border:2px dashed grey;min-height:2rem}.dropdown-icon.svelte-fhevgs{align-self:flex-start}.inline.svelte-fhevgs{display:inline-flex;width:100%;height:100%;min-width:2rem}.icon.svelte-fhevgs{display:flex}")}function Go(a,e,t){let n=a.slice();return n[20]=e[t],n[21]=e,n[22]=t,n}function bh(a){let e,t,n,i,s,r=a[20],c,o;function l(h){a[15](h,a[20])}function d(h){a[16](h)}let u={inline:a[20].type=="inline"};a[20].nested!==void 0&&(u.blocks=a[20].nested),a[1]!==void 0&&(u.plugin=a[1]),t=new Dn({props:u}),rt.push(()=>ci(t,"blocks",l)),rt.push(()=>ci(t,"plugin",d));let m=Uo(a);return{c(){e=A("div"),X(t.$$.fragment),s=R(),m.c(),c=re(),_(e,"class","item svelte-fhevgs"),Re(e,"group",a[20].type=="group"||a[20].type=="inline")},m(h,b){x(h,e,b),J(t,e,null),x(h,s,b),m.m(h,b),x(h,c,b),o=!0},p(h,b){a=h;let f={};b&9&&(f.inline=a[20].type=="inline"),!n&&b&9&&(n=!0,f.blocks=a[20].nested,si(()=>n=!1)),!i&&b&2&&(i=!0,f.plugin=a[1],si(()=>i=!1)),t.$set(f),(!o||b&9)&&Re(e,"group",a[20].type=="group"||a[20].type=="inline"),b&9&&j(r,r=a[20])?(m.d(1),m=Uo(a),m.c(),m.m(c.parentNode,c)):m.p(a,b)},i(h){o||(I(t.$$.fragment,h),o=!0)},o(h){O(t.$$.fragment,h),o=!1},d(h){h&&S(e),Y(t),h&&S(s),h&&S(c),m.d(h)}}}function kh(a){let e,t,n;return t=new qo({props:{plugin:a[1],block:a[20]}}),t.$on("trash",a[13]),t.$on("edited",a[14]),{c(){e=A("div"),X(t.$$.fragment),_(e,"class","item svelte-fhevgs")},m(i,s){x(i,e,s),J(t,e,null),n=!0},p(i,s){let r={};s&2&&(r.plugin=i[1]),s&9&&(r.block=i[20]),t.$set(r)},i(i){n||(I(t.$$.fragment,i),n=!0)},o(i){O(t.$$.fragment,i),n=!1},d(i){i&&S(e),Y(t)}}}function Uo(a){let e,t,n,i;return{c(){e=A("div"),_(e,"class","dropdown-icon svelte-fhevgs")},m(s,r){x(s,e,r),n||(i=ae(t=a[11].call(null,e,a[20])),n=!0)},p(s,r){a=s,t&&ze(t.update)&&r&9&&t.update.call(null,a[20])},d(s){s&&S(e),n=!1,i()}}}function Vo(a){let e,t,n;return t=new sn({}),{c(){e=A("div"),X(t.$$.fragment),_(e,"aria-label","Block Has Rule")},m(i,s){x(i,e,s),J(t,e,null),n=!0},i(i){n||(I(t.$$.fragment,i),n=!0)},o(i){O(t.$$.fragment,i),n=!1},d(i){i&&S(e),Y(t)}}}function Ko(a,e){let t,n,i,s,r,c,o,l,d,u,m,h,b=H,f,k,C,w=[kh,bh],W=[];function E(g,p){return g[20].type!="group"&&g[20].type!="inline"?0:1}l=E(e,-1),d=W[l]=w[l](e);let y=e[20].hasRule&&Vo(e);return{key:a,first:null,c(){t=A("div"),n=A("div"),i=A("div"),s=A("div"),o=R(),d.c(),u=R(),y&&y.c(),m=R(),_(s,"class","icon svelte-fhevgs"),_(s,"style",r=e[4]?"cursor: grab":"cursor: grabbing"),_(i,"class","block svelte-fhevgs"),_(n,"class","block-container"),this.first=t},m(g,p){x(g,t,p),D(t,n),D(n,i),D(i,s),D(i,o),W[l].m(i,null),D(n,u),y&&y.m(n,null),D(t,m),f=!0,k||(C=[ae(c=e[7].call(null,s)),ue(s,"mousedown",e[8]),ue(s,"touchstart",e[8])],k=!0)},p(g,p){e=g,(!f||p&16&&r!==(r=e[4]?"cursor: grab":"cursor: grabbing"))&&_(s,"style",r);let v=l;l=E(e,p),l===v?W[l].p(e,p):(ie(),O(W[v],1,1,()=>{W[v]=null}),se(),d=W[l],d?d.p(e,p):(d=W[l]=w[l](e),d.c()),I(d,1),d.m(i,null)),e[20].hasRule?y?p&9&&I(y,1):(y=Vo(e),y.c(),I(y,1),y.m(n,null)):y&&(ie(),O(y,1,1,()=>{y=null}),se())},r(){h=t.getBoundingClientRect()},f(){en(t),b()},a(){b(),b=Qa(t,h,ln,{duration:ts})},i(g){f||(I(d),I(y),f=!0)},o(g){O(d),O(y),f=!1},d(g){g&&S(t),W[l].d(),y&&y.d(),k=!1,me(C)}}}function vh(a){let e,t,n=[],i=new Map,s,r,c,o,l=a[0].filter(a[12]),d=u=>u[20].id;for(let u=0;u<l.length;u+=1){let m=Go(a,l,u),h=d(m);i.set(h,n[u]=Ko(h,m))}return{c(){e=A("div"),t=A("section");for(let u=0;u<n.length;u+=1)n[u].c();_(t,"class","creator-zone svelte-fhevgs"),Re(t,"inline",a[2]),_(e,"class","creator")},m(u,m){x(u,e,m),D(e,t);for(let h=0;h<n.length;h+=1)n[h].m(t,null);r=!0,c||(o=[ae(s=la.call(null,t,{items:a[0],flipDurationMs:ts,dragDisabled:a[4],type:"creator"})),ue(t,"consider",a[5]),ue(t,"finalize",a[6])],c=!0)},p(u,[m]){if(m&1819){l=u[0].filter(u[12]),ie();for(let h=0;h<n.length;h+=1)n[h].r();n=aa(n,m,d,1,u,l,i,t,Zs,Ko,null,Go);for(let h=0;h<n.length;h+=1)n[h].a();se()}s&&ze(s.update)&&m&17&&s.update.call(null,{items:u[0],flipDurationMs:ts,dragDisabled:u[4],type:"creator"}),(!r||m&4)&&Re(t,"inline",u[2])},i(u){if(!r){for(let m=0;m<l.length;m+=1)I(n[m]);r=!0}},o(u){for(let m=0;m<n.length;m+=1)O(n[m]);r=!1},d(u){u&&S(e);for(let m=0;m<n.length;m+=1)n[m].d();c=!1,me(o)}}}var ts=300;function yh(a,e,t){let n=We(),{blocks:i=[]}=e,{inline:s=!1}=e,{plugin:r}=e,c=!0;function o(g){let{items:p,info:{source:v,trigger:M}}=g.detail;t(0,i=[...p]),v===Se.KEYBOARD&&M===De.DRAG_STOPPED&&t(4,c=!0)}function l(g){let{items:p,info:{source:v}}=g.detail;t(0,i=[...p]),n("sorted",i),v===Se.POINTER&&t(4,c=!0)}let d=g=>{(0,jt.setIcon)(g,"dropzone-grip")};function u(g){g.preventDefault(),t(4,c=!1)}let m=g=>{t(0,i=i.filter(p=>p.id!=g.id)),n("sorted",i)},h=g=>{let p=i.findIndex(v=>v.id==g.id);i.splice(p,1,g),t(0,i)},b=g=>{let p=new ha(r,g);p.onClose=()=>{!p.saved||h(p.block)},p.open()},f=async(g,p)=>{if(!("nested"in g))return;let v=new jt.Menu().setNoIcon();Da.forEach(M=>{v.addItem(N=>{N.setTitle(M[1]).onClick(()=>{let T=cn(M[0]);v.unload(),T&&(g.nested=[...g.nested,T],t(0,i),n("sorted",i))})})}),v.showAtMouseEvent(p)},k=(g,p)=>{new jt.ExtraButtonComponent(g).setIcon("vertical-three-dots"),g.onclick=v=>{new jt.Menu().addItem(M=>{M.setTitle("Add").setIcon("plus-with-circle").onClick(N=>{f(p,v)})}).addItem(M=>M.setTitle("Edit").setIcon("pencil").onClick(()=>{b(p)})).addItem(M=>M.setTitle("Delete").setIcon("trash").onClick(()=>m(p))).showAtMouseEvent(v)}},C=g=>g.id!==xt,w=g=>m(g.detail),W=g=>h(g.detail);function E(g,p){a.$$.not_equal(p.nested,g)&&(p.nested=g,t(0,i))}function y(g){r=g,t(1,r)}return a.$$set=g=>{"blocks"in g&&t(0,i=g.blocks),"inline"in g&&t(2,s=g.inline),"plugin"in g&&t(1,r=g.plugin)},[i,r,s,xt,c,o,l,d,u,m,h,k,C,w,W,E,y]}var Dn=class extends q{constructor(e){super(),U(this,e,yh,vh,j,{blocks:0,inline:2,plugin:1},ph)}},Yo=Dn;function _h(a){K(a,"svelte-fktbyg",".top.svelte-fktbyg{display:flex;align-items:center;justify-content:space-between}.name.svelte-fktbyg{display:flex;align-items:center}.name.svelte-fktbyg .buttons{display:flex;justify-content:flex-end;align-items:center}.bottom.svelte-fktbyg{display:flex;justify-content:flex-end;align-items:center;margin-top:0.5rem}")}function Jo(a){let e,t;return e=new Yo({props:{blocks:a[2],plugin:a[1]}}),e.$on("sorted",a[3]),{c(){X(e.$$.fragment)},m(n,i){J(e,n,i),t=!0},p(n,i){let s={};i&4&&(s.blocks=n[2]),i&2&&(s.plugin=n[1]),e.$set(s)},i(n){t||(I(e.$$.fragment,n),t=!0)},o(n){O(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function wh(a){let e,t,n,i,s,r,c,o,l=a[0],d,u,m,h,b,f,k,C,w,W,E=Jo(a);return{c(){e=A("div"),t=A("div"),i=R(),s=A("div"),c=R(),o=A("div"),E.c(),d=R(),u=A("div"),m=A("div"),b=R(),f=A("div"),_(t,"class","name svelte-fktbyg"),_(s,"class","add"),_(e,"class","top svelte-fktbyg"),_(o,"class","creator-container"),_(m,"class","save"),_(f,"class","cancel"),_(u,"class","bottom svelte-fktbyg")},m(y,g){x(y,e,g),D(e,t),D(e,i),D(e,s),x(y,c,g),x(y,o,g),E.m(o,null),x(y,d,g),x(y,u,g),D(u,m),D(u,b),D(u,f),C=!0,w||(W=[ae(n=a[4].call(null,t)),ae(r=a[8].call(null,s)),ue(s,"click",a[9]),ae(h=a[5].call(null,m)),ae(k=a[6].call(null,f))],w=!0)},p(y,[g]){g&1&&j(l,l=y[0])?(ie(),O(E,1,1,H),se(),E=Jo(y),E.c(),I(E,1),E.m(o,null)):E.p(y,g)},i(y){C||(I(E),C=!0)},o(y){O(E),C=!1},d(y){y&&S(e),y&&S(c),y&&S(o),E.d(y),y&&S(d),y&&S(u),w=!1,me(W)}}}function Th(a,e,t){let n,{layout:i}=e,{plugin:s}=e,r=k=>[...k.map(C=>"nested"in C?[C.id,r(C.nested)].flat():[C.id]).flat()],c=We(),o=k=>{t(0,i.blocks=[...k.detail],i)},l=!1,d=k=>{if(k.empty(),l){let C=i.name;new et.TextComponent(k).setValue(C).onChange(W=>{C=W});let w=k.createDiv("buttons");new et.ExtraButtonComponent(w).setIcon("checkmark").setTooltip("Save").onClick(()=>{l=!1,t(0,i.name=C,i),d(k)}),new et.ExtraButtonComponent(w).setIcon("cross-in-box").setTooltip("Cancel").onClick(()=>{l=!1,d(k)})}else k.createEl("h3",{text:i.name}),new et.ExtraButtonComponent(k.createDiv("buttons")).setIcon("pencil").setTooltip("Edit Name").onClick(()=>{l=!0,d(k)})},u=k=>{new et.ButtonComponent(k).setIcon("checkmark").setCta().setTooltip("Save").onClick(()=>{c("saved")})},m=k=>{new et.ExtraButtonComponent(k).setIcon("cross").setTooltip("Cancel").onClick(()=>{c("cancel")})},h=async k=>{let C=new et.Menu().setNoIcon();Da.forEach(w=>{C.addItem(W=>{W.setTitle(w[1]).onClick(()=>{let E=cn(w[0]);C.unload(),E&&t(0,i.blocks=[...i.blocks,E],i)})})}),C.showAtMouseEvent(k)},b=k=>{new et.ExtraButtonComponent(k).setIcon("plus-with-circle").setTooltip("Add Block")},f=k=>h(k);return a.$$set=k=>{"layout"in k&&t(0,i=k.layout),"plugin"in k&&t(1,s=k.plugin)},a.$$.update=()=>{if(a.$$.dirty&1){e:t(2,n=i.blocks)}},[i,s,n,o,d,u,m,h,b,f]}var as=class extends q{constructor(e){super(),U(this,e,Th,wh,j,{layout:0,plugin:1},_h)}},Xo=as;var qt=require("obsidian");var En=require("obsidian");var Ye=require("obsidian");function Ah(a){K(a,"svelte-1m3i208",".top-level.svelte-1m3i208.svelte-1m3i208{display:flex;flex-flow:column nowrap}textarea.svelte-1m3i208.svelte-1m3i208{flex-grow:1;height:500px;max-height:50vh}.json.svelte-1m3i208.svelte-1m3i208{margin-bottom:1rem;display:flex;justify-content:flex-start;align-items:center}.json.svelte-1m3i208>div.svelte-1m3i208{border-radius:4px;margin:5px 0px}.active.svelte-1m3i208.svelte-1m3i208{background-color:var(--background-secondary-alt)}.buttons.svelte-1m3i208.svelte-1m3i208{margin-top:1rem;display:flex;justify-content:flex-end;align-items:center}")}function Zo(a){let e,t,n,i;return{c(){e=A("textarea"),e.value=t=a[6](),_(e,"class","svelte-1m3i208")},m(s,r){x(s,e,r),a[11](e),n||(i=ue(e,"blur",a[12]),n=!0)},p:H,d(s){s&&S(e),a[11](null),n=!1,i()}}}function Ch(a){let e,t,n,i,s,r,c,o,l,d,u,m=a[0],h,b,f,k,C,w,W,E,y,g=Zo(a);return{c(){e=A("div"),t=A("h2"),t.textContent="Edit Monster",n=R(),i=A("div"),s=A("div"),r=A("div"),o=R(),l=A("div"),u=R(),g.c(),h=R(),b=A("div"),f=A("div"),C=R(),w=A("div"),_(r,"class","svelte-1m3i208"),Re(r,"active",!a[0]),_(l,"class","svelte-1m3i208"),Re(l,"active",a[0]),_(s,"class","json svelte-1m3i208"),_(i,"class","top-level svelte-1m3i208"),_(b,"class","buttons svelte-1m3i208"),_(e,"class","edit-monster-modal")},m(p,v){x(p,e,v),D(e,t),D(e,n),D(e,i),D(i,s),D(s,r),D(s,o),D(s,l),D(i,u),g.m(i,null),D(e,h),D(e,b),D(b,f),D(b,C),D(b,w),E||(y=[ae(c=a[3].call(null,r)),ue(r,"click",a[9]),ae(d=a[2].call(null,l)),ue(l,"click",a[10]),ae(k=a[4].call(null,f)),ae(W=a[5].call(null,w))],E=!0)},p(p,[v]){v&1&&Re(r,"active",!p[0]),v&1&&Re(l,"active",p[0]),v&1&&j(m,m=p[0])?(g.d(1),g=Zo(p),g.c(),g.m(i,null)):g.p(p,v)},i:H,o:H,d(p){p&&S(e),g.d(p),E=!1,me(y)}}}function Sh(a,e,t){let n=We(),{monster:i={}}=e,s=!1,r,c=C=>{new Ye.ExtraButtonComponent(C).setIcon("code-glyph").setTooltip("JSON")},o=C=>{new Ye.ExtraButtonComponent(C).setIcon("lines-of-text").setTooltip("YAML")},l=C=>{new Ye.ButtonComponent(C).setIcon("checkmark").setTooltip("Save Changes").onClick(()=>{if(s)try{s?t(8,i=JSON.parse(r.value)):t(8,i=(0,Ye.parseYaml)(r.value))}catch(w){console.error(w),new Ye.Notice(`There was an error saving the creaturen
|
||
|
||
${w.message}`);return}n("save",i)})},d=C=>{new Ye.ExtraButtonComponent(C).setIcon("cross").setTooltip("Cancel").onClick(()=>{n("cancel")})};function u(){return s?JSON.stringify(i,null,2):!i||!Object.keys(i??{})?.length?"":(0,Ye.stringifyYaml)(i).trim()}function m(){try{s?t(8,i=JSON.parse(r.value)):t(8,i=(0,Ye.parseYaml)(r.value))}catch(C){console.error(C)}}let h=()=>t(0,s=!1),b=()=>t(0,s=!0);function f(C){rt[C?"unshift":"push"](()=>{r=C,t(1,r)})}let k=()=>m();return a.$$set=C=>{"monster"in C&&t(8,i=C.monster)},[s,r,c,o,l,d,u,m,i,h,b,f,k]}var ns=class extends q{constructor(e){super(),U(this,e,Sh,Ch,j,{monster:8},Ah)}},Qo=ns;var ma=class extends En.Modal{constructor(t,n={}){super(t.app);this.plugin=t;this.monster=n}onOpen(){this._instance=new Qo({target:this.contentEl,props:{monster:this.monster}}),this._instance.$on("cancel",()=>{this.close()}),this._instance.$on("save",async({detail:t})=>{if(!t.name){new En.Notice("Creatures must be given a name.");return}await this.plugin.updateMonster(this.monster,t),this.close()})}onClose(){}close(){this._instance&&this._instance.$destroy(),super.close()}};var Mn=class extends qt.Modal{constructor(t,n){super(t.app);this.plugin=t;this.monster=n}async display(){qt.Platform.isMobile||(this.contentEl.style.maxWidth="85vw"),new Tt({container:this.contentEl,monster:this.monster,plugin:this.plugin})}onOpen(){this.display()}};var ws=_a(xa());function Ha(a){let e=new Blob([a],{type:"text/javascript"}),t=URL.createObjectURL(e),n=new Worker(t);return URL.revokeObjectURL(t),n}function is(){return Ha('var yn=Object.create;var At=Object.defineProperty;var Rn=Object.getOwnPropertyDescriptor;var Cn=Object.getOwnPropertyNames;var En=Object.getPrototypeOf,_n=Object.prototype.hasOwnProperty;var Ne=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var An=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Cn(e))!_n.call(t,i)&&i!==n&&At(t,i,{get:()=>e[i],enumerable:!(r=Rn(e,i))||r.enumerable});return t};var Tn=(t,e,n)=>(n=t!=null?yn(En(t)):{},An(e||!t||!t.__esModule?At(n,"default",{value:t,enumerable:!0}):n,t));var bt=Ne(Tt=>{Tt.entityMap={lt:"<",gt:">",amp:"&",quot:\'"\',apos:"\'",Agrave:"\\xC0",Aacute:"\\xC1",Acirc:"\\xC2",Atilde:"\\xC3",Auml:"\\xC4",Aring:"\\xC5",AElig:"\\xC6",Ccedil:"\\xC7",Egrave:"\\xC8",Eacute:"\\xC9",Ecirc:"\\xCA",Euml:"\\xCB",Igrave:"\\xCC",Iacute:"\\xCD",Icirc:"\\xCE",Iuml:"\\xCF",ETH:"\\xD0",Ntilde:"\\xD1",Ograve:"\\xD2",Oacute:"\\xD3",Ocirc:"\\xD4",Otilde:"\\xD5",Ouml:"\\xD6",Oslash:"\\xD8",Ugrave:"\\xD9",Uacute:"\\xDA",Ucirc:"\\xDB",Uuml:"\\xDC",Yacute:"\\xDD",THORN:"\\xDE",szlig:"\\xDF",agrave:"\\xE0",aacute:"\\xE1",acirc:"\\xE2",atilde:"\\xE3",auml:"\\xE4",aring:"\\xE5",aelig:"\\xE6",ccedil:"\\xE7",egrave:"\\xE8",eacute:"\\xE9",ecirc:"\\xEA",euml:"\\xEB",igrave:"\\xEC",iacute:"\\xED",icirc:"\\xEE",iuml:"\\xEF",eth:"\\xF0",ntilde:"\\xF1",ograve:"\\xF2",oacute:"\\xF3",ocirc:"\\xF4",otilde:"\\xF5",ouml:"\\xF6",oslash:"\\xF8",ugrave:"\\xF9",uacute:"\\xFA",ucirc:"\\xFB",uuml:"\\xFC",yacute:"\\xFD",thorn:"\\xFE",yuml:"\\xFF",nbsp:"\\xA0",iexcl:"\\xA1",cent:"\\xA2",pound:"\\xA3",curren:"\\xA4",yen:"\\xA5",brvbar:"\\xA6",sect:"\\xA7",uml:"\\xA8",copy:"\\xA9",ordf:"\\xAA",laquo:"\\xAB",not:"\\xAC",shy:"\\xAD\\xAD",reg:"\\xAE",macr:"\\xAF",deg:"\\xB0",plusmn:"\\xB1",sup2:"\\xB2",sup3:"\\xB3",acute:"\\xB4",micro:"\\xB5",para:"\\xB6",middot:"\\xB7",cedil:"\\xB8",sup1:"\\xB9",ordm:"\\xBA",raquo:"\\xBB",frac14:"\\xBC",frac12:"\\xBD",frac34:"\\xBE",iquest:"\\xBF",times:"\\xD7",divide:"\\xF7",forall:"\\u2200",part:"\\u2202",exist:"\\u2203",empty:"\\u2205",nabla:"\\u2207",isin:"\\u2208",notin:"\\u2209",ni:"\\u220B",prod:"\\u220F",sum:"\\u2211",minus:"\\u2212",lowast:"\\u2217",radic:"\\u221A",prop:"\\u221D",infin:"\\u221E",ang:"\\u2220",and:"\\u2227",or:"\\u2228",cap:"\\u2229",cup:"\\u222A",int:"\\u222B",there4:"\\u2234",sim:"\\u223C",cong:"\\u2245",asymp:"\\u2248",ne:"\\u2260",equiv:"\\u2261",le:"\\u2264",ge:"\\u2265",sub:"\\u2282",sup:"\\u2283",nsub:"\\u2284",sube:"\\u2286",supe:"\\u2287",oplus:"\\u2295",otimes:"\\u2297",perp:"\\u22A5",sdot:"\\u22C5",Alpha:"\\u0391",Beta:"\\u0392",Gamma:"\\u0393",Delta:"\\u0394",Epsilon:"\\u0395",Zeta:"\\u0396",Eta:"\\u0397",Theta:"\\u0398",Iota:"\\u0399",Kappa:"\\u039A",Lambda:"\\u039B",Mu:"\\u039C",Nu:"\\u039D",Xi:"\\u039E",Omicron:"\\u039F",Pi:"\\u03A0",Rho:"\\u03A1",Sigma:"\\u03A3",Tau:"\\u03A4",Upsilon:"\\u03A5",Phi:"\\u03A6",Chi:"\\u03A7",Psi:"\\u03A8",Omega:"\\u03A9",alpha:"\\u03B1",beta:"\\u03B2",gamma:"\\u03B3",delta:"\\u03B4",epsilon:"\\u03B5",zeta:"\\u03B6",eta:"\\u03B7",theta:"\\u03B8",iota:"\\u03B9",kappa:"\\u03BA",lambda:"\\u03BB",mu:"\\u03BC",nu:"\\u03BD",xi:"\\u03BE",omicron:"\\u03BF",pi:"\\u03C0",rho:"\\u03C1",sigmaf:"\\u03C2",sigma:"\\u03C3",tau:"\\u03C4",upsilon:"\\u03C5",phi:"\\u03C6",chi:"\\u03C7",psi:"\\u03C8",omega:"\\u03C9",thetasym:"\\u03D1",upsih:"\\u03D2",piv:"\\u03D6",OElig:"\\u0152",oelig:"\\u0153",Scaron:"\\u0160",scaron:"\\u0161",Yuml:"\\u0178",fnof:"\\u0192",circ:"\\u02C6",tilde:"\\u02DC",ensp:"\\u2002",emsp:"\\u2003",thinsp:"\\u2009",zwnj:"\\u200C",zwj:"\\u200D",lrm:"\\u200E",rlm:"\\u200F",ndash:"\\u2013",mdash:"\\u2014",lsquo:"\\u2018",rsquo:"\\u2019",sbquo:"\\u201A",ldquo:"\\u201C",rdquo:"\\u201D",bdquo:"\\u201E",dagger:"\\u2020",Dagger:"\\u2021",bull:"\\u2022",hellip:"\\u2026",permil:"\\u2030",prime:"\\u2032",Prime:"\\u2033",lsaquo:"\\u2039",rsaquo:"\\u203A",oline:"\\u203E",euro:"\\u20AC",trade:"\\u2122",larr:"\\u2190",uarr:"\\u2191",rarr:"\\u2192",darr:"\\u2193",harr:"\\u2194",crarr:"\\u21B5",lceil:"\\u2308",rceil:"\\u2309",lfloor:"\\u230A",rfloor:"\\u230B",loz:"\\u25CA",spades:"\\u2660",clubs:"\\u2663",hearts:"\\u2665",diams:"\\u2666"}});var It=Ne(Le=>{var Ue=/[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/,Nt=new RegExp("[\\\\-\\\\.0-9"+Ue.source.slice(1,-1)+"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]"),wt=new RegExp("^"+Ue.source+Nt.source+"*(?::"+Ue.source+Nt.source+"*)?$"),he=0,q=1,ne=2,ge=3,re=4,ie=5,de=6,we=7;function se(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,se)}se.prototype=new Error;se.prototype.name=se.name;function xt(){}xt.prototype={parse:function(t,e,n){var r=this.domBuilder;r.startDocument(),Mt(e,e={}),bn(t,e,n,r,this.errorHandler),r.endDocument()}};function bn(t,e,n,r,i){function s(A){if(A>65535){A-=65536;var g=55296+(A>>10),ee=56320+(A&1023);return String.fromCharCode(g,ee)}else return String.fromCharCode(A)}function o(A){var g=A.slice(1,-1);return g in n?n[g]:g.charAt(0)==="#"?s(parseInt(g.substr(1).replace("x","0x"))):(i.error("entity not found:"+A),A)}function l(A){if(A>C){var g=t.substring(C,A).replace(/&#?\\w+;/g,o);S&&u(C),r.characters(g,0,A-C),C=A}}function u(A,g){for(;A>=f&&(g=h.exec(t));)a=g.index,f=a+g[0].length,S.lineNumber++;S.columnNumber=A-a+1}for(var a=0,f=0,h=/.*(?:\\r\\n?|\\n)|.*$/g,S=r.locator,_=[{currentNSMap:e}],y={},C=0;;){try{var v=t.indexOf("<",C);if(v<0){if(!t.substr(C).match(/^\\s*$/)){var M=r.doc,P=M.createTextNode(t.substr(C));M.appendChild(P),r.currentElement=P}return}switch(v>C&&l(v),t.charAt(v+1)){case"/":var b=t.indexOf(">",v+3),R=t.substring(v+2,b),w=_.pop();b<0?(R=t.substring(v+2).replace(/[\\s<].*/,""),i.error("end tag name: "+R+" is not complete:"+w.tagName),b=v+1+R.length):R.match(/\\s</)&&(R=R.replace(/[\\s<].*/,""),i.error("end tag name: "+R+" maybe not complete"),b=v+1+R.length);var W=w.localNSMap,d=w.tagName==R,G=d||w.tagName&&w.tagName.toLowerCase()==R.toLowerCase();if(G){if(r.endElement(w.uri,w.localName,R),W)for(var k in W)r.endPrefixMapping(k);d||i.fatalError("end tag name: "+R+" is not match the current start tagName:"+w.tagName)}else _.push(w);b++;break;case"?":S&&u(v),b=xn(t,v,r);break;case"!":S&&u(v),b=$n(t,v,r,i);break;default:S&&u(v);var N=new Ot,L=_[_.length-1].currentNSMap,b=Nn(t,v,N,L,o,i),Y=N.length;if(!N.closed&&Dn(t,b,N.tagName,y)&&(N.closed=!0,n.nbsp||i.warning("unclosed xml attribute")),S&&Y){for(var J=Dt(S,{}),V=0;V<Y;V++){var B=N[V];u(B.offset),B.locator=Dt(S,{})}r.locator=J,$t(N,r,L)&&_.push(N),r.locator=S}else $t(N,r,L)&&_.push(N);N.uri==="http://www.w3.org/1999/xhtml"&&!N.closed?b=wn(t,b,N.tagName,o,r):b++}}catch(A){if(A instanceof se)throw A;i.error("element parse error: "+A),b=-1}b>C?C=b:l(Math.max(v,C)+1)}}function Dt(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function Nn(t,e,n,r,i,s){function o(_,y,C){_ in n.attributeNames&&s.fatalError("Attribute "+_+" redefined"),n.addValue(_,y,C)}for(var l,u,a=++e,f=he;;){var h=t.charAt(a);switch(h){case"=":if(f===q)l=t.slice(e,a),f=ge;else if(f===ne)f=ge;else throw new Error("attribute equal must after attrName");break;case"\'":case\'"\':if(f===ge||f===q)if(f===q&&(s.warning(\'attribute value must after "="\'),l=t.slice(e,a)),e=a+1,a=t.indexOf(h,e),a>0)u=t.slice(e,a).replace(/&#?\\w+;/g,i),o(l,u,e-1),f=ie;else throw new Error("attribute value no end \'"+h+"\' match");else if(f==re)u=t.slice(e,a).replace(/&#?\\w+;/g,i),o(l,u,e),s.warning(\'attribute "\'+l+\'" missed start quot(\'+h+")!!"),e=a+1,f=ie;else throw new Error(\'attribute value must after "="\');break;case"/":switch(f){case he:n.setTagName(t.slice(e,a));case ie:case de:case we:f=we,n.closed=!0;case re:case q:case ne:break;default:throw new Error("attribute invalid close char(\'/\')")}break;case"":return s.error("unexpected end of input"),f==he&&n.setTagName(t.slice(e,a)),a;case">":switch(f){case he:n.setTagName(t.slice(e,a));case ie:case de:case we:break;case re:case q:u=t.slice(e,a),u.slice(-1)==="/"&&(n.closed=!0,u=u.slice(0,-1));case ne:f===ne&&(u=l),f==re?(s.warning(\'attribute "\'+u+\'" missed quot(")!\'),o(l,u.replace(/&#?\\w+;/g,i),e)):((r[""]!=="http://www.w3.org/1999/xhtml"||!u.match(/^(?:disabled|checked|selected)$/i))&&s.warning(\'attribute "\'+u+\'" missed value!! "\'+u+\'" instead!!\'),o(u,u,e));break;case ge:throw new Error("attribute value missed!!")}return a;case"\\x80":h=" ";default:if(h<=" ")switch(f){case he:n.setTagName(t.slice(e,a)),f=de;break;case q:l=t.slice(e,a),f=ne;break;case re:var u=t.slice(e,a).replace(/&#?\\w+;/g,i);s.warning(\'attribute "\'+u+\'" missed quot(")!!\'),o(l,u,e);case ie:f=de;break}else switch(f){case ne:var S=n.tagName;(r[""]!=="http://www.w3.org/1999/xhtml"||!l.match(/^(?:disabled|checked|selected)$/i))&&s.warning(\'attribute "\'+l+\'" missed value!! "\'+l+\'" instead2!!\'),o(l,l,e),e=a,f=q;break;case ie:s.warning(\'attribute space is required"\'+l+\'"!!\');case de:f=q,e=a;break;case ge:f=re,e=a;break;case we:throw new Error("elements closed character \'/\' and \'>\' must be connected to")}}a++}}function $t(t,e,n){for(var r=t.tagName,i=null,h=t.length;h--;){var s=t[h],o=s.qName,l=s.value,S=o.indexOf(":");if(S>0)var u=s.prefix=o.slice(0,S),a=o.slice(S+1),f=u==="xmlns"&&a;else a=o,u=null,f=o==="xmlns"&&"";s.localName=a,f!==!1&&(i==null&&(i={},Mt(n,n={})),n[f]=i[f]=l,s.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(f,l))}for(var h=t.length;h--;){s=t[h];var u=s.prefix;u&&(u==="xml"&&(s.uri="http://www.w3.org/XML/1998/namespace"),u!=="xmlns"&&(s.uri=n[u||""]))}var S=r.indexOf(":");S>0?(u=t.prefix=r.slice(0,S),a=t.localName=r.slice(S+1)):(u=null,a=t.localName=r);var _=t.uri=n[u||""];if(e.startElement(_,a,r,t),t.closed){if(e.endElement(_,a,r),i)for(u in i)e.endPrefixMapping(u)}else return t.currentNSMap=n,t.localNSMap=i,!0}function wn(t,e,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var s=t.indexOf("</"+n+">",e),o=t.substring(e+1,s);if(/[&<]/.test(o))return/^script$/i.test(n)?(i.characters(o,0,o.length),s):(o=o.replace(/&#?\\w+;/g,r),i.characters(o,0,o.length),s)}return e+1}function Dn(t,e,n,r){var i=r[n];return i==null&&(i=t.lastIndexOf("</"+n+">"),i<e&&(i=t.lastIndexOf("</"+n)),r[n]=i),i<e}function Mt(t,e){for(var n in t)e[n]=t[n]}function $n(t,e,n,r){var i=t.charAt(e+2);switch(i){case"-":if(t.charAt(e+3)==="-"){var s=t.indexOf("-->",e+4);return s>e?(n.comment(t,e+4,s-e-4),s+3):(r.error("Unclosed comment"),-1)}else return-1;default:if(t.substr(e+3,6)=="CDATA["){var s=t.indexOf("]]>",e+9);return n.startCDATA(),n.characters(t,e+9,s-e-9),n.endCDATA(),s+3}var o=Mn(t,e),l=o.length;if(l>1&&/!doctype/i.test(o[0][0])){var u=o[1][0],a=!1,f=!1;l>3&&(/^public$/i.test(o[2][0])?(a=o[3][0],f=l>4&&o[4][0]):/^system$/i.test(o[2][0])&&(f=o[3][0]));var h=o[l-1];return n.startDTD(u,a,f),n.endDTD(),h.index+h[0].length}}return-1}function xn(t,e,n){var r=t.indexOf("?>",e);if(r){var i=t.substring(e,r).match(/^<\\?(\\S*)\\s*([\\s\\S]*?)\\s*$/);if(i){var s=i[0].length;return n.processingInstruction(i[1],i[2]),r+2}else return-1}return-1}function Ot(){this.attributeNames={}}Ot.prototype={setTagName:function(t){if(!wt.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,n){if(!wt.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}};function Mn(t,e){var n,r=[],i=/\'[^\']+\'|"[^"]+"|[^\\s<>\\/=]+=?|(\\/?\\s*>|<)/g;for(i.lastIndex=e,i.exec(t);n=i.exec(t);)if(r.push(n),n[1])return r}Le.XMLReader=xt;Le.ParseError=se});var Xe=Ne(Ce=>{function ve(t,e){for(var n in t)e[n]=t[n]}function F(t,e){var n=t.prototype;if(!(n instanceof e)){let i=function(){};var r=i;i.prototype=e.prototype,i=new i,ve(n,i),t.prototype=n=i}n.constructor!=t&&(typeof t!="function"&&console.error("unknow Class:"+t),n.constructor=t)}var On="http://www.w3.org/1999/xhtml",U={},j=U.ELEMENT_NODE=1,oe=U.ATTRIBUTE_NODE=2,De=U.TEXT_NODE=3,Wt=U.CDATA_SECTION_NODE=4,Gt=U.ENTITY_REFERENCE_NODE=5,In=U.ENTITY_NODE=6,jt=U.PROCESSING_INSTRUCTION_NODE=7,Bt=U.COMMENT_NODE=8,Vt=U.DOCUMENT_NODE=9,zt=U.DOCUMENT_TYPE_NODE=10,z=U.DOCUMENT_FRAGMENT_NODE=11,Pn=U.NOTATION_NODE=12,O={},$={},Sa=O.INDEX_SIZE_ERR=($[1]="Index size error",1),va=O.DOMSTRING_SIZE_ERR=($[2]="DOMString size error",2),kn=O.HIERARCHY_REQUEST_ERR=($[3]="Hierarchy request error",3),ya=O.WRONG_DOCUMENT_ERR=($[4]="Wrong document",4),Ra=O.INVALID_CHARACTER_ERR=($[5]="Invalid character",5),Ca=O.NO_DATA_ALLOWED_ERR=($[6]="No data allowed",6),Ea=O.NO_MODIFICATION_ALLOWED_ERR=($[7]="No modification allowed",7),Fn=O.NOT_FOUND_ERR=($[8]="Not found",8),_a=O.NOT_SUPPORTED_ERR=($[9]="Not supported",9),Pt=O.INUSE_ATTRIBUTE_ERR=($[10]="Attribute in use",10),Aa=O.INVALID_STATE_ERR=($[11]="Invalid state",11),Ta=O.SYNTAX_ERR=($[12]="Syntax error",12),ba=O.INVALID_MODIFICATION_ERR=($[13]="Invalid modification",13),Na=O.NAMESPACE_ERR=($[14]="Invalid namespace",14),wa=O.INVALID_ACCESS_ERR=($[15]="Invalid access",15);function te(t,e){if(e instanceof Error)var n=e;else n=this,Error.call(this,$[t]),this.message=$[t],Error.captureStackTrace&&Error.captureStackTrace(this,te);return n.code=t,e&&(this.message=this.message+": "+e),n}te.prototype=Error.prototype;ve(O,te);function Z(){}Z.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var n=[],r=0;r<this.length;r++)ae(this[r],n,t,e);return n.join("")}};function ce(t,e){this._node=t,this._refresh=e,Ge(this)}function Ge(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var n=t._refresh(t._node);nn(t,"length",n.length),ve(n,t),t._inc=e}}ce.prototype.item=function(t){return Ge(this),this[t]};F(ce,Z);function $e(){}function Ht(t,e){for(var n=t.length;n--;)if(t[n]===e)return n}function kt(t,e,n,r){if(r?e[Ht(e,r)]=n:e[e.length++]=n,t){n.ownerElement=t;var i=t.ownerDocument;i&&(r&&Yt(i,t,r),Un(i,t,n))}}function Ft(t,e,n){var r=Ht(e,n);if(r>=0){for(var i=e.length-1;r<i;)e[r]=e[++r];if(e.length=i,t){var s=t.ownerDocument;s&&(Yt(s,t,n),n.ownerElement=null)}}else throw te(Fn,new Error(t.tagName+"@"+n))}$e.prototype={length:0,item:Z.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var n=this[e];if(n.nodeName==t)return n}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new te(Pt);var n=this.getNamedItem(t.nodeName);return kt(this._ownerElement,this,t,n),n},setNamedItemNS:function(t){var e=t.ownerElement,n;if(e&&e!=this._ownerElement)throw new te(Pt);return n=this.getNamedItemNS(t.namespaceURI,t.localName),kt(this._ownerElement,this,t,n),n},removeNamedItem:function(t){var e=this.getNamedItem(t);return Ft(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var n=this.getNamedItemNS(t,e);return Ft(this._ownerElement,this,n),n},getNamedItemNS:function(t,e){for(var n=this.length;n--;){var r=this[n];if(r.localName==e&&r.namespaceURI==t)return r}return null}};function Kt(t){if(this._features={},t)for(var e in t)this._features=t[e]}Kt.prototype={hasFeature:function(t,e){var n=this._features[t.toLowerCase()];return!!(n&&(!e||e in n))},createDocument:function(t,e,n){var r=new ye;if(r.implementation=this,r.childNodes=new Z,r.doctype=n,n&&r.appendChild(n),e){var i=r.createElementNS(t,e);r.appendChild(i)}return r},createDocumentType:function(t,e,n){var r=new He;return r.name=t,r.nodeName=t,r.publicId=e,r.systemId=n,r}};function I(){}I.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(t,e){return qt(this,t,e)},replaceChild:function(t,e){this.insertBefore(t,e),e&&this.removeChild(e)},removeChild:function(t){return Xt(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(t){return We(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==De&&t.nodeType==De?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var n=e._nsMap;if(n){for(var r in n)if(n[r]==t)return r}e=e.nodeType==oe?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var n=e._nsMap;if(n&&t in n)return n[t];e=e.nodeType==oe?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return e==null}};function Ut(t){return t=="<"&&"<"||t==">"&&">"||t=="&"&&"&"||t==\'"\'&&"""||"&#"+t.charCodeAt()+";"}ve(U,I);ve(U,I.prototype);function Se(t,e){if(e(t))return!0;if(t=t.firstChild)do if(Se(t,e))return!0;while(t=t.nextSibling)}function ye(){}function Un(t,e,n){t&&t._inc++;var r=n.namespaceURI;r=="http://www.w3.org/2000/xmlns/"&&(e._nsMap[n.prefix?n.localName:""]=n.value)}function Yt(t,e,n,r){t&&t._inc++;var i=n.namespaceURI;i=="http://www.w3.org/2000/xmlns/"&&delete e._nsMap[n.prefix?n.localName:""]}function je(t,e,n){if(t&&t._inc){t._inc++;var r=e.childNodes;if(n)r[r.length++]=n;else{for(var i=e.firstChild,s=0;i;)r[s++]=i,i=i.nextSibling;r.length=s}}}function Xt(t,e){var n=e.previousSibling,r=e.nextSibling;return n?n.nextSibling=r:t.firstChild=r,r?r.previousSibling=n:t.lastChild=n,je(t.ownerDocument,t),e}function qt(t,e,n){var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===z){var i=e.firstChild;if(i==null)return e;var s=e.lastChild}else i=s=e;var o=n?n.previousSibling:t.lastChild;i.previousSibling=o,s.nextSibling=n,o?o.nextSibling=i:t.firstChild=i,n==null?t.lastChild=s:n.previousSibling=s;do i.parentNode=t;while(i!==s&&(i=i.nextSibling));return je(t.ownerDocument||t,t),e.nodeType==z&&(e.firstChild=e.lastChild=null),e}function Ln(t,e){var n=e.parentNode;if(n){var r=t.lastChild;n.removeChild(e);var r=t.lastChild}var r=t.lastChild;return e.parentNode=t,e.previousSibling=r,e.nextSibling=null,r?r.nextSibling=e:t.firstChild=e,t.lastChild=e,je(t.ownerDocument,t,e),e}ye.prototype={nodeName:"#document",nodeType:Vt,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==z){for(var n=t.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,e),n=r}return t}return this.documentElement==null&&t.nodeType==j&&(this.documentElement=t),qt(this,t,e),t.ownerDocument=this,t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),Xt(this,t)},importNode:function(t,e){return tn(this,t,e)},getElementById:function(t){var e=null;return Se(this.documentElement,function(n){if(n.nodeType==j&&n.getAttribute("id")==t)return e=n,!0}),e},getElementsByClassName:function(t){var e=new RegExp("(^|\\\\s)"+t+"(\\\\s|$)");return new ce(this,function(n){var r=[];return Se(n.documentElement,function(i){i!==n&&i.nodeType==j&&e.test(i.getAttribute("class"))&&r.push(i)}),r})},createElement:function(t){var e=new le;e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.childNodes=new Z;var n=e.attributes=new $e;return n._ownerElement=e,e},createDocumentFragment:function(){var t=new Me;return t.ownerDocument=this,t.childNodes=new Z,t},createTextNode:function(t){var e=new Be;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new Ve;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new ze;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var n=new Ye;return n.ownerDocument=this,n.tagName=n.target=t,n.nodeValue=n.data=e,n},createAttribute:function(t){var e=new xe;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new Ke;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var n=new le,r=e.split(":"),i=n.attributes=new $e;return n.childNodes=new Z,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=e,i._ownerElement=n,n},createAttributeNS:function(t,e){var n=new xe,r=e.split(":");return n.ownerDocument=this,n.nodeName=e,n.name=e,n.namespaceURI=t,n.specified=!0,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=e,n}};F(ye,I);function le(){this._nsMap={}}le.prototype={nodeType:j,hasAttribute:function(t){return this.getAttributeNode(t)!=null},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var n=this.ownerDocument.createAttribute(t);n.value=n.nodeValue=""+e,this.setAttributeNode(n)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===z?this.insertBefore(t,null):Ln(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);n&&this.removeAttributeNode(n)},hasAttributeNS:function(t,e){return this.getAttributeNodeNS(t,e)!=null},getAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);return n&&n.value||""},setAttributeNS:function(t,e,n){var r=this.ownerDocument.createAttributeNS(t,e);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new ce(this,function(e){var n=[];return Se(e,function(r){r!==e&&r.nodeType==j&&(t==="*"||r.tagName==t)&&n.push(r)}),n})},getElementsByTagNameNS:function(t,e){return new ce(this,function(n){var r=[];return Se(n,function(i){i!==n&&i.nodeType===j&&(t==="*"||i.namespaceURI===t)&&(e==="*"||i.localName==e)&&r.push(i)}),r})}};ye.prototype.getElementsByTagName=le.prototype.getElementsByTagName;ye.prototype.getElementsByTagNameNS=le.prototype.getElementsByTagNameNS;F(le,I);function xe(){}xe.prototype.nodeType=oe;F(xe,I);function Re(){}Re.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error($[kn])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,n){var r=this.data.substring(0,t),i=this.data.substring(t+e);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}};F(Re,I);function Be(){}Be.prototype={nodeName:"#text",nodeType:De,splitText:function(t){var e=this.data,n=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}};F(Be,Re);function Ve(){}Ve.prototype={nodeName:"#comment",nodeType:Bt};F(Ve,Re);function ze(){}ze.prototype={nodeName:"#cdata-section",nodeType:Wt};F(ze,Re);function He(){}He.prototype.nodeType=zt;F(He,I);function Zt(){}Zt.prototype.nodeType=Pn;F(Zt,I);function Qt(){}Qt.prototype.nodeType=In;F(Qt,I);function Ke(){}Ke.prototype.nodeType=Gt;F(Ke,I);function Me(){}Me.prototype.nodeName="#document-fragment";Me.prototype.nodeType=z;F(Me,I);function Ye(){}Ye.prototype.nodeType=jt;F(Ye,I);function Jt(){}Jt.prototype.serializeToString=function(t,e,n){return en.call(t,e,n)};I.prototype.toString=en;function en(t,e){var n=[],r=this.nodeType==9&&this.documentElement||this,i=r.prefix,s=r.namespaceURI;if(s&&i==null){var i=r.lookupPrefix(s);if(i==null)var o=[{namespace:s,prefix:null}]}return ae(this,n,t,e,o),n.join("")}function Lt(t,e,n){var r=t.prefix||"",i=t.namespaceURI;if(!r&&!i||r==="xml"&&i==="http://www.w3.org/XML/1998/namespace"||i=="http://www.w3.org/2000/xmlns/")return!1;for(var s=n.length;s--;){var o=n[s];if(o.prefix==r)return o.namespace!=i}return!0}function ae(t,e,n,r,i){if(r)if(t=r(t),t){if(typeof t=="string"){e.push(t);return}}else return;switch(t.nodeType){case j:i||(i=[]);var s=i.length,o=t.attributes,l=o.length,y=t.firstChild,u=t.tagName;n=On===t.namespaceURI||n,e.push("<",u);for(var a=0;a<l;a++){var f=o.item(a);f.prefix=="xmlns"?i.push({prefix:f.localName,namespace:f.value}):f.nodeName=="xmlns"&&i.push({prefix:"",namespace:f.value})}for(var a=0;a<l;a++){var f=o.item(a);if(Lt(f,n,i)){var h=f.prefix||"",S=f.namespaceURI,_=h?" xmlns:"+h:" xmlns";e.push(_,\'="\',S,\'"\'),i.push({prefix:h,namespace:S})}ae(f,e,n,r,i)}if(Lt(t,n,i)){var h=t.prefix||"",S=t.namespaceURI;if(S){var _=h?" xmlns:"+h:" xmlns";e.push(_,\'="\',S,\'"\'),i.push({prefix:h,namespace:S})}}if(y||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(e.push(">"),n&&/^script$/i.test(u))for(;y;)y.data?e.push(y.data):ae(y,e,n,r,i),y=y.nextSibling;else for(;y;)ae(y,e,n,r,i),y=y.nextSibling;e.push("</",u,">")}else e.push("/>");return;case Vt:case z:for(var y=t.firstChild;y;)ae(y,e,n,r,i),y=y.nextSibling;return;case oe:return e.push(" ",t.name,\'="\',t.value.replace(/[<&"]/g,Ut),\'"\');case De:return e.push(t.data.replace(/[<&]/g,Ut).replace(/]]>/g,"]]>"));case Wt:return e.push("<![CDATA[",t.data,"]]>");case Bt:return e.push("<!--",t.data,"-->");case zt:var C=t.publicId,v=t.systemId;if(e.push("<!DOCTYPE ",t.name),C)e.push(" PUBLIC ",C),v&&v!="."&&e.push(" ",v),e.push(">");else if(v&&v!=".")e.push(" SYSTEM ",v,">");else{var M=t.internalSubset;M&&e.push(" [",M,"]"),e.push(">")}return;case jt:return e.push("<?",t.target," ",t.data,"?>");case Gt:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function tn(t,e,n){var r;switch(e.nodeType){case j:r=e.cloneNode(!1),r.ownerDocument=t;case z:break;case oe:n=!0;break}if(r||(r=e.cloneNode(!1)),r.ownerDocument=t,r.parentNode=null,n)for(var i=e.firstChild;i;)r.appendChild(tn(t,i,n)),i=i.nextSibling;return r}function We(t,e,n){var r=new e.constructor;for(var i in e){var s=e[i];typeof s!="object"&&s!=r[i]&&(r[i]=s)}switch(e.childNodes&&(r.childNodes=new Z),r.ownerDocument=t,r.nodeType){case j:var o=e.attributes,l=r.attributes=new $e,u=o.length;l._ownerElement=r;for(var a=0;a<u;a++)r.setAttributeNode(We(t,o.item(a),!0));break;case oe:n=!0}if(n)for(var f=e.firstChild;f;)r.appendChild(We(t,f,n)),f=f.nextSibling;return r}function nn(t,e,n){t[e]=n}try{if(Object.defineProperty){let t=function(e){switch(e.nodeType){case j:case z:var n=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&n.push(t(e)),e=e.nextSibling;return n.join("");default:return e.nodeValue}};Da=t,Object.defineProperty(ce.prototype,"length",{get:function(){return Ge(this),this.$$length}}),Object.defineProperty(I.prototype,"textContent",{get:function(){return t(this)},set:function(e){switch(this.nodeType){case j:case z:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),nn=function(e,n,r){e["$$"+n]=r}}}catch(t){}var Da;Ce.Node=I;Ce.DOMException=te;Ce.DOMImplementation=Kt;Ce.XMLSerializer=Jt});var on=Ne(_e=>{function sn(t){this.options=t||{locator:{}}}sn.prototype.parseFromString=function(t,e){var n=this.options,r=new jn,i=n.domBuilder||new Ee,s=n.errorHandler,o=n.locator,l=n.xmlns||{},u=/\\/x?html?$/.test(e),a=u?Gn.entityMap:{lt:"<",gt:">",amp:"&",quot:\'"\',apos:"\'"};return o&&i.setDocumentLocator(o),r.errorHandler=Wn(s,i,o),r.domBuilder=n.domBuilder||i,u&&(l[""]="http://www.w3.org/1999/xhtml"),l.xml=l.xml||"http://www.w3.org/XML/1998/namespace",t&&typeof t=="string"?r.parse(t,l,a):r.errorHandler.error("invalid doc source"),i.doc};function Wn(t,e,n){if(!t){if(e instanceof Ee)return e;t=e}var r={},i=t instanceof Function;n=n||{};function s(o){var l=t[o];!l&&i&&(l=t.length==2?function(u){t(o,u)}:t),r[o]=l&&function(u){l("[xmldom "+o+"] "+u+qe(n))}||function(){}}return s("warning"),s("error"),s("fatalError"),r}function Ee(){this.cdata=!1}function ue(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}Ee.prototype={startDocument:function(){this.doc=new Vn().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,r){var i=this.doc,s=i.createElementNS(t,n||e),o=r.length;Oe(this,s),this.currentElement=s,this.locator&&ue(this.locator,s);for(var l=0;l<o;l++){var t=r.getURI(l),u=r.getValue(l),n=r.getQName(l),a=i.createAttributeNS(t,n);this.locator&&ue(r.getLocator(l),a),a.value=a.nodeValue=u,s.setAttributeNode(a)}},endElement:function(t,e,n){var r=this.currentElement,i=r.tagName;this.currentElement=r.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var n=this.doc.createProcessingInstruction(t,e);this.locator&&ue(this.locator,n),Oe(this,n)},ignorableWhitespace:function(t,e,n){},characters:function(t,e,n){if(t=rn.apply(this,arguments),t){if(this.cdata)var r=this.doc.createCDATASection(t);else var r=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(r):/^\\s*$/.test(t)&&this.doc.appendChild(r),this.locator&&ue(this.locator,r)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,n){t=rn.apply(this,arguments);var r=this.doc.createComment(t);this.locator&&ue(this.locator,r),Oe(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(t,e,n);this.locator&&ue(this.locator,i),Oe(this,i)}},warning:function(t){console.warn("[xmldom warning] "+t,qe(this.locator))},error:function(t){console.error("[xmldom error] "+t,qe(this.locator))},fatalError:function(t){throw new Bn(t,this.locator)}};function qe(t){if(t)return`\n@`+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function rn(t,e,n){return typeof t=="string"?t.substr(e,n):t.length>=e+n||e?new java.lang.String(t,e,n)+"":t}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\\w+/g,function(t){Ee.prototype[t]=function(){return null}});function Oe(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}var Gn=bt(),an=It(),jn=an.XMLReader,Bn=an.ParseError,Vn=_e.DOMImplementation=Xe().DOMImplementation;_e.XMLSerializer=Xe().XMLSerializer;_e.DOMParser=sn;_e.__DOMHandler=Ee});var ln=Tn(on());async function un(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=async i=>{let s=i.target.result,l=new ln.DOMParser().parseFromString(s,"application/xml").getElementsByTagName("monster"),u=[];if(l.length){for(let a of Array.from(l))try{let f={image:null,name:x(a,"name"),size:qn(a),type:x(a,"type"),subtype:x(a,"subtype"),alignment:x(a,"alignment"),ac:Zn(a),hp:Number(cn(a,"hp")),hit_dice:cn(a,"hit_dice"),speed:x(a,"speed"),stats:[Number(x(a,"str")),Number(x(a,"dex")),Number(x(a,"con")),Number(x(a,"int")),Number(x(a,"wis")),Number(x(a,"cha"))],saves:Yn(a),skillsaves:Hn(a),damage_vulnerabilities:x(a,"vulnerable"),damage_resistances:x(a,"resist"),damage_immunities:x(a,"immune"),condition_immunities:x(a,"conditionImmune"),senses:x(a,"senses"),languages:x(a,"languages"),cr:x(a,"cr"),traits:Ie(a,"trait"),spells:zn(a),actions:Ie(a,"action"),legendary_actions:Ie(a,"legendary"),reactions:Ie(a,"reaction"),source:Qn(a)};u.push(f)}catch(f){console.error(f);continue}e(u)}},r.readAsText(t)})}function x(t,e){let n=t.getElementsByTagName(e);if(n&&n.length)return n[0].textContent}function Ie(t,e){var i;if(!((i=t.getElementsByTagName(e))!=null&&i.length))return[];let n=t.getElementsByTagName(e),r=[];for(let s of Array.from(n)){let o=s.getElementsByTagName("name");if(!o||!o.length||!o[0].textContent||o[0].textContent.includes("Spellcasting"))continue;let l=[],u=s.getElementsByTagName("text");for(let a of Array.from(u))l.push(a.textContent);r.push({name:o[0].textContent,desc:l.join(" ")})}return r}function zn(t){var r;if(!((r=t.getElementsByTagName("trait"))!=null&&r.length))return[];let n=Array.from(t.getElementsByTagName("trait")).find(i=>{var s;return(s=i.getElementsByTagName("name")[0])==null?void 0:s.textContent.includes("Spellcasting")});return n?Array.from(n.getElementsByTagName("text")).map(i=>i.textContent.replace(/(•|\u2022)/u,"").trim()).filter(i=>i.length):[]}function Hn(t){var r;if(!((r=t.getElementsByTagName("skill"))!=null&&r.length))return[];let e=t.getElementsByTagName("skill")[0].textContent.split(", "),n=[];return e.forEach(i=>{let s=i.split(/\\s[\\+\\-]/);n.push({[s[0]]:Number(s[1])})}),n}var Kn={Str:"strength",Dex:"dexterity",Con:"constitution",Int:"intelligence",Wis:"wisdom",Cha:"charisma"};function Yn(t){var r;if(!((r=t.getElementsByTagName("save"))!=null&&r.length))return[];let e=t.getElementsByTagName("save")[0].textContent.split(", "),n=[];return e.forEach(i=>{let s=i.split(/\\s[\\+\\-]/);n.push({[Kn[s[0]]]:Number(s[1])})}),n}function cn(t,e){var s,o;if(!((s=t.getElementsByTagName("hp"))!=null&&s.length))return"";let n=t.getElementsByTagName("hp")[0].textContent,[,r,i]=(o=n.match(/(\\d+) \\(([\\s\\S]+)\\)/))!=null?o:[,"",""];return{hp:r,hit_dice:i}[e]}var Xn={T:"tiny",S:"small",M:"medium",L:"large",H:"huge",G:"gargantuan"};function qn(t){var e;return t.getElementsByTagName("size")&&(e=Xn[t.getElementsByTagName("size")[0].textContent])!=null?e:""}function Zn(t){var e;if(t.getElementsByTagName("ac")){let[,n]=(e=t.getElementsByTagName("ac")[0])==null?void 0:e.textContent.match(/(\\d+)/);return Number(n)}return 0}function Qn(t){var n,r,i,s,o,l;let e="Unknown";if((n=t.getElementsByTagName("source"))!=null&&n.length)e=t.getElementsByTagName("source")[0].textContent;else if((r=t.getElementsByTagName("trait"))!=null&&r.length&&Array.from(t.getElementsByTagName("trait")).find(u=>{var a;return((a=u.getElementsByTagName("name"))==null?void 0:a[0].textContent)=="Source"})){let u=Array.from(t.getElementsByTagName("trait")).find(a=>{var f,h;return((h=(f=a.getElementsByTagName("name"))==null?void 0:f[0])==null?void 0:h.textContent)=="Source"});e=(o=(s=(i=u==null?void 0:u.getElementsByTagName("text"))==null?void 0:i[0])==null?void 0:s.textContent)==null?void 0:o.replace(/p. \\d+/,"").trim()}else if((l=t.getElementsByTagName("description"))!=null&&l.length){let u=t.getElementsByTagName("description"),a="Source: ";if(u[0].textContent.includes(a)){let f=u[0].textContent.lastIndexOf(a);e=u[0].textContent.slice(f+a.length).split(/, ?/)[0]}}return e}var Jn={STR:"strength",DEX:"dexterity",CON:"constitution",INT:"intelligence",WIS:"wisdom",CHA:"charisma"};async function fn(t){return new Promise((e,n)=>{let r=new FileReader,i=[];r.onload=async s=>{var o,l,u,a,f,h,S,_,y,C,v,M,P,R,w,W,d,G,k,N,L,b,Y,J,V,B,A,g,ee,E,X,nt,rt,it,st,at,ot,ct,lt,ut,ft,mt,pt,ht,gt,dt,St,vt,yt,Rt,Ct,Et,_t;try{let Pe=JSON.parse(s.target.result),Sn=Object.keys(Pe).filter(ke=>/^Creatures\\./.test(ke));for(let ke of Sn)try{let T=Pe[ke],vn={name:T.Name,source:(o=T.Source)!=null&&o.trim().length?(l=T.Source)==null?void 0:l.trim():"Unknown",type:(f=(a=(u=T.Type)==null?void 0:u.split(/,\\s?/))==null?void 0:a[0])==null?void 0:f.trim(),subtype:"",size:"",alignment:(_=(S=(h=T.Type)==null?void 0:h.split(/,\\s?/))==null?void 0:S[1])==null?void 0:_.trim(),hp:(y=T.HP)==null?void 0:y.Value,hit_dice:(M=(v=(C=T.HP)==null?void 0:C.Notes)==null?void 0:v.replace(/([()])/g,""))==null?void 0:M.trim(),ac:T.AC.Value,speed:(R=(P=T.Speed)==null?void 0:P.join(", "))==null?void 0:R.trim(),stats:Object.values((w=T.Abilities)!=null?w:{}),damage_immunities:(k=(G=(d=(W=T.DamageImmunities)==null?void 0:W.join("; "))==null?void 0:d.toLowerCase())==null?void 0:G.trim())!=null?k:"",damage_resistances:(Y=(b=(L=(N=T.DamageResistances)==null?void 0:N.join(", "))==null?void 0:L.toLowerCase())==null?void 0:b.trim())!=null?Y:"",damage_vulnerabilities:(A=(B=(V=(J=T.DamageVulnerabilities)==null?void 0:J.join(", "))==null?void 0:V.toLowerCase())==null?void 0:B.trim())!=null?A:"",condition_immunities:(X=(E=(ee=(g=T.ConditionImmunities)==null?void 0:g.join(", "))==null?void 0:ee.toLowerCase())==null?void 0:E.trim())!=null?X:"",saves:(rt=(nt=T.Saves)==null?void 0:nt.map(({Name:D,Modifier:Fe})=>({[Jn[D]]:Fe})))!=null?rt:[],skillsaves:(st=(it=T.Skills)==null?void 0:it.map(({Name:D,Modifier:Fe})=>({[D]:Fe})))!=null?st:[],senses:(ct=(ot=(at=T.Senses)==null?void 0:at.join(", "))==null?void 0:ot.trim())!=null?ct:"",languages:(ft=(ut=(lt=T.Languages)==null?void 0:lt.join(", "))==null?void 0:ut.trim())!=null?ft:"",cr:(pt=(mt=T.Challenge)==null?void 0:mt.trim())!=null?pt:"",traits:(gt=(ht=T.Traits)==null?void 0:ht.map(D=>({name:D.Name,desc:D.Content})))!=null?gt:[],actions:(St=(dt=T.Actions)==null?void 0:dt.map(D=>({name:D.Name,desc:D.Content})))!=null?St:[],bonus_actions:(yt=(vt=T.BonusActions)==null?void 0:vt.map(D=>({name:D.Name,desc:D.Content})))!=null?yt:[],reactions:(Ct=(Rt=T.Reactions)==null?void 0:Rt.map(D=>({name:D.Name,desc:D.Content})))!=null?Ct:[],legendary_actions:(_t=(Et=T.LegendaryActions)==null?void 0:Et.map(D=>({name:D.Name,desc:D.Content})))!=null?_t:[],image:null};i.push(vn)}catch(T){continue}e(i)}catch(Pe){n()}},r.readAsText(t)})}async function mn(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=async i=>{var o,l,u,a,f,h,S,_,y,C,v,M,P,R,w,W,d,G,k,N,L,b,Y,J,V;let s=[];try{let B=JSON.parse(i.target.result),A=[];B.creatures?A=B.creatures:A=[B];for(let g of A)try{let ee={image:null,name:g.name,source:"CritterDB",type:g.stats.race,subtype:"",size:g.stats.size,alignment:g.stats.alignment,hp:g.stats.hitPoints,hit_dice:`${Math.floor(g.stats.extraHealthFromConstitution/g.stats.abilityScoreModifiers.constitution)}d${g.stats.hitDieSize} + ${g.stats.extraHealthFromConstitution}`,ac:g.stats.armorClass,speed:g.stats.speed,stats:[g.stats.abilityScores.strength,g.stats.abilityScores.dexterity,g.stats.abilityScores.constitution,g.stats.abilityScores.intelligence,g.stats.abilityScores.wisdom,g.stats.abilityScores.charisma],damage_immunities:(l=(o=g.stats.damageImmunities)==null?void 0:o.join("; ").toLowerCase().trim())!=null?l:"",damage_resistances:(a=(u=g.stats.damageResistances)==null?void 0:u.join(", ").toLowerCase().trim())!=null?a:"",damage_vulnerabilities:(h=(f=g.stats.damageVulnerabilities)==null?void 0:f.join(", ").toLowerCase().trim())!=null?h:"",condition_immunities:(_=(S=g.stats.conditionImmunities)==null?void 0:S.join(", ").toLowerCase().trim())!=null?_:"",saves:(C=(y=g.stats.savingThrows)==null?void 0:y.map(E=>{var X;if(!(!("value"in E)&&!("modifier"in E)))return{[E.ability]:(X=E.value)!=null?X:E.modifier}}).filter(E=>E))!=null?C:[],skillsaves:(M=(v=g.stats.skills)==null?void 0:v.map(E=>{var X;if(!(!("value"in E)&&!("modifier"in E)))return{[E.name]:(X=E.value)!=null?X:E.modifier}}).filter(E=>E))!=null?M:[],senses:(R=(P=g.stats.senses)==null?void 0:P.join(", ").trim())!=null?R:"",languages:(W=(w=g.stats.languages)==null?void 0:w.join(", ").trim())!=null?W:"",cr:(d=g.stats.challengeRating)!=null?d:"",traits:(k=(G=g.stats.additionalAbilities)==null?void 0:G.map(E=>({name:E.name,desc:E.description.replace(/<[^>]*>/g,"")})))!=null?k:[],actions:(L=(N=g.stats.actions)==null?void 0:N.map(E=>({name:E.name,desc:E.description.replace(/<[^>]*>/g,"")})))!=null?L:[],reactions:(Y=(b=g.stats.reactions)==null?void 0:b.map(E=>({name:E.name,desc:E.description.replace(/<[^>]*>/g,"")})))!=null?Y:[],legendary_actions:(V=(J=g.stats.legendaryActions)==null?void 0:J.map(E=>({name:E.name,desc:E.description.replace(/<[^>]*>/g,"")})))!=null?V:[]};s.push(ee)}catch(ee){continue}e(s)}catch(B){n()}},r.readAsText(t)})}function Ae(t,e=0,n=" ",r=!0){let i=[];if(e==5||t==null)return"";if(typeof t=="string")return t;if(typeof t=="number")return`${t}`;if(Array.isArray(t))i.push(`${r?"(":""}${t.map(s=>Ae(s,e++)).join(n)}${r?")":""}`);else if(typeof t=="object")for(let s of Object.values(t))i.push(Ae(s,e++));return i.join(" ")}var er={str:"strength",dex:"dexterity",con:"constitution",wis:"wisdom",int:"intelligence",cha:"charisma"};function H(t){return t?t.replace(/{@condition (.+?)}/g,"$1").replace(/{@item (.+?)}/g,"$1").replace(/{@spell ([\\s\\S]+?)}/g,"$1").replace(/{@recharge (.+?)}/g,"(Recharge $1-6)").replace(/{@recharge}/g,"(Recharge 6)").replace(/{@h}/g,"").replace(/{@damage (.+?)}/g,"$1").replace(/{@atk ms}/g,"Melee Spell Attack").replace(/{@atk rs}/g,"Ranged Spell Attack").replace(/{@atk mw}/g,"Melee Weapon Attack").replace(/{@atk rw}/g,"Ranged Weapon Attack").replace(/{@atk mw,rw}/g,"Melee / Ranged Weapon Attack").replace(/{@creature (.+?)}/g,"$1").replace(/{@skill (.+?)}/g,"$1").replace(/{@dice (.+?)}/g,"$1").replace(/{@hit (\\d+?)}/g,"+$1").replace(/{@dc (\\d+?)}/g,"$1").replace(/{@quickref (.+?)\\|\\|.+?}/,"$1"):""}async function pn(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=async i=>{var s,o,l,u,a,f,h,S,_,y,C,v,M,P;try{let R=JSON.parse(i.target.result),w;"monster"in R?w=R.monster:Array.isArray(R)?w=R:typeof R=="object"?w=[R]:n("Invalid monster JSON provided.");let W=[];for(let d of w)try{let G={image:null,name:d.name,source:mr(d),type:tr(d.type),subtype:"",size:_r[(s=d.size)==null?void 0:s[0]],alignment:lr(d),hp:d.hp&&"average"in d.hp?(o=d.hp)==null?void 0:o.average:null,hit_dice:d.hp&&"formula"in d.hp?(l=d.hp)==null?void 0:l.formula:"",ac:ir(d.ac),speed:ur(d),stats:[d.str,d.dex,d.con,d.int,d.wis,d.cha],damage_immunities:H(fe(d.immune)),damage_resistances:H(fe(d.resist)),damage_vulnerabilities:H(fe(d.vulnerable)),condition_immunities:H(fe(d.conditionImmune)),saves:Object.entries((u=d.save)!=null?u:{}).map(k=>{var L,b;if(!k||!k[1])return;let[,N]=(b=(L=k[1])==null?void 0:L.match(/.*?(\\d+)/))!=null?b:[];if(N)return{[er[k[0]]]:N}}).filter(k=>k),skillsaves:ma(d),senses:fr(d),languages:Ae(d.languages,0,", ",!1),cr:nr(d.cr),traits:(f=(a=d.trait)==null?void 0:a.flatMap(Te))!=null?f:[],actions:(S=(h=d.action)==null?void 0:h.flatMap(Te))!=null?S:[],bonus_actions:(y=(_=d.bonus)==null?void 0:_.flatMap(Te))!=null?y:[],reactions:(v=(C=d.reaction)==null?void 0:C.flatMap(Te))!=null?v:[],legendary_actions:(P=(M=d.legendary)==null?void 0:M.flatMap(Te))!=null?P:[],spells:cr(d),spellsNotes:rr(d).join(" ")};W.push(G)}catch(G){console.error(G);continue}e(W)}catch(R){console.error("reject!!!",R),n(R)}},r.readAsText(t)})}function tr(t){if(t)return typeof t=="string"?t:t.type}function nr(t){if(t)return typeof t=="string"?t:t.cr}function rr(t){let e=[];for(let n in t.spellcasting)e.push(Ae(t.spellcasting[n].footerEntries,0,", ",!1));return e}function fe(t){if(!t)return"";let e=[];for(let n of t){if(typeof n=="string"){e.push(n);continue}if("special"in n){e.push(n.special);continue}if("immune"in n){e.push(`${fe(n.immune)}${n.note?" ":""}${n.note?n.note:""}`);continue}if("resist"in n){e.push(`${fe(n.resist)}${n.note?" ":""}${n.note?n.note:""}`);continue}}return e.join(", ")}function ir(t=[]){var n;let[e]=t;if(e){if(typeof e=="number")return e;if(typeof e=="string"){let[r,i]=(n=e.match(/(\\d+)/))!=null?n:[];return i?Number(i):null}if(typeof e=="object")return"special"in e?null:e.ac}}var sr={0:"Cantrips (at will)",1:"1st level",2:"2nd level",3:"3rd level",4:"4th level",5:"5th level",6:"6th level",7:"7th level",8:"8th level",9:"9th level"};function Ze(t){let e=[];for(let n of t){if(typeof n=="string"){e.push(n);continue}!n.hidden&&n.entry&&n.entry.length&&e.push(n.entry)}return H(e.join(", "))}function ar(t){let e=[];for(let n of Object.keys(t)){let r=t[n],i=Number(n.replace(/[^0-9]/,""));e.push([i,Ze(r)])}return e}function or(t){var i,s;let e=[H(((i=t.headerEntries)!=null?i:[]).join(`\n`))];if("spells"in t)try{for(let o in(s=t.spells)!=null?s:{}){let l=t.spells[o],{spells:u}=l,a=`${sr[o]}`;a+="slots"in l?` (${l.slots} slots)`:"";let f=H(u.join(", "));e.push({[a]:f})}}catch(o){throw new Error("There was an error parsing the spells.")}if("will"in t&&t.will.length>0)try{e.push({"At will":Ze(t.will)})}catch(o){throw new Error("There was an error parsing the at-will spells.")}if("ritual"in t&&t.ritual.length>0)try{e.push({Rituals:Ze(t.ritual)})}catch(o){throw new Error("There was an error parsing the ritual spells.")}let n=["rest","daily","weekly","yearly","charges"],r={rest:"/rest each",daily:"/day each",weekly:"/week each",yearly:"/year each",charges:" charges"};for(let o of n)if(o in t){let l=ar(t[o]);for(let u of l.sort((a,f)=>f[0]-a[0]))e.push({[`${u[0]}${r[o]}`]:u[1]})}return e}function cr(t){return!t.spellcasting||!t.spellcasting.length?[]:t.spellcasting.flatMap(or)}function lr(t){return t.alignment?Qe(t.alignment):null}function Qe(t){var n;if(!t)return null;let e=[];if(Array.isArray(t))for(let r of t)e.push(Qe(r));else if(typeof t=="object"){if("special"in t&&t.special!=null)return t.special;if("alignment"in t)return`${((n=t.alignment)!=null?n:[]).map(r=>Qe(r)).join(" ")}${t.chance?` (${t.chance}%)`:""}${t.note?` (${t.note})`:""}`}else{switch(t.toUpperCase()){case"L":return"lawful";case"N":return"neutral";case"NX":return"neutral (law/chaos axis)";case"NY":return"neutral (good/evil axis)";case"C":return"chaotic";case"G":return"good";case"E":return"evil";case"U":return"unaligned";case"A":return"any alignment"}return t}return e.join(" or ")}function ur(t){var l,u;let e=t.speed;if(!e)return"\\u2014";if(typeof e=="number")return`${e}`;function n(a){return typeof a=="number"?a:a.number!=null?a.number:a}function r(a){var f;return typeof a=="number"?"":(f=a==null?void 0:a.condition)!=null?f:""}let i=[],s=["walk","burrow","climb","fly","swim"];for(let a of s){if(a!="walk"&&!(a in e)&&!(a in((l=e.alternate)!=null?l:{})))continue;let f=[];i.push(`${a==="walk"?"":`${a} `}${n((u=e[a])!=null?u:0)} ft. ${r(e[a])}`.trim()),e.alternate&&e.alternate[a]&&e.alternate[a].forEach(h=>{i.push(`${a==="walk"?"":`${a} `}${n(h!=null?h:0)} ft. ${r(h)}`.trim())})}let o=", ";if(e.choose){o="; ";let a=e.choose.from.sort();a.length>1?(`${a.slice(0,a.length-1).join(", ")}${a[a.length-1]}${e.choose.amount}`,e.choose.note&&`${e.choose.note}`):i.push(`${a} ${e.choose.amount} ft.${e.choose.note?` ${e.choose.note}`:""}`)}return i.join(o)}function fr(t){var n,r;if(typeof t.senses=="string")return t.senses;let e=[(r=(n=t.senses)==null?void 0:n.join(", ").trim())!=null?r:""];return t.passive&&e.push(`passive Perception ${t.passive}`),e.join(", ")}function mr(t){var n,r,i;let e=[];return(n=t.source)!=null&&n.length&&e.push((r=c[t.source])!=null?r:t.source),(i=t.otherSources)!=null&&i.length&&e.push(...t.otherSources.map(s=>{var o;return(o=c[s.source])!=null?o:s.source})),e}function Te(t){return t.entries.reduce((n,r)=>{var s;if(typeof r!="string"){let o=(s=r.items)==null?void 0:s.map(l=>typeof l=="string"?{name:l,entries:[]}:"entry"in l?{name:l.name,entries:[l.entry]}:{name:l.name,entries:l.entries});return n.concat(o!=null?o:[])}return n.length>1||n[0].entries.push(r),n},[{name:t.name,entries:[]}]).map(({name:n,entries:r})=>({name:H(n),desc:H(r.join(`\n`))}))}var pr="F",hr="D",gr="T",dr="S",Sr="M",vr="L",yr="H",Rr="G",Cr="C",Er="V",_r={[pr]:"Fine",[hr]:"Diminutive",[gr]:"Tiny",[dr]:"Small",[Sr]:"Medium",[vr]:"Large",[yr]:"Huge",[Rr]:"Gargantuan",[Cr]:"Colossal",[Er]:"Varies"},Ar="CoS",Tr="DMG",br="EEPC",Nr="EET",wr="HotDQ",Dr="LMoP",$r="Mag",xr="MM",Mr="OotA",Or="PHB",Ir="PotA",Pr="RoT",kr="RoTOS",Fr="SCAG",Ur="SKT",Lr="ToA",Wr="ToD",Gr="TTP",jr="TftYP",Br="TftYP-AtG",Vr="TftYP-DiT",zr="TftYP-TFoF",Hr="TftYP-THSoT",Kr="TftYP-TSC",Yr="TftYP-ToH",Xr="TftYP-WPM",qr="VGM",Zr="XGE",Qr="OGA",Jr="MTF",ei="WDH",ti="WDMM",ni="GGR",ri="KKW",ii="LLK",si="GoS",ai="AI",oi="OoW",ci="ESK",li="DIP",ui="HftT",fi="DC",mi="SLW",pi="SDW",hi="BGDIA",gi="LR",di="AL",Si="SAC",vi="ERLW",yi="EFR",Ri="RMBRE",Ci="RMR",Ei="MFF",_i="AWM",Ai="IMR",Ti="SADS",bi="EGW",Ni="ToR",wi="DD",Di="FS",$i="US",xi="MOT",Mi="IDRotF",Oi="TCE",Ii="VRGR",Pi="HoL",ki="Screen",Fi="ScreenWildernessKit",Ui="HF",Li="CM",Wi="WBtW",Gi="CRCotN",Je="AL",ji=`${Je}CurseOfStrahd`,Bi=`${Je}ElementalEvil`,Vi=`${Je}RageOfDemons`,me="PS",zi=`${me}A`,Hi=`${me}I`,Ki=`${me}K`,Yi=`${me}Z`,Xi=`${me}X`,qi=`${me}D`,m="UA",Zi=`${m}Artificer`,Qi=`${m}EladrinAndGith`,Ji=`${m}Eberron`,es=`${m}FeatsForRaces`,ts=`${m}FeatsForSkills`,ns=`${m}FiendishOptions`,rs=`${m}Feats`,is=`${m}GothicHeroes`,ss=`${m}ModernMagic`,as=`${m}StarterSpells`,os=`${m}TheMysticClass`,cs=`${m}ThatOldBlackMagic`,ls=`${m}TheRangerRevised`,us=`${m}WaterborneAdventures`,fs=`${m}VariantRules`,ms=`${m}LightDarkUnderdark`,ps=`${m}RangerAndRogue`,hs=`${m}ATrioOfSubclasses`,gs=`${m}BarbarianPrimalPaths`,ds=`${m}RevisedSubclasses`,Ss=`${m}KitsOfOld`,vs=`${m}BardBardColleges`,ys=`${m}ClericDivineDomains`,Rs=`${m}Druid`,Cs=`${m}RevisedClassOptions`,Es=`${m}Fighter`,_s=`${m}Monk`,As=`${m}Paladin`,Ts=`${m}ModifyingClasses`,bs=`${m}Sorcerer`,Ns=`${m}WarlockAndWizard`,ws=`${m}TheFaithful`,Ds=`${m}WizardRevisited`,$s=`${m}ElfSubraces`,xs=`${m}MassCombat`,Ms=`${m}ThreePillarExperience`,Os=`${m}GreyhawkInitiative`,Is=`${m}ThreeSubclasses`,Ps=`${m}OrderDomain`,ks=`${m}CentaursMinotaurs`,Fs=`${m}GiantSoulSorcerer`,Us=`${m}RacesOfEberron`,Ls=`${m}RacesOfRavnica`,Ws=`${m}WGE`,Gs=`${m}OfShipsAndSea`,js=`${m}Sidekicks`,Bs=`${m}ArtificerRevisited`,Vs=`${m}BarbarianAndMonk`,zs=`${m}SorcererAndWarlock`,Hs=`${m}BardAndPaladin`,Ks=`${m}ClericDruidWizard`,Ys=`${m}FighterRangerRogue`,Xs=`${m}ClassFeatureVariants`,qs=`${m}FighterRogueWizard`,Zs=`${m}PrestigeClassesRunMagic`,Qs=`${m}Ranger`,Js=`${m}2020SubclassesPt1`,ea=`${m}2020SubclassesPt2`,ta=`${m}2020SubclassesPt3`,na=`${m}2020SubclassesPt4`,ra=`${m}2020SubclassesPt5`,ia=`${m}2020SpellsAndMagicTattoos`,sa=`${m}2020PsionicOptionsRevisited`,aa=`${m}2020SubclassesRevisited`,oa=`${m}2020Feats`,ca=`${m}2021GothicLineages`,la=`${m}2021FolkOfTheFeywild`,ua=`${m}2021DraconicOptions`,fa=`${m}2021MagesOfStrixhaven`,et="Adventurers League: ",pe="Plane Shift: ",p="Unearthed Arcana: ",Q="Tales from the Yawning Portal",c={};c[Ar]="Curse of Strahd";c[Tr]="Dungeon Master\'s Guide";c[br]="Elemental Evil Player\'s Companion";c[Nr]="Elemental Evil: Trinkets";c[wr]="Hoard of the Dragon Queen";c[Dr]="Lost Mine of Phandelver";c[$r]="Dragon Magazine";c[xr]="Monster Manual";c[Mr]="Out of the Abyss";c[Or]="Player\'s Handbook";c[Ir]="Princes of the Apocalypse";c[Pr]="The Rise of Tiamat";c[kr]="The Rise of Tiamat Online Supplement";c[Fr]="Sword Coast Adventurer\'s Guide";c[Ur]="Storm King\'s Thunder";c[Lr]="Tomb of Annihilation";c[Wr]="Tyranny of Dragons";c[Gr]="The Tortle Package";c[jr]=Q;c[Br]=`${Q}: Against the Giants`;c[Vr]=`${Q}: Dead in Thay`;c[zr]=`${Q}: The Forge of Fury`;c[Hr]=`${Q}: The Hidden Shrine of Tamoachan`;c[Kr]=`${Q}: The Sunless Citadel`;c[Yr]=`${Q}: Tomb of Horrors`;c[Xr]=`${Q}: White Plume Mountain`;c[qr]="Volo\'s Guide to Monsters";c[Zr]="Xanathar\'s Guide to Everything";c[Qr]="One Grung Above";c[Jr]="Mordenkainen\'s Tome of Foes";c[ei]="Waterdeep: Dragon Heist";c[ti]="Waterdeep: Dungeon of the Mad Mage";c[ni]="Guildmasters\' Guide to Ravnica";c[ri]="Krenko\'s Way";c[ii]="Lost Laboratory of Kwalish";c[si]="Ghosts of Saltmarsh";c[ai]="Acquisitions Incorporated";c[oi]="The Orrery of the Wanderer";c[ci]="Essentials Kit";c[li]="Dragon of Icespire Peak";c[ui]="Hunt for the Thessalhydra";c[fi]="Divine Contention";c[mi]="Storm Lord\'s Wrath";c[pi]="Sleeping Dragon\'s Wake";c[hi]="Baldur\'s Gate: Descent Into Avernus";c[gi]="Locathah Rising";c[di]="Adventurers\' League";c[Si]="Sage Advice Compendium";c[vi]="Eberron: Rising from the Last War";c[yi]="Eberron: Forgotten Relics";c[Ri]="The Lost Dungeon of Rickedness: Big Rick Energy";c[Ci]="Dungeons & Dragons vs. Rick and Morty: Basic Rules";c[Ei]="Mordenkainen\'s Fiendish Folio";c[_i]="Adventure with Muk";c[Ai]="Infernal Machine Rebuild";c[Ti]="Sapphire Anniversary Dice Set";c[bi]="Explorer\'s Guide to Wildemount";c[Ni]="Tide of Retribution";c[wi]="Dangerous Designs";c[Di]="Frozen Sick";c[$i]="Unwelcome Spirits";c[xi]="Mythic Odysseys of Theros";c[Mi]="Icewind Dale: Rime of the Frostmaiden";c[Oi]="Tasha\'s Cauldron of Everything";c[Ii]="Van Richten\'s Guide to Ravenloft";c[Pi]="The House of Lament";c[ki]="Dungeon Master\'s Screen";c[Fi]="Dungeon Master\'s Screen: Wilderness Kit";c[Ui]="Heroes\' Feast";c[Li]="Candlekeep Mysteries";c[ji]=`${et}Curse of Strahd`;c[Bi]=`${et}Elemental Evil`;c[Vi]=`${et}Rage of Demons`;c[zi]=`${pe}Amonkhet`;c[Hi]=`${pe}Innistrad`;c[Ki]=`${pe}Kaladesh`;c[Yi]=`${pe}Zendikar`;c[Xi]=`${pe}Ixalan`;c[qi]=`${pe}Dominaria`;c[Zi]=`${p}Artificer`;c[Qi]=`${p}Eladrin and Gith`;c[Ji]=`${p}Eberron`;c[es]=`${p}Feats for Races`;c[ts]=`${p}Feats for Skills`;c[ns]=`${p}Fiendish Options`;c[rs]=`${p}Feats`;c[is]=`${p}Gothic Heroes`;c[ss]=`${p}Modern Magic`;c[as]=`${p}Starter Spells`;c[os]=`${p}The Mystic Class`;c[cs]=`${p}That Old Black Magic`;c[ls]=`${p}The Ranger, Revised`;c[us]=`${p}Waterborne Adventures`;c[fs]=`${p}Variant Rules`;c[ms]=`${p}Light, Dark, Underdark!`;c[ps]=`${p}Ranger and Rogue`;c[hs]=`${p}A Trio of Subclasses`;c[gs]=`${p}Barbarian Primal Paths`;c[ds]=`${p}Revised Subclasses`;c[Ss]=`${p}Kits of Old`;c[vs]=`${p}Bard: Bard Colleges`;c[ys]=`${p}Cleric: Divine Domains`;c[Rs]=`${p}Druid`;c[Cs]=`${p}Revised Class Options`;c[Es]=`${p}Fighter`;c[_s]=`${p}Monk`;c[As]=`${p}Paladin`;c[Ts]=`${p}Modifying Classes`;c[bs]=`${p}Sorcerer`;c[Ns]=`${p}Warlock and Wizard`;c[ws]=`${p}The Faithful`;c[Ds]=`${p}Wizard Revisited`;c[$s]=`${p}Elf Subraces`;c[xs]=`${p}Mass Combat`;c[Ms]=`${p}Three-Pillar Experience`;c[Os]=`${p}Greyhawk Initiative`;c[Is]=`${p}Three Subclasses`;c[Ps]=`${p}Order Domain`;c[ks]=`${p}Centaurs and Minotaurs`;c[Fs]=`${p}Giant Soul Sorcerer`;c[Us]=`${p}Races of Eberron`;c[Ls]=`${p}Races of Ravnica`;c[Ws]="Wayfinder\'s Guide to Eberron";c[Gs]=`${p}Of Ships and the Sea`;c[js]=`${p}Sidekicks`;c[Bs]=`${p}Artificer Revisited`;c[Vs]=`${p}Barbarian and Monk`;c[zs]=`${p}Sorcerer and Warlock`;c[Hs]=`${p}Bard and Paladin`;c[Ks]=`${p}Cleric, Druid, and Wizard`;c[Ys]=`${p}Fighter, Ranger, and Rogue`;c[Xs]=`${p}Class Feature Variants`;c[qs]=`${p}Fighter, Rogue, and Wizard`;c[Zs]=`${p}Prestige Classes and Rune Magic`;c[Qs]=`${p}Ranger`;c[Js]=`${p}2020 Subclasses, Part 1`;c[ea]=`${p}2020 Subclasses, Part 2`;c[ta]=`${p}2020 Subclasses, Part 3`;c[na]=`${p}2020 Subclasses, Part 4`;c[ra]=`${p}2020 Subclasses, Part 5`;c[ia]=`${p}2020 Spells and Magic Tattoos`;c[sa]=`${p}2020 Psionic Options Revisited`;c[aa]=`${p}2020 Subclasses Revisited`;c[oa]=`${p}2020 Feats`;c[ca]=`${p}2021 Gothic Lineages`;c[la]=`${p}2021 Folk of the Feywild`;c[ua]=`${p}2021 Draconic Options`;c[fa]=`${p}2021 Mages of Strixhaven`;c[Wi]="The Wild Beyond the Witchlight";c[Gi]="Critical Role: Call of the Netherdeep";function ma(t){var i,s,o;let e=t.skill;if(!e)return[];let n=[],r=[];for(let l of Object.keys(e)){if(l=="other"){let f=e[l];for(let h of f){let S=h.oneOf;if(!S)continue;let _=Object.keys(S).sort(),y=_.shift(),C=S[y],[,v]=(i=C==null?void 0:C.match(/.*?(\\d+)/))!=null?i:[];r.push({[`plus one of the following: ${y.charAt(0).toUpperCase()+y.slice(1)}`]:v});for(let M of _.slice(1)){let P=S[M],[,R]=(s=P==null?void 0:P.match(/.*?(\\d+)/))!=null?s:[];R&&r.push({[M]:R})}}continue}let u=e[l],[,a]=(o=u==null?void 0:u.match(/.*?(\\d+)/))!=null?o:[];a&&n.push({[l]:a})}return[...n.filter(l=>l),...r.filter(l=>l)]}var hn={0:{cr:"0",value:0,xp:0},"1/8":{cr:"1/8",value:.125,xp:25},"1/4":{cr:"1/4",value:.25,xp:50},"1/2":{cr:"1/2",value:.5,xp:100},"0.125":{cr:"1/8",value:.125,xp:25},"0.25":{cr:"1/4",value:.25,xp:50},"0.5":{cr:"1/2",value:.5,xp:100},1:{cr:"1",value:1,xp:200},2:{cr:"2",value:2,xp:450},3:{cr:"3",value:3,xp:700},4:{cr:"4",value:4,xp:1100},5:{cr:"5",value:5,xp:1800},6:{cr:"6",value:6,xp:2300},7:{cr:"7",value:7,xp:2900},8:{cr:"8",value:8,xp:3900},9:{cr:"9",value:9,xp:5e3},10:{cr:"10",value:10,xp:5900},11:{cr:"11",value:11,xp:7200},12:{cr:"12",value:12,xp:8400},13:{cr:"13",value:13,xp:1e4},14:{cr:"14",value:14,xp:11500},15:{cr:"15",value:15,xp:13e3},16:{cr:"16",value:16,xp:15e3},17:{cr:"17",value:17,xp:18e3},18:{cr:"18",value:18,xp:2e4},19:{cr:"19",value:19,xp:22e3},20:{cr:"20",value:20,xp:25e3},21:{cr:"21",value:21,xp:33e3},22:{cr:"22",value:22,xp:41e3},23:{cr:"23",value:23,xp:5e4},24:{cr:"24",value:24,xp:62e3},25:{cr:"25",value:25,xp:75e3},26:{cr:"26",value:26,xp:9e4},27:{cr:"27",value:27,xp:105e3},28:{cr:"28",value:28,xp:12e4},29:{cr:"29",value:29,xp:135e3},30:{cr:"30",value:30,xp:155e3}};function K(t){return Math.floor(((t!=null?t:10)-10)/2)}var gn={tiny:4,small:6,medium:8,large:10,huge:12,gargantuan:20},pa={str:"strength",dex:"dexterity",con:"constitution",int:"intelligence",wis:"wisdom",cha:"charisma"},be=class{constructor(e){this.monster=e;this.proficiency=this.getProf(this.monster);this.stats={str:this.monster.strPoints,dex:this.monster.dexPoints,con:this.monster.conPoints,int:this.monster.intPoints,wis:this.monster.wisPoints,cha:this.monster.chaPoints};this.modifiers={str:K(this.stats.str),dex:K(this.stats.dex),con:K(this.stats.con),int:K(this.stats.int),wis:K(this.stats.wis),cha:K(this.stats.cha)}}static parse(e){var i,s,o,l,u,a;let n=new be(e);return{image:null,name:e.name,source:"TetraCube",type:e.type,subtype:"",size:e.size,alignment:e.alignment,hp:(i=n.getHP(e))==null?void 0:i.hp,hit_dice:(s=n.getHP(e))==null?void 0:s.dice,ac:(u=(l=((o=e.ac)!=null?o:[])[0])==null?void 0:l.ac)!=null?u:"",speed:n.getSpeedString(e),stats:[e.strPoints,e.dexPoints,e.conPoints,e.intPoints,e.wisPoints,e.chaPoints],damage_immunities:n.parseImmune(e,"i"),damage_resistances:n.parseImmune(e,"r"),damage_vulnerabilities:n.parseImmune(e,"v"),condition_immunities:n.parseConditions(e),saves:n.getSaves(e),skillsaves:n.getSkills(e),senses:n.getSenses(e),languages:n.getLanguages(e),cr:(a=e.cr)!=null?a:"",traits:n.getTraits(e.abilities),actions:n.getTraits(e.actions),reactions:n.getTraits(e.reactions),legendary_actions:n.getTraits(e.legendaries),spells:n.getSpells(e.abilities)}}getHP(e){var n,r;if(e.customHP||e.hitDice&&/(\\d+) \\((.+)\\)/.test(e.hpText)){let[i,s,o]=(n=e.hpText.match(/(\\d+) \\((.+)\\)/))!=null?n:[];return{hp:s,dice:o}}if(e.hitDice){let i=Number(e.hitDice),s=(r=gn[e.size])!=null?r:gn.medium,o=this.modifiers.con,l=i*s/(2+.5)+o*i,u=o>0?"+":"-",a=o==0?"":` ${u} ${o*i}`;return{hp:l,dice:`${i}d${s}${a}`}}}getSpeedString(e){if(e.customSpeed)return e.speedDesc;let n=[e.speed+" ft."];return e.burrowSpeed>0&&n.push("burrow "+e.burrowSpeed+" ft."),e.climbSpeed>0&&n.push("climb "+e.climbSpeed+" ft."),e.flySpeed>0&&n.push("fly "+e.flySpeed+" ft."+(e.hover?" (hover)":"")),e.swimSpeed>0&&n.push("swim "+e.swimSpeed+" ft."),n.join(", ")}parseImmune(e,n){let r=[];"damagetypes"in e&&Array.isArray(e.damagetypes)&&r.push(...e.damagetypes.filter(s=>s.type==n).map(s=>s.name));let i=[];return"specialdamage"in e&&Array.isArray(e.specialdamage)&&i.push(...e.specialdamage.filter(s=>s.type==n).map(s=>s.name)),[r.join(", "),i.join(", ")].filter(s=>s&&s.length).join("; ")}getLanguages(e){let n=[],r=[],i=[];for(let s=0;s<e.languages.length;s++){let o=e.languages[s];o.speaks||o.speaks==null?r.push(o):i.push(o)}return r.length>0&&n.push([r.slice(0,r.length-2).map(s=>s.name).join(", "),r.slice(-1).map(s=>s.name)].filter(s=>s).join(" and ")),i.length>0&&n.push([i.slice(0,i.length-2).map(s=>s.name).join(", "),i.slice(-1).map(s=>s.name)].filter(s=>s).join(" and ")),e.telepathy>0&&n.push("telepathy "+e.telepathy+" ft."),n.length==0&&n.push("—"),n.join("; ")}getSenses(e){let n=[];e.blindsight>0&&n.push("blindsight "+e.blindsight+" ft."+(e.blind?" (blind beyond this radius)":"")),e.darkvision>0&&n.push("darkvision "+e.darkvision+" ft."),e.tremorsense>0&&n.push("tremorsense "+e.tremorsense+" ft."),e.truesight>0&&n.push("truesight "+e.truesight+" ft.");let r=e.skills.find(s=>s.name=="perception"),i=10+K(e.wisPoints);return r!=null&&(i+=this.proficiency*("note"in r?2:1)),n.push("passive Perception "+i),n.join(", ")}transformString(e){return e.replace(/(_|\\*|\\s*>\\s*)/g,"").replace(/\\[MON(S)?\\]/g,`${this.monster.shortName&&this.monster.shortName.length?this.monster.shortName:this.monster.name}$1`).replace(/\\[(\\w+)\\]/g,(n,r)=>{if(r=r.toLowerCase(),!(r in this.modifiers))return n;let i=this.modifiers[r];return`${i>=0?"+":""}${i}`}).replace(/\\[(\\w+) (ATK|SAVE)\\s?(?:([+-])\\s?(\\d+))?\\]/g,(n,r,i="ATK",s="+",o=0)=>{if(r=r.toLowerCase(),!(r in this.modifiers))return n;o=s=="+"?Number(o):-Number(o);let l=(i=="ATK"?0:8)+this.modifiers[r]+this.proficiency+o;return`${l>=0?"+":""}${l}`}).replace(/\\[(\\w+)?\\s?(\\d*[dD]\\d+)\\s?(?:([+-])\\s?(\\d+))?\\]/g,(n,r,i,s="+",o=0)=>{var h;r=r.toLowerCase();let[,l=1,u]=(h=i.match(/(\\d*)[dD](\\d+)/))!=null?h:[];if(l||(l=1),!u)return n;o=s=="+"?Number(o):-Number(o),r in this.modifiers&&(o+=this.modifiers[r]);let a=Math.floor((u/2+.5)*l)+o,f=[`${l}d${u}`];return o&&o!=0&&(f.push(o>=0?"+":"-"),f.push(o)),`${a} (${f.join(" ")})`})}getTraits(e){return!e||!e.length?void 0:e.filter(r=>r.name!="Spellcasting").map(r=>({name:r.name,desc:this.transformString(r.desc)}))}getSpells(e){var i;if(!e.abilities||!e.abilities.length)return;let{desc:n}=(i=e.abilities.find(s=>s.name=="Spellcasting"))!=null?i:{};return n?this.transformString(n).trim().split(`\n`).filter(s=>s.length):void 0}getSaves(e){if(!("sthrows"in e)||!Array.isArray(e.sthrows)||!e.sthrows.length)return[];let n=this.proficiency,r=[];for(let i of e.sthrows){let s=i.name,o=K(Number(e[`${s}Points`]));isNaN(o)||r.push({[pa[s]]:o+n})}return r}getSkills(e){if(!("skills"in e)||!Array.isArray(e.skills)||!e.skills.length)return[];let n=[],r=this.proficiency;for(let i of e.skills){let s=i.stat,o=K(Number(e[`${s}Points`]));if(isNaN(o))continue;let l="note"in i;n.push({[i.name]:r+o+o*Number(l)})}return n}getProf(e){var r,i;let n=0;return e.cr=="*"&&(n=e.customProf),"cr"in e&&e.cr in hn&&(n=Math.max(Math.floor(2+(((i=(r=hn[e.cr])==null?void 0:r.value)!=null?i:0)-1)/4),2)),isNaN(Number(n))?0:Number(n)}parseConditions(e){if("conditions"in e&&Array.isArray(e.conditions))return e.conditions.map(n=>n.name).join(", ")}};async function dn(t){return new Promise((e,n)=>{let r=new FileReader,i=[];r.onload=async s=>{try{let o=JSON.parse(s.target.result),l;"monster"in o?l=o.monster:Array.isArray(o)?l=o:typeof o=="object"?l=[o]:n("Invalid monster JSON provided.");let u=[];for(let a of l)try{let f=be.parse(a);u.push(f)}catch(f){console.error(f);continue}e(u)}catch(o){console.error("reject!!!",o),n(o)}},r.readAsText(t)})}var tt=self;tt.onmessage=async t=>{if(!t.data)return;let{files:e,source:n}=t.data,r=[];for(let i of e)switch(n){case"5e":{let s=await pn(i);r.push(...s!=null?s:[]);break}case"critter":{let s=await mn(i);r.push(...s!=null?s:[]);break}case"improved":{let s=await fn(i);r.push(...s!=null?s:[]);break}case"appfile":{let s=await un(i);r.push(...s!=null?s:[]);break}case"tetra":{let s=await dn(i);r.push(...s!=null?s:[]);break}}tt.postMessage({monsters:r})};tt.addEventListener("unhandledrejection",function(t){throw t.reason});\n')}var Dt=require("obsidian");var ss=class extends Dt.Modal{constructor(){super(...arguments);this.saved=!1}display(){this.titleEl.createSpan({text:"Set Sources"}),new Dt.Setting(this.contentEl).setName("A source could not be found for some imported monsters. Do you wish to manually add one?").addText(t=>{t.setPlaceholder("Unknown").onChange(n=>{this.source=n})}),this.buildButtons(this.contentEl)}buildButtons(t){new Dt.Setting(t).addButton(n=>n.setCta().setIcon("checkmark").setTooltip("Save").onClick(()=>{this.saved=!0,this.close()})).addExtraButton(n=>n.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.close()}))}onOpen(){this.display()}},xh=async a=>new Promise(e=>{let t=new ss(a);t.onClose=()=>{t.saved||e(null),e(t.source)},t.open()}),La=class{constructor(e){this.plugin=e;this.workers=new Map}async import(e,t){return new Promise(n=>{let i=new is,s=z();this.workers.set(s,i),i.onmessage=async r=>{let{monsters:c}=r.data??{monsters:[]};if(c){new Dt.Notice(`Successfully imported ${c.length} Monsters`);let o=c.filter(d=>d.source=="Unknown"||!d.source),l;o.length&&(l=await xh(this.plugin.app))&&o.forEach(d=>d.source=l)}i.terminate(),this.workers.delete(s),n(c)},i.onerror=r=>{new Dt.Notice(`There was an error importing the file.
|
||
|
||
${r.message}`),i.terminate(),this.workers.delete(s),n([])},i.postMessage({files:e,source:t})})}};var _c=require("obsidian");var Rn=require("obsidian");var ye="top",Ee="bottom",xe="right",_e="left",In="auto",Et=[ye,Ee,xe,_e],yt="start",Gt="end",ec="clippingParents",Pn="viewport",ga="popper",tc="reference",rs=Et.reduce(function(a,e){return a.concat([e+"-"+yt,e+"-"+Gt])},[]),On=[].concat(Et,[In]).reduce(function(a,e){return a.concat([e,e+"-"+yt,e+"-"+Gt])},[]),Dh="beforeRead",Eh="read",Mh="afterRead",Ih="beforeMain",Ph="main",Oh="afterMain",Wh="beforeWrite",Nh="write",Hh="afterWrite",ac=[Dh,Eh,Mh,Ih,Ph,Oh,Wh,Nh,Hh];function Pe(a){return a?(a.nodeName||"").toLowerCase():null}function be(a){if(a==null)return window;if(a.toString()!=="[object Window]"){var e=a.ownerDocument;return e&&e.defaultView||window}return a}function tt(a){var e=be(a).Element;return a instanceof e||a instanceof Element}function Me(a){var e=be(a).HTMLElement;return a instanceof e||a instanceof HTMLElement}function fa(a){if(typeof ShadowRoot>"u")return!1;var e=be(a).ShadowRoot;return a instanceof e||a instanceof ShadowRoot}function Lh(a){var e=a.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},s=e.elements[t];!Me(s)||!Pe(s)||(Object.assign(s.style,n),Object.keys(i).forEach(function(r){var c=i[r];c===!1?s.removeAttribute(r):s.setAttribute(r,c===!0?"":c)}))})}function Rh(a){var e=a.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(n){var i=e.elements[n],s=e.attributes[n]||{},r=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:t[n]),c=r.reduce(function(o,l){return o[l]="",o},{});!Me(i)||!Pe(i)||(Object.assign(i.style,c),Object.keys(s).forEach(function(o){i.removeAttribute(o)}))})}}var nc={name:"applyStyles",enabled:!0,phase:"write",fn:Lh,effect:Rh,requires:["computeStyles"]};function Oe(a){return a.split("-")[0]}var ut=Math.max,Ut=Math.min,_t=Math.round;function pa(){var a=navigator.userAgentData;return a!=null&&a.brands?a.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ra(){return!/^((?!chrome|android).)*safari/i.test(pa())}function at(a,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var n=a.getBoundingClientRect(),i=1,s=1;e&&Me(a)&&(i=a.offsetWidth>0&&_t(n.width)/a.offsetWidth||1,s=a.offsetHeight>0&&_t(n.height)/a.offsetHeight||1);var r=tt(a)?be(a):window,c=r.visualViewport,o=!Ra()&&t,l=(n.left+(o&&c?c.offsetLeft:0))/i,d=(n.top+(o&&c?c.offsetTop:0))/s,u=n.width/i,m=n.height/s;return{width:u,height:m,top:d,right:l+u,bottom:d+m,left:l,x:l,y:d}}function Vt(a){var e=at(a),t=a.offsetWidth,n=a.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:a.offsetLeft,y:a.offsetTop,width:t,height:n}}function Ba(a,e){var t=e.getRootNode&&e.getRootNode();if(a.contains(e))return!0;if(t&&fa(t)){var n=e;do{if(n&&a.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function $e(a){return be(a).getComputedStyle(a)}function os(a){return["table","td","th"].indexOf(Pe(a))>=0}function Le(a){return((tt(a)?a.ownerDocument:a.document)||window.document).documentElement}function wt(a){return Pe(a)==="html"?a:a.assignedSlot||a.parentNode||(fa(a)?a.host:null)||Le(a)}function ic(a){return!Me(a)||$e(a).position==="fixed"?null:a.offsetParent}function Bh(a){var e=/firefox/i.test(pa()),t=/Trident/i.test(pa());if(t&&Me(a)){var n=$e(a);if(n.position==="fixed")return null}var i=wt(a);for(fa(i)&&(i=i.host);Me(i)&&["html","body"].indexOf(Pe(i))<0;){var s=$e(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function ht(a){for(var e=be(a),t=ic(a);t&&os(t)&&$e(t).position==="static";)t=ic(t);return t&&(Pe(t)==="html"||Pe(t)==="body"&&$e(t).position==="static")?e:t||Bh(a)||e}function Kt(a){return["top","bottom"].indexOf(a)>=0?"x":"y"}function Yt(a,e,t){return ut(a,Ut(e,t))}function sc(a,e,t){var n=Yt(a,e,t);return n>t?t:n}function Fa(){return{top:0,right:0,bottom:0,left:0}}function za(a){return Object.assign({},Fa(),a)}function $a(a,e){return e.reduce(function(t,n){return t[n]=a,t},{})}var Fh=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,za(typeof e!="number"?e:$a(e,Et))};function zh(a){var e,t=a.state,n=a.name,i=a.options,s=t.elements.arrow,r=t.modifiersData.popperOffsets,c=Oe(t.placement),o=Kt(c),l=[_e,xe].indexOf(c)>=0,d=l?"height":"width";if(!(!s||!r)){var u=Fh(i.padding,t),m=Vt(s),h=o==="y"?ye:_e,b=o==="y"?Ee:xe,f=t.rects.reference[d]+t.rects.reference[o]-r[o]-t.rects.popper[d],k=r[o]-t.rects.reference[o],C=ht(s),w=C?o==="y"?C.clientHeight||0:C.clientWidth||0:0,W=f/2-k/2,E=u[h],y=w-m[d]-u[b],g=w/2-m[d]/2+W,p=Yt(E,g,y),v=o;t.modifiersData[n]=(e={},e[v]=p,e.centerOffset=p-g,e)}}function $h(a){var e=a.state,t=a.options,n=t.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||!Ba(e.elements.popper,i)||(e.elements.arrow=i))}var rc={name:"arrow",enabled:!0,phase:"main",fn:zh,effect:$h,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function nt(a){return a.split("-")[1]}var jh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qh(a){var e=a.x,t=a.y,n=window,i=n.devicePixelRatio||1;return{x:_t(e*i)/i||0,y:_t(t*i)/i||0}}function oc(a){var e,t=a.popper,n=a.popperRect,i=a.placement,s=a.variation,r=a.offsets,c=a.position,o=a.gpuAcceleration,l=a.adaptive,d=a.roundOffsets,u=a.isFixed,m=r.x,h=m===void 0?0:m,b=r.y,f=b===void 0?0:b,k=typeof d=="function"?d({x:h,y:f}):{x:h,y:f};h=k.x,f=k.y;var C=r.hasOwnProperty("x"),w=r.hasOwnProperty("y"),W=_e,E=ye,y=window;if(l){var g=ht(t),p="clientHeight",v="clientWidth";if(g===be(t)&&(g=Le(t),$e(g).position!=="static"&&c==="absolute"&&(p="scrollHeight",v="scrollWidth")),g=g,i===ye||(i===_e||i===xe)&&s===Gt){E=Ee;var M=u&&g===y&&y.visualViewport?y.visualViewport.height:g[p];f-=M-n.height,f*=o?1:-1}if(i===_e||(i===ye||i===Ee)&&s===Gt){W=xe;var N=u&&g===y&&y.visualViewport?y.visualViewport.width:g[v];h-=N-n.width,h*=o?1:-1}}var T=Object.assign({position:c},l&&jh),P=d===!0?qh({x:h,y:f}):{x:h,y:f};if(h=P.x,f=P.y,o){var L;return Object.assign({},T,(L={},L[E]=w?"0":"",L[W]=C?"0":"",L.transform=(y.devicePixelRatio||1)<=1?"translate("+h+"px, "+f+"px)":"translate3d("+h+"px, "+f+"px, 0)",L))}return Object.assign({},T,(e={},e[E]=w?f+"px":"",e[W]=C?h+"px":"",e.transform="",e))}function Gh(a){var e=a.state,t=a.options,n=t.gpuAcceleration,i=n===void 0?!0:n,s=t.adaptive,r=s===void 0?!0:s,c=t.roundOffsets,o=c===void 0?!0:c;if(!1)var l;var d={placement:Oe(e.placement),variation:nt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,oc(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:o})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,oc(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var cc={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Gh,data:{}};var Wn={passive:!0};function Uh(a){var e=a.state,t=a.instance,n=a.options,i=n.scroll,s=i===void 0?!0:i,r=n.resize,c=r===void 0?!0:r,o=be(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach(function(d){d.addEventListener("scroll",t.update,Wn)}),c&&o.addEventListener("resize",t.update,Wn),function(){s&&l.forEach(function(d){d.removeEventListener("scroll",t.update,Wn)}),c&&o.removeEventListener("resize",t.update,Wn)}}var lc={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Uh,data:{}};var Vh={left:"right",right:"left",bottom:"top",top:"bottom"};function ba(a){return a.replace(/left|right|bottom|top/g,function(e){return Vh[e]})}var Kh={start:"end",end:"start"};function Nn(a){return a.replace(/start|end/g,function(e){return Kh[e]})}function Jt(a){var e=be(a),t=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:t,scrollTop:n}}function Xt(a){return at(Le(a)).left+Jt(a).scrollLeft}function cs(a,e){var t=be(a),n=Le(a),i=t.visualViewport,s=n.clientWidth,r=n.clientHeight,c=0,o=0;if(i){s=i.width,r=i.height;var l=Ra();(l||!l&&e==="fixed")&&(c=i.offsetLeft,o=i.offsetTop)}return{width:s,height:r,x:c+Xt(a),y:o}}function ls(a){var e,t=Le(a),n=Jt(a),i=(e=a.ownerDocument)==null?void 0:e.body,s=ut(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),r=ut(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),c=-n.scrollLeft+Xt(a),o=-n.scrollTop;return $e(i||t).direction==="rtl"&&(c+=ut(t.clientWidth,i?i.clientWidth:0)-s),{width:s,height:r,x:c,y:o}}function Zt(a){var e=$e(a),t=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+n)}function Hn(a){return["html","body","#document"].indexOf(Pe(a))>=0?a.ownerDocument.body:Me(a)&&Zt(a)?a:Hn(wt(a))}function Mt(a,e){var t;e===void 0&&(e=[]);var n=Hn(a),i=n===((t=a.ownerDocument)==null?void 0:t.body),s=be(n),r=i?[s].concat(s.visualViewport||[],Zt(n)?n:[]):n,c=e.concat(r);return i?c:c.concat(Mt(wt(r)))}function ka(a){return Object.assign({},a,{left:a.x,top:a.y,right:a.x+a.width,bottom:a.y+a.height})}function Yh(a,e){var t=at(a,!1,e==="fixed");return t.top=t.top+a.clientTop,t.left=t.left+a.clientLeft,t.bottom=t.top+a.clientHeight,t.right=t.left+a.clientWidth,t.width=a.clientWidth,t.height=a.clientHeight,t.x=t.left,t.y=t.top,t}function dc(a,e,t){return e===Pn?ka(cs(a,t)):tt(e)?Yh(e,t):ka(ls(Le(a)))}function Jh(a){var e=Mt(wt(a)),t=["absolute","fixed"].indexOf($e(a).position)>=0,n=t&&Me(a)?ht(a):a;return tt(n)?e.filter(function(i){return tt(i)&&Ba(i,n)&&Pe(i)!=="body"}):[]}function ds(a,e,t,n){var i=e==="clippingParents"?Jh(a):[].concat(e),s=[].concat(i,[t]),r=s[0],c=s.reduce(function(o,l){var d=dc(a,l,n);return o.top=ut(d.top,o.top),o.right=Ut(d.right,o.right),o.bottom=Ut(d.bottom,o.bottom),o.left=ut(d.left,o.left),o},dc(a,r,n));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function ja(a){var e=a.reference,t=a.element,n=a.placement,i=n?Oe(n):null,s=n?nt(n):null,r=e.x+e.width/2-t.width/2,c=e.y+e.height/2-t.height/2,o;switch(i){case ye:o={x:r,y:e.y-t.height};break;case Ee:o={x:r,y:e.y+e.height};break;case xe:o={x:e.x+e.width,y:c};break;case _e:o={x:e.x-t.width,y:c};break;default:o={x:e.x,y:e.y}}var l=i?Kt(i):null;if(l!=null){var d=l==="y"?"height":"width";switch(s){case yt:o[l]=o[l]-(e[d]/2-t[d]/2);break;case Gt:o[l]=o[l]+(e[d]/2-t[d]/2);break;default:}}return o}function mt(a,e){e===void 0&&(e={});var t=e,n=t.placement,i=n===void 0?a.placement:n,s=t.strategy,r=s===void 0?a.strategy:s,c=t.boundary,o=c===void 0?ec:c,l=t.rootBoundary,d=l===void 0?Pn:l,u=t.elementContext,m=u===void 0?ga:u,h=t.altBoundary,b=h===void 0?!1:h,f=t.padding,k=f===void 0?0:f,C=za(typeof k!="number"?k:$a(k,Et)),w=m===ga?tc:ga,W=a.rects.popper,E=a.elements[b?w:m],y=ds(tt(E)?E:E.contextElement||Le(a.elements.popper),o,d,r),g=at(a.elements.reference),p=ja({reference:g,element:W,strategy:"absolute",placement:i}),v=ka(Object.assign({},W,p)),M=m===ga?v:g,N={top:y.top-M.top+C.top,bottom:M.bottom-y.bottom+C.bottom,left:y.left-M.left+C.left,right:M.right-y.right+C.right},T=a.modifiersData.offset;if(m===ga&&T){var P=T[i];Object.keys(N).forEach(function(L){var G=[xe,Ee].indexOf(L)>=0?1:-1,B=[ye,Ee].indexOf(L)>=0?"y":"x";N[L]+=P[B]*G})}return N}function us(a,e){e===void 0&&(e={});var t=e,n=t.placement,i=t.boundary,s=t.rootBoundary,r=t.padding,c=t.flipVariations,o=t.allowedAutoPlacements,l=o===void 0?On:o,d=nt(n),u=d?c?rs:rs.filter(function(b){return nt(b)===d}):Et,m=u.filter(function(b){return l.indexOf(b)>=0});m.length===0&&(m=u);var h=m.reduce(function(b,f){return b[f]=mt(a,{placement:f,boundary:i,rootBoundary:s,padding:r})[Oe(f)],b},{});return Object.keys(h).sort(function(b,f){return h[b]-h[f]})}function Xh(a){if(Oe(a)===In)return[];var e=ba(a);return[Nn(a),e,Nn(e)]}function Zh(a){var e=a.state,t=a.options,n=a.name;if(!e.modifiersData[n]._skip){for(var i=t.mainAxis,s=i===void 0?!0:i,r=t.altAxis,c=r===void 0?!0:r,o=t.fallbackPlacements,l=t.padding,d=t.boundary,u=t.rootBoundary,m=t.altBoundary,h=t.flipVariations,b=h===void 0?!0:h,f=t.allowedAutoPlacements,k=e.options.placement,C=Oe(k),w=C===k,W=o||(w||!b?[ba(k)]:Xh(k)),E=[k].concat(W).reduce(function($,Q){return $.concat(Oe(Q)===In?us(e,{placement:Q,boundary:d,rootBoundary:u,padding:l,flipVariations:b,allowedAutoPlacements:f}):Q)},[]),y=e.rects.reference,g=e.rects.popper,p=new Map,v=!0,M=E[0],N=0;N<E.length;N++){var T=E[N],P=Oe(T),L=nt(T)===yt,G=[ye,Ee].indexOf(P)>=0,B=G?"width":"height",te=mt(e,{placement:T,boundary:d,rootBoundary:u,altBoundary:m,padding:l}),F=G?L?xe:_e:L?Ee:ye;y[B]>g[B]&&(F=ba(F));var fe=ba(F),oe=[];if(s&&oe.push(te[P]<=0),c&&oe.push(te[F]<=0,te[fe]<=0),oe.every(function($){return $})){M=T,v=!1;break}p.set(T,oe)}if(v)for(var he=b?3:1,pe=function(Q){var ce=E.find(function(ne){var ke=p.get(ne);if(ke)return ke.slice(0,Q).every(function(Ge){return Ge})});if(ce)return M=ce,"break"},we=he;we>0;we--){var qe=pe(we);if(qe==="break")break}e.placement!==M&&(e.modifiersData[n]._skip=!0,e.placement=M,e.reset=!0)}}var uc={name:"flip",enabled:!0,phase:"main",fn:Zh,requiresIfExists:["offset"],data:{_skip:!1}};function hc(a,e,t){return t===void 0&&(t={x:0,y:0}),{top:a.top-e.height-t.y,right:a.right-e.width+t.x,bottom:a.bottom-e.height+t.y,left:a.left-e.width-t.x}}function mc(a){return[ye,xe,Ee,_e].some(function(e){return a[e]>=0})}function Qh(a){var e=a.state,t=a.name,n=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,r=mt(e,{elementContext:"reference"}),c=mt(e,{altBoundary:!0}),o=hc(r,n),l=hc(c,i,s),d=mc(o),u=mc(l);e.modifiersData[t]={referenceClippingOffsets:o,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}var gc={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Qh};function em(a,e,t){var n=Oe(a),i=[_e,ye].indexOf(n)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:a})):t,r=s[0],c=s[1];return r=r||0,c=(c||0)*i,[_e,xe].indexOf(n)>=0?{x:c,y:r}:{x:r,y:c}}function tm(a){var e=a.state,t=a.options,n=a.name,i=t.offset,s=i===void 0?[0,0]:i,r=On.reduce(function(d,u){return d[u]=em(u,e.rects,s),d},{}),c=r[e.placement],o=c.x,l=c.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=o,e.modifiersData.popperOffsets.y+=l),e.modifiersData[n]=r}var fc={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:tm};function am(a){var e=a.state,t=a.name;e.modifiersData[t]=ja({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var pc={name:"popperOffsets",enabled:!0,phase:"read",fn:am,data:{}};function hs(a){return a==="x"?"y":"x"}function nm(a){var e=a.state,t=a.options,n=a.name,i=t.mainAxis,s=i===void 0?!0:i,r=t.altAxis,c=r===void 0?!1:r,o=t.boundary,l=t.rootBoundary,d=t.altBoundary,u=t.padding,m=t.tether,h=m===void 0?!0:m,b=t.tetherOffset,f=b===void 0?0:b,k=mt(e,{boundary:o,rootBoundary:l,padding:u,altBoundary:d}),C=Oe(e.placement),w=nt(e.placement),W=!w,E=Kt(C),y=hs(E),g=e.modifiersData.popperOffsets,p=e.rects.reference,v=e.rects.popper,M=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,N=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(!!g){if(s){var L,G=E==="y"?ye:_e,B=E==="y"?Ee:xe,te=E==="y"?"height":"width",F=g[E],fe=F+k[G],oe=F-k[B],he=h?-v[te]/2:0,pe=w===yt?p[te]:v[te],we=w===yt?-v[te]:-p[te],qe=e.elements.arrow,$=h&&qe?Vt(qe):{width:0,height:0},Q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Fa(),ce=Q[G],ne=Q[B],ke=Yt(0,p[te],$[te]),Ge=W?p[te]/2-he-ke-ce-N.mainAxis:pe-ke-ce-N.mainAxis,ya=W?-p[te]/2+he+ke+ne+N.mainAxis:we+ke+ne+N.mainAxis,It=e.elements.arrow&&ht(e.elements.arrow),st=It?E==="y"?It.clientTop||0:It.clientLeft||0:0,Je=(L=T?.[E])!=null?L:0,Pt=F+Ge-Je-st,Ic=F+ya-Je,xs=Yt(h?Ut(fe,Pt):fe,F,h?ut(oe,Ic):oe);g[E]=xs,P[E]=xs-F}if(c){var Ds,Pc=E==="x"?ye:_e,Oc=E==="x"?Ee:xe,Ot=g[y],Ga=y==="y"?"height":"width",Es=Ot+k[Pc],Ms=Ot-k[Oc],Gn=[ye,_e].indexOf(C)!==-1,Is=(Ds=T?.[y])!=null?Ds:0,Ps=Gn?Es:Ot-p[Ga]-v[Ga]-Is+N.altAxis,Os=Gn?Ot+p[Ga]+v[Ga]-Is-N.altAxis:Ms,Ws=h&&Gn?sc(Ps,Ot,Os):Yt(h?Ps:Es,Ot,h?Os:Ms);g[y]=Ws,P[y]=Ws-Ot}e.modifiersData[n]=P}}var bc={name:"preventOverflow",enabled:!0,phase:"main",fn:nm,requiresIfExists:["offset"]};function ms(a){return{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}}function gs(a){return a===be(a)||!Me(a)?Jt(a):ms(a)}function im(a){var e=a.getBoundingClientRect(),t=_t(e.width)/a.offsetWidth||1,n=_t(e.height)/a.offsetHeight||1;return t!==1||n!==1}function fs(a,e,t){t===void 0&&(t=!1);var n=Me(e),i=Me(e)&&im(e),s=Le(e),r=at(a,i,t),c={scrollLeft:0,scrollTop:0},o={x:0,y:0};return(n||!n&&!t)&&((Pe(e)!=="body"||Zt(s))&&(c=gs(e)),Me(e)?(o=at(e,!0),o.x+=e.clientLeft,o.y+=e.clientTop):s&&(o.x=Xt(s))),{x:r.left+c.scrollLeft-o.x,y:r.top+c.scrollTop-o.y,width:r.width,height:r.height}}function sm(a){var e=new Map,t=new Set,n=[];a.forEach(function(s){e.set(s.name,s)});function i(s){t.add(s.name);var r=[].concat(s.requires||[],s.requiresIfExists||[]);r.forEach(function(c){if(!t.has(c)){var o=e.get(c);o&&i(o)}}),n.push(s)}return a.forEach(function(s){t.has(s.name)||i(s)}),n}function ps(a){var e=sm(a);return ac.reduce(function(t,n){return t.concat(e.filter(function(i){return i.phase===n}))},[])}function bs(a){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(a())})})),e}}function ks(a){var e=a.reduce(function(t,n){var i=t[n.name];return t[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,t},{});return Object.keys(e).map(function(t){return e[t]})}var kc={placement:"bottom",modifiers:[],strategy:"absolute"};function vc(){for(var a=arguments.length,e=new Array(a),t=0;t<a;t++)e[t]=arguments[t];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function yc(a){a===void 0&&(a={});var e=a,t=e.defaultModifiers,n=t===void 0?[]:t,i=e.defaultOptions,s=i===void 0?kc:i;return function(c,o,l){l===void 0&&(l=s);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},kc,s),modifiersData:{},elements:{reference:c,popper:o},attributes:{},styles:{}},u=[],m=!1,h={state:d,setOptions:function(C){var w=typeof C=="function"?C(d.options):C;f(),d.options=Object.assign({},s,d.options,w),d.scrollParents={reference:tt(c)?Mt(c):c.contextElement?Mt(c.contextElement):[],popper:Mt(o)};var W=ps(ks([].concat(n,d.options.modifiers)));if(d.orderedModifiers=W.filter(function(T){return T.enabled}),!1){var E;if(getBasePlacement(d.options.placement)===auto)var y;var g,p,v,M,N}return b(),h.update()},forceUpdate:function(){if(!m){var C=d.elements,w=C.reference,W=C.popper;if(!!vc(w,W)){d.rects={reference:fs(w,ht(W),d.options.strategy==="fixed"),popper:Vt(W)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(T){return d.modifiersData[T.name]=Object.assign({},T.data)});for(var E=0,y=0;y<d.orderedModifiers.length;y++){if(d.reset===!0){d.reset=!1,y=-1;continue}var g=d.orderedModifiers[y],p=g.fn,v=g.options,M=v===void 0?{}:v,N=g.name;typeof p=="function"&&(d=p({state:d,options:M,name:N,instance:h})||d)}}}},update:bs(function(){return new Promise(function(k){h.forceUpdate(),k(d)})}),destroy:function(){f(),m=!0}};if(!vc(c,o))return h;h.setOptions(l).then(function(k){!m&&l.onFirstUpdate&&l.onFirstUpdate(k)});function b(){d.orderedModifiers.forEach(function(k){var C=k.name,w=k.options,W=w===void 0?{}:w,E=k.effect;if(typeof E=="function"){var y=E({state:d,name:C,instance:h,options:W}),g=function(){};u.push(y||g)}})}function f(){u.forEach(function(k){return k()}),u=[]}return h}}var rm=[lc,pc,cc,nc,fc,uc,bc,rc,gc],vs=yc({defaultModifiers:rm});var ys=class{constructor(e,t,n){this.containerEl=t,this.owner=e,t.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),t.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),n.register([],"ArrowUp",()=>(this.setSelectedItem(this.selectedItem-1,!0),!1)),n.register([],"ArrowDown",()=>(this.setSelectedItem(this.selectedItem+1,!0),!1)),n.register([],"Enter",i=>(this.useSelectedItem(i),!1)),n.register([],"Tab",i=>(this.chooseSuggestion(i),!1))}chooseSuggestion(e){if(!this.items||!this.items.length)return;let t=this.items[this.selectedItem];t&&this.owner.onChooseSuggestion(t,e)}onSuggestionClick(e,t){if(e.preventDefault(),!this.suggestions||!this.suggestions.length)return;let n=this.suggestions.indexOf(t);this.setSelectedItem(n,!1),this.useSelectedItem(e)}onSuggestionMouseover(e,t){if(!this.suggestions||!this.suggestions.length)return;let n=this.suggestions.indexOf(t);this.setSelectedItem(n,!1)}empty(){this.containerEl.empty()}setSuggestions(e){this.containerEl.empty();let t=[];e.forEach(n=>{let i=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(n,i),t.push(i)}),this.items=e,this.suggestions=t,this.setSelectedItem(0,!1)}useSelectedItem(e){if(!this.items||!this.items.length)return;let t=this.items[this.selectedItem];t&&this.owner.selectSuggestion(t,e)}wrap(e,t){return(e%t+t)%t}setSelectedItem(e,t){let n=this.wrap(e,this.suggestions.length),i=this.suggestions[this.selectedItem],s=this.suggestions[n];i&&i.removeClass("is-selected"),s&&s.addClass("is-selected"),this.selectedItem=n,t&&s&&s.scrollIntoView(!1)}},Ln=class extends Rn.FuzzySuggestModal{constructor(t,n,i){super(t);this.items=[];this.scope=new Rn.Scope;this.emptyStateText="No match found";this.limit=100;this.inputEl=n,this.items=i,this.suggestEl=createDiv("suggestion-container"),this.contentEl=this.suggestEl.createDiv("suggestion"),this.suggester=new ys(this,this.contentEl,this.scope),this.scope.register([],"Escape",this.onEscape.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onFocus.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",s=>{s.preventDefault()})}empty(){this.suggester.empty()}onInputChanged(){if(this.shouldNotOpen)return;let t=this.modifyInput(this.inputEl.value),n=this.getSuggestions(t);n.length>0?this.suggester.setSuggestions(n.slice(0,this.limit)):this.onNoSuggestion(),this.open()}onFocus(){this.shouldNotOpen=!1,this.onInputChanged()}modifyInput(t){return t}onNoSuggestion(){this.empty(),this.renderSuggestion(null,this.contentEl.createDiv("suggestion-item"))}open(){this.app.keymap.pushScope(this.scope),document.body.appendChild(this.suggestEl),this.popper=vs(this.inputEl,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"flip",options:{fallbackPlacements:["top"]}}]})}onEscape(){this.close(),this.shouldNotOpen=!0}close(){this.app.keymap.popScope(this.scope),this.suggester.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}createPrompt(t){this.promptEl||(this.promptEl=this.suggestEl.createDiv("prompt-instructions"));let n=this.promptEl.createDiv("prompt-instruction");for(let i of t)n.appendChild(i)}};var Bn=class extends Ln{constructor(t,n,i){super(t,n.inputEl,i);this.folders=[...i],this.text=n,this.inputEl.addEventListener("input",()=>this.getFolder())}getFolder(){let t=this.inputEl.value,n=this.app.vault.getAbstractFileByPath(t);n!=this.folder&&n instanceof _c.TFolder&&(this.folder=n,this.onInputChanged())}getItemText(t){return t.path}onChooseItem(t){this.text.setValue(t.path),this.folder=t}selectSuggestion({item:t}){let n=t.path;this.text.setValue(n),this.onClose(),this.close()}renderSuggestion(t,n){let{item:i,match:s}=t||{},r=n.createDiv({cls:"suggestion-content"});if(!i){r.setText(this.emptyStateText),r.parentElement.addClass("is-selected");return}let c=i.path.length-i.name.length,o=s.matches.map(l=>createSpan("suggestion-highlight"));for(let l=c;l<i.path.length;l++){let d=s.matches.find(u=>u[0]===l);if(d){let u=o[s.matches.indexOf(d)];r.appendChild(u),u.appendText(i.path.substring(d[0],d[1])),l+=d[1]-d[0]-1;continue}r.appendText(i.path[l])}n.createDiv({cls:"suggestion-note",text:i.path})}getItems(){return this.folders}};var om=[{type:"inline",id:z(),properties:[],hasRule:!0,nested:[{type:"group",id:z(),properties:["name","description","aspects","temporaryAspects"],nested:[{type:"heading",id:z(),properties:["name"],conditioned:!0,size:1},{type:"text",id:z(),properties:["description"],conditioned:!0,markdown:!0,text:null,dice:!1},{type:"text",id:z(),properties:["aspects"],markdown:!0,text:null,dice:!1,conditioned:!0,heading:"Aspects"},{type:"text",id:z(),properties:["temporaryAspects"],markdown:!0,text:null,dice:!1,conditioned:!0,heading:"Temporary Aspects"}],conditioned:!0},{type:"image",id:z(),properties:["image"],conditioned:!0}]},{type:"table",id:z(),properties:["stress"],headers:["Physical","Mental"],calculate:!1,hasRule:!0,conditioned:!0},{type:"traits",id:z(),properties:["consequences"],conditioned:!0,heading:"Consequences"},{type:"traits",id:z(),properties:["skills"],conditioned:!0,hasRule:!1,heading:"Skills"},{type:"traits",id:z(),properties:["stunts"],markdown:!0,dice:!1,conditioned:!0,heading:"Stunts"},{type:"traits",id:z(),properties:["items"],heading:"Items",conditioned:!0,markdown:!0,dice:!1},{type:"traits",id:z(),properties:["extras"],heading:"Extras",conditioned:!0,markdown:!0,dice:!1}],wc={blocks:om,name:"Basic Fate Core Layout"};var Fn=[bt,wc];var qa=class extends V.PluginSettingTab{constructor(t,n){super(t,n);this.plugin=n;this.results=[];this.displayed=new Set(this.plugin.sources);this.importer=new La(this.plugin)}async display(){try{let{containerEl:t}=this;t.empty(),t.addClass("statblock-settings"),t.createEl("h2",{text:"TTRPG Statblock Settings"}),this.generateTopSettings(t.createDiv()),this.generateParseSettings(t.createDiv()),this.generateLayouts(t.createDiv()),this.generateImports(t.createDiv()),this.generateMonsters(t.createDiv()),t.createDiv("coffee").createEl("a",{href:"https://www.buymeacoffee.com/valentine195"}).createEl("img",{attr:{src:"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=\u2615&slug=valentine195&button_colour=e3e7ef&font_colour=262626&font_family=Inter&outline_colour=262626&coffee_colour=ff0000"}})}catch(t){console.error(t),new V.Notice("There was an error displaying the settings tab for 5e Statblocks.")}}generateTopSettings(t){t.empty(),new V.Setting(t).setHeading().setName("General Settings"),new V.Setting(t).setName("Enable Export to PNG").setDesc(createFragment(n=>{n.createSpan({text:'Add "Export to PNG" button by default. Use '}),n.createEl("code",{text:"export: false"}),n.createSpan({text:" to disable per-statblock."})})).setDisabled(!this.plugin.canUseDiceRoller).addToggle(n=>n.setValue(this.plugin.settings.useDice).onChange(async i=>{this.plugin.settings.useDice=i,await this.plugin.saveSettings()})),new V.Setting(t).setName("Integrate Dice Roller").setDesc(createFragment(n=>{this.plugin.canUseDiceRoller?(n.createSpan({text:"Add Dice Roller dice to statblocks by default. Use "}),n.createEl("code",{text:"dice: false"}),n.createSpan({text:" to disable per-statblock."})):n.createSpan({text:"This setting is only usable with the Dice Roller plugin enabled."})})).setDisabled(!this.plugin.canUseDiceRoller).addToggle(n=>n.setValue(this.plugin.settings.useDice).onChange(async i=>{this.plugin.settings.useDice=i,await this.plugin.saveSettings()})),new V.Setting(t).setName("Render Dice Rolls").setDesc(createFragment(n=>{this.plugin.canUseDiceRoller?(n.createSpan({text:"Roll graphical dice inside statblocks by default. Use "}),n.createEl("code",{text:"render: false"}),n.createSpan({text:" to disable per-statblock."})):n.createSpan({text:"This setting is only usable with the Dice Roller plugin enabled."})})).setDisabled(!this.plugin.canUseDiceRoller).addToggle(n=>n.setValue(this.plugin.settings.renderDice).onChange(async i=>{this.plugin.settings.renderDice=i,await this.plugin.saveSettings()})),new V.Setting(t).setName("Try to Render Wikilinks").setDesc(createFragment(n=>{n.createSpan({text:"The plugin will attempt to detect wikilinks inside Statblocks."}),n.createEl("br"),n.createEl("strong",{text:"Please note: these links will not be added to the graph."})})).addToggle(n=>n.setValue(this.plugin.settings.tryToRenderLinks).onChange(async i=>{this.plugin.settings.tryToRenderLinks=i,await this.plugin.saveSettings()})),new V.Setting(t).setName("Disable 5e SRD").setDesc(createFragment(n=>{n.createSpan({text:"Disable the Dungeons & Dragons 5th Edition System Reference Document monsters."})})).addToggle(n=>n.setValue(this.plugin.settings.disableSRD).onChange(async i=>{this.plugin.settings.disableSRD=i,await this.plugin.saveSettings()}))}generateParseSettings(t){t.empty();let n=t.createDiv("statblock-additional-container");new V.Setting(n).setHeading().setName("Note Parsing"),new V.Setting(n).setName("Parse Frontmatter for Creatures").setDesc(createFragment(r=>{r.createSpan({text:"The plugin will watch the vault for creatures defined in note frontmatter."}),r.createEl("br"),r.createEl("br"),r.createSpan({text:'The "Parse Frontmatter for Creatures" command can also be used.'})})).addToggle(r=>{r.setValue(this.plugin.settings.autoParse).onChange(async c=>{this.plugin.settings.autoParse=c,c&&this.plugin.watcher.start(),await this.plugin.saveSettings()})}),new V.Setting(n).setName("Enable Debug Messages").setDesc(createFragment(r=>{r.createSpan({text:"Debug messages will be displayed by the file parser."})})).addToggle(r=>r.setValue(this.plugin.settings.debug).onChange(async c=>{this.plugin.settings.debug=c,this.plugin.watcher.setDebug(),await this.plugin.saveSettings()}));let i;new V.Setting(n).setName("Bestiary Folder").setDesc("The plugin will only parse notes inside these folders and their children.").addText(async r=>{let c=this.app.vault.getAllLoadedFiles().filter(l=>l instanceof V.TFolder&&!this.plugin.settings.paths.includes(l.path));r.setPlaceholder("/");let o=new Bn(this.app,r,[...c]);o.onClose=async()=>{let l=r.inputEl.value?.trim()?r.inputEl.value.trim():"/";i=(0,V.normalizePath)(l)},r.inputEl.onblur=async()=>{let l=r.inputEl.value?.trim()?r.inputEl.value.trim():"/";i=(0,V.normalizePath)(l)}}).addExtraButton(r=>{r.setIcon("plus-with-circle").onClick(async()=>{!i||!i.length||(this.plugin.settings.paths.push((0,V.normalizePath)(i)),await this.plugin.saveSettings(),await this.plugin.watcher.reparseVault(),await this.generateParseSettings(t))})});let s=n.createDiv("additional");for(let r of this.plugin.settings.paths)new V.Setting(s).setName(r).addExtraButton(c=>c.setIcon("trash").onClick(async()=>{this.plugin.settings.paths=this.plugin.settings.paths.filter(o=>o!=r),await this.plugin.saveSettings(),await this.plugin.watcher.reparseVault(),await this.generateParseSettings(t)}))}generateLayouts(t){t.empty(),new V.Setting(t).setHeading().setName("Layouts");let n=t.createDiv("statblock-additional-container");n.createDiv("setting-item").createDiv().appendChild(createFragment(o=>{o.createSpan({text:"New statblock layouts can be created and managed here. A specific statblock can be used for a creature using the "}),o.createEl("code",{text:"statblock"}),o.createSpan({text:" parameter."})}));let i=new V.Setting(n).setName("Import From JSON").setDesc("Import a custom layout from a JSON file."),s=createEl("input",{attr:{type:"file",name:"layout",accept:".json",multiple:!0}});s.onchange=async()=>{let{files:o}=s;if(!!o.length)try{let{files:l}=s;if(!l.length)return;for(let d of Array.from(l))await new Promise((u,m)=>{let h=new FileReader;h.onload=b=>{try{let f=JSON.parse(b.target.result);if(!f){m(new Error("Invalid layout imported"));return}if(!f?.name){m(new Error("Invalid layout imported: layout does not have a name"));return}if(!f?.blocks){m(new Error("Invalid layout imported: no blocks defined in layout."));return}this.plugin.settings.layouts.push(this.getDuplicate(f)),u()}catch(f){m(f)}},h.readAsText(d)}).catch(u=>{new V.Notice(`There was an error importing the layout:
|
||
|
||
${u}`),console.error(u)});await this.plugin.saveSettings(),this.buildCustomLayouts(c)}catch{}},i.addButton(o=>{o.setIcon("upload"),o.buttonEl.addClass("statblock-file-upload"),o.buttonEl.appendChild(s),o.onClick(()=>s.click())}),new V.Setting(n).setName("Add New Layout").addButton(o=>o.setIcon("plus-with-circle").setTooltip("Add New Statblock").onClick(()=>{let l=new zn(this.plugin);l.onClose=async()=>{!l.saved||(this.plugin.settings.layouts.push(this.getDuplicate(l.layout)),await this.plugin.saveSettings(),this.buildCustomLayouts(c))},l.open()}));let r=n.createDiv("additional");new V.Setting(r).setName("Default Layout").setDesc("Change the default statblock layout used, if not specified.").addDropdown(async o=>{for(let l of this.plugin.layouts)o.addOption(l.name,l.name);(!this.plugin.settings.default||!this.plugin.layouts.find(({name:l})=>l==this.plugin.settings.default))&&(this.plugin.settings.default=bt.name,await this.plugin.saveSettings()),o.setValue(this.plugin.settings.default??bt.name),o.onChange(async l=>{this.plugin.settings.default=l,await this.plugin.saveSettings()})}),new V.Setting(r).setName("Show Advanced Options").setDesc("Show advanced options when editing layout blocks.").addToggle(o=>o.setValue(this.plugin.settings.showAdvanced).onChange(async l=>{this.plugin.settings.showAdvanced=l,await this.plugin.saveSettings()}));let c=n.createDiv("additional");this.buildCustomLayouts(c)}getDuplicate(t){if(!this.plugin.layouts.find(c=>c.name==t.name)&&t.name!=bt.name)return t;let n=this.plugin.layouts.filter(c=>c.name.contains(`${t.name} Copy`)).map(c=>c.name),i=`${t.name} Copy`,s=i,r=1;for(;n.includes(s);)s=`${i} (${r})`,r++;return{blocks:(0,ws.default)(t.blocks),name:s}}buildCustomLayouts(t){t.empty();for(let n of Fn)new V.Setting(t).setName(n.name).addExtraButton(i=>{i.setIcon("duplicate-glyph").setTooltip("Create Copy").onClick(async()=>{this.plugin.settings.layouts.push(this.getDuplicate(n)),await this.plugin.saveSettings(),this.buildCustomLayouts(t)})});for(let n of this.plugin.settings.layouts)new V.Setting(t).setName(n.name).addExtraButton(i=>{i.setIcon("pencil").setTooltip("Edit").onClick(()=>{let s=new zn(this.plugin,n);s.onClose=async()=>{!s.saved||(this.plugin.settings.layouts.splice(this.plugin.settings.layouts.indexOf(n),1,s.layout),await this.plugin.saveSettings(),this.buildCustomLayouts(t))},s.open()})}).addExtraButton(i=>{i.setIcon("duplicate-glyph").setTooltip("Create Copy").onClick(async()=>{this.plugin.settings.layouts.push(this.getDuplicate(n)),await this.plugin.saveSettings(),this.buildCustomLayouts(t)})}).addExtraButton(i=>{i.setIcon("import-glyph").setTooltip("Export as JSON").onClick(()=>{let s=createEl("a"),r=new Blob([JSON.stringify(n)],{type:"json"}),c=URL.createObjectURL(r);s.href=c,s.download=`${n.name}.json`,s.click(),URL.revokeObjectURL(c)})}).addExtraButton(i=>{i.setIcon("trash").setTooltip("Delete").onClick(async()=>{this.plugin.settings.layouts=this.plugin.settings.layouts.filter(s=>s.name!==n.name),await this.plugin.saveSettings(),this.buildCustomLayouts(t)})})}generateImports(t){t.empty(),new V.Setting(t).setHeading().setName("Import Homebrew Creatures");let n=t.createDiv("statblock-additional-container");new V.Setting(n).setDesc("Import creatures from creature files. Monsters are stored by name, so only the last creature by that name will be saved. This is destructive - any saved creature will be overwritten.");let i=n.createDiv("additional"),s=new V.Setting(i).setName("Import DnDAppFile").setDesc("Only import content that you own."),r=createEl("input",{attr:{type:"file",name:"dndappfile",accept:".xml",multiple:!0}});r.onchange=async()=>{let{files:f}=r;if(!!f.length)try{let{files:k}=r;if(!k.length)return;let C=await this.importer.import(k,"appfile");C&&C.length&&await this.plugin.saveMonsters(C),this.display()}catch{}},s.addButton(f=>{f.setButtonText("Choose File(s)").setTooltip("Import DnDAppFile Data"),f.buttonEl.addClass("statblock-file-upload"),f.buttonEl.appendChild(r),f.onClick(()=>r.click())});let c=new V.Setting(i).setName("Import Improved Initiative Data").setDesc("Only import content that you own."),o=createEl("input",{attr:{type:"file",name:"improvedinitiative",accept:".json",multiple:!0}});o.onchange=async()=>{let{files:f}=o;if(!!f.length)try{let{files:k}=o;if(!k.length)return;let C=await this.importer.import(k,"improved");C&&C.length&&await this.plugin.saveMonsters(C),this.display()}catch{}},c.addButton(f=>{f.setButtonText("Choose File(s)").setTooltip("Import Improved Initiative Data"),f.buttonEl.addClass("statblock-file-upload"),f.buttonEl.appendChild(o),f.onClick(()=>o.click())});let l=new V.Setting(i).setName("Import CritterDB Data").setDesc("Only import content that you own."),d=createEl("input",{attr:{type:"file",name:"critterdb",accept:".json",multiple:!0}});d.onchange=async()=>{let{files:f}=d;if(!!f.length)try{let{files:k}=d;if(!k.length)return;let C=await this.importer.import(k,"critter");C&&C.length&&await this.plugin.saveMonsters(C),this.display()}catch{}},l.addButton(f=>{f.setButtonText("Choose File(s)").setTooltip("Import CritterDB Data"),f.buttonEl.addClass("statblock-file-upload"),f.buttonEl.appendChild(d),f.onClick(()=>d.click())});let u=new V.Setting(i).setName("Import 5e.tools Data").setDesc("Only import content that you own."),m=createEl("input",{attr:{type:"file",name:"fivetools",accept:".json",multiple:!0}});m.onchange=async()=>{let{files:f}=m;if(!f.length)return;let k=await this.importer.import(f,"5e");k&&k.length&&await this.plugin.saveMonsters(k),this.display()},u.addButton(f=>{f.setButtonText("Choose File(s)").setTooltip("Import 5e.tools Data"),f.buttonEl.addClass("statblock-file-upload"),f.buttonEl.appendChild(m),f.onClick(()=>m.click())});let h=new V.Setting(i).setName("Import TetraCube Data").setDesc("Only import content that you own."),b=createEl("input",{attr:{type:"file",name:"tetra",accept:".json, .monster",multiple:!0}});b.onchange=async()=>{let{files:f}=b;if(!f.length)return;let k=await this.importer.import(f,"tetra");k&&k.length&&await this.plugin.saveMonsters(k),this.display()},h.addButton(f=>{f.setButtonText("Choose File(s)").setTooltip("Import TetraCube Data"),f.buttonEl.addClass("statblock-file-upload"),f.buttonEl.appendChild(b),f.onClick(()=>b.click())})}generateMonsters(t){t.empty(),new V.Setting(t).setHeading().setName("Homebrew Creatures");let n=t.createDiv("statblock-additional-container statblock-monsters");new V.Setting(n).setName("Add Creature").addButton(u=>{u.setIcon("plus-with-circle").onClick(()=>{let m=new ma(this.plugin);m.onClose=()=>{this.generateMonsters(t)},m.open()})});let i=this.containerEl.closest(".statblock-settings"),{backgroundColor:s,paddingTop:r}=getComputedStyle(i),c=n.createDiv({cls:"statblock-monster-filter",attr:{style:`--statblock-filter-offset: ${r}; --statblock-filter-bg: ${s}`}});this.filter=new V.Setting(c).setClass("statblock-filter-container").addSearch(u=>{u.setPlaceholder("Search Monsters").onChange((0,V.debounce)(m=>{this.showSearchResults(d,m)},100))}).addExtraButton(u=>{u.setIcon("trash").setTooltip("Delete All Filtered Monsters").onClick(()=>{let m=new _s(this.results.length,this.plugin.app);m.onClose=async()=>{m.saved&&(await this.plugin.deleteMonsters(...this.results?.map(h=>h.name)??[]),this.generateMonsters(t))},m.open()})}),this.setFilterDesc();let o=c.createEl("details");o.createEl("summary",{text:"Filter Sources"});let l=o.createEl("ul","contains-task-list task-list-inline markdown-preview-view");for(let u of this.plugin.sources){let m=l.createEl("li","task-list-item");m.createEl("input",{attr:{id:"input_"+u,checked:!0},type:"checkbox",cls:"task-list-item-checkbox"}).onclick=h=>{h.target.checked?this.displayed.add(u):this.displayed.delete(u),this.showSearchResults(d,"")},m.createEl("label",{attr:{for:"input_"+u},text:u})}let d=n.createDiv("additional");if(!this.plugin.data.size){d.createDiv({attr:{style:"display: flex; justify-content: center; padding-bottom: 18px;"}}).createSpan({text:"No saved creatures! Create one to see it here."});return}setTimeout(()=>this.showSearchResults(d,""))}setFilterDesc(){this.filter.setDesc(createFragment(t=>{t.createSpan({text:`Managing ${this.plugin.settings.monsters.length} homebrew creature${this.plugin.settings.monsters.length==1?"":"s"}.`}),t.createEl("p",{attr:{style:"margin: 0;"}}).createEl("small",{text:`Displaying: ${this.results.length} homebrew creatures.`})}))}showSearchResults(t,n){t.empty();for(let i of this.performFuzzySearch(n)){let s=new V.Setting(t).setName(i.name),r,c=!1;if(Array.isArray(i.source)){let o=i.source.slice(0,4);i.source.length>4&&(o.push(`and ${i.source.length-4} more`),c=!0),r=Z(o,0,", ",!1)}else r=i.source;s.setDesc(r),c&&s.descEl.setAttr("aria-label",Z(i.source,0,", ",!1)),s.addExtraButton(o=>{o.setIcon("info").setTooltip("View").onClick(()=>{new Mn(this.plugin,i).open()})}).addExtraButton(o=>{o.setIcon("pencil").setTooltip("Edit").onClick(()=>{let l=new ma(this.plugin,i);l.open(),l.onClose=()=>{this.showSearchResults(t,n)}})}).addExtraButton(o=>{o.setIcon("trash").setTooltip("Delete").onClick(async()=>{await this.plugin.deleteMonster(i.name),this.showSearchResults(t,n)})})}this.setFilterDesc()}performFuzzySearch(t){let n=[];for(let i of this.plugin.sorted){if(!i.name&&!i.source||typeof i.source=="string"&&!this.displayed.has(i.source)||Array.isArray(i.source)&&!i.source.find(c=>this.displayed.has(c)))continue;let s=(0,V.prepareSimpleSearch)(t),r=s(i.name);!r&&i.source!=null&&(r=s(Z(i.source))),r&&n.push(i)}return this.results=n.slice(0,100),this.results}},zn=class extends V.Modal{constructor(t,n={name:"Layout",blocks:[]}){super(t.app);this.plugin=t;this.saved=!1;this.layout=(0,ws.default)(n)}onOpen(){this.display()}display(){this.titleEl.createSpan({text:"Create Layout"}),this.creator=new Xo({target:this.contentEl,props:{layout:this.layout,plugin:this.plugin}}),this.creator.$on("saved",()=>{this.saved=!0,this.close()}),this.creator.$on("cancel",()=>{this.close()})}},_s=class extends V.Modal{constructor(t,n){super(n);this.filtered=t;this.saved=!1}onOpen(){this.titleEl.setText("Are you sure?"),this.contentEl.createEl("p",{text:`This will delete ${this.filtered} creatures. This cannot be undone.`}),new V.Setting(this.contentEl).setClass("no-border-top").addButton(t=>{t.setIcon("checkmark").setCta().onClick(()=>{this.saved=!0,this.close()})}).addExtraButton(t=>t.setIcon("cross").onClick(()=>{this.saved=!0,this.close()}))}};var Ss=_a(xa());var Tc=function(a){return function(e,t,n){return a(e,t,n)*n}},As=function(a,e){if(a)throw Error("Invalid sort config: "+e)},Ac=function(a){var e=a||{},t=e.asc,n=e.desc,i=t?1:-1,s=t||n;As(!s,"Expected `asc` or `desc` property"),As(t&&n,"Ambiguous object with `asc` and `desc` config properties");var r=a.comparer&&Tc(a.comparer);return{order:i,sortBy:s,comparer:r}},cm=function(a){return function e(t,n,i,s,r,c,o){var l,d;if(typeof t=="string")l=c[t],d=o[t];else if(typeof t=="function")l=t(c),d=t(o);else{var u=Ac(t);return e(u.sortBy,n,i,u.order,u.comparer||a,c,o)}var m=r(l,d,s);return(m===0||l==null&&d==null)&&n.length>i?e(n[i],n,i+1,s,r,c,o):m}};function Cc(a,e,t){if(a===void 0||a===!0)return function(s,r){return e(s,r,t)};if(typeof a=="string")return As(a.includes("."),"String syntax not allowed for nested properties."),function(s,r){return e(s[a],r[a],t)};if(typeof a=="function")return function(s,r){return e(a(s),a(r),t)};if(Array.isArray(a)){var n=cm(e);return function(s,r){return n(a[0],a,1,t,e,s,r)}}var i=Ac(a);return Cc(i.sortBy,i.comparer||e,i.order)}var Ts=function(a,e,t,n){var i;return Array.isArray(e)?(Array.isArray(t)&&t.length<2&&(i=t,t=i[0]),e.sort(Cc(t,n,a))):e};function Sc(a){var e=Tc(a.comparer);return function(t){var n=Array.isArray(t)&&!a.inPlaceSorting?t.slice():t;return{asc:function(i){return Ts(1,n,i,e)},desc:function(i){return Ts(-1,n,i,e)},by:function(i){return Ts(1,n,i,e)}}}}var xc=function(a,e,t){return a==null?t:e==null?-t:a<e?-1:a>e?1:0},va=Sc({comparer:xc}),ev=Sc({comparer:xc,inPlaceSorting:!0});var it=require("obsidian");function Cs(){return Ha('var Nn=Object.create;var xt=Object.defineProperty;var On=Object.getOwnPropertyDescriptor;var An=Object.getOwnPropertyNames;var En=Object.getPrototypeOf,Ln=Object.prototype.hasOwnProperty;var In=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),bs=(s,e)=>{for(var t in e)xt(s,t,{get:e[t],enumerable:!0})},Tn=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of An(e))!Ln.call(s,i)&&i!==t&&xt(s,i,{get:()=>e[i],enumerable:!(n=On(e,i))||n.enumerable});return s};var Cn=(s,e,t)=>(t=s!=null?Nn(En(s)):{},Tn(e||!s||!s.__esModule?xt(t,"default",{value:s,enumerable:!0}):t,s));var ws=In((Ut,Vt)=>{(function(s,e){typeof Ut=="object"&&typeof Vt!="undefined"?Vt.exports=e():typeof define=="function"&&define.amd?define(e):(s=typeof globalThis!="undefined"?globalThis:s||self,s["fast-copy"]=e())})(Ut,function(){"use strict";var s=Function.prototype.toString,e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,o=Object.getPrototypeOf,a=Object.prototype,l=a.hasOwnProperty,c=a.propertyIsEnumerable,u=typeof r=="function",f=typeof WeakMap=="function",h=function(){if(f)return function(){return new WeakMap};var y=function(){function m(){this._keys=[],this._values=[]}return m.prototype.has=function(L){return!!~this._keys.indexOf(L)},m.prototype.get=function(L){return this._values[this._keys.indexOf(L)]},m.prototype.set=function(L,E){this._keys.push(L),this._values.push(E)},m}();return function(){return new y}}(),d=function(y,m){var L=y.__proto__||o(y);if(!L)return e(null);var E=L.constructor;if(E===m.Object)return L===m.Object.prototype?{}:e(L);if(~s.call(E).indexOf("[native code]"))try{return new E}catch(_){}return e(L)},w=function(y,m,L,E){var _=d(y,m);E.set(y,_);for(var B in y)l.call(y,B)&&(_[B]=L(y[B],E));if(u)for(var S=r(y),D=0,q=S.length,$=void 0;D<q;++D)$=S[D],c.call(y,$)&&(_[$]=L(y[$],E));return _},p=function(y,m,L,E){var _=d(y,m);E.set(y,_);for(var B=u?i(y).concat(r(y)):i(y),S=0,D=B.length,q=void 0,$=void 0;S<D;++S)if(q=B[S],q!=="callee"&&q!=="caller")if($=n(y,q),$){!$.get&&!$.set&&($.value=L(y[q],E));try{t(_,q,$)}catch(P){_[q]=$.value}}else _[q]=L(y[q],E);return _},g=function(y){var m="";return y.global&&(m+="g"),y.ignoreCase&&(m+="i"),y.multiline&&(m+="m"),y.unicode&&(m+="u"),y.sticky&&(m+="y"),m},k=Array.isArray,b=Object.getPrototypeOf,O=function(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:(console&&console.error&&console.error(\'Unable to locate global object, returning "this".\'),this)}();function A(y,m){var L=!!(m&&m.isStrict),E=m&&m.realm||O,_=L?p:w,B=function(S,D){if(!S||typeof S!="object")return S;if(D.has(S))return D.get(S);var q=S.__proto__||b(S),$=q&&q.constructor;if(!$||$===E.Object)return _(S,E,B,D);var P;if(k(S)){if(L)return p(S,E,B,D);P=new $,D.set(S,P);for(var ot=0,Sn=S.length;ot<Sn;++ot)P[ot]=B(S[ot],D);return P}if(S instanceof E.Date)return new $(S.getTime());if(S instanceof E.RegExp)return P=new $(S.source,S.flags||g(S)),P.lastIndex=S.lastIndex,P;if(E.Map&&S instanceof E.Map)return P=new $,D.set(S,P),S.forEach(function(Rt,kn){P.set(kn,B(Rt,D))}),P;if(E.Set&&S instanceof E.Set)return P=new $,D.set(S,P),S.forEach(function(Rt){P.add(B(Rt,D))}),P;if(E.Blob&&S instanceof E.Blob)return S.slice(0,S.size,S.type);if(E.Buffer&&E.Buffer.isBuffer(S))return P=E.Buffer.allocUnsafe?E.Buffer.allocUnsafe(S.length):new $(S.length),D.set(S,P),S.copy(P),P;if(E.ArrayBuffer){if(E.ArrayBuffer.isView(S))return P=new $(S.buffer.slice(0)),D.set(S,P),P;if(S instanceof E.ArrayBuffer)return P=S.slice(0),D.set(S,P),P}return typeof S.then=="function"||S instanceof Error||E.WeakMap&&S instanceof E.WeakMap||E.WeakSet&&S instanceof E.WeakSet?S:_(S,E,B,D)};return B(y,h())}return A.default=A,A.strict=function(m,L){return A(m,{isStrict:!0,realm:L?L.realm:void 0})},A})});var wn=Cn(ws());var xe=(s,e=0)=>{let t=[];if(e==5||!s||s==null)return"";if(typeof s=="string")return s;if(typeof s=="number")return`${s}`;if(Array.isArray(s))t.push(`${s.map(n=>xe(n,e++)).join(" ")}`);else if(typeof s=="object")for(let[n,i]of Object.entries(s))t.push(xe(n,e++),xe(i,e++));return t.join(" ")};function Ie(s=[],e=[]){s||(s=[]),Array.isArray(s)||(s=[s]),e||(e=[]),Array.isArray(e)||(e=[e]);for(let t of e!=null?e:[])if(t)if(Array.isArray(t)){let n=xe(t.slice(1));s=s.filter(i=>i.name!=t[0]&&i.desc!=n),s.push({name:t[0],desc:n})}else typeof t=="object"&&("name"in t||"desc"in t)&&(s=s.filter(n=>n.name!=t.name||n.desc!=t.desc),s.push({name:t.name,desc:xe(t.desc)}));return s}var gs={};bs(gs,{Alias:()=>ae,CST:()=>hs,Composer:()=>Ee,Document:()=>z,Lexer:()=>qe,LineCounter:()=>Ke,Pair:()=>v,Parser:()=>Le,Scalar:()=>N,Schema:()=>ke,YAMLError:()=>De,YAMLMap:()=>j,YAMLParseError:()=>Y,YAMLSeq:()=>x,YAMLWarning:()=>je,isAlias:()=>G,isCollection:()=>M,isDocument:()=>ge,isMap:()=>V,isNode:()=>C,isPair:()=>T,isScalar:()=>I,isSeq:()=>Q,parse:()=>gn,parseAllDocuments:()=>mn,parseDocument:()=>ms,stringify:()=>yn,visit:()=>H,visitAsync:()=>Ue});var at=Symbol.for("yaml.alias"),lt=Symbol.for("yaml.document"),ee=Symbol.for("yaml.map"),Jt=Symbol.for("yaml.pair"),W=Symbol.for("yaml.scalar"),fe=Symbol.for("yaml.seq"),U=Symbol.for("yaml.node.type"),G=s=>!!s&&typeof s=="object"&&s[U]===at,ge=s=>!!s&&typeof s=="object"&&s[U]===lt,V=s=>!!s&&typeof s=="object"&&s[U]===ee,T=s=>!!s&&typeof s=="object"&&s[U]===Jt,I=s=>!!s&&typeof s=="object"&&s[U]===W,Q=s=>!!s&&typeof s=="object"&&s[U]===fe;function M(s){if(s&&typeof s=="object")switch(s[U]){case ee:case fe:return!0}return!1}function C(s){if(s&&typeof s=="object")switch(s[U]){case at:case ee:case W:case fe:return!0}return!1}var Ss=s=>(I(s)||M(s))&&!!s.anchor,me=class{constructor(e){Object.defineProperty(this,U,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}};var J=Symbol("break visit"),ks=Symbol("skip children"),oe=Symbol("remove node");function H(s,e){let t=Ns(e);ge(s)?Te(null,s.contents,t,Object.freeze([s]))===oe&&(s.contents=null):Te(null,s,t,Object.freeze([]))}H.BREAK=J;H.SKIP=ks;H.REMOVE=oe;function Te(s,e,t,n){let i=Os(s,e,t,n);if(C(i)||T(i))return As(s,n,i),Te(s,i,t,n);if(typeof i!="symbol"){if(M(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=Te(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===J)return J;o===oe&&(e.items.splice(r,1),r-=1)}}}else if(T(e)){n=Object.freeze(n.concat(e));let r=Te("key",e.key,t,n);if(r===J)return J;r===oe&&(e.key=null);let o=Te("value",e.value,t,n);if(o===J)return J;o===oe&&(e.value=null)}}return i}async function Ue(s,e){let t=Ns(e);ge(s)?await Ce(null,s.contents,t,Object.freeze([s]))===oe&&(s.contents=null):await Ce(null,s,t,Object.freeze([]))}Ue.BREAK=J;Ue.SKIP=ks;Ue.REMOVE=oe;async function Ce(s,e,t,n){let i=await Os(s,e,t,n);if(C(i)||T(i))return As(s,n,i),Ce(s,i,t,n);if(typeof i!="symbol"){if(M(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await Ce(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===J)return J;o===oe&&(e.items.splice(r,1),r-=1)}}}else if(T(e)){n=Object.freeze(n.concat(e));let r=await Ce("key",e.key,t,n);if(r===J)return J;r===oe&&(e.key=null);let o=await Ce("value",e.value,t,n);if(o===J)return J;o===oe&&(e.value=null)}}return i}function Ns(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function Os(s,e,t,n){var i,r,o,a,l;if(typeof t=="function")return t(s,e,n);if(V(e))return(i=t.Map)==null?void 0:i.call(t,s,e,n);if(Q(e))return(r=t.Seq)==null?void 0:r.call(t,s,e,n);if(T(e))return(o=t.Pair)==null?void 0:o.call(t,s,e,n);if(I(e))return(a=t.Scalar)==null?void 0:a.call(t,s,e,n);if(G(e))return(l=t.Alias)==null?void 0:l.call(t,s,e,n)}function As(s,e,t){let n=e[e.length-1];if(M(n))n.items[s]=t;else if(T(n))s==="key"?n.key=t:n.value=t;else if(ge(n))n.contents=t;else{let i=G(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}var Mn={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},$n=s=>s.replace(/[!,[\\]{}]/g,e=>Mn[e]),F=class{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},F.defaultYaml,e),this.tags=Object.assign({},F.defaultTags,t)}clone(){let e=new F(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new F(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:F.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},F.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:F.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},F.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \\t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\\d+\\.\\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren\'t resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];return r?r+decodeURIComponent(i):n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+$n(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&C(e.contents)){let r={};H(e.contents,(o,a)=>{C(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`\n`)}};F.defaultYaml={explicit:!1,version:"1.2"};F.defaultTags={"!!":"tag:yaml.org,2002:"};function ct(s){if(/[\\x00-\\x19\\s,[\\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Yt(s){let e=new Set;return H(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Wt(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function Es(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i||(i=Yt(s));let o=Wt(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(I(o.node)||M(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}var ae=class extends me{constructor(e){super(at),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return H(e,{Node:(n,i)=>{if(i===this)return H.BREAK;i.anchor===this.source&&(t=i)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i);if(!o){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=n.get(o);if(!a||a.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ft(i,o,n)),a.count*a.aliasCount>r)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(ct(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function ft(s,e,t){if(G(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(M(e)){let n=0;for(let i of e.items){let r=ft(s,i,t);r>n&&(n=r)}return n}else if(T(e)){let n=ft(s,e.key,t),i=ft(s,e.value,t);return Math.max(n,i)}return 1}function R(s,e,t){if(Array.isArray(s))return s.map((n,i)=>R(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!Ss(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!(t!=null&&t.keep)?Number(s):s}var ut=s=>!s||typeof s!="function"&&typeof s!="object",N=class extends me{constructor(e){super(W),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:R(this.value,e,t)}toString(){return String(this.value)}};N.BLOCK_FOLDED="BLOCK_FOLDED";N.BLOCK_LITERAL="BLOCK_LITERAL";N.PLAIN="PLAIN";N.QUOTE_DOUBLE="QUOTE_DOUBLE";N.QUOTE_SINGLE="QUOTE_SINGLE";var _n="tag:yaml.org,2002:";function Pn(s,e,t){var n;if(e){let i=t.filter(o=>o.tag===e),r=(n=i.find(o=>!o.format))!=null?n:i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,s))&&!i.format})}function ue(s,e,t){var f,h;if(ge(s)&&(s=s.contents),C(s))return s;if(T(s)){let d=(h=(f=t.schema[ee]).createNode)==null?void 0:h.call(f,t.schema,null,t);return d.items.push(s),d}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt!="undefined"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t,l;if(n&&s&&typeof s=="object"){if(l=a.get(s),l)return l.anchor||(l.anchor=i(s)),new ae(l.anchor);l={anchor:null,node:null},a.set(s,l)}e!=null&&e.startsWith("!!")&&(e=_n+e.slice(2));let c=Pn(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let d=new N(s);return l&&(l.node=d),d}c=s instanceof Map?o[ee]:Symbol.iterator in Object(s)?o[fe]:o[ee]}r&&(r(c),delete t.onTagObj);let u=c!=null&&c.createNode?c.createNode(t.schema,s,t):new N(s);return e&&(u.tag=e),l&&(l.node=u),u}function Ve(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return ue(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Me=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,he=class extends me{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>C(n)||T(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Me(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(M(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,Ve(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(M(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&I(r)?r.value:r:M(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!T(t))return!1;let n=t.value;return n==null||e&&I(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return M(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(M(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,Ve(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};he.maxFlowStringSingleLineLength=60;var Ls=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function X(s,e){return/^\\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var te=(s,e,t)=>s.endsWith(`\n`)?X(t,e):t.includes(`\n`)?`\n`+X(t,e):(s.endsWith(" ")?"":" ")+t;var Gt="flow",ht="block",Je="quoted";function Ye(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return s;let l=Math.max(1+r,1+i-e.length);if(s.length<=l)return s;let c=[],u={},f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let h,d,w=!1,p=-1,g=-1,k=-1;t===ht&&(p=Is(s,p),p!==-1&&(f=p+l));for(let O;O=s[p+=1];){if(t===Je&&O==="\\\\"){switch(g=p,s[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}k=p}if(O===`\n`)t===ht&&(p=Is(s,p)),f=p+l,h=void 0;else{if(O===" "&&d&&d!==" "&&d!==`\n`&&d!==" "){let A=s[p+1];A&&A!==" "&&A!==`\n`&&A!==" "&&(h=p)}if(p>=f)if(h)c.push(h),f=h+l,h=void 0;else if(t===Je){for(;d===" "||d===" ";)d=O,O=s[p+=1],w=!0;let A=p>k+1?p-2:g-1;if(u[A])return s;c.push(A),u[A]=!0,f=A+l,h=void 0}else w=!0}d=O}if(w&&a&&a(),c.length===0)return s;o&&o();let b=s.slice(0,c[0]);for(let O=0;O<c.length;++O){let A=c[O],y=c[O+1]||s.length;A===0?b=`\n${e}${s.slice(0,y)}`:(t===Je&&u[A]&&(b+=`${s[A]}\\\\`),b+=`\n${e}${s.slice(A+1,y)}`)}return b}function Is(s,e){let t=s[e+1];for(;t===" "||t===" ";){do t=s[e+=1];while(t&&t!==`\n`);t=s[e+1]}return e}var dt=s=>({indentAtStart:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),mt=s=>/^(%|---|\\.\\.\\.)/m.test(s);function vn(s,e,t){if(!e||e<0)return!1;let n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(s[r]===`\n`){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function We(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(mt(s)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\\\ ",l+=1,a=l,c="\\\\"),c==="\\\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let u=t.substr(l+2,4);switch(u){case"0000":o+="\\\\0";break;case"0007":o+="\\\\a";break;case"000b":o+="\\\\v";break;case"001b":o+="\\\\e";break;case"0085":o+="\\\\N";break;case"00a0":o+="\\\\_";break;case"2028":o+="\\\\L";break;case"2029":o+="\\\\P";break;default:u.substr(0,2)==="00"?o+="\\\\x"+u.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||t[l+2]===\'"\'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`\n\n`;t[l+2]==="\\\\"&&t[l+3]==="n"&&t[l+4]!==\'"\';)o+=`\n`,l+=2;o+=r,t[l+2]===" "&&(o+="\\\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:Ye(o,r,Je,dt(e))}function Qt(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`\n`)||/[ \\t]\\n|\\n[ \\t]/.test(s))return We(s,e);let t=e.indent||(mt(s)?" ":""),n="\'"+s.replace(/\'/g,"\'\'").replace(/\\n+/g,`$&\n${t}`)+"\'";return e.implicitKey?n:Ye(n,t,Gt,dt(e))}function $e(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=We;else{let i=s.includes(\'"\'),r=s.includes("\'");i&&!r?n=Qt:r&&!i?n=We:n=t?Qt:We}return n(s,e)}function pt({comment:s,type:e,value:t},n,i,r){let{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\\n[\\t ]+$/.test(t)||/^\\s*$/.test(t))return $e(t,n);let c=n.indent||(n.forceBlockIndent||mt(t)?" ":""),u=o==="literal"?!0:o==="folded"||e===N.BLOCK_FOLDED?!1:e===N.BLOCK_LITERAL?!0:!vn(t,l,c.length);if(!t)return u?`|\n`:`>\n`;let f,h;for(h=t.length;h>0;--h){let m=t[h-1];if(m!==`\n`&&m!==" "&&m!==" ")break}let d=t.substring(h),w=d.indexOf(`\n`);w===-1?f="-":t===d||w!==d.length-1?(f="+",r&&r()):f="",d&&(t=t.slice(0,-d.length),d[d.length-1]===`\n`&&(d=d.slice(0,-1)),d=d.replace(/\\n+(?!\\n|$)/g,`$&${c}`));let p=!1,g,k=-1;for(g=0;g<t.length;++g){let m=t[g];if(m===" ")p=!0;else if(m===`\n`)k=g;else break}let b=t.substring(0,k<g?k+1:g);b&&(t=t.substring(b.length),b=b.replace(/\\n+/g,`$&${c}`));let A=(u?"|":">")+(p?c?"2":"1":"")+f;if(s&&(A+=" "+a(s.replace(/ ?[\\r\\n]+/g," ")),i&&i()),u)return t=t.replace(/\\n+/g,`$&${c}`),`${A}\n${c}${b}${t}${d}`;t=t.replace(/\\n+/g,`\n$&`).replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g,"$1$2").replace(/\\n+/g,`$&${c}`);let y=Ye(`${b}${t}${d}`,c,ht,dt(n));return`${A}\n${c}${y}`}function Bn(s,e,t,n){let{type:i,value:r}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&/[\\n[\\]{},]/.test(r)||u&&/[[\\]{},]/.test(r))return $e(r,e);if(!r||/^[\\n\\t ,[\\]{}#&*!|>\'"%@`]|^[?-]$|^[?-][ \\t]|[\\n:][ \\t]|[ \\t]\\n|[\\n\\t ]#|[\\n\\t :]$/.test(r))return a||u||!r.includes(`\n`)?$e(r,e):pt(s,e,t,n);if(!a&&!u&&i!==N.PLAIN&&r.includes(`\n`))return pt(s,e,t,n);if(mt(r)){if(l==="")return e.forceBlockIndent=!0,pt(s,e,t,n);if(a&&l===c)return $e(r,e)}let f=r.replace(/\\n+/g,`$&\n${l}`);if(o){let h=p=>{var g;return p.default&&p.tag!=="tag:yaml.org,2002:str"&&((g=p.test)==null?void 0:g.test(f))},{compat:d,tags:w}=e.doc.schema;if(w.some(h)||d!=null&&d.some(h))return $e(r,e)}return a?f:Ye(f,l,Gt,dt(e))}function pe(s,e,t,n){let{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:a}=s;a!==N.QUOTE_DOUBLE&&/[\\x00-\\x08\\x0b-\\x1f\\x7f-\\x9f\\u{D800}-\\u{DFFF}]/u.test(o.value)&&(a=N.QUOTE_DOUBLE);let l=u=>{switch(u){case N.BLOCK_FOLDED:case N.BLOCK_LITERAL:return i||r?$e(o.value,e):pt(o,e,t,n);case N.QUOTE_DOUBLE:return We(o.value,e);case N.QUOTE_SINGLE:return Qt(o.value,e);case N.PLAIN:return Bn(o,e,t,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,h=i&&u||f;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function gt(s,e){let t=Object.assign({blockQuote:!0,commentString:Ls,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function Dn(s,e){var i,r,o,a;if(e.tag){let l=s.filter(c=>c.tag===e.tag);if(l.length>0)return(i=l.find(c=>c.format===e.format))!=null?i:l[0]}let t,n;if(I(e)){n=e.value;let l=s.filter(c=>{var u;return(u=c.identify)==null?void 0:u.call(c,n)});t=(r=l.find(c=>c.format===e.format))!=null?r:l.find(c=>!c.format)}else n=e,t=s.find(l=>l.nodeClass&&n instanceof l.nodeClass);if(!t){let l=(a=(o=n==null?void 0:n.constructor)==null?void 0:o.name)!=null?a:typeof n;throw new Error(`Tag not resolved for ${l} value`)}return t}function jn(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let i=[],r=(I(s)||M(s))&&s.anchor;r&&ct(r)&&(t.add(r),i.push(`&${r}`));let o=s.tag?s.tag:e.default?null:e.tag;return o&&i.push(n.directives.tagString(o)),i.join(" ")}function se(s,e,t,n){var l,c;if(T(s))return s.toString(e,t,n);if(G(s)){if(e.doc.directives)return s.toString(e);if((l=e.resolvedAliases)!=null&&l.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i,r=C(s)?s:e.doc.createNode(s,{onTagObj:u=>i=u});i||(i=Dn(e.doc.schema.tags,r));let o=jn(r,i,e);o.length>0&&(e.indentAtStart=((c=e.indentAtStart)!=null?c:0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(r,e,t,n):I(r)?pe(r,e,t,n):r.toString(e,t,n);return o?I(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}\n${e.indent}${a}`:a}function Ts({key:s,value:e},t,n,i){var L,E;let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=t,h=C(s)&&s.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(M(s)){let _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let d=!f&&(!s||h&&e==null&&!t.inFlow||M(s)||(I(s)?s.type===N.BLOCK_FOLDED||s.type===N.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!d&&(f||!r),indent:a+l});let w=!1,p=!1,g=se(s,t,()=>w=!0,()=>p=!0);if(!d&&!t.inFlow&&g.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(t.inFlow){if(r||e==null)return w&&n&&n(),g===""?"?":d?`? ${g}`:g}else if(r&&!f||e==null&&d)return g=`? ${g}`,h&&!w?g+=te(g,t.indent,c(h)):p&&i&&i(),g;w&&(h=null),d?(h&&(g+=te(g,t.indent,c(h))),g=`? ${g}\n${a}:`):(g=`${g}:`,h&&(g+=te(g,t.indent,c(h))));let k,b,O;C(e)?(k=!!e.spaceBefore,b=e.commentBefore,O=e.comment):(k=!1,b=null,O=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!d&&!h&&I(e)&&(t.indentAtStart=g.length+1),p=!1,!u&&l.length>=2&&!t.inFlow&&!d&&Q(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let A=!1,y=se(e,t,()=>A=!0,()=>p=!0),m=" ";if(h||k||b){if(m=k?`\n`:"",b){let _=c(b);m+=`\n${X(_,t.indent)}`}y===""&&!t.inFlow?m===`\n`&&(m=`\n\n`):m+=`\n${t.indent}`}else if(!d&&M(e)){let _=y[0],B=y.indexOf(`\n`),S=B!==-1,D=(E=(L=t.inFlow)!=null?L:e.flow)!=null?E:e.items.length===0;if(S||!D){let q=!1;if(S&&(_==="&"||_==="!")){let $=y.indexOf(" ");_==="&"&&$!==-1&&$<B&&y[$+1]==="!"&&($=y.indexOf(" ",$+1)),($===-1||B<$)&&(q=!0)}q||(m=`\n${t.indent}`)}}else(y===""||y[0]===`\n`)&&(m="");return g+=m+y,t.inFlow?A&&n&&n():O&&!A?g+=te(g,t.indent,c(O)):p&&i&&i(),g}function yt(s,e){(s==="debug"||s==="warn")&&(typeof process!="undefined"&&process.emitWarning?process.emitWarning(e):console.warn(e))}var Cs="<<";function bt(s,e,{key:t,value:n}){if(s!=null&&s.doc.schema.merge&&Fn(t))if(n=G(n)?n.resolve(s.doc):n,Q(n))for(let i of n.items)Ht(s,e,i);else if(Array.isArray(n))for(let i of n)Ht(s,e,i);else Ht(s,e,n);else{let i=R(t,"",s);if(e instanceof Map)e.set(i,R(n,i,s));else if(e instanceof Set)e.add(i);else{let r=qn(t,i,s),o=R(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}var Fn=s=>s===Cs||I(s)&&s.value===Cs&&(!s.type||s.type===N.PLAIN);function Ht(s,e,t){let n=s&&G(t)?t.resolve(s.doc):t;if(!V(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,s,Map);for(let[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function qn(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(C(s)&&t&&t.doc){let n=gt(t.doc,{});n.anchors=new Set;for(let r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+\'..."\'),yt(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function _e(s,e,t){let n=ue(s,void 0,t),i=ue(e,void 0,t);return new v(n,i)}var v=class{constructor(e,t=null){Object.defineProperty(this,U,{value:Jt}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return C(t)&&(t=t.clone(e)),C(n)&&(n=n.clone(e)),new v(t,n)}toJSON(e,t){let n=t!=null&&t.mapAsMap?new Map:{};return bt(t,n,this)}toString(e,t,n){return e!=null&&e.doc?Ts(this,e,t,n):JSON.stringify(this)}};function St(s,e,t){var r;return(((r=e.inFlow)!=null?r:s.flow)?Rn:Kn)(s,e,t)}function Kn({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,u=Object.assign({},t,{indent:r,type:null}),f=!1,h=[];for(let w=0;w<e.length;++w){let p=e[w],g=null;if(C(p))!f&&p.spaceBefore&&h.push(""),wt(t,h,p.commentBefore,f),p.comment&&(g=p.comment);else if(T(p)){let b=C(p.key)?p.key:null;b&&(!f&&b.spaceBefore&&h.push(""),wt(t,h,b.commentBefore,f))}f=!1;let k=se(p,u,()=>g=null,()=>f=!0);g&&(k+=te(k,r,c(g))),f&&g&&(f=!1),h.push(n+k)}let d;if(h.length===0)d=i.start+i.end;else{d=h[0];for(let w=1;w<h.length;++w){let p=h[w];d+=p?`\n${l}${p}`:`\n`}}return s?(d+=`\n`+X(c(s),l),a&&a()):f&&o&&o(),d}function Rn({comment:s,items:e},t,{flowChars:n,itemIndent:i,onComment:r}){let{indent:o,indentStep:a,flowCollectionPadding:l,options:{commentString:c}}=t;i+=a;let u=Object.assign({},t,{indent:i,inFlow:!0,type:null}),f=!1,h=0,d=[];for(let k=0;k<e.length;++k){let b=e[k],O=null;if(C(b))b.spaceBefore&&d.push(""),wt(t,d,b.commentBefore,!1),b.comment&&(O=b.comment);else if(T(b)){let y=C(b.key)?b.key:null;y&&(y.spaceBefore&&d.push(""),wt(t,d,y.commentBefore,!1),y.comment&&(f=!0));let m=C(b.value)?b.value:null;m?(m.comment&&(O=m.comment),m.commentBefore&&(f=!0)):b.value==null&&y&&y.comment&&(O=y.comment)}O&&(f=!0);let A=se(b,u,()=>O=null);k<e.length-1&&(A+=","),O&&(A+=te(A,i,c(O))),!f&&(d.length>h||A.includes(`\n`))&&(f=!0),d.push(A),h=d.length}let w,{start:p,end:g}=n;if(d.length===0)w=p+g;else if(f||(f=d.reduce((b,O)=>b+O.length+2,2)>he.maxFlowStringSingleLineLength),f){w=p;for(let k of d)w+=k?`\n${a}${o}${k}`:`\n`;w+=`\n${o}${g}`}else w=`${p}${l}${d.join(" ")}${l}${g}`;return s&&(w+=te(w,c(s),o),r&&r()),w}function wt({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\\n+/,"")),n){let r=X(e(n),s);t.push(r.trimStart())}}function ye(s,e){let t=I(e)?e.value:e;for(let n of s)if(T(n)&&(n.key===e||n.key===t||I(n.key)&&n.key.value===t))return n}var j=class extends he{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ee,e),this.items=[]}add(e,t){var o;let n;T(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new v(e,e==null?void 0:e.value):n=new v(e.key,e.value);let i=ye(this.items,n.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);I(i.value)&&ut(n.value)?i.value.value=n.value:i.value=n.value}else if(r){let a=this.items.findIndex(l=>r(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){let t=ye(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){var r;let n=ye(this.items,e),i=n==null?void 0:n.value;return(r=!t&&I(i)?i.value:i)!=null?r:void 0}has(e){return!!ye(this.items,e)}set(e,t){this.add(new v(e,t),!0)}toJSON(e,t,n){let i=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(i);for(let r of this.items)bt(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!T(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),St(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};function xn(s,e,t){let{keepUndefined:n,replacer:i}=t,r=new j(s),o=(a,l)=>{if(typeof i=="function")l=i.call(e,a,l);else if(Array.isArray(i)&&!i.includes(a))return;(l!==void 0||n)&&r.items.push(_e(a,l,t))};if(e instanceof Map)for(let[a,l]of e)o(a,l);else if(e&&typeof e=="object")for(let a of Object.keys(e))o(a,e[a]);return typeof s.sortMapEntries=="function"&&r.items.sort(s.sortMapEntries),r}var ne={collection:"map",createNode:xn,default:!0,nodeClass:j,tag:"tag:yaml.org,2002:map",resolve(s,e){return V(s)||e("Expected a mapping for this tag"),s}};var x=class extends he{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(fe,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=kt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=kt(e);if(typeof n!="number")return;let i=this.items[n];return!t&&I(i)?i.value:i}has(e){let t=kt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=kt(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];I(i)&&ut(t)?i.value=t:this.items[n]=t}toJSON(e,t){let n=[];t!=null&&t.onCreate&&t.onCreate(n);let i=0;for(let r of this.items)n.push(R(r,String(i++),t));return n}toString(e,t,n){return e?St(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}};function kt(s){let e=I(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}function Un(s,e,t){let{replacer:n}=t,i=new x(s);if(e&&Symbol.iterator in Object(e)){let r=0;for(let o of e){if(typeof n=="function"){let a=e instanceof Set?o:String(r++);o=n.call(e,a,o)}i.items.push(ue(o,void 0,t))}}return i}var ie={collection:"seq",createNode:Un,default:!0,nodeClass:x,tag:"tag:yaml.org,2002:seq",resolve(s,e){return Q(s)||e("Expected a sequence for this tag"),s}};var be={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),pe(s,e,t,n)}};var Ae={identify:s=>s==null,createNode:()=>new N(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new N(null),stringify:({source:s},e)=>typeof s=="string"&&Ae.test.test(s)?s:e.options.nullStr};var Ge={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new N(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&Ge.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};function K({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}var Nt={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:K},Ot={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\\.[0-9]+|[0-9]+(?:\\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():K(s)}},At={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\\.[0-9]+|[0-9]+\\.[0-9]*)$/,resolve(s){let e=new N(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:K};var Et=s=>typeof s=="bigint"||Number.isInteger(s),Xt=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function Ms(s,e,t){let{value:n}=s;return Et(n)&&n>=0?t+n.toString(e):K(s)}var Lt={identify:s=>Et(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>Xt(s,2,8,t),stringify:s=>Ms(s,8,"0o")},It={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>Xt(s,0,10,t),stringify:K},Tt={identify:s=>Et(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>Xt(s,2,16,t),stringify:s=>Ms(s,16,"0x")};var $s=[ne,ie,be,Ae,Ge,Lt,It,Tt,Nt,Ot,At];function _s(s){return typeof s=="bigint"||Number.isInteger(s)}var Ct=({value:s})=>JSON.stringify(s),Vn=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Ct},{identify:s=>s==null,createNode:()=>new N(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ct},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:s=>s==="true",stringify:Ct},{identify:_s,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>_s(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:Ct}],Jn={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},Ps=[ne,ie].concat(Vn,Jn);var Qe={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Buffer=="function")return Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\\n\\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){let o=t,a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=N.BLOCK_LITERAL),e!==N.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,h=0;f<c;++f,h+=l)u[f]=a.substr(h,l);a=u.join(e===N.BLOCK_LITERAL?`\n`:" ")}return pe({comment:s,type:e,value:a},n,i,r)}};function zt(s,e){var t;if(Q(s))for(let n=0;n<s.items.length;++n){let i=s.items[n];if(!T(i)){if(V(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new v(new N(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}\n${r.key.commentBefore}`:i.commentBefore),i.comment){let o=(t=r.value)!=null?t:r.key;o.comment=o.comment?`${i.comment}\n${o.comment}`:i.comment}i=r}s.items[n]=T(i)?i:new v(i)}}else e("Expected a sequence for this tag");return s}function Zt(s,e,t){let{replacer:n}=t,i=new x(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected { key: value } tuple: ${o}`)}else a=o;i.items.push(_e(a,l,t))}return i}var He={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:zt,createNode:Zt};var we=class extends x{constructor(){super(),this.add=j.prototype.add.bind(this),this.delete=j.prototype.delete.bind(this),this.get=j.prototype.get.bind(this),this.has=j.prototype.has.bind(this),this.set=j.prototype.set.bind(this),this.tag=we.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(let i of this.items){let r,o;if(T(i)?(r=R(i.key,"",t),o=R(i.value,r,t)):r=R(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}};we.tag="tag:yaml.org,2002:omap";var Xe={collection:"seq",identify:s=>s instanceof Map,nodeClass:we,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=zt(s,e),n=[];for(let{key:i}of t.items)I(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new we,t)},createNode(s,e,t){let n=Zt(s,e,t),i=new we;return i.items=n.items,i}};function vs({value:s,source:e},t){return e&&(s?es:ts).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var es={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new N(!0),stringify:vs},ts={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>new N(!1),stringify:vs};var Bs={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?\\.(?:inf|Inf|INF|nan|NaN|NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:K},Ds={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():K(s)}},js={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\\.[0-9_]*$/,resolve(s){let e=new N(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:K};var ze=s=>typeof s=="bigint"||Number.isInteger(s);function Mt(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let o=BigInt(s);return i==="-"?BigInt(-1)*o:o}let r=parseInt(s,t);return i==="-"?-1*r:r}function ss(s,e,t){let{value:n}=s;if(ze(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return K(s)}var Fs={identify:ze,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Mt(s,2,2,t),stringify:s=>ss(s,2,"0b")},qs={identify:ze,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Mt(s,1,8,t),stringify:s=>ss(s,8,"0")},Ks={identify:ze,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Mt(s,0,10,t),stringify:K},Rs={identify:ze,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Mt(s,2,16,t),stringify:s=>ss(s,16,"0x")};var Se=class extends j{constructor(e){super(e),this.tag=Se.tag}add(e){let t;T(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new v(e.key,null):t=new v(e,null),ye(this.items,t.key)||this.items.push(t)}get(e,t){let n=ye(this.items,e);return!t&&T(n)?I(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=ye(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new v(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}};Se.tag="tag:yaml.org,2002:set";var Ze={collection:"map",identify:s=>s instanceof Set,nodeClass:Se,default:!1,tag:"tag:yaml.org,2002:set",resolve(s,e){if(V(s)){if(s.hasAllNullValues(!0))return Object.assign(new Se,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s},createNode(s,e,t){let{replacer:n}=t,i=new Se(s);if(e&&Symbol.iterator in Object(e))for(let r of e)typeof n=="function"&&(r=n.call(e,r,r)),i.items.push(_e(r,null,t));return i}};function ns(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function xs(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return K(s);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>o<10?"0"+String(o):String(o)).join(":").replace(/000000\\d*$/,"")}var $t={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>ns(s,t),stringify:xs},_t={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*$/,resolve:s=>ns(s,!1),stringify:xs},Pe={identify:s=>s instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\\\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\\\.[0-9]+)?)(?:[ \\\\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(s){let e=s.match(Pe.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,r||0,o||0,a||0,l),u=e[8];if(u&&u!=="Z"){let f=ns(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>s.toISOString().replace(/((T00:00)?:00)?\\.000Z$/,"")};var is=[ne,ie,be,Ae,es,ts,Fs,qs,Ks,Rs,Bs,Ds,js,Qe,Xe,He,Ze,$t,_t,Pe];var Us=new Map([["core",$s],["failsafe",[ne,ie,be]],["json",Ps],["yaml11",is],["yaml-1.1",is]]),Vs={binary:Qe,bool:Ge,float:At,floatExp:Ot,floatNaN:Nt,floatTime:_t,int:It,intHex:Tt,intOct:Lt,intTime:$t,map:ne,null:Ae,omap:Xe,pairs:He,seq:ie,set:Ze,timestamp:Pe},Js={"tag:yaml.org,2002:binary":Qe,"tag:yaml.org,2002:omap":Xe,"tag:yaml.org,2002:pairs":He,"tag:yaml.org,2002:set":Ze,"tag:yaml.org,2002:timestamp":Pe};function Pt(s,e){let t=Us.get(e);if(!t)if(Array.isArray(s))t=[];else{let n=Array.from(Us.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${n} or define customTags array`)}if(Array.isArray(s))for(let n of s)t=t.concat(n);else typeof s=="function"&&(t=s(t.slice()));return t.map(n=>{if(typeof n!="string")return n;let i=Vs[n];if(i)return i;let r=Object.keys(Vs).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${r}`)})}var Yn=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,ke=class{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Pt(e,"compat"):e?Pt(null,e):null,this.merge=!!n,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Js:{},this.tags=Pt(t,this.name),this.toStringOptions=a!=null?a:null,Object.defineProperty(this,ee,{value:ne}),Object.defineProperty(this,W,{value:be}),Object.defineProperty(this,fe,{value:ie}),this.sortMapEntries=typeof o=="function"?o:o===!0?Yn:null}clone(){let e=Object.create(ke.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function Ys(s,e){var l;let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let c=s.directives.toString(s);c?(t.push(c),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=gt(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let c=r(s.commentBefore);t.unshift(X(c,""))}let o=!1,a=null;if(s.contents){if(C(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let f=r(s.contents.commentBefore);t.push(X(f,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}let c=a?void 0:()=>o=!0,u=se(s.contents,i,()=>a=null,c);a&&(u+=te(u,"",r(a))),(u[0]==="|"||u[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${u}`:t.push(u)}else t.push(se(s.contents,i));if((l=s.directives)!=null&&l.docEnd)if(s.comment){let c=r(s.comment);c.includes(`\n`)?(t.push("..."),t.push(X(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=s.comment;c&&o&&(c=c.replace(/^\\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(X(r(c),"")))}return t.join(`\n`)+`\n`}function ve(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],a=ve(s,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=ve(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=ve(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=ve(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}var z=class{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,U,{value:lt});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new F({version:o}),this.setSchema(o,n),e===void 0?this.contents=null:this.contents=this.createNode(e,i,n)}clone(){let e=Object.create(z.prototype,{[U]:{value:lt}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=C(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Be(this.contents)&&this.contents.add(e)}addIn(e,t){Be(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=Yt(this);e.anchor=!t||n.has(t)?Wt(t||"a",n):t}return new ae(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let g=b=>typeof b=="number"||b instanceof String||b instanceof Number,k=t.filter(g).map(String);k.length>0&&(t=t.concat(k)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=n!=null?n:{},{onAnchor:f,setAnchors:h,sourceObjects:d}=Es(this,o||"a"),w={aliasDuplicateObjects:r!=null?r:!0,keepUndefined:l!=null?l:!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:d},p=ue(e,u,w);return a&&M(p)&&(p.flow=!0),h(),p}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new v(i,r)}delete(e){return Be(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Me(e)?this.contents==null?!1:(this.contents=null,!0):Be(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return M(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Me(e)?!t&&I(this.contents)?this.contents.value:this.contents:M(this.contents)?this.contents.getIn(e,t):void 0}has(e){return M(this.contents)?this.contents.has(e):!1}hasIn(e){return Me(e)?this.contents!==void 0:M(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ve(this.schema,[e],t):Be(this.contents)&&this.contents.set(e,t)}setIn(e,t){Me(e)?this.contents=t:this.contents==null?this.contents=Ve(this.schema,Array.from(e),t):Be(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new F({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new F({version:e}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected \'1.1\', \'1.2\' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new ke(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100,stringify:se},l=R(this.contents,t!=null?t:"",a);if(typeof r=="function")for(let{count:c,res:u}of a.anchors.values())r(u,c);return typeof o=="function"?ve(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Ys(this,e)}};function Be(s){if(M(s))return!0;throw new Error("Expected a YAML collection as document contents")}var De=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},Y=class extends De{constructor(e,t,n){super("YAMLParseError",e,t,n)}},je=class extends De{constructor(e,t,n){super("YAMLWarning",e,t,n)}},et=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\\n\\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\\u2026"),n>1&&/^ *$/.test(o.substring(0,r))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\\u2026\n`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l&&l.line===n&&l.col>i&&(a=Math.min(l.col-i,80-r));let c=" ".repeat(r)+"^".repeat(a);t.message+=`:\n\n${o}\n${c}\n`}};function le(s,{flow:e,indicator:t,next:n,offset:i,onError:r,startOnNewline:o}){let a=!1,l=o,c=o,u="",f="",h=!1,d=!1,w=!1,p=null,g=null,k=null,b=null,O=null;for(let m of s)switch(w&&(m.type!=="space"&&m.type!=="newline"&&m.type!=="comma"&&r(m.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),m.type){case"space":!e&&l&&t!=="doc-start"&&m.source[0]===" "&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),c=!0;break;case"comment":{c||r(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let L=m.source.substring(1)||" ";u?u+=f+L:u=L,f="",l=!1;break}case"newline":l?u?u+=m.source:a=!0:f+=m.source,l=!0,h=!0,(p||g)&&(d=!0),c=!0;break;case"anchor":p&&r(m,"MULTIPLE_ANCHORS","A node can have at most one anchor"),m.source.endsWith(":")&&r(m.offset+m.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=m,O===null&&(O=m.offset),l=!1,c=!1,w=!0;break;case"tag":{g&&r(m,"MULTIPLE_TAGS","A node can have at most one tag"),g=m,O===null&&(O=m.offset),l=!1,c=!1,w=!0;break}case t:(p||g)&&r(m,"BAD_PROP_ORDER",`Anchors and tags must be after the ${m.source} indicator`),b&&r(m,"UNEXPECTED_TOKEN",`Unexpected ${m.source} in ${e!=null?e:"collection"}`),b=m,l=!1,c=!1;break;case"comma":if(e){k&&r(m,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=m,l=!1,c=!1;break}default:r(m,"UNEXPECTED_TOKEN",`Unexpected ${m.type} token`),l=!1,c=!1}let A=s[s.length-1],y=A?A.offset+A.source.length:i;return w&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),{comma:k,found:b,spaceBefore:a,comment:u,hasNewline:h,hasNewlineAfterProp:d,anchor:p,tag:g,end:y,start:O!=null?O:y}}function Ne(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`\n`))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Ne(e.key)||Ne(e.value))return!0}return!1;default:return!0}}function tt(s,e,t){if((e==null?void 0:e.type)==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Ne(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function vt(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let i=typeof n=="function"?n:(r,o)=>r===o||I(r)&&I(o)&&r.value===o.value&&!(r.value==="<<"&&s.schema.merge);return e.some(r=>i(r.key,t))}var Ws="All mapping items must start at the same column";function Gs({composeNode:s,composeEmptyNode:e},t,n,i){var l;let r=new j(t.schema);t.atRoot&&(t.atRoot=!1);let o=n.offset,a=null;for(let c of n.items){let{start:u,key:f,sep:h,value:d}=c,w=le(u,{indicator:"explicit-key-ind",next:f!=null?f:h==null?void 0:h[0],offset:o,onError:i,startOnNewline:!0}),p=!w.found;if(p){if(f&&(f.type==="block-seq"?i(o,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(o,"BAD_INDENT",Ws)),!w.anchor&&!w.tag&&!h){a=w.end,w.comment&&(r.comment?r.comment+=`\n`+w.comment:r.comment=w.comment);continue}(w.hasNewlineAfterProp||Ne(f))&&i(f!=null?f:u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((l=w.found)==null?void 0:l.indent)!==n.indent&&i(o,"BAD_INDENT",Ws);let g=w.end,k=f?s(t,f,w,i):e(t,g,u,null,w,i);t.schema.compat&&tt(n.indent,f,i),vt(t,r.items,k)&&i(g,"DUPLICATE_KEY","Map keys must be unique");let b=le(h!=null?h:[],{indicator:"map-value-ind",next:d,offset:k.range[2],onError:i,startOnNewline:!f||f.type==="block-scalar"});if(o=b.end,b.found){p&&((d==null?void 0:d.type)==="block-map"&&!b.hasNewline&&i(o,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&w.start<b.found.offset-1024&&i(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let O=d?s(t,d,b,i):e(t,o,h,null,b,i);t.schema.compat&&tt(n.indent,d,i),o=O.range[2];let A=new v(k,O);t.options.keepSourceTokens&&(A.srcToken=c),r.items.push(A)}else{p&&i(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(k.comment?k.comment+=`\n`+b.comment:k.comment=b.comment);let O=new v(k);t.options.keepSourceTokens&&(O.srcToken=c),r.items.push(O)}}return a&&a<o&&i(a,"IMPOSSIBLE","Map comment with trailing content"),r.range=[n.offset,o,a!=null?a:o],r}function Qs({composeNode:s,composeEmptyNode:e},t,n,i){let r=new x(t.schema);t.atRoot&&(t.atRoot=!1);let o=n.offset,a=null;for(let{start:l,value:c}of n.items){let u=le(l,{indicator:"seq-item-ind",next:c,offset:o,onError:i,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||c)c&&c.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(o,"MISSING_CHAR","Sequence item without - indicator");else{a=u.end,u.comment&&(r.comment=u.comment);continue}let f=c?s(t,c,u,i):e(t,u.end,l,null,u,i);t.schema.compat&&tt(n.indent,c,i),o=f.range[2],r.items.push(f)}return r.range=[n.offset,o,a!=null?a:o],r}function ce(s,e,t,n){let i="";if(s){let r=!1,o="";for(let a of s){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";i?i+=o+u:i=u,o="";break}case"newline":i&&(o+=l),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}var rs="Block collections are not allowed within flow collections",os=s=>s&&(s.type==="block-map"||s.type==="block-seq");function Hs({composeNode:s,composeEmptyNode:e},t,n,i){var w;let r=n.start.source==="{",o=r?"flow map":"flow sequence",a=r?new j(t.schema):new x(t.schema);a.flow=!0;let l=t.atRoot;l&&(t.atRoot=!1);let c=n.offset+n.start.source.length;for(let p=0;p<n.items.length;++p){let g=n.items[p],{start:k,key:b,sep:O,value:A}=g,y=le(k,{flow:o,indicator:"explicit-key-ind",next:b!=null?b:O==null?void 0:O[0],offset:c,onError:i,startOnNewline:!1});if(!y.found){if(!y.anchor&&!y.tag&&!O&&!A){p===0&&y.comma?i(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):p<n.items.length-1&&i(y.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),y.comment&&(a.comment?a.comment+=`\n`+y.comment:a.comment=y.comment),c=y.end;continue}!r&&t.options.strict&&Ne(b)&&i(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)y.comma&&i(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(y.comma||i(y.start,"MISSING_CHAR",`Missing , between ${o} items`),y.comment){let m="";e:for(let L of k)switch(L.type){case"comma":case"space":break;case"comment":m=L.source.substring(1);break e;default:break e}if(m){let L=a.items[a.items.length-1];T(L)&&(L=(w=L.value)!=null?w:L.key),L.comment?L.comment+=`\n`+m:L.comment=m,y.comment=y.comment.substring(m.length+1)}}if(!r&&!O&&!y.found){let m=A?s(t,A,y,i):e(t,y.end,O,null,y,i);a.items.push(m),c=m.range[2],os(A)&&i(m.range,"BLOCK_IN_FLOW",rs)}else{let m=y.end,L=b?s(t,b,y,i):e(t,m,k,null,y,i);os(b)&&i(L.range,"BLOCK_IN_FLOW",rs);let E=le(O!=null?O:[],{flow:o,indicator:"map-value-ind",next:A,offset:L.range[2],onError:i,startOnNewline:!1});if(E.found){if(!r&&!y.found&&t.options.strict){if(O)for(let S of O){if(S===E.found)break;if(S.type==="newline"){i(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}y.start<E.found.offset-1024&&i(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source&&A.source[0]===":"?i(A,"MISSING_CHAR",`Missing space after : in ${o}`):i(E.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let _=A?s(t,A,E,i):E.found?e(t,E.end,O,null,E,i):null;_?os(A)&&i(_.range,"BLOCK_IN_FLOW",rs):E.comment&&(L.comment?L.comment+=`\n`+E.comment:L.comment=E.comment);let B=new v(L,_);if(t.options.keepSourceTokens&&(B.srcToken=g),r){let S=a;vt(t,S.items,L)&&i(m,"DUPLICATE_KEY","Map keys must be unique"),S.items.push(B)}else{let S=new j(t.schema);S.flow=!0,S.items.push(B),a.items.push(S)}c=_?_.range[2]:E.end}}let u=r?"}":"]",[f,...h]=n.end,d=c;if(f&&f.source===u)d=f.offset+f.source.length;else{let p=o[0].toUpperCase()+o.substring(1),g=l?`${p} must end with a ${u}`:`${p} in block collection must be sufficiently indented and end with a ${u}`;i(c,l?"MISSING_CHAR":"BAD_INDENT",g),f&&f.source.length!==1&&h.unshift(f)}if(h.length>0){let p=ce(h,d,t.options.strict,i);p.comment&&(a.comment?a.comment+=`\n`+p.comment:a.comment=p.comment),a.range=[n.offset,d,p.offset]}else a.range=[n.offset,d,d];return a}function Xs(s,e,t,n,i){let r;switch(t.type){case"block-map":{r=Gs(s,e,t,i);break}case"block-seq":{r=Qs(s,e,t,i);break}case"flow-collection":{r=Hs(s,e,t,i);break}}if(!n)return r;let o=e.directives.tagName(n.source,h=>i(n,"TAG_RESOLVE_FAILED",h));if(!o)return r;let a=r.constructor;if(o==="!"||o===a.tagName)return r.tag=a.tagName,r;let l=V(r)?"map":"seq",c=e.schema.tags.find(h=>h.collection===l&&h.tag===o);if(!c){let h=e.schema.knownTags[o];if(h&&h.collection===l)e.schema.tags.push(Object.assign({},h,{default:!1})),c=h;else return i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),r.tag=o,r}let u=c.resolve(r,h=>i(n,"TAG_RESOLVE_FAILED",h),e.options),f=C(u)?u:new N(u);return f.range=r.range,f.tag=o,c!=null&&c.format&&(f.format=c.format),f}function Bt(s,e,t){let n=s.offset,i=Wn(s,e,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?N.BLOCK_FOLDED:N.BLOCK_LITERAL,o=s.source?Gn(s.source):[],a=o.length;for(let p=o.length-1;p>=0;--p){let g=o[p][1];if(g===""||g==="\\r")a=p;else break}if(a===0){let p=i.chomp==="+"&&o.length>0?`\n`.repeat(Math.max(1,o.length-1)):"",g=n+i.length;return s.source&&(g+=s.source.length),{value:p,type:r,comment:i.comment,range:[n,g,g]}}let l=s.indent+i.indent,c=s.offset+i.length,u=0;for(let p=0;p<a;++p){let[g,k]=o[p];if(k===""||k==="\\r")i.indent===0&&g.length>l&&(l=g.length);else{if(g.length<l){let b="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";t(c+g.length,"MISSING_CHAR",b)}i.indent===0&&(l=g.length),u=p;break}c+=g.length+k.length+1}for(let p=o.length-1;p>=a;--p)o[p][0].length>l&&(a=p+1);let f="",h="",d=!1;for(let p=0;p<u;++p)f+=o[p][0].slice(l)+`\n`;for(let p=u;p<a;++p){let[g,k]=o[p];c+=g.length+k.length+1;let b=k[k.length-1]==="\\r";if(b&&(k=k.slice(0,-1)),k&&g.length<l){let A=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-k.length-(b?2:1),"BAD_INDENT",A),g=""}r===N.BLOCK_LITERAL?(f+=h+g.slice(l)+k,h=`\n`):g.length>l||k[0]===" "?(h===" "?h=`\n`:!d&&h===`\n`&&(h=`\n\n`),f+=h+g.slice(l)+k,h=`\n`,d=!0):k===""?h===`\n`?f+=`\n`:h=`\n`:(f+=h+k,h=" ",d=!1)}switch(i.chomp){case"-":break;case"+":for(let p=a;p<o.length;++p)f+=`\n`+o[p][0].slice(l);f[f.length-1]!==`\n`&&(f+=`\n`);break;default:f+=`\n`}let w=n+i.length+s.source.length;return{value:f,type:r,comment:i.comment,range:[n,w,w]}}function Wn({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],o=0,a="",l=-1;for(let h=1;h<i.length;++h){let d=i[h];if(!a&&(d==="-"||d==="+"))a=d;else{let w=Number(d);!o&&w?o=w:l===-1&&(l=s+h)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,u="",f=i.length;for(let h=1;h<e.length;++h){let d=e[h];switch(d.type){case"space":c=!0;case"newline":f+=d.source.length;break;case"comment":t&&!c&&n(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=d.source.length,u=d.source.substring(1);break;case"error":n(d,"UNEXPECTED_TOKEN",d.message),f+=d.source.length;break;default:{let w=`Unexpected token in block scalar header: ${d.type}`;n(d,"UNEXPECTED_TOKEN",w);let p=d.source;p&&typeof p=="string"&&(f+=p.length)}}}return{mode:r,indent:o,chomp:a,comment:u,length:f}}function Gn(s){let e=s.split(/\\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n!=null&&n[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}function Dt(s,e,t){let{offset:n,type:i,source:r,end:o}=s,a,l,c=(h,d,w)=>t(n+h,d,w);switch(i){case"scalar":a=N.PLAIN,l=Qn(r,c);break;case"single-quoted-scalar":a=N.QUOTE_SINGLE,l=Hn(r,c);break;case"double-quoted-scalar":a=N.QUOTE_DOUBLE,l=Xn(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let u=n+r.length,f=ce(o,u,e,t);return{value:l,type:a,comment:f.comment,range:[n,u,f.offset]}}function Qn(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),zs(s)}function Hn(s,e){return(s[s.length-1]!=="\'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing \'quote"),zs(s.slice(1,-1)).replace(/\'\'/g,"\'")}function zs(s){var l;let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\\r?\n`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\\r?\n`,"sy")}catch(c){e=new RegExp("(.*?)[ \\\\t]*\\\\r?\\\\n","sy"),t=new RegExp("[ \\\\t]*(.*?)[ \\\\t]*\\\\r?\\\\n","sy")}let n=e.exec(s);if(!n)return s;let i=n[1],r=" ",o=e.lastIndex;for(t.lastIndex=o;n=t.exec(s);)n[1]===""?r===`\n`?i+=r:r=`\n`:(i+=r+n[1],r=" "),o=t.lastIndex;let a=new RegExp("[ \\\\t]*(.*)","sy");return a.lastIndex=o,n=a.exec(s),i+r+((l=n==null?void 0:n[1])!=null?l:"")}function Xn(s,e){let t="";for(let n=1;n<s.length-1;++n){let i=s[n];if(!(i==="\\r"&&s[n+1]===`\n`))if(i===`\n`){let{fold:r,offset:o}=zn(s,n);t+=r,n=o}else if(i==="\\\\"){let r=s[++n],o=Zn[r];if(o)t+=o;else if(r===`\n`)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\\r"&&s[n+1]===`\n`)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){let a={x:2,u:4,U:8}[r];t+=ei(s,n+1,a,e),n+=a}else{let a=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){let r=n,o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`\n`&&!(o==="\\r"&&s[n+2]===`\n`)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!==\'"\'||s.length===1)&&e(s.length,"MISSING_CHAR",\'Missing closing "quote\'),t}function zn(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`\n`||n==="\\r")&&!(n==="\\r"&&s[e+2]!==`\n`);)n===`\n`&&(t+=`\n`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var Zn={0:"\\0",a:"\\x07",b:"\\b",e:"\\x1B",f:"\\f",n:`\n`,r:"\\r",t:" ",v:"\\v",N:"\\x85",_:"\\xA0",L:"\\u2028",P:"\\u2029"," ":" ",\'"\':\'"\',"/":"/","\\\\":"\\\\"," ":" "};function ei(s,e,t,n){let i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function as(s,e,t,n){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?Bt(e,s.options.strict,n):Dt(e,s.options.strict,n),l=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null,c=t&&l?ti(s.schema,i,l,t,n):e.type==="scalar"?si(s,i,e,n):s.schema[W],u;try{let f=c.resolve(i,h=>n(t!=null?t:e,"TAG_RESOLVE_FAILED",h),s.options);u=I(f)?f:new N(f)}catch(f){let h=f instanceof Error?f.message:String(f);n(t!=null?t:e,"TAG_RESOLVE_FAILED",h),u=new N(i)}return u.range=a,u.source=i,r&&(u.type=r),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function ti(s,e,t,n,i){var a;if(t==="!")return s[W];let r=[];for(let l of s.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)r.push(l);else return l;for(let l of r)if((a=l.test)!=null&&a.test(e))return l;let o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[W])}function si({directives:s,schema:e},t,n,i){var o;let r=e.tags.find(a=>{var l;return a.default&&((l=a.test)==null?void 0:l.test(t))})||e[W];if(e.compat){let a=(o=e.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(t))}))!=null?o:e[W];if(r.tag!==a.tag){let l=s.tagString(r.tag),c=s.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;i(n,"TAG_RESOLVE_FAILED",u,!0)}}return r}function Zs(s,e,t){if(e){t===null&&(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];(i==null?void 0:i.type)==="space";)s+=i.source.length,i=e[++n];break}}return s}var ni={composeNode:ls,composeEmptyNode:jt};function ls(s,e,t,n){let{spaceBefore:i,comment:r,anchor:o,tag:a}=t,l,c=!0;switch(e.type){case"alias":l=ii(s,e,n),(o||a)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=as(s,e,a,n),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=Xs(ni,s,e,a,n),o&&(l.anchor=o.source.substring(1));break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",u),l=jt(s,e.offset,void 0,null,t,n),c=!1}}return o&&l.anchor===""&&n(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(l.spaceBefore=!0),r&&(e.type==="scalar"&&e.source===""?l.comment=r:l.commentBefore=r),s.options.keepSourceTokens&&c&&(l.srcToken=e),l}function jt(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let u={type:"scalar",offset:Zs(e,t,n),indent:-1,source:""},f=as(s,u,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function ii({options:s},{offset:e,source:t,end:n},i){let r=new ae(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=ce(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function en(s,e,{offset:t,start:n,value:i,end:r},o){let a=Object.assign({_directives:e},s),l=new z(void 0,a),c={atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=le(n,{indicator:"doc-start",next:i!=null?i:r==null?void 0:r[0],offset:t,onError:o,startOnNewline:!0});u.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?ls(c,i,u,o):jt(c,u.end,n,null,u,o);let f=l.contents.range[2],h=ce(r,f,!1,o);return h.comment&&(l.comment=h.comment),l.range=[t,f,h.offset],l}function st(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function tn(s){var i;let e="",t=!1,n=!1;for(let r=0;r<s.length;++r){let o=s[r];switch(o[0]){case"#":e+=(e===""?"":n?`\n\n`:`\n`)+(o.substring(1)||" "),t=!0,n=!1;break;case"%":((i=s[r+1])==null?void 0:i[0])!=="#"&&(r+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var Ee=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{let o=st(t);r?this.warnings.push(new je(o,n,i)):this.errors.push(new Y(o,n,i))},this.directives=new F({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=tn(this.prelude);if(n){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(M(r)&&!r.flow&&r.items.length>0){let o=r.items[0];T(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}\n${a}`:n}else{let o=r.commentBefore;r.commentBefore=o?`${n}\n${o}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:tn(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let r=st(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=en(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Y(st(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Y(st(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=ce(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Y(st(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new z(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};var hs={};bs(hs,{BOM:()=>nt,DOCUMENT:()=>it,FLOW_END:()=>rt,SCALAR:()=>Fe,createScalarToken:()=>nn,isCollection:()=>ai,isScalar:()=>li,prettyToken:()=>ci,resolveAsScalar:()=>sn,setScalarValue:()=>rn,stringify:()=>an,tokenType:()=>us,visit:()=>Oe});function sn(s,e=!0,t){if(s){let n=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new Y([a,a+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Dt(s,e,n);case"block-scalar":return Bt(s,e,n)}}return null}function nn(s,e){var c;let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=pe({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=(c=e.end)!=null?c:[{type:"newline",offset:-1,indent:n,source:`\n`}];switch(a[0]){case"|":case">":{let u=a.indexOf(`\n`),f=a.substring(0,u),h=a.substring(u+1)+`\n`,d=[{type:"block-scalar-header",offset:r,indent:n,source:f}];return on(d,l)||d.push({type:"newline",offset:-1,indent:n,source:`\n`}),{type:"block-scalar",offset:r,indent:n,props:d,source:h}}case\'"\':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"\'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function rn(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,a="indent"in s?s.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(s.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=pe({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":ri(s,l);break;case\'"\':cs(s,l,"double-quoted-scalar");break;case"\'":cs(s,l,"single-quoted-scalar");break;default:cs(s,l,"scalar")}}function ri(s,e){let t=e.indexOf(`\n`),n=e.substring(0,t),i=e.substring(t+1)+`\n`;if(s.type==="block-scalar"){let r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{let{offset:r}=s,o="indent"in s?s.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];on(a,"end"in s?s.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`\n`});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:o,props:a,source:i})}}function on(s,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function cs(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{let n=s.props.slice(1),i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(let r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`\n`};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{let n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}var an=s=>"type"in s?qt(s):Ft(s);function qt(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=qt(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=Ft(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=Ft(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=Ft(s);if(s.end)for(let t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(let t of s.end)e+=t.source;return e}}}function Ft({start:s,key:e,sep:t,value:n}){let i="";for(let r of s)i+=r.source;if(e&&(i+=qt(e)),t)for(let r of t)i+=r.source;return n&&(i+=qt(n)),i}var fs=Symbol("break visit"),oi=Symbol("skip children"),ln=Symbol("remove item");function Oe(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),cn(Object.freeze([]),s,e)}Oe.BREAK=fs;Oe.SKIP=oi;Oe.REMOVE=ln;Oe.itemAtPath=(s,e)=>{let t=s;for(let[n,i]of e){let r=t==null?void 0:t[n];if(r&&"items"in r)t=r.items[i];else return}return t};Oe.parentCollection=(s,e)=>{let t=Oe.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t==null?void 0:t[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function cn(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=cn(Object.freeze(s.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===fs)return fs;a===ln&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}var nt="\\uFEFF",it="",rt="",Fe="",ai=s=>!!s&&"items"in s,li=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function ci(s){switch(s){case nt:return"<BOM>";case it:return"<DOC>";case rt:return"<FLOW_END>";case Fe:return"<SCALAR>";default:return JSON.stringify(s)}}function us(s){switch(s){case nt:return"byte-order-mark";case it:return"doc-mode";case rt:return"flow-error-end";case Fe:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`\n`:case`\\r\n`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(s[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"\'":return"single-quoted-scalar";case\'"\':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Z(s){switch(s){case void 0:case" ":case`\n`:case"\\r":case" ":return!0;default:return!1}}var fn="0123456789ABCDEFabcdef".split(""),fi="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*\'()".split(""),ps=",[]{}".split(""),ui=` ,[]{}\n\\r `.split(""),ds=s=>!s||ui.includes(s),qe=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){var i;e&&(this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null),this.atEnd=!t;let n=(i=this.next)!=null?i:"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`\n`?!0:t==="\\r"?this.buffer[e+1]===`\n`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\\r"){let i=this.buffer[n+e+1];if(i===`\n`||!i&&!this.atEnd)return e+n+1}return t===`\n`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Z(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`\n`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===nt&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");if(n!==-1){let r=e[n-1];(r===" "||r===" ")&&(t=n-1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield it,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if(t==="---"&&Z(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"doc";if(t==="..."&&Z(this.charAt(3)))return yield*this.pushCount(3),"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Z(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Z(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(ds),"doc";case\'"\':case"\'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Z(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield rt,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(ds),"flow";case\'"\':case"\'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||Z(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="\'")for(;t!==-1&&this.buffer[t+1]==="\'";)t=this.buffer.indexOf("\'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf(\'"\',t+1)}let n=this.buffer.substring(0,t),i=n.indexOf(`\n`,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`\n`,r)}i!==-1&&(t=i-(n[i-1]==="\\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Z(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let i=this.pos;n=this.buffer[i];++i)switch(n){case" ":t+=1;break;case`\n`:e=i,t=0;break;case"\\r":{let r=this.buffer[i+1];if(!r&&!this.atEnd)return this.setNext("block-scalar");if(r===`\n`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext+=this.blockScalarIndent;do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`\n`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}if(!this.blockScalarKeep)do{let i=e-1,r=this.buffer[i];r==="\\r"&&(r=this.buffer[--i]);let o=i;for(;r===" "||r===" ";)r=this.buffer[--i];if(r===`\n`&&i>=this.pos&&i+1+t>o)e=i;else break}while(!0);return yield Fe,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let r=this.buffer[n+1];if(Z(r)||e&&r===",")break;t=n}else if(Z(i)){let r=this.buffer[n+1];if(i==="\\r"&&(r===`\n`?(n+=1,i=`\n`,r=this.buffer[n+1]):t=n),r==="#"||e&&ps.includes(r))break;if(i===`\n`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&ps.includes(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Fe,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(ds))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(Z(t)||e&&ps.includes(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Z(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(fi.includes(t))t=this.buffer[++e];else if(t==="%"&&fn.includes(this.buffer[e+1])&&fn.includes(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`\n`?yield*this.pushCount(1):e==="\\r"&&this.charAt(1)===`\n`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};var Ke=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};function re(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function un(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function pn(s){switch(s==null?void 0:s.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Kt(s){var e;switch(s.type){case"document":return s.start;case"block-map":{let t=s.items[s.items.length-1];return(e=t.sep)!=null?e:t.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function Re(s){var t;if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=s[++e])==null?void 0:t.type)==="space";);return s.splice(e,s.length)}function hn(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!re(e.start,"explicit-key-ind")&&!re(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,pn(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var Le=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new qe,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=us(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e!=null?e:this.stack.pop();if(t)if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&hn(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!re(i.start,"explicit-key-ind");return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&un(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.items.splice(-1,1))}}else{let n="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:n}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{un(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=Kt(this.peek(2)),n=Re(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`\n`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`\n`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var n;let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent&&t.sep,r=[];if(i&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!re(t.start,"explicit-key-ind")?t.start.push(this.sourceToken):i||t.value?(r.push(this.sourceToken),e.items.push({start:r})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}),this.onKeyLine=!0;return;case"map-value-ind":if(re(t.start,"explicit-key-ind"))if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(re(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(pn(t.key)&&!re(t.sep,"newline")){let o=Re(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(re(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Re(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):re(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){i&&o.type!=="block-seq"&&re(t.start,"explicit-key-ind")&&e.items.push({start:r}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var n;let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||re(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Kt(n),r=Re(i);hn(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`\n`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`\n`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Kt(e),n=Re(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Kt(e),n=Re(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function dn(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new Ke||null,prettyErrors:e}}function mn(s,e={}){let{lineCounter:t,prettyErrors:n}=dn(e),i=new Le(t==null?void 0:t.addNewLine),r=new Ee(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(let a of o)a.errors.forEach(et(s,t)),a.warnings.forEach(et(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function ms(s,e={}){let{lineCounter:t,prettyErrors:n}=dn(e),i=new Le(t==null?void 0:t.addNewLine),r=new Ee(e),o=null;for(let a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Y(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(et(s,t)),o.warnings.forEach(et(s,t))),o}function gn(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=ms(s,t);if(!i)return null;if(i.warnings.forEach(r=>yt(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function yn(s,e,t){var i;let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(s===void 0){let{keepUndefined:r}=(i=t!=null?t:e)!=null?i:{};if(!r)return}return new z(s,n,t).toString(t)}var bn=gs;var de=self,ys=class{constructor(){this.queue=[];this.pendingContentProcessing=new Map;this.parsing=!1;de.addEventListener("message",e=>{e.data.type=="queue"&&(this.add(...e.data.paths),this.debug&&console.debug(`TTRPG: Received queue message for ${e.data.paths.length} paths`))}),de.addEventListener("message",e=>{e.data.type=="debug"&&(this.debug=e.data.debug)}),de.addEventListener("message",e=>{e.data.type=="content"&&this.processContent(e.data.path,e.data.content)})}add(...e){this.debug&&console.debug(`TTRPG: Adding ${e.length} paths to queue`),this.queue.push(...e),this.parsing||this.parse()}processContent(e,t){this.debug&&console.debug(`TTRPG: Process Content: ${e}`);let n=this.pendingContentProcessing.get(e),i=this.findFirstStatBlock(t);if(i){this.debug&&console.debug(`TTRPG: found Statblock: ${JSON.stringify(i)}`);let r=Object.assign({},bn.parse(i),{note:e,mtime:n.mtime});this.debug&&console.debug(`TTRPG: ${JSON.stringify(r)}`),this.processMonster(r,n)}this.pendingContentProcessing.delete(e),this.checkForWorkComplete()}findFirstStatBlock(e){let t=e.match(/^```[^\\S\\r\\n]*statblock\\s?\\n([\\s\\S]+?)^```/m);return t?t[1]:null}async parse(){for(this.parsing=!0;this.queue.length;){let e=this.queue.shift();if(!e.endsWith(".md"))continue;this.debug&&console.debug(`TTRPG: Parsing ${e} for statblocks (${this.queue.length} to go)`);let{file:t,cache:n}=await this.getFileData(e);this.parseFileForCreatures(t,n),de.postMessage({type:"done",path:e})}this.checkForWorkComplete()}checkForWorkComplete(){this.pendingContentProcessing.size==0&&(this.parsing=!1,de.postMessage({type:"save"}))}async getFileData(e){return new Promise(t=>{de.addEventListener("message",n=>{n.data.type=="file"&&t(n.data)}),de.postMessage({path:e,type:"get"})})}parseFileForCreatures(e,t){if(!t||!t.frontmatter||!t.frontmatter.statblock)return;if(t.frontmatter.statblock==="inline"){de.postMessage({type:"read",path:e.path}),this.pendingContentProcessing.set(e.path,e);return}if(!t.frontmatter.name)return;let n=this.validate(Object.assign({},(0,wn.default)(t.frontmatter),{note:e.path,mtime:e.mtime}));n.traits&&(n.traits=Ie([],n.traits)),this.processMonster(n,e)}processMonster(e,t){e.actions&&(e.actions=Ie([],e.actions)),e.bonus_actions&&(e.bonus_actions=Ie([],e.bonus_actions)),e.reactions&&(e.reactions=Ie([],e.reactions)),e.legendary_actions&&(e.legendary_actions=Ie([],e.legendary_actions)),e["statblock-link"]&&e["statblock-link"].startsWith("#")&&(e["statblock-link"]=`[${e.name}](${t.path}${e["statblock-link"]})`),this.debug&&console.debug(`TTRPG: Adding ${e.name} to bestiary from ${t.basename}`),de.postMessage({type:"update",monster:e,path:t.path})}validate(e){return e}};new ys;\n')}var $n=class extends it.Component{constructor(t){super();this.plugin=t;this.watchPaths=new Map;this.worker=new Cs}get metadataCache(){return this.plugin.app.metadataCache}get vault(){return this.plugin.app.vault}setDebug(){this.worker.postMessage({type:"debug",debug:this.plugin.settings.debug})}onload(){this.setDebug(),this.registerEvent(this.metadataCache.on("changed",async t=>{if(!this.plugin.settings.autoParse)return;let{frontmatter:n}=this.metadataCache.getFileCache(t)??{};if(!n||!n.statblock){this.watchPaths.has(t.path)&&this.delete(t.path);return}this.plugin.settings.debug&&console.debug(`TTRPG: Reparsing ${t.name}`),this.parsePath(t)})),this.registerEvent(this.vault.on("rename",async(t,n)=>{!this.plugin.settings.autoParse||t instanceof it.TFile&&(!this.watchPaths.has(n)||(this.plugin.settings.debug&&console.debug(`TTRPG: Handling rename of ${n} to ${t.path}`),await this.delete(n),this.parsePath(t)))})),this.registerEvent(this.vault.on("delete",t=>{!this.plugin.settings.autoParse||t instanceof it.TFile&&(!this.watchPaths.has(t.path)||this.delete(t.path))})),this.worker.addEventListener("message",t=>{if(t.data.type=="get"){let{path:n}=t.data,i=this.getFileInformation(n);this.worker.postMessage({type:"file",path:n,...i})}}),this.worker.addEventListener("message",async t=>{if(t.data.type=="update"){let{monster:n,path:i}=t.data,s=!1;if(this.watchPaths.has(i)){let r=this.watchPaths.get(i);await this.plugin.deleteMonster(r),s=!0,this.plugin.settings.debug&&console.debug(`TTRPG: Updating ${n.name}`)}this.watchPaths.set(i,n.name),await this.plugin.saveMonster(n,!1,!1),this.plugin.settings.debug&&console.debug(`TTRPG: ${s?"Updated":"Added"} ${n.name}`)}}),this.worker.addEventListener("message",async t=>{t.data.type=="save"&&await this.save()}),this.worker.addEventListener("message",async t=>{if(t.data.type=="read"){let n=this.plugin.app.vault.getAbstractFileByPath(t.data.path);if(!(n instanceof it.TFile))return"";await this.plugin.app.vault.read(n).then(i=>{this.worker.postMessage({type:"content",path:t.data.path,content:i})})}}),this.plugin.app.workspace.onLayoutReady(()=>{for(let[t,n]of this.plugin.settings.monsters.filter(([i,s])=>s.note))this.watchPaths.has(n.note)&&this.plugin.deleteMonster(n.name),this.watchPaths.set(n.note,n.name);!this.plugin.settings.autoParse||this.start()})}async save(){await this.plugin.saveSettings(),this.startTime&&(console.info(`TTRPG Statblocks: Frontmatter Parsing Complete in ${((Date.now()-this.startTime)/1e3).toLocaleString()} seconds.`),this.startTime=0),this.announce&&(new it.Notice("TTRPG Statblocks: Frontmatter Parsing complete."),this.announce=!1)}async delete(t){await this.plugin.deleteMonster(this.watchPaths.get(t)),this.watchPaths.delete(t),this.plugin.settings.debug&&console.debug(`TTRPG: Removing '${t}' from bestiary`)}start(t=!1){this.announce=t,this.startTime=Date.now(),console.info("TTRPG Statblocks: Starting Frontmatter Parsing."),this.plugin.settings.paths?.length||(this.plugin.settings.paths=["/"]);let n=!1;for(let i of this.plugin.settings.paths){let s=this.vault.getAbstractFileByPath(i);!s||(n=!0,this.parsePath(s))}n||this.save()}pathContainsFile(t){if(!this.plugin.settings.paths.length||this.plugin.settings.paths.contains("/"))return!0;for(let n of this.plugin.settings.paths)if(t.path.includes(n))return!0;return!1}parsePath(t){if(!this.pathContainsFile(t))return;let n=new Set;for(let i of this.getFiles(t))n.add(i);this.startParsing([...n])}startParsing(t){t.length&&this.worker.postMessage({type:"queue",paths:t})}getFileInformation(t){let n=this.plugin.app.vault.getAbstractFileByPath(t);if(!(n instanceof it.TFile))return{};if(this.watchPaths.has(n.path)){let s=this.plugin.bestiary.get(this.watchPaths.get(n.path));if(s&&s.mtime&&s.mtime==n.stat.mtime)return{}}return{cache:this.metadataCache.getFileCache(n),file:{path:n.path,basename:n.basename,mtime:n.stat.mtime}}}getFiles(t){let n=[];if(t instanceof it.TFolder)for(let i of t.children)n.push(...this.getFiles(i));return t instanceof it.TFile&&n.push(t.path),n}async reparseVault(){for(let t of this.watchPaths.values())this.plugin.deleteMonster(t,!1,!1);this.start(!1)}onunload(){this.worker.terminate(),this.worker=null}};var Dc=require("obsidian"),jn=class extends Dc.EditorSuggest{constructor(t){super(t.app);this.plugin=t}getSuggestions(t){return this.plugin.getBestiaryNames().filter(n=>n.toLowerCase().contains(t.query.toLowerCase()))}renderSuggestion(t,n){n.createSpan({text:t})}selectSuggestion(t,n){if(!this.context)return;let i=this.context.editor.getLine(this.context.end.line).slice(this.context.end.ch),[s,r]=i.match(/^(\] ?)/)??[];this.context.editor.replaceRange(`${t}`,this.context.start,{...this.context.end,ch:this.context.start.ch+this.context.query.length+(r?.length??0)},"statblocks"),this.context.editor.setCursor(this.context.start.line,this.context.start.ch+t.length),this.close()}onTrigger(t,n,i){let s=n.getRange({line:0,ch:0},t);if(s.indexOf("```statblock\n")===-1)return;let r=s.split(`
|
||
`).reverse(),c=!1;for(let b of r){if(/^```$/.test(b))return;if(/^```statblock/.test(b)){c=!0;break}}if(!c)return;let o=n.getLine(t.line);if(!/^(monster|creature):/m.test(o.slice(0,t.ch)))return null;let l=o.match(/^(monster|creature): (.+)\n?/);if(!l)return null;let[d,u,m]=l;return!m||this.plugin.getBestiaryNames().find(b=>b.toLowerCase()==m.toLowerCase())?null:{end:t,start:{ch:u.length+2,line:t.line},query:m}}};var Ec={monsters:[],layouts:[],default:bt.name,useDice:!0,renderDice:!1,export:!0,showAdvanced:!1,version:{major:null,minor:null,patch:null},paths:["/"],autoParse:!1,disableSRD:!1,tryToRenderLinks:!0,debug:!1},qn=class extends je.Plugin{constructor(){super(...arguments);this.namesHaveChanged=!0;this.watcher=new $n(this);this._sorted=[]}getBestiaryNames(){return this.namesHaveChanged&&(this.names=[...this.bestiary.keys()]),this.names}getRoller(t){return this.canUseDiceRoller?this.app.plugins.getPlugin("obsidian-dice-roller").getRollerSync(t,"statblock",!0):void 0}get canUseDiceRoller(){if(this.app.plugins.getPlugin("obsidian-dice-roller")!=null)if(!this.app.plugins.getPlugin("obsidian-dice-roller").getRollerSync)new je.Notice("Please update Dice Roller to the latest version to use with Initiative Tracker.");else return!0;return!1}get sorted(){let t=Array.from(this.data.values());return this._sorted.length!=t.length&&(this._sorted=va(t).asc(n=>n.name)),this._sorted}get sources(){return new Set(Array.from(this.data.values()).map(t=>t.source).flat())}async onload(){console.log("TTRPG StatBlocks loaded"),await this.loadSettings(),await this.loadMonsterData(),await this.saveSettings(),this.watcher.load(),this.addCommand({id:"parse-frontmatter",name:"Parse Frontmatter for Creatures",callback:()=>{this.watcher.start(!0)}}),(0,je.addIcon)("dropzone-grip",'<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="grip-lines-vertical" class="svg-inline--fa fa-grip-lines-vertical fa-w-8" role="img" viewBox="0 0 256 512"><path fill="currentColor" d="M96 496V16c0-8.8-7.2-16-16-16H48c-8.8 0-16 7.2-16 16v480c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16zm128 0V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v480c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16z"/></svg>'),(0,je.addIcon)("statblock-conditioned",'<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="far" data-icon="question-circle" class="svg-inline--fa fa-question-circle fa-w-16" role="img" viewBox="0 0 512 512"><path fill="currentColor" d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z"/></svg>'),(0,je.addIcon)("dice-roller-dice",'<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="dice" class="svg-inline--fa fa-dice fa-w-20" role="img" viewBox="0 0 640 512"><path fill="currentColor" d="M592 192H473.26c12.69 29.59 7.12 65.2-17 89.32L320 417.58V464c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48V240c0-26.51-21.49-48-48-48zM480 376c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm-46.37-186.7L258.7 14.37c-19.16-19.16-50.23-19.16-69.39 0L14.37 189.3c-19.16 19.16-19.16 50.23 0 69.39L189.3 433.63c19.16 19.16 50.23 19.16 69.39 0L433.63 258.7c19.16-19.17 19.16-50.24 0-69.4zM96 248c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm128 128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm0-128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm0-128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24zm128 128c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"/></svg>'),(0,je.addIcon)("markdown-icon",'<svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"/></svg>'),this.addSettingTab(new qa(this.app,this)),(0,je.addIcon)(tn,Qs),(0,je.addIcon)(an,er),this.bestiary=new Map([...wa(this.settings.disableSRD),...this.data]),Object.defineProperty(window,"bestiary",{value:this.bestiary,writable:!1,configurable:!0}),this.registerMarkdownCodeBlockProcessor("statblock",this.postprocessor.bind(this)),this.registerEditorSuggest(new jn(this)),this.registerEvent(this.app.workspace.on("dice-roller:unload",()=>{this.settings.useDice=!1}))}async loadSettings(){let t=await this.loadData();t!=null&&!("version"in t)?(this.settings={...Ec},this.settings.monsters=t,await this.loadMonsterData(),new je.Notice("5e Statblocks is now TTRPG Statblocks. Check out the ReadMe for more information!")):this.settings={...Ec,...t};let n=this.manifest.version.split(".");this.settings.version={major:Number(n[0]),minor:Number(n[1]),patch:Number(n[2])}}async saveSettings(){this.settings.monsters=this._transformData(this.data),this.bestiary=new Map([...wa(this.settings.disableSRD),...this.data]),await this.saveData(this.settings)}async loadMonsterData(){let t=this.settings.monsters;t||(this.data=new Map),this.data=new Map(t?.map(([n,i])=>[n,(0,Ss.default)(i)])??[])}async saveMonster(t,n=!0,i=!0){!t.name||(this.data.set(t.name,t),this.bestiary.set(t.name,t),this.namesHaveChanged=!0,i&&await this.saveSettings(),n&&(this._sorted=va(Array.from(this.data.values())).asc(s=>s.name)))}async saveMonsters(t){for(let n of t)await this.saveMonster(n,!1,!1);this._sorted=va(Array.from(this.data.values())).asc(n=>n.name),await this.saveSettings()}async updateMonster(t,n){this.data.delete(t.name),await this.saveMonster(n)}async deleteMonsters(...t){for(let n of t)!this.data.has(n)||(this.data.delete(n),this.bestiary.delete(n),this.namesHaveChanged=!0);await this.saveSettings(),this._sorted=va(Array.from(this.data.values())).asc(n=>n.name)}async deleteMonster(t,n=!0,i=!0){!this.data.has(t)||(this.data.delete(t),this.bestiary.delete(t),wa(this.settings.disableSRD).has(t)&&this.bestiary.set(t,wa(this.settings.disableSRD).get(t)),this.namesHaveChanged=!0,i&&await this.saveSettings(),n&&(this._sorted=va(Array.from(this.data.values())).asc(s=>s.name)))}_transformData(t){return[...t??[]].map(([n,i])=>[n,(0,Ss.default)(i)])}onunload(){delete window.bestiary,this.watcher.unload(),console.log("TTRPG StatBlocks unloaded")}exportAsPng(t,n){function i(r){return!r.hasClass||!r.hasClass("clickable-icon")}let s=n.querySelector(".statblock-content");s&&delete s.style.boxShadow,Mc.default.toPng(n,{filter:i,style:{height:"100%"}}).then(r=>{let c=document.createElement("a");c.download=t+".png",c.href=r,c.click(),c.detach()}).catch(r=>{new je.Notice(`There was an error creating the image:
|
||
|
||
${r.message}`),console.error(r)})}parseForDice(t){let n=s=>{let r,c;if(/\w+ [\+\-]\d+/.test(s)){let[,o,l,d]=s.match(/(\w+) ([\+\-])(\d+)/)??[],u=1;l==="-"&&(u=-1),isNaN(Number(d))||(r=`1d20+${u*Number(d)}`,c=`${o} ${l}${d}`)}else if(/[\+\-]\d+ to hit/.test(s)){let[,o,l]=s.match(/([\+\-])(\d+)/)??[],d=1;o==="-"&&(d=-1),isNaN(Number(l))||(r=`1d20+${d*Number(l)}`,c=s)}else if(/\d+\s\(\d+d\d+(?:\s*[+\-]\s*\d+)?\)/.test(s)){let[,o,l]=s.match(/(\d+)\s\((\d+d\d+(?:\s*[+\-]\s*\d+)?)\)/)??[];!isNaN(Number(o))&&l&&(r=l)}return{text:r,original:c}},i=s=>/\w+ [\+\-]\d+/.test(s)||/[\+\-]\d+ to hit/.test(s)||/\d+\s\(\d+d\d+(?:\s*[+\-]\s*\d+)?\)/.test(s);return t.split(/([\+\-]\d+ to hit|\d+\s\(\d+d\d+(?:\s*[+\-]\s*\d+)?\)|\w+ [\+\-]\d+)/).map(s=>i(s)?n(s):s)}get layouts(){return[...Fn,...this.settings.layouts]}get defaultLayout(){return this.layouts?.find(t=>t.name==this.settings.default)??bt}async postprocessor(t,n,i){try{t=t.replace(/^image: (?:\[\[([\s\S]+?)\]\]|\[[\s\S]*?\]\(([\s\S]+?)\))\n/gm,(c,o,l)=>l?.length?`image: ${l}
|
||
`:`image: ${o}
|
||
`).replace(/\[\[([\s\S]+?)\]\]/g,"<STATBLOCK-LINK>$1</STATBLOCK-LINK>").replace(/\[([\s\S]*?)\]\(([\s\S]+?)\)/g,(c,o,l)=>o.length?`<STATBLOCK-LINK>${l}|${o}</STATBLOCK-LINK>`:`<STATBLOCK-LINK>${l}</STATBLOCK-LINK>`);let s=(0,je.parseYaml)(t);n.addClass("statblock-plugin-container"),n.parentElement?.addClass("statblock-plugin-parent");let r=new Tt({container:n,plugin:this,params:s,context:i.sourcePath});i.addChild(r)}catch(s){console.error(`Obsidian Statblock Error:
|
||
${s}`),createEl("pre").setText(`\`\`\`statblock
|
||
There was an error rendering the statblock:
|
||
${s.stack.split(`
|
||
`).filter(c=>!/^at/.test(c?.trim())).join(`
|
||
`)}
|
||
\`\`\``)}}render(t,n,i){let s=Object.assign(this.bestiary.get(t.name)??{},{...t});return s?(i&&(s.name=i),new Tt({container:n,monster:s,plugin:this,context:"STATBLOCK_RENDERER"})):null}getLayoutOrDefault(t){return this.layouts.find(n=>n.name==t?.layout)??this.defaultLayout}};
|