@bkm016/basalt 0.1.15 → 0.1.16
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/{chunk-mfb3dgs8.js → chunk-1c9nr9rs.js} +1 -1
- package/{chunk-z9p6s986.js → chunk-4hf0r9hv.js} +3 -3
- package/{chunk-p886jr17.js → chunk-6ae9810t.js} +2 -2
- package/{chunk-6hx9y86d.js → chunk-6exa9fp7.js} +1 -1
- package/{chunk-tszctb17.js → chunk-8jn0yax5.js} +26 -26
- package/{chunk-xq74x4gc.js → chunk-8r4baw9e.js} +1 -1
- package/{chunk-5n1qra6k.js → chunk-9ymm1gge.js} +158 -149
- package/{chunk-qjnx4fsn.js → chunk-b350b01x.js} +3 -3
- package/{chunk-59hg9a84.js → chunk-bv96b8q7.js} +1 -1
- package/{chunk-343jsm46.js → chunk-e8x8zwkg.js} +1 -1
- package/{chunk-k38jaz6c.js → chunk-ehnc8g6v.js} +2 -2
- package/{chunk-kcn05erf.js → chunk-fzftb4n2.js} +3 -3
- package/{chunk-0rasqm8y.js → chunk-nrdszs0g.js} +2 -2
- package/{chunk-qs161f2q.js → chunk-p78wde92.js} +1 -1
- package/{chunk-39mh7h58.js → chunk-pna1wh02.js} +1 -1
- package/{chunk-edcf97ka.js → chunk-q6tgpaf3.js} +1 -1
- package/{chunk-qe76naq9.js → chunk-rqn67tm8.js} +1 -1
- package/{chunk-en7z6ne5.js → chunk-v9ttcf6r.js} +1 -1
- package/{chunk-9v3b7jjv.js → chunk-vv9csar7.js} +1 -1
- package/{chunk-81x8r8w4.js → chunk-xba6fr5v.js} +1 -1
- package/{chunk-03wzwnn6.js → chunk-ypxs8djn.js} +1 -1
- package/compiled.js +4 -4
- package/package.json +1 -1
- package/ui-test-worker.js +2 -2
- package/web/{chunk-ymtq18z6.js → chunk-0qnetvsc.js} +4 -4
- package/web/{chunk-p1bb9xp8.js → chunk-0zb330w3.js} +4 -4
- package/web/{chunk-zf4b8jb9.js → chunk-0zyekjym.js} +1 -1
- package/web/chunk-11byy7vm.js +1 -0
- package/web/chunk-160x5pv7.js +1 -0
- package/web/{chunk-jca9xbe0.js → chunk-19g09ekr.js} +5 -5
- package/web/chunk-1gzprnyd.js +1 -0
- package/web/{chunk-7wzszsf5.js → chunk-1hx4xtdk.js} +2 -2
- package/web/{chunk-50vgq2nk.js → chunk-1je4p601.js} +4 -4
- package/web/{chunk-jx3z63tq.js → chunk-1np2aamb.js} +3 -3
- package/web/{chunk-ed5xfgxb.js → chunk-1rjtqf8h.js} +2 -2
- package/web/{chunk-62gj74fq.js → chunk-23258z1r.js} +1 -1
- package/web/{chunk-1bhpfsvr.js → chunk-27592nd8.js} +3 -3
- package/web/chunk-27tchdxd.js +2 -0
- package/web/{chunk-pdmcr6d4.js → chunk-2hqmdqn3.js} +1 -1
- package/web/chunk-2q79n966.js +2 -0
- package/web/{chunk-djnq1w1e.js → chunk-2ws74tfa.js} +10 -10
- package/web/{chunk-vypfy030.js → chunk-2z8epr8f.js} +7 -7
- package/web/{chunk-k4qrqmdk.js → chunk-36e78034.js} +2 -2
- package/web/{chunk-27cntdyk.js → chunk-3gj2t10x.js} +8 -8
- package/web/{chunk-tvaxyhh0.js → chunk-444xfger.js} +4 -4
- package/web/{chunk-z5h046zm.js → chunk-4k62e61g.js} +5 -5
- package/web/{chunk-phj4pcx4.js → chunk-4z6wma3s.js} +2 -2
- package/web/{chunk-251yw6f2.js → chunk-5sss3r97.js} +1 -1
- package/web/chunk-5wkqqa59.js +1 -0
- package/web/{chunk-qdsg8wp0.js → chunk-5yczs6sb.js} +1 -1
- package/web/chunk-5yn7mwvt.js +1 -0
- package/web/{chunk-pa82db2e.js → chunk-6ty9vw27.js} +3 -3
- package/web/chunk-705tkt2r.js +1 -0
- package/web/{chunk-t72z2ww3.js → chunk-753qp8sa.js} +2 -2
- package/web/{chunk-7frnjms9.js → chunk-75kzvpf3.js} +8 -8
- package/web/{chunk-hdtvrh0f.js → chunk-75meb0dh.js} +2 -2
- package/web/{chunk-66164wmv.js → chunk-76e3npmd.js} +1 -1
- package/web/chunk-7p04dn0k.js +1 -0
- package/web/chunk-7rb3v8gy.js +1 -0
- package/web/{chunk-65ay0j1t.js → chunk-7yz88k97.js} +3 -3
- package/web/{chunk-yeh77fvq.js → chunk-85d7jkp0.js} +1 -1
- package/web/chunk-90kgn35s.js +1 -0
- package/web/chunk-931y1g0h.js +1 -0
- package/web/{chunk-jy448465.js → chunk-bcp6na49.js} +104 -101
- package/web/chunk-bz1q7qdd.js +8 -0
- package/web/chunk-c0evk1xy.js +1 -0
- package/web/{chunk-8qzsxg1q.js → chunk-c0hdp2zj.js} +1 -1
- package/web/{chunk-25sn840r.js → chunk-c1z290wm.js} +2 -2
- package/web/{chunk-01nbc18z.js → chunk-cge0cjfm.js} +1 -1
- package/web/{chunk-3zs2v6b4.js → chunk-chh8bg2h.js} +11 -11
- package/web/{chunk-7zfqppsx.js → chunk-ctmxm4qd.js} +2 -2
- package/web/{chunk-hbwxtbq3.js → chunk-e229cr90.js} +1 -1
- package/web/{chunk-pma5pats.js → chunk-e9mmkrc3.js} +5 -5
- package/web/{chunk-yzmrbssn.js → chunk-ef03t1mb.js} +5 -5
- package/web/{chunk-ehz9m6g4.js → chunk-f8nnrk6y.js} +4 -4
- package/web/{chunk-mss6eg27.js → chunk-fcrswzgm.js} +3 -3
- package/web/{chunk-1v6hhgc6.js → chunk-ffn1a0zw.js} +1 -1
- package/web/chunk-fw4fa7j6.js +1 -0
- package/web/chunk-fx8hheqz.js +1 -0
- package/web/{chunk-937ndmh1.js → chunk-g8wy9sa6.js} +11 -11
- package/web/{chunk-pafw34vg.js → chunk-gaf9brzv.js} +2 -2
- package/web/{chunk-bcx7xges.js → chunk-gj16e7z0.js} +1 -1
- package/web/{chunk-6x1hfjb9.js → chunk-gjchc4kg.js} +1 -1
- package/web/chunk-h1y8y203.js +1 -0
- package/web/{chunk-6s1vjny7.js → chunk-h6vy008x.js} +1 -1
- package/web/{chunk-t5ke9cyg.js → chunk-h8mhnze5.js} +55 -55
- package/web/{chunk-s6bc73n3.js → chunk-hhnhgthx.js} +2 -2
- package/web/{chunk-4m9mgdaa.js → chunk-j27mtdr2.js} +1 -1
- package/web/chunk-jys02310.js +1 -0
- package/web/chunk-kew13yzg.js +1 -0
- package/web/{chunk-43194184.js → chunk-kx5r8nf2.js} +1 -1
- package/web/{chunk-3hy2gsgf.js → chunk-m7c0xk69.js} +1 -1
- package/web/{chunk-n0ezfa12.js → chunk-madrcnm1.js} +2 -2
- package/web/{chunk-vwv6pqy7.js → chunk-mcm3t5wr.js} +1 -1
- package/web/{chunk-q6j2e8a1.js → chunk-mrnx4f74.js} +2 -2
- package/web/chunk-mtdsrtc5.js +1 -0
- package/web/{chunk-te15yhn5.js → chunk-mv5axm2y.js} +4 -4
- package/web/{chunk-t78qm9gs.js → chunk-n3f5a91k.js} +1 -1
- package/web/{chunk-ksnsfqrn.js → chunk-n3spc397.js} +1 -1
- package/web/{chunk-dde64qjd.js → chunk-nhc280n0.js} +1 -1
- package/web/chunk-nx1bcekh.js +2 -0
- package/web/{chunk-wfgrdabk.js → chunk-p0jghn6b.js} +1 -1
- package/web/chunk-p8t7s4z4.js +1 -0
- package/web/chunk-pgh1cx6w.js +1 -0
- package/web/{chunk-mv9q8jrm.js → chunk-ps489yjy.js} +1 -1
- package/web/{chunk-2tm4xe0j.js → chunk-qbhv18t0.js} +2 -2
- package/web/{chunk-cq1f20k6.js → chunk-qgzn0ha5.js} +1 -1
- package/web/{chunk-aw6wg8fe.js → chunk-qtwxq6hj.js} +3 -3
- package/web/chunk-qwp3dhmf.js +1 -0
- package/web/{chunk-t2v01k4z.js → chunk-qwwqdmhv.js} +1 -1
- package/web/{chunk-43bczb21.js → chunk-rjh54ygb.js} +5 -5
- package/web/chunk-ryh8jdzy.js +1 -0
- package/web/chunk-s3t8dkkz.js +1 -0
- package/web/chunk-sk1w7f7h.js +1 -0
- package/web/chunk-smkrxjm5.js +1 -0
- package/web/{chunk-ppfhtyxt.js → chunk-sv5ph7fa.js} +1 -1
- package/web/{chunk-4q2jtvwn.js → chunk-t89tfrpj.js} +8 -8
- package/web/{chunk-qv1w36ja.js → chunk-t9pg7qf8.js} +2 -2
- package/web/{chunk-qdn3hmfy.js → chunk-t9twxmsg.js} +1 -1
- package/web/{chunk-pmghe7rh.js → chunk-tfdchqn4.js} +1 -1
- package/web/{chunk-dgepxev9.js → chunk-tfsrk2rc.js} +24 -24
- package/web/{chunk-5rwg3qqd.js → chunk-tvvggvjt.js} +8 -8
- package/web/chunk-ty87gdvr.js +1 -0
- package/web/{chunk-b323qea5.js → chunk-v16s0x7c.js} +1 -1
- package/web/{chunk-6xfbh4z5.js → chunk-vb2z2azk.js} +10 -10
- package/web/{chunk-ea6b8b50.js → chunk-vcnsvj49.js} +9 -9
- package/web/{chunk-8nm0mghm.js → chunk-vgyp8wa2.js} +2 -2
- package/web/chunk-vh8pkcem.css +1 -0
- package/web/{chunk-17wwzrp4.js → chunk-vjnvfb8z.js} +1 -1
- package/web/{chunk-qf2kb7zj.js → chunk-vphzndz8.js} +1 -1
- package/web/{chunk-fttdbcqv.js → chunk-w60dxtyz.js} +1 -1
- package/web/{chunk-1zwc09e8.js → chunk-wcj3bxdf.js} +2 -2
- package/web/{chunk-kxr473dw.js → chunk-wgmwgaw4.js} +5 -5
- package/web/{chunk-k3ah0513.js → chunk-wvt76598.js} +1 -1
- package/web/chunk-y0mef85j.js +1 -0
- package/web/{chunk-5fzmk43v.js → chunk-y2ykn1gm.js} +1 -1
- package/web/{chunk-jdx7qp2w.js → chunk-ybqt106a.js} +2 -2
- package/web/{chunk-m5psa69k.js → chunk-ym9qfsjs.js} +4 -4
- package/web/{chunk-w9nkvcjr.js → chunk-ypdptddq.js} +1 -1
- package/web/{chunk-3f8fjee5.js → chunk-z08c63ph.js} +2 -2
- package/web/{chunk-bzdn9sxz.js → chunk-z2hvvkf5.js} +2 -2
- package/web/chunk-z6x74qfh.js +1 -0
- package/web/{chunk-57b8j192.js → chunk-z86pjpqp.js} +1 -1
- package/web/{chunk-4tbhxtnm.js → chunk-zh0vjc6g.js} +1 -1
- package/web/chunk-zns9wmab.js +1 -0
- package/web/index.html +1 -1
- package/web/chunk-00swes3c.js +0 -1
- package/web/chunk-0e995hjg.js +0 -1
- package/web/chunk-3egthz5k.js +0 -2
- package/web/chunk-3fjzgpaw.js +0 -1
- package/web/chunk-3mgzqbc8.js +0 -1
- package/web/chunk-3yvanftw.js +0 -1
- package/web/chunk-64h7k870.js +0 -1
- package/web/chunk-6ehecat3.js +0 -1
- package/web/chunk-73941p08.js +0 -1
- package/web/chunk-7jh6zxg3.js +0 -1
- package/web/chunk-7mgwejn4.js +0 -1
- package/web/chunk-8zg89764.js +0 -1
- package/web/chunk-95gbcs8j.js +0 -1
- package/web/chunk-evp6t44y.js +0 -8
- package/web/chunk-eyg28s83.js +0 -1
- package/web/chunk-g7bcntpm.js +0 -1
- package/web/chunk-g9bqacq1.js +0 -1
- package/web/chunk-gh8kjzdj.js +0 -1
- package/web/chunk-j031r08w.js +0 -1
- package/web/chunk-jab2p5zv.js +0 -2
- package/web/chunk-jpf8x9tm.js +0 -1
- package/web/chunk-jy8zat04.js +0 -1
- package/web/chunk-k8s7kye3.js +0 -1
- package/web/chunk-k9zn1n6d.js +0 -1
- package/web/chunk-md9j949p.js +0 -1
- package/web/chunk-npyrdsf8.css +0 -1
- package/web/chunk-pze2v3v1.js +0 -2
- package/web/chunk-q6jf3zc1.js +0 -1
- package/web/chunk-sdtesqbb.js +0 -1
- package/web/chunk-t0z8ygx4.js +0 -1
- package/web/chunk-w7cyrbk2.js +0 -1
- package/web/chunk-x2f8bwd2.js +0 -1
- package/web/chunk-xq8x7dvr.js +0 -1
package/package.json
CHANGED
package/ui-test-worker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{yr,Vn,M,Kn,Qn,Xn,en,Jn,gt,tn}from"./chunk-pdt65s31.js";import{jn,gr}from"./chunk-
|
|
2
|
+
import{yr,Vn,M,Kn,Qn,Xn,en,Jn,gt,tn}from"./chunk-pdt65s31.js";import{jn,gr}from"./chunk-8jn0yax5.js";import"./chunk-38g4jd6v.js";import"./chunk-44a7f5ta.js";import{a,r,Ze,Kt}from"./chunk-qd2enpr2.js";var mh=r(function(FA){FA.removeLeadingAndTrailingHTTPWhitespace=(t)=>t.replace(/^[ \t\n\r]+/u,"").replace(/[ \t\n\r]+$/u,"");FA.removeTrailingHTTPWhitespace=(t)=>t.replace(/[ \t\n\r]+$/u,"");FA.isHTTPWhitespaceChar=(t)=>t===" "||t==="\t"||t===`
|
|
3
3
|
`||t==="\r";FA.solelyContainsHTTPTokenCodePoints=(t)=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(t);FA.soleyContainsHTTPQuotedStringTokenCodePoints=(t)=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(t);FA.asciiLowercase=(t)=>t.replace(/[A-Z]/ug,(e)=>e.toLowerCase());FA.collectAnHTTPQuotedString=(t,e)=>{let o="";e++;while(!0){while(e<t.length&&t[e]!=='"'&&t[e]!=="\\")o+=t[e],++e;if(e>=t.length)break;let i=t[e];if(++e,i==="\\"){if(e>=t.length){o+="\\";break}o+=t[e],++e}else break}return[o,e]}});var PS=r(function(z2,fS){var{asciiLowercase:Rc,solelyContainsHTTPTokenCodePoints:WA,soleyContainsHTTPQuotedStringTokenCodePoints:_A}=mh();fS.exports=class{constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=Rc(String(e)),this._map.get(e)}has(e){return e=Rc(String(e)),this._map.has(e)}set(e,o){if(e=Rc(String(e)),o=String(o),!WA(e))throw Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!_A(o))throw Error(`Invalid MIME type parameter value "${o}": only HTTP quoted-string token code points are valid.`);return this._map.set(e,o)}clear(){this._map.clear()}delete(e){return e=Rc(String(e)),this._map.delete(e)}forEach(e,o){this._map.forEach(e,o)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this._map[Symbol.iterator]()}}});var ES=r(function(J2,wS){var{removeLeadingAndTrailingHTTPWhitespace:YA,removeTrailingHTTPWhitespace:AS,isHTTPWhitespaceChar:KA,solelyContainsHTTPTokenCodePoints:cg,soleyContainsHTTPQuotedStringTokenCodePoints:QA,asciiLowercase:dg,collectAnHTTPQuotedString:jA}=mh();wS.exports=(t)=>{t=YA(t);let e=0,o="";while(e<t.length&&t[e]!=="/")o+=t[e],++e;if(o.length===0||!cg(o))return null;if(e>=t.length)return null;++e;let i="";while(e<t.length&&t[e]!==";")i+=t[e],++e;if(i=AS(i),i.length===0||!cg(i))return null;let s={type:dg(o),subtype:dg(i),parameters:new Map};while(e<t.length){++e;while(KA(t[e]))++e;let n="";while(e<t.length&&t[e]!==";"&&t[e]!=="=")n+=t[e],++e;if(n=dg(n),e<t.length){if(t[e]===";")continue;++e}let l=null;if(t[e]==='"'){[l,e]=jA(t,e);while(e<t.length&&t[e]!==";")++e}else{l="";while(e<t.length&&t[e]!==";")l+=t[e],++e;if(l=AS(l),l==="")continue}if(n.length>0&&cg(n)&&QA(l)&&!s.parameters.has(n))s.parameters.set(n,l)}return s}});var vS=r(function(Z2,xS){var{solelyContainsHTTPTokenCodePoints:qA}=mh();xS.exports=(t)=>{let e=`${t.type}/${t.subtype}`;if(t.parameters.size===0)return e;for(let[o,i]of t.parameters){if(e+=";",e+=o,e+="=",!qA(i)||i.length===0)i=i.replace(/(["\\])/ug,"\\$1"),i=`"${i}"`;e+=i}return e}});var LS=r(function(tU,NS){var $A=PS(),XA=ES(),zA=vS(),{asciiLowercase:TS,solelyContainsHTTPTokenCodePoints:CS}=mh();NS.exports=class{constructor(e){e=String(e);let o=XA(e);if(o===null)throw Error(`Could not parse MIME type string "${e}"`);this._type=o.type,this._subtype=o.subtype,this._parameters=new $A(o.parameters)}static parse(e){try{return new this(e)}catch(o){return null}}get essence(){return`${this.type}/${this.subtype}`}get type(){return this._type}set type(e){if(e=TS(String(e)),e.length===0)throw Error("Invalid type: must be a non-empty string");if(!CS(e))throw Error(`Invalid type ${e}: must contain only HTTP token code points`);this._type=e}get subtype(){return this._subtype}set subtype(e){if(e=TS(String(e)),e.length===0)throw Error("Invalid subtype: must be a non-empty string");if(!CS(e))throw Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return zA(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this._type){case"text":switch(this._subtype){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}case"application":switch(this._subtype){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}default:return!1}}isXML(){return this._subtype==="xml"&&(this._type==="text"||this._type==="application")||this._subtype.endsWith("+xml")}isHTML(){return this._subtype==="html"&&this._type==="text"}}});var $d={};Ze($d,{PluginWebUIContext:()=>qd,SlotButton:()=>kw,useDraftReplace:()=>Lw,usePluginWebUI:()=>OS});var Lg={};Kt(Lg,{Fragment:()=>GS,jsxDEV:()=>US},{Fragment:(D5)=>GS=D5,jsxDEV:(D5)=>US=D5});var kg={};Kt(kg,{Fragment:()=>WS,jsx:()=>_S,jsxs:()=>YS},{Fragment:(B5)=>WS=B5,jsx:(B5)=>_S=B5,jsxs:(B5)=>YS=B5});var An=(t)=>globalThis.postMessage(t),lf=0,zd=new Map;function Rg(t,e){let o=lf++;return new Promise((i,s)=>{zd.set(o,{resolve:i,reject:s}),e.addEventListener("abort",()=>An({type:"cancel",id:o}),{once:!0}),An({type:"request",id:o,input:t})})}function Fg(t){let e=zd.get(t.id);if(zd.delete(t.id),t.error)e?.reject(Error(t.error));else if(t.response)e?.resolve(t.response)}var af="http://basalt.internal";function mf(t){if(!t.startsWith("/api/")||/[\\\r\n#]/.test(t)||!new URL(t,af).pathname.startsWith("/api/"))throw Error("request path must stay within /api/")}function yf(t,e){return new Promise((o,i)=>{let n=setTimeout(()=>{e.removeEventListener("abort",l),o()},t),l=()=>{clearTimeout(n),e.removeEventListener("abort",l),i(Error("Request aborted"))};e.addEventListener("abort",l,{once:!0})})}function pf(t){if(t===void 0||t===null)return;if(typeof t!=="string")throw Error("ui_test requests require a JSON string body");if(!t)return;let e=JSON.parse(t);if(!e||typeof e!=="object"||Array.isArray(e))throw Error("request body must be a JSON object");return e}function Vg(t,e){return{async request(o,i){mf(o);let s=(i?.method??"GET").toUpperCase(),n=i?.signal?AbortSignal.any([i.signal,e]):e;n.throwIfAborted();let l=`${s} ${o}`,y=t&&Object.hasOwn(t,l)?t[l]:void 0;if(y){if(await yf(y.delayMs??0,n),n.throwIfAborted(),y.status<200||y.status>=300)throw Error(`Request failed (${y.status})`);return structuredClone(y.body)}let u=await Rg({path:o,method:s,body:pf(i?.body)},n);if(n.throwIfAborted(),u.status<200||u.status>=300)throw Error(`Request failed (${u.status})`);if(u.truncated)throw Error("API response exceeds ui_test response limit");return JSON.parse(u.body)}}}function Dg(t,e){let o=t.ownerDocument;function i(E){for(let R=E;R;R=R.parentElement){if(R.hasAttribute("hidden")||R.getAttribute("aria-hidden")==="true")return!1;let H=e.getComputedStyle(R);if(H.display==="none"||H.visibility==="hidden")return!1}return!0}function s(E){let R=E.getAttribute("aria-label");if(R!==null)return R;let H=E.getAttribute("aria-labelledby");if(H)return H.split(/\s+/).map((yt)=>o.getElementById(yt)?.textContent??"").join(" ");if("labels"in E){let yt=Array.from(E.labels??[]);if(yt.length)return yt.map((bt)=>bt.textContent).join(" ")}return E.textContent??""}function n(E){return E.hasAttribute("disabled")||E.getAttribute("aria-disabled")==="true"}function l(E){let R=[],H=o.createTreeWalker(E,4);while(H.nextNode()){let yt=H.currentNode,bt=yt?.parentElement;if(bt&&!bt.closest("script,style,textarea")&&i(bt))R.push(yt?.textContent??"")}return R.join(" ").replace(/\s+/g," ").trim()}function y(){return Array.from(t.querySelectorAll("button,[role=button]")).filter(i).map((E)=>({name:s(E).trim(),disabled:n(E),busy:E.getAttribute("aria-busy")==="true"}))}function u(){return Array.from(t.querySelectorAll("input,textarea,select")).filter((E)=>E instanceof e.HTMLInputElement||E instanceof e.HTMLTextAreaElement||E instanceof e.HTMLSelectElement).filter(i).map((E)=>({label:s(E).trim(),value:E.value}))}function c(E=t,R=!0){let H=l(E),yt=y(),bt=u();if(!R)return{text:H,buttons:yt,values:bt,truncated:!1};let Rt=new TextEncoder().encode(H);return{text:new TextDecoder().decode(Rt.slice(0,2048),{stream:!0}),buttons:yt.slice(0,50),values:bt.slice(0,50),truncated:Rt.length>2048||yt.length>50||bt.length>50}}function d(E,R){let H=Array.from(t.querySelectorAll(E)).filter((yt)=>yt instanceof e.HTMLElement).filter((yt)=>i(yt)&&s(yt).trim()===R);if(H.length!==1||!H[0])throw Error(`Expected one control named ${JSON.stringify(R)}, found ${H.length}`);return H[0]}function g(E){let R=Array.from(t.querySelectorAll(E)).filter(i),H=R[0];if(R.length!==1||!(H instanceof e.HTMLElement))throw Error(`Expected one visible element for ${E}, found ${R.length}`);return H}function f(E,R){let H=200,yt=(bt,Rt)=>{H--;let lt=[];if(Rt<R)for(let ct of bt.children){if(!H)break;lt.push(yt(ct,Rt+1))}return{tag:bt.tagName.toLowerCase(),role:bt.getAttribute("role"),class:bt.className,text:Array.from(bt.childNodes).filter((ct)=>ct.nodeType===3).map((ct)=>ct.textContent).join(" ").trim(),childCount:bt.children.length,children:lt}};return yt(E,0)}return{visible:i,isDisabled:n,snapshot:c,findByName:d,selectOne:g,outline:f,count:(E)=>t.querySelectorAll(E).length,anyVisible:(E)=>Array.from(t.querySelectorAll(E)).some(i)}}var ui=Symbol("abort"),Me=Symbol("activeElement"),Pt=Symbol("asyncTaskManager"),hi=Symbol("bodyBuffer"),Nt=Symbol("buffer"),Qo=Symbol("cachedResponse"),ci=Symbol("callbacks"),wn=Symbol("checked"),Ts=Symbol("childNodes"),ir=Symbol("children"),Aa=Symbol("classList"),zr=Symbol("connectedToNode"),Vi=Symbol("disconnectedFromNode"),sr=Symbol("connectedToDocument"),nr=Symbol("disconnectedFromDocument"),xl=Symbol("contentLength"),xe=Symbol("contentType"),fr=Symbol("cssText"),Do=Symbol("currentScript"),Bo=Symbol("currentTarget"),Yt=Symbol("data"),Lr=Symbol("defaultView"),At=Symbol("destroy"),En=Symbol("dirtyness"),Y=Symbol("end"),Xe=Symbol("entries"),oE=Symbol("evaluateCSS"),Oo=Symbol("evaluateScript"),Jr=Symbol("exceptionObserver"),Gt=Symbol("formNode"),xn=Symbol("internalId"),F=Symbol("height"),Cs=Symbol("immediatePropagationStopped"),vn=Symbol("indeterminate"),Ns=Symbol("isFirstWrite"),Ls=Symbol("isFirstWriteAfterOpen"),wa=Symbol("isInPassiveEventListener"),Zr=Symbol("isValue"),ks=Symbol("listenerOptions"),he=Symbol("listeners"),Hr=Symbol("itemsByName"),Ms=Symbol("nextActiveElement"),vl=Symbol("observeMutations"),to=Symbol("mutationListeners"),x=Symbol("ownerDocument"),xt=Symbol("ownerElement"),Is=Symbol("propagationStopped"),Ao=Symbol("readyStateManager"),Pr=Symbol("referrer"),di=Symbol("registry"),eo=Symbol("relList"),Ea=Symbol("resetSelection"),ve=Symbol("rootNode"),Ie=Symbol("selectNode"),Ar=Symbol("selectedness"),Tn=Symbol("selection"),Tm=Symbol("setupVMContext"),be=Symbol("shadowRoot"),O=Symbol("start"),ge=Symbol("style"),wr=Symbol("target"),ze=Symbol("textAreaNode"),xa=Symbol("unobserveMutations"),Di=Symbol("reportMutation"),Cn=Symbol("updateSelectedness"),Pe=Symbol("url"),q=Symbol("value"),V=Symbol("width"),m=Symbol("window"),vh=Symbol("windowResizeListener"),Nn=Symbol("mutationObservers"),ro=Symbol("openerFrame"),bi=Symbol("openerWindow"),Cm=Symbol("pointerCaptures"),Ln=Symbol("popup"),tt=Symbol("isConnected"),W=Symbol("parentNode"),D=Symbol("nodeType"),z=Symbol("tagName"),Ft=Symbol("prefix"),Jd=Symbol("scrollHeight"),Zd=Symbol("scrollWidth"),Th=Symbol("scrollTop"),Ch=Symbol("scrollLeft"),St=Symbol("attributes"),va=Symbol("attributesProxy"),J=Symbol("namespaceURI"),Ta=Symbol("accessKey"),iE=Symbol("accessKeyLabel"),tb=Symbol("offsetHeight"),eb=Symbol("offsetWidth"),rb=Symbol("offsetLeft"),ob=Symbol("offsetTop"),ib=Symbol("clientHeight"),sb=Symbol("clientWidth"),nb=Symbol("clientLeft"),lb=Symbol("clientTop"),rt=Symbol("name"),Nm=Symbol("specified"),Rs=Symbol("adoptedStyleSheets"),Nh=Symbol("implementation"),kn=Symbol("readyState"),Fs=Symbol("publicId"),Vs=Symbol("systemId"),Ce=Symbol("validationMessage"),Ke=Symbol("validity"),Lh=Symbol("returnValue"),Bi=Symbol("elements"),sE=Symbol("length"),ab=Symbol("complete"),mb=Symbol("naturalHeight"),yb=Symbol("naturalWidth"),Bg=Symbol("loading"),L=Symbol("x"),k=Symbol("y"),nE=Symbol("defaultChecked"),jo=Symbol("files"),Be=Symbol("sheet"),kh=Symbol("volume"),Tl=Symbol("paused"),Mh=Symbol("currentTime"),Ih=Symbol("playbackRate"),Rh=Symbol("defaultPlaybackRate"),Ca=Symbol("muted"),Cl=Symbol("defaultMuted"),Fh=Symbol("preservesPitch"),pb=Symbol("buffered"),ub=Symbol("duration"),Qe=Symbol("error"),hb=Symbol("ended"),cb=Symbol("networkState"),Vh=Symbol("textTracks"),db=Symbol("seeking"),bb=Symbol("seekable"),gb=Symbol("played"),Oi=Symbol("options"),oo=Symbol("content"),Ee=Symbol("mode"),Mn=Symbol("host"),Wr=Symbol("setURL"),ot=Symbol("localName"),Na=Symbol("classRegistry"),Lm=Symbol("nodeStream"),io=Symbol("location"),Oe=Symbol("history"),Dh=Symbol("navigator"),Bh=Symbol("screen"),Oh=Symbol("sessionStorage"),Gh=Symbol("localStorage"),km=Symbol("sandbox"),ht=Symbol("cloneNode"),Et=Symbol("appendChild"),hr=Symbol("removeChild"),kr=Symbol("insertBefore"),La=Symbol("replaceChild"),gi=Symbol("tracks"),ka=Symbol("constraints"),Si=Symbol("capabilities"),In=Symbol("settings"),lE=Symbol("clone"),Ds=Symbol("removeNamedItem"),Q=Symbol("items"),Rn=Symbol("selectedOptions"),cr=Symbol("styleNode"),Fn=Symbol("updateSheet"),Mr=Symbol("clearCache"),Re=Symbol("onSetAttribute"),dr=Symbol("onRemoveAttribute"),_=Symbol("nodeArray"),dt=Symbol("elementArray"),U=Symbol("cache"),He=Symbol("affectsCache"),Ma=Symbol("forms"),qo=Symbol("affectsComputedStyleCache"),Nl=Symbol("query"),Ll=Symbol("computedStyle"),so=Symbol("getFormControlItems"),Mm=Symbol("getFormControlNamedItem"),Uh=Symbol("dataset"),aE=Symbol("getNamespaceItemKey"),mE=Symbol("getNamedItemKey"),fi=Symbol("itemsByNamespaceURI"),Vt=Symbol("proxy"),$o=Symbol("setNamedItem"),Er=Symbol("getTokenList"),Bs=Symbol("attributeName"),Go=Symbol("selectedIndex"),Dn=Symbol("self"),no=Symbol("parent"),Xo=Symbol("top"),Im=Symbol("areas"),lo=Symbol("defaultValue"),Pi=Symbol("elementIdMap"),Bn=Symbol("clonable"),kl=Symbol("delegatesFocus"),Gi=Symbol("serializable"),Ai=Symbol("slotAssignment"),Ui=Symbol("assignedNodes"),zo=Symbol("assignedToSlot"),Rm=Symbol("cells"),Fm=Symbol("rows"),Hh=Symbol("headers"),Vm=Symbol("tBodies"),Ia=Symbol("track"),Dm=Symbol("controlsList"),Wh=Symbol("mediaKeys"),Sb=Symbol("remote"),_h=Symbol("sinkId"),Yh=Symbol("srcObject"),Ml=Symbol("cues"),fb=Symbol("activeCues"),wo=Symbol("kind"),Os=Symbol("label"),Il=Symbol("language"),Bm=Symbol("id"),h=Symbol("illegalConstructor"),Pb=Symbol("state"),Om=Symbol("canvas"),On=Symbol("popoverTargetElement"),Gm=Symbol("composed"),Gs=Symbol("bubbles"),Hi=Symbol("cancelable"),lr=Symbol("defaultPrevented"),xr=Symbol("eventPhase"),Ab=Symbol("timeStamp"),Qt=Symbol("type"),Um=Symbol("detail"),yE=Symbol("globalObject"),Hm=Symbol("destroyed"),Se=Symbol("aborted"),Wm=Symbol("browserFrames"),Kh=Symbol("windowInternalId"),K=Symbol("getItemList"),Wi=Symbol("requiredExtensions"),_i=Symbol("systemLanguage"),_m=Symbol("transform"),se=Symbol("baseVal"),ne=Symbol("animVal"),Ym=Symbol("pathLength"),pE=Symbol("unitType"),Yi=Symbol("viewBox"),Km=Symbol("markerUnits"),Qm=Symbol("markerWidth"),jm=Symbol("markerHeight"),Je=Symbol("values"),qm=Symbol("orientType"),$m=Symbol("orientAngle"),Xm=Symbol("refX"),zm=Symbol("refY"),j=Symbol("readOnly"),ar=Symbol("preserveAspectRatio"),Ki=Symbol("animatedPoints"),Qi=Symbol("points"),ji=Symbol("rx"),qi=Symbol("ry"),ao=Symbol("cx"),mo=Symbol("cy"),$i=Symbol("r"),Jm=Symbol("clipPathUnits"),Zm=Symbol("maskUnits"),ty=Symbol("maskContentUnits"),ey=Symbol("filterUnits"),ry=Symbol("primitiveUnits"),Lt=Symbol("href"),Xi=Symbol("x1"),zi=Symbol("y1"),Ji=Symbol("x2"),Zi=Symbol("y2"),oy=Symbol("gradientUnits"),iy=Symbol("gradientTransform"),sy=Symbol("spreadMethod"),ny=Symbol("patternUnits"),ly=Symbol("patternContentUnits"),ay=Symbol("patternTransform"),my=Symbol("fx"),yy=Symbol("fy"),ts=Symbol("offset"),Gn=Symbol("disabled"),py=Symbol("textLength"),uy=Symbol("lengthAdjust"),v=Symbol("getAttribute"),A=Symbol("setAttribute"),Ir=Symbol("z"),Rl=Symbol("w"),hy=Symbol("toArray"),Fl=Symbol("fromString"),Eo=Symbol("fromArray"),uE=Symbol("angle"),kt=Symbol("m11"),Dt=Symbol("m12"),zt=Symbol("m13"),Jt=Symbol("m14"),Mt=Symbol("m21"),Bt=Symbol("m22"),Zt=Symbol("m23"),te=Symbol("m24"),Ht=Symbol("m31"),jt=Symbol("m32"),qt=Symbol("m33"),Wt=Symbol("m34"),It=Symbol("m41"),Ot=Symbol("m42"),$t=Symbol("m43"),Xt=Symbol("m44"),Ra=Symbol("setMatrixValue"),xo=Symbol("translateSelf"),Us=Symbol("rotateSelf"),Hs=Symbol("rotateAxisAngleSelf"),es=Symbol("scaleSelf"),cy=Symbol("scale3dSelf"),dy=Symbol("scaleNonUniformSelf"),Vl=Symbol("skewXSelf"),Dl=Symbol("skewYSelf"),vo=Symbol("multiplySelf"),Ws=Symbol("matrix"),hE=Symbol("domMatrix"),Ne=Symbol("getDOMMatrix"),br=Symbol("setDOMMatrix"),I=Symbol("attributeValue"),by=Symbol("startOffset"),_s=Symbol("method"),gy=Symbol("spacing"),at=Symbol("in1"),yo=Symbol("in2"),Z=Symbol("result"),Sy=Symbol("bias"),fy=Symbol("divisor"),rs=Symbol("edgeMode"),Py=Symbol("kernelMatrix"),po=Symbol("kernelUnitLengthX"),uo=Symbol("kernelUnitLengthY"),Ay=Symbol("orderX"),wy=Symbol("orderY"),Ey=Symbol("preserveAlpha"),xy=Symbol("targetX"),vy=Symbol("targetY"),Ty=Symbol("diffuseConstant"),os=Symbol("surfaceScale"),Cy=Symbol("scale"),Ny=Symbol("xChannelSelector"),Ly=Symbol("yChannelSelector"),ky=Symbol("azimuth"),My=Symbol("elevation"),ho=Symbol("dx"),co=Symbol("dy"),is=Symbol("stdDeviationX"),ss=Symbol("stdDeviationY"),Iy=Symbol("tableValues"),Ry=Symbol("slope"),Fy=Symbol("intercept"),Vy=Symbol("amplitude"),Dy=Symbol("exponent"),Og=Symbol("crossOrigin"),By=Symbol("operator"),Oy=Symbol("radiusX"),Gy=Symbol("radiusY"),Uy=Symbol("specularConstant"),ns=Symbol("specularExponent"),Hy=Symbol("pointsAtX"),Wy=Symbol("pointsAtY"),_y=Symbol("pointsAtZ"),Yy=Symbol("limitingConeAngle"),Ky=Symbol("baseFrequencyX"),Qy=Symbol("baseFrequencyY"),jy=Symbol("numOctaves"),qy=Symbol("seed"),$y=Symbol("stitchTiles"),Xy=Symbol("rotateFromVectorSelf"),zy=Symbol("flipXSelf"),Jy=Symbol("flipYSelf"),Zy=Symbol("invertSelf"),wb=Symbol("getLength"),Qh=Symbol("currentScale"),tp=Symbol("rotate"),Eb=Symbol("bindMethods"),Un=Symbol("xmlProcessingInstruction"),cE=Symbol("root"),Uo=Symbol("filterNode"),Ys=Symbol("customElementReactionStack"),Hn=Symbol("dispatching"),ls=Symbol("modules"),Rr=Symbol("preloads"),Ks=Symbol("body"),jh=Symbol("redirect"),Fa=Symbol("referrerPolicy"),qh=Symbol("signal"),wi=Symbol("bodyUsed"),$h=Symbol("credentials"),ep=Symbol("blocking"),Bl=Symbol("moduleImportMap"),le=Symbol("dispatchError"),Xh=Symbol("supports"),To=Symbol("reason"),p=Symbol("propertyEventListeners"),We=Symbol("cssRules"),Qs=Symbol("parentRule"),Co=Symbol("parentStyleSheet"),bo=Symbol("conditionText"),as=Symbol("keyText"),xb=Symbol("media"),rp=Symbol("styleMap"),Ol=Symbol("selectorText"),Gl=Symbol("cssParser"),js=Symbol("cssRule"),Fr=Symbol("rulePrefix"),_r=Symbol("virtualServerFile"),vb=Symbol("frames"),qs=Symbol("disableEvaluation"),Tb=Symbol("validateJavaScriptExecutionEnvironment"),dE=Symbol("currentNode"),Wn=Symbol("openWebSockets"),vr=Symbol("webSocket"),Va=Symbol("moduleCache");var Cb;(function(t){t.strict="Strict",t.lax="Lax",t.none="None"})(Cb||(Cb={}));var $s=Cb;var zh={key:null,originURL:null,value:null,domain:"",path:"",expires:null,httpOnly:!1,secure:!1,sameSite:$s.lax};class op{static hasExpired(t){return t.expires&&t.expires.getTime()<Date.now()}}class Jh{static cookieMatchesURL(t,e){let o=e.hostname==="localhost"||e.hostname?.endsWith(".localhost");return(!t.secure||e.protocol==="https:"||o)&&(!t.domain||e.hostname?.endsWith(t.domain))&&(!t.path||e.pathname?.startsWith(t.path))&&(t.sameSite===$s.none&&t.secure||t.originURL?.hostname===e.hostname)}}class ip{#t=[];addCookies(t){let e=new Map,o=(i)=>`${i.key}-${i.originURL.hostname}-${i.path}-${typeof i.value}`;for(let i=0,s=this.#t.length;i<s;i++)e.set(o(this.#t[i]),i);for(let i of t){let s=Object.assign({},zh,i);if(s&&s.key&&s.originURL){let n=e.get(o(s));if(n!==void 0)this.#t.splice(n,1);if(!op.hasExpired(s))e.set(o(s),this.#t.length),this.#t.push(s)}}}getCookies(t=null,e=!1){let o=[];for(let i of this.#t)if(!op.hasExpired(i)&&(!e||!i.httpOnly)&&(!t||Jh.cookieMatchesURL(i,t)))o.push(i);return o}clearCookies(){this.#t=[]}}var Nb;(function(t){t.fresh="fresh",t.stale="stale"})(Nb||(Nb={}));var _n=Nb;var Lb;(function(t){t.invalidStateError="InvalidStateError",t.indexSizeError="IndexSizeError",t.syntaxError="SyntaxError",t.hierarchyRequestError="HierarchyRequestError",t.notSupportedError="NotSupportedError",t.wrongDocumentError="WrongDocumentError",t.invalidNodeTypeError="InvalidNodeTypeError",t.invalidCharacterError="InvalidCharacterError",t.notFoundError="NotFoundError",t.securityError="SecurityError",t.networkError="NetworkError",t.domException="DOMException",t.invalidAccessError="InvalidAccessError",t.unknownError="UnknownError",t.abortError="AbortError",t.timeoutError="TimeoutError",t.encodingError="EncodingError",t.uriMismatchError="URIMismatchError",t.inUseAttributeError="InUseAttributeError",t.namespaceError="NamespaceError"})(Lb||(Lb={}));var w=Lb;class re extends Error{constructor(t,e=null){super(t);this.name=e||w.domException}}class Ei{[Xe]={};constructor(t){if(t)if(t instanceof Ei)this[Xe]=JSON.parse(JSON.stringify(t[Xe]));else if(Array.isArray(t))for(let e of t){if(e.length!==2)throw new re('Failed to construct "Headers": The provided init is not a valid array.',w.invalidStateError);this.append(e[0],e[1])}else for(let e of Object.keys(t))this.set(e,t[e])}append(t,e){let o=t.toLowerCase();if(this[Xe][o])this[Xe][o].value.push(e);else this[Xe][o]={name:t,value:[e]}}delete(t){delete this[Xe][t.toLowerCase()]}get(t){return this[Xe][t.toLowerCase()]?.value.join(", ")??null}set(t,e){this[Xe][t.toLowerCase()]={name:t,value:[e]}}getSetCookie(){let t=this[Xe]["set-cookie"];if(!t)return[];return t.value}has(t){return!!this[Xe][t.toLowerCase()]}forEach(t,e){let o=e??this[m];for(let i of Object.values(this[Xe]))t.call(o,i.value.join(", "),i.name,this)}*keys(){for(let t of Object.values(this[Xe]))yield t.name}*values(){for(let t of Object.values(this[Xe]))yield t.value.join(", ")}*entries(){for(let t of Object.values(this[Xe]))yield[t.name,t.value.join(", ")]}*[Symbol.iterator](){for(let t of Object.values(this[Xe]))yield[t.name,t.value.join(", ")]}}import Da from"fs";import Ba from"path";import uf from"crypto";class Zh{#t=new Set;#e=new Set;#r;constructor(t){this.#r=t}async load(t){if(!t)throw Error("Failed to execute 'load' on 'ResponseCacheFileSystem': Directory is not specified.");let e=Ba.resolve(t),o=[];try{o=await Da.promises.readdir(e)}catch(n){return}let i=[],s=this.#r;for(let n of o)if(n.endsWith(".json"))i.push(Da.promises.readFile(Ba.join(e,n),"utf8").then((l)=>{let y=JSON.parse(l);if(y.response&&y.request&&!y.virtual)return y.response.headers=new Ei(y.response.headers),y.request.headers=new Ei(y.request.headers),Da.promises.readFile(Ba.join(e,n.split(".")[0]+".data")).then((u)=>{y.response.body=u;let c=s.get(y.response.url);if(!c)c=[],s.set(y.response.url,c);c.push(y)}).catch(()=>{let u=s.get(y.response.url);if(!u)u=[],s.set(y.response.url,u);u.push(y)})}).catch(()=>{}));await Promise.all(i)}async save(t){if(!t)throw Error("Failed to execute 'store' on 'ResponseCacheFileSystem': Directory is not specified.");if(!this.#r.size)return;let e=Ba.resolve(t);if(!this.#t.has(e)){this.#t.add(e);try{await Da.promises.mkdir(e,{recursive:!0})}catch(n){}}let i=this.#r,s=[];for(let n of i.values())for(let l of n)if(!l.virtual){let y={},u={};for(let[f,E]of l.response.headers.entries())y[f]=E;for(let[f,E]of l.request.headers.entries())u[f]=E;let c={...l,response:{...l.response,headers:y,body:null},request:{...l.request,headers:u}},d=JSON.stringify(c,null,3),g=uf.createHash("md5").update(d).digest("hex");if(!this.#e.has(g)){if(this.#e.add(g),s.push(Da.promises.writeFile(Ba.join(e,`${g}.json`),d)),l.response.body)s.push(Da.promises.writeFile(Ba.join(e,`${g}.data`),l.response.body))}}await Promise.all(s)}}var hf=["Cache-Control","Last-Modified","Vary","ETag"];class sp{fileSystem;#t=new Map;constructor(){this.fileSystem=new Zh(this.#t)}get(t){if(t.headers.get("Cache-Control")?.includes("no-cache"))return null;let e=t.url,o=this.#t.get(e);if(o)for(let i=0,s=o.length;i<s;i++){let n=o[i],l=n.request.method===t.method;if(l)for(let y of Object.keys(n.vary)){let u=t.headers.get(y);if(u!==null&&n.vary[y]!==u){l=!1;break}}if(l){if(n.expires&&n.expires<Date.now()){if(n.lastModified)n.state=_n.stale;else if(!n.etag)return o.splice(i,1),null}return n}}return null}add(t,e){if(t.method!=="GET"&&t.method!=="HEAD"||t.headers.get("Cache-Control")?.includes("no-cache"))return null;let o=t.url,i=this.get(t);if(e.status===304){if(!i)throw Error("ResponseCache: Cached response not found.");for(let s of hf)if(e.headers.has(s))i.response.headers.set(s,e.headers.get(s));i.cacheUpdateTime=Date.now(),i.state=_n.fresh}else{if(i){let n=this.#t.get(o);if(n){let l=n.indexOf(i);if(l!==-1)n.splice(l,1)}}i={response:{status:e.status,statusText:e.statusText,url:e.url,headers:new Ei(e.headers),waitingForBody:e.waitingForBody,body:e.body??null},request:{headers:t.headers,method:t.method},vary:{},expires:null,etag:null,cacheUpdateTime:Date.now(),lastModified:null,mustRevalidate:!1,staleWhileRevalidate:!1,state:_n.fresh,virtual:e.virtual??!1};let s=this.#t.get(o);if(!s)s=[],this.#t.set(o,s);s.push(i)}if(e.headers.has("Cache-Control")){let s=e.headers.get("Age");for(let n of e.headers.get("Cache-Control").split(",")){let[l,y]=n.trim().split("=");switch(l){case"max-age":i.expires=Date.now()+parseFloat(y)*1000-(s?parseFloat(s)*1000:0);break;case"no-cache":case"no-store":let u=this.#t.get(o);if(u){let c=u.indexOf(i);if(c!==-1)u.splice(c,1)}return null;case"must-revalidate":i.mustRevalidate=!0;break;case"stale-while-revalidate":i.staleWhileRevalidate=!0;break}}}if(e.headers.has("Last-Modified"))i.lastModified=Date.parse(e.headers.get("Last-Modified"));if(e.headers.has("Vary"))for(let s of e.headers.get("Vary").split(",")){let n=s.trim(),l=t.headers.get(n);if(l)i.vary[n]=l}if(e.headers.has("ETag"))i.etag=e.headers.get("ETag");if(!i.expires){let s=e.headers.get("Expires");if(s)i.expires=Date.parse(s)}if(!i.etag&&(!i.expires||i.expires<Date.now())){let s=this.#t.get(o);if(s){let n=s.indexOf(i);if(n!==-1)s.splice(n,1)}return null}return i}clear(t){if(t){if(t.toTime)for(let e of t.url?[t.url]:this.#t.keys()){let o=this.#t.get(e);if(o){for(let i=0,s=o.length;i<s;i++)if(o[i].cacheUpdateTime<t.toTime)o.splice(i,1),i--,s--}}else if(t.url)this.#t.delete(t.url)}else this.#t.clear()}}var kb;(function(t){t[t.log=0]="log",t[t.info=1]="info",t[t.warn=2]="warn",t[t.error=3]="error"})(kb||(kb={}));var mr=kb;var Mb;(function(t){t[t.elementNode=1]="elementNode",t[t.attributeNode=2]="attributeNode",t[t.textNode=3]="textNode",t[t.cdataSectionNode=4]="cdataSectionNode",t[t.commentNode=8]="commentNode",t[t.documentNode=9]="documentNode",t[t.documentTypeNode=10]="documentTypeNode",t[t.documentFragmentNode=11]="documentFragmentNode",t[t.processingInstructionNode=7]="processingInstructionNode"})(Mb||(Mb={}));var T=Mb;var Ib;(function(t){t[t.none=0]="none",t[t.capturing=1]="capturing",t[t.atTarget=2]="atTarget",t[t.bubbling=3]="bubbling"})(Ib||(Ib={}));var ae=Ib;class C{static NONE=ae.none;static CAPTURING_PHASE=ae.capturing;static AT_TARGET=ae.atTarget;static BUBBLING_PHASE=ae.bubbling;NONE=C.NONE;CAPTURING_PHASE=C.CAPTURING_PHASE;AT_TARGET=C.AT_TARGET;BUBBLING_PHASE=C.BUBBLING_PHASE;[Gm]=!1;[Gs]=!1;[Hi]=!1;[lr]=!1;[xr]=ae.none;[Ab]=performance.now();[Qt];[Hn]=!1;[Cs]=!1;[Is]=!1;[wr]=null;[Bo]=null;[wa]=!1;constructor(t,e=null){this[Qt]=t,this[Gs]=e?.bubbles??!1,this[Hi]=e?.cancelable??!1,this[Gm]=e?.composed??!1}get composed(){return this[Gm]}get bubbles(){return this[Gs]}get cancelable(){return this[Hi]}get defaultPrevented(){return this[lr]}get eventPhase(){return this[xr]}get timeStamp(){return this[Ab]}get type(){return this[Qt]}get target(){return this[wr]}get currentTarget(){return this[Bo]}get cancelBubble(){return this[Is]}composedPath(){if(!this[wr])return[];let t=[],e=this[wr];while(e)if(t.push(e),e.parentNode)e=e.parentNode;else if(this[Gm]&&e[D]===T.documentFragmentNode&&e.host)e=e.host;else if(e[D]===T.documentNode&&this[Qt]!=="load")e=e[m];else break;return t}initEvent(t,e=!1,o=!1){this[Qt]=t,this[Gs]=e,this[Hi]=o,this[Is]=!1,this[Cs]=!1,this[lr]=!1}preventDefault(){if(!this[wa]&&this.cancelable)this[lr]=!0}stopImmediatePropagation(){this[Cs]=!0}stopPropagation(){this[Is]=!0}}var Rb;(function(t){t.log="log",t.table="table",t.trace="trace",t.dir="dir",t.dirxml="dirxml",t.group="group",t.groupCollapsed="groupCollapsed",t.debug="debug",t.timeLog="timeLog",t.info="info",t.count="count",t.timeEnd="timeEnd",t.warn="warn",t.countReset="countReset",t.error="error",t.assert="assert"})(Rb||(Rb={}));var Fe=Rb;class tc{static toString(t){if(this.isLogEntryCollapsed(t))return"";let e=this.getLogEntryGroupTabbing(t),o=e;for(let i of t.message)if(o+=o!==""&&o!==e?" ":"",typeof i==="object"&&(i===null||i.constructor.name==="Object"||Array.isArray(i)))try{o+=JSON.stringify(i)}catch(s){o+=Error("Failed to JSON stringify object in log entry.").stack.replace(/\n at/gm,`
|
|
4
4
|
`+e+"at")}else if(typeof i==="object"&&i.message&&i.stack)o+=i.stack.replace(/\n at/gm,`
|
|
5
5
|
`+e+"at");else o+=this.getLogEntryIcon(t)+String(i);return o+`
|
|
@@ -222,5 +222,5 @@ It is recommended to disable code generation and freeze all builtins at process
|
|
|
222
222
|
For more information, see https://github.com/capricorn86/happy-dom/wiki/JavaScript-Evaluation-Warning
|
|
223
223
|
|
|
224
224
|
`)}[At](){if(this.closed)return;super[At](),this.closed=!0;let t=this[Nn];for(let s of t)if(s[At])s[At]();this[Nn]=[];for(let s of this[Wn])s[At]();this[Wn]=[],this.document[At]();let e=this.document.createElement("html"),o=this.document.createElement("head"),i=this.document.createElement("body");if(e.appendChild(o),e.appendChild(i),this.document[Et](e),this.location[At])this.location[At]();if(this.customElements[At])this.customElements[At]();if(this.history[At])this.history[At]();this[ls].json.clear(),this[ls].css.clear(),this[ls].esm.clear(),this.document[Rr].clear(),this.document[Me]=null,this.document[Ms]=null,this.document[Do]=null,this.document[Tn]=null,this[no]=null,this[Xo]=null,it.removeWindowBrowserFrameRelation(this)}[Eb](){for(let t of[El,vt]){let e=Object.getOwnPropertyDescriptors(t.prototype),o=Object.keys(e);for(let i of o){let s=e[i];if(s.get||s.set)Object.defineProperty(this,i,{...s,get:s.get?.bind(this),set:s.set?.bind(this)});else if(i!=="constructor"&&typeof s.value==="function"&&!s.value.toString().startsWith("class "))Object.defineProperty(this,i,{...s,value:s.value.bind(this)})}}}}import{Script as xw}from"vm";class Pm{static evaluate(t,e){if(!t.window)throw Error('The frame has been destroyed, the "window" property is not set.');return e=typeof e==="string"?new xw(e):e,e.runInContext(t.window)}static async evaluateModule(t,e){if(!t.window)throw Error('The frame has been destroyed, the "window" property is not set.');let o=t.window;if(e?.code){let i=e.url?new URL(e.url,o.location.href):o.location,s=e.code;switch(e?.type||"esm"){case"esm":let n=new Yo(o,i);return await new pn({window:o,url:i,source:s,factory:n}).evaluate();case"json":return await new mm({window:o,url:i,source:s}).evaluate();case"css":return await new am({window:o,url:i,source:s}).evaluate()}}if(e?.url)return await(await new Yo(o,o.location).getModule(e.url,{with:{type:e.type||"esm"}})).evaluate();return{}}}class dh{currentItem={title:"",href:"about:blank",state:null,popState:!1,scrollRestoration:ri.auto,method:"GET",formData:null};items=[this.currentItem];push(t){let e=this.items.indexOf(this.currentItem);if(e!==this.items.length-1)this.items.length=e+1;this.items.push(t),this.currentItem=t}replace(t){let e=this.items.indexOf(this.currentItem);if(e!==this.items.length-1)this.items.length=e+1;if(e===-1)throw Error("Current history item not found");this.currentItem=t,this.items[e]=t}clear(){this.items.length=0,this.currentItem={title:"",href:"about:blank",state:null,popState:!1,scrollRestoration:ri.auto,method:"GET",formData:null},this.items.push(this.currentItem)}}class Am{#t;#e={};#r={};#o=0;#i=[];constructor(t){this.#t=t}assert(t,e,...o){if(!t)this.#t.print({type:Fe.assert,level:mr.error,message:["Assertion failed:",...e?[e,...o]:o],group:this.#i[this.#i.length-1]||null})}clear(){this.#t.clear()}count(t="default"){if(!this.#e[t])this.#e[t]=0;this.#e[t]++,this.#t.print({type:Fe.count,level:mr.info,message:[`${t}: ${this.#e[t]}`],group:this.#i[this.#i.length-1]||null})}countReset(t="default"){delete this.#e[t],this.#t.print({type:Fe.countReset,level:mr.warn,message:[`${t}: 0`],group:this.#i[this.#i.length-1]||null})}debug(t,...e){this.#t.print({type:Fe.debug,level:mr.log,message:t?[t,...e]:e,group:this.#i[this.#i.length-1]||null})}dir(t){this.#t.print({type:Fe.dir,level:mr.log,message:[t],group:this.#i[this.#i.length-1]||null})}dirxml(t){this.#t.print({type:Fe.dirxml,level:mr.log,message:[t],group:this.#i[this.#i.length-1]||null})}error(t,...e){this.#t.print({type:Fe.error,level:mr.error,message:t?[t,...e]:e,group:this.#i[this.#i.length-1]||null})}exception(...t){this.error(...t)}group(t){this.#o++;let e={id:this.#o,label:t||"default",collapsed:!1,parent:this.#i[this.#i.length-1]||null};this.#i.push(e),this.#t.print({type:Fe.group,level:mr.log,message:[t||"default"],group:e})}groupCollapsed(t){this.#o++;let e={id:this.#o,label:t||"default",collapsed:!0,parent:this.#i[this.#i.length-1]||null};this.#i.push(e),this.#t.print({type:Fe.groupCollapsed,level:mr.log,message:[t||"default"],group:e})}groupEnd(){if(this.#i.length===0)return;this.#i.pop()}info(t,...e){this.#t.print({type:Fe.info,level:mr.info,message:t?[t,...e]:e,group:this.#i[this.#i.length-1]||null})}log(t,...e){this.#t.print({type:Fe.log,level:mr.log,message:t?[t,...e]:e,group:this.#i[this.#i.length-1]||null})}profile(){throw Error("Method not implemented.")}profileEnd(){throw Error("Method not implemented.")}table(t){this.#t.print({type:Fe.table,level:mr.log,message:[t],group:this.#i[this.#i.length-1]||null})}time(t="default"){this.#r[t]=performance.now()}timeEnd(t="default"){let e=this.#r[t];if(e){let o=performance.now()-e;this.#t.print({type:Fe.timeEnd,level:mr.info,message:[`${t}: ${o}ms - timer ended`],group:this.#i[this.#i.length-1]||null})}}timeLog(t="default",...e){let o=this.#r[t];if(o){let i=performance.now()-o;this.#t.print({type:Fe.timeLog,level:mr.info,message:[`${t}: ${i}ms`,...e],group:this.#i[this.#i.length-1]||null})}}timeStamp(){throw Error("Method not implemented.")}trace(t,...e){this.#t.print({type:Fe.trace,level:mr.log,message:[...t?[t,...e]:e,Error("stack").stack.replace("Error: stack","")],group:this.#i[this.#i.length-1]||null})}warn(t,...e){this.#t.print({type:Fe.warn,level:mr.warn,message:t?[t,...e]:e,group:this.#i[this.#i.length-1]||null})}}class wm{static getFrames(t){return this.findFrames(t.mainFrame)}static closePage(t){if(t.closed)return Promise.resolve();t.closed=!0;let e=t.context.pages.indexOf(t);if(e!==-1)t.context.pages.splice(e,1);return t.virtualConsolePrinter.close(),fs.destroyFrame(t.mainFrame)}static findFrames(t){let e=[t];for(let o of t.childFrames)e=e.concat(this.findFrames(o));return e}}class bh{#t=new Map;get(t){let e=this.#t.get(t.url);if(e){if(e.expires<Date.now())return this.#t.delete(t.url),null;return e}return null}add(t,e){if(this.#t.delete(t.url),t.headers.get("Cache-Control")?.includes("no-cache"))return null;if(e.status<200||e.status>=300)return null;let o=e.headers.get("Access-Control-Max-Age"),i=e.headers.get("Access-Control-Allow-Origin");if(!o||!i)return null;let s=[];if(e.headers.has("Access-Control-Allow-Methods")){if(e.headers.get("Access-Control-Allow-Methods")!=="*")for(let y of e.headers.get("Access-Control-Allow-Methods").split(","))s.push(y.trim().toUpperCase())}let n={allowOrigin:i,allowMethods:s,expires:Date.now()+parseInt(o)*1000};if(isNaN(n.expires)||n.expires<Date.now())return null;return this.#t.set(t.url,n),n}clear(){this.#t.clear()}}var BS={version:"20.9.0"};var Fi={disableJavaScriptEvaluation:!1,enableJavaScriptEvaluation:!1,disableJavaScriptFileLoading:!1,disableCSSFileLoading:!1,disableIframePageLoading:!1,disableComputedStyleRendering:!1,handleDisabledFileLoadingAsSuccess:!1,disableErrorCapturing:!1,errorCapture:me.tryAndCatch,enableFileSystemHttpRequests:!1,suppressCodeGenerationFromStringsWarning:!1,suppressInsecureJavaScriptEnvironmentWarning:!1,timer:{maxTimeout:-1,maxIntervalTime:-1,maxIntervalIterations:-1,preventTimerLoops:!1},fetch:{disableSameOriginPolicy:!1,disableStrictSSL:!1,interceptor:null,requestHeaders:null,virtualServers:null},module:{resolveNodeModules:null,urlResolver:null,disableCache:!1},navigation:{disableMainFrameNavigation:!1,disableChildFrameNavigation:!1,disableChildPageNavigation:!1,disableFallbackToSetURL:!1,crossOriginPolicy:im.anyOrigin,beforeContentCallback:null},navigator:{userAgent:`Mozilla/5.0 (X11; ${process.platform.charAt(0).toUpperCase()+process.platform.slice(1)+" "+process.arch}) AppleWebKit/537.36 (KHTML, like Gecko) HappyDOM/${BS.version}`,maxTouchPoints:0},device:{prefersColorScheme:"light",prefersReducedMotion:"no-preference",mediaType:"screen",forcedColors:"none"},debug:{traceWaitUntilComplete:-1},viewport:{width:1024,height:768,devicePixelRatio:1}};class gh{static createSettings(t){if(t)this.validate(Fi,t);return{...Fi,...t,navigation:{...Fi.navigation,...t?.navigation},navigator:{...Fi.navigator,...t?.navigator},timer:{...Fi.timer,...t?.timer},fetch:{...Fi.fetch,...t?.fetch},module:{...Fi.module,...t?.module},device:{...Fi.device,...t?.device},debug:{...Fi.debug,...t?.debug},viewport:{...Fi.viewport,...t?.viewport}}}static validate(t,e,o){for(let i of Object.keys(e)){if(t[i]===void 0){let s=o?o+"."+i:i;throw Error(`Unknown browser setting "${s}"`)}if(typeof t[i]==="object"&&!Array.isArray(t[i])&&t[i]!==null){let s=o?o+"."+i:i;if(typeof e[i]!=="object"||Array.isArray(e[i])||e[i]===null)throw Error(`Browser setting "${s}" cannot be null`);this.validate(t[i],e[i],s)}else if((typeof t[i]==="boolean"||typeof t[i]==="number"||typeof t[i]==="string")&&typeof e[i]!==typeof t[i]){if(!(i==="preventTimerLoops"&&typeof e[i]==="object"&&e[i]!==null)){let n=o?o+"."+i:i;throw Error(`Browser setting "${n}" must be of type "${typeof t[i]}"`)}}}}}class Sh{static listenerCount=0;observedWindows=[];uncaughtExceptionListener=null;uncaughtRejectionListener=null;observe(t){if(this.observedWindows.includes(t))throw Error("Browser window is already being observed.");if(this.observedWindows.push(t),this.uncaughtExceptionListener)return;this.uncaughtExceptionListener=(e,o)=>{if(o==="unhandledRejection")return;let i=null;for(let s of this.observedWindows)if(e instanceof s.Error||e instanceof s.DOMException){i=s;break}if(i)i.console.error(e),i.dispatchEvent(new i.ErrorEvent("error",{error:e,message:e.message}));else if(process.listenerCount("uncaughtException")===this.constructor.listenerCount)console.error(e),process.exit(1)},this.uncaughtRejectionListener=(e)=>{let o=null;for(let i of this.observedWindows)if(e instanceof i.Error||e instanceof i.DOMException){o=i;break}if(o)o.console.error(e),o.dispatchEvent(new o.ErrorEvent("error",{error:e,message:e.message}));else if(process.listenerCount("unhandledRejection")===this.constructor.listenerCount)console.error(e),process.exit(1)},this.constructor.listenerCount++,process.on("uncaughtException",this.uncaughtExceptionListener),process.on("unhandledRejection",this.uncaughtRejectionListener)}disconnect(t){let e=this.observedWindows.indexOf(t);if(e===-1)return;if(this.observedWindows.splice(e,1),this.observedWindows.length===0&&this.uncaughtExceptionListener){if(this.constructor.listenerCount--,process.off("uncaughtException",this.uncaughtExceptionListener),this.uncaughtRejectionListener)process.off("unhandledRejection",this.uncaughtRejectionListener);this.uncaughtExceptionListener=null,this.uncaughtRejectionListener=null}}}class fh{childFrames=[];parentFrame=null;page;closed=!1;[Pt]=new Xs(this);[he]={navigation:[]};[ro]=null;[bi]=null;[Ln]=!1;[Oe]=new dh;constructor(t){if(this.page=t,t.context.browser.contexts[0]?.pages[0]?.mainFrame){if(this.window=new this.page.context.browser.windowClass(this),t.context.browser[Jr])t.context.browser[Jr].observe(this.window)}}get content(){if(!this.window)throw Error('The frame has been destroyed, the "window" property is not set.');return this.window.document.documentElement.outerHTML}set content(t){if(!this.window)throw Error('The frame has been destroyed, the "window" property is not set.');this.window.document[Ns]=!0,this.window.document[Ls]=!1,this.window.document.open(),this.window.document.write(t)}get url(){if(!this.window)throw Error('The frame has been destroyed, the "window" property is not set.');return this.window.location.href}set url(t){if(!this.window)throw Error('The frame has been destroyed, the "window" property is not set.');this.window[io][Wr](this,Io.getRelativeURL(this,t).href)}get document(){return this.window?.document??null}async waitUntilComplete(){await Promise.all([this[Pt].waitUntilComplete(),...this.childFrames.map((t)=>t.waitUntilComplete())])}waitForNavigation(){return new Promise((t)=>this[he].navigation.push(t))}abort(){if(!this.childFrames.length)return this[Pt].abort();return new Promise((t,e)=>{Promise.all(this.childFrames.map((o)=>o.abort()).concat([this[Pt].abort()])).then(()=>t()).catch(e)})}evaluate(t){return Pm.evaluate(this,t)}evaluateModule(t){return Pm.evaluateModule(this,t)}goto(t,e){return qr.navigate({windowClass:this.page.context.browser.windowClass,frame:this,url:t,goToOptions:e})}goBack(t){return qr.navigateBack({windowClass:this.page.context.browser.windowClass,frame:this,goToOptions:t})}goForward(t){return qr.navigateForward({windowClass:this.page.context.browser.windowClass,frame:this,goToOptions:t})}goSteps(t,e){return qr.navigateSteps({windowClass:this.page.context.browser.windowClass,frame:this,steps:t,goToOptions:e})}reload(t){return qr.reload({windowClass:this.page.context.browser.windowClass,frame:this,goToOptions:t})}}class Em{virtualConsolePrinter=new Oa;mainFrame;context;console;viewport;closed=!1;constructor(t){this.context=t,this.console=t.browser.console??new Am(this.virtualConsolePrinter),this.mainFrame=new fh(this),this.viewport={width:t.browser.settings.viewport.width,height:t.browser.settings.viewport.height,devicePixelRatio:t.browser.settings.viewport.devicePixelRatio}}get frames(){return wm.getFrames(this)}get content(){return this.mainFrame.content}set content(t){this.mainFrame.content=t}get url(){return this.mainFrame.url}set url(t){this.mainFrame.url=t}close(){return new Promise((t,e)=>{let o=this.context;wm.closePage(this).then(()=>{if(o.pages[0]===this)o.browser.close().then(t).catch(e);else t()}).catch(e)})}waitUntilComplete(){return this.mainFrame.waitUntilComplete()}waitForNavigation(){return this.mainFrame.waitForNavigation()}abort(){return this.mainFrame.abort()}evaluate(t){return this.mainFrame.evaluate(t)}evaluateModule(t){return this.mainFrame.evaluateModule(t)}setViewport(t){let e=Object.assign({},this.viewport);if(Object.assign(this.viewport,t),e.width!==this.viewport.width||e.height!==this.viewport.height||e.devicePixelRatio!==this.viewport.devicePixelRatio)this.mainFrame.window.dispatchEvent(new C("resize"))}goto(t,e){return this.mainFrame.goto(t,e)}goBack(t){return this.mainFrame.goBack(t)}goForward(t){return this.mainFrame.goForward(t)}goSteps(t,e){return this.mainFrame.goSteps(t,e)}reload(t){return this.mainFrame.reload(t)}}class Ph{pages;browser;cookieContainer=new ip;responseCache=new sp;preflightResponseCache=new bh;closed=!1;[Va]=new Map;constructor(t){this.browser=t,this.pages=[],this.pages.push(new Em(this))}async close(){if(this.closed)return;if(this.browser.contexts[0]===this)throw Error("Cannot close the default context. Use `browser.close()` to close the browser instead.");this.closed=!0,await Promise.all(this.pages.slice().map((o)=>o.close()));let t=this.browser,e=t.contexts.indexOf(this);if(e!==-1)t.contexts.splice(e,1);this.pages=[],this.cookieContainer.clearCookies(),this.responseCache.clear(),this.preflightResponseCache.clear()}async waitUntilComplete(){await Promise.all(this.pages.map((t)=>t.waitUntilComplete()))}abort(){return new Promise((t,e)=>{if(!this.pages.length){t();return}Promise.all(this.pages.slice().map((o)=>o.abort())).then(()=>t()).catch((o)=>e(o))})}newPage(){let t=new Em(this);return this.pages.push(t),t}}class Ah{contexts;settings;console;windowClass;[Jr]=null;constructor(t,e){if(this.windowClass=t,this.console=e?.console||null,this.settings=gh.createSettings(e?.settings),this.settings.errorCapture===me.processLevel)this[Jr]=new Sh;this.contexts=[],this.contexts.push(new Ph(this))}get closed(){return this.contexts.length===0}get defaultContext(){if(this.contexts.length===0)throw Error("No default context. The browser has been closed.");return this.contexts[0]}async close(){if(this.contexts.length===0)return;let t=this.contexts;this.contexts=[],await Promise.all(t.map((e)=>e.close()))}async waitUntilComplete(){await Promise.all(this.contexts.map((t)=>t.waitUntilComplete()))}abort(){return new Promise((t,e)=>{if(!this.contexts.length){t();return}Promise.all(this.contexts.slice().map((o)=>o.abort())).then(()=>t()).catch((o)=>e(o))})}newIncognitoContext(){throw Error("Not possible to create a new context on a detached browser.")}newPage(){if(this.contexts.length===0)throw Error("No default context. The browser has been closed.");return this.contexts[0].newPage()}}class wh{#t;constructor(t){this.#t=t}get settings(){return this.#t.page.context.browser.settings}get virtualConsolePrinter(){return this.#t.page.virtualConsolePrinter}waitUntilComplete(){return this.#t.waitUntilComplete()}whenAsyncComplete(){return this.waitUntilComplete()}abort(){return this.#t.abort()}cancelAsync(){return this.abort()}close(){return this.#t.page.close()}setURL(t){this.#t.url=t}setViewport(t){this.#t.page.setViewport(t)}setWindowSize(t){this.setViewport({width:t?.width,height:t?.height})}setInnerWidth(t){this.setViewport({width:t})}setInnerHeight(t){this.setViewport({height:t})}}class Eh extends El{happyDOM;constructor(t){let o=new Ah(El,{console:t?.console,settings:t?.settings}).defaultContext.pages[0],i=o.mainFrame;if(t&&(t.width||t.height||t.innerWidth||t.innerHeight))Object.assign(o.viewport,{width:t.width||t.innerWidth||o.viewport.width,height:t.height||t.innerHeight||o.viewport.height});super(i,{url:t?.url});if(i.window=this,i.page.context.browser[Jr])i.page.context.browser[Jr].observe(this);this.happyDOM=new wh(i)}}import{Buffer as Nw}from"buffer";class xh extends Eh{Array=globalThis.Array;ArrayBuffer=globalThis.ArrayBuffer;Boolean=globalThis.Boolean;Buffer=Nw;DataView=globalThis.DataView;Date=globalThis.Date;Error=globalThis.Error;EvalError=globalThis.EvalError;Float32Array=globalThis.Float32Array;Float64Array=globalThis.Float64Array;Function=globalThis.Function;Infinity=globalThis.Infinity;Int16Array=globalThis.Int16Array;Int32Array=globalThis.Int32Array;Int8Array=globalThis.Int8Array;Intl=globalThis.Intl;JSON=globalThis.JSON;Map=globalThis.Map;Math=globalThis.Math;NaN=globalThis.NaN;Number=globalThis.Number;Object=globalThis.Object;Promise=globalThis.Promise;RangeError=globalThis.RangeError;ReferenceError=globalThis.ReferenceError;RegExp=globalThis.RegExp;Set=globalThis.Set;String=globalThis.String;Symbol=globalThis.Symbol;SyntaxError=globalThis.SyntaxError;TypeError=globalThis.TypeError;URIError=globalThis.URIError;Uint16Array=globalThis.Uint16Array;Uint32Array=globalThis.Uint32Array;Uint8Array=globalThis.Uint8Array;Uint8ClampedArray=globalThis.Uint8ClampedArray;WeakMap=globalThis.WeakMap;WeakSet=globalThis.WeakSet;decodeURI=globalThis.decodeURI;decodeURIComponent=globalThis.decodeURIComponent;encodeURI=globalThis.encodeURI;encodeURIComponent=globalThis.encodeURIComponent;eval=globalThis.eval;escape=globalThis.escape;global=globalThis;isFinite=globalThis.isFinite;isNaN=globalThis.isNaN;parseFloat=globalThis.parseFloat;parseInt=globalThis.parseInt;undefined=globalThis.undefined;unescape=globalThis.unescape;[Oo](t,e){if(e?.filename)return this.eval(`${t}
|
|
225
|
-
//# sourceURL=${e.filename}`);return this.eval(t)}[Tm](){}}class Ng{context;active=!0;revision=0;controller;state={pending:!1,error:null};listeners=new Set;update(t){if(t?.text!==this.context?.text||t?.draftKey!==this.context?.draftKey||t?.busy!==this.context?.busy||t?.disabled!==this.context?.disabled)this.revision++;this.context=t}activate(){this.active=!0}dispose(){this.active=!1,this.controller?.abort(),this.controller=void 0,this.state={...this.state,pending:!1}}subscribe=(t)=>(this.listeners.add(t),()=>this.listeners.delete(t));getSnapshot=()=>this.state;publish(t,e){this.state={pending:t,error:e};for(let o of this.listeners)o()}clearError=()=>this.publish(this.state.pending,null);run=async(t)=>{if(!this.active||this.controller)return;let e=this.context;if(!e||e.busy||e.disabled){this.publish(!1,"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C");return}let o=this.revision,i=new AbortController;this.controller=i,this.publish(!0,null);try{let s=await t(e.text,i.signal);if(!this.active||i.signal.aborted)return;if(o!==this.revision){this.publish(!0,this.context?.busy||this.context?.disabled?"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C":"\u8349\u7A3F\u5DF2\u66F4\u6539\uFF0C\u672A\u8986\u76D6\u5F53\u524D\u5185\u5BB9");return}e.setText((n)=>{if(!this.active||i.signal.aborted||o!==this.revision||n!==e.text)return queueMicrotask(()=>{if(this.active&&!i.signal.aborted)this.publish(this.state.pending,this.context?.busy||this.context?.disabled?"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C":"\u8349\u7A3F\u5DF2\u66F4\u6539\uFF0C\u672A\u8986\u76D6\u5F53\u524D\u5185\u5BB9")}),n;return s})}catch(s){if(this.active&&!i.signal.aborted)this.publish(!0,s instanceof Error?s.message:String(s))}finally{if(this.controller===i){if(this.controller=void 0,this.active)this.publish(!1,this.state.error)}}}}var qd=Vn(null);function OS(){let t=Kn(qd);if(!t)throw Error("Plugin Web UI provider is missing");return t}function Lw(t){let e=Xn(null);if(!e.current)e.current=new Ng;let o=e.current;return o.update(t.context),Qn(()=>(o.activate(),()=>o.dispose()),[o]),{...Jn(o.subscribe,o.getSnapshot,o.getSnapshot),run:o.run,clearError:o.clearError}}function kw({pending:t,disabled:e,...o}){let{Button:i}=OS();return M(i,{...o,type:"button",size:"sm",variant:"ghost",disabled:e||t,loading:t,"aria-busy":t||void 0})}var Mw=Symbol.for("react.fragment");var GS=Mw,US=void 0;var Iw=Symbol.for("react.transitional.element"),Rw=Symbol.for("react.fragment");function HS(t,e,o){var i=null;if(o!==void 0&&(i=""+o),e.key!==void 0&&(i=""+e.key),"key"in e){o={};for(var s in e)s!=="key"&&(o[s]=e[s])}else o=e;return e=o.ref,{$$typeof:Iw,type:t,key:i,ref:e!==void 0?e:null,props:o}}var WS=Rw,_S=HS,YS=HS;var Fw={sans:'ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif',serif:'ui-serif, Georgia, "PingFang SC", "Microsoft YaHei", serif',mono:'ui-monospace, "SF Mono", Menlo, Consolas, monospace'},Vw={bg:"oklch(0.984 0.002 95)",sidebar:"oklch(0.966 0.003 95)",panel:"oklch(1 0 0)",raised:"oklch(0.94 0.004 95)",bubble:"oklch(0.948 0.004 95)",line:"oklch(0.905 0.005 95)",lineStrong:"oklch(0.84 0.006 95)",ink:"oklch(0.22 0.006 250)",dim:"oklch(0.47 0.008 250)",faint:"oklch(0.63 0.008 250)",accent:"oklch(0.53 0.085 172)",accentStrong:"oklch(0.47 0.085 172)",accentInk:"oklch(0.99 0.01 172)",accentSoft:"oklch(0.53 0.085 172 / 0.11)",danger:"oklch(0.55 0.17 27)",dangerFill:"oklch(0.52 0.17 27)",dangerFillHover:"oklch(0.47 0.17 27)",success:"oklch(0.56 0.11 155)",warning:"oklch(0.7 0.14 70)",overlay:"oklch(0.2 0.01 250 / 0.32)",facet:"oklch(0.32 0.012 240)",facetLit:"oklch(0.46 0.012 240)",facetShade:"oklch(0.27 0.01 240)",hex:{bg:"#f9f9f8",panel:"#ffffff",ink:"#1b1f24",dim:"#5b6068",faint:"#878c94",line:"#e3e2dd",lineStrong:"#cfcdc7"},chartPalette:["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#4a3aa7","#e34948"],chartSequential:["#cde2fb","#86b6ef","#3987e5","#1c5cab","#0d366b"]},Dw={float:"0 1px 2px oklch(0.2 0.01 250 / 0.05), 0 8px 28px -6px oklch(0.2 0.01 250 / 0.14)",composer:"0 1px 2px oklch(0.2 0.01 250 / 0.04), 0 6px 24px -8px oklch(0.2 0.01 250 / 0.1)"},Bw={scheme:"light",colors:Vw,fonts:Fw,shadows:Dw},KS={"surface.panel":"overflow-hidden rounded-xl border border-line bg-panel text-ink","surface.card":"rounded-2xl border border-line bg-panel text-ink","surface.subtle":"rounded-xl border border-line/60 bg-raised/25","surface.interactive":"overflow-hidden rounded-xl border border-line bg-panel/70 transition-colors hover:border-line-strong hover:bg-panel","surface.dock":"relative flex flex-col overflow-hidden rounded-[20px] border border-line bg-panel outline-none","surface.empty":"py-8 text-center text-xs text-faint","surface.emptyDashed":"flex flex-col items-center gap-3 rounded-2xl border border-dashed border-line-strong/70 px-6 py-16 text-center","surface.floating":"z-50 min-w-40 overflow-hidden rounded-xl border border-line bg-panel p-1 text-ink shadow-float outline-none","surface.floatingItem":"relative flex min-h-8 w-full cursor-default items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[13.5px] outline-none select-none","surface.floatingLabel":"px-2 pt-1.5 pb-1 text-xs font-medium text-faint","surface.floatingSeparator":"-mx-1 my-1 h-px bg-line","surface.toolbarFloating":"flex items-center gap-0.5 rounded-lg border border-line/70 bg-panel/85 p-0.5 shadow-xs backdrop-blur-sm","surface.tooltip":"z-50 flex items-center gap-1.5 rounded-md bg-ink px-2 py-1 text-xs font-medium text-bg","surface.dialog":"fixed z-50 flex max-h-[min(92dvh,48rem)] w-full flex-col border border-line bg-panel shadow-float outline-none","surface.overlay":"fixed inset-0 z-40 bg-overlay backdrop-blur-[2px]","toast.item":"pointer-events-auto flex w-full items-start gap-2.5 rounded-xl border border-line bg-panel px-3.5 py-2.5 text-[13.5px] leading-5 text-ink shadow-float outline-none","toast.danger":"border-danger/35","button.base":"relative inline-flex shrink-0 items-center justify-center gap-1.5 font-medium whitespace-nowrap select-none","button.primary":"bg-accent text-accent-ink hover:bg-accent-strong","button.secondary":"border border-line bg-panel text-ink hover:border-line-strong hover:bg-raised/60","button.ghost":"text-dim hover:bg-raised hover:text-ink","button.danger":"bg-danger-fill text-white hover:bg-danger-fill-hover","button.dangerGhost":"text-danger hover:bg-danger/10","button.inverse":"bg-ink text-bg hover:bg-ink/85","control.input":"w-full rounded-[10px] border border-line bg-bg px-3 text-sm text-ink outline-none placeholder:text-faint","control.chipTrigger":"inline-flex h-8 max-w-full min-w-0 items-center gap-1.5 rounded-full border border-line bg-panel px-3 text-xs text-dim shadow-xs select-none","control.fieldTrigger":"inline-flex h-9 w-full min-w-0 items-center gap-2 rounded-[10px] border border-line bg-bg px-3 text-sm text-ink select-none","control.segmented":"relative inline-flex rounded-xl bg-raised p-1","control.segmentedPill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-panel opacity-0 shadow-xs will-change-transform","control.switch":"group/switch relative inline-flex h-5.5 w-9.5 shrink-0 items-center rounded-full p-0.5","control.switchThumb":"block h-4.5 w-4.5 rounded-full bg-white","control.kbd":"inline-flex h-4.5 min-w-4.5 items-center justify-center rounded border border-line bg-raised px-1","control.badge":"inline-flex items-center rounded-md bg-raised px-1.5 py-0.5 text-[10.5px] leading-none font-medium text-faint","control.badgeAccent":"inline-flex shrink-0 items-center rounded-md bg-accent-soft px-1.5 py-0.5 text-[11px] leading-none font-medium text-accent","control.iconCircle":"group relative flex size-7 items-center justify-center rounded-full border border-line bg-raised/40 text-dim","command.inputWrap":"flex shrink-0 items-center gap-2 border-b border-line px-3","command.input":"h-11 min-w-0 flex-1 bg-transparent text-[14px] outline-none placeholder:text-faint","command.group":"text-xs font-medium text-faint","command.row":"relative flex w-full cursor-default gap-3 rounded-lg px-2.5 py-2 text-left outline-none select-none","code.base":"overflow-x-auto font-mono text-[12.5px] leading-[1.65]","code.block":"group/code my-4 font-sans not-italic first:mt-0 last:mb-0","page.container":"mx-auto max-w-3xl px-4 pt-6 pb-16 sm:px-6 sm:pt-10","page.title":"min-w-0 flex-1 font-serif text-[1.75rem] leading-tight tracking-[-0.015em]","page.description":"mb-8 text-sm text-dim","workspace.header":"flex h-12 shrink-0 items-center gap-2 border-b border-line/60 px-3","settings.groupTitle":"text-[13px] font-medium text-dim","settings.groupDesc":"mt-0.5 text-xs text-faint","settings.groupBox":"divide-y divide-line overflow-hidden rounded-2xl border border-line bg-panel","settings.row":"flex flex-wrap items-center justify-between gap-4 p-4","settings.rowTitle":"text-sm font-medium text-ink","settings.rowDesc":"mt-0.5 text-xs leading-5 break-words text-dim","status.base":"inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-1 text-[11px] leading-none font-medium","status.success":"bg-success/10 text-success","status.warning":"bg-warning/10 text-warning","status.danger":"bg-danger/10 text-danger","status.neutral":"bg-raised text-dim","callout.base":"flex items-start gap-2.5 rounded-xl border px-3.5 py-2.5 text-[13.5px] leading-5","callout.info":"border-line bg-raised/40 text-dim","callout.danger":"border-danger/25 bg-danger/6 text-danger","chat.banner":"flex shrink-0 flex-wrap items-center justify-between gap-2 border-b border-line bg-raised/45 px-4 py-2 text-xs text-dim","chat.dockBanner":"flex shrink-0 flex-wrap items-center justify-between gap-2 rounded-[20px] border border-line bg-raised/55 px-4 py-3 text-xs text-dim","chat.userBubble":"rounded-[20px] rounded-br-md bg-bubble px-4 py-2.5 text-[14.5px] leading-[1.6] text-ink break-words whitespace-pre-wrap","chat.attachmentCard":"flex h-8 items-center gap-1.5 rounded-xl border border-line bg-panel px-2.5 text-xs text-dim","chat.prose":"font-serif text-[14.5px] leading-[1.78] tracking-[0.005em] break-words text-ink/84","chat.metaBadge":"inline-flex items-center gap-1 rounded-md border border-line/60 bg-raised/60 px-1.5 py-0.5","chat.stepRow":"group/collapsible -mx-2 flex w-[calc(100%+1rem)] items-center gap-2 rounded-lg px-2 py-1.5","chat.timelineRow":"group/collapsible -mx-2 flex w-[calc(100%+1rem)] items-center gap-2 rounded-lg px-2 py-1","chat.thinkingBody":"mt-1.5 mb-2.5 font-serif text-[13.5px] leading-[1.65] text-dim italic","chat.toolOutput":"max-h-80 overflow-auto px-4 py-3 font-mono text-[12.5px] leading-[1.65] whitespace-pre-wrap break-words","chat.diffAdd":"bg-success/10 text-success","chat.diffRemove":"bg-danger/9 text-danger","chat.foldPill":"group/fold flex cursor-pointer select-none items-center gap-2 rounded-full border border-line/70 bg-panel/90 px-3.5 py-1 text-xs text-faint","chat.scrollBottomBtn":"flex h-8 items-center gap-1.5 rounded-full border border-line bg-panel/95 px-3 text-xs font-medium text-dim shadow-float","search.highlight":"rounded-sm bg-accent-soft px-0.5 font-medium text-ink","search.filterChip":"inline-flex h-6 items-center gap-1 rounded-md border border-line bg-panel px-2 text-xs text-dim","search.filterChipActive":"inline-flex h-6 items-center gap-1 rounded-md border border-accent/35 bg-accent-soft pl-2 pr-1 text-xs font-medium text-accent","composer.box":"group/composer relative min-w-0 rounded-[20px] border border-line bg-panel","composer.input":"relative block min-h-13 w-full resize-none bg-transparent px-4 pt-3.5 pb-1.5 text-[15px] leading-6","composer.attachment":"group/att flex h-9 items-center gap-2 rounded-xl border border-line bg-raised/60 pr-1.5 pl-2.5 text-xs","sidebar.shell":"flex h-full flex-col bg-sidebar","sidebar.drawer":"fixed inset-y-0 left-0 z-0 flex w-[min(86vw,24rem)] flex-col bg-sidebar outline-none","sidebar.rightShell":"flex h-full w-full flex-col border-l border-line bg-sidebar","sidebar.rightDrawer":"fixed inset-y-0 right-0 z-50 flex w-[min(24rem,90vw)] flex-col border-l border-line bg-sidebar shadow-float outline-none","sidebar.navItem":"group flex h-9 w-full items-center gap-2.5 rounded-lg px-2 text-left text-sm select-none","sidebar.sectionTitle":"flex-1 text-xs font-medium text-faint","sidebar.hoverPill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-raised/65 opacity-0","sidebar.activePill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-raised opacity-0","markdown.p":"my-4 first:mt-0 last:mb-0","markdown.strong":"font-semibold text-ink","markdown.a":"font-medium text-accent underline","markdown.fileChip":"inline-flex items-baseline gap-1 rounded-md bg-raised/85 px-[0.42em] py-[0.08em] font-mono","markdown.h1":"mt-6 mb-2.5 text-[1.28em] leading-snug font-semibold text-ink first:mt-0","markdown.h2":"mt-6 mb-2.5 text-[1.16em] leading-snug font-semibold text-ink first:mt-0","markdown.h3":"mt-5.5 mb-2 text-[1.06em] font-semibold text-ink first:mt-0","markdown.h4":"mt-4.5 mb-1.5 font-semibold text-ink first:mt-0","markdown.ul":"mt-1.5 mb-5 list-disc pl-[1.5em] marker:text-faint first:mt-0 last:mb-0","markdown.ol":"mt-1.5 mb-5 list-decimal pl-[1.6em] marker:text-[0.9em] marker:text-faint first:mt-0 last:mb-0","markdown.li":"my-2 pl-1","markdown.blockquote":"my-3.5 border-l-[3px] border-line-strong pl-3.5 text-dim italic","markdown.hr":"my-5 border-line","markdown.inlineCode":"mx-[0.18em] rounded-md bg-raised/85 px-[0.38em] py-[0.12em] font-mono text-[0.84em] text-ink/95 break-words","markdown.details":"my-3.5 overflow-hidden rounded-xl border border-line bg-raised/25 not-italic first:mt-0 last:mb-0","markdown.detailsTrigger":"group/collapsible flex w-full cursor-pointer items-center gap-2 px-3.5 py-2.5 text-left font-sans text-[13.5px] leading-snug font-medium text-ink","markdown.detailsContent":"border-t border-line px-3.5 py-3","markdown.imageButton":"my-3 block cursor-zoom-in overflow-hidden rounded-xl border border-line bg-panel text-left","markdown.tableWrap":"my-4 overflow-x-auto rounded-xl border border-line font-sans not-italic first:mt-0 last:mb-0","markdown.table":"w-full border-collapse text-[13.5px]","markdown.thead":"bg-raised/50","markdown.th":"min-w-24 border-b border-line px-3 py-2 text-left font-semibold","markdown.td":"min-w-24 border-t border-line px-3 py-2 align-top [&_code]:wrap-anywhere"},Ow={themeID:"basalt",preference:"light",resolved:"light",tokens:Bw,recipes:KS};function Gw({loading:t,disabled:e,size:o,variant:i,...s}){return M("button",{type:"button",...s,disabled:e||t,"aria-busy":t||void 0})}var QS={Button:Gw,Panel:({header:t,actions:e,children:o,...i})=>M("div",i,t,e,o),ScrollArea:({as:t="div",viewportClassName:e,viewportRef:o,children:i,...s})=>M(t,s,M("div",{className:e,ref:o},i)),PageLayout:({title:t,description:e,actions:o,children:i,"aria-label":s,className:n})=>M("section",{"aria-label":s,className:n},M("header",null,M("h1",null,t),o,e&&M("p",null,e)),i),StatusChip:({children:t,title:e})=>M("span",{title:e},t),Markdown:({text:t})=>M("div",null,t),CatalogRow:({name:t,selectLabel:e,onSelect:o,meta:i,description:s,aside:n,actions:l,toggle:y,title:u})=>M("div",null,M(o?"button":"div",o?{type:"button","aria-label":e,title:u,onClick:o}:{title:u},t,i,s),n,l,y&&M("button",{type:"button",role:"switch","aria-checked":y.checked,"aria-label":y.label,disabled:y.disabled,onClick:()=>y.onCheckedChange(!y.checked)},y.label)),Form:(t)=>M("form",t),FormError:({children:t})=>M("p",{role:"alert"},t),Switch:({checked:t,onCheckedChange:e,label:o,...i})=>M("button",{...i,type:"button",role:"switch","aria-checked":t,onClick:()=>e(!t)},o),Select:({groups:t,onValueChange:e,placeholder:o,...i})=>M("select",{...i,onChange:(s)=>e(s.currentTarget.value)},o&&M("option",{value:""},o),t.map((s,n)=>M("optgroup",{key:n,label:s.label??""},s.options.map((l)=>M("option",{key:l.value,value:l.value},l.label))))),Input:(t)=>M("input",t),Textarea:(t)=>M("textarea",t),Code:({code:t,lang:e,className:o})=>M("pre",{className:o,"data-lang":e},M("code",null,t)),CopyButton:({text:t,label:e})=>M("button",{type:"button","aria-label":e??"\u590D\u5236",onClick:()=>void globalThis.navigator?.clipboard?.writeText(typeof t==="function"?t():t)}),useColorScheme:()=>"light",useTheme:()=>Ow,style:(t,...e)=>[KS[t]??t,...e].filter(Boolean).join(" "),cn:(...t)=>t.filter(Boolean).join(" ")},jS=new Proxy(QS,{get(t,e){if(Object.hasOwn(t,e))return Reflect.get(t,e);throw Error(`ui_test does not provide UI capability ${String(e)}; use supported native controls for structural tests and a browser for this capability`)}}),Xd={react:yr,"react-dom":tn,"react/jsx-runtime":kg,"react/jsx-dev-runtime":Lg,"@basalt/plugin/web":$d,"@basalt/ui":QS};var qS=Promise.resolve();async function Uw(){let t=qS,e=()=>{};return qS=new Promise((o)=>{e=o}),await t,e}function Hw(t){return{window:t,document:t.document,navigator:t.navigator,HTMLElement:t.HTMLElement,HTMLInputElement:t.HTMLInputElement,HTMLTextAreaElement:t.HTMLTextAreaElement,Node:t.Node,Event:t.Event,MouseEvent:t.MouseEvent,getComputedStyle:t.getComputedStyle.bind(t)}}async function Ww(t,e){let o=await Bun.build({entrypoints:["basalt-ui-entry"],target:"browser",format:"esm",throw:!1,plugins:[{name:"basalt-ui-bridge",setup(s){s.onResolve({filter:/.*/},({path:n})=>{if(n==="basalt-ui-entry")return{path:n,namespace:"test-entry"};if(Object.hasOwn(Xd,n))return{path:n,namespace:"test-bridge"};throw Error(`Unsupported ui_test import: ${n}`)}),s.onLoad({filter:/.*/,namespace:"test-entry"},()=>({contents:t,loader:"js"})),s.onLoad({filter:/.*/,namespace:"test-bridge"},({path:n})=>({loader:"js",contents:Object.keys(Xd[n]??{}).map((l,y)=>{let u=`globalThis[${JSON.stringify(e)}][${JSON.stringify(n)}][${JSON.stringify(l)}]`;return`const e${y}=${u};export {e${y} as ${l}};`}).join(`
|
|
225
|
+
//# sourceURL=${e.filename}`);return this.eval(t)}[Tm](){}}class Ng{context;active=!0;revision=0;controller;state={pending:!1,error:null};listeners=new Set;update(t){if(t?.text!==this.context?.text||t?.draftKey!==this.context?.draftKey||t?.busy!==this.context?.busy||t?.disabled!==this.context?.disabled)this.revision++;this.context=t}activate(){this.active=!0}dispose(){this.active=!1,this.controller?.abort(),this.controller=void 0,this.state={...this.state,pending:!1}}subscribe=(t)=>(this.listeners.add(t),()=>this.listeners.delete(t));getSnapshot=()=>this.state;publish(t,e){this.state={pending:t,error:e};for(let o of this.listeners)o()}clearError=()=>this.publish(this.state.pending,null);run=async(t)=>{if(!this.active||this.controller)return;let e=this.context;if(!e||e.busy||e.disabled){this.publish(!1,"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C");return}let o=this.revision,i=new AbortController;this.controller=i,this.publish(!0,null);try{let s=await t(e.text,i.signal);if(!this.active||i.signal.aborted)return;if(o!==this.revision){this.publish(!0,this.context?.busy||this.context?.disabled?"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C":"\u8349\u7A3F\u5DF2\u66F4\u6539\uFF0C\u672A\u8986\u76D6\u5F53\u524D\u5185\u5BB9");return}e.setText((n)=>{if(!this.active||i.signal.aborted||o!==this.revision||n!==e.text)return queueMicrotask(()=>{if(this.active&&!i.signal.aborted)this.publish(this.state.pending,this.context?.busy||this.context?.disabled?"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C":"\u8349\u7A3F\u5DF2\u66F4\u6539\uFF0C\u672A\u8986\u76D6\u5F53\u524D\u5185\u5BB9")}),n;return s})}catch(s){if(this.active&&!i.signal.aborted)this.publish(!0,s instanceof Error?s.message:String(s))}finally{if(this.controller===i){if(this.controller=void 0,this.active)this.publish(!1,this.state.error)}}}}var qd=Vn(null);function OS(){let t=Kn(qd);if(!t)throw Error("Plugin Web UI provider is missing");return t}function Lw(t){let e=Xn(null);if(!e.current)e.current=new Ng;let o=e.current;return o.update(t.context),Qn(()=>(o.activate(),()=>o.dispose()),[o]),{...Jn(o.subscribe,o.getSnapshot,o.getSnapshot),run:o.run,clearError:o.clearError}}function kw({pending:t,disabled:e,...o}){let{Button:i}=OS();return M(i,{...o,type:"button",size:"sm",variant:"ghost",disabled:e||t,loading:t,"aria-busy":t||void 0})}var Mw=Symbol.for("react.fragment");var GS=Mw,US=void 0;var Iw=Symbol.for("react.transitional.element"),Rw=Symbol.for("react.fragment");function HS(t,e,o){var i=null;if(o!==void 0&&(i=""+o),e.key!==void 0&&(i=""+e.key),"key"in e){o={};for(var s in e)s!=="key"&&(o[s]=e[s])}else o=e;return e=o.ref,{$$typeof:Iw,type:t,key:i,ref:e!==void 0?e:null,props:o}}var WS=Rw,_S=HS,YS=HS;var Fw={sans:'ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif',serif:'ui-serif, Georgia, "PingFang SC", "Microsoft YaHei", serif',mono:'ui-monospace, "SF Mono", Menlo, Consolas, monospace'},Vw={bg:"oklch(0.984 0.002 95)",sidebar:"oklch(0.966 0.003 95)",panel:"oklch(1 0 0)",raised:"oklch(0.94 0.004 95)",bubble:"oklch(0.948 0.004 95)",line:"oklch(0.905 0.005 95)",lineStrong:"oklch(0.84 0.006 95)",ink:"oklch(0.22 0.006 250)",dim:"oklch(0.47 0.008 250)",faint:"oklch(0.63 0.008 250)",accent:"oklch(0.53 0.085 172)",accentStrong:"oklch(0.47 0.085 172)",accentInk:"oklch(0.99 0.01 172)",accentSoft:"oklch(0.53 0.085 172 / 0.11)",danger:"oklch(0.55 0.17 27)",dangerFill:"oklch(0.52 0.17 27)",dangerFillHover:"oklch(0.47 0.17 27)",success:"oklch(0.56 0.11 155)",warning:"oklch(0.7 0.14 70)",overlay:"oklch(0.2 0.01 250 / 0.32)",facet:"oklch(0.32 0.012 240)",facetLit:"oklch(0.46 0.012 240)",facetShade:"oklch(0.27 0.01 240)",hex:{bg:"#f9f9f8",panel:"#ffffff",ink:"#1b1f24",dim:"#5b6068",faint:"#878c94",line:"#e3e2dd",lineStrong:"#cfcdc7"},chartPalette:["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#4a3aa7","#e34948"],chartSequential:["#cde2fb","#86b6ef","#3987e5","#1c5cab","#0d366b"]},Dw={float:"0 1px 2px oklch(0.2 0.01 250 / 0.05), 0 8px 28px -6px oklch(0.2 0.01 250 / 0.14)",composer:"0 1px 2px oklch(0.2 0.01 250 / 0.04), 0 6px 24px -8px oklch(0.2 0.01 250 / 0.1)"},Bw={scheme:"light",colors:Vw,fonts:Fw,shadows:Dw},KS={"surface.panel":"overflow-hidden rounded-xl border border-line bg-panel text-ink","surface.card":"rounded-2xl border border-line bg-panel text-ink","surface.subtle":"rounded-xl border border-line/60 bg-raised/25","surface.interactive":"overflow-hidden rounded-xl border border-line bg-panel/70 transition-colors hover:border-line-strong hover:bg-panel","surface.dock":"relative flex flex-col overflow-hidden rounded-[20px] border border-line bg-panel outline-none","surface.empty":"py-8 text-center text-xs text-faint","surface.emptyDashed":"flex flex-col items-center gap-3 rounded-2xl border border-dashed border-line-strong/70 px-6 py-16 text-center","surface.floating":"z-50 min-w-40 overflow-hidden rounded-xl border border-line bg-panel p-1 text-ink shadow-float outline-none","surface.floatingItem":"relative flex min-h-8 w-full cursor-default items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[13.5px] outline-none select-none","surface.floatingLabel":"px-2 pt-1.5 pb-1 text-xs font-medium text-faint","surface.floatingSeparator":"-mx-1 my-1 h-px bg-line","surface.toolbarFloating":"flex items-center gap-0.5 rounded-lg border border-line/70 bg-panel/85 p-0.5 shadow-xs backdrop-blur-sm","surface.tooltip":"z-50 flex items-center gap-1.5 rounded-md bg-ink px-2 py-1 text-xs font-medium text-bg","surface.dialog":"fixed z-50 flex max-h-[min(92dvh,48rem)] w-full flex-col border border-line bg-panel shadow-float outline-none","surface.overlay":"fixed inset-0 z-40 bg-overlay backdrop-blur-[2px]","toast.item":"pointer-events-auto flex w-full items-start gap-2.5 rounded-xl border border-line bg-panel px-3.5 py-2.5 text-[13.5px] leading-5 text-ink shadow-float outline-none","toast.danger":"border-danger/35","button.base":"relative inline-flex shrink-0 items-center justify-center gap-1.5 font-medium whitespace-nowrap select-none","button.primary":"bg-accent text-accent-ink hover:bg-accent-strong","button.secondary":"border border-line bg-panel text-ink hover:border-line-strong hover:bg-raised/60","button.ghost":"text-dim hover:bg-raised hover:text-ink","button.danger":"bg-danger-fill text-white hover:bg-danger-fill-hover","button.dangerGhost":"text-danger hover:bg-danger/10","button.inverse":"bg-ink text-bg hover:bg-ink/85","control.input":"w-full rounded-[10px] border border-line bg-bg px-3 text-sm text-ink outline-none placeholder:text-faint","control.chipTrigger":"inline-flex h-8 max-w-full min-w-0 items-center gap-1.5 rounded-full border border-line bg-panel px-3 text-xs text-dim shadow-xs select-none","control.fieldTrigger":"inline-flex h-9 w-full min-w-0 items-center gap-2 rounded-[10px] border border-line bg-bg px-3 text-sm text-ink select-none","control.segmented":"relative inline-flex rounded-xl bg-raised p-1","control.segmentedPill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-panel opacity-0 shadow-xs will-change-transform","control.switch":"group/switch relative inline-flex h-5.5 w-9.5 shrink-0 items-center rounded-full p-0.5","control.switchThumb":"block h-4.5 w-4.5 rounded-full bg-white","control.kbd":"inline-flex h-4.5 min-w-4.5 items-center justify-center rounded border border-line bg-raised px-1","control.badge":"inline-flex items-center rounded-md bg-raised px-1.5 py-0.5 text-[10.5px] leading-none font-medium text-faint","control.badgeAccent":"inline-flex shrink-0 items-center rounded-md bg-accent-soft px-1.5 py-0.5 text-[11px] leading-none font-medium text-accent","control.iconCircle":"group relative flex size-7 items-center justify-center rounded-full border border-line bg-raised/40 text-dim","command.inputWrap":"flex shrink-0 items-center gap-2 border-b border-line px-3","command.input":"h-11 min-w-0 flex-1 bg-transparent text-[14px] outline-none placeholder:text-faint","command.group":"text-xs font-medium text-faint","command.row":"relative flex w-full cursor-default gap-3 rounded-lg px-2.5 py-2 text-left outline-none select-none","code.base":"overflow-x-auto font-mono text-[12.5px] leading-[1.65]","code.block":"group/code my-4 font-sans not-italic first:mt-0 last:mb-0","page.container":"mx-auto max-w-3xl px-4 pt-6 pb-16 sm:px-6 sm:pt-10","page.title":"min-w-0 flex-1 font-serif text-[1.75rem] leading-tight tracking-[-0.015em]","page.description":"mb-8 text-sm text-dim","workspace.header":"flex h-12 shrink-0 items-center gap-2 border-b border-line/60 px-3","settings.groupTitle":"text-[13px] font-medium text-dim","settings.groupDesc":"mt-0.5 text-xs text-faint","settings.groupBox":"divide-y divide-line overflow-hidden rounded-2xl border border-line bg-panel","settings.row":"flex flex-wrap items-center justify-between gap-4 p-4","settings.rowTitle":"text-sm font-medium text-ink","settings.rowDesc":"mt-0.5 text-xs leading-5 break-words text-dim","status.base":"inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-1 text-[11px] leading-none font-medium","status.success":"bg-success/10 text-success","status.warning":"bg-warning/10 text-warning","status.danger":"bg-danger/10 text-danger","status.neutral":"bg-raised text-dim","callout.base":"flex items-start gap-2.5 rounded-xl border px-3.5 py-2.5 text-[13.5px] leading-5","callout.info":"border-line bg-raised/40 text-dim","callout.danger":"border-danger/25 bg-danger/6 text-danger","chat.banner":"flex shrink-0 flex-wrap items-center justify-between gap-2 border-b border-line bg-raised/45 px-4 py-2 text-xs text-dim","chat.dockBanner":"flex shrink-0 flex-wrap items-center justify-between gap-2 rounded-[20px] border border-line bg-raised/55 px-4 py-3 text-xs text-dim","chat.userBubble":"rounded-[20px] rounded-br-md bg-bubble px-4 py-2.5 text-[14.5px] leading-[1.6] text-ink break-words whitespace-pre-wrap","chat.attachmentCard":"flex h-8 items-center gap-1.5 rounded-xl border border-line bg-panel px-2.5 text-xs text-dim","chat.prose":"font-serif text-[14.5px] leading-[1.78] tracking-[0.005em] break-words text-ink/84","chat.metaBadge":"inline-flex items-center gap-1 rounded-md border border-line/60 bg-raised/60 px-1.5 py-0.5","chat.stepRow":"group/collapsible -mx-2 flex w-[calc(100%+1rem)] items-center gap-2 rounded-lg px-2 py-1.5","chat.timelineRow":"group/collapsible -mx-2 flex w-[calc(100%+1rem)] items-center gap-2 rounded-lg px-2 py-1","chat.thinkingBody":"mt-1.5 mb-2.5 font-serif text-[13.5px] leading-[1.65] text-dim italic","chat.toolOutput":"max-h-80 overflow-auto px-4 py-3 font-mono text-[12.5px] leading-[1.65] whitespace-pre-wrap break-words","chat.diffAdd":"bg-success/10 text-success","chat.diffRemove":"bg-danger/9 text-danger","chat.foldPill":"group/fold flex cursor-pointer select-none items-center gap-2 rounded-full border border-line/70 bg-panel/90 px-3.5 py-1 text-xs text-faint","chat.scrollBottomBtn":"flex h-8 items-center gap-1.5 rounded-full border border-line bg-panel/95 px-3 text-xs font-medium text-dim shadow-float","search.highlight":"rounded-sm bg-accent-soft px-0.5 font-medium text-ink","search.filterChip":"inline-flex h-6 items-center gap-1 rounded-md border border-line bg-panel px-2 text-xs text-dim","search.filterChipActive":"inline-flex h-6 items-center gap-1 rounded-md border border-accent/35 bg-accent-soft pl-2 pr-1 text-xs font-medium text-accent","composer.box":"group/composer relative min-w-0 rounded-[20px] border border-line bg-panel","composer.input":"relative block min-h-13 w-full resize-none bg-transparent px-4 pt-3.5 pb-1.5 text-[15px] leading-6","composer.attachment":"group/att flex h-9 items-center gap-2 rounded-xl border border-line bg-raised/60 pr-1.5 pl-2.5 text-xs","sidebar.shell":"flex h-full flex-col bg-sidebar","sidebar.drawer":"fixed inset-y-0 left-0 z-0 flex w-[min(86vw,24rem)] flex-col bg-sidebar outline-none","sidebar.rightShell":"flex h-full w-full flex-col border-l border-line bg-bg","sidebar.rightDrawer":"fixed inset-y-0 right-0 z-50 flex w-[min(24rem,90vw)] flex-col border-l border-line bg-sidebar shadow-float outline-none","sidebar.navItem":"group flex h-9 w-full items-center gap-2.5 rounded-lg px-2 text-left text-sm select-none","sidebar.sectionTitle":"flex-1 text-xs font-medium text-faint","sidebar.hoverPill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-raised/65 opacity-0","sidebar.activePill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-raised opacity-0","markdown.p":"my-4 first:mt-0 last:mb-0","markdown.strong":"font-semibold text-ink","markdown.a":"font-medium text-accent underline","markdown.fileChip":"inline-flex items-baseline gap-1 rounded-md bg-raised/85 px-[0.42em] py-[0.08em] font-mono","markdown.h1":"mt-6 mb-2.5 text-[1.28em] leading-snug font-semibold text-ink first:mt-0","markdown.h2":"mt-6 mb-2.5 text-[1.16em] leading-snug font-semibold text-ink first:mt-0","markdown.h3":"mt-5.5 mb-2 text-[1.06em] font-semibold text-ink first:mt-0","markdown.h4":"mt-4.5 mb-1.5 font-semibold text-ink first:mt-0","markdown.ul":"mt-1.5 mb-5 list-disc pl-[1.5em] marker:text-faint first:mt-0 last:mb-0","markdown.ol":"mt-1.5 mb-5 list-decimal pl-[1.6em] marker:text-[0.9em] marker:text-faint first:mt-0 last:mb-0","markdown.li":"my-2 pl-1","markdown.blockquote":"my-3.5 border-l-[3px] border-line-strong pl-3.5 text-dim italic","markdown.hr":"my-5 border-line","markdown.inlineCode":"mx-[0.18em] rounded-md bg-raised/85 px-[0.38em] py-[0.12em] font-mono text-[0.84em] text-ink/95 break-words","markdown.details":"my-3.5 overflow-hidden rounded-xl border border-line bg-raised/25 not-italic first:mt-0 last:mb-0","markdown.detailsTrigger":"group/collapsible flex w-full cursor-pointer items-center gap-2 px-3.5 py-2.5 text-left font-sans text-[13.5px] leading-snug font-medium text-ink","markdown.detailsContent":"border-t border-line px-3.5 py-3","markdown.imageButton":"my-3 block cursor-zoom-in overflow-hidden rounded-xl border border-line bg-panel text-left","markdown.tableWrap":"my-4 overflow-x-auto rounded-xl border border-line font-sans not-italic first:mt-0 last:mb-0","markdown.table":"w-full border-collapse text-[13.5px]","markdown.thead":"bg-raised/50","markdown.th":"min-w-24 border-b border-line px-3 py-2 text-left font-semibold","markdown.td":"min-w-24 border-t border-line px-3 py-2 align-top [&_code]:wrap-anywhere"},Ow={themeID:"basalt",preference:"light",resolved:"light",tokens:Bw,recipes:KS};function Gw({loading:t,disabled:e,size:o,variant:i,...s}){return M("button",{type:"button",...s,disabled:e||t,"aria-busy":t||void 0})}var QS={Button:Gw,Panel:({header:t,actions:e,children:o,...i})=>M("div",i,t,e,o),ScrollArea:({as:t="div",viewportClassName:e,viewportRef:o,children:i,...s})=>M(t,s,M("div",{className:e,ref:o},i)),PageLayout:({title:t,description:e,actions:o,children:i,"aria-label":s,className:n})=>M("section",{"aria-label":s,className:n},M("header",null,M("h1",null,t),o,e&&M("p",null,e)),i),StatusChip:({children:t,title:e})=>M("span",{title:e},t),Markdown:({text:t})=>M("div",null,t),CatalogRow:({name:t,selectLabel:e,onSelect:o,meta:i,description:s,aside:n,actions:l,toggle:y,title:u})=>M("div",null,M(o?"button":"div",o?{type:"button","aria-label":e,title:u,onClick:o}:{title:u},t,i,s),n,l,y&&M("button",{type:"button",role:"switch","aria-checked":y.checked,"aria-label":y.label,disabled:y.disabled,onClick:()=>y.onCheckedChange(!y.checked)},y.label)),Form:(t)=>M("form",t),FormError:({children:t})=>M("p",{role:"alert"},t),Switch:({checked:t,onCheckedChange:e,label:o,...i})=>M("button",{...i,type:"button",role:"switch","aria-checked":t,onClick:()=>e(!t)},o),Select:({groups:t,onValueChange:e,placeholder:o,...i})=>M("select",{...i,onChange:(s)=>e(s.currentTarget.value)},o&&M("option",{value:""},o),t.map((s,n)=>M("optgroup",{key:n,label:s.label??""},s.options.map((l)=>M("option",{key:l.value,value:l.value},l.label))))),Input:(t)=>M("input",t),Textarea:(t)=>M("textarea",t),Code:({code:t,lang:e,className:o})=>M("pre",{className:o,"data-lang":e},M("code",null,t)),CopyButton:({text:t,label:e})=>M("button",{type:"button","aria-label":e??"\u590D\u5236",onClick:()=>void globalThis.navigator?.clipboard?.writeText(typeof t==="function"?t():t)}),useColorScheme:()=>"light",useTheme:()=>Ow,style:(t,...e)=>[KS[t]??t,...e].filter(Boolean).join(" "),cn:(...t)=>t.filter(Boolean).join(" ")},jS=new Proxy(QS,{get(t,e){if(Object.hasOwn(t,e))return Reflect.get(t,e);throw Error(`ui_test does not provide UI capability ${String(e)}; use supported native controls for structural tests and a browser for this capability`)}}),Xd={react:yr,"react-dom":tn,"react/jsx-runtime":kg,"react/jsx-dev-runtime":Lg,"@basalt/plugin/web":$d,"@basalt/ui":QS};var qS=Promise.resolve();async function Uw(){let t=qS,e=()=>{};return qS=new Promise((o)=>{e=o}),await t,e}function Hw(t){return{window:t,document:t.document,navigator:t.navigator,HTMLElement:t.HTMLElement,HTMLInputElement:t.HTMLInputElement,HTMLTextAreaElement:t.HTMLTextAreaElement,Node:t.Node,Event:t.Event,MouseEvent:t.MouseEvent,getComputedStyle:t.getComputedStyle.bind(t)}}async function Ww(t,e){let o=await Bun.build({entrypoints:["basalt-ui-entry"],target:"browser",format:"esm",throw:!1,plugins:[{name:"basalt-ui-bridge",setup(s){s.onResolve({filter:/.*/},({path:n})=>{if(n==="basalt-ui-entry")return{path:n,namespace:"test-entry"};if(Object.hasOwn(Xd,n))return{path:n,namespace:"test-bridge"};throw Error(`Unsupported ui_test import: ${n}`)}),s.onLoad({filter:/.*/,namespace:"test-entry"},()=>({contents:t,loader:"js"})),s.onLoad({filter:/.*/,namespace:"test-bridge"},({path:n})=>({loader:"js",contents:Object.keys(Xd[n]??{}).map((l,y)=>{let u=`globalThis[${JSON.stringify(e)}][${JSON.stringify(n)}][${JSON.stringify(l)}]`;return`const e${y}=${u};export {e${y} as ${l}};`}).join(`
|
|
226
226
|
`)}))}}]}),i=o.outputs[0];if(!o.success||!i)throw Error(o.logs.map((s)=>s.message).join("; ")||"UI bridge build failed");return i.text()}function _w(t,e){if(!(typeof t==="object"&&t!==null&&("id"in t)&&t.id===e&&("apiVersion"in t)&&t.apiVersion===1))throw Error("Web module must export default with matching id and apiVersion: 1")}async function Mg(t,e,o){let i=new xh({settings:{disableJavaScriptEvaluation:!0,disableJavaScriptFileLoading:!0,disableCSSFileLoading:!0,enableFileSystemHttpRequests:!1}}),s=await Uw(),n=`__basalt_ui_${crypto.randomUUID().replaceAll("-","")}`,l={...Hw(i),[n]:Xd},y=new Map(Object.keys(l).map((c)=>[c,Object.getOwnPropertyDescriptor(globalThis,c)])),u;try{for(let[d,g]of Object.entries(l))Object.defineProperty(globalThis,d,{configurable:!0,writable:!0,value:g});u=URL.createObjectURL(new Blob([await Ww(t,n)],{type:"text/javascript"})),An({type:"importing"});let c=await import(u);return An({type:"imported"}),_w(c.default,e),await o(c.default,i)}finally{try{await i.happyDOM.close()}finally{if(u)URL.revokeObjectURL(u);for(let[c,d]of y)if(d)Object.defineProperty(globalThis,c,d);else Reflect.deleteProperty(globalThis,c);s()}}}var Yw=10,$S=1000,XS=200,Kw="button,[role=button]";async function zS(t,e,o,i){let s=Date.now()+e;while(!t()){if(Date.now()>=s)throw Error(o);await Bun.sleep(Yw),await i.settle()}}function Qw(t,e,o){if(t.disabled||t.readOnly)throw Error("Control is not editable");let i=t.tagName==="TEXTAREA"?o.HTMLTextAreaElement.prototype:o.HTMLInputElement.prototype;Object.getOwnPropertyDescriptor(i,"value")?.set?.call(t,e),gt(()=>{t.dispatchEvent(new o.Event("input",{bubbles:!0})),t.dispatchEvent(new o.Event("change",{bubbles:!0}))})}async function jw(t,e){let{inspect:o,calls:i,window:s}=e;if("click"in t){let n=typeof t.click==="string"?o.findByName(Kw,t.click):o.selectOne(t.click.selector);if(o.isDisabled(n))throw Error("Control is disabled");gt(()=>n.click())}else if("type"in t)Qw(o.findByName("input,textarea",t.type.label),t.type.text,s);else if("waitText"in t){let{waitText:n}=t;await zS(()=>o.snapshot(void 0,!1).text.includes(n),t.timeoutMs??$S,`Timed out waiting for ${JSON.stringify(n)}`,e)}else if("waitSelector"in t){let{waitSelector:n}=t;await zS(()=>o.anyVisible(n),t.timeoutMs??$S,`Timed out waiting for selector ${n}`,e)}else if("expectCount"in t){let{selector:n,n:l}=t.expectCount,y=o.count(n);if(!Number.isInteger(l)||l<0||y!==l)throw Error(`Expected ${l} elements, got ${y}`)}else if("snapshot"in t){let n=t.snapshot.depth??10;if(!Number.isInteger(n)||n<0||n>XS)throw Error(`snapshot depth must be 0\u2013${XS}`);return o.outline(o.selectOne(t.snapshot.selector),n)}else if("expectCalls"in t){let{onOpen:n,onClose:l}=t.expectCalls;if(n&&JSON.stringify(n)!==JSON.stringify(i.onOpen))throw Error(`onOpen calls differ: ${JSON.stringify(i.onOpen)}`);if(l!==void 0&&l!==i.onClose)throw Error(`Expected ${l} onClose calls, got ${i.onClose}`)}else if("expectText"in t){let n=t.within?o.selectOne(t.within):void 0;if(!o.snapshot(n,!1).text.includes(t.expectText))throw Error(`Missing text: ${t.expectText}`)}else if("expectValue"in t){let n=o.findByName("input,textarea,select",t.expectValue.label);if(n.value!==t.expectValue.value)throw Error(`Expected value ${JSON.stringify(t.expectValue.value)}, got ${JSON.stringify(n.value)}`)}else throw Error("Unknown UI step")}async function JS(t,e){let o=[];for(let i of t)try{let s=await jw(i,e);await e.settle(),o.push({step:i,ok:!0,snapshot:e.inspect.snapshot(),outline:s})}catch(s){o.push({step:i,ok:!1,snapshot:e.inspect.snapshot(),error:s instanceof Error?s.message:String(s)});break}return o}var qw=()=>({id:"ui-test",title:"",projectID:null,model:"",created:0,updated:0,status:"idle",todos:[],parentID:null,forkThroughSeq:null,kind:"main",archivedAt:null}),ZS=["page","tab","card","sidebar"],tf=(t)=>[t.slot,t.view,t.codeBlock].filter(Boolean).length;async function ef(t,e){if(e.codeBlock){let s=e.codeBlock.toLowerCase(),n=Object.entries(t.codeBlocks??{}).find(([l])=>l.toLowerCase()===s)?.[1];if(!n)throw Error(`Unknown code block: ${e.codeBlock}`);return{view:void 0,codeBlock:s,component:(await n.load()).default}}let o=e.view?t.views?.[e.view]:void 0;if(e.view&&!o)throw Error(`Unknown view: ${e.view}`);if(o&&(!ZS.includes(o.kind)||e.kind&&e.kind!==o.kind))throw Error(`View kind mismatch for ${e.view}: expected ${e.kind??ZS.join("/")}, got ${o.kind}`);let i=o?(await o.load()).default:t.slots?.[e.slot??""];if(!i)throw Error(e.view?`Missing component for view: ${e.view}`:`Unknown slot: ${e.slot}`);return{view:o,codeBlock:void 0,component:i}}function $w(t,e,o,i,s){let n=(y)=>s.onOpen.push(y),l=()=>{s.onClose++};switch(t.kind){case"page":return M(e,{connection:i,onOpen:n});case"tab":return M(e,{connection:i,onClose:l});case"card":return M(e,{connection:i,onOpen:n,sessionID:typeof o.props?.sessionID==="string"?o.props.sessionID:"ui-test",payload:o.props?.payload});case"sidebar":return M(e,{session:qw(),entries:[],...o.props,connection:i})}}function rf(t,e,o,i){return function(){let[n,l]=en(typeof e.context?.text==="string"?e.context.text:""),[y,u]=en(Array.isArray(e.context?.attachments)?e.context.attachments:[]),c={disabled:!1,busy:!1,draftKey:"ui-test",...e.context,text:n,setText:l,attachments:y,setAttachments:u},d=M("textarea",{"aria-label":"__basalt_host_draft__",value:n,onInput:(f)=>{let E=Reflect.get(f.currentTarget,"value");if(typeof E==="string")l(E)}}),g=t.view?[$w(t.view,t.component,e,o,i)]:t.codeBlock?[M(t.component,{code:typeof e.props?.code==="string"?e.props.code:"",lang:t.codeBlock,streaming:e.props?.streaming===!0})]:[d,M(t.component,{context:c,connection:o})];return M(qd.Provider,{value:jS},...g)}}var of=1e4;function Xw(t){let e=`ui_test requires id, exactly one of slot, view or codeBlock, and at most ${jn} steps`;if(!t.id||tf(t)!==1||!Array.isArray(t.steps))throw Error(e);if(t.steps.length>jn)throw Error(e);for(let o of t.steps){if(!(("waitText"in o)||("waitSelector"in o)))continue;let i=o.timeoutMs??1000;if(!Number.isInteger(i)||i<1||i>gr)throw Error(`wait timeoutMs must be between 1 and ${gr}`)}for(let o of Object.values(t.mockRoutes??{})){let i=o.delayMs??0,s=Number.isInteger(o.status)&&o.status>=100&&o.status<=599,n=Number.isInteger(i)&&i>=0&&i<=of;if(!s||!n)throw Error(`mockRoutes requires HTTP status and delayMs between 0 and ${of}`)}}async function zw(t,e,o){return Xw(o),Mg(t,o.id,async(i,s)=>{if(e){let H=s.document.createElement("style");H.textContent=e,s.document.head.append(H)}let n=await ef(i,o),l={onOpen:[],onClose:0},y=new AbortController,u=Vg(o.mockRoutes,y.signal),c=rf(n,o,u,l),d=s.document.createElement("div");s.document.body.append(d);let g,{createRoot:f}=await import("./chunk-wnd3y4c0.js"),E=f(d,{onUncaughtError:(H)=>{g=H}}),R=async()=>{if(await Bun.sleep(0),gt(()=>{}),g)throw g};try{gt(()=>E.render(M(c))),await R();let H=Dg(d,s),yt=await JS(o.steps,{window:s,inspect:H,calls:l,settle:R});return{ok:yt.every((bt)=>bt.ok),steps:yt,calls:l}}finally{gt(()=>E.unmount()),y.abort()}})}function Jw(t,e){return Mg(t,e,async(o)=>{let i=o.pageNav?.viewID??"page";return{slots:Object.keys(o.slots??{}),views:Object.keys(o.views??{}),codeBlocks:Object.keys(o.codeBlocks??{}).map((s)=>s.toLowerCase()),pageNav:o.pageNav?{viewID:i,kind:o.views?.[i]?.kind}:void 0,themes:Array.isArray(o.themes)?o.themes.map((s)=>s&&typeof s==="object"?s.id:void 0).filter((s)=>typeof s==="string"&&s.length>0):void 0}})}globalThis.onmessage=async(t)=>{let e=t.data;if(e.type==="response")return Fg(e);try{let o=e.input?await zw(e.source,e.css,e.input):await Jw(e.source,e.id);An({type:"done",result:o})}catch(o){An({type:"error",error:o instanceof Error?o.message:String(o)})}};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{t,a,
|
|
1
|
+
import{t,a,K,u,d,N,x,_o,O,l,ge,ye}from"./chunk-h8mhnze5.js";import{he}from"./chunk-76e3npmd.js";import{ue}from"./chunk-wvt76598.js";var _e=new Uint8Array(16);function ee(){return crypto.getRandomValues(_e)}var S=[];for(let e=0;e<256;++e)S.push((e+256).toString(16).slice(1));function de(e,i=0){return(S[e[i+0]]+S[e[i+1]]+S[e[i+2]]+S[e[i+3]]+"-"+S[e[i+4]]+S[e[i+5]]+"-"+S[e[i+6]]+S[e[i+7]]+"-"+S[e[i+8]]+S[e[i+9]]+"-"+S[e[i+10]]+S[e[i+11]]+S[e[i+12]]+S[e[i+13]]+S[e[i+14]]+S[e[i+15]]).toLowerCase()}function Se(e,i,p){if(!i&&!e&&crypto.randomUUID)return crypto.randomUUID();return xe(e,i,p)}function xe(e,i,p){e=e||{};let h=e.random??e.rng?.()??ee();if(h.length<16)throw Error("Random bytes length must be >= 16");if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,i){if(p=p||0,p<0||p+16>i.length)throw RangeError(`UUID byte range ${p}:${p+15} is out of buffer bounds`);for(let n=0;n<16;++n)i[p+n]=h[n];return i}return de(h)}var te=Se;var ne=function(){var e=t(function(w,o,r,c){for(r=r||{},c=w.length;c--;r[w[c]]=o);return r},"o"),i=[1,4],p=[1,13],h=[1,12],n=[1,15],f=[1,16],k=[1,20],E=[1,19],L=[6,7,8],U=[1,26],M=[1,24],P=[1,25],m=[6,7,11],V=[1,6,13,15,16,19,22],ie=[1,33],re=[1,34],F=[1,6,7,11,13,15,16,19,22],z={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:t(function(o,r,c,g,b,s,G){var y=s.length-1;switch(b){case 6:case 7:return g;case 8:g.getLogger().trace("Stop NL ");break;case 9:g.getLogger().trace("Stop EOF ");break;case 11:g.getLogger().trace("Stop NL2 ");break;case 12:g.getLogger().trace("Stop EOF2 ");break;case 15:g.getLogger().info("Node: ",s[y].id),g.addNode(s[y-1].length,s[y].id,s[y].descr,s[y].type);break;case 16:g.getLogger().trace("Icon: ",s[y]),g.decorateNode({icon:s[y]});break;case 17:case 21:g.decorateNode({class:s[y]});break;case 18:g.getLogger().trace("SPACELIST");break;case 19:g.getLogger().trace("Node: ",s[y].id),g.addNode(0,s[y].id,s[y].descr,s[y].type);break;case 20:g.decorateNode({icon:s[y]});break;case 25:g.getLogger().trace("node found ..",s[y-2]),this.$={id:s[y-1],descr:s[y-1],type:g.getType(s[y-2],s[y])};break;case 26:this.$={id:s[y],descr:s[y],type:g.nodeType.DEFAULT};break;case 27:g.getLogger().trace("node found ..",s[y-3]),this.$={id:s[y-3],descr:s[y-1],type:g.getType(s[y-2],s[y])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:i},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:i},{6:p,7:[1,10],9:9,12:11,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},e(L,[2,3]),{1:[2,2]},e(L,[2,4]),e(L,[2,5]),{1:[2,6],6:p,12:21,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},{6:p,9:22,12:11,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},{6:U,7:M,10:23,11:P},e(m,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:k,22:E}),e(m,[2,18]),e(m,[2,19]),e(m,[2,20]),e(m,[2,21]),e(m,[2,23]),e(m,[2,24]),e(m,[2,26],{19:[1,30]}),{20:[1,31]},{6:U,7:M,10:32,11:P},{1:[2,7],6:p,12:21,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},e(V,[2,14],{7:ie,11:re}),e(F,[2,8]),e(F,[2,9]),e(F,[2,10]),e(m,[2,15]),e(m,[2,16]),e(m,[2,17]),{20:[1,35]},{21:[1,36]},e(V,[2,13],{7:ie,11:re}),e(F,[2,11]),e(F,[2,12]),{21:[1,37]},e(m,[2,25]),e(m,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(o,r){if(r.recoverable)this.trace(o);else{var c=Error(o);throw c.hash=r,c}},"parseError"),parse:t(function(o){var r=this,c=[0],g=[],b=[null],s=[],G=this.table,y="",H=0,se=0,oe=0,me=2,ae=1,ke=s.slice.call(arguments,1),_=Object.create(this.lexer),R={yy:{}};for(var Y in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Y))R.yy[Y]=this.yy[Y];if(_.setInput(o,R.yy),R.yy.lexer=_,R.yy.parser=this,typeof _.yylloc>"u")_.yylloc={};var q=_.yylloc;s.push(q);var be=_.options&&_.options.ranges;if(typeof R.yy.parseError==="function")this.parseError=R.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Ee(T){c.length=c.length-2*T,b.length=b.length-T,s.length=s.length-T}t(Ee,"popStack");function ce(){var T=g.pop()||_.lex()||ae;if(typeof T!=="number"){if(T instanceof Array)g=T,T=g.pop();T=r.symbols_[T]||T}return T}t(ce,"lex");var D,J,A,v,we,Q,B={},W,I,le,X;while(!0){if(A=c[c.length-1],this.defaultActions[A])v=this.defaultActions[A];else{if(D===null||typeof D>"u")D=ce();v=G[A]&&G[A][D]}if(typeof v>"u"||!v.length||!v[0]){var Z="";X=[];for(W in G[A])if(this.terminals_[W]&&W>me)X.push("'"+this.terminals_[W]+"'");if(_.showPosition)Z="Parse error on line "+(H+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
|
-
Expecting `+
|
|
3
|
+
Expecting `+X.join(", ")+", got '"+(this.terminals_[D]||D)+"'";else Z="Parse error on line "+(H+1)+": Unexpected "+(D==ae?"end of input":"'"+(this.terminals_[D]||D)+"'");this.parseError(Z,{text:_.match,token:this.terminals_[D]||D,line:_.yylineno,loc:q,expected:X})}if(v[0]instanceof Array&&v.length>1)throw Error("Parse Error: multiple actions possible at state: "+A+", token: "+D);switch(v[0]){case 1:if(c.push(D),b.push(_.yytext),s.push(_.yylloc),c.push(v[1]),D=null,!J){if(se=_.yyleng,y=_.yytext,H=_.yylineno,q=_.yylloc,oe>0)oe--}else D=J,J=null;break;case 2:if(I=this.productions_[v[1]][1],B.$=b[b.length-I],B._$={first_line:s[s.length-(I||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(I||1)].first_column,last_column:s[s.length-1].last_column},be)B._$.range=[s[s.length-(I||1)].range[0],s[s.length-1].range[1]];if(Q=this.performAction.apply(B,[y,se,H,R.yy,v[1],b,s].concat(ke)),typeof Q<"u")return Q;if(I)c=c.slice(0,-1*I*2),b=b.slice(0,-1*I),s=s.slice(0,-1*I);c.push(this.productions_[v[1]][0]),b.push(B.$),s.push(B._$),le=G[c[c.length-2]][c[c.length-1]],c.push(le);break;case 3:return!0}}return!0},"parse")},fe=function(){var w={EOF:1,parseError:t(function(r,c){if(this.yy.parser)this.yy.parser.parseError(r,c);else throw Error(r)},"parseError"),setInput:t(function(o,r){if(this.yy=r||this.yy||{},this._input=o,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];return this.offset=0,this},"setInput"),input:t(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var r=o.match(/(?:\r\n?|\n).*/g);if(r)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),o},"input"),unput:t(function(o){var r=o.length,c=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var g=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1)this.yylineno-=c.length-1;var b=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===g.length?this.yylloc.first_column:0)+g[g.length-c.length].length-c[0].length:this.yylloc.first_column-r},this.options.ranges)this.yylloc.range=[b[0],b[0]+this.yyleng-r];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(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:t(function(o){this.unput(this.match.slice(o))},"less"),pastInput:t(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var o=this.match;if(o.length<20)o+=this._input.substr(0,20-o.length);return(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var o=this.pastInput(),r=Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
|
5
5
|
`+r+"^"},"showPosition"),test_match:t(function(o,r){var c,g,b;if(this.options.backtrack_lexer){if(b={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)b.yylloc.range=this.yylloc.range.slice(0)}if(g=o[0].match(/(?:\r\n?|\n).*/g),g)this.yylineno+=g.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],c=this.performAction.call(this,this.yy,this,r,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(c)return c;else if(this._backtrack){for(var s in b)this[s]=b[s];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var o,r,c,g;if(!this._more)this.yytext="",this.match="";var b=this._currentRules();for(var s=0;s<b.length;s++)if(c=this._input.match(this.rules[b[s]]),c&&(!r||c[0].length>r[0].length)){if(r=c,g=s,this.options.backtrack_lexer)if(o=this.test_match(c,b[s]),o!==!1)return o;else if(this._backtrack){r=!1;continue}else return!1;else if(!this.options.flex)break}if(r){if(o=this.test_match(r,b[g]),o!==!1)return o;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var r=this.next();if(r)return r;else return this.lex()},"lex"),begin:t(function(r){this.conditionStack.push(r)},"begin"),popState:t(function(){var r=this.conditionStack.length-1;if(r>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(r){if(r=this.conditionStack.length-1-Math.abs(r||0),r>=0)return this.conditionStack[r];else return"INITIAL"},"topState"),pushState:t(function(r){this.begin(r)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(r,c,g,b){var s=b;switch(g){case 0:return r.getLogger().trace("Found comment",c.yytext),6;break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;break;case 4:this.popState();break;case 5:r.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return r.getLogger().trace("SPACELINE"),6;break;case 7:return 7;case 8:return 15;case 9:r.getLogger().trace("end icon"),this.popState();break;case 10:return r.getLogger().trace("Exploding node"),this.begin("NODE"),19;break;case 11:return r.getLogger().trace("Cloud"),this.begin("NODE"),19;break;case 12:return r.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;break;case 13:return r.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;break;case 14:return this.begin("NODE"),19;break;case 15:return this.begin("NODE"),19;break;case 16:return this.begin("NODE"),19;break;case 17:return this.begin("NODE"),19;break;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:r.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return r.getLogger().trace("description:",c.yytext),"NODE_DESCR";break;case 26:this.popState();break;case 27:return this.popState(),r.getLogger().trace("node end ))"),"NODE_DEND";break;case 28:return this.popState(),r.getLogger().trace("node end )"),"NODE_DEND";break;case 29:return this.popState(),r.getLogger().trace("node end ...",c.yytext),"NODE_DEND";break;case 30:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 31:return this.popState(),r.getLogger().trace("node end (-"),"NODE_DEND";break;case 32:return this.popState(),r.getLogger().trace("node end (-"),"NODE_DEND";break;case 33:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 34:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 35:return r.getLogger().trace("Long description:",c.yytext),20;break;case 36:return r.getLogger().trace("Long description:",c.yytext),20;break}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w}();
|
|
7
|
-
`+e);let n=h.db,f=n.getData(),k=he(i,f.config.securityLevel);if(f.type=h.type,f.layoutAlgorithm=ye(f.config.layout,{fallback:"cose-bilkent"}),f.diagramId=i,!n.getMindmap())return;f.nodes.forEach((m)=>{if(m.shape==="rounded")m.radius=15,m.taper=15,m.stroke="none",m.width=0,m.padding=15;else if(m.shape==="circle")m.padding=10;else if(m.shape==="rect")m.width=0,m.padding=10;else if(m.shape==="hexagon")m.width=0,m.height=0}),await ge(f,k);let{themeVariables:L}=x(),{useGradient:U,gradientStart:M,gradientStop:P}=L;if(U&&M&&P){let m=k.attr("id"),V=k.append("defs").append("linearGradient").attr("id",`${m}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");V.append("stop").attr("offset","0%").attr("stop-color",M).attr("stop-opacity",1),V.append("stop").attr("offset","100%").attr("stop-color",P).attr("stop-opacity",1)}ue(k,f.config.mindmap?.padding??N.mindmap.padding,"mindmapDiagram",f.config.mindmap?.useMaxWidth??N.mindmap.useMaxWidth)},"draw"),ve={draw:De},Te=t((e)=>{let{theme:i,look:p}=e,h="";for(let n=0;n<e.THEME_COLOR_LIMIT;n++)if(e["lineColor"+n]=e["lineColor"+n]||e["cScaleInv"+n],
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var r=this.next();if(r)return r;else return this.lex()},"lex"),begin:t(function(r){this.conditionStack.push(r)},"begin"),popState:t(function(){var r=this.conditionStack.length-1;if(r>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(r){if(r=this.conditionStack.length-1-Math.abs(r||0),r>=0)return this.conditionStack[r];else return"INITIAL"},"topState"),pushState:t(function(r){this.begin(r)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(r,c,g,b){var s=b;switch(g){case 0:return r.getLogger().trace("Found comment",c.yytext),6;break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;break;case 4:this.popState();break;case 5:r.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return r.getLogger().trace("SPACELINE"),6;break;case 7:return 7;case 8:return 15;case 9:r.getLogger().trace("end icon"),this.popState();break;case 10:return r.getLogger().trace("Exploding node"),this.begin("NODE"),19;break;case 11:return r.getLogger().trace("Cloud"),this.begin("NODE"),19;break;case 12:return r.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;break;case 13:return r.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;break;case 14:return this.begin("NODE"),19;break;case 15:return this.begin("NODE"),19;break;case 16:return this.begin("NODE"),19;break;case 17:return this.begin("NODE"),19;break;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:r.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return r.getLogger().trace("description:",c.yytext),"NODE_DESCR";break;case 26:this.popState();break;case 27:return this.popState(),r.getLogger().trace("node end ))"),"NODE_DEND";break;case 28:return this.popState(),r.getLogger().trace("node end )"),"NODE_DEND";break;case 29:return this.popState(),r.getLogger().trace("node end ...",c.yytext),"NODE_DEND";break;case 30:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 31:return this.popState(),r.getLogger().trace("node end (-"),"NODE_DEND";break;case 32:return this.popState(),r.getLogger().trace("node end (-"),"NODE_DEND";break;case 33:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 34:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 35:return r.getLogger().trace("Long description:",c.yytext),20;break;case 36:return r.getLogger().trace("Long description:",c.yytext),20;break}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w}();z.lexer=fe;function j(){this.yy={}}return t(j,"Parser"),j.prototype=z,z.Parser=j,new j}();ne.parser=ne;var Ne=ne,pe=12,C={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Le=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=C,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{t(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let i=this.nodes.length-1;i>=0;i--)if(this.nodes[i].level<e)return this.nodes[i];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,i,p,h){a.info("addNode",e,i,p,h);let n=!1;if(this.nodes.length===0)this.baseLevel=e,e=0,n=!0;else if(this.baseLevel!==void 0)e=e-this.baseLevel,n=!1;let f=l(),k=f.mindmap?.padding??N.mindmap.padding;switch(h){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:k*=2;break}let E={id:this.count++,nodeId:O(i,f),level:e,descr:O(p,f),type:h,children:[],width:f.mindmap?.maxNodeWidth??N.mindmap.maxNodeWidth,padding:k,isRoot:n},L=this.getParent(e);if(L)L.children.push(E),this.nodes.push(E);else if(n)this.nodes.push(E);else throw Error(`There can be only one root. No parent could be found for ("${E.descr}")`)}getType(e,i){switch(a.debug("In get type",e,i),e){case"[":return this.nodeType.RECT;case"(":return i===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,i){this.elements[e]=i}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let i=l(),p=this.nodes[this.nodes.length-1];if(e.icon)p.icon=O(e.icon,i);if(e.class)p.class=O(e.class,i)}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,i,p=0,h=!1){if(e.level===0)e.section=void 0;else e.section=h?(p-1)%(pe-1):i;if(e.children)for(let[n,f]of e.children.entries()){let k=e.level===0?n%(pe-1):i;this.assignSections(f,k,p+1,h)}}flattenNodes(e,i){let p=l(),h=["mindmap-node"];if(e.isRoot===!0)h.push("section-root","section--1");else if(e.section!==void 0)h.push(`section-${e.section}`);if(e.class)h.push(e.class);let n=h.join(" "),f=t((E)=>{let U=(p.theme?.toLowerCase()??"").includes("redux");switch(E){case C.CIRCLE:return"mindmapCircle";case C.RECT:return"rect";case C.ROUNDED_RECT:return"rounded";case C.CLOUD:return"cloud";case C.BANG:return"bang";case C.HEXAGON:return"hexagon";case C.DEFAULT:return U?"rounded":"defaultMindmapNode";case C.NO_BORDER:default:return"rect"}},"getShapeFromType"),k={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:f(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:n,cssStyles:[],centerLabel:!0,look:p.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(i.push(k),e.children)for(let E of e.children)this.flattenNodes(E,i)}generateEdges(e,i){if(!e.children)return;let p=l();for(let h of e.children){let n="edge";if(h.section!==void 0)n+=` section-edge-${h.section}`;let f=e.level+1;n+=` edge-depth-${f}`;let k={id:`edge_${e.id}_${h.id}`,start:e.id.toString(),end:h.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:p.look,classes:n,depth:e.level,section:h.section};i.push(k),this.generateEdges(h,i)}}getData(){let e=this.getMindmap(),i=l(),h=_o().layout!==void 0,n=i;if(!h)n.layout="cose-bilkent";if(!e)return{nodes:[],edges:[],config:n};a.debug("getData: mindmapRoot",e,i),this.assignSections(e,void 0,0,i.mindmap?.colorBy==="depth");let f=[],k=[];this.flattenNodes(e,f),this.generateEdges(e,k),a.debug(`getData: processed ${f.length} nodes and ${k.length} edges`);let E=new Map;for(let L of f)E.set(L.id,{shape:L.shape,width:L.width,height:L.height,padding:L.padding});return{nodes:f,edges:k,config:n,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(E),type:"mindmap",diagramId:"mindmap-"+te()}}getLogger(){return a}},De=t(async(e,i,p,h)=>{a.debug(`Rendering mindmap diagram
|
|
7
|
+
`+e);let n=h.db,f=n.getData(),k=he(i,f.config.securityLevel);if(f.type=h.type,f.layoutAlgorithm=ye(f.config.layout,{fallback:"cose-bilkent"}),f.diagramId=i,!n.getMindmap())return;f.nodes.forEach((m)=>{if(m.shape==="rounded")m.radius=15,m.taper=15,m.stroke="none",m.width=0,m.padding=15;else if(m.shape==="circle")m.padding=10;else if(m.shape==="rect")m.width=0,m.padding=10;else if(m.shape==="hexagon")m.width=0,m.height=0}),await ge(f,k);let{themeVariables:L}=x(),{useGradient:U,gradientStart:M,gradientStop:P}=L;if(U&&M&&P){let m=k.attr("id"),V=k.append("defs").append("linearGradient").attr("id",`${m}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");V.append("stop").attr("offset","0%").attr("stop-color",M).attr("stop-opacity",1),V.append("stop").attr("offset","100%").attr("stop-color",P).attr("stop-opacity",1)}ue(k,f.config.mindmap?.padding??N.mindmap.padding,"mindmapDiagram",f.config.mindmap?.useMaxWidth??N.mindmap.useMaxWidth)},"draw"),ve={draw:De},Te=t((e)=>{let{theme:i,look:p}=e,h="";for(let n=0;n<e.THEME_COLOR_LIMIT;n++)if(e["lineColor"+n]=e["lineColor"+n]||e["cScaleInv"+n],K(e["lineColor"+n]))e["lineColor"+n]=u(e["lineColor"+n],20);else e["lineColor"+n]=d(e["lineColor"+n],20);for(let n=0;n<e.THEME_COLOR_LIMIT;n++){let f=""+(p==="neo"?Math.max(10-(n-1)*2,2):17-3*n),k=i==="redux"||i==="redux-dark"?e.nodeBorder:e["cScaleLabel"+(i==="neutral"?1:n)];h+=`
|
|
8
8
|
.section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {
|
|
9
9
|
fill: ${e["cScale"+n]};
|
|
10
10
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{t,a,
|
|
1
|
+
import{t,a,K,u,d,N,O,yt,l,V,rt,at,Et,bt,en}from"./chunk-h8mhnze5.js";import{qe}from"./chunk-ffn1a0zw.js";var ae=function(){var e=t(function(R,r,i,o){for(i=i||{},o=R.length;o--;i[R[o]]=r);return i},"o"),f=[1,4],m=[1,13],s=[1,12],y=[1,15],x=[1,16],S=[1,20],g=[1,19],A=[6,7,8],P=[1,26],b=[1,24],j=[1,25],v=[6,7,11],Y=[1,31],L=[6,7,11,24],W=[1,6,13,16,17,20,23],k=[1,35],F=[1,36],T=[1,6,7,11,13,16,17,20,23],J=[1,38],G={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:t(function(r,i,o,c,p,n,M){var h=n.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",n[h-1].id),c.addNode(n[h-2].length,n[h-1].id,n[h-1].descr,n[h-1].type,n[h]);break;case 16:c.getLogger().info("Node: ",n[h].id),c.addNode(n[h-1].length,n[h].id,n[h].descr,n[h].type);break;case 17:c.getLogger().trace("Icon: ",n[h]),c.decorateNode({icon:n[h]});break;case 18:case 23:c.decorateNode({class:n[h]});break;case 19:c.getLogger().trace("SPACELIST");break;case 20:c.getLogger().trace("Node: ",n[h-1].id),c.addNode(0,n[h-1].id,n[h-1].descr,n[h-1].type,n[h]);break;case 21:c.getLogger().trace("Node: ",n[h].id),c.addNode(0,n[h].id,n[h].descr,n[h].type);break;case 22:c.decorateNode({icon:n[h]});break;case 27:c.getLogger().trace("node found ..",n[h-2]),this.$={id:n[h-1],descr:n[h-1],type:c.getType(n[h-2],n[h])};break;case 28:this.$={id:n[h],descr:n[h],type:0};break;case 29:c.getLogger().trace("node found ..",n[h-3]),this.$={id:n[h-3],descr:n[h-1],type:c.getType(n[h-2],n[h])};break;case 30:this.$=n[h-1]+n[h];break;case 31:this.$=n[h];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:f},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:f},{6:m,7:[1,10],9:9,12:11,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},e(A,[2,3]),{1:[2,2]},e(A,[2,4]),e(A,[2,5]),{1:[2,6],6:m,12:21,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},{6:m,9:22,12:11,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},{6:P,7:b,10:23,11:j},e(v,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:S,23:g}),e(v,[2,19]),e(v,[2,21],{15:30,24:Y}),e(v,[2,22]),e(v,[2,23]),e(L,[2,25]),e(L,[2,26]),e(L,[2,28],{20:[1,32]}),{21:[1,33]},{6:P,7:b,10:34,11:j},{1:[2,7],6:m,12:21,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},e(W,[2,14],{7:k,11:F}),e(T,[2,8]),e(T,[2,9]),e(T,[2,10]),e(v,[2,16],{15:37,24:Y}),e(v,[2,17]),e(v,[2,18]),e(v,[2,20],{24:J}),e(L,[2,31]),{21:[1,39]},{22:[1,40]},e(W,[2,13],{7:k,11:F}),e(T,[2,11]),e(T,[2,12]),e(v,[2,15],{24:J}),e(L,[2,30]),{22:[1,41]},e(L,[2,27]),e(L,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(r,i){if(i.recoverable)this.trace(r);else{var o=Error(r);throw o.hash=i,o}},"parseError"),parse:t(function(r){var i=this,o=[0],c=[],p=[null],n=[],M=this.table,h="",q=0,he=0,ue=0,be=2,ge=1,ye=n.slice.call(arguments,1),_=Object.create(this.lexer),U={yy:{}};for(var te in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,te))U.yy[te]=this.yy[te];if(_.setInput(r,U.yy),U.yy.lexer=_,U.yy.parser=this,typeof _.yylloc>"u")_.yylloc={};var ne=_.yylloc;n.push(ne);var me=_.options&&_.options.ranges;if(typeof U.yy.parseError==="function")this.parseError=U.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ke(C){o.length=o.length-2*C,p.length=p.length-C,n.length=n.length-C}t(ke,"popStack");function de(){var C=c.pop()||_.lex()||ge;if(typeof C!=="number"){if(C instanceof Array)c=C,C=c.pop();C=i.symbols_[C]||C}return C}t(de,"lex");var D,ie,H,I,je,re,X={},Q,B,pe,Z;while(!0){if(H=o[o.length-1],this.defaultActions[H])I=this.defaultActions[H];else{if(D===null||typeof D>"u")D=de();I=M[H]&&M[H][D]}if(typeof I>"u"||!I.length||!I[0]){var se="";Z=[];for(Q in M[H])if(this.terminals_[Q]&&Q>be)Z.push("'"+this.terminals_[Q]+"'");if(_.showPosition)se="Parse error on line "+(q+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
|
-
Expecting `+Z.join(", ")+", got '"+(this.terminals_[D]||D)+"'";else se="Parse error on line "+(q+1)+": Unexpected "+(D==ge?"end of input":"'"+(this.terminals_[D]||D)+"'");this.parseError(se,{text:_.match,token:this.terminals_[D]||D,line:_.yylineno,loc:ne,expected:Z})}if(I[0]instanceof Array&&I.length>1)throw Error("Parse Error: multiple actions possible at state: "+H+", token: "+D);switch(I[0]){case 1:if(o.push(D),p.push(_.yytext),n.push(_.yylloc),o.push(I[1]),D=null,!ie){if(he=_.yyleng,h=_.yytext,q=_.yylineno,ne=_.yylloc,ue>0)ue--}else D=ie,ie=null;break;case 2:if(B=this.productions_[I[1]][1],
|
|
3
|
+
Expecting `+Z.join(", ")+", got '"+(this.terminals_[D]||D)+"'";else se="Parse error on line "+(q+1)+": Unexpected "+(D==ge?"end of input":"'"+(this.terminals_[D]||D)+"'");this.parseError(se,{text:_.match,token:this.terminals_[D]||D,line:_.yylineno,loc:ne,expected:Z})}if(I[0]instanceof Array&&I.length>1)throw Error("Parse Error: multiple actions possible at state: "+H+", token: "+D);switch(I[0]){case 1:if(o.push(D),p.push(_.yytext),n.push(_.yylloc),o.push(I[1]),D=null,!ie){if(he=_.yyleng,h=_.yytext,q=_.yylineno,ne=_.yylloc,ue>0)ue--}else D=ie,ie=null;break;case 2:if(B=this.productions_[I[1]][1],X.$=p[p.length-B],X._$={first_line:n[n.length-(B||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(B||1)].first_column,last_column:n[n.length-1].last_column},me)X._$.range=[n[n.length-(B||1)].range[0],n[n.length-1].range[1]];if(re=this.performAction.apply(X,[h,he,q,U.yy,I[1],p,n].concat(ye)),typeof re<"u")return re;if(B)o=o.slice(0,-1*B*2),p=p.slice(0,-1*B),n=n.slice(0,-1*B);o.push(this.productions_[I[1]][0]),p.push(X.$),n.push(X._$),pe=M[o[o.length-2]][o[o.length-1]],o.push(pe);break;case 3:return!0}}return!0},"parse")},ee=function(){var R={EOF:1,parseError:t(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw Error(i)},"parseError"),setInput:t(function(r,i){if(this.yy=i||this.yy||{},this._input=r,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];return this.offset=0,this},"setInput"),input:t(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var i=r.match(/(?:\r\n?|\n).*/g);if(i)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),r},"input"),unput:t(function(r){var i=r.length,o=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1)this.yylineno-=o.length-1;var p=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges)this.yylloc.range=[p[0],p[0]+this.yyleng-i];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(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:t(function(r){this.unput(this.match.slice(r))},"less"),pastInput:t(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var r=this.match;if(r.length<20)r+=this._input.substr(0,20-r.length);return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var r=this.pastInput(),i=Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
5
|
`+i+"^"},"showPosition"),test_match:t(function(r,i){var o,c,p;if(this.options.backtrack_lexer){if(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)p.yylloc.range=this.yylloc.range.slice(0)}if(c=r[0].match(/(?:\r\n?|\n).*/g),c)this.yylineno+=c.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],o=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(o)return o;else if(this._backtrack){for(var n in p)this[n]=p[n];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var r,i,o,c;if(!this._more)this.yytext="",this.match="";var p=this._currentRules();for(var n=0;n<p.length;n++)if(o=this._input.match(this.rules[p[n]]),o&&(!i||o[0].length>i[0].length)){if(i=o,c=n,this.options.backtrack_lexer)if(r=this.test_match(o,p[n]),r!==!1)return r;else if(this._backtrack){i=!1;continue}else return!1;else if(!this.options.flex)break}if(i){if(r=this.test_match(i,p[c]),r!==!1)return r;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
6
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var i=this.next();if(i)return i;else return this.lex()},"lex"),begin:t(function(i){this.conditionStack.push(i)},"begin"),popState:t(function(){var i=this.conditionStack.length-1;if(i>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(i){if(i=this.conditionStack.length-1-Math.abs(i||0),i>=0)return this.conditionStack[i];else return"INITIAL"},"topState"),pushState:t(function(i){this.begin(i)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(i,o,c,p){var n=p;switch(c){case 0:return this.pushState("shapeData"),o.yytext="",24;break;case 1:return this.pushState("shapeDataStr"),24;break;case 2:return this.popState(),24;break;case 3:let M=/\n\s*/g;return o.yytext=o.yytext.replace(M,"<br/>"),24;break;case 4:return 24;case 5:this.popState();break;case 6:return i.getLogger().trace("Found comment",o.yytext),6;break;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;break;case 10:this.popState();break;case 11:i.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return i.getLogger().trace("SPACELINE"),6;break;case 13:return 7;case 14:return 16;case 15:i.getLogger().trace("end icon"),this.popState();break;case 16:return i.getLogger().trace("Exploding node"),this.begin("NODE"),20;break;case 17:return i.getLogger().trace("Cloud"),this.begin("NODE"),20;break;case 18:return i.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;break;case 19:return i.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;break;case 20:return this.begin("NODE"),20;break;case 21:return this.begin("NODE"),20;break;case 22:return this.begin("NODE"),20;break;case 23:return this.begin("NODE"),20;break;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:i.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return i.getLogger().trace("description:",o.yytext),"NODE_DESCR";break;case 32:this.popState();break;case 33:return this.popState(),i.getLogger().trace("node end ))"),"NODE_DEND";break;case 34:return this.popState(),i.getLogger().trace("node end )"),"NODE_DEND";break;case 35:return this.popState(),i.getLogger().trace("node end ...",o.yytext),"NODE_DEND";break;case 36:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";break;case 37:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";break;case 38:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";break;case 39:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";break;case 40:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";break;case 41:return i.getLogger().trace("Long description:",o.yytext),21;break;case 42:return i.getLogger().trace("Long description:",o.yytext),21;break}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return R}();G.lexer=ee;function z(){this.yy={}}return t(z,"Parser"),z.prototype=G,G.Parser=z,new z}();ae.parser=ae;var Ee=ae,w=[],ce=[],oe=0,le={},_e=t(()=>{w=[],ce=[],oe=0,le={}},"clear"),Se=t((e)=>{if(w.length===0)return null;let f=w[0].level,m=null;for(let s=w.length-1;s>=0;s--){if(w[s].level===f&&!m)m=w[s];if(w[s].level<f)throw Error('Items without section detected, found section ("'+w[s].label+'")')}if(e===m?.level)return null;return m},"getSection"),fe=t(function(){return ce},"getSections"),Ne=t(function(){let e=[],f=[],m=fe(),s=l();for(let y of m){let x={id:y.id,label:O(y.label??"",s),labelType:"markdown",isGroup:!0,ticket:y.ticket,shape:"kanbanSection",level:y.level,look:s.look};f.push(x);let S=w.filter((g)=>g.parentId===y.id);for(let g of S){let A={id:g.id,parentId:y.id,label:O(g.label??"",s),labelType:"markdown",isGroup:!1,ticket:g?.ticket,priority:g?.priority,assigned:g?.assigned,icon:g?.icon,shape:"kanbanItem",level:g.level,rx:5,ry:5,cssStyles:["text-align: left"]};f.push(A)}}return{nodes:f,edges:e,other:{},config:l()}},"getData"),xe=t((e,f,m,s,y)=>{let x=l(),S=x.mindmap?.padding??N.mindmap.padding;switch(s){case E.ROUNDED_RECT:case E.RECT:case E.HEXAGON:S*=2}let g={id:O(f,x)||"kbn"+oe++,level:e,label:O(m,x),width:x.mindmap?.maxNodeWidth??N.mindmap.maxNodeWidth,padding:S,isGroup:!1};if(y!==void 0){let P;if(!y.includes(`
|
|
7
7
|
`))P=`{
|
|
8
8
|
`+y+`
|
|
9
9
|
}`;else P=y+`
|
|
10
|
-
`;let b=
|
|
11
|
-
`+e);let x=s.db.getData(),S=l();S.htmlLabels=!1;let g=V(f);for(let k of x.nodes)k.domId=`${f}-${k.id}`;let A=g.append("g");A.attr("class","sections");let P=g.append("g");P.attr("class","items");let b=x.nodes.filter((k)=>k.isGroup),j=0,v=10,Y=[],L=25;for(let k of b){let F=S?.kanban?.sectionWidth||200;j=j+1,k.x=F*j+(j-1)*v/2,k.width=F,k.y=0,k.height=F*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+j;let T=await en(A,k);L=Math.max(L,T?.labelBBox?.height),Y.push(T)}let W=0;for(let k of b){let F=Y[W];W=W+1;let T=S?.kanban?.sectionWidth||200,J=-T*3/2+L,G=J,ee=x.nodes.filter((r)=>r.parentId===k.id);for(let r of ee){if(r.isGroup)throw Error("Groups within groups are not allowed in Kanban diagrams");r.x=k.x,r.width=T-1.5*v;let o=(await Et(P,r,{config:S})).node().getBBox();r.y=G+o.height/2,await bt(r),G=r.y+o.height/2+v/2}let z=F.cluster.select("rect"),R=Math.max(G-J+3*v,50)+(L-25);z.attr("height",R)}yt(void 0,g,S.mindmap?.padding??N.kanban.padding,S.mindmap?.useMaxWidth??N.kanban.useMaxWidth)},"draw"),Re={draw:Te},Pe=t((e)=>{let f="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)if(e["lineColor"+s]=e["lineColor"+s]||e["cScaleInv"+s],
|
|
10
|
+
`;let b=at(P,{schema:rt});if(b.shape&&(b.shape!==b.shape.toLowerCase()||b.shape.includes("_")))throw Error(`No such shape: ${b.shape}. Shape names should be lowercase.`);if(b?.shape&&b.shape==="kanbanItem")g.shape=b?.shape;if(b?.label)g.label=b?.label;if(b?.icon)g.icon=b?.icon.toString();if(b?.assigned)g.assigned=b?.assigned.toString();if(b?.ticket)g.ticket=b?.ticket.toString();if(b?.priority)g.priority=b?.priority}let A=Se(e);if(A)g.parentId=A.id||"kbn"+oe++;else ce.push(g);w.push(g)},"addNode"),E={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},ve=t((e,f)=>{switch(a.debug("In get type",e,f),e){case"[":return E.RECT;case"(":return f===")"?E.ROUNDED_RECT:E.CLOUD;case"((":return E.CIRCLE;case")":return E.CLOUD;case"))":return E.BANG;case"{{":return E.HEXAGON;default:return E.DEFAULT}},"getType"),De=t((e,f)=>{le[e]=f},"setElementForId"),Le=t((e)=>{if(!e)return;let f=l(),m=w[w.length-1];if(e.icon)m.icon=O(e.icon,f);if(e.class)m.cssClasses=O(e.class,f)},"decorateNode"),Oe=t((e)=>{switch(e){case E.DEFAULT:return"no-border";case E.RECT:return"rect";case E.ROUNDED_RECT:return"rounded-rect";case E.CIRCLE:return"circle";case E.CLOUD:return"cloud";case E.BANG:return"bang";case E.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Ie=t(()=>a,"getLogger"),Ce=t((e)=>le[e],"getElementById"),we={clear:_e,addNode:xe,getSections:fe,getData:Ne,nodeType:E,getType:ve,setElementForId:De,decorateNode:Le,type2Str:Oe,getLogger:Ie,getElementById:Ce},Ae=we,Te=t(async(e,f,m,s)=>{a.debug(`Rendering kanban diagram
|
|
11
|
+
`+e);let x=s.db.getData(),S=l();S.htmlLabels=!1;let g=V(f);for(let k of x.nodes)k.domId=`${f}-${k.id}`;let A=g.append("g");A.attr("class","sections");let P=g.append("g");P.attr("class","items");let b=x.nodes.filter((k)=>k.isGroup),j=0,v=10,Y=[],L=25;for(let k of b){let F=S?.kanban?.sectionWidth||200;j=j+1,k.x=F*j+(j-1)*v/2,k.width=F,k.y=0,k.height=F*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+j;let T=await en(A,k);L=Math.max(L,T?.labelBBox?.height),Y.push(T)}let W=0;for(let k of b){let F=Y[W];W=W+1;let T=S?.kanban?.sectionWidth||200,J=-T*3/2+L,G=J,ee=x.nodes.filter((r)=>r.parentId===k.id);for(let r of ee){if(r.isGroup)throw Error("Groups within groups are not allowed in Kanban diagrams");r.x=k.x,r.width=T-1.5*v;let o=(await Et(P,r,{config:S})).node().getBBox();r.y=G+o.height/2,await bt(r),G=r.y+o.height/2+v/2}let z=F.cluster.select("rect"),R=Math.max(G-J+3*v,50)+(L-25);z.attr("height",R)}yt(void 0,g,S.mindmap?.padding??N.kanban.padding,S.mindmap?.useMaxWidth??N.kanban.useMaxWidth)},"draw"),Re={draw:Te},Pe=t((e)=>{let f="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)if(e["lineColor"+s]=e["lineColor"+s]||e["cScaleInv"+s],K(e["lineColor"+s]))e["lineColor"+s]=u(e["lineColor"+s],20);else e["lineColor"+s]=d(e["lineColor"+s],20);let m=t((s,y)=>e.darkMode?d(s,y):u(s,y),"adjuster");for(let s=0;s<e.THEME_COLOR_LIMIT;s++){let y=""+(17-3*s);f+=`
|
|
12
12
|
.section-${s-1} rect, .section-${s-1} path, .section-${s-1} circle, .section-${s-1} polygon, .section-${s-1} path {
|
|
13
13
|
fill: ${m(e["cScale"+s],10)};
|
|
14
14
|
stroke: ${m(e["cScale"+s],10)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,a,p}from"./chunk-t5ke9cyg.js";import{ht,xr}from"./chunk-7frnjms9.js";import{Ce,Se}from"./chunk-jy448465.js";var k=Se(function(F,Y){(function(g,r){if(typeof F==="object"&&typeof Y==="object")Y.exports=r(xr());else if(typeof define==="function"&&define.amd)define(["cose-base"],r);else if(typeof F==="object")F.cytoscapeCoseBilkent=r(xr());else g.cytoscapeCoseBilkent=r(g.coseBase)})(F,function(u){return function(g){var r={};function n(o){if(r[o])return r[o].exports;var d=r[o]={i:o,l:!1,exports:{}};return g[o].call(d.exports,d,d.exports,n),d.l=!0,d.exports}return n.m=g,n.c=r,n.i=function(o){return o},n.d=function(o,d,l){if(!n.o(o,d))Object.defineProperty(o,d,{configurable:!1,enumerable:!0,get:l})},n.n=function(o){var d=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(d,"a",d),d},n.o=function(o,d){return Object.prototype.hasOwnProperty.call(o,d)},n.p="",n(n.s=1)}([function(g,r){g.exports=u},function(g,r,n){var o=n(0).layoutBase.LayoutConstants,d=n(0).layoutBase.FDLayoutConstants,l=n(0).CoSEConstants,L=n(0).CoSELayout,b=n(0).CoSENode,H=n(0).layoutBase.PointD,v=n(0).layoutBase.DimensionD,_={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:0.45,nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.5};function D(E,e){var f={};for(var s in E)f[s]=E[s];for(var s in e)f[s]=e[s];return f}function I(E){this.options=D(_,E),U(this.options)}var U=function(e){if(e.nodeRepulsion!=null)l.DEFAULT_REPULSION_STRENGTH=d.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion;if(e.idealEdgeLength!=null)l.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=e.idealEdgeLength;if(e.edgeElasticity!=null)l.DEFAULT_SPRING_STRENGTH=d.DEFAULT_SPRING_STRENGTH=e.edgeElasticity;if(e.nestingFactor!=null)l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor;if(e.gravity!=null)l.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=e.gravity;if(e.numIter!=null)l.MAX_ITERATIONS=d.MAX_ITERATIONS=e.numIter;if(e.gravityRange!=null)l.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange;if(e.gravityCompound!=null)l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound;if(e.gravityRangeCompound!=null)l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound;if(e.initialEnergyOnIncremental!=null)l.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental;if(e.quality=="draft")o.QUALITY=0;else if(e.quality=="proof")o.QUALITY=2;else o.QUALITY=1;l.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!e.randomize,l.ANIMATE=d.ANIMATE=o.ANIMATE=e.animate,l.TILE=e.tile,l.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==="function"?e.tilingPaddingVertical.call():e.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==="function"?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal};I.prototype.run=function(){var E,e,f=this.options,s=this.idToLNode={},c=this.layout=new L,i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var y=c.newGraphManager();this.gm=y;var T=this.options.eles.nodes(),m=this.options.eles.edges();this.root=y.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(T),c);for(var h=0;h<m.length;h++){var P=m[h],x=this.idToLNode[P.data("source")],O=this.idToLNode[P.data("target")];if(x!==O&&x.getEdgesBetween(O).length==0){var et=y.add(c.newEdge(),x,O);et.id=P.id()}}var V=function(R,B){if(typeof R==="number")R=B;var C=R.data("id"),G=i.idToLNode[C];return{x:G.getRect().getCenterX(),y:G.getRect().getCenterY()}},nt=function X(){var R=function(){if(f.fit)f.cy.fit(f.eles,f.padding);if(!E)E=!0,i.cy.one("layoutready",f.ready),i.cy.trigger({type:"layoutready",layout:i})},B=i.options.refresh,C;for(var G=0;G<B&&!C;G++)C=i.stopped||i.layout.tick();if(C){if(c.checkLayoutSuccess()&&!c.isSubLayout)c.doPostLayout();if(c.tilingPostLayout)c.tilingPostLayout();if(c.isLayoutFinished=!0,i.options.eles.nodes().positions(V),R(),i.cy.one("layoutstop",i.options.stop),i.cy.trigger({type:"layoutstop",layout:i}),e)cancelAnimationFrame(e);E=!1;return}var M=i.layout.getPositionsData();f.eles.nodes().positions(function(A,it){if(typeof A==="number")A=it;if(!A.isParent()){var j=A.id(),N=M[j],w=A;while(N==null)if(N=M[w.data("parent")]||M["DummyCompound_"+w.data("parent")],M[j]=N,w=w.parent()[0],w==null)break;if(N!=null)return{x:N.x,y:N.y};else return{x:A.position("x"),y:A.position("y")}}}),R(),e=requestAnimationFrame(X)};if(c.addListener("layoutstarted",function(){if(i.options.animate==="during")e=requestAnimationFrame(nt)}),c.runLayout(),this.options.animate!=="during")i.options.eles.nodes().not(":parent").layoutPositions(i,i.options,V),E=!1;return this},I.prototype.getTopMostNodes=function(E){var e={};for(var f=0;f<E.length;f++)e[E[f].id()]=!0;var s=E.filter(function(c,i){if(typeof c==="number")c=i;var y=c.parent()[0];while(y!=null){if(e[y.id()])return!1;y=y.parent()[0]}return!0});return s},I.prototype.processChildrenList=function(E,e,f){var s=e.length;for(var c=0;c<s;c++){var i=e[c],y=i.children(),T,m=i.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(i.outerWidth()!=null&&i.outerHeight()!=null)T=E.add(new b(f.graphManager,new H(i.position("x")-m.w/2,i.position("y")-m.h/2),new v(parseFloat(m.w),parseFloat(m.h))));else T=E.add(new b(this.graphManager));if(T.id=i.data("id"),T.paddingLeft=parseInt(i.css("padding")),T.paddingTop=parseInt(i.css("padding")),T.paddingRight=parseInt(i.css("padding")),T.paddingBottom=parseInt(i.css("padding")),this.options.nodeDimensionsIncludeLabels){if(i.isParent()){var h=i.boundingBox({includeLabels:!0,includeNodes:!1}).w,P=i.boundingBox({includeLabels:!0,includeNodes:!1}).h,x=i.css("text-halign");T.labelWidth=h,T.labelHeight=P,T.labelPos=x}}if(this.idToLNode[i.data("id")]=T,isNaN(T.rect.x))T.rect.x=0;if(isNaN(T.rect.y))T.rect.y=0;if(y!=null&&y.length>0){var O=f.getGraphManager().add(f.newGraph(),T);this.processChildrenList(O,y,f)}}},I.prototype.stop=function(){return this.stopped=!0,this};var S=function(e){e("layout","cose-bilkent",I)};if(typeof cytoscape<"u")S(cytoscape);g.exports=S}])})});var z=Ce(k(),1);ht.use(z.default);function q(u,g){u.forEach((r)=>{let n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach((o)=>{if(!["id","label","height","width","padding","x","y"].includes(o))n[o]=r[o]}),g.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}t(q,"addNodes");function W(u,g){u.forEach((r)=>{let n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach((o)=>{if(!["id","start","end"].includes(o))n[o]=r[o]}),g.add({group:"edges",data:n})})}t(W,"addEdges");function Q(u){return new Promise((g)=>{let r=p("body").append("div").attr("id","cy").attr("style","display:none"),n=ht({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),q(u.nodes,n),W(u.edges,n),n.nodes().forEach(function(d){d.layoutDimensions=()=>{let l=d.data();return{w:l.width,h:l.height}}});let o={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(o).run(),n.ready((d)=>{a.info("Cytoscape ready",d),g(n)})})}t(Q,"createCytoscapeInstance");function Z(u){return u.nodes().map((g)=>{let r=g.data(),n=g.position(),o={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach((d)=>{if(d!=="id")o[d]=r[d]}),o})}t(Z,"extractPositionedNodes");function J(u){return u.edges().map((g)=>{let r=g.data(),n=g._private.rscratch,o={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach((d)=>{if(!["id","source","target"].includes(d))o[d]=r[d]}),o})}t(J,"extractPositionedEdges");async function K(u,g){a.debug("Starting cose-bilkent layout algorithm");try{tt(u);let r=await Q(u),n=Z(r),o=J(r);return a.debug(`Layout completed: ${n.length} nodes, ${o.length} edges`),{nodes:n,edges:o}}catch(r){throw a.error("Error in cose-bilkent layout algorithm:",r),r}}t(K,"executeCoseBilkentLayout");function tt(u){if(!u)throw Error("Layout data is required");if(!u.config)throw Error("Configuration is required in layout data");if(!u.rootNode)throw Error("Root node is required");if(!u.nodes||!Array.isArray(u.nodes))throw Error("No nodes found in layout data");if(!Array.isArray(u.edges))throw Error("Edges array is required in layout data");return!0}t(tt,"validateLayoutData");var at=t(async(u,g,{insertCluster:r,insertEdge:n,insertEdgeLabel:o,insertMarkers:d,insertNode:l,log:L,positionEdgeLabel:b},{algorithm:H})=>{let v={},_={},D=g.select("g");d(D,u.markers,u.type,u.diagramId);let I=D.insert("g").attr("class","subgraphs"),U=D.insert("g").attr("class","edgePaths"),S=D.insert("g").attr("class","edgeLabels"),E=D.insert("g").attr("class","nodes");L.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(u.nodes.map(async(s)=>{if(s.isGroup){let c={...s};_[s.id]=c,v[s.id]=c,await r(I,s)}else{let c={...s};v[s.id]=c;let i=await l(E,s,{config:u.config,dir:u.direction||"TB"}),y=i.node().getBBox();c.width=y.width,c.height=y.height,c.domId=i,L.debug(`Node ${s.id} dimensions: ${y.width}x${y.height}`)}})),L.debug("Running cose-bilkent layout algorithm");let e={...u,nodes:u.nodes.map((s)=>{let c=v[s.id];return{...s,width:c.width,height:c.height}})},f=await K(e,u.config);L.debug("Positioning nodes based on layout results"),f.nodes.forEach((s)=>{let c=v[s.id];if(c?.domId)c.domId.attr("transform",`translate(${s.x}, ${s.y})`),c.x=s.x,c.y=s.y,L.debug(`Positioned node ${c.id} at center (${s.x}, ${s.y})`)}),f.edges.forEach((s)=>{let c=u.edges.find((i)=>i.id===s.id);if(c)c.points=[{x:s.startX,y:s.startY},{x:s.midX,y:s.midY},{x:s.endX,y:s.endY}]}),L.debug("Inserting and positioning edges"),await Promise.all(u.edges.map(async(s)=>{let c=await o(S,s),i=v[s.start??""],y=v[s.end??""];if(i&&y){let T=f.edges.find((m)=>m.id===s.id);if(T){L.debug("APA01 positionedEdge",T);let m={...s},h=n(U,m,_,u.type,i,y,u.diagramId);b(m,h)}else{let m={...s,points:[{x:i.x||0,y:i.y||0},{x:y.x||0,y:y.y||0}]},h=n(U,m,_,u.type,i,y,u.diagramId);b(m,h)}}})),L.debug("Cose-bilkent rendering completed")},"render"),ct=at;export{ct as render};
|
|
1
|
+
import{t,a,p}from"./chunk-h8mhnze5.js";import{ht,_r}from"./chunk-75kzvpf3.js";import{Ce,Se}from"./chunk-bcp6na49.js";var k=Se(function(F,Y){(function(g,r){if(typeof F==="object"&&typeof Y==="object")Y.exports=r(_r());else if(typeof define==="function"&&define.amd)define(["cose-base"],r);else if(typeof F==="object")F.cytoscapeCoseBilkent=r(_r());else g.cytoscapeCoseBilkent=r(g.coseBase)})(F,function(u){return function(g){var r={};function n(o){if(r[o])return r[o].exports;var d=r[o]={i:o,l:!1,exports:{}};return g[o].call(d.exports,d,d.exports,n),d.l=!0,d.exports}return n.m=g,n.c=r,n.i=function(o){return o},n.d=function(o,d,l){if(!n.o(o,d))Object.defineProperty(o,d,{configurable:!1,enumerable:!0,get:l})},n.n=function(o){var d=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(d,"a",d),d},n.o=function(o,d){return Object.prototype.hasOwnProperty.call(o,d)},n.p="",n(n.s=1)}([function(g,r){g.exports=u},function(g,r,n){var o=n(0).layoutBase.LayoutConstants,d=n(0).layoutBase.FDLayoutConstants,l=n(0).CoSEConstants,L=n(0).CoSELayout,b=n(0).CoSENode,H=n(0).layoutBase.PointD,v=n(0).layoutBase.DimensionD,_={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:0.45,nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.5};function D(E,e){var f={};for(var s in E)f[s]=E[s];for(var s in e)f[s]=e[s];return f}function I(E){this.options=D(_,E),U(this.options)}var U=function(e){if(e.nodeRepulsion!=null)l.DEFAULT_REPULSION_STRENGTH=d.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion;if(e.idealEdgeLength!=null)l.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=e.idealEdgeLength;if(e.edgeElasticity!=null)l.DEFAULT_SPRING_STRENGTH=d.DEFAULT_SPRING_STRENGTH=e.edgeElasticity;if(e.nestingFactor!=null)l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor;if(e.gravity!=null)l.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=e.gravity;if(e.numIter!=null)l.MAX_ITERATIONS=d.MAX_ITERATIONS=e.numIter;if(e.gravityRange!=null)l.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange;if(e.gravityCompound!=null)l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound;if(e.gravityRangeCompound!=null)l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound;if(e.initialEnergyOnIncremental!=null)l.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental;if(e.quality=="draft")o.QUALITY=0;else if(e.quality=="proof")o.QUALITY=2;else o.QUALITY=1;l.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!e.randomize,l.ANIMATE=d.ANIMATE=o.ANIMATE=e.animate,l.TILE=e.tile,l.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==="function"?e.tilingPaddingVertical.call():e.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==="function"?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal};I.prototype.run=function(){var E,e,f=this.options,s=this.idToLNode={},c=this.layout=new L,i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var y=c.newGraphManager();this.gm=y;var T=this.options.eles.nodes(),m=this.options.eles.edges();this.root=y.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(T),c);for(var h=0;h<m.length;h++){var P=m[h],x=this.idToLNode[P.data("source")],O=this.idToLNode[P.data("target")];if(x!==O&&x.getEdgesBetween(O).length==0){var et=y.add(c.newEdge(),x,O);et.id=P.id()}}var V=function(R,B){if(typeof R==="number")R=B;var C=R.data("id"),G=i.idToLNode[C];return{x:G.getRect().getCenterX(),y:G.getRect().getCenterY()}},nt=function X(){var R=function(){if(f.fit)f.cy.fit(f.eles,f.padding);if(!E)E=!0,i.cy.one("layoutready",f.ready),i.cy.trigger({type:"layoutready",layout:i})},B=i.options.refresh,C;for(var G=0;G<B&&!C;G++)C=i.stopped||i.layout.tick();if(C){if(c.checkLayoutSuccess()&&!c.isSubLayout)c.doPostLayout();if(c.tilingPostLayout)c.tilingPostLayout();if(c.isLayoutFinished=!0,i.options.eles.nodes().positions(V),R(),i.cy.one("layoutstop",i.options.stop),i.cy.trigger({type:"layoutstop",layout:i}),e)cancelAnimationFrame(e);E=!1;return}var M=i.layout.getPositionsData();f.eles.nodes().positions(function(A,it){if(typeof A==="number")A=it;if(!A.isParent()){var j=A.id(),N=M[j],w=A;while(N==null)if(N=M[w.data("parent")]||M["DummyCompound_"+w.data("parent")],M[j]=N,w=w.parent()[0],w==null)break;if(N!=null)return{x:N.x,y:N.y};else return{x:A.position("x"),y:A.position("y")}}}),R(),e=requestAnimationFrame(X)};if(c.addListener("layoutstarted",function(){if(i.options.animate==="during")e=requestAnimationFrame(nt)}),c.runLayout(),this.options.animate!=="during")i.options.eles.nodes().not(":parent").layoutPositions(i,i.options,V),E=!1;return this},I.prototype.getTopMostNodes=function(E){var e={};for(var f=0;f<E.length;f++)e[E[f].id()]=!0;var s=E.filter(function(c,i){if(typeof c==="number")c=i;var y=c.parent()[0];while(y!=null){if(e[y.id()])return!1;y=y.parent()[0]}return!0});return s},I.prototype.processChildrenList=function(E,e,f){var s=e.length;for(var c=0;c<s;c++){var i=e[c],y=i.children(),T,m=i.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(i.outerWidth()!=null&&i.outerHeight()!=null)T=E.add(new b(f.graphManager,new H(i.position("x")-m.w/2,i.position("y")-m.h/2),new v(parseFloat(m.w),parseFloat(m.h))));else T=E.add(new b(this.graphManager));if(T.id=i.data("id"),T.paddingLeft=parseInt(i.css("padding")),T.paddingTop=parseInt(i.css("padding")),T.paddingRight=parseInt(i.css("padding")),T.paddingBottom=parseInt(i.css("padding")),this.options.nodeDimensionsIncludeLabels){if(i.isParent()){var h=i.boundingBox({includeLabels:!0,includeNodes:!1}).w,P=i.boundingBox({includeLabels:!0,includeNodes:!1}).h,x=i.css("text-halign");T.labelWidth=h,T.labelHeight=P,T.labelPos=x}}if(this.idToLNode[i.data("id")]=T,isNaN(T.rect.x))T.rect.x=0;if(isNaN(T.rect.y))T.rect.y=0;if(y!=null&&y.length>0){var O=f.getGraphManager().add(f.newGraph(),T);this.processChildrenList(O,y,f)}}},I.prototype.stop=function(){return this.stopped=!0,this};var S=function(e){e("layout","cose-bilkent",I)};if(typeof cytoscape<"u")S(cytoscape);g.exports=S}])})});var z=Ce(k(),1);ht.use(z.default);function q(u,g){u.forEach((r)=>{let n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach((o)=>{if(!["id","label","height","width","padding","x","y"].includes(o))n[o]=r[o]}),g.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}t(q,"addNodes");function W(u,g){u.forEach((r)=>{let n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach((o)=>{if(!["id","start","end"].includes(o))n[o]=r[o]}),g.add({group:"edges",data:n})})}t(W,"addEdges");function Q(u){return new Promise((g)=>{let r=p("body").append("div").attr("id","cy").attr("style","display:none"),n=ht({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),q(u.nodes,n),W(u.edges,n),n.nodes().forEach(function(d){d.layoutDimensions=()=>{let l=d.data();return{w:l.width,h:l.height}}});let o={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(o).run(),n.ready((d)=>{a.info("Cytoscape ready",d),g(n)})})}t(Q,"createCytoscapeInstance");function Z(u){return u.nodes().map((g)=>{let r=g.data(),n=g.position(),o={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach((d)=>{if(d!=="id")o[d]=r[d]}),o})}t(Z,"extractPositionedNodes");function J(u){return u.edges().map((g)=>{let r=g.data(),n=g._private.rscratch,o={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach((d)=>{if(!["id","source","target"].includes(d))o[d]=r[d]}),o})}t(J,"extractPositionedEdges");async function K(u,g){a.debug("Starting cose-bilkent layout algorithm");try{tt(u);let r=await Q(u),n=Z(r),o=J(r);return a.debug(`Layout completed: ${n.length} nodes, ${o.length} edges`),{nodes:n,edges:o}}catch(r){throw a.error("Error in cose-bilkent layout algorithm:",r),r}}t(K,"executeCoseBilkentLayout");function tt(u){if(!u)throw Error("Layout data is required");if(!u.config)throw Error("Configuration is required in layout data");if(!u.rootNode)throw Error("Root node is required");if(!u.nodes||!Array.isArray(u.nodes))throw Error("No nodes found in layout data");if(!Array.isArray(u.edges))throw Error("Edges array is required in layout data");return!0}t(tt,"validateLayoutData");var at=t(async(u,g,{insertCluster:r,insertEdge:n,insertEdgeLabel:o,insertMarkers:d,insertNode:l,log:L,positionEdgeLabel:b},{algorithm:H})=>{let v={},_={},D=g.select("g");d(D,u.markers,u.type,u.diagramId);let I=D.insert("g").attr("class","subgraphs"),U=D.insert("g").attr("class","edgePaths"),S=D.insert("g").attr("class","edgeLabels"),E=D.insert("g").attr("class","nodes");L.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(u.nodes.map(async(s)=>{if(s.isGroup){let c={...s};_[s.id]=c,v[s.id]=c,await r(I,s)}else{let c={...s};v[s.id]=c;let i=await l(E,s,{config:u.config,dir:u.direction||"TB"}),y=i.node().getBBox();c.width=y.width,c.height=y.height,c.domId=i,L.debug(`Node ${s.id} dimensions: ${y.width}x${y.height}`)}})),L.debug("Running cose-bilkent layout algorithm");let e={...u,nodes:u.nodes.map((s)=>{let c=v[s.id];return{...s,width:c.width,height:c.height}})},f=await K(e,u.config);L.debug("Positioning nodes based on layout results"),f.nodes.forEach((s)=>{let c=v[s.id];if(c?.domId)c.domId.attr("transform",`translate(${s.x}, ${s.y})`),c.x=s.x,c.y=s.y,L.debug(`Positioned node ${c.id} at center (${s.x}, ${s.y})`)}),f.edges.forEach((s)=>{let c=u.edges.find((i)=>i.id===s.id);if(c)c.points=[{x:s.startX,y:s.startY},{x:s.midX,y:s.midY},{x:s.endX,y:s.endY}]}),L.debug("Inserting and positioning edges"),await Promise.all(u.edges.map(async(s)=>{let c=await o(S,s),i=v[s.start??""],y=v[s.end??""];if(i&&y){let T=f.edges.find((m)=>m.id===s.id);if(T){L.debug("APA01 positionedEdge",T);let m={...s},h=n(U,m,_,u.type,i,y,u.diagramId);b(m,h)}else{let m={...s,points:[{x:i.x||0,y:i.y||0},{x:y.x||0,y:y.y||0}]},h=n(U,m,_,u.type,i,y,u.diagramId);b(m,h)}}})),L.debug("Cose-bilkent rendering completed")},"render"),ct=at;export{ct as render};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mi}from"./chunk-ctmxm4qd.js";export{mi as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$i}from"./chunk-tfsrk2rc.js";export{$i as createPieServices};
|