termbeam 1.17.8 → 1.18.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/package.json +1 -1
- package/public/assets/{_basePickBy-Bx4czgjK.js → _basePickBy-CVn0rIeA.js} +1 -1
- package/public/assets/{_baseUniq-B_xhLk1b.js → _baseUniq-D-ViDZI1.js} +1 -1
- package/public/assets/{arc-_Z6A8o27.js → arc-BWX7iih_.js} +1 -1
- package/public/assets/{architectureDiagram-2XIMDMQ5-DDtL0DSL.js → architectureDiagram-2XIMDMQ5-Dr3bqfT2.js} +1 -1
- package/public/assets/{blockDiagram-WCTKOSBZ-DYgWhdwH.js → blockDiagram-WCTKOSBZ-RZQh_7bp.js} +1 -1
- package/public/assets/{c4Diagram-IC4MRINW-DlbE0l99.js → c4Diagram-IC4MRINW-BM1jg1mo.js} +1 -1
- package/public/assets/channel-N7LACYfb.js +1 -0
- package/public/assets/{chunk-4BX2VUAB-BbtQtJab.js → chunk-4BX2VUAB-Cz0Sexay.js} +1 -1
- package/public/assets/{chunk-55IACEB6-Dk_FjBN6.js → chunk-55IACEB6-DhjD4VKO.js} +1 -1
- package/public/assets/{chunk-FMBD7UC4-BSOODOC9.js → chunk-FMBD7UC4-H_1l13Rz.js} +1 -1
- package/public/assets/{chunk-JSJVCQXG-B71Oj-xI.js → chunk-JSJVCQXG-D_GdzPQn.js} +1 -1
- package/public/assets/{chunk-KX2RTZJC-Bv_BWOZR.js → chunk-KX2RTZJC-BU-NTTwY.js} +1 -1
- package/public/assets/{chunk-NQ4KR5QH-NrpJgmB3.js → chunk-NQ4KR5QH-_X3IQmYu.js} +1 -1
- package/public/assets/{chunk-QZHKN3VN-BmrKPCfl.js → chunk-QZHKN3VN-CrSItx1v.js} +1 -1
- package/public/assets/{chunk-WL4C6EOR-CpglQTvf.js → chunk-WL4C6EOR-XtpH4KKr.js} +1 -1
- package/public/assets/classDiagram-VBA2DB6C-Ct_F3N6M.js +1 -0
- package/public/assets/classDiagram-v2-RAHNMMFH-Ct_F3N6M.js +1 -0
- package/public/assets/clone-DfaqXUXL.js +1 -0
- package/public/assets/{cose-bilkent-S5V4N54A-DYL0lt4P.js → cose-bilkent-S5V4N54A-BNYNzK1p.js} +1 -1
- package/public/assets/{dagre-KLK3FWXG-BNyGQfuq.js → dagre-KLK3FWXG-CvP5MaIU.js} +1 -1
- package/public/assets/{diagram-E7M64L7V-BueAxddl.js → diagram-E7M64L7V-C1ypW2kT.js} +1 -1
- package/public/assets/{diagram-IFDJBPK2-Dr-u91gt.js → diagram-IFDJBPK2-CH5mcu6V.js} +1 -1
- package/public/assets/{diagram-P4PSJMXO-C1T2kE4V.js → diagram-P4PSJMXO-D7EqFseu.js} +1 -1
- package/public/assets/{erDiagram-INFDFZHY-CO2EjQ8J.js → erDiagram-INFDFZHY-Dc_91GQC.js} +1 -1
- package/public/assets/{flowDiagram-PKNHOUZH-T00X36Vw.js → flowDiagram-PKNHOUZH-wUw5Mjvb.js} +1 -1
- package/public/assets/{ganttDiagram-A5KZAMGK-DgBggnkU.js → ganttDiagram-A5KZAMGK-C55hiPqb.js} +1 -1
- package/public/assets/{gitGraphDiagram-K3NZZRJ6-BSWTPOpC.js → gitGraphDiagram-K3NZZRJ6-D3HBxR11.js} +1 -1
- package/public/assets/{graph-BT-QdyLg.js → graph-mq5DkKwp.js} +1 -1
- package/public/assets/{index-CZRetRoe.js → index-BxVq7AYs.js} +114 -114
- package/public/assets/{index-XvAS6GsK.css → index-Cpm34cTy.css} +1 -1
- package/public/assets/{infoDiagram-LFFYTUFH-Dj6pwKgk.js → infoDiagram-LFFYTUFH-Cisyfr_w.js} +1 -1
- package/public/assets/{ishikawaDiagram-PHBUUO56-Db8O4ufB.js → ishikawaDiagram-PHBUUO56-BjaKmPoV.js} +1 -1
- package/public/assets/{journeyDiagram-4ABVD52K-BpZ_Yrqs.js → journeyDiagram-4ABVD52K-BNP3C6Ph.js} +1 -1
- package/public/assets/{kanban-definition-K7BYSVSG-D3zRUDJP.js → kanban-definition-K7BYSVSG-D9TVNfL2.js} +1 -1
- package/public/assets/{layout-BI7uDMCL.js → layout-DIfi_3Cg.js} +1 -1
- package/public/assets/{linear-DgP566HT.js → linear-CNFortHj.js} +1 -1
- package/public/assets/{mindmap-definition-YRQLILUH-BXNxkbvs.js → mindmap-definition-YRQLILUH-CfNe7W8X.js} +1 -1
- package/public/assets/{pieDiagram-SKSYHLDU-CuMBI_xo.js → pieDiagram-SKSYHLDU-C3T1FeFD.js} +1 -1
- package/public/assets/{quadrantDiagram-337W2JSQ-7_kXk56H.js → quadrantDiagram-337W2JSQ-Dcj0avLR.js} +1 -1
- package/public/assets/{requirementDiagram-Z7DCOOCP-Dc4encPC.js → requirementDiagram-Z7DCOOCP-D4yTZU0p.js} +1 -1
- package/public/assets/{sankeyDiagram-WA2Y5GQK-DSlUG_VS.js → sankeyDiagram-WA2Y5GQK-CpT1bDmZ.js} +1 -1
- package/public/assets/{sequenceDiagram-2WXFIKYE-DaWz5El2.js → sequenceDiagram-2WXFIKYE-CPsVjHHb.js} +1 -1
- package/public/assets/{stateDiagram-RAJIS63D-B4oQefUl.js → stateDiagram-RAJIS63D-CbB0QqSa.js} +1 -1
- package/public/assets/stateDiagram-v2-FVOUBMTO-CQnYvVz1.js +1 -0
- package/public/assets/{timeline-definition-YZTLITO2-D9zlUa7w.js → timeline-definition-YZTLITO2-Bi12ioU0.js} +1 -1
- package/public/assets/{treemap-KZPCXAKY-RGFpoXIT.js → treemap-KZPCXAKY-Ct-pligZ.js} +1 -1
- package/public/assets/{vennDiagram-LZ73GAT5-D5gYnx59.js → vennDiagram-LZ73GAT5-Ci8AKqD1.js} +1 -1
- package/public/assets/{xychartDiagram-JWTSCODW-C7kxjkz6.js → xychartDiagram-JWTSCODW-BsOGuDAL.js} +1 -1
- package/public/index.html +2 -2
- package/public/sw.js +1 -1
- package/src/server/index.js +85 -13
- package/src/server/routes.js +77 -0
- package/src/tunnel/index.js +202 -55
- package/public/assets/channel-Cw6U4HD8.js +0 -1
- package/public/assets/classDiagram-VBA2DB6C-B8Ph5aUJ.js +0 -1
- package/public/assets/classDiagram-v2-RAHNMMFH-B8Ph5aUJ.js +0 -1
- package/public/assets/clone-tNYKz33q.js +0 -1
- package/public/assets/stateDiagram-v2-FVOUBMTO-C4ooUxXR.js +0 -1
package/public/assets/{xychartDiagram-JWTSCODW-C7kxjkz6.js → xychartDiagram-JWTSCODW-BsOGuDAL.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as gi,g as xi,q as Xt,p as di,a as fi,b as pi,_ as a,l as Nt,I as mi,e as yi,z as bi,G as St,i as Ai,E as Yt,F as wi,K as Ci,aH as Si,R as Wt}from"./index-
|
|
1
|
+
import{s as gi,g as xi,q as Xt,p as di,a as fi,b as pi,_ as a,l as Nt,I as mi,e as yi,z as bi,G as St,i as Ai,E as Yt,F as wi,K as Ci,aH as Si,R as Wt}from"./index-BxVq7AYs.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as zt}from"./linear-CNFortHj.js";import"./defaultLocale-DX6XiGOO.js";function Ri(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function yt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,g,m=!1,p=0,k=0,v=.5;delete e.unknown;function C(){var b=t().length,E=n<s,D=E?n:s,P=E?s:n;o=(P-D)/Math.max(1,b-p+k*2),m&&(o=Math.floor(o)),D+=(P-D-o*(b-p))*v,g=o*(1-p),m&&(D=Math.round(D),g=Math.round(g));var I=Ri(b).map(function(y){return D+o*y});return i(E?I.reverse():I)}return e.domain=function(b){return arguments.length?(t(b),C()):t()},e.range=function(b){return arguments.length?([s,n]=b,s=+s,n=+n,C()):[s,n]},e.rangeRound=function(b){return[s,n]=b,s=+s,n=+n,m=!0,C()},e.bandwidth=function(){return g},e.step=function(){return o},e.round=function(b){return arguments.length?(m=!!b,C()):m},e.padding=function(b){return arguments.length?(p=Math.min(1,k=+b),C()):p},e.paddingInner=function(b){return arguments.length?(p=Math.min(1,b),C()):p},e.paddingOuter=function(b){return arguments.length?(k=+b,C()):k},e.align=function(b){return arguments.length?(v=Math.max(0,Math.min(1,b)),C()):v},e.copy=function(){return yt(t(),[s,n]).round(m).paddingInner(p).paddingOuter(k).align(v)},_i.apply(C(),arguments)}var bt=(function(){var e=a(function(F,h,u,x){for(u=u||{},x=F.length;x--;u[F[x]]=h);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],g=[1,7],m=[1,5,10,12,14,16,18,19,21,23,34,35,36],p=[1,25],k=[1,26],v=[1,28],C=[1,29],b=[1,30],E=[1,31],D=[1,32],P=[1,33],I=[1,34],y=[1,35],_=[1,36],c=[1,37],W=[1,43],z=[1,42],U=[1,47],X=[1,50],l=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],R=[1,64],$={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(h,u,x,d,w,r,at){var f=r.length-1;switch(w){case 5:d.setOrientation(r[f]);break;case 9:d.setDiagramTitle(r[f].text.trim());break;case 12:d.setLineData({text:"",type:"text"},r[f]);break;case 13:d.setLineData(r[f-1],r[f]);break;case 14:d.setBarData({text:"",type:"text"},r[f]);break;case 15:d.setBarData(r[f-1],r[f]);break;case 16:this.$=r[f].trim(),d.setAccTitle(this.$);break;case 17:case 18:this.$=r[f].trim(),d.setAccDescription(this.$);break;case 19:this.$=r[f-1];break;case 20:this.$=[Number(r[f-2]),...r[f]];break;case 21:this.$=[Number(r[f])];break;case 22:d.setXAxisTitle(r[f]);break;case 23:d.setXAxisTitle(r[f-1]);break;case 24:d.setXAxisTitle({type:"text",text:""});break;case 25:d.setXAxisBand(r[f]);break;case 26:d.setXAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 27:this.$=r[f-1];break;case 28:this.$=[r[f-2],...r[f]];break;case 29:this.$=[r[f]];break;case 30:d.setYAxisTitle(r[f]);break;case 31:d.setYAxisTitle(r[f-1]);break;case 32:d.setYAxisTitle({type:"text",text:""});break;case 33:d.setYAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 37:this.$={text:r[f],type:"text"};break;case 38:this.$={text:r[f],type:"text"};break;case 39:this.$={text:r[f],type:"markdown"};break;case 40:this.$=r[f];break;case 41:this.$=r[f-1]+""+r[f];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:o,36:g}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:o,36:g}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:o,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(m,[2,34]),e(m,[2,35]),e(m,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:o,36:g}),{1:[2,3]},e(m,[2,5]),e(t,[2,7],{4:22,34:n,35:o,36:g}),{11:23,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},{11:39,13:38,24:W,27:z,29:40,30:41,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},{11:45,15:44,27:U,33:46,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},{11:49,17:48,24:X,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},{11:52,17:51,24:X,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},{20:[1,53]},{22:[1,54]},e(l,[2,18]),{1:[2,2]},e(l,[2,8]),e(l,[2,9]),e(L,[2,37],{40:55,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c}),e(L,[2,38]),e(L,[2,39]),e(S,[2,40]),e(S,[2,42]),e(S,[2,43]),e(S,[2,44]),e(S,[2,45]),e(S,[2,46]),e(S,[2,47]),e(S,[2,48]),e(S,[2,49]),e(S,[2,50]),e(S,[2,51]),e(l,[2,10]),e(l,[2,22],{30:41,29:56,24:W,27:z}),e(l,[2,24]),e(l,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},e(l,[2,11]),e(l,[2,30],{33:60,27:U}),e(l,[2,32]),{31:[1,61]},e(l,[2,12]),{17:62,24:X},{25:63,27:R},e(l,[2,14]),{17:65,24:X},e(l,[2,16]),e(l,[2,17]),e(S,[2,41]),e(l,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(l,[2,31]),{27:[1,69]},e(l,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(l,[2,15]),e(l,[2,26]),e(l,[2,27]),{11:59,32:72,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},e(l,[2,33]),e(l,[2,19]),{25:73,27:R},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(h,u){if(u.recoverable)this.trace(h);else{var x=new Error(h);throw x.hash=u,x}},"parseError"),parse:a(function(h){var u=this,x=[0],d=[],w=[null],r=[],at=this.table,f="",lt=0,It=0,hi=2,Mt=1,li=r.slice.call(arguments,1),T=Object.create(this.lexer),Y={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(Y.yy[dt]=this.yy[dt]);T.setInput(h,Y.yy),Y.yy.lexer=T,Y.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var ft=T.yylloc;r.push(ft);var ci=T.options&&T.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ui(V){x.length=x.length-2*V,w.length=w.length-V,r.length=r.length-V}a(ui,"popStack");function Vt(){var V;return V=d.pop()||T.lex()||Mt,typeof V!="number"&&(V instanceof Array&&(d=V,V=d.pop()),V=u.symbols_[V]||V),V}a(Vt,"lex");for(var M,H,B,pt,q={},ct,O,Bt,ut;;){if(H=x[x.length-1],this.defaultActions[H]?B=this.defaultActions[H]:((M===null||typeof M>"u")&&(M=Vt()),B=at[H]&&at[H][M]),typeof B>"u"||!B.length||!B[0]){var mt="";ut=[];for(ct in at[H])this.terminals_[ct]&&ct>hi&&ut.push("'"+this.terminals_[ct]+"'");T.showPosition?mt="Parse error on line "+(lt+1)+`:
|
|
2
2
|
`+T.showPosition()+`
|
|
3
3
|
Expecting `+ut.join(", ")+", got '"+(this.terminals_[M]||M)+"'":mt="Parse error on line "+(lt+1)+": Unexpected "+(M==Mt?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(mt,{text:T.match,token:this.terminals_[M]||M,line:T.yylineno,loc:ft,expected:ut})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+M);switch(B[0]){case 1:x.push(M),w.push(T.yytext),r.push(T.yylloc),x.push(B[1]),M=null,It=T.yyleng,f=T.yytext,lt=T.yylineno,ft=T.yylloc;break;case 2:if(O=this.productions_[B[1]][1],q.$=w[w.length-O],q._$={first_line:r[r.length-(O||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(O||1)].first_column,last_column:r[r.length-1].last_column},ci&&(q._$.range=[r[r.length-(O||1)].range[0],r[r.length-1].range[1]]),pt=this.performAction.apply(q,[f,It,lt,Y.yy,B[1],w,r].concat(li)),typeof pt<"u")return pt;O&&(x=x.slice(0,-1*O*2),w=w.slice(0,-1*O),r=r.slice(0,-1*O)),x.push(this.productions_[B[1]][0]),w.push(q.$),r.push(q._$),Bt=at[x[x.length-2]][x[x.length-1]],x.push(Bt);break;case 3:return!0}}return!0},"parse")},Et=(function(){var F={EOF:1,parseError:a(function(u,x){if(this.yy.parser)this.yy.parser.parseError(u,x);else throw new Error(u)},"parseError"),setInput:a(function(h,u){return this.yy=u||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:a(function(h){var u=h.length,x=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var w=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===d.length?this.yylloc.first_column:0)+d[d.length-x.length].length-x[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(h){this.unput(this.match.slice(h))},"less"),pastInput:a(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var h=this.pastInput(),u=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
|
package/public/index.html
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
const t = localStorage.getItem('termbeam-theme');
|
|
28
28
|
if (t) document.documentElement.setAttribute('data-theme', t);
|
|
29
29
|
</script>
|
|
30
|
-
<script type="module" crossorigin src="/assets/index-
|
|
31
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
30
|
+
<script type="module" crossorigin src="/assets/index-BxVq7AYs.js"></script>
|
|
31
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Cpm34cTy.css">
|
|
32
32
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
|
33
33
|
<body>
|
|
34
34
|
<div id="root"></div>
|
package/public/sw.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
try{self["workbox:core:7.3.0"]&&_()}catch{}const G=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},Q=G;class h extends Error{constructor(e,t){const n=Q(e,t);super(n),this.name=e,this.details=t}}const d={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},E=s=>[d.prefix,s,d.suffix].filter(e=>e&&e.length>0).join("-"),z=s=>{for(const e of Object.keys(d))s(e)},b={updateDetails:s=>{z(e=>{typeof s[e]=="string"&&(d[e]=s[e])})},getGoogleAnalyticsName:s=>s||E(d.googleAnalytics),getPrecacheName:s=>s||E(d.precache),getPrefix:()=>d.prefix,getRuntimeName:s=>s||E(d.runtime),getSuffix:()=>d.suffix};function N(s,e){const t=e();return s.waitUntil(t),t}try{self["workbox:precaching:7.3.0"]&&_()}catch{}const J="__WB_REVISION__";function X(s){if(!s)throw new h("add-to-cache-list-unexpected-type",{entry:s});if(typeof s=="string"){const r=new URL(s,location.href);return{cacheKey:r.href,url:r.href}}const{revision:e,url:t}=s;if(!t)throw new h("add-to-cache-list-unexpected-type",{entry:s});if(!e){const r=new URL(t,location.href);return{cacheKey:r.href,url:r.href}}const n=new URL(t,location.href),a=new URL(t,location.href);return n.searchParams.set(J,e),{cacheKey:n.href,url:a.href}}class Y{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const a=t.originalRequest.url;n?this.notUpdatedURLs.push(a):this.updatedURLs.push(a)}return n}}}class Z{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:n})=>{const a=(n==null?void 0:n.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return a?new Request(a,{headers:t.headers}):t},this._precacheController=e}}let m;function ee(){if(m===void 0){const s=new Response("");if("body"in s)try{new Response(s.body),m=!0}catch{m=!1}m=!1}return m}async function te(s,e){let t=null;if(s.url&&(t=new URL(s.url).origin),t!==self.location.origin)throw new h("cross-origin-copy-response",{origin:t});const n=s.clone(),r={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},i=ee()?n.body:await n.blob();return new Response(i,r)}const se=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function M(s,e){const t=new URL(s);for(const n of e)t.searchParams.delete(n);return t.href}async function ne(s,e,t,n){const a=M(e.url,t);if(e.url===a)return s.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await s.keys(e,r);for(const c of i){const o=M(c.url,t);if(a===o)return s.match(c,n)}}class ae{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}const B=new Set;async function re(){for(const s of B)await s()}function ie(s){return new Promise(e=>setTimeout(e,s))}try{self["workbox:strategies:7.3.0"]&&_()}catch{}function C(s){return typeof s=="string"?new Request(s):s}class ce{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new ae,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let n=C(e);if(n.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const i=await t.preloadResponse;if(i)return i}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const i of this.iterateCallbacks("requestWillFetch"))n=await i({request:n.clone(),event:t})}catch(i){if(i instanceof Error)throw new h("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let i;i=await fetch(n,n.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))i=await c({event:t,request:r,response:i});return i}catch(i){throw a&&await this.runCallbacks("fetchDidFail",{error:i,event:t,originalRequest:a.clone(),request:r.clone()}),i}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=C(e);let n;const{cacheName:a,matchOptions:r}=this._strategy,i=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},r),{cacheName:a});n=await caches.match(i,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await o({cacheName:a,matchOptions:r,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(e,t){const n=C(e);await ie(0);const a=await this.getCacheKey(n,"write");if(!t)throw new h("cache-put-with-no-response",{url:se(a.url)});const r=await this._ensureResponseSafeToCache(t);if(!r)return!1;const{cacheName:i,matchOptions:c}=this._strategy,o=await self.caches.open(i),l=this.hasCallback("cacheDidUpdate"),g=l?await ne(o,a.clone(),["__WB_REVISION__"],c):null;try{await o.put(a,l?r.clone():r)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await re(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:i,oldResponse:g,newResponse:r.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let a=e;for(const r of this.iterateCallbacks("cacheKeyWillBeUsed"))a=C(await r({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[n]=a}return this._cacheKeys[n]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const n=this._pluginStateMap.get(t);yield r=>{const i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){const e=this._extendLifetimePromises.splice(0),n=(await Promise.allSettled(e)).find(a=>a.status==="rejected");if(n)throw n.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const a of this.iterateCallbacks("cacheWillUpdate"))if(t=await a({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}}class W{constructor(e={}){this.cacheName=b.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n=typeof e.request=="string"?new Request(e.request):e.request,a="params"in e?e.params:void 0,r=new ce(this,{event:t,request:n,params:a}),i=this._getResponse(r,n,t),c=this._awaitComplete(i,r,n,t);return[i,c]}async _getResponse(e,t,n){await e.runCallbacks("handlerWillStart",{event:n,request:t});let a;try{if(a=await this._handle(t,e),!a||a.type==="error")throw new h("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(const i of e.iterateCallbacks("handlerDidError"))if(a=await i({error:r,event:n,request:t}),a)break}if(!a)throw r}for(const r of e.iterateCallbacks("handlerWillRespond"))a=await r({event:n,request:t,response:a});return a}async _awaitComplete(e,t,n,a){let r,i;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:a,request:n,response:r}),await t.doneWaiting()}catch(c){c instanceof Error&&(i=c)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:n,response:r,error:i}),t.destroy(),i)throw i}}class p extends W{constructor(e={}){e.cacheName=b.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(p.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const n=await t.cacheMatch(e);return n||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let n;const a=t.params||{};if(this._fallbackToNetwork){const r=a.integrity,i=e.integrity,c=!i||i===r;n=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?i||r:void 0})),r&&c&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,n.clone()))}else throw new h("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return n}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const n=await t.fetch(e);if(!await t.cachePut(e,n.clone()))throw new h("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[n,a]of this.plugins.entries())a!==p.copyRedirectedCacheableResponsesPlugin&&(a===p.defaultPrecacheCacheabilityPlugin&&(e=n),a.cacheWillUpdate&&t++);t===0?this.plugins.push(p.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}p.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:s}){return!s||s.status>=400?null:s}};p.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:s}){return s.redirected?await te(s):s}};class oe{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new p({cacheName:b.getPrecacheName(e),plugins:[...t,new Z({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const n of e){typeof n=="string"?t.push(n):n&&n.revision===void 0&&t.push(n.url);const{cacheKey:a,url:r}=X(n),i=typeof n!="string"&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(r)&&this._urlsToCacheKeys.get(r)!==a)throw new h("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(r),secondEntry:a});if(typeof n!="string"&&n.integrity){if(this._cacheKeysToIntegrities.has(a)&&this._cacheKeysToIntegrities.get(a)!==n.integrity)throw new h("add-to-cache-list-conflicting-integrities",{url:r});this._cacheKeysToIntegrities.set(a,n.integrity)}if(this._urlsToCacheKeys.set(r,a),this._urlsToCacheModes.set(r,i),t.length>0){const c=`Workbox is precaching URLs without revision info: ${t.join(", ")}
|
|
2
|
-
This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return N(e,async()=>{const t=new Y;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),l=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:l,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return N(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new h("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let L;const j=()=>(L||(L=new oe),L);try{self["workbox:routing:7.3.0"]&&_()}catch{}const F="GET",x=s=>s&&typeof s=="object"?s:{handle:s};class R{constructor(e,t,n=F){this.handler=x(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=x(e)}}class le extends R{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class he{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let l;try{l=c.handle({url:n,request:e,event:t,params:r})}catch(u){l=Promise.reject(u)}const g=i&&i.catchHandler;return l instanceof Promise&&(this._catchHandler||g)&&(l=l.catch(async u=>{if(g)try{return await g.handle({url:n,request:e,event:t,params:r})}catch(I){I instanceof Error&&(u=I)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),l}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=F){this._defaultHandlerMap.set(t,x(e))}setCatchHandler(e){this._catchHandler=x(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new h("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new h("unregister-route-route-not-registered")}}let w;const ue=()=>(w||(w=new he,w.addFetchListener(),w.addCacheListener()),w);function q(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new R(i,e,t)}else if(s instanceof RegExp)n=new le(s,e,t);else if(typeof s=="function")n=new R(s,e,t);else if(s instanceof R)n=s;else throw new h("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return ue().registerRoute(n),n}function de(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*fe(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=de(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class pe extends R{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of fe(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function ge(s){const e=j(),t=new pe(e,s);q(t)}const me="-precache-",we=async(s,e=me)=>{const n=(await self.caches.keys()).filter(a=>a.includes(e)&&a.includes(self.registration.scope)&&a!==s);return await Promise.all(n.map(a=>self.caches.delete(a))),n};function ye(){self.addEventListener("activate",(s=>{const e=b.getPrecacheName();s.waitUntil(we(e).then(t=>{}))}))}function _e(s){j().precache(s)}function Re(s,e){_e(s),ge(e)}class be extends W{async _handle(e,t){let n=await t.cacheMatch(e),a;if(!n)try{n=await t.fetchAndCachePut(e)}catch(r){r instanceof Error&&(a=r)}if(!n)throw new h("no-response",{url:e.url,error:a});return n}}function H(s){s.then(()=>{})}const Ce=(s,e)=>e.some(t=>s instanceof t);let A,K;function xe(){return A||(A=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ee(){return K||(K=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const V=new WeakMap,k=new WeakMap,$=new WeakMap,D=new WeakMap,v=new WeakMap;function Le(s){const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("success",r),s.removeEventListener("error",i)},r=()=>{t(f(s.result)),a()},i=()=>{n(s.error),a()};s.addEventListener("success",r),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&V.set(t,s)}).catch(()=>{}),v.set(e,s),e}function De(s){if(k.has(s))return;const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",i),s.removeEventListener("abort",i)},r=()=>{t(),a()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",r),s.addEventListener("error",i),s.addEventListener("abort",i)});k.set(s,e)}let P={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return k.get(s);if(e==="objectStoreNames")return s.objectStoreNames||$.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return f(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function Ue(s){P=s(P)}function Te(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(U(this),e,...t);return $.set(n,e.sort?e.sort():[e]),f(n)}:Ee().includes(s)?function(...e){return s.apply(U(this),e),f(V.get(this))}:function(...e){return f(s.apply(U(this),e))}}function ke(s){return typeof s=="function"?Te(s):(s instanceof IDBTransaction&&De(s),Ce(s,xe())?new Proxy(s,P):s)}function f(s){if(s instanceof IDBRequest)return Le(s);if(D.has(s))return D.get(s);const e=ke(s);return e!==s&&(D.set(s,e),v.set(e,s)),e}const U=s=>v.get(s);function Pe(s,e,{blocked:t,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(s,e),c=f(i);return n&&i.addEventListener("upgradeneeded",o=>{n(f(i.result),o.oldVersion,o.newVersion,f(i.transaction),o)}),t&&i.addEventListener("blocked",o=>t(o.oldVersion,o.newVersion,o)),c.then(o=>{r&&o.addEventListener("close",()=>r()),a&&o.addEventListener("versionchange",l=>a(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}function ve(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",n=>e(n.oldVersion,n)),f(t).then(()=>{})}const Ie=["get","getKey","getAll","getAllKeys","count"],Ne=["put","add","delete","clear"],T=new Map;function S(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(T.get(e))return T.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,a=Ne.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||Ie.includes(t)))return;const r=async function(i,...c){const o=this.transaction(i,a?"readwrite":"readonly");let l=o.store;return n&&(l=l.index(c.shift())),(await Promise.all([l[t](...c),a&&o.done]))[0]};return T.set(e,r),r}Ue(s=>({...s,get:(e,t,n)=>S(e,t)||s.get(e,t,n),has:(e,t)=>!!S(e,t)||s.has(e,t)}));try{self["workbox:expiration:7.3.0"]&&_()}catch{}const Me="workbox-expiration",y="cache-entries",O=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class Ae{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(y,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&ve(this._cacheName)}async setTimestamp(e,t){e=O(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},r=(await this.getDb()).transaction(y,"readwrite",{durability:"relaxed"});await r.store.put(n),await r.done}async getTimestamp(e){const n=await(await this.getDb()).get(y,this._getId(e));return n==null?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let a=await n.transaction(y).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp<e||t&&i>=t?r.push(a.value):i++),a=await a.continue()}const c=[];for(const o of r)await n.delete(y,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+O(e)}async getDb(){return this._db||(this._db=await Pe(Me,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class Ke{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new Ae(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const a of t)await n.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,H(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t<n:!0}else return!1}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}function Se(s){B.add(s)}class Oe{constructor(e={}){this.cachedResponseWillBeUsed=async({event:t,request:n,cacheName:a,cachedResponse:r})=>{if(!r)return null;const i=this._isResponseDateFresh(r),c=this._getCacheExpiration(a);H(c.expireEntries());const o=c.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch{}return i?r:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(n.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&Se(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===b.getRuntimeName())throw new h("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new Ke(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}Re([{"revision":"1872c500de691dce40960bb85481de07","url":"registerSW.js"},{"revision":"0f93805414c783a30b72e0ce88f2c7c4","url":"icons/icon.svg"},{"revision":"5dee5ddcd8e8533edb348118334d9756","url":"icons/icon-512.png"},{"revision":"75734e6b38a556148f51b9e10eeb01c8","url":"icons/icon-192.png"},{"revision":"0362e0eb00358646fd4c97674945adba","url":"icons/icon-180.png"},{"revision":null,"url":"assets/xychartDiagram-JWTSCODW-C7kxjkz6.js"},{"revision":null,"url":"assets/vennDiagram-LZ73GAT5-D5gYnx59.js"},{"revision":null,"url":"assets/treemap-KZPCXAKY-RGFpoXIT.js"},{"revision":null,"url":"assets/timeline-definition-YZTLITO2-D9zlUa7w.js"},{"revision":null,"url":"assets/stateDiagram-v2-FVOUBMTO-C4ooUxXR.js"},{"revision":null,"url":"assets/stateDiagram-RAJIS63D-B4oQefUl.js"},{"revision":null,"url":"assets/sequenceDiagram-2WXFIKYE-DaWz5El2.js"},{"revision":null,"url":"assets/sankeyDiagram-WA2Y5GQK-DSlUG_VS.js"},{"revision":null,"url":"assets/requirementDiagram-Z7DCOOCP-Dc4encPC.js"},{"revision":null,"url":"assets/quadrantDiagram-337W2JSQ-7_kXk56H.js"},{"revision":null,"url":"assets/pieDiagram-SKSYHLDU-CuMBI_xo.js"},{"revision":null,"url":"assets/ordinal-Cboi1Yqb.js"},{"revision":null,"url":"assets/mindmap-definition-YRQLILUH-BXNxkbvs.js"},{"revision":null,"url":"assets/linear-DgP566HT.js"},{"revision":null,"url":"assets/layout-BI7uDMCL.js"},{"revision":null,"url":"assets/katex-B1X10hvy.js"},{"revision":null,"url":"assets/kanban-definition-K7BYSVSG-D3zRUDJP.js"},{"revision":null,"url":"assets/journeyDiagram-4ABVD52K-BpZ_Yrqs.js"},{"revision":null,"url":"assets/ishikawaDiagram-PHBUUO56-Db8O4ufB.js"},{"revision":null,"url":"assets/init-Gi6I4Gst.js"},{"revision":null,"url":"assets/infoDiagram-LFFYTUFH-Dj6pwKgk.js"},{"revision":null,"url":"assets/index-XvAS6GsK.css"},{"revision":null,"url":"assets/index-CZRetRoe.js"},{"revision":null,"url":"assets/graph-BT-QdyLg.js"},{"revision":null,"url":"assets/gitGraphDiagram-K3NZZRJ6-BSWTPOpC.js"},{"revision":null,"url":"assets/ganttDiagram-A5KZAMGK-DgBggnkU.js"},{"revision":null,"url":"assets/flowDiagram-PKNHOUZH-T00X36Vw.js"},{"revision":null,"url":"assets/erDiagram-INFDFZHY-CO2EjQ8J.js"},{"revision":null,"url":"assets/diagram-P4PSJMXO-C1T2kE4V.js"},{"revision":null,"url":"assets/diagram-IFDJBPK2-Dr-u91gt.js"},{"revision":null,"url":"assets/diagram-E7M64L7V-BueAxddl.js"},{"revision":null,"url":"assets/defaultLocale-DX6XiGOO.js"},{"revision":null,"url":"assets/dagre-KLK3FWXG-BNyGQfuq.js"},{"revision":null,"url":"assets/cytoscape.esm-BQaXIfA_.js"},{"revision":null,"url":"assets/cose-bilkent-S5V4N54A-DYL0lt4P.js"},{"revision":null,"url":"assets/clone-tNYKz33q.js"},{"revision":null,"url":"assets/classDiagram-v2-RAHNMMFH-B8Ph5aUJ.js"},{"revision":null,"url":"assets/classDiagram-VBA2DB6C-B8Ph5aUJ.js"},{"revision":null,"url":"assets/chunk-WL4C6EOR-CpglQTvf.js"},{"revision":null,"url":"assets/chunk-QZHKN3VN-BmrKPCfl.js"},{"revision":null,"url":"assets/chunk-NQ4KR5QH-NrpJgmB3.js"},{"revision":null,"url":"assets/chunk-KX2RTZJC-Bv_BWOZR.js"},{"revision":null,"url":"assets/chunk-JSJVCQXG-B71Oj-xI.js"},{"revision":null,"url":"assets/chunk-FMBD7UC4-BSOODOC9.js"},{"revision":null,"url":"assets/chunk-55IACEB6-Dk_FjBN6.js"},{"revision":null,"url":"assets/chunk-4BX2VUAB-BbtQtJab.js"},{"revision":null,"url":"assets/channel-Cw6U4HD8.js"},{"revision":null,"url":"assets/c4Diagram-IC4MRINW-DlbE0l99.js"},{"revision":null,"url":"assets/blockDiagram-WCTKOSBZ-DYgWhdwH.js"},{"revision":null,"url":"assets/architectureDiagram-2XIMDMQ5-DDtL0DSL.js"},{"revision":null,"url":"assets/arc-_Z6A8o27.js"},{"revision":null,"url":"assets/_baseUniq-B_xhLk1b.js"},{"revision":null,"url":"assets/_basePickBy-Bx4czgjK.js"},{"revision":"0362e0eb00358646fd4c97674945adba","url":"icons/icon-180.png"},{"revision":"75734e6b38a556148f51b9e10eeb01c8","url":"icons/icon-192.png"},{"revision":"5dee5ddcd8e8533edb348118334d9756","url":"icons/icon-512.png"},{"revision":"b0747e8d6cde0d45e05be8e5c731729e","url":"manifest.webmanifest"}]);ye();q(({url:s})=>s.hostname==="cdn.jsdelivr.net"&&s.pathname.endsWith(".ttf"),new be({cacheName:"termbeam-fonts",plugins:[new Oe({maxEntries:5,maxAgeSeconds:365*24*60*60})]}));self.addEventListener("message",s=>{var e;((e=s.data)==null?void 0:e.type)==="CLEAR_CACHES"&&caches.keys().then(t=>{for(const n of t)n!=="workbox-precache-v2"&&caches.delete(n)})});self.addEventListener("install",()=>{self.skipWaiting()});self.addEventListener("activate",s=>{s.waitUntil(caches.delete("termbeam-navigation").then(()=>self.clients.claim()))});self.addEventListener("push",s=>{let e={title:"Command finished",body:"TermBeam"};if(s.data)try{e=s.data.json()}catch{}s.waitUntil(self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(async t=>{if(t.some(r=>r.url.includes(self.location.origin)&&r.focused))return;const a={body:e.body||"A command has completed",icon:"/icons/icon-192.png",badge:"/icons/icon-192.png",tag:"termbeam-cmd",renotify:!0,data:{url:"/"},vibrate:[200,100,200]};try{await self.navigator.setAppBadge(1)}catch{}return self.registration.showNotification(e.title||"Command finished",a)}))});self.addEventListener("notificationclick",s=>{var t;s.notification.close();try{self.navigator.clearAppBadge()}catch{}const e=((t=s.notification.data)==null?void 0:t.url)||"/";s.waitUntil(self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(n=>{for(const a of n)if(a.url.includes(self.location.origin)&&"focus"in a)return a.focus();return self.clients.openWindow(e)}))});
|
|
2
|
+
This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return N(e,async()=>{const t=new Y;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),l=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:l,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return N(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new h("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let L;const j=()=>(L||(L=new oe),L);try{self["workbox:routing:7.3.0"]&&_()}catch{}const F="GET",x=s=>s&&typeof s=="object"?s:{handle:s};class R{constructor(e,t,n=F){this.handler=x(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=x(e)}}class le extends R{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class he{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let l;try{l=c.handle({url:n,request:e,event:t,params:r})}catch(u){l=Promise.reject(u)}const g=i&&i.catchHandler;return l instanceof Promise&&(this._catchHandler||g)&&(l=l.catch(async u=>{if(g)try{return await g.handle({url:n,request:e,event:t,params:r})}catch(I){I instanceof Error&&(u=I)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),l}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=F){this._defaultHandlerMap.set(t,x(e))}setCatchHandler(e){this._catchHandler=x(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new h("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new h("unregister-route-route-not-registered")}}let w;const ue=()=>(w||(w=new he,w.addFetchListener(),w.addCacheListener()),w);function q(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new R(i,e,t)}else if(s instanceof RegExp)n=new le(s,e,t);else if(typeof s=="function")n=new R(s,e,t);else if(s instanceof R)n=s;else throw new h("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return ue().registerRoute(n),n}function de(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*fe(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=de(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class pe extends R{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of fe(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function ge(s){const e=j(),t=new pe(e,s);q(t)}const me="-precache-",we=async(s,e=me)=>{const n=(await self.caches.keys()).filter(a=>a.includes(e)&&a.includes(self.registration.scope)&&a!==s);return await Promise.all(n.map(a=>self.caches.delete(a))),n};function ye(){self.addEventListener("activate",(s=>{const e=b.getPrecacheName();s.waitUntil(we(e).then(t=>{}))}))}function _e(s){j().precache(s)}function Re(s,e){_e(s),ge(e)}class be extends W{async _handle(e,t){let n=await t.cacheMatch(e),a;if(!n)try{n=await t.fetchAndCachePut(e)}catch(r){r instanceof Error&&(a=r)}if(!n)throw new h("no-response",{url:e.url,error:a});return n}}function H(s){s.then(()=>{})}const Ce=(s,e)=>e.some(t=>s instanceof t);let A,K;function xe(){return A||(A=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ee(){return K||(K=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const V=new WeakMap,k=new WeakMap,$=new WeakMap,D=new WeakMap,v=new WeakMap;function Le(s){const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("success",r),s.removeEventListener("error",i)},r=()=>{t(f(s.result)),a()},i=()=>{n(s.error),a()};s.addEventListener("success",r),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&V.set(t,s)}).catch(()=>{}),v.set(e,s),e}function De(s){if(k.has(s))return;const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",i),s.removeEventListener("abort",i)},r=()=>{t(),a()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",r),s.addEventListener("error",i),s.addEventListener("abort",i)});k.set(s,e)}let P={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return k.get(s);if(e==="objectStoreNames")return s.objectStoreNames||$.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return f(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function Ue(s){P=s(P)}function Te(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(U(this),e,...t);return $.set(n,e.sort?e.sort():[e]),f(n)}:Ee().includes(s)?function(...e){return s.apply(U(this),e),f(V.get(this))}:function(...e){return f(s.apply(U(this),e))}}function ke(s){return typeof s=="function"?Te(s):(s instanceof IDBTransaction&&De(s),Ce(s,xe())?new Proxy(s,P):s)}function f(s){if(s instanceof IDBRequest)return Le(s);if(D.has(s))return D.get(s);const e=ke(s);return e!==s&&(D.set(s,e),v.set(e,s)),e}const U=s=>v.get(s);function Pe(s,e,{blocked:t,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(s,e),c=f(i);return n&&i.addEventListener("upgradeneeded",o=>{n(f(i.result),o.oldVersion,o.newVersion,f(i.transaction),o)}),t&&i.addEventListener("blocked",o=>t(o.oldVersion,o.newVersion,o)),c.then(o=>{r&&o.addEventListener("close",()=>r()),a&&o.addEventListener("versionchange",l=>a(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}function ve(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",n=>e(n.oldVersion,n)),f(t).then(()=>{})}const Ie=["get","getKey","getAll","getAllKeys","count"],Ne=["put","add","delete","clear"],T=new Map;function S(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(T.get(e))return T.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,a=Ne.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||Ie.includes(t)))return;const r=async function(i,...c){const o=this.transaction(i,a?"readwrite":"readonly");let l=o.store;return n&&(l=l.index(c.shift())),(await Promise.all([l[t](...c),a&&o.done]))[0]};return T.set(e,r),r}Ue(s=>({...s,get:(e,t,n)=>S(e,t)||s.get(e,t,n),has:(e,t)=>!!S(e,t)||s.has(e,t)}));try{self["workbox:expiration:7.3.0"]&&_()}catch{}const Me="workbox-expiration",y="cache-entries",O=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class Ae{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(y,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&ve(this._cacheName)}async setTimestamp(e,t){e=O(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},r=(await this.getDb()).transaction(y,"readwrite",{durability:"relaxed"});await r.store.put(n),await r.done}async getTimestamp(e){const n=await(await this.getDb()).get(y,this._getId(e));return n==null?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let a=await n.transaction(y).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp<e||t&&i>=t?r.push(a.value):i++),a=await a.continue()}const c=[];for(const o of r)await n.delete(y,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+O(e)}async getDb(){return this._db||(this._db=await Pe(Me,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class Ke{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new Ae(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const a of t)await n.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,H(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t<n:!0}else return!1}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}function Se(s){B.add(s)}class Oe{constructor(e={}){this.cachedResponseWillBeUsed=async({event:t,request:n,cacheName:a,cachedResponse:r})=>{if(!r)return null;const i=this._isResponseDateFresh(r),c=this._getCacheExpiration(a);H(c.expireEntries());const o=c.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch{}return i?r:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(n.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&Se(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===b.getRuntimeName())throw new h("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new Ke(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}Re([{"revision":"1872c500de691dce40960bb85481de07","url":"registerSW.js"},{"revision":"0f93805414c783a30b72e0ce88f2c7c4","url":"icons/icon.svg"},{"revision":"5dee5ddcd8e8533edb348118334d9756","url":"icons/icon-512.png"},{"revision":"75734e6b38a556148f51b9e10eeb01c8","url":"icons/icon-192.png"},{"revision":"0362e0eb00358646fd4c97674945adba","url":"icons/icon-180.png"},{"revision":null,"url":"assets/xychartDiagram-JWTSCODW-BsOGuDAL.js"},{"revision":null,"url":"assets/vennDiagram-LZ73GAT5-Ci8AKqD1.js"},{"revision":null,"url":"assets/treemap-KZPCXAKY-Ct-pligZ.js"},{"revision":null,"url":"assets/timeline-definition-YZTLITO2-Bi12ioU0.js"},{"revision":null,"url":"assets/stateDiagram-v2-FVOUBMTO-CQnYvVz1.js"},{"revision":null,"url":"assets/stateDiagram-RAJIS63D-CbB0QqSa.js"},{"revision":null,"url":"assets/sequenceDiagram-2WXFIKYE-CPsVjHHb.js"},{"revision":null,"url":"assets/sankeyDiagram-WA2Y5GQK-CpT1bDmZ.js"},{"revision":null,"url":"assets/requirementDiagram-Z7DCOOCP-D4yTZU0p.js"},{"revision":null,"url":"assets/quadrantDiagram-337W2JSQ-Dcj0avLR.js"},{"revision":null,"url":"assets/pieDiagram-SKSYHLDU-C3T1FeFD.js"},{"revision":null,"url":"assets/ordinal-Cboi1Yqb.js"},{"revision":null,"url":"assets/mindmap-definition-YRQLILUH-CfNe7W8X.js"},{"revision":null,"url":"assets/linear-CNFortHj.js"},{"revision":null,"url":"assets/layout-DIfi_3Cg.js"},{"revision":null,"url":"assets/katex-B1X10hvy.js"},{"revision":null,"url":"assets/kanban-definition-K7BYSVSG-D9TVNfL2.js"},{"revision":null,"url":"assets/journeyDiagram-4ABVD52K-BNP3C6Ph.js"},{"revision":null,"url":"assets/ishikawaDiagram-PHBUUO56-BjaKmPoV.js"},{"revision":null,"url":"assets/init-Gi6I4Gst.js"},{"revision":null,"url":"assets/infoDiagram-LFFYTUFH-Cisyfr_w.js"},{"revision":null,"url":"assets/index-Cpm34cTy.css"},{"revision":null,"url":"assets/index-BxVq7AYs.js"},{"revision":null,"url":"assets/graph-mq5DkKwp.js"},{"revision":null,"url":"assets/gitGraphDiagram-K3NZZRJ6-D3HBxR11.js"},{"revision":null,"url":"assets/ganttDiagram-A5KZAMGK-C55hiPqb.js"},{"revision":null,"url":"assets/flowDiagram-PKNHOUZH-wUw5Mjvb.js"},{"revision":null,"url":"assets/erDiagram-INFDFZHY-Dc_91GQC.js"},{"revision":null,"url":"assets/diagram-P4PSJMXO-D7EqFseu.js"},{"revision":null,"url":"assets/diagram-IFDJBPK2-CH5mcu6V.js"},{"revision":null,"url":"assets/diagram-E7M64L7V-C1ypW2kT.js"},{"revision":null,"url":"assets/defaultLocale-DX6XiGOO.js"},{"revision":null,"url":"assets/dagre-KLK3FWXG-CvP5MaIU.js"},{"revision":null,"url":"assets/cytoscape.esm-BQaXIfA_.js"},{"revision":null,"url":"assets/cose-bilkent-S5V4N54A-BNYNzK1p.js"},{"revision":null,"url":"assets/clone-DfaqXUXL.js"},{"revision":null,"url":"assets/classDiagram-v2-RAHNMMFH-Ct_F3N6M.js"},{"revision":null,"url":"assets/classDiagram-VBA2DB6C-Ct_F3N6M.js"},{"revision":null,"url":"assets/chunk-WL4C6EOR-XtpH4KKr.js"},{"revision":null,"url":"assets/chunk-QZHKN3VN-CrSItx1v.js"},{"revision":null,"url":"assets/chunk-NQ4KR5QH-_X3IQmYu.js"},{"revision":null,"url":"assets/chunk-KX2RTZJC-BU-NTTwY.js"},{"revision":null,"url":"assets/chunk-JSJVCQXG-D_GdzPQn.js"},{"revision":null,"url":"assets/chunk-FMBD7UC4-H_1l13Rz.js"},{"revision":null,"url":"assets/chunk-55IACEB6-DhjD4VKO.js"},{"revision":null,"url":"assets/chunk-4BX2VUAB-Cz0Sexay.js"},{"revision":null,"url":"assets/channel-N7LACYfb.js"},{"revision":null,"url":"assets/c4Diagram-IC4MRINW-BM1jg1mo.js"},{"revision":null,"url":"assets/blockDiagram-WCTKOSBZ-RZQh_7bp.js"},{"revision":null,"url":"assets/architectureDiagram-2XIMDMQ5-Dr3bqfT2.js"},{"revision":null,"url":"assets/arc-BWX7iih_.js"},{"revision":null,"url":"assets/_baseUniq-D-ViDZI1.js"},{"revision":null,"url":"assets/_basePickBy-CVn0rIeA.js"},{"revision":"0362e0eb00358646fd4c97674945adba","url":"icons/icon-180.png"},{"revision":"75734e6b38a556148f51b9e10eeb01c8","url":"icons/icon-192.png"},{"revision":"5dee5ddcd8e8533edb348118334d9756","url":"icons/icon-512.png"},{"revision":"b0747e8d6cde0d45e05be8e5c731729e","url":"manifest.webmanifest"}]);ye();q(({url:s})=>s.hostname==="cdn.jsdelivr.net"&&s.pathname.endsWith(".ttf"),new be({cacheName:"termbeam-fonts",plugins:[new Oe({maxEntries:5,maxAgeSeconds:365*24*60*60})]}));self.addEventListener("message",s=>{var e;((e=s.data)==null?void 0:e.type)==="CLEAR_CACHES"&&caches.keys().then(t=>{for(const n of t)n!=="workbox-precache-v2"&&caches.delete(n)})});self.addEventListener("install",()=>{self.skipWaiting()});self.addEventListener("activate",s=>{s.waitUntil(caches.delete("termbeam-navigation").then(()=>self.clients.claim()))});self.addEventListener("push",s=>{let e={title:"Command finished",body:"TermBeam"};if(s.data)try{e=s.data.json()}catch{}s.waitUntil(self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(async t=>{if(t.some(r=>r.url.includes(self.location.origin)&&r.focused))return;const a={body:e.body||"A command has completed",icon:"/icons/icon-192.png",badge:"/icons/icon-192.png",tag:"termbeam-cmd",renotify:!0,data:{url:"/"},vibrate:[200,100,200]};try{await self.navigator.setAppBadge(1)}catch{}return self.registration.showNotification(e.title||"Command finished",a)}))});self.addEventListener("notificationclick",s=>{var t;s.notification.close();try{self.navigator.clearAppBadge()}catch{}const e=((t=s.notification.data)==null?void 0:t.url)||"/";s.waitUntil(self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(n=>{for(const a of n)if(a.url.includes(self.location.origin)&&"focus"in a)return a.focus();return self.clients.openWindow(e)}))});
|
package/src/server/index.js
CHANGED
|
@@ -13,7 +13,13 @@ const { createAuth } = require('./auth');
|
|
|
13
13
|
const { SessionManager } = require('./sessions');
|
|
14
14
|
const { setupRoutes, cleanupUploadedFiles } = require('./routes');
|
|
15
15
|
const { setupWebSocket } = require('./websocket');
|
|
16
|
-
const {
|
|
16
|
+
const {
|
|
17
|
+
startTunnel,
|
|
18
|
+
cleanupTunnel,
|
|
19
|
+
findDevtunnel,
|
|
20
|
+
tunnelEvents,
|
|
21
|
+
getLoginInfo,
|
|
22
|
+
} = require('../tunnel');
|
|
17
23
|
const { createPreviewProxy } = require('./preview');
|
|
18
24
|
const { writeConnectionConfig, removeConnectionConfig } = require('../cli/resume');
|
|
19
25
|
const { checkForUpdate, detectInstallMethod } = require('../utils/update-check');
|
|
@@ -96,7 +102,7 @@ function createTermBeamServer(overrides = {}) {
|
|
|
96
102
|
const server = http.createServer(app);
|
|
97
103
|
const wss = new WebSocketServer({ server, path: '/ws', maxPayload: 1 * 1024 * 1024 });
|
|
98
104
|
|
|
99
|
-
const state = { shareBaseUrl: null, updateInfo: null, wss };
|
|
105
|
+
const state = { shareBaseUrl: null, updateInfo: null, wss, tunnelStatus: null, getLoginInfo };
|
|
100
106
|
app.use('/preview', auth.middleware, createPreviewProxy());
|
|
101
107
|
setupRoutes(app, { auth, sessions, config, state, pushManager });
|
|
102
108
|
setupWebSocket(wss, { auth, sessions });
|
|
@@ -247,33 +253,99 @@ function createTermBeamServer(overrides = {}) {
|
|
|
247
253
|
|
|
248
254
|
let publicUrl = null;
|
|
249
255
|
if (config.useTunnel) {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
// Helper: broadcast a message to all WebSocket clients
|
|
257
|
+
function broadcastTunnelStatus(msg) {
|
|
258
|
+
if (!wss) return;
|
|
259
|
+
const data = JSON.stringify(msg);
|
|
260
|
+
wss.clients.forEach((client) => {
|
|
261
|
+
if (client.readyState === 1) {
|
|
262
|
+
try {
|
|
263
|
+
client.send(data);
|
|
264
|
+
} catch {
|
|
265
|
+
/* client disconnected */
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
});
|
|
260
269
|
}
|
|
261
270
|
|
|
262
|
-
//
|
|
271
|
+
// Wire up tunnel events BEFORE starting (startTunnel emits during setup)
|
|
272
|
+
tunnelEvents.removeAllListeners();
|
|
263
273
|
tunnelEvents.on('disconnected', () => {
|
|
264
274
|
log.warn('Tunnel disconnected — watchdog will attempt to reconnect');
|
|
275
|
+
state.tunnelStatus = { state: 'disconnected' };
|
|
276
|
+
broadcastTunnelStatus({ type: 'tunnel-status', state: 'disconnected' });
|
|
277
|
+
});
|
|
278
|
+
tunnelEvents.on('auth-expiring', ({ expiresIn, provider }) => {
|
|
279
|
+
const minutes = Math.round(expiresIn / 60000);
|
|
280
|
+
log.warn(`Tunnel token expiring in ${minutes}m`);
|
|
281
|
+
state.tunnelStatus = { state: 'expiring', expiresIn, provider };
|
|
282
|
+
broadcastTunnelStatus({
|
|
283
|
+
type: 'tunnel-status',
|
|
284
|
+
state: 'expiring',
|
|
285
|
+
expiresIn,
|
|
286
|
+
provider,
|
|
287
|
+
});
|
|
288
|
+
void pushManager
|
|
289
|
+
.notify({
|
|
290
|
+
title: '⏰ Tunnel token expiring',
|
|
291
|
+
body: `Token expires in ${minutes}m — open TermBeam to renew.`,
|
|
292
|
+
tag: 'termbeam-tunnel-expiring',
|
|
293
|
+
})
|
|
294
|
+
.catch(() => {});
|
|
295
|
+
});
|
|
296
|
+
tunnelEvents.on('auth-expired', () => {
|
|
297
|
+
log.warn('Tunnel auth expired — waiting for user to re-authenticate');
|
|
298
|
+
const loginInfo = getLoginInfo ? getLoginInfo() : null;
|
|
299
|
+
const provider = loginInfo?.provider ?? null;
|
|
300
|
+
state.tunnelStatus = { state: 'auth-expired', provider };
|
|
301
|
+
broadcastTunnelStatus({ type: 'tunnel-status', state: 'auth-expired', provider });
|
|
302
|
+
void pushManager
|
|
303
|
+
.notify({
|
|
304
|
+
title: '❌ Tunnel disconnected',
|
|
305
|
+
body: 'Auth token expired. Re-authenticate to restore.',
|
|
306
|
+
tag: 'termbeam-tunnel-expired',
|
|
307
|
+
})
|
|
308
|
+
.catch(() => {});
|
|
309
|
+
});
|
|
310
|
+
tunnelEvents.on('auth-restored', () => {
|
|
311
|
+
log.info('Tunnel auth restored — resuming reconnection');
|
|
312
|
+
broadcastTunnelStatus({ type: 'tunnel-status', state: 'reconnecting' });
|
|
265
313
|
});
|
|
266
314
|
tunnelEvents.on('reconnecting', ({ attempt, delay }) => {
|
|
267
315
|
log.info(`Tunnel reconnecting (attempt ${attempt}, backoff ${delay}ms)`);
|
|
268
316
|
});
|
|
269
317
|
tunnelEvents.on('connected', ({ url }) => {
|
|
270
318
|
log.info(`Tunnel connected: ${url}`);
|
|
319
|
+
state.tunnelStatus = { state: 'connected' };
|
|
320
|
+
broadcastTunnelStatus({ type: 'tunnel-status', state: 'connected' });
|
|
271
321
|
});
|
|
272
322
|
tunnelEvents.on('failed', ({ attempts }) => {
|
|
273
323
|
log.error(
|
|
274
324
|
`Tunnel watchdog gave up after ${attempts} attempts — tunnel URL is unreachable`,
|
|
275
325
|
);
|
|
326
|
+
state.tunnelStatus = { state: 'failed' };
|
|
327
|
+
broadcastTunnelStatus({ type: 'tunnel-status', state: 'failed' });
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
const tunnel = await startTunnel(actualPort, {
|
|
331
|
+
persisted: config.persistedTunnel,
|
|
332
|
+
anonymous: config.publicTunnel,
|
|
276
333
|
});
|
|
334
|
+
if (tunnel) {
|
|
335
|
+
publicUrl = tunnel.url;
|
|
336
|
+
state.shareBaseUrl = publicUrl;
|
|
337
|
+
} else {
|
|
338
|
+
// Check if failure is due to missing auth
|
|
339
|
+
const loginInfo = getLoginInfo();
|
|
340
|
+
if (!loginInfo) {
|
|
341
|
+
log.warn('Tunnel failed to start — not authenticated.');
|
|
342
|
+
console.log(' ⚠️ Tunnel auth required. Log in with: devtunnel user login -e -d');
|
|
343
|
+
state.tunnelStatus = { state: 'auth-expired' };
|
|
344
|
+
} else {
|
|
345
|
+
log.warn('Tunnel failed to start, falling back to LAN-only');
|
|
346
|
+
console.log(' ⚠️ Tunnel failed to start. Using LAN only.');
|
|
347
|
+
}
|
|
348
|
+
}
|
|
277
349
|
}
|
|
278
350
|
|
|
279
351
|
console.log(` Shell: ${config.shell}`);
|
package/src/server/routes.js
CHANGED
|
@@ -977,6 +977,83 @@ function setupRoutes(app, { auth, sessions, config, state, pushManager }) {
|
|
|
977
977
|
res.json({ ok: true });
|
|
978
978
|
});
|
|
979
979
|
}
|
|
980
|
+
|
|
981
|
+
// --- Tunnel token renewal ---
|
|
982
|
+
app.get('/api/tunnel/status', apiRateLimit, auth.middleware, (_req, res) => {
|
|
983
|
+
const tunnelStatus = state.tunnelStatus || { state: 'unknown' };
|
|
984
|
+
// Injected via state to avoid loading the full tunnel module in test contexts
|
|
985
|
+
const getLoginInfo = state.getLoginInfo;
|
|
986
|
+
const loginInfo = getLoginInfo ? getLoginInfo() : null;
|
|
987
|
+
res.json({
|
|
988
|
+
...tunnelStatus,
|
|
989
|
+
provider: loginInfo?.provider ?? null,
|
|
990
|
+
tokenLifetimeSeconds: loginInfo?.tokenLifetimeSeconds ?? null,
|
|
991
|
+
});
|
|
992
|
+
});
|
|
993
|
+
|
|
994
|
+
app.post('/api/tunnel/renew', apiRateLimit, auth.middleware, (_req, res) => {
|
|
995
|
+
const { spawn } = require('child_process');
|
|
996
|
+
const { findDevtunnel } = require('../tunnel');
|
|
997
|
+
const cmd = findDevtunnel() || 'devtunnel';
|
|
998
|
+
const proc = spawn(cmd, ['user', 'login', '-d'], {
|
|
999
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
1000
|
+
});
|
|
1001
|
+
|
|
1002
|
+
let output = '';
|
|
1003
|
+
let responded = false;
|
|
1004
|
+
|
|
1005
|
+
const timeout = setTimeout(() => {
|
|
1006
|
+
if (!responded) {
|
|
1007
|
+
responded = true;
|
|
1008
|
+
proc.kill();
|
|
1009
|
+
res.status(504).json({ error: 'Timed out waiting for device code' });
|
|
1010
|
+
}
|
|
1011
|
+
}, 15000);
|
|
1012
|
+
|
|
1013
|
+
function tryParse(data) {
|
|
1014
|
+
if (responded || output.length > 10_000) return;
|
|
1015
|
+
output += data;
|
|
1016
|
+
// Entra: "open the page https://... and enter the code ABC123 to authenticate"
|
|
1017
|
+
// GitHub: "Browse to https://... and enter the code: AB12-CD34"
|
|
1018
|
+
const match =
|
|
1019
|
+
output.match(/open the page (https:\/\/[^\s]+) and enter the code ([A-Z0-9]+)/i) ||
|
|
1020
|
+
output.match(/Browse to (https:\/\/[^\s]+) and enter the code:?\s*([A-Z0-9-]+)/i);
|
|
1021
|
+
if (match) {
|
|
1022
|
+
responded = true;
|
|
1023
|
+
clearTimeout(timeout);
|
|
1024
|
+
// Stop reading output — we have what we need
|
|
1025
|
+
proc.stdout.removeAllListeners('data');
|
|
1026
|
+
proc.stderr.removeAllListeners('data');
|
|
1027
|
+
res.json({
|
|
1028
|
+
url: match[1],
|
|
1029
|
+
code: match[2],
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
proc.stdout.on('data', (d) => tryParse(d.toString()));
|
|
1035
|
+
proc.stderr.on('data', (d) => tryParse(d.toString()));
|
|
1036
|
+
|
|
1037
|
+
proc.on('close', (code) => {
|
|
1038
|
+
clearTimeout(timeout);
|
|
1039
|
+
if (!responded) {
|
|
1040
|
+
responded = true;
|
|
1041
|
+
if (code === 0) {
|
|
1042
|
+
res.json({ ok: true, message: 'Already authenticated' });
|
|
1043
|
+
} else {
|
|
1044
|
+
res.status(500).json({ error: 'DevTunnel login failed' });
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
|
|
1049
|
+
proc.on('error', (err) => {
|
|
1050
|
+
clearTimeout(timeout);
|
|
1051
|
+
if (!responded) {
|
|
1052
|
+
responded = true;
|
|
1053
|
+
res.status(500).json({ error: err.message });
|
|
1054
|
+
}
|
|
1055
|
+
});
|
|
1056
|
+
});
|
|
980
1057
|
}
|
|
981
1058
|
|
|
982
1059
|
function cleanupUploadedFiles() {
|