md-runbook 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cli.js +254 -217
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -1,76 +1,77 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
`}return
|
|
4
|
-
`}return Oe.substring(0,Oe.length-1)},H.renderTo2dContext=function(x,v){v=v||2;for(var A=H.getModuleCount(),N=0;N<A;N++)for(var F=0;F<A;F++)x.fillStyle=H.isDark(N,F)?"black":"white",x.fillRect(F*v,N*v,v,v)},H};r.stringToBytesFuncs={default:function(E){for(var S=[],w=0;w<E.length;w+=1){var y=E.charCodeAt(w);S.push(y&255)}return S}},r.stringToBytes=r.stringToBytesFuncs.default,r.createStringToBytes=function(E,S){var w=(function(){for(var O=h(E),$=function(){var V=O.read();if(V==-1)throw"eof";return V},b=0,m={};;){var G=O.read();if(G==-1)break;var T=$(),H=$(),Q=$(),z=String.fromCharCode(G<<8|T),q=H<<8|Q;m[z]=q,b+=1}if(b!=S)throw b+" != "+S;return m})(),y=63;return function(O){for(var $=[],b=0;b<O.length;b+=1){var m=O.charCodeAt(b);if(m<128)$.push(m);else{var G=w[O.charAt(b)];typeof G=="number"?(G&255)==G?$.push(G):($.push(G>>>8),$.push(G&255)):$.push(y)}}return $}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},n={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=(function(){var E=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],S=1335,w=7973,y=21522,O={},$=function(b){for(var m=0;b!=0;)m+=1,b>>>=1;return m};return O.getBCHTypeInfo=function(b){for(var m=b<<10;$(m)-$(S)>=0;)m^=S<<$(m)-$(S);return(b<<10|m)^y},O.getBCHTypeNumber=function(b){for(var m=b<<12;$(m)-$(w)>=0;)m^=w<<$(m)-$(w);return b<<12|m},O.getPatternPosition=function(b){return E[b-1]},O.getMaskFunction=function(b){switch(b){case n.PATTERN000:return function(m,G){return(m+G)%2==0};case n.PATTERN001:return function(m,G){return m%2==0};case n.PATTERN010:return function(m,G){return G%3==0};case n.PATTERN011:return function(m,G){return(m+G)%3==0};case n.PATTERN100:return function(m,G){return(Math.floor(m/2)+Math.floor(G/3))%2==0};case n.PATTERN101:return function(m,G){return m*G%2+m*G%3==0};case n.PATTERN110:return function(m,G){return(m*G%2+m*G%3)%2==0};case n.PATTERN111:return function(m,G){return(m*G%3+(m+G)%2)%2==0};default:throw"bad maskPattern:"+b}},O.getErrorCorrectPolynomial=function(b){for(var m=i([1],0),G=0;G<b;G+=1)m=m.multiply(i([1,B.gexp(G)],0));return m},O.getLengthInBits=function(b,m){if(1<=m&&m<10)switch(b){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw"mode:"+b}else if(m<27)switch(b){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw"mode:"+b}else if(m<41)switch(b){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw"mode:"+b}else throw"type:"+m},O.getLostPoint=function(b){for(var m=b.getModuleCount(),G=0,T=0;T<m;T+=1)for(var H=0;H<m;H+=1){for(var Q=0,z=b.isDark(T,H),q=-1;q<=1;q+=1)if(!(T+q<0||m<=T+q))for(var V=-1;V<=1;V+=1)H+V<0||m<=H+V||q==0&&V==0||z==b.isDark(T+q,H+V)&&(Q+=1);Q>5&&(G+=3+Q-5)}for(var T=0;T<m-1;T+=1)for(var H=0;H<m-1;H+=1){var ee=0;b.isDark(T,H)&&(ee+=1),b.isDark(T+1,H)&&(ee+=1),b.isDark(T,H+1)&&(ee+=1),b.isDark(T+1,H+1)&&(ee+=1),(ee==0||ee==4)&&(G+=3)}for(var T=0;T<m;T+=1)for(var H=0;H<m-6;H+=1)b.isDark(T,H)&&!b.isDark(T,H+1)&&b.isDark(T,H+2)&&b.isDark(T,H+3)&&b.isDark(T,H+4)&&!b.isDark(T,H+5)&&b.isDark(T,H+6)&&(G+=40);for(var H=0;H<m;H+=1)for(var T=0;T<m-6;T+=1)b.isDark(T,H)&&!b.isDark(T+1,H)&&b.isDark(T+2,H)&&b.isDark(T+3,H)&&b.isDark(T+4,H)&&!b.isDark(T+5,H)&&b.isDark(T+6,H)&&(G+=40);for(var Be=0,H=0;H<m;H+=1)for(var T=0;T<m;T+=1)b.isDark(T,H)&&(Be+=1);var te=Math.abs(100*Be/m/m-50)/5;return G+=te*10,G},O})(),B=(function(){for(var E=new Array(256),S=new Array(256),w=0;w<8;w+=1)E[w]=1<<w;for(var w=8;w<256;w+=1)E[w]=E[w-4]^E[w-5]^E[w-6]^E[w-8];for(var w=0;w<255;w+=1)S[E[w]]=w;var y={};return y.glog=function(O){if(O<1)throw"glog("+O+")";return S[O]},y.gexp=function(O){for(;O<0;)O+=255;for(;O>=256;)O-=255;return E[O]},y})();function i(E,S){if(typeof E.length>"u")throw E.length+"/"+S;var w=(function(){for(var O=0;O<E.length&&E[O]==0;)O+=1;for(var $=new Array(E.length-O+S),b=0;b<E.length-O;b+=1)$[b]=E[b+O];return $})(),y={};return y.getAt=function(O){return w[O]},y.getLength=function(){return w.length},y.multiply=function(O){for(var $=new Array(y.getLength()+O.getLength()-1),b=0;b<y.getLength();b+=1)for(var m=0;m<O.getLength();m+=1)$[b+m]^=B.gexp(B.glog(y.getAt(b))+B.glog(O.getAt(m)));return i($,0)},y.mod=function(O){if(y.getLength()-O.getLength()<0)return y;for(var $=B.glog(y.getAt(0))-B.glog(O.getAt(0)),b=new Array(y.getLength()),m=0;m<y.getLength();m+=1)b[m]=y.getAt(m);for(var m=0;m<O.getLength();m+=1)b[m]^=B.gexp(B.glog(O.getAt(m))+$);return i(b,0).mod(O)},y}var o=(function(){var E=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],S=function(O,$){var b={};return b.totalCount=O,b.dataCount=$,b},w={},y=function(O,$){switch($){case t.L:return E[(O-1)*4+0];case t.M:return E[(O-1)*4+1];case t.Q:return E[(O-1)*4+2];case t.H:return E[(O-1)*4+3];default:return}};return w.getRSBlocks=function(O,$){var b=y(O,$);if(typeof b>"u")throw"bad rs block @ typeNumber:"+O+"/errorCorrectionLevel:"+$;for(var m=b.length/3,G=[],T=0;T<m;T+=1)for(var H=b[T*3+0],Q=b[T*3+1],z=b[T*3+2],q=0;q<H;q+=1)G.push(S(Q,z));return G},w})(),a=function(){var E=[],S=0,w={};return w.getBuffer=function(){return E},w.getAt=function(y){var O=Math.floor(y/8);return(E[O]>>>7-y%8&1)==1},w.put=function(y,O){for(var $=0;$<O;$+=1)w.putBit((y>>>O-$-1&1)==1)},w.getLengthInBits=function(){return S},w.putBit=function(y){var O=Math.floor(S/8);E.length<=O&&E.push(0),y&&(E[O]|=128>>>S%8),S+=1},w},c=function(E){var S=e.MODE_NUMBER,w=E,y={};y.getMode=function(){return S},y.getLength=function(b){return w.length},y.write=function(b){for(var m=w,G=0;G+2<m.length;)b.put(O(m.substring(G,G+3)),10),G+=3;G<m.length&&(m.length-G==1?b.put(O(m.substring(G,G+1)),4):m.length-G==2&&b.put(O(m.substring(G,G+2)),7))};var O=function(b){for(var m=0,G=0;G<b.length;G+=1)m=m*10+$(b.charAt(G));return m},$=function(b){if("0"<=b&&b<="9")return b.charCodeAt(0)-48;throw"illegal char :"+b};return y},u=function(E){var S=e.MODE_ALPHA_NUM,w=E,y={};y.getMode=function(){return S},y.getLength=function($){return w.length},y.write=function($){for(var b=w,m=0;m+1<b.length;)$.put(O(b.charAt(m))*45+O(b.charAt(m+1)),11),m+=2;m<b.length&&$.put(O(b.charAt(m)),6)};var O=function($){if("0"<=$&&$<="9")return $.charCodeAt(0)-48;if("A"<=$&&$<="Z")return $.charCodeAt(0)-65+10;switch($){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+$}};return y},l=function(E){var S=e.MODE_8BIT_BYTE,w=E,y=r.stringToBytes(E),O={};return O.getMode=function(){return S},O.getLength=function($){return y.length},O.write=function($){for(var b=0;b<y.length;b+=1)$.put(y[b],8)},O},f=function(E){var S=e.MODE_KANJI,w=E,y=r.stringToBytesFuncs.SJIS;if(!y)throw"sjis not supported.";(function(b,m){var G=y(b);if(G.length!=2||(G[0]<<8|G[1])!=m)throw"sjis not supported."})("\u53CB",38726);var O=y(E),$={};return $.getMode=function(){return S},$.getLength=function(b){return~~(O.length/2)},$.write=function(b){for(var m=O,G=0;G+1<m.length;){var T=(255&m[G])<<8|255&m[G+1];if(33088<=T&&T<=40956)T-=33088;else if(57408<=T&&T<=60351)T-=49472;else throw"illegal char at "+(G+1)+"/"+T;T=(T>>>8&255)*192+(T&255),b.put(T,13),G+=2}if(G<m.length)throw"illegal char at "+(G+1)},$},C=function(){var E=[],S={};return S.writeByte=function(w){E.push(w&255)},S.writeShort=function(w){S.writeByte(w),S.writeByte(w>>>8)},S.writeBytes=function(w,y,O){y=y||0,O=O||w.length;for(var $=0;$<O;$+=1)S.writeByte(w[$+y])},S.writeString=function(w){for(var y=0;y<w.length;y+=1)S.writeByte(w.charCodeAt(y))},S.toByteArray=function(){return E},S.toString=function(){var w="";w+="[";for(var y=0;y<E.length;y+=1)y>0&&(w+=","),w+=E[y];return w+="]",w},S},d=function(){var E=0,S=0,w=0,y="",O={},$=function(m){y+=String.fromCharCode(b(m&63))},b=function(m){if(!(m<0)){if(m<26)return 65+m;if(m<52)return 97+(m-26);if(m<62)return 48+(m-52);if(m==62)return 43;if(m==63)return 47}throw"n:"+m};return O.writeByte=function(m){for(E=E<<8|m&255,S+=8,w+=1;S>=6;)$(E>>>S-6),S-=6},O.flush=function(){if(S>0&&($(E<<6-S),E=0,S=0),w%3!=0)for(var m=3-w%3,G=0;G<m;G+=1)y+="="},O.toString=function(){return y},O},h=function(E){var S=E,w=0,y=0,O=0,$={};$.read=function(){for(;O<8;){if(w>=S.length){if(O==0)return-1;throw"unexpected end of file./"+O}var m=S.charAt(w);if(w+=1,m=="=")return O=0,-1;if(m.match(/^\s$/))continue;y=y<<6|b(m.charCodeAt(0)),O+=6}var G=y>>>O-8&255;return O-=8,G};var b=function(m){if(65<=m&&m<=90)return m-65;if(97<=m&&m<=122)return m-97+26;if(48<=m&&m<=57)return m-48+52;if(m==43)return 62;if(m==47)return 63;throw"c:"+m};return $},k=function(E,S){var w=E,y=S,O=new Array(E*S),$={};$.setPixel=function(T,H,Q){O[H*w+T]=Q},$.write=function(T){T.writeString("GIF87a"),T.writeShort(w),T.writeShort(y),T.writeByte(128),T.writeByte(0),T.writeByte(0),T.writeByte(0),T.writeByte(0),T.writeByte(0),T.writeByte(255),T.writeByte(255),T.writeByte(255),T.writeString(","),T.writeShort(0),T.writeShort(0),T.writeShort(w),T.writeShort(y),T.writeByte(0);var H=2,Q=m(H);T.writeByte(H);for(var z=0;Q.length-z>255;)T.writeByte(255),T.writeBytes(Q,z,255),z+=255;T.writeByte(Q.length-z),T.writeBytes(Q,z,Q.length-z),T.writeByte(0),T.writeString(";")};var b=function(T){var H=T,Q=0,z=0,q={};return q.write=function(V,ee){if(V>>>ee)throw"length over";for(;Q+ee>=8;)H.writeByte(255&(V<<Q|z)),ee-=8-Q,V>>>=8-Q,z=0,Q=0;z=V<<Q|z,Q=Q+ee},q.flush=function(){Q>0&&H.writeByte(z)},q},m=function(T){for(var H=1<<T,Q=(1<<T)+1,z=T+1,q=G(),V=0;V<H;V+=1)q.add(String.fromCharCode(V));q.add(String.fromCharCode(H)),q.add(String.fromCharCode(Q));var ee=C(),Be=b(ee);Be.write(H,z);var te=0,De=String.fromCharCode(O[te]);for(te+=1;te<O.length;){var pe=String.fromCharCode(O[te]);te+=1,q.contains(De+pe)?De=De+pe:(Be.write(q.indexOf(De),z),q.size()<4095&&(q.size()==1<<z&&(z+=1),q.add(De+pe)),De=pe)}return Be.write(q.indexOf(De),z),Be.write(Q,z),Be.flush(),ee.toByteArray()},G=function(){var T={},H=0,Q={};return Q.add=function(z){if(Q.contains(z))throw"dup key:"+z;T[z]=H,H+=1},Q.size=function(){return H},Q.indexOf=function(z){return T[z]},Q.contains=function(z){return typeof T[z]<"u"},Q};return $},R=function(E,S,w){for(var y=k(E,S),O=0;O<S;O+=1)for(var $=0;$<E;$+=1)y.setPixel($,O,w($,O));var b=C();y.write(b);for(var m=d(),G=b.toByteArray(),T=0;T<G.length;T+=1)m.writeByte(G[T]);return m.flush(),"data:image/gif;base64,"+m};return r})();(function(){Al.stringToBytesFuncs["UTF-8"]=function(r){function e(t){for(var n=[],s=0;s<t.length;s++){var B=t.charCodeAt(s);B<128?n.push(B):B<2048?n.push(192|B>>6,128|B&63):B<55296||B>=57344?n.push(224|B>>12,128|B>>6&63,128|B&63):(s++,B=65536+((B&1023)<<10|t.charCodeAt(s)&1023),n.push(240|B>>18,128|B>>12&63,128|B>>6&63,128|B&63))}return n}return e(r)}})();(function(r){typeof define=="function"&&define.amd?define([],r):typeof Rl=="object"&&(yl.exports=r())})(function(){return Al})});var BC={};su(BC,{estimate:()=>Ql,lint:()=>Yl,main:()=>ql,parseArgs:()=>zl});module.exports=Bu(BC);var He=ae(require("node:fs")),Dt=ae(require("node:path"));var hi={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0};function Ee(r){return typeof r=="string"}function di(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="markup"&&Ee(e.lead)&&Ee(e.content)&&Ee(e.trail)&&(e.eol===`
|
|
2
|
+
"use strict";var cf=Object.create;var Rs=Object.defineProperty;var ff=Object.getOwnPropertyDescriptor;var Cf=Object.getOwnPropertyNames;var df=Object.getPrototypeOf,hf=Object.prototype.hasOwnProperty;var pf=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},gf=(r,e)=>{for(var t in e)Rs(r,t,{get:e[t],enumerable:!0})},Ca=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Cf(e))!hf.call(r,s)&&s!==t&&Rs(r,s,{get:()=>e[s],enumerable:!(n=ff(e,s))||n.enumerable});return r};var Ce=(r,e,t)=>(t=r!=null?cf(df(r)):{},Ca(e||!r||!r.__esModule?Rs(t,"default",{value:r,enumerable:!0}):t,r)),mf=r=>Ca(Rs({},"__esModule",{value:!0}),r);var Mc=pf((Lc,Nc)=>{var Tc=(function(){var r=function(E,b){var D=236,y=17,v=E,$=t[b],k=null,m=0,L=null,A=[],H={},Y=function(I,M){m=v*4+17,k=(function(F){for(var G=new Array(F),P=0;P<F;P+=1){G[P]=new Array(F);for(var U=0;U<F;U+=1)G[P][U]=null}return G})(m),z(0,0),z(m-7,0),z(0,m-7),Q(),Z(),ie(I,M),v>=7&&ne(I),L==null&&(L=Xe(v,$,A)),De(L,M)},z=function(I,M){for(var F=-1;F<=7;F+=1)if(!(I+F<=-1||m<=I+F))for(var G=-1;G<=7;G+=1)M+G<=-1||m<=M+G||(0<=F&&F<=6&&(G==0||G==6)||0<=G&&G<=6&&(F==0||F==6)||2<=F&&F<=4&&2<=G&&G<=4?k[I+F][M+G]=!0:k[I+F][M+G]=!1)},te=function(){for(var I=0,M=0,F=0;F<8;F+=1){Y(!0,F);var G=s.getLostPoint(H);(F==0||I>G)&&(I=G,M=F)}return M},Z=function(){for(var I=8;I<m-8;I+=1)k[I][6]==null&&(k[I][6]=I%2==0);for(var M=8;M<m-8;M+=1)k[6][M]==null&&(k[6][M]=M%2==0)},Q=function(){for(var I=s.getPatternPosition(v),M=0;M<I.length;M+=1)for(var F=0;F<I.length;F+=1){var G=I[M],P=I[F];if(k[G][P]==null)for(var U=-2;U<=2;U+=1)for(var X=-2;X<=2;X+=1)U==-2||U==2||X==-2||X==2||U==0&&X==0?k[G+U][P+X]=!0:k[G+U][P+X]=!1}},ne=function(I){for(var M=s.getBCHTypeNumber(v),F=0;F<18;F+=1){var G=!I&&(M>>F&1)==1;k[Math.floor(F/3)][F%3+m-8-3]=G}for(var F=0;F<18;F+=1){var G=!I&&(M>>F&1)==1;k[F%3+m-8-3][Math.floor(F/3)]=G}},ie=function(I,M){for(var F=$<<3|M,G=s.getBCHTypeInfo(F),P=0;P<15;P+=1){var U=!I&&(G>>P&1)==1;P<6?k[P][8]=U:P<8?k[P+1][8]=U:k[m-15+P][8]=U}for(var P=0;P<15;P+=1){var U=!I&&(G>>P&1)==1;P<8?k[8][m-P-1]=U:P<9?k[8][15-P-1+1]=U:k[8][15-P-1]=U}k[m-8][8]=!I},De=function(I,M){for(var F=-1,G=m-1,P=7,U=0,X=s.getMaskFunction(M),q=m-1;q>0;q-=2)for(q==6&&(q-=1);;){for(var le=0;le<2;le+=1)if(k[G][q-le]==null){var we=!1;U<I.length&&(we=(I[U]>>>P&1)==1);var W=X(G,q-le);W&&(we=!we),k[G][q-le]=we,P-=1,P==-1&&(U+=1,P=7)}if(G+=F,G<0||m<=G){G-=F,F=-F;break}}},de=function(I,M){for(var F=0,G=0,P=0,U=new Array(M.length),X=new Array(M.length),q=0;q<M.length;q+=1){var le=M[q].dataCount,we=M[q].totalCount-le;G=Math.max(G,le),P=Math.max(P,we),U[q]=new Array(le);for(var W=0;W<U[q].length;W+=1)U[q][W]=255&I.getBuffer()[W+F];F+=le;var Ne=s.getErrorCorrectPolynomial(we),et=o(U[q],Ne.getLength()-1),Hn=et.mod(Ne);X[q]=new Array(Ne.getLength()-1);for(var W=0;W<X[q].length;W+=1){var Qt=W+Hn.getLength()-X[q].length;X[q][W]=Qt>=0?Hn.getAt(Qt):0}}for(var un=0,W=0;W<M.length;W+=1)un+=M[W].totalCount;for(var qt=new Array(un),Wt=0,W=0;W<G;W+=1)for(var q=0;q<M.length;q+=1)W<U[q].length&&(qt[Wt]=U[q][W],Wt+=1);for(var W=0;W<P;W+=1)for(var q=0;q<M.length;q+=1)W<X[q].length&&(qt[Wt]=X[q][W],Wt+=1);return qt},Xe=function(I,M,F){for(var G=B.getRSBlocks(I,M),P=a(),U=0;U<F.length;U+=1){var X=F[U];P.put(X.getMode(),4),P.put(X.getLength(),s.getLengthInBits(X.getMode(),I)),X.write(P)}for(var q=0,U=0;U<G.length;U+=1)q+=G[U].dataCount;if(P.getLengthInBits()>q*8)throw"code length overflow. ("+P.getLengthInBits()+">"+q*8+")";for(P.getLengthInBits()+4<=q*8&&P.put(0,4);P.getLengthInBits()%8!=0;)P.putBit(!1);for(;!(P.getLengthInBits()>=q*8||(P.put(D,8),P.getLengthInBits()>=q*8));)P.put(y,8);return de(P,G)};H.addData=function(I,M){M=M||"Byte";var F=null;switch(M){case"Numeric":F=c(I);break;case"Alphanumeric":F=u(I);break;case"Byte":F=l(I);break;case"Kanji":F=C(I);break;default:throw"mode:"+M}A.push(F),L=null},H.isDark=function(I,M){if(I<0||m<=I||M<0||m<=M)throw I+","+M;return k[I][M]},H.getModuleCount=function(){return m},H.make=function(){if(v<1){for(var I=1;I<40;I++){for(var M=B.getRSBlocks(I,$),F=a(),G=0;G<A.length;G++){var P=A[G];F.put(P.getMode(),4),F.put(P.getLength(),s.getLengthInBits(P.getMode(),I)),P.write(F)}for(var U=0,G=0;G<M.length;G++)U+=M[G].dataCount;if(F.getLengthInBits()<=U*8)break}v=I}Y(!1,te())},H.createTableTag=function(I,M){I=I||2,M=typeof M>"u"?I*4:M;var F="";F+='<table style="',F+=" border-width: 0px; border-style: none;",F+=" border-collapse: collapse;",F+=" padding: 0px; margin: "+M+"px;",F+='">',F+="<tbody>";for(var G=0;G<H.getModuleCount();G+=1){F+="<tr>";for(var P=0;P<H.getModuleCount();P+=1)F+='<td style="',F+=" border-width: 0px; border-style: none;",F+=" border-collapse: collapse;",F+=" padding: 0px; margin: 0px;",F+=" width: "+I+"px;",F+=" height: "+I+"px;",F+=" background-color: ",F+=H.isDark(G,P)?"#000000":"#ffffff",F+=";",F+='"/>';F+="</tr>"}return F+="</tbody>",F+="</table>",F},H.createSvgTag=function(I,M,F,G){var P={};typeof arguments[0]=="object"&&(P=arguments[0],I=P.cellSize,M=P.margin,F=P.alt,G=P.title),I=I||2,M=typeof M>"u"?I*4:M,F=typeof F=="string"?{text:F}:F||{},F.text=F.text||null,F.id=F.text?F.id||"qrcode-description":null,G=typeof G=="string"?{text:G}:G||{},G.text=G.text||null,G.id=G.text?G.id||"qrcode-title":null;var U=H.getModuleCount()*I+M*2,X,q,le,we,W="",Ne;for(Ne="l"+I+",0 0,"+I+" -"+I+",0 0,-"+I+"z ",W+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',W+=P.scalable?"":' width="'+U+'px" height="'+U+'px"',W+=' viewBox="0 0 '+U+" "+U+'" ',W+=' preserveAspectRatio="xMinYMin meet"',W+=G.text||F.text?' role="img" aria-labelledby="'+ye([G.id,F.id].join(" ").trim())+'"':"",W+=">",W+=G.text?'<title id="'+ye(G.id)+'">'+ye(G.text)+"</title>":"",W+=F.text?'<description id="'+ye(F.id)+'">'+ye(F.text)+"</description>":"",W+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',W+='<path d="',le=0;le<H.getModuleCount();le+=1)for(we=le*I+M,X=0;X<H.getModuleCount();X+=1)H.isDark(le,X)&&(q=X*I+M,W+="M"+q+","+we+Ne);return W+='" stroke="transparent" fill="black"/>',W+="</svg>",W},H.createDataURL=function(I,M){I=I||2,M=typeof M>"u"?I*4:M;var F=H.getModuleCount()*I+M*2,G=M,P=F-M;return S(F,F,function(U,X){if(G<=U&&U<P&&G<=X&&X<P){var q=Math.floor((U-G)/I),le=Math.floor((X-G)/I);return H.isDark(le,q)?0:1}else return 1})},H.createImgTag=function(I,M,F){I=I||2,M=typeof M>"u"?I*4:M;var G=H.getModuleCount()*I+M*2,P="";return P+="<img",P+=' src="',P+=H.createDataURL(I,M),P+='"',P+=' width="',P+=G,P+='"',P+=' height="',P+=G,P+='"',F&&(P+=' alt="',P+=ye(F),P+='"'),P+="/>",P};var ye=function(I){for(var M="",F=0;F<I.length;F+=1){var G=I.charAt(F);switch(G){case"<":M+="<";break;case">":M+=">";break;case"&":M+="&";break;case'"':M+=""";break;default:M+=G;break}}return M},xe=function(I){var M=1;I=typeof I>"u"?M*2:I;var F=H.getModuleCount()*M+I*2,G=I,P=F-I,U,X,q,le,we,W={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},Ne={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},et="";for(U=0;U<F;U+=2){for(q=Math.floor((U-G)/M),le=Math.floor((U+1-G)/M),X=0;X<F;X+=1)we="\u2588",G<=X&&X<P&&G<=U&&U<P&&H.isDark(q,Math.floor((X-G)/M))&&(we=" "),G<=X&&X<P&&G<=U+1&&U+1<P&&H.isDark(le,Math.floor((X-G)/M))?we+=" ":we+="\u2588",et+=I<1&&U+1>=P?Ne[we]:W[we];et+=`
|
|
3
|
+
`}return F%2&&I>0?et.substring(0,et.length-F-1)+Array(F+1).join("\u2580"):et.substring(0,et.length-1)};return H.createASCII=function(I,M){if(I=I||1,I<2)return xe(M);I-=1,M=typeof M>"u"?I*2:M;var F=H.getModuleCount()*I+M*2,G=M,P=F-M,U,X,q,le,we=Array(I+1).join("\u2588\u2588"),W=Array(I+1).join(" "),Ne="",et="";for(U=0;U<F;U+=1){for(q=Math.floor((U-G)/I),et="",X=0;X<F;X+=1)le=1,G<=X&&X<P&&G<=U&&U<P&&H.isDark(q,Math.floor((X-G)/I))&&(le=0),et+=le?we:W;for(q=0;q<I;q+=1)Ne+=et+`
|
|
4
|
+
`}return Ne.substring(0,Ne.length-1)},H.renderTo2dContext=function(I,M){M=M||2;for(var F=H.getModuleCount(),G=0;G<F;G++)for(var P=0;P<F;P++)I.fillStyle=H.isDark(G,P)?"black":"white",I.fillRect(P*M,G*M,M,M)},H};r.stringToBytesFuncs={default:function(E){for(var b=[],D=0;D<E.length;D+=1){var y=E.charCodeAt(D);b.push(y&255)}return b}},r.stringToBytes=r.stringToBytesFuncs.default,r.createStringToBytes=function(E,b){var D=(function(){for(var v=d(E),$=function(){var Z=v.read();if(Z==-1)throw"eof";return Z},k=0,m={};;){var L=v.read();if(L==-1)break;var A=$(),H=$(),Y=$(),z=String.fromCharCode(L<<8|A),te=H<<8|Y;m[z]=te,k+=1}if(k!=b)throw k+" != "+b;return m})(),y=63;return function(v){for(var $=[],k=0;k<v.length;k+=1){var m=v.charCodeAt(k);if(m<128)$.push(m);else{var L=D[v.charAt(k)];typeof L=="number"?(L&255)==L?$.push(L):($.push(L>>>8),$.push(L&255)):$.push(y)}}return $}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},n={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=(function(){var E=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],b=1335,D=7973,y=21522,v={},$=function(k){for(var m=0;k!=0;)m+=1,k>>>=1;return m};return v.getBCHTypeInfo=function(k){for(var m=k<<10;$(m)-$(b)>=0;)m^=b<<$(m)-$(b);return(k<<10|m)^y},v.getBCHTypeNumber=function(k){for(var m=k<<12;$(m)-$(D)>=0;)m^=D<<$(m)-$(D);return k<<12|m},v.getPatternPosition=function(k){return E[k-1]},v.getMaskFunction=function(k){switch(k){case n.PATTERN000:return function(m,L){return(m+L)%2==0};case n.PATTERN001:return function(m,L){return m%2==0};case n.PATTERN010:return function(m,L){return L%3==0};case n.PATTERN011:return function(m,L){return(m+L)%3==0};case n.PATTERN100:return function(m,L){return(Math.floor(m/2)+Math.floor(L/3))%2==0};case n.PATTERN101:return function(m,L){return m*L%2+m*L%3==0};case n.PATTERN110:return function(m,L){return(m*L%2+m*L%3)%2==0};case n.PATTERN111:return function(m,L){return(m*L%3+(m+L)%2)%2==0};default:throw"bad maskPattern:"+k}},v.getErrorCorrectPolynomial=function(k){for(var m=o([1],0),L=0;L<k;L+=1)m=m.multiply(o([1,i.gexp(L)],0));return m},v.getLengthInBits=function(k,m){if(1<=m&&m<10)switch(k){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw"mode:"+k}else if(m<27)switch(k){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw"mode:"+k}else if(m<41)switch(k){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw"mode:"+k}else throw"type:"+m},v.getLostPoint=function(k){for(var m=k.getModuleCount(),L=0,A=0;A<m;A+=1)for(var H=0;H<m;H+=1){for(var Y=0,z=k.isDark(A,H),te=-1;te<=1;te+=1)if(!(A+te<0||m<=A+te))for(var Z=-1;Z<=1;Z+=1)H+Z<0||m<=H+Z||te==0&&Z==0||z==k.isDark(A+te,H+Z)&&(Y+=1);Y>5&&(L+=3+Y-5)}for(var A=0;A<m-1;A+=1)for(var H=0;H<m-1;H+=1){var Q=0;k.isDark(A,H)&&(Q+=1),k.isDark(A+1,H)&&(Q+=1),k.isDark(A,H+1)&&(Q+=1),k.isDark(A+1,H+1)&&(Q+=1),(Q==0||Q==4)&&(L+=3)}for(var A=0;A<m;A+=1)for(var H=0;H<m-6;H+=1)k.isDark(A,H)&&!k.isDark(A,H+1)&&k.isDark(A,H+2)&&k.isDark(A,H+3)&&k.isDark(A,H+4)&&!k.isDark(A,H+5)&&k.isDark(A,H+6)&&(L+=40);for(var H=0;H<m;H+=1)for(var A=0;A<m-6;A+=1)k.isDark(A,H)&&!k.isDark(A+1,H)&&k.isDark(A+2,H)&&k.isDark(A+3,H)&&k.isDark(A+4,H)&&!k.isDark(A+5,H)&&k.isDark(A+6,H)&&(L+=40);for(var ne=0,H=0;H<m;H+=1)for(var A=0;A<m;A+=1)k.isDark(A,H)&&(ne+=1);var ie=Math.abs(100*ne/m/m-50)/5;return L+=ie*10,L},v})(),i=(function(){for(var E=new Array(256),b=new Array(256),D=0;D<8;D+=1)E[D]=1<<D;for(var D=8;D<256;D+=1)E[D]=E[D-4]^E[D-5]^E[D-6]^E[D-8];for(var D=0;D<255;D+=1)b[E[D]]=D;var y={};return y.glog=function(v){if(v<1)throw"glog("+v+")";return b[v]},y.gexp=function(v){for(;v<0;)v+=255;for(;v>=256;)v-=255;return E[v]},y})();function o(E,b){if(typeof E.length>"u")throw E.length+"/"+b;var D=(function(){for(var v=0;v<E.length&&E[v]==0;)v+=1;for(var $=new Array(E.length-v+b),k=0;k<E.length-v;k+=1)$[k]=E[k+v];return $})(),y={};return y.getAt=function(v){return D[v]},y.getLength=function(){return D.length},y.multiply=function(v){for(var $=new Array(y.getLength()+v.getLength()-1),k=0;k<y.getLength();k+=1)for(var m=0;m<v.getLength();m+=1)$[k+m]^=i.gexp(i.glog(y.getAt(k))+i.glog(v.getAt(m)));return o($,0)},y.mod=function(v){if(y.getLength()-v.getLength()<0)return y;for(var $=i.glog(y.getAt(0))-i.glog(v.getAt(0)),k=new Array(y.getLength()),m=0;m<y.getLength();m+=1)k[m]=y.getAt(m);for(var m=0;m<v.getLength();m+=1)k[m]^=i.gexp(i.glog(v.getAt(m))+$);return o(k,0).mod(v)},y}var B=(function(){var E=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],b=function(v,$){var k={};return k.totalCount=v,k.dataCount=$,k},D={},y=function(v,$){switch($){case t.L:return E[(v-1)*4+0];case t.M:return E[(v-1)*4+1];case t.Q:return E[(v-1)*4+2];case t.H:return E[(v-1)*4+3];default:return}};return D.getRSBlocks=function(v,$){var k=y(v,$);if(typeof k>"u")throw"bad rs block @ typeNumber:"+v+"/errorCorrectionLevel:"+$;for(var m=k.length/3,L=[],A=0;A<m;A+=1)for(var H=k[A*3+0],Y=k[A*3+1],z=k[A*3+2],te=0;te<H;te+=1)L.push(b(Y,z));return L},D})(),a=function(){var E=[],b=0,D={};return D.getBuffer=function(){return E},D.getAt=function(y){var v=Math.floor(y/8);return(E[v]>>>7-y%8&1)==1},D.put=function(y,v){for(var $=0;$<v;$+=1)D.putBit((y>>>v-$-1&1)==1)},D.getLengthInBits=function(){return b},D.putBit=function(y){var v=Math.floor(b/8);E.length<=v&&E.push(0),y&&(E[v]|=128>>>b%8),b+=1},D},c=function(E){var b=e.MODE_NUMBER,D=E,y={};y.getMode=function(){return b},y.getLength=function(k){return D.length},y.write=function(k){for(var m=D,L=0;L+2<m.length;)k.put(v(m.substring(L,L+3)),10),L+=3;L<m.length&&(m.length-L==1?k.put(v(m.substring(L,L+1)),4):m.length-L==2&&k.put(v(m.substring(L,L+2)),7))};var v=function(k){for(var m=0,L=0;L<k.length;L+=1)m=m*10+$(k.charAt(L));return m},$=function(k){if("0"<=k&&k<="9")return k.charCodeAt(0)-48;throw"illegal char :"+k};return y},u=function(E){var b=e.MODE_ALPHA_NUM,D=E,y={};y.getMode=function(){return b},y.getLength=function($){return D.length},y.write=function($){for(var k=D,m=0;m+1<k.length;)$.put(v(k.charAt(m))*45+v(k.charAt(m+1)),11),m+=2;m<k.length&&$.put(v(k.charAt(m)),6)};var v=function($){if("0"<=$&&$<="9")return $.charCodeAt(0)-48;if("A"<=$&&$<="Z")return $.charCodeAt(0)-65+10;switch($){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+$}};return y},l=function(E){var b=e.MODE_8BIT_BYTE,D=E,y=r.stringToBytes(E),v={};return v.getMode=function(){return b},v.getLength=function($){return y.length},v.write=function($){for(var k=0;k<y.length;k+=1)$.put(y[k],8)},v},C=function(E){var b=e.MODE_KANJI,D=E,y=r.stringToBytesFuncs.SJIS;if(!y)throw"sjis not supported.";(function(k,m){var L=y(k);if(L.length!=2||(L[0]<<8|L[1])!=m)throw"sjis not supported."})("\u53CB",38726);var v=y(E),$={};return $.getMode=function(){return b},$.getLength=function(k){return~~(v.length/2)},$.write=function(k){for(var m=v,L=0;L+1<m.length;){var A=(255&m[L])<<8|255&m[L+1];if(33088<=A&&A<=40956)A-=33088;else if(57408<=A&&A<=60351)A-=49472;else throw"illegal char at "+(L+1)+"/"+A;A=(A>>>8&255)*192+(A&255),k.put(A,13),L+=2}if(L<m.length)throw"illegal char at "+(L+1)},$},f=function(){var E=[],b={};return b.writeByte=function(D){E.push(D&255)},b.writeShort=function(D){b.writeByte(D),b.writeByte(D>>>8)},b.writeBytes=function(D,y,v){y=y||0,v=v||D.length;for(var $=0;$<v;$+=1)b.writeByte(D[$+y])},b.writeString=function(D){for(var y=0;y<D.length;y+=1)b.writeByte(D.charCodeAt(y))},b.toByteArray=function(){return E},b.toString=function(){var D="";D+="[";for(var y=0;y<E.length;y+=1)y>0&&(D+=","),D+=E[y];return D+="]",D},b},h=function(){var E=0,b=0,D=0,y="",v={},$=function(m){y+=String.fromCharCode(k(m&63))},k=function(m){if(!(m<0)){if(m<26)return 65+m;if(m<52)return 97+(m-26);if(m<62)return 48+(m-52);if(m==62)return 43;if(m==63)return 47}throw"n:"+m};return v.writeByte=function(m){for(E=E<<8|m&255,b+=8,D+=1;b>=6;)$(E>>>b-6),b-=6},v.flush=function(){if(b>0&&($(E<<6-b),E=0,b=0),D%3!=0)for(var m=3-D%3,L=0;L<m;L+=1)y+="="},v.toString=function(){return y},v},d=function(E){var b=E,D=0,y=0,v=0,$={};$.read=function(){for(;v<8;){if(D>=b.length){if(v==0)return-1;throw"unexpected end of file./"+v}var m=b.charAt(D);if(D+=1,m=="=")return v=0,-1;if(m.match(/^\s$/))continue;y=y<<6|k(m.charCodeAt(0)),v+=6}var L=y>>>v-8&255;return v-=8,L};var k=function(m){if(65<=m&&m<=90)return m-65;if(97<=m&&m<=122)return m-97+26;if(48<=m&&m<=57)return m-48+52;if(m==43)return 62;if(m==47)return 63;throw"c:"+m};return $},x=function(E,b){var D=E,y=b,v=new Array(E*b),$={};$.setPixel=function(A,H,Y){v[H*D+A]=Y},$.write=function(A){A.writeString("GIF87a"),A.writeShort(D),A.writeShort(y),A.writeByte(128),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(255),A.writeByte(255),A.writeByte(255),A.writeString(","),A.writeShort(0),A.writeShort(0),A.writeShort(D),A.writeShort(y),A.writeByte(0);var H=2,Y=m(H);A.writeByte(H);for(var z=0;Y.length-z>255;)A.writeByte(255),A.writeBytes(Y,z,255),z+=255;A.writeByte(Y.length-z),A.writeBytes(Y,z,Y.length-z),A.writeByte(0),A.writeString(";")};var k=function(A){var H=A,Y=0,z=0,te={};return te.write=function(Z,Q){if(Z>>>Q)throw"length over";for(;Y+Q>=8;)H.writeByte(255&(Z<<Y|z)),Q-=8-Y,Z>>>=8-Y,z=0,Y=0;z=Z<<Y|z,Y=Y+Q},te.flush=function(){Y>0&&H.writeByte(z)},te},m=function(A){for(var H=1<<A,Y=(1<<A)+1,z=A+1,te=L(),Z=0;Z<H;Z+=1)te.add(String.fromCharCode(Z));te.add(String.fromCharCode(H)),te.add(String.fromCharCode(Y));var Q=f(),ne=k(Q);ne.write(H,z);var ie=0,De=String.fromCharCode(v[ie]);for(ie+=1;ie<v.length;){var de=String.fromCharCode(v[ie]);ie+=1,te.contains(De+de)?De=De+de:(ne.write(te.indexOf(De),z),te.size()<4095&&(te.size()==1<<z&&(z+=1),te.add(De+de)),De=de)}return ne.write(te.indexOf(De),z),ne.write(Y,z),ne.flush(),Q.toByteArray()},L=function(){var A={},H=0,Y={};return Y.add=function(z){if(Y.contains(z))throw"dup key:"+z;A[z]=H,H+=1},Y.size=function(){return H},Y.indexOf=function(z){return A[z]},Y.contains=function(z){return typeof A[z]<"u"},Y};return $},S=function(E,b,D){for(var y=x(E,b),v=0;v<b;v+=1)for(var $=0;$<E;$+=1)y.setPixel($,v,D($,v));var k=f();y.write(k);for(var m=h(),L=k.toByteArray(),A=0;A<L.length;A+=1)m.writeByte(L[A]);return m.flush(),"data:image/gif;base64,"+m};return r})();(function(){Tc.stringToBytesFuncs["UTF-8"]=function(r){function e(t){for(var n=[],s=0;s<t.length;s++){var i=t.charCodeAt(s);i<128?n.push(i):i<2048?n.push(192|i>>6,128|i&63):i<55296||i>=57344?n.push(224|i>>12,128|i>>6&63,128|i&63):(s++,i=65536+((i&1023)<<10|t.charCodeAt(s)&1023),n.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63))}return n}return e(r)}})();(function(r){typeof define=="function"&&define.amd?define([],r):typeof Lc=="object"&&(Nc.exports=r())})(function(){return Tc})});var Sh={};gf(Sh,{estimate:()=>ef,lint:()=>Xc,main:()=>tf,parseArgs:()=>Zc});module.exports=mf(Sh);var Ze=Ce(require("node:fs")),xt=Ce(require("node:path"));var da={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0};function Re(r){return typeof r=="string"}function ha(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="markup"&&Re(e.lead)&&Re(e.content)&&Re(e.trail)&&(e.eol===`
|
|
5
5
|
`||e.eol===`\r
|
|
6
|
-
`)&&
|
|
6
|
+
`)&&Re(e.finalEol)&&Re(e.value)}function pa(r){if(typeof r!="object"||r===null)return!1;let e=r;return(e.raw===void 0||Re(e.raw))&&Re(e.text)&&typeof e.attrs=="object"&&e.attrs!==null&&Object.values(e.attrs).every(Re)}function Ef(r){if(typeof r!="object"||r===null)return!1;let e=r;return Re(e.raw)&&Re(e.gap)&&Array.isArray(e.entries)&&e.entries.every(pa)}function Df(r){if(typeof r!="object"||r===null)return!1;let e=r;return Re(e.raw)&&Re(e.gap)}function ce(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="code"&&Re(e.lead)&&Re(e.open)&&Re(e.body)&&Re(e.close)&&Re(e.trail)&&Re(e.indent)&&(e.fenceChar==="`"||e.fenceChar==="~")&&typeof e.fenceLen=="number"&&Re(e.info)&&Re(e.lang)&&(e.eol===`
|
|
7
7
|
`||e.eol===`\r
|
|
8
|
-
`)&&
|
|
8
|
+
`)&&Re(e.value)&&(e.output===void 0||Df(e.output))&&(e.history===void 0||Ef(e.history))}function ga(r){if(typeof r!="object"||r===null)return!1;let e=r;return typeof e.bom=="boolean"&&(e.eol===`
|
|
9
9
|
`||e.eol===`\r
|
|
10
|
-
`)}function
|
|
10
|
+
`)}function mn(r){let e=[],t=/\r\n|\n|\r/g,n=0,s;for(;(s=t.exec(r))!==null;)e.push({text:r.slice(n,s.index),eol:s[0]}),n=t.lastIndex;return n<r.length&&e.push({text:r.slice(n),eol:""}),e}function Nt(r){let e="";for(let t of r)e+=t.text+t.eol;return e}function Fs(r,e){let t=0,n=0;for(let s of r)s.eol===`\r
|
|
11
11
|
`?t++:s.eol===`
|
|
12
12
|
`&&n++;return t===0&&n===0?e:t>n?`\r
|
|
13
13
|
`:`
|
|
14
|
-
`}function
|
|
14
|
+
`}function Is(r){return r.endsWith(`\r
|
|
15
15
|
`)?`\r
|
|
16
16
|
`:r.endsWith(`
|
|
17
17
|
`)?`
|
|
18
|
-
`:r.endsWith("\r")?"\r":""}function
|
|
19
|
-
`)}var
|
|
20
|
-
`)s[
|
|
21
|
-
`)}var
|
|
22
|
-
`).map((n,s)=>n.includes(
|
|
23
|
-
`),stderr:e}}function
|
|
24
|
-
`);if(t.length<=e)return r;let n=Math.ceil(e/2),s=e-n,
|
|
25
|
-
`)}function
|
|
26
|
-
`),
|
|
27
|
-
`),
|
|
28
|
-
`),
|
|
29
|
-
`),
|
|
30
|
-
`),
|
|
31
|
-
`);return{meta:{raw:
|
|
32
|
-
`},s=n.eol,
|
|
33
|
-
`).map(n
|
|
34
|
-
`))e?
|
|
35
|
-
`),
|
|
36
|
-
`);if(t>=0&&(this.held+=this.pending.slice(0,t+1),this.pending=this.pending.slice(t+1),(!
|
|
37
|
-
`);if(
|
|
38
|
-
`}
|
|
39
|
-
`
|
|
40
|
-
`))
|
|
41
|
-
|
|
42
|
-
`,t++;continue}if(
|
|
43
|
-
|
|
44
|
-
|
|
18
|
+
`:r.endsWith("\r")?"\r":""}function xr(r){return Is(r)!==""}function Yn(r){return r.replace(/\r\n?/g,`
|
|
19
|
+
`)}var Qn=/^[ \t]*$/;var bf=new Set(["sh","bash","pwsh","powershell","cmd","runbook"]),wf={sh:"shellscript",bash:"shellscript",pwsh:"powershell",powershell:"powershell",cmd:"bat"},ma={shellscript:"bash",powershell:"pwsh",bat:"cmd",runbook:"runbook"},Ih=Object.keys(ma);function eo(r){return bf.has(r)}function $s(r){return wf[r]??r}function Ea(r){return ma[r]??r}var kf=/^([ \t]*)(`{3,}|~{3,})(.*)$/,Da=/^[ \t]*(`{3,}|~{3,})[ \t]*$/;function Je(r){let e=kf.exec(r);if(!e)return null;let t=e[1]??"",n=e[2]??"",s=e[3]??"",i=n[0];return i==="`"&&s.includes("`")?null:{indent:t,char:i,len:n.length,info:s}}function Ke(r,e){let t=Da.exec(r);if(!t)return!1;let n=t[1]??"";return n[0]===e.char&&n.length>=e.len}var ba=/^(\s*)([^\s{]+)/;function Zt(r){let e=ba.exec(r);return e?(e[2]??"").toLowerCase():""}function wa(r,e){let t=ba.exec(r);return t?(t[1]??"")+e+r.slice(t[0].length):e+r}function ka(r,e){let t=0;for(let n of r){let i=Da.exec(n)?.[1];i&&i[0]===e&&(t=Math.max(t,i.length))}return t}function to(r,e){if(e==="")return r;if(r.startsWith(e))return r.slice(e.length);let t=0;for(;t<e.length&&t<r.length&&(r[t]===" "||r[t]===" ");)t++;return r.slice(t)}function En(r,e){return r===""?r:e+r}var xf=new RegExp(["(?:\\u001B\\]|\\u009D)[^\\u0007\\u001B\\u009C]*(?:\\u0007|\\u001B\\u005C|\\u009C)","[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"),"g");function yt(r){return r.replace(xf,"")}var vf=/^\u001b\[([0-9;?]*)([ -/]*)([@-~])/,Sf=/^\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)?/,yf=/[\r\b\u0000-\u0008\u000b-\u001a\u001c-\u001f\u007f]|\u001b\[[0-9;?]*[ -/]*[A-GJKsu]|\u001b[78]/;function vr(r,e=""){if(!yf.test(r))return r;let t=[[]],n=[!1],s=[""],i="",o=0,B=0,a=[0,0],c=C=>{for(;t.length<=C;)t.push([]),n.push(!1),s.push("")},u=C=>{let f=t[o];for(;f.length<B;)f.push(" ");f[B]=i+C,i="",B++},l=(C,f)=>{let h=parseInt(C.split(";")[0]??"",10);return Number.isFinite(h)&&h>0?h:f};for(let C=0;C<r.length;){let f=r[C];if(f==="\x1B"){let h=r.slice(C,C+256),d=vf.exec(h);if(d){let[E,b,D,y]=d;if(C+=E.length,D!==""||b.startsWith("?")){y==="m"&&(i+=E);continue}let v=l(b,1);switch(y){case"A":o=Math.max(0,o-v);break;case"B":o+=v,c(o);break;case"C":B+=v;break;case"D":B=Math.max(0,B-v);break;case"E":o+=v,c(o),B=0;break;case"F":o=Math.max(0,o-v),B=0;break;case"G":B=v-1;break;case"K":{let $=l(b,0),k=t[o];if($===0)k.length=Math.min(k.length,B);else if($===1)for(let m=0;m<=B&&m<k.length;m++)k[m]=" ";else k.length=0;break}case"J":{let $=l(b,0);if($===0)t[o].length=Math.min(t[o].length,B),t.length=o+1,n.length=o+1,s.length=o+1;else if($===1){for(let k=0;k<o;k++)t[k]=[];for(let k=0;k<=B&&k<t[o].length;k++)t[o][k]=" "}break}case"s":a=[o,B];break;case"u":[o,B]=a,c(o);break;default:i+=E}continue}let x=Sf.exec(h);if(x&&x[0].length>2){i+=x[0],C+=x[0].length;continue}let S=r[C+1];S==="7"?a=[o,B]:S==="8"&&([o,B]=a,c(o)),C+=S===void 0?1:2;continue}if(C++,f===`
|
|
20
|
+
`)s[o]+=i,i="",o++,c(o),B=0;else if(f==="\r")B=0;else if(f==="\b")B=Math.max(0,B-1);else if(e!==""&&f===e)n[o]=!0;else if(f===" ")u(f);else{if(f<" "||f==="\x7F")continue;f>="\uD800"&&f<="\uDBFF"&&C<r.length?u(f+r[C++]):u(f)}}return s[o]+=i,t.map((C,f)=>(n[f]?e:"")+C.join("")+s[f]).join(`
|
|
21
|
+
`)}var va=[{level:"critical",words:["EMERGENCY","EMERG","ALERT","CRITICAL","CRIT","FATAL","PANIC"],capitalized:!0,colon:["fatal","panic","critical"],brackets:["fatal","fatl","ftl","crit","critical","emerg","alert"],klog:"F"},{level:"error",words:["ERROR","ERR","EROR","FAIL","FAILED","FAILURE","EE"],capitalized:!0,colon:["error","err"],brackets:["error","eror","err","er","e","fail","failed"],klog:"E",extra:["\\b[A-Za-z.]*Exception\\b","[\u2717\u2718]"]},{level:"warning",words:["WARNING","WARN","WRN","WW"],capitalized:!0,colon:["warning","warn"],brackets:["warning","warn","wrn","wn","w"],klog:"W"},{level:"info",words:["INFORMATIONAL","INFORMATION","INFO","NOTICE","HINT","II"],capitalized:!0,colon:["info","notice","hint"],brackets:["information","info","inf","in","i","notice"],klog:"I"},{level:"debug",words:["DEBUG_LOW","DEBUG_MED","DEBUG_HIGH","DEBUG_MAX","DBG_LOW","DBG_MED","DBG_HIGH","DBG_MAX","DEBUG","DBUG","DBG"],capitalized:!0,colon:["debug"],brackets:["debug","dbug","dbg","de","d"]},{level:"trace",words:["TRACE","VERBOSE","VRB"],capitalized:!0,colon:["trace","verbose"],brackets:["trace","verbose","verb","vrb","vb","v"]},{level:"success",words:["SUCCESSFUL","SUCCEEDED","SUCCESS","COMPLETED","PASSED","PASS","DONE","OK"],capitalized:!0,colon:["success","ok","done"],brackets:["success","ok","pass","passed","done"],extra:["[\u2713\u2714]"]}],Of=new Set(["ALERT","NOTICE","HINT","PASS","DONE","OK","EE","WW","II","ERR","EROR","CRIT","EMERG","WRN","DBUG","DBG","VRB"]),xa=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Af=r=>r[0]+r.slice(1).toLowerCase(),Hh=new RegExp(va.map(r=>{let e=[],t=[...r.words,...r.capitalized?r.words.filter(n=>!Of.has(n)&&!n.includes("_")).map(Af):[]];return e.push(`\\b(?:${t.map(xa).join("|")})\\b`),r.colon?.length&&e.push(`\\b(?:${r.colon.map(xa).join("|")})(?=:)`),r.brackets?.length&&e.push(`\\[(?:${r.brackets.map(n=>n.split("").map(s=>`[${s.toLowerCase()}${s.toUpperCase()}]`).join("")).join("|")})\\]`),r.klog&&e.push(`^${r.klog}\\d{4} \\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?`),r.extra&&e.push(...r.extra),`(${e.join("|")})`}).join("|"),"gu");var qn="\uE000";function no(r){if(!r.includes(qn))return{text:r,stderr:[]};let e=[];return{text:r.split(`
|
|
22
|
+
`).map((n,s)=>n.includes(qn)?(e.push(s),n.split(qn).join("")):n).join(`
|
|
23
|
+
`),stderr:e}}function ro(r){let e=[...new Set(r)].sort((n,s)=>n-s),t=[];for(let n=0;n<e.length;){let s=n;for(;s+1<e.length&&e[s+1]===e[s]+1;)s++;t.push(n===s?`${e[n]+1}`:`${e[n]+1}-${e[s]+1}`),n=s+1}return t.join(",")}var Ts=/^[ \t]*<!--[ \t]*md-runbook:output start\b(.*?)-->[ \t]*$/,so=/^[ \t]*<!--[ \t]*md-runbook:output end[ \t]*-->[ \t]*$/,Sa=/^[ \t]*<details>[ \t]*<summary>[ \t]*md-runbook:[^<]*<\/summary>[ \t]*$/,ya=/^[ \t]*<\/details>[ \t]*$/,Rf=/([\w-]+)=(?:"([^"]*)"|(\S+))/g;function Sr(r){let e={};for(let t of r.matchAll(Rf)){let n=t[1];n&&(e[n]=t[2]??t[3]??"")}return e}function Oa(r){let e="";for(let[t,n]of Object.entries(r)){if(!/^[\w-]+$/.test(t))continue;let s=n.replace(/["\r\n]/g,"").replace(/-->/g,"--");e+=" "+t+"="+(s===""||/\s/.test(s)?`"${s}"`:s)}return e}function Ff(r){return`\u2026 [md-runbook: ${r} line${r===1?"":"s"} truncated] \u2026`}function Aa(r,e){if(e<=0)return r;let t=r.split(`
|
|
24
|
+
`);if(t.length<=e)return r;let n=Math.ceil(e/2),s=e-n,i=t.length-e;return[...t.slice(0,n),Ff(i),...t.slice(t.length-s)].join(`
|
|
25
|
+
`)}function Ra(r,e){let t=vr(r.replace(/\r\n/g,`
|
|
26
|
+
`),qn);e.stripAnsi&&(t=yt(t)),e.redact&&(t=e.redact(t)),t=t.replace(/\n+$/,"");let n=no(Aa(t,e.maxOutputLines));return{text:n.text,stderr:ro(n.stderr)}}function yr(r,e,t,n){let s=r===""?[]:Yn(r).split(`
|
|
27
|
+
`),i="`".repeat(Math.max(3,If(s)+1));return[`<!-- md-runbook:output start${Oa(e)} -->`,i+"text",...s,i,"<!-- md-runbook:output end -->"].map(B=>En(B,t)).join(n)+n}function If(r){let e=0;for(let t of r){let n=/^[ \t]*(`+)/.exec(t);n?.[1]&&(e=Math.max(e,n[1].length))}return e}function Ls(r){return`${(Math.max(0,r)/1e3).toFixed(3)}s`}function Fe(r){let e=s=>String(Math.abs(s)).padStart(2,"0"),t=-r.getTimezoneOffset(),n=t>=0?"+":"-";return`${r.getFullYear()}-${e(r.getMonth()+1)}-${e(r.getDate())}T${e(r.getHours())}:${e(r.getMinutes())}:${e(r.getSeconds())}${n}${e(Math.trunc(t/60))}:${e(t%60)}`}function he(r){let e=r,t=!1;e.charCodeAt(0)===65279&&(t=!0,e=e.slice(1));let n=mn(e),s=Fs(n,`
|
|
28
|
+
`),i=[],o="",B=u=>{if(u.length===0)return;let l=0,C=u.length;for(;l<C&&Qn.test(u[l].text);)l++;for(;C>l&&Qn.test(u[C-1].text);)C--;if(l===C){let x=Nt(u),S=i[i.length-1];S?S.meta.trail+=x:o+=x;return}let f=u.slice(l,C),h=f.map(x=>x.text).join(`
|
|
29
|
+
`),d={kind:"markup",lead:o+Nt(u.slice(0,l)),content:Nt(f),trail:Nt(u.slice(C)),eol:Fs(f,s),finalEol:f[f.length-1].eol,value:h};o="",i.push({kind:"markup",value:h,languageId:"markdown",meta:d})},a=0,c=0;for(;c<n.length;){let u=Je(n[c].text);if(!u){c++;continue}let l=c+1;for(;l<n.length&&!Ke(n[l].text,u);)l++;if(l>=n.length)break;let C=Zt(u.info);if(!eo(C)){c=l+1;continue}B(n.slice(a,c));let f=n[c],h=n.slice(c+1,l),d=h.map(D=>to(D.text,u.indent)).join(`
|
|
30
|
+
`),x={kind:"code",lead:o,open:f.text+f.eol,body:Nt(h),close:n[l].text+n[l].eol,trail:"",indent:u.indent,fenceChar:u.char,fenceLen:u.len,info:u.info,lang:C,eol:Fs([f,...h],s),value:d};o="";let S={kind:"code",value:d,languageId:$s(C),meta:x},E=l+1,b=io(n,E);if(b){x.output=b.meta,S.output=b.output,E=b.end;let D=$f(n,E);D&&(x.history=D.meta,E=D.end)}i.push(S),c=E,a=E}return B(n.slice(a)),o!==""&&i.push({kind:"markup",value:"",languageId:"markdown",meta:{kind:"markup",lead:o,content:"",trail:"",eol:s,finalEol:"",value:""}}),{meta:{bom:t,eol:s},cells:i}}function io(r,e){let t=e;for(;t<r.length&&Qn.test(r[t].text);)t++;let n=r[t]?Ts.exec(r[t].text):null;if(!n)return null;let s=t+1,i=r[s]?Je(r[s].text):null;if(!i)return null;let o=s+1;for(;o<r.length&&!Ke(r[o].text,i);)o++;let B=o+1;if(B>=r.length||!so.test(r[B].text))return null;let a=r.slice(s+1,o).map(c=>to(c.text,i.indent)).join(`
|
|
31
|
+
`);return{meta:{raw:Nt(r.slice(e,B+1)),gap:Nt(r.slice(e,t))},output:{text:a,attrs:Sr(n[1]??"")},end:B+1}}function $f(r,e){let t=e;for(;t<r.length&&Qn.test(r[t].text);)t++;if(!r[t]||!Sa.test(r[t].text))return null;let n=[],s=t+1;for(;;){let i=io(r,s);if(!i)break;n.push({raw:i.meta.raw.slice(i.meta.gap.length),...i.output}),s=i.end}for(;s<r.length&&Qn.test(r[s].text);)s++;return n.length===0||!r[s]||!ya.test(r[s].text)?null:{meta:{raw:Nt(r.slice(e,s+1)),gap:Nt(r.slice(e,t)),entries:n},end:s+1}}function oo(r){let e=mn(r),t=io(e,0);return t&&t.end===e.length?t.output:null}function Ns(r){if(!r.output)return;let e=r.output.raw.slice(r.output.gap.length),t=oo(e);return t?{raw:e,...t}:void 0}function Ms(r,e,t){return!r||t<=0?[]:[r,...e].slice(0,t)}function Tf(r){return`md-runbook: ${r} previous run${r===1?"":"s"}`}function Bo(r,e,t){let n=En(`<details><summary>${Tf(r.length)}</summary>`,e)+t;for(let s of r)n+=t,s.raw!==void 0?n+=xr(s.raw)?s.raw:s.raw+t:n+=yr(s.text,s.attrs,e,t);return n+t+En("</details>",e)+t}var Or=r=>String(r).padStart(2,"0");function ao(r,e){let t=r.replace(/\.md$/i,""),n=`${e.getFullYear()}${Or(e.getMonth()+1)}${Or(e.getDate())}-${Or(e.getHours())}${Or(e.getMinutes())}${Or(e.getSeconds())}`;return`${t}.${n}.md`}function Gs(r,e,t){let n=ga(r)?r:{bom:!1,eol:`
|
|
32
|
+
`},s=n.eol,i="",o=!1,B=!1;for(let a of e){let c=Yn(a.value),u=a.kind==="markup"?ha(a.meta)?a.meta:void 0:ce(a.meta)?a.meta:void 0,l=u===void 0;i!==""&&!xr(i)&&(i+=s);let C=B&&i!=="",f=a.kind==="markup"?Gf(c,u,s,C):Hf(c,a.languageId,u,a.output,s,t,C);i!==""&&(l||o)&&!Nf(i)&&!Lf(f)&&(i+=s),i+=f,o=l,B=u!==void 0&&u.trail!==""}return(n.bom?"\uFEFF":"")+i}function Lf(r){return/^[ \t]*(?:\r\n|\n|\r)/.test(r)}function Nf(r){return/(?:\r\n|\n|\r)[ \t]*(?:\r\n|\n|\r)$/.test(r)||/^[ \t]*(?:\r\n|\n|\r)$/.test(r)}function Ia(r,e,t=""){return r===""?"":r.split(`
|
|
33
|
+
`).map(n=>En(n,t)).join(e)}function Mf(r){let e=null;for(let t of r.split(`
|
|
34
|
+
`))e?Ke(t,e)&&(e=null):e=Je(t);return e?e.indent+e.char.repeat(e.len):""}function Fa(r,e,t){let n=Mf(r);return Ia(r,e)+(n===""?"":e+n)+t}function Gf(r,e,t,n){if(!e)return r===""?"":Fa(r,t,t);let s=n?"":e.lead;if(r===e.value)return s+e.content+e.trail;let i=r===""?"":Fa(r,e.eol,e.finalEol);return s+i+e.trail}function Hf(r,e,t,n,s,i,o){let B=t!==void 0&&e!==void 0&&$s(t.lang)!==e,a=o?"":t?.lead??"";if(t&&!B&&r===t.value)a+=t.open+t.body+t.close;else{let u=t?.eol??s,l=t?.indent??"",C=t?.fenceChar??"`",f=t?.fenceLen??3,h=Math.max(f,ka(r.split(`
|
|
35
|
+
`),C)+1),d=Ea(e??"shellscript"),x=l+C.repeat(h),S,E;if(t){let D=B?wa(t.info,d):t.info,y=Is(t.open);S=h===f&&!B&&y!=="\r"?t.open:x+D+(y==="\r"?u:y||u),E=h===f?t.close:x+Is(t.close)}else S=x+d+u,E=x+u;let b=r===""?"":Ia(r,u,l)+u;a+=S+b+E}let c=Pf(n,t,s,i);return c!==""&&(xr(a)||(a+=t?.eol??s),a+=c),a+(t?.trail??"")}function Pf(r,e,t,n){if(!r)return"";if(r.kind==="preserved")return e?.output?e.output.raw+(e.history?.raw??""):"";if(!n.persistOutputs)return"";let{text:s,stderr:i}=Ra(r.text,n),o=e?.eol??t,B=e?.indent??"",{stderr:a,...c}=r.attrs,u=i?{...c,stderr:i}:c,l=r.previous?{...u,changed:r.previous.text===s?"no":"yes"}:u,C=(e?.output?.gap??"")+yr(s,l,B,o);return r.history?.length&&(C+=(e?.history?.gap??"")+Bo(r.history,B,o)),C}function Hs(r,e=!0){return r.cells.map(t=>({kind:t.kind,value:t.value,languageId:t.languageId,meta:t.meta,output:e&&t.output?{kind:"preserved"}:void 0}))}function Ar(r){let e=he(r);return Gs(e.meta,Hs(e,!1),da)}var Wn="[REDACTED]",lo="password|passwd|pwd|secret|token|api[_-]?key|access[_-]?key|private[_-]?key|privatekey|client[_-]?key|credentials?|\\.key",_f=`(?:\\$\\{[^}\\s]*\\}|\\$\\([^)\\r\\n]*\\)|\\$env:\\w+|%[A-Za-z_]\\w*%)(?![^\\s"',;&])`,Ps=`(?<!\\$\\{(?:secret|secretFile|input|param):)(?!(?:Bearer|Basic|Negotiate|true|false|null|none)\\b)(?!${_f})`,$a="k8s-secret-data",uo=[{name:"pem-private-key",pattern:"(?<=-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----)[\\s\\S]+?(?=-----END [A-Z0-9 ]*PRIVATE KEY-----|$)"},{name:$a,pattern:"(?!)"},{name:"authorization-header",pattern:`(?<=\\b(?:Proxy-)?Authorization["']?[ \\t]*:[ \\t]*)[^\\s"'][^\\r\\n"']*|(?<=\\b(?:Proxy-)?Authorization["']?[ \\t]*=[ \\t]*)[^\\s"'][^\\r\\n"',;}&]*`,flags:"i"},{name:"cookie-header",pattern:`(?<=\\b(?:Set-)?Cookie["']?[ \\t]*[:=][ \\t]*)[^\\s"'][^\\r\\n"']*`,flags:"i"},{name:"bearer-token",pattern:"(?<=\\bBearer[ \\t]+)(?=[A-Za-z0-9\\-._~+/]*[0-9._~+/-])[A-Za-z0-9\\-._~+/]{8,}=*",flags:"i"},{name:"jwt",pattern:"\\beyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]{5,}(?:\\.[A-Za-z0-9_-]*)*"},{name:"secret-key-value-quoted",pattern:`(?<=\\b[\\w.-]*(?:${lo})[\\w.-]*["']?[ \\t]*[:=][ \\t]*")${Ps}[^"\\r\\n]+(?=")|(?<=\\b[\\w.-]*(?:${lo})[\\w.-]*["']?[ \\t]*[:=][ \\t]*')${Ps}[^'\\r\\n]+(?=')`,flags:"i"},{name:"secret-key-value",pattern:`(?<=\\b[\\w.-]*(?:${lo})[\\w.-]*["']?[ \\t]*[:=][ \\t]*["']?)${Ps}[^\\s"',;&}]+`,flags:"i"},{name:"pass-key-value",pattern:`(?<=(?:^|[^A-Za-z0-9])(?:[\\w.-]*[_.-])?pass["']?[ \\t]*[:=][ \\t]*["']?)${Ps}[^\\s"',;&}]+`,flags:"i"},{name:"secret-flag-value",pattern:`(?<=(?:^|\\s)--?(?:password|passwd|pass|secret|client-secret|token|api-key|apikey|access-key|secret-key)[ \\t]+)(?:"(?![$%])[^"\\r\\n]*"|'(?![$%])[^'\\r\\n]*'|(?![-$%])[^\\s"']+)|(?<=\\blogin\\b[^\\r\\n]*?\\s-p[ \\t]*)(?!-)[^\\s"']+|(?<=\\bmysql\\b[^\\r\\n]*?\\s-p)[^\\s"']+|(?<=(?:^|\\s)(?:-u|--user)[ \\t]+[^\\s:"']+:)[^\\s"']+`,flags:"i"},{name:"keycloak-client-secret",pattern:'(?<="type"[ \\t]*:[ \\t]*"secret"[ \\t]*,[ \\t]*"value"[ \\t]*:[ \\t]*")[^"]+|(?<=\\bsecret\\b[^\\r\\n]{0,40}?)\\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\b',flags:"i"},{name:"url-credentials",pattern:"(?<=\\b[a-z][a-z0-9+.-]*://[^/\\s:@]+:)[^/\\s@]+(?=@)",flags:"i"},{name:"base64-pem",pattern:"\\bLS0tLS1CRUdJTi[A-Za-z0-9+/=]+"},{name:"base64-dockerconfig",pattern:"\\beyJhdXRocyI6[A-Za-z0-9+/=]+"},{name:"openshift-token",pattern:"\\bsha256~[A-Za-z0-9_-]{20,}"},{name:"github-token",pattern:"\\bgh[pousr]_[A-Za-z0-9]{30,}"},{name:"gitlab-token",pattern:"\\bglpat-[A-Za-z0-9_-]{20,}"},{name:"npm-token",pattern:"\\bnpm_[A-Za-z0-9]{36}\\b"},{name:"anthropic-openai-key",pattern:"\\bsk-(?:ant-)?[A-Za-z0-9_-]{20,}"},{name:"slack-token",pattern:"\\bxox[abposr]-[A-Za-z0-9-]{10,}"},{name:"gcp-api-key",pattern:"\\bAIza[0-9A-Za-z_-]{35}\\b"},{name:"gcp-oauth-token",pattern:"\\bya29\\.[0-9A-Za-z_-]{20,}"},{name:"azure-storage-key",pattern:"(?<=\\b(?:AccountKey|SharedAccessKey)=)[A-Za-z0-9+/=]{20,}",flags:"i"},{name:"azure-sas-signature",pattern:"(?<=[?&]sig=)[A-Za-z0-9%+/=]{20,}"},{name:"aws-access-key-id",pattern:"\\b(?:AKIA|ASIA)[0-9A-Z]{16}\\b"}];function Jf(r){if(!/["']?kind["']?[ \t]*:[ \t]*["']?Secret\b/.test(r))return r;let e=r.replace(/^([ \t]*)(data|stringData):[ \t]*(\r?\n)((?:\1[ \t]+[^\r\n]*(?:\r?\n|$))+)/gm,(t,n,s,i,o)=>{let B=o.replace(/^([ \t]+[^\s:#][^:\r\n]*:[ \t]*)(?:\|[-+]?|>[-+]?)?[ \t]*(\S[^\r\n]*)?$/gm,(a,c,u)=>u===void 0||u.startsWith("[REDACTED]")?a:`${c}${Wn}`);return`${n}${s}:${i}${B}`});return e=e.replace(/("(?:data|stringData)"[ \t]*:[ \t]*\{)([^{}]*)(\})/g,(t,n,s,i)=>n+s.replace(/("[^"\r\n]+"[ \t]*:[ \t]*)"[^"]*"/g,`$1"${Wn}"`)+i),e}function Uf(r){let e=new Set((r??"").replace(/[gy]/g,"").split(""));return e.add("g"),[...e].join("")}function jf(r){let e=typeof r=="string"?{pattern:r}:r;return new RegExp(e.pattern,Uf(e.flags))}function co(r){let e=[],t=[],n=!1;for(let s of r){if(typeof s!="string"&&s.name===$a){n=!0;continue}try{e.push(jf(s))}catch(i){let o=typeof s=="string"?s:s.name??s.pattern;t.push(`${o}: ${i instanceof Error?i.message:String(i)}`)}}return{errors:t,redact(s){let i=n?Jf(s):s;for(let o of e)o.lastIndex=0,i=i.replace(o,B=>B===""?B:Wn);return i}}}var Kf=/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----(?![\s\S]*-----END [A-Z0-9 ]*PRIVATE KEY-----)/,Dn=class{constructor(e,t=i=>i,n=64*1024,s=256*1024){this.emit=e;this.transform=t;this.maxPending=n;this.maxHeld=s}emit;transform;maxPending;maxHeld;pending="";held="";write(e){this.pending+=e;let t=this.pending.lastIndexOf(`
|
|
36
|
+
`);if(t>=0&&(this.held+=this.pending.slice(0,t+1),this.pending=this.pending.slice(t+1),(!Kf.test(this.held)||this.held.length>this.maxHeld)&&this.release(this.held)),this.pending.length>this.maxPending){let n=Math.max(this.pending.lastIndexOf(" "),this.pending.lastIndexOf(" ")),s=n>0?n+1:this.pending.length,i=this.pending.slice(0,s);this.pending=this.pending.slice(s),this.release(this.held+i)}}flush(){this.release(this.held+this.pending),this.pending=""}release(e){this.held="",e!==""&&this.emit(this.transform(e))}};function Ie(r){switch(r.toLowerCase()){case"sh":case"bash":case"shellscript":return"bash";case"pwsh":case"powershell":return"pwsh";case"cmd":case"bat":return"cmd";default:return}}var Rr=["bash","zsh","sh"],Fr=["pwsh","windows-powershell"];function Ir(r){let e={},t=[],n=[],s=r.replace(/^\s*\[|\]\s*$/g,"").split(/[\s,]+/).map(i=>i.replace(/^["']|["']$/g,"")).filter(Boolean);for(let i of s){let o=i.toLowerCase();Rr.includes(o)?e.unix?n.push(i):e.unix=o:Fr.includes(o)?e.powershell?n.push(i):e.powershell=o:t.push(i)}return{shells:e,unknown:t,twice:n}}function $r(r){return r.timedOut?"timeout":r.cancelled?"cancelled":r.error!==void 0?"error":r.exitCode!==null?String(r.exitCode):r.signal??"unknown"}function Vn(r){return!r.timedOut&&!r.cancelled&&r.error===void 0&&r.exitCode===0}var bn=class{constructor(e,t){this.emit=t;this.needle=""+e+" "}emit;pending="";needle;code;get done(){return this.code!==void 0}write(e){if(this.done)return;let t=this.pending+e,n=t.indexOf(this.needle);if(n>=0){this.send(t.slice(0,n)),t=t.slice(n);let o=t.indexOf(`
|
|
37
|
+
`);if(o>=0){let B=Number.parseInt(t.slice(this.needle.length,o),10);this.code=Number.isNaN(B)?1:B,t=""}this.pending=t;return}let s=t.lastIndexOf(""),i=s>=0&&this.needle.startsWith(t.slice(s))?s:t.length;this.send(t.slice(0,i)),this.pending=t.slice(i)}flush(){this.send(this.pending),this.pending=""}send(e){e!==""&&this.emit(e)}};function _s(r,e=!1,t){return r===void 0||r==="running"||r==="declined"||r==="proposed"?"pending":t==="failed"?"failed":t==="ok"||r==="0"||r==="done"?e?"pending":"done":r==="skipped"?"skipped":"failed"}var zf=/^[ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]+\[([ xX])\](?=[ \t]|$)/;function Tr(r){let e=[],t=null,n=0;return r.split(`
|
|
38
|
+
`).forEach((s,i)=>{let o=s.endsWith("\r")?s.slice(0,-1):s;if(t)Ke(o,t)&&(t=null);else if((t=Je(o))===null){let B=zf.exec(o);B&&e.push({line:i,offset:n+B[0].length-2,checked:B[1]!==" "})}n+=s.length+1}),e}function Js(r){return r.match(/\r\n|\n|\r/g)?.length??0}function ct(r){let e=[],t=0;return r.cells.forEach((n,s)=>{let i=n.meta;if(ce(i)){let o=t+Js(i.lead);e.push({cellIndex:s,line:o,closeLine:o+1+Js(i.body),language:i.lang,info:i.info,source:n.value,outputAttrs:n.output?.attrs}),t+=Js(i.lead+i.open+i.body+i.close+(i.output?.raw??"")+(i.history?.raw??"")+i.trail)}else t+=Js(i.lead+i.content+i.trail)}),e}function wn(r,e,t,n){let s=he(r);if(s.cells[e]?.kind!=="code")return;let i=Hs(s);return i[e].output=t,Gs(s.meta,i,n)}function fo(r,e=new Date){let t=r.exit??"?",s=[`${r.check==="failed"?"\u2717":r.check==="ok"||t==="0"||t==="done"?"\u2713":["skipped","declined","proposed","running"].includes(t)?"\u2013":"\u2717"} ${/^-?\d+$/.test(t)?`exit ${t}`:t}`];r.check==="failed"&&s.push("check failed"),r.attempts&&s.push(`${r.attempts} attempts`),r.lines&&s.push(`lines ${r.lines}`);let i=r.duration?parseFloat(r.duration):NaN;isNaN(i)||s.push(i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m${Math.round(i%60)}s`);let o=Date.parse(r.ended??r.ran??"");return isNaN(o)||s.push(Yf(e.getTime()-o)),s.join(" \xB7 ")}function Yf(r){let e=Math.max(0,Math.round(r/1e3));return e<60?"just now":e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}function re(r){return r.replace(/[&<>"']/g,e=>`&${{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#39"}[e]};`)}function La(r){if(/[\x00-\x20\x7f]/.test(r)||/^[\\/]{2}/.test(r))return;let e=/^([^/?#]*?):/.exec(r);if(!(e&&!/^(https?|mailto)$/i.test(e[1])))return r}var Na=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?(?:[ \t]+#+)?[ \t]*$/,Ma=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/,Nr=/^([ \t]*)([-*+]|(\d{1,9})[.)])([ \t]+|$)(.*)$/,Co=/^ {0,3}> ?(.*)$/,Qf=/^[ \t]*\|?[ \t]*:?-+:?[ \t]*(\|[ \t]*:?-+:?[ \t]*)*\|?[ \t]*$/,Zn=/^[ \t]*$/;function Lr(r){let e=0;for(let t of r)e+=t===" "?4-e%4:1;return e}function js(r,e){return`<div class="code">${e?`<span class="lang">${re(e)}</span>`:""}<pre><code>${re(r)}</code></pre></div>
|
|
39
|
+
`}var Us=r=>r;function ho(r,e){let t=Us;Us=e??(n=>n);try{return po(Yn(r).split(`
|
|
40
|
+
`))}finally{Us=t}}function Ga(r){return Na.test(r)||Ma.test(r)||Co.test(r)||Je(r)!==null||/^[ \t]*<!--/.test(r)}function po(r){let e="",t=0;for(;t<r.length;){let n=r[t];if(Zn.test(n)){t++;continue}if(/^[ \t]*<!--/.test(n)){for(;t<r.length&&!r[t].includes("-->");)t++;t++;continue}let s=Je(n);if(s){let c=t+1;for(;c<r.length&&!Ke(r[c],s);)c++;let u=l=>l.replace(new RegExp(`^[ \\t]{0,${s.indent.length}}`),"");e+=js(Us(r.slice(t+1,c).map(u).join(`
|
|
41
|
+
`)),Zt(s.info)),t=c+1;continue}let i=Na.exec(n);if(i){let c=i[1].length;e+=`<h${c}>${Xt(i[2]??"")}</h${c}>
|
|
42
|
+
`,t++;continue}if(Ma.test(n)){e+=`<hr>
|
|
43
|
+
`,t++;continue}if(Co.test(n)){let c=[];for(;t<r.length&&!Zn.test(r[t]);){let u=Co.exec(r[t]);c.push(u?u[1]:r[t]),t++}e+=`<blockquote>
|
|
44
|
+
${po(c)}</blockquote>
|
|
45
|
+
`;continue}if(Nr.test(n)){let c=qf(r,t);e+=c.html,t=c.end;continue}if(n.includes("|")&&t+1<r.length&&Qf.test(r[t+1])&&r[t+1].includes("-")){let c=[n],u=t+2;for(;u<r.length&&!Zn.test(r[u])&&r[u].includes("|");)c.push(r[u++]);e+=Vf(c),t=u;continue}let o=[];for(;t<r.length&&!Zn.test(r[t])&&(o.length===0||!Ga(r[t])&&!Nr.test(r[t]));)o.push(r[t]),t++;let B=c=>/ {2,}$|\\$/.test(c),a=o.map((c,u)=>Xt(c.trim().replace(/\\$/,""))+(u===o.length-1?"":B(c)?`<br>
|
|
45
46
|
`:`
|
|
46
47
|
`));e+=`<p>${a.join("")}</p>
|
|
47
|
-
`}return e}function
|
|
48
|
-
`;for(let u of
|
|
49
|
-
`);c+=`<li${l?' class="task"':""}>${
|
|
50
|
-
`}return{html:c+`</${
|
|
51
|
-
`,end:
|
|
52
|
-
<thead><tr>`+e(t).map(
|
|
48
|
+
`}return e}function qf(r,e){let t=Nr.exec(r[e]),n=Lr(t[1]),s=t[3]!==void 0,i=[],o=e;for(;o<r.length;){let u=Nr.exec(r[o]);if(u&&Lr(u[1])<=n+1&&u[3]!==void 0===s){let l=Lr(u[1]+u[2]+(u[4]||" ")),C=[u[5]];for(o++;o<r.length;){let f=r[o];if(Zn.test(f)){let d=o;for(;d<r.length&&Zn.test(r[d]);)d++;if(d<r.length&&Lr(/^[ \t]*/.exec(r[d])[0])>=l){for(;o<d;)C.push(r[o++].trim());continue}break}if(Lr(/^[ \t]*/.exec(f)[0])>=l)C.push(Wf(f,l));else if(!Nr.test(f)&&!Ga(f))C.push(f.trim());else break;o++}i.push(C);continue}break}let B=s?"ol":"ul",a=s&&t[3]!=="1"?` start="${parseInt(t[3],10)}"`:"",c=`<${B}${a}>
|
|
49
|
+
`;for(let u of i){let l=/^\[([ xX])\][ \t]+/.exec(u[0]);l&&(u[0]=u[0].slice(l[0].length));let C=l?`<input type="checkbox" disabled${l[1]===" "?"":" checked"}> `:"",f=u.length===1?Xt(u[0]):po(u).replace(/^<p>([\s\S]*?)<\/p>\n/,`$1
|
|
50
|
+
`);c+=`<li${l?' class="task"':""}>${C}${f}</li>
|
|
51
|
+
`}return{html:c+`</${B}>
|
|
52
|
+
`,end:o}}function Wf(r,e){let t=0,n=0;for(;n<r.length&&t<e&&(r[n]===" "||r[n]===" ");)t+=r[n]===" "?4-t%4:1,n++;return r.slice(n)}function Vf(r){let e=i=>i.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,"").split(/(?<!\\)\|/).map(o=>o.trim().replace(/\\\|/g,"|")),[t,...n]=r,s=`<table>
|
|
53
|
+
<thead><tr>`+e(t).map(i=>`<th>${Xt(i)}</th>`).join("")+`</tr></thead>
|
|
53
54
|
<tbody>
|
|
54
|
-
`;for(let
|
|
55
|
+
`;for(let i of n)s+="<tr>"+e(i).map(o=>`<td>${Xt(o)}</td>`).join("")+`</tr>
|
|
55
56
|
`;return s+`</tbody>
|
|
56
57
|
</table>
|
|
57
|
-
`}function
|
|
58
|
-
`,10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["'",39],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["`",96],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]]);static toUpperCase(r){if(r<zn)return Ws[r];let e=String.fromCodePoint(r).toUpperCase(),t=e.codePointAt(0)>$r?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),s=n.codePointAt(0)>$r?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}static toLowerCase(r){if(r<zn)return Vs[r];let e=String.fromCodePoint(r).toLowerCase(),t=e.codePointAt(0)>$r?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),s=n.codePointAt(0)>$r?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}},p=class{constructor(r,e=!1){this.data=r,this.isStride1=e,this.SIZE=e?2:3}getLo(r){return this.data[r*this.SIZE]}getHi(r){return this.data[r*this.SIZE+1]}getStride(r){return this.isStride1?1:this.data[r*this.SIZE+2]}get length(){return this.data.length/this.SIZE}},fo=new Uint8Array(256);for(let r=0,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";r<64;r++)fo[e.charCodeAt(r)]=r;var Co=r=>{let e=[],t=0,n=0;for(let s=0;s<r.length;s++){let B=fo[r.charCodeAt(s)];t|=(B&31)<<n,(B&32)===0?(e.push(t),t=0,n=0):n+=5}return e},g=(r,e)=>{let t=Co(r),n=e?t.length/2:t.length/3,s=new Uint32Array(n*3),B=0,i=0;for(let o=0;o<n;o++)B+=t[i++],s[o*3]=B,B+=t[i++],s[o*3+1]=B,s[o*3+2]=e?1:t[i++];return s},Gu=r=>{let e=Co(r),t=new Map,n=0;for(let s=0;s<e.length;s+=2){n+=e[s];let B=e[s+1],i=B>>>1^-(B&1);t.set(n,n+i)}return t},Mr=class{constructor(r){this.initializer=r,this.cache=new Map}has(r){return r in this.initializer}get(r){if(this.cache.has(r))return this.cache.get(r);let e=this.initializer[r],t=e?e():null;return this.cache.set(r,t),t}},Ge=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=Gu("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-BB-BB-BB-BB-BBskQB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BC-BB-BB-BB-BB-BB-BB-BByHBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBxHBCBBBCBBBCBBB3SBmMBkNBCBBBCBBB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BOBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new p(g("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))});static get Upper(){return this.CATEGORIES.get("Lu")}static SCRIPTS=new Mr({Adlam:()=>new p(g("go6DrCFJFB",!0)),Ahom:()=>new p(g("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new p(g("ggxCmS",!0)),Arabic:()=>new p(g("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new p(g("xpBlBDxBDCks9BE",!0)),Avestan:()=>new p(g("g4iC1BEG",!0)),Balinese:()=>new p(g("g4GsCCxB",!0)),Bamum:()=>new p(g("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new p(g("w26CdDF",!0)),Batak:()=>new p(g("g+GzBJD",!0)),Bengali:()=>new p(g("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new p(g("g17CYDY",!0)),Bhaiksuki:()=>new p(g("ggnCICsBCNLc",!0)),Bopomofo:()=>new p(g("qXB6wLqBxDf",!0)),Brahmi:()=>new p(g("ggkCtCFjBKA",!0)),Braille:()=>new p(g("ggK-H",!0)),Buginese:()=>new p(g("gwGbDB",!0)),Buhid:()=>new p(g("g6FT",!0)),Canadian_Aboriginal:()=>new p(g("ggF-TxRlC7tgCP",!0)),Carian:()=>new p(g("g1gCwB",!0)),Caucasian_Albanian:()=>new p(g("wphCzBMA",!0)),Chakma:()=>new p(g("gokC0BCR",!0)),Cham:()=>new p(g("gwqB2BKNDJDD",!0)),Cherokee:()=>new p(g("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new p(g("w9jCb",!0)),Common:()=>new p(g("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new p(g("ifNxkKzDGG",!0)),Cuneiform:()=>new p(g("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new p(g("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new p(g("w8rCiD",!0)),Cyrillic:()=>new p(g("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new p(g("gghCvC",!0)),Devanagari:()=>new p(g("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new p(g("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new p(g("ggmC7B",!0)),Duployan:()=>new p(g("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new p(g("ggsC1iBL68D",!0)),Elbasan:()=>new p(g("gohCnB",!0)),Elymaic:()=>new p(g("g-jCW",!0)),Ethiopic:()=>new p(g("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new p(g("gqjClBEcJB",!0)),Georgian:()=>new p(g("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new p(g("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new p(g("w5gCa",!0)),Grantha:()=>new p(g("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new p(g("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new p(g("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new p(g("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new p(g("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new p(g("go4C5B",!0)),Han:()=>new p(g("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new p(g("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new p(g("gojCnBJJ",!0)),Hanunoo:()=>new p(g("g5FU",!0)),Hatran:()=>new p(g("gniCSCBGE",!0)),Hebrew:()=>new p(g("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new p(g("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new p(g("giiCVCI",!0)),Inherited:()=>new p(g("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new p(g("g7iCSGH",!0)),Inscriptional_Parthian:()=>new p(g("g6iCVDH",!0)),Javanese:()=>new p(g("gsqBtCDJFB",!0)),Kaithi:()=>new p(g("gkkCiCLA",!0)),Kannada:()=>new p(g("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new p(g("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new p(g("g4nCQCoBEc",!0)),Kayah_Li:()=>new p(g("goqBtBCA",!0)),Kharoshthi:()=>new p(g("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new p(g("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new p(g("g8F9CDJHJnPf",!0)),Khojki:()=>new p(g("gwkCRCuB",!0)),Khudawadi:()=>new p(g("w1kC6BGJ",!0)),Kirat_Rai:()=>new p(g("gq7C5B",!0)),Lao:()=>new p(g("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new p(g("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new p(g("ggH3BEOEC",!0)),Limbu:()=>new p(g("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new p(g("gwhC2JKVLH",!0)),Linear_B:()=>new p(g("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new p(g("wmpBvBx1eA",!0)),Lycian:()=>new p(g("g0gCc",!0)),Lydian:()=>new p(g("gpiCZGA",!0)),Mahajani:()=>new p(g("wqkCmB",!0)),Makasar:()=>new p(g("g3nCY",!0)),Malayalam:()=>new p(g("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new p(g("giCbDA",!0)),Manichaean:()=>new p(g("g2iCmBFL",!0)),Marchen:()=>new p(g("wjnCfDVCN",!0)),Masaram_Gondi:()=>new p(g("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new p(g("gy7C6C",!0)),Meetei_Mayek:()=>new p(g("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new p(g("gg6DkGDP",!0)),Meroitic_Cursive:()=>new p(g("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new p(g("gsiCf",!0)),Miao:()=>new p(g("g47CqCF4BIQ",!0)),Modi:()=>new p(g("gwlCkCMJ",!0)),Mongolian:()=>new p(g("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new p(g("gy6CeCJFB",!0)),Multani:()=>new p(g("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new p(g("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new p(g("gkiCeJI",!0)),Nag_Mundari:()=>new p(g("wm5DpB",!0)),Nandinagari:()=>new p(g("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new p(g("gsGrBFZHKEB",!0)),Newa:()=>new p(g("gglC7CCE",!0)),Nko:()=>new p(g("g+B6BDC",!0)),Nushu:()=>new p(g("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new p(g("go4DsBENDJFB",!0)),Ogham:()=>new p(g("g0Fc",!0)),Ol_Chiki:()=>new p(g("wiHvB",!0)),Ol_Onal:()=>new p(g("wu5DqBFA",!0)),Old_Hungarian:()=>new p(g("gkjCyBOyBIF",!0)),Old_Italic:()=>new p(g("g4gCjBKC",!0)),Old_North_Arabian:()=>new p(g("g0iCf",!0)),Old_Permic:()=>new p(g("w6gCqB",!0)),Old_Persian:()=>new p(g("g9gCjBFN",!0)),Old_Sogdian:()=>new p(g("g4jCnB",!0)),Old_South_Arabian:()=>new p(g("gziCf",!0)),Old_Turkic:()=>new p(g("ggjCoC",!0)),Old_Uyghur:()=>new p(g("w7jCZ",!0)),Oriya:()=>new p(g("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new p(g("wlhCjBFjB",!0)),Osmanya:()=>new p(g("gkhCdDJ",!0)),Pahawh_Hmong:()=>new p(g("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new p(g("gjiCf",!0)),Pau_Cin_Hau:()=>new p(g("g2mC4B",!0)),Phags_Pa:()=>new p(g("giqB3B",!0)),Phoenician:()=>new p(g("goiCbEA",!0)),Psalter_Pahlavi:()=>new p(g("g8iCRIDNG",!0)),Rejang:()=>new p(g("wpqBjBMA",!0)),Runic:()=>new p(g("g1FqCEK",!0)),Samaritan:()=>new p(g("ggCtBDO",!0)),Saurashtra:()=>new p(g("gkqBlCJL",!0)),Sharada:()=>new p(g("gskC-ChsCH",!0)),Shavian:()=>new p(g("wihCvB",!0)),Siddham:()=>new p(g("gslC1BDlB",!0)),Sidetic:()=>new p(g("gqiCZ",!0)),SignWriting:()=>new p(g("gg2DrUQECO",!0)),Sinhala:()=>new p(g("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new p(g("w5jCpB",!0)),Sora_Sompeng:()=>new p(g("wmkCYIJ",!0)),Soyombo:()=>new p(g("wymCyC",!0)),Sundanese:()=>new p(g("g8G-BhIH",!0)),Sunuwar:()=>new p(g("g+mChBPJ",!0)),Syloti_Nagri:()=>new p(g("ggqBsB",!0)),Syriac:()=>new p(g("g4BNC7BDCxIK",!0)),Tagalog:()=>new p(g("g4FVKA",!0)),Tagbanwa:()=>new p(g("g7FMCCCB",!0)),Tai_Le:()=>new p(g("wqGdDE",!0)),Tai_Tham:()=>new p(g("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new p(g("g0qBiCZE",!0)),Tai_Yo:()=>new p(g("g25DeCVJB",!0)),Takri:()=>new p(g("g0lC5BHJ",!0)),Tamil:()=>new p(g("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new p(g("wz6CuCCJ",!0)),Tangut:()=>new p(g("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new p(g("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new p(g("g8BxB",!0)),Thai:()=>new p(g("hwD5BGb",!0)),Tibetan:()=>new p(g("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new p(g("wpL3BIBPA",!0)),Tirhuta:()=>new p(g("gklCnCJJ",!0)),Todhri:()=>new p(g("guhCzB",!0)),Tolong_Siki:()=>new p(g("wtnCrBFJ",!0)),Toto:()=>new p(g("w04De",!0)),Tulu_Tigalari:()=>new p(g("g8kCJBCDDClBBCJBCDDCDBCJBCBBJBB",!1)),Ugaritic:()=>new p(g("g8gCdCA",!0)),Unknown:()=>new p(g("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBF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hD-DBxHvw-FB",!1)),Vai:()=>new p(g("gopBrJ",!0)),Vithkuqi:()=>new p(g("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new p(g("g24D5BGA",!0)),Warang_Citi:()=>new p(g("glmCyCNA",!0)),Yezidi:()=>new p(g("g0jCpBCCDB",!0)),Yi:()=>new p(g("ggoBskBE2B",!0)),Zanabazar_Square:()=>new p(g("gwmCnC",!0))});static FOLD_CATEGORIES=new Mr({L:()=>new p(g("laA",!0)),LC:()=>new p(g("laA",!0)),Ll:()=>new p(g("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Lt:()=>new p(g("kOCCBCCBCClBCCtsHHBJHBJHBMQQwBAB",!1)),Lu:()=>new p(g("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHB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PPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new Mr({Common:()=>new p(g("8cgBgB",!1)),Greek:()=>new p(g("1FwUwU",!1)),Inherited:()=>new p(g("5cgBgBlgHAB",!1))})},J=class ye{static MAX_RUNE=1114111;static RUNE_ERROR=65533;static isUnsearchable(e){return e===ye.RUNE_ERROR||e>=ye.MIN_HIGH_SURROGATE&&e<=ye.MAX_LOW_SURROGATE}static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static MIN_HIGH_SURROGATE=55296;static MAX_HIGH_SURROGATE=56319;static MIN_LOW_SURROGATE=56320;static MAX_LOW_SURROGATE=57343;static MIN_SUPPLEMENTARY_CODE_POINT=65536;static is32(e,t){let n=0,s=e.length;for(;n<s;){let B=n+Math.floor((s-n)/2),i=e.getLo(B),o=e.getHi(B);if(i<=t&&t<=o){let a=e.getStride(B);return(t-i)%a===0}t<i?s=B:n=B+1}return!1}static is(e,t){if(t<=ye.MAX_LATIN1){for(let n=0;n<e.length;n++){if(t>e.getHi(n))continue;let s=e.getLo(n);if(t<s)return!1;let B=e.getStride(n);return(t-s)%B===0}return!1}return e.length>0&&t>=e.getLo(0)&&ye.is32(e,t)}static isUpper(e){if(e<=ye.MAX_LATIN1){let t=String.fromCodePoint(e);return t.toUpperCase()===t&&t.toLowerCase()!==t}return ye.is(Ge.Upper,e)}static isPrint(e){return e<=ye.MAX_LATIN1?e>=32&&e<ye.MAX_ASCII||e>=161&&e!==173:ye.is(Ge.Print,e)}static simpleFold(e){if(Ge.CASE_ORBIT.has(e))return Ge.CASE_ORBIT.get(e);if(e<=ye.MAX_ASCII){let t=L.toLowerCase(e);return t!==e?t:L.toUpperCase(e)}return e}static equalsIgnoreCase(e,t){if(e===t)return!0;if(e<0||t<0)return!1;if(e<=ye.MAX_ASCII&&t<=ye.MAX_ASCII)return 65<=e&&e<=90&&(e|=32),65<=t&&t<=90&&(t|=32),e===t;for(let n=ye.simpleFold(e);n!==e;n=ye.simpleFold(n))if(n===t)return!0;return!1}},eB=256,ho=new Uint8Array(eB);for(let r=0;r<eB;r++)ho[r]=97<=r&&r<=122||65<=r&&r<=90||48<=r&&r<=57||r===95?1:0;var zs=null,Ys=null,_=class Pe{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isByteArray(e){return Array.isArray(e)||Object.prototype.toString.call(e)==="[object Uint8Array]"}static isalnum(e){return L.CODES.get("0")<=e&&e<=L.CODES.get("9")||L.CODES.get("a")<=e&&e<=L.CODES.get("z")||L.CODES.get("A")<=e&&e<=L.CODES.get("Z")}static unhex(e){return L.CODES.get("0")<=e&&e<=L.CODES.get("9")?e-L.CODES.get("0"):L.CODES.get("a")<=e&&e<=L.CODES.get("f")?e-L.CODES.get("a")+10:L.CODES.get("A")<=e&&e<=L.CODES.get("F")?e-L.CODES.get("A")+10:-1}static escapeRune(e){let t="";if(J.isPrint(e))Pe.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(t+="\\"),t+=String.fromCodePoint(e);else switch(e){case L.CODES.get('"'):t+='\\"';break;case L.CODES.get("\\"):t+="\\\\";break;case L.CODES.get(" "):t+="\\t";break;case L.CODES.get(`
|
|
59
|
-
`):t+="\\n";break;case L.CODES.get("\r"):t+="\\r";break;case L.CODES.get("\b"):t+="\\b";break;case L.CODES.get("\f"):t+="\\f";break;default:{let n=e.toString(16);e<256?(t+="\\x",n.length===1&&(t+="0"),t+=n):t+=`\\x{${n}}`;break}}return t}static stringToRunes(e){let t=String(e),n=[],s=0;for(;s<t.length;){let B=t.codePointAt(s);n.push(B),s+=B>J.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<eB?ho[e]===1:!1}static emptyOpContext(e,t){let n=0;return e<0&&(n|=Pe.EMPTY_BEGIN_TEXT|Pe.EMPTY_BEGIN_LINE),e===10&&(n|=Pe.EMPTY_BEGIN_LINE),t<0&&(n|=Pe.EMPTY_END_TEXT|Pe.EMPTY_END_LINE),t===10&&(n|=Pe.EMPTY_END_LINE),Pe.isWordRune(e)!==Pe.isWordRune(t)?n|=Pe.EMPTY_WORD_BOUNDARY:n|=Pe.EMPTY_NO_WORD_BOUNDARY,n}static quoteMeta(e){return e.split("").map(t=>Pe.METACHARACTERS.indexOf(t)>=0?`\\${t}`:t).join("")}static charCount(e){return e>J.MAX_BMP?2:1}static toArray(e){let t=e.length,n=new Array(t);for(let s=0;s<t;s++)n[s]=e[s];return n}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return zs||(zs=new TextEncoder),zs.encode(e);{let t=[],n=0;for(let s=0;s<e.length;s++){let B=e.charCodeAt(s);B<128?t[n++]=B:B<2048?(t[n++]=B>>6|192,t[n++]=B&63|128):(B&64512)===J.MIN_HIGH_SURROGATE&&s+1<e.length&&(e.charCodeAt(s+1)&64512)===J.MIN_LOW_SURROGATE?(B=J.MIN_SUPPLEMENTARY_CODE_POINT+((B&1023)<<10)+(e.charCodeAt(++s)&1023),t[n++]=B>>18|240,t[n++]=B>>12&63|128,t[n++]=B>>6&63|128,t[n++]=B&63|128):(t[n++]=B>>12|224,t[n++]=B>>6&63|128,t[n++]=B&63|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){Ys||(Ys=new TextDecoder("utf-8"));let t=e instanceof Uint8Array?e:new Uint8Array(e);return Ys.decode(t)}else{let t=[],n=0,s=0;for(;n<e.length;){let B=e[n++];if(B<128)t[s++]=String.fromCharCode(B);else if(B>191&&B<224){let i=e[n++];t[s++]=String.fromCharCode((B&31)<<6|i&63)}else if(B>239&&B<365){let i=e[n++],o=e[n++],a=e[n++],c=((B&7)<<18|(i&63)<<12|(o&63)<<6|a&63)-J.MIN_SUPPLEMENTARY_CODE_POINT;t[s++]=String.fromCharCode(J.MIN_HIGH_SURROGATE+(c>>10)),t[s++]=String.fromCharCode(J.MIN_LOW_SURROGATE+(c&1023))}else{let i=e[n++],o=e[n++];t[s++]=String.fromCharCode((B&15)<<12|(i&63)<<6|o&63)}}return t.join("")}}},po=(r=[],e=0)=>{let t=Object.create(null);for(let n=0;n<r.length;n++){let s=r[n],B=e+n;t[s]=B,t[B]=s}return Object.freeze(t)},Kt=class Zs{static Encoding=po(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===Zs.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===Zs.Encoding.UTF_16}},Hi=class extends Kt{constructor(r=null){super(),this.bytes=r}getEncoding(){return Kt.Encoding.UTF_8}asCharSequence(){return _.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},Hu=class extends Kt{constructor(r=null){super(),this.charSequence=r}getEncoding(){return Kt.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return _.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},Ut=class{static utf16(r){return new Hu(r)}static utf8(r){return _.isByteArray(r)?new Hi(r):new Hi(_.stringToUtf8ByteArray(r))}},Ne=class{static EOF(){return-8}constructor(){this.end=0}canCheckPrefix(){return!0}endPos(){return this.end}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},Pu=class un extends Ne{static RUNE_ERROR_STEP=J.RUNE_ERROR<<3|1;constructor(e,t=0,n=e.length){super(),this.bytes=e,this.start=t,this.end=n}hasString(e,t){let n=e.bytes;if(n.length===0)return!0;let s=this.indexOf(this.bytes,n,this.start+t);return s!==-1&&s<=this.end-n.length}hasAnyString(e,t){return e.automaton8().searchUTF8(this.bytes,this.start+t,this.end)}step(e){if(e+=this.start,e>=this.end)return Ne.EOF();let t=this.bytes[e]&255;if(t<128)return t<<3|1;let n,s,B=128,i=191;if(t>=194&&t<=223)n=2,s=t&31;else if(t>=224&&t<=239)n=3,s=t&15,t===224?B=160:t===237&&(i=159);else if(t>=240&&t<=244)n=4,s=t&7,t===240?B=144:t===244&&(i=143);else return un.RUNE_ERROR_STEP;if(e+n>this.end)return un.RUNE_ERROR_STEP;let o=this.bytes[e+1]&255;if(o<B||o>i)return un.RUNE_ERROR_STEP;if(s=s<<6|o&63,n>2){let a=this.bytes[e+2]&255;if((a&192)!==128)return un.RUNE_ERROR_STEP;if(s=s<<6|a&63,n>3){let c=this.bytes[e+3]&255;if((c&192)!==128)return un.RUNE_ERROR_STEP;s=s<<6|c&63}}return s<<3|n}index(e,t){t+=this.start;let n=this.indexOf(this.bytes,e.prefixUTF8,t);return n<0?n:n-t}context(e){e+=this.start;let t=-1;if(e>this.start&&e<=this.end){let s=e-1;if(t=this.bytes[s--],t>=128){let B=e-4;for(B<this.start&&(B=this.start);s>=B&&(this.bytes[s]&192)===128;)s--;s<this.start&&(s=this.start);let i=this.step(s-this.start);t=s+(i&7)===e?i>>3:J.RUNE_ERROR}}let n=e<this.end?this.step(e-this.start)>>3:-1;return _.emptyOpContext(t,n)}indexOf(e,t,n=0){let s=t.length;if(s===0)return n<=this.end?n:-1;let B=t[0],i=this.end-s,o=typeof e.indexOf=="function",a=n;for(;a<=i;){if(o){if(a=e.indexOf(B,a),a===-1||a>i)return-1}else{for(;a<=i&&e[a]!==B;)a++;if(a>i)return-1}let c=!0;for(let u=1;u<s;u++)if(e[a+u]!==t[u]){c=!1;break}if(c)return a;a++}return-1}prefixLength(e){return e.prefixUTF8.length}},_u=class extends Ne{constructor(r,e=0,t=r.length){super(),this.charSequence=r,this.start=e,this.end=t}hasString(r,e){let t=this.charSequence.indexOf(r.str,this.start+e);return t!==-1&&t<=this.end-r.str.length}hasAnyString(r,e){return r.automaton16().searchUTF16(this.charSequence,this.start+e,this.end)}step(r){if(r+=this.start,r>=this.end)return Ne.EOF();let e=this.charSequence.charCodeAt(r);if(e<J.MIN_HIGH_SURROGATE||e>J.MAX_HIGH_SURROGATE||r+1>=this.end)return e<<3|1;let t=this.charSequence.charCodeAt(r+1);return t>=J.MIN_LOW_SURROGATE&&t<=J.MAX_LOW_SURROGATE?(e-J.MIN_HIGH_SURROGATE)*1024+(t-J.MIN_LOW_SURROGATE)+J.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:e<<3|1}index(r,e){e+=this.start;let t=this.charSequence.indexOf(r.prefix,e);return t<0||t>this.end-r.prefix.length?-1:t-e}context(r){r+=this.start;let e=r>this.start&&r<=this.end?this.charSequence.charCodeAt(r-1):-1,t=r<this.end?this.charSequence.charCodeAt(r):-1;return _.emptyOpContext(e,t)}prefixLength(r){return r.prefix.length}},ue=class{static fromUTF8(r,e=0,t=r.length){return new Pu(r,e,t)}static fromUTF16(r,e=0,t=r.length){return new _u(r,e,t)}},Yn=class extends Error{constructor(r){super(r),this.name="RE2JSException"}},fe=class extends Yn{constructor(r,e=null){let t=`error parsing regexp: ${r}`;e&&(t+=`: \`${e}\``),super(t),this.name="RE2JSSyntaxException",this.message=t,this.error=r,this.input=e}getDescription(){return this.error}getPattern(){return this.input}},Kn=class extends Yn{constructor(r){super(r),this.name="RE2JSCompileException"}},Me=class extends Yn{constructor(r){super(r),this.name="RE2JSGroupException"}},Ju=class extends Yn{constructor(r){super(r),this.name="RE2JSFlagsException"}},jn=class extends Yn{constructor(r){super(r),this.name="RE2JSInternalException"}},Pi=class go{static MAX_REPLACER_ARGS=65535;static quoteReplacement(e,t=!1){return t?e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(n=>{let s=n.codePointAt(0);return s===L.CODES.get("\\")||s===L.CODES.get("$")?`\\${n}`:n}).join(""):e.indexOf("$")<0?e:e.split("").map(n=>n.codePointAt(0)===L.CODES.get("$")?"$$":n).join("")}constructor(e,t){if(e===null)throw new Error("pattern is null");this.patternInput=e;let n=this.patternInput.re2();this.patternGroupCount=n.numberOfCapturingGroups(),this.groups=[],this.namedGroups=n.namedGroups,this.numberOfInstructions=n.numberOfInstructions(),this.lookbehindState=null,t instanceof Kt?this.resetMatcherInput(t):_.isByteArray(t)?this.resetMatcherInput(Ut.utf8(t)):this.resetMatcherInput(Ut.utf16(t))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(e===null)throw new Error("input is null");return e instanceof Kt||(_.isByteArray(e)?e=Ut.utf8(e):e=Ut.utf16(e)),this.matcherInput=e,this.lookbehindState!==null?this.lookbehindState.reset():this.lookbehindState=this.patternInput.re2().createLookbehindState(),this.reset(),this}start(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new Me(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e]}end(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new Me(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e+1]}programSize(){return this.numberOfInstructions}group(e=0){if(typeof e=="string"){let s=this.namedGroups[e];if(!Number.isFinite(s))throw new Me(`group '${e}' not found`);e=s}let t=this.start(e),n=this.end(e);return t<0&&n<0?null:this.substring(t,n)}getNamedGroups(){if(!this.hasMatch)throw new Me("perhaps no match attempted");let e=Object.create(null);for(let t of Object.keys(this.namedGroups))e[t]=this.group(t);return e}groupCount(){return this.patternGroupCount}loadGroup(e){if(!Number.isInteger(e)||e<0||e>this.patternGroupCount)throw new Me(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new Me("perhaps no match attempted");if(e===0||this.hasGroups)return;let t=this.matcherInputLength,n=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],t,this.anchorFlag,1+this.patternGroupCount,this.lookbehindState);if(!n[0])throw new Me("inconsistency in matching group data");this.groups=n[1],this.hasGroups=!0}matches(){return this.genMatch(0,M.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,M.ANCHOR_START)}find(e=null){if(e!==null){if(!Number.isInteger(e)||e<0||e>this.matcherInputLength)throw new Me(`start index out of bounds: ${e}`);return this.reset(),this.genMatch(e,0)}if(e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1])){let t=(this.matcherInput.isUTF16Encoding()?ue.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):ue.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(e);t<0?e++:e+=t&7}return this.genMatch(e,M.UNANCHORED)}genMatch(e,t){let n=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,t,1,this.lookbehindState);return n[0]?(this.groups=n[1],this.hasMatch=!0,this.hasGroups=this.patternGroupCount===0,this.anchorFlag=t,!0):(this.hasMatch=!1,!1)}substring(e,t){return this.matcherInput.isUTF8Encoding()?_.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,t)):this.matcherInput.asCharSequence().substring(e,t).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e,t=!1){let n="",s=this.start(),B=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=B,n+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),n}appendReplacementInternalJava(e){let t="",n=0,s=e.length,B=0;for(;B<s;){let i=e.codePointAt(B);if(i===L.CODES.get("\\")){if(n<B&&(t+=e.substring(n,B)),B++,B>=s)throw new Me("character to be escaped is missing");n=B,B++;continue}if(i===L.CODES.get("$")){if(n<B&&(t+=e.substring(n,B)),B+1>=s)throw new Me("Illegal group reference: group index is missing");let o=e.codePointAt(B+1);if(L.CODES.get("0")<=o&&o<=L.CODES.get("9")){let a=o-L.CODES.get("0"),c=B+2;for(;c<s;c++){let l=e.codePointAt(c);if(l<L.CODES.get("0")||l>L.CODES.get("9")||a*10+l-L.CODES.get("0")>this.patternGroupCount)break;a=a*10+l-L.CODES.get("0")}if(a>this.patternGroupCount)throw new Me(`n > number of groups: ${a}`);let u=this.group(a);u!==null&&(t+=u),B=c,n=B}else if(o===L.CODES.get("{")){let a=B+2;for(;a<s&&e.codePointAt(a)!==L.CODES.get("}");)a++;if(a>=s)throw new Me("named capture group is missing trailing '}'");let c=e.substring(B+2,a),u=this.group(c);u!==null&&(t+=u),B=a+1,n=B}else throw new Me("Illegal group reference");continue}B++}return n<s&&(t+=e.substring(n,s)),t}appendReplacementInternalJs(e){let t="",n=0,s=e.length;for(let B=0;B<s-1;B++)if(e.codePointAt(B)===L.CODES.get("$")){let i=e.codePointAt(B+1);if(L.CODES.get("$")===i){n<B&&(t+=e.substring(n,B)),t+="$",B++,n=B+1;continue}else if(L.CODES.get("&")===i){n<B&&(t+=e.substring(n,B));let o=this.group(0);o!==null?t+=o:t+="$&",B++,n=B+1;continue}else if(L.CODES.get("`")===i){n<B&&(t+=e.substring(n,B)),t+=this.substring(0,this.start(0)),B++,n=B+1;continue}else if(L.CODES.get("'")===i){n<B&&(t+=e.substring(n,B)),t+=this.substring(this.end(0),this.matcherInputLength),B++,n=B+1;continue}else if(L.CODES.get("1")<=i&&i<=L.CODES.get("9")){let o=i-L.CODES.get("0");for(n<B&&(t+=e.substring(n,B)),B+=2;B<s&&(i=e.codePointAt(B),!(i<L.CODES.get("0")||i>L.CODES.get("9")||o*10+i-L.CODES.get("0")>this.patternGroupCount));B++)o=o*10+i-L.CODES.get("0");if(o>this.patternGroupCount){t+=`$${o}`,n=B,B--;continue}let a=this.group(o);a!==null&&(t+=a),n=B,B--;continue}else if(i===L.CODES.get("<")){n<B&&(t+=e.substring(n,B)),B++;let o=B+1;for(;o<e.length&&e.codePointAt(o)!==L.CODES.get(">")&&e.codePointAt(o)!==L.CODES.get(" ");)o++;if(o===e.length||e.codePointAt(o)!==L.CODES.get(">")){t+=e.substring(B-1,o+1),n=o+1,B=o;continue}let a=e.substring(B+1,o);if(Object.prototype.hasOwnProperty.call(this.namedGroups,a)){let c=this.group(a);c!==null&&(t+=c)}else t+=`$<${a}>`;n=o+1,B=o;continue}}return n<s&&(t+=e.substring(n,s)),t}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e,t=!1){return this.replace(e,!0,t)}replaceFirst(e,t=!1){return this.replace(e,!1,t)}replace(e,t=!0,n=!1){let s="";this.reset();let B=typeof e=="function",i=Object.keys(this.namedGroups).length>0,o=null;if(B){if(this.groupCount()>=go.MAX_REPLACER_ARGS)throw new Me("Too many capture groups to safely invoke replacer function");o=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(s+=B?this.appendReplacementFunc(e,i,o):this.appendReplacement(e,n),!!t););return s+=this.appendTail(),s}appendReplacementFunc(e,t,n){let s="",B=this.start(),i=this.end();this.appendPos<B&&(s+=this.substring(this.appendPos,B)),this.appendPos=i;let o=this.buildReplacerArgs(B,t,n);return s+=String(e(...o)),s}buildReplacerArgs(e,t,n){let s=[this.group(0)],B=this.groupCount();for(let i=1;i<=B;i++){let o=this.start(i);o<0?s.push(void 0):s.push(this.substring(o,this.end(i)))}if(s.push(e),s.push(n),t){let i=this.getNamedGroups();for(let o in i)i[o]===null&&(i[o]=void 0);s.push(i)}return s}},I=class xe{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static LB_WRITE=12;static LB_CHECK=13;static isRuneOp(e){return xe.RUNE<=e&&e<=xe.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let n of e)t+=_.escapeRune(n);return t+='"',t}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=new Int32Array(0),this.next=null}matchRune(e){if(this.runes.length===1){let i=this.runes[0];return(this.arg&M.FOLD_CASE)!==0?J.equalsIgnoreCase(i,e):e===i}let t=this.runes.length;if(t===0)return!1;if(t===2||t===4||t===6||t===8){for(let i=0;i<t;i+=2){if(e<this.runes[i])return!1;if(e<=this.runes[i+1])return!0}return!1}let n=0,s=t>>1;for(;s>1;){let i=s>>1;n+=this.runes[n+i<<1]<=e?i:0,s-=i}n+=this.runes[n<<1]<=e?1:0;let B=n-1;return B>=0&&e<=this.runes[B<<1|1]}matchRunePos(e){if(this.runes.length===1){let i=this.runes[0];return(this.arg&M.FOLD_CASE)!==0?J.equalsIgnoreCase(i,e)?0:-1:e===i?0:-1}let t=this.runes.length;if(t===0)return-1;if(t===2||t===4||t===6||t===8){for(let i=0;i<t;i+=2){if(e<this.runes[i])return-1;if(e<=this.runes[i+1])return Math.floor(i/2)}return-1}let n=0,s=t>>1;for(;s>1;){let i=s>>1;n+=this.runes[n+i<<1]<=e?i:0,s-=i}n+=this.runes[n<<1]<=e?1:0;let B=n-1;return B>=0&&e<=this.runes[B<<1|1]?B:-1}toString(){switch(this.op){case xe.ALT:return`alt -> ${this.out}, ${this.arg}`;case xe.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case xe.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case xe.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case xe.MATCH:return`match${this.arg!==0?` ${this.arg}`:""}`;case xe.FAIL:return"fail";case xe.NOP:return`nop -> ${this.out}`;case xe.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case xe.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case xe.RUNE:return this.runes===null?"rune <null>":["rune ",xe.escapeRunes(this.runes),(this.arg&M.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case xe.RUNE1:return`rune1 ${xe.escapeRunes(this.runes)} -> ${this.out}`;case xe.RUNE_ANY:return`any -> ${this.out}`;case xe.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},_i=class mo{constructor(e){this.sparse=new Int32Array(e),this.densePcs=new Int32Array(e),this.denseCaps=null,this.size=0,this.ncap=0,this.mainThreads=0}static INITIAL_THREADS=32;init(e){this.ncap=e;let t=Math.min(this.densePcs.length,mo.INITIAL_THREADS)*e;(!this.denseCaps||this.denseCaps.length<t)&&(this.denseCaps=new Int32Array(t))}growCaps(e){let t=this.densePcs.length*this.ncap,n=new Int32Array(Math.min(t,Math.max(e,2*this.denseCaps.length)));n.set(this.denseCaps),this.denseCaps=n}contains(e){let t=this.sparse[e];return t<this.size&&this.densePcs[t]===e}isEmpty(){return this.size===0}add(e){let t=this.size++;return this.sparse[e]=t,this.densePcs[t]=e,t}clear(){this.size=0,this.mainThreads=0}toString(){let e="{";for(let t=0;t<this.size;t++)t!==0&&(e+=", "),e+=this.densePcs[t];return e+="}",e}},Uu=class{constructor(r){this.pos=-1,this.pcs=new Int32Array(r.numInst()),this.size=0,this.lbTable=new Int32Array(r.numLb+1)}reset(){this.pos=-1,this.size=0}},Eo=class Do{static fromRE2(e){let t=new Do;return t.prog=e.prog,t.re2=e,t.q0=new _i(t.prog.numInst()),t.q1=new _i(t.prog.numInst()),t.addStack=new Int32Array(2*(t.prog.numInst()+1)),t.matched=!1,t.matchcap=new Int32Array(t.prog.numCap<2?2:t.prog.numCap),t.ncap=0,t}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.addStack=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(e){this.ncap=e,e>this.matchcap.length?this.matchcap=new Int32Array(e).fill(-1):this.matchcap.fill(-1),this.q0.init(e),this.q1.init(e),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return this.ncap===0?_.emptyInts():_.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,n,s=null){let B=this.re2.cond;if(B===_.EMPTY_ALL||(n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&t!==0)return!1;this.matched=!1,this.matchcap.fill(-1);let i=this.prog.numLb>0,o=t,a=t,c=!1;i&&(s!==null&&s.pos>=0&&s.pos<=t?(a=s.pos,c=!0):a=0);let u=i&&s!==null,l=this.q0,f=this.q1,C=e.step(a),d=C>>3,h=C&7,k=-1,R=0;C!==Ne.EOF()&&(C=e.step(a+h),k=C>>3,R=C&7);let E;for(a===0?E=_.emptyOpContext(-1,d):E=e.context(a),i&&(c?this.restoreLookbehinds(s,l,E):this.spawnLookbehinds(l,a,E));;){if(l.mainThreads===0){if((B&_.EMPTY_BEGIN_TEXT)!==0&&a!==0||(n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&a!==0||this.matched)break;if(this.prog.numLb===0&&l.isEmpty()&&this.re2.prefix.length!==0&&k!==this.re2.prefixRune&&e.canCheckPrefix()){let y=e.index(this.re2,a);if(y<0)break;a+=y,C=e.step(a),d=C>>3,h=C&7,C=e.step(a+h),k=C>>3,R=C&7,E=e.context(a)}}a>=o&&(u&&(this.saveLookbehinds(s,l,a),u=!1),!this.matched&&(a===0||n===M.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=a),this.add(l,this.prog.start,a,this.matchcap,0,E)));let S=a+h;if(E=e.context(S),this.step(l,f,a,S,d,E,n,a===e.endPos()),h===0||this.ncap===0&&this.matched)break;a+=h,d=k,h=R,d!==-1&&(C=e.step(a+h),k=C>>3,R=C&7);let w=l;l=f,f=w}return l.clear(),f.clear(),this.matched}matchSet(e,t,n){let s=this.re2.cond;if(s===_.EMPTY_ALL)return[];if((n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&t!==0)return[];let B=this.prog.numLb>0?0:t,i=t,o=this.q0,a=this.q1,c=e.step(B),u=c>>3,l=c&7,f=-1,C=0;c!==Ne.EOF()&&(c=e.step(B+l),f=c>>3,C=c&7);let d=B===0?_.emptyOpContext(-1,u):e.context(B),h=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(o,B,d);!(o.mainThreads===0&&((s&_.EMPTY_BEGIN_TEXT)!==0&&B!==0||(n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&B!==0));){(B===0||n===M.UNANCHORED)&&B>=i&&this.add(o,this.prog.start,B,this.matchcap,0,d);let k=B+l;d=e.context(k);for(let E=0;E<o.size;E++){let S=o.densePcs[E],w=this.prog.inst[S],y=E*this.ncap,O=!1;switch(w.op){case I.MATCH:if(n===M.ANCHOR_BOTH&&B!==e.endPos())break;h.add(w.arg);break;case I.RUNE:O=w.matchRune(u);break;case I.RUNE1:O=u===w.runes[0];break;case I.RUNE_ANY:O=!0;break;case I.RUNE_ANY_NOT_NL:O=u!==10;break;default:continue}O&&this.add(a,w.out,k,o.denseCaps,y,d)}if(o.clear(),l===0)break;B+=l,u=f,l=C,u!==-1&&(c=e.step(B+l),f=c>>3,C=c&7);let R=o;o=a,a=R}return a.clear(),Array.from(h).sort((k,R)=>k-R)}step(e,t,n,s,B,i,o,a){let c=this.re2.longest;for(let u=0;u<e.size;u++){let l=e.densePcs[u],f=u*this.ncap;if(c&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[f])continue;let C=this.prog.inst[l],d=!1;switch(C.op){case I.MATCH:if(o===M.ANCHOR_BOTH&&!a)break;if(this.ncap>0&&(!c||!this.matched||this.matchcap[1]<n)){e.denseCaps[f+1]=n;for(let h=0;h<this.ncap;h++)this.matchcap[h]=e.denseCaps[f+h]}c||(e.size=0),this.matched=!0;break;case I.RUNE:d=C.matchRune(B);break;case I.RUNE1:d=B===C.runes[0];break;case I.RUNE_ANY:d=!0;break;case I.RUNE_ANY_NOT_NL:d=B!==10;break;default:continue}d&&this.add(t,C.out,s,e.denseCaps,f,i)}e.clear()}spawnLookbehinds(e,t,n){for(let s=0;s<this.prog.lbStarts.length;s++)this.add(e,this.prog.lbStarts[s],t,this.matchcap,0,n)}restoreLookbehinds(e,t,n){this.lbTable.set(e.lbTable);for(let s=0;s<e.size;s++)this.add(t,e.pcs[s],e.pos,this.matchcap,0,n)}saveLookbehinds(e,t,n){let s=0;for(let B=0;B<t.size;B++){let i=t.densePcs[B];this.prog.lbInst[i]===1&&I.isRuneOp(this.prog.inst[i].op)&&(e.pcs[s++]=i)}e.size=s,e.pos=n,e.lbTable.set(this.lbTable)}add(e,t,n,s,B,i){let o=this.addStack,a=0;for(;;){for(;t!==0&&!e.contains(t);){let u=e.add(t),l=this.prog.inst[t];switch(l.op){case I.FAIL:t=0;break;case I.ALT:case I.ALT_MATCH:o[a++]=l.arg,o[a++]=0,t=l.out;break;case I.EMPTY_WIDTH:t=(l.arg&~i)===0?l.out:0;break;case I.NOP:t=l.out;break;case I.CAPTURE:l.arg<this.ncap&&(o[a++]=-l.arg-1,o[a++]=s[B+l.arg],s[B+l.arg]=n),t=l.out;break;case I.LB_WRITE:this.lbTable[Math.abs(l.arg)]=n,t=l.out;break;case I.LB_CHECK:l.arg>0?t=this.lbTable[l.arg]===n?l.out:0:t=this.lbTable[-l.arg]!==n?l.out:0;break;case I.MATCH:case I.RUNE:case I.RUNE1:case I.RUNE_ANY:case I.RUNE_ANY_NOT_NL:if(this.prog.lbInst[t]===0&&e.mainThreads++,this.ncap>0){let f=u*this.ncap;f+this.ncap>e.denseCaps.length&&e.growCaps(f+this.ncap);for(let C=0;C<this.ncap;C++)e.denseCaps[f+C]=s[B+C]}t=0;break;default:throw new jn("unhandled")}}if(a===0)return;a-=2;let c=o[a];c<0?(s[B-c-1]=o[a+1],t=0):t=c}}},Ku=(r,e,t)=>{let n=-2128831035;for(let s=0;s<r.length;s++)n^=r[s],n=Math.imul(n,16777619);n^=e,n=Math.imul(n,16777619);for(let s=0;s<t.length;s++)n^=t[s],n=Math.imul(n,16777619);return n},Ji=(r,e)=>{if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0},Qs=[],Jn=-1,ju=class{constructor(r,e,t){this.nfaStates=r,this.flag=e,this.isMatch=(e&tB.FLAG_MATCH)!==0,this.matchIDs=t,this.next=null,this.nextAnchored=null}},tB=class _e{static FLAG_EMPTY_MASK=255;static FLAG_MATCH=256;static FLAG_LAST_WORD=512;static FLAG_NEED_SHIFT=16;static STATE_OVERHEAD=160;static TABLE_OVERHEAD=16;static PROGRESS_PER_STATE=10;constructor(e,t=8388608){this.prog=e,this.maxMem=t,this.stateCache=new Map,this.stateCount=0,this.startStates=new Map,this.failed=!1;for(let n=0;n<e.numInst();n++){let s=e.getInst(n).op;if(s===I.LB_WRITE||s===I.LB_CHECK){this.failed=!0;break}}this.computeRuneClasses(),this.stateBudget=t,this.memBudget=t}computeRuneClasses(){let e=new Set,t=(s,B)=>{e.add(s),e.add(B+1)};for(let s=0;s<this.prog.numInst();s++){let B=this.prog.getInst(s);switch(B.op){case I.RUNE:case I.RUNE1:if(B.runes.length===1){if(t(B.runes[0],B.runes[0]),(B.arg&M.FOLD_CASE)!==0)for(let i=J.simpleFold(B.runes[0]);i!==B.runes[0];i=J.simpleFold(i))t(i,i)}else for(let i=0;i<B.runes.length;i+=2)t(B.runes[i],B.runes[i+1]);break;case I.RUNE_ANY_NOT_NL:t(10,10);break;case I.EMPTY_WIDTH:(B.arg&(_.EMPTY_BEGIN_LINE|_.EMPTY_END_LINE))!==0&&t(10,10),(B.arg&(_.EMPTY_WORD_BOUNDARY|_.EMPTY_NO_WORD_BOUNDARY))!==0&&(t(48,57),t(65,90),t(95,95),t(97,122))}}e.delete(0),this.classBounds=Int32Array.from(e).sort(),this.numClasses=this.classBounds.length+1;let n=new Int32Array(J.MAX_LATIN1+1);for(let s=0;s<=J.MAX_LATIN1;s++)n[s]=this.searchClass(s);this.latin1Class=n}runeClass(e){return e<=J.MAX_LATIN1?this.latin1Class[e]:this.searchClass(e)}searchClass(e){let t=this.classBounds,n=0,s=t.length;for(;n<s;){let B=n+s>>1;t[B]<=e?n=B+1:s=B}return n}closure(e,t){let n=new Set,s=Array.from(e),B=0;for(;s.length>0;){let i=s.pop();if(i===0||n.has(i))continue;n.add(i);let o=this.prog.getInst(i);switch(o.op){case I.ALT:case I.ALT_MATCH:s.push(o.out),s.push(o.arg);break;case I.NOP:case I.CAPTURE:s.push(o.out);break;case I.EMPTY_WIDTH:B|=o.arg,(o.arg&~t)===0&&s.push(o.out)}}return{pcs:Int32Array.from(n).sort(),needflags:B}}getState(e,t,n){let s=Ku(e,t,n),B=this.stateCache.get(s);if(B)for(let a=0;a<B.length;a++){let c=B[a];if(c.flag===t&&Ji(c.nfaStates,e)&&Ji(c.matchIDs,n))return c}let i=_e.STATE_OVERHEAD+4*e.length+8*n.length;if(this.memBudget<i)return null;this.memBudget-=i,B||(B=[],this.stateCache.set(s,B));let o=new ju(e,t,n);return B.push(o),this.stateCount++,o}makeState(e,t,n){let s=this.closure(e,t&_e.FLAG_EMPTY_MASK),B=t;return s.needflags===0&&(B&=_e.FLAG_MATCH),B|=s.needflags<<_e.FLAG_NEED_SHIFT,this.getState(s.pcs,B,n)}allocTable(e,t){let n=this.numClasses+1,s=_e.TABLE_OVERHEAD+8*n;if(this.memBudget<s)return null;this.memBudget-=s;let B=new Array(n).fill(null);return t===M.UNANCHORED?e.next=B:e.nextAnchored=B,B}clearCache(){this.stateCache.clear(),this.stateCount=0,this.startStates.clear(),this.memBudget=this.stateBudget}resetCache(e){return this.clearCache(),this.getState(e.nfaStates,e.flag,e.matchIDs)}step(e,t,n,s){let B=s===M.UNANCHORED?e.next:e.nextAnchored;if(B!==null){let E=B[t];if(E!==null)return E}else if(B=this.allocTable(e,s),B===null)return null;let i=e.flag>>>_e.FLAG_NEED_SHIFT,o=e.flag&_e.FLAG_EMPTY_MASK,a=o,c=0;n===10&&(a|=_.EMPTY_END_LINE,c|=_.EMPTY_BEGIN_LINE),n===Jn&&(a|=_.EMPTY_END_LINE|_.EMPTY_END_TEXT);let u=(e.flag&_e.FLAG_LAST_WORD)!==0,l=n!==Jn&&_.isWordRune(n);a|=l===u?_.EMPTY_NO_WORD_BOUNDARY:_.EMPTY_WORD_BOUNDARY;let f=e.nfaStates;(a&~o&i)!==0&&(f=this.closure(f,a).pcs);let C=[],d=!1,h=Qs;for(let E=0;E<f.length;E++){let S=this.prog.getInst(f[E]);S.op===I.MATCH?(d||(d=!0,h=[]),h.push(S.arg)):n!==Jn&&I.isRuneOp(S.op)&&S.matchRune(n)&&C.push(S.out)}h.length>1&&h.sort((E,S)=>E-S),s===M.UNANCHORED&&n!==Jn&&C.push(this.prog.start);let k=c;d&&(k|=_e.FLAG_MATCH),l&&(k|=_e.FLAG_LAST_WORD);let R=this.makeState(C,k,h);return R===null?null:(B[t]=R,R)}start(e,t){let n=e.context(t),s;if((n&_.EMPTY_BEGIN_TEXT)!==0)s=_.EMPTY_BEGIN_TEXT|_.EMPTY_BEGIN_LINE;else if((n&_.EMPTY_BEGIN_LINE)!==0)s=_.EMPTY_BEGIN_LINE;else{let i=e.step(t),o=i>=0&&_.isWordRune(i>>3);s=(n&_.EMPTY_WORD_BOUNDARY)!==0!==o?_e.FLAG_LAST_WORD:0}let B=this.startStates.get(s);if(B===void 0){if(B=this.makeState([this.prog.start],s,Qs),B===null&&(this.clearCache(),B=this.makeState([this.prog.start],s,Qs),B===null))return null;this.startStates.set(s,B)}return B}stepOrReset(e,t,n,s,B,i){let o=this.step(e,t,n,s);if(o!==null)return o;if(i.resetPos>=0&&B-i.resetPos<_e.PROGRESS_PER_STATE*this.stateCount)return null;i.resetPos=B;let a=this.resetCache(e);return a===null?null:(o=this.step(a,t,n,s),o)}run(e,t,n,s,B){let i=e.endPos(),o=this.latin1Class,a=n===M.UNANCHORED,c={resetPos:-1},u=t;for(;u<i;){let l=e.step(u),f=l>>3,C=l&7;if(C===0)break;let d=f<=J.MAX_LATIN1?o[f]:this.runeClass(f),h=a&&s.next!==null?s.next[d]:null;if(h===null&&(h=this.stepOrReset(s,d,f,n,u,c),h===null))return null;if(s=h,s.isMatch&&B(s,!1))return!0;if(!a&&s.nfaStates.length===0)return!1;u+=C}return s=this.stepOrReset(s,this.numClasses,Jn,n,u,c),s===null?null:s.isMatch&&B(s,!0)}match(e,t,n){if(this.failed)return null;if((n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&t!==0)return!1;let s=this.start(e,t);return s===null?null:this.run(e,t,n,s,(B,i)=>n!==M.ANCHOR_BOTH||i)}matchSet(e,t,n){if(this.failed)return null;if((n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&t!==0)return[];let s=this.start(e,t);if(s===null)return null;let B=new Set,i=(o,a)=>{if(n!==M.ANCHOR_BOTH||a)for(let c=0;c<o.matchIDs.length;c++)B.add(o.matchIDs[c]);return!1};return this.run(e,t,n,s,i)===null?null:Array.from(B).sort((o,a)=>o-a)}},zu=32,Yu=500,qs=256,Qu=262144,qu=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(qs),this.jobArg=new Uint8Array(qs),this.jobPos=new Int32Array(qs),this.jobLen=0,this.visited=new Uint32Array(0)}reset(r,e,t){this.end=e,this.jobLen=0,this.ncap=t;let n=r.numInst()*(e+1)+zu-1>>>5;this.visited.length<n?this.visited=new Uint32Array(n):this.visited.fill(0,0,n),this.cap.length<t?this.cap=new Int32Array(t).fill(-1):this.cap.fill(-1,0,t),this.matchcap.length<t?this.matchcap=new Int32Array(t).fill(-1):this.matchcap.fill(-1,0,t)}shouldVisit(r,e){let t=r*(this.end+1)+e,n=t>>>5,s=1<<(t&31);return(this.visited[n]&s)!==0?!1:(this.visited[n]|=s,!0)}push(r,e,t,n){if(r.prog.getInst(e).op!==I.FAIL&&(n||this.shouldVisit(e,t))){if(this.jobLen>=this.jobPc.length){let s=this.jobPc.length*2,B=new Int32Array(s);B.set(this.jobPc),this.jobPc=B;let i=new Uint8Array(s);i.set(this.jobArg),this.jobArg=i;let o=new Int32Array(s);o.set(this.jobPos),this.jobPos=o}this.jobPc[this.jobLen]=e,this.jobArg[this.jobLen]=n?1:0,this.jobPos[this.jobLen]=t,this.jobLen++}}tryBacktrack(r,e,t,n,s){let B=r.longest;for(this.push(r,t,n,!1);this.jobLen>0;){this.jobLen--;let i=this.jobPc[this.jobLen],o=this.jobArg[this.jobLen]===1,a=this.jobPos[this.jobLen],c=!0;for(;!(!c&&!this.shouldVisit(i,a));){c=!1;let u=r.prog.getInst(i);switch(u.op){case I.FAIL:throw new jn("unexpected InstFail");case I.ALT:if(o){o=!1,i=u.arg;continue}else{this.push(r,i,a,!0),i=u.out;continue}case I.ALT_MATCH:{let l=r.prog.getInst(u.out);if(I.isRuneOp(l.op)){this.push(r,u.arg,a,!1),i=u.arg,a=this.end;continue}this.push(r,u.out,this.end,!1),i=u.out;continue}case I.RUNE:{let l=e.step(a);if(l===Ne.EOF()||!u.matchRune(l>>3))break;a+=l&7,i=u.out;continue}case I.RUNE1:{let l=e.step(a);if(l===Ne.EOF()||l>>3!==u.runes[0])break;a+=l&7,i=u.out;continue}case I.RUNE_ANY_NOT_NL:{let l=e.step(a);if(l===Ne.EOF()||l>>3===10)break;a+=l&7,i=u.out;continue}case I.RUNE_ANY:{let l=e.step(a);if(l===Ne.EOF())break;a+=l&7,i=u.out;continue}case I.CAPTURE:if(o){this.cap[u.arg]=a;break}else{u.arg<this.ncap&&(this.push(r,i,this.cap[u.arg],!0),this.cap[u.arg]=a),i=u.out;continue}case I.EMPTY_WIDTH:{let l=e.context(a);if((u.arg&~l)!==0)break;i=u.out;continue}case I.NOP:i=u.out;continue;case I.MATCH:{if(s===M.ANCHOR_BOTH&&a!==this.end)break;if(this.ncap===0)return!0;this.ncap>1&&(this.cap[1]=a);let l=this.matchcap[1];if((l===-1||B&&a>0&&a>l)&&this.matchcap.set(this.cap),!B||a===this.end)return!0;break}case I.LB_WRITE:case I.LB_CHECK:throw new jn("Backtracker cannot evaluate Lookbehind instructions");default:throw new jn("bad inst")}break}}return B&&this.matchcap.length>1&&this.matchcap[1]>=0}},Gr=[],Hr=class bo{static shouldBacktrack(e){return e.numInst()<=Yu}static maxBitStateLen(e){return bo.shouldBacktrack(e)?Math.floor(Qu/e.numInst()):0}static execute(e,t,n,s,B){let i=e.cond;if(i===_.EMPTY_ALL||(s===M.ANCHOR_START||s===M.ANCHOR_BOTH)&&n!==0||(i&_.EMPTY_BEGIN_TEXT)!==0&&n!==0)return null;let o=Gr.length>0?Gr.pop():new qu,a=t.endPos();o.reset(e.prog,a,B);let c=!1;if((i&_.EMPTY_BEGIN_TEXT)!==0||s===M.ANCHOR_START||s===M.ANCHOR_BOTH)o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(e,t,e.prog.start,n,s)&&(c=!0);else{let l=-1;for(;n<=a&&l!==0;n+=l){if(e.prefix.length>0){let C=t.index(e,n);if(C<0)break;n+=C}if(o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(e,t,e.prog.start,n,s)){c=!0;break}let f=t.step(n);l=f===Ne.EOF()?0:f&7}}if(!c)return Gr.push(o),null;let u=B===0?[]:_.toArray(o.matchcap.subarray(0,B));return Gr.push(o),u}},Ui=class{constructor(r){this.sparse=new Uint32Array(r),this.dense=new Uint32Array(r),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(r){return r<this.sparse.length&&this.sparse[r]<this.size&&this.dense[this.sparse[r]]===r}insert(r){this.contains(r)||this.insertNew(r)}insertNew(r){r>=this.sparse.length||(this.sparse[r]=this.size,this.dense[this.size]=r,this.size++)}},Wu=(r,e,t,n)=>{let s=r.length,B=e.length,i=0,o=0,a=[],c=[],u=!0,l=-1,f=C=>{let d=C?r:e,h=C?i:o,k=C?t:n;return l>0&&d[h]<=a[l]?!1:(a.push(d[h],d[h+1]),C?i+=2:o+=2,l+=2,c.push(k),!0)};for(;i<s||o<B;)if(o>=B?u=f(!0):i>=s||e[o]<r[i]?u=f(!1):u=f(!0),!u)return null;return{merged:a,next:c}},Vu=class{constructor(r){this.start=r.start,this.numCap=r.numCap,this.inst=new Array(r.inst.length);for(let e=0;e<r.inst.length;e++){let t=r.inst[e],n=new I(t.op);n.out=t.out,n.arg=t.arg,n.runes=t.runes?new Int32Array(t.runes):new Int32Array(0),n.next=null,this.inst[e]=n}}},Zu=r=>{let e=new Vu(r);for(let t=0;t<e.inst.length;t++){let n=e.inst[t];if(n.op!==I.ALT&&n.op!==I.ALT_MATCH)continue;let s="out",B="arg",i=e.inst[n[B]];if(i.op!==I.ALT&&i.op!==I.ALT_MATCH&&(s="arg",B="out",i=e.inst[n[B]],i.op!==I.ALT&&i.op!==I.ALT_MATCH))continue;let o=e.inst[n[s]];if(o.op===I.ALT||o.op===I.ALT_MATCH)continue;let a="out",c="arg",u=!1;i.out===t?u=!0:i.arg===t&&(u=!0,a="arg",c="out"),u&&(i[a]=n[s]),n[s]===i[a]&&(n[B]=i[c])}return e},Xu=r=>{if(r.inst.length>=1e3)return null;let e=new Ui(r.inst.length),t=new Ui(r.inst.length),n=new Array(r.inst.length),s=new Array(r.inst.length).fill(!1),B=i=>{let o=!0,a=r.inst[i];if(t.contains(i))return!0;switch(t.insert(i),a.op){case I.ALT:case I.ALT_MATCH:{o=B(a.out)&&B(a.arg);let c=s[a.out],u=s[a.arg];if(c&&u)return!1;if(u){let d=a.out;a.out=a.arg,a.arg=d;let h=c;c=u,u=h}c&&(s[i]=!0,a.op=I.ALT_MATCH);let l=n[a.out]||[],f=n[a.arg]||[],C=Wu(l,f,a.out,a.arg);if(!C)return!1;n[i]=new Int32Array(C.merged),a.next=new Uint32Array(C.next);break}case I.CAPTURE:case I.EMPTY_WIDTH:case I.NOP:o=B(a.out),s[i]=s[a.out],n[i]=n[a.out]?new Int32Array(n[a.out]):new Int32Array(0),a.next=new Uint32Array(Math.floor(n[i].length/2)+1).fill(a.out);break;case I.MATCH:case I.FAIL:s[i]=a.op===I.MATCH;break;case I.RUNE:{if(s[i]=!1,a.next&&a.next.length>0)break;if(e.insert(a.out),!a.runes||a.runes.length===0){n[i]=new Int32Array(0),a.next=new Uint32Array([a.out]);break}let c=[];if(a.runes.length===1&&(a.arg&M.FOLD_CASE)!==0){let u=a.runes[0];c.push(u,u);for(let l=J.simpleFold(u);l!==u;l=J.simpleFold(l))c.push(l,l);c.sort((l,f)=>l-f)}else for(let u=0;u<a.runes.length;u++)c.push(a.runes[u]);n[i]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=I.RUNE;break}case I.RUNE1:{if(s[i]=!1,a.next&&a.next.length>0)break;e.insert(a.out);let c=[];if((a.arg&M.FOLD_CASE)!==0){let u=a.runes[0];c.push(u,u);for(let l=J.simpleFold(u);l!==u;l=J.simpleFold(l))c.push(l,l);c.sort((l,f)=>l-f)}else c.push(a.runes[0],a.runes[0]);n[i]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=I.RUNE;break}case I.RUNE_ANY:if(s[i]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[i]=new Int32Array([0,J.MAX_RUNE]),a.next=new Uint32Array([a.out]);break;case I.RUNE_ANY_NOT_NL:if(s[i]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[i]=new Int32Array([0,9,11,J.MAX_RUNE]),a.next=new Uint32Array(Math.floor(n[i].length/2)+1).fill(a.out)}return o};for(e.clear(),e.insert(r.start);!e.empty();)if(t.clear(),!B(e.next()))return null;for(let i=0;i<r.inst.length;i++)n[i]&&(r.inst[i].runes=n[i]);return r},ec=(r,e)=>{for(let t=0;t<e.inst.length;t++){let n=e.inst[t];switch(n.op){case I.ALT:case I.ALT_MATCH:case I.RUNE:break;case I.CAPTURE:case I.EMPTY_WIDTH:case I.NOP:case I.MATCH:case I.FAIL:r.inst[t].next=null;break;case I.RUNE1:case I.RUNE_ANY:case I.RUNE_ANY_NOT_NL:r.inst[t].next=null,r.inst[t].op=n.op,r.inst[t].runes=n.runes?new Int32Array(n.runes):new Int32Array(0)}}},Ki=class wo{static compile(e){if(e.start===0||e.numLb>0)return null;let t=e.inst[e.start];if(t.op!==I.EMPTY_WIDTH||(t.arg&_.EMPTY_BEGIN_TEXT)===0)return null;let n=!1;for(let B=0;B<e.inst.length;B++)if(e.inst[B].op===I.ALT||e.inst[B].op===I.ALT_MATCH){n=!0;break}for(let B=0;B<e.inst.length;B++){let i=e.inst[B],o=e.inst[i.out].op;switch(i.op){case I.ALT:case I.ALT_MATCH:if(o===I.MATCH||e.inst[i.arg].op===I.MATCH)return null;break;case I.EMPTY_WIDTH:if(o===I.MATCH){if((i.arg&_.EMPTY_END_TEXT)===_.EMPTY_END_TEXT)continue;return null}break;default:if(o===I.MATCH&&n)return null}}let s=Zu(e);return s=Xu(s),s!==null&&ec(s,e),s}static next(e,t){let n=e.matchRunePos(t);return n>=0?e.next[n]:e.op===I.ALT_MATCH?e.out:0}static execute(e,t,n,s,B){let i=e.onepass;if(!i)return null;let o=new Int32Array(B).fill(-1),a=!1,c=t.step(n),u=c>>3,l=c&7,f=Ne.EOF(),C=-1,d=0;c!==Ne.EOF()&&(f=t.step(n+l),f!==Ne.EOF()&&(C=f>>3,d=f&7));let h=n===0?_.emptyOpContext(-1,u):t.context(n),k=i.start,R;for(;;){switch(R=i.inst[k],k=R.out,R.op){case I.MATCH:return s===M.ANCHOR_BOTH&&n!==t.endPos()?null:(a=!0,o.length>0&&(o[0]=0,o[1]=n),B===0?[]:_.toArray(o));case I.RUNE:if(!R.matchRune(u))return null;break;case I.RUNE1:if(u!==R.runes[0])return null;break;case I.RUNE_ANY:break;case I.RUNE_ANY_NOT_NL:if(u===10)return null;break;case I.ALT:case I.ALT_MATCH:k=wo.next(R,u);continue;case I.FAIL:return null;case I.NOP:continue;case I.EMPTY_WIDTH:if((R.arg&~h)!==0)return null;continue;case I.CAPTURE:R.arg<o.length&&(o[R.arg]=n);continue;default:throw new jn("bad inst")}if(l===0)break;h=_.emptyOpContext(u,C),n+=l,u=C,l=d,u!==-1&&(f=t.step(n+l),f!==Ne.EOF()?(C=f>>3,d=f&7):(C=-1,d=0))}return a?B===0?[]:_.toArray(o):null}},D=class W{static Op=po(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(e){return e>=W.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===L.CODES.get("-")?"\\":""}static fromRegexp(e){let t=new W(e.op);return t.flags=e.flags,t.subs=e.subs,t.runes=e.runes,t.cap=e.cap,t.min=e.min,t.max=e.max,t.name=e.name,t.namedGroups=e.namedGroups,t.lb=e.lb,t}constructor(e){this.op=e,this.flags=0,this.subs=W.emptySubs(),this.runes=new Int32Array(0),this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=W.emptySubs(),this.runes=new Int32Array(0),this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case W.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case W.Op.EMPTY_MATCH:e+="(?:)";break;case W.Op.STAR:case W.Op.PLUS:case W.Op.QUEST:case W.Op.REPEAT:{let t=this.subs[0];switch(t.op>W.Op.CAPTURE||t.op===W.Op.LITERAL&&t.runes.length>1?e+=`(?:${t.appendTo()})`:e+=t.appendTo(),this.op){case W.Op.STAR:e+="*";break;case W.Op.PLUS:e+="+";break;case W.Op.QUEST:e+="?";break;case W.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}"}(this.flags&M.NON_GREEDY)!==0&&(e+="?");break}case W.Op.CONCAT:for(let t of this.subs)t.op===W.Op.ALTERNATE?e+=`(?:${t.appendTo()})`:e+=t.appendTo();break;case W.Op.ALTERNATE:{let t="";for(let n of this.subs)e+=t,t="|",e+=n.appendTo();break}case W.Op.LITERAL:(this.flags&M.FOLD_CASE)!==0&&(e+="(?i:");for(let t of this.runes)e+=_.escapeRune(t);(this.flags&M.FOLD_CASE)!==0&&(e+=")");break;case W.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case W.Op.ANY_CHAR:e+="(?s:.)";break;case W.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case W.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case W.Op.CAPTURE:this.name===null||this.name.length===0?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==W.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case W.Op.BEGIN_TEXT:e+="\\A";break;case W.Op.END_TEXT:(this.flags&M.WAS_DOLLAR)!==0?e+="(?-m:$)":e+="\\z";break;case W.Op.BEGIN_LINE:e+="^";break;case W.Op.END_LINE:e+="$";break;case W.Op.WORD_BOUNDARY:e+="\\b";break;case W.Op.NO_WORD_BOUNDARY:e+="\\B";break;case W.Op.CHAR_CLASS:if(this.runes.length%2!==0){e+="[invalid char class]";break}if(e+="[",this.runes.length===0)e+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===J.MAX_RUNE){e+="^";for(let t=1;t<this.runes.length-1;t+=2){let n=this.runes[t]+1,s=this.runes[t+1]-1;e+=W.quoteIfHyphen(n),e+=_.escapeRune(n),n!==s&&(e+="-",e+=W.quoteIfHyphen(s),e+=_.escapeRune(s))}}else for(let t=0;t<this.runes.length;t+=2){let n=this.runes[t],s=this.runes[t+1];e+=W.quoteIfHyphen(n),e+=_.escapeRune(n),n!==s&&(e+="-",e+=W.quoteIfHyphen(s),e+=_.escapeRune(s))}e+="]";break;default:e+=this.op}return e}maxCap(){let e=0;if(this.op===W.Op.CAPTURE&&(e=this.cap),this.subs!==null)for(let t of this.subs){let n=t.maxCap();e<n&&(e=n)}return e}equals(e){if(!(e!==null&&e instanceof W)||this.op!==e.op)return!1;switch(this.op){case W.Op.END_TEXT:if((this.flags&M.WAS_DOLLAR)!==(e.flags&M.WAS_DOLLAR))return!1;break;case W.Op.LITERAL:case W.Op.CHAR_CLASS:if((this.flags&M.FOLD_CASE)!==(e.flags&M.FOLD_CASE))return!1;if(this.runes===null&&e.runes===null)break;if(this.runes===null||e.runes===null||this.runes.length!==e.runes.length)return!1;for(let t=0;t<this.runes.length;t++)if(this.runes[t]!==e.runes[t])return!1;break;case W.Op.ALTERNATE:case W.Op.CONCAT:if(this.subs.length!==e.subs.length)return!1;for(let t=0;t<this.subs.length;++t)if(!this.subs[t].equals(e.subs[t]))return!1;break;case W.Op.STAR:case W.Op.PLUS:case W.Op.QUEST:if((this.flags&M.NON_GREEDY)!==(e.flags&M.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case W.Op.REPEAT:if((this.flags&M.NON_GREEDY)!==(e.flags&M.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case W.Op.CAPTURE:if(this.cap!==e.cap||(this.name===null?e.name!==null:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1;break;case W.Op.PLB:case W.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1}return!0}},nB=class{static walk(r,e){let t=[],n=r,s;for(;;){if(n.subs.length===0)s=e.leaf(n);else{let B=e.enter(n);if(B.result===void 0){t.push({re:n,state:B,i:0}),n=n.subs[0];continue}s=B.result}for(;;){if(t.length===0)return s;let B=t[t.length-1];if(e.child(B.re,B.state,s,B.i),B.i++,B.state.result===void 0&&B.i<B.re.subs.length){n=B.re.subs[B.i];break}t.pop(),s=B.state.result!==void 0?B.state.result:e.leave(B.re,B.state)}}}},ji=class{constructor(r,e){let t=new Map,n=[0],s=[0],B=[0],i=[0];for(let d of r){let h=0;for(let k=0;k<d.length;k++){let R=h*e+d[k],E=t.get(R);E===void 0&&(E=n.length,t.set(R,E),n.push(h),s.push(d[k]),B.push(B[h]+1),i.push(0)),h=E}i[h]=1}let o=n.length,a=new Int32Array(o-1);for(let d=1;d<o;d++)a[d-1]=d;a.sort((d,h)=>n[d]-n[h]||s[d]-s[h]);let c=new Int32Array(o+1);for(let d=1;d<o;d++)c[n[d]+1]++;for(let d=0;d<o;d++)c[d+1]+=c[d];let u=new Int32Array(o-1);for(let d=0;d<a.length;d++)u[d]=s[a[d]];this.childStart=c,this.childUnit=u,this.childNode=a;let l=new Int32Array(o);for(let d=0;d<o;d++)l[d]=d;l.sort((d,h)=>B[d]-B[h]);let f=new Int32Array(o),C=Uint8Array.from(i);for(let d=1;d<o;d++){let h=l[d],k=n[h];if(k!==0){let R=f[k],E=this.next(R,s[h]);for(;E<0&&R!==0;)R=f[R],E=this.next(R,s[h]);f[h]=E>=0?E:0}C[h]|=C[f[h]]}this.fail=f,this.match=C}next(r,e){let t=this.childStart[r],n=this.childStart[r+1],s=this.childUnit;for(;t<n;){let B=t+n>>1,i=s[B];if(i===e)return this.childNode[B];i<e?t=B+1:n=B}return-1}advance(r,e){for(;;){let t=this.next(r,e);if(t>=0)return t;if(r===0)return 0;r=this.fail[r]}}searchUTF16(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r.charCodeAt(s)),this.match[n]===1)return!0;return!1}searchUTF8(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r[s]),this.match[n]===1)return!0;return!1}},re=class cn{static Type={NONE:0,EXACT:1,AND:2,OR:3};static MAX_SCANS=32;static MAX_AC_UNITS=1<<18;constructor(e){this.type=e,this.subs=[],this.str="",this.bytes=null,this.cost=e===cn.Type.EXACT?1:0,this.allExact=!1,this.ac16=null,this.ac8=null}automaton16(){if(this.ac16===null){let e=this.subs.map(t=>{let n=new Array(t.str.length);for(let s=0;s<t.str.length;s++)n[s]=t.str.charCodeAt(s);return n});this.ac16=new ji(e,65536)}return this.ac16}automaton8(){return this.ac8===null&&(this.ac8=new ji(this.subs.map(e=>e.bytes),256)),this.ac8}eval(e,t){switch(this.type){case cn.Type.NONE:return!0;case cn.Type.EXACT:return e.hasString(this,t);case cn.Type.AND:for(let n=0;n<this.subs.length;n++)if(!this.subs[n].eval(e,t))return!1;return!0;case cn.Type.OR:if(this.allExact)return e.hasAnyString(this,t);for(let n=0;n<this.subs.length;n++)if(this.subs[n].eval(e,t))return!0;return!1;default:return!0}}},tc=class fn{static build(e){return e?nB.walk(e,fn.WALKER):new re(re.Type.NONE)}static WALKER={leaf:e=>fn.leaf(e),enter:e=>fn.enter(e),child:(e,t,n)=>fn.child(e,t,n),leave:(e,t)=>fn.leave(e,t)};static leaf(e){if(e.op!==D.Op.LITERAL)return new re(re.Type.NONE);if(e.runes.length===0||(e.flags&M.FOLD_CASE)!==0)return new re(re.Type.NONE);let t="";for(let s=0;s<e.runes.length;s++){if(J.isUnsearchable(e.runes[s]))return new re(re.Type.NONE);t+=String.fromCodePoint(e.runes[s])}let n=new re(re.Type.EXACT);return n.str=t,n.bytes=_.stringToUtf8ByteArray(n.str),n}static enter(e){switch(e.op){case D.Op.CAPTURE:case D.Op.PLUS:return{sub:null};case D.Op.REPEAT:return e.min>=1?{sub:null}:{result:new re(re.Type.NONE)};case D.Op.CONCAT:return{pf:new re(re.Type.AND),subs:[]};case D.Op.ALTERNATE:return{pf:new re(re.Type.OR),subs:[]};default:return{result:new re(re.Type.NONE)}}}static child(e,t,n){if(t.subs===void 0){t.sub=n;return}if(t.pf.type===re.Type.AND){if(n.type===re.Type.NONE)return;if(n.type===re.Type.AND){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n);return}if(n.type===re.Type.NONE){t.result=new re(re.Type.NONE);return}if(n.type===re.Type.OR){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n)}static leave(e,t){if(t.subs===void 0)return t.sub;let n=t.pf,s=new Set,B=[];for(let c of t.subs){if(c.type===re.Type.EXACT){if(s.has(c.str))continue;s.add(c.str)}B.push(c)}if(n.type===re.Type.AND){let c=[],u=0;for(let l of B)u+l.cost>re.MAX_SCANS||(c.push(l),u+=l.cost);return c.length===0?new re(re.Type.NONE):c.length===1?c[0]:(n.subs=c,n.cost=u,n)}if(B.length===0)return new re(re.Type.NONE);if(B.length===1)return B[0];n.subs=B;let i=!0,o=0,a=0;for(let c of B)c.type!==re.Type.EXACT?i=!1:a+=c.bytes.length,o+=c.cost;return i?a>re.MAX_AC_UNITS?new re(re.Type.NONE):(n.allExact=!0,n.cost=1,n):o>re.MAX_SCANS?new re(re.Type.NONE):(n.cost=o,n)}},je=class{constructor(r=0,e=0){this.head=r,this.tail=e}},nc=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0,this.lbInst=null}getInst(r){return this.inst[r]}numInst(){return this.inst.length}addInst(r){this.inst.push(new I(r))}markLookbehindInsts(){let r=new Uint8Array(this.inst.length),e=this.lbStarts.slice();for(;e.length>0;){let t=e.pop();if(t===0||r[t]===1)continue;r[t]=1;let n=this.inst[t];switch(n.op){case I.ALT:case I.ALT_MATCH:e.push(n.out,n.arg);break;case I.MATCH:case I.FAIL:break;default:e.push(n.out)}}this.lbInst=r}skipNop(r){let e=this.inst[r];for(;e.op===I.NOP||e.op===I.CAPTURE;)e=this.inst[r],r=e.out;return e}prefix(){let r="",e=this.skipNop(this.start);if(!I.isRuneOp(e.op)||e.runes.length!==1)return[e.op===I.MATCH,r];for(;I.isRuneOp(e.op)&&e.runes.length===1&&(e.arg&M.FOLD_CASE)===0&&!J.isUnsearchable(e.runes[0]);)r+=String.fromCodePoint(e.runes[0]),e=this.skipNop(e.out);return[e.op===I.MATCH,r]}startCond(){let r=0,e=this.start;e:for(;;){let t=this.inst[e];switch(t.op){case I.EMPTY_WIDTH:r|=t.arg;break;case I.FAIL:return-1;case I.CAPTURE:case I.NOP:break;default:break e}e=t.out}return r}patch(r,e){let t=r.head;for(;t!==0;){let n=this.inst[t>>1];(t&1)===0?(t=n.out,n.out=e):(t=n.arg,n.arg=e)}}append(r,e){if(r.head===0)return e;if(e.head===0)return r;let t=this.inst[r.tail>>1];return(r.tail&1)===0?t.out=e.head:t.arg=e.head,new je(r.head,e.tail)}toString(){let r="";for(let e=0;e<this.inst.length;e++){let t=r.length;r+=e,e===this.start&&(r+="*"),r+=" ".substring(r.length-t),r+=this.inst[e],r+=`
|
|
60
|
-
`}return r}},
|
|
61
|
-
`)-1,
|
|
62
|
-
`)+1,
|
|
63
|
-
`)-1&&e[2]===
|
|
64
|
-
`)+1&&e[3]===
|
|
65
|
-
`)-1&&e.runes[2]===
|
|
66
|
-
`)+1&&e.runes[3]===J.MAX_RUNE)return new D(D.Op.ANY_CHAR_NOT_NL)}return e}static enter(e){switch(e.op){case D.Op.PLB:case D.Op.NLB:case D.Op.CAPTURE:case D.Op.STAR:case D.Op.PLUS:case D.Op.QUEST:return{sub:null};case D.Op.CONCAT:case D.Op.ALTERNATE:return{subs:[],changed:!1};case D.Op.REPEAT:return e.min===0&&e.max===0?{result:new D(D.Op.EMPTY_MATCH)}:{sub:null};default:return{result:e}}}static child(e,t,n,s){if(t.subs===void 0){t.sub=n;return}if(n!==e.subs[s]&&(t.changed=!0),e.op===D.Op.CONCAT){if(n.op===D.Op.NO_MATCH){t.result=new D(D.Op.NO_MATCH);return}if(n.op===D.Op.EMPTY_MATCH){t.changed=!0;return}if(n.op===D.Op.CONCAT){t.changed=!0;for(let B=0;B<n.subs.length;B++)t.subs.push(n.subs[B]);return}}else{if(n.op===D.Op.NO_MATCH){t.changed=!0;return}if(n.op===D.Op.ALTERNATE){t.changed=!0;for(let B=0;B<n.subs.length;B++)t.subs.push(n.subs[B]);return}}t.subs.push(n)}static leave(e,t){switch(e.op){case D.Op.PLB:case D.Op.NLB:case D.Op.CAPTURE:{let n=t.sub;if(n!==e.subs[0]){let s=D.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=[n],s}return e}case D.Op.CONCAT:case D.Op.ALTERNATE:if(t.changed){let n=t.subs;if(n.length===0)return new D(e.op===D.Op.CONCAT?D.Op.EMPTY_MATCH:D.Op.NO_MATCH);if(n.length===1)return n[0];let s=D.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=n,s}return e;case D.Op.STAR:case D.Op.PLUS:case D.Op.QUEST:return Fe.simplify1(e.op,e.flags,t.sub,e);case D.Op.REPEAT:return Fe.simplifyRepeat(e,t.sub);default:return e}}static simplifyRepeat(e,t){if(e.max===-1){if(e.min===0)return Fe.simplify1(D.Op.STAR,e.flags,t,null);if(e.min===1)return Fe.simplify1(D.Op.PLUS,e.flags,t,null);let s=[];for(let B=0;B<e.min-1;B++)s.push(t);return s.push(Fe.simplify1(D.Op.PLUS,e.flags,t,null)),Fe.concat(s)}if(e.min===1&&e.max===1)return t;let n=null;if(e.min>0){n=[];for(let s=0;s<e.min;s++)n.push(t)}if(e.max>e.min){let s=Fe.simplify1(D.Op.QUEST,e.flags,t,null);for(let B=e.min+1;B<e.max;B++)s=Fe.simplify1(D.Op.QUEST,e.flags,Fe.concat([t,s]),null);if(n===null)return s;n.push(s)}return n!==null?Fe.concat(n):new D(D.Op.NO_MATCH)}static concat(e){let t=[];for(let s=0;s<e.length;s++){let B=e[s];if(B.op===D.Op.NO_MATCH)return new D(D.Op.NO_MATCH);if(B.op!==D.Op.EMPTY_MATCH){if(B.op===D.Op.CONCAT){for(let i=0;i<B.subs.length;i++)t.push(B.subs[i]);continue}t.push(B)}}if(t.length===0)return new D(D.Op.EMPTY_MATCH);if(t.length===1)return t[0];let n=new D(D.Op.CONCAT);return n.subs=t,n}static simplify1(e,t,n,s){if(n.op===D.Op.EMPTY_MATCH)return n;if(n.op===D.Op.NO_MATCH)return e===D.Op.PLUS?n:new D(D.Op.EMPTY_MATCH);if(e===n.op&&(t&M.NON_GREEDY)===(n.flags&M.NON_GREEDY))return n;if(s!==null&&s.op===e&&(s.flags&M.NON_GREEDY)===(t&M.NON_GREEDY)&&n===s.subs[0])return s;let B=new D(e);return B.flags=t,B.subs=[n],B}},ie=class{constructor(r,e){this.sign=r,this.cls=e}},Yi=[48,57],Qi=[9,10,12,13,32,32],qi=[48,57,65,90,95,95,97,122],Wi=new Map([["\\d",new ie(1,Yi)],["\\D",new ie(-1,Yi)],["\\s",new ie(1,Qi)],["\\S",new ie(-1,Qi)],["\\w",new ie(1,qi)],["\\W",new ie(-1,qi)]]),Vi=[48,57,65,90,97,122],Zi=[65,90,97,122],Xi=[0,127],eo=[9,9,32,32],to=[0,31,127,127],no=[48,57],ro=[33,126],so=[97,122],Bo=[32,126],io=[33,47,58,64,91,96,123,126],oo=[9,13,32,32],ao=[65,90],lo=[48,57,65,90,95,95,97,122],uo=[48,57,65,70,97,102],co=new Map([["[:alnum:]",new ie(1,Vi)],["[:^alnum:]",new ie(-1,Vi)],["[:alpha:]",new ie(1,Zi)],["[:^alpha:]",new ie(-1,Zi)],["[:ascii:]",new ie(1,Xi)],["[:^ascii:]",new ie(-1,Xi)],["[:blank:]",new ie(1,eo)],["[:^blank:]",new ie(-1,eo)],["[:cntrl:]",new ie(1,to)],["[:^cntrl:]",new ie(-1,to)],["[:digit:]",new ie(1,no)],["[:^digit:]",new ie(-1,no)],["[:graph:]",new ie(1,ro)],["[:^graph:]",new ie(-1,ro)],["[:lower:]",new ie(1,so)],["[:^lower:]",new ie(-1,so)],["[:print:]",new ie(1,Bo)],["[:^print:]",new ie(-1,Bo)],["[:punct:]",new ie(1,io)],["[:^punct:]",new ie(-1,io)],["[:space:]",new ie(1,oo)],["[:^space:]",new ie(-1,oo)],["[:upper:]",new ie(1,ao)],["[:^upper:]",new ie(-1,ao)],["[:word:]",new ie(1,lo)],["[:^word:]",new ie(-1,lo)],["[:xdigit:]",new ie(1,uo)],["[:^xdigit:]",new ie(-1,uo)]]),Pt=class _r{static charClassToString(e,t){let n="[";for(let s=0;s<t;s+=2){s>0&&(n+=" ");let B=e[s],i=e[s+1];B===i?n+=`0x${B.toString(16)}`:n+=`0x${B.toString(16)}-0x${i.toString(16)}`}return n+="]",n}static sortRanges(e,t){let n=t>>1,s=new Array(n);for(let i=0;i<n;i++)s[i]=i;s.sort((i,o)=>e[2*i]-e[2*o]||e[2*o+1]-e[2*i+1]);let B=e.slice(0,t);for(let i=0;i<n;i++)e[2*i]=B[2*s[i]],e[2*i+1]=B[2*s[i]+1]}constructor(e=_.emptyInts()){this.r=e,this.len=e.length}toArray(){return this.r instanceof Int32Array?this.len===this.r.length?this.r:this.r.subarray(0,this.len):new Int32Array(this.len===this.r.length?this.r:this.r.slice(0,this.len))}toGrowableArray(){return Array.isArray(this.r)?(this.r.length=this.len,this.r):Array.from(this.r.subarray(0,this.len))}cleanClass(){if(this.len<4)return this;_r.sortRanges(this.r,this.len);let e=2;for(let t=2;t<this.len;t+=2){let n=this.r[t],s=this.r[t+1];if(n<=this.r[e-1]+1){s>this.r[e-1]&&(this.r[e-1]=s);continue}this.r[e]=n,this.r[e+1]=s,e+=2}return this.len=e,this}appendLiteral(e,t){return(t&M.FOLD_CASE)!==0?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,t){if(this.len>0){for(let n=2;n<=4;n+=2)if(this.len>=n){let s=this.r[this.len-n],B=this.r[this.len-n+1];if(e<=B+1&&s<=t+1)return e<s&&(this.r[this.len-n]=e),t>B&&(this.r[this.len-n+1]=t),this}}return this.r[this.len++]=e,this.r[this.len++]=t,this}appendFoldedRange(e,t){if(e<=J.MIN_FOLD&&t>=J.MAX_FOLD)return this.appendRange(e,t);if(t<J.MIN_FOLD||e>J.MAX_FOLD)return this.appendRange(e,t);e<J.MIN_FOLD&&(this.appendRange(e,J.MIN_FOLD-1),e=J.MIN_FOLD),t>J.MAX_FOLD&&(this.appendRange(J.MAX_FOLD+1,t),t=J.MAX_FOLD);for(let n=e;n<=t;n++){this.appendRange(n,n);for(let s=J.simpleFold(n);s!==n;s=J.simpleFold(s))this.appendRange(s,s)}return this}appendClass(e){for(let t=0;t<e.length;t+=2)this.appendRange(e[t],e[t+1]);return this}appendFoldedClass(e){for(let t=0;t<e.length;t+=2)this.appendFoldedRange(e[t],e[t+1]);return this}appendNegatedClass(e){let t=0;for(let n=0;n<e.length;n+=2){let s=e[n],B=e[n+1];t<=s-1&&this.appendRange(t,s-1),t=B+1}return t<=J.MAX_RUNE&&this.appendRange(t,J.MAX_RUNE),this}appendTable(e){for(let t=0;t<e.length;++t){let n=e.getLo(t),s=e.getHi(t),B=e.getStride(t);if(B===1){this.appendRange(n,s);continue}for(let i=n;i<=s;i+=B)this.appendRange(i,i)}return this}appendNegatedTable(e){let t=0;for(let n=0;n<e.length;++n){let s=e.getLo(n),B=e.getHi(n),i=e.getStride(n);if(i===1){t<=s-1&&this.appendRange(t,s-1),t=B+1;continue}for(let o=s;o<=B;o+=i)t<=o-1&&this.appendRange(t,o-1),t=o+1}return t<=J.MAX_RUNE&&this.appendRange(t,J.MAX_RUNE),this}appendTableWithSign(e,t){return t<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,t=0;for(let n=0;n<this.len;n+=2){let s=this.r[n],B=this.r[n+1];e<=s-1&&(this.r[t]=e,this.r[t+1]=s-1,t+=2),e=B+1}return this.len=t,e<=J.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=J.MAX_RUNE),this}appendClassWithSign(e,t){return t<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(e,t){let n=e.cls;return t&&(n=new _r().appendFoldedClass(n).cleanClass().toArray()),this.appendClassWithSign(n,e.sign)}toString(){return _r.charClassToString(this.r,this.len)}},sc=class{constructor(r){this.str=r,this.position=0}pos(){return this.position}rewindTo(r){this.position=r}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(r){this.position+=r}skipString(r){this.position+=r.length}pop(){let r=this.str.codePointAt(this.position);return this.position+=_.charCount(r),r}lookingAt(r){return this.str.startsWith(r,this.position)}rest(){return this.str.substring(this.position)}from(r){return this.str.substring(r,this.position)}toString(){return this.rest()}},Un=class Y{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static ERR_INVALID_CAPTURE_IN_LOOKBEHIND="invalid capture in lookbehind";static MAX_HEIGHT=1e3;static MAX_SIZE=1398101;static MAX_RUNES=33554432;static ANY_TABLE=new p(new Uint32Array([0,J.MAX_RUNE,1]));static ASCII_TABLE=new p(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new p(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(e){return e==="Any"?{tab:Y.ANY_TABLE,fold:Y.ANY_TABLE,sign:1}:e==="Ascii"?{tab:Y.ASCII_TABLE,fold:Y.ASCII_FOLD_TABLE,sign:1}:e==="Assigned"?{tab:Ge.CATEGORIES.get("Cn"),fold:Ge.CATEGORIES.get("Cn"),sign:-1}:e==="Lc"?{tab:Ge.CATEGORIES.get("LC"),fold:Ge.FOLD_CATEGORIES.get("LC"),sign:1}:Ge.CATEGORIES.has(e)?{tab:Ge.CATEGORIES.get(e),fold:Ge.FOLD_CATEGORIES.get(e),sign:1}:Ge.SCRIPTS.has(e)?{tab:Ge.SCRIPTS.get(e),fold:Ge.FOLD_SCRIPT.get(e),sign:1}:null}static minFoldRune(e){if(e<J.MIN_FOLD||e>J.MAX_FOLD)return e;let t=e,n=e;for(e=J.simpleFold(e);e!==n;e=J.simpleFold(e))t>e&&(t=e);return t}static leadingRegexp(e){if(e.op===D.Op.EMPTY_MATCH)return null;if(e.op===D.Op.CONCAT&&e.subs.length>0){let t=e.subs[0];return t.op===D.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){let n=new D(D.Op.LITERAL);return n.flags=t,n.runes=_.stringToRunes(e),n}static parse(e,t){return new Y(e,t).parseInternal()}static parseRepeat(e){let t=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);let n=Y.parseInt(e);if(n===-1||!e.more())return-1;let s;if(!e.lookingAt(","))s=n;else{if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))s=-1;else if((s=Y.parseInt(e))===-1)return-1}if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),n<0||n>1e3||s===-2||s>1e3||s>=0&&n>s)throw new fe(Y.ERR_INVALID_REPEAT_SIZE,e.from(t));return n<<16|s&J.MAX_BMP}static isValidCaptureName(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n!==L.CODES.get("_")&&!_.isalnum(n))return!1}return!0}static parseInt(e){let t=e.pos();for(;e.more()&&e.peek()>=L.CODES.get("0")&&e.peek()<=L.CODES.get("9");)e.skip(1);let n=e.from(t);return n.length===0||n.length>1&&n.codePointAt(0)===L.CODES.get("0")?-1:n.length>8?-2:parseInt(n,10)}static isCharClass(e){return e.op===D.Op.LITERAL&&e.runes.length===1||e.op===D.Op.CHAR_CLASS||e.op===D.Op.ANY_CHAR_NOT_NL||e.op===D.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case D.Op.LITERAL:return e.runes.length===1&&e.runes[0]===t;case D.Op.CHAR_CLASS:for(let n=0;n<e.runes.length;n+=2)if(e.runes[n]<=t&&t<=e.runes[n+1])return!0;return!1;case D.Op.ANY_CHAR_NOT_NL:return t!==L.CODES.get(`
|
|
67
|
-
`);case
|
|
68
|
-
`))&&(e.op=
|
|
69
|
-
`);case
|
|
70
|
-
`)-1&&e.runes[2]===
|
|
71
|
-
`)+1&&e.runes[3]===
|
|
72
|
-
`),
|
|
73
|
-
`)));let i=!0;for(;!e.more()||e.peek()!==L.CODES.get("]")||i;){if(e.more()&&e.lookingAt("-")&&(this.flags&M.PERL_X)===0&&!i){let u=e.rest();if(u==="-"||!u.startsWith("-]"))throw e.rewindTo(t),new fe(Y.ERR_INVALID_CHAR_RANGE,e.rest())}i=!1;let o=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,s))continue;e.rewindTo(o)}if(this.parseUnicodeClass(e,s)||this.parsePerlClassEscape(e,s))continue;e.rewindTo(o);let a=Y.parseClassChar(e,t),c=a;if(e.more()&&e.lookingAt("-")){if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(c=Y.parseClassChar(e,t),c<a)throw new fe(Y.ERR_INVALID_CHAR_RANGE,e.from(o))}(this.flags&M.FOLD_CASE)===0?s.appendRange(a,c):s.appendFoldedRange(a,c)}e.skip(1),s.cleanClass(),B<0&&s.negateClass(),n.runes=s.toArray(),this.push(n)}},Bc=class Jt{static initTest(e){let t=Jt.compile(e),n=new Jt(t.expr,t.prog,t.numSubexp,t.longest);return n.cond=t.cond,n.prefix=t.prefix,n.prefixUTF8=t.prefixUTF8,n.prefixComplete=t.prefixComplete,n.prefixRune=t.prefixRune,n.prefilter=t.prefilter,n}static compile(e){return Jt.compileImpl(e,M.PERL,!1)}static compilePOSIX(e){return Jt.compileImpl(e,M.POSIX,!0)}static compileImpl(e,t,n){let s=Un.parse(e,t),B=s.maxCap(),i=s.namedGroups;s=ko.simplify(s);let o=tc.build(s),a=xo.compileRegexp(s),c=new Jt(e,a,B,n);c.prefilter=o.type===re.Type.NONE?null:o;let[u,l]=a.prefix();return c.prefixComplete=u,c.prefix=l,c.prefixUTF8=_.stringToUtf8ByteArray(c.prefix),c.prefix.length>0&&(c.prefixRune=c.prefix.codePointAt(0)),c.namedGroups=i,c}static match(e,t){return Jt.compile(e).match(t)}constructor(e,t,n=0,s=0){this.expr=e,this.prog=t,this.numSubexp=n,this.longest=s,this.cond=t.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.machinePool=[],this.dfa=new tB(this.prog),this.onepass=Ki.compile(this.prog),this.prefilter=null}matchPrefixComplete(e,t,n,s){if((n===M.ANCHOR_START||n===M.ANCHOR_BOTH)&&t!==0)return null;let B=-1,i=-1,o=e.prefixLength(this);if(n===M.UNANCHORED){let a=e.index(this,t);if(a<0)return null;B=t+a,i=B+o}else if(n===M.ANCHOR_BOTH){if(e.endPos()!==o||e.index(this,0)!==0)return null;B=0,i=o}else if(n===M.ANCHOR_START){if(e.index(this,0)!==0)return null;B=0,i=o}if(B<0)return null;if(s>0){let a=new Int32Array(s).fill(-1);return a[0]=B,a[1]=i,Array.from(a)}return[]}createLookbehindState(){return this.prog.numLb>0?new Uu(this.prog):null}executeEngine(e,t,n,s,B=null){if(this.prefixComplete&&(s===0||this.numSubexp===0))return this.matchPrefixComplete(e,t,n,s);if(this.prefilter!==null&&n===M.UNANCHORED&&!this.prefilter.eval(e,t))return null;if(this.onepass!==null)return Ki.execute(this,e,t,n,s);if(s>0)return this.prog.numLb===0&&e.endPos()<=Hr.maxBitStateLen(this.prog)?Hr.execute(this,e,t,n,s):this.doExecuteNFA(e,t,n,s,B);if(this.prog.numLb===0){let i=this.dfa.match(e,t,n);if(i!==null)return i?[]:null;if(e.endPos()<=Hr.maxBitStateLen(this.prog))return Hr.execute(this,e,t,n,s)}return this.doExecuteNFA(e,t,n,s,B)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(e){this.machinePool.push(e)}toString(){return this.expr}doExecuteNFA(e,t,n,s,B=null){let i=this.get();i||(i=Eo.fromRE2(this)),i.init(s);let o=i.match(e,t,n,B)?i.submatches():null;return this.put(i),o}match(e){return this.executeEngine(ue.fromUTF16(e),0,M.UNANCHORED,0)!==null}matchWithGroup(e,t,n,s,B,i=null){return e instanceof Kt||(_.isByteArray(e)?e=Ut.utf8(e):e=Ut.utf16(e)),this.matchMachineInput(e,t,n,s,B,i)}matchMachineInput(e,t,n,s,B,i=null){if(t>n)return[!1,null];let o=e.isUTF16Encoding()?ue.fromUTF16(e.asCharSequence(),0,n):ue.fromUTF8(e.asBytes(),0,n),a=this.executeEngine(o,t,s,2*B,i);return a===null?[!1,null]:[!0,a]}matchUTF8(e){return this.executeEngine(ue.fromUTF8(e),0,M.UNANCHORED,0)!==null}replaceAll(e,t){return this.replaceAllFunc(e,()=>t,2*e.length+1)}replaceFirst(e,t){return this.replaceAllFunc(e,()=>t,1)}replaceAllFunc(e,t,n){let s=0,B=0,i="",o=ue.fromUTF16(e),a=this.createLookbehindState(),c=0;for(;B<=e.length;){let u=this.executeEngine(o,B,M.UNANCHORED,2,a);if(u===null||u.length===0)break;i+=e.substring(s,u[0]),(u[1]>s||u[0]===0)&&(i+=t(e.substring(u[0],u[1])),c++),s=u[1];let l=o.step(B)&7;if(B+l>u[1]?B+=l:B+1>u[1]?B++:B=u[1],c>=n)break}return i+=e.substring(s),i}pad(e){if(e===null)return null;let t=(1+this.numSubexp)*2;if(e.length<t){let n=new Array(t).fill(-1);for(let s=0;s<e.length;s++)n[s]=e[s];e=n}return e}allMatches(e,t,n=s=>s){let s=[],B=e.endPos();t<0&&(t=B+1);let i=0,o=0,a=-1,c=this.createLookbehindState();for(;o<t&&i<=B;){let u=this.executeEngine(e,i,M.UNANCHORED,this.prog.numCap,c);if(u===null||u.length===0)break;let l=!0;if(u[1]===i){u[0]===a&&(l=!1);let f=e.step(i);f<0?i=B+1:i+=f&7}else i=u[1];a=u[1],l&&(s.push(n(this.pad(u))),o++)}return s}findUTF8(e){let t=this.executeEngine(ue.fromUTF8(e),0,M.UNANCHORED,2);return t===null?null:e.slice(t[0],t[1])}findUTF8Index(e){let t=this.executeEngine(ue.fromUTF8(e),0,M.UNANCHORED,2);return t===null?null:t.slice(0,2)}find(e){let t=this.executeEngine(ue.fromUTF16(e),0,M.UNANCHORED,2);return t===null?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(ue.fromUTF16(e),0,M.UNANCHORED,2)}findUTF8Submatch(e){let t=this.executeEngine(ue.fromUTF8(e),0,M.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.slice(t[2*s],t[2*s+1]));return n}findUTF8SubmatchIndex(e){return this.pad(this.executeEngine(ue.fromUTF8(e),0,M.UNANCHORED,this.prog.numCap))}findSubmatch(e){let t=this.executeEngine(ue.fromUTF16(e),0,M.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.substring(t[2*s],t[2*s+1]));return n}findSubmatchIndex(e){return this.pad(this.executeEngine(ue.fromUTF16(e),0,M.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){let n=this.allMatches(ue.fromUTF8(e),t,s=>e.slice(s[0],s[1]));return n.length===0?null:n}findAllUTF8Index(e,t){let n=this.allMatches(ue.fromUTF8(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAll(e,t){let n=this.allMatches(ue.fromUTF16(e),t,s=>e.substring(s[0],s[1]));return n.length===0?null:n}findAllIndex(e,t){let n=this.allMatches(ue.fromUTF16(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAllUTF8Submatch(e,t){let n=this.allMatches(ue.fromUTF8(e),t,s=>{let B=new Array(s.length/2|0).fill(null);for(let i=0;i<B.length;i++)s[2*i]>=0&&(B[i]=e.slice(s[2*i],s[2*i+1]));return B});return n.length===0?null:n}findAllUTF8SubmatchIndex(e,t){let n=this.allMatches(ue.fromUTF8(e),t);return n.length===0?null:n}findAllSubmatch(e,t){let n=this.allMatches(ue.fromUTF16(e),t,s=>{let B=new Array(s.length/2|0).fill(null);for(let i=0;i<B.length;i++)s[2*i]>=0&&(B[i]=e.substring(s[2*i],s[2*i+1]));return B});return n.length===0?null:n}findAllSubmatchIndex(e,t){let n=this.allMatches(ue.fromUTF16(e),t);return n.length===0?null:n}},bh=class Jr{static UNANCHORED=M.UNANCHORED;static ANCHOR_START=M.ANCHOR_START;static ANCHOR_BOTH=M.ANCHOR_BOTH;constructor(e=Jr.UNANCHORED,t=0,n=8388608){this.anchor=e,this.jsFlags=t,this.maxMem=n;let s=M.PERL;(t&Ze.DISABLE_UNICODE_GROUPS)!==0&&(s&=~M.UNICODE_GROUPS),(t&Ze.LOOKBEHINDS)!==0&&(s|=M.LOOKBEHIND),this.re2Flags=s,this.regexps=[],this.prog=null,this.dfa=null,this.dummyRe2=null}add(e){if(this.prog)throw new Kn("Cannot add patterns after compile");let t=e;(this.jsFlags&Ze.CASE_INSENSITIVE)!==0&&(t=`(?i)${t}`),(this.jsFlags&Ze.DOTALL)!==0&&(t=`(?s)${t}`),(this.jsFlags&Ze.MULTILINE)!==0&&(t=`(?m)${t}`);let n=Un.parse(t,this.re2Flags);return this.regexps.push(ko.simplify(n)),this.regexps.length-1}compile(){if(this.prog)return;let e=xo.compileSet(this.regexps);if(e.numInst()>Un.MAX_SIZE)throw new Kn(`${Un.ERR_LARGE}: the set compiles to ${e.numInst()} instructions, more than ${Un.MAX_SIZE}`);this.prog=e,this.dfa=new tB(this.prog,this.maxMem),this.dummyRe2={prog:this.prog,cond:this.prog.startCond(),prefix:"",prefixRune:0,longest:!1}}match(e){this.prog||this.compile();let t=_.isByteArray(e)?ue.fromUTF8(e):ue.fromUTF16(e),n=M.UNANCHORED;this.anchor===Jr.ANCHOR_START?n=M.ANCHOR_START:this.anchor===Jr.ANCHOR_BOTH&&(n=M.ANCHOR_BOTH);let s=this.dfa.matchSet(t,0,n);if(s!==null)return s;let B=Eo.fromRE2(this.dummyRe2);return B.init(0),B.matchSet(t,0,n)}},ic=class Cn{static isHexadecimal(e){return"0"<=e&&e<="9"||"A"<=e&&e<="F"||"a"<=e&&e<="f"}static translate(e){let t="";if(e instanceof RegExp&&(e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e=e.source),typeof e!="string")return e;let n="",s=!1,B=e.length;B===0&&(n="(?:)",s=!0);let i=!1,o=0;for(;o<B;){let c=e[o];if(c==="\\"){if(o+1<B)switch(c=e[o+1],c){case"\\":n+="\\\\",o+=2;continue;case"c":if(o+2<B){let f=e[o+2].charCodeAt(0);if(f>=65&&f<=90||f>=97&&f<=122){let C=f%32;n+="\\x",n+=(C>>4).toString(16).toUpperCase(),n+=(C&15).toString(16).toUpperCase(),o+=3,s=!0;continue}}n+="c",o+=2,s=!0;continue;case"u":if(o+2<B){if(e[o+2]==="{"){let f=o+3,C=!1,d=!1;for(;f<B;){let h=e[f];if(h==="}"){d=!0;break}if(!Cn.isHexadecimal(h))break;C=!0,f++}if(d&&C){n+="\\x",o+=2,s=!0;continue}}else if(o+5<B){let f=!0;for(let C=0;C<4;C++)if(!Cn.isHexadecimal(e[o+2+C])){f=!1;break}if(f){n+="\\x{"+e.substring(o+2,o+6)+"}",o+=6,s=!0;continue}}}n+="u",o+=2,s=!0;continue;case"x":{let f=!1;if(o+2<B&&e[o+2]==="{"){let C=o+3,d=!1,h=!1;for(;C<B;){let k=e[C];if(k==="}"){h=!0;break}if(!Cn.isHexadecimal(k))break;d=!0,C++}h&&d&&(f=!0)}else o+3<B&&Cn.isHexadecimal(e[o+2])&&Cn.isHexadecimal(e[o+3])&&(f=!0);f?(n+="\\x",o+=2):(n+="x",o+=2,s=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":n+="\\"+c,o+=2;continue;default:{let f=e.codePointAt(o+1);if(f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122){let C=_.charCount(f);n+=e.substring(o+1,o+1+C),o+=C+1,s=!0}else{n+="\\";let C=_.charCount(f);n+=e.substring(o+1,o+1+C),o+=C+1}continue}}}else if(c==="/"){n+="\\/",o+=1,s=!0;continue}else if(c==="[")i=!0;else if(c==="]")i=!1;else if(!i&&c==="("&&o+2<B&&e[o+1]==="?"&&e[o+2]==="<"&&o+3<B&&!"=!>)".includes(e[o+3])){n+="(?P<",o+=3,s=!0;continue}let u=e.codePointAt(o),l=_.charCount(u);n+=e.substring(o,o+l),o+=l}let a=s?n:e;return t.length>0?`(?${t})${a}`:a}},hn=class Ie{static CASE_INSENSITIVE=Ze.CASE_INSENSITIVE;static DOTALL=Ze.DOTALL;static MULTILINE=Ze.MULTILINE;static DISABLE_UNICODE_GROUPS=Ze.DISABLE_UNICODE_GROUPS;static LONGEST_MATCH=Ze.LONGEST_MATCH;static LOOKBEHINDS=Ze.LOOKBEHINDS;static quote(e){return _.quoteMeta(e)}static quoteReplacement(e,t=!1){return Pi.quoteReplacement(e,t)}static translateRegExp(e){return ic.translate(e)}static compile(e,t=0){let n=e;if((t&Ie.CASE_INSENSITIVE)!==0&&(n=`(?i)${n}`),(t&Ie.DOTALL)!==0&&(n=`(?s)${n}`),(t&Ie.MULTILINE)!==0&&(n=`(?m)${n}`),(t&~(Ie.MULTILINE|Ie.DOTALL|Ie.CASE_INSENSITIVE|Ie.DISABLE_UNICODE_GROUPS|Ie.LONGEST_MATCH|Ie.LOOKBEHINDS))!==0)throw new Ju("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let s=M.PERL;(t&Ie.DISABLE_UNICODE_GROUPS)!==0&&(s&=~M.UNICODE_GROUPS),(t&Ie.LOOKBEHINDS)!==0&&(s|=M.LOOKBEHIND);let B=new Ie(e,t);return B.re2Input=Bc.compileImpl(n,s,(t&Ie.LONGEST_MATCH)!==0),B}static matches(e,t){return Ie.compile(e).testExact(t)}static initTest(e,t,n){if(e==null)throw new Error("pattern is null");if(n==null)throw new Error("re2 is null");let s=new Ie(e,t);return s.re2Input=n,s}constructor(e,t){this.patternInput=e,this.flagsInput=t,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.testExact(e)}matcher(e){return _.isByteArray(e)&&(e=Ut.utf8(e)),new Pi(this,e)}test(e){return _.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){let t=_.isByteArray(e)?ue.fromUTF8(e):ue.fromUTF16(e);return this.re2Input.executeEngine(t,0,M.ANCHOR_BOTH,0)!==null}exec(e){let t=this.matcher(e);if(!t.find())return null;let n=[t.group(0)];for(let B=1;B<=t.groupCount();B++){let i=t.group(B);n.push(i===null?void 0:i)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let B=t.getNamedGroups();for(let i in B)B[i]===null&&(B[i]=void 0);n.groups=B}else n.groups=void 0;return n}split(e,t=0){let n=this.matcher(e),s=[],B=0,i=0;for(;n.find();){if(i===0&&n.end()===0){i=n.end();continue}if(t>0&&s.length===t-1)break;if(i===n.start()){if(t===0){B+=1,i=n.end();continue}}else for(;B>0;)s.push(""),B-=1;s.push(n.substring(i,n.start())),i=n.end()}if(t===0&&i!==n.inputLength()){for(;B>0;)s.push(""),B-=1;s.push(n.substring(i,n.inputLength()))}return(t!==0||s.length===0&&!(i===n.inputLength()&&i>0))&&s.push(n.substring(i,n.inputLength())),s}*matchAll(e){let t=this.matcher(e);for(;t.find();){let n=[t.group(0)];for(let B=1;B<=t.groupCount();B++){let i=t.group(B);n.push(i===null?void 0:i)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let B=t.getNamedGroups();for(let i in B)B[i]===null&&(B[i]=void 0);n.groups=B}else n.groups=void 0;yield n}}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e?!0:e===null||this.constructor!==e.constructor?!1:this.flagsInput===e.flagsInput&&this.patternInput===e.patternInput}};var vo="kubectl config current-context",oc=/^[A-Za-z0-9][A-Za-z0-9._:@/+-]*$/;function So(r){return r.length<=253&&oc.test(r)}var ac=/^\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}$/;function jt(r){return r===void 0?void 0:ac.exec(r)?.[1]}function Ur(r){return So(r)||jt(r)!==void 0}function Kr(r,e){return r.kubeContext??e?.kubeContext}function Oo(r,e){let t=jt(r);if(t===void 0)return r;let n=e(t);if(n===void 0)throw new Error(`md-runbook: kube-context \${param:${t}} has no value: nothing ran`);if(!So(n))throw new Error(`md-runbook: kube-context \${param:${t}} is ${JSON.stringify(n)}, which is not a Kubernetes context name: nothing ran`);return n}function Ao(r){let e=jt(r);return e===void 0?"":`\${param:${e}}`}function lc(r,e){let t=e.stdout.split(/\r?\n/).map(B=>B.trim()).find(B=>B!=="");if(e.exitCode===0&&t===r)return;let n=`md-runbook: this runbook is for the Kubernetes context ${r}`;if(e.exitCode===0&&t!==void 0)return`${n}, and kubectl's current context is ${t}: nothing ran. Switch with \`kubectl config use-context ${r}\`, or open the runbook meant for ${t}.`;let s=(e.stderr??"").split(/\r?\n/).map(B=>B.trim()).find(B=>B!=="");return`${n}, and \`${vo}\` ${s?`failed (${s})`:"named no context"}: nothing ran.`}async function Ro(r,e,t=!1){if(r===void 0)return;let n;try{n=await e(t?To(r):vo)}catch(s){n={exitCode:null,stdout:"",stderr:s instanceof Error?s.message:String(s)}}return t?uc(r,n):lc(r,n)}var yo=["check","pin"];function Fo(r){return`# md-runbook: the Kubernetes context of a runbook with kube-context-mode: pin.
|
|
58
|
+
`}function Xt(r){let e=[],t=s=>`\0${e.push(s)-1}\0`,n=r.replace(/\u0000/g,"");for(n=n.replace(/(`+)([\s\S]*?[^`])\1(?!`)/g,(s,i,o)=>t(`<code>${re(o.replace(/^ (.*) $/,"$1"))}</code>`)),n=n.replace(/\\([!-/:-@[-`{-~])/g,(s,i)=>t(re(i))),n=re(n),n=n.replace(/!?\[([^\]]*)\]\(([^)\s]*)(?:\s+"[^)]*?")?\)/g,(s,i,o)=>{let B=La(o.replace(/&/g,"&")),a=Ta(i)||o;return t(B===void 0?a:`<a href="${re(B)}">${a}</a>`)}),n=n.replace(/<((?:https?:\/\/|mailto:)[^\s&]+(?:&[^\s&]+)*)>/g,(s,i)=>t(`<a href="${i}">${i}</a>`)),n=Ta(n);/\u0000\d+\u0000/.test(n);)n=n.replace(/\u0000(\d+)\u0000/g,(s,i)=>e[Number(i)]);return n}function Ta(r){return r.replace(/\*\*(?=\S)([\s\S]*?\S)\*\*/g,"<strong>$1</strong>").replace(/(^|[^\w])__(?=\S)([\s\S]*?\S)__(?!\w)/g,"$1<strong>$2</strong>").replace(/\*(?=[^\s*])([\s\S]*?[^\s*])\*/g,"<em>$1</em>").replace(/(^|[^\w])_(?=[^\s_])([\s\S]*?[^\s_])_(?!\w)/g,"$1<em>$2</em>").replace(/~~(?=\S)([\s\S]*?\S)~~/g,"<del>$1</del>")}var N=class xn{static FOLD_CASE=1;static LITERAL=2;static CLASS_NL=4;static DOT_NL=8;static ONE_LINE=16;static NON_GREEDY=32;static PERL_X=64;static UNICODE_GROUPS=128;static WAS_DOLLAR=256;static LOOKBEHIND=512;static MATCH_NL=xn.CLASS_NL|xn.DOT_NL;static PERL=xn.CLASS_NL|xn.ONE_LINE|xn.PERL_X|xn.UNICODE_GROUPS;static POSIX=0;static UNANCHORED=0;static ANCHOR_START=1;static ANCHOR_BOTH=2},Ot={CASE_INSENSITIVE:1,DOTALL:2,MULTILINE:4,DISABLE_UNICODE_GROUPS:8,LONGEST_MATCH:16,LOOKBEHINDS:512},_r=128,bo=new Int32Array(_r),wo=new Int32Array(_r),Ks=65535;for(let r=0;r<_r;r++)r>=97&&r<=122?bo[r]=r-32:bo[r]=r,r>=65&&r<=90?wo[r]=r+32:wo[r]=r;var T=class{static CODES=new Map([["\x07",7],["\b",8],[" ",9],[`
|
|
59
|
+
`,10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["'",39],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["`",96],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]]);static toUpperCase(r){if(r<_r)return bo[r];let e=String.fromCodePoint(r).toUpperCase(),t=e.codePointAt(0)>Ks?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),s=n.codePointAt(0)>Ks?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}static toLowerCase(r){if(r<_r)return wo[r];let e=String.fromCodePoint(r).toLowerCase(),t=e.codePointAt(0)>Ks?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),s=n.codePointAt(0)>Ks?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}},p=class{constructor(r,e=!1){this.data=r,this.isStride1=e,this.SIZE=e?2:3}getLo(r){return this.data[r*this.SIZE]}getHi(r){return this.data[r*this.SIZE+1]}getStride(r){return this.isStride1?1:this.data[r*this.SIZE+2]}get length(){return this.data.length/this.SIZE}},fl=new Uint8Array(256);for(let r=0,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";r<64;r++)fl[e.charCodeAt(r)]=r;var Cl=r=>{let e=[],t=0,n=0;for(let s=0;s<r.length;s++){let i=fl[r.charCodeAt(s)];t|=(i&31)<<n,(i&32)===0?(e.push(t),t=0,n=0):n+=5}return e},g=(r,e)=>{let t=Cl(r),n=e?t.length/2:t.length/3,s=new Uint32Array(n*3),i=0,o=0;for(let B=0;B<n;B++)i+=t[o++],s[B*3]=i,i+=t[o++],s[B*3+1]=i,s[B*3+2]=e?1:t[o++];return s},Zf=r=>{let e=Cl(r),t=new Map,n=0;for(let s=0;s<e.length;s+=2){n+=e[s];let i=e[s+1],o=i>>>1^-(i&1);t.set(n,n+o)}return t},zs=class{constructor(r){this.initializer=r,this.cache=new Map}has(r){return r in this.initializer}get(r){if(this.cache.has(r))return this.cache.get(r);let e=this.initializer[r],t=e?e():null;return this.cache.set(r,t),t}},rt=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=Zf("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-BB-BB-BB-BB-BBskQB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BC-BB-BB-BB-BB-BB-BB-BByHBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBxHBCBBBCBBBCBBB3SBmMBkNBCBBBCBBB8MBCBBB6MB6MBCBBC+EB0MB2MBCBBB6MB+MBiGBmNBiNBCBBBmKBikzCBmNBqNBkIBsNBCBBBCBBBCBBB0NBCBBB0NDCBBB0NBCBBByNByNBCBBBCBBB2NBCBBDCBBCwDFCBCBDBCBCBDBCBCBDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBB9EBC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BbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new p(g("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))});static get Upper(){return this.CATEGORIES.get("Lu")}static SCRIPTS=new zs({Adlam:()=>new p(g("go6DrCFJFB",!0)),Ahom:()=>new p(g("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new p(g("ggxCmS",!0)),Arabic:()=>new p(g("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new p(g("xpBlBDxBDCks9BE",!0)),Avestan:()=>new p(g("g4iC1BEG",!0)),Balinese:()=>new p(g("g4GsCCxB",!0)),Bamum:()=>new p(g("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new p(g("w26CdDF",!0)),Batak:()=>new p(g("g+GzBJD",!0)),Bengali:()=>new p(g("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new p(g("g17CYDY",!0)),Bhaiksuki:()=>new p(g("ggnCICsBCNLc",!0)),Bopomofo:()=>new p(g("qXB6wLqBxDf",!0)),Brahmi:()=>new p(g("ggkCtCFjBKA",!0)),Braille:()=>new p(g("ggK-H",!0)),Buginese:()=>new p(g("gwGbDB",!0)),Buhid:()=>new p(g("g6FT",!0)),Canadian_Aboriginal:()=>new p(g("ggF-TxRlC7tgCP",!0)),Carian:()=>new p(g("g1gCwB",!0)),Caucasian_Albanian:()=>new p(g("wphCzBMA",!0)),Chakma:()=>new p(g("gokC0BCR",!0)),Cham:()=>new p(g("gwqB2BKNDJDD",!0)),Cherokee:()=>new p(g("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new p(g("w9jCb",!0)),Common:()=>new p(g("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new p(g("ifNxkKzDGG",!0)),Cuneiform:()=>new p(g("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new p(g("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new p(g("w8rCiD",!0)),Cyrillic:()=>new p(g("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new p(g("gghCvC",!0)),Devanagari:()=>new p(g("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new p(g("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new p(g("ggmC7B",!0)),Duployan:()=>new p(g("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new p(g("ggsC1iBL68D",!0)),Elbasan:()=>new p(g("gohCnB",!0)),Elymaic:()=>new p(g("g-jCW",!0)),Ethiopic:()=>new p(g("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new p(g("gqjClBEcJB",!0)),Georgian:()=>new p(g("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new p(g("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new p(g("w5gCa",!0)),Grantha:()=>new p(g("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new p(g("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new p(g("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new p(g("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new p(g("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new p(g("go4C5B",!0)),Han:()=>new p(g("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new p(g("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new p(g("gojCnBJJ",!0)),Hanunoo:()=>new p(g("g5FU",!0)),Hatran:()=>new p(g("gniCSCBGE",!0)),Hebrew:()=>new p(g("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new p(g("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new p(g("giiCVCI",!0)),Inherited:()=>new p(g("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new p(g("g7iCSGH",!0)),Inscriptional_Parthian:()=>new p(g("g6iCVDH",!0)),Javanese:()=>new p(g("gsqBtCDJFB",!0)),Kaithi:()=>new p(g("gkkCiCLA",!0)),Kannada:()=>new p(g("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new p(g("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new p(g("g4nCQCoBEc",!0)),Kayah_Li:()=>new p(g("goqBtBCA",!0)),Kharoshthi:()=>new p(g("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new p(g("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new p(g("g8F9CDJHJnPf",!0)),Khojki:()=>new p(g("gwkCRCuB",!0)),Khudawadi:()=>new p(g("w1kC6BGJ",!0)),Kirat_Rai:()=>new p(g("gq7C5B",!0)),Lao:()=>new p(g("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new p(g("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new p(g("ggH3BEOEC",!0)),Limbu:()=>new p(g("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new p(g("gwhC2JKVLH",!0)),Linear_B:()=>new p(g("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new p(g("wmpBvBx1eA",!0)),Lycian:()=>new p(g("g0gCc",!0)),Lydian:()=>new p(g("gpiCZGA",!0)),Mahajani:()=>new p(g("wqkCmB",!0)),Makasar:()=>new p(g("g3nCY",!0)),Malayalam:()=>new p(g("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new p(g("giCbDA",!0)),Manichaean:()=>new p(g("g2iCmBFL",!0)),Marchen:()=>new p(g("wjnCfDVCN",!0)),Masaram_Gondi:()=>new p(g("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new p(g("gy7C6C",!0)),Meetei_Mayek:()=>new p(g("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new p(g("gg6DkGDP",!0)),Meroitic_Cursive:()=>new p(g("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new p(g("gsiCf",!0)),Miao:()=>new p(g("g47CqCF4BIQ",!0)),Modi:()=>new p(g("gwlCkCMJ",!0)),Mongolian:()=>new p(g("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new p(g("gy6CeCJFB",!0)),Multani:()=>new p(g("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new p(g("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new p(g("gkiCeJI",!0)),Nag_Mundari:()=>new p(g("wm5DpB",!0)),Nandinagari:()=>new p(g("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new p(g("gsGrBFZHKEB",!0)),Newa:()=>new p(g("gglC7CCE",!0)),Nko:()=>new p(g("g+B6BDC",!0)),Nushu:()=>new p(g("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new p(g("go4DsBENDJFB",!0)),Ogham:()=>new p(g("g0Fc",!0)),Ol_Chiki:()=>new p(g("wiHvB",!0)),Ol_Onal:()=>new p(g("wu5DqBFA",!0)),Old_Hungarian:()=>new p(g("gkjCyBOyBIF",!0)),Old_Italic:()=>new p(g("g4gCjBKC",!0)),Old_North_Arabian:()=>new p(g("g0iCf",!0)),Old_Permic:()=>new p(g("w6gCqB",!0)),Old_Persian:()=>new p(g("g9gCjBFN",!0)),Old_Sogdian:()=>new p(g("g4jCnB",!0)),Old_South_Arabian:()=>new p(g("gziCf",!0)),Old_Turkic:()=>new p(g("ggjCoC",!0)),Old_Uyghur:()=>new p(g("w7jCZ",!0)),Oriya:()=>new p(g("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new p(g("wlhCjBFjB",!0)),Osmanya:()=>new p(g("gkhCdDJ",!0)),Pahawh_Hmong:()=>new p(g("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new p(g("gjiCf",!0)),Pau_Cin_Hau:()=>new p(g("g2mC4B",!0)),Phags_Pa:()=>new p(g("giqB3B",!0)),Phoenician:()=>new p(g("goiCbEA",!0)),Psalter_Pahlavi:()=>new p(g("g8iCRIDNG",!0)),Rejang:()=>new p(g("wpqBjBMA",!0)),Runic:()=>new p(g("g1FqCEK",!0)),Samaritan:()=>new p(g("ggCtBDO",!0)),Saurashtra:()=>new p(g("gkqBlCJL",!0)),Sharada:()=>new p(g("gskC-ChsCH",!0)),Shavian:()=>new p(g("wihCvB",!0)),Siddham:()=>new p(g("gslC1BDlB",!0)),Sidetic:()=>new p(g("gqiCZ",!0)),SignWriting:()=>new p(g("gg2DrUQECO",!0)),Sinhala:()=>new p(g("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new p(g("w5jCpB",!0)),Sora_Sompeng:()=>new p(g("wmkCYIJ",!0)),Soyombo:()=>new p(g("wymCyC",!0)),Sundanese:()=>new p(g("g8G-BhIH",!0)),Sunuwar:()=>new p(g("g+mChBPJ",!0)),Syloti_Nagri:()=>new p(g("ggqBsB",!0)),Syriac:()=>new p(g("g4BNC7BDCxIK",!0)),Tagalog:()=>new p(g("g4FVKA",!0)),Tagbanwa:()=>new p(g("g7FMCCCB",!0)),Tai_Le:()=>new p(g("wqGdDE",!0)),Tai_Tham:()=>new p(g("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new p(g("g0qBiCZE",!0)),Tai_Yo:()=>new p(g("g25DeCVJB",!0)),Takri:()=>new p(g("g0lC5BHJ",!0)),Tamil:()=>new p(g("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new p(g("wz6CuCCJ",!0)),Tangut:()=>new p(g("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new p(g("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new p(g("g8BxB",!0)),Thai:()=>new p(g("hwD5BGb",!0)),Tibetan:()=>new p(g("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new p(g("wpL3BIBPA",!0)),Tirhuta:()=>new p(g("gklCnCJJ",!0)),Todhri:()=>new p(g("guhCzB",!0)),Tolong_Siki:()=>new p(g("wtnCrBFJ",!0)),Toto:()=>new p(g("w04De",!0)),Tulu_Tigalari:()=>new p(g("g8kCJBCDDClBBCJBCDDCDBCJBCBBJBB",!1)),Ugaritic:()=>new p(g("g8gCdCA",!0)),Unknown:()=>new p(g("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEET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!1)),Mn:()=>new p(g("5cgBgBlgHAB",!1)),Emoji:()=>new p(g("8mJA",!0)),Extended_Pictographic:()=>new p(g("8mJA",!0)),Lowercase:()=>new p(g("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHuBPBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Math:()=>new p(g("ycGDCHHFMMDDDCHHFAB",!1)),Uppercase:()=>new p(g("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new zs({Common:()=>new p(g("8cgBgB",!1)),Greek:()=>new p(g("1FwUwU",!1)),Inherited:()=>new p(g("5cgBgBlgHAB",!1))})},j=class ze{static MAX_RUNE=1114111;static RUNE_ERROR=65533;static isUnsearchable(e){return e===ze.RUNE_ERROR||e>=ze.MIN_HIGH_SURROGATE&&e<=ze.MAX_LOW_SURROGATE}static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static MIN_HIGH_SURROGATE=55296;static MAX_HIGH_SURROGATE=56319;static MIN_LOW_SURROGATE=56320;static MAX_LOW_SURROGATE=57343;static MIN_SUPPLEMENTARY_CODE_POINT=65536;static is32(e,t){let n=0,s=e.length;for(;n<s;){let i=n+Math.floor((s-n)/2),o=e.getLo(i),B=e.getHi(i);if(o<=t&&t<=B){let a=e.getStride(i);return(t-o)%a===0}t<o?s=i:n=i+1}return!1}static is(e,t){if(t<=ze.MAX_LATIN1){for(let n=0;n<e.length;n++){if(t>e.getHi(n))continue;let s=e.getLo(n);if(t<s)return!1;let i=e.getStride(n);return(t-s)%i===0}return!1}return e.length>0&&t>=e.getLo(0)&&ze.is32(e,t)}static isUpper(e){if(e<=ze.MAX_LATIN1){let t=String.fromCodePoint(e);return t.toUpperCase()===t&&t.toLowerCase()!==t}return ze.is(rt.Upper,e)}static isPrint(e){return e<=ze.MAX_LATIN1?e>=32&&e<ze.MAX_ASCII||e>=161&&e!==173:ze.is(rt.Print,e)}static simpleFold(e){if(rt.CASE_ORBIT.has(e))return rt.CASE_ORBIT.get(e);if(e<=ze.MAX_ASCII){let t=T.toLowerCase(e);return t!==e?t:T.toUpperCase(e)}return e}static equalsIgnoreCase(e,t){if(e===t)return!0;if(e<0||t<0)return!1;if(e<=ze.MAX_ASCII&&t<=ze.MAX_ASCII)return 65<=e&&e<=90&&(e|=32),65<=t&&t<=90&&(t|=32),e===t;for(let n=ze.simpleFold(e);n!==e;n=ze.simpleFold(n))if(n===t)return!0;return!1}},vo=256,dl=new Uint8Array(vo);for(let r=0;r<vo;r++)dl[r]=97<=r&&r<=122||65<=r&&r<=90||48<=r&&r<=57||r===95?1:0;var go=null,mo=null,J=class ft{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isByteArray(e){return Array.isArray(e)||Object.prototype.toString.call(e)==="[object Uint8Array]"}static isalnum(e){return T.CODES.get("0")<=e&&e<=T.CODES.get("9")||T.CODES.get("a")<=e&&e<=T.CODES.get("z")||T.CODES.get("A")<=e&&e<=T.CODES.get("Z")}static unhex(e){return T.CODES.get("0")<=e&&e<=T.CODES.get("9")?e-T.CODES.get("0"):T.CODES.get("a")<=e&&e<=T.CODES.get("f")?e-T.CODES.get("a")+10:T.CODES.get("A")<=e&&e<=T.CODES.get("F")?e-T.CODES.get("A")+10:-1}static escapeRune(e){let t="";if(j.isPrint(e))ft.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(t+="\\"),t+=String.fromCodePoint(e);else switch(e){case T.CODES.get('"'):t+='\\"';break;case T.CODES.get("\\"):t+="\\\\";break;case T.CODES.get(" "):t+="\\t";break;case T.CODES.get(`
|
|
60
|
+
`):t+="\\n";break;case T.CODES.get("\r"):t+="\\r";break;case T.CODES.get("\b"):t+="\\b";break;case T.CODES.get("\f"):t+="\\f";break;default:{let n=e.toString(16);e<256?(t+="\\x",n.length===1&&(t+="0"),t+=n):t+=`\\x{${n}}`;break}}return t}static stringToRunes(e){let t=String(e),n=[],s=0;for(;s<t.length;){let i=t.codePointAt(s);n.push(i),s+=i>j.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<vo?dl[e]===1:!1}static emptyOpContext(e,t){let n=0;return e<0&&(n|=ft.EMPTY_BEGIN_TEXT|ft.EMPTY_BEGIN_LINE),e===10&&(n|=ft.EMPTY_BEGIN_LINE),t<0&&(n|=ft.EMPTY_END_TEXT|ft.EMPTY_END_LINE),t===10&&(n|=ft.EMPTY_END_LINE),ft.isWordRune(e)!==ft.isWordRune(t)?n|=ft.EMPTY_WORD_BOUNDARY:n|=ft.EMPTY_NO_WORD_BOUNDARY,n}static quoteMeta(e){return e.split("").map(t=>ft.METACHARACTERS.indexOf(t)>=0?`\\${t}`:t).join("")}static charCount(e){return e>j.MAX_BMP?2:1}static toArray(e){let t=e.length,n=new Array(t);for(let s=0;s<t;s++)n[s]=e[s];return n}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return go||(go=new TextEncoder),go.encode(e);{let t=[],n=0;for(let s=0;s<e.length;s++){let i=e.charCodeAt(s);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===j.MIN_HIGH_SURROGATE&&s+1<e.length&&(e.charCodeAt(s+1)&64512)===j.MIN_LOW_SURROGATE?(i=j.MIN_SUPPLEMENTARY_CODE_POINT+((i&1023)<<10)+(e.charCodeAt(++s)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){mo||(mo=new TextDecoder("utf-8"));let t=e instanceof Uint8Array?e:new Uint8Array(e);return mo.decode(t)}else{let t=[],n=0,s=0;for(;n<e.length;){let i=e[n++];if(i<128)t[s++]=String.fromCharCode(i);else if(i>191&&i<224){let o=e[n++];t[s++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){let o=e[n++],B=e[n++],a=e[n++],c=((i&7)<<18|(o&63)<<12|(B&63)<<6|a&63)-j.MIN_SUPPLEMENTARY_CODE_POINT;t[s++]=String.fromCharCode(j.MIN_HIGH_SURROGATE+(c>>10)),t[s++]=String.fromCharCode(j.MIN_LOW_SURROGATE+(c&1023))}else{let o=e[n++],B=e[n++];t[s++]=String.fromCharCode((i&15)<<12|(o&63)<<6|B&63)}}return t.join("")}}},hl=(r=[],e=0)=>{let t=Object.create(null);for(let n=0;n<r.length;n++){let s=r[n],i=e+n;t[s]=i,t[i]=s}return Object.freeze(t)},yn=class ko{static Encoding=hl(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===ko.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===ko.Encoding.UTF_16}},Ha=class extends yn{constructor(r=null){super(),this.bytes=r}getEncoding(){return yn.Encoding.UTF_8}asCharSequence(){return J.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},Xf=class extends yn{constructor(r=null){super(),this.charSequence=r}getEncoding(){return yn.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return J.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},Sn=class{static utf16(r){return new Xf(r)}static utf8(r){return J.isByteArray(r)?new Ha(r):new Ha(J.stringToUtf8ByteArray(r))}},We=class{static EOF(){return-8}constructor(){this.end=0}canCheckPrefix(){return!0}endPos(){return this.end}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},eC=class Xn extends We{static RUNE_ERROR_STEP=j.RUNE_ERROR<<3|1;constructor(e,t=0,n=e.length){super(),this.bytes=e,this.start=t,this.end=n}hasString(e,t){let n=e.bytes;if(n.length===0)return!0;let s=this.indexOf(this.bytes,n,this.start+t);return s!==-1&&s<=this.end-n.length}hasAnyString(e,t){return e.automaton8().searchUTF8(this.bytes,this.start+t,this.end)}step(e){if(e+=this.start,e>=this.end)return We.EOF();let t=this.bytes[e]&255;if(t<128)return t<<3|1;let n,s,i=128,o=191;if(t>=194&&t<=223)n=2,s=t&31;else if(t>=224&&t<=239)n=3,s=t&15,t===224?i=160:t===237&&(o=159);else if(t>=240&&t<=244)n=4,s=t&7,t===240?i=144:t===244&&(o=143);else return Xn.RUNE_ERROR_STEP;if(e+n>this.end)return Xn.RUNE_ERROR_STEP;let B=this.bytes[e+1]&255;if(B<i||B>o)return Xn.RUNE_ERROR_STEP;if(s=s<<6|B&63,n>2){let a=this.bytes[e+2]&255;if((a&192)!==128)return Xn.RUNE_ERROR_STEP;if(s=s<<6|a&63,n>3){let c=this.bytes[e+3]&255;if((c&192)!==128)return Xn.RUNE_ERROR_STEP;s=s<<6|c&63}}return s<<3|n}index(e,t){t+=this.start;let n=this.indexOf(this.bytes,e.prefixUTF8,t);return n<0?n:n-t}context(e){e+=this.start;let t=-1;if(e>this.start&&e<=this.end){let s=e-1;if(t=this.bytes[s--],t>=128){let i=e-4;for(i<this.start&&(i=this.start);s>=i&&(this.bytes[s]&192)===128;)s--;s<this.start&&(s=this.start);let o=this.step(s-this.start);t=s+(o&7)===e?o>>3:j.RUNE_ERROR}}let n=e<this.end?this.step(e-this.start)>>3:-1;return J.emptyOpContext(t,n)}indexOf(e,t,n=0){let s=t.length;if(s===0)return n<=this.end?n:-1;let i=t[0],o=this.end-s,B=typeof e.indexOf=="function",a=n;for(;a<=o;){if(B){if(a=e.indexOf(i,a),a===-1||a>o)return-1}else{for(;a<=o&&e[a]!==i;)a++;if(a>o)return-1}let c=!0;for(let u=1;u<s;u++)if(e[a+u]!==t[u]){c=!1;break}if(c)return a;a++}return-1}prefixLength(e){return e.prefixUTF8.length}},tC=class extends We{constructor(r,e=0,t=r.length){super(),this.charSequence=r,this.start=e,this.end=t}hasString(r,e){let t=this.charSequence.indexOf(r.str,this.start+e);return t!==-1&&t<=this.end-r.str.length}hasAnyString(r,e){return r.automaton16().searchUTF16(this.charSequence,this.start+e,this.end)}step(r){if(r+=this.start,r>=this.end)return We.EOF();let e=this.charSequence.charCodeAt(r);if(e<j.MIN_HIGH_SURROGATE||e>j.MAX_HIGH_SURROGATE||r+1>=this.end)return e<<3|1;let t=this.charSequence.charCodeAt(r+1);return t>=j.MIN_LOW_SURROGATE&&t<=j.MAX_LOW_SURROGATE?(e-j.MIN_HIGH_SURROGATE)*1024+(t-j.MIN_LOW_SURROGATE)+j.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:e<<3|1}index(r,e){e+=this.start;let t=this.charSequence.indexOf(r.prefix,e);return t<0||t>this.end-r.prefix.length?-1:t-e}context(r){r+=this.start;let e=r>this.start&&r<=this.end?this.charSequence.charCodeAt(r-1):-1,t=r<this.end?this.charSequence.charCodeAt(r):-1;return J.emptyOpContext(e,t)}prefixLength(r){return r.prefix.length}},be=class{static fromUTF8(r,e=0,t=r.length){return new eC(r,e,t)}static fromUTF16(r,e=0,t=r.length){return new tC(r,e,t)}},Jr=class extends Error{constructor(r){super(r),this.name="RE2JSException"}},ke=class extends Jr{constructor(r,e=null){let t=`error parsing regexp: ${r}`;e&&(t+=`: \`${e}\``),super(t),this.name="RE2JSSyntaxException",this.message=t,this.error=r,this.input=e}getDescription(){return this.error}getPattern(){return this.input}},Hr=class extends Jr{constructor(r){super(r),this.name="RE2JSCompileException"}},nt=class extends Jr{constructor(r){super(r),this.name="RE2JSGroupException"}},nC=class extends Jr{constructor(r){super(r),this.name="RE2JSFlagsException"}},Pr=class extends Jr{constructor(r){super(r),this.name="RE2JSInternalException"}},Pa=class pl{static MAX_REPLACER_ARGS=65535;static quoteReplacement(e,t=!1){return t?e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(n=>{let s=n.codePointAt(0);return s===T.CODES.get("\\")||s===T.CODES.get("$")?`\\${n}`:n}).join(""):e.indexOf("$")<0?e:e.split("").map(n=>n.codePointAt(0)===T.CODES.get("$")?"$$":n).join("")}constructor(e,t){if(e===null)throw new Error("pattern is null");this.patternInput=e;let n=this.patternInput.re2();this.patternGroupCount=n.numberOfCapturingGroups(),this.groups=[],this.namedGroups=n.namedGroups,this.numberOfInstructions=n.numberOfInstructions(),this.lookbehindState=null,t instanceof yn?this.resetMatcherInput(t):J.isByteArray(t)?this.resetMatcherInput(Sn.utf8(t)):this.resetMatcherInput(Sn.utf16(t))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(e===null)throw new Error("input is null");return e instanceof yn||(J.isByteArray(e)?e=Sn.utf8(e):e=Sn.utf16(e)),this.matcherInput=e,this.lookbehindState!==null?this.lookbehindState.reset():this.lookbehindState=this.patternInput.re2().createLookbehindState(),this.reset(),this}start(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new nt(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e]}end(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new nt(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e+1]}programSize(){return this.numberOfInstructions}group(e=0){if(typeof e=="string"){let s=this.namedGroups[e];if(!Number.isFinite(s))throw new nt(`group '${e}' not found`);e=s}let t=this.start(e),n=this.end(e);return t<0&&n<0?null:this.substring(t,n)}getNamedGroups(){if(!this.hasMatch)throw new nt("perhaps no match attempted");let e=Object.create(null);for(let t of Object.keys(this.namedGroups))e[t]=this.group(t);return e}groupCount(){return this.patternGroupCount}loadGroup(e){if(!Number.isInteger(e)||e<0||e>this.patternGroupCount)throw new nt(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new nt("perhaps no match attempted");if(e===0||this.hasGroups)return;let t=this.matcherInputLength,n=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],t,this.anchorFlag,1+this.patternGroupCount,this.lookbehindState);if(!n[0])throw new nt("inconsistency in matching group data");this.groups=n[1],this.hasGroups=!0}matches(){return this.genMatch(0,N.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,N.ANCHOR_START)}find(e=null){if(e!==null){if(!Number.isInteger(e)||e<0||e>this.matcherInputLength)throw new nt(`start index out of bounds: ${e}`);return this.reset(),this.genMatch(e,0)}if(e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1])){let t=(this.matcherInput.isUTF16Encoding()?be.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):be.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(e);t<0?e++:e+=t&7}return this.genMatch(e,N.UNANCHORED)}genMatch(e,t){let n=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,t,1,this.lookbehindState);return n[0]?(this.groups=n[1],this.hasMatch=!0,this.hasGroups=this.patternGroupCount===0,this.anchorFlag=t,!0):(this.hasMatch=!1,!1)}substring(e,t){return this.matcherInput.isUTF8Encoding()?J.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,t)):this.matcherInput.asCharSequence().substring(e,t).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e,t=!1){let n="",s=this.start(),i=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=i,n+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),n}appendReplacementInternalJava(e){let t="",n=0,s=e.length,i=0;for(;i<s;){let o=e.codePointAt(i);if(o===T.CODES.get("\\")){if(n<i&&(t+=e.substring(n,i)),i++,i>=s)throw new nt("character to be escaped is missing");n=i,i++;continue}if(o===T.CODES.get("$")){if(n<i&&(t+=e.substring(n,i)),i+1>=s)throw new nt("Illegal group reference: group index is missing");let B=e.codePointAt(i+1);if(T.CODES.get("0")<=B&&B<=T.CODES.get("9")){let a=B-T.CODES.get("0"),c=i+2;for(;c<s;c++){let l=e.codePointAt(c);if(l<T.CODES.get("0")||l>T.CODES.get("9")||a*10+l-T.CODES.get("0")>this.patternGroupCount)break;a=a*10+l-T.CODES.get("0")}if(a>this.patternGroupCount)throw new nt(`n > number of groups: ${a}`);let u=this.group(a);u!==null&&(t+=u),i=c,n=i}else if(B===T.CODES.get("{")){let a=i+2;for(;a<s&&e.codePointAt(a)!==T.CODES.get("}");)a++;if(a>=s)throw new nt("named capture group is missing trailing '}'");let c=e.substring(i+2,a),u=this.group(c);u!==null&&(t+=u),i=a+1,n=i}else throw new nt("Illegal group reference");continue}i++}return n<s&&(t+=e.substring(n,s)),t}appendReplacementInternalJs(e){let t="",n=0,s=e.length;for(let i=0;i<s-1;i++)if(e.codePointAt(i)===T.CODES.get("$")){let o=e.codePointAt(i+1);if(T.CODES.get("$")===o){n<i&&(t+=e.substring(n,i)),t+="$",i++,n=i+1;continue}else if(T.CODES.get("&")===o){n<i&&(t+=e.substring(n,i));let B=this.group(0);B!==null?t+=B:t+="$&",i++,n=i+1;continue}else if(T.CODES.get("`")===o){n<i&&(t+=e.substring(n,i)),t+=this.substring(0,this.start(0)),i++,n=i+1;continue}else if(T.CODES.get("'")===o){n<i&&(t+=e.substring(n,i)),t+=this.substring(this.end(0),this.matcherInputLength),i++,n=i+1;continue}else if(T.CODES.get("1")<=o&&o<=T.CODES.get("9")){let B=o-T.CODES.get("0");for(n<i&&(t+=e.substring(n,i)),i+=2;i<s&&(o=e.codePointAt(i),!(o<T.CODES.get("0")||o>T.CODES.get("9")||B*10+o-T.CODES.get("0")>this.patternGroupCount));i++)B=B*10+o-T.CODES.get("0");if(B>this.patternGroupCount){t+=`$${B}`,n=i,i--;continue}let a=this.group(B);a!==null&&(t+=a),n=i,i--;continue}else if(o===T.CODES.get("<")){n<i&&(t+=e.substring(n,i)),i++;let B=i+1;for(;B<e.length&&e.codePointAt(B)!==T.CODES.get(">")&&e.codePointAt(B)!==T.CODES.get(" ");)B++;if(B===e.length||e.codePointAt(B)!==T.CODES.get(">")){t+=e.substring(i-1,B+1),n=B+1,i=B;continue}let a=e.substring(i+1,B);if(Object.prototype.hasOwnProperty.call(this.namedGroups,a)){let c=this.group(a);c!==null&&(t+=c)}else t+=`$<${a}>`;n=B+1,i=B;continue}}return n<s&&(t+=e.substring(n,s)),t}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e,t=!1){return this.replace(e,!0,t)}replaceFirst(e,t=!1){return this.replace(e,!1,t)}replace(e,t=!0,n=!1){let s="";this.reset();let i=typeof e=="function",o=Object.keys(this.namedGroups).length>0,B=null;if(i){if(this.groupCount()>=pl.MAX_REPLACER_ARGS)throw new nt("Too many capture groups to safely invoke replacer function");B=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(s+=i?this.appendReplacementFunc(e,o,B):this.appendReplacement(e,n),!!t););return s+=this.appendTail(),s}appendReplacementFunc(e,t,n){let s="",i=this.start(),o=this.end();this.appendPos<i&&(s+=this.substring(this.appendPos,i)),this.appendPos=o;let B=this.buildReplacerArgs(i,t,n);return s+=String(e(...B)),s}buildReplacerArgs(e,t,n){let s=[this.group(0)],i=this.groupCount();for(let o=1;o<=i;o++){let B=this.start(o);B<0?s.push(void 0):s.push(this.substring(B,this.end(o)))}if(s.push(e),s.push(n),t){let o=this.getNamedGroups();for(let B in o)o[B]===null&&(o[B]=void 0);s.push(o)}return s}},O=class He{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static LB_WRITE=12;static LB_CHECK=13;static isRuneOp(e){return He.RUNE<=e&&e<=He.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let n of e)t+=J.escapeRune(n);return t+='"',t}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=new Int32Array(0),this.next=null}matchRune(e){if(this.runes.length===1){let o=this.runes[0];return(this.arg&N.FOLD_CASE)!==0?j.equalsIgnoreCase(o,e):e===o}let t=this.runes.length;if(t===0)return!1;if(t===2||t===4||t===6||t===8){for(let o=0;o<t;o+=2){if(e<this.runes[o])return!1;if(e<=this.runes[o+1])return!0}return!1}let n=0,s=t>>1;for(;s>1;){let o=s>>1;n+=this.runes[n+o<<1]<=e?o:0,s-=o}n+=this.runes[n<<1]<=e?1:0;let i=n-1;return i>=0&&e<=this.runes[i<<1|1]}matchRunePos(e){if(this.runes.length===1){let o=this.runes[0];return(this.arg&N.FOLD_CASE)!==0?j.equalsIgnoreCase(o,e)?0:-1:e===o?0:-1}let t=this.runes.length;if(t===0)return-1;if(t===2||t===4||t===6||t===8){for(let o=0;o<t;o+=2){if(e<this.runes[o])return-1;if(e<=this.runes[o+1])return Math.floor(o/2)}return-1}let n=0,s=t>>1;for(;s>1;){let o=s>>1;n+=this.runes[n+o<<1]<=e?o:0,s-=o}n+=this.runes[n<<1]<=e?1:0;let i=n-1;return i>=0&&e<=this.runes[i<<1|1]?i:-1}toString(){switch(this.op){case He.ALT:return`alt -> ${this.out}, ${this.arg}`;case He.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case He.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case He.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case He.MATCH:return`match${this.arg!==0?` ${this.arg}`:""}`;case He.FAIL:return"fail";case He.NOP:return`nop -> ${this.out}`;case He.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case He.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case He.RUNE:return this.runes===null?"rune <null>":["rune ",He.escapeRunes(this.runes),(this.arg&N.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case He.RUNE1:return`rune1 ${He.escapeRunes(this.runes)} -> ${this.out}`;case He.RUNE_ANY:return`any -> ${this.out}`;case He.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},_a=class gl{constructor(e){this.sparse=new Int32Array(e),this.densePcs=new Int32Array(e),this.denseCaps=null,this.size=0,this.ncap=0,this.mainThreads=0}static INITIAL_THREADS=32;init(e){this.ncap=e;let t=Math.min(this.densePcs.length,gl.INITIAL_THREADS)*e;(!this.denseCaps||this.denseCaps.length<t)&&(this.denseCaps=new Int32Array(t))}growCaps(e){let t=this.densePcs.length*this.ncap,n=new Int32Array(Math.min(t,Math.max(e,2*this.denseCaps.length)));n.set(this.denseCaps),this.denseCaps=n}contains(e){let t=this.sparse[e];return t<this.size&&this.densePcs[t]===e}isEmpty(){return this.size===0}add(e){let t=this.size++;return this.sparse[e]=t,this.densePcs[t]=e,t}clear(){this.size=0,this.mainThreads=0}toString(){let e="{";for(let t=0;t<this.size;t++)t!==0&&(e+=", "),e+=this.densePcs[t];return e+="}",e}},rC=class{constructor(r){this.pos=-1,this.pcs=new Int32Array(r.numInst()),this.size=0,this.lbTable=new Int32Array(r.numLb+1)}reset(){this.pos=-1,this.size=0}},ml=class El{static fromRE2(e){let t=new El;return t.prog=e.prog,t.re2=e,t.q0=new _a(t.prog.numInst()),t.q1=new _a(t.prog.numInst()),t.addStack=new Int32Array(2*(t.prog.numInst()+1)),t.matched=!1,t.matchcap=new Int32Array(t.prog.numCap<2?2:t.prog.numCap),t.ncap=0,t}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.addStack=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(e){this.ncap=e,e>this.matchcap.length?this.matchcap=new Int32Array(e).fill(-1):this.matchcap.fill(-1),this.q0.init(e),this.q1.init(e),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return this.ncap===0?J.emptyInts():J.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,n,s=null){let i=this.re2.cond;if(i===J.EMPTY_ALL||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return!1;this.matched=!1,this.matchcap.fill(-1);let o=this.prog.numLb>0,B=t,a=t,c=!1;o&&(s!==null&&s.pos>=0&&s.pos<=t?(a=s.pos,c=!0):a=0);let u=o&&s!==null,l=this.q0,C=this.q1,f=e.step(a),h=f>>3,d=f&7,x=-1,S=0;f!==We.EOF()&&(f=e.step(a+d),x=f>>3,S=f&7);let E;for(a===0?E=J.emptyOpContext(-1,h):E=e.context(a),o&&(c?this.restoreLookbehinds(s,l,E):this.spawnLookbehinds(l,a,E));;){if(l.mainThreads===0){if((i&J.EMPTY_BEGIN_TEXT)!==0&&a!==0||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&a!==0||this.matched)break;if(this.prog.numLb===0&&l.isEmpty()&&this.re2.prefix.length!==0&&x!==this.re2.prefixRune&&e.canCheckPrefix()){let y=e.index(this.re2,a);if(y<0)break;a+=y,f=e.step(a),h=f>>3,d=f&7,f=e.step(a+d),x=f>>3,S=f&7,E=e.context(a)}}a>=B&&(u&&(this.saveLookbehinds(s,l,a),u=!1),!this.matched&&(a===0||n===N.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=a),this.add(l,this.prog.start,a,this.matchcap,0,E)));let b=a+d;if(E=e.context(b),this.step(l,C,a,b,h,E,n,a===e.endPos()),d===0||this.ncap===0&&this.matched)break;a+=d,h=x,d=S,h!==-1&&(f=e.step(a+d),x=f>>3,S=f&7);let D=l;l=C,C=D}return l.clear(),C.clear(),this.matched}matchSet(e,t,n){let s=this.re2.cond;if(s===J.EMPTY_ALL)return[];if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return[];let i=this.prog.numLb>0?0:t,o=t,B=this.q0,a=this.q1,c=e.step(i),u=c>>3,l=c&7,C=-1,f=0;c!==We.EOF()&&(c=e.step(i+l),C=c>>3,f=c&7);let h=i===0?J.emptyOpContext(-1,u):e.context(i),d=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(B,i,h);!(B.mainThreads===0&&((s&J.EMPTY_BEGIN_TEXT)!==0&&i!==0||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&i!==0));){(i===0||n===N.UNANCHORED)&&i>=o&&this.add(B,this.prog.start,i,this.matchcap,0,h);let x=i+l;h=e.context(x);for(let E=0;E<B.size;E++){let b=B.densePcs[E],D=this.prog.inst[b],y=E*this.ncap,v=!1;switch(D.op){case O.MATCH:if(n===N.ANCHOR_BOTH&&i!==e.endPos())break;d.add(D.arg);break;case O.RUNE:v=D.matchRune(u);break;case O.RUNE1:v=u===D.runes[0];break;case O.RUNE_ANY:v=!0;break;case O.RUNE_ANY_NOT_NL:v=u!==10;break;default:continue}v&&this.add(a,D.out,x,B.denseCaps,y,h)}if(B.clear(),l===0)break;i+=l,u=C,l=f,u!==-1&&(c=e.step(i+l),C=c>>3,f=c&7);let S=B;B=a,a=S}return a.clear(),Array.from(d).sort((x,S)=>x-S)}step(e,t,n,s,i,o,B,a){let c=this.re2.longest;for(let u=0;u<e.size;u++){let l=e.densePcs[u],C=u*this.ncap;if(c&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[C])continue;let f=this.prog.inst[l],h=!1;switch(f.op){case O.MATCH:if(B===N.ANCHOR_BOTH&&!a)break;if(this.ncap>0&&(!c||!this.matched||this.matchcap[1]<n)){e.denseCaps[C+1]=n;for(let d=0;d<this.ncap;d++)this.matchcap[d]=e.denseCaps[C+d]}c||(e.size=0),this.matched=!0;break;case O.RUNE:h=f.matchRune(i);break;case O.RUNE1:h=i===f.runes[0];break;case O.RUNE_ANY:h=!0;break;case O.RUNE_ANY_NOT_NL:h=i!==10;break;default:continue}h&&this.add(t,f.out,s,e.denseCaps,C,o)}e.clear()}spawnLookbehinds(e,t,n){for(let s=0;s<this.prog.lbStarts.length;s++)this.add(e,this.prog.lbStarts[s],t,this.matchcap,0,n)}restoreLookbehinds(e,t,n){this.lbTable.set(e.lbTable);for(let s=0;s<e.size;s++)this.add(t,e.pcs[s],e.pos,this.matchcap,0,n)}saveLookbehinds(e,t,n){let s=0;for(let i=0;i<t.size;i++){let o=t.densePcs[i];this.prog.lbInst[o]===1&&O.isRuneOp(this.prog.inst[o].op)&&(e.pcs[s++]=o)}e.size=s,e.pos=n,e.lbTable.set(this.lbTable)}add(e,t,n,s,i,o){let B=this.addStack,a=0;for(;;){for(;t!==0&&!e.contains(t);){let u=e.add(t),l=this.prog.inst[t];switch(l.op){case O.FAIL:t=0;break;case O.ALT:case O.ALT_MATCH:B[a++]=l.arg,B[a++]=0,t=l.out;break;case O.EMPTY_WIDTH:t=(l.arg&~o)===0?l.out:0;break;case O.NOP:t=l.out;break;case O.CAPTURE:l.arg<this.ncap&&(B[a++]=-l.arg-1,B[a++]=s[i+l.arg],s[i+l.arg]=n),t=l.out;break;case O.LB_WRITE:this.lbTable[Math.abs(l.arg)]=n,t=l.out;break;case O.LB_CHECK:l.arg>0?t=this.lbTable[l.arg]===n?l.out:0:t=this.lbTable[-l.arg]!==n?l.out:0;break;case O.MATCH:case O.RUNE:case O.RUNE1:case O.RUNE_ANY:case O.RUNE_ANY_NOT_NL:if(this.prog.lbInst[t]===0&&e.mainThreads++,this.ncap>0){let C=u*this.ncap;C+this.ncap>e.denseCaps.length&&e.growCaps(C+this.ncap);for(let f=0;f<this.ncap;f++)e.denseCaps[C+f]=s[i+f]}t=0;break;default:throw new Pr("unhandled")}}if(a===0)return;a-=2;let c=B[a];c<0?(s[i-c-1]=B[a+1],t=0):t=c}}},sC=(r,e,t)=>{let n=-2128831035;for(let s=0;s<r.length;s++)n^=r[s],n=Math.imul(n,16777619);n^=e,n=Math.imul(n,16777619);for(let s=0;s<t.length;s++)n^=t[s],n=Math.imul(n,16777619);return n},Ja=(r,e)=>{if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0},Eo=[],Mr=-1,iC=class{constructor(r,e,t){this.nfaStates=r,this.flag=e,this.isMatch=(e&So.FLAG_MATCH)!==0,this.matchIDs=t,this.next=null,this.nextAnchored=null}},So=class Ct{static FLAG_EMPTY_MASK=255;static FLAG_MATCH=256;static FLAG_LAST_WORD=512;static FLAG_NEED_SHIFT=16;static STATE_OVERHEAD=160;static TABLE_OVERHEAD=16;static PROGRESS_PER_STATE=10;constructor(e,t=8388608){this.prog=e,this.maxMem=t,this.stateCache=new Map,this.stateCount=0,this.startStates=new Map,this.failed=!1;for(let n=0;n<e.numInst();n++){let s=e.getInst(n).op;if(s===O.LB_WRITE||s===O.LB_CHECK){this.failed=!0;break}}this.computeRuneClasses(),this.stateBudget=t,this.memBudget=t}computeRuneClasses(){let e=new Set,t=(s,i)=>{e.add(s),e.add(i+1)};for(let s=0;s<this.prog.numInst();s++){let i=this.prog.getInst(s);switch(i.op){case O.RUNE:case O.RUNE1:if(i.runes.length===1){if(t(i.runes[0],i.runes[0]),(i.arg&N.FOLD_CASE)!==0)for(let o=j.simpleFold(i.runes[0]);o!==i.runes[0];o=j.simpleFold(o))t(o,o)}else for(let o=0;o<i.runes.length;o+=2)t(i.runes[o],i.runes[o+1]);break;case O.RUNE_ANY_NOT_NL:t(10,10);break;case O.EMPTY_WIDTH:(i.arg&(J.EMPTY_BEGIN_LINE|J.EMPTY_END_LINE))!==0&&t(10,10),(i.arg&(J.EMPTY_WORD_BOUNDARY|J.EMPTY_NO_WORD_BOUNDARY))!==0&&(t(48,57),t(65,90),t(95,95),t(97,122))}}e.delete(0),this.classBounds=Int32Array.from(e).sort(),this.numClasses=this.classBounds.length+1;let n=new Int32Array(j.MAX_LATIN1+1);for(let s=0;s<=j.MAX_LATIN1;s++)n[s]=this.searchClass(s);this.latin1Class=n}runeClass(e){return e<=j.MAX_LATIN1?this.latin1Class[e]:this.searchClass(e)}searchClass(e){let t=this.classBounds,n=0,s=t.length;for(;n<s;){let i=n+s>>1;t[i]<=e?n=i+1:s=i}return n}closure(e,t){let n=new Set,s=Array.from(e),i=0;for(;s.length>0;){let o=s.pop();if(o===0||n.has(o))continue;n.add(o);let B=this.prog.getInst(o);switch(B.op){case O.ALT:case O.ALT_MATCH:s.push(B.out),s.push(B.arg);break;case O.NOP:case O.CAPTURE:s.push(B.out);break;case O.EMPTY_WIDTH:i|=B.arg,(B.arg&~t)===0&&s.push(B.out)}}return{pcs:Int32Array.from(n).sort(),needflags:i}}getState(e,t,n){let s=sC(e,t,n),i=this.stateCache.get(s);if(i)for(let a=0;a<i.length;a++){let c=i[a];if(c.flag===t&&Ja(c.nfaStates,e)&&Ja(c.matchIDs,n))return c}let o=Ct.STATE_OVERHEAD+4*e.length+8*n.length;if(this.memBudget<o)return null;this.memBudget-=o,i||(i=[],this.stateCache.set(s,i));let B=new iC(e,t,n);return i.push(B),this.stateCount++,B}makeState(e,t,n){let s=this.closure(e,t&Ct.FLAG_EMPTY_MASK),i=t;return s.needflags===0&&(i&=Ct.FLAG_MATCH),i|=s.needflags<<Ct.FLAG_NEED_SHIFT,this.getState(s.pcs,i,n)}allocTable(e,t){let n=this.numClasses+1,s=Ct.TABLE_OVERHEAD+8*n;if(this.memBudget<s)return null;this.memBudget-=s;let i=new Array(n).fill(null);return t===N.UNANCHORED?e.next=i:e.nextAnchored=i,i}clearCache(){this.stateCache.clear(),this.stateCount=0,this.startStates.clear(),this.memBudget=this.stateBudget}resetCache(e){return this.clearCache(),this.getState(e.nfaStates,e.flag,e.matchIDs)}step(e,t,n,s){let i=s===N.UNANCHORED?e.next:e.nextAnchored;if(i!==null){let E=i[t];if(E!==null)return E}else if(i=this.allocTable(e,s),i===null)return null;let o=e.flag>>>Ct.FLAG_NEED_SHIFT,B=e.flag&Ct.FLAG_EMPTY_MASK,a=B,c=0;n===10&&(a|=J.EMPTY_END_LINE,c|=J.EMPTY_BEGIN_LINE),n===Mr&&(a|=J.EMPTY_END_LINE|J.EMPTY_END_TEXT);let u=(e.flag&Ct.FLAG_LAST_WORD)!==0,l=n!==Mr&&J.isWordRune(n);a|=l===u?J.EMPTY_NO_WORD_BOUNDARY:J.EMPTY_WORD_BOUNDARY;let C=e.nfaStates;(a&~B&o)!==0&&(C=this.closure(C,a).pcs);let f=[],h=!1,d=Eo;for(let E=0;E<C.length;E++){let b=this.prog.getInst(C[E]);b.op===O.MATCH?(h||(h=!0,d=[]),d.push(b.arg)):n!==Mr&&O.isRuneOp(b.op)&&b.matchRune(n)&&f.push(b.out)}d.length>1&&d.sort((E,b)=>E-b),s===N.UNANCHORED&&n!==Mr&&f.push(this.prog.start);let x=c;h&&(x|=Ct.FLAG_MATCH),l&&(x|=Ct.FLAG_LAST_WORD);let S=this.makeState(f,x,d);return S===null?null:(i[t]=S,S)}start(e,t){let n=e.context(t),s;if((n&J.EMPTY_BEGIN_TEXT)!==0)s=J.EMPTY_BEGIN_TEXT|J.EMPTY_BEGIN_LINE;else if((n&J.EMPTY_BEGIN_LINE)!==0)s=J.EMPTY_BEGIN_LINE;else{let o=e.step(t),B=o>=0&&J.isWordRune(o>>3);s=(n&J.EMPTY_WORD_BOUNDARY)!==0!==B?Ct.FLAG_LAST_WORD:0}let i=this.startStates.get(s);if(i===void 0){if(i=this.makeState([this.prog.start],s,Eo),i===null&&(this.clearCache(),i=this.makeState([this.prog.start],s,Eo),i===null))return null;this.startStates.set(s,i)}return i}stepOrReset(e,t,n,s,i,o){let B=this.step(e,t,n,s);if(B!==null)return B;if(o.resetPos>=0&&i-o.resetPos<Ct.PROGRESS_PER_STATE*this.stateCount)return null;o.resetPos=i;let a=this.resetCache(e);return a===null?null:(B=this.step(a,t,n,s),B)}run(e,t,n,s,i){let o=e.endPos(),B=this.latin1Class,a=n===N.UNANCHORED,c={resetPos:-1},u=t;for(;u<o;){let l=e.step(u),C=l>>3,f=l&7;if(f===0)break;let h=C<=j.MAX_LATIN1?B[C]:this.runeClass(C),d=a&&s.next!==null?s.next[h]:null;if(d===null&&(d=this.stepOrReset(s,h,C,n,u,c),d===null))return null;if(s=d,s.isMatch&&i(s,!1))return!0;if(!a&&s.nfaStates.length===0)return!1;u+=f}return s=this.stepOrReset(s,this.numClasses,Mr,n,u,c),s===null?null:s.isMatch&&i(s,!0)}match(e,t,n){if(this.failed)return null;if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return!1;let s=this.start(e,t);return s===null?null:this.run(e,t,n,s,(i,o)=>n!==N.ANCHOR_BOTH||o)}matchSet(e,t,n){if(this.failed)return null;if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return[];let s=this.start(e,t);if(s===null)return null;let i=new Set,o=(B,a)=>{if(n!==N.ANCHOR_BOTH||a)for(let c=0;c<B.matchIDs.length;c++)i.add(B.matchIDs[c]);return!1};return this.run(e,t,n,s,o)===null?null:Array.from(i).sort((B,a)=>B-a)}},oC=32,BC=500,Do=256,aC=262144,lC=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(Do),this.jobArg=new Uint8Array(Do),this.jobPos=new Int32Array(Do),this.jobLen=0,this.visited=new Uint32Array(0)}reset(r,e,t){this.end=e,this.jobLen=0,this.ncap=t;let n=r.numInst()*(e+1)+oC-1>>>5;this.visited.length<n?this.visited=new Uint32Array(n):this.visited.fill(0,0,n),this.cap.length<t?this.cap=new Int32Array(t).fill(-1):this.cap.fill(-1,0,t),this.matchcap.length<t?this.matchcap=new Int32Array(t).fill(-1):this.matchcap.fill(-1,0,t)}shouldVisit(r,e){let t=r*(this.end+1)+e,n=t>>>5,s=1<<(t&31);return(this.visited[n]&s)!==0?!1:(this.visited[n]|=s,!0)}push(r,e,t,n){if(r.prog.getInst(e).op!==O.FAIL&&(n||this.shouldVisit(e,t))){if(this.jobLen>=this.jobPc.length){let s=this.jobPc.length*2,i=new Int32Array(s);i.set(this.jobPc),this.jobPc=i;let o=new Uint8Array(s);o.set(this.jobArg),this.jobArg=o;let B=new Int32Array(s);B.set(this.jobPos),this.jobPos=B}this.jobPc[this.jobLen]=e,this.jobArg[this.jobLen]=n?1:0,this.jobPos[this.jobLen]=t,this.jobLen++}}tryBacktrack(r,e,t,n,s){let i=r.longest;for(this.push(r,t,n,!1);this.jobLen>0;){this.jobLen--;let o=this.jobPc[this.jobLen],B=this.jobArg[this.jobLen]===1,a=this.jobPos[this.jobLen],c=!0;for(;!(!c&&!this.shouldVisit(o,a));){c=!1;let u=r.prog.getInst(o);switch(u.op){case O.FAIL:throw new Pr("unexpected InstFail");case O.ALT:if(B){B=!1,o=u.arg;continue}else{this.push(r,o,a,!0),o=u.out;continue}case O.ALT_MATCH:{let l=r.prog.getInst(u.out);if(O.isRuneOp(l.op)){this.push(r,u.arg,a,!1),o=u.arg,a=this.end;continue}this.push(r,u.out,this.end,!1),o=u.out;continue}case O.RUNE:{let l=e.step(a);if(l===We.EOF()||!u.matchRune(l>>3))break;a+=l&7,o=u.out;continue}case O.RUNE1:{let l=e.step(a);if(l===We.EOF()||l>>3!==u.runes[0])break;a+=l&7,o=u.out;continue}case O.RUNE_ANY_NOT_NL:{let l=e.step(a);if(l===We.EOF()||l>>3===10)break;a+=l&7,o=u.out;continue}case O.RUNE_ANY:{let l=e.step(a);if(l===We.EOF())break;a+=l&7,o=u.out;continue}case O.CAPTURE:if(B){this.cap[u.arg]=a;break}else{u.arg<this.ncap&&(this.push(r,o,this.cap[u.arg],!0),this.cap[u.arg]=a),o=u.out;continue}case O.EMPTY_WIDTH:{let l=e.context(a);if((u.arg&~l)!==0)break;o=u.out;continue}case O.NOP:o=u.out;continue;case O.MATCH:{if(s===N.ANCHOR_BOTH&&a!==this.end)break;if(this.ncap===0)return!0;this.ncap>1&&(this.cap[1]=a);let l=this.matchcap[1];if((l===-1||i&&a>0&&a>l)&&this.matchcap.set(this.cap),!i||a===this.end)return!0;break}case O.LB_WRITE:case O.LB_CHECK:throw new Pr("Backtracker cannot evaluate Lookbehind instructions");default:throw new Pr("bad inst")}break}}return i&&this.matchcap.length>1&&this.matchcap[1]>=0}},Ys=[],Qs=class Dl{static shouldBacktrack(e){return e.numInst()<=BC}static maxBitStateLen(e){return Dl.shouldBacktrack(e)?Math.floor(aC/e.numInst()):0}static execute(e,t,n,s,i){let o=e.cond;if(o===J.EMPTY_ALL||(s===N.ANCHOR_START||s===N.ANCHOR_BOTH)&&n!==0||(o&J.EMPTY_BEGIN_TEXT)!==0&&n!==0)return null;let B=Ys.length>0?Ys.pop():new lC,a=t.endPos();B.reset(e.prog,a,i);let c=!1;if((o&J.EMPTY_BEGIN_TEXT)!==0||s===N.ANCHOR_START||s===N.ANCHOR_BOTH)B.ncap>0&&(B.cap[0]=n),B.tryBacktrack(e,t,e.prog.start,n,s)&&(c=!0);else{let l=-1;for(;n<=a&&l!==0;n+=l){if(e.prefix.length>0){let f=t.index(e,n);if(f<0)break;n+=f}if(B.ncap>0&&(B.cap[0]=n),B.tryBacktrack(e,t,e.prog.start,n,s)){c=!0;break}let C=t.step(n);l=C===We.EOF()?0:C&7}}if(!c)return Ys.push(B),null;let u=i===0?[]:J.toArray(B.matchcap.subarray(0,i));return Ys.push(B),u}},Ua=class{constructor(r){this.sparse=new Uint32Array(r),this.dense=new Uint32Array(r),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(r){return r<this.sparse.length&&this.sparse[r]<this.size&&this.dense[this.sparse[r]]===r}insert(r){this.contains(r)||this.insertNew(r)}insertNew(r){r>=this.sparse.length||(this.sparse[r]=this.size,this.dense[this.size]=r,this.size++)}},uC=(r,e,t,n)=>{let s=r.length,i=e.length,o=0,B=0,a=[],c=[],u=!0,l=-1,C=f=>{let h=f?r:e,d=f?o:B,x=f?t:n;return l>0&&h[d]<=a[l]?!1:(a.push(h[d],h[d+1]),f?o+=2:B+=2,l+=2,c.push(x),!0)};for(;o<s||B<i;)if(B>=i?u=C(!0):o>=s||e[B]<r[o]?u=C(!1):u=C(!0),!u)return null;return{merged:a,next:c}},cC=class{constructor(r){this.start=r.start,this.numCap=r.numCap,this.inst=new Array(r.inst.length);for(let e=0;e<r.inst.length;e++){let t=r.inst[e],n=new O(t.op);n.out=t.out,n.arg=t.arg,n.runes=t.runes?new Int32Array(t.runes):new Int32Array(0),n.next=null,this.inst[e]=n}}},fC=r=>{let e=new cC(r);for(let t=0;t<e.inst.length;t++){let n=e.inst[t];if(n.op!==O.ALT&&n.op!==O.ALT_MATCH)continue;let s="out",i="arg",o=e.inst[n[i]];if(o.op!==O.ALT&&o.op!==O.ALT_MATCH&&(s="arg",i="out",o=e.inst[n[i]],o.op!==O.ALT&&o.op!==O.ALT_MATCH))continue;let B=e.inst[n[s]];if(B.op===O.ALT||B.op===O.ALT_MATCH)continue;let a="out",c="arg",u=!1;o.out===t?u=!0:o.arg===t&&(u=!0,a="arg",c="out"),u&&(o[a]=n[s]),n[s]===o[a]&&(n[i]=o[c])}return e},CC=r=>{if(r.inst.length>=1e3)return null;let e=new Ua(r.inst.length),t=new Ua(r.inst.length),n=new Array(r.inst.length),s=new Array(r.inst.length).fill(!1),i=o=>{let B=!0,a=r.inst[o];if(t.contains(o))return!0;switch(t.insert(o),a.op){case O.ALT:case O.ALT_MATCH:{B=i(a.out)&&i(a.arg);let c=s[a.out],u=s[a.arg];if(c&&u)return!1;if(u){let h=a.out;a.out=a.arg,a.arg=h;let d=c;c=u,u=d}c&&(s[o]=!0,a.op=O.ALT_MATCH);let l=n[a.out]||[],C=n[a.arg]||[],f=uC(l,C,a.out,a.arg);if(!f)return!1;n[o]=new Int32Array(f.merged),a.next=new Uint32Array(f.next);break}case O.CAPTURE:case O.EMPTY_WIDTH:case O.NOP:B=i(a.out),s[o]=s[a.out],n[o]=n[a.out]?new Int32Array(n[a.out]):new Int32Array(0),a.next=new Uint32Array(Math.floor(n[o].length/2)+1).fill(a.out);break;case O.MATCH:case O.FAIL:s[o]=a.op===O.MATCH;break;case O.RUNE:{if(s[o]=!1,a.next&&a.next.length>0)break;if(e.insert(a.out),!a.runes||a.runes.length===0){n[o]=new Int32Array(0),a.next=new Uint32Array([a.out]);break}let c=[];if(a.runes.length===1&&(a.arg&N.FOLD_CASE)!==0){let u=a.runes[0];c.push(u,u);for(let l=j.simpleFold(u);l!==u;l=j.simpleFold(l))c.push(l,l);c.sort((l,C)=>l-C)}else for(let u=0;u<a.runes.length;u++)c.push(a.runes[u]);n[o]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=O.RUNE;break}case O.RUNE1:{if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out);let c=[];if((a.arg&N.FOLD_CASE)!==0){let u=a.runes[0];c.push(u,u);for(let l=j.simpleFold(u);l!==u;l=j.simpleFold(l))c.push(l,l);c.sort((l,C)=>l-C)}else c.push(a.runes[0],a.runes[0]);n[o]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=O.RUNE;break}case O.RUNE_ANY:if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[o]=new Int32Array([0,j.MAX_RUNE]),a.next=new Uint32Array([a.out]);break;case O.RUNE_ANY_NOT_NL:if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[o]=new Int32Array([0,9,11,j.MAX_RUNE]),a.next=new Uint32Array(Math.floor(n[o].length/2)+1).fill(a.out)}return B};for(e.clear(),e.insert(r.start);!e.empty();)if(t.clear(),!i(e.next()))return null;for(let o=0;o<r.inst.length;o++)n[o]&&(r.inst[o].runes=n[o]);return r},dC=(r,e)=>{for(let t=0;t<e.inst.length;t++){let n=e.inst[t];switch(n.op){case O.ALT:case O.ALT_MATCH:case O.RUNE:break;case O.CAPTURE:case O.EMPTY_WIDTH:case O.NOP:case O.MATCH:case O.FAIL:r.inst[t].next=null;break;case O.RUNE1:case O.RUNE_ANY:case O.RUNE_ANY_NOT_NL:r.inst[t].next=null,r.inst[t].op=n.op,r.inst[t].runes=n.runes?new Int32Array(n.runes):new Int32Array(0)}}},ja=class bl{static compile(e){if(e.start===0||e.numLb>0)return null;let t=e.inst[e.start];if(t.op!==O.EMPTY_WIDTH||(t.arg&J.EMPTY_BEGIN_TEXT)===0)return null;let n=!1;for(let i=0;i<e.inst.length;i++)if(e.inst[i].op===O.ALT||e.inst[i].op===O.ALT_MATCH){n=!0;break}for(let i=0;i<e.inst.length;i++){let o=e.inst[i],B=e.inst[o.out].op;switch(o.op){case O.ALT:case O.ALT_MATCH:if(B===O.MATCH||e.inst[o.arg].op===O.MATCH)return null;break;case O.EMPTY_WIDTH:if(B===O.MATCH){if((o.arg&J.EMPTY_END_TEXT)===J.EMPTY_END_TEXT)continue;return null}break;default:if(B===O.MATCH&&n)return null}}let s=fC(e);return s=CC(s),s!==null&&dC(s,e),s}static next(e,t){let n=e.matchRunePos(t);return n>=0?e.next[n]:e.op===O.ALT_MATCH?e.out:0}static execute(e,t,n,s,i){let o=e.onepass;if(!o)return null;let B=new Int32Array(i).fill(-1),a=!1,c=t.step(n),u=c>>3,l=c&7,C=We.EOF(),f=-1,h=0;c!==We.EOF()&&(C=t.step(n+l),C!==We.EOF()&&(f=C>>3,h=C&7));let d=n===0?J.emptyOpContext(-1,u):t.context(n),x=o.start,S;for(;;){switch(S=o.inst[x],x=S.out,S.op){case O.MATCH:return s===N.ANCHOR_BOTH&&n!==t.endPos()?null:(a=!0,B.length>0&&(B[0]=0,B[1]=n),i===0?[]:J.toArray(B));case O.RUNE:if(!S.matchRune(u))return null;break;case O.RUNE1:if(u!==S.runes[0])return null;break;case O.RUNE_ANY:break;case O.RUNE_ANY_NOT_NL:if(u===10)return null;break;case O.ALT:case O.ALT_MATCH:x=bl.next(S,u);continue;case O.FAIL:return null;case O.NOP:continue;case O.EMPTY_WIDTH:if((S.arg&~d)!==0)return null;continue;case O.CAPTURE:S.arg<B.length&&(B[S.arg]=n);continue;default:throw new Pr("bad inst")}if(l===0)break;d=J.emptyOpContext(u,f),n+=l,u=f,l=h,u!==-1&&(C=t.step(n+l),C!==We.EOF()?(f=C>>3,h=C&7):(f=-1,h=0))}return a?i===0?[]:J.toArray(B):null}},w=class se{static Op=hl(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(e){return e>=se.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===T.CODES.get("-")?"\\":""}static fromRegexp(e){let t=new se(e.op);return t.flags=e.flags,t.subs=e.subs,t.runes=e.runes,t.cap=e.cap,t.min=e.min,t.max=e.max,t.name=e.name,t.namedGroups=e.namedGroups,t.lb=e.lb,t}constructor(e){this.op=e,this.flags=0,this.subs=se.emptySubs(),this.runes=new Int32Array(0),this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=se.emptySubs(),this.runes=new Int32Array(0),this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case se.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case se.Op.EMPTY_MATCH:e+="(?:)";break;case se.Op.STAR:case se.Op.PLUS:case se.Op.QUEST:case se.Op.REPEAT:{let t=this.subs[0];switch(t.op>se.Op.CAPTURE||t.op===se.Op.LITERAL&&t.runes.length>1?e+=`(?:${t.appendTo()})`:e+=t.appendTo(),this.op){case se.Op.STAR:e+="*";break;case se.Op.PLUS:e+="+";break;case se.Op.QUEST:e+="?";break;case se.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}"}(this.flags&N.NON_GREEDY)!==0&&(e+="?");break}case se.Op.CONCAT:for(let t of this.subs)t.op===se.Op.ALTERNATE?e+=`(?:${t.appendTo()})`:e+=t.appendTo();break;case se.Op.ALTERNATE:{let t="";for(let n of this.subs)e+=t,t="|",e+=n.appendTo();break}case se.Op.LITERAL:(this.flags&N.FOLD_CASE)!==0&&(e+="(?i:");for(let t of this.runes)e+=J.escapeRune(t);(this.flags&N.FOLD_CASE)!==0&&(e+=")");break;case se.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case se.Op.ANY_CHAR:e+="(?s:.)";break;case se.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case se.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case se.Op.CAPTURE:this.name===null||this.name.length===0?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==se.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case se.Op.BEGIN_TEXT:e+="\\A";break;case se.Op.END_TEXT:(this.flags&N.WAS_DOLLAR)!==0?e+="(?-m:$)":e+="\\z";break;case se.Op.BEGIN_LINE:e+="^";break;case se.Op.END_LINE:e+="$";break;case se.Op.WORD_BOUNDARY:e+="\\b";break;case se.Op.NO_WORD_BOUNDARY:e+="\\B";break;case se.Op.CHAR_CLASS:if(this.runes.length%2!==0){e+="[invalid char class]";break}if(e+="[",this.runes.length===0)e+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===j.MAX_RUNE){e+="^";for(let t=1;t<this.runes.length-1;t+=2){let n=this.runes[t]+1,s=this.runes[t+1]-1;e+=se.quoteIfHyphen(n),e+=J.escapeRune(n),n!==s&&(e+="-",e+=se.quoteIfHyphen(s),e+=J.escapeRune(s))}}else for(let t=0;t<this.runes.length;t+=2){let n=this.runes[t],s=this.runes[t+1];e+=se.quoteIfHyphen(n),e+=J.escapeRune(n),n!==s&&(e+="-",e+=se.quoteIfHyphen(s),e+=J.escapeRune(s))}e+="]";break;default:e+=this.op}return e}maxCap(){let e=0;if(this.op===se.Op.CAPTURE&&(e=this.cap),this.subs!==null)for(let t of this.subs){let n=t.maxCap();e<n&&(e=n)}return e}equals(e){if(!(e!==null&&e instanceof se)||this.op!==e.op)return!1;switch(this.op){case se.Op.END_TEXT:if((this.flags&N.WAS_DOLLAR)!==(e.flags&N.WAS_DOLLAR))return!1;break;case se.Op.LITERAL:case se.Op.CHAR_CLASS:if((this.flags&N.FOLD_CASE)!==(e.flags&N.FOLD_CASE))return!1;if(this.runes===null&&e.runes===null)break;if(this.runes===null||e.runes===null||this.runes.length!==e.runes.length)return!1;for(let t=0;t<this.runes.length;t++)if(this.runes[t]!==e.runes[t])return!1;break;case se.Op.ALTERNATE:case se.Op.CONCAT:if(this.subs.length!==e.subs.length)return!1;for(let t=0;t<this.subs.length;++t)if(!this.subs[t].equals(e.subs[t]))return!1;break;case se.Op.STAR:case se.Op.PLUS:case se.Op.QUEST:if((this.flags&N.NON_GREEDY)!==(e.flags&N.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case se.Op.REPEAT:if((this.flags&N.NON_GREEDY)!==(e.flags&N.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case se.Op.CAPTURE:if(this.cap!==e.cap||(this.name===null?e.name!==null:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1;break;case se.Op.PLB:case se.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1}return!0}},yo=class{static walk(r,e){let t=[],n=r,s;for(;;){if(n.subs.length===0)s=e.leaf(n);else{let i=e.enter(n);if(i.result===void 0){t.push({re:n,state:i,i:0}),n=n.subs[0];continue}s=i.result}for(;;){if(t.length===0)return s;let i=t[t.length-1];if(e.child(i.re,i.state,s,i.i),i.i++,i.state.result===void 0&&i.i<i.re.subs.length){n=i.re.subs[i.i];break}t.pop(),s=i.state.result!==void 0?i.state.result:e.leave(i.re,i.state)}}}},Ka=class{constructor(r,e){let t=new Map,n=[0],s=[0],i=[0],o=[0];for(let h of r){let d=0;for(let x=0;x<h.length;x++){let S=d*e+h[x],E=t.get(S);E===void 0&&(E=n.length,t.set(S,E),n.push(d),s.push(h[x]),i.push(i[d]+1),o.push(0)),d=E}o[d]=1}let B=n.length,a=new Int32Array(B-1);for(let h=1;h<B;h++)a[h-1]=h;a.sort((h,d)=>n[h]-n[d]||s[h]-s[d]);let c=new Int32Array(B+1);for(let h=1;h<B;h++)c[n[h]+1]++;for(let h=0;h<B;h++)c[h+1]+=c[h];let u=new Int32Array(B-1);for(let h=0;h<a.length;h++)u[h]=s[a[h]];this.childStart=c,this.childUnit=u,this.childNode=a;let l=new Int32Array(B);for(let h=0;h<B;h++)l[h]=h;l.sort((h,d)=>i[h]-i[d]);let C=new Int32Array(B),f=Uint8Array.from(o);for(let h=1;h<B;h++){let d=l[h],x=n[d];if(x!==0){let S=C[x],E=this.next(S,s[d]);for(;E<0&&S!==0;)S=C[S],E=this.next(S,s[d]);C[d]=E>=0?E:0}f[d]|=f[C[d]]}this.fail=C,this.match=f}next(r,e){let t=this.childStart[r],n=this.childStart[r+1],s=this.childUnit;for(;t<n;){let i=t+n>>1,o=s[i];if(o===e)return this.childNode[i];o<e?t=i+1:n=i}return-1}advance(r,e){for(;;){let t=this.next(r,e);if(t>=0)return t;if(r===0)return 0;r=this.fail[r]}}searchUTF16(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r.charCodeAt(s)),this.match[n]===1)return!0;return!1}searchUTF8(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r[s]),this.match[n]===1)return!0;return!1}},ae=class er{static Type={NONE:0,EXACT:1,AND:2,OR:3};static MAX_SCANS=32;static MAX_AC_UNITS=1<<18;constructor(e){this.type=e,this.subs=[],this.str="",this.bytes=null,this.cost=e===er.Type.EXACT?1:0,this.allExact=!1,this.ac16=null,this.ac8=null}automaton16(){if(this.ac16===null){let e=this.subs.map(t=>{let n=new Array(t.str.length);for(let s=0;s<t.str.length;s++)n[s]=t.str.charCodeAt(s);return n});this.ac16=new Ka(e,65536)}return this.ac16}automaton8(){return this.ac8===null&&(this.ac8=new Ka(this.subs.map(e=>e.bytes),256)),this.ac8}eval(e,t){switch(this.type){case er.Type.NONE:return!0;case er.Type.EXACT:return e.hasString(this,t);case er.Type.AND:for(let n=0;n<this.subs.length;n++)if(!this.subs[n].eval(e,t))return!1;return!0;case er.Type.OR:if(this.allExact)return e.hasAnyString(this,t);for(let n=0;n<this.subs.length;n++)if(this.subs[n].eval(e,t))return!0;return!1;default:return!0}}},hC=class tr{static build(e){return e?yo.walk(e,tr.WALKER):new ae(ae.Type.NONE)}static WALKER={leaf:e=>tr.leaf(e),enter:e=>tr.enter(e),child:(e,t,n)=>tr.child(e,t,n),leave:(e,t)=>tr.leave(e,t)};static leaf(e){if(e.op!==w.Op.LITERAL)return new ae(ae.Type.NONE);if(e.runes.length===0||(e.flags&N.FOLD_CASE)!==0)return new ae(ae.Type.NONE);let t="";for(let s=0;s<e.runes.length;s++){if(j.isUnsearchable(e.runes[s]))return new ae(ae.Type.NONE);t+=String.fromCodePoint(e.runes[s])}let n=new ae(ae.Type.EXACT);return n.str=t,n.bytes=J.stringToUtf8ByteArray(n.str),n}static enter(e){switch(e.op){case w.Op.CAPTURE:case w.Op.PLUS:return{sub:null};case w.Op.REPEAT:return e.min>=1?{sub:null}:{result:new ae(ae.Type.NONE)};case w.Op.CONCAT:return{pf:new ae(ae.Type.AND),subs:[]};case w.Op.ALTERNATE:return{pf:new ae(ae.Type.OR),subs:[]};default:return{result:new ae(ae.Type.NONE)}}}static child(e,t,n){if(t.subs===void 0){t.sub=n;return}if(t.pf.type===ae.Type.AND){if(n.type===ae.Type.NONE)return;if(n.type===ae.Type.AND){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n);return}if(n.type===ae.Type.NONE){t.result=new ae(ae.Type.NONE);return}if(n.type===ae.Type.OR){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n)}static leave(e,t){if(t.subs===void 0)return t.sub;let n=t.pf,s=new Set,i=[];for(let c of t.subs){if(c.type===ae.Type.EXACT){if(s.has(c.str))continue;s.add(c.str)}i.push(c)}if(n.type===ae.Type.AND){let c=[],u=0;for(let l of i)u+l.cost>ae.MAX_SCANS||(c.push(l),u+=l.cost);return c.length===0?new ae(ae.Type.NONE):c.length===1?c[0]:(n.subs=c,n.cost=u,n)}if(i.length===0)return new ae(ae.Type.NONE);if(i.length===1)return i[0];n.subs=i;let o=!0,B=0,a=0;for(let c of i)c.type!==ae.Type.EXACT?o=!1:a+=c.bytes.length,B+=c.cost;return o?a>ae.MAX_AC_UNITS?new ae(ae.Type.NONE):(n.allExact=!0,n.cost=1,n):B>ae.MAX_SCANS?new ae(ae.Type.NONE):(n.cost=B,n)}},Et=class{constructor(r=0,e=0){this.head=r,this.tail=e}},pC=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0,this.lbInst=null}getInst(r){return this.inst[r]}numInst(){return this.inst.length}addInst(r){this.inst.push(new O(r))}markLookbehindInsts(){let r=new Uint8Array(this.inst.length),e=this.lbStarts.slice();for(;e.length>0;){let t=e.pop();if(t===0||r[t]===1)continue;r[t]=1;let n=this.inst[t];switch(n.op){case O.ALT:case O.ALT_MATCH:e.push(n.out,n.arg);break;case O.MATCH:case O.FAIL:break;default:e.push(n.out)}}this.lbInst=r}skipNop(r){let e=this.inst[r];for(;e.op===O.NOP||e.op===O.CAPTURE;)e=this.inst[r],r=e.out;return e}prefix(){let r="",e=this.skipNop(this.start);if(!O.isRuneOp(e.op)||e.runes.length!==1)return[e.op===O.MATCH,r];for(;O.isRuneOp(e.op)&&e.runes.length===1&&(e.arg&N.FOLD_CASE)===0&&!j.isUnsearchable(e.runes[0]);)r+=String.fromCodePoint(e.runes[0]),e=this.skipNop(e.out);return[e.op===O.MATCH,r]}startCond(){let r=0,e=this.start;e:for(;;){let t=this.inst[e];switch(t.op){case O.EMPTY_WIDTH:r|=t.arg;break;case O.FAIL:return-1;case O.CAPTURE:case O.NOP:break;default:break e}e=t.out}return r}patch(r,e){let t=r.head;for(;t!==0;){let n=this.inst[t>>1];(t&1)===0?(t=n.out,n.out=e):(t=n.arg,n.arg=e)}}append(r,e){if(r.head===0)return e;if(e.head===0)return r;let t=this.inst[r.tail>>1];return(r.tail&1)===0?t.out=e.head:t.arg=e.head,new Et(r.head,e.tail)}toString(){let r="";for(let e=0;e<this.inst.length;e++){let t=r.length;r+=e,e===this.start&&(r+="*"),r+=" ".substring(r.length-t),r+=this.inst[e],r+=`
|
|
61
|
+
`}return r}},gC=new Int32Array([0,T.CODES.get(`
|
|
62
|
+
`)-1,T.CODES.get(`
|
|
63
|
+
`)+1,j.MAX_RUNE]),za=new Int32Array([0,j.MAX_RUNE]),qs=class{constructor(r=0,e=new Et,t=!1){this.i=r,this.out=e,this.nullable=t}},wl=class xo{static compileRegexp(e){let t=new xo,n=t.compile(e);return t.prog.patch(n.out,t.newInst(O.MATCH).i),t.prog.start=n.i,t.prog.markLookbehindInsts(),t.prog}static compileSet(e){let t=new xo;if(e.length===0)return t.prog.start=t.newInst(O.FAIL).i,t.prog.markLookbehindInsts(),t.prog;let n=[];for(let i=0;i<e.length;i++){let o=t.compile(e[i]),B=t.newInst(O.MATCH);t.prog.getInst(B.i).arg=i,t.prog.patch(o.out,B.i),n.push(o.i)}let s=n[0];for(let i=1;i<n.length;i++){let o=t.newInst(O.ALT),B=t.prog.getInst(o.i);B.out=s,B.arg=n[i],s=o.i}return t.prog.start=s,t.prog.markLookbehindInsts(),t.prog}constructor(){this.prog=new pC,this.newInst(O.FAIL),this.runeCache=new Map,this.walker={leaf:e=>this.leaf(e),enter:e=>this.enter(e),child:(e,t,n)=>this.child(e,t,n),leave:(e,t)=>this.leave(e,t)}}newInst(e){return this.prog.addInst(e),new qs(this.prog.numInst()-1,new Et,!0)}nop(){let e=this.newInst(O.NOP);return e.out=new Et(e.i<<1,e.i<<1),e}fail(){return new qs}cap(e){let t=this.newInst(O.CAPTURE);return t.out=new Et(t.i<<1,t.i<<1),this.prog.getInst(t.i).arg=e,this.prog.numCap<e+1&&(this.prog.numCap=e+1),t}cat(e,t){return e.i===0||t.i===0?this.fail():(this.prog.patch(e.out,t.i),new qs(e.i,t.out,e.nullable&&t.nullable))}alt(e,t){if(e.i===0)return t;if(t.i===0)return e;let n=this.newInst(O.ALT),s=this.prog.getInst(n.i);return s.out=e.i,s.arg=t.i,n.out=this.prog.append(e.out,t.out),n.nullable=e.nullable||t.nullable,n}loop(e,t){let n=this.newInst(O.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new Et(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new Et(n.i<<1|1,n.i<<1|1)),this.prog.patch(e.out,n.i),n}quest(e,t){let n=this.newInst(O.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new Et(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new Et(n.i<<1|1,n.i<<1|1)),n.out=this.prog.append(n.out,e.out),n}star(e,t){return e.nullable?this.quest(this.plus(e,t),t):this.loop(e,t)}plus(e,t){return new qs(e.i,this.loop(e,t).out,e.nullable)}empty(e){let t=this.newInst(O.EMPTY_WIDTH);return this.prog.getInst(t.i).arg=e,t.out=new Et(t.i<<1,t.i<<1),t}rune(e,t){let n=this.newInst(O.RUNE);n.nullable=!1;let s=this.prog.getInst(n.i);return s.runes=e,t&=N.FOLD_CASE,(e.length!==1||j.simpleFold(e[0])===e[0])&&(t&=~N.FOLD_CASE),s.arg=t,n.out=new Et(n.i<<1,n.i<<1),(t&N.FOLD_CASE)===0&&e.length===1||e.length===2&&e[0]===e[1]?s.op=O.RUNE1:e.length===2&&e[0]===0&&e[1]===j.MAX_RUNE?s.op=O.RUNE_ANY:e.length===4&&e[0]===0&&e[1]===T.CODES.get(`
|
|
64
|
+
`)-1&&e[2]===T.CODES.get(`
|
|
65
|
+
`)+1&&e[3]===j.MAX_RUNE&&(s.op=O.RUNE_ANY_NOT_NL),n}lookBehind(e,t){let n=this.newInst(O.LB_WRITE);this.prog.getInst(n.i).arg=t;let s=this.rune(za,0),i=this.star(s,!0),o=this.cat(i,e);this.prog.patch(o.out,n.i);let B=this.newInst(O.LB_CHECK);return this.prog.getInst(B.i).arg=t,this.prog.lbStarts.push(o.i),Math.abs(t)>this.prog.numLb&&(this.prog.numLb=Math.abs(t)),B.out=new Et(B.i<<1,B.i<<1),B}compile(e){return yo.walk(e,this.walker)}leaf(e){switch(e.op){case w.Op.NO_MATCH:return this.fail();case w.Op.EMPTY_MATCH:return this.nop();case w.Op.LITERAL:{if(e.runes.length===0)return this.nop();let t=null;for(let n of e.runes){let s=this.runeCache.get(n);s===void 0&&(s=new Int32Array([n]),this.runeCache.set(n,s));let i=this.rune(s,e.flags);t=t===null?i:this.cat(t,i)}return t}case w.Op.CHAR_CLASS:return this.rune(e.runes,e.flags);case w.Op.ANY_CHAR_NOT_NL:return this.rune(gC,0);case w.Op.ANY_CHAR:return this.rune(za,0);case w.Op.BEGIN_LINE:return this.empty(J.EMPTY_BEGIN_LINE);case w.Op.END_LINE:return this.empty(J.EMPTY_END_LINE);case w.Op.BEGIN_TEXT:return this.empty(J.EMPTY_BEGIN_TEXT);case w.Op.END_TEXT:return this.empty(J.EMPTY_END_TEXT);case w.Op.WORD_BOUNDARY:return this.empty(J.EMPTY_WORD_BOUNDARY);case w.Op.NO_WORD_BOUNDARY:return this.empty(J.EMPTY_NO_WORD_BOUNDARY);case w.Op.CONCAT:case w.Op.ALTERNATE:return this.nop();default:throw new Hr("regexp: unhandled case in compile")}}enter(e){switch(e.op){case w.Op.PLB:case w.Op.NLB:case w.Op.STAR:case w.Op.PLUS:case w.Op.QUEST:return{sub:null};case w.Op.CAPTURE:return{bra:this.cap(e.cap<<1),sub:null};case w.Op.CONCAT:case w.Op.ALTERNATE:return{f:null};default:throw new Hr("regexp: unhandled case in compile")}}child(e,t,n){e.op===w.Op.CONCAT?t.f=t.f===null?n:this.cat(t.f,n):e.op===w.Op.ALTERNATE?t.f=t.f===null?n:this.alt(t.f,n):t.sub=n}leave(e,t){switch(e.op){case w.Op.PLB:case w.Op.NLB:return this.lookBehind(t.sub,e.lb);case w.Op.CAPTURE:{let n=this.cap(e.cap<<1|1);return this.cat(this.cat(t.bra,t.sub),n)}case w.Op.STAR:return this.star(t.sub,(e.flags&N.NON_GREEDY)!==0);case w.Op.PLUS:return this.plus(t.sub,(e.flags&N.NON_GREEDY)!==0);case w.Op.QUEST:return this.quest(t.sub,(e.flags&N.NON_GREEDY)!==0);case w.Op.CONCAT:case w.Op.ALTERNATE:return t.f;default:throw new Hr("regexp: unhandled case in compile")}}},kl=class Ye{static simplify(e){return e===null?null:yo.walk(e,Ye.WALKER)}static WALKER={leaf:e=>Ye.leaf(e),enter:e=>Ye.enter(e),child:(e,t,n,s)=>Ye.child(e,t,n,s),leave:(e,t)=>Ye.leave(e,t)};static leaf(e){if(e.op===w.Op.CHAR_CLASS){if(e.runes===null)return e;if(e.runes.length===0)return new w(w.Op.NO_MATCH);if(e.runes.length===2&&e.runes[0]===0&&e.runes[1]===j.MAX_RUNE)return new w(w.Op.ANY_CHAR);if(e.runes.length===4&&e.runes[0]===0&&e.runes[1]===T.CODES.get(`
|
|
66
|
+
`)-1&&e.runes[2]===T.CODES.get(`
|
|
67
|
+
`)+1&&e.runes[3]===j.MAX_RUNE)return new w(w.Op.ANY_CHAR_NOT_NL)}return e}static enter(e){switch(e.op){case w.Op.PLB:case w.Op.NLB:case w.Op.CAPTURE:case w.Op.STAR:case w.Op.PLUS:case w.Op.QUEST:return{sub:null};case w.Op.CONCAT:case w.Op.ALTERNATE:return{subs:[],changed:!1};case w.Op.REPEAT:return e.min===0&&e.max===0?{result:new w(w.Op.EMPTY_MATCH)}:{sub:null};default:return{result:e}}}static child(e,t,n,s){if(t.subs===void 0){t.sub=n;return}if(n!==e.subs[s]&&(t.changed=!0),e.op===w.Op.CONCAT){if(n.op===w.Op.NO_MATCH){t.result=new w(w.Op.NO_MATCH);return}if(n.op===w.Op.EMPTY_MATCH){t.changed=!0;return}if(n.op===w.Op.CONCAT){t.changed=!0;for(let i=0;i<n.subs.length;i++)t.subs.push(n.subs[i]);return}}else{if(n.op===w.Op.NO_MATCH){t.changed=!0;return}if(n.op===w.Op.ALTERNATE){t.changed=!0;for(let i=0;i<n.subs.length;i++)t.subs.push(n.subs[i]);return}}t.subs.push(n)}static leave(e,t){switch(e.op){case w.Op.PLB:case w.Op.NLB:case w.Op.CAPTURE:{let n=t.sub;if(n!==e.subs[0]){let s=w.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=[n],s}return e}case w.Op.CONCAT:case w.Op.ALTERNATE:if(t.changed){let n=t.subs;if(n.length===0)return new w(e.op===w.Op.CONCAT?w.Op.EMPTY_MATCH:w.Op.NO_MATCH);if(n.length===1)return n[0];let s=w.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=n,s}return e;case w.Op.STAR:case w.Op.PLUS:case w.Op.QUEST:return Ye.simplify1(e.op,e.flags,t.sub,e);case w.Op.REPEAT:return Ye.simplifyRepeat(e,t.sub);default:return e}}static simplifyRepeat(e,t){if(e.max===-1){if(e.min===0)return Ye.simplify1(w.Op.STAR,e.flags,t,null);if(e.min===1)return Ye.simplify1(w.Op.PLUS,e.flags,t,null);let s=[];for(let i=0;i<e.min-1;i++)s.push(t);return s.push(Ye.simplify1(w.Op.PLUS,e.flags,t,null)),Ye.concat(s)}if(e.min===1&&e.max===1)return t;let n=null;if(e.min>0){n=[];for(let s=0;s<e.min;s++)n.push(t)}if(e.max>e.min){let s=Ye.simplify1(w.Op.QUEST,e.flags,t,null);for(let i=e.min+1;i<e.max;i++)s=Ye.simplify1(w.Op.QUEST,e.flags,Ye.concat([t,s]),null);if(n===null)return s;n.push(s)}return n!==null?Ye.concat(n):new w(w.Op.NO_MATCH)}static concat(e){let t=[];for(let s=0;s<e.length;s++){let i=e[s];if(i.op===w.Op.NO_MATCH)return new w(w.Op.NO_MATCH);if(i.op!==w.Op.EMPTY_MATCH){if(i.op===w.Op.CONCAT){for(let o=0;o<i.subs.length;o++)t.push(i.subs[o]);continue}t.push(i)}}if(t.length===0)return new w(w.Op.EMPTY_MATCH);if(t.length===1)return t[0];let n=new w(w.Op.CONCAT);return n.subs=t,n}static simplify1(e,t,n,s){if(n.op===w.Op.EMPTY_MATCH)return n;if(n.op===w.Op.NO_MATCH)return e===w.Op.PLUS?n:new w(w.Op.EMPTY_MATCH);if(e===n.op&&(t&N.NON_GREEDY)===(n.flags&N.NON_GREEDY))return n;if(s!==null&&s.op===e&&(s.flags&N.NON_GREEDY)===(t&N.NON_GREEDY)&&n===s.subs[0])return s;let i=new w(e);return i.flags=t,i.subs=[n],i}},fe=class{constructor(r,e){this.sign=r,this.cls=e}},Ya=[48,57],Qa=[9,10,12,13,32,32],qa=[48,57,65,90,95,95,97,122],Wa=new Map([["\\d",new fe(1,Ya)],["\\D",new fe(-1,Ya)],["\\s",new fe(1,Qa)],["\\S",new fe(-1,Qa)],["\\w",new fe(1,qa)],["\\W",new fe(-1,qa)]]),Va=[48,57,65,90,97,122],Za=[65,90,97,122],Xa=[0,127],el=[9,9,32,32],tl=[0,31,127,127],nl=[48,57],rl=[33,126],sl=[97,122],il=[32,126],ol=[33,47,58,64,91,96,123,126],Bl=[9,13,32,32],al=[65,90],ll=[48,57,65,90,95,95,97,122],ul=[48,57,65,70,97,102],cl=new Map([["[:alnum:]",new fe(1,Va)],["[:^alnum:]",new fe(-1,Va)],["[:alpha:]",new fe(1,Za)],["[:^alpha:]",new fe(-1,Za)],["[:ascii:]",new fe(1,Xa)],["[:^ascii:]",new fe(-1,Xa)],["[:blank:]",new fe(1,el)],["[:^blank:]",new fe(-1,el)],["[:cntrl:]",new fe(1,tl)],["[:^cntrl:]",new fe(-1,tl)],["[:digit:]",new fe(1,nl)],["[:^digit:]",new fe(-1,nl)],["[:graph:]",new fe(1,rl)],["[:^graph:]",new fe(-1,rl)],["[:lower:]",new fe(1,sl)],["[:^lower:]",new fe(-1,sl)],["[:print:]",new fe(1,il)],["[:^print:]",new fe(-1,il)],["[:punct:]",new fe(1,ol)],["[:^punct:]",new fe(-1,ol)],["[:space:]",new fe(1,Bl)],["[:^space:]",new fe(-1,Bl)],["[:upper:]",new fe(1,al)],["[:^upper:]",new fe(-1,al)],["[:word:]",new fe(1,ll)],["[:^word:]",new fe(-1,ll)],["[:xdigit:]",new fe(1,ul)],["[:^xdigit:]",new fe(-1,ul)]]),kn=class Ws{static charClassToString(e,t){let n="[";for(let s=0;s<t;s+=2){s>0&&(n+=" ");let i=e[s],o=e[s+1];i===o?n+=`0x${i.toString(16)}`:n+=`0x${i.toString(16)}-0x${o.toString(16)}`}return n+="]",n}static sortRanges(e,t){let n=t>>1,s=new Array(n);for(let o=0;o<n;o++)s[o]=o;s.sort((o,B)=>e[2*o]-e[2*B]||e[2*B+1]-e[2*o+1]);let i=e.slice(0,t);for(let o=0;o<n;o++)e[2*o]=i[2*s[o]],e[2*o+1]=i[2*s[o]+1]}constructor(e=J.emptyInts()){this.r=e,this.len=e.length}toArray(){return this.r instanceof Int32Array?this.len===this.r.length?this.r:this.r.subarray(0,this.len):new Int32Array(this.len===this.r.length?this.r:this.r.slice(0,this.len))}toGrowableArray(){return Array.isArray(this.r)?(this.r.length=this.len,this.r):Array.from(this.r.subarray(0,this.len))}cleanClass(){if(this.len<4)return this;Ws.sortRanges(this.r,this.len);let e=2;for(let t=2;t<this.len;t+=2){let n=this.r[t],s=this.r[t+1];if(n<=this.r[e-1]+1){s>this.r[e-1]&&(this.r[e-1]=s);continue}this.r[e]=n,this.r[e+1]=s,e+=2}return this.len=e,this}appendLiteral(e,t){return(t&N.FOLD_CASE)!==0?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,t){if(this.len>0){for(let n=2;n<=4;n+=2)if(this.len>=n){let s=this.r[this.len-n],i=this.r[this.len-n+1];if(e<=i+1&&s<=t+1)return e<s&&(this.r[this.len-n]=e),t>i&&(this.r[this.len-n+1]=t),this}}return this.r[this.len++]=e,this.r[this.len++]=t,this}appendFoldedRange(e,t){if(e<=j.MIN_FOLD&&t>=j.MAX_FOLD)return this.appendRange(e,t);if(t<j.MIN_FOLD||e>j.MAX_FOLD)return this.appendRange(e,t);e<j.MIN_FOLD&&(this.appendRange(e,j.MIN_FOLD-1),e=j.MIN_FOLD),t>j.MAX_FOLD&&(this.appendRange(j.MAX_FOLD+1,t),t=j.MAX_FOLD);for(let n=e;n<=t;n++){this.appendRange(n,n);for(let s=j.simpleFold(n);s!==n;s=j.simpleFold(s))this.appendRange(s,s)}return this}appendClass(e){for(let t=0;t<e.length;t+=2)this.appendRange(e[t],e[t+1]);return this}appendFoldedClass(e){for(let t=0;t<e.length;t+=2)this.appendFoldedRange(e[t],e[t+1]);return this}appendNegatedClass(e){let t=0;for(let n=0;n<e.length;n+=2){let s=e[n],i=e[n+1];t<=s-1&&this.appendRange(t,s-1),t=i+1}return t<=j.MAX_RUNE&&this.appendRange(t,j.MAX_RUNE),this}appendTable(e){for(let t=0;t<e.length;++t){let n=e.getLo(t),s=e.getHi(t),i=e.getStride(t);if(i===1){this.appendRange(n,s);continue}for(let o=n;o<=s;o+=i)this.appendRange(o,o)}return this}appendNegatedTable(e){let t=0;for(let n=0;n<e.length;++n){let s=e.getLo(n),i=e.getHi(n),o=e.getStride(n);if(o===1){t<=s-1&&this.appendRange(t,s-1),t=i+1;continue}for(let B=s;B<=i;B+=o)t<=B-1&&this.appendRange(t,B-1),t=B+1}return t<=j.MAX_RUNE&&this.appendRange(t,j.MAX_RUNE),this}appendTableWithSign(e,t){return t<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,t=0;for(let n=0;n<this.len;n+=2){let s=this.r[n],i=this.r[n+1];e<=s-1&&(this.r[t]=e,this.r[t+1]=s-1,t+=2),e=i+1}return this.len=t,e<=j.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=j.MAX_RUNE),this}appendClassWithSign(e,t){return t<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(e,t){let n=e.cls;return t&&(n=new Ws().appendFoldedClass(n).cleanClass().toArray()),this.appendClassWithSign(n,e.sign)}toString(){return Ws.charClassToString(this.r,this.len)}},mC=class{constructor(r){this.str=r,this.position=0}pos(){return this.position}rewindTo(r){this.position=r}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(r){this.position+=r}skipString(r){this.position+=r.length}pop(){let r=this.str.codePointAt(this.position);return this.position+=J.charCount(r),r}lookingAt(r){return this.str.startsWith(r,this.position)}rest(){return this.str.substring(this.position)}from(r){return this.str.substring(r,this.position)}toString(){return this.rest()}},Gr=class V{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static ERR_INVALID_CAPTURE_IN_LOOKBEHIND="invalid capture in lookbehind";static MAX_HEIGHT=1e3;static MAX_SIZE=1398101;static MAX_RUNES=33554432;static ANY_TABLE=new p(new Uint32Array([0,j.MAX_RUNE,1]));static ASCII_TABLE=new p(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new p(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(e){return e==="Any"?{tab:V.ANY_TABLE,fold:V.ANY_TABLE,sign:1}:e==="Ascii"?{tab:V.ASCII_TABLE,fold:V.ASCII_FOLD_TABLE,sign:1}:e==="Assigned"?{tab:rt.CATEGORIES.get("Cn"),fold:rt.CATEGORIES.get("Cn"),sign:-1}:e==="Lc"?{tab:rt.CATEGORIES.get("LC"),fold:rt.FOLD_CATEGORIES.get("LC"),sign:1}:rt.CATEGORIES.has(e)?{tab:rt.CATEGORIES.get(e),fold:rt.FOLD_CATEGORIES.get(e),sign:1}:rt.SCRIPTS.has(e)?{tab:rt.SCRIPTS.get(e),fold:rt.FOLD_SCRIPT.get(e),sign:1}:null}static minFoldRune(e){if(e<j.MIN_FOLD||e>j.MAX_FOLD)return e;let t=e,n=e;for(e=j.simpleFold(e);e!==n;e=j.simpleFold(e))t>e&&(t=e);return t}static leadingRegexp(e){if(e.op===w.Op.EMPTY_MATCH)return null;if(e.op===w.Op.CONCAT&&e.subs.length>0){let t=e.subs[0];return t.op===w.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){let n=new w(w.Op.LITERAL);return n.flags=t,n.runes=J.stringToRunes(e),n}static parse(e,t){return new V(e,t).parseInternal()}static parseRepeat(e){let t=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);let n=V.parseInt(e);if(n===-1||!e.more())return-1;let s;if(!e.lookingAt(","))s=n;else{if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))s=-1;else if((s=V.parseInt(e))===-1)return-1}if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),n<0||n>1e3||s===-2||s>1e3||s>=0&&n>s)throw new ke(V.ERR_INVALID_REPEAT_SIZE,e.from(t));return n<<16|s&j.MAX_BMP}static isValidCaptureName(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n!==T.CODES.get("_")&&!J.isalnum(n))return!1}return!0}static parseInt(e){let t=e.pos();for(;e.more()&&e.peek()>=T.CODES.get("0")&&e.peek()<=T.CODES.get("9");)e.skip(1);let n=e.from(t);return n.length===0||n.length>1&&n.codePointAt(0)===T.CODES.get("0")?-1:n.length>8?-2:parseInt(n,10)}static isCharClass(e){return e.op===w.Op.LITERAL&&e.runes.length===1||e.op===w.Op.CHAR_CLASS||e.op===w.Op.ANY_CHAR_NOT_NL||e.op===w.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case w.Op.LITERAL:return e.runes.length===1&&e.runes[0]===t;case w.Op.CHAR_CLASS:for(let n=0;n<e.runes.length;n+=2)if(e.runes[n]<=t&&t<=e.runes[n+1])return!0;return!1;case w.Op.ANY_CHAR_NOT_NL:return t!==T.CODES.get(`
|
|
68
|
+
`);case w.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(e,t){switch(e.op){case w.Op.ANY_CHAR:break;case w.Op.ANY_CHAR_NOT_NL:V.matchRune(t,T.CODES.get(`
|
|
69
|
+
`))&&(e.op=w.Op.ANY_CHAR);break;case w.Op.CHAR_CLASS:{let n=new kn(Array.isArray(e.runes)?e.runes:Array.from(e.runes));t.op===w.Op.LITERAL?n.appendLiteral(t.runes[0],t.flags):n.appendClass(t.runes),e.runes=n.toGrowableArray();break}case w.Op.LITERAL:if(t.runes[0]===e.runes[0]&&t.flags===e.flags)break;e.op=w.Op.CHAR_CLASS,e.runes=new kn().appendLiteral(e.runes[0],e.flags).appendLiteral(t.runes[0],t.flags).toGrowableArray()}}static parseEscape(e){let t=e.pos();if(e.skip(1),!e.more())throw new ke(V.ERR_TRAILING_BACKSLASH);let n=e.pop();e:switch(n){case T.CODES.get("1"):case T.CODES.get("2"):case T.CODES.get("3"):case T.CODES.get("4"):case T.CODES.get("5"):case T.CODES.get("6"):case T.CODES.get("7"):if(!e.more()||e.peek()<T.CODES.get("0")||e.peek()>T.CODES.get("7"))break;case T.CODES.get("0"):{let s=n-T.CODES.get("0");for(let i=1;i<3&&!(!e.more()||e.peek()<T.CODES.get("0")||e.peek()>T.CODES.get("7"));i++)s=s*8+e.peek()-T.CODES.get("0"),e.skip(1);return s}case T.CODES.get("x"):{if(!e.more())break;if(n=e.pop(),n===T.CODES.get("{")){let o=0,B=0;for(;;){if(!e.more())break e;if(n=e.pop(),n===T.CODES.get("}"))break;let a=J.unhex(n);if(a<0||(B=B*16+a,B>j.MAX_RUNE))break e;o++}if(o===0)break e;return B}let s=J.unhex(n);if(!e.more())break;n=e.pop();let i=J.unhex(n);if(s<0||i<0)break;return s*16+i}case T.CODES.get("a"):return T.CODES.get("\x07");case T.CODES.get("f"):return T.CODES.get("\f");case T.CODES.get("n"):return T.CODES.get(`
|
|
70
|
+
`);case T.CODES.get("r"):return T.CODES.get("\r");case T.CODES.get("t"):return T.CODES.get(" ");case T.CODES.get("v"):return T.CODES.get("\v");default:if(n<=j.MAX_ASCII&&!J.isalnum(n))return n}throw new ke(V.ERR_INVALID_ESCAPE,e.from(t))}static parseClassChar(e,t){if(!e.more())throw new ke(V.ERR_MISSING_BRACKET,e.from(t));return e.lookingAt("\\")?V.parseEscape(e):e.pop()}static hasCapture(e){if(e===null)return!1;if(e.op===w.Op.CAPTURE)return!0;if(e.subs){for(let t of e.subs)if(V.hasCapture(t))return!0}return!1}constructor(e,t=0){this.wholeRegexp=e,this.flags=t,this.numCap=0,this.namedGroups=Object.create(null),this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null,this.nlb=0}newRegexp(e){let t=this.free;return t!==null&&t.subs!==null&&t.subs.length>0?(this.free=t.subs[0],t.reinit(),t.op=e):(t=new w(e),this.numRegexp+=1),t}reuse(e){this.height!==null&&this.height.has(e)&&this.height.delete(e),e.subs!==null&&e.subs.length>0&&(e.subs[0]=this.free),this.free=e}checkLimits(e){if(this.numRunes>V.MAX_RUNES)throw new ke(V.ERR_LARGE);this.checkSize(e),this.checkHeight(e)}checkSize(e){if(this.size===null){if(this.repeats===0&&(this.repeats=1),e.op===w.Op.REPEAT){let t=e.max;t===-1&&(t=e.min),t<=0&&(t=1),t>Math.floor(V.MAX_SIZE/this.repeats)?this.repeats=V.MAX_SIZE:this.repeats*=t}if(this.numRegexp<Math.floor(V.MAX_SIZE/this.repeats))return;this.size=new Map;for(let t of this.stack)this.checkSize(t)}if(this.calcSize(e,!0)>V.MAX_SIZE)throw new ke(V.ERR_LARGE)}calcSize(e,t=!1){if(!t&&this.size!==null&&this.size.has(e))return this.size.get(e);let n=0;switch(e.op){case w.Op.LITERAL:n=e.runes.length;break;case w.Op.PLB:case w.Op.NLB:case w.Op.CAPTURE:case w.Op.STAR:n=2+this.calcSize(e.subs[0]);break;case w.Op.PLUS:case w.Op.QUEST:n=1+this.calcSize(e.subs[0]);break;case w.Op.CONCAT:for(let s of e.subs)n=n+this.calcSize(s);break;case w.Op.ALTERNATE:for(let s of e.subs)n=n+this.calcSize(s);e.subs.length>1&&(n=n+e.subs.length-1);break;case w.Op.REPEAT:{let s=this.calcSize(e.subs[0]);if(e.max===-1){e.min===0?n=2+s:n=1+e.min*s;break}n=e.max*s+(e.max-e.min);break}}return n=Math.max(1,n),this.size===null&&(this.size=new Map),this.size.set(e,n),n}checkHeight(e){if(!(this.numRegexp<V.MAX_HEIGHT)){if(this.height===null){this.height=new Map;for(let t of this.stack)this.checkHeight(t)}if(this.calcHeight(e,!0)>V.MAX_HEIGHT)throw new ke(V.ERR_NESTING_DEPTH)}}calcHeight(e,t=!1){if(!t&&this.height!==null&&this.height.has(e))return this.height.get(e);let n=1;for(let s of e.subs){let i=this.calcHeight(s);n<1+i&&(n=1+i)}return this.height===null&&(this.height=new Map),this.height.set(e,n),n}pop(){return this.stack.pop()}popToPseudo(){let e=this.stack.length,t=e;for(;t>0&&!w.isPseudoOp(this.stack[t-1].op);)t--;return this.stack.splice(t,e-t)}push(e){if(this.numRunes+=e.runes.length,e.op===w.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]===e.runes[1]){if(this.maybeConcat(e.runes[0],this.flags&~N.FOLD_CASE))return null;e.op=w.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags&~N.FOLD_CASE}else if(e.op===w.Op.CHAR_CLASS&&e.runes.length===4&&e.runes[0]===e.runes[1]&&e.runes[2]===e.runes[3]&&j.simpleFold(e.runes[0])===e.runes[2]&&j.simpleFold(e.runes[2])===e.runes[0]||e.op===w.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]+1===e.runes[1]&&j.simpleFold(e.runes[0])===e.runes[1]&&j.simpleFold(e.runes[1])===e.runes[0]){if(this.maybeConcat(e.runes[0],this.flags|N.FOLD_CASE))return null;e.op=w.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags|N.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(e),this.checkLimits(e),e}maybeConcat(e,t){let n=this.stack.length;if(n<2)return!1;let s=this.stack[n-1],i=this.stack[n-2];if(s.op!==w.Op.LITERAL||i.op!==w.Op.LITERAL||(s.flags&N.FOLD_CASE)!==(i.flags&N.FOLD_CASE))return!1;Array.isArray(i.runes)||(i.runes=Array.from(i.runes));for(let o=0;o<s.runes.length;o++)i.runes.push(s.runes[o]);return e>=0?(s.runes=[e],s.flags=t,!0):(this.pop(),this.reuse(s),!1)}newLiteral(e,t){let n=this.newRegexp(w.Op.LITERAL);return n.flags=t,(t&N.FOLD_CASE)!==0&&(e=V.minFoldRune(e)),n.runes=[e],n}literal(e){this.push(this.newLiteral(e,this.flags))}op(e){let t=this.newRegexp(e);return t.flags=this.flags,this.push(t)}repeat(e,t,n,s,i,o){let B=this.flags;if((B&N.PERL_X)!==0&&(i.more()&&i.lookingAt("?")&&(i.skip(1),B^=N.NON_GREEDY),o!==-1))throw new ke(V.ERR_INVALID_REPEAT_OP,i.from(o));let a=this.stack.length;if(a===0)throw new ke(V.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let c=this.stack[a-1];if(w.isPseudoOp(c.op))throw new ke(V.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let u=this.newRegexp(e);if(u.min=t,u.max=n,u.flags=B,u.subs=[c],this.stack[a-1]=u,this.checkLimits(u),e===w.Op.REPEAT&&(t>=2||n>=2)&&!this.repeatIsValid(u,1e3))throw new ke(V.ERR_INVALID_REPEAT_SIZE,i.from(s))}repeatIsValid(e,t){if(e.op===w.Op.REPEAT){let n=e.max;if(n===0)return!0;if(n<0&&(n=e.min),n>t)return!1;n>0&&(t=Math.trunc(t/n))}for(let n of e.subs)if(!this.repeatIsValid(n,t))return!1;return!0}concat(){this.maybeConcat(-1,0);let e=this.popToPseudo();return e.length===0?this.push(this.newRegexp(w.Op.EMPTY_MATCH)):this.push(this.collapse(e,w.Op.CONCAT))}alternate(){let e=this.popToPseudo();return e.length>0&&this.cleanAlt(e[e.length-1]),e.length===0?this.push(this.newRegexp(w.Op.NO_MATCH)):this.push(this.collapse(e,w.Op.ALTERNATE))}cleanAlt(e){e.op===w.Op.CHAR_CLASS&&(e.runes=new kn(Array.from(e.runes)).cleanClass().toArray(),e.runes.length===2&&e.runes[0]===0&&e.runes[1]===j.MAX_RUNE?(e.runes=new Int32Array(0),e.op=w.Op.ANY_CHAR):e.runes.length===4&&e.runes[0]===0&&e.runes[1]===T.CODES.get(`
|
|
71
|
+
`)-1&&e.runes[2]===T.CODES.get(`
|
|
72
|
+
`)+1&&e.runes[3]===j.MAX_RUNE&&(e.runes=new Int32Array(0),e.op=w.Op.ANY_CHAR_NOT_NL))}collapse(e,t){if(e.length===1)return e[0];let n=0;for(let B of e)n+=B.op===t?B.subs.length:1;let s=new Array(n).fill(null),i=0;for(let B of e)if(B.op===t){for(let a=0;a<B.subs.length;a++)s[i++]=B.subs[a];this.reuse(B)}else s[i++]=B;let o=this.newRegexp(t);if(o.subs=s,t===w.Op.ALTERNATE&&(o.subs=this.factor(o.subs),o.subs.length===1)){let B=o;o=o.subs[0],this.reuse(B)}return o}factor(e){if(e.length<2)return e;let t=0,n=e.length,s=0,i=null,o=0,B=0,a=0;for(let u=0;u<=n;u++){let l=null,C=0,f=0;if(u<n){let h=e[t+u];if(h.op===w.Op.CONCAT&&h.subs.length>0&&(h=h.subs[0]),h.op===w.Op.LITERAL&&(l=h.runes,C=h.runes.length,f=h.flags&N.FOLD_CASE),f===B){let d=0;for(;d<o&&d<C&&i[d]===l[d];)d++;if(d>0){o=d;continue}}}if(u!==a)if(u===a+1)e[s++]=e[t+a];else{let h=this.newRegexp(w.Op.LITERAL);h.flags=B,h.runes=i.slice(0,o);for(let S=a;S<u;S++)e[t+S]=this.removeLeadingString(e[t+S],o),this.checkLimits(e[t+S]);let d=this.collapse(e.slice(t+a,t+u),w.Op.ALTERNATE),x=this.newRegexp(w.Op.CONCAT);x.subs=[h,d],e[s++]=x}a=u,i=l,o=C,B=f}n=s,t=0,a=0,s=0;let c=null;for(let u=0;u<=n;u++){let l=null;if(!(u<n&&(l=V.leadingRegexp(e[t+u]),c!==null&&c.equals(l)&&(V.isCharClass(c)||c.op===w.Op.REPEAT&&c.min===c.max&&V.isCharClass(c.subs[0]))))){if(u!==a)if(u===a+1)e[s++]=e[t+a];else{let C=c;for(let d=a;d<u;d++){let x=d!==a;e[t+d]=this.removeLeadingRegexp(e[t+d],x),this.checkLimits(e[t+d])}let f=this.collapse(e.slice(t+a,t+u),w.Op.ALTERNATE),h=this.newRegexp(w.Op.CONCAT);h.subs=[C,f],e[s++]=h}a=u,c=l}}n=s,t=0,a=0,s=0;for(let u=0;u<=n;u++)if(!(u<n&&V.isCharClass(e[t+u]))){if(u!==a)if(u===a+1)e[s++]=e[t+a];else{let l=a;for(let f=a+1;f<u;f++){let h=e[t+l],d=e[t+f];(h.op<d.op||h.op===d.op&&(h.runes!==null?h.runes.length:0)<(d.runes!==null?d.runes.length:0))&&(l=f)}let C=e[t+a];e[t+a]=e[t+l],e[t+l]=C;for(let f=a+1;f<u;f++)V.mergeCharClass(e[t+a],e[t+f]),this.reuse(e[t+f]);this.cleanAlt(e[t+a]),e[s++]=e[t+a]}u<n&&(e[s++]=e[t+u]),a=u+1}n=s,t=0,a=0,s=0;for(let u=0;u<n;++u)u+1<n&&e[t+u].op===w.Op.EMPTY_MATCH&&e[t+u+1].op===w.Op.EMPTY_MATCH||(e[s++]=e[t+u]);return n=s,t=0,e.slice(t,n)}removeLeadingString(e,t){if(e.op===w.Op.CONCAT&&e.subs.length>0){let n=this.removeLeadingString(e.subs[0],t);if(e.subs[0]=n,n.op===w.Op.EMPTY_MATCH)switch(this.reuse(n),e.subs.length){case 0:case 1:e.op=w.Op.EMPTY_MATCH,e.subs=w.emptySubs();break;case 2:{let s=e;e=e.subs[1],this.reuse(s);break}default:e.subs=e.subs.slice(1,e.subs.length)}return e}return e.op===w.Op.LITERAL&&(e.runes=e.runes.slice(t,e.runes.length),e.runes.length===0&&(e.op=w.Op.EMPTY_MATCH)),e}removeLeadingRegexp(e,t){if(e.op===w.Op.CONCAT&&e.subs.length>0){switch(t&&this.reuse(e.subs[0]),e.subs=e.subs.slice(1,e.subs.length),e.subs.length){case 0:e.op=w.Op.EMPTY_MATCH,e.subs=w.emptySubs();break;case 1:{let n=e;e=e.subs[0],this.reuse(n);break}}return e}return t&&this.reuse(e),this.newRegexp(w.Op.EMPTY_MATCH)}parseInternal(){if((this.flags&N.LITERAL)!==0)return V.literalRegexp(this.wholeRegexp,this.flags);let e=-1,t=-1,n=-1,s=new mC(this.wholeRegexp);for(;s.more();){let i=-1;e:switch(s.peek()){case T.CODES.get("("):if((this.flags&N.LOOKBEHIND)!==0){if(s.lookingAt("(?<=")){this.parsePosLookBehind(),s.skip(4);break}if(s.lookingAt("(?<!")){this.parseNegLookBehind(),s.skip(4);break}}if((this.flags&N.PERL_X)!==0&&s.lookingAt("(?")){this.parsePerlFlags(s);break}this.op(w.Op.LEFT_PAREN).cap=++this.numCap,s.skip(1);break;case T.CODES.get("|"):this.parseVerticalBar(),s.skip(1);break;case T.CODES.get(")"):this.parseRightParen(),s.skip(1);break;case T.CODES.get("^"):(this.flags&N.ONE_LINE)!==0?this.op(w.Op.BEGIN_TEXT):this.op(w.Op.BEGIN_LINE),s.skip(1);break;case T.CODES.get("$"):(this.flags&N.ONE_LINE)!==0?this.op(w.Op.END_TEXT).flags|=N.WAS_DOLLAR:this.op(w.Op.END_LINE),s.skip(1);break;case T.CODES.get("."):(this.flags&N.DOT_NL)!==0?this.op(w.Op.ANY_CHAR):this.op(w.Op.ANY_CHAR_NOT_NL),s.skip(1);break;case T.CODES.get("["):this.parseClass(s);break;case T.CODES.get("*"):case T.CODES.get("+"):case T.CODES.get("?"):{i=s.pos();let o=null;switch(s.pop()){case T.CODES.get("*"):o=w.Op.STAR;break;case T.CODES.get("+"):o=w.Op.PLUS;break;case T.CODES.get("?"):o=w.Op.QUEST}this.repeat(o,t,n,i,s,e);break}case T.CODES.get("{"):{let o=s.pos(),B=V.parseRepeat(s);if(B<0){s.rewindTo(o),this.literal(s.pop());break}i=o,t=B>>16,n=(B&j.MAX_BMP)<<16>>16,this.repeat(w.Op.REPEAT,t,n,i,s,e);break}case T.CODES.get("\\"):{let o=s.pos();if(s.skip(1),(this.flags&N.PERL_X)!==0&&s.more())switch(s.pop()){case T.CODES.get("A"):this.op(w.Op.BEGIN_TEXT);break e;case T.CODES.get("b"):this.op(w.Op.WORD_BOUNDARY);break e;case T.CODES.get("B"):this.op(w.Op.NO_WORD_BOUNDARY);break e;case T.CODES.get("C"):throw new ke(V.ERR_INVALID_ESCAPE,"\\C");case T.CODES.get("Q"):{let c=s.rest(),u=c.indexOf("\\E");u>=0?(c=c.substring(0,u),s.skipString(c),s.skipString("\\E")):s.skipString(c);let l=0;for(;l<c.length;){let C=c.codePointAt(l);this.literal(C),l+=J.charCount(C)}break e}case T.CODES.get("z"):this.op(w.Op.END_TEXT);break e;default:s.rewindTo(o)}else s.rewindTo(o);let B=this.newRegexp(w.Op.CHAR_CLASS);if(B.flags=this.flags,s.lookingAt("\\p")||s.lookingAt("\\P")){let c=new kn;if(this.parseUnicodeClass(s,c)){B.runes=c.toArray(),this.push(B);break e}}let a=new kn;if(this.parsePerlClassEscape(s,a)){B.runes=a.toArray(),this.push(B);break e}s.rewindTo(o),this.reuse(B),this.literal(V.parseEscape(s));break}default:this.literal(s.pop())}e=i}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length!==1)throw new ke(V.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(e){let t=e.pos(),n=e.rest();if(n.startsWith("(?P<")||n.startsWith("(?<")){let B=n.charAt(2)==="P"?4:3,a=n.indexOf(">");if(a<0)throw new ke(V.ERR_INVALID_NAMED_CAPTURE,n);let c=n.substring(B,a);if(e.skipString(c),e.skip(B+1),!V.isValidCaptureName(c))throw new ke(V.ERR_INVALID_NAMED_CAPTURE,n.substring(0,a+1));let u=this.op(w.Op.LEFT_PAREN);if(u.cap=++this.numCap,this.namedGroups[c])throw new ke(V.ERR_DUPLICATE_NAMED_CAPTURE,c);this.namedGroups[c]=this.numCap,u.name=c;return}e.skip(2);let s=this.flags,i=1,o=!1;e:for(;e.more();){let B=e.pop();switch(B){case T.CODES.get("i"):s|=N.FOLD_CASE,o=!0;break;case T.CODES.get("m"):s&=~N.ONE_LINE,o=!0;break;case T.CODES.get("s"):s|=N.DOT_NL,o=!0;break;case T.CODES.get("U"):s|=N.NON_GREEDY,o=!0;break;case T.CODES.get("-"):if(i<0)break e;i=-1,s=~s,o=!1;break;case T.CODES.get(":"):case T.CODES.get(")"):if(i<0){if(!o)break e;s=~s}B===T.CODES.get(":")&&this.op(w.Op.LEFT_PAREN),this.flags=s;return;default:break e}}throw new ke(V.ERR_INVALID_PERL_OP,e.from(t))}parsePosLookBehind(){let e=this.newRegexp(w.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=++this.nlb,this.push(e)}parseNegLookBehind(){let e=this.newRegexp(w.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=-++this.nlb,this.push(e)}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(w.Op.VERTICAL_BAR)}swapVerticalBar(){let e=this.stack.length;if(e>=3&&this.stack[e-2].op===w.Op.VERTICAL_BAR&&V.isCharClass(this.stack[e-1])&&V.isCharClass(this.stack[e-3])){let t=this.stack[e-1],n=this.stack[e-3];if(t.op>n.op){let s=n;n=t,t=s,this.stack[e-3]=n}return V.mergeCharClass(n,t),this.reuse(t),this.pop(),!0}if(e>=2){let t=this.stack[e-1],n=this.stack[e-2];if(n.op===w.Op.VERTICAL_BAR)return e>=3&&this.cleanAlt(this.stack[e-3]),this.stack[e-2]=t,this.stack[e-1]=n,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new ke(V.ERR_UNEXPECTED_PAREN,this.wholeRegexp);let e=this.pop(),t=this.pop();if(t.op!==w.Op.LEFT_PAREN)throw new ke(V.ERR_UNEXPECTED_PAREN,this.wholeRegexp);if(this.flags=t.flags,t.lb!==0){if(V.hasCapture(e))throw new ke(V.ERR_INVALID_CAPTURE_IN_LOOKBEHIND,this.wholeRegexp);t.lb>0?t.op=w.Op.PLB:t.op=w.Op.NLB,t.subs=[e],this.push(t);return}t.cap===0?this.push(e):(t.op=w.Op.CAPTURE,t.subs=[e],this.push(t))}parsePerlClassEscape(e,t){let n=e.pos();if((this.flags&N.PERL_X)===0||!e.more()||e.pop()!==T.CODES.get("\\")||!e.more())return!1;e.pop();let s=e.from(n),i=Wa.has(s)?Wa.get(s):null;return i===null?!1:(t.appendGroup(i,(this.flags&N.FOLD_CASE)!==0),!0)}parseNamedClass(e,t){let n=e.rest(),s=n.indexOf(":]");if(s<0)return!1;let i=n.substring(0,s+2);e.skipString(i);let o=cl.has(i)?cl.get(i):null;if(o===null)throw new ke(V.ERR_INVALID_CHAR_RANGE,i);return t.appendGroup(o,(this.flags&N.FOLD_CASE)!==0),!0}parseUnicodeClass(e,t){let n=e.pos();if((this.flags&N.UNICODE_GROUPS)===0||!e.lookingAt("\\p")&&!e.lookingAt("\\P"))return!1;e.skip(1);let s=1,i=e.pop();if(i===T.CODES.get("P")&&(s=-1),!e.more())throw e.rewindTo(n),new ke(V.ERR_INVALID_CHAR_RANGE,e.rest());i=e.pop();let o;if(i!==T.CODES.get("{"))o=J.runeToString(i);else{let u=e.rest(),l=u.indexOf("}");if(l<0)throw e.rewindTo(n),new ke(V.ERR_INVALID_CHAR_RANGE,e.rest());o=u.substring(0,l),e.skipString(o),e.skip(1)}o.length!==0&&o.codePointAt(0)===T.CODES.get("^")&&(s=0-s,o=o.substring(1));let B=V.unicodeTable(o);if(B===null)throw new ke(V.ERR_INVALID_CHAR_RANGE,e.from(n));B.sign<0&&(s=0-s);let a=B.tab,c=B.fold;if((this.flags&N.FOLD_CASE)===0||c===null)t.appendTableWithSign(a,s);else{let u=new kn().appendTable(a).appendTable(c).cleanClass().toArray();t.appendClassWithSign(Array.from(u),s)}return!0}parseClass(e){let t=e.pos();e.skip(1);let n=this.newRegexp(w.Op.CHAR_CLASS);n.flags=this.flags;let s=new kn,i=1;e.more()&&e.lookingAt("^")&&(i=-1,e.skip(1),(this.flags&N.CLASS_NL)===0&&s.appendRange(T.CODES.get(`
|
|
73
|
+
`),T.CODES.get(`
|
|
74
|
+
`)));let o=!0;for(;!e.more()||e.peek()!==T.CODES.get("]")||o;){if(e.more()&&e.lookingAt("-")&&(this.flags&N.PERL_X)===0&&!o){let u=e.rest();if(u==="-"||!u.startsWith("-]"))throw e.rewindTo(t),new ke(V.ERR_INVALID_CHAR_RANGE,e.rest())}o=!1;let B=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,s))continue;e.rewindTo(B)}if(this.parseUnicodeClass(e,s)||this.parsePerlClassEscape(e,s))continue;e.rewindTo(B);let a=V.parseClassChar(e,t),c=a;if(e.more()&&e.lookingAt("-")){if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(c=V.parseClassChar(e,t),c<a)throw new ke(V.ERR_INVALID_CHAR_RANGE,e.from(B))}(this.flags&N.FOLD_CASE)===0?s.appendRange(a,c):s.appendFoldedRange(a,c)}e.skip(1),s.cleanClass(),i<0&&s.negateClass(),n.runes=s.toArray(),this.push(n)}},EC=class vn{static initTest(e){let t=vn.compile(e),n=new vn(t.expr,t.prog,t.numSubexp,t.longest);return n.cond=t.cond,n.prefix=t.prefix,n.prefixUTF8=t.prefixUTF8,n.prefixComplete=t.prefixComplete,n.prefixRune=t.prefixRune,n.prefilter=t.prefilter,n}static compile(e){return vn.compileImpl(e,N.PERL,!1)}static compilePOSIX(e){return vn.compileImpl(e,N.POSIX,!0)}static compileImpl(e,t,n){let s=Gr.parse(e,t),i=s.maxCap(),o=s.namedGroups;s=kl.simplify(s);let B=hC.build(s),a=wl.compileRegexp(s),c=new vn(e,a,i,n);c.prefilter=B.type===ae.Type.NONE?null:B;let[u,l]=a.prefix();return c.prefixComplete=u,c.prefix=l,c.prefixUTF8=J.stringToUtf8ByteArray(c.prefix),c.prefix.length>0&&(c.prefixRune=c.prefix.codePointAt(0)),c.namedGroups=o,c}static match(e,t){return vn.compile(e).match(t)}constructor(e,t,n=0,s=0){this.expr=e,this.prog=t,this.numSubexp=n,this.longest=s,this.cond=t.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.machinePool=[],this.dfa=new So(this.prog),this.onepass=ja.compile(this.prog),this.prefilter=null}matchPrefixComplete(e,t,n,s){if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return null;let i=-1,o=-1,B=e.prefixLength(this);if(n===N.UNANCHORED){let a=e.index(this,t);if(a<0)return null;i=t+a,o=i+B}else if(n===N.ANCHOR_BOTH){if(e.endPos()!==B||e.index(this,0)!==0)return null;i=0,o=B}else if(n===N.ANCHOR_START){if(e.index(this,0)!==0)return null;i=0,o=B}if(i<0)return null;if(s>0){let a=new Int32Array(s).fill(-1);return a[0]=i,a[1]=o,Array.from(a)}return[]}createLookbehindState(){return this.prog.numLb>0?new rC(this.prog):null}executeEngine(e,t,n,s,i=null){if(this.prefixComplete&&(s===0||this.numSubexp===0))return this.matchPrefixComplete(e,t,n,s);if(this.prefilter!==null&&n===N.UNANCHORED&&!this.prefilter.eval(e,t))return null;if(this.onepass!==null)return ja.execute(this,e,t,n,s);if(s>0)return this.prog.numLb===0&&e.endPos()<=Qs.maxBitStateLen(this.prog)?Qs.execute(this,e,t,n,s):this.doExecuteNFA(e,t,n,s,i);if(this.prog.numLb===0){let o=this.dfa.match(e,t,n);if(o!==null)return o?[]:null;if(e.endPos()<=Qs.maxBitStateLen(this.prog))return Qs.execute(this,e,t,n,s)}return this.doExecuteNFA(e,t,n,s,i)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(e){this.machinePool.push(e)}toString(){return this.expr}doExecuteNFA(e,t,n,s,i=null){let o=this.get();o||(o=ml.fromRE2(this)),o.init(s);let B=o.match(e,t,n,i)?o.submatches():null;return this.put(o),B}match(e){return this.executeEngine(be.fromUTF16(e),0,N.UNANCHORED,0)!==null}matchWithGroup(e,t,n,s,i,o=null){return e instanceof yn||(J.isByteArray(e)?e=Sn.utf8(e):e=Sn.utf16(e)),this.matchMachineInput(e,t,n,s,i,o)}matchMachineInput(e,t,n,s,i,o=null){if(t>n)return[!1,null];let B=e.isUTF16Encoding()?be.fromUTF16(e.asCharSequence(),0,n):be.fromUTF8(e.asBytes(),0,n),a=this.executeEngine(B,t,s,2*i,o);return a===null?[!1,null]:[!0,a]}matchUTF8(e){return this.executeEngine(be.fromUTF8(e),0,N.UNANCHORED,0)!==null}replaceAll(e,t){return this.replaceAllFunc(e,()=>t,2*e.length+1)}replaceFirst(e,t){return this.replaceAllFunc(e,()=>t,1)}replaceAllFunc(e,t,n){let s=0,i=0,o="",B=be.fromUTF16(e),a=this.createLookbehindState(),c=0;for(;i<=e.length;){let u=this.executeEngine(B,i,N.UNANCHORED,2,a);if(u===null||u.length===0)break;o+=e.substring(s,u[0]),(u[1]>s||u[0]===0)&&(o+=t(e.substring(u[0],u[1])),c++),s=u[1];let l=B.step(i)&7;if(i+l>u[1]?i+=l:i+1>u[1]?i++:i=u[1],c>=n)break}return o+=e.substring(s),o}pad(e){if(e===null)return null;let t=(1+this.numSubexp)*2;if(e.length<t){let n=new Array(t).fill(-1);for(let s=0;s<e.length;s++)n[s]=e[s];e=n}return e}allMatches(e,t,n=s=>s){let s=[],i=e.endPos();t<0&&(t=i+1);let o=0,B=0,a=-1,c=this.createLookbehindState();for(;B<t&&o<=i;){let u=this.executeEngine(e,o,N.UNANCHORED,this.prog.numCap,c);if(u===null||u.length===0)break;let l=!0;if(u[1]===o){u[0]===a&&(l=!1);let C=e.step(o);C<0?o=i+1:o+=C&7}else o=u[1];a=u[1],l&&(s.push(n(this.pad(u))),B++)}return s}findUTF8(e){let t=this.executeEngine(be.fromUTF8(e),0,N.UNANCHORED,2);return t===null?null:e.slice(t[0],t[1])}findUTF8Index(e){let t=this.executeEngine(be.fromUTF8(e),0,N.UNANCHORED,2);return t===null?null:t.slice(0,2)}find(e){let t=this.executeEngine(be.fromUTF16(e),0,N.UNANCHORED,2);return t===null?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(be.fromUTF16(e),0,N.UNANCHORED,2)}findUTF8Submatch(e){let t=this.executeEngine(be.fromUTF8(e),0,N.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.slice(t[2*s],t[2*s+1]));return n}findUTF8SubmatchIndex(e){return this.pad(this.executeEngine(be.fromUTF8(e),0,N.UNANCHORED,this.prog.numCap))}findSubmatch(e){let t=this.executeEngine(be.fromUTF16(e),0,N.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.substring(t[2*s],t[2*s+1]));return n}findSubmatchIndex(e){return this.pad(this.executeEngine(be.fromUTF16(e),0,N.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){let n=this.allMatches(be.fromUTF8(e),t,s=>e.slice(s[0],s[1]));return n.length===0?null:n}findAllUTF8Index(e,t){let n=this.allMatches(be.fromUTF8(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAll(e,t){let n=this.allMatches(be.fromUTF16(e),t,s=>e.substring(s[0],s[1]));return n.length===0?null:n}findAllIndex(e,t){let n=this.allMatches(be.fromUTF16(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAllUTF8Submatch(e,t){let n=this.allMatches(be.fromUTF8(e),t,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=e.slice(s[2*o],s[2*o+1]));return i});return n.length===0?null:n}findAllUTF8SubmatchIndex(e,t){let n=this.allMatches(be.fromUTF8(e),t);return n.length===0?null:n}findAllSubmatch(e,t){let n=this.allMatches(be.fromUTF16(e),t,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=e.substring(s[2*o],s[2*o+1]));return i});return n.length===0?null:n}findAllSubmatchIndex(e,t){let n=this.allMatches(be.fromUTF16(e),t);return n.length===0?null:n}},Jp=class Vs{static UNANCHORED=N.UNANCHORED;static ANCHOR_START=N.ANCHOR_START;static ANCHOR_BOTH=N.ANCHOR_BOTH;constructor(e=Vs.UNANCHORED,t=0,n=8388608){this.anchor=e,this.jsFlags=t,this.maxMem=n;let s=N.PERL;(t&Ot.DISABLE_UNICODE_GROUPS)!==0&&(s&=~N.UNICODE_GROUPS),(t&Ot.LOOKBEHINDS)!==0&&(s|=N.LOOKBEHIND),this.re2Flags=s,this.regexps=[],this.prog=null,this.dfa=null,this.dummyRe2=null}add(e){if(this.prog)throw new Hr("Cannot add patterns after compile");let t=e;(this.jsFlags&Ot.CASE_INSENSITIVE)!==0&&(t=`(?i)${t}`),(this.jsFlags&Ot.DOTALL)!==0&&(t=`(?s)${t}`),(this.jsFlags&Ot.MULTILINE)!==0&&(t=`(?m)${t}`);let n=Gr.parse(t,this.re2Flags);return this.regexps.push(kl.simplify(n)),this.regexps.length-1}compile(){if(this.prog)return;let e=wl.compileSet(this.regexps);if(e.numInst()>Gr.MAX_SIZE)throw new Hr(`${Gr.ERR_LARGE}: the set compiles to ${e.numInst()} instructions, more than ${Gr.MAX_SIZE}`);this.prog=e,this.dfa=new So(this.prog,this.maxMem),this.dummyRe2={prog:this.prog,cond:this.prog.startCond(),prefix:"",prefixRune:0,longest:!1}}match(e){this.prog||this.compile();let t=J.isByteArray(e)?be.fromUTF8(e):be.fromUTF16(e),n=N.UNANCHORED;this.anchor===Vs.ANCHOR_START?n=N.ANCHOR_START:this.anchor===Vs.ANCHOR_BOTH&&(n=N.ANCHOR_BOTH);let s=this.dfa.matchSet(t,0,n);if(s!==null)return s;let i=ml.fromRE2(this.dummyRe2);return i.init(0),i.matchSet(t,0,n)}},DC=class nr{static isHexadecimal(e){return"0"<=e&&e<="9"||"A"<=e&&e<="F"||"a"<=e&&e<="f"}static translate(e){let t="";if(e instanceof RegExp&&(e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e=e.source),typeof e!="string")return e;let n="",s=!1,i=e.length;i===0&&(n="(?:)",s=!0);let o=!1,B=0;for(;B<i;){let c=e[B];if(c==="\\"){if(B+1<i)switch(c=e[B+1],c){case"\\":n+="\\\\",B+=2;continue;case"c":if(B+2<i){let C=e[B+2].charCodeAt(0);if(C>=65&&C<=90||C>=97&&C<=122){let f=C%32;n+="\\x",n+=(f>>4).toString(16).toUpperCase(),n+=(f&15).toString(16).toUpperCase(),B+=3,s=!0;continue}}n+="c",B+=2,s=!0;continue;case"u":if(B+2<i){if(e[B+2]==="{"){let C=B+3,f=!1,h=!1;for(;C<i;){let d=e[C];if(d==="}"){h=!0;break}if(!nr.isHexadecimal(d))break;f=!0,C++}if(h&&f){n+="\\x",B+=2,s=!0;continue}}else if(B+5<i){let C=!0;for(let f=0;f<4;f++)if(!nr.isHexadecimal(e[B+2+f])){C=!1;break}if(C){n+="\\x{"+e.substring(B+2,B+6)+"}",B+=6,s=!0;continue}}}n+="u",B+=2,s=!0;continue;case"x":{let C=!1;if(B+2<i&&e[B+2]==="{"){let f=B+3,h=!1,d=!1;for(;f<i;){let x=e[f];if(x==="}"){d=!0;break}if(!nr.isHexadecimal(x))break;h=!0,f++}d&&h&&(C=!0)}else B+3<i&&nr.isHexadecimal(e[B+2])&&nr.isHexadecimal(e[B+3])&&(C=!0);C?(n+="\\x",B+=2):(n+="x",B+=2,s=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":n+="\\"+c,B+=2;continue;default:{let C=e.codePointAt(B+1);if(C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122){let f=J.charCount(C);n+=e.substring(B+1,B+1+f),B+=f+1,s=!0}else{n+="\\";let f=J.charCount(C);n+=e.substring(B+1,B+1+f),B+=f+1}continue}}}else if(c==="/"){n+="\\/",B+=1,s=!0;continue}else if(c==="[")o=!0;else if(c==="]")o=!1;else if(!o&&c==="("&&B+2<i&&e[B+1]==="?"&&e[B+2]==="<"&&B+3<i&&!"=!>)".includes(e[B+3])){n+="(?P<",B+=3,s=!0;continue}let u=e.codePointAt(B),l=J.charCount(u);n+=e.substring(B,B+l),B+=l}let a=s?n:e;return t.length>0?`(?${t})${a}`:a}},rr=class Qe{static CASE_INSENSITIVE=Ot.CASE_INSENSITIVE;static DOTALL=Ot.DOTALL;static MULTILINE=Ot.MULTILINE;static DISABLE_UNICODE_GROUPS=Ot.DISABLE_UNICODE_GROUPS;static LONGEST_MATCH=Ot.LONGEST_MATCH;static LOOKBEHINDS=Ot.LOOKBEHINDS;static quote(e){return J.quoteMeta(e)}static quoteReplacement(e,t=!1){return Pa.quoteReplacement(e,t)}static translateRegExp(e){return DC.translate(e)}static compile(e,t=0){let n=e;if((t&Qe.CASE_INSENSITIVE)!==0&&(n=`(?i)${n}`),(t&Qe.DOTALL)!==0&&(n=`(?s)${n}`),(t&Qe.MULTILINE)!==0&&(n=`(?m)${n}`),(t&~(Qe.MULTILINE|Qe.DOTALL|Qe.CASE_INSENSITIVE|Qe.DISABLE_UNICODE_GROUPS|Qe.LONGEST_MATCH|Qe.LOOKBEHINDS))!==0)throw new nC("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let s=N.PERL;(t&Qe.DISABLE_UNICODE_GROUPS)!==0&&(s&=~N.UNICODE_GROUPS),(t&Qe.LOOKBEHINDS)!==0&&(s|=N.LOOKBEHIND);let i=new Qe(e,t);return i.re2Input=EC.compileImpl(n,s,(t&Qe.LONGEST_MATCH)!==0),i}static matches(e,t){return Qe.compile(e).testExact(t)}static initTest(e,t,n){if(e==null)throw new Error("pattern is null");if(n==null)throw new Error("re2 is null");let s=new Qe(e,t);return s.re2Input=n,s}constructor(e,t){this.patternInput=e,this.flagsInput=t,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.testExact(e)}matcher(e){return J.isByteArray(e)&&(e=Sn.utf8(e)),new Pa(this,e)}test(e){return J.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){let t=J.isByteArray(e)?be.fromUTF8(e):be.fromUTF16(e);return this.re2Input.executeEngine(t,0,N.ANCHOR_BOTH,0)!==null}exec(e){let t=this.matcher(e);if(!t.find())return null;let n=[t.group(0)];for(let i=1;i<=t.groupCount();i++){let o=t.group(i);n.push(o===null?void 0:o)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let i=t.getNamedGroups();for(let o in i)i[o]===null&&(i[o]=void 0);n.groups=i}else n.groups=void 0;return n}split(e,t=0){let n=this.matcher(e),s=[],i=0,o=0;for(;n.find();){if(o===0&&n.end()===0){o=n.end();continue}if(t>0&&s.length===t-1)break;if(o===n.start()){if(t===0){i+=1,o=n.end();continue}}else for(;i>0;)s.push(""),i-=1;s.push(n.substring(o,n.start())),o=n.end()}if(t===0&&o!==n.inputLength()){for(;i>0;)s.push(""),i-=1;s.push(n.substring(o,n.inputLength()))}return(t!==0||s.length===0&&!(o===n.inputLength()&&o>0))&&s.push(n.substring(o,n.inputLength())),s}*matchAll(e){let t=this.matcher(e);for(;t.find();){let n=[t.group(0)];for(let i=1;i<=t.groupCount();i++){let o=t.group(i);n.push(o===null?void 0:o)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let i=t.getNamedGroups();for(let o in i)i[o]===null&&(i[o]=void 0);n.groups=i}else n.groups=void 0;yield n}}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e?!0:e===null||this.constructor!==e.constructor?!1:this.flagsInput===e.flagsInput&&this.patternInput===e.patternInput}};var xl="kubectl config current-context",bC=/^[A-Za-z0-9][A-Za-z0-9._:@/+-]*$/;function vl(r){return r.length<=253&&bC.test(r)}var wC=/^\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}$/;function On(r){return r===void 0?void 0:wC.exec(r)?.[1]}function Zs(r){return vl(r)||On(r)!==void 0}function Ur(r,e){return r.kubeContext??e?.kubeContext}function Xs(r,e){let t=On(r);if(t===void 0)return r;let n=e(t);if(n===void 0)throw new Error(`md-runbook: kube-context \${param:${t}} has no value: nothing ran`);if(!vl(n))throw new Error(`md-runbook: kube-context \${param:${t}} is ${JSON.stringify(n)}, which is not a Kubernetes context name: nothing ran`);return n}function Sl(r){let e=On(r);return e===void 0?"":`\${param:${e}}`}function kC(r,e){let t=e.stdout.split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");if(e.exitCode===0&&t===r)return;let n=`md-runbook: this runbook is for the Kubernetes context ${r}`;if(e.exitCode===0&&t!==void 0)return`${n}, and kubectl's current context is ${t}: nothing ran. Switch with \`kubectl config use-context ${r}\`, or open the runbook meant for ${t}.`;let s=(e.stderr??"").split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");return`${n}, and \`${xl}\` ${s?`failed (${s})`:"named no context"}: nothing ran.`}async function yl(r,e,t=!1){if(r===void 0)return;let n;try{n=await e(t?Fl(r):xl)}catch(s){n={exitCode:null,stdout:"",stderr:s instanceof Error?s.message:String(s)}}return t?xC(r,n):kC(r,n)}var Ol=["check","pin"];function Al(r){return`# md-runbook: the Kubernetes context of a runbook with kube-context-mode: pin.
|
|
74
75
|
# Only the current context is here; clusters, users and credentials come from your own kubeconfig.
|
|
75
76
|
apiVersion: v1
|
|
76
77
|
kind: Config
|
|
@@ -79,76 +80,84 @@ clusters: []
|
|
|
79
80
|
contexts: []
|
|
80
81
|
users: []
|
|
81
82
|
current-context: ${JSON.stringify(r)}
|
|
82
|
-
`}function
|
|
83
|
+
`}function Rl(r,e,t){return r+(t==="win32"?";":":")+e}function Fl(r){return`kubectl config get-contexts ${r}`}function xC(r,e){let t=e.stdout.split(/\r?\n/).map(i=>i.trim().split(/\s+/));if(e.exitCode===0&&t.some(i=>i[0]==="*"&&i[1]===r))return;let n=`md-runbook: this runbook pins the Kubernetes context ${r}`;if(e.exitCode===0&&t.some(i=>i[0]===r))return`${n}, and kubectl's current context in the cell is another one (does KUBECONFIG change before kubectl runs?): nothing ran.`;let s=(e.stderr??"").split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");return s!==void 0&&/\bcontext\b.*\bnot found\b/i.test(s)?`${n}, and your kubeconfig has no context ${r} (${s}): nothing ran. \`kubectl config get-contexts\` lists the ones you have.`:`${n}, and \`${Fl(r)}\` ${s?`failed (${s})`:"did not list it"}: nothing ran.`}var At=/^[A-Za-z_][A-Za-z0-9_]*$/,Ao=/\$\{(secret|input|param|out):([A-Za-z_][A-Za-z0-9_]*)(:secret)?\}/g;function vC(r){return/_(PASSWORD|TOKEN|SECRET)$/i.test(r)}function st(r){let e=new Map;for(let t of r.matchAll(Ao)){let n=t[1],s=t[2];if(t[3]&&n!=="input")continue;let i=n==="secret"||n==="input"&&(!!t[3]||vC(s)),o=e.get(s);if(o&&o.kind!==n)throw new Error(`${s} is referenced as both ${o.kind} and ${n}`);o?o.secret||=i:e.set(s,{kind:n,name:s,secret:i})}return[...e.values()]}function An(r,e){return r.replace(Ao,(t,n,s,i)=>i&&n!=="input"?t:e(n,s))}function SC(r,e){switch(e){case"bash":return"${"+r+"}";case"pwsh":return"${env:"+r+"}";case"cmd":return"!"+r+"!"}}var yC="@setlocal EnableDelayedExpansion";function sr(r,e){let t=!1,n=r.replace(Ao,(i,o,B,a)=>a&&o!=="input"?i:(t=!0,SC(B,e)));if(e!=="cmd"||!t)return n;let s=/\r\n/.test(r)?`\r
|
|
83
84
|
`:`
|
|
84
|
-
`;return
|
|
85
|
-
`)}function
|
|
86
|
-
`);function
|
|
87
|
-
`))}function
|
|
88
|
-
`).trim().replace(/^\*\*[^*]*:\*\*\s*/,""),B=pB.includes(n.milestone??"")?n.milestone:void 0;e.push({at:n.at,kind:"note",text:s,...n.by?{by:n.by}:{},...B?{milestone:B}:{}})}return e}var Sc=(r,e)=>e==="failed"||r!==void 0&&!["0","done","skipped","running","proposed","declined"].includes(r)&&e!=="ok";function zo(r,e,t,n,s){if(!r.ran||Number.isNaN(Date.parse(r.ran)))return;let B=r.exit==="done"||r.exit==="skipped",i=s===void 0?[]:jo(s);return{at:r.ran,kind:B&&r.duration===void 0?"mark":"run",step:e,label:t,...r.by?{by:r.by}:{},...r.on?{on:r.on}:{},...r.exit!==void 0?{exit:r.exit}:{},...r.check?{check:r.check}:{},ok:!Sc(r.exit,r.check),...r.duration?{duration:r.duration}:{},...n?{earlier:!0}:{},...i.length?{checks:i}:{}}}var Vr=(r,e)=>Math.max(0,Math.round((Date.parse(e)-Date.parse(r))/1e3));function Zr(r){let e=et(r),t=[],n=Ce(r),s=n.cells.map(C=>le(C.meta)?de(C.meta.info):void 0),B=kt(n.cells.map((C,d)=>le(C.meta)?{kind:"code",os:s[d]?.os}:{kind:"markup"}));for(let[C,d]of n.cells.entries()){let h=B[C];if(h===void 0||!le(d.meta))continue;let k=s[C]?.name??d.value.split(/\r?\n/).find(E=>E.trim()!=="")?.trim()??`step ${h}`,R=Ko(d.value);if(d.output){let E=zo(d.output.attrs,h,k,!1,R?d.output.text:void 0);E&&t.push(E)}for(let E of d.meta.history?.entries??[]){let S=zo(E.attrs,h,k,!0,R?E.text:void 0);S&&t.push(S)}}t.push(...vc(r)),t.sort((C,d)=>Date.parse(C.at)-Date.parse(d.at)||(C.step??0)-(d.step??0));let i={};for(let C of t)C.milestone&&!i[C.milestone]&&(i[C.milestone]=C.at);let o=t.filter(C=>C.kind==="run"),a=t[0]?.at,c=t[t.length-1]?.at,u=i.detected??a,l={...e?.incident?{incident:e.incident}:{},...e?.severity?{severity:e.severity}:{},...e?.drill?{drill:!0}:{},...a?{start:a}:{},...c?{end:c}:{},...a&&c?{durationSeconds:Vr(a,c)}:{},runs:o.length,failedAttempts:o.filter(C=>!C.ok).length,milestones:i,...u&&i.mitigated?{timeToMitigateSeconds:Vr(u,i.mitigated)}:{},...u&&i.resolved?{timeToResolveSeconds:Vr(u,i.resolved)}:{},people:[...new Set(t.flatMap(C=>C.by?[C.by]:[]))],places:[...new Set(t.flatMap(C=>C.on?[C.on]:[]))]},f=t.flatMap(C=>C.earlier?[]:C.checks??[]);if(f.length&&(l.endpointChecks={total:f.length,failed:f.filter(C=>!C.ok).length}),e?.rtoSeconds!==void 0){l.rtoSeconds=e.rtoSeconds;let C=i.resolved??c;a&&C&&(l.rtoMet=Vr(a,C)<=e.rtoSeconds)}return{events:t,summary:l}}function Wn(r){let e=Math.floor(r/3600),t=Math.floor(r%3600/60),n=r%60;return[e?`${e} h`:"",t?`${t} min`:"",n||!e&&!t?`${n} s`:""].filter(Boolean).join(" ")}var Oc=100;function Yo(r,e,t=!1){return!t&&!et(r)?.evidence?{}:{...e.by?{by:e.by}:{},...e.on?{on:e.on}:{}}}function Qo(r,e){return et(r)?.evidence?Math.max(e,Oc):e}var Zo=require("module"),Ac=(0,Zo.createRequire)("/"),Rc;try{Rc=Ac("worker_threads").Worker}catch{}var we=Uint8Array,Je=Uint16Array,kB=Int32Array,Xr=new we([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),es=new we([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),DB=new we([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xo=function(r,e){for(var t=new Je(31),n=0;n<31;++n)t[n]=e+=1<<r[n-1];for(var s=new kB(t[30]),n=1;n<30;++n)for(var B=t[n];B<t[n+1];++B)s[B]=B-t[n]<<5|n;return{b:t,r:s}},ea=Xo(Xr,2),ta=ea.b,bB=ea.r;ta[28]=258,bB[258]=28;var na=Xo(es,0),yc=na.b,qo=na.r,wB=new Je(32768);for(oe=0;oe<32768;++oe)dt=(oe&43690)>>1|(oe&21845)<<1,dt=(dt&52428)>>2|(dt&13107)<<2,dt=(dt&61680)>>4|(dt&3855)<<4,wB[oe]=((dt&65280)>>8|(dt&255)<<8)>>1;var dt,oe,lt=(function(r,e,t){for(var n=r.length,s=0,B=new Je(e);s<n;++s)r[s]&&++B[r[s]-1];var i=new Je(e);for(s=1;s<e;++s)i[s]=i[s-1]+B[s-1]<<1;var o;if(t){o=new Je(1<<e);var a=15-e;for(s=0;s<n;++s)if(r[s])for(var c=s<<4|r[s],u=e-r[s],l=i[r[s]-1]++<<u,f=l|(1<<u)-1;l<=f;++l)o[wB[l]>>a]=c}else for(o=new Je(n),s=0;s<n;++s)r[s]&&(o[s]=wB[i[r[s]-1]++]>>15-r[s]);return o}),vt=new we(288);for(oe=0;oe<144;++oe)vt[oe]=8;var oe;for(oe=144;oe<256;++oe)vt[oe]=9;var oe;for(oe=256;oe<280;++oe)vt[oe]=7;var oe;for(oe=280;oe<288;++oe)vt[oe]=8;var oe,er=new we(32);for(oe=0;oe<32;++oe)er[oe]=5;var oe,Fc=lt(vt,9,0),Ic=lt(vt,9,1),Tc=lt(er,5,0),Lc=lt(er,5,1),gB=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},tt=function(r,e,t){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&t},mB=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},vB=function(r){return(r+7)/8|0},Xn=function(r,e,t){return(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length),new we(r.subarray(e,t))};var Nc=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],nt=function(r,e,t){var n=new Error(e||Nc[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,nt),!t)throw n;return n},$c=function(r,e,t,n){var s=r.length,B=n?n.length:0;if(!s||e.f&&!e.l)return t||new we(0);var i=!t,o=i||e.i!=2,a=e.i;i&&(t=new we(s*3));var c=function(j){var U=t.length;if(j>U){var ne=new we(Math.max(U*2,j));ne.set(t),t=ne}},u=e.f||0,l=e.p||0,f=e.b||0,C=e.l,d=e.d,h=e.m,k=e.n,R=s*8;do{if(!C){u=tt(r,l,1);var E=tt(r,l+1,3);if(l+=3,E)if(E==1)C=Ic,d=Lc,h=9,k=5;else if(E==2){var O=tt(r,l,31)+257,$=tt(r,l+10,15)+4,b=O+tt(r,l+5,31)+1;l+=14;for(var m=new we(b),G=new we(19),T=0;T<$;++T)G[DB[T]]=tt(r,l+T*3,7);l+=$*3;for(var H=gB(G),Q=(1<<H)-1,z=lt(G,H,1),T=0;T<b;){var q=z[tt(r,l,Q)];l+=q&15;var S=q>>4;if(S<16)m[T++]=S;else{var V=0,ee=0;for(S==16?(ee=3+tt(r,l,3),l+=2,V=m[T-1]):S==17?(ee=3+tt(r,l,7),l+=3):S==18&&(ee=11+tt(r,l,127),l+=7);ee--;)m[T++]=V}}var Be=m.subarray(0,O),te=m.subarray(O);h=gB(Be),k=gB(te),C=lt(Be,h,1),d=lt(te,k,1)}else nt(1);else{var S=vB(l)+4,w=r[S-4]|r[S-3]<<8,y=S+w;if(y>s){a&&nt(0);break}o&&c(f+w),t.set(r.subarray(S,y),f),e.b=f+=w,e.p=l=y*8,e.f=u;continue}if(l>R){a&&nt(0);break}}o&&c(f+131072);for(var De=(1<<h)-1,pe=(1<<k)-1,$e=l;;$e=l){var V=C[mB(r,l)&De],he=V>>4;if(l+=V&15,l>R){a&&nt(0);break}if(V||nt(2),he<256)t[f++]=he;else if(he==256){$e=l,C=null;break}else{var ke=he-254;if(he>264){var T=he-257,x=Xr[T];ke=tt(r,l,(1<<x)-1)+ta[T],l+=x}var v=d[mB(r,l)&pe],A=v>>4;v||nt(3),l+=v&15;var te=yc[A];if(A>3){var x=es[A];te+=mB(r,l)&(1<<x)-1,l+=x}if(l>R){a&&nt(0);break}o&&c(f+131072);var N=f+ke;if(f<te){var F=B-te,P=Math.min(te,N);for(F+f<0&&nt(3);f<P;++f)t[f]=n[F+f]}for(;f<N;++f)t[f]=t[f-te]}}e.l=C,e.p=$e,e.b=f,e.f=u,C&&(u=1,e.m=h,e.d=d,e.n=k)}while(!u);return f!=t.length&&i?Xn(t,0,f):t.subarray(0,f)},pt=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8},Vn=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8,r[n+2]|=t>>16},EB=function(r,e){for(var t=[],n=0;n<r.length;++n)r[n]&&t.push({s:n,f:r[n]});var s=t.length,B=t.slice();if(!s)return{t:sa,l:0};if(s==1){var i=new we(t[0].s+1);return i[t[0].s]=1,{t:i,l:1}}t.sort(function(y,O){return y.f-O.f}),t.push({s:-1,f:25001});var o=t[0],a=t[1],c=0,u=1,l=2;for(t[0]={s:-1,f:o.f+a.f,l:o,r:a};u!=s-1;)o=t[t[c].f<t[l].f?c++:l++],a=t[c!=u&&t[c].f<t[l].f?c++:l++],t[u++]={s:-1,f:o.f+a.f,l:o,r:a};for(var f=B[0].s,n=1;n<s;++n)B[n].s>f&&(f=B[n].s);var C=new Je(f+1),d=xB(t[u-1],C,0);if(d>e){var n=0,h=0,k=d-e,R=1<<k;for(B.sort(function(O,$){return C[$.s]-C[O.s]||O.f-$.f});n<s;++n){var E=B[n].s;if(C[E]>e)h+=R-(1<<d-C[E]),C[E]=e;else break}for(h>>=k;h>0;){var S=B[n].s;C[S]<e?h-=1<<e-C[S]++-1:++n}for(;n>=0&&h;--n){var w=B[n].s;C[w]==e&&(--C[w],++h)}d=e}return{t:new we(C),l:d}},xB=function(r,e,t){return r.s==-1?Math.max(xB(r.l,e,t+1),xB(r.r,e,t+1)):e[r.s]=t},Wo=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new Je(++e),n=0,s=r[0],B=1,i=function(a){t[n++]=a},o=1;o<=e;++o)if(r[o]==s&&o!=e)++B;else{if(!s&&B>2){for(;B>138;B-=138)i(32754);B>2&&(i(B>10?B-11<<5|28690:B-3<<5|12305),B=0)}else if(B>3){for(i(s),--B;B>6;B-=6)i(8304);B>2&&(i(B-3<<5|8208),B=0)}for(;B--;)i(s);B=1,s=r[o]}return{c:t.subarray(0,n),n:e}},Zn=function(r,e){for(var t=0,n=0;n<e.length;++n)t+=r[n]*e[n];return t},ra=function(r,e,t){var n=t.length,s=vB(e+2);r[s]=n&255,r[s+1]=n>>8,r[s+2]=r[s]^255,r[s+3]=r[s+1]^255;for(var B=0;B<n;++B)r[s+B+4]=t[B];return(s+4+n)*8},Vo=function(r,e,t,n,s,B,i,o,a,c,u){pt(e,u++,t),++s[256];for(var l=EB(s,15),f=l.t,C=l.l,d=EB(B,15),h=d.t,k=d.l,R=Wo(f),E=R.c,S=R.n,w=Wo(h),y=w.c,O=w.n,$=new Je(19),b=0;b<E.length;++b)++$[E[b]&31];for(var b=0;b<y.length;++b)++$[y[b]&31];for(var m=EB($,7),G=m.t,T=m.l,H=19;H>4&&!G[DB[H-1]];--H);var Q=c+5<<3,z=Zn(s,vt)+Zn(B,er)+i,q=Zn(s,f)+Zn(B,h)+i+14+3*H+Zn($,G)+2*$[16]+3*$[17]+7*$[18];if(a>=0&&Q<=z&&Q<=q)return ra(e,u,r.subarray(a,a+c));var V,ee,Be,te;if(pt(e,u,1+(q<z)),u+=2,q<z){V=lt(f,C,0),ee=f,Be=lt(h,k,0),te=h;var De=lt(G,T,0);pt(e,u,S-257),pt(e,u+5,O-1),pt(e,u+10,H-4),u+=14;for(var b=0;b<H;++b)pt(e,u+3*b,G[DB[b]]);u+=3*H;for(var pe=[E,y],$e=0;$e<2;++$e)for(var he=pe[$e],b=0;b<he.length;++b){var ke=he[b]&31;pt(e,u,De[ke]),u+=G[ke],ke>15&&(pt(e,u,he[b]>>5&127),u+=he[b]>>12)}}else V=Fc,ee=vt,Be=Tc,te=er;for(var b=0;b<o;++b){var x=n[b];if(x>255){var ke=x>>18&31;Vn(e,u,V[ke+257]),u+=ee[ke+257],ke>7&&(pt(e,u,x>>23&31),u+=Xr[ke]);var v=x&31;Vn(e,u,Be[v]),u+=te[v],v>3&&(Vn(e,u,x>>5&8191),u+=es[v])}else Vn(e,u,V[x]),u+=ee[x]}return Vn(e,u,V[256]),u+ee[256]},Mc=new kB([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sa=new we(0),Gc=function(r,e,t,n,s,B){var i=B.z||r.length,o=new we(n+i+5*(1+Math.ceil(i/7e3))+s),a=o.subarray(n,o.length-s),c=B.l,u=(B.r||0)&7;if(e){u&&(a[0]=B.r>>3);for(var l=Mc[e-1],f=l>>13,C=l&8191,d=(1<<t)-1,h=B.p||new Je(32768),k=B.h||new Je(d+1),R=Math.ceil(t/3),E=2*R,S=function(ce){return(r[ce]^r[ce+1]<<R^r[ce+2]<<E)&d},w=new kB(25e3),y=new Je(288),O=new Je(32),$=0,b=0,m=B.i||0,G=0,T=B.w||0,H=0;m+2<i;++m){var Q=S(m),z=m&32767,q=k[Q];if(h[z]=q,k[Q]=z,T<=m){var V=i-m;if(($>7e3||G>24576)&&(V>423||!c)){u=Vo(r,a,0,w,y,O,b,G,H,m-H,u),G=$=b=0,H=m;for(var ee=0;ee<286;++ee)y[ee]=0;for(var ee=0;ee<30;++ee)O[ee]=0}var Be=2,te=0,De=C,pe=z-q&32767;if(V>2&&Q==S(m-pe))for(var $e=Math.min(f,V)-1,he=Math.min(32767,m),ke=Math.min(258,V);pe<=he&&--De&&z!=q;){if(r[m+Be]==r[m+Be-pe]){for(var x=0;x<ke&&r[m+x]==r[m+x-pe];++x);if(x>Be){if(Be=x,te=pe,x>$e)break;for(var v=Math.min(pe,x-2),A=0,ee=0;ee<v;++ee){var N=m-pe+ee&32767,F=h[N],P=N-F&32767;P>A&&(A=P,q=N)}}}z=q,q=h[z],pe+=z-q&32767}if(te){w[G++]=268435456|bB[Be]<<18|qo[te];var j=bB[Be]&31,U=qo[te]&31;b+=Xr[j]+es[U],++y[257+j],++O[U],T=m+Be,++$}else w[G++]=r[m],++y[r[m]]}}for(m=Math.max(m,T);m<i;++m)w[G++]=r[m],++y[r[m]];u=Vo(r,a,c,w,y,O,b,G,H,m-H,u),c||(B.r=u&7|a[u/8|0]<<3,u-=7,B.h=k,B.p=h,B.i=m,B.w=T)}else{for(var m=B.w||0;m<i+c;m+=65535){var ne=m+65535;ne>=i&&(a[u/8|0]=c,ne=i),u=ra(a,u+1,r.subarray(m,ne))}B.i=i}return Xn(o,0,n+vB(u)+s)};var Hc=function(r,e,t,n,s){if(!s&&(s={l:1},e.dictionary)){var B=e.dictionary.subarray(-32768),i=new we(B.length+r.length);i.set(B),i.set(r,B.length),r=i,s.w=B.length}return Gc(r,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,n,s)};function Ba(r,e){return Hc(r,e||{},0,0)}var ia=(function(){function r(e,t){typeof e=="function"&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new we(32768),this.p=new we(0),n&&this.o.set(n)}return r.prototype.e=function(e){if(this.ondata||nt(5),this.d&&nt(4),!this.p.length)this.p=e;else if(e.length){var t=new we(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},r.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=$c(this.p,this.s,this.o);this.ondata(Xn(n,t,this.s.b),this.d),this.o=Xn(n,this.s.b-32768),this.s.b=this.o.length,this.p=Xn(this.p,this.s.p/8|0),this.s.p&=7},r.prototype.push=function(e,t){this.e(e),this.c(t)},r})();var Pc=typeof TextDecoder<"u"&&new TextDecoder,_c=0;try{Pc.decode(sa,{stream:!0}),_c=1}catch{}var Jc=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ut=(r,e)=>r>>>e|r<<32-e;function oa(r){return Array.from(Uc(new TextEncoder().encode(r)),e=>e.toString(16).padStart(8,"0")).join("")}function Uc(r){let e=r.length*8,t=new Uint8Array(r.length+9+63>>6<<6);t.set(r),t[r.length]=128;let n=new DataView(t.buffer);n.setUint32(t.length-8,Math.floor(e/4294967296)),n.setUint32(t.length-4,e>>>0);let s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),B=new Uint32Array(64);for(let i=0;i<t.length;i+=64){for(let h=0;h<16;h++)B[h]=n.getUint32(i+h*4);for(let h=16;h<64;h++){let k=ut(B[h-15],7)^ut(B[h-15],18)^B[h-15]>>>3,R=ut(B[h-2],17)^ut(B[h-2],19)^B[h-2]>>>10;B[h]=B[h-16]+k+B[h-7]+R>>>0}let[o,a,c,u,l,f,C,d]=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];for(let h=0;h<64;h++){let k=ut(l,6)^ut(l,11)^ut(l,25),R=l&f^~l&C,E=d+k+R+Jc[h]+B[h]>>>0,S=ut(o,2)^ut(o,13)^ut(o,22),w=o&a^o&c^a&c,y=S+w>>>0;d=C,C=f,f=l,l=u+E>>>0,u=c,c=a,a=o,o=E+y>>>0}s[0]=s[0]+o>>>0,s[1]=s[1]+a>>>0,s[2]=s[2]+c>>>0,s[3]=s[3]+u>>>0,s[4]=s[4]+l>>>0,s[5]=s[5]+f>>>0,s[6]=s[6]+C>>>0,s[7]=s[7]+d>>>0}return s}var ts=/[ \t]/,aa=/[A-Za-z0-9_]/,Kc=/^[ \t]*(function[ \t]+[^\s()]+([ \t]*\([ \t]*\))?|[^\s()=;&|<>]+[ \t]*\([ \t]*\))[ \t]*$/;function jc(r,e){let t=e,n=r[t]==="-";for(n&&t++;t<r.length&&ts.test(r[t]);)t++;let s="";for(;t<r.length&&!/[\s;&|<>()]/.test(r[t]);){let B=r[t];if(B==="'"||B==='"'){let i=r.indexOf(B,t+1);if(i<0)return;let o=r.slice(t+1,i);s+=B==='"'?o.replace(/\\([\\"$`])/g,"$1"):o,t=i+1}else B==="\\"?(s+=r[t+1]??"",t+=2):(s+=B,t++)}return s===""?void 0:{word:s,strip:n,end:t}}var SB=class{quote="";stack=[];heredocs=[];inHeredoc=!1;cont=!1;open(){return this.quote!==""||this.stack.length>0||this.heredocs.length>0||this.cont}line(e){if(this.inHeredoc){let o=this.heredocs[0];return(o.strip?e.replace(/^\t+/,""):e)===o.word&&this.heredocs.shift(),this.inHeredoc=this.heredocs.length>0,!0}this.cont=!1;let t=this.quote!=="",n=this.quote==="",s="",B=e.length,i=0;for(;i<B;){let o=e[i];if(this.quote==="'"||this.quote==="$'"){o==="\\"&&this.quote==="$'"?i++:o==="'"&&(this.quote=""),i++;continue}if(this.quote==='"'||this.quote==="`"){o==="\\"?(i===B-1&&(this.cont=!0),i++):o===this.quote&&(this.quote=""),i++;continue}if(ts.test(o)){i++;continue}if(o==="#"&&(i===0||/[\s;&|()]/.test(e[i-1])))break;if(t=!0,o==="\\"){i===B-1&&(this.cont=!0),s="",n=!1,i+=2;continue}if(o==="'"||o==='"'||o==="`")this.quote=o;else if(o==="$"&&e[i+1]==="'")this.quote="$'",i++;else if(o==="<"&&e.startsWith("<<",i)&&e[i+2]!=="<"){let a=jc(e,i+2);if(a){this.heredocs.push({word:a.word,strip:a.strip}),i=a.end,s="x",n=!1;continue}}else if(o==="("||o===")")this.top()!=="case"&&(o==="("?this.stack.push("("):this.top()==="("&&this.stack.pop());else if(o==="{")this.stack.push("{");else if(o==="}")this.top()==="{"&&this.stack.pop();else if(n&&aa.test(o)){let a=i;for(;a<B&&aa.test(e[a]);)a++;let c=e.slice(i,a);if((a===B||/[\s;&|()<>]/.test(e[a]))&&this.keyword(c)){i=a,s=c;continue}i=a,s=c,n=!1;continue}n=o===";"||o==="&"||o==="|"||o==="("||o==="{"||o==="}"||o==="!",s=(s+o).slice(-2),i++}return this.quote===""&&(s.endsWith("|")||s.endsWith("&&"))&&(this.cont=!0),this.quote===""&&Kc.test(e.replace(/[ \t]+#.*$/,""))&&(this.cont=!0),this.inHeredoc=this.heredocs.length>0,t}top(){return this.stack[this.stack.length-1]}keyword(e){switch(e){case"if":case"case":return this.stack.push(e),!0;case"for":case"while":case"until":case"select":return this.stack.push("loop"),!0;case"fi":case"esac":case"done":{let t=e==="fi"?"if":e==="esac"?"case":"loop";return this.top()===t&&this.stack.pop(),!0}case"then":case"do":case"else":case"elif":case"in":case"function":case"time":return!0;default:return!1}}},OB=class{quote="";blockComment=!1;depth=0;cont=!1;open(){return this.quote!==""||this.blockComment||this.depth>0||this.cont}line(e){if(this.cont=!1,this.quote==="@'"||this.quote==='@"')return e.startsWith(this.quote[1]+"@")&&(this.quote=""),!0;let t=this.quote!=="",n="",s=e.length,B=0;for(;B<s;){let i=e[B];if(this.blockComment){e.startsWith("#>",B)?(this.blockComment=!1,B+=2):B++;continue}if(this.quote==="'"){(i==="'"||i==="\u2018"||i==="\u2019")&&(e[B+1]===i?B++:this.quote=""),B++;continue}if(this.quote==='"'){i==="`"?B++:i==='"'&&(e[B+1]==='"'?B++:this.quote=""),B++;continue}if(ts.test(i)){B++;continue}if(e.startsWith("<#",B)){this.blockComment=!0,B+=2;continue}if(i==="#")break;if(t=!0,i==="`"){B===s-1&&(this.cont=!0),n="`",B+=2;continue}if(i==="@"&&(e[B+1]==="'"||e[B+1]==='"')&&e.slice(B+2).trim()==="")return this.quote=e[B+1]==="'"?"@'":'@"',!0;i==="'"||i==='"'||i==="\u2018"||i==="\u2019"?this.quote=i==='"'?'"':"'":i==="("||i==="{"||i==="["?this.depth++:(i===")"||i==="}"||i==="]")&&this.depth>0&&this.depth--,n=(n+i).slice(-4),B++}return this.quote===""&&!this.blockComment&&/(\||,|(?<![=!<>+\-*/%])=|&&|\|\||-and|-or)$/i.test(n)&&(this.cont=!0),t}},AB=class{depth=0;cont=!1;open(){return this.depth>0||this.cont}line(e){if(this.cont=!1,this.depth===0&&/^[ \t]*(@?rem([ \t].*)?$|:)/i.test(e))return!1;let t=!1,n=!1;for(let s=0;s<e.length;s++){let B=e[s];if(ts.test(B)||(n=!0),B==='"')t=!t;else{if(t)continue;B==="^"?(s===e.length-1&&(this.cont=!0),s++):B==="("?this.depth++:B===")"&&this.depth>0&&this.depth--}}return n}};function zc(r){return r==="pwsh"?new OB:r==="cmd"?new AB:new SB}function Yc(r,e){return r==="pwsh"&&/^[ \t]*(\||(else|elseif|catch|finally)\b)/i.test(e)}function la(r,e){let t=Nt(r),n=zc(e),s=[],B,i=a=>{s.push({start:B,end:a,text:t.slice(B,a+1).map((c,u,l)=>c.text+(u<l.length-1?c.eol:"")).join("")}),B=void 0},o=a=>t.slice(a+1).find(c=>c.text.trim()!=="")?.text;for(let a=0;a<t.length;a++){let c=n.line(t[a].text);if(B===void 0){if(!c)continue;B=a}if(n.open())continue;let u=o(a);u!==void 0&&Yc(e,u)||i(a)}if(B!==void 0){let a=t.length-1;for(;a>B&&t[a].text.trim()==="";)a--;i(a)}return s}var yB="md-runbook",ca="md-runbook-manifest 1",fa=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,99}$/,Qc=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,qc=/^\d{4}-\d{2}-\d{2}$/,Wc=r=>qc.test(r)&&new Date(`${r}T00:00:00Z`).toISOString().slice(0,10)===r;function ua(r){return/^(PATH|IFS|ENV|BASH_ENV|CDPATH|GLOBIGNORE|HOME|SHELL|SHELLOPTS|BASHOPTS|PS[1-4]|PROMPT_COMMAND|PWD|OLDPWD|TMPDIR|LANG|LANGUAGE)$/.test(r)||/^(LC_|LD_|DYLD_|BASH_FUNC_|__mdrb_|MD_RUNBOOK_GATE_)/.test(r)}var Vc=/\\[dDwWsSbB1-9]|\(\?|[*+?}]\?/,tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function St(r){let e=new TextEncoder().encode(r),t="";for(let n=0;n<e.length;n+=3){let s=e[n],B=e[n+1],i=e[n+2];t+=tr[s>>2]+tr[(s&3)<<4|(B??0)>>4],t+=B===void 0?"=":tr[(B&15)<<2|(i??0)>>6],t+=i===void 0?"=":tr[i&63]}return t}function Ca(r){if(r.length%4!==0||!/^[A-Za-z0-9+/]*={0,2}$/.test(r))return;let e=r.endsWith("==")?2:r.endsWith("=")?1:0,t=new Uint8Array(r.length/4*3-e),n=0;for(let B=0;B<r.length;B+=4){let i=[0,1,2,3].map(a=>r[B+a]==="="?0:tr.indexOf(r[B+a])),o=i[0]<<18|i[1]<<12|i[2]<<6|i[3];for(let a of[o>>16,o>>8&255,o&255])n<t.length&&(t[n++]=a)}let s=new TextDecoder().decode(t);return St(s)===r?s:void 0}function RB(r){let e=[];return Ce(r).cells.forEach((t,n)=>{t.kind!=="code"||!le(t.meta)||Re(t.languageId)==="bash"&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function Zc(r){let e=[],t=null,n=!1;return r.split(/\r?\n/).forEach((s,B)=>{if(t){Le(s,t)&&(/^( {4}|\t| {0,3}\t)/.test(s)&&e.push(`line ${B+1}: a closing fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),t=null);return}let i=Ae(s);if(i){/^( {4}|\t| {0,3}\t)/.test(i.indent)&&e.push(`line ${B+1}: a fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),n&&Re(wt(i.info))==="bash"&&e.push(`line ${B+1}: a bash block inside an HTML comment (<!-- \u2026 -->) is hidden on GitHub but would be signed`),t=i;return}for(let o of s.matchAll(/<!--|-->/g))n=o[0]==="<!--"}),e}function FB(r,e){let t=[];fa.test(e.name)||t.push(`name "${e.name}": use letters, digits and . _ / - (at most 100)`),(!Number.isInteger(e.version)||e.version<1)&&t.push(`version ${e.version}: expected a positive whole number`),e.expires!==void 0&&!Wc(e.expires)&&t.push(`expires ${e.expires}: expected a date, YYYY-MM-DD`);for(let a of e.scopes)Qc.test(a)||t.push(`scope "${a}": use letters, digits and . _ - (at most 64)`);for(let[a,c]of Object.entries(e.patterns))ht.test(a)?ua(a)&&t.push(`\${param:${a}}: ${a} can't be a parameter of a signed runbook (it changes how the shell runs the code)`):t.push(`pattern for "${a}": not a parameter name`),c===""||/[\r\n]/.test(c)?t.push(`pattern for ${a}: empty or more than one line`):Vc.test(c)&&t.push(`pattern for ${a}: ${c} uses JavaScript-only syntax (\\d, \\w, (?\u2026), lazy *?, back-references); servers check it with grep -E: use [0-9], [A-Za-z0-9_], \u2026`);t.push(...Zc(ga(r)));let n=et(r)?.shell?.unix;n&&n!=="bash"&&t.push(`front matter shell: ${n}: servers run signed runbooks in bash; remove it, or write shell: bash`);let s=new Set;for(let a of RB(r))for(let c of de(a.info).checks?.captures??[])c.secret&&s.add(c.name);let B=[];for(let a of RB(r)){let c=B.length+1,u=`cell ${c} (${a.value.split(`
|
|
89
|
-
|
|
85
|
+
`;return yC+s+n}function Oo(r){return r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))?r.startsWith('"')?r.slice(1,-1).replace(/\\(["\\])/g,"$1"):r.slice(1,-1).replace(/''/g,"'"):r}function Il(r){let e=r.trim(),t=/^("(?:[^"\\]|\\.)*"|'(?:[^']|'')*')\s*(?:#.*)?$/.exec(e);return t?Oo(t[1]):e.startsWith("#")?"":e.replace(/\s+#.*$/,"")}var Ro=/^\s+([A-Za-z_][A-Za-z0-9_]*)\s*:(?:\s+(.*?))?\s*$/;function OC(r){let e=r.trim().toLowerCase();if(/^\d+(?:\.\d+)?$/.test(e))return Number(e);let t=/^(?:(\d+)h)?\s*(?:(\d+)m)?\s*(?:(\d+)s)?$/.exec(e);if(!(!t||!t[1]&&!t[2]&&!t[3]))return Number(t[1]??0)*3600+Number(t[2]??0)*60+Number(t[3]??0)}function Ue(r){let e=r.replace(/^\uFEFF/,"").split(/\r?\n/);if(e[0]?.trimEnd()!=="---")return;let t=[],n,s,i,o,B,a,c,u,l,C,f,h,d,x=Object.create(null),S=!1,E=!1;for(let b=1;b<e.length;b++){let D=e[b];if(/^(---|\.\.\.)\s*$/.test(D))return{params:t,...n?{mode:n}:{},...s!==void 0?{timeoutSeconds:s}:{},...i!==void 0?{cwd:i}:{},...o?{shell:o}:{},...B?{incident:B}:{},...a?{severity:a}:{},...c||B?{evidence:!0}:{},...u!==void 0?{rtoSeconds:u}:{},...l?{practice:l}:{},...C?{drill:C}:{},...f?{kubeContext:f}:{},...h?{kubeContextMode:h}:{},...d?{gitBashPathConversion:d}:{},...Object.keys(x).length>0?{env:x}:{}};if(D.trim()===""||D.trim().startsWith("#"))continue;if(!/^\s/.test(D)&&!D.startsWith("-")){S=/^params\s*:\s*$/.test(D),E=/^env\s*:\s*(#.*)?$/i.test(D);let m=/^mode\s*:\s*["']?(session|isolated)["']?\s*(#.*)?$/i.exec(D);m&&(n=m[1].toLowerCase());let L=/^timeout\s*:\s*["']?(\d+(?:\.\d+)?)s?["']?\s*(#.*)?$/i.exec(D);L&&(s=Number(L[1]));let A=/^cwd\s*:\s*(.*?)\s*$/i.exec(D);A&&A[1]!==""&&(i=Oo(A[1].replace(/\s+#.*$/,"")));let H=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(D);if(H){let{shells:De}=Ir(H[1]);(De.unix||De.powershell)&&(o={...De,...o})}let Y=De=>{let de=new RegExp(`^${De}\\s*:\\s*(.*?)\\s*$`,"i").exec(D)?.[1];return de===void 0||de===""?void 0:Oo(de.replace(/\s+#.*$/,""))};B=Y("incident")??B,a=Y("severity")??a,l=Y("practice")??l;let z=Y("drill");z!==void 0&&(C=/^(true|yes|on)$/i.test(z));let te=Y("evidence");te!==void 0&&(c=/^(true|yes|on)$/i.test(te));let Z=Y("rto");Z!==void 0&&(u=OC(Z)??u);let Q=Y("kube-context");Q!==void 0&&Zs(Q)&&(f=Q);let ne=Y("kube-context-mode")?.toLowerCase();ne!==void 0&&Ol.includes(ne)&&(h=ne);let ie=Y("git-bash-path-conversion")?.toLowerCase();(ie==="on"||ie==="off")&&(d=ie);continue}if(E){let m=Ro.exec(D);m&&!(m[1]in x)&&(x[m[1]]=Il(m[2]??""));continue}if(!S)continue;let y=/^\s*-\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*:(?:\s+(.*?)|\s*)|\s+#.*|)\s*$/.exec(D);if(!y)continue;let v=y[1];if(t.some(m=>m.name===v))continue;let $=y[2]!==void 0?Il(y[2]):"",k=/^["']/.test(y[2]?.trim()??"");t.push($!==""||k?{name:v,default:$}:{name:v})}}var Fo=100,Ll=36e5,jr=class{constructor(e,t){this.source=e;this.flags=t;let n=0;t.includes("i")&&(n|=rr.CASE_INSENSITIVE),t.includes("m")&&(n|=rr.MULTILINE),t.includes("s")&&(n|=rr.DOTALL);try{this.re=rr.compile(e,n)}catch(s){let i=s instanceof Error?s.message:String(s);throw new Error(`invalid regular expression /${e}/${t}: ${i} (look-around and back-references are not supported)`)}}source;flags;re;exec(e){let t=this.re.matcher(e);if(!t.find())return null;let n=[];for(let s=0;s<=t.groupCount();s++)n.push(t.group(s)??void 0);return n}toString(){return`/${this.source}/${this.flags}`}},AC=/^\/([\s\S]*)\/([imsu]*)$/;function Io(r){let e=st(r).find(n=>n.secret);if(e)throw new Error(`a check can't use the secret ${e.kind==="secret"?`\${secret:${e.name}}`:`\${input:${e.name}}`}: its text is shown when it fails`);let t=AC.exec(r);return t?(st(t[1]).length>0&&new jr(An(t[1],()=>"(?:x)"),t[2]),{kind:"regex",re:new jr(t[1],t[2])}):{kind:"text",text:r}}function $o(r){return[r?.expect,r?.expectNot].filter(e=>e!==void 0).map(e=>e.kind==="text"?e.text:e.re.source).join(`
|
|
86
|
+
`)}function RC(r){return st($o(r))}function Nl(r,e,t=()=>!1){let n=(B,a,c)=>{let u=e[a];if(u===void 0)throw new Error(`\${${B}:${a}} in a check has no value`);if(t(a))throw new Error(`a check can't use \${${B}:${a}}: it is a secret value, and a check's text is shown when it fails`);return c(u)},s=B=>{if(B===void 0)return;if(B.kind==="text")return{kind:"text",text:An(B.text,(c,u)=>n(c,u,l=>l))};let a=An(B.re.source,(c,u)=>n(c,u,l=>`(?:${rr.quote(l)})`));return a===B.re.source?B:{kind:"regex",re:new jr(a,B.re.flags)}};if(RC(r).length===0)return r;let i=s(r.expect),o=s(r.expectNot);return{...r,...i?{expect:i}:{},...o?{expectNot:o}:{}}}function ei(r){return r.kind==="text"?JSON.stringify(r.text):String(r.re)}function Ml(r,e){let t=r.indexOf(":"),n=t<0?r:r.slice(0,t);if(!At.test(n))throw new Error("expected a variable name (letters, digits, _)");if(t<0)return{name:n,secret:e};let s=Io(r.slice(t+1));if(s.kind!=="regex")throw new Error("expected NAME or NAME:/regex/");return{name:n,pattern:s.re,secret:e}}function Gl(r){return!!r&&(r.expect!==void 0||r.expectNot!==void 0||r.expectExit!==void 0||r.captures.length>0)}var $l=r=>yt(r).replace(/\r\n?/g,`
|
|
87
|
+
`);function Tl(r,e){return r.kind==="text"?e.includes(r.text):r.re.exec(e)!==null}function Hl(r,e,t,n){let s=[],i=r.expectExit??0,o=e===i;!o&&r.expectExit!==void 0&&s.push(`exit code ${e}, expected ${i}`);let B=$l(t);r.expect&&!Tl(r.expect,B)&&(o=!1,s.push(r.expect.kind==="text"?`the output does not contain ${ei(r.expect)}`:`the output does not match ${ei(r.expect)}`)),r.expectNot&&Tl(r.expectNot,B)&&(o=!1,s.push(r.expectNot.kind==="text"?`the output contains ${ei(r.expectNot)}`:`the output matches ${ei(r.expectNot)}`));let a=[],c=[];if(o){let u=$l(n);for(let l of r.captures){let C;if(l.pattern){let f=l.pattern.exec(u);C=f?f[1]??f[0]:void 0,C===void 0&&s.push(`capture ${l.name}: nothing in the output matches ${String(l.pattern)}`)}else C=u.trim(),C===""&&(s.push(`capture ${l.name}: the cell printed nothing`),C=void 0);C!==void 0&&a.push({name:l.name,value:C,secret:l.secret}),C!==void 0&&l.secret&&c.push(C)}a.length<r.captures.length&&(o=!1,a.length=0)}return{ok:o,failures:s,captured:a,secretValues:c}}var FC={h:36e5,m:6e4,s:1e3,ms:1};function To(r){let e=r.trim();if(/^\d+(?:\.\d+)?$/.test(e))return Math.round(Number(e)*1e3);if(!/^(?:\d+(?:\.\d+)?(?:ms|h|m|s))+$/i.test(e))return;let t=0,n=1/0;for(let[,s,i]of e.matchAll(/(\d+(?:\.\d+)?)(ms|h|m|s)/gi)){let o=FC[i.toLowerCase()];if(o>=n)return;n=o,t+=Number(s)*o}return Math.round(t)}var IC={windows:"windows",win:"windows",win32:"windows",linux:"linux",macos:"macos",mac:"macos",osx:"macos",darwin:"macos"},$C={windows:"Windows",linux:"Linux",macos:"macOS"};function Pl(r){let e=[];for(let t of r.split(",").map(n=>n.trim().toLowerCase())){let n=IC[t];if(!n)return`unknown OS "${t}" (expected windows, linux or macos)`;e.includes(n)||e.push(n)}return e.length>0?e:"expected windows, linux or macos"}function Rn(r=process.platform){return r==="win32"?"windows":r==="darwin"?"macos":"linux"}function ir(r){return r.map(e=>$C[e]).join(", ")}function Fn(r,e=Rn()){let t=-1,n=new Set,s=!1;return r.map((i,o)=>{if(i.kind!=="markup"){if(!i.os){s=!1;return}(!s||i.os.some(B=>n.has(B)))&&(t=o,n=new Set),s=!0;for(let B of i.os)n.add(B);return{group:t,active:i.os.includes(e)}}})}function en(r){let e=Fn(r),t=new Map,n=0;return r.map((s,i)=>{if(s.kind!=="code")return;let o=e[i];return o&&t.has(o.group)?t.get(o.group):(n++,o&&t.set(o.group,n),n)})}var Lo=r=>r===" "||r===" ";function tn(r){let e=[],t=r.length,n=0;for(;n<t;){for(;n<t&&Lo(r[n]);)n++;if(n>=t)break;if(r[n]==="{"){let a=r.indexOf("}",n);n=a<0?t:a+1;continue}let s=n;for(;n<t&&!Lo(r[n])&&r[n]!=="=";)n++;let i=r.slice(s,n);if(r[n]!=="="){e.push({key:i,start:s,end:n});continue}n++;let o=r[n],B;if(o==='"'||o==="'"){let a=r.indexOf(o,n+1);B=r.slice(n+1,a<0?t:a),n=a<0?t:a+1}else{let a=n;for(;n<t&&!Lo(r[n]);)n++;B=r.slice(a,n)}i!==""&&e.push({key:i,value:B,start:s,end:n})}return e}var TC=/^\s*[^\s{]*/;function or(r,e,t){let n=ge(e),s=[$o(n.checks),Sl(Ur(n,t))].filter(i=>i!=="");return st([r,...s].join(`
|
|
88
|
+
`))}function ge(r){let e={env:{},errors:[]},t=()=>e.checks??={captures:[]},n;for(let{key:s,value:i}of tn(r.replace(TC,""))){let o=s.toLowerCase();if(i===void 0)o==="continue-on-error"?e.continueOnError=!0:o==="skip"?e.skip=!0:o==="confirm"?e.confirm=!0:o==="no-confirm"?e.confirm=!1:o==="terminal"?e.terminal=!0:(o==="setup"||o==="teardown"||o==="ready")&&(e.part!==void 0&&e.part!==o?e.errors.push(`${o}: a block is only one of setup, teardown and ready (it is already ${e.part})`):e.part=o);else if(o==="timeout"){let B=Number(i.replace(/s$/i,""));i.trim()===""||!Number.isFinite(B)||B<0?e.errors.push(`timeout=${i}: expected seconds (0 = none)`):e.timeoutSeconds=B}else if(o==="estimate"){let B=To(i);B===void 0?e.errors.push(`estimate=${i}: expected a duration such as 2m30s, 45s or 90 (seconds)`):e.estimateSeconds=B/1e3}else if(o==="cwd")i===""?e.errors.push("cwd: empty path"):e.cwd=i;else if(o==="name")e.name=i;else if(o==="expect"||o==="expect-not")try{t()[o==="expect"?"expect":"expectNot"]=Io(i)}catch(B){e.errors.push(`${o}=${i}: ${B instanceof Error?B.message:String(B)}`)}else if(o==="expect-exit")/^-?\d+$/.test(i.trim())?t().expectExit=Number(i):e.errors.push(`expect-exit=${i}: expected an exit code`);else if(o==="capture"||o==="capture-secret")try{t().captures.push(Ml(i,o==="capture-secret"))}catch(B){e.errors.push(`${o}=${i}: ${B instanceof Error?B.message:String(B)}`)}else if(o==="os"){let B=Pl(i);typeof B=="string"?e.errors.push(`os=${i}: ${B}`):e.os=B}else if(o==="host")i.trim()===""?e.errors.push("host: empty name"):e.host=i.trim();else if(o==="kube-context")Zs(i.trim())?e.kubeContext=i.trim():e.errors.push(`kube-context=${i}: expected a Kubernetes context name or \${param:NAME}`);else if(o==="lines")i.toLowerCase()!=="any"?e.errors.push(`lines=${i}: expected lines=any`):e.lines="any";else if(o==="retry"){let B=Number(i);!Number.isInteger(B)||B<1||B>Fo?e.errors.push(`retry=${i}: expected the number of attempts (1 to ${Fo})`):e.retry={attempts:B,everyMs:5e3}}else o==="every"?(n=To(i),n===void 0?e.errors.push(`every=${i}: expected a duration such as 15s, 500ms or 2m`):n>Ll&&e.errors.push(`every=${i}: at most 1h`)):o.startsWith("env.")&&s.length>4&&(e.env[s.slice(4)]=i)}return e.retry&&n!==void 0&&(e.retry.everyMs=n),e}var LC=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/;function In(r){let e=mn(r.replace(/^/,"")).map(s=>s.text),t=[],n=0;if(e[0]?.trimEnd()==="---"){let s=e.findIndex((i,o)=>o>0&&/^(---|\.\.\.)\s*$/.test(i));s>0&&(n=s+1)}for(;n<e.length;n++){let s=Je(e[n]);if(s){for(;n+1<e.length&&!Ke(e[n+1],s);)n++;n++;continue}let i=LC.exec(e[n]);if(!i)continue;let o=(i[2]??"").replace(/(^|[ \t]+)#+$/,"").trim();t.push({line:n,level:i[1].length,text:o})}return t}function ti(r,e){return e.filter(t=>!r.some(n=>n.text.startsWith(t)))}function ni(r,e){if(r.length<2)return;let t=Math.min(...r.map(B=>B.level)),n=r.filter(B=>B.level===t);if(n.length!==1)return;let s=n[0],i=e.find(B=>s.text.startsWith(B));if(i===void 0)return;let o=r.find(B=>B!==s&&B.text.startsWith(i))?.text;return{section:i,title:s.text,...o!==void 0?{other:o}:{}}}function $n(r,e){return t=>{let n=[];for(let s of r){if(s.line>=t)break;for(;n.length>0&&n[n.length-1].level>=s.level;)n.pop();n.push(s)}return n.some(s=>e.some(i=>s.text.startsWith(i)))}}var NC="runbook",Br=3,_l=new Set(["src","section"]),Jl=new Set(["cwd","expect","expect-not","expect-exit","capture","capture-secret","retry","every","terminal","host","lines","os"]);function Pe(r){return r===NC}function MC(r){return r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))?r.slice(1,-1):r}function Ve(r,e){let t={sections:[],args:[],problems:[]};for(let n of tn(r.replace(/^\s*[^\s{]*/,""))){let s=n.key.toLowerCase();s==="src"?n.value===void 0||n.value.trim()===""?t.problems.push({message:"src= is empty: give the runbook to run, relative to this file"}):t.src=n.value.trim():s==="section"&&(n.value===void 0||n.value.trim()===""?t.problems.push({message:"section= is empty: give the start of a heading of the runbook called"}):t.sections.push(n.value.trim()))}if(t.src===void 0&&!t.problems.some(n=>n.message.startsWith("src="))&&t.problems.push({message:"a runbook call needs src=, the runbook to run (relative to this file)"}),t.src!==void 0)try{for(let n of st(t.src))(n.kind==="input"||n.kind==="secret")&&t.problems.push({message:`src= can't use \${${n.kind}:${n.name}}: use \${param:NAME} or \${out:NAME}`})}catch(n){t.problems.push({message:`src=: ${n instanceof Error?n.message:String(n)}`})}return e.split(/\r?\n/).forEach((n,s)=>{let i=n.trim();if(i===""||i.startsWith("#"))return;let o=i.indexOf("="),B=o<0?i:i.slice(0,o).trim();if(o<0||!At.test(B)){t.problems.push({line:s,message:`"${i}": expected NAME=value, a parameter of the runbook called (NAME letters, digits and _)`});return}if(t.args.some(a=>a.name===B)){t.problems.push({line:s,message:`${B} is passed twice: the first one counts`});return}t.args.push({name:B,value:MC(i.slice(o+1).trim()),line:s})}),t}function Mt(r){return st([r.src??"",...r.args.map(e=>e.value)].join(`
|
|
89
|
+
`))}function ri(r,e){let t,n=An(r,(s,i)=>{let o=e(s,i);return o===void 0&&(t??={kind:s,name:i}),o??""});return t?{missing:t}:{text:n}}function ar(r){return/\$\{(param|out|input|secret):/.test(r)}function Ul(r){return An(r,()=>"*")}function GC(r){let e=Ue(r)?.params??[],t=new Set;for(let n of r.matchAll(/\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}/g))t.add(n[1]);return{declared:e,used:t}}function si(r,e){let{declared:t,used:n}=GC(e),s=new Set([...t.map(f=>f.name),...n]),i=new Set(r.args.map(f=>f.name)),o=new Set(t.filter(f=>f.default!==void 0).map(f=>f.name)),B=In(e),a=ti(B,r.sections),c=ni(B,r.sections),u=ct(he(e)).map(f=>f.line),l=Tr(e);return{manualOnly:r.sections.filter(f=>{if(a.includes(f))return!1;let h=$n(B,[f]);return!u.some(h)&&l.some(d=>h(d.line))}),unknown:r.args.filter(f=>!s.has(f.name)),notPassed:[...s].filter(f=>!i.has(f)&&!o.has(f)),sections:[...a.map(f=>`section="${f}": no heading of the runbook called starts with it`),...c?[`section="${c.section}" matches the title "${c.title}", which holds every step${c.other?`; for "${c.other}", give more of it`:""}`]:[]]}}function No(r){let e=Ue(r);return e?{...e.incident?{incident:e.incident}:{},...e.severity?{severity:e.severity}:{},...e.evidence?{evidence:"true"}:{},...e.drill?{drill:"true"}:{},...e.rtoSeconds!==void 0?{rto:`${e.rtoSeconds}s`}:{}}:{}}function Kr(r){let e=[`${r.done} done`];return r.skipped&&e.push(`${r.skipped} skipped`),r.failed&&e.push(`${r.failed} failed`),r.notRun&&e.push(`${r.notRun} not run`),r.manual&&e.push(`${r.manual} manual not ticked`),e.join(", ")}function jl(r){return{runbook:r.runbook,copy:r.copy,sha256:r.sha256,steps:Kr(r)}}function Kl(r,e){let t=e.length?` (section${e.length===1?"":"s"} ${e.map(n=>`"${n}"`).join(", ")})`:"";return`[md-runbook] ran ${r.runbook}${t} as ${r.copy}
|
|
90
|
+
[md-runbook] ${Kr(r)} \xB7 sha256 ${r.sha256}
|
|
91
|
+
`}function ii(r){if(!(!r?.copy||!r.runbook))return{runbook:r.runbook,copy:r.copy,...r.sha256?{sha256:r.sha256}:{},...r.exit?{exit:r.exit}:{}}}function zl(r,e,t=(n,s)=>n===s){let n=r.findIndex(s=>t(s,e));if(n>=0)return`a runbook call cycle: ${[...r.slice(n),e].join(" \u2192 ")}`;if(r.length>Br)return`runbook calls nest more than ${Br} deep: ${[...r,e].join(" \u2192 ")}`}function oi(r){let e=/^?---[ \t]*\r?\n(?:[\s\S]*?\r?\n)?(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/.exec(r);return e?r.slice(e[0].length):r}function Bi(r){let e=[],t;return r.split(/\r?\n/).forEach((n,s)=>{let i=/^ {0,3}(`{3,}|~{3,})/.exec(n)?.[1];if(t!==void 0){i&&i[0]===t[0]&&i.length>=t.length&&n.trim()===i&&(t=void 0);return}if(i){t=i;return}let o=/^ {0,3}(#{1,6})[ \t]+(.+?)(?:[ \t]+#+)?[ \t]*$/.exec(n),B=o?.[2]?.trim();o&&B&&e.push({level:o[1].length,text:B,line:s})}),e}function lr(r){return Bi(oi(r)).find(e=>e.level===1)?.text}function it(r){let e=Math.max(0,r);if(e<1)return`${Math.round(e*1e3)/1e3}s`;let t=Math.round(e),n=Math.floor(t/3600),s=Math.floor(t%3600/60),i=t%60;return[n?`${n}h`:"",s?`${s}m`:"",i||!n&&!s?`${i}s`:""].join("")}function ai(r){let e=Math.round(Math.max(0,r)/60);return e<1?"under a minute":e<60?`about ${e} min`:`about ${Math.floor(e/60)} h${e%60?` ${e%60} min`:""}`}function Mo(r,e){return r>2*e&&r-e>60}function Ql(r,e=10){let t=Math.min(1,Math.max(0,Number.isFinite(r)?r:0)),n=Math.round(t*e);return`[${"#".repeat(n)}${".".repeat(e-n)}]`}function Yl(r,e){return e.estimateSeconds===void 0?(r.unestimated++,e.state!=="done"):(r.totalSeconds+=e.estimateSeconds,e.state==="done"?r.doneSeconds+=e.estimateSeconds:e.state==="running"?r.leftSeconds+=Math.max(0,e.estimateSeconds-(e.elapsedSeconds??0)):r.leftSeconds+=e.estimateSeconds,!1)}function Go(r,e={}){let t={setup:e.setup??"run",teardown:e.teardown??"offered"},n=r.some(a=>a.part!==void 0),s=a=>a.part===void 0||(a.part==="setup"?t.setup==="run":t.teardown==="chosen"),i={totalSeconds:0,doneSeconds:0,leftSeconds:0,blocks:0,unestimated:0,unestimatedLeft:0},o=()=>({totalSeconds:0,doneSeconds:0,leftSeconds:0,blocks:0,unestimated:0}),B={setup:o(),body:o(),teardown:o()};for(let a of r){let c=B[a.part??"body"];c.blocks++,Yl(c,a),!(n&&!s(a))&&(i.blocks++,Yl(i,a)&&i.unestimatedLeft++)}return i.totalSeconds>0&&(i.fraction=i.doneSeconds/i.totalSeconds),n&&(i.parts={...B,states:t}),i}function HC(r){let e=r.parts;if(!e)return;let t=[],n=s=>s.unestimated===s.blocks?"":` ${it(s.totalSeconds)}`;return e.setup.blocks>0&&(e.states.setup==="up"?t.push("setup \u2713 already up"):e.states.setup==="unchecked"?t.push(e.setup.unestimated===e.setup.blocks?"setup unless already up":`+${it(e.setup.totalSeconds)} if the setup runs`):e.setup.leftSeconds===0&&e.setup.doneSeconds>0&&t.push("setup \u2713")),e.teardown.blocks>0&&t.push(e.states.teardown==="chosen"?`teardown${n(e.teardown)}`:`teardown${n(e.teardown)}, offered`),t.length?t.join(" \xB7 "):void 0}function Ho(r,e=10){if(r.fraction===void 0)return;let t=[`${Ql(r.fraction,e)} ${Math.floor(r.fraction*100)}%`,r.leftSeconds>0?`${ai(r.leftSeconds)} left`:"nothing left"];r.unestimatedLeft>0&&t.push(li(r.unestimatedLeft));let n=HC(r);return n&&t.push(n),t.join(" \xB7 ")}function li(r){return`${r} block${r===1?"":"s"} without an estimate`}function ui(r,e,t){let n=he(r).cells,s=n.map(h=>h.kind==="code"&&ce(h.meta)?ge(h.meta.info):void 0);n.forEach((h,d)=>{let x=s[d];if(!t||!x||x.estimateSeconds!==void 0||!ce(h.meta)||!Pe(h.languageId))return;let S=t(h.meta.info,h.value);S!==void 0&&(s[d]={...x,estimateSeconds:S})});let i=Fn(n.map((h,d)=>({kind:h.kind,...s[d]?.os?{os:s[d].os}:{}})),e),o=new Map,B=new Map;i.forEach((h,d)=>{h&&B.set(h.group,[...B.get(h.group)??[],{active:h.active,e:s[d]?.estimateSeconds}])});for(let[h,d]of B){let x=e!==void 0?d.find(E=>E.active):void 0,S=d.flatMap(E=>E.e===void 0?[]:[E.e]);o.set(h,x?x.e:S.length?Math.max(...S):void 0)}let a=new Set,c=[],u=[],l=[],C={setup:{seconds:0,blocks:0,unestimated:0},teardown:{seconds:0,blocks:0,unestimated:0}},f;return n.forEach((h,d)=>{if(h.kind!=="code"){c.push(void 0),u.push(!1);for(let D of Bi(d===0?oi(h.value):h.value))D.level>2||(f={heading:D.text,level:D.level,cell:d,seconds:0,blocks:0,unestimated:0},l.push(f));return}let x=s[d],S=i[d],E=x!==void 0&&!x.skip&&x.part!=="ready",b=x?.estimateSeconds;if(E&&S&&(a.has(S.group)?E=!1:(a.add(S.group),b=o.get(S.group))),c.push(x?.estimateSeconds),u.push(E),!!E&&(f||(f={level:0,cell:-1,seconds:0,blocks:0,unestimated:0},l.unshift(f)),f.blocks++,b===void 0?f.unestimated++:f.seconds+=b,x?.part==="setup"||x?.part==="teardown")){let D=C[x.part];D.blocks++,b===void 0?D.unestimated++:D.seconds+=b}}),{sections:l,totalSeconds:l.reduce((h,d)=>h+d.seconds,0),blocks:l.reduce((h,d)=>h+d.blocks,0),unestimated:l.reduce((h,d)=>h+d.unestimated,0),perCell:c,counts:u,parts:C,guarded:s.some((h,d)=>h?.part==="ready"||h?.part==="setup"&&Pe(n[d].languageId))}}function Po(r,e,t,n,s=0,i){let o=ge(r).estimateSeconds;if(o!==void 0)return o;let B=Ve(r,e);if(B.src===void 0||ar(B.src)||s>=Br)return;let a=t(B.src,i);if(!a)return;let c=ui(a.text,n,(C,f)=>a.at===void 0?void 0:Po(C,f,t,n,s+1,a.at));if(B.sections.length===0)return c.blocks>c.unestimated?c.totalSeconds:void 0;let u=$n(In(a.text),B.sections),l;for(let C of ct(he(a.text))){let f=c.perCell[C.cellIndex];c.counts[C.cellIndex]&&f!==void 0&&u(C.line)&&(l=(l??0)+f)}return l}function ql(r){return/(^|[\s;|&(])md-runbook-probe(\s|$)/m.test(r)}var PC=/^(OK|FAIL) {2,}(\S+) {2,}(.+)$/;function Wl(r){let e=[];for(let t of r.split(/\r?\n/)){let n=PC.exec(t.trimEnd());if(!n)continue;let s=n[3],i={target:n[2],ok:n[1]==="OK",detail:s},o=/(\d+) days left \((\d{4}-\d\d-\d\d)\)/.exec(s),B=/expires in (-?\d+) days \((\d{4}-\d\d-\d\d)\)/.exec(s),a=/expires (\d{4}-\d\d-\d\d) \((-?\d+) days\)/.exec(s),c=/EXPIRED on (\d{4}-\d\d-\d\d) \((\d+) days ago\)/.exec(s);if(o||B){let u=o??B;i.daysLeft=Number(u[1]),i.expires=u[2]}else a?(i.daysLeft=Number(a[2]),i.expires=a[1]):c&&(i.daysLeft=-Number(c[2]),i.expires=c[1]);e.push(i)}return e}var _o=["detected","mitigated","resolved"],_C=/^[ \t]*<!--[ \t]*md-runbook:note\b(.*?)-->[ \t]*\r?\n((?:[ \t]*>.*(?:\r?\n|$))*)/gm;function JC(r){let e=[];for(let t of r.matchAll(_C)){let n=Sr(t[1]??"");if(!n.at||Number.isNaN(Date.parse(n.at)))continue;let s=(t[2]??"").split(/\r?\n/).map(o=>o.replace(/^[ \t]*>[ \t]?/,"")).join(`
|
|
92
|
+
`).trim().replace(/^\*\*[^*]*:\*\*\s*/,""),i=_o.includes(n.milestone??"")?n.milestone:void 0;e.push({at:n.at,kind:"note",text:s,...n.by?{by:n.by}:{},...i?{milestone:i}:{}})}return e}var UC=(r,e)=>e==="failed"||r!==void 0&&!["0","done","skipped","running","proposed","declined"].includes(r)&&e!=="ok";function Vl(r,e,t,n,s){if(!r.ran||Number.isNaN(Date.parse(r.ran)))return;let i=r.exit==="done"||r.exit==="skipped",o=s===void 0?[]:Wl(s);return{at:r.ran,kind:i&&r.duration===void 0?"mark":"run",step:e,label:t,...r.by?{by:r.by}:{},...r.on?{on:r.on}:{},...r.exit!==void 0?{exit:r.exit}:{},...r.check?{check:r.check}:{},ok:!UC(r.exit,r.check),...r.duration?{duration:r.duration}:{},...n?{earlier:!0}:{},...o.length?{checks:o}:{}}}var ci=(r,e)=>Math.max(0,Math.round((Date.parse(e)-Date.parse(r))/1e3));function fi(r){let e=Ue(r),t=[],n=he(r),s=n.cells.map(f=>ce(f.meta)?ge(f.meta.info):void 0),i=en(n.cells.map((f,h)=>ce(f.meta)?{kind:"code",os:s[h]?.os}:{kind:"markup"}));for(let[f,h]of n.cells.entries()){let d=i[f];if(d===void 0||!ce(h.meta))continue;let x=s[f]?.name??h.value.split(/\r?\n/).find(E=>E.trim()!=="")?.trim()??`step ${d}`,S=ql(h.value);if(h.output){let E=Vl(h.output.attrs,d,x,!1,S?h.output.text:void 0);E&&t.push(E)}for(let E of h.meta.history?.entries??[]){let b=Vl(E.attrs,d,x,!0,S?E.text:void 0);b&&t.push(b)}}t.push(...JC(r)),t.sort((f,h)=>Date.parse(f.at)-Date.parse(h.at)||(f.step??0)-(h.step??0));let o={};for(let f of t)f.milestone&&!o[f.milestone]&&(o[f.milestone]=f.at);let B=t.filter(f=>f.kind==="run"),a=t[0]?.at,c=t[t.length-1]?.at,u=o.detected??a,l={...e?.incident?{incident:e.incident}:{},...e?.severity?{severity:e.severity}:{},...e?.drill?{drill:!0}:{},...a?{start:a}:{},...c?{end:c}:{},...a&&c?{durationSeconds:ci(a,c)}:{},runs:B.length,failedAttempts:B.filter(f=>!f.ok).length,milestones:o,...u&&o.mitigated?{timeToMitigateSeconds:ci(u,o.mitigated)}:{},...u&&o.resolved?{timeToResolveSeconds:ci(u,o.resolved)}:{},people:[...new Set(t.flatMap(f=>f.by?[f.by]:[]))],places:[...new Set(t.flatMap(f=>f.on?[f.on]:[]))]},C=t.flatMap(f=>f.earlier?[]:f.checks??[]);if(C.length&&(l.endpointChecks={total:C.length,failed:C.filter(f=>!f.ok).length}),e?.rtoSeconds!==void 0){l.rtoSeconds=e.rtoSeconds;let f=o.resolved??c;a&&f&&(l.rtoMet=ci(a,f)<=e.rtoSeconds)}return{events:t,summary:l}}function zr(r){let e=Math.floor(r/3600),t=Math.floor(r%3600/60),n=r%60;return[e?`${e} h`:"",t?`${t} min`:"",n||!e&&!t?`${n} s`:""].filter(Boolean).join(" ")}var jC=100;function Jo(r,e,t=!1){return!t&&!Ue(r)?.evidence?{}:{...e.by?{by:e.by}:{},...e.on?{on:e.on}:{}}}function Uo(r,e){return Ue(r)?.evidence?Math.max(e,jC):e}function Zl(r,e){let t=/\r\n/.test(r)?`\r
|
|
93
|
+
`:`
|
|
94
|
+
`,n=r.startsWith("\uFEFF")?"\uFEFF":"",s=n?r.slice(1):r,i=c=>/^[\w.@:/+ -]*$/.test(c)&&!/^\s|\s$|: /.test(c)?c:JSON.stringify(c),o=s.split(/\r?\n/),B=o[0]?.trimEnd()==="---"?o.findIndex((c,u)=>u>0&&/^(---|\.\.\.)\s*$/.test(c)):-1;if(B<0){let c=["---",...Object.entries(e).map(([u,l])=>`${u}: ${i(l)}`),"---",""];return n+c.join(t)+t+s}let a=o.slice(1,B);for(let[c,u]of Object.entries(e)){let l=a.findIndex(C=>new RegExp(`^${c}\\s*:`).test(C));l>=0?a[l]=`${c}: ${i(u)}`:a.push(`${c}: ${i(u)}`)}return n+["---",...a,...o.slice(B)].join(t)}var nu=require("module"),KC=(0,nu.createRequire)("/"),zC;try{zC=KC("worker_threads").Worker}catch{}var Me=Uint8Array,dt=Uint16Array,Vo=Int32Array,Ci=new Me([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),di=new Me([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Yo=new Me([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ru=function(r,e){for(var t=new dt(31),n=0;n<31;++n)t[n]=e+=1<<r[n-1];for(var s=new Vo(t[30]),n=1;n<30;++n)for(var i=t[n];i<t[n+1];++i)s[i]=i-t[n]<<5|n;return{b:t,r:s}},su=ru(Ci,2),iu=su.b,Qo=su.r;iu[28]=258,Qo[258]=28;var ou=ru(di,0),YC=ou.b,Xl=ou.r,qo=new dt(32768);for(pe=0;pe<32768;++pe)jt=(pe&43690)>>1|(pe&21845)<<1,jt=(jt&52428)>>2|(jt&13107)<<2,jt=(jt&61680)>>4|(jt&3855)<<4,qo[pe]=((jt&65280)>>8|(jt&255)<<8)>>1;var jt,pe,Gt=(function(r,e,t){for(var n=r.length,s=0,i=new dt(e);s<n;++s)r[s]&&++i[r[s]-1];var o=new dt(e);for(s=1;s<e;++s)o[s]=o[s-1]+i[s-1]<<1;var B;if(t){B=new dt(1<<e);var a=15-e;for(s=0;s<n;++s)if(r[s])for(var c=s<<4|r[s],u=e-r[s],l=o[r[s]-1]++<<u,C=l|(1<<u)-1;l<=C;++l)B[qo[l]>>a]=c}else for(B=new dt(n),s=0;s<n;++s)r[s]&&(B[s]=qo[o[r[s]-1]++]>>15-r[s]);return B}),nn=new Me(288);for(pe=0;pe<144;++pe)nn[pe]=8;var pe;for(pe=144;pe<256;++pe)nn[pe]=9;var pe;for(pe=256;pe<280;++pe)nn[pe]=7;var pe;for(pe=280;pe<288;++pe)nn[pe]=8;var pe,Wr=new Me(32);for(pe=0;pe<32;++pe)Wr[pe]=5;var pe,QC=Gt(nn,9,0),qC=Gt(nn,9,1),WC=Gt(Wr,5,0),VC=Gt(Wr,5,1),jo=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},Rt=function(r,e,t){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&t},Ko=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},Zo=function(r){return(r+7)/8|0},qr=function(r,e,t){return(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length),new Me(r.subarray(e,t))};var ZC=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ft=function(r,e,t){var n=new Error(e||ZC[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,Ft),!t)throw n;return n},XC=function(r,e,t,n){var s=r.length,i=n?n.length:0;if(!s||e.f&&!e.l)return t||new Me(0);var o=!t,B=o||e.i!=2,a=e.i;o&&(t=new Me(s*3));var c=function(X){var q=t.length;if(X>q){var le=new Me(Math.max(q*2,X));le.set(t),t=le}},u=e.f||0,l=e.p||0,C=e.b||0,f=e.l,h=e.d,d=e.m,x=e.n,S=s*8;do{if(!f){u=Rt(r,l,1);var E=Rt(r,l+1,3);if(l+=3,E)if(E==1)f=qC,h=VC,d=9,x=5;else if(E==2){var v=Rt(r,l,31)+257,$=Rt(r,l+10,15)+4,k=v+Rt(r,l+5,31)+1;l+=14;for(var m=new Me(k),L=new Me(19),A=0;A<$;++A)L[Yo[A]]=Rt(r,l+A*3,7);l+=$*3;for(var H=jo(L),Y=(1<<H)-1,z=Gt(L,H,1),A=0;A<k;){var te=z[Rt(r,l,Y)];l+=te&15;var b=te>>4;if(b<16)m[A++]=b;else{var Z=0,Q=0;for(b==16?(Q=3+Rt(r,l,3),l+=2,Z=m[A-1]):b==17?(Q=3+Rt(r,l,7),l+=3):b==18&&(Q=11+Rt(r,l,127),l+=7);Q--;)m[A++]=Z}}var ne=m.subarray(0,v),ie=m.subarray(v);d=jo(ne),x=jo(ie),f=Gt(ne,d,1),h=Gt(ie,x,1)}else Ft(1);else{var b=Zo(l)+4,D=r[b-4]|r[b-3]<<8,y=b+D;if(y>s){a&&Ft(0);break}B&&c(C+D),t.set(r.subarray(b,y),C),e.b=C+=D,e.p=l=y*8,e.f=u;continue}if(l>S){a&&Ft(0);break}}B&&c(C+131072);for(var De=(1<<d)-1,de=(1<<x)-1,Xe=l;;Xe=l){var Z=f[Ko(r,l)&De],ye=Z>>4;if(l+=Z&15,l>S){a&&Ft(0);break}if(Z||Ft(2),ye<256)t[C++]=ye;else if(ye==256){Xe=l,f=null;break}else{var xe=ye-254;if(ye>264){var A=ye-257,I=Ci[A];xe=Rt(r,l,(1<<I)-1)+iu[A],l+=I}var M=h[Ko(r,l)&de],F=M>>4;M||Ft(3),l+=M&15;var ie=YC[F];if(F>3){var I=di[F];ie+=Ko(r,l)&(1<<I)-1,l+=I}if(l>S){a&&Ft(0);break}B&&c(C+131072);var G=C+xe;if(C<ie){var P=i-ie,U=Math.min(ie,G);for(P+C<0&&Ft(3);C<U;++C)t[C]=n[P+C]}for(;C<G;++C)t[C]=t[C-ie]}}e.l=f,e.p=Xe,e.b=C,e.f=u,f&&(u=1,e.m=d,e.d=h,e.n=x)}while(!u);return C!=t.length&&o?qr(t,0,C):t.subarray(0,C)},Kt=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8},Yr=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8,r[n+2]|=t>>16},zo=function(r,e){for(var t=[],n=0;n<r.length;++n)r[n]&&t.push({s:n,f:r[n]});var s=t.length,i=t.slice();if(!s)return{t:au,l:0};if(s==1){var o=new Me(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(y,v){return y.f-v.f}),t.push({s:-1,f:25001});var B=t[0],a=t[1],c=0,u=1,l=2;for(t[0]={s:-1,f:B.f+a.f,l:B,r:a};u!=s-1;)B=t[t[c].f<t[l].f?c++:l++],a=t[c!=u&&t[c].f<t[l].f?c++:l++],t[u++]={s:-1,f:B.f+a.f,l:B,r:a};for(var C=i[0].s,n=1;n<s;++n)i[n].s>C&&(C=i[n].s);var f=new dt(C+1),h=Wo(t[u-1],f,0);if(h>e){var n=0,d=0,x=h-e,S=1<<x;for(i.sort(function(v,$){return f[$.s]-f[v.s]||v.f-$.f});n<s;++n){var E=i[n].s;if(f[E]>e)d+=S-(1<<h-f[E]),f[E]=e;else break}for(d>>=x;d>0;){var b=i[n].s;f[b]<e?d-=1<<e-f[b]++-1:++n}for(;n>=0&&d;--n){var D=i[n].s;f[D]==e&&(--f[D],++d)}h=e}return{t:new Me(f),l:h}},Wo=function(r,e,t){return r.s==-1?Math.max(Wo(r.l,e,t+1),Wo(r.r,e,t+1)):e[r.s]=t},eu=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new dt(++e),n=0,s=r[0],i=1,o=function(a){t[n++]=a},B=1;B<=e;++B)if(r[B]==s&&B!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=r[B]}return{c:t.subarray(0,n),n:e}},Qr=function(r,e){for(var t=0,n=0;n<e.length;++n)t+=r[n]*e[n];return t},Bu=function(r,e,t){var n=t.length,s=Zo(e+2);r[s]=n&255,r[s+1]=n>>8,r[s+2]=r[s]^255,r[s+3]=r[s+1]^255;for(var i=0;i<n;++i)r[s+i+4]=t[i];return(s+4+n)*8},tu=function(r,e,t,n,s,i,o,B,a,c,u){Kt(e,u++,t),++s[256];for(var l=zo(s,15),C=l.t,f=l.l,h=zo(i,15),d=h.t,x=h.l,S=eu(C),E=S.c,b=S.n,D=eu(d),y=D.c,v=D.n,$=new dt(19),k=0;k<E.length;++k)++$[E[k]&31];for(var k=0;k<y.length;++k)++$[y[k]&31];for(var m=zo($,7),L=m.t,A=m.l,H=19;H>4&&!L[Yo[H-1]];--H);var Y=c+5<<3,z=Qr(s,nn)+Qr(i,Wr)+o,te=Qr(s,C)+Qr(i,d)+o+14+3*H+Qr($,L)+2*$[16]+3*$[17]+7*$[18];if(a>=0&&Y<=z&&Y<=te)return Bu(e,u,r.subarray(a,a+c));var Z,Q,ne,ie;if(Kt(e,u,1+(te<z)),u+=2,te<z){Z=Gt(C,f,0),Q=C,ne=Gt(d,x,0),ie=d;var De=Gt(L,A,0);Kt(e,u,b-257),Kt(e,u+5,v-1),Kt(e,u+10,H-4),u+=14;for(var k=0;k<H;++k)Kt(e,u+3*k,L[Yo[k]]);u+=3*H;for(var de=[E,y],Xe=0;Xe<2;++Xe)for(var ye=de[Xe],k=0;k<ye.length;++k){var xe=ye[k]&31;Kt(e,u,De[xe]),u+=L[xe],xe>15&&(Kt(e,u,ye[k]>>5&127),u+=ye[k]>>12)}}else Z=QC,Q=nn,ne=WC,ie=Wr;for(var k=0;k<B;++k){var I=n[k];if(I>255){var xe=I>>18&31;Yr(e,u,Z[xe+257]),u+=Q[xe+257],xe>7&&(Kt(e,u,I>>23&31),u+=Ci[xe]);var M=I&31;Yr(e,u,ne[M]),u+=ie[M],M>3&&(Yr(e,u,I>>5&8191),u+=di[M])}else Yr(e,u,Z[I]),u+=Q[I]}return Yr(e,u,Z[256]),u+Q[256]},ed=new Vo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),au=new Me(0),td=function(r,e,t,n,s,i){var o=i.z||r.length,B=new Me(n+o+5*(1+Math.ceil(o/7e3))+s),a=B.subarray(n,B.length-s),c=i.l,u=(i.r||0)&7;if(e){u&&(a[0]=i.r>>3);for(var l=ed[e-1],C=l>>13,f=l&8191,h=(1<<t)-1,d=i.p||new dt(32768),x=i.h||new dt(h+1),S=Math.ceil(t/3),E=2*S,b=function(we){return(r[we]^r[we+1]<<S^r[we+2]<<E)&h},D=new Vo(25e3),y=new dt(288),v=new dt(32),$=0,k=0,m=i.i||0,L=0,A=i.w||0,H=0;m+2<o;++m){var Y=b(m),z=m&32767,te=x[Y];if(d[z]=te,x[Y]=z,A<=m){var Z=o-m;if(($>7e3||L>24576)&&(Z>423||!c)){u=tu(r,a,0,D,y,v,k,L,H,m-H,u),L=$=k=0,H=m;for(var Q=0;Q<286;++Q)y[Q]=0;for(var Q=0;Q<30;++Q)v[Q]=0}var ne=2,ie=0,De=f,de=z-te&32767;if(Z>2&&Y==b(m-de))for(var Xe=Math.min(C,Z)-1,ye=Math.min(32767,m),xe=Math.min(258,Z);de<=ye&&--De&&z!=te;){if(r[m+ne]==r[m+ne-de]){for(var I=0;I<xe&&r[m+I]==r[m+I-de];++I);if(I>ne){if(ne=I,ie=de,I>Xe)break;for(var M=Math.min(de,I-2),F=0,Q=0;Q<M;++Q){var G=m-de+Q&32767,P=d[G],U=G-P&32767;U>F&&(F=U,te=G)}}}z=te,te=d[z],de+=z-te&32767}if(ie){D[L++]=268435456|Qo[ne]<<18|Xl[ie];var X=Qo[ne]&31,q=Xl[ie]&31;k+=Ci[X]+di[q],++y[257+X],++v[q],A=m+ne,++$}else D[L++]=r[m],++y[r[m]]}}for(m=Math.max(m,A);m<o;++m)D[L++]=r[m],++y[r[m]];u=tu(r,a,c,D,y,v,k,L,H,m-H,u),c||(i.r=u&7|a[u/8|0]<<3,u-=7,i.h=x,i.p=d,i.i=m,i.w=A)}else{for(var m=i.w||0;m<o+c;m+=65535){var le=m+65535;le>=o&&(a[u/8|0]=c,le=o),u=Bu(a,u+1,r.subarray(m,le))}i.i=o}return qr(B,0,n+Zo(u)+s)};var nd=function(r,e,t,n,s){if(!s&&(s={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),o=new Me(i.length+r.length);o.set(i),o.set(r,i.length),r=o,s.w=i.length}return td(r,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,n,s)};function lu(r,e){return nd(r,e||{},0,0)}var uu=(function(){function r(e,t){typeof e=="function"&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new Me(32768),this.p=new Me(0),n&&this.o.set(n)}return r.prototype.e=function(e){if(this.ondata||Ft(5),this.d&&Ft(4),!this.p.length)this.p=e;else if(e.length){var t=new Me(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},r.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=XC(this.p,this.s,this.o);this.ondata(qr(n,t,this.s.b),this.d),this.o=qr(n,this.s.b-32768),this.s.b=this.o.length,this.p=qr(this.p,this.s.p/8|0),this.s.p&=7},r.prototype.push=function(e,t){this.e(e),this.c(t)},r})();var rd=typeof TextDecoder<"u"&&new TextDecoder,sd=0;try{rd.decode(au,{stream:!0}),sd=1}catch{}var id=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ht=(r,e)=>r>>>e|r<<32-e;function hi(r){return Array.from(od(new TextEncoder().encode(r)),e=>e.toString(16).padStart(8,"0")).join("")}function od(r){let e=r.length*8,t=new Uint8Array(r.length+9+63>>6<<6);t.set(r),t[r.length]=128;let n=new DataView(t.buffer);n.setUint32(t.length-8,Math.floor(e/4294967296)),n.setUint32(t.length-4,e>>>0);let s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);for(let o=0;o<t.length;o+=64){for(let d=0;d<16;d++)i[d]=n.getUint32(o+d*4);for(let d=16;d<64;d++){let x=Ht(i[d-15],7)^Ht(i[d-15],18)^i[d-15]>>>3,S=Ht(i[d-2],17)^Ht(i[d-2],19)^i[d-2]>>>10;i[d]=i[d-16]+x+i[d-7]+S>>>0}let[B,a,c,u,l,C,f,h]=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];for(let d=0;d<64;d++){let x=Ht(l,6)^Ht(l,11)^Ht(l,25),S=l&C^~l&f,E=h+x+S+id[d]+i[d]>>>0,b=Ht(B,2)^Ht(B,13)^Ht(B,22),D=B&a^B&c^a&c,y=b+D>>>0;h=f,f=C,C=l,l=u+E>>>0,u=c,c=a,a=B,B=E+y>>>0}s[0]=s[0]+B>>>0,s[1]=s[1]+a>>>0,s[2]=s[2]+c>>>0,s[3]=s[3]+u>>>0,s[4]=s[4]+l>>>0,s[5]=s[5]+C>>>0,s[6]=s[6]+f>>>0,s[7]=s[7]+h>>>0}return s}var pi=/[ \t]/,cu=/[A-Za-z0-9_]/,Bd=/^[ \t]*(function[ \t]+[^\s()]+([ \t]*\([ \t]*\))?|[^\s()=;&|<>]+[ \t]*\([ \t]*\))[ \t]*$/;function ad(r,e){let t=e,n=r[t]==="-";for(n&&t++;t<r.length&&pi.test(r[t]);)t++;let s="";for(;t<r.length&&!/[\s;&|<>()]/.test(r[t]);){let i=r[t];if(i==="'"||i==='"'){let o=r.indexOf(i,t+1);if(o<0)return;let B=r.slice(t+1,o);s+=i==='"'?B.replace(/\\([\\"$`])/g,"$1"):B,t=o+1}else i==="\\"?(s+=r[t+1]??"",t+=2):(s+=i,t++)}return s===""?void 0:{word:s,strip:n,end:t}}var Xo=class{quote="";stack=[];heredocs=[];inHeredoc=!1;cont=!1;open(){return this.quote!==""||this.stack.length>0||this.heredocs.length>0||this.cont}line(e){if(this.inHeredoc){let B=this.heredocs[0];return(B.strip?e.replace(/^\t+/,""):e)===B.word&&this.heredocs.shift(),this.inHeredoc=this.heredocs.length>0,!0}this.cont=!1;let t=this.quote!=="",n=this.quote==="",s="",i=e.length,o=0;for(;o<i;){let B=e[o];if(this.quote==="'"||this.quote==="$'"){B==="\\"&&this.quote==="$'"?o++:B==="'"&&(this.quote=""),o++;continue}if(this.quote==='"'||this.quote==="`"){B==="\\"?(o===i-1&&(this.cont=!0),o++):B===this.quote&&(this.quote=""),o++;continue}if(pi.test(B)){o++;continue}if(B==="#"&&(o===0||/[\s;&|()]/.test(e[o-1])))break;if(t=!0,B==="\\"){o===i-1&&(this.cont=!0),s="",n=!1,o+=2;continue}if(B==="'"||B==='"'||B==="`")this.quote=B;else if(B==="$"&&e[o+1]==="'")this.quote="$'",o++;else if(B==="<"&&e.startsWith("<<",o)&&e[o+2]!=="<"){let a=ad(e,o+2);if(a){this.heredocs.push({word:a.word,strip:a.strip}),o=a.end,s="x",n=!1;continue}}else if(B==="("||B===")")this.top()!=="case"&&(B==="("?this.stack.push("("):this.top()==="("&&this.stack.pop());else if(B==="{")this.stack.push("{");else if(B==="}")this.top()==="{"&&this.stack.pop();else if(n&&cu.test(B)){let a=o;for(;a<i&&cu.test(e[a]);)a++;let c=e.slice(o,a);if((a===i||/[\s;&|()<>]/.test(e[a]))&&this.keyword(c)){o=a,s=c;continue}o=a,s=c,n=!1;continue}n=B===";"||B==="&"||B==="|"||B==="("||B==="{"||B==="}"||B==="!",s=(s+B).slice(-2),o++}return this.quote===""&&(s.endsWith("|")||s.endsWith("&&"))&&(this.cont=!0),this.quote===""&&Bd.test(e.replace(/[ \t]+#.*$/,""))&&(this.cont=!0),this.inHeredoc=this.heredocs.length>0,t}top(){return this.stack[this.stack.length-1]}keyword(e){switch(e){case"if":case"case":return this.stack.push(e),!0;case"for":case"while":case"until":case"select":return this.stack.push("loop"),!0;case"fi":case"esac":case"done":{let t=e==="fi"?"if":e==="esac"?"case":"loop";return this.top()===t&&this.stack.pop(),!0}case"then":case"do":case"else":case"elif":case"in":case"function":case"time":return!0;default:return!1}}},eB=class{quote="";blockComment=!1;depth=0;cont=!1;open(){return this.quote!==""||this.blockComment||this.depth>0||this.cont}line(e){if(this.cont=!1,this.quote==="@'"||this.quote==='@"')return e.startsWith(this.quote[1]+"@")&&(this.quote=""),!0;let t=this.quote!=="",n="",s=e.length,i=0;for(;i<s;){let o=e[i];if(this.blockComment){e.startsWith("#>",i)?(this.blockComment=!1,i+=2):i++;continue}if(this.quote==="'"){(o==="'"||o==="\u2018"||o==="\u2019")&&(e[i+1]===o?i++:this.quote=""),i++;continue}if(this.quote==='"'){o==="`"?i++:o==='"'&&(e[i+1]==='"'?i++:this.quote=""),i++;continue}if(pi.test(o)){i++;continue}if(e.startsWith("<#",i)){this.blockComment=!0,i+=2;continue}if(o==="#")break;if(t=!0,o==="`"){i===s-1&&(this.cont=!0),n="`",i+=2;continue}if(o==="@"&&(e[i+1]==="'"||e[i+1]==='"')&&e.slice(i+2).trim()==="")return this.quote=e[i+1]==="'"?"@'":'@"',!0;o==="'"||o==='"'||o==="\u2018"||o==="\u2019"?this.quote=o==='"'?'"':"'":o==="("||o==="{"||o==="["?this.depth++:(o===")"||o==="}"||o==="]")&&this.depth>0&&this.depth--,n=(n+o).slice(-4),i++}return this.quote===""&&!this.blockComment&&/(\||,|(?<![=!<>+\-*/%])=|&&|\|\||-and|-or)$/i.test(n)&&(this.cont=!0),t}},tB=class{depth=0;cont=!1;open(){return this.depth>0||this.cont}line(e){if(this.cont=!1,this.depth===0&&/^[ \t]*(@?rem([ \t].*)?$|:)/i.test(e))return!1;let t=!1,n=!1;for(let s=0;s<e.length;s++){let i=e[s];if(pi.test(i)||(n=!0),i==='"')t=!t;else{if(t)continue;i==="^"?(s===e.length-1&&(this.cont=!0),s++):i==="("?this.depth++:i===")"&&this.depth>0&&this.depth--}}return n}};function ld(r){return r==="pwsh"?new eB:r==="cmd"?new tB:new Xo}function ud(r,e){return r==="pwsh"&&/^[ \t]*(\||(else|elseif|catch|finally)\b)/i.test(e)}function fu(r,e){let t=mn(r),n=ld(e),s=[],i,o=a=>{s.push({start:i,end:a,text:t.slice(i,a+1).map((c,u,l)=>c.text+(u<l.length-1?c.eol:"")).join("")}),i=void 0},B=a=>t.slice(a+1).find(c=>c.text.trim()!=="")?.text;for(let a=0;a<t.length;a++){let c=n.line(t[a].text);if(i===void 0){if(!c)continue;i=a}if(n.open())continue;let u=B(a);u!==void 0&&ud(e,u)||o(a)}if(i!==void 0){let a=t.length-1;for(;a>i&&t[a].text.trim()==="";)a--;o(a)}return s}var rB="md-runbook",du="md-runbook-manifest 1",hu=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,99}$/,cd=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,fd=/^\d{4}-\d{2}-\d{2}$/,Cd=r=>fd.test(r)&&new Date(`${r}T00:00:00Z`).toISOString().slice(0,10)===r;function Cu(r){return/^(PATH|IFS|ENV|BASH_ENV|CDPATH|GLOBIGNORE|HOME|SHELL|SHELLOPTS|BASHOPTS|PS[1-4]|PROMPT_COMMAND|PWD|OLDPWD|TMPDIR|LANG|LANGUAGE)$/.test(r)||/^(LC_|LD_|DYLD_|BASH_FUNC_|__mdrb_|MD_RUNBOOK_GATE_)/.test(r)}var dd=/\\[dDwWsSbB1-9]|\(\?|[*+?}]\?/,Vr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Pt(r){let e=new TextEncoder().encode(r),t="";for(let n=0;n<e.length;n+=3){let s=e[n],i=e[n+1],o=e[n+2];t+=Vr[s>>2]+Vr[(s&3)<<4|(i??0)>>4],t+=i===void 0?"=":Vr[(i&15)<<2|(o??0)>>6],t+=o===void 0?"=":Vr[o&63]}return t}function pu(r){if(r.length%4!==0||!/^[A-Za-z0-9+/]*={0,2}$/.test(r))return;let e=r.endsWith("==")?2:r.endsWith("=")?1:0,t=new Uint8Array(r.length/4*3-e),n=0;for(let i=0;i<r.length;i+=4){let o=[0,1,2,3].map(a=>r[i+a]==="="?0:Vr.indexOf(r[i+a])),B=o[0]<<18|o[1]<<12|o[2]<<6|o[3];for(let a of[B>>16,B>>8&255,B&255])n<t.length&&(t[n++]=a)}let s=new TextDecoder().decode(t);return Pt(s)===r?s:void 0}function gu(r){let e=[];return he(r).cells.forEach((t,n)=>{t.kind==="code"&&ce(t.meta)&&Pe(t.languageId)&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function nB(r){let e=[];return he(r).cells.forEach((t,n)=>{t.kind!=="code"||!ce(t.meta)||Ie(t.languageId)==="bash"&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function hd(r){let e=[],t=null,n=!1;return r.split(/\r?\n/).forEach((s,i)=>{if(t){Ke(s,t)&&(/^( {4}|\t| {0,3}\t)/.test(s)&&e.push(`line ${i+1}: a closing fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),t=null);return}let o=Je(s);if(o){/^( {4}|\t| {0,3}\t)/.test(o.indent)&&e.push(`line ${i+1}: a fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),n&&Ie(Zt(o.info))==="bash"&&e.push(`line ${i+1}: a bash block inside an HTML comment (<!-- \u2026 -->) is hidden on GitHub but would be signed`),t=o;return}for(let B of s.matchAll(/<!--|-->/g))n=B[0]==="<!--"}),e}function sB(r,e){let t=[];hu.test(e.name)||t.push(`name "${e.name}": use letters, digits and . _ / - (at most 100)`),(!Number.isInteger(e.version)||e.version<1)&&t.push(`version ${e.version}: expected a positive whole number`),e.expires!==void 0&&!Cd(e.expires)&&t.push(`expires ${e.expires}: expected a date, YYYY-MM-DD`);for(let c of e.scopes)cd.test(c)||t.push(`scope "${c}": use letters, digits and . _ - (at most 64)`);for(let[c,u]of Object.entries(e.patterns))At.test(c)?Cu(c)&&t.push(`\${param:${c}}: ${c} can't be a parameter of a signed runbook (it changes how the shell runs the code)`):t.push(`pattern for "${c}": not a parameter name`),u===""||/[\r\n]/.test(u)?t.push(`pattern for ${c}: empty or more than one line`):dd.test(u)&&t.push(`pattern for ${c}: ${u} uses JavaScript-only syntax (\\d, \\w, (?\u2026), lazy *?, back-references); servers check it with grep -E: use [0-9], [A-Za-z0-9_], \u2026`);t.push(...hd(Du(r)));let n=Ue(r)?.shell?.unix;n&&n!=="bash"&&t.push(`front matter shell: ${n}: servers run signed runbooks in bash; remove it, or write shell: bash`);let s=new Set;for(let c of nB(r))for(let u of ge(c.info).checks?.captures??[])u.secret&&s.add(u.name);let i=[];for(let c of nB(r)){let u=i.length+1,l=`cell ${u} (${c.value.split(`
|
|
95
|
+
`)[0]?.slice(0,40)??""})`,C=ge(c.info);for(let d of C.errors)t.push(`${l}: invalid option ${d}`);let f=[];try{for(let d of st(c.value)){let x=`\${${d.kind}:${d.name}${d.kind==="input"&&d.secret?":secret":""}}`;d.kind==="secret"?t.push(`${l}: ${x} can't be signed (servers log the values signed cells get)`):d.secret?t.push(`${l}: ${x} can't be signed: a secret input would be in the servers' logs`):d.kind==="out"&&s.has(d.name)?t.push(`${l}: ${x} comes from capture-secret= and can't be signed (servers log the values)`):e.patterns[d.name]===void 0?t.push(`${l}: ${x} needs a pattern (--pattern ${d.name}=REGEX)`):f.includes(d.name)||f.push(d.name)}}catch(d){t.push(`${l}: ${d instanceof Error?d.message:String(d)}`)}for(let d of c.value.matchAll(/\$\{(secret|input|param|out):[^}\s]*/g))/^\$\{((secret|param|out):[A-Za-z_][A-Za-z0-9_]*|input:[A-Za-z_][A-Za-z0-9_]*(:secret)?)$/.test(d[0])||t.push(`${l}: ${d[0]}} is not a plain \${${d[1]}:NAME} and can't be signed`);let h=On(C.kubeContext);h!==void 0&&e.patterns[h]===void 0&&t.push(`${l}: kube-context=\${param:${h}} needs a pattern (--pattern ${h}=REGEX)`);for(let[d,x]of Object.entries(C.env))At.test(d)?Cu(d)&&t.push(`${l}: env.${d} can't be set by a signed runbook (it changes how the shell runs the code)`):t.push(`${l}: env.${d} is not a variable name`),/\$\{(secret|input|param|out):/.test(x)&&t.push(`${l}: env.${d} can't use placeholders in a signed runbook`);i.push({n:u,lines:C.lines==="any"?"any":"all",info:c.info,code:sr(c.value,"bash"),needs:f,...C.cwd!==void 0?{cwd:C.cwd}:{},env:C.env,steps:fu(c.value,"bash").map(d=>sr(d.text,"bash"))})}let o=[];for(let c of gu(r)){let u=o.length+1,l=`runbook call ${u} (src=${Ve(c.info,c.value).src??"?"})`,C=Ve(c.info,c.value);for(let h of C.problems)t.push(`${l}: ${h.message}`);for(let h of ge(c.info).errors)t.push(`${l}: invalid option ${h}`);C.src!==void 0&&/^([A-Za-z]:)?[\\/]/.test(C.src)&&t.push(`${l}: src= must be relative: a signed runbook calls runbooks in its own repository`);let f=[];try{for(let h of Mt(C)){let d=`\${${h.kind}:${h.name}}`;h.kind==="secret"||h.secret?t.push(`${l}: ${d} can't be signed: pass secrets to the runbook called another way`):e.patterns[h.name]===void 0?t.push(`${l}: ${d} needs a pattern (--pattern ${h.name}=REGEX)`):f.includes(h.name)||f.push(h.name)}}catch(h){t.push(`${l}: ${h instanceof Error?h.message:String(h)}`)}o.push({n:u,info:c.info,body:c.value,needs:f})}if(i.length===0&&o.length===0&&t.push("no bash or sh cells to sign"),t.length>0)return{errors:t};let B=new Set([...i.flatMap(c=>c.needs),...o.flatMap(c=>c.needs)]),a=Object.fromEntries(Object.entries(e.patterns).filter(([c])=>B.has(c)));return{manifest:{...e,scopes:[...new Set(e.scopes)],patterns:a,cells:i,calls:o}}}function iB(r){let e=[du,`name ${r.name}`,`version ${r.version}`];r.expires&&e.push(`expires ${r.expires}`),r.scopes.length>0&&e.push(`scope ${r.scopes.join(" ")}`);for(let[t,n]of Object.entries(r.patterns))e.push(`param ${t} ${Pt(n)}`);for(let t of r.cells){e.push(`cell ${t.n} ${t.lines}`,`info ${Pt(t.info)}`,`code ${Pt(t.code)}`);for(let n of t.needs)e.push(`needs ${n}`);t.cwd!==void 0&&e.push(`cwd ${Pt(t.cwd)}`);for(let[n,s]of Object.entries(t.env))e.push(`env ${n} ${Pt(s)}`);for(let n of t.steps)e.push(`step ${Pt(n)}`)}for(let t of r.calls){e.push(`call ${t.n}`,`callinfo ${Pt(t.info)}`,`callbody ${Pt(t.body)}`);for(let n of t.needs)e.push(`callneeds ${n}`)}return e.push("end"),e.join(`
|
|
90
96
|
`)+`
|
|
91
|
-
`}function
|
|
92
|
-
`);if(e[0]!==
|
|
93
|
-
`).trimEnd(),
|
|
97
|
+
`}function Zr(r){let e=r.split(`
|
|
98
|
+
`);if(e[0]!==du)throw new Error("not an md-runbook manifest (or a newer version)");let t={name:"",version:0,scopes:[],patterns:{},cells:[],calls:[]},n,s,i=c=>{if(!s)throw new Error(`manifest: ${c} outside a call`);return s},o=(c,u)=>{let l=c===void 0?void 0:pu(c);if(l===void 0)throw new Error(`manifest: bad ${u}`);return l},B=c=>{if(!n)throw new Error(`manifest: ${c} outside a cell`);return n},a=!1;for(let c of e.slice(1)){if(a){if(c!=="")throw new Error("manifest: text after end");continue}if(c==="")continue;let[u,l,C,...f]=c.split(" ");if(f.length>0&&u!=="scope")throw new Error(`manifest: bad line "${c.slice(0,40)}"`);switch(u){case"name":t.name=l??"";break;case"version":t.version=Number(l);break;case"expires":t.expires=l;break;case"scope":t.scopes=c.split(" ").slice(1);break;case"param":t.patterns[l??""]=o(C,"pattern");break;case"cell":n={n:Number(l),lines:C==="any"?"any":"all",info:"",code:"",needs:[],env:{},steps:[]},t.cells.push(n);break;case"info":B("info").info=o(l,"info");break;case"code":B("code").code=o(l,"code");break;case"needs":B("needs").needs.push(l??"");break;case"cwd":B("cwd").cwd=o(l,"cwd");break;case"env":B("env").env[l??""]=o(C,"env");break;case"step":B("step").steps.push(o(l,"step"));break;case"call":s={n:Number(l),info:"",body:"",needs:[]},t.calls.push(s);break;case"callinfo":i("callinfo").info=o(l,"callinfo");break;case"callbody":i("callbody").body=o(l,"callbody");break;case"callneeds":i("callneeds").needs.push(l??"");break;case"end":a=!0;break;default:throw new Error(`manifest: unknown item "${u}"`)}}if(!a)throw new Error("manifest: no end");if(!hu.test(t.name)||!Number.isInteger(t.version)||t.version<1)throw new Error("manifest: bad name or version");return t}var pd=/^<!-- md-runbook:signature v1 signer=(\S+) signed=(\d{4}-\d{2}-\d{2})\r?\nmanifest\r?\n([A-Za-z0-9+/=\r\n]+?)\r?\nsignature\r?\n([A-Za-z0-9+/=\r\n]+?)((?:\r?\ncosign signer=\S+ signed=\d{4}-\d{2}-\d{2}\r?\n[A-Za-z0-9+/=\r\n]+?)*)\r?\n-->[ \t]*$/m,gd=/cosign signer=(\S+) signed=(\d{4}-\d{2}-\d{2})\r?\n([A-Za-z0-9+/=\r\n]+?)(?=\r?\ncosign |$)/g,gi=r=>r.replace(/.{1,76}/g,`$&
|
|
99
|
+
`).trimEnd(),rn=r=>r.replace(/[^\w@.+-]+/g,"_").replace(/-{2,}/g,"-")||"unknown";function md(r){return`<!-- md-runbook:signature v1 signer=${rn(r.signer)} signed=${r.signed}
|
|
94
100
|
manifest
|
|
95
|
-
${
|
|
101
|
+
${gi(Pt(r.manifest))}
|
|
96
102
|
signature
|
|
97
|
-
${
|
|
98
|
-
`+(r.cosigners??[]).map(e=>`cosign signer=${
|
|
99
|
-
${
|
|
100
|
-
`).join("")+"-->"}function
|
|
101
|
-
`)){let o
|
|
103
|
+
${gi(r.signature)}
|
|
104
|
+
`+(r.cosigners??[]).map(e=>`cosign signer=${rn(e.signer)} signed=${e.signed}
|
|
105
|
+
${gi(e.signature)}
|
|
106
|
+
`).join("")+"-->"}function mu(r){let e=new Set,t=null,n=0;for(let o of r.split(`
|
|
107
|
+
`)){let B=o.replace(/\r$/,"");t?(e.add(n),Ke(B,t)&&(t=null)):t=Je(B),n+=o.length+1}let s=new RegExp(pd.source,"gm"),i;for(let o=s.exec(r);o;o=s.exec(r))e.has(o.index)||(i=o);return i}function oB(r){let e=mu(r);if(!e)return;let t=pu(e[3].replace(/\s+/g,""));if(t===void 0)return;let n=[...(e[5]??"").trim().matchAll(gd)].map(s=>({signer:s[1],signed:s[2],signature:s[3].replace(/\s+/g,"")}));return{signer:e[1],signed:e[2],manifest:t,signature:e[4].replace(/\s+/g,""),...n.length?{cosigners:n}:{}}}function Eu(r,e){let t;try{t=Zr(e.manifest)}catch{return!1}let n=sB(r,{name:t.name,version:t.version,...t.expires?{expires:t.expires}:{},scopes:t.scopes,patterns:t.patterns});return!("errors"in n)&&iB(n.manifest)===e.manifest}function mi(r){return[r.signature,...(r.cosigners??[]).map(e=>e.signature)]}function BB(r){return[r.signer,...(r.cosigners??[]).map(e=>e.signer)]}function Du(r){let e=mu(r);return e?r.slice(0,e.index).replace(/(\r?\n)[ \t]*(\r?\n)+$/,"$1")+r.slice(e.index+e[0].length).replace(/^\r?\n/,""):r}function aB(r,e){let t=Du(r),n=/\r\n/.test(t)?`\r
|
|
102
108
|
`:`
|
|
103
|
-
`,s=
|
|
104
|
-
${
|
|
109
|
+
`,s=md(e).replace(/\n/g,n),i=t.replace(/(\r?\n)*$/,"");return(i===""?"":i+n+n)+s+n}function bu(r){return`-----BEGIN SSH SIGNATURE-----
|
|
110
|
+
${gi(r)}
|
|
105
111
|
-----END SSH SIGNATURE-----
|
|
106
|
-
`}function
|
|
107
|
-
`).trimEnd();function
|
|
112
|
+
`}function wu(r){let e=/-----BEGIN SSH SIGNATURE-----([\s\S]*?)-----END SSH SIGNATURE-----/.exec(r);if(!e)throw new Error("not an SSH signature");return e[1].replace(/\s+/g,"")}function It(r){let e=oB(r);if(!e)return;let t;try{t=Zr(e.manifest)}catch{return}let n=[...t.cells],s=new Map,i=[],o=[],B=0;for(let u of nB(r)){let l=sr(u.value,"bash"),C=n.findIndex(h=>h.info===u.info&&h.code===l);if(C<0){i.push(u.index);continue}let f=n.splice(C,1)[0];s.set(u.index,{n:f.n,lines:f.lines,steps:f.steps,needs:f.needs}),f.n<B&&o.push(u.index),B=Math.max(B,f.n)}let a=[...t.calls],c=new Map;for(let u of gu(r)){let l=a.findIndex(C=>C.info===u.info&&C.body===u.value);l<0?i.push(u.index):c.set(u.index,a.splice(l,1)[0])}return{block:e,manifest:t,cells:s,changed:i.sort((u,l)=>u-l),missing:n.map(u=>u.n),moved:o,calls:c,missingCalls:a.map(u=>u.n)}}var Di="mdrunbook://open",Ed=256*1024,Dd=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,bd=/^[0-9a-f]{64}$/;function Ei(r){let e;try{e=new URL(r.trim())}catch{return{ok:!1,problem:"not-a-link"}}let t=e.searchParams;if(!(e.protocol==="mdrunbook:"||e.protocol==="https:"&&/\/open\/?$/.test(e.pathname)&&(t.has("url")||t.has("rb"))))return e.protocol==="https:"?{ok:!0,link:{url:e.toString(),params:{}}}:{ok:!1,problem:"not-a-link"};let s={params:{}},i=t.get("url"),o=t.get("rb");if(i!==null&&o!==null)return{ok:!1,problem:"both"};if(i!==null){try{if(new URL(i).protocol!=="https:")return{ok:!1,problem:"not-https"}}catch{return{ok:!1,problem:"not-https"}}s.url=i}else if(o!==null){let c=kd(o);if(typeof c!="string")return{ok:!1,problem:c.problem};s.text=c}else return{ok:!1,problem:"no-runbook"};let B=t.get("sha256");if(B!==null){if(!bd.test(B.toLowerCase()))return{ok:!1,problem:"bad-sha256"};s.sha256=B.toLowerCase()}let a=t.get("host");if(a!==null){if(!Dd.test(a))return{ok:!1,problem:"bad-host"};s.host=a}for(let[c,u]of t){if(!c.startsWith("p."))continue;let l=c.slice(2);if(!At.test(l)||/[\r\n]/.test(u))return{ok:!1,problem:"bad-param"};s.params[l]=u}return t.get("action")==="cosign"&&(s.action="cosign"),{ok:!0,link:s}}function es(r,e=Di){let t=[],n=(s,i)=>t.push(`${encodeURIComponent(s)}=${encodeURIComponent(i)}`);r.url!==void 0?n("url",r.url):r.text!==void 0&&n("rb",Su(r.text)),r.sha256&&n("sha256",r.sha256),r.host&&n("host",r.host);for(let[s,i]of Object.entries(r.params))n(`p.${s}`,i);return r.action&&n("action",r.action),`${e}?${t.join("&")}`}var ku="vscode://smojon.md-runbook/open",wd=/[&=#+%]/;function xu(r){return[r.url,r.text!==void 0?Su(r.text):void 0,r.sha256,r.host,...Object.entries(r.params).flat()].some(t=>t!==void 0&&wd.test(t))?`${ku}?link=${encodeURIComponent(es(r))}`:es(r,ku)}function vu(r){if(r.startsWith("link="))return Ei(r.slice(5));let e=r.split("&").map(t=>{let n=t.indexOf("=");return n<0?encodeURIComponent(t):`${encodeURIComponent(t.slice(0,n))}=${encodeURIComponent(t.slice(n+1))}`});return Ei(`${Di}?${e.join("&")}`)}function ts(r){return hi(r.replace(/^/,""))}function Su(r){return xd(lu(new TextEncoder().encode(r),{level:9}))}function kd(r){let e;try{e=vd(r)}catch{return{problem:"bad-text"}}let t=[],n=0,s=!1,i=new uu(a=>{n+=a.length,n>Ed?s=!0:t.push(a)});try{for(let a=0;a<e.length&&!s;a+=4096)i.push(e.subarray(a,a+4096),a+4096>=e.length)}catch{return{problem:"bad-text"}}if(s)return{problem:"too-large"};let o=new Uint8Array(n),B=0;for(let a of t)o.set(a,B),B+=a.length;try{return new TextDecoder().decode(o)}catch{return{problem:"bad-text"}}}var Xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function xd(r){let e="";for(let t=0;t<r.length;t+=3){let n=r[t]<<16|(r[t+1]??0)<<8|(r[t+2]??0);e+=Xr[n>>18&63]+Xr[n>>12&63],t+1<r.length&&(e+=Xr[n>>6&63]),t+2<r.length&&(e+=Xr[n&63])}return e}function vd(r){let e=r.replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_");if(/[^A-Za-z0-9_-]/.test(e)||e.length%4===1)throw new Error("not base64url");let t=new Uint8Array(Math.floor(e.length*3/4)),n=0,s=0,i=0;for(let o of e)s=s<<6|Xr.indexOf(o),n+=6,n>=8&&(n-=8,t[i++]=s>>n&255);return t}var yu="[A-Za-z0-9+/=\\r\\n]+?",Au=new RegExp(`^<!-- md-runbook:record-signature v1 signer=(\\S+) signed=(\\S+) sha256=([0-9a-f]{64})\\r?\\nsignature\\r?\\n(${yu})((?:\\r?\\ncosign signer=\\S+ signed=\\S+\\r?\\n${yu})*)\\r?\\n-->[ \\t]*$`,"m"),Sd=/cosign signer=(\S+) signed=(\S+)\r?\n([A-Za-z0-9+/=\r\n]+?)(?=\r?\ncosign |$)/g,Ou=r=>r.replace(/.{1,76}/g,`$&
|
|
113
|
+
`).trimEnd();function lB(r){return`md-runbook run record v1
|
|
108
114
|
sha256 ${r}
|
|
109
|
-
`}function
|
|
115
|
+
`}function yd(r){let e=Au.exec(r);if(!e)return;let t=[...(e[5]??"").trim().matchAll(Sd)].map(n=>({signer:n[1],signed:n[2],signature:n[3].replace(/\s+/g,"")}));return{signer:e[1],signed:e[2],sha256:e[3],signature:e[4].replace(/\s+/g,""),...t.length?{cosigners:t}:{}}}function Ru(r){let e=Au.exec(r);return e?r.slice(0,e.index).replace(/(\r?\n)[ \t]*(\r?\n)+$/,"$1")+r.slice(e.index+e[0].length).replace(/^\r?\n/,""):r}function bi(r){return ts(Ru(r))}function Od(r){return`<!-- md-runbook:record-signature v1 signer=${rn(r.signer)} signed=${r.signed} sha256=${r.sha256}
|
|
110
116
|
signature
|
|
111
|
-
${
|
|
112
|
-
`+(r.cosigners??[]).map(e=>`cosign signer=${
|
|
113
|
-
${
|
|
114
|
-
`).join("")+"-->"}function
|
|
117
|
+
${Ou(r.signature)}
|
|
118
|
+
`+(r.cosigners??[]).map(e=>`cosign signer=${rn(e.signer)} signed=${e.signed}
|
|
119
|
+
${Ou(e.signature)}
|
|
120
|
+
`).join("")+"-->"}function Fu(r,e){let t=Ru(r),n=/\r\n/.test(t)?`\r
|
|
115
121
|
`:`
|
|
116
|
-
`;return`${t.replace(/(\r?\n)*$/,"")}${n}${n}${
|
|
117
|
-
`)){let n=/^ {0,3}(`{3,}|~{3,})/.exec(t)?.[1];if(e!==void 0){n&&n[0]===e[0]&&n.length>=e.length&&t.trim()===n&&(e=void 0);continue}if(n){e=n;continue}let s=/^ {0,3}#{1,6}[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/.exec(t);if(s?.[1])return s[1].replace(/[*_`]/g,"")}}function
|
|
122
|
+
`;return`${t.replace(/(\r?\n)*$/,"")}${n}${n}${Od(e).replace(/\n/g,n)}${n}`}function ns(r){let e=yd(r);return e?{block:e,unchanged:bi(r)===e.sha256}:void 0}var ur=r=>[r.signer,...(r.cosigners??[]).map(e=>e.signer)];function Iu(r,e){return{...r,cosigners:[...(r.cosigners??[]).filter(t=>t.signer!==rn(e.signer)),e]}}function uB(r,e,t){return r===void 0?"none":t==="failed"?"fail":t==="ok"||r==="0"||r==="done"?e===void 0?"ok":"none":r==="running"||r==="declined"||r==="proposed"?"none":r==="skipped"?"skip":"fail"}function Ad(r,e,t){if(e!==void 0&&uB(r,e,t)==="none")return`<span class="badge none">${re(`\u2013 lines ${e} ran`)}</span>`;if(t==="failed")return`<span class="badge fail">${re("\u2717 check failed")}</span>`;if(t==="ok")return`<span class="badge ok">${re(`\u2713 ${/^-?\d+$/.test(r??"")?`exit ${r}`:r??""}`)}</span>`;let n=uB(r),s=r!==void 0&&!/^-?\d+$/.test(r),i=n==="none"?s?`\u2013 ${r}`:"not run":n==="ok"?s?`\u2713 ${r}`:"\u2713 exit 0":n==="skip"?"\u2013 skipped":`\u2717 ${/^-?\d+$/.test(r)?`exit ${r}`:r}`;return`<span class="badge ${n}">${re(i)}</span>`}function Rd(r){let e;for(let t of r.split(`
|
|
123
|
+
`)){let n=/^ {0,3}(`{3,}|~{3,})/.exec(t)?.[1];if(e!==void 0){n&&n[0]===e[0]&&n.length>=e.length&&t.trim()===n&&(e=void 0);continue}if(n){e=n;continue}let s=/^ {0,3}#{1,6}[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/.exec(t);if(s?.[1])return s[1].replace(/[*_`]/g,"")}}function Fd(r){let e=r.split(`
|
|
118
124
|
`);if(e[0]?.replace(/^\uFEFF/,"").trimEnd()!=="---")return;let t=e.findIndex((n,s)=>s>0&&/^(---|\.\.\.)[ \t]*$/.test(n));if(!(t<0))return{yaml:e.slice(1,t).join(`
|
|
119
125
|
`),rest:e.slice(t+1).join(`
|
|
120
|
-
`)}}function
|
|
121
|
-
`,
|
|
122
|
-
`).find(
|
|
123
|
-
`,
|
|
124
|
-
<div class="step-head">Step ${
|
|
125
|
-
`,
|
|
126
|
-
`}i
|
|
127
|
-
|
|
126
|
+
`)}}function Id(r,e){let t=[];for(let n of[...r.split("/"),...e.split(/[\\/]+/)])n===""||n==="."||(n===".."&&t.length>0&&t[t.length-1]!==".."?t.pop():t.push(n));return t.join("/")}function $u(r,e,t,n,s,i,o=""){let B=he(r),a,c="",u="",l=0,C=0,f=E=>{let b=B.cells[E].meta;return ce(b)?ge(b.info).os:void 0},h=Fn(B.cells.map((E,b)=>ce(E.meta)?{kind:"code",os:f(b)}:{kind:"markup"})),d=new Map;h.forEach((E,b)=>{if(!E)return;let D=d.get(E.group);(D===void 0||!B.cells[D].output&&B.cells[b].output)&&d.set(E.group,b)});let x=en(B.cells.map((E,b)=>ce(E.meta)?{kind:"code",os:f(b)}:{kind:"markup"})),S=new Map;x.forEach((E,b)=>E!==void 0&&S.set(b,E)),l=Math.max(0,...x.filter(E=>E!==void 0));for(let[E,b]of B.cells.entries()){if(!ce(b.meta)){let ne=b.value;if(E===0){let ie=Fd(ne);ie&&(u+=`<div class="front-matter">${js(n(ie.yaml),"front matter")}</div>
|
|
127
|
+
`,ne=ie.rest)}a??=Rd(ne),u+=ho(ne,n);continue}let D=h[E],y=D!==void 0&&d.get(D.group)!==E,v=S.get(E),$=b.output?.attrs??{},k=y?"skip":uB($.exit,$.lines,$.check);y||s[k]++;let m=y?`<span class="badge skip">${re(`\u2013 for ${ir(f(E)??[])}`)}</span>`:Ad($.exit,$.lines,$.check),L=`${e}${v}`,A=y?`step-${L.replace(/\./g,"-")}-${E}`:`step-${L.replace(/\./g,"-")}`,H=b.meta.lang,Y=n(b.value),z=Y.split(`
|
|
128
|
+
`).find(ne=>ne.trim()!=="")?.trim()??"",te=ge(b.meta.info).estimateSeconds,Z=te!==void 0?`est. ${it(te)}`:void 0;if(c+=`<tr class="${k}${e?" nested":""}"><td><a href="#${A}">${L}</a></td><td><code>${re(z)}</code></td><td>${re(H)}</td><td>${m}</td><td>${re($.ran??"")}</td><td>${re([$.duration,Z].filter(Boolean).join(" \xB7 "))}</td></tr>
|
|
129
|
+
`,u+=`<section class="step ${k}" id="${A}">
|
|
130
|
+
<div class="step-head">Step ${L}${y?" (alternative)":""}</div>
|
|
131
|
+
`,u+=js(Y,H),b.output){let ne=[$.ran&&`ran ${$.ran}`,$.duration,Z].filter(Boolean).map(ie=>re(ie));u+=`<div class="output"><div class="output-head">${m} ${ne.join(" \xB7 ")}</div><pre>${re(n(yt(b.output.text)))}</pre></div>
|
|
132
|
+
`}let Q=Pe(b.meta.lang)?ii($):void 0;if(Q&&t.readCall&&i<Br){let ne=Id(o,Q.copy),ie=t.readCall(ne);if(ie===void 0)u+=`<p class="call-note">${re(`The copy ${ne} is not there: its steps can't be shown.`)}</p>
|
|
133
|
+
`;else{let De=Q.sha256===void 0||hi(ie)===Q.sha256;u+=`<div class="call"><p class="call-note">Ran <code>${re(Q.runbook)}</code> as <a href="${re(encodeURI(ne))}"><code>${re(ne)}</code></a>`+(De?"":` \xB7 <span class="badge fail">${re("\u2717 the copy changed after the run (its SHA-256 differs)")}</span>`)+`</p>
|
|
134
|
+
`;let de=$u(ie,`${L}.`,t,n,s,i+1,ne.includes("/")?ne.slice(0,ne.lastIndexOf("/")):"");c+=de.rows,C+=de.total,u+=de.body+`</div>
|
|
135
|
+
`}}u+=`</section>
|
|
136
|
+
`}return{rows:c,body:u,...a!==void 0?{title:a}:{},step:l,total:l+C}}function cB(r,e){let t=l=>e.redact?e.redact(l):l,n={ok:0,fail:0,skip:0,none:0},{rows:s,body:i,title:o,total:B}=$u(r,"",e,t,n,0),a=o??e.fallbackTitle??"Runbook report",c=[`${B} step${B===1?"":"s"}`,`${n.ok} passed`,`${n.fail} failed`];n.skip&&c.push(`${n.skip} skipped`),n.none&&c.push(`${n.none} not run`);let u=$d(fi(r),ns(r),t);return`<!DOCTYPE html>
|
|
128
137
|
<html lang="en">
|
|
129
138
|
<head>
|
|
130
139
|
<meta charset="utf-8">
|
|
131
140
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'">
|
|
132
141
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
133
142
|
<meta name="generator" content="md-runbook">
|
|
134
|
-
<title>${
|
|
135
|
-
<style>${
|
|
143
|
+
<title>${re(a)}</title>
|
|
144
|
+
<style>${fB}${u.pageCss}</style>
|
|
136
145
|
</head>
|
|
137
146
|
<body>
|
|
138
147
|
<header>
|
|
139
|
-
<h1 class="title">${
|
|
140
|
-
<p class="meta">Generated ${
|
|
148
|
+
<h1 class="title">${Xt(a)}</h1>
|
|
149
|
+
<p class="meta">Generated ${re(Fe(e.generatedAt))} \xB7 ${c.join(" \xB7 ")}</p>
|
|
141
150
|
</header>
|
|
142
|
-
${
|
|
151
|
+
${u.html}<table class="summary">
|
|
143
152
|
<thead><tr><th>#</th><th>Command</th><th>Shell</th><th>Exit</th><th>Ran</th><th>Duration</th></tr></thead>
|
|
144
153
|
<tbody>
|
|
145
|
-
${
|
|
154
|
+
${s}</tbody>
|
|
146
155
|
</table>
|
|
147
156
|
<main>
|
|
148
157
|
${i}</main>
|
|
149
158
|
</body>
|
|
150
159
|
</html>
|
|
151
|
-
`}var
|
|
160
|
+
`}var fB=`
|
|
152
161
|
:root{--bg:#fff;--fg:#1f2328;--muted:#656d76;--border:#d0d7de;--code:#f6f8fa;--ok:#1a7f37;--fail:#cf222e;--skip:#9a6700;--link:#0969da}
|
|
153
162
|
@media (prefers-color-scheme:dark){:root{--bg:#0d1117;--fg:#e6edf3;--muted:#8d96a0;--border:#30363d;--code:#161b22;--ok:#3fb950;--fail:#f85149;--skip:#d29922;--link:#4493f8}}
|
|
154
163
|
*{box-sizing:border-box}
|
|
@@ -173,6 +182,8 @@ th,td{border:1px solid var(--border);padding:4px 8px;text-align:left;vertical-al
|
|
|
173
182
|
.step-head{font-weight:600;color:var(--muted);font-size:13px}
|
|
174
183
|
.output-head{margin:6px 0 4px;color:var(--muted);font-size:13px}
|
|
175
184
|
.output pre{white-space:pre-wrap;word-break:break-word}
|
|
185
|
+
.call{margin:8px 0 0 8px}.call-note{color:var(--muted);font-size:13px}
|
|
186
|
+
.summary tr.nested td:first-child{padding-left:20px}
|
|
176
187
|
li.task{list-style:none}
|
|
177
188
|
blockquote{margin:0;padding:0 1em;color:var(--muted);border-left:.25em solid var(--border)}
|
|
178
189
|
.record{margin:16px 0 24px}
|
|
@@ -185,89 +196,94 @@ blockquote{margin:0;padding:0 1em;color:var(--muted);border-left:.25em solid var
|
|
|
185
196
|
.badge.milestone{color:var(--link)}
|
|
186
197
|
.earlier{font-size:12px;color:var(--muted)}
|
|
187
198
|
@media print{.facts div,.timeline tr{break-inside:avoid}.timeline tr.note td{background:none}}
|
|
188
|
-
`,
|
|
189
|
-
`}).join(""),
|
|
199
|
+
`,rs=r=>r.replace("T"," ").replace(/([+-]\d\d:\d\d|Z)$/," $1");function $d(r,e,t){let n=r.summary;if(r.events.length===0&&!n.incident&&!e)return{html:"",pageCss:""};let s=[];n.incident&&s.push([n.drill?"Drill":"Incident",[n.incident,n.severity].filter(Boolean).join(" \xB7 ")]),n.start&&s.push(["Start",rs(n.start)]),n.end&&s.push(["End",rs(n.end)]),n.durationSeconds!==void 0&&s.push(["Duration",zr(n.durationSeconds)]);for(let l of _o)n.milestones[l]&&s.push([l[0].toUpperCase()+l.slice(1),rs(n.milestones[l])]);if(n.timeToMitigateSeconds!==void 0&&s.push(["Time to mitigate",zr(n.timeToMitigateSeconds)]),n.timeToResolveSeconds!==void 0&&s.push(["Time to resolve",zr(n.timeToResolveSeconds)]),n.rtoSeconds!==void 0&&s.push(["RTO",`${zr(n.rtoSeconds)}${n.rtoMet===void 0?"":n.rtoMet?" \xB7 met":" \xB7 missed"}`]),s.push(["Runs",`${n.runs}${n.failedAttempts?` \xB7 ${n.failedAttempts} failed`:""}`]),n.endpointChecks&&s.push(["Endpoint checks",`${n.endpointChecks.total}${n.endpointChecks.failed?` \xB7 ${n.endpointChecks.failed} failed`:" \xB7 all up"}`]),n.people.length&&s.push(["People",n.people.join(", ")]),n.places.length&&s.push(["Ran on",n.places.join(", ")]),e){let l=ur(e.block).join(", ");s.push(["Record signed",e.unchanged?`by ${l} \xB7 unchanged since`:`by ${l} \xB7 CHANGED since signing`])}let i=s.map(([l,C])=>`<div${l==="Record signed"&&e&&!e.unchanged?' class="changed"':""}><dt>${re(l)}</dt><dd>${re(t(C))}</dd></div>`).join(""),o=r.events.map(l=>{let C=l.kind==="note"?`${l.milestone?`<span class="badge milestone">${re(l.milestone)}</span> `:""}${re(t(l.text??"")).replace(/\n/g,"<br>")}`:`<a href="#step-${l.step}">${l.step}</a> <code>${re(t(l.label??""))}</code>${l.earlier?' <span class="earlier">earlier attempt</span>':""}`,f=l.kind==="note"?"":`<span class="badge ${l.ok?l.exit==="skipped"?"skip":"ok":"fail"}">${re(l.check==="failed"?"check failed":l.exit==="0"?"exit 0":/^-?\d+$/.test(l.exit??"")?`exit ${l.exit}`:l.exit??"")}</span>`;return`<tr class="${l.kind}"><td>${re(rs(l.at))}</td><td>${C}</td><td>${re(t(l.by??""))}</td><td>${re(t(l.on??""))}</td><td>${f}</td><td>${re(l.duration??"")}</td></tr>
|
|
200
|
+
`}).join(""),B=r.events.flatMap(l=>(l.checks??[]).map(C=>({e:l,c:C}))).map(({e:l,c:C})=>`<tr><td>${re(rs(l.at))}</td><td><a href="#step-${l.step}">${l.step}</a>${l.earlier?' <span class="earlier">earlier attempt</span>':""}</td><td><code>${re(t(C.target))}</code></td><td><span class="badge ${C.ok?"ok":"fail"}">${C.ok?"up":"failed"}</span></td><td>${C.expires?re(`${C.expires} (${C.daysLeft!==void 0&&C.daysLeft<0?`expired ${-C.daysLeft} days ago`:`${C.daysLeft} days`})`):""}</td><td>${re(t(C.detail))}</td></tr>
|
|
190
201
|
`).join(""),a=`<section class="record">
|
|
191
202
|
<h2>${n.drill?"Drill record":n.incident?"Incident record":"Run record"}</h2>
|
|
192
|
-
<dl class="facts">${
|
|
193
|
-
`+(
|
|
203
|
+
<dl class="facts">${i}</dl>
|
|
204
|
+
`+(o?`<table class="timeline">
|
|
194
205
|
<thead><tr><th>Time</th><th>What</th><th>By</th><th>On</th><th>Result</th><th>Duration</th></tr></thead>
|
|
195
206
|
<tbody>
|
|
196
|
-
${
|
|
207
|
+
${o}</tbody>
|
|
197
208
|
</table>
|
|
198
|
-
`:"")+(
|
|
209
|
+
`:"")+(B?`<h3>Endpoint checks</h3>
|
|
199
210
|
<table class="timeline">
|
|
200
211
|
<thead><tr><th>Time</th><th>Step</th><th>Endpoint</th><th>Result</th><th>Certificate expires</th><th>Detail</th></tr></thead>
|
|
201
212
|
<tbody>
|
|
202
|
-
${
|
|
213
|
+
${B}</tbody>
|
|
203
214
|
</table>
|
|
204
215
|
`:"")+`</section>
|
|
205
|
-
`,c=n.incident?`${n.incident}${n.severity?` \xB7 ${n.severity}`:""}`:"",u=`@page{@bottom-right{content:"Page " counter(page) " of " counter(pages);font:10px sans-serif;color:#656d76}${c?`@top-right{content:${JSON.stringify(c)};font:10px sans-serif;color:#656d76}`:""}}`;return{html:a,pageCss:u}}var Ia=new Set(["timeout","estimate","cwd","continue-on-error","skip","confirm","no-confirm","terminal","name","expect","expect-not","expect-exit","capture","capture-secret","os","host","kube-context","lines","retry","every","proposed","by","reason","approved","approved-by","approved-at"]),mf=/^\s*[^\s{]*/;function ya(r,e){let t=Array.from({length:r.length+1},(n,s)=>Array.from({length:e.length+1},(B,i)=>s===0?i:i===0?s:0));for(let n=1;n<=r.length;n++)for(let s=1;s<=e.length;s++){let B=r[n-1]===e[s-1]?0:1,i=Math.min(t[n-1][s]+1,t[n][s-1]+1,t[n-1][s-1]+B);n>1&&s>1&&r[n-1]===e[s-2]&&r[n-2]===e[s-1]&&(i=Math.min(i,t[n-2][s-2]+1)),t[n][s]=i}return t[r.length][e.length]}function Ef(r){let e=r.toLowerCase(),t=e.length<=4?1:2,n,s=1/0,B=!1;for(let i of Ia){let o=i.endsWith("y")?`${i.slice(0,-1)}ies`:`${i}s`,a=Math.min(ya(e,i),ya(e,o));a<s?(n=i,s=a,B=!1):a===s&&(B=!0)}return n!==void 0&&s<=t&&!B?n:void 0}var Df=/^(PATH|BASH_ENV|ENV|IFS|PROMPT_COMMAND|PS4|SHELLOPTS|BASHOPTS|CDPATH|LD_\w+|DYLD_\w+|NODE_OPTIONS|PYTHONPATH|PYTHONSTARTUP|PERL5OPT|PERL5LIB|RUBYOPT|GIT_SSH_COMMAND|GIT_EXEC_PATH)$/i;function bf(r,e,t){let n=[],s=r.findIndex((i,o)=>o>0&&o<e&&/^env\s*:/i.test(i));if(s<0)return n;if(!/^env\s*:\s*(#.*)?$/i.test(r[s]))return n.push({severity:"warning",line:s,message:"front matter env: is ignored: write each variable on its own indented line below it ( NAME: value)"}),n;let B=new Set;for(let i=s+1;i<e;i++){let o=r[i];if(o.trim()===""||o.trim().startsWith("#"))continue;if(!/^\s/.test(o))break;let a=sB.exec(o);if(!a){n.push({severity:"warning",line:i,message:`front matter env: "${o.trim()}" is ignored (expected NAME: value, the name letters, digits and _)`});continue}let c=a[1];if(B.has(c)){n.push({severity:"warning",line:i,message:`front matter env: ${c} is set twice: the first one counts`});continue}B.add(c),Df.test(c)&&n.push({severity:"warning",line:i,message:`front matter env: ${c} changes what every cell runs, and the front matter isn't signed: set it on the cells that need it (env.${c}=)`})}return t&&B.size>0&&n.push({severity:"warning",line:s,message:"front matter env: is used in VS Code and the command line only: the md-runbook app doesn't use it for a signed runbook's cells (the front matter isn't signed); put what a host needs on the cells (env.NAME=)"}),n}function Ta(r){let e=[],t=Ce(r),n=Ht(t),s=et(r);if(s){let u=r.replace(/^/,"").split(/\r?\n/),l=u.findIndex((C,d)=>d>0&&/^(---|\.\.\.)\s*$/.test(C));for(let C=1;C<l;C++){let d=/^(mode|timeout|cwd|kube-context|kube-context-mode|git-bash-path-conversion)\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[C]);if(!d)continue;let h=d[1].toLowerCase();if(h==="mode"&&s.mode===void 0||h==="timeout"&&s.timeoutSeconds===void 0||h==="cwd"&&s.cwd===void 0||h==="kube-context"&&s.kubeContext===void 0||h==="kube-context-mode"&&s.kubeContextMode===void 0||h==="git-bash-path-conversion"&&s.gitBashPathConversion===void 0){let R={mode:"session or isolated",timeout:"seconds, e.g. 300",cwd:"a folder","kube-context":"a Kubernetes context name, e.g. prod-eu, or ${param:NAME}","kube-context-mode":"check or pin","git-bash-path-conversion":"on or off"};e.push({severity:"warning",line:C,message:`front matter ${h}: "${d[2]}" is ignored (expected ${R[h]})`})}}let f={};for(let C=1;C<l;C++){let d=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[C]);if(!d)continue;if(d[1]===""){e.push({severity:"warning",line:C,message:"front matter shell: is empty: write the names on the same line (shell: zsh, pwsh), not as a list below it"});continue}let{shells:h,unknown:k,twice:R}=$n(d[1]);for(let E of["unix","powershell"]){let S=h[E];S&&(f[E]?R.push(S):f[E]=S)}for(let E of k){let S=/[\\/]/.test(E)?`front matter shell: "${E}" is ignored: name a shell (${[...Ln,...Nn].join(", ")}), never a path`:`front matter shell: "${E}" is ignored (expected ${Ln.join(", ")} for sh/bash cells, ${Nn.join(" or ")} for PowerShell cells)`;e.push({severity:"warning",line:C,message:S})}for(let E of R)e.push({severity:"warning",line:C,message:`front matter shell: "${E}" is ignored: one shell per kind of cell, the first one counts`})}e.push(...bf(u,l,At(r)!==void 0))}let B=s?.kubeContextMode==="pin",i=()=>Math.max(0,r.replace(/^/,"").split(/\r?\n/).findIndex(u=>/^kube-context-mode\s*:/i.test(u)));B&&!s?.kubeContext&&!n.some(u=>de(u.info).kubeContext!==void 0)&&e.push({severity:"warning",line:i(),message:"front matter kube-context-mode: pin has no effect: no kube-context: in the front matter and no kube-context= on a block"}),B&&s?.practice&&e.push({severity:"warning",line:i(),message:`front matter kube-context-mode: pin doesn't apply on the practice host ${s.practice}: there the Kubernetes context is only checked`});let o=new Set((s?.params??[]).map(u=>u.name)),a=new Set;for(let u of n){let l=t.cells[u.cellIndex];if(!le(l.meta)||!Re(u.language))continue;let f=(S,w,y,O)=>{e.push({severity:S,message:w,line:y===void 0?u.line:u.line+1+y,cell:{index:u.cellIndex,...y!==void 0?{sourceLine:y}:{}},...O?{fix:O}:{}})},C=de(u.info);for(let S of C.errors)f("error",`invalid cell option ${S}`);let d=u.info.replace(mf,"");for(let S of qn(d)){let w=S.key.toLowerCase();if(Ia.has(w)||w.startsWith("env.")&&w.length>4)continue;let y=Ef(w);y?f("warning",`unknown cell option "${S.key}" (ignored): did you mean "${y}"?`,void 0,{option:S.key,to:y}):f("warning",`unknown cell option "${S.key}" (ignored)`)}/(^|\s)every=/i.test(d)&&!C.retry&&f("warning","every= has no effect without retry="),C.host&&s?.env&&f("warning",`front matter env: doesn't apply on the host ${C.host}: there the cell gets only its own env.NAME= variables`);let h=C.kubeContext??s?.kubeContext;B&&C.host&&h&&f("warning",`kube-context-mode: pin doesn't apply on the host ${C.host}: there kubectl's current context must already be ${h} (only checked)`);let k=[];try{k=gn(u.source,u.info,s)}catch(S){f("error",S instanceof Error?S.message:String(S))}let R=u.source.split(/\r?\n/),E=S=>{let w=R.findIndex(y=>y.includes(S));return w<0?void 0:w};for(let S of k){let w="${"+S.kind+":"+S.name;S.kind==="out"&&!a.has(S.name)&&f("error",`\${out:${S.name}} is not captured by an earlier block (add capture=${S.name} to the block that prints it)`,E(w)),S.kind==="param"&&!o.has(S.name)&&f("warning",`\${param:${S.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${S.name}=\u2026)`,E(w))}for(let S of C.checks?.captures??[])a.add(S.name)}let c=At(r);if(c){let u=s?.shell?.unix;if(u&&u!=="bash"){let l=r.replace(/^/,"").split(/\r?\n/).findIndex(f=>/^shell\s*:/i.test(f));e.push({severity:"warning",line:Math.max(0,l),message:`front matter shell: ${u} in a signed runbook: servers run its signed blocks in bash, and without the gate they would run in ${u}`})}for(let l of n.filter(f=>c.changed.includes(f.cellIndex)))e.push({severity:"warning",line:l.line,cell:{index:l.cellIndex},message:"block changed since the runbook was signed: servers that only run signed runbooks refuse it (sign the runbook again)"});for(let l of n.filter(f=>c.moved.includes(f.cellIndex)))e.push({severity:"warning",line:l.line,cell:{index:l.cellIndex},message:`block moved since the runbook was signed: it was signed as block ${c.cells.get(l.cellIndex).n}, after blocks that now come later`});c.missing.length>0&&e.push({severity:"warning",line:Math.max(0,Fa(r)),message:`signed block${c.missing.length===1?"":"s"} ${c.missing.join(", ")} of ${c.manifest.cells.length} not in the file as signed (deleted or changed since signing)`})}else{let u=Fa(r);u>=0&&e.push({severity:"error",line:u,message:"the signature block is damaged (sign the runbook again)"})}return e.sort((u,l)=>u.line-l.line)}function Fa(r){let e=null,t=-1;return r.split(/\r?\n/).forEach((n,s)=>{e?Le(n,e)&&(e=null):(e=Ae(n),e===null&&n.startsWith("<!-- md-runbook:signature")&&(t=s))}),t}function La(r,e){return`${r}:${e.line+1}: ${e.severity}: ${e.message}`}var dr=ae(require("node:fs")),gs=ae(require("node:os")),Et=ae(require("node:path"));var _B=require("node:child_process"),PB=require("node:string_decoder");function is(r,e=process.platform){if(e==="win32"){(0,_B.spawn)("taskkill",["/PID",String(r),"/T","/F"],{windowsHide:!0,stdio:"ignore"}).on("error",()=>{});return}let t=n=>{try{process.kill(-r,n)}catch{try{process.kill(r,n)}catch{}}};t("SIGTERM"),setTimeout(()=>t("SIGKILL"),2e3).unref()}var wf=1e3;function JB(r){let e=Date.now();return new Promise(t=>{let n=!1,s=!1,B=!1,i,o=d=>{B||(B=!0,clearTimeout(i),r.signal?.removeEventListener("abort",a),t({...d,timedOut:n,cancelled:s,durationMs:Date.now()-e}))},a=()=>{s=!0,u()};if(r.signal?.aborted){s=!0,o({exitCode:null,signal:null});return}let c=(0,_B.spawn)(r.command,r.args,{cwd:r.cwd,env:r.env??process.env,stdio:["ignore","pipe","pipe"],windowsHide:!0,detached:process.platform!=="win32",windowsVerbatimArguments:r.windowsVerbatimArguments}),u=()=>{c.pid!==void 0&&c.exitCode===null&&is(c.pid)};r.signal?.addEventListener("abort",a),r.timeoutMs>0&&(i=setTimeout(()=>{n=!0,u()},r.timeoutMs));let l=new PB.StringDecoder("utf8"),f=new PB.StringDecoder("utf8");c.stdout?.on("data",d=>r.onStdout(l.write(d))),c.stderr?.on("data",d=>r.onStderr(f.write(d)));let C=(d,h)=>{if(B)return;let k=l.end(),R=f.end();k&&r.onStdout(k),R&&r.onStderr(R),o({exitCode:d,signal:h})};c.on("error",d=>o({exitCode:null,signal:null,error:d.message})),c.on("close",C),c.on("exit",(d,h)=>{setTimeout(()=>{B||(c.stdout?.destroy(),c.stderr?.destroy(),C(d,h))},wf)})})}var gt=ae(require("node:fs")),jB=ae(require("node:os")),Dn=ae(require("node:path"));var $a=require("node:child_process"),xf=["HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","HKCU\\Environment"];function Ma(r){let e=/^\s*Path\s+REG_(?:EXPAND_)?SZ\s+(.*)$/im.exec(r);return e?e[1].trim():""}function Ga(r,e){return r.replace(/%([^%;]+)%/g,(t,n)=>{let s=Object.keys(e).find(i=>i.toUpperCase()===n.toUpperCase()),B=s===void 0?void 0:e[s];return B===void 0?t:B})}function Na(r){return r.trim().replace(/[\\/]+$/,"").toLowerCase()}function Ha(r,e){let t=new Set(r.split(";").map(Na).filter(Boolean)),n=[];for(let s of e){let B=Na(s);!B||t.has(B)||(t.add(B),n.push(s.trim()))}return n.length===0?r:[r.replace(/;+$/,""),...n].filter(Boolean).join(";")}var kf=r=>new Promise(e=>{(0,$a.execFile)("reg",["query",r,"/v","Path"],{windowsHide:!0,timeout:5e3},(t,n)=>e(t?"":String(n)))}),os,vf=3e3;async function Pa(r,e=Date.now(),t=kf){if(!os||e-os.at>=vf){let n=await Promise.all(xf.map(async s=>Ma(await t(s))));os={at:e,values:n}}return os.values.flatMap(n=>Ga(n,r).split(";").filter(s=>s.trim()))}async function UB(r,e=process.platform,t=Pa){if(e!=="win32")return r;let n=Object.keys(r).find(i=>i.toUpperCase()==="PATH")??"Path",s=r[n]??"",B=Ha(s,await t(r));return B!==s&&(r[n]=B),r}var En=ae(require("node:path"));function Yt(r,e,t){switch(r){case"pwsh":return Sf(e,t);case"cmd":return Of(t);case"bash":return Rf(e,t)}}function _a(r){let e=r.env.SystemRoot??r.env.SYSTEMROOT??"C:\\Windows",t=En.win32.join(e,"System32","WindowsPowerShell","v1.0","powershell.exe");return r.which("powershell.exe")??(r.exists(t)?t:void 0)}function Sf(r,e){let t=e.platform==="win32",n=r.runbook?.powershell,s;if(n==="windows-powershell"){if(!t)return{ok:!1,error:"Windows PowerShell 5.1 runs only on Windows (the runbook's shell: windows-powershell)."};if(s=_a(e),!s)return{ok:!1,error:"Windows PowerShell 5.1 not found (the runbook's shell: windows-powershell)."}}else{if(s=r.pwshPath?.trim()||e.which("pwsh"),!s&&n==="pwsh")return{ok:!1,error:"PowerShell 7 (pwsh) not found (the runbook's shell: pwsh): install it or set mdRunbook.shell.pwshPath."};!s&&t&&(s=_a(e)),s||(s=e.which("powershell"))}if(!s)return{ok:!1,error:"PowerShell not found: install PowerShell 7 (pwsh) or set mdRunbook.shell.pwshPath."};let B=/powershell(\.exe)?$/i.test(s)?"powershell":"pwsh";return{ok:!0,shell:{kind:"pwsh",command:s,label:B,extension:".ps1",args:i=>["-NoLogo","-NoProfile","-NonInteractive",...t?["-ExecutionPolicy","Bypass"]:[],"-Command",Ua(i)],script:i=>"\uFEFF"+i.replace(/\r?\n/g,t?`\r
|
|
216
|
+
`,c=n.incident?`${n.incident}${n.severity?` \xB7 ${n.severity}`:""}`:"",u=`@page{@bottom-right{content:"Page " counter(page) " of " counter(pages);font:10px sans-serif;color:#656d76}${c?`@top-right{content:${JSON.stringify(c)};font:10px sans-serif;color:#656d76}`:""}}`;return{html:a,pageCss:u}}function Ld(r){return ge(r).part??"body"}function Nd(r){return Pe(r.language)||Ie(r.language)!==void 0}function CB(r){let e=r.map(n=>Nd(n)?Ld(n.info):void 0),t=e.indexOf("ready");return{parts:e,...t>=0?{ready:t}:{},any:e.some(n=>n!==void 0&&n!=="body")}}function Tu(r){let e=[],{parts:t}=CB(r),n=a=>r[a].line+1,s,i,o,B;return t.forEach((a,c)=>{if(a!==void 0){if(a==="ready"){Pe(r[c].language)?e.push({at:c,message:"ready: the ready check is a shell block (exit 0 = up), not a runbook call"}):s!==void 0?e.push({at:c,message:`ready: a runbook has one ready check (the first one is on line ${n(s)})`}):B!==void 0&&e.push({at:c,message:`ready: the ready check comes before the setup steps it guards (a setup step is on line ${n(B)})`}),s??=c;return}if(a==="setup"){B??=c;let u=i??o;u!==void 0&&e.push({at:c,message:`setup: setup steps come before the runbook's own steps (one is on line ${n(u)})`});return}if(a==="body"){i??=c,o!==void 0&&e.push({at:c,message:`a step after the teardown (line ${n(o)}): teardown steps come last; mark this one teardown, or move it up`});return}o??=c}}),e}var hB=new Set(["timeout","estimate","cwd","continue-on-error","skip","confirm","no-confirm","terminal","name","expect","expect-not","expect-exit","capture","capture-secret","os","host","kube-context","lines","retry","every","setup","teardown","ready","proposed","by","reason","approved","approved-by","approved-at"]),Nu=/^\s*[^\s{]*/;function Lu(r,e){let t=Array.from({length:r.length+1},(n,s)=>Array.from({length:e.length+1},(i,o)=>s===0?o:o===0?s:0));for(let n=1;n<=r.length;n++)for(let s=1;s<=e.length;s++){let i=r[n-1]===e[s-1]?0:1,o=Math.min(t[n-1][s]+1,t[n][s-1]+1,t[n-1][s-1]+i);n>1&&s>1&&r[n-1]===e[s-2]&&r[n-2]===e[s-1]&&(o=Math.min(o,t[n-2][s-2]+1)),t[n][s]=o}return t[r.length][e.length]}function Mu(r){let e=r.toLowerCase(),t=e.length<=4?1:2,n,s=1/0,i=!1;for(let o of hB){let B=o.endsWith("y")?`${o.slice(0,-1)}ies`:`${o}s`,a=Math.min(Lu(e,o),Lu(e,B));a<s?(n=o,s=a,i=!1):a===s&&(i=!0)}return n!==void 0&&s<=t&&!i?n:void 0}var Md=/^(PATH|BASH_ENV|ENV|IFS|PROMPT_COMMAND|PS4|SHELLOPTS|BASHOPTS|CDPATH|LD_\w+|DYLD_\w+|NODE_OPTIONS|PYTHONPATH|PYTHONSTARTUP|PERL5OPT|PERL5LIB|RUBYOPT|GIT_SSH_COMMAND|GIT_EXEC_PATH)$/i;function Gd(r,e,t){let n=[],s=r.findIndex((o,B)=>B>0&&B<e&&/^env\s*:/i.test(o));if(s<0)return n;if(!/^env\s*:\s*(#.*)?$/i.test(r[s]))return n.push({severity:"warning",line:s,message:"front matter env: is ignored: write each variable on its own indented line below it ( NAME: value)"}),n;let i=new Set;for(let o=s+1;o<e;o++){let B=r[o];if(B.trim()===""||B.trim().startsWith("#"))continue;if(!/^\s/.test(B))break;let a=Ro.exec(B);if(!a){n.push({severity:"warning",line:o,message:`front matter env: "${B.trim()}" is ignored (expected NAME: value, the name letters, digits and _)`});continue}let c=a[1];if(i.has(c)){n.push({severity:"warning",line:o,message:`front matter env: ${c} is set twice: the first one counts`});continue}i.add(c),Md.test(c)&&n.push({severity:"warning",line:o,message:`front matter env: ${c} changes what every cell runs, and the front matter isn't signed: set it on the cells that need it (env.${c}=)`})}return t&&i.size>0&&n.push({severity:"warning",line:s,message:"front matter env: is used in VS Code and the command line only: the md-runbook app doesn't use it for a signed runbook's cells (the front matter isn't signed); put what a host needs on the cells (env.NAME=)"}),n}function Gu(r,e={}){let t=[],n=he(r),s=ct(n),i=Ue(r);if(i){let l=r.replace(/^/,"").split(/\r?\n/),C=l.findIndex((h,d)=>d>0&&/^(---|\.\.\.)\s*$/.test(h));for(let h=1;h<C;h++){let d=/^(mode|timeout|cwd|kube-context|kube-context-mode|git-bash-path-conversion)\s*:\s*(.*?)\s*(#.*)?$/i.exec(l[h]);if(!d)continue;let x=d[1].toLowerCase();if(x==="mode"&&i.mode===void 0||x==="timeout"&&i.timeoutSeconds===void 0||x==="cwd"&&i.cwd===void 0||x==="kube-context"&&i.kubeContext===void 0||x==="kube-context-mode"&&i.kubeContextMode===void 0||x==="git-bash-path-conversion"&&i.gitBashPathConversion===void 0){let E={mode:"session or isolated",timeout:"seconds, e.g. 300",cwd:"a folder","kube-context":"a Kubernetes context name, e.g. prod-eu, or ${param:NAME}","kube-context-mode":"check or pin","git-bash-path-conversion":"on or off"};t.push({severity:"warning",line:h,message:`front matter ${x}: "${d[2]}" is ignored (expected ${E[x]})`})}}let f={};for(let h=1;h<C;h++){let d=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(l[h]);if(!d)continue;if(d[1]===""){t.push({severity:"warning",line:h,message:"front matter shell: is empty: write the names on the same line (shell: zsh, pwsh), not as a list below it"});continue}let{shells:x,unknown:S,twice:E}=Ir(d[1]);for(let b of["unix","powershell"]){let D=x[b];D&&(f[b]?E.push(D):f[b]=D)}for(let b of S){let D=/[\\/]/.test(b)?`front matter shell: "${b}" is ignored: name a shell (${[...Rr,...Fr].join(", ")}), never a path`:`front matter shell: "${b}" is ignored (expected ${Rr.join(", ")} for sh/bash cells, ${Fr.join(" or ")} for PowerShell cells)`;t.push({severity:"warning",line:h,message:D})}for(let b of E)t.push({severity:"warning",line:h,message:`front matter shell: "${b}" is ignored: one shell per kind of cell, the first one counts`})}t.push(...Gd(l,C,It(r)!==void 0))}let o=i?.kubeContextMode==="pin",B=()=>Math.max(0,r.replace(/^/,"").split(/\r?\n/).findIndex(l=>/^kube-context-mode\s*:/i.test(l)));o&&!i?.kubeContext&&!s.some(l=>ge(l.info).kubeContext!==void 0)&&t.push({severity:"warning",line:B(),message:"front matter kube-context-mode: pin has no effect: no kube-context: in the front matter and no kube-context= on a block"}),o&&i?.practice&&t.push({severity:"warning",line:B(),message:`front matter kube-context-mode: pin doesn't apply on the practice host ${i.practice}: there the Kubernetes context is only checked`});let a=new Set((i?.params??[]).map(l=>l.name)),c=new Set;for(let l of s){let C=n.cells[l.cellIndex];if(ce(C.meta)&&Pe(l.language)){t.push(...Hd(l,a,c,e));for(let D of ge(l.info).checks?.captures??[])c.add(D.name);continue}if(!ce(C.meta)||!Ie(l.language))continue;let f=(D,y,v,$)=>{t.push({severity:D,message:y,line:v===void 0?l.line:l.line+1+v,cell:{index:l.cellIndex,...v!==void 0?{sourceLine:v}:{}},...$?{fix:$}:{}})},h=ge(l.info);for(let D of h.errors)f("error",`invalid cell option ${D}`);let d=l.info.replace(Nu,"");for(let D of tn(d)){let y=D.key.toLowerCase();if(hB.has(y)||y.startsWith("env.")&&y.length>4)continue;let v=Mu(y);v?f("warning",`unknown cell option "${D.key}" (ignored): did you mean "${v}"?`,void 0,{option:D.key,to:v}):f("warning",`unknown cell option "${D.key}" (ignored)`)}/(^|\s)every=/i.test(d)&&!h.retry&&f("warning","every= has no effect without retry="),h.host&&i?.env&&f("warning",`front matter env: doesn't apply on the host ${h.host}: there the cell gets only its own env.NAME= variables`);let x=h.kubeContext??i?.kubeContext;o&&h.host&&x&&f("warning",`kube-context-mode: pin doesn't apply on the host ${h.host}: there kubectl's current context must already be ${x} (only checked)`);let S=[];try{S=or(l.source,l.info,i)}catch(D){f("error",D instanceof Error?D.message:String(D))}let E=l.source.split(/\r?\n/),b=D=>{let y=E.findIndex(v=>v.includes(D));return y<0?void 0:y};for(let D of S){let y="${"+D.kind+":"+D.name;D.kind==="out"&&!c.has(D.name)&&f("error",`\${out:${D.name}} is not captured by an earlier block (add capture=${D.name} to the block that prints it)`,b(y)),D.kind==="param"&&!a.has(D.name)&&f("warning",`\${param:${D.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${D.name}=\u2026)`,b(y))}for(let D of h.checks?.captures??[])c.add(D.name)}for(let l of Tu(s)){let C=s[l.at];t.push({severity:"error",message:l.message,line:C.line,cell:{index:C.cellIndex}})}let u=It(r);if(u){let l=i?.shell?.unix;if(l&&l!=="bash"){let C=r.replace(/^/,"").split(/\r?\n/).findIndex(f=>/^shell\s*:/i.test(f));t.push({severity:"warning",line:Math.max(0,C),message:`front matter shell: ${l} in a signed runbook: servers run its signed blocks in bash, and without the gate they would run in ${l}`})}for(let C of s.filter(f=>u.changed.includes(f.cellIndex)))t.push({severity:"warning",line:C.line,cell:{index:C.cellIndex},message:"block changed since the runbook was signed: servers that only run signed runbooks refuse it (sign the runbook again)"});for(let C of s.filter(f=>u.moved.includes(f.cellIndex)))t.push({severity:"warning",line:C.line,cell:{index:C.cellIndex},message:`block moved since the runbook was signed: it was signed as block ${u.cells.get(C.cellIndex).n}, after blocks that now come later`});u.missingCalls.length>0&&t.push({severity:"warning",line:Math.max(0,dB(r)),message:`signed runbook call${u.missingCalls.length===1?"":"s"} ${u.missingCalls.join(", ")} of ${u.manifest.calls.length} not in the file as signed (deleted or changed since signing)`}),u.missing.length>0&&t.push({severity:"warning",line:Math.max(0,dB(r)),message:`signed block${u.missing.length===1?"":"s"} ${u.missing.join(", ")} of ${u.manifest.cells.length} not in the file as signed (deleted or changed since signing)`})}else{let l=dB(r);l>=0&&t.push({severity:"error",line:l,message:"the signature block is damaged (sign the runbook again)"})}return t.sort((l,C)=>l.line-C.line)}function Hd(r,e,t,n){let s=[],i=(C,f,h,d)=>{s.push({severity:C,message:f,line:h===void 0?r.line:r.line+1+h,cell:{index:r.cellIndex,...h!==void 0?{sourceLine:h}:{}},...d?{fix:d}:{}})},o=ge(r.info);for(let C of o.errors)i("error",`invalid cell option ${C}`);for(let C of tn(r.info.replace(Nu,""))){let f=C.key.toLowerCase();if(Jl.has(f)||f.startsWith("env.")){i("warning",`${C.key}= has no effect on a runbook call (ignored): it runs no shell of its own; put it on the blocks of the runbook called`);continue}if(hB.has(f)||_l.has(f))continue;let h=Mu(f)??(["source","file","path","srcs"].includes(f)?"src":["sections","part"].includes(f)?"section":void 0);h?i("warning",`unknown cell option "${C.key}" (ignored): did you mean "${h}"?`,void 0,{option:C.key,to:h}):i("warning",`unknown cell option "${C.key}" (ignored)`)}let B=Ve(r.info,r.source);for(let C of B.problems)i("error",C.message,C.line);let a=[];try{a=Mt(B)}catch(C){i("error",C instanceof Error?C.message:String(C))}let c=C=>B.args.find(f=>f.value.includes(C))?.line;for(let C of a){let f="${"+C.kind+":"+C.name;C.kind==="out"&&!t.has(C.name)&&i("error",`\${out:${C.name}} is not captured by an earlier block (add capture=${C.name} to the block that prints it)`,c(f)),C.kind==="param"&&!e.has(C.name)&&i("warning",`\${param:${C.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${C.name}=\u2026)`,c(f))}if(B.src===void 0)return s;if(ar(B.src)){let C=Ul(B.src),f=n.matchRunbooks?.(C);return f&&f.length===0&&i("warning",`src="${B.src}": no runbook matches ${C} yet`),s}if(!n.readRunbook)return s;let u=n.readRunbook(B.src);if(u===void 0)return i("error",`src="${B.src}": no such runbook (relative to this file)`),s;let l=si(B,u);for(let C of l.unknown)i("error",`${C.name}: the runbook called (${B.src}) has no parameter ${C.name}`,C.line);for(let C of l.notPassed)i("warning",`${B.src} needs \${param:${C}}, which this call doesn't pass and which has no default: it will be asked (on the command line: an error)`);for(let C of l.sections)i("error",C);for(let C of l.manualOnly)i("warning",`section="${C}" holds manual steps only (task-list items): the command line runs none of it, and a runbook that keeps evidence fails until they are ticked`);return s}function dB(r){let e=null,t=-1;return r.split(/\r?\n/).forEach((n,s)=>{e?Ke(n,e)&&(e=null):(e=Je(n),e===null&&n.startsWith("<!-- md-runbook:signature")&&(t=s))}),t}function Hu(r,e){return`${r}:${e.line+1}: ${e.severity}: ${e.message}`}var gB=require("node:child_process"),pB=require("node:string_decoder");function wi(r,e=process.platform){if(e==="win32"){(0,gB.spawn)("taskkill",["/PID",String(r),"/T","/F"],{windowsHide:!0,stdio:"ignore"}).on("error",()=>{});return}let t=n=>{try{process.kill(-r,n)}catch{try{process.kill(r,n)}catch{}}};t("SIGTERM"),setTimeout(()=>t("SIGKILL"),2e3).unref()}var Pd=1e3;function mB(r){let e=Date.now();return new Promise(t=>{let n=!1,s=!1,i=!1,o,B=h=>{i||(i=!0,clearTimeout(o),r.signal?.removeEventListener("abort",a),t({...h,timedOut:n,cancelled:s,durationMs:Date.now()-e}))},a=()=>{s=!0,u()};if(r.signal?.aborted){s=!0,B({exitCode:null,signal:null});return}let c=(0,gB.spawn)(r.command,r.args,{cwd:r.cwd,env:r.env??process.env,stdio:["ignore","pipe","pipe"],windowsHide:!0,detached:process.platform!=="win32",windowsVerbatimArguments:r.windowsVerbatimArguments}),u=()=>{c.pid!==void 0&&c.exitCode===null&&wi(c.pid)};r.signal?.addEventListener("abort",a),r.timeoutMs>0&&(o=setTimeout(()=>{n=!0,u()},r.timeoutMs));let l=new pB.StringDecoder("utf8"),C=new pB.StringDecoder("utf8");c.stdout?.on("data",h=>r.onStdout(l.write(h))),c.stderr?.on("data",h=>r.onStderr(C.write(h)));let f=(h,d)=>{if(i)return;let x=l.end(),S=C.end();x&&r.onStdout(x),S&&r.onStderr(S),B({exitCode:h,signal:d})};c.on("error",h=>B({exitCode:null,signal:null,error:h.message})),c.on("close",f),c.on("exit",(h,d)=>{setTimeout(()=>{i||(c.stdout?.destroy(),c.stderr?.destroy(),f(h,d))},Pd)})})}var zt=Ce(require("node:fs")),bB=Ce(require("node:os")),fr=Ce(require("node:path"));var _u=require("node:child_process"),_d=["HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","HKCU\\Environment"];function Ju(r){let e=/^\s*Path\s+REG_(?:EXPAND_)?SZ\s+(.*)$/im.exec(r);return e?e[1].trim():""}function Uu(r,e){return r.replace(/%([^%;]+)%/g,(t,n)=>{let s=Object.keys(e).find(o=>o.toUpperCase()===n.toUpperCase()),i=s===void 0?void 0:e[s];return i===void 0?t:i})}function Pu(r){return r.trim().replace(/[\\/]+$/,"").toLowerCase()}function ju(r,e){let t=new Set(r.split(";").map(Pu).filter(Boolean)),n=[];for(let s of e){let i=Pu(s);!i||t.has(i)||(t.add(i),n.push(s.trim()))}return n.length===0?r:[r.replace(/;+$/,""),...n].filter(Boolean).join(";")}var Jd=r=>new Promise(e=>{(0,_u.execFile)("reg",["query",r,"/v","Path"],{windowsHide:!0,timeout:5e3},(t,n)=>e(t?"":String(n)))}),ki,Ud=3e3;async function Ku(r,e=Date.now(),t=Jd){if(!ki||e-ki.at>=Ud){let n=await Promise.all(_d.map(async s=>Ju(await t(s))));ki={at:e,values:n}}return ki.values.flatMap(n=>Uu(n,r).split(";").filter(s=>s.trim()))}async function EB(r,e=process.platform,t=Ku){if(e!=="win32")return r;let n=Object.keys(r).find(o=>o.toUpperCase()==="PATH")??"Path",s=r[n]??"",i=ju(s,await t(r));return i!==s&&(r[n]=i),r}var cr=Ce(require("node:path"));function Tn(r,e,t){switch(r){case"pwsh":return jd(e,t);case"cmd":return Kd(t);case"bash":return Yd(e,t)}}function zu(r){let e=r.env.SystemRoot??r.env.SYSTEMROOT??"C:\\Windows",t=cr.win32.join(e,"System32","WindowsPowerShell","v1.0","powershell.exe");return r.which("powershell.exe")??(r.exists(t)?t:void 0)}function jd(r,e){let t=e.platform==="win32",n=r.runbook?.powershell,s;if(n==="windows-powershell"){if(!t)return{ok:!1,error:"Windows PowerShell 5.1 runs only on Windows (the runbook's shell: windows-powershell)."};if(s=zu(e),!s)return{ok:!1,error:"Windows PowerShell 5.1 not found (the runbook's shell: windows-powershell)."}}else{if(s=r.pwshPath?.trim()||e.which("pwsh"),!s&&n==="pwsh")return{ok:!1,error:"PowerShell 7 (pwsh) not found (the runbook's shell: pwsh): install it or set mdRunbook.shell.pwshPath."};!s&&t&&(s=zu(e)),s||(s=e.which("powershell"))}if(!s)return{ok:!1,error:"PowerShell not found: install PowerShell 7 (pwsh) or set mdRunbook.shell.pwshPath."};let i=/powershell(\.exe)?$/i.test(s)?"powershell":"pwsh";return{ok:!0,shell:{kind:"pwsh",command:s,label:i,extension:".ps1",args:o=>["-NoLogo","-NoProfile","-NonInteractive",...t?["-ExecutionPolicy","Bypass"]:[],"-Command",Qu(o)],script:o=>"\uFEFF"+o.replace(/\r?\n/g,t?`\r
|
|
206
217
|
`:`
|
|
207
218
|
`)+(t?`\r
|
|
208
219
|
`:`
|
|
209
|
-
`)}}}function
|
|
220
|
+
`)}}}function Qu(r){return["[Console]::OutputEncoding = [System.Text.Encoding]::UTF8","$OutputEncoding = New-Object System.Text.UTF8Encoding $false","$global:LASTEXITCODE = 0",`& ${"'"+r.replace(/['\u2018\u2019\u201A\u201B]/g,t=>t+t)+"'"}`,"$mdRunbookOk = $?","if ($LASTEXITCODE) { exit $LASTEXITCODE } elseif (-not $mdRunbookOk) { exit 1 } else { exit 0 }"].join("; ")}function Kd(r){if(r.platform!=="win32")return{ok:!1,error:"cmd blocks can only run on Windows."};let e=r.env.SystemRoot??r.env.SYSTEMROOT??"C:\\Windows";return{ok:!0,shell:{kind:"cmd",command:r.env.ComSpec??r.env.COMSPEC??cr.win32.join(e,"System32","cmd.exe"),label:"cmd",extension:".cmd",args:n=>["/d","/s","/c",`""${n}""`],windowsVerbatimArguments:!0,script:n=>["@echo off","@chcp 65001 >nul",...n.split(/\r?\n/)].join(`\r
|
|
210
221
|
`)+`\r
|
|
211
|
-
`}}}function
|
|
222
|
+
`}}}function DB(r){let e=cr.win32,t=[];for(let s of[r.env.ProgramFiles,r.env.ProgramW6432,r.env["ProgramFiles(x86)"]])s&&t.push(e.join(s,"Git","bin","bash.exe"));r.env.LOCALAPPDATA&&t.push(e.join(r.env.LOCALAPPDATA,"Programs","Git","bin","bash.exe")),r.env.USERPROFILE&&t.push(e.join(r.env.USERPROFILE,"scoop","apps","git","current","bin","bash.exe"));let n=r.which("git.exe")??r.which("git");if(n){let s=e.dirname(n);t.push(e.join(s,"..","bin","bash.exe"),e.join(s,"..","..","bin","bash.exe"))}return[...new Set(t.map(s=>e.normalize(s)))]}function qu(r){return/\\(System32|Sysnative)\\bash\.exe$/i.test(r)||/\\WindowsApps\\/i.test(r)}function Yu(r,e){let t=r.which(e);return t&&!qu(t)?t:void 0}var Wu=(r,e,t)=>({kind:"bash",command:r,label:e,extension:".sh",args:n=>[t?n.replace(/\\/g,"/"):n],script:n=>n.replace(/\r\n/g,`
|
|
212
223
|
`)+`
|
|
213
|
-
`});function
|
|
224
|
+
`});function zd(r,e,t){let n=t.platform==="win32",s;if(r==="zsh")s=n?Yu(t,"zsh.exe"):t.which("zsh");else if(!n)s=t.exists("/bin/sh")?"/bin/sh":t.which("sh");else{let i=e.bashPath?.trim();s=[...i?[i]:[],...DB(t)].map(o=>cr.win32.join(cr.win32.dirname(o),"sh.exe")).find(o=>t.exists(o)),s??=Yu(t,"sh.exe")}return s?{ok:!0,shell:Wu(s,r,n)}:{ok:!1,error:`${r} not found${n&&r==="sh"?": install Git for Windows":n?" on PATH (WSL's is not used)":" on PATH"} (the runbook's shell: ${r}).`}}function Yd(r,e){let t=r.runbook?.unix;if(t==="zsh"||t==="sh")return zd(t,r,e);let n=e.platform==="win32",s=r.bashPath?.trim()||void 0;if(!s&&n){if(s=DB(e).find(i=>e.exists(i)),!s){let i=e.which("bash.exe");i&&!qu(i)&&(s=i)}if(!s)return{ok:!1,error:"Git Bash not found: install Git for Windows or set mdRunbook.shell.bashPath to bash.exe."}}return s||(s=e.which("bash")??(t==="bash"?void 0:e.which("sh"))),s?{ok:!0,shell:Wu(s,/(^|[\\/])sh$/.test(s)?"sh":"bash",n)}:{ok:!1,error:`bash not found on PATH${t==="bash"?" (the runbook's shell: bash)":""}: set mdRunbook.shell.bashPath.`}}function Vu(r,e=process.env){let t=(e.PATH??e.Path??"").split(fr.delimiter).filter(Boolean),n=process.platform==="win32"?["",...(e.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")]:[""];for(let s of t)for(let i of n){let o=fr.join(s,r.toLowerCase().endsWith(i.toLowerCase())?r:r+i);try{if(zt.statSync(o).isFile())return o}catch{}}}function sn(r=process.env){return{platform:process.platform,env:r,exists:e=>{try{return zt.statSync(e).isFile()}catch{return!1}},which:e=>Vu(e,r)}}async function ss(r,e,t){let n={...process.env,...e};return r.refreshPath!==!1&&await EB(n,t),Zu(n,t)}function Zu(r,e){return e!=="win32"||Object.keys(r).some(n=>/^(PYTHONIOENCODING|PYTHONUTF8)$/i.test(n))||(r.PYTHONIOENCODING="utf-8"),r}function xi(r,e){return r.env===process.env?{...r,env:e,which:t=>Vu(t,e)}:r}async function Ln(r,e=sn()){let t=C=>({exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:C,durationMs:0}),n=Ie(r.language);if(!n)return t(`No shell for language '${r.language}'.`);let s=await ss(r.settings,r.env,e.platform),i=Tn(n,r.settings,xi(e,s));if(!i.ok)return t(i.error);let o=i.shell,B=zt.mkdtempSync(fr.join(bB.tmpdir(),"md-runbook-")),a=fr.join(B,"cell"+o.extension),c=r.source,u=r.cwd,l=o.args(a);o.kind==="cmd"&&/^[\\/]{2}/.test(u)&&(c=`pushd "${u}" >nul 2>&1 || (echo md-runbook: cannot open ${u} 1>&2 & exit /b 1)\r
|
|
214
225
|
${c}\r
|
|
215
|
-
popd`,u=
|
|
216
|
-
`)[0]}): ${
|
|
217
|
-
`:`$__mdrbDir = $env:${
|
|
218
|
-
`}function
|
|
219
|
-
`}let
|
|
220
|
-
if ($__mdrbPushed) { Pop-Location -StackName ${
|
|
221
|
-
`}function
|
|
222
|
-
`)}var
|
|
223
|
-
`),
|
|
224
|
-
`);let{ended:a,...c}=
|
|
225
|
-
`;if(r.command!==void 0&&r.command.trim()!==""){let
|
|
226
|
+
popd`,u=bB.tmpdir()),o.kind==="bash"&&e.platform==="win32"&&/['"\[\]*?{}$`]/.test(a)&&(s.MDRB_SCRIPT=l[0]??a,l=["-c",'. "$MDRB_SCRIPT"']);try{return zt.writeFileSync(a,o.script(c),"utf8"),{...await mB({command:o.command,args:l,cwd:u,env:s,timeoutMs:r.timeoutMs,signal:r.signal,windowsVerbatimArguments:o.windowsVerbatimArguments,onStdout:r.onStdout,onStderr:r.onStderr}),shell:o}}finally{try{zt.rmSync(B,{recursive:!0,force:!0})}catch{}}}var on=Ce(require("node:fs")),is=Ce(require("node:os")),Nn=Ce(require("node:path"));var Xu={MSYS_NO_PATHCONV:"1",MSYS2_ARG_CONV_EXCL:"*"};function Cr(r,e,t){if(t!=="win32")return r[e];let n=Object.keys(r).find(s=>s.toUpperCase()===e);return n===void 0?void 0:r[n]}var Qd=r=>{try{return on.statSync(r).isFile()}catch{return!1}};function ec(r,e=process.platform,t=Qd){let n=Cr(r,"KUBECONFIG",e);if(n)return n;let s=e==="win32"?Nn.win32.join:Nn.posix.join;if(e!=="win32")return s(r.HOME||is.homedir(),".kube","config");let i=Cr(r,"HOMEDRIVE",e),o=Cr(r,"HOMEPATH",e);return[Cr(r,"HOME",e),i&&o?i+o:void 0,Cr(r,"USERPROFILE",e)].filter(c=>!!c).map(c=>s(c,".kube","config")).find(t)??s(Cr(r,"USERPROFILE",e)||is.homedir(),".kube","config")}var os=class{constructor(e=is.tmpdir()){this.tmp=e}tmp;dir;files=new Map;file(e){let t=this.files.get(e);t===void 0&&this.files.set(e,t=`pin-${this.files.size+1}.kubeconfig`);let n=()=>{this.dir??=on.mkdtempSync(Nn.join(this.tmp,"md-runbook-kube-"));let s=Nn.join(this.dir,t);return on.writeFileSync(s,Al(e),{mode:384}),s};try{return n()}catch(s){if(s.code!=="ENOENT")throw s;return this.dir=void 0,n()}}dispose(){if(this.dir!==void 0){try{on.rmSync(this.dir,{recursive:!0,force:!0})}catch{}this.dir=void 0}}};function wB(r){let e=r.platform??process.platform,t=r.frontMatter,n={...t?.env},s={},i=!1;if(t?.kubeContextMode==="pin"&&r.pins){let o=ec(r.env,e);r.kubeContext!==void 0?(s.KUBECONFIG=Rl(r.pins.file(r.kubeContext),o,e),i=!0):s.KUBECONFIG=o}return t?.gitBashPathConversion==="off"&&e==="win32"&&Ie(r.language)==="bash"&&Object.assign(s,Xu),{env:s,defaults:n,pinned:i}}function kB(r,e){return{...e.defaults,...r,...e.env}}var tc=require("node:child_process"),nc=require("node:crypto"),ht=Ce(require("node:fs")),rc=Ce(require("node:os")),Si=Ce(require("node:path"));function yi(r){return(0,nc.createHash)("sha256").update(r,"utf8").digest("hex")}function vi(r,e,t){return new Promise((n,s)=>{let i=(0,tc.spawn)(r,e,{stdio:[t==="inherit"?"inherit":"pipe","pipe","pipe"],windowsHide:!0}),o="",B="";i.stdout.on("data",a=>o+=a.toString("utf8")),i.stderr.on("data",a=>B+=a.toString("utf8")),i.on("error",a=>s(new Error(`${r}: ${a.message} (OpenSSH's ssh-keygen is needed)`))),i.on("close",a=>n({code:a,stdout:o,stderr:B})),t!=="inherit"&&(i.stdin.on("error",()=>{}),i.stdin.end(t))})}function sc(){return ht.mkdtempSync(Si.join(rc.tmpdir(),"md-runbook-sign-"))}async function Bs(r,e,t={}){let n=sc();try{let s=Si.join(n,"manifest");ht.writeFileSync(s,r,"utf8");let i=await vi(t.sshKeygen??"ssh-keygen",["-Y","sign","-q","-f",e,"-n",rB,s],t.interactive===!1?"":"inherit");if(i.code!==0||!ht.existsSync(s+".sig"))throw new Error(`ssh-keygen could not sign: ${i.stderr.trim()||`exit ${i.code}`}`);return wu(ht.readFileSync(s+".sig","utf8"))}finally{ht.rmSync(n,{recursive:!0,force:!0})}}async function dr(r,e,t,n="ssh-keygen"){let s=sc();try{let i=Si.join(s,"manifest.sig");ht.writeFileSync(i,bu(e),"utf8");let o=await vi(n,["-Y","find-principals","-s",i,"-f",t],""),B=o.code===0?o.stdout.split(/[\r\n,]+/).filter(Boolean):[];if(B.length===0)throw new Error(`no key in ${t} made this signature`);let a="";for(let c of B){let u=await vi(n,["-Y","verify","-f",t,"-I",c,"-n",rB,"-s",i],r);if(u.code===0)return c;a=(u.stderr||u.stdout).trim()}throw new Error(`the signature does not verify: ${a}`)}finally{ht.rmSync(s,{recursive:!0,force:!0})}}async function xB(r,e){let t=[];for(let n of r.cells)if(!(n.steps.length<2))for(let s=0;s<n.steps.length;s++){let i;try{i=await vi(e,["--norc","--noprofile","-n"],n.steps[s])}catch{return}let o=i.stderr.trim().split(/\r?\n/)[0];(i.code!==0||o)&&t.push(`cell ${n.n}, command ${s+1} (${n.steps[s].split(`
|
|
227
|
+
`)[0]}): ${o||`bash -n exit ${i.code}`}`)}return t}function as(r){let e=r.endsWith(".pub")?r:r+".pub";try{let t=ht.readFileSync(e,"utf8").trim().split(/\s+/);return t.length>=3?t.slice(2).join(" "):void 0}catch{return}}var Bn=Ce(require("node:fs")),ic=Ce(require("node:path")),oc=10*1024*1024,qd=100,ls=class{constructor(e,t,n=oc,s=qd){this.file=e;this.onError=t;this.maxBytes=n;this.batchMs=s}file;onError;maxBytes;batchMs;pending="";timer;failed=!1;append(e){this.failed||e===""||(this.pending+=e,this.timer===void 0&&(this.timer=setTimeout(()=>this.flush(),this.batchMs),this.timer.unref?.()))}flush(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0;let e=this.pending;if(this.pending="",!(this.failed||e===""))try{Bn.mkdirSync(ic.dirname(this.file),{recursive:!0});let t=0;try{t=Bn.statSync(this.file).size}catch{}t>0&&t+Buffer.byteLength(e)>this.maxBytes&&Bn.renameSync(this.file,`${this.file}.1`),Bn.appendFileSync(this.file,e,"utf8")}catch(t){this.failed=!0,this.onError?.(t instanceof Error?t:new Error(String(t)))}}};var $e=Ce(require("node:fs")),Se=Ce(require("node:path")),Bc=require("node:crypto");function _t(r,e){return Se.resolve(Se.dirname(Se.resolve(r)),e)}function us(r,e){return Se.relative(Se.dirname(Se.resolve(r)),e).split(Se.sep).join("/")}function hr(r,e){let t=n=>{let s=Se.resolve(n);try{s=$e.realpathSync.native(s)}catch{}return process.platform==="linux"?s:s.toLowerCase()};return t(r)===t(e)}function vB(r){return e=>{try{let t=_t(r,e);return $e.statSync(t).isFile()?$e.readFileSync(t,"utf8"):void 0}catch{return}}}function SB(r,e){let t=e.split(/[\\/]+/).filter(o=>o!==""&&o!=="."),n=o=>new RegExp(`^${o.replace(/[.+^${}()|[\]\\?]/g,"\\$&").replace(/\*/g,".*")}$`,process.platform==="linux"?"":"i"),s=[Se.dirname(Se.resolve(r))],i=[];return t.forEach((o,B)=>{let a=B===t.length-1,c=[];for(let u of s){if(!o.includes("*")){let C=Se.join(u,o);$e.existsSync(C)&&c.push(C);continue}let l=[];try{l=$e.readdirSync(u)}catch{continue}for(let C of l)n(o).test(C)&&!/\.\d{8}-\d{6}(?:-\d+)?\.md$/i.test(C)&&c.push(Se.join(u,C))}a?i.push(...c.filter(u=>$e.statSync(u).isFile())):s=c.filter(u=>$e.statSync(u).isDirectory())}),i.map(o=>us(r,o)).sort()}function yB(r,e,t,n=new Date){let s=t?Se.resolve(Se.dirname(r),t):Se.dirname(r);$e.mkdirSync(s,{recursive:!0});let i=ao(Se.basename(r),n),o=Se.join(s,i);for(let c=2;$e.existsSync(o);c++)o=Se.join(s,i.replace(/\.md$/i,`-${c}.md`));let B=No(e),a=Ar($e.readFileSync(r,"utf8"));return $e.writeFileSync(o,Object.keys(B).length?Zl(a,B):a,"utf8"),o}function cs(r,e,t){return Po(e,t,(s,i)=>{let o=_t(i??r,s);try{return{text:$e.readFileSync(o,"utf8"),at:o}}catch{return}},Rn())}function OB(r){return(0,Bc.createHash)("sha256").update($e.readFileSync(r)).digest("hex")}var Dt=Ce(require("node:fs")),gs=Ce(require("node:os")),qe=Ce(require("node:path"));var ac=["\\b(delete|drain|cordon|scale\\s+.*--replicas=0)\\b","\\brm\\s+-[a-z]*r[a-z]*f","--force\\b","\\bRemove-Item\\b.*-Recurse","\\bdrop\\s+(table|database)\\b","\\brollout\\s+(restart|undo)\\b","(?<![-.])\\bpatch\\b","(?<![-.])\\bapply\\b","(?<![-.])\\breplace\\b","\\badm\\s+policy\\s+(add|remove)","\\bset\\s+(env|image|resources)\\b","\\bhelm\\s+(upgrade|rollback|uninstall)\\b","\\bcurl\\b.*(-X\\s*|--request[\\s=]+)(PUT|POST|PATCH|DELETE)\\b","\\bInvoke-(RestMethod|WebRequest)\\b.*-Method\\s+(Put|Post|Patch|Delete)\\b"];function lc(r){let e=[],t=[];for(let n of r)try{e.push(new RegExp(n,"i"))}catch(s){t.push(`${n}: ${s instanceof Error?s.message:String(s)}`)}return{regexes:e,errors:t}}function Wd(r,e){let t;for(let n of e){let s=n.exec(r);s&&(!t||s.index<t.index)&&(t=s)}return t?.[0]}function AB(r,e,t,n){if(n===!1||n===void 0&&e==="never")return;let s=Wd(r,t);return s!==void 0?s:n===!0||e==="always"?"":void 0}function RB(r){let e=Zt(r),t=r.slice(r.toLowerCase().indexOf(e)+e.length),n={state:"none"},s=!1;for(let i of tn(t)){let o=i.key.toLowerCase();o==="proposed"&&i.value===void 0?s=!0:o==="by"&&i.value?n.by=i.value:o==="reason"&&i.value!==void 0?n.reason=i.value:o==="approved-by"&&i.value?n.approvedBy=i.value:o==="approved-at"&&i.value&&(n.approvedAt=i.value)}return n.state=s?"proposed":n.approvedBy?"approved":n.by?"proposed":"none",n}var cc=require("node:child_process"),fc=require("node:crypto"),Yt=Ce(require("node:fs")),Cc=Ce(require("node:os")),Mn=Ce(require("node:path")),IB=require("node:string_decoder");var Vd=1e3,fs="MD_RUNBOOK_SESSION_DIR",Oi="MD_RUNBOOK_TERM",dc="__mdrbCellCwd",uc=r=>"'"+r.replace(/'/g,"'\\''")+"'",FB=r=>"'"+r.replace(/['‘’‚‛]/g,"$&$&")+"'";function Zd(r,e){return r.kind==="bash"?["-s"]:["-NoLogo","-NoProfile","-NonInteractive",...e==="win32"?["-ExecutionPolicy","Bypass"]:[],"-Command","-"]}function Xd(r){return r==="bash"?`__mdrb_dir=$${fs}; unset ${fs}
|
|
228
|
+
`:`$__mdrbDir = $env:${fs}; Remove-Item Env:${fs} -ErrorAction Ignore; if ($env:${Oi}) { $env:TERM = $env:${Oi} } else { Remove-Item Env:TERM -ErrorAction Ignore }; Remove-Item Env:${Oi} -ErrorAction Ignore; [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; $OutputEncoding = New-Object System.Text.UTF8Encoding $false
|
|
229
|
+
`}function eh(r,e,t,n){let s=`__MDRB_${e}__`;if(r==="bash"){let B=`"$__mdrb_dir/${e}.pre${t}"`,a=`. "$__mdrb_dir/${e}${t}" </dev/null; __mdrb_rc=$?`;return(n?`__mdrb_cd=; if . ${B} </dev/null; then rm -f ${B} 2>/dev/null; ${a}; else __mdrb_rc=$?; rm -f ${B} 2>/dev/null; fi; if [ -n "$__mdrb_cd" ]; then cd -- "$__mdrb_cd" 2>/dev/null; __mdrb_cd=; fi; `:`${a}; `)+`printf '\\036%s %s\\n' ${s} "$__mdrb_rc"; printf '\\036%s %s\\n' ${s} "$__mdrb_rc" >&2
|
|
230
|
+
`}let i=`"$__mdrbDir/${e}.pre${t}"`;return`$global:LASTEXITCODE = 0; $__mdrbOk = $false; $__mdrbPushed = $false; ${n?`. ${i}; Remove-Item -LiteralPath ${i} -Force -ErrorAction Ignore; `:""}. "$__mdrbDir/${e}${t}"; $__mdrbOk = $?
|
|
231
|
+
if ($__mdrbPushed) { Pop-Location -StackName ${dc} -ErrorAction Ignore; $__mdrbPushed = $false }; $__mdrbRc = if ($LASTEXITCODE) { $LASTEXITCODE } elseif (-not $__mdrbOk) { 1 } else { 0 }; $__mdrbS = [string][char]30 + "${s} $__mdrbRc\`n"; [Console]::Out.Write($__mdrbS); [Console]::Error.Write($__mdrbS)
|
|
232
|
+
`}function th(r,e,t,n=process.platform){let s=[];for(let[i,o]of Object.entries(e))r==="pwsh"?s.push(`[Environment]::SetEnvironmentVariable(${FB(i)}, ${FB(o)})`):/^[A-Za-z_][A-Za-z0-9_]*$/.test(i)&&s.push(`export ${i}=${uc(o)}`);return t!==void 0&&(r==="pwsh"?s.push(`Push-Location -LiteralPath ${FB(t)} -StackName ${dc} -ErrorAction Stop`,"$__mdrbPushed = $true"):s.push("__mdrb_cd=$PWD",`cd -- ${uc(n==="win32"?t.replace(/\\/g,"/"):t)} || return 1`)),s.join(`
|
|
233
|
+
`)}var $B=class{constructor(e,t,n=process.platform,s=process.env){this.shell=e;this.cwd=t;this.platform=n;this.dir=Yt.mkdtempSync(Mn.join(Cc.tmpdir(),"md-runbook-session-"));let i=n==="win32"&&e.kind==="bash"?this.dir.replace(/\\/g,"/"):this.dir,o={...s,[fs]:i};e.kind==="pwsh"&&(o[Oi]=o.TERM??"",o.TERM="dumb"),this.child=(0,cc.spawn)(e.command,Zd(e,n),{cwd:t,env:o,stdio:["pipe","pipe","pipe"],windowsHide:!0,detached:n!=="win32"}),this.child.stdout.on("data",B=>this.deliver("out",this.outDec.write(B))),this.child.stderr.on("data",B=>this.deliver("err",this.errDec.write(B))),this.child.stdin.on("error",()=>{}),this.child.on("error",B=>{this.startError=B.message,this.end(null,null)}),this.child.on("close",(B,a)=>this.end(B,a)),this.child.on("exit",(B,a)=>setTimeout(()=>this.end(B,a),Vd).unref()),this.child.stdin.write(Xd(e.kind))}shell;cwd;platform;child;dir;ended=!1;killed=!1;startError;current;outDec=new IB.StringDecoder("utf8");errDec=new IB.StringDecoder("utf8");onDidEnd=()=>{};get alive(){return!this.ended&&!this.killed}get pid(){return this.child.pid}run(e){let t=Date.now();return new Promise(n=>{let s=!1,i=!1,o=!1,B,a=[],c=(S,E)=>{if(!o){o=!0,clearTimeout(B),e.signal?.removeEventListener("abort",u),this.current=void 0;for(let b of a)try{Yt.rmSync(b,{force:!0})}catch{}n({...S,timedOut:s,cancelled:i,ended:E,durationMs:Date.now()-t})}},u=()=>{i=!0,this.kill()};if(!this.alive)return c({exitCode:null,signal:null,error:this.startError??"The session has ended."},!0);if(this.current)return c({exitCode:null,signal:null,error:"The session is busy."},!1);if(e.signal?.aborted)return i=!0,c({exitCode:null,signal:null},!1);let l=(0,fc.randomBytes)(12).toString("hex"),C=this.shell.extension,f=e.env??{},h=Object.keys(f).length>0||e.cwd!==void 0;try{let S=Mn.join(this.dir,l+C);if(a.push(S),Yt.writeFileSync(S,this.shell.script(e.source),"utf8"),h){let E=Mn.join(this.dir,`${l}.pre${C}`);a.push(E),Yt.writeFileSync(E,this.shell.script(th(this.shell.kind,f,e.cwd,this.platform)),{encoding:"utf8",mode:384})}}catch(S){return c({exitCode:null,signal:null,error:S instanceof Error?S.message:String(S)},!1)}let d=new bn(`__MDRB_${l}__`,e.onStdout),x=new bn(`__MDRB_${l}__`,e.onStderr);this.current={out:d,err:x,check:()=>{d.done&&x.done&&c({exitCode:d.code,signal:null},!1)},onExit:(S,E)=>{d.flush(),x.flush(),c({exitCode:S,signal:E,error:this.startError},!0)}},e.signal?.addEventListener("abort",u),e.timeoutMs>0&&(B=setTimeout(()=>{s=!0,this.kill()},e.timeoutMs)),this.child.stdin.write(eh(this.shell.kind,l,C,h))})}kill(){this.killed||this.ended||(this.killed=!0,this.child.pid!==void 0&&wi(this.child.pid,this.platform))}dispose(){this.kill(),this.ended&&this.cleanup()}deliver(e,t){let n=this.current;!n||t===""||(n[e].write(t),n.check())}end(e,t){this.ended||(this.ended=!0,this.deliver("out",this.outDec.end()),this.deliver("err",this.errDec.end()),this.current?.onExit(e,t),this.cleanup(),this.onDidEnd())}cleanup(){Yt.rm(this.dir,{recursive:!0,force:!0},()=>{})}},Ai=class{constructor(e=()=>{},t=sn(),n=" session"){this.onChange=e;this.shellEnv=t;this.labelSuffix=n}onChange;shellEnv;labelSuffix;sessions=new Map;started=new Set;settings={};labels(){return[...this.sessions.values()].filter(e=>e.alive).map(e=>e.shell.label)}session(e){let t=this.sessions.get(e);return t?.alive?t:void 0}async execute(e){let t=Ie(e.language);if(t===void 0||t==="cmd")return Ln(e,this.shellEnv);this.settings=e.settings;let n=await ss(e.settings,void 0,this.shellEnv.platform),s=Tn(t,e.settings,xi(this.shellEnv,n));if(!s.ok)return Ln(e,this.shellEnv);let i=this.sessions.get(t);i&&(!i.alive||i.shell.command!==s.shell.command)&&(i.dispose(),i=void 0),i||(this.started.has(t)&&e.onStdout(`[md-runbook] new session started
|
|
234
|
+
`),i=this.start(s.shell,e.baseCwd??e.cwd,n));let o=Mn.resolve(e.cwd)===Mn.resolve(i.cwd)?void 0:e.cwd,B=await i.run({source:e.source,env:e.env,cwd:o,timeoutMs:e.timeoutMs,signal:e.signal,onStdout:e.onStdout,onStderr:e.onStderr});B.ended&&!B.cancelled&&!B.timedOut&&B.error===void 0&&e.onStderr(`[md-runbook] session ended (exit ${B.exitCode??B.signal}); the next cell starts a new session
|
|
235
|
+
`);let{ended:a,...c}=B;return{...c,shell:{...s.shell,label:s.shell.label+this.labelSuffix}}}async restart(){let e=[...this.sessions.values()].filter(n=>n.alive);if(e.length===0)return[];let t=await ss(this.settings,void 0,this.shellEnv.platform);for(let n of e)n.dispose(),this.start(n.shell,n.cwd,t);return e.map(n=>n.shell.label)}stop(){let e=this.labels();for(let t of this.sessions.values())t.dispose();return this.sessions.clear(),this.onChange(),e}dispose(){this.stop()}start(e,t,n){let s=new $B(e,t,this.shellEnv.platform,n);return s.onDidEnd=()=>{this.sessions.get(e.kind)===s&&this.sessions.delete(e.kind),this.onChange()},this.sessions.set(e.kind,s),this.started.add(e.kind),this.onChange(),s}};function nh(r){let e=Math.max(0,Math.round(r));return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m${Math.round(e%6e4/1e3)}s`}var hc=r=>r.replace(/\s*[\r\n]+\s*/g," ").trim();function rh(r,e){let t=r.step!==void 0?`Step ${r.step}`:void 0,n=r.line!==void 0?`${r.runbook}:${r.line}`:r.runbook,s=[Fe(r.at),n,t,r.section,r.title].filter(o=>o!==void 0&&o.trim()!==""),i=`===== ${e(s.map(hc).join(" \xB7 "))}
|
|
236
|
+
`;if(r.command!==void 0&&r.command.trim()!==""){let o=e(yt(r.command).replace(/\r\n?/g,`
|
|
226
237
|
`).replace(/\n+$/,"")).split(`
|
|
227
|
-
`);
|
|
238
|
+
`);i+=o.map(B=>`$ ${B}`).join(`
|
|
228
239
|
`)+`
|
|
229
|
-
`}return
|
|
240
|
+
`}return i}function sh(r){return`===== ${[`exit=${r.exit}`,nh(r.durationMs),r.check&&`check ${r.check==="ok"?"passed":"failed"}`,r.attempt!==void 0&&r.attempts!==void 0&&r.attempts>1&&`attempt ${r.attempt}/${r.attempts}`,r.lines&&`lines ${r.lines}`].filter(Boolean).join(" \xB7 ")}
|
|
230
241
|
|
|
231
|
-
`}function
|
|
242
|
+
`}function pc(r,e,t,n){return`===== ${n(hc(`${Fe(r)} \xB7 ${e} \xB7 ${t}`))}
|
|
232
243
|
|
|
233
|
-
`}var
|
|
234
|
-
`)))),
|
|
235
|
-
`))}end(e){this.ended||(this.release(),this.ended=!0,this.write(
|
|
244
|
+
`}var ih={stdout:"| ",stderr:"! "},Ri=class{constructor(e,t,n=!1){this.write=e;this.redact=t;this.hold=n;let s=o=>this.redact(yt(vr(o.replace(/\r\n/g,`
|
|
245
|
+
`)))),i=o=>new Dn(B=>this.lines(o,B),s);this.buffers={stdout:i("stdout"),stderr:i("stderr")}}write;redact;hold;buffers;carry={stdout:"",stderr:""};held=[];ended=!1;start(e){this.write(rh(e,this.redact))}out(e,t){this.ended||t===""||(this.hold?this.held.push({stream:e,text:t}):this.buffers[e].write(t))}attempt(e,t,n){this.ended||(this.release(),this.write(`----- attempt ${e}/${t} \xB7 ${Fe(n)}
|
|
246
|
+
`))}end(e){this.ended||(this.release(),this.ended=!0,this.write(sh(e)))}release(){for(let e of this.held.splice(0))this.buffers[e.stream].write(e.text);for(let e of["stdout","stderr"])this.buffers[e].flush(),this.carry[e]!==""&&this.lines(e,`
|
|
236
247
|
`)}lines(e,t){let n=(this.carry[e]+t).split(`
|
|
237
|
-
`);this.carry[e]=n.pop(),n.length>0&&this.write(n.map(s=>
|
|
248
|
+
`);this.carry[e]=n.pop(),n.length>0&&this.write(n.map(s=>ih[e]+s).join(`
|
|
238
249
|
`)+`
|
|
239
|
-
`)}};var
|
|
250
|
+
`)}};var pt=class extends Error{},TB=In;function gc(r){let e=[...r].sort((n,s)=>n-s),t=[];for(let n=0;n<e.length;){let s=n;for(;s+1<e.length&&e[s+1]===e[s]+1;)s++;t.push(s===n?`${e[n]}`:`${e[n]}\u2013${e[s]}`),n=s+1}return t.join(", ")}function Cs(r){return[...r.from!==void 0?[`--from ${r.from}`]:[],...r.to!==void 0?[`--to ${r.to}`]:[],...(r.sections??[]).map(e=>`--section ${JSON.stringify(e)}`)].join(" ")}function mc(r,e,t,n,s=[]){let i=Dc(r,t,n);if(!i)return;let o=new Set;if(e.forEach((B,a)=>{let c=t[a];i(c,B.line)&&o.add(c)}),o.size===0&&!s.some(B=>i(Math.max(B.step,1),B.line)))throw new pt(`${Cs(n)} selects no step`);return o}function Ec(r,e,t,n){let s=Dc(r,e,t);return s?n.filter(i=>s(Math.max(i.step,1),i.line)):[...n]}function Dc(r,e,t){let n=t.sections??[];if(t.from===void 0&&t.to===void 0&&n.length===0)return;let s=Math.max(0,...e);for(let[a,c]of[["--from",t.from],["--to",t.to]])if(c!==void 0&&(c<1||c>s))throw new pt(`${a} ${c} is outside the runbook: it has ${s===0?"no steps":s===1?"one step":`steps 1 to ${s}`}`);if(t.from!==void 0&&t.to!==void 0&&t.from>t.to)throw new pt(`--from ${t.from} is after --to ${t.to}`);let i=t.from??1,o=t.to??s,B=()=>!0;if(n.length>0){let a=TB(r),c=ti(a,n);if(c.length>0)throw new pt(`no heading starts with ${c.map(l=>JSON.stringify(l)).join(", ")} (--section matches the heading text after the #s, case-sensitive)`);let u=ni(a,n);if(u){let l=u.other!==void 0?`; for ${JSON.stringify(u.other)}, give more of it, e.g. --section ${JSON.stringify(u.other.split(/\s+/).slice(0,2).join(" "))}`:"";throw new pt(`--section ${JSON.stringify(u.section)} matches the runbook's title ${JSON.stringify(u.title)}, which holds every step${l}`)}B=$n(a,n)}return(a,c)=>a>=i&&a<=o&&B(c)}function bc(r,e){let t=[];return r.forEach((n,s)=>{if(n.runs)for(let i of new Set(n.uses)){let o=r.slice(0,s).filter(a=>a.captures.includes(i));if(o.length===0||o.some(a=>a.selected))continue;let B=o[o.length-1];t.push(`step ${n.n} (${e}:${n.loc.line+1}) uses \${out:${i}}, captured by step ${B.n} (${e}:${B.loc.line+1}), which is not selected`)}}),t}var ds=Ce(require("node:fs")),Te=Ce(require("node:path"));function Fi(r){let e=Te.dirname(Te.resolve(r));for(;;){if(ds.existsSync(Te.join(e,".git")))return e;let t=Te.dirname(e);if(t===e)return Te.dirname(Te.resolve(r));e=t}}function hs(r,e){let t=Te.relative(r,Te.resolve(e));return t!==""&&!t.startsWith("..")&&!Te.isAbsolute(t)}function oh(r,e){try{return new RegExp(`^(?:${e})$`).test(r)&&!/[\r\n]/.test(r)}catch{return!1}}var Bh=()=>new Date().toISOString().slice(0,10);async function ps(r,e,t,n,s={}){let i=s.shown??Te.basename(r),o=[],B=S=>{o.push(`${i}: ${S}`)},a=ds.readFileSync(r,"utf8"),c=It(a);if(!c)return B(/<!-- md-runbook:signature/.test(a)?"the signature block is damaged":"not signed (md-runbook sign)"),{problems:o};let u=c.manifest,l,C=[];for(let S of mi(c.block))try{l=await dr(c.block.manifest,S,t,s.sshKeygen);break}catch(E){C.push(E instanceof Error?E.message:String(E))}l||B(`its signature is not good: ${C.join("; ")}`),u.expires&&u.expires<Bh()&&B(`its signature expired on ${u.expires}`);let f=new Map(ct(he(a)).map(S=>[S.cellIndex,S.line+1]));for(let S of c.changed)B(`line ${f.get(S)??"?"}: changed since signing (or never signed)`);for(let S of c.moved)B(`line ${f.get(S)??"?"}: moved since signing`);c.missing.length&&B(`signed block${c.missing.length===1?"":"s"} ${c.missing.join(", ")} not in the file as signed`),c.missingCalls.length&&B(`signed runbook call${c.missingCalls.length===1?"":"s"} ${c.missingCalls.join(", ")} not in the file as signed`),he(a).cells.forEach((S,E)=>{if(S.kind!=="code"||!ce(S.meta))return;let b=ge(S.meta.info);if(b.skip||b.host||b.os&&!b.os.includes(Rn()))return;let D=Ie(S.languageId);D&&D!=="bash"&&B(`line ${f.get(E)??"?"}: a ${S.meta.lang} block is never signed (only bash/sh blocks are): it can't run in a signed run`)});let d=Ue(a),x=S=>e[S]??d?.params.find(E=>E.name===S)?.default;for(let[S,E]of Object.entries(u.patterns)){let b=x(S);b!==void 0&&!oh(b,E)&&B(`${S}=${JSON.stringify(b)} doesn't match its signed pattern ${E}`)}if((s.depth??0)<3)for(let[S,E]of c.calls){let b=Ve(E.info,E.body);if(b.src===void 0||!Mt(b).every(L=>L.kind==="param"&&x(L.name)!==void 0))continue;let y=L=>{let A=ri(L,(H,Y)=>x(Y));return"text"in A?A.text:L},v=_t(r,y(b.src)),$=`line ${f.get(S)??"?"}: the runbook call of ${y(b.src)}`;if(!hs(n,v)){B(`${$} leaves the repository (${n}): a signed runbook calls runbooks in its own repository`);continue}if(!ds.existsSync(v)){B(`${$}: no such runbook`);continue}if(hr(v,r))continue;let k={};for(let L of b.args)k[L.name]=y(L.value);let m=await ps(v,k,t,n,{...s,shown:Te.relative(Te.dirname(r),v).split(Te.sep).join("/"),depth:(s.depth??0)+1});o.push(...m.problems)}return{problems:o,...l?{signer:l}:{}}}var ah=4,lh=(r,e)=>new Promise(t=>{if(e?.aborted)return t(!1);let n=setTimeout(()=>t(!0),r);e?.addEventListener("abort",()=>(clearTimeout(n),t(!1)),{once:!0})});async function LB(r,e){let t=Dt.readFileSync(r.file,"utf8"),n=r.allowedSigners?r.signedRoot??Fi(r.file):void 0;if(r.allowedSigners&&n){let R=await ps(r.file,r.params,r.allowedSigners,n);if(R.problems.length>0)throw new pt(`not run as signed (--allowed-signers ${r.allowedSigners}); nothing ran:
|
|
251
|
+
${R.problems.map(_=>` ${_}`).join(`
|
|
252
|
+
`)}`);e.log(`\u2713 signed${R.signer?` by ${R.signer}`:""}, unchanged, parameters as signed`)}let s=qe.basename(r.file),i=qe.dirname(qe.resolve(r.file)),o=Ue(t),B=r.inheritKubeContext,a=B&&!o?.kubeContext?{params:[],...o,kubeContext:B.context,...B.mode&&!o?.kubeContextMode?{kubeContextMode:B.mode}:{}}:o,c=a?.cwd?qe.resolve(i,a.cwd):i,u=r.session??a?.mode==="session",l=new os,C=new Set,f=co(uo),h=R=>{let _=f.redact(R);for(let Ee of[...C].sort((ue,ee)=>ee.length-ue.length))_=_.split(Ee).join(Wn);return _},d=R=>{R.length>=ah&&C.add(R)},x={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0,redact:h},{regexes:S}=lc(ac),E=new Map,b=t,D=he(t),y=ct(D);for(let R of r.extraSecrets??[])d(R);for(let R of y){let _=Pe(R.language);if(!Ie(R.language)&&!_)continue;let Ee=[];try{Ee=_?Mt(Ve(R.info,R.source)):st(R.source)}catch{continue}for(let ue of Ee){if(!ue.secret)continue;let ee=ue.kind==="secret"?r.env[ue.name]:ue.kind==="input"?r.inputs[ue.name]??r.env[ue.name]:void 0;ee!==void 0&&d(ee)}}let v=D.cells.map(R=>R.kind==="code"?{kind:"code",os:ge(R.meta.kind==="code"?R.meta.info:"").os}:{kind:"markup"}),$=Fn(v),k=new Set($.filter(R=>R?.active).map(R=>R.group)),m=en(v),L=y.map(R=>m[R.cellIndex]),A={...r.from!==void 0?{from:r.from}:{},...r.to!==void 0?{to:r.to}:{},...r.sections?.length?{sections:r.sections}:{}},H=t.split(/\r?\n/),Y=Tr(t).map(R=>{let _=-1;return y.forEach((Ee,ue)=>{Ee.line<R.line&&(_=ue)}),{line:R.line,step:_>=0?L[_]:0,after:_,text:(H[R.line]??"").replace(/^.*?\[[ xX]\][ \t]*/,"").trim(),ticked:R.checked}}),z=mc(t,y,L,A,Y),te=CB(y),Z=te.ready,Q=R=>te.parts[R]??"body",ne=r.setup??"auto",ie=r.teardown??"no",De=R=>Z!==void 0&&R!==Z&&ne==="auto"&&(r.readyFirst?!0:Q(R)==="setup");z&&(r.addSetup&&y.forEach((R,_)=>{(Q(_)==="setup"||_===Z)&&z.add(L[_])}),r.readyFirst&&Z!==void 0&&z.add(L[Z]));let de=Ec(t,L,A,Y),Xe=new Set,ye=R=>{for(let _ of de)_.after!==R||_.ticked||Xe.has(_.line)||(Xe.add(_.line),e.log(`\u2610 manual, not ticked \xB7 ${s}:${_.line+1} \xB7 ${h(_.text)}`))},xe=y.map((R,_)=>{let Ee=ge(R.info),ue=$[R.cellIndex],ee=RB(R.info),Bt=[];try{Bt=(Pe(R.language)?Mt(Ve(R.info,R.source)):or(R.source,R.info,a)).filter(vt=>vt.kind==="out").map(vt=>vt.name)}catch{}let cn=!z||z.has(L[_]);return{n:L[_],loc:R,selected:cn,runs:cn&&(!ue||ue.active)&&!Ee.host&&!Ee.skip&&Ee.errors.length===0&&ee.state!=="proposed"&&ee.by===void 0&&!(Q(_)==="teardown"&&ie==="no")&&!(Q(_)==="setup"&&ne==="never")&&!(_===Z&&ne!=="auto"),uses:Bt,captures:(Ee.checks?.captures??[]).map(vt=>vt.name)}}),I=bc(xe,s);if(I.length>0)throw new pt(`${I.join(`
|
|
240
253
|
`)}
|
|
241
|
-
select the step that captures it too (a run starts without captured values); nothing ran`);if(!r.yes&&!r.keepGoing){let
|
|
242
|
-
${
|
|
254
|
+
select the step that captures it too (a run starts without captured values); nothing ran`);if(!r.yes&&!r.keepGoing){let R=xe.flatMap(_=>{if(!_.runs)return[];let Ee=ge(_.loc.info),ue=AB(Pe(_.loc.language)?"":_.loc.source,"patterns",S,Ee.confirm===!0?!0:void 0);if(ue===void 0)return[];let ee=_.loc.source.split(/\r?\n/).find(Bt=>Bt.trim()!=="")?.trim()??"";return[` Step ${_.n} \xB7 ${s}:${_.loc.line+1} \xB7 ${h(Ee.name??ee)}: ${ue===""?"confirm option":`risky command \u201C${ue.trim()}\u201D`}`]});if(R.length>0){let _=R.length===1;throw new pt(`${_?"a step asks":`${R.length} steps ask`} for confirmation in VS Code and ${_?"needs":"need"} --yes here; nothing ran:
|
|
255
|
+
${R.join(`
|
|
243
256
|
`)}
|
|
244
|
-
pass --yes to run ${
|
|
245
|
-
`,attrs:{exit:"skipped",ran:
|
|
246
|
-
`,attrs:{exit:"
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
`);for(let K of
|
|
250
|
-
`)
|
|
251
|
-
|
|
257
|
+
pass --yes to run ${_?"it":"them"}`)}}z&&e.log(z.size===0?`No block selected (${Cs(A)}): manual steps only`:`Step${z.size===1?"":"s"} ${gc([...z])} of ${Math.max(0,...L)} (${Cs(A)})`);let M=`not selected (${Cs(A)})`,F=u?new Ai:void 0,G=r.transcript?new ls(qe.resolve(r.transcript),R=>e.log(`! the transcript ${r.transcript} can't be written, so it stops: ${R.message}`)):void 0,P=r.stepPrefix??"",U=TB(t),X=R=>[...U].reverse().find(_=>_.line<R)?.text,q=(R,_,Ee)=>{G?.append(pc(new Date,s,`Step ${P}${R} \xB7 ${_}: ${Ee}`,h)),G?.flush()},le=R=>{let _,Ee=R.secret;if(R.kind==="secret")_=r.env[R.name];else if(R.kind==="input")_=r.inputs[R.name]??r.env[R.name];else if(R.kind==="param")_=r.params[R.name]??a?.params.find(ue=>ue.name===R.name)?.default;else{let ue=E.get(R.name);_=ue?.value,Ee=ue?.secret??!1}return _!==void 0?{value:_,secret:Ee}:{missing:R.kind==="secret"?`\${secret:${R.name}}: set the environment variable ${R.name}`:R.kind==="input"?`\${input:${R.name}}: pass --input ${R.name}=\u2026 or set the environment variable ${R.name}`:R.kind==="param"?r.callers?`\${param:${R.name}}: the runbook call doesn't pass ${R.name} (${R.name}=\u2026 in its block), and it has no default`:`\${param:${R.name}}: pass --param ${R.name}=\u2026 (it has no default)`:`\${out:${R.name}} has no value yet; run the cell with capture=${R.name} first`}},we=new Set,W=[],Ne=!1,et=xe.flatMap((R,_)=>R.runs||Q(_)==="teardown"&&R.selected?[_]:[]),Hn=y.map(R=>Pe(R.language)?cs(r.file,R.info,R.source):ge(R.info).estimateSeconds),Qt=new Set,un,qt=[],Wt=0,nf=R=>{let _=Q(R);return _==="setup"||_==="teardown"?{part:_}:{}},rf=()=>Ho(Go(et.filter(R=>R!==Z).map(R=>({estimateSeconds:Hn[R],state:Qt.has(R)?"done":"pending",...nf(R)})),{setup:Z===void 0||ne!=="auto"?"run":un===void 0?"unchecked":un?"up":"run",teardown:ie==="no"?"offered":"chosen"})),Er=[...y.keys()];Z!==void 0&&xe.some((R,_)=>_<Z&&R.runs&&De(_))&&(Er.splice(Er.indexOf(Z),1),Er.unshift(Z));let _B=R=>h(r.readyFirst?lr(t)??s:R.name??lr(t)??s);try{for(let R of Er){let _=y[R];ye(R-1);let Ee=$[_.cellIndex];if(Ee&&we.has(Ee.group)){if(!Ee.active)continue}else Ee&&we.add(Ee.group);let ue=L[R],ee=ge(_.info),Bt=Q(R),cn=R===Z,vt=_.source.split(/\r?\n/).find(K=>K.trim()!=="")?.trim()??"",at=(K,Oe,tt={})=>({step:ue,line:_.line+1,language:_.language,title:h(ee.name??vt),status:K,exit:Oe,durationMs:0,...ee.estimateSeconds!==void 0?{estimateSeconds:ee.estimateSeconds}:{},output:"",...te.any?{part:Bt}:{},...tt}),Bf=Bt==="body"?"":Bt==="ready"?" [ready check]":` [${Bt}]`,St=`Step ${P}${ue}${Bf} \xB7 ${s}:${_.line+1} \xB7 ${_.language}`;if(Ee&&!Ee.active){k.has(Ee.group)||(e.log(`\u2013 ${St}: for ${ir(ee.os??[])}, skipped on ${ir([Rn()])}`),W.push(at("skipped","skipped",{message:`for ${ir(ee.os??[])}`})));continue}if(r.skipDone&&xe[R].selected){let K=_.outputAttrs,Oe=_s(K?.exit,K?.lines!==void 0,K?.check);if(Oe==="done"||Oe==="skipped"){e.log(`\u2013 ${St}: done in an earlier run, kept`),W.push(at("skipped","skipped",{message:"done in an earlier run"})),Qt.add(R);continue}}if(!xe[R].selected){W.push(at("skipped","skipped",{message:M}));continue}if(ee.host){e.log(`\u2013 ${St}: runs on the host ${ee.host} (md-runbook app), skipped here`),W.push(at("skipped","skipped",{message:`runs on the host ${ee.host}`}));continue}if(cn&&ne!=="auto"){let K=ne==="never"?"--no-setup":"--setup-always";e.log(`\u2013 ${St}: not run (${K})`),W.push(at("skipped","skipped",{message:`not run (${K})`}));continue}if(Bt==="setup"&&ne==="never"){e.log(`\u2013 ${St}: setup, not run (--no-setup)`),W.push(at("skipped","skipped",{message:"setup, not run (--no-setup)"}));continue}if(Bt==="teardown"&&ie==="no"){e.log(`\u2013 ${St}: teardown, not run (--teardown runs it)`),W.push(at("skipped","skipped",{message:"teardown, not chosen (--teardown runs it)"}));continue}if(Ne&&!(Bt==="teardown"&&ie==="always")){W.push(at("not run","not run",{message:"an earlier step failed"}));continue}if(De(R)&&un===!0){e.log(`\u2013 ${St}: already up (the ready check passed), skipped`),b=wn(b,_.cellIndex,{kind:"new",text:`[md-runbook] skipped: already up (the ready check passed)
|
|
258
|
+
`,attrs:{exit:"skipped",ready:"up",ran:Fe(new Date)}},x)??b,W.push(at("skipped","skipped",{message:"already up"})),Qt.add(R);continue}let je=(K,Oe="not run")=>{e.log(`\u2717 ${St}: not run: ${K}`),q(ue,h(ee.name??vt),`not run: ${K}`),W.push(at("not run",Oe,{message:K})),r.keepGoing||(Ne=!0)};if(ee.errors.length>0){je(`invalid cell option ${ee.errors.join("; ")}`,"error");continue}let UB=RB(_.info);if(UB.state==="proposed"){je("proposed by an assistant and not approved; approve it in VS Code first");continue}if(UB.by!==void 0){je("written by an assistant; such cells only run in VS Code (approval, read-only credentials)");continue}let Gi=Ie(_.language),Hi=Pe(_.language);if(!Gi&&!Hi)continue;if(ee.skip){e.log(`\u2013 ${St}: skipped (skip option)`),b=wn(b,_.cellIndex,{kind:"new",text:`[md-runbook] skipped: skip option
|
|
259
|
+
`,attrs:{exit:"skipped",ran:Fe(new Date)}},x)??b,W.push(at("skipped","skipped"));continue}let Pi=AB(Hi?"":_.source,"patterns",S,ee.confirm===!0?!0:void 0);if(Pi!==void 0&&!r.yes){let K=Pi===""?"this block asks for confirmation (confirm option)":`risky command \u201C${Pi.trim()}\u201D`;b=wn(b,_.cellIndex,{kind:"new",text:`[md-runbook] not confirmed: ${K}; pass --yes to run it
|
|
260
|
+
`,attrs:{exit:"declined",ran:Fe(new Date)}},x)??b,je(`${K}; pass --yes to run it`,"declined");continue}if(Hi){let K=Ve(_.info,_.source);if(K.problems.length>0||K.src===void 0){je(K.problems.map(oe=>oe.message).join("; "),"error");continue}let Oe;try{Oe=Mt(K)}catch(oe){je(oe instanceof Error?oe.message:String(oe),"error");continue}let tt=new Map,lt;for(let oe of Oe){let me=le(oe);if("missing"in me){lt=me.missing;break}tt.set(oe.name,me),me.secret&&d(me.value)}if(lt){je(lt,"error");continue}let Ut=oe=>{let me=ri(oe,(kr,gn)=>tt.get(gn)?.value);return"text"in me?me.text:oe},Ge=_t(r.file,Ut(K.src)),Ae=us(r.file,Ge);if(!Dt.existsSync(Ge)||!Dt.statSync(Ge).isFile()){je(`src="${h(K.src)}": no such runbook: ${h(Ae)}`,"error");continue}if(n&&!hs(n,Ge)){je(`${h(Ae)} is outside the repository (${n}): a signed runbook calls runbooks in its own repository`,"error");continue}let hn=r.callers??[qe.resolve(r.file)],na=zl(hn.map(oe=>qe.relative(process.cwd(),oe)||oe),qe.relative(process.cwd(),Ge)||Ge,(oe,me)=>hr(oe,me));if(na){je(na,"error");continue}let ra=Dt.readFileSync(Ge,"utf8"),Yi=si(K,ra),sa=[...Yi.unknown.map(oe=>`${Ae} has no parameter ${oe.name}`),...Yi.notPassed.map(oe=>`${Ae} needs \${param:${oe}}: pass it in the call (${oe}=\u2026), it has no default`),...Yi.sections];if(sa.length>0){je(sa.join("; "),"error");continue}let Qi={};for(let oe of K.args)Qi[oe.name]=Ut(oe.value);let ia=Ue(ra),oa;try{let oe=gn=>r.params[gn]??a?.params.find(Xi=>Xi.name===gn)?.default,me=Xs(Ur(ee,a),oe),kr=Xs(ia?.kubeContext,gn=>Qi[gn]??ia?.params.find(Xi=>Xi.name===gn)?.default);if(me!==void 0&&kr!==void 0&&me!==kr){je(`${Ae} runs against the Kubernetes context ${kr}, this runbook against ${me}: nothing ran`,"error");continue}me!==void 0&&kr===void 0&&(oa={context:me,...a?.kubeContextMode?{mode:a.kubeContextMode}:{}})}catch(oe){je(oe instanceof Error?oe.message:String(oe),"error");continue}let Un,qi=!1,jn=ii(_.outputAttrs);if(jn&&!r.freshCopy&&jn.exit!==void 0&&jn.exit!=="0"&&jn.exit!=="skipped"){let oe=qe.resolve(qe.dirname(qe.resolve(r.file)),jn.copy);Dt.existsSync(oe)&&hr(_t(r.file,jn.runbook),Ge)&&(Un=oe,qi=!0)}Un??=yB(Ge,t,r.copyFolder);let Kn=us(r.file,Un),Ba=h(ee.name??vt),aa=K.sections.length?` (section${K.sections.length===1?"":"s"} ${K.sections.map(oe=>JSON.stringify(oe)).join(", ")})`:"";e.log(`\u25B6 ${St}${ee.name?` \xB7 ${ee.name}`:""} \xB7 ${h(Ae)}${aa} \xB7 ${qi?`continuing ${Kn} (steps done there are kept)`:`copy ${Kn}`}`),q(ue,Ba,`runs ${h(Ae)}${aa} as ${Kn}`);let Ss=new Date,Wi=new AbortController,la=()=>Wi.abort();r.signal?.addEventListener("abort",la,{once:!0});let Vi=!1,uf=ee.timeoutSeconds?setTimeout(()=>(Vi=!0,Wi.abort()),ee.timeoutSeconds*1e3):void 0,ut,mt;try{ut=await LB({...r,file:Un,params:Qi,from:void 0,to:void 0,skipDone:qi,sections:K.sections.length?K.sections:void 0,session:void 0,signal:Wi.signal,progress:!1,extraSecrets:[...C],callers:[...hn,Ge],stepPrefix:`${P}${ue}.`,inheritKubeContext:oa,...n?{signedRoot:n}:{},setup:"auto",addSetup:!1,teardown:ie==="always"?"always":"success",readyFirst:Q(R)==="setup"},{out:e.out,log:me=>e.log(` ${me}`)}),Dt.writeFileSync(Un,ut.text,"utf8");for(let me of ut.steps)(me.status==="failed"||me.status==="not run")&&(mt??=`step ${P}${ue}.${me.step} ${me.status==="failed"?"failed":"not run"}: ${me.message??me.exit}`);let oe=ut.manual.filter(me=>!me.ticked).length;!ut.ok&&mt===void 0&&oe>0&&(mt=`${oe} manual step${oe===1?"":"s"} not ticked in ${Kn}, which keeps evidence: tick ${oe===1?"it":"them"} there and run the call again`)}catch(oe){mt=oe instanceof Error?oe.message:String(oe)}finally{clearTimeout(uf),r.signal?.removeEventListener("abort",la)}Vi&&(mt=`timed out after ${ee.timeoutSeconds}s; the runbook called was stopped`);let Zi=new Date,ys=oe=>ut?.steps.filter(me=>me.status===oe).length??0,wr={runbook:Ae,copy:Kn,sha256:OB(Un),done:ys("passed"),skipped:ys("skipped"),failed:ys("failed"),notRun:ys("not run"),manual:ut?.manual.filter(oe=>!oe.ticked).length??0},pn=ut?.ok===!0&&!Vi,zn=pn&&Q(R)==="setup"&&ut?.setup?.ready===!0;Q(R)==="setup"&&ut?.setup?.ready!==void 0&&qt.push(ut.setup.ready),Q(R)==="setup"&&!zn&&(Wt+=Date.now()-Ss.getTime());let ua=Kl(wr,K.sections)+(zn?`[md-runbook] already up: the ready check of ${Ae} passed, so its setup was skipped
|
|
261
|
+
`:"")+(mt?`[md-runbook] ${mt}
|
|
262
|
+
`:""),ca={exit:zn?"skipped":pn?"0":"1",...zn?{ready:"up"}:{},ran:Fe(Ss),ended:Fe(Zi),duration:Ls(Zi.getTime()-Ss.getTime()),...ee.name!==void 0?{name:ee.name}:{},...jl(wr),...Jo(b,{by:Ii(),on:`${Ii()}@${gs.hostname()}`})},Os=he(b).cells[_.cellIndex]?.meta,As=ce(Os)?Ns(Os):void 0,fa=As?Ms(As,ce(Os)?Os.history?.entries??[]:[],Uo(b,0)):[];b=wn(b,_.cellIndex,{kind:"new",text:h(ua),attrs:ca,...As&&fa.length?{previous:As,history:fa}:{}},x)??b,q(ue,Ba,`${pn?"done":"failed"}: ${Kr(wr)}${mt?` (${h(mt)})`:""}`),e.log(`${pn?"\u2713":"\u2717"} Step ${P}${ue} \xB7 ${h(Ae)}: ${Kr(wr)}${mt?` \xB7 ${h(mt)}`:""}`),Qt.add(R),W.push(at(zn?"skipped":pn?"passed":"failed",ca.exit,{durationMs:Zi.getTime()-Ss.getTime(),output:h(ua),call:{runbook:Ae,copy:Kn,sha256:wr.sha256,steps:ut?.steps??[],manual:ut?.manual??[]},...zn?{message:"already up"}:pn?{}:{message:h(mt??"the runbook called failed")}})),!pn&&!ee.continueOnError&&!r.keepGoing&&(Ne=!0),r.signal?.aborted&&(Ne=!0);continue}if(!Gi)continue;let Vt={...ee.env},_i,jB=new Set,KB,zB;try{zB=st(_.source).length,KB=or(_.source,_.info,a)}catch(K){je(K instanceof Error?K.message:String(K),"error");continue}for(let K of KB){let Oe=le(K);if("missing"in Oe){_i=Oe.missing;break}Vt[K.name]=Oe.value,Oe.secret&&(d(Oe.value),jB.add(K.name))}if(_i){je(_i,"error");continue}let Dr=ee.checks,Ds,YB=Ur(ee,a);try{Dr&&(Dr=Nl(Dr,Vt,K=>jB.has(K))),Ds=Xs(YB,K=>Vt[K])}catch(K){je(K instanceof Error?K.message:String(K),"error");continue}let bs=On(YB)!==void 0?Ds:void 0,QB=wB({language:_.language,frontMatter:a,kubeContext:Ds,env:{...process.env,...a?.env,...Vt},pins:l});Vt=kB(Vt,QB);let qB=zB>0?sr(_.source,Gi):_.source,Ji=(ee.checks?.captures??[]).some(K=>K.secret),Ui="",br=ee.cwd!==void 0?qe.resolve(i,ee.cwd):c,WB=ee.timeoutSeconds??a?.timeoutSeconds??r.timeoutSeconds??0,fn=ee.retry?.attempts??1,af=ee.estimateSeconds!==void 0?` \xB7 est. ${it(ee.estimateSeconds)}`:"";e.log(`\u25B6 ${St}${af}${ee.name?` \xB7 ${ee.name}`:""}${bs?` \xB7 Kubernetes context ${bs}`:""}`);let Cn=new Date,Pn=G?new Ri(K=>G.append(K),h,Ji):void 0;Pn?.start({at:Cn,runbook:s,step:ue,line:_.line+1,section:X(_.line),title:ee.name??vt,command:qB});let _n="",ji="",ve,_e,Jt=0,VB=Dt.existsSync(br)?await yl(Ds,async K=>{let Oe="",tt="",lt={language:_.language,source:K,cwd:br,settings:a?.shell?{...r.shell,runbook:a.shell}:r.shell,timeoutMs:15e3,env:Vt,signal:r.signal,onStdout:Ge=>Oe+=Ge,onStderr:Ge=>tt+=Ge},Ut=F?await F.execute({...lt,baseCwd:c}):await Ln(lt);return{exitCode:Ut.exitCode,stdout:Oe,stderr:Ut.error??(Ut.timedOut?"timed out":tt)}},QB.pinned):void 0;if(VB!==void 0)Jt=1,ve={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:VB,durationMs:0};else for(;;){Jt++,Jt>1&&Pn?.attempt(Jt,fn,new Date),_n="",ji="",Ui="";let K=new Dn(Ae=>Ji?Ui+=Ae:e.out(Ae),h),Oe=Ae=>hn=>{_n+=hn,Ae&&(ji+=hn),K.write(hn),Pn?.out(Ae?"stdout":"stderr",hn)},tt={language:_.language,source:qB,cwd:br,settings:a?.shell?{...r.shell,runbook:a.shell}:r.shell,timeoutMs:WB*1e3,env:Vt,signal:r.signal,onStdout:Oe(!0),onStderr:Oe(!1)};if(!Dt.existsSync(br))ve={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:`Working directory not found: ${br}`,durationMs:0};else try{ve=F?await F.execute({...tt,baseCwd:c}):await Ln(tt)}catch(Ae){ve={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:Ae instanceof Error?Ae.message:String(Ae),durationMs:0}}if(K.flush(),_e=Gl(Dr)&&ve.exitCode!==null&&ve.error===void 0&&!ve.timedOut&&!ve.cancelled?Hl(Dr,ve.exitCode,_n,ji):void 0,(_e?_e.ok:Vn(ve))||Jt>=fn||ve.cancelled||r.signal?.aborted)break;let Ut=_e?.failures[0]??(ve.timedOut?"timed out":ve.error??`exit code ${$r(ve)}`),Ge=ee.retry?.everyMs??0;if(e.log(` attempt ${Jt}/${fn} failed (${h(Ut)}); trying again in ${Ge/1e3}s`),Pn?.out("stderr",`[md-runbook] attempt ${Jt}/${fn} failed (${Ut}); trying again in ${Ge/1e3}s
|
|
263
|
+
`),!await lh(Ge,r.signal))break}for(let K of _e?.secretValues??[])d(K);Ji&&e.out(h(Ui));let Ki=K=>{_n+=K,e.out(h(K)),Pn?.out("stderr",K)};ve.error!==void 0&&Ki(ve.error+`
|
|
264
|
+
`),ve.timedOut&&Ki(`[md-runbook] timed out after ${WB}s; process tree killed
|
|
265
|
+
`);for(let K of _e&&!_e.ok?_e.failures:[])Ki(`[md-runbook] check failed: ${K}
|
|
266
|
+
`);if(_e?.ok)for(let K of _e.captured)E.set(K.name,{value:K.value,secret:K.secret});let Jn=new Date,ws=$r(ve),dn=cn?(_e?_e.ok:Vn(ve))&&!ve.cancelled:void 0,ks=cn?"ok":_e?_e.ok?"ok":"failed":void 0,ZB={exit:ws,ran:Fe(Cn),ended:Fe(Jn),duration:Ls(Jn.getTime()-Cn.getTime()),...ks?{check:ks}:{},...dn!==void 0?{ready:dn?"up":"down"}:{},...fn>1?{attempts:String(Jt)}:{},...ee.name!==void 0?{name:ee.name}:{},...bs?{"kube-context":bs}:{},...Jo(b,{by:Ii(),on:`${Ii()}@${gs.hostname()}`})},xs=he(b).cells[_.cellIndex]?.meta,vs=ce(xs)?Ns(xs):void 0,XB=vs?Ms(vs,ce(xs)?xs.history?.entries??[]:[],Uo(b,0)):[];b=wn(b,_.cellIndex,{kind:"new",text:_n,attrs:ZB,...vs&&XB.length?{previous:vs,history:XB}:{}},x)??b;let zi=cn?!ve.cancelled:_e?_e.ok:Vn(ve);if(dn!==void 0){un=dn,qt.push(dn);let K=xe.flatMap((tt,lt)=>tt.runs&&De(lt)&&Hn[lt]!==void 0?[Hn[lt]]:[]),Oe=K.length?` - ${ai(K.reduce((tt,lt)=>tt+lt,0))} to set it up`:"";e.log(dn?`Setup: ${_B(ee)} is already up - setup skipped`:`Setup: ${_B(ee)} is not up${Oe}`),q(ue,h(ee.name??vt),dn?"ready check: up, setup skipped":"ready check: not up, the setup runs")}Bt==="setup"&&(Wt+=Jn.getTime()-Cn.getTime()),Pn?.end({exit:ws,durationMs:Jn.getTime()-Cn.getTime(),...ks?{check:ks}:{},...fn>1?{attempt:Jt,attempts:fn}:{}}),G?.flush();let{ran:yh,ended:Oh,...lf}=ZB;e.log(`${fo(lf)}${ve.shell?` \xB7 ${ve.shell.label}`:""}`);let ea=(Jn.getTime()-Cn.getTime())/1e3;ee.estimateSeconds!==void 0&&Mo(ea,ee.estimateSeconds)&&e.log(`! Step ${P}${ue} took ${it(ea)}, more than twice its estimate of ${it(ee.estimateSeconds)}`),Qt.add(R);let ta=r.progress?rf():void 0;ta&&e.log(` ${ta}`),W.push(at(zi?"passed":"failed",ws,{durationMs:Jn.getTime()-Cn.getTime(),output:h(_n),...zi?{}:{message:_e?.failures[0]??`exit ${ws}`}})),!zi&&!ee.continueOnError&&!r.keepGoing&&(Ne=!0),r.signal?.aborted&&(Ne=!0)}}finally{G?.flush(),F?.dispose(),l.dispose()}ye(y.length-1);let Mi=de.filter(R=>!R.ticked),JB=o?.evidence===!0;if(Mi.length>0){let R=Mi.length;e.log(JB?`\u2717 ${R} manual step${R===1?"":"s"} not ticked, and this runbook keeps evidence: tick ${R===1?"it":"them"} (- [x]) once done, and run again`:`\u2610 ${R} manual step${R===1?"":"s"} not ticked`)}let sf=W.every(R=>R.status==="passed"||R.status==="skipped")&&!(JB&&Mi.length>0);Er[0]!==0&&W.sort((R,_)=>R.step-_.step),te.any&&ie==="no"&&xe.some((R,_)=>Q(_)==="teardown"&&R.selected)&&e.log("\u2610 teardown not run: run again with --teardown (or --from with its step) when you stop for the day");let of=te.any?{setup:{...qt.length?{ready:qt.every(Boolean)}:{},seconds:Math.round(Wt/100)/10}}:{};return{steps:W,manual:de.map(({after:R,..._})=>({..._,text:h(_.text)})),text:b,ok:sf,redact:h,...of}}var an=r=>r.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]).replace(/[\x00-\x08\x0b\x0c\x0e-\x1f]/g,"");function NB(r,e=""){return r.flatMap(t=>[{...t,number:`${e}${t.step}`},...t.call?NB(t.call.steps,`${e}${t.step}.`).map(n=>({...n,file:n.file??t.call.copy})):[]])}function MB(r,e,t){return[...t.map(n=>({...n,file:r})),...e.flatMap(n=>n.call?MB(n.call.copy,n.call.steps,n.call.manual):[])]}function wc(r,e,t=[]){let n=NB(e),s=MB(r,e,t).map(u=>{let l=` <testcase classname="${an(u.file)}" name="${an(`Manual (line ${u.line+1}): ${u.text}`)}" time="0.000">`;return u.ticked?`${l}</testcase>`:`${l}<skipped message="manual step, not ticked"/></testcase>`}),i=n.filter(u=>u.status==="failed"||u.status==="not run").length,o=n.filter(u=>u.status==="skipped").length+s.filter(u=>u.includes("<skipped")).length,B=u=>(u/1e3).toFixed(3),a=e.reduce((u,l)=>u+l.durationMs,0),c=n.map(u=>{let l=an(`Step ${u.number}: ${u.title}`),C=u.estimateSeconds!==void 0?`<properties><property name="estimate" value="${u.estimateSeconds}"/></properties>`:"",f=` <testcase classname="${an(u.file??r)}" name="${l}" time="${B(u.durationMs)}">${C}`;return u.status==="passed"?`${f}</testcase>`:u.status==="skipped"?`${f}<skipped message="${an(u.message??"skipped")}"/></testcase>`:`${f}
|
|
267
|
+
<failure message="${an(u.message??u.exit)}">${an(u.output)}</failure>
|
|
252
268
|
</testcase>`});return`<?xml version="1.0" encoding="UTF-8"?>
|
|
253
269
|
<testsuites>
|
|
254
|
-
<testsuite name="${
|
|
255
|
-
`+
|
|
270
|
+
<testsuite name="${an(r)}" tests="${n.length+s.length}" failures="${i}" skipped="${o}" time="${B(a)}">
|
|
271
|
+
`+[...c,...s].join(`
|
|
256
272
|
`)+`
|
|
257
273
|
</testsuite>
|
|
258
274
|
</testsuites>
|
|
259
|
-
`}function
|
|
275
|
+
`}function kc(r,e,t=[]){let n=NB(e),s={passed:"\u2705",failed:"\u274C",skipped:"\u23ED\uFE0F","not run":"\u26D4"},i=l=>l.replace(/\|/g,"\\|").replace(/\r?\n/g," "),o=n.map(l=>`| ${l.number} | ${s[l.status]} ${l.status} | \`${i(l.title).slice(0,80)}\` | ${i(l.exit)} | ${(l.durationMs/1e3).toFixed(1)}s${l.estimateSeconds!==void 0?` (est. ${it(l.estimateSeconds)})`:""} | ${i(l.message??"")} |`),B=n.filter(l=>l.status==="passed").length,a=MB(r,e,t),c=a.map(l=>`| \u2013 | ${l.ticked?"\u2611 ticked":"\u2610 not ticked"} | ${i(l.text).slice(0,80)} | manual | \u2013 | ${i(l.file)}:${l.line+1} |`),u=a.filter(l=>!l.ticked).length;return`### ${i(r)}: ${B}/${n.length} steps passed${u?`, ${u} manual step${u===1?"":"s"} not ticked`:""}
|
|
260
276
|
|
|
261
277
|
| Step | Result | Command | Exit | Time | Note |
|
|
262
278
|
|---|---|---|---|---|---|
|
|
263
|
-
${
|
|
279
|
+
${[...o,...c].join(`
|
|
264
280
|
`)}
|
|
265
|
-
`}function
|
|
266
|
-
`)}function
|
|
267
|
-
`).map((n,s)=>({type:"TextBlock",text:n,wrap:!0,...s===0?{weight:"Bolder"}:{}}))}}]}:{text:e}}async function
|
|
281
|
+
`}function Ii(){try{return gs.userInfo().username}catch{return process.env.USER??process.env.USERNAME??"unknown"}}function xc(r,e){let t=r?.trim();if(!t)return;let n=(e?.trim()||"failure").toLowerCase();if(n!=="failure"&&n!=="always")return`notify-on must be "failure" or "always", not "${e}"`;let s;try{s=new URL(t)}catch{return"the notification URL is not a valid URL"}let i=s.hostname==="localhost"||s.hostname==="127.0.0.1"||s.hostname==="[::1]";return s.protocol!=="https:"&&!(s.protocol==="http:"&&i)?"the notification URL must use https":{url:t,on:n}}function $i(r){let{GITHUB_SERVER_URL:e,GITHUB_REPOSITORY:t,GITHUB_RUN_ID:n}=r;return e&&t&&n?`${e}/${t}/actions/runs/${n}`:void 0}var uh=r=>`Step ${r.step} (line ${r.line}) ${r.status==="failed"?"failed":"was not run"}${r.message?`: ${r.message}`:""}`;function vc(r,e,t){let n=e.steps.length,s=e.steps.filter(B=>B.status==="failed"||B.status==="not run"),o=[e.ok?`\u2713 ${r}: all ${n} step${n===1?"":"s"} passed`:`\u2717 ${r}: ${s.length} of ${n} steps failed or did not run`,...s.filter(B=>B.status==="failed"||B.message!=="an earlier step failed").slice(0,5).map(B=>`\u2022 ${uh(B)}`)];return t&&o.push(t),o.join(`
|
|
282
|
+
`)}function ch(r,e){let t=new URL(r).hostname.toLowerCase();return t==="discord.com"||t.endsWith(".discord.com")||t==="discordapp.com"?{content:e.slice(0,2e3)}:t.endsWith(".logic.azure.com")||t.endsWith(".powerplatform.com")||t.endsWith(".webhook.office.com")?{type:"message",attachments:[{contentType:"application/vnd.microsoft.card.adaptive",content:{$schema:"http://adaptivecards.io/schemas/adaptive-card.json",type:"AdaptiveCard",version:"1.4",body:e.split(`
|
|
283
|
+
`).map((n,s)=>({type:"TextBlock",text:n,wrap:!0,...s===0?{weight:"Bolder"}:{}}))}}]}:{text:e}}async function Sc(r,e,t=fetch){let n;try{n=await t(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(ch(r,e)),signal:AbortSignal.timeout(15e3)})}catch(s){let i=s instanceof Error&&s.name==="TimeoutError"?"no answer within 15 s":"the request failed";throw new Error(`could not send the notification (${i})`)}if(!n.ok)throw new Error(`could not send the notification (HTTP ${n.status})`)}var yc=require("node:child_process"),wt=Ce(require("node:fs")),Oc=Ce(require("node:os")),bt=Ce(require("node:path")),Ac=require("node:url");function fh(r){let e=r.env;return r.platform==="win32"?[e.ProgramFiles,e["ProgramFiles(x86)"],e.LOCALAPPDATA].filter(n=>!!n).flatMap(n=>[bt.win32.join(n,"Google","Chrome","Application","chrome.exe"),bt.win32.join(n,"Microsoft","Edge","Application","msedge.exe"),bt.win32.join(n,"Chromium","Application","chrome.exe")]):r.platform==="darwin"?["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Chromium.app/Contents/MacOS/Chromium"]:["google-chrome","google-chrome-stable","chromium","chromium-browser","microsoft-edge"].map(t=>r.which(t)).filter(t=>t!==void 0)}function pr(r,e=sn()){return r||fh(e).find(t=>e.exists(t))}async function gr(r,e,t){let n=wt.mkdtempSync(bt.join(Oc.tmpdir(),"md-runbook-pdf-")),s=bt.join(n,"report.html"),i=bt.resolve(e);wt.writeFileSync(s,r,"utf8");try{wt.rmSync(i,{force:!0});let o=["--headless=new","--disable-gpu","--no-first-run","--no-default-browser-check",`--user-data-dir=${bt.join(n,"profile")}`,...process.platform==="linux"&&process.getuid?.()===0?["--no-sandbox"]:[],"--no-pdf-header-footer",`--print-to-pdf=${i}`,(0,Ac.pathToFileURL)(s).href];await new Promise((B,a)=>{(0,yc.execFile)(t,o,{timeout:12e4,windowsHide:!0},(c,u,l)=>{if(wt.existsSync(i)&&wt.statSync(i).size>0)return B();a(new Error(`${bt.basename(t)} did not write the PDF${c?`: ${c.message}`:""}${l.trim()?`
|
|
268
284
|
${l.trim().split(`
|
|
269
285
|
`).slice(-3).join(`
|
|
270
|
-
`)}`:""}`))})})}finally{
|
|
286
|
+
`)}`:""}`))})})}finally{wt.rm(n,{recursive:!0,force:!0,maxRetries:3},()=>{})}}var gt=Ce(require("node:fs")),Rc=Ce(require("node:path"));var ms=`Usage: md-runbook sign <file.md> --key KEY [options]
|
|
271
287
|
md-runbook verify <file.md> [--allowed-signers FILE]
|
|
272
288
|
|
|
273
289
|
sign writes a signature block at the end of the runbook: its bash blocks as servers with
|
|
@@ -293,22 +309,22 @@ verify shows what a runbook's signature covers and which blocks changed since si
|
|
|
293
309
|
with --allowed-signers (a server's allowed_signers file) does it check the signature as the gate
|
|
294
310
|
would; without it, the signer's name is just what the file says. Exit code 0 when everything is
|
|
295
311
|
signed (and, with --allowed-signers, the signature verifies).
|
|
296
|
-
|
|
297
|
-
`)};async function
|
|
312
|
+
`,$t=class extends Error{},Es=(r=0)=>new Date(Date.now()+r*864e5).toISOString().slice(0,10);function Ch(r){return Rc.basename(r).replace(/(\.runbook)?\.md$/i,"").replace(/[^A-Za-z0-9._/-]+/g,"-").replace(/^[^A-Za-z0-9]+/,"")||"runbook"}function dh(r){let e=[...r],t={patterns:{}},n=s=>{let i=e.shift();if(i===void 0||i.startsWith("--"))throw new $t(`${s} needs a value`);return i};for(;e.length>0;){let s=e.shift();switch(s){case"--key":t.key=n(s);break;case"--signer":t.signer=n(s);break;case"--name":t.name=n(s);break;case"--out":t.out=n(s);break;case"--cosign":t.cosign=!0;break;case"--record":t.record=!0;break;case"--version":{let i=Number(n(s));if(!Number.isInteger(i)||i<1)throw new $t("--version expects a positive whole number");t.version=i;break}case"--expires":t.expires=n(s);break;case"--expires-in":{let i=Number(n(s));if(!Number.isInteger(i)||i<0)throw new $t("--expires-in expects days");t.expires=Es(i);break}case"--scope":(t.scopes??=[]).push(n(s));break;case"--pattern":{let i=n(s),o=i.indexOf("=");if(o<=0)throw new $t(`--pattern expects NAME=REGEX, got "${i}"`);t.patterns[i.slice(0,o)]=i.slice(o+1);break}default:if(s.startsWith("-"))throw new $t(`unknown option ${s}`);if(t.file)throw new $t(`one runbook at a time (got "${t.file}" and "${s}")`);t.file=s}}if(!t.file)throw new $t("missing the runbook file");if(!t.key)throw new $t("missing --key");return t}var Fc=r=>{process.stdout.write(r+`
|
|
313
|
+
`)};async function Ic(r,e=Fc,t){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(ms),0;let n;try{n=dh(r)}catch(d){if(!(d instanceof $t))throw d;return process.stderr.write(`md-runbook: ${d.message}
|
|
298
314
|
|
|
299
|
-
${
|
|
300
|
-
`),2;let s=
|
|
301
|
-
`),1;if(r.cosign&&s&&!s.unchanged)return process.stderr.write(`md-runbook: ${r.file}: the run record changed since ${
|
|
302
|
-
`),1;let
|
|
303
|
-
`),1}let
|
|
315
|
+
${ms}`),2}if(!gt.existsSync(n.file))return process.stderr.write(`md-runbook: no such file: ${n.file}
|
|
316
|
+
`),2;let s=gt.readFileSync(n.file,"utf8"),i=(()=>{let d=oB(s);try{return d?{block:d,manifest:Zr(d.manifest)}:void 0}catch{return}})();if(n.record)return ph(n,s,e,t);if(n.cosign)return hh(n,s,i?.block,e,t);let o={name:n.name??i?.manifest.name??Ch(n.file),version:n.version??(i?i.manifest.version+1:1),...n.expires?{expires:n.expires}:{},scopes:n.scopes??i?.manifest.scopes??[],patterns:{...i?.manifest.patterns??{},...n.patterns}},B=sB(s,o);if("errors"in B){for(let d of B.errors)e(`${n.file}: error: ${d}`);return e("\u2717 not signed"),1}let a=Tn("bash",{},sn()),c=a.ok?await xB(B.manifest,a.shell.command):void 0;if(c?.length){for(let d of c)e(`${n.file}: error: ${d}`);return e("\u2717 not signed: a server runs these commands one by one; make each a whole command (or end the cell differently)"),1}c||e(" note: bash not found, so the commands were not checked one by one (bash -n)");let u=iB(B.manifest),l;try{l=await Bs(u,n.key,{sshKeygen:t})}catch(d){return e(`\u2717 ${d instanceof Error?d.message:String(d)}`),1}let C=n.signer??as(n.key)??i?.block.signer??"unknown",f=n.out??n.file;gt.writeFileSync(f,aB(s,{signer:C,signed:Es(),manifest:u,signature:l}),"utf8");let h=B.manifest;return e(`\u2713 ${h.name} version ${h.version} signed by ${C}: ${h.cells.length} block${h.cells.length===1?"":"s"}${h.scopes.length?`, scopes ${h.scopes.join(" ")}`:""}${h.expires?`, until ${h.expires}`:""} \xB7 written to ${f}`),e(` manifest sha256 ${yi(u)} (list it in a server's revoked file to withdraw this version)`),0}async function hh(r,e,t,n,s){if(!t)return n(`\u2717 ${r.file} is not signed yet: sign it first, then a second signer adds --cosign`),1;if(r.name||r.version||r.expires||r.scopes||Object.keys(r.patterns).length)return n("\u2717 --cosign signs the manifest as it is: --name, --version, --expires, --scope and --pattern belong to signing"),1;if(!Eu(e,t))return n(`\u2717 ${r.file} changed since ${t.signer} signed it: sign it again (a new version), then co-sign that`),1;let i;try{i=await Bs(t.manifest,r.key,{sshKeygen:s})}catch(l){return n(`\u2717 ${l instanceof Error?l.message:String(l)}`),1}let o=r.signer??as(r.key)??"unknown",B=[...(t.cosigners??[]).filter(l=>l.signer!==rn(o)),{signer:o,signed:Es(),signature:i}],a=r.out??r.file,c={...t,cosigners:B};gt.writeFileSync(a,aB(e,c),"utf8");let u=Zr(t.manifest);return n(`\u2713 ${u.name} version ${u.version} co-signed by ${o}: signed by ${BB(c).join(", ")} \xB7 written to ${a}`),0}async function ph(r,e,t,n){let s=ns(e);if(r.cosign&&!s)return process.stderr.write(`md-runbook: ${r.file}: the run record is not signed yet (sign it first, then a second person co-signs)
|
|
317
|
+
`),1;if(r.cosign&&s&&!s.unchanged)return process.stderr.write(`md-runbook: ${r.file}: the run record changed since ${ur(s.block).join(", ")} signed it: sign it again first
|
|
318
|
+
`),1;let i=bi(e),o;try{o=await Bs(lB(i),r.key,{sshKeygen:n})}catch(l){return process.stderr.write(`md-runbook: ${l instanceof Error?l.message:String(l)}
|
|
319
|
+
`),1}let B=r.signer??as(r.key)??"unknown",a=Fe(new Date),c=r.cosign&&s?Iu(s.block,{signer:B,signed:a,signature:o}):{signer:B,signed:a,sha256:i,signature:o},u=r.out??r.file;return gt.writeFileSync(u,Fu(e,c),"utf8"),t(`\u2713 ${u}: run record signed by ${ur(c).join(", ")} (sha256 ${i})`),0}async function gh(r,e,t,n,s){let i=ns(r);if(!i)return;let o=i.block,B=(o.cosigners??[]).map(c=>`, co-signed by ${c.signer} at ${c.signed}`).join("");n(`${e}: run record signed by ${o.signer} at ${o.signed}${B} (as the file says)`),n(` record sha256 ${o.sha256}: ${i.unchanged?"unchanged since signing":`CHANGED since signing (now ${bi(r)})`}`);let a=i.unchanged;if(t){let c=[o.signature,...(o.cosigners??[]).map(l=>l.signature)],u=ur(o);for(let l=0;l<c.length;l++)try{n(` record signature ${l+1} (${u[l]}): good, by ${await dr(lB(o.sha256),c[l],t,s)} (${t})`)}catch(C){n(` record signature ${l+1} (${u[l]}): ${C instanceof Error?C.message:String(C)}`),a=!1}}else n(" record signature: NOT checked: add --allowed-signers FILE");return a}async function $c(r,e=Fc,t){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(ms),0;let n=[...r],s,i;for(;n.length>0;){let h=n.shift();if(h==="--allowed-signers")i=n.shift();else{if(h.startsWith("-")||s)return process.stderr.write(`md-runbook: ${h.startsWith("-")?`unknown option ${h}`:"one runbook at a time"}
|
|
304
320
|
|
|
305
|
-
${
|
|
321
|
+
${ms}`),2;s=h}}if(!s||r.includes("--allowed-signers")&&!i)return process.stderr.write(`md-runbook: ${s?"--allowed-signers needs a file":"missing the runbook file"}
|
|
306
322
|
|
|
307
|
-
${
|
|
308
|
-
`),2;let
|
|
323
|
+
${ms}`),2;if(!gt.existsSync(s))return process.stderr.write(`md-runbook: no such file: ${s}
|
|
324
|
+
`),2;let o=gt.readFileSync(s,"utf8"),B=It(o),a=await gh(o,s,i,e,t);if(!B)return a!==void 0?(e(`${a?"\u2713":"\u2717"} run record${i?"":", signature not checked"} (the runbook itself is not signed)`),a?0:1):(e(`\u2717 ${s}: ${/<!-- md-runbook:signature/.test(o)?"the signature block is damaged":"not signed"}`),1);a===!1&&e(" (the run record above does not verify)");let c=B.manifest,u=(B.block.cosigners??[]).map(h=>`, co-signed by ${h.signer} on ${h.signed}`).join("");e(`${s}: ${c.name} version ${c.version}, signed by ${B.block.signer} on ${B.block.signed}${u} (as the file says)`),e(` scopes: ${c.scopes.length?c.scopes.join(" "):"none (only servers that accept any scope)"}`),c.expires&&e(` expires: ${c.expires}${c.expires<Es()?" (expired)":""}`);for(let[h,d]of Object.entries(c.patterns))e(` parameter ${h}: ${d}`);e(` manifest sha256 ${yi(B.block.manifest)}`);let l=!0,C=new Map(ct(he(o)).map(h=>[h.cellIndex,h.line]));for(let h of B.changed)e(`${s}:${(C.get(h)??0)+1}: changed since signing: servers that only run signed runbooks refuse this block`),l=!1;for(let h of B.moved)e(`${s}:${(C.get(h)??0)+1}: moved since signing: signed as block ${B.cells.get(h).n}, after blocks that now come later`),l=!1;if(B.missing.length>0&&(e(` signed block${B.missing.length===1?"":"s"} ${B.missing.join(", ")} of ${c.cells.length} not in the file as signed (deleted or changed)`),l=!1),c.expires&&c.expires<Es()&&(l=!1),i){let h=mi(B.block),d=BB(B.block),x=new Set;for(let S=0;S<h.length;S++){let E=h.length>1?`signature ${S+1} (${d[S]})`:"signature";try{let b=await dr(B.block.manifest,h[S],i,t);x.add(b),e(` ${E}: good, by ${b} (${i})`)}catch(b){e(` ${E}: ${b instanceof Error?b.message:String(b)}`),l=!1}}h.length>1&&e(` signers: ${x.size} distinct (${[...x].join(", ")||"none"})`)}else e(" signature: NOT checked (anyone can write a signer name): add --allowed-signers FILE to check it as the gate does");B.missingCalls.length>0&&(e(` signed runbook call${B.missingCalls.length===1?"":"s"} ${B.missingCalls.join(", ")} of ${c.calls.length} not in the file as signed (deleted or changed)`),l=!1);let f=Fi(s);for(let h of B.calls.values()){let d=Ve(h.info,h.body).src??"";if(ar(d)){e(` runbook call: ${d}: has placeholders, checked when it runs (md-runbook run --allowed-signers)`);continue}let x=_t(s,d);if(!hs(f,x)){e(` runbook call: ${d}: outside the repository (${f})`),l=!1;continue}if(!i){e(` runbook call: ${d}: ${It(gt.existsSync(x)?gt.readFileSync(x,"utf8"):"")?"signed (not checked)":"NOT signed"}`);continue}let S=gt.existsSync(x)?await ps(x,{},i,f,{shown:d,...t?{sshKeygen:t}:{}}):{problems:[`${d}: no such runbook`]};e(` runbook call: ${d}: ${S.problems.length===0?"signed, good":S.problems.join("; ")}`),S.problems.length>0&&(l=!1)}return e(`${l?"\u2713":"\u2717"} ${B.cells.size} signed block${B.cells.size===1?"":"s"}${B.calls.size?`, ${B.calls.size} signed runbook call${B.calls.size===1?"":"s"}`:""}, ${B.changed.length} changed`+(i?"":", signature not checked")),l&&a!==!1?0:1}var Uc=require("node:child_process"),Tt=Ce(require("node:fs")),Le=Ce(require("node:path"));var mh=Mc(),Gc={M:2331,L:2953};function GB(r){let e=new TextEncoder().encode(r).length,t=e<=Gc.M?"M":e<=Gc.L?"L":void 0;if(!t)return;let n=mh(0,t);n.addData(r,"Byte"),n.make();let s=n.getModuleCount(),i=Array.from({length:s},(o,B)=>Array.from({length:s},(a,c)=>n.isDark(B,c)));return{size:s,dark:i,level:t}}function HB(r,e={}){let t=e.scale??4,n=e.margin??4,s=(r.size+n*2)*t,i=e.caption?Math.max(14,t*4)+t*2:0,o=[];for(let a=0;a<r.size;a++){let c=0;for(;c<r.size;){if(!r.dark[a][c]){c++;continue}let u=c;for(;c<r.size&&r.dark[a][c];)c++;o.push(`M${(u+n)*t} ${(a+n)*t}h${(c-u)*t}v${t}h-${(c-u)*t}z`)}}let B=e.caption?`<text x="${s/2}" y="${s+i/2}" text-anchor="middle" dominant-baseline="middle" font-family="system-ui, sans-serif" font-size="${Math.max(12,t*3.5)}" fill="#000">${re(e.caption)}</text>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${s+i}" width="${s}" height="${s+i}" shape-rendering="crispEdges"><rect width="100%" height="100%" fill="#fff"/><path fill="#000" d="${o.join("")}"/>${B}</svg>`}function Hc(r,e){let t=[],n=e.map(i=>{let o=GB(i.link);return o?`<figure class="label">${HB(o,{scale:3})}<figcaption><strong>${re(i.title)}</strong>${i.subtitle?`<span>${re(i.subtitle)}</span>`:""}</figcaption></figure>`:(t.push(i.title),"")});return{html:`<!doctype html>
|
|
309
325
|
<html lang="en"><head><meta charset="utf-8">
|
|
310
326
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:">
|
|
311
|
-
<title>${
|
|
327
|
+
<title>${re(r)}</title>
|
|
312
328
|
<style>
|
|
313
329
|
@page{size:A4;margin:12mm}
|
|
314
330
|
body{font-family:system-ui,sans-serif;margin:0;color:#000;background:#fff}
|
|
@@ -319,15 +335,15 @@ h1{font-size:14px;font-weight:600;margin:0 0 8mm}
|
|
|
319
335
|
figcaption{font-size:11px;line-height:1.35;margin-top:2mm;overflow-wrap:anywhere}
|
|
320
336
|
figcaption span{display:block;color:#333}
|
|
321
337
|
</style></head><body>
|
|
322
|
-
<h1>${
|
|
338
|
+
<h1>${re(r)}</h1>
|
|
323
339
|
<div class="sheet">
|
|
324
340
|
${n.filter(Boolean).join(`
|
|
325
341
|
`)}
|
|
326
342
|
</div>
|
|
327
343
|
</body></html>
|
|
328
|
-
`,tooLong:t}}function
|
|
329
|
-
`||u==="\r"?(u==="\r"&&
|
|
330
|
-
`&&c++,t.push(n),e.push(t),t=[],n=""):n+=u}(n!==""||t.length>0)&&(t.push(n),e.push(t));let[
|
|
344
|
+
`,tooLong:t}}function Pc(r){let e=[],t=[],n="",s=!1,i=r.replace(/^/,"");for(let c=0;c<i.length;c++){let u=i[c];s?u==='"'&&i[c+1]==='"'?(n+='"',c++):u==='"'?s=!1:n+=u:u==='"'?s=!0:u===","?(t.push(n),n=""):u===`
|
|
345
|
+
`||u==="\r"?(u==="\r"&&i[c+1]===`
|
|
346
|
+
`&&c++,t.push(n),e.push(t),t=[],n=""):n+=u}(n!==""||t.length>0)&&(t.push(n),e.push(t));let[o,...B]=e.filter(c=>c.some(u=>u.trim()!==""));if(!o)return[];let a=o.map(c=>c.trim());return B.map(c=>Object.fromEntries(a.map((u,l)=>[u,(c[l]??"").trim()])))}function _c(r,e,t){let n=r.trim().replace(/\.git$/,""),s=/^(?:git@([^:]+):|ssh:\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/|https:\/\/(?:[^@/]+@)?([^/]+)\/)(.+)$/.exec(n);if(!s)return;let i=(s[1]??s[2]??s[3]).toLowerCase(),o=s[4],B=c=>c.split(/[\\/]/).map(encodeURIComponent).join("/"),a=B(t);if(i==="github.com")return`https://github.com/${o}/blob/${B(e)}/${a}`;if(i.includes("gitlab"))return`https://${i}/${o}/-/blob/${B(e)}/${a}`}var Jc=`Usage: md-runbook qr <file.md> [options]
|
|
331
347
|
md-runbook link <file.md> [options] (prints the link: a pager alert, a chat)
|
|
332
348
|
md-runbook qr <file.md> --labels hosts.csv [options]
|
|
333
349
|
|
|
@@ -351,29 +367,32 @@ says who approved it.
|
|
|
351
367
|
--out FILE .svg (one code), .html or .pdf (labels). Default: next to the runbook
|
|
352
368
|
--browser PATH Browser for a .pdf (default: CHROME_PATH, else one found on this machine)
|
|
353
369
|
--link Print the link too
|
|
354
|
-
`,
|
|
355
|
-
`)};function
|
|
370
|
+
`,kt=class extends Error{},Eh=r=>{process.stdout.write(r+`
|
|
371
|
+
`)};function Dh(r){let e=[...r],t={file:"",embed:!1,pin:!1,params:{},cosign:!1,vscode:!1,printLink:!1},n=s=>{let i=e.shift();if(i===void 0||i.startsWith("--"))throw new kt(`${s} needs a value`);return i};for(;e.length>0;){let s=e.shift();switch(s){case"--embed":t.embed=!0;break;case"--url":t.url=n(s);break;case"--pin":t.pin=!0;break;case"--host":t.host=n(s);break;case"--param":{let i=n(s),o=i.indexOf("=");if(o<=0||!At.test(i.slice(0,o)))throw new kt(`--param expects NAME=VALUE, got "${i}"`);t.params[i.slice(0,o)]=i.slice(o+1);break}case"--cosign":t.cosign=!0;break;case"--web-app":t.webApp=n(s);break;case"--vscode":t.vscode=!0;break;case"--labels":t.labels=n(s);break;case"--out":t.out=n(s);break;case"--browser":t.browser=n(s);break;case"--link":t.printLink=!0;break;default:if(s.startsWith("-"))throw new kt(`unknown option ${s}`);if(t.file)throw new kt(`one runbook at a time (got ${t.file} and ${s})`);t.file=s}}if(!t.file)throw new kt("missing the runbook file");if(t.embed&&t.url)throw new kt("--embed and --url: choose one");if(t.pin&&!t.url)throw new kt("--pin goes with --url (the Git address is pinned anyway)");if(t.webApp&&!/^https:\/\/[^/]+\/(?:.*\/)?open$/.test(t.webApp))throw new kt("--web-app expects https://<web app>/open");if(t.webApp&&t.vscode)throw new kt("--web-app and --vscode: choose one");return t}var Ti=(r,e)=>(0,Uc.execFileSync)("git",e,{cwd:r,encoding:"utf8",windowsHide:!0,timeout:1e4,stdio:["ignore","pipe","ignore"],maxBuffer:8*1024*1024});function bh(r){let e=Le.dirname(Le.resolve(r)),t,n,s;try{t=Ti(e,["rev-parse","--show-toplevel"]).trim(),n=Ti(e,["remote","get-url","origin"]).trim(),s=Ti(e,["rev-parse","--abbrev-ref","HEAD"]).trim()}catch{return"not in a Git repository with a remote: use --embed, or --url"}let i=Le.relative(t,Le.resolve(r)).split(Le.sep).join("/"),o=_c(n,s,i);if(!o)return`the app opens GitHub and GitLab addresses; this repository's remote is ${n}: use --embed, or --url`;try{return{web:o,sha256:ts(Ti(t,["show",`origin/${s}:${i}`]))}}catch{return{web:o}}}async function PB(r,e=Eh,t=!1){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(Jc),0;let n;try{n=Dh(r)}catch(d){if(!(d instanceof kt))throw d;return process.stderr.write(`md-runbook: ${d.message}
|
|
356
372
|
|
|
357
|
-
${
|
|
373
|
+
${Jc}`),2}if(!Tt.existsSync(n.file))return process.stderr.write(`md-runbook: no such file: ${n.file}
|
|
358
374
|
`),2;if(n.vscode&&!t)return process.stderr.write(`md-runbook: --vscode is for md-runbook link (a phone camera does not open VS Code links)
|
|
359
|
-
`),2;let s=
|
|
360
|
-
`),2;
|
|
361
|
-
`)}let
|
|
362
|
-
`),2;if(t)return e(
|
|
363
|
-
`),1;let E=n.out??
|
|
364
|
-
`,"utf8"),n.printLink&&e(
|
|
365
|
-
`),2;let u=
|
|
366
|
-
`),2;let l=[];for(let[
|
|
367
|
-
`),2;t?e(`${
|
|
368
|
-
`),1;let
|
|
369
|
-
`),1;await
|
|
370
|
-
${
|
|
371
|
-
${
|
|
372
|
-
|
|
373
|
-
`)
|
|
374
|
-
`).
|
|
375
|
-
`).join(""),
|
|
376
|
-
|
|
375
|
+
`),2;let s=Tt.readFileSync(n.file,"utf8"),i={params:{...n.params},...n.cosign?{action:"cosign"}:{}};if(n.embed)i.text=Ar(s);else if(n.url)i.url=n.url,n.pin&&(i.sha256=ts(s));else{let d=bh(n.file);if(typeof d=="string")return process.stderr.write(`md-runbook: ${d}
|
|
376
|
+
`),2;i.url=d.web,d.sha256?i.sha256=d.sha256:process.stderr.write(`md-runbook: the file is not pushed yet (no origin version): the link is not pinned
|
|
377
|
+
`)}let o=d=>n.vscode?xu(d):es(d,n.webApp??Di),B=d=>{let x=n.vscode?vu(decodeURIComponent(d.slice(d.indexOf("?")+1))):Ei(d);return x.ok?void 0:x.problem},a=Le.basename(n.file).replace(/\.md$/i,""),c=lr(s)??a;if(!n.labels){n.host&&(i.host=n.host);let d=o(i),x=B(d);if(x)return process.stderr.write(`md-runbook: the app would refuse this link (${x})
|
|
378
|
+
`),2;if(t)return e(d),0;let S=GB(d);if(!S)return process.stderr.write(`md-runbook: too much for a QR code (${Buffer.byteLength(d)} bytes; 2953 at most): use its address instead of --embed
|
|
379
|
+
`),1;let E=n.out??Le.join(Le.dirname(n.file),`${a}.qr.svg`);return Tt.mkdirSync(Le.dirname(Le.resolve(E)),{recursive:!0}),Tt.writeFileSync(E,HB(S,{scale:8,caption:n.host??c})+`
|
|
380
|
+
`,"utf8"),n.printLink&&e(d),e(`\u2713 ${E}: QR code (${S.size}\xD7${S.size}, level ${S.level}) for ${n.host?`${c} on ${n.host}`:c}`),0}if(n.host)return process.stderr.write(`md-runbook: --host and --labels: the hosts come from the CSV
|
|
381
|
+
`),2;let u=Pc(Tt.readFileSync(n.labels,"utf8"));if(u.length===0||!("host"in u[0]))return process.stderr.write(`md-runbook: ${n.labels}: expected a header row with a host column (and optional label, p.NAME columns)
|
|
382
|
+
`),2;let l=[];for(let[d,x]of u.entries()){let S={...i.params};for(let[D,y]of Object.entries(x))D.startsWith("p.")&&y!==""&&(S[D.slice(2)]=y);let E=o({...i,...x.host?{host:x.host}:{},params:S}),b=B(E);if(b)return process.stderr.write(`md-runbook: ${n.labels} row ${d+2}: the app would refuse its link (${b})
|
|
383
|
+
`),2;t?e(`${x.host} ${E}`):n.printLink&&e(E),l.push({link:E,title:x.host||c,subtitle:x.label||(x.host?c:void 0)})}if(t)return 0;let{html:C,tooLong:f}=Hc(c,l);if(f.length>0)return process.stderr.write(`md-runbook: too much for a QR code: ${f.join(", ")} (use its address instead of --embed)
|
|
384
|
+
`),1;let h=n.out??Le.join(Le.dirname(n.file),`${a}.labels.html`);if(Tt.mkdirSync(Le.dirname(Le.resolve(h)),{recursive:!0}),/\.pdf$/i.test(h)){let d=pr(n.browser??process.env.CHROME_PATH);if(!d)return process.stderr.write(`md-runbook: a .pdf needs Chrome, Edge or Chromium; none was found (use --browser PATH or CHROME_PATH), or write .html
|
|
385
|
+
`),1;await gr(C,h,d)}else Tt.writeFileSync(h,C,"utf8");return e(`\u2713 ${h}: ${l.length} label${l.length===1?"":"s"}`),0}var Lt=Ce(require("node:fs")),Gn=Ce(require("node:path"));function jc(r){let e=[],t=0;for(let n of r.split(/\r?\n/)){if(n.trim()==="")continue;let s=n.indexOf("{");if(s<0){t++;continue}try{let i=JSON.parse(n.slice(s));typeof i.time=="string"&&typeof i.event=="string"?e.push(i):t++}catch{t++}}return{events:e,skipped:t}}var Be=r=>typeof r=="string"?r:r===void 0?"":String(r);function Kc(r,e=0){let t=[...r].sort((f,h)=>Date.parse(f.time)-Date.parse(h.time)),n=[],s=[],i=[],o=new Map,B=new Map,a=new Map,c=0,u=f=>`${Be(f.account)}
|
|
386
|
+
${Be(f.who)}
|
|
387
|
+
${Be(f.client)}`,l=new Map,C=new Map;for(let f of t){let h=u(f);switch(f.event){case"session":c++,o.set(h,new Map);break;case"load":o.has(h)||o.set(h,new Map),o.get(h).set(Be(f.runbook),{}),l.set(Be(f.hash),{runbook:Be(f.runbook),version:Be(f.version)}),typeof f["called-by"]=="string"?C.set(`${h}
|
|
388
|
+
${Be(f.runbook)}`,{hash:f["called-by"],call:Be(f.call)}):C.delete(`${h}
|
|
389
|
+
${Be(f.runbook)}`);break;case"param":{let d=o.get(h)??new Map;o.set(h,d);let x=d.get(Be(f.runbook))??{};x[Be(f.name)]=Be(f.value),d.set(Be(f.runbook),x);break}case"run":{let d={time:f.time,account:Be(f.account),who:Be(f.who),client:Be(f.client),runbook:Be(f.runbook),version:Be(f.version),hash:Be(f.hash),signer:Be(f.signer),cell:Be(f.cell),step:Be(f.step),params:{...o.get(h)?.get(Be(f.runbook))??{}}},x=C.get(`${h}
|
|
390
|
+
${Be(f.runbook)}`);x&&(d.calledBy={...x}),n.push(d),B.set(Be(f.id),d),a.set(Be(f.id),d);break}case"probe":{let d=Number(Be(f.days_left)),x=f.run===void 0?void 0:a.get(Be(f.run));i.push({time:f.time,account:Be(f.account),who:Be(f.who),client:Be(f.client),target:Be(f.target),address:Be(f.address),ok:f.result==="ok",detail:Be(f.detail),...Be(f.days_left)!==""&&Number.isFinite(d)?{daysLeft:d}:{},...f.not_after?{notAfter:Be(f.not_after)}:{},...f.cert_sha256?{certSha256:Be(f.cert_sha256)}:{},...x?{run:x}:{}});break}case"end":{let d=B.get(Be(f.id));if(!d)break;B.delete(Be(f.id)),d.ended=f.time,d.durationSeconds=Math.max(0,Math.round((Date.parse(f.time)-Date.parse(d.time))/1e3)),typeof f.exit=="number"&&(d.exit=f.exit);break}case"refused":case"unsigned":case"stop":s.push({time:f.time,kind:f.event,account:Be(f.account),who:Be(f.who),client:Be(f.client),detail:f.event==="refused"?Be(f.reason):f.event==="unsigned"?`unsigned code, sha256 ${Be(f.hash)}`:`stopped (${Be(f.signal)})`});break}}for(let f of n)f.calledBy&&Object.assign(f.calledBy,l.get(f.calledBy.hash)??{});return{runs:n,findings:s,probes:i,sessions:c,skipped:e}}function zc(r,e){let t=n=>(!e.since||Date.parse(n)>=e.since.getTime())&&(!e.until||Date.parse(n)<=e.until.getTime());return{...r,runs:r.runs.filter(n=>t(n.time)&&(!e.runbook||n.runbook===e.runbook)&&(!e.who||n.who===e.who)),findings:r.findings.filter(n=>t(n.time)&&(!e.who||n.who===e.who)),probes:r.probes.filter(n=>t(n.time)&&(!e.who||n.who===e.who)&&(!e.runbook||n.run?.runbook===e.runbook))}}function Yc(r,e,t,n=120){let s=It(t),i=s?.manifest.name??"",o=he(t),B=o.cells.map(C=>ce(C.meta)?ge(C.meta.info):void 0),a=en(o.cells.map((C,f)=>ce(C.meta)?{kind:"code",os:B[f]?.os}:{kind:"markup"})),c=[],u=[],l=new Set;for(let[C,f]of o.cells.entries()){let h=a[C];if(h===void 0||!ce(f.meta))continue;let d=f.output?.attrs.ran;if(!d||Number.isNaN(Date.parse(d)))continue;let x=s?.cells.get(C)?.n;if(x===void 0)continue;let S=r.runs.find(E=>!l.has(E)&&E.runbook===i&&E.cell===String(x)&&Math.abs(Date.parse(E.time)-Date.parse(d))<=n*1e3);S?(l.add(S),S.matched={file:e,step:h},c.push({step:h,ran:d})):u.push({step:h,ran:d})}return{file:e,runbook:i,confirmed:c,missing:u}}var mr=r=>r.replace("T"," ").replace(/Z$/," UTC");function Qc(r,e,t){let n=r.runs,s=n.filter(d=>d.exit!==void 0&&d.exit!==0).length,i=new Set(n.map(d=>d.who)),o=n.length?`${mr(n[0].time)} \u2013 ${mr(n[n.length-1].time)}`:"no runs",B=new Map;for(let d of n){let x=`${d.runbook} v${d.version}`,S=B.get(x)??{version:d.version,signer:d.signer,runs:0,failed:0};S.runs++,d.exit!==void 0&&d.exit!==0&&S.failed++,B.set(x,S)}let a=d=>`<td>${re(d)}</td>`,c=d=>d.exit===void 0?'<span class="badge none">no end logged</span>':`<span class="badge ${d.exit===0?"ok":"fail"}">exit ${d.exit}</span>`,u=n.map(d=>`<tr>${a(mr(d.time))}${a(d.who)}${a(`${d.account} from ${d.client}`)}${a(`${d.runbook} v${d.version}${wh(d)}`)}${a(`${d.cell}${d.step?`.${d.step}`:""}`)}${a(Object.entries(d.params).map(([x,S])=>`${x}=${S}`).join(" "))}<td>${c(d)}</td>${a(d.durationSeconds===void 0?"":`${d.durationSeconds} s`)}${a(d.matched?`${d.matched.file}, step ${d.matched.step}`:"")}</tr>
|
|
391
|
+
`).join(""),l=r.findings.map(d=>`<tr>${a(mr(d.time))}${a(d.kind)}${a(d.who)}${a(`${d.account} from ${d.client}`)}${a(d.detail)}</tr>
|
|
392
|
+
`).join(""),C=r.probes.map(d=>`<tr>${a(mr(d.time))}${a(d.who)}${a(d.target)}${a(d.address)}<td><span class="badge ${d.ok?"ok":"fail"}">${d.ok?"up":"failed"}</span></td>${a(d.notAfter?`${mr(d.notAfter)}${d.daysLeft===void 0?"":` (${d.daysLeft} days)`}`:"")}${a(d.certSha256?`sha256 ${d.certSha256}`:"")}${a(d.run?`${d.run.runbook} v${d.run.version}, block ${d.run.cell}`:"unsigned or by hand")}${a(d.detail)}</tr>
|
|
393
|
+
`).join(""),f=[...B.entries()].map(([d,x])=>`<tr>${a(d)}${a(x.signer)}${a(String(x.runs))}${a(String(x.failed))}</tr>
|
|
394
|
+
`).join(""),h=e.map(d=>`<h3>${re(d.file)}${d.runbook?` (${re(d.runbook)})`:""}</h3>
|
|
395
|
+
<p>${d.confirmed.length} recorded run${d.confirmed.length===1?"":"s"} of signed blocks confirmed by the log`+(d.missing.length?`; <strong>not in the log</strong>: ${d.missing.map(x=>`step ${x.step} at ${re(x.ran)}`).join(", ")} (ran elsewhere, unsigned, or the log is incomplete)`:"")+`.</p>
|
|
377
396
|
`).join("");return`<!DOCTYPE html>
|
|
378
397
|
<html lang="en">
|
|
379
398
|
<head>
|
|
@@ -382,32 +401,32 @@ ${se(l.client)}`;for(let l of t){let f=u(l);switch(l.event){case"session":c++,i.
|
|
|
382
401
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
383
402
|
<meta name="generator" content="md-runbook audit">
|
|
384
403
|
<title>Gate audit</title>
|
|
385
|
-
<style>${
|
|
404
|
+
<style>${fB}@page{@bottom-right{content:"Page " counter(page) " of " counter(pages);font:10px sans-serif;color:#656d76}}</style>
|
|
386
405
|
</head>
|
|
387
406
|
<body>
|
|
388
407
|
<header>
|
|
389
408
|
<h1 class="title">Gate audit</h1>
|
|
390
|
-
<p class="meta">Generated ${
|
|
409
|
+
<p class="meta">Generated ${re(Fe(t.generatedAt))} from ${re(t.sources.join(", "))} \xB7 ${r.sessions} session${r.sessions===1?"":"s"} \xB7 ${n.length} run${n.length===1?"":"s"} by ${i.size} ${i.size===1?"key":"keys"} \xB7 ${s} failed \xB7 ${r.findings.length} finding${r.findings.length===1?"":"s"}</p>
|
|
391
410
|
</header>
|
|
392
411
|
<section class="record">
|
|
393
|
-
<dl class="facts"><div><dt>Period</dt><dd>${
|
|
412
|
+
<dl class="facts"><div><dt>Period</dt><dd>${re(o)}</dd></div><div><dt>Runs</dt><dd>${n.length}${s?` \xB7 ${s} failed`:""}</dd></div><div><dt>Findings</dt><dd>${r.findings.length}</dd></div>${r.skipped?`<div><dt>Other log lines</dt><dd>${r.skipped} skipped</dd></div>`:""}</dl>
|
|
394
413
|
</section>
|
|
395
414
|
<h2>Runbooks</h2>
|
|
396
415
|
<table class="timeline"><thead><tr><th>Runbook</th><th>Signer (as the gate accepted)</th><th>Runs</th><th>Failed</th></tr></thead><tbody>
|
|
397
|
-
${
|
|
416
|
+
${f}</tbody></table>
|
|
398
417
|
<h2>Runs</h2>
|
|
399
418
|
<table class="timeline"><thead><tr><th>Time</th><th>Who (key)</th><th>Account, client</th><th>Runbook</th><th>Block</th><th>Parameters</th><th>Result</th><th>Duration</th><th>In run record</th></tr></thead><tbody>
|
|
400
419
|
${u}</tbody></table>
|
|
401
420
|
<h2>Findings</h2>
|
|
402
421
|
${l?`<table class="timeline"><thead><tr><th>Time</th><th>What</th><th>Who (key)</th><th>Account, client</th><th>Detail</th></tr></thead><tbody>
|
|
403
422
|
${l}</tbody></table>`:"<p>None: no refusals, no unsigned code, no stopped runs.</p>"}
|
|
404
|
-
${
|
|
423
|
+
${C?`<h2>Endpoint checks</h2>
|
|
405
424
|
<table class="timeline"><thead><tr><th>Time</th><th>Who (key)</th><th>Endpoint</th><th>Address</th><th>Result</th><th>Certificate expires</th><th>Certificate</th><th>Signed run</th><th>Detail</th></tr></thead><tbody>
|
|
406
|
-
${
|
|
425
|
+
${C}</tbody></table>
|
|
407
426
|
`:""}${e.length?`<h2>Run records</h2>
|
|
408
|
-
${
|
|
427
|
+
${h}`:""}</body>
|
|
409
428
|
</html>
|
|
410
|
-
`}var
|
|
429
|
+
`}function wh(r){let e=r.calledBy;return e?` \xB7 called by ${e.runbook?`${e.runbook} v${e.version}`:`sha256 ${e.hash.slice(0,12)}\u2026`} (call ${e.call})`:""}var qc=`Usage: md-runbook audit <gate log>... [options]
|
|
411
430
|
|
|
412
431
|
Reads md-runbook-gate's log (its log file, or syslog: journalctl -t md-runbook-gate -o cat, or
|
|
413
432
|
/var/log/syslog lines with the tag) and reports every run of a signed runbook: when, the key
|
|
@@ -428,13 +447,13 @@ that checked it). "-" reads standard input.
|
|
|
428
447
|
--browser PATH Browser for a .pdf (default: CHROME_PATH, else one found on this machine)
|
|
429
448
|
|
|
430
449
|
Exit code 0: nothing to flag; 1: findings, or recorded runs the log doesn't show; 2: usage.
|
|
431
|
-
`,
|
|
432
|
-
`)};function
|
|
450
|
+
`,ln=class extends Error{},kh=r=>{process.stdout.write(r+`
|
|
451
|
+
`)};function Wc(r,e){let t=new Date(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e);if(Number.isNaN(t.getTime()))throw new ln(`${r} expects a date or time, got "${e}"`);return t}function xh(r){let e=[...r],t={logs:[],records:[],out:"gate-audit.html"},n=s=>{let i=e.shift();if(i===void 0||i.startsWith("--"))throw new ln(`${s} needs a value`);return i};for(;e.length>0;){let s=e.shift();switch(s){case"--record":t.records.push(n(s));break;case"--since":t.since=Wc(s,n(s));break;case"--until":t.until=Wc(s,n(s));break;case"--runbook":t.runbook=n(s);break;case"--who":t.who=n(s);break;case"--out":t.out=n(s);break;case"--browser":t.browser=n(s);break;default:if(s.startsWith("--"))throw new ln(`unknown option ${s}`);t.logs.push(s)}}if(t.logs.length===0)throw new ln("missing the gate log (a file, or - for standard input)");if(!/\.(html?|pdf|json)$/i.test(t.out))throw new ln("--out must end in .html, .pdf or .json");return t}async function Vc(r,e=kh,t=()=>Lt.readFileSync(0,"utf8")){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(qc),0;let n;try{n=xh(r)}catch(l){if(!(l instanceof ln))throw l;return process.stderr.write(`md-runbook: ${l.message}
|
|
433
452
|
|
|
434
|
-
${
|
|
435
|
-
`),2;let s=0,
|
|
436
|
-
`,"utf8")}else{let l=
|
|
437
|
-
`),2;await
|
|
453
|
+
${qc}`),2}for(let l of[...n.logs.filter(C=>C!=="-"),...n.records])if(!Lt.existsSync(l))return process.stderr.write(`md-runbook: no such file: ${l}
|
|
454
|
+
`),2;let s=0,i=n.logs.flatMap(l=>{let C=jc(l==="-"?t():Lt.readFileSync(l,"utf8"));return s+=C.skipped,C.events}),o=zc(Kc(i,s),n),B=n.records.map(l=>Yc(o,Gn.basename(l),Lt.readFileSync(l,"utf8")));if(Lt.mkdirSync(Gn.dirname(Gn.resolve(n.out)),{recursive:!0}),/\.json$/i.test(n.out)){let l=o.probes.map(({run:C,...f})=>({...f,...C?{run:{time:C.time,runbook:C.runbook,version:C.version,cell:C.cell}}:{}}));Lt.writeFileSync(n.out,JSON.stringify({format:"md-runbook gate audit v1",sources:n.logs,...o,probes:l,records:B},null,2)+`
|
|
455
|
+
`,"utf8")}else{let l=Qc(o,B,{generatedAt:new Date,sources:n.logs.map(C=>C==="-"?"standard input":Gn.basename(C))});if(/\.pdf$/i.test(n.out)){let C=pr(n.browser??process.env.CHROME_PATH);if(!C)return process.stderr.write(`md-runbook: a .pdf needs Chrome, Edge or Chromium; none was found (use --browser PATH or CHROME_PATH), or write .html
|
|
456
|
+
`),2;await gr(l,n.out,C)}else Lt.writeFileSync(n.out,l,"utf8")}let a=o.runs.filter(l=>l.exit!==void 0&&l.exit!==0).length,c=B.reduce((l,C)=>l+C.missing.length,0);e(`${o.runs.length} run${o.runs.length===1?"":"s"} in ${o.sessions} session${o.sessions===1?"":"s"}, ${a} failed, ${o.findings.length} finding${o.findings.length===1?"":"s"}`);for(let l of o.findings)e(` ${l.time} ${l.kind}: ${l.who} (${l.account} from ${l.client}): ${l.detail}`);if(o.probes.length){let l=o.probes.filter(C=>!C.ok);e(`${o.probes.length} endpoint check${o.probes.length===1?"":"s"} (md-runbook-probe), ${l.length} failed`);for(let C of l)e(` ${C.time} ${C.target}: ${C.detail}`)}for(let l of B)e(` ${l.file}: ${l.confirmed.length} recorded run${l.confirmed.length===1?"":"s"} confirmed by the log${l.missing.length?`, ${l.missing.length} not in it (steps ${l.missing.map(C=>C.step).join(", ")})`:""}`);let u=o.findings.length>0||c>0;return e(`${u?"\u2717":"\u2713"} ${n.out}`),u?1:0}var Ni=`Usage: md-runbook run <file.md> [options]
|
|
438
457
|
md-runbook lint <file.md>... [--strict]
|
|
439
458
|
md-runbook estimate <file.md>... (how long each section takes, by estimate=)
|
|
440
459
|
md-runbook sign <file.md> --key KEY [options] (see md-runbook sign --help)
|
|
@@ -444,7 +463,8 @@ ${Ul}`),2}for(let l of[...n.logs.filter(f=>f!=="-"),...n.records])if(!Bt.existsS
|
|
|
444
463
|
md-runbook audit <gate log>... [options] (see md-runbook audit --help)
|
|
445
464
|
|
|
446
465
|
Runs the bash, pwsh/powershell and cmd blocks of a Markdown runbook in order and writes their
|
|
447
|
-
output into the file, as the VS Code extension does. Stops at the first failed step.
|
|
466
|
+
output into the file, as the VS Code extension does. Stops at the first failed step. A runbook
|
|
467
|
+
block runs another runbook as one step: as a copy, with the parameters it passes.
|
|
448
468
|
|
|
449
469
|
Options:
|
|
450
470
|
--check Run, but don't write the outputs into the file
|
|
@@ -466,6 +486,22 @@ Options:
|
|
|
466
486
|
--section TEXT Run only the steps under headings that start with TEXT, e.g. "3." or
|
|
467
487
|
"Rollback" (repeatable; with --from/--to, both must hold)
|
|
468
488
|
--keep-going Carry on after a failed step
|
|
489
|
+
--teardown Also run the teardown steps (teardown option) after a run that passed;
|
|
490
|
+
without it they are listed, not run (you may go on to the next runbook)
|
|
491
|
+
--teardown=always Run the teardown steps after a failure too (CI that must clean up)
|
|
492
|
+
--setup With --from/--to/--section: also run the setup steps (setup option), and
|
|
493
|
+
the ready check first, so a resumed run brings back what is down
|
|
494
|
+
--setup-always Run the setup steps even when the ready check (ready option) says up
|
|
495
|
+
--no-setup Run neither the setup steps nor the ready check
|
|
496
|
+
--copy-folder DIR Where runbook calls (\`\`\`runbook blocks) write the copies of the runbooks
|
|
497
|
+
they run, relative to each one (default: next to it)
|
|
498
|
+
--allowed-signers FILE
|
|
499
|
+
Run only as signed, as a server with md-runbook-gate would: the
|
|
500
|
+
runbook's signature is good by a key in FILE, nothing changed since
|
|
501
|
+
signing, parameters match their patterns, and the runbooks its calls
|
|
502
|
+
run are signed and in its repository; else nothing runs (exit 2)
|
|
503
|
+
--fresh-copy A runbook call that failed before starts a new copy, instead of
|
|
504
|
+
continuing the one it ran (keeping the steps done there)
|
|
469
505
|
--session Run all blocks of a shell in one process (like session mode)
|
|
470
506
|
--isolated One process per block, even with "mode: session" in the front matter
|
|
471
507
|
--timeout SECONDS Default timeout per block (the front matter and timeout= win)
|
|
@@ -485,32 +521,33 @@ exits with 1 when it finds an error (with --strict: also a warning).
|
|
|
485
521
|
estimate adds up the blocks' estimate= options (e.g. estimate=2m30s): one line per # and ##
|
|
486
522
|
section with its time and the blocks without an estimate, then the runbook's total. A run
|
|
487
523
|
prints a step's estimate on its "\u25B6 Step N" line, warns when the step took more than twice it,
|
|
488
|
-
and in a terminal shows after each step how far the run is and about how long is left.
|
|
524
|
+
and in a terminal shows after each step how far the run is and about how long is left. With
|
|
525
|
+
setup or teardown steps, a "Parts:" line says how long each part takes.
|
|
489
526
|
|
|
490
527
|
\${secret:NAME} values come from the environment variable NAME and are redacted from output.
|
|
491
528
|
On GitHub Actions, a summary table is added to the job summary.
|
|
492
|
-
`,
|
|
529
|
+
`,ot=class extends Error{};function vh(r,e){try{return Ze.readFileSync(xt.resolve(xt.dirname(xt.resolve(r)),e),"utf8")}catch{return}}function Li(r,e){Ze.mkdirSync(xt.dirname(xt.resolve(r)),{recursive:!0}),Ze.writeFileSync(r,e,"utf8")}function Zc(r){let e=[...r];if(e.length===0||e[0]==="-h"||e[0]==="--help")return"help";if(e[0]==="--version")return"version";if(e[0]!=="run")throw new ot(`unknown command "${e[0]}" (expected run, lint, estimate, sign, verify, qr, link or audit)`);e.shift();let t={file:"",write:!0,params:{},inputs:{},yes:!1,keepGoing:!1,shell:{}},n,s,i,o,B=!1,a=u=>{let l=e.shift();if(l===void 0||l.startsWith("--"))throw new ot(`${u} needs a value`);return l},c=(u,l)=>{let C=a(u),f=C.indexOf("=");if(f<=0)throw new ot(`${u} expects NAME=VALUE, got "${C}"`);l[C.slice(0,f)]=C.slice(f+1)};for(;e.length>0;){let u=e.shift();switch(u){case"--check":t.write=!1;break;case"--out":t.out=a(u);break;case"--report":t.report=a(u);break;case"--pdf":n=a(u);break;case"--browser":s=a(u);break;case"--notify":i=a(u);break;case"--notify-on":o=a(u);break;case"--junit":t.junit=a(u);break;case"--json":t.json=a(u);break;case"--transcript":t.transcript=a(u);break;case"--param":c(u,t.params);break;case"--input":c(u,t.inputs);break;case"--yes":t.yes=!0;break;case"--keep-going":t.keepGoing=!0;break;case"--teardown":t.teardown="success";break;case"--teardown=always":t.teardown="always";break;case"--setup":t.addSetup=!0;break;case"--setup-always":case"--no-setup":{let l=u==="--no-setup"?"never":"always";if(t.setup&&t.setup!==l)throw new ot("--setup-always and --no-setup exclude each other");t.setup=l;break}case"--from":case"--to":{let l=a(u);if(!/^[1-9]\d*$/.test(l))throw new ot(`${u} expects a step number (1, 2, \u2026), got "${l}"`);t[u==="--from"?"from":"to"]=Number(l);break}case"--section":{let l=a(u);if(l.trim()==="")throw new ot("--section needs the start of a heading");(t.sections??=[]).push(l);break}case"--session":t.session=!0;break;case"--isolated":t.session=!1;break;case"--timeout":{let l=Number(a(u));if(!Number.isFinite(l)||l<0)throw new ot("--timeout expects seconds (0 = none)");t.timeoutSeconds=l;break}case"--bash":t.shell.bashPath=a(u);break;case"--pwsh":t.shell.pwshPath=a(u);break;case"--quiet":B=!0;break;case"--copy-folder":t.copyFolder=a(u);break;case"--fresh-copy":t.freshCopy=!0;break;case"--allowed-signers":t.allowedSigners=a(u);break;default:if(u.startsWith("-"))throw new ot(`unknown option ${u}`);if(t.file)throw new ot(`only one runbook per run (got "${t.file}" and "${u}")`);t.file=u}}if(!t.file)throw new ot("missing the runbook file");if(t.from!==void 0&&t.to!==void 0&&t.from>t.to)throw new ot(`--from ${t.from} is after --to ${t.to}`);return{options:t,...n?{pdf:n}:{},...s?{browser:s}:{},...i?{notify:i}:{},...o?{notifyOn:o}:{},quiet:B}}function Xc(r,e=t=>{process.stdout.write(t+`
|
|
493
530
|
`)}){let t=r.includes("--strict"),n=r.filter(a=>a!=="--strict"),s=n.find(a=>a.startsWith("-"));if(s||n.length===0)return process.stderr.write(`md-runbook: ${s?`unknown option ${s}`:"missing the runbook file(s)"}
|
|
494
531
|
|
|
495
|
-
${
|
|
532
|
+
${Ni}`),2;let i=process.env.GITHUB_ACTIONS==="true",o=!1,B=0;for(let a of n){if(!Ze.existsSync(a)){e(`${a}: error: no such file`),o=!0;continue}for(let c of Gu(Ze.readFileSync(a,"utf8"),{readRunbook:vB(a),matchRunbooks:u=>SB(a,u)}))B++,e(Hu(a,c)),i&&e(`::${c.severity} file=${a},line=${c.line+1}::${c.message.replace(/\r?\n/g," ")}`),(c.severity==="error"||t)&&(o=!0)}return e(`${o?"\u2717":"\u2713"} ${n.length} runbook${n.length===1?"":"s"} checked, ${B} problem${B===1?"":"s"}`),o?1:0}function ef(r,e=t=>{process.stdout.write(t+`
|
|
496
533
|
`)}){let t=r.find(s=>s.startsWith("-"));if(t||r.length===0)return process.stderr.write(`md-runbook: ${t?`unknown option ${t}`:"missing the runbook file(s)"}
|
|
497
534
|
|
|
498
|
-
${
|
|
535
|
+
${Ni}`),2;let n=!1;return r.forEach((s,i)=>{if(i>0&&e(""),!Ze.existsSync(s)){e(`${s}: error: no such file`),n=!0;return}let o=ui(Ze.readFileSync(s,"utf8"),void 0,(C,f)=>cs(s,C,f)),B=(C,f,h)=>f===0?"\u2013":`${h===f?"?":it(C)}${h>0?` (${li(h)})`:""}`,a=o.sections.map(C=>[C.level===0?"(before the first heading)":`${"#".repeat(C.level)} ${C.heading}`,B(C.seconds,C.blocks,C.unestimated)]),c=Math.min(60,Math.max(0,...a.map(([C])=>C.length)));e(s);for(let[C,f]of a)e(` ${C.length>c?C.slice(0,c-1)+"\u2026":C.padEnd(c)} ${f}`);e(` Total: ${B(o.totalSeconds,o.blocks,o.unestimated)} for ${o.blocks} block${o.blocks===1?"":"s"}`);let{setup:u,teardown:l}=o.parts;if(u.blocks>0||l.blocks>0){let C={seconds:o.totalSeconds-u.seconds-l.seconds,blocks:o.blocks-u.blocks-l.blocks,unestimated:o.unestimated-u.unestimated-l.unestimated};e(` Parts: ${[...u.blocks>0?[`setup ${B(u.seconds,u.blocks,u.unestimated)}${o.guarded?" (skipped when already up)":""}`]:[],`runbook ${B(C.seconds,C.blocks,C.unestimated)}`,...l.blocks>0?[`teardown ${B(l.seconds,l.blocks,l.unestimated)} (offered)`]:[]].join(" \xB7 ")}`)}}),n?1:0}async function tf(r){if(r[0]==="lint")return Xc(r.slice(1));if(r[0]==="estimate")return ef(r.slice(1));if(r[0]==="sign")return Ic(r.slice(1));if(r[0]==="verify")return $c(r.slice(1));if(r[0]==="qr")return PB(r.slice(1));if(r[0]==="link")return PB(r.slice(1),void 0,!0);if(r[0]==="audit")return Vc(r.slice(1));let e;try{e=Zc(r)}catch(D){if(!(D instanceof ot))throw D;return process.stderr.write(`md-runbook: ${D.message}
|
|
499
536
|
|
|
500
|
-
${
|
|
501
|
-
`),0;let{options:t,quiet:n}=e;if(!
|
|
502
|
-
`),2;let s=
|
|
503
|
-
`),2;delete process.env.MD_RUNBOOK_NOTIFY_URL;let
|
|
504
|
-
`)}},
|
|
505
|
-
`)}})}catch(
|
|
506
|
-
`),2;throw await
|
|
507
|
-
${
|
|
508
|
-
`)
|
|
509
|
-
`);let
|
|
510
|
-
`),
|
|
511
|
-
`),
|
|
512
|
-
${a.ok?"\u2713":"\u2717"} ${c}: ${a.steps.length} step${a.steps.length===1?"":"s"}, ${
|
|
513
|
-
`),a.ok&&!
|
|
537
|
+
${Ni}`),2}if(e==="help")return process.stdout.write(Ni),0;if(e==="version")return process.stdout.write(`0.22.0
|
|
538
|
+
`),0;let{options:t,quiet:n}=e;if(!Ze.existsSync(t.file))return process.stderr.write(`md-runbook: no such file: ${t.file}
|
|
539
|
+
`),2;let s=xc(e.notify??process.env.MD_RUNBOOK_NOTIFY_URL,e.notifyOn??process.env.MD_RUNBOOK_NOTIFY_ON);if(typeof s=="string")return process.stderr.write(`md-runbook: ${s}
|
|
540
|
+
`),2;delete process.env.MD_RUNBOOK_NOTIFY_URL;let i=async D=>{if(s)try{await Sc(s.url,D)}catch(y){process.stderr.write(`md-runbook: ${y instanceof Error?y.message:String(y)}
|
|
541
|
+
`)}},o=new AbortController,B=()=>o.abort();process.once("SIGINT",B),process.once("SIGTERM",B);let a;try{a=await LB({...t,env:process.env,signal:o.signal,progress:process.stdout.isTTY===!0&&!n,...s?{extraSecrets:[s.url]}:{}},{out:D=>{n||process.stdout.write(D)},log:D=>{n||process.stdout.write(D+`
|
|
542
|
+
`)}})}catch(D){if(D instanceof pt)return process.off("SIGINT",B),process.off("SIGTERM",B),process.stderr.write(`md-runbook: ${D.message}
|
|
543
|
+
`),2;throw await i(`\u2717 ${xt.basename(t.file)}: the run stopped with an error${$i(process.env)?`
|
|
544
|
+
${$i(process.env)}`:""}`),D}process.off("SIGINT",B),process.off("SIGTERM",B);let c=xt.basename(t.file),u=t.out??t.file;t.write&&Li(u,a.text);let l=()=>cB(a.text,{generatedAt:new Date,fallbackTitle:c,redact:a.redact,readCall:D=>vh(t.file,D)});if(t.report&&Li(t.report,l()),t.junit&&Li(t.junit,wc(c,a.steps,a.manual)),t.json){let D=a.setup?{setup:a.setup}:{};Li(t.json,JSON.stringify({file:c,ok:a.ok,...D,steps:a.steps,manual:a.manual,record:fi(a.text)},null,2)+`
|
|
545
|
+
`)}let C=process.env.GITHUB_STEP_SUMMARY;C&&Ze.appendFileSync(C,kc(c,a.steps,a.manual)+`
|
|
546
|
+
`);let f=!1;if(e.pdf){let D=pr(e.browser??process.env.CHROME_PATH);if(!D)process.stderr.write(`md-runbook: --pdf needs Chrome, Edge or Chromium; none was found (use --browser PATH or CHROME_PATH)
|
|
547
|
+
`),f=!0;else try{Ze.mkdirSync(xt.dirname(xt.resolve(e.pdf)),{recursive:!0}),await gr(l(),e.pdf,D)}catch(y){process.stderr.write(`md-runbook: PDF export failed: ${y instanceof Error?y.message:String(y)}
|
|
548
|
+
`),f=!0}}s&&(s.on==="always"||!a.ok)&&await i(vc(c,a,$i(process.env)));let h=D=>a.steps.filter(y=>y.status===D).length,d=[`${h("passed")} passed`,`${h("failed")} failed`];h("skipped")&&d.push(`${h("skipped")} skipped`),h("not run")&&d.push(`${h("not run")} not run`);let x=a.steps.filter(D=>D.status==="passed"||D.status==="failed"),S=x.reduce((D,y)=>D+(y.estimateSeconds??0),0),E=x.filter(D=>D.estimateSeconds===void 0).length,b=S>0?` \xB7 took ${it(x.reduce((D,y)=>D+y.durationMs,0)/1e3)}, estimated ${it(S)}`+(E>0?` (${E} step${E===1?"":"s"} without an estimate)`:""):"";return process.stdout.write(`
|
|
549
|
+
${a.ok?"\u2713":"\u2717"} ${c}: ${a.steps.length} step${a.steps.length===1?"":"s"}, ${d.join(", ")}${b}${t.write?` \xB7 outputs written to ${u}`:""}
|
|
550
|
+
`),a.ok&&!f?0:1}require.main===module&&tf(process.argv.slice(2)).then(r=>process.exitCode=r,r=>{process.stderr.write(`md-runbook: ${r instanceof Error?r.stack??r.message:String(r)}
|
|
514
551
|
`),process.exitCode=1});0&&(module.exports={estimate,lint,main,parseArgs});
|
|
515
552
|
/*! Bundled license information:
|
|
516
553
|
|