From c42b593acba9f4d2119fb84dc0862ca57d2d1e0a Mon Sep 17 00:00:00 2001 From: intuit-svc Date: Tue, 3 Dec 2024 15:32:52 -0800 Subject: [PATCH] Deploying docs for 0.10.0-next.11 --- ...er.DQqXxIk2.js => ASTExplorer.B5uzbaSo.js} | 2 +- ...qP.js => DSLContentPlayground.DzndYZw0.js} | 50 +++++++++---------- ....C_fXK8Ns.js => PlayerPreview.bT1BeelW.js} | 2 +- .../{index.DPFtMv8W.js => index.CZMVt0yS.js} | 28 +++++------ next/index.html | 2 +- next/player/team/index.html | 2 +- next/storybook-demo/project.json | 2 +- next/tools/dsl-content-playground/index.html | 2 +- next/tools/view-ast-explorer/index.html | 2 +- 9 files changed, 46 insertions(+), 46 deletions(-) rename next/_astro/{ASTExplorer.DQqXxIk2.js => ASTExplorer.B5uzbaSo.js} (99%) rename next/_astro/{DSLContentPlayground.BA6LTCqP.js => DSLContentPlayground.DzndYZw0.js} (91%) rename next/_astro/{PlayerPreview.C_fXK8Ns.js => PlayerPreview.bT1BeelW.js} (99%) rename next/_astro/{index.DPFtMv8W.js => index.CZMVt0yS.js} (66%) diff --git a/next/_astro/ASTExplorer.DQqXxIk2.js b/next/_astro/ASTExplorer.B5uzbaSo.js similarity index 99% rename from next/_astro/ASTExplorer.DQqXxIk2.js rename to next/_astro/ASTExplorer.B5uzbaSo.js index 2fea8901..c65eb7d4 100644 --- a/next/_astro/ASTExplorer.DQqXxIk2.js +++ b/next/_astro/ASTExplorer.B5uzbaSo.js @@ -1,4 +1,4 @@ -import{j as v}from"./jsx-runtime.s_qdhQ62.js";import{R as X}from"./index.DRjF_FHU.js";import{w as Cu,B as Au,L as nu,E as Eu,e as iu,f as au,T as su,g as Bu,h as ou,M as cu,l as lu,c as G,P as fu}from"./index.DPFtMv8W.js";import{s as pu}from"./index.ZI6s4LW5.js";var du=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,hu=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,mu=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,M={Space_Separator:du,ID_Start:hu,ID_Continue:mu},o={isSpaceSeparator(D){return typeof D=="string"&&M.Space_Separator.test(D)},isIdStartChar(D){return typeof D=="string"&&(D>="a"&&D<="z"||D>="A"&&D<="Z"||D==="$"||D==="_"||M.ID_Start.test(D))},isIdContinueChar(D){return typeof D=="string"&&(D>="a"&&D<="z"||D>="A"&&D<="Z"||D>="0"&&D<="9"||D==="$"||D==="_"||D==="‌"||D==="‍"||M.ID_Continue.test(D))},isDigit(D){return typeof D=="string"&&/[0-9]/.test(D)},isHexDigit(D){return typeof D=="string"&&/[0-9A-Fa-f]/.test(D)}};let q,m,x,L,N,y,p,K,k;var gu=function(C,E){q=String(C),m="start",x=[],L=0,N=1,y=0,p=void 0,K=void 0,k=void 0;do p=yu(),xu[m]();while(p.type!=="eof");return typeof E=="function"?R({"":k},"",E):k};function R(D,C,E){const n=D[C];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let l=0;l="a"&&D<="z"||D>="A"&&D<="Z"||D==="$"||D==="_"||M.ID_Start.test(D))},isIdContinueChar(D){return typeof D=="string"&&(D>="a"&&D<="z"||D>="A"&&D<="Z"||D>="0"&&D<="9"||D==="$"||D==="_"||D==="‌"||D==="‍"||M.ID_Continue.test(D))},isDigit(D){return typeof D=="string"&&/[0-9]/.test(D)},isHexDigit(D){return typeof D=="string"&&/[0-9A-Fa-f]/.test(D)}};let q,m,x,L,N,y,p,K,k;var gu=function(C,E){q=String(C),m="start",x=[],L=0,N=1,y=0,p=void 0,K=void 0,k=void 0;do p=yu(),xu[m]();while(p.type!=="eof");return typeof E=="function"?R({"":k},"",E):k};function R(D,C,E){const n=D[C];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let l=0;lu[f]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var browser={exports:{}};(function(i){(s=>{var o=Object.defineProperty,u=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,m=(h,v)=>{for(var R in v)o(h,R,{get:v[R],enumerable:!0})},d=(h,v,R,B)=>{if(v&&typeof v=="object"||typeof v=="function")for(let oe of f(v))!c.call(h,oe)&&oe!==R&&o(h,oe,{get:()=>v[oe],enumerable:!(B=u(v,oe))||B.enumerable});return h},C=h=>d(o({},"__esModule",{value:!0}),h),E=(h,v,R)=>new Promise((B,oe)=>{var se=Q=>{try{he(R.next(Q))}catch(xe){oe(xe)}},le=Q=>{try{he(R.throw(Q))}catch(xe){oe(xe)}},he=Q=>Q.done?B(Q.value):Promise.resolve(Q.value).then(se,le);he((R=R.apply(h,v)).next())}),w={};m(w,{analyzeMetafile:()=>ir,analyzeMetafileSync:()=>Fn,build:()=>An,buildSync:()=>or,context:()=>ln,default:()=>ae,formatMessages:()=>rr,formatMessagesSync:()=>Un,initialize:()=>M,stop:()=>$n,transform:()=>nr,transformSync:()=>lr,version:()=>tr}),s.exports=C(w);function ee(h){let v=B=>{if(B===null)R.write8(0);else if(typeof B=="boolean")R.write8(1),R.write8(+B);else if(typeof B=="number")R.write8(2),R.write32(B|0);else if(typeof B=="string")R.write8(3),R.write(z(B));else if(B instanceof Uint8Array)R.write8(4),R.write(B);else if(B instanceof Array){R.write8(5),R.write32(B.length);for(let oe of B)v(oe)}else{let oe=Object.keys(B);R.write8(6),R.write32(oe.length);for(let se of oe)R.write(z(se)),v(B[se])}},R=new re;return R.write32(0),R.write32(h.id<<1|+!h.isRequest),v(h.value),q(R.buf,R.len-4,0),R.buf.subarray(0,R.len)}function V(h){let v=()=>{switch(R.read8()){case 0:return null;case 1:return!!R.read8();case 2:return R.read32();case 3:return ie(R.read());case 4:return R.read();case 5:{let le=R.read32(),he=[];for(let Q=0;Q>>=1;let se=v();if(R.ptr!==h.length)throw new Error("Invalid packet");return{id:B,isRequest:oe,value:se}}var re=class{constructor(h=new Uint8Array(1024)){this.buf=h,this.len=0,this.ptr=0}_write(h){if(this.len+h>this.buf.length){let v=new Uint8Array((this.len+h)*2);v.set(this.buf),this.buf=v}return this.len+=h,this.len-h}write8(h){let v=this._write(1);this.buf[v]=h}write32(h){let v=this._write(4);q(this.buf,h,v)}write(h){let v=this._write(4+h.length);q(this.buf,h.length,v),this.buf.set(h,v+4)}_read(h){if(this.ptr+h>this.buf.length)throw new Error("Invalid packet");return this.ptr+=h,this.ptr-h}read8(){return this.buf[this._read(1)]}read32(){return F(this.buf,this._read(4))}read(){let h=this.read32(),v=new Uint8Array(h),R=this._read(v.length);return v.set(this.buf.subarray(R,R+h)),v}},z,ie,ce;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let h=new TextEncoder,v=new TextDecoder;z=R=>h.encode(R),ie=R=>v.decode(R),ce='new TextEncoder().encode("")'}else if(typeof Buffer<"u")z=h=>Buffer.from(h),ie=h=>{let{buffer:v,byteOffset:R,byteLength:B}=h;return Buffer.from(v,R,B).toString()},ce='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(z("")instanceof Uint8Array))throw new Error(`Invariant violation: "${ce} instanceof Uint8Array" is incorrectly false +import{j as jsxRuntimeExports}from"./jsx-runtime.s_qdhQ62.js";import{c as commonjsGlobal,r as reactExports,g as getDefaultExportFromCjs,R as React15,a as React}from"./index.DRjF_FHU.js";import{c as SyncWaterfallHook,e as dequal,f as SyncHook,g as AsyncSeriesWaterfallHook,h as AsyncSeriesHook,r as resolveDataRefs,l as loader,d as de}from"./index.CZMVt0yS.js";import{s as stringifyObject}from"./index.ZI6s4LW5.js";function _mergeNamespaces(i,s){for(var o=0;ou[f]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var browser={exports:{}};(function(i){(s=>{var o=Object.defineProperty,u=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,m=(h,v)=>{for(var R in v)o(h,R,{get:v[R],enumerable:!0})},d=(h,v,R,B)=>{if(v&&typeof v=="object"||typeof v=="function")for(let oe of f(v))!c.call(h,oe)&&oe!==R&&o(h,oe,{get:()=>v[oe],enumerable:!(B=u(v,oe))||B.enumerable});return h},C=h=>d(o({},"__esModule",{value:!0}),h),E=(h,v,R)=>new Promise((B,oe)=>{var se=Q=>{try{he(R.next(Q))}catch(xe){oe(xe)}},le=Q=>{try{he(R.throw(Q))}catch(xe){oe(xe)}},he=Q=>Q.done?B(Q.value):Promise.resolve(Q.value).then(se,le);he((R=R.apply(h,v)).next())}),w={};m(w,{analyzeMetafile:()=>ir,analyzeMetafileSync:()=>Fn,build:()=>Ln,buildSync:()=>or,context:()=>ln,default:()=>ae,formatMessages:()=>rr,formatMessagesSync:()=>Un,initialize:()=>M,stop:()=>$n,transform:()=>nr,transformSync:()=>lr,version:()=>tr}),s.exports=C(w);function ee(h){let v=B=>{if(B===null)R.write8(0);else if(typeof B=="boolean")R.write8(1),R.write8(+B);else if(typeof B=="number")R.write8(2),R.write32(B|0);else if(typeof B=="string")R.write8(3),R.write(z(B));else if(B instanceof Uint8Array)R.write8(4),R.write(B);else if(B instanceof Array){R.write8(5),R.write32(B.length);for(let oe of B)v(oe)}else{let oe=Object.keys(B);R.write8(6),R.write32(oe.length);for(let se of oe)R.write(z(se)),v(B[se])}},R=new re;return R.write32(0),R.write32(h.id<<1|+!h.isRequest),v(h.value),q(R.buf,R.len-4,0),R.buf.subarray(0,R.len)}function V(h){let v=()=>{switch(R.read8()){case 0:return null;case 1:return!!R.read8();case 2:return R.read32();case 3:return ie(R.read());case 4:return R.read();case 5:{let le=R.read32(),he=[];for(let Q=0;Q>>=1;let se=v();if(R.ptr!==h.length)throw new Error("Invalid packet");return{id:B,isRequest:oe,value:se}}var re=class{constructor(h=new Uint8Array(1024)){this.buf=h,this.len=0,this.ptr=0}_write(h){if(this.len+h>this.buf.length){let v=new Uint8Array((this.len+h)*2);v.set(this.buf),this.buf=v}return this.len+=h,this.len-h}write8(h){let v=this._write(1);this.buf[v]=h}write32(h){let v=this._write(4);q(this.buf,h,v)}write(h){let v=this._write(4+h.length);q(this.buf,h.length,v),this.buf.set(h,v+4)}_read(h){if(this.ptr+h>this.buf.length)throw new Error("Invalid packet");return this.ptr+=h,this.ptr-h}read8(){return this.buf[this._read(1)]}read32(){return F(this.buf,this._read(4))}read(){let h=this.read32(),v=new Uint8Array(h),R=this._read(v.length);return v.set(this.buf.subarray(R,R+h)),v}},z,ie,ce;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let h=new TextEncoder,v=new TextDecoder;z=R=>h.encode(R),ie=R=>v.decode(R),ce='new TextEncoder().encode("")'}else if(typeof Buffer<"u")z=h=>Buffer.from(h),ie=h=>{let{buffer:v,byteOffset:R,byteLength:B}=h;return Buffer.from(v,R,B).toString()},ce='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(z("")instanceof Uint8Array))throw new Error(`Invariant violation: "${ce} instanceof Uint8Array" is incorrectly false This indicates that your JavaScript environment is broken. You cannot use esbuild in this environment because esbuild relies on this invariant. This is not a problem with esbuild. You need to fix your environment instead. -`);function F(h,v){return h[v++]|h[v++]<<8|h[v++]<<16|h[v++]<<24}function q(h,v,R){h[R++]=v,h[R++]=v>>8,h[R++]=v>>16,h[R++]=v>>24}var A=JSON.stringify,$="warning",X="silent";function J(h){if(tt(h,"target"),h.indexOf(",")>=0)throw new Error(`Invalid target: ${h}`);return h}var K=()=>null,b=h=>typeof h=="boolean"?null:"a boolean",g=h=>typeof h=="string"?null:"a string",x=h=>h instanceof RegExp?null:"a RegExp object",O=h=>typeof h=="number"&&h===(h|0)?null:"an integer",te=h=>typeof h=="function"?null:"a function",Z=h=>Array.isArray(h)?null:"an array",we=h=>typeof h=="object"&&h!==null&&!Array.isArray(h)?null:"an object",Le=h=>typeof h=="object"&&h!==null?null:"an array or an object",Ke=h=>h instanceof WebAssembly.Module?null:"a WebAssembly.Module",Xe=h=>typeof h=="object"&&!Array.isArray(h)?null:"an object or null",Tt=h=>typeof h=="string"||typeof h=="boolean"?null:"a string or a boolean",ct=h=>typeof h=="string"||typeof h=="object"&&h!==null&&!Array.isArray(h)?null:"a string or an object",On=h=>typeof h=="string"||Array.isArray(h)?null:"a string or an array",ye=h=>typeof h=="string"||h instanceof Uint8Array?null:"a string or a Uint8Array",je=h=>typeof h=="string"||h instanceof URL?null:"a string or a URL";function T(h,v,R,B){let oe=h[R];if(v[R+""]=!0,oe===void 0)return;let se=B(oe);if(se!==null)throw new Error(`${A(R)} must be ${se}`);return oe}function $e(h,v,R){for(let B in h)if(!(B in v))throw new Error(`Invalid option ${R}: ${A(B)}`)}function lt(h){let v=Object.create(null),R=T(h,v,"wasmURL",je),B=T(h,v,"wasmModule",Ke),oe=T(h,v,"worker",b);return $e(h,v,"in initialize() call"),{wasmURL:R,wasmModule:B,worker:oe}}function Ot(h){let v;if(h!==void 0){v=Object.create(null);for(let R in h){let B=h[R];if(typeof B=="string"||B===!1)v[R]=B;else throw new Error(`Expected ${A(R)} in mangle cache to map to either a string or false`)}}return v}function yt(h,v,R,B,oe){let se=T(v,R,"color",b),le=T(v,R,"logLevel",g),he=T(v,R,"logLimit",O);se!==void 0?h.push(`--color=${se}`):B&&h.push("--color=true"),h.push(`--log-level=${le||oe}`),h.push(`--log-limit=${he||0}`)}function tt(h,v,R){if(typeof h!="string")throw new Error(`Expected value for ${v}${R!==void 0?" "+A(R):""} to be a string, got ${typeof h} instead`);return h}function St(h,v,R){let B=T(v,R,"legalComments",g),oe=T(v,R,"sourceRoot",g),se=T(v,R,"sourcesContent",b),le=T(v,R,"target",On),he=T(v,R,"format",g),Q=T(v,R,"globalName",g),xe=T(v,R,"mangleProps",x),Te=T(v,R,"reserveProps",x),Ce=T(v,R,"mangleQuoted",b),qe=T(v,R,"minify",b),ze=T(v,R,"minifySyntax",b),ke=T(v,R,"minifyWhitespace",b),it=T(v,R,"minifyIdentifiers",b),ue=T(v,R,"lineLimit",O),Qe=T(v,R,"drop",Z),Je=T(v,R,"dropLabels",Z),ge=T(v,R,"charset",g),W=T(v,R,"treeShaking",b),j=T(v,R,"ignoreAnnotations",b),U=T(v,R,"jsx",g),fe=T(v,R,"jsxFactory",g),me=T(v,R,"jsxFragment",g),Pe=T(v,R,"jsxImportSource",g),Ne=T(v,R,"jsxDev",b),S=T(v,R,"jsxSideEffects",b),k=T(v,R,"define",we),ne=T(v,R,"logOverride",we),pe=T(v,R,"supported",we),Ee=T(v,R,"pure",Z),Ae=T(v,R,"keepNames",b),De=T(v,R,"platform",g),Be=T(v,R,"tsconfigRaw",ct);if(B&&h.push(`--legal-comments=${B}`),oe!==void 0&&h.push(`--source-root=${oe}`),se!==void 0&&h.push(`--sources-content=${se}`),le&&(Array.isArray(le)?h.push(`--target=${Array.from(le).map(J).join(",")}`):h.push(`--target=${J(le)}`)),he&&h.push(`--format=${he}`),Q&&h.push(`--global-name=${Q}`),De&&h.push(`--platform=${De}`),Be&&h.push(`--tsconfig-raw=${typeof Be=="string"?Be:JSON.stringify(Be)}`),qe&&h.push("--minify"),ze&&h.push("--minify-syntax"),ke&&h.push("--minify-whitespace"),it&&h.push("--minify-identifiers"),ue&&h.push(`--line-limit=${ue}`),ge&&h.push(`--charset=${ge}`),W!==void 0&&h.push(`--tree-shaking=${W}`),j&&h.push("--ignore-annotations"),Qe)for(let Oe of Qe)h.push(`--drop:${tt(Oe,"drop")}`);if(Je&&h.push(`--drop-labels=${Array.from(Je).map(Oe=>tt(Oe,"dropLabels")).join(",")}`),xe&&h.push(`--mangle-props=${xe.source}`),Te&&h.push(`--reserve-props=${Te.source}`),Ce!==void 0&&h.push(`--mangle-quoted=${Ce}`),U&&h.push(`--jsx=${U}`),fe&&h.push(`--jsx-factory=${fe}`),me&&h.push(`--jsx-fragment=${me}`),Pe&&h.push(`--jsx-import-source=${Pe}`),Ne&&h.push("--jsx-dev"),S&&h.push("--jsx-side-effects"),k)for(let Oe in k){if(Oe.indexOf("=")>=0)throw new Error(`Invalid define: ${Oe}`);h.push(`--define:${Oe}=${tt(k[Oe],"define",Oe)}`)}if(ne)for(let Oe in ne){if(Oe.indexOf("=")>=0)throw new Error(`Invalid log override: ${Oe}`);h.push(`--log-override:${Oe}=${tt(ne[Oe],"log override",Oe)}`)}if(pe)for(let Oe in pe){if(Oe.indexOf("=")>=0)throw new Error(`Invalid supported: ${Oe}`);const Ue=pe[Oe];if(typeof Ue!="boolean")throw new Error(`Expected value for supported ${A(Oe)} to be a boolean, got ${typeof Ue} instead`);h.push(`--supported:${Oe}=${Ue}`)}if(Ee)for(let Oe of Ee)h.push(`--pure:${tt(Oe,"pure")}`);Ae&&h.push("--keep-names")}function zt(h,v,R,B,oe){var se;let le=[],he=[],Q=Object.create(null),xe=null,Te=null;yt(le,v,Q,R,B),St(le,v,Q);let Ce=T(v,Q,"sourcemap",Tt),qe=T(v,Q,"bundle",b),ze=T(v,Q,"splitting",b),ke=T(v,Q,"preserveSymlinks",b),it=T(v,Q,"metafile",b),ue=T(v,Q,"outfile",g),Qe=T(v,Q,"outdir",g),Je=T(v,Q,"outbase",g),ge=T(v,Q,"tsconfig",g),W=T(v,Q,"resolveExtensions",Z),j=T(v,Q,"nodePaths",Z),U=T(v,Q,"mainFields",Z),fe=T(v,Q,"conditions",Z),me=T(v,Q,"external",Z),Pe=T(v,Q,"packages",g),Ne=T(v,Q,"alias",we),S=T(v,Q,"loader",we),k=T(v,Q,"outExtension",we),ne=T(v,Q,"publicPath",g),pe=T(v,Q,"entryNames",g),Ee=T(v,Q,"chunkNames",g),Ae=T(v,Q,"assetNames",g),De=T(v,Q,"inject",Z),Be=T(v,Q,"banner",we),Oe=T(v,Q,"footer",we),Ue=T(v,Q,"entryPoints",Le),Ye=T(v,Q,"absWorkingDir",g),We=T(v,Q,"stdin",we),et=(se=T(v,Q,"write",b))!=null?se:oe,dt=T(v,Q,"allowOverwrite",b),Rt=T(v,Q,"mangleCache",we);if(Q.plugins=!0,$e(v,Q,`in ${h}() call`),Ce&&le.push(`--sourcemap${Ce===!0?"":`=${Ce}`}`),qe&&le.push("--bundle"),dt&&le.push("--allow-overwrite"),ze&&le.push("--splitting"),ke&&le.push("--preserve-symlinks"),it&&le.push("--metafile"),ue&&le.push(`--outfile=${ue}`),Qe&&le.push(`--outdir=${Qe}`),Je&&le.push(`--outbase=${Je}`),ge&&le.push(`--tsconfig=${ge}`),Pe&&le.push(`--packages=${Pe}`),W){let Re=[];for(let rt of W){if(tt(rt,"resolve extension"),rt.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${rt}`);Re.push(rt)}le.push(`--resolve-extensions=${Re.join(",")}`)}if(ne&&le.push(`--public-path=${ne}`),pe&&le.push(`--entry-names=${pe}`),Ee&&le.push(`--chunk-names=${Ee}`),Ae&&le.push(`--asset-names=${Ae}`),U){let Re=[];for(let rt of U){if(tt(rt,"main field"),rt.indexOf(",")>=0)throw new Error(`Invalid main field: ${rt}`);Re.push(rt)}le.push(`--main-fields=${Re.join(",")}`)}if(fe){let Re=[];for(let rt of fe){if(tt(rt,"condition"),rt.indexOf(",")>=0)throw new Error(`Invalid condition: ${rt}`);Re.push(rt)}le.push(`--conditions=${Re.join(",")}`)}if(me)for(let Re of me)le.push(`--external:${tt(Re,"external")}`);if(Ne)for(let Re in Ne){if(Re.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${Re}`);le.push(`--alias:${Re}=${tt(Ne[Re],"alias",Re)}`)}if(Be)for(let Re in Be){if(Re.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${Re}`);le.push(`--banner:${Re}=${tt(Be[Re],"banner",Re)}`)}if(Oe)for(let Re in Oe){if(Re.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${Re}`);le.push(`--footer:${Re}=${tt(Oe[Re],"footer",Re)}`)}if(De)for(let Re of De)le.push(`--inject:${tt(Re,"inject")}`);if(S)for(let Re in S){if(Re.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${Re}`);le.push(`--loader:${Re}=${tt(S[Re],"loader",Re)}`)}if(k)for(let Re in k){if(Re.indexOf("=")>=0)throw new Error(`Invalid out extension: ${Re}`);le.push(`--out-extension:${Re}=${tt(k[Re],"out extension",Re)}`)}if(Ue)if(Array.isArray(Ue))for(let Re=0,rt=Ue.length;Re{let W=he+ge.length;if(W>le.length){let U=new Uint8Array(W*2);U.set(le),le=U}le.set(ge,he),he+=ge.length;let j=0;for(;j+4<=he;){let U=F(le,j);if(j+4+U>he)break;j+=4,ke(le.subarray(j,j+U)),j+=U}j>0&&(le.copyWithin(0,j,he),he-=j)},xe=ge=>{R.didClose=!0,ge&&(R.reason=": "+(ge.message||ge));const W="The service was stopped"+R.reason;for(let j in B)B[j](W,null);B={}},Te=(ge,W,j)=>{if(R.didClose)return j("The service is no longer running"+R.reason,null);let U=oe++;B[U]=(fe,me)=>{try{j(fe,me)}finally{ge&&ge.unref()}},ge&&ge.ref(),h.writeToStdin(ee({id:U,isRequest:!0,value:W}))},Ce=(ge,W)=>{if(R.didClose)throw new Error("The service is no longer running"+R.reason);h.writeToStdin(ee({id:ge,isRequest:!1,value:W}))},qe=(ge,W)=>E(this,null,function*(){try{if(W.command==="ping"){Ce(ge,{});return}if(typeof W.key=="number"){const j=v[W.key];if(!j)return;const U=j[W.command];if(U){yield U(ge,W);return}}throw new Error("Invalid command: "+W.command)}catch(j){const U=[kt(j,h,null,void 0,"")];try{Ce(ge,{errors:U})}catch{}}}),ze=!0,ke=ge=>{if(ze){ze=!1;let j=String.fromCharCode(...ge);if(j!=="0.19.12")throw new Error(`Cannot start service: Host version "0.19.12" does not match binary version ${A(j)}`);return}let W=V(ge);if(W.isRequest)qe(W.id,W.value);else{let j=B[W.id];delete B[W.id],W.value.error?j(W.value.error,{}):j(null,W.value)}};return{readFromStdout:Q,afterClose:xe,service:{buildOrContext:({callName:ge,refs:W,options:j,isTTY:U,defaultWD:fe,callback:me})=>{let Pe=0;const Ne=se++,S={},k={ref(){++Pe===1&&W&&W.ref()},unref(){--Pe===0&&(delete v[Ne],W&&W.unref())}};v[Ne]=S,k.ref(),Ft(ge,Ne,Te,Ce,k,h,S,j,U,fe,(ne,pe)=>{try{me(ne,pe)}finally{k.unref()}})},transform:({callName:ge,refs:W,input:j,options:U,isTTY:fe,fs:me,callback:Pe})=>{const Ne=vt();let S=k=>{try{if(typeof j!="string"&&!(j instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:ne,mangleCache:pe}=hn(ge,U,fe,X),Ee={command:"transform",flags:ne,inputFS:k!==null,input:k!==null?z(k):typeof j=="string"?z(j):j};pe&&(Ee.mangleCache=pe),Te(W,Ee,(Ae,De)=>{if(Ae)return Pe(new Error(Ae),null);let Be=It(De.errors,Ne),Oe=It(De.warnings,Ne),Ue=1,Ye=()=>{if(--Ue===0){let We={warnings:Oe,code:De.code,map:De.map,mangleCache:void 0,legalComments:void 0};"legalComments"in De&&(We.legalComments=De?.legalComments),De.mangleCache&&(We.mangleCache=De?.mangleCache),Pe(null,We)}};if(Be.length>0)return Pe(Bt("Transform failed",Be,Oe),null);De.codeFS&&(Ue++,me.readFile(De.code,(We,et)=>{We!==null?Pe(We,null):(De.code=et,Ye())})),De.mapFS&&(Ue++,me.readFile(De.map,(We,et)=>{We!==null?Pe(We,null):(De.map=et,Ye())})),Ye()})}catch(ne){let pe=[];try{yt(pe,U,{},fe,X)}catch{}const Ee=kt(ne,h,Ne,void 0,"");Te(W,{command:"error",flags:pe,error:Ee},()=>{Ee.detail=Ne.load(Ee.detail),Pe(Bt("Transform failed",[Ee],[]),null)})}};if((typeof j=="string"||j instanceof Uint8Array)&&j.length>1024*1024){let k=S;S=()=>me.writeFile(j,k)}S(null)},formatMessages:({callName:ge,refs:W,messages:j,options:U,callback:fe})=>{if(!U)throw new Error(`Missing second argument in ${ge}() call`);let me={},Pe=T(U,me,"kind",g),Ne=T(U,me,"color",b),S=T(U,me,"terminalWidth",O);if($e(U,me,`in ${ge}() call`),Pe===void 0)throw new Error(`Missing "kind" in ${ge}() call`);if(Pe!=="error"&&Pe!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${ge}() call`);let k={command:"format-msgs",messages:Nt(j,"messages",null,"",S),isWarning:Pe==="warning"};Ne!==void 0&&(k.color=Ne),S!==void 0&&(k.terminalWidth=S),Te(W,k,(ne,pe)=>{if(ne)return fe(new Error(ne),null);fe(null,pe.messages)})},analyzeMetafile:({callName:ge,refs:W,metafile:j,options:U,callback:fe})=>{U===void 0&&(U={});let me={},Pe=T(U,me,"color",b),Ne=T(U,me,"verbose",b);$e(U,me,`in ${ge}() call`);let S={command:"analyze-metafile",metafile:j};Pe!==void 0&&(S.color=Pe),Ne!==void 0&&(S.verbose=Ne),Te(W,S,(k,ne)=>{if(k)return fe(new Error(k),null);fe(null,ne.result)})}}}}function Ft(h,v,R,B,oe,se,le,he,Q,xe,Te){const Ce=vt(),qe=h==="context",ze=(ue,Qe)=>{const Je=[];try{yt(Je,he,{},Q,$)}catch{}const ge=kt(ue,se,Ce,void 0,Qe);R(oe,{command:"error",flags:Je,error:ge},()=>{ge.detail=Ce.load(ge.detail),Te(Bt(qe?"Context failed":"Build failed",[ge],[]),null)})};let ke;if(typeof he=="object"){const ue=he.plugins;if(ue!==void 0){if(!Array.isArray(ue))return ze(new Error('"plugins" must be an array'),"");ke=ue}}if(ke&&ke.length>0){if(se.isSync)return ze(new Error("Cannot use plugins in synchronous API calls"),"");ht(v,R,B,oe,se,le,he,ke,Ce).then(ue=>{if(!ue.ok)return ze(ue.error,ue.pluginName);try{it(ue.requestPlugins,ue.runOnEndCallbacks,ue.scheduleOnDisposeCallbacks)}catch(Qe){ze(Qe,"")}},ue=>ze(ue,""));return}try{it(null,(ue,Qe)=>Qe([],[]),()=>{})}catch(ue){ze(ue,"")}function it(ue,Qe,Je){const ge=se.hasFS,{entries:W,flags:j,write:U,stdinContents:fe,stdinResolveDir:me,absWorkingDir:Pe,nodePaths:Ne,mangleCache:S}=zt(h,he,Q,$,ge);if(U&&!se.hasFS)throw new Error('The "write" option is unavailable in this environment');const k={command:"build",key:v,entries:W,flags:j,write:U,stdinContents:fe,stdinResolveDir:me,absWorkingDir:Pe||xe,nodePaths:Ne,context:qe};ue&&(k.plugins=ue),S&&(k.mangleCache=S);const ne=(Ae,De)=>{const Be={errors:It(Ae.errors,Ce),warnings:It(Ae.warnings,Ce),outputFiles:void 0,metafile:void 0,mangleCache:void 0},Oe=Be.errors.slice(),Ue=Be.warnings.slice();Ae.outputFiles&&(Be.outputFiles=Ae.outputFiles.map(er)),Ae.metafile&&(Be.metafile=JSON.parse(Ae.metafile)),Ae.mangleCache&&(Be.mangleCache=Ae.mangleCache),Ae.writeToStdout!==void 0&&console.log(ie(Ae.writeToStdout).replace(/\n$/,"")),Qe(Be,(Ye,We)=>{if(Oe.length>0||Ye.length>0){const et=Bt("Build failed",Oe.concat(Ye),Ue.concat(We));return De(et,null,Ye,We)}De(null,Be,Ye,We)})};let pe,Ee;qe&&(le["on-end"]=(Ae,De)=>new Promise(Be=>{ne(De,(Oe,Ue,Ye,We)=>{const et={errors:Ye,warnings:We};Ee&&Ee(Oe,Ue),pe=void 0,Ee=void 0,B(Ae,et),Be()})})),R(oe,k,(Ae,De)=>{if(Ae)return Te(new Error(Ae),null);if(!qe)return ne(De,(Ue,Ye)=>(Je(),Te(Ue,Ye)));if(De.errors.length>0)return Te(Bt("Context failed",De.errors,De.warnings),null);let Be=!1;const Oe={rebuild:()=>(pe||(pe=new Promise((Ue,Ye)=>{let We;Ee=(dt,Rt)=>{We||(We=()=>dt?Ye(dt):Ue(Rt))};const et=()=>{R(oe,{command:"rebuild",key:v},(Rt,Mt)=>{Rt?Ye(new Error(Rt)):We?We():et()})};et()})),pe),watch:(Ue={})=>new Promise((Ye,We)=>{if(!se.hasFS)throw new Error('Cannot use the "watch" API in this environment');$e(Ue,{},"in watch() call"),R(oe,{command:"watch",key:v},Rt=>{Rt?We(new Error(Rt)):Ye(void 0)})}),serve:(Ue={})=>new Promise((Ye,We)=>{if(!se.hasFS)throw new Error('Cannot use the "serve" API in this environment');const et={},dt=T(Ue,et,"port",O),Rt=T(Ue,et,"host",g),Mt=T(Ue,et,"servedir",g),Re=T(Ue,et,"keyfile",g),rt=T(Ue,et,"certfile",g),He=T(Ue,et,"fallback",g),Et=T(Ue,et,"onRequest",te);$e(Ue,et,"in serve() call");const At={command:"serve",key:v,onRequest:!!Et};dt!==void 0&&(At.port=dt),Rt!==void 0&&(At.host=Rt),Mt!==void 0&&(At.servedir=Mt),Re!==void 0&&(At.keyfile=Re),rt!==void 0&&(At.certfile=rt),He!==void 0&&(At.fallback=He),R(oe,At,(Ln,Tn)=>{if(Ln)return We(new Error(Ln));Et&&(le["serve-request"]=(Nr,zn)=>{Et(zn.args),B(Nr,{})}),Ye(Tn)})}),cancel:()=>new Promise(Ue=>{if(Be)return Ue();R(oe,{command:"cancel",key:v},()=>{Ue()})}),dispose:()=>new Promise(Ue=>{if(Be)return Ue();Be=!0,R(oe,{command:"dispose",key:v},()=>{Ue(),Je(),oe.unref()})})};oe.ref(),Te(null,Oe)})}}var ht=(h,v,R,B,oe,se,le,he,Q)=>E(void 0,null,function*(){let xe=[],Te=[],Ce={},qe={},ze=[],ke=0,it=0,ue=[],Qe=!1;he=[...he];for(let W of he){let j={};if(typeof W!="object")throw new Error(`Plugin at index ${it} must be an object`);const U=T(W,j,"name",g);if(typeof U!="string"||U==="")throw new Error(`Plugin at index ${it} is missing a name`);try{let fe=T(W,j,"setup",te);if(typeof fe!="function")throw new Error("Plugin is missing a setup function");$e(W,j,`on plugin ${A(U)}`);let me={name:U,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};it++;let Ne=fe({initialOptions:le,resolve:(S,k={})=>{if(!Qe)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof S!="string")throw new Error("The path to resolve must be a string");let ne=Object.create(null),pe=T(k,ne,"pluginName",g),Ee=T(k,ne,"importer",g),Ae=T(k,ne,"namespace",g),De=T(k,ne,"resolveDir",g),Be=T(k,ne,"kind",g),Oe=T(k,ne,"pluginData",K);return $e(k,ne,"in resolve() call"),new Promise((Ue,Ye)=>{const We={command:"resolve",path:S,key:h,pluginName:U};if(pe!=null&&(We.pluginName=pe),Ee!=null&&(We.importer=Ee),Ae!=null&&(We.namespace=Ae),De!=null&&(We.resolveDir=De),Be!=null)We.kind=Be;else throw new Error('Must specify "kind" when calling "resolve"');Oe!=null&&(We.pluginData=Q.store(Oe)),v(B,We,(et,dt)=>{et!==null?Ye(new Error(et)):Ue({errors:It(dt.errors,Q),warnings:It(dt.warnings,Q),path:dt.path,external:dt.external,sideEffects:dt.sideEffects,namespace:dt.namespace,suffix:dt.suffix,pluginData:Q.load(dt.pluginData)})})})},onStart(S){let k='This error came from the "onStart" callback registered here:',ne=at(new Error(k),oe,"onStart");xe.push({name:U,callback:S,note:ne}),me.onStart=!0},onEnd(S){let k='This error came from the "onEnd" callback registered here:',ne=at(new Error(k),oe,"onEnd");Te.push({name:U,callback:S,note:ne}),me.onEnd=!0},onResolve(S,k){let ne='This error came from the "onResolve" callback registered here:',pe=at(new Error(ne),oe,"onResolve"),Ee={},Ae=T(S,Ee,"filter",x),De=T(S,Ee,"namespace",g);if($e(S,Ee,`in onResolve() call for plugin ${A(U)}`),Ae==null)throw new Error("onResolve() call is missing a filter");let Be=ke++;Ce[Be]={name:U,callback:k,note:pe},me.onResolve.push({id:Be,filter:Ae.source,namespace:De||""})},onLoad(S,k){let ne='This error came from the "onLoad" callback registered here:',pe=at(new Error(ne),oe,"onLoad"),Ee={},Ae=T(S,Ee,"filter",x),De=T(S,Ee,"namespace",g);if($e(S,Ee,`in onLoad() call for plugin ${A(U)}`),Ae==null)throw new Error("onLoad() call is missing a filter");let Be=ke++;qe[Be]={name:U,callback:k,note:pe},me.onLoad.push({id:Be,filter:Ae.source,namespace:De||""})},onDispose(S){ze.push(S)},esbuild:oe.esbuild});Ne&&(yield Ne),ue.push(me)}catch(fe){return{ok:!1,error:fe,pluginName:U}}}se["on-start"]=(W,j)=>E(void 0,null,function*(){let U={errors:[],warnings:[]};yield Promise.all(xe.map(fe=>E(void 0,[fe],function*({name:me,callback:Pe,note:Ne}){try{let S=yield Pe();if(S!=null){if(typeof S!="object")throw new Error(`Expected onStart() callback in plugin ${A(me)} to return an object`);let k={},ne=T(S,k,"errors",Z),pe=T(S,k,"warnings",Z);$e(S,k,`from onStart() callback in plugin ${A(me)}`),ne!=null&&U.errors.push(...Nt(ne,"errors",Q,me,void 0)),pe!=null&&U.warnings.push(...Nt(pe,"warnings",Q,me,void 0))}}catch(S){U.errors.push(kt(S,oe,Q,Ne&&Ne(),me))}}))),R(W,U)}),se["on-resolve"]=(W,j)=>E(void 0,null,function*(){let U={},fe="",me,Pe;for(let Ne of j.ids)try{({name:fe,callback:me,note:Pe}=Ce[Ne]);let S=yield me({path:j.path,importer:j.importer,namespace:j.namespace,resolveDir:j.resolveDir,kind:j.kind,pluginData:Q.load(j.pluginData)});if(S!=null){if(typeof S!="object")throw new Error(`Expected onResolve() callback in plugin ${A(fe)} to return an object`);let k={},ne=T(S,k,"pluginName",g),pe=T(S,k,"path",g),Ee=T(S,k,"namespace",g),Ae=T(S,k,"suffix",g),De=T(S,k,"external",b),Be=T(S,k,"sideEffects",b),Oe=T(S,k,"pluginData",K),Ue=T(S,k,"errors",Z),Ye=T(S,k,"warnings",Z),We=T(S,k,"watchFiles",Z),et=T(S,k,"watchDirs",Z);$e(S,k,`from onResolve() callback in plugin ${A(fe)}`),U.id=Ne,ne!=null&&(U.pluginName=ne),pe!=null&&(U.path=pe),Ee!=null&&(U.namespace=Ee),Ae!=null&&(U.suffix=Ae),De!=null&&(U.external=De),Be!=null&&(U.sideEffects=Be),Oe!=null&&(U.pluginData=Q.store(Oe)),Ue!=null&&(U.errors=Nt(Ue,"errors",Q,fe,void 0)),Ye!=null&&(U.warnings=Nt(Ye,"warnings",Q,fe,void 0)),We!=null&&(U.watchFiles=Ct(We,"watchFiles")),et!=null&&(U.watchDirs=Ct(et,"watchDirs"));break}}catch(S){U={id:Ne,errors:[kt(S,oe,Q,Pe&&Pe(),fe)]};break}R(W,U)}),se["on-load"]=(W,j)=>E(void 0,null,function*(){let U={},fe="",me,Pe;for(let Ne of j.ids)try{({name:fe,callback:me,note:Pe}=qe[Ne]);let S=yield me({path:j.path,namespace:j.namespace,suffix:j.suffix,pluginData:Q.load(j.pluginData),with:j.with});if(S!=null){if(typeof S!="object")throw new Error(`Expected onLoad() callback in plugin ${A(fe)} to return an object`);let k={},ne=T(S,k,"pluginName",g),pe=T(S,k,"contents",ye),Ee=T(S,k,"resolveDir",g),Ae=T(S,k,"pluginData",K),De=T(S,k,"loader",g),Be=T(S,k,"errors",Z),Oe=T(S,k,"warnings",Z),Ue=T(S,k,"watchFiles",Z),Ye=T(S,k,"watchDirs",Z);$e(S,k,`from onLoad() callback in plugin ${A(fe)}`),U.id=Ne,ne!=null&&(U.pluginName=ne),pe instanceof Uint8Array?U.contents=pe:pe!=null&&(U.contents=z(pe)),Ee!=null&&(U.resolveDir=Ee),Ae!=null&&(U.pluginData=Q.store(Ae)),De!=null&&(U.loader=De),Be!=null&&(U.errors=Nt(Be,"errors",Q,fe,void 0)),Oe!=null&&(U.warnings=Nt(Oe,"warnings",Q,fe,void 0)),Ue!=null&&(U.watchFiles=Ct(Ue,"watchFiles")),Ye!=null&&(U.watchDirs=Ct(Ye,"watchDirs"));break}}catch(S){U={id:Ne,errors:[kt(S,oe,Q,Pe&&Pe(),fe)]};break}R(W,U)});let Je=(W,j)=>j([],[]);Te.length>0&&(Je=(W,j)=>{E(void 0,null,function*(){const U=[],fe=[];for(const{name:me,callback:Pe,note:Ne}of Te){let S,k;try{const ne=yield Pe(W);if(ne!=null){if(typeof ne!="object")throw new Error(`Expected onEnd() callback in plugin ${A(me)} to return an object`);let pe={},Ee=T(ne,pe,"errors",Z),Ae=T(ne,pe,"warnings",Z);$e(ne,pe,`from onEnd() callback in plugin ${A(me)}`),Ee!=null&&(S=Nt(Ee,"errors",Q,me,void 0)),Ae!=null&&(k=Nt(Ae,"warnings",Q,me,void 0))}}catch(ne){S=[kt(ne,oe,Q,Ne&&Ne(),me)]}if(S){U.push(...S);try{W.errors.push(...S)}catch{}}if(k){fe.push(...k);try{W.warnings.push(...k)}catch{}}}j(U,fe)})});let ge=()=>{for(const W of ze)setTimeout(()=>W(),0)};return Qe=!0,{ok:!0,requestPlugins:ue,runOnEndCallbacks:Je,scheduleOnDisposeCallbacks:ge}});function vt(){const h=new Map;let v=0;return{load(R){return h.get(R)},store(R){if(R===void 0)return-1;const B=v++;return h.set(B,R),B}}}function at(h,v,R){let B,oe=!1;return()=>{if(oe)return B;oe=!0;try{let se=(h.stack+"").split(` +`);function F(h,v){return h[v++]|h[v++]<<8|h[v++]<<16|h[v++]<<24}function q(h,v,R){h[R++]=v,h[R++]=v>>8,h[R++]=v>>16,h[R++]=v>>24}var L=JSON.stringify,$="warning",X="silent";function J(h){if(tt(h,"target"),h.indexOf(",")>=0)throw new Error(`Invalid target: ${h}`);return h}var K=()=>null,b=h=>typeof h=="boolean"?null:"a boolean",g=h=>typeof h=="string"?null:"a string",x=h=>h instanceof RegExp?null:"a RegExp object",O=h=>typeof h=="number"&&h===(h|0)?null:"an integer",te=h=>typeof h=="function"?null:"a function",Z=h=>Array.isArray(h)?null:"an array",we=h=>typeof h=="object"&&h!==null&&!Array.isArray(h)?null:"an object",Ae=h=>typeof h=="object"&&h!==null?null:"an array or an object",Ke=h=>h instanceof WebAssembly.Module?null:"a WebAssembly.Module",Xe=h=>typeof h=="object"&&!Array.isArray(h)?null:"an object or null",Tt=h=>typeof h=="string"||typeof h=="boolean"?null:"a string or a boolean",ct=h=>typeof h=="string"||typeof h=="object"&&h!==null&&!Array.isArray(h)?null:"a string or an object",On=h=>typeof h=="string"||Array.isArray(h)?null:"a string or an array",ye=h=>typeof h=="string"||h instanceof Uint8Array?null:"a string or a Uint8Array",je=h=>typeof h=="string"||h instanceof URL?null:"a string or a URL";function T(h,v,R,B){let oe=h[R];if(v[R+""]=!0,oe===void 0)return;let se=B(oe);if(se!==null)throw new Error(`${L(R)} must be ${se}`);return oe}function $e(h,v,R){for(let B in h)if(!(B in v))throw new Error(`Invalid option ${R}: ${L(B)}`)}function lt(h){let v=Object.create(null),R=T(h,v,"wasmURL",je),B=T(h,v,"wasmModule",Ke),oe=T(h,v,"worker",b);return $e(h,v,"in initialize() call"),{wasmURL:R,wasmModule:B,worker:oe}}function Ot(h){let v;if(h!==void 0){v=Object.create(null);for(let R in h){let B=h[R];if(typeof B=="string"||B===!1)v[R]=B;else throw new Error(`Expected ${L(R)} in mangle cache to map to either a string or false`)}}return v}function yt(h,v,R,B,oe){let se=T(v,R,"color",b),le=T(v,R,"logLevel",g),he=T(v,R,"logLimit",O);se!==void 0?h.push(`--color=${se}`):B&&h.push("--color=true"),h.push(`--log-level=${le||oe}`),h.push(`--log-limit=${he||0}`)}function tt(h,v,R){if(typeof h!="string")throw new Error(`Expected value for ${v}${R!==void 0?" "+L(R):""} to be a string, got ${typeof h} instead`);return h}function St(h,v,R){let B=T(v,R,"legalComments",g),oe=T(v,R,"sourceRoot",g),se=T(v,R,"sourcesContent",b),le=T(v,R,"target",On),he=T(v,R,"format",g),Q=T(v,R,"globalName",g),xe=T(v,R,"mangleProps",x),Te=T(v,R,"reserveProps",x),Ce=T(v,R,"mangleQuoted",b),qe=T(v,R,"minify",b),ze=T(v,R,"minifySyntax",b),ke=T(v,R,"minifyWhitespace",b),it=T(v,R,"minifyIdentifiers",b),ue=T(v,R,"lineLimit",O),Qe=T(v,R,"drop",Z),Je=T(v,R,"dropLabels",Z),ge=T(v,R,"charset",g),W=T(v,R,"treeShaking",b),j=T(v,R,"ignoreAnnotations",b),U=T(v,R,"jsx",g),fe=T(v,R,"jsxFactory",g),me=T(v,R,"jsxFragment",g),Pe=T(v,R,"jsxImportSource",g),Ne=T(v,R,"jsxDev",b),S=T(v,R,"jsxSideEffects",b),k=T(v,R,"define",we),ne=T(v,R,"logOverride",we),pe=T(v,R,"supported",we),Ee=T(v,R,"pure",Z),Le=T(v,R,"keepNames",b),De=T(v,R,"platform",g),Be=T(v,R,"tsconfigRaw",ct);if(B&&h.push(`--legal-comments=${B}`),oe!==void 0&&h.push(`--source-root=${oe}`),se!==void 0&&h.push(`--sources-content=${se}`),le&&(Array.isArray(le)?h.push(`--target=${Array.from(le).map(J).join(",")}`):h.push(`--target=${J(le)}`)),he&&h.push(`--format=${he}`),Q&&h.push(`--global-name=${Q}`),De&&h.push(`--platform=${De}`),Be&&h.push(`--tsconfig-raw=${typeof Be=="string"?Be:JSON.stringify(Be)}`),qe&&h.push("--minify"),ze&&h.push("--minify-syntax"),ke&&h.push("--minify-whitespace"),it&&h.push("--minify-identifiers"),ue&&h.push(`--line-limit=${ue}`),ge&&h.push(`--charset=${ge}`),W!==void 0&&h.push(`--tree-shaking=${W}`),j&&h.push("--ignore-annotations"),Qe)for(let Oe of Qe)h.push(`--drop:${tt(Oe,"drop")}`);if(Je&&h.push(`--drop-labels=${Array.from(Je).map(Oe=>tt(Oe,"dropLabels")).join(",")}`),xe&&h.push(`--mangle-props=${xe.source}`),Te&&h.push(`--reserve-props=${Te.source}`),Ce!==void 0&&h.push(`--mangle-quoted=${Ce}`),U&&h.push(`--jsx=${U}`),fe&&h.push(`--jsx-factory=${fe}`),me&&h.push(`--jsx-fragment=${me}`),Pe&&h.push(`--jsx-import-source=${Pe}`),Ne&&h.push("--jsx-dev"),S&&h.push("--jsx-side-effects"),k)for(let Oe in k){if(Oe.indexOf("=")>=0)throw new Error(`Invalid define: ${Oe}`);h.push(`--define:${Oe}=${tt(k[Oe],"define",Oe)}`)}if(ne)for(let Oe in ne){if(Oe.indexOf("=")>=0)throw new Error(`Invalid log override: ${Oe}`);h.push(`--log-override:${Oe}=${tt(ne[Oe],"log override",Oe)}`)}if(pe)for(let Oe in pe){if(Oe.indexOf("=")>=0)throw new Error(`Invalid supported: ${Oe}`);const Ue=pe[Oe];if(typeof Ue!="boolean")throw new Error(`Expected value for supported ${L(Oe)} to be a boolean, got ${typeof Ue} instead`);h.push(`--supported:${Oe}=${Ue}`)}if(Ee)for(let Oe of Ee)h.push(`--pure:${tt(Oe,"pure")}`);Le&&h.push("--keep-names")}function zt(h,v,R,B,oe){var se;let le=[],he=[],Q=Object.create(null),xe=null,Te=null;yt(le,v,Q,R,B),St(le,v,Q);let Ce=T(v,Q,"sourcemap",Tt),qe=T(v,Q,"bundle",b),ze=T(v,Q,"splitting",b),ke=T(v,Q,"preserveSymlinks",b),it=T(v,Q,"metafile",b),ue=T(v,Q,"outfile",g),Qe=T(v,Q,"outdir",g),Je=T(v,Q,"outbase",g),ge=T(v,Q,"tsconfig",g),W=T(v,Q,"resolveExtensions",Z),j=T(v,Q,"nodePaths",Z),U=T(v,Q,"mainFields",Z),fe=T(v,Q,"conditions",Z),me=T(v,Q,"external",Z),Pe=T(v,Q,"packages",g),Ne=T(v,Q,"alias",we),S=T(v,Q,"loader",we),k=T(v,Q,"outExtension",we),ne=T(v,Q,"publicPath",g),pe=T(v,Q,"entryNames",g),Ee=T(v,Q,"chunkNames",g),Le=T(v,Q,"assetNames",g),De=T(v,Q,"inject",Z),Be=T(v,Q,"banner",we),Oe=T(v,Q,"footer",we),Ue=T(v,Q,"entryPoints",Ae),Ye=T(v,Q,"absWorkingDir",g),We=T(v,Q,"stdin",we),et=(se=T(v,Q,"write",b))!=null?se:oe,dt=T(v,Q,"allowOverwrite",b),Rt=T(v,Q,"mangleCache",we);if(Q.plugins=!0,$e(v,Q,`in ${h}() call`),Ce&&le.push(`--sourcemap${Ce===!0?"":`=${Ce}`}`),qe&&le.push("--bundle"),dt&&le.push("--allow-overwrite"),ze&&le.push("--splitting"),ke&&le.push("--preserve-symlinks"),it&&le.push("--metafile"),ue&&le.push(`--outfile=${ue}`),Qe&&le.push(`--outdir=${Qe}`),Je&&le.push(`--outbase=${Je}`),ge&&le.push(`--tsconfig=${ge}`),Pe&&le.push(`--packages=${Pe}`),W){let Re=[];for(let rt of W){if(tt(rt,"resolve extension"),rt.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${rt}`);Re.push(rt)}le.push(`--resolve-extensions=${Re.join(",")}`)}if(ne&&le.push(`--public-path=${ne}`),pe&&le.push(`--entry-names=${pe}`),Ee&&le.push(`--chunk-names=${Ee}`),Le&&le.push(`--asset-names=${Le}`),U){let Re=[];for(let rt of U){if(tt(rt,"main field"),rt.indexOf(",")>=0)throw new Error(`Invalid main field: ${rt}`);Re.push(rt)}le.push(`--main-fields=${Re.join(",")}`)}if(fe){let Re=[];for(let rt of fe){if(tt(rt,"condition"),rt.indexOf(",")>=0)throw new Error(`Invalid condition: ${rt}`);Re.push(rt)}le.push(`--conditions=${Re.join(",")}`)}if(me)for(let Re of me)le.push(`--external:${tt(Re,"external")}`);if(Ne)for(let Re in Ne){if(Re.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${Re}`);le.push(`--alias:${Re}=${tt(Ne[Re],"alias",Re)}`)}if(Be)for(let Re in Be){if(Re.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${Re}`);le.push(`--banner:${Re}=${tt(Be[Re],"banner",Re)}`)}if(Oe)for(let Re in Oe){if(Re.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${Re}`);le.push(`--footer:${Re}=${tt(Oe[Re],"footer",Re)}`)}if(De)for(let Re of De)le.push(`--inject:${tt(Re,"inject")}`);if(S)for(let Re in S){if(Re.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${Re}`);le.push(`--loader:${Re}=${tt(S[Re],"loader",Re)}`)}if(k)for(let Re in k){if(Re.indexOf("=")>=0)throw new Error(`Invalid out extension: ${Re}`);le.push(`--out-extension:${Re}=${tt(k[Re],"out extension",Re)}`)}if(Ue)if(Array.isArray(Ue))for(let Re=0,rt=Ue.length;Re{let W=he+ge.length;if(W>le.length){let U=new Uint8Array(W*2);U.set(le),le=U}le.set(ge,he),he+=ge.length;let j=0;for(;j+4<=he;){let U=F(le,j);if(j+4+U>he)break;j+=4,ke(le.subarray(j,j+U)),j+=U}j>0&&(le.copyWithin(0,j,he),he-=j)},xe=ge=>{R.didClose=!0,ge&&(R.reason=": "+(ge.message||ge));const W="The service was stopped"+R.reason;for(let j in B)B[j](W,null);B={}},Te=(ge,W,j)=>{if(R.didClose)return j("The service is no longer running"+R.reason,null);let U=oe++;B[U]=(fe,me)=>{try{j(fe,me)}finally{ge&&ge.unref()}},ge&&ge.ref(),h.writeToStdin(ee({id:U,isRequest:!0,value:W}))},Ce=(ge,W)=>{if(R.didClose)throw new Error("The service is no longer running"+R.reason);h.writeToStdin(ee({id:ge,isRequest:!1,value:W}))},qe=(ge,W)=>E(this,null,function*(){try{if(W.command==="ping"){Ce(ge,{});return}if(typeof W.key=="number"){const j=v[W.key];if(!j)return;const U=j[W.command];if(U){yield U(ge,W);return}}throw new Error("Invalid command: "+W.command)}catch(j){const U=[kt(j,h,null,void 0,"")];try{Ce(ge,{errors:U})}catch{}}}),ze=!0,ke=ge=>{if(ze){ze=!1;let j=String.fromCharCode(...ge);if(j!=="0.19.12")throw new Error(`Cannot start service: Host version "0.19.12" does not match binary version ${L(j)}`);return}let W=V(ge);if(W.isRequest)qe(W.id,W.value);else{let j=B[W.id];delete B[W.id],W.value.error?j(W.value.error,{}):j(null,W.value)}};return{readFromStdout:Q,afterClose:xe,service:{buildOrContext:({callName:ge,refs:W,options:j,isTTY:U,defaultWD:fe,callback:me})=>{let Pe=0;const Ne=se++,S={},k={ref(){++Pe===1&&W&&W.ref()},unref(){--Pe===0&&(delete v[Ne],W&&W.unref())}};v[Ne]=S,k.ref(),Ft(ge,Ne,Te,Ce,k,h,S,j,U,fe,(ne,pe)=>{try{me(ne,pe)}finally{k.unref()}})},transform:({callName:ge,refs:W,input:j,options:U,isTTY:fe,fs:me,callback:Pe})=>{const Ne=vt();let S=k=>{try{if(typeof j!="string"&&!(j instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:ne,mangleCache:pe}=hn(ge,U,fe,X),Ee={command:"transform",flags:ne,inputFS:k!==null,input:k!==null?z(k):typeof j=="string"?z(j):j};pe&&(Ee.mangleCache=pe),Te(W,Ee,(Le,De)=>{if(Le)return Pe(new Error(Le),null);let Be=It(De.errors,Ne),Oe=It(De.warnings,Ne),Ue=1,Ye=()=>{if(--Ue===0){let We={warnings:Oe,code:De.code,map:De.map,mangleCache:void 0,legalComments:void 0};"legalComments"in De&&(We.legalComments=De?.legalComments),De.mangleCache&&(We.mangleCache=De?.mangleCache),Pe(null,We)}};if(Be.length>0)return Pe(Bt("Transform failed",Be,Oe),null);De.codeFS&&(Ue++,me.readFile(De.code,(We,et)=>{We!==null?Pe(We,null):(De.code=et,Ye())})),De.mapFS&&(Ue++,me.readFile(De.map,(We,et)=>{We!==null?Pe(We,null):(De.map=et,Ye())})),Ye()})}catch(ne){let pe=[];try{yt(pe,U,{},fe,X)}catch{}const Ee=kt(ne,h,Ne,void 0,"");Te(W,{command:"error",flags:pe,error:Ee},()=>{Ee.detail=Ne.load(Ee.detail),Pe(Bt("Transform failed",[Ee],[]),null)})}};if((typeof j=="string"||j instanceof Uint8Array)&&j.length>1024*1024){let k=S;S=()=>me.writeFile(j,k)}S(null)},formatMessages:({callName:ge,refs:W,messages:j,options:U,callback:fe})=>{if(!U)throw new Error(`Missing second argument in ${ge}() call`);let me={},Pe=T(U,me,"kind",g),Ne=T(U,me,"color",b),S=T(U,me,"terminalWidth",O);if($e(U,me,`in ${ge}() call`),Pe===void 0)throw new Error(`Missing "kind" in ${ge}() call`);if(Pe!=="error"&&Pe!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${ge}() call`);let k={command:"format-msgs",messages:Nt(j,"messages",null,"",S),isWarning:Pe==="warning"};Ne!==void 0&&(k.color=Ne),S!==void 0&&(k.terminalWidth=S),Te(W,k,(ne,pe)=>{if(ne)return fe(new Error(ne),null);fe(null,pe.messages)})},analyzeMetafile:({callName:ge,refs:W,metafile:j,options:U,callback:fe})=>{U===void 0&&(U={});let me={},Pe=T(U,me,"color",b),Ne=T(U,me,"verbose",b);$e(U,me,`in ${ge}() call`);let S={command:"analyze-metafile",metafile:j};Pe!==void 0&&(S.color=Pe),Ne!==void 0&&(S.verbose=Ne),Te(W,S,(k,ne)=>{if(k)return fe(new Error(k),null);fe(null,ne.result)})}}}}function Ft(h,v,R,B,oe,se,le,he,Q,xe,Te){const Ce=vt(),qe=h==="context",ze=(ue,Qe)=>{const Je=[];try{yt(Je,he,{},Q,$)}catch{}const ge=kt(ue,se,Ce,void 0,Qe);R(oe,{command:"error",flags:Je,error:ge},()=>{ge.detail=Ce.load(ge.detail),Te(Bt(qe?"Context failed":"Build failed",[ge],[]),null)})};let ke;if(typeof he=="object"){const ue=he.plugins;if(ue!==void 0){if(!Array.isArray(ue))return ze(new Error('"plugins" must be an array'),"");ke=ue}}if(ke&&ke.length>0){if(se.isSync)return ze(new Error("Cannot use plugins in synchronous API calls"),"");ht(v,R,B,oe,se,le,he,ke,Ce).then(ue=>{if(!ue.ok)return ze(ue.error,ue.pluginName);try{it(ue.requestPlugins,ue.runOnEndCallbacks,ue.scheduleOnDisposeCallbacks)}catch(Qe){ze(Qe,"")}},ue=>ze(ue,""));return}try{it(null,(ue,Qe)=>Qe([],[]),()=>{})}catch(ue){ze(ue,"")}function it(ue,Qe,Je){const ge=se.hasFS,{entries:W,flags:j,write:U,stdinContents:fe,stdinResolveDir:me,absWorkingDir:Pe,nodePaths:Ne,mangleCache:S}=zt(h,he,Q,$,ge);if(U&&!se.hasFS)throw new Error('The "write" option is unavailable in this environment');const k={command:"build",key:v,entries:W,flags:j,write:U,stdinContents:fe,stdinResolveDir:me,absWorkingDir:Pe||xe,nodePaths:Ne,context:qe};ue&&(k.plugins=ue),S&&(k.mangleCache=S);const ne=(Le,De)=>{const Be={errors:It(Le.errors,Ce),warnings:It(Le.warnings,Ce),outputFiles:void 0,metafile:void 0,mangleCache:void 0},Oe=Be.errors.slice(),Ue=Be.warnings.slice();Le.outputFiles&&(Be.outputFiles=Le.outputFiles.map(er)),Le.metafile&&(Be.metafile=JSON.parse(Le.metafile)),Le.mangleCache&&(Be.mangleCache=Le.mangleCache),Le.writeToStdout!==void 0&&console.log(ie(Le.writeToStdout).replace(/\n$/,"")),Qe(Be,(Ye,We)=>{if(Oe.length>0||Ye.length>0){const et=Bt("Build failed",Oe.concat(Ye),Ue.concat(We));return De(et,null,Ye,We)}De(null,Be,Ye,We)})};let pe,Ee;qe&&(le["on-end"]=(Le,De)=>new Promise(Be=>{ne(De,(Oe,Ue,Ye,We)=>{const et={errors:Ye,warnings:We};Ee&&Ee(Oe,Ue),pe=void 0,Ee=void 0,B(Le,et),Be()})})),R(oe,k,(Le,De)=>{if(Le)return Te(new Error(Le),null);if(!qe)return ne(De,(Ue,Ye)=>(Je(),Te(Ue,Ye)));if(De.errors.length>0)return Te(Bt("Context failed",De.errors,De.warnings),null);let Be=!1;const Oe={rebuild:()=>(pe||(pe=new Promise((Ue,Ye)=>{let We;Ee=(dt,Rt)=>{We||(We=()=>dt?Ye(dt):Ue(Rt))};const et=()=>{R(oe,{command:"rebuild",key:v},(Rt,Mt)=>{Rt?Ye(new Error(Rt)):We?We():et()})};et()})),pe),watch:(Ue={})=>new Promise((Ye,We)=>{if(!se.hasFS)throw new Error('Cannot use the "watch" API in this environment');$e(Ue,{},"in watch() call"),R(oe,{command:"watch",key:v},Rt=>{Rt?We(new Error(Rt)):Ye(void 0)})}),serve:(Ue={})=>new Promise((Ye,We)=>{if(!se.hasFS)throw new Error('Cannot use the "serve" API in this environment');const et={},dt=T(Ue,et,"port",O),Rt=T(Ue,et,"host",g),Mt=T(Ue,et,"servedir",g),Re=T(Ue,et,"keyfile",g),rt=T(Ue,et,"certfile",g),He=T(Ue,et,"fallback",g),Et=T(Ue,et,"onRequest",te);$e(Ue,et,"in serve() call");const Lt={command:"serve",key:v,onRequest:!!Et};dt!==void 0&&(Lt.port=dt),Rt!==void 0&&(Lt.host=Rt),Mt!==void 0&&(Lt.servedir=Mt),Re!==void 0&&(Lt.keyfile=Re),rt!==void 0&&(Lt.certfile=rt),He!==void 0&&(Lt.fallback=He),R(oe,Lt,(An,Tn)=>{if(An)return We(new Error(An));Et&&(le["serve-request"]=(Nr,zn)=>{Et(zn.args),B(Nr,{})}),Ye(Tn)})}),cancel:()=>new Promise(Ue=>{if(Be)return Ue();R(oe,{command:"cancel",key:v},()=>{Ue()})}),dispose:()=>new Promise(Ue=>{if(Be)return Ue();Be=!0,R(oe,{command:"dispose",key:v},()=>{Ue(),Je(),oe.unref()})})};oe.ref(),Te(null,Oe)})}}var ht=(h,v,R,B,oe,se,le,he,Q)=>E(void 0,null,function*(){let xe=[],Te=[],Ce={},qe={},ze=[],ke=0,it=0,ue=[],Qe=!1;he=[...he];for(let W of he){let j={};if(typeof W!="object")throw new Error(`Plugin at index ${it} must be an object`);const U=T(W,j,"name",g);if(typeof U!="string"||U==="")throw new Error(`Plugin at index ${it} is missing a name`);try{let fe=T(W,j,"setup",te);if(typeof fe!="function")throw new Error("Plugin is missing a setup function");$e(W,j,`on plugin ${L(U)}`);let me={name:U,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};it++;let Ne=fe({initialOptions:le,resolve:(S,k={})=>{if(!Qe)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof S!="string")throw new Error("The path to resolve must be a string");let ne=Object.create(null),pe=T(k,ne,"pluginName",g),Ee=T(k,ne,"importer",g),Le=T(k,ne,"namespace",g),De=T(k,ne,"resolveDir",g),Be=T(k,ne,"kind",g),Oe=T(k,ne,"pluginData",K);return $e(k,ne,"in resolve() call"),new Promise((Ue,Ye)=>{const We={command:"resolve",path:S,key:h,pluginName:U};if(pe!=null&&(We.pluginName=pe),Ee!=null&&(We.importer=Ee),Le!=null&&(We.namespace=Le),De!=null&&(We.resolveDir=De),Be!=null)We.kind=Be;else throw new Error('Must specify "kind" when calling "resolve"');Oe!=null&&(We.pluginData=Q.store(Oe)),v(B,We,(et,dt)=>{et!==null?Ye(new Error(et)):Ue({errors:It(dt.errors,Q),warnings:It(dt.warnings,Q),path:dt.path,external:dt.external,sideEffects:dt.sideEffects,namespace:dt.namespace,suffix:dt.suffix,pluginData:Q.load(dt.pluginData)})})})},onStart(S){let k='This error came from the "onStart" callback registered here:',ne=at(new Error(k),oe,"onStart");xe.push({name:U,callback:S,note:ne}),me.onStart=!0},onEnd(S){let k='This error came from the "onEnd" callback registered here:',ne=at(new Error(k),oe,"onEnd");Te.push({name:U,callback:S,note:ne}),me.onEnd=!0},onResolve(S,k){let ne='This error came from the "onResolve" callback registered here:',pe=at(new Error(ne),oe,"onResolve"),Ee={},Le=T(S,Ee,"filter",x),De=T(S,Ee,"namespace",g);if($e(S,Ee,`in onResolve() call for plugin ${L(U)}`),Le==null)throw new Error("onResolve() call is missing a filter");let Be=ke++;Ce[Be]={name:U,callback:k,note:pe},me.onResolve.push({id:Be,filter:Le.source,namespace:De||""})},onLoad(S,k){let ne='This error came from the "onLoad" callback registered here:',pe=at(new Error(ne),oe,"onLoad"),Ee={},Le=T(S,Ee,"filter",x),De=T(S,Ee,"namespace",g);if($e(S,Ee,`in onLoad() call for plugin ${L(U)}`),Le==null)throw new Error("onLoad() call is missing a filter");let Be=ke++;qe[Be]={name:U,callback:k,note:pe},me.onLoad.push({id:Be,filter:Le.source,namespace:De||""})},onDispose(S){ze.push(S)},esbuild:oe.esbuild});Ne&&(yield Ne),ue.push(me)}catch(fe){return{ok:!1,error:fe,pluginName:U}}}se["on-start"]=(W,j)=>E(void 0,null,function*(){let U={errors:[],warnings:[]};yield Promise.all(xe.map(fe=>E(void 0,[fe],function*({name:me,callback:Pe,note:Ne}){try{let S=yield Pe();if(S!=null){if(typeof S!="object")throw new Error(`Expected onStart() callback in plugin ${L(me)} to return an object`);let k={},ne=T(S,k,"errors",Z),pe=T(S,k,"warnings",Z);$e(S,k,`from onStart() callback in plugin ${L(me)}`),ne!=null&&U.errors.push(...Nt(ne,"errors",Q,me,void 0)),pe!=null&&U.warnings.push(...Nt(pe,"warnings",Q,me,void 0))}}catch(S){U.errors.push(kt(S,oe,Q,Ne&&Ne(),me))}}))),R(W,U)}),se["on-resolve"]=(W,j)=>E(void 0,null,function*(){let U={},fe="",me,Pe;for(let Ne of j.ids)try{({name:fe,callback:me,note:Pe}=Ce[Ne]);let S=yield me({path:j.path,importer:j.importer,namespace:j.namespace,resolveDir:j.resolveDir,kind:j.kind,pluginData:Q.load(j.pluginData)});if(S!=null){if(typeof S!="object")throw new Error(`Expected onResolve() callback in plugin ${L(fe)} to return an object`);let k={},ne=T(S,k,"pluginName",g),pe=T(S,k,"path",g),Ee=T(S,k,"namespace",g),Le=T(S,k,"suffix",g),De=T(S,k,"external",b),Be=T(S,k,"sideEffects",b),Oe=T(S,k,"pluginData",K),Ue=T(S,k,"errors",Z),Ye=T(S,k,"warnings",Z),We=T(S,k,"watchFiles",Z),et=T(S,k,"watchDirs",Z);$e(S,k,`from onResolve() callback in plugin ${L(fe)}`),U.id=Ne,ne!=null&&(U.pluginName=ne),pe!=null&&(U.path=pe),Ee!=null&&(U.namespace=Ee),Le!=null&&(U.suffix=Le),De!=null&&(U.external=De),Be!=null&&(U.sideEffects=Be),Oe!=null&&(U.pluginData=Q.store(Oe)),Ue!=null&&(U.errors=Nt(Ue,"errors",Q,fe,void 0)),Ye!=null&&(U.warnings=Nt(Ye,"warnings",Q,fe,void 0)),We!=null&&(U.watchFiles=Ct(We,"watchFiles")),et!=null&&(U.watchDirs=Ct(et,"watchDirs"));break}}catch(S){U={id:Ne,errors:[kt(S,oe,Q,Pe&&Pe(),fe)]};break}R(W,U)}),se["on-load"]=(W,j)=>E(void 0,null,function*(){let U={},fe="",me,Pe;for(let Ne of j.ids)try{({name:fe,callback:me,note:Pe}=qe[Ne]);let S=yield me({path:j.path,namespace:j.namespace,suffix:j.suffix,pluginData:Q.load(j.pluginData),with:j.with});if(S!=null){if(typeof S!="object")throw new Error(`Expected onLoad() callback in plugin ${L(fe)} to return an object`);let k={},ne=T(S,k,"pluginName",g),pe=T(S,k,"contents",ye),Ee=T(S,k,"resolveDir",g),Le=T(S,k,"pluginData",K),De=T(S,k,"loader",g),Be=T(S,k,"errors",Z),Oe=T(S,k,"warnings",Z),Ue=T(S,k,"watchFiles",Z),Ye=T(S,k,"watchDirs",Z);$e(S,k,`from onLoad() callback in plugin ${L(fe)}`),U.id=Ne,ne!=null&&(U.pluginName=ne),pe instanceof Uint8Array?U.contents=pe:pe!=null&&(U.contents=z(pe)),Ee!=null&&(U.resolveDir=Ee),Le!=null&&(U.pluginData=Q.store(Le)),De!=null&&(U.loader=De),Be!=null&&(U.errors=Nt(Be,"errors",Q,fe,void 0)),Oe!=null&&(U.warnings=Nt(Oe,"warnings",Q,fe,void 0)),Ue!=null&&(U.watchFiles=Ct(Ue,"watchFiles")),Ye!=null&&(U.watchDirs=Ct(Ye,"watchDirs"));break}}catch(S){U={id:Ne,errors:[kt(S,oe,Q,Pe&&Pe(),fe)]};break}R(W,U)});let Je=(W,j)=>j([],[]);Te.length>0&&(Je=(W,j)=>{E(void 0,null,function*(){const U=[],fe=[];for(const{name:me,callback:Pe,note:Ne}of Te){let S,k;try{const ne=yield Pe(W);if(ne!=null){if(typeof ne!="object")throw new Error(`Expected onEnd() callback in plugin ${L(me)} to return an object`);let pe={},Ee=T(ne,pe,"errors",Z),Le=T(ne,pe,"warnings",Z);$e(ne,pe,`from onEnd() callback in plugin ${L(me)}`),Ee!=null&&(S=Nt(Ee,"errors",Q,me,void 0)),Le!=null&&(k=Nt(Le,"warnings",Q,me,void 0))}}catch(ne){S=[kt(ne,oe,Q,Ne&&Ne(),me)]}if(S){U.push(...S);try{W.errors.push(...S)}catch{}}if(k){fe.push(...k);try{W.warnings.push(...k)}catch{}}}j(U,fe)})});let ge=()=>{for(const W of ze)setTimeout(()=>W(),0)};return Qe=!0,{ok:!0,requestPlugins:ue,runOnEndCallbacks:Je,scheduleOnDisposeCallbacks:ge}});function vt(){const h=new Map;let v=0;return{load(R){return h.get(R)},store(R){if(R===void 0)return-1;const B=v++;return h.set(B,R),B}}}function at(h,v,R){let B,oe=!1;return()=>{if(oe)return B;oe=!0;try{let se=(h.stack+"").split(` `);se.splice(1,1);let le=on(v,se,R);if(le)return B={text:h.message,location:le},B}catch{}}}function kt(h,v,R,B,oe){let se="Internal error",le=null;try{se=(h&&h.message||h)+""}catch{}try{le=on(v,(h.stack+"").split(` `),"")}catch{}return{id:"",pluginName:oe,text:se,location:le,notes:B?[B]:[],detail:R?R.store(h):-1}}function on(h,v,R){let B=" at ";if(h.readFileSync&&!v[0].startsWith(B)&&v[1].startsWith(B))for(let oe=1;oe{if(le===B)return` ...`;if(!se.location)return` error: ${se.text}`;let{file:he,line:Q,column:xe}=se.location,Te=se.pluginName?`[plugin: ${se.pluginName}] `:"";return` -${he}:${Q}:${xe}: ERROR: ${Te}${se.text}`}).join("");let oe=new Error(h);for(const[se,le]of[["errors",v],["warnings",R]])Object.defineProperty(oe,se,{configurable:!0,enumerable:!0,get:()=>le,set:he=>Object.defineProperty(oe,se,{configurable:!0,enumerable:!0,value:he})});return oe}function It(h,v){for(const R of h)R.detail=v.load(R.detail);return h}function Nn(h,v,R){if(h==null)return null;let B={},oe=T(h,B,"file",g),se=T(h,B,"namespace",g),le=T(h,B,"line",O),he=T(h,B,"column",O),Q=T(h,B,"length",O),xe=T(h,B,"lineText",g),Te=T(h,B,"suggestion",g);if($e(h,B,v),xe){const Ce=xe.slice(0,(he&&he>0?he:0)+(Q&&Q>0?Q:0)+(R&&R>0?R:80));!/[\x7F-\uFFFF]/.test(Ce)&&!/\n/.test(xe)&&(xe=Ce)}return{file:oe||"",namespace:se||"",line:le||0,column:he||0,length:Q||0,lineText:xe||"",suggestion:Te||""}}function Nt(h,v,R,B,oe){let se=[],le=0;for(const he of h){let Q={},xe=T(he,Q,"id",g),Te=T(he,Q,"pluginName",g),Ce=T(he,Q,"text",g),qe=T(he,Q,"location",Xe),ze=T(he,Q,"notes",Z),ke=T(he,Q,"detail",K),it=`in element ${le} of "${v}"`;$e(he,Q,it);let ue=[];if(ze)for(const Qe of ze){let Je={},ge=T(Qe,Je,"text",g),W=T(Qe,Je,"location",Xe);$e(Qe,Je,it),ue.push({text:ge||"",location:Nn(W,it,oe)})}se.push({id:xe||"",pluginName:Te||B,text:Ce||"",location:Nn(qe,it,oe),notes:ue,detail:R?R.store(ke):-1}),le++}return se}function Ct(h,v){const R=[];for(const B of h){if(typeof B!="string")throw new Error(`${A(v)} must be an array of strings`);R.push(B)}return R}function er({path:h,contents:v,hash:R}){let B=null;return{path:h,contents:v,hash:R,get text(){const oe=this.contents;return(B===null||oe!==v)&&(v=oe,B=ie(oe)),B}}}var tr="0.19.12",An=h=>N().build(h),ln=h=>N().context(h),nr=(h,v)=>N().transform(h,v),rr=(h,v)=>N().formatMessages(h,v),ir=(h,v)=>N().analyzeMetafile(h,v),or=()=>{throw new Error('The "buildSync" API only works in node')},lr=()=>{throw new Error('The "transformSync" API only works in node')},Un=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Fn=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},$n=()=>{yn&&yn()},Vt,yn,y,N=()=>{if(y)return y;throw Vt?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},M=h=>{h=lt(h||{});let v=h.wasmURL,R=h.wasmModule,B=h.worker!==!1;if(!v&&!R)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(Vt)throw new Error('Cannot call "initialize" more than once');return Vt=Y(v||"",R,B),Vt.catch(()=>{Vt=void 0}),Vt},Y=(h,v,R)=>E(void 0,null,function*(){let B;if(R){let xe=new Blob([`onmessage=((postMessage) => { +${he}:${Q}:${xe}: ERROR: ${Te}${se.text}`}).join("");let oe=new Error(h);for(const[se,le]of[["errors",v],["warnings",R]])Object.defineProperty(oe,se,{configurable:!0,enumerable:!0,get:()=>le,set:he=>Object.defineProperty(oe,se,{configurable:!0,enumerable:!0,value:he})});return oe}function It(h,v){for(const R of h)R.detail=v.load(R.detail);return h}function Nn(h,v,R){if(h==null)return null;let B={},oe=T(h,B,"file",g),se=T(h,B,"namespace",g),le=T(h,B,"line",O),he=T(h,B,"column",O),Q=T(h,B,"length",O),xe=T(h,B,"lineText",g),Te=T(h,B,"suggestion",g);if($e(h,B,v),xe){const Ce=xe.slice(0,(he&&he>0?he:0)+(Q&&Q>0?Q:0)+(R&&R>0?R:80));!/[\x7F-\uFFFF]/.test(Ce)&&!/\n/.test(xe)&&(xe=Ce)}return{file:oe||"",namespace:se||"",line:le||0,column:he||0,length:Q||0,lineText:xe||"",suggestion:Te||""}}function Nt(h,v,R,B,oe){let se=[],le=0;for(const he of h){let Q={},xe=T(he,Q,"id",g),Te=T(he,Q,"pluginName",g),Ce=T(he,Q,"text",g),qe=T(he,Q,"location",Xe),ze=T(he,Q,"notes",Z),ke=T(he,Q,"detail",K),it=`in element ${le} of "${v}"`;$e(he,Q,it);let ue=[];if(ze)for(const Qe of ze){let Je={},ge=T(Qe,Je,"text",g),W=T(Qe,Je,"location",Xe);$e(Qe,Je,it),ue.push({text:ge||"",location:Nn(W,it,oe)})}se.push({id:xe||"",pluginName:Te||B,text:Ce||"",location:Nn(qe,it,oe),notes:ue,detail:R?R.store(ke):-1}),le++}return se}function Ct(h,v){const R=[];for(const B of h){if(typeof B!="string")throw new Error(`${L(v)} must be an array of strings`);R.push(B)}return R}function er({path:h,contents:v,hash:R}){let B=null;return{path:h,contents:v,hash:R,get text(){const oe=this.contents;return(B===null||oe!==v)&&(v=oe,B=ie(oe)),B}}}var tr="0.19.12",Ln=h=>N().build(h),ln=h=>N().context(h),nr=(h,v)=>N().transform(h,v),rr=(h,v)=>N().formatMessages(h,v),ir=(h,v)=>N().analyzeMetafile(h,v),or=()=>{throw new Error('The "buildSync" API only works in node')},lr=()=>{throw new Error('The "transformSync" API only works in node')},Un=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Fn=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},$n=()=>{yn&&yn()},Vt,yn,y,N=()=>{if(y)return y;throw Vt?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},M=h=>{h=lt(h||{});let v=h.wasmURL,R=h.wasmModule,B=h.worker!==!1;if(!v&&!R)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(Vt)throw new Error('Cannot call "initialize" more than once');return Vt=Y(v||"",R,B),Vt.catch(()=>{Vt=void 0}),Vt},Y=(h,v,R)=>E(void 0,null,function*(){let B;if(R){let xe=new Blob([`onmessage=((postMessage) => { // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -688,39 +688,39 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var hasRequiredScheduler_production_min;function requireScheduler_production_min(){return hasRequiredScheduler_production_min||(hasRequiredScheduler_production_min=1,function(i){var s,o,u,f;if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;i.unstable_now=function(){return c.now()}}else{var m=Date,d=m.now();i.unstable_now=function(){return m.now()-d}}if(typeof window>"u"||typeof MessageChannel!="function"){var C=null,E=null,w=function(){if(C!==null)try{var ye=i.unstable_now();C(!0,ye),C=null}catch(je){throw setTimeout(w,0),je}};s=function(ye){C!==null?setTimeout(s,0,ye):(C=ye,setTimeout(w,0))},o=function(ye,je){E=setTimeout(ye,je)},u=function(){clearTimeout(E)},i.unstable_shouldYield=function(){return!1},f=i.unstable_forceFrameRate=function(){}}else{var ee=window.setTimeout,V=window.clearTimeout;if(typeof console<"u"){var re=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof re!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var z=!1,ie=null,ce=-1,F=5,q=0;i.unstable_shouldYield=function(){return i.unstable_now()>=q},f=function(){},i.unstable_forceFrameRate=function(ye){0>ye||125>>1,lt=ye[$e];if(lt!==void 0&&0b(yt,T))St!==void 0&&0>b(St,yt)?(ye[$e]=St,ye[tt]=T,$e=tt):(ye[$e]=yt,ye[Ot]=T,$e=Ot);else if(St!==void 0&&0>b(St,T))ye[$e]=St,ye[tt]=T,$e=tt;else break e}}return je}return null}function b(ye,je){var T=ye.sortIndex-je.sortIndex;return T!==0?T:ye.id-je.id}var g=[],x=[],O=1,te=null,Z=3,we=!1,Le=!1,Ke=!1;function Xe(ye){for(var je=J(x);je!==null;){if(je.callback===null)K(x);else if(je.startTime<=ye)K(x),je.sortIndex=je.expirationTime,X(g,je);else break;je=J(x)}}function Tt(ye){if(Ke=!1,Xe(ye),!Le)if(J(g)!==null)Le=!0,s(ct);else{var je=J(x);je!==null&&o(Tt,je.startTime-ye)}}function ct(ye,je){Le=!1,Ke&&(Ke=!1,u()),we=!0;var T=Z;try{for(Xe(je),te=J(g);te!==null&&(!(te.expirationTime>je)||ye&&!i.unstable_shouldYield());){var $e=te.callback;if(typeof $e=="function"){te.callback=null,Z=te.priorityLevel;var lt=$e(te.expirationTime<=je);je=i.unstable_now(),typeof lt=="function"?te.callback=lt:te===J(g)&&K(g),Xe(je)}else K(g);te=J(g)}if(te!==null)var Ot=!0;else{var yt=J(x);yt!==null&&o(Tt,yt.startTime-je),Ot=!1}return Ot}finally{te=null,Z=T,we=!1}}var On=f;i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(ye){ye.callback=null},i.unstable_continueExecution=function(){Le||we||(Le=!0,s(ct))},i.unstable_getCurrentPriorityLevel=function(){return Z},i.unstable_getFirstCallbackNode=function(){return J(g)},i.unstable_next=function(ye){switch(Z){case 1:case 2:case 3:var je=3;break;default:je=Z}var T=Z;Z=je;try{return ye()}finally{Z=T}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=On,i.unstable_runWithPriority=function(ye,je){switch(ye){case 1:case 2:case 3:case 4:case 5:break;default:ye=3}var T=Z;Z=ye;try{return je()}finally{Z=T}},i.unstable_scheduleCallback=function(ye,je,T){var $e=i.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0$e?(ye.sortIndex=T,X(x,ye),J(g)===null&&ye===J(x)&&(Ke?u():Ke=!0,o(Tt,T-$e))):(ye.sortIndex=lt,X(g,ye),Le||we||(Le=!0,s(ct))),ye},i.unstable_wrapCallback=function(ye){var je=Z;return function(){var T=Z;Z=je;try{return ye.apply(this,arguments)}finally{Z=T}}}}(scheduler_production_min)),scheduler_production_min}var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,scheduler.exports=requireScheduler_production_min()),scheduler.exports}/** @license React v0.26.2 + */var hasRequiredScheduler_production_min;function requireScheduler_production_min(){return hasRequiredScheduler_production_min||(hasRequiredScheduler_production_min=1,function(i){var s,o,u,f;if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;i.unstable_now=function(){return c.now()}}else{var m=Date,d=m.now();i.unstable_now=function(){return m.now()-d}}if(typeof window>"u"||typeof MessageChannel!="function"){var C=null,E=null,w=function(){if(C!==null)try{var ye=i.unstable_now();C(!0,ye),C=null}catch(je){throw setTimeout(w,0),je}};s=function(ye){C!==null?setTimeout(s,0,ye):(C=ye,setTimeout(w,0))},o=function(ye,je){E=setTimeout(ye,je)},u=function(){clearTimeout(E)},i.unstable_shouldYield=function(){return!1},f=i.unstable_forceFrameRate=function(){}}else{var ee=window.setTimeout,V=window.clearTimeout;if(typeof console<"u"){var re=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof re!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var z=!1,ie=null,ce=-1,F=5,q=0;i.unstable_shouldYield=function(){return i.unstable_now()>=q},f=function(){},i.unstable_forceFrameRate=function(ye){0>ye||125>>1,lt=ye[$e];if(lt!==void 0&&0b(yt,T))St!==void 0&&0>b(St,yt)?(ye[$e]=St,ye[tt]=T,$e=tt):(ye[$e]=yt,ye[Ot]=T,$e=Ot);else if(St!==void 0&&0>b(St,T))ye[$e]=St,ye[tt]=T,$e=tt;else break e}}return je}return null}function b(ye,je){var T=ye.sortIndex-je.sortIndex;return T!==0?T:ye.id-je.id}var g=[],x=[],O=1,te=null,Z=3,we=!1,Ae=!1,Ke=!1;function Xe(ye){for(var je=J(x);je!==null;){if(je.callback===null)K(x);else if(je.startTime<=ye)K(x),je.sortIndex=je.expirationTime,X(g,je);else break;je=J(x)}}function Tt(ye){if(Ke=!1,Xe(ye),!Ae)if(J(g)!==null)Ae=!0,s(ct);else{var je=J(x);je!==null&&o(Tt,je.startTime-ye)}}function ct(ye,je){Ae=!1,Ke&&(Ke=!1,u()),we=!0;var T=Z;try{for(Xe(je),te=J(g);te!==null&&(!(te.expirationTime>je)||ye&&!i.unstable_shouldYield());){var $e=te.callback;if(typeof $e=="function"){te.callback=null,Z=te.priorityLevel;var lt=$e(te.expirationTime<=je);je=i.unstable_now(),typeof lt=="function"?te.callback=lt:te===J(g)&&K(g),Xe(je)}else K(g);te=J(g)}if(te!==null)var Ot=!0;else{var yt=J(x);yt!==null&&o(Tt,yt.startTime-je),Ot=!1}return Ot}finally{te=null,Z=T,we=!1}}var On=f;i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(ye){ye.callback=null},i.unstable_continueExecution=function(){Ae||we||(Ae=!0,s(ct))},i.unstable_getCurrentPriorityLevel=function(){return Z},i.unstable_getFirstCallbackNode=function(){return J(g)},i.unstable_next=function(ye){switch(Z){case 1:case 2:case 3:var je=3;break;default:je=Z}var T=Z;Z=je;try{return ye()}finally{Z=T}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=On,i.unstable_runWithPriority=function(ye,je){switch(ye){case 1:case 2:case 3:case 4:case 5:break;default:ye=3}var T=Z;Z=ye;try{return je()}finally{Z=T}},i.unstable_scheduleCallback=function(ye,je,T){var $e=i.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0$e?(ye.sortIndex=T,X(x,ye),J(g)===null&&ye===J(x)&&(Ke?u():Ke=!0,o(Tt,T-$e))):(ye.sortIndex=lt,X(g,ye),Ae||we||(Ae=!0,s(ct))),ye},i.unstable_wrapCallback=function(ye){var je=Z;return function(){var T=Z;Z=je;try{return ye.apply(this,arguments)}finally{Z=T}}}}(scheduler_production_min)),scheduler_production_min}var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,scheduler.exports=requireScheduler_production_min()),scheduler.exports}/** @license React v0.26.2 * react-reconciler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */reactReconciler_production_min.exports;(function(i){i.exports=function(o){var u={},f=requireObjectAssign(),c=reactExports,m=requireScheduler();function d(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;rL||a[_]!==p[L])return` -`+a[_].replace(" at new "," at ");while(1<=_&&0<=L);break}}}finally{fe=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?U(e):""}var Pe=[],Ne=-1;function S(e){return{current:e}}function k(e){0>Ne||(e.current=Pe[Ne],Pe[Ne]=null,Ne--)}function ne(e,n){Ne++,Pe[Ne]=e.current,e.current=n}var pe={},Ee=S(pe),Ae=S(!1),De=pe;function Be(e,n){var r=e.type.contextTypes;if(!r)return pe;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var a={},p;for(p in r)a[p]=n[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=a),a}function Oe(e){return e=e.childContextTypes,e!=null}function Ue(){k(Ae),k(Ee)}function Ye(e,n,r){if(Ee.current!==pe)throw Error(d(168));ne(Ee,n),ne(Ae,r)}function We(e,n,r){var l=e.stateNode;if(e=n.childContextTypes,typeof l.getChildContext!="function")return r;l=l.getChildContext();for(var a in l)if(!(a in e))throw Error(d(108,te(n)||"Unknown",a));return f({},r,l)}function et(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pe,De=Ee.current,ne(Ee,e),ne(Ae,Ae.current),!0}function dt(e,n,r){var l=e.stateNode;if(!l)throw Error(d(169));r?(e=We(e,n,De),l.__reactInternalMemoizedMergedChildContext=e,k(Ae),k(Ee),ne(Ee,e)):k(Ae),ne(Ae,r)}var Rt=null,Mt=null,Re=m.unstable_now;Re();var rt=0,He=8;function Et(e){if(1&e)return He=15,1;if(2&e)return He=14,2;if(4&e)return He=13,4;var n=24&e;return n!==0?(He=12,n):e&32?(He=11,32):(n=192&e,n!==0?(He=10,n):e&256?(He=9,256):(n=3584&e,n!==0?(He=8,n):e&4096?(He=7,4096):(n=4186112&e,n!==0?(He=6,n):(n=62914560&e,n!==0?(He=5,n):e&67108864?(He=4,67108864):e&134217728?(He=3,134217728):(n=805306368&e,n!==0?(He=2,n):1073741824&e?(He=1,1073741824):(He=8,e))))))}function At(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function Ln(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(d(358,e))}}function Tn(e,n){var r=e.pendingLanes;if(r===0)return He=0;var l=0,a=0,p=e.expiredLanes,_=e.suspendedLanes,L=e.pingedLanes;if(p!==0)l=p,a=He=15;else if(p=r&134217727,p!==0){var G=p&~_;G!==0?(l=Et(G),a=He):(L&=p,L!==0&&(l=Et(L),a=He))}else p=r&~_,p!==0?(l=Et(p),a=He):L!==0&&(l=Et(L),a=He);if(l===0)return 0;if(l=31-vn(l),l=r&((0>l?0:1<r;r++)n.push(e);return n}function Ar(e,n,r){e.pendingLanes|=n;var l=n-1;e.suspendedLanes&=l,e.pingedLanes&=l,e=e.eventTimes,n=31-vn(n),e[n]=r}var vn=Math.clz32?Math.clz32:Ul,Dl=Math.log,jl=Math.LN2;function Ul(e){return e===0?32:31-(Dl(e)/jl|0)|0}var Fl=m.unstable_runWithPriority,yi=m.unstable_scheduleCallback,vi=m.unstable_cancelCallback,$l=m.unstable_shouldYield,go=m.unstable_requestPaint,Ei=m.unstable_now,zl=m.unstable_getCurrentPriorityLevel,Lr=m.unstable_ImmediatePriority,yo=m.unstable_UserBlockingPriority,vo=m.unstable_NormalPriority,Eo=m.unstable_LowPriority,So=m.unstable_IdlePriority,Si={},Bl=go!==void 0?go:function(){},sn=null,Tr=null,wi=!1,wo=Ei(),wt=1e4>wo?Ei:function(){return Ei()-wo};function Vn(){switch(zl()){case Lr:return 99;case yo:return 98;case vo:return 97;case Eo:return 96;case So:return 95;default:throw Error(d(332))}}function _o(e){switch(e){case 99:return Lr;case 98:return yo;case 97:return vo;case 96:return Eo;case 95:return So;default:throw Error(d(332))}}function an(e,n){return e=_o(e),Fl(e,n)}function sr(e,n,r){return e=_o(e),yi(e,n,r)}function Wt(){if(Tr!==null){var e=Tr;Tr=null,vi(e)}xo()}function xo(){if(!wi&&sn!==null){wi=!0;var e=0;try{var n=sn;an(99,function(){for(;ent?(mt=Ge,Ge=null):mt=Ge.sibling;var Ze=_e(D,Ge,H[nt],Se);if(Ze===null){Ge===null&&(Ge=mt);break}e&&Ge&&Ze.alternate===null&&n(D,Ge),I=p(Ze,I,nt),st===null?Me=Ze:st.sibling=Ze,st=Ze,Ge=mt}if(nt===H.length)return r(D,Ge),Me;if(Ge===null){for(;ntnt?(mt=Ge,Ge=null):mt=Ge.sibling;var bn=_e(D,Ge,Ze.value,Se);if(bn===null){Ge===null&&(Ge=mt);break}e&&Ge&&bn.alternate===null&&n(D,Ge),I=p(bn,I,nt),st===null?Me=bn:st.sibling=bn,st=bn,Ge=mt}if(Ze.done)return r(D,Ge),Me;if(Ge===null){for(;!Ze.done;nt++,Ze=H.next())Ze=Ve(D,Ze.value,Se),Ze!==null&&(I=p(Ze,I,nt),st===null?Me=Ze:st.sibling=Ze,st=Ze);return Me}for(Ge=l(D,Ge);!Ze.done;nt++,Ze=H.next())Ze=ot(Ge,D,nt,Ze.value,Se),Ze!==null&&(e&&Ze.alternate!==null&&Ge.delete(Ze.key===null?nt:Ze.key),I=p(Ze,I,nt),st===null?Me=Ze:st.sibling=Ze,st=Ze);return e&&Ge.forEach(function(ws){return n(D,ws)}),Me}return function(D,I,H,Se){var Me=typeof H=="object"&&H!==null&&H.type===ee&&H.key===null;Me&&(H=H.props.children);var st=typeof H=="object"&&H!==null;if(st)switch(H.$$typeof){case E:e:{for(st=H.key,Me=I;Me!==null;){if(Me.key===st){switch(Me.tag){case 7:if(H.type===ee){r(D,Me.sibling),I=a(Me,H.props.children),I.return=D,D=I;break e}break;default:if(Me.elementType===H.type){r(D,Me.sibling),I=a(Me,H.props),I.ref=ur(D,Me,H),I.return=D,D=I;break e}}r(D,Me);break}else n(D,Me);Me=Me.sibling}H.type===ee?(I=Xn(H.props.children,D.mode,Se,H.key),I.return=D,D=I):(Se=mi(H.type,H.key,H.props,null,D.mode,Se),Se.ref=ur(D,I,H),Se.return=D,D=Se)}return _(D);case w:e:{for(Me=H.key;I!==null;){if(I.key===Me)if(I.tag===4&&I.stateNode.containerInfo===H.containerInfo&&I.stateNode.implementation===H.implementation){r(D,I.sibling),I=a(I,H.children||[]),I.return=D,D=I;break e}else{r(D,I);break}else n(D,I);I=I.sibling}I=ho(H,D.mode,Se),I.return=D,D=I}return _(D)}if(typeof H=="string"||typeof H=="number")return H=""+H,I!==null&&I.tag===6?(r(D,I.sibling),I=a(I,H),I.return=D,D=I):(r(D,I),I=mo(H,D.mode,Se),I.return=D,D=I),_(D);if(Fr(H))return ut(D,I,H,Se);if(O(H))return Kt(D,I,H,Se);if(st&&$r(D,H),typeof H>"u"&&!Me)switch(D.tag){case 1:case 22:case 0:case 11:case 15:throw Error(d(152,te(D.type)||"Component"))}return r(D,I)}}var zr=ko(!0),Io=ko(!1),cr={},Ht=S(cr),fr=S(cr),qn=S(cr);function Xt(e){if(e===cr)throw Error(d(174));return e}function Pi(e,n){ne(qn,n),ne(fr,e),ne(Ht,cr),e=On(n),k(Ht),ne(Ht,e)}function Hn(){k(Ht),k(fr),k(qn)}function Mo(e){var n=Xt(qn.current),r=Xt(Ht.current);n=ye(r,e.type,n),r!==n&&(ne(fr,e),ne(Ht,n))}function bi(e){fr.current===e&&(k(Ht),k(fr))}var ft=S(0);function Br(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||qe(r)||ze(r)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if(n.flags&64)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var un=null,kn=null,en=!1;function Do(e,n){var r=Jt(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=n,r.return=e,r.flags=8,e.lastEffect!==null?(e.lastEffect.nextEffect=r,e.lastEffect=r):e.firstEffect=e.lastEffect=r}function jo(e,n){switch(e.tag){case 5:return n=Te(n,e.type,e.pendingProps),n!==null?(e.stateNode=n,!0):!1;case 6:return n=Ce(n,e.pendingProps),n!==null?(e.stateNode=n,!0):!1;case 13:return!1;default:return!1}}function Oi(e){if(en){var n=kn;if(n){var r=n;if(!jo(e,n)){if(n=ke(r),!n||!jo(e,n)){e.flags=e.flags&-1025|2,en=!1,un=e;return}Do(un,r)}un=e,kn=it(n)}else e.flags=e.flags&-1025|2,en=!1,un=e}}function Uo(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;un=e}function Vr(e){if(!at||e!==un)return!1;if(!en)return Uo(e),en=!0,!1;var n=e.type;if(e.tag!==5||n!=="head"&&n!=="body"&&!tt(n,e.memoizedProps))for(n=kn;n;)Do(e,n),n=ke(n);if(Uo(e),e.tag===13){if(!at)throw Error(d(316));if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));kn=Je(e)}else kn=un?ke(e.stateNode):null;return!0}function Ni(){at&&(kn=un=null,en=!1)}var Qn=[];function Ai(){for(var e=0;ep))throw Error(d(301));p+=1,_t=Pt=null,n.updateQueue=null,dr.current=Kl,e=r(l,a)}while(mr)}if(dr.current=Qr,n=Pt!==null&&Pt.next!==null,pr=0,_t=Pt=pt=null,Wr=!1,n)throw Error(d(300));return e}function In(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?pt.memoizedState=_t=e:_t=_t.next=e,_t}function Mn(){if(Pt===null){var e=pt.alternate;e=e!==null?e.memoizedState:null}else e=Pt.next;var n=_t===null?pt.memoizedState:_t.next;if(n!==null)_t=n,Pt=e;else{if(e===null)throw Error(d(310));Pt=e,e={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},_t===null?pt.memoizedState=_t=e:_t=_t.next=e}return _t}function tn(e,n){return typeof n=="function"?n(e):n}function hr(e){var n=Mn(),r=n.queue;if(r===null)throw Error(d(311));r.lastRenderedReducer=e;var l=Pt,a=l.baseQueue,p=r.pending;if(p!==null){if(a!==null){var _=a.next;a.next=p.next,p.next=_}l.baseQueue=a=p,r.pending=null}if(a!==null){a=a.next,l=l.baseState;var L=_=p=null,G=a;do{var ve=G.lane;if((pr&ve)===ve)L!==null&&(L=L.next={lane:0,action:G.action,eagerReducer:G.eagerReducer,eagerState:G.eagerState,next:null}),l=G.eagerReducer===e?G.eagerState:e(l,G.action);else{var Ie={lane:ve,action:G.action,eagerReducer:G.eagerReducer,eagerState:G.eagerState,next:null};L===null?(_=L=Ie,p=l):L=L.next=Ie,pt.lanes|=ve,_r|=ve}G=G.next}while(G!==null&&G!==a);L===null?p=l:L.next=_,Gt(l,n.memoizedState)||(Zt=!0),n.memoizedState=l,n.baseState=p,n.baseQueue=L,r.lastRenderedState=l}return[n.memoizedState,r.dispatch]}function gr(e){var n=Mn(),r=n.queue;if(r===null)throw Error(d(311));r.lastRenderedReducer=e;var l=r.dispatch,a=r.pending,p=n.memoizedState;if(a!==null){r.pending=null;var _=a=a.next;do p=e(p,_.action),_=_.next;while(_!==a);Gt(p,n.memoizedState)||(Zt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),r.lastRenderedState=p}return[p,l]}function Fo(e,n,r){var l=n._getVersion;l=l(n._source);var a=Ft?n._workInProgressVersionPrimary:n._workInProgressVersionSecondary;if(a!==null?e=a===l:(e=e.mutableReadLanes,(e=(pr&e)===e)&&(Ft?n._workInProgressVersionPrimary=l:n._workInProgressVersionSecondary=l,Qn.push(n))),e)return r(n._source);throw Qn.push(n),Error(d(350))}function $o(e,n,r,l){var a=Lt;if(a===null)throw Error(d(349));var p=n._getVersion,_=p(n._source),L=dr.current,G=L.useState(function(){return Fo(a,n,r)}),ve=G[1],Ie=G[0];G=_t;var Ve=e.memoizedState,_e=Ve.refs,ot=_e.getSnapshot,ut=Ve.source;Ve=Ve.subscribe;var Kt=pt;return e.memoizedState={refs:_e,source:n,subscribe:l},L.useEffect(function(){_e.getSnapshot=r,_e.setSnapshot=ve;var D=p(n._source);if(!Gt(_,D)){D=r(n._source),Gt(Ie,D)||(ve(D),D=Cn(Kt),a.mutableReadLanes|=D&a.pendingLanes),D=a.mutableReadLanes,a.entangledLanes|=D;for(var I=a.entanglements,H=D;0r?98:r,function(){e(!0)}),an(97no&&(n.flags|=64,a=!0,Sr(l,!1),n.lanes=33554432)}else{if(!a)if(e=Br(p),e!==null){if(n.flags|=64,a=!0,e=e.updateQueue,e!==null&&(n.updateQueue=e,n.flags|=4),Sr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!p.alternate&&!en)return n=n.lastEffect=l.lastEffect,n!==null&&(n.nextEffect=null),null}else 2*wt()-l.renderingStartTime>no&&r!==1073741824&&(n.flags|=64,a=!0,Sr(l,!1),n.lanes=33554432);l.isBackwards?(p.sibling=n.child,n.child=p):(e=l.last,e!==null?e.sibling=p:n.child=p,l.last=p)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.lastEffect=n.lastEffect,l.renderingStartTime=wt(),e.sibling=null,n=ft.current,ne(ft,a?n&1|2:n&1),e):null;case 23:case 24:return ao(),e!==null&&e.memoizedState!==null!=(n.memoizedState!==null)&&l.mode!=="unstable-defer-without-hiding"&&(n.flags|=4),null}throw Error(d(156,n.tag))}function Xl(e){switch(e.tag){case 1:Oe(e.type)&&Ue();var n=e.flags;return n&4096?(e.flags=n&-4097|64,e):null;case 3:if(Hn(),k(Ae),k(Ee),Ai(),n=e.flags,n&64)throw Error(d(285));return e.flags=n&-4097|64,e;case 5:return bi(e),null;case 13:return k(ft),n=e.flags,n&4096?(e.flags=n&-4097|64,e):null;case 19:return k(ft),null;case 4:return Hn(),null;case 10:return xi(e),null;case 23:case 24:return ao(),null;default:return null}}function zi(e,n){try{var r="",l=n;do r+=ql(l),l=l.return;while(l);var a=r}catch(p){a=` +`),_=a.length-1,A=p.length-1;1<=_&&0<=A&&a[_]!==p[A];)A--;for(;1<=_&&0<=A;_--,A--)if(a[_]!==p[A]){if(_!==1||A!==1)do if(_--,A--,0>A||a[_]!==p[A])return` +`+a[_].replace(" at new "," at ");while(1<=_&&0<=A);break}}}finally{fe=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?U(e):""}var Pe=[],Ne=-1;function S(e){return{current:e}}function k(e){0>Ne||(e.current=Pe[Ne],Pe[Ne]=null,Ne--)}function ne(e,n){Ne++,Pe[Ne]=e.current,e.current=n}var pe={},Ee=S(pe),Le=S(!1),De=pe;function Be(e,n){var r=e.type.contextTypes;if(!r)return pe;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var a={},p;for(p in r)a[p]=n[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=a),a}function Oe(e){return e=e.childContextTypes,e!=null}function Ue(){k(Le),k(Ee)}function Ye(e,n,r){if(Ee.current!==pe)throw Error(d(168));ne(Ee,n),ne(Le,r)}function We(e,n,r){var l=e.stateNode;if(e=n.childContextTypes,typeof l.getChildContext!="function")return r;l=l.getChildContext();for(var a in l)if(!(a in e))throw Error(d(108,te(n)||"Unknown",a));return f({},r,l)}function et(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pe,De=Ee.current,ne(Ee,e),ne(Le,Le.current),!0}function dt(e,n,r){var l=e.stateNode;if(!l)throw Error(d(169));r?(e=We(e,n,De),l.__reactInternalMemoizedMergedChildContext=e,k(Le),k(Ee),ne(Ee,e)):k(Le),ne(Le,r)}var Rt=null,Mt=null,Re=m.unstable_now;Re();var rt=0,He=8;function Et(e){if(1&e)return He=15,1;if(2&e)return He=14,2;if(4&e)return He=13,4;var n=24&e;return n!==0?(He=12,n):e&32?(He=11,32):(n=192&e,n!==0?(He=10,n):e&256?(He=9,256):(n=3584&e,n!==0?(He=8,n):e&4096?(He=7,4096):(n=4186112&e,n!==0?(He=6,n):(n=62914560&e,n!==0?(He=5,n):e&67108864?(He=4,67108864):e&134217728?(He=3,134217728):(n=805306368&e,n!==0?(He=2,n):1073741824&e?(He=1,1073741824):(He=8,e))))))}function Lt(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function An(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(d(358,e))}}function Tn(e,n){var r=e.pendingLanes;if(r===0)return He=0;var l=0,a=0,p=e.expiredLanes,_=e.suspendedLanes,A=e.pingedLanes;if(p!==0)l=p,a=He=15;else if(p=r&134217727,p!==0){var G=p&~_;G!==0?(l=Et(G),a=He):(A&=p,A!==0&&(l=Et(A),a=He))}else p=r&~_,p!==0?(l=Et(p),a=He):A!==0&&(l=Et(A),a=He);if(l===0)return 0;if(l=31-vn(l),l=r&((0>l?0:1<r;r++)n.push(e);return n}function Lr(e,n,r){e.pendingLanes|=n;var l=n-1;e.suspendedLanes&=l,e.pingedLanes&=l,e=e.eventTimes,n=31-vn(n),e[n]=r}var vn=Math.clz32?Math.clz32:Ul,Dl=Math.log,jl=Math.LN2;function Ul(e){return e===0?32:31-(Dl(e)/jl|0)|0}var Fl=m.unstable_runWithPriority,yi=m.unstable_scheduleCallback,vi=m.unstable_cancelCallback,$l=m.unstable_shouldYield,go=m.unstable_requestPaint,Ei=m.unstable_now,zl=m.unstable_getCurrentPriorityLevel,Ar=m.unstable_ImmediatePriority,yo=m.unstable_UserBlockingPriority,vo=m.unstable_NormalPriority,Eo=m.unstable_LowPriority,So=m.unstable_IdlePriority,Si={},Bl=go!==void 0?go:function(){},sn=null,Tr=null,wi=!1,wo=Ei(),wt=1e4>wo?Ei:function(){return Ei()-wo};function Vn(){switch(zl()){case Ar:return 99;case yo:return 98;case vo:return 97;case Eo:return 96;case So:return 95;default:throw Error(d(332))}}function _o(e){switch(e){case 99:return Ar;case 98:return yo;case 97:return vo;case 96:return Eo;case 95:return So;default:throw Error(d(332))}}function an(e,n){return e=_o(e),Fl(e,n)}function sr(e,n,r){return e=_o(e),yi(e,n,r)}function Wt(){if(Tr!==null){var e=Tr;Tr=null,vi(e)}xo()}function xo(){if(!wi&&sn!==null){wi=!0;var e=0;try{var n=sn;an(99,function(){for(;ent?(mt=Ge,Ge=null):mt=Ge.sibling;var Ze=_e(D,Ge,H[nt],Se);if(Ze===null){Ge===null&&(Ge=mt);break}e&&Ge&&Ze.alternate===null&&n(D,Ge),I=p(Ze,I,nt),st===null?Me=Ze:st.sibling=Ze,st=Ze,Ge=mt}if(nt===H.length)return r(D,Ge),Me;if(Ge===null){for(;ntnt?(mt=Ge,Ge=null):mt=Ge.sibling;var bn=_e(D,Ge,Ze.value,Se);if(bn===null){Ge===null&&(Ge=mt);break}e&&Ge&&bn.alternate===null&&n(D,Ge),I=p(bn,I,nt),st===null?Me=bn:st.sibling=bn,st=bn,Ge=mt}if(Ze.done)return r(D,Ge),Me;if(Ge===null){for(;!Ze.done;nt++,Ze=H.next())Ze=Ve(D,Ze.value,Se),Ze!==null&&(I=p(Ze,I,nt),st===null?Me=Ze:st.sibling=Ze,st=Ze);return Me}for(Ge=l(D,Ge);!Ze.done;nt++,Ze=H.next())Ze=ot(Ge,D,nt,Ze.value,Se),Ze!==null&&(e&&Ze.alternate!==null&&Ge.delete(Ze.key===null?nt:Ze.key),I=p(Ze,I,nt),st===null?Me=Ze:st.sibling=Ze,st=Ze);return e&&Ge.forEach(function(ws){return n(D,ws)}),Me}return function(D,I,H,Se){var Me=typeof H=="object"&&H!==null&&H.type===ee&&H.key===null;Me&&(H=H.props.children);var st=typeof H=="object"&&H!==null;if(st)switch(H.$$typeof){case E:e:{for(st=H.key,Me=I;Me!==null;){if(Me.key===st){switch(Me.tag){case 7:if(H.type===ee){r(D,Me.sibling),I=a(Me,H.props.children),I.return=D,D=I;break e}break;default:if(Me.elementType===H.type){r(D,Me.sibling),I=a(Me,H.props),I.ref=ur(D,Me,H),I.return=D,D=I;break e}}r(D,Me);break}else n(D,Me);Me=Me.sibling}H.type===ee?(I=Xn(H.props.children,D.mode,Se,H.key),I.return=D,D=I):(Se=mi(H.type,H.key,H.props,null,D.mode,Se),Se.ref=ur(D,I,H),Se.return=D,D=Se)}return _(D);case w:e:{for(Me=H.key;I!==null;){if(I.key===Me)if(I.tag===4&&I.stateNode.containerInfo===H.containerInfo&&I.stateNode.implementation===H.implementation){r(D,I.sibling),I=a(I,H.children||[]),I.return=D,D=I;break e}else{r(D,I);break}else n(D,I);I=I.sibling}I=ho(H,D.mode,Se),I.return=D,D=I}return _(D)}if(typeof H=="string"||typeof H=="number")return H=""+H,I!==null&&I.tag===6?(r(D,I.sibling),I=a(I,H),I.return=D,D=I):(r(D,I),I=mo(H,D.mode,Se),I.return=D,D=I),_(D);if(Fr(H))return ut(D,I,H,Se);if(O(H))return Kt(D,I,H,Se);if(st&&$r(D,H),typeof H>"u"&&!Me)switch(D.tag){case 1:case 22:case 0:case 11:case 15:throw Error(d(152,te(D.type)||"Component"))}return r(D,I)}}var zr=ko(!0),Io=ko(!1),cr={},Ht=S(cr),fr=S(cr),qn=S(cr);function Xt(e){if(e===cr)throw Error(d(174));return e}function Pi(e,n){ne(qn,n),ne(fr,e),ne(Ht,cr),e=On(n),k(Ht),ne(Ht,e)}function Hn(){k(Ht),k(fr),k(qn)}function Mo(e){var n=Xt(qn.current),r=Xt(Ht.current);n=ye(r,e.type,n),r!==n&&(ne(fr,e),ne(Ht,n))}function bi(e){fr.current===e&&(k(Ht),k(fr))}var ft=S(0);function Br(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||qe(r)||ze(r)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if(n.flags&64)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var un=null,kn=null,en=!1;function Do(e,n){var r=Jt(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=n,r.return=e,r.flags=8,e.lastEffect!==null?(e.lastEffect.nextEffect=r,e.lastEffect=r):e.firstEffect=e.lastEffect=r}function jo(e,n){switch(e.tag){case 5:return n=Te(n,e.type,e.pendingProps),n!==null?(e.stateNode=n,!0):!1;case 6:return n=Ce(n,e.pendingProps),n!==null?(e.stateNode=n,!0):!1;case 13:return!1;default:return!1}}function Oi(e){if(en){var n=kn;if(n){var r=n;if(!jo(e,n)){if(n=ke(r),!n||!jo(e,n)){e.flags=e.flags&-1025|2,en=!1,un=e;return}Do(un,r)}un=e,kn=it(n)}else e.flags=e.flags&-1025|2,en=!1,un=e}}function Uo(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;un=e}function Vr(e){if(!at||e!==un)return!1;if(!en)return Uo(e),en=!0,!1;var n=e.type;if(e.tag!==5||n!=="head"&&n!=="body"&&!tt(n,e.memoizedProps))for(n=kn;n;)Do(e,n),n=ke(n);if(Uo(e),e.tag===13){if(!at)throw Error(d(316));if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));kn=Je(e)}else kn=un?ke(e.stateNode):null;return!0}function Ni(){at&&(kn=un=null,en=!1)}var Qn=[];function Li(){for(var e=0;ep))throw Error(d(301));p+=1,_t=Pt=null,n.updateQueue=null,dr.current=Kl,e=r(l,a)}while(mr)}if(dr.current=Qr,n=Pt!==null&&Pt.next!==null,pr=0,_t=Pt=pt=null,Wr=!1,n)throw Error(d(300));return e}function In(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?pt.memoizedState=_t=e:_t=_t.next=e,_t}function Mn(){if(Pt===null){var e=pt.alternate;e=e!==null?e.memoizedState:null}else e=Pt.next;var n=_t===null?pt.memoizedState:_t.next;if(n!==null)_t=n,Pt=e;else{if(e===null)throw Error(d(310));Pt=e,e={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},_t===null?pt.memoizedState=_t=e:_t=_t.next=e}return _t}function tn(e,n){return typeof n=="function"?n(e):n}function hr(e){var n=Mn(),r=n.queue;if(r===null)throw Error(d(311));r.lastRenderedReducer=e;var l=Pt,a=l.baseQueue,p=r.pending;if(p!==null){if(a!==null){var _=a.next;a.next=p.next,p.next=_}l.baseQueue=a=p,r.pending=null}if(a!==null){a=a.next,l=l.baseState;var A=_=p=null,G=a;do{var ve=G.lane;if((pr&ve)===ve)A!==null&&(A=A.next={lane:0,action:G.action,eagerReducer:G.eagerReducer,eagerState:G.eagerState,next:null}),l=G.eagerReducer===e?G.eagerState:e(l,G.action);else{var Ie={lane:ve,action:G.action,eagerReducer:G.eagerReducer,eagerState:G.eagerState,next:null};A===null?(_=A=Ie,p=l):A=A.next=Ie,pt.lanes|=ve,_r|=ve}G=G.next}while(G!==null&&G!==a);A===null?p=l:A.next=_,Gt(l,n.memoizedState)||(Zt=!0),n.memoizedState=l,n.baseState=p,n.baseQueue=A,r.lastRenderedState=l}return[n.memoizedState,r.dispatch]}function gr(e){var n=Mn(),r=n.queue;if(r===null)throw Error(d(311));r.lastRenderedReducer=e;var l=r.dispatch,a=r.pending,p=n.memoizedState;if(a!==null){r.pending=null;var _=a=a.next;do p=e(p,_.action),_=_.next;while(_!==a);Gt(p,n.memoizedState)||(Zt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),r.lastRenderedState=p}return[p,l]}function Fo(e,n,r){var l=n._getVersion;l=l(n._source);var a=Ft?n._workInProgressVersionPrimary:n._workInProgressVersionSecondary;if(a!==null?e=a===l:(e=e.mutableReadLanes,(e=(pr&e)===e)&&(Ft?n._workInProgressVersionPrimary=l:n._workInProgressVersionSecondary=l,Qn.push(n))),e)return r(n._source);throw Qn.push(n),Error(d(350))}function $o(e,n,r,l){var a=At;if(a===null)throw Error(d(349));var p=n._getVersion,_=p(n._source),A=dr.current,G=A.useState(function(){return Fo(a,n,r)}),ve=G[1],Ie=G[0];G=_t;var Ve=e.memoizedState,_e=Ve.refs,ot=_e.getSnapshot,ut=Ve.source;Ve=Ve.subscribe;var Kt=pt;return e.memoizedState={refs:_e,source:n,subscribe:l},A.useEffect(function(){_e.getSnapshot=r,_e.setSnapshot=ve;var D=p(n._source);if(!Gt(_,D)){D=r(n._source),Gt(Ie,D)||(ve(D),D=Cn(Kt),a.mutableReadLanes|=D&a.pendingLanes),D=a.mutableReadLanes,a.entangledLanes|=D;for(var I=a.entanglements,H=D;0r?98:r,function(){e(!0)}),an(97no&&(n.flags|=64,a=!0,Sr(l,!1),n.lanes=33554432)}else{if(!a)if(e=Br(p),e!==null){if(n.flags|=64,a=!0,e=e.updateQueue,e!==null&&(n.updateQueue=e,n.flags|=4),Sr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!p.alternate&&!en)return n=n.lastEffect=l.lastEffect,n!==null&&(n.nextEffect=null),null}else 2*wt()-l.renderingStartTime>no&&r!==1073741824&&(n.flags|=64,a=!0,Sr(l,!1),n.lanes=33554432);l.isBackwards?(p.sibling=n.child,n.child=p):(e=l.last,e!==null?e.sibling=p:n.child=p,l.last=p)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.lastEffect=n.lastEffect,l.renderingStartTime=wt(),e.sibling=null,n=ft.current,ne(ft,a?n&1|2:n&1),e):null;case 23:case 24:return ao(),e!==null&&e.memoizedState!==null!=(n.memoizedState!==null)&&l.mode!=="unstable-defer-without-hiding"&&(n.flags|=4),null}throw Error(d(156,n.tag))}function Xl(e){switch(e.tag){case 1:Oe(e.type)&&Ue();var n=e.flags;return n&4096?(e.flags=n&-4097|64,e):null;case 3:if(Hn(),k(Le),k(Ee),Li(),n=e.flags,n&64)throw Error(d(285));return e.flags=n&-4097|64,e;case 5:return bi(e),null;case 13:return k(ft),n=e.flags,n&4096?(e.flags=n&-4097|64,e):null;case 19:return k(ft),null;case 4:return Hn(),null;case 10:return xi(e),null;case 23:case 24:return ao(),null;default:return null}}function zi(e,n){try{var r="",l=n;do r+=ql(l),l=l.return;while(l);var a=r}catch(p){a=` Error generating stack: `+p.message+` -`+p.stack}return{value:e,source:n,stack:a}}function Bi(e,n){try{console.error(n.value)}catch(r){setTimeout(function(){throw r})}}var es=typeof WeakMap=="function"?WeakMap:Map;function al(e,n,r){r=Sn(-1,r),r.tag=3,r.payload={element:null};var l=n.value;return r.callback=function(){si||(si=!0,ro=l),Bi(e,n)},r}function ul(e,n,r){r=Sn(-1,r),r.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var a=n.value;r.payload=function(){return Bi(e,n),l(a)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(r.callback=function(){typeof l!="function"&&(rn===null?rn=new Set([this]):rn.add(this),Bi(e,n));var _=n.stack;this.componentDidCatch(n.value,{componentStack:_!==null?_:""})}),r}var ts=typeof WeakSet=="function"?WeakSet:Set;function cl(e){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Rn(e,r)}else n.current=null}function ns(e,n){switch(n.tag){case 0:case 11:case 15:case 22:return;case 1:if(n.flags&256&&e!==null){var r=e.memoizedProps,l=e.memoizedState;e=n.stateNode,n=e.getSnapshotBeforeUpdate(n.elementType===n.type?r:Yt(n.type,r),l),e.__reactInternalSnapshotBeforeUpdate=n}return;case 3:ht&&n.flags&256&&R(n.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(d(163))}function fl(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do{if((r.tag&e)===e){var l=r.destroy;r.destroy=void 0,l!==void 0&&l()}r=r.next}while(r!==n)}}function rs(e,n,r){switch(r.tag){case 0:case 11:case 15:case 22:if(n=r.updateQueue,n=n!==null?n.lastEffect:null,n!==null){e=n=n.next;do{if((e.tag&3)===3){var l=e.create;e.destroy=l()}e=e.next}while(e!==n)}if(n=r.updateQueue,n=n!==null?n.lastEffect:null,n!==null){e=n=n.next;do{var a=e;l=a.next,a=a.tag,a&4&&a&1&&(Ol(r,e),ds(r,e)),e=l}while(e!==n)}return;case 1:e=r.stateNode,r.flags&4&&(n===null?e.componentDidMount():(l=r.elementType===r.type?n.memoizedProps:Yt(r.type,n.memoizedProps),e.componentDidUpdate(l,n.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),n=r.updateQueue,n!==null&&Oo(r,n,e);return;case 3:if(n=r.updateQueue,n!==null){if(e=null,r.child!==null)switch(r.child.tag){case 5:e=ct(r.child.stateNode);break;case 1:e=r.child.stateNode}Oo(r,n,e)}return;case 5:e=r.stateNode,n===null&&r.flags&4&&Fn(e,r.type,r.memoizedProps,r);return;case 6:return;case 4:return;case 12:return;case 13:at&&r.memoizedState===null&&(r=r.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&W(r))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(d(163))}function dl(e,n){if(ht)for(var r=e;;){if(r.tag===5){var l=r.stateNode;n?Y(l):h(r.stateNode,r.memoizedProps)}else if(r.tag===6)l=r.stateNode,n?ae(l):v(l,r.memoizedProps);else if((r.tag!==23&&r.tag!==24||r.memoizedState===null||r===e)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function pl(e,n){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(Rt,n)}catch{}switch(n.tag){case 0:case 11:case 14:case 15:case 22:if(e=n.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var r=e=e.next;do{var l=r,a=l.destroy;if(l=l.tag,a!==void 0)if(l&4)Ol(n,r);else{l=n;try{a()}catch(p){Rn(l,p)}}r=r.next}while(r!==e)}break;case 1:if(cl(n),e=n.stateNode,typeof e.componentWillUnmount=="function")try{e.props=n.memoizedProps,e.state=n.memoizedState,e.componentWillUnmount()}catch(p){Rn(n,p)}break;case 5:cl(n);break;case 4:ht?vl(e,n):vt&&vt&&(n=n.stateNode.containerInfo,e=oe(n),he(n,e))}}function ml(e,n){for(var r=n;;)if(pl(e,r),r.child===null||ht&&r.tag===4){if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return;r=r.return}r.sibling.return=r.return,r=r.sibling}else r.child.return=r,r=r.child}function hl(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function gl(e){return e.tag===5||e.tag===3||e.tag===4}function yl(e){if(ht){e:{for(var n=e.return;n!==null;){if(gl(n))break e;n=n.return}throw Error(d(160))}var r=n;switch(n=r.stateNode,r.tag){case 5:var l=!1;break;case 3:n=n.containerInfo,l=!0;break;case 4:n=n.containerInfo,l=!0;break;default:throw Error(d(161))}r.flags&16&&(M(n),r.flags&=-17);e:t:for(r=e;;){for(;r.sibling===null;){if(r.return===null||gl(r.return)){r=null;break e}r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue t;r.child.return=r,r=r.child}if(!(r.flags&2)){r=r.stateNode;break e}}l?Vi(e,r,n):Wi(e,r,n)}}function Vi(e,n,r){var l=e.tag,a=l===5||l===6;if(a)e=a?e.stateNode:e.stateNode.instance,n?yn(r,e,n):lr(r,e);else if(l!==4&&(e=e.child,e!==null))for(Vi(e,n,r),e=e.sibling;e!==null;)Vi(e,n,r),e=e.sibling}function Wi(e,n,r){var l=e.tag,a=l===5||l===6;if(a)e=a?e.stateNode:e.stateNode.instance,n?Vt(r,e,n):or(r,e);else if(l!==4&&(e=e.child,e!==null))for(Wi(e,n,r),e=e.sibling;e!==null;)Wi(e,n,r),e=e.sibling}function vl(e,n){for(var r=n,l=!1,a,p;;){if(!l){l=r.return;e:for(;;){if(l===null)throw Error(d(160));switch(a=l.stateNode,l.tag){case 5:p=!1;break e;case 3:a=a.containerInfo,p=!0;break e;case 4:a=a.containerInfo,p=!0;break e}l=l.return}l=!0}if(r.tag===5||r.tag===6)ml(e,r),p?N(a,r.stateNode):y(a,r.stateNode);else if(r.tag===4){if(r.child!==null){a=r.stateNode.containerInfo,p=!0,r.child.return=r,r=r.child;continue}}else if(pl(e,r),r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return;r=r.return,r.tag===4&&(l=!1)}r.sibling.return=r.return,r=r.sibling}}function Gi(e,n){if(ht){switch(n.tag){case 0:case 11:case 14:case 15:case 22:fl(3,n);return;case 1:return;case 5:var r=n.stateNode;if(r!=null){var l=n.memoizedProps;e=e!==null?e.memoizedProps:l;var a=n.type,p=n.updateQueue;n.updateQueue=null,p!==null&&$n(r,p,a,e,l,n)}return;case 6:if(n.stateNode===null)throw Error(d(162));r=n.memoizedProps,Un(n.stateNode,e!==null?e.memoizedProps:r,r);return;case 3:at&&(n=n.stateNode,n.hydrate&&(n.hydrate=!1,ge(n.containerInfo)));return;case 12:return;case 13:El(n),Zr(n);return;case 19:Zr(n);return;case 17:return;case 23:case 24:dl(n,n.memoizedState!==null);return}throw Error(d(163))}switch(n.tag){case 0:case 11:case 14:case 15:case 22:fl(3,n);return;case 12:return;case 13:El(n),Zr(n);return;case 19:Zr(n);return;case 3:at&&(r=n.stateNode,r.hydrate&&(r.hydrate=!1,ge(r.containerInfo)));break;case 23:case 24:return}e:if(vt){switch(n.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:n=n.stateNode,he(n.containerInfo,n.pendingChildren);break e}throw Error(d(163))}}function El(e){e.memoizedState!==null&&(to=wt(),ht&&dl(e.child,!0))}function Zr(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new ts),n.forEach(function(l){var a=hs.bind(null,e,l);r.has(l)||(r.add(l),l.then(a,a))})}}function is(e,n){return e!==null&&(e=e.memoizedState,e===null||e.dehydrated!==null)?(n=n.memoizedState,n!==null&&n.dehydrated===null):!1}var Xr=0,ei=1,ti=2,ni=3,ri=4;if(typeof Symbol=="function"&&Symbol.for){var wr=Symbol.for;Xr=wr("selector.component"),ei=wr("selector.has_pseudo_class"),ti=wr("selector.role"),ni=wr("selector.test_id"),ri=wr("selector.text")}function qi(e){var n=kt(e);if(n!=null){if(typeof n.memoizedProps["data-testname"]!="string")throw Error(d(364));return n}if(e=er(e),e===null)throw Error(d(362));return e.stateNode.current}function Hi(e,n){switch(n.$$typeof){case Xr:if(e.type===n.value)return!0;break;case ei:e:{n=n.value,e=[e,0];for(var r=0;r";case ei:return":has("+(Qi(e)||"")+")";case ti:return'[role="'+e.value+'"]';case ri:return'"'+e.value+'"';case ni:return'[data-testname="'+e.value+'"]';default:throw Error(d(365,e))}}function Sl(e,n){var r=[];e=[e,0];for(var l=0;la&&(a=_),r&=~p}if(r=a,r=wt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ls(r/1960))-r,10";case ei:return":has("+(Qi(e)||"")+")";case ti:return'[role="'+e.value+'"]';case ri:return'"'+e.value+'"';case ni:return'[data-testname="'+e.value+'"]';default:throw Error(d(365,e))}}function Sl(e,n){var r=[];e=[e,0];for(var l=0;la&&(a=_),r&=~p}if(r=a,r=wt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ls(r/1960))-r,10 component higher in the tree to provide a loading indicator or placeholder to display.`)}xt!==5&&(xt=2),G=zi(G,L),_e=_;do{switch(_e.tag){case 3:p=G,_e.flags|=4096,n&=-n,_e.lanes|=n;var st=al(_e,p,n);bo(_e,st);break e;case 1:p=G;var Ge=_e.type,nt=_e.stateNode;if(!(_e.flags&64)&&(typeof Ge.getDerivedStateFromError=="function"||nt!==null&&typeof nt.componentDidCatch=="function"&&(rn===null||!rn.has(nt)))){_e.flags|=4096,n&=-n,_e.lanes|=n;var mt=ul(_e,p,n);bo(_e,mt);break e}}_e=_e.return}while(_e!==null)}bl(r)}catch(Ze){n=Ze,gt===r&&r!==null&&(gt=r=r.return);continue}break}while(!0)}function Rl(){var e=oi.current;return oi.current=Qr,e===null?Qr:e}function Or(e,n){var r=Fe;Fe|=16;var l=Rl();Lt===e&&bt===n||Zn(e,n);do try{as();break}catch(a){Cl(e,a)}while(!0);if(_i(),Fe=r,oi.current=l,gt!==null)throw Error(d(261));return Lt=null,bt=0,xt}function as(){for(;gt!==null;)Pl(gt)}function us(){for(;gt!==null&&!$l();)Pl(gt)}function Pl(e){var n=Al(e.alternate,e,Dn);e.memoizedProps=e.pendingProps,n===null?bl(e):gt=n,Ki.current=null}function bl(e){var n=e;do{var r=n.alternate;if(e=n.return,n.flags&2048){if(r=Xl(n),r!==null){r.flags&=2047,gt=r;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(r=Zl(r,n,Dn),r!==null){gt=r;return}if(r=n,r.tag!==24&&r.tag!==23||r.memoizedState===null||Dn&1073741824||!(r.mode&4)){for(var l=0,a=r.child;a!==null;)l|=a.lanes|a.childLanes,a=a.sibling;r.childLanes=l}e!==null&&!(e.flags&2048)&&(e.firstEffect===null&&(e.firstEffect=n.firstEffect),n.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=n.firstEffect),e.lastEffect=n.lastEffect),1wt()-to?Zn(e,0):Xi|=r),$t(e,n)}function hs(e,n){var r=e.stateNode;r!==null&&r.delete(n),n=0,n===0&&(n=e.mode,n&2?n&4?(dn===0&&(dn=Jn),n=Bn(62914560&~dn),n===0&&(n=4194304)):n=Vn()===99?1:2:n=1),r=Ut(),e=ci(e,n),e!==null&&(Ar(e,n,r),$t(e,r))}var Al;Al=function(e,n,r){var l=n.lanes;if(e!==null)if(e.memoizedProps!==n.pendingProps||Ae.current)Zt=!0;else if(r&l)Zt=!!(e.flags&16384);else{switch(Zt=!1,n.tag){case 3:el(n),Ni();break;case 5:Mo(n);break;case 1:Oe(n.type)&&et(n);break;case 4:Pi(n,n.stateNode.containerInfo);break;case 10:Co(n,n.memoizedProps.value);break;case 13:if(n.memoizedState!==null)return r&n.child.childLanes?tl(e,n,r):(ne(ft,ft.current&1),n=cn(e,n,r),n!==null?n.sibling:null);ne(ft,ft.current&1);break;case 19:if(l=(r&n.childLanes)!==0,e.flags&64){if(l)return ll(e,n,r);n.flags|=64}var a=n.memoizedState;if(a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ne(ft,ft.current),l)break;return null;case 23:case 24:return n.lanes=0,ji(e,n,r)}return cn(e,n,r)}else Zt=!1;switch(n.lanes=0,n.tag){case 2:if(l=n.type,e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2),e=n.pendingProps,a=Be(n,Ee.current),Gn(n,r),a=Ti(null,n,l,e,a,r),n.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0){if(n.tag=1,n.memoizedState=null,n.updateQueue=null,Oe(l)){var p=!0;et(n)}else p=!1;n.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ci(n);var _=l.getDerivedStateFromProps;typeof _=="function"&&jr(n,l,_,e),a.updater=Ur,n.stateNode=a,a._reactInternals=n,Ri(n,l,e,r),n=Fi(null,n,l,!0,p,r)}else n.tag=0,jt(null,n,a,r),n=n.child;return n;case 16:a=n.elementType;e:{switch(e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2),e=n.pendingProps,p=a._init,a=p(a._payload),n.type=a,p=n.tag=ys(a),e=Yt(a,e),p){case 0:n=Ui(null,n,a,e,r);break e;case 1:n=Xo(null,n,a,e,r);break e;case 11:n=Jo(null,n,a,e,r);break e;case 14:n=Ko(null,n,a,Yt(a.type,e),l,r);break e}throw Error(d(306,a,""))}return n;case 0:return l=n.type,a=n.pendingProps,a=n.elementType===l?a:Yt(l,a),Ui(e,n,l,a,r);case 1:return l=n.type,a=n.pendingProps,a=n.elementType===l?a:Yt(l,a),Xo(e,n,l,a,r);case 3:if(el(n),l=n.updateQueue,e===null||l===null)throw Error(d(282));if(l=n.pendingProps,a=n.memoizedState,a=a!==null?a.element:null,Po(e,n),ar(n,l,null,r),l=n.memoizedState.element,l===a)Ni(),n=cn(e,n,r);else{if(a=n.stateNode,(p=a.hydrate)&&(at?(kn=it(n.stateNode.containerInfo),un=n,p=en=!0):p=!1),p){if(at&&(e=a.mutableSourceEagerHydrationData,e!=null))for(a=0;a=ve&&p>=Ve&&a<=Ie&&_<=_e){e.splice(n,1);break}else if(l!==ve||r.width!==G.width||_e_){if(!(p!==Ve||r.height!==G.height||Iea)){ve>l&&(G.width+=ve-l,G.x=l),Iep&&(G.height+=Ve-p,G.y=p),_e<_&&(G.height=_-Ve),e.splice(n,1);break}}}return e},u.findHostInstance=Il,u.findHostInstanceWithNoPortals=function(e){return e=Xe(e),e===null?null:e.tag===20?e.stateNode.instance:e.stateNode},u.findHostInstanceWithWarning=function(e){return Il(e)},u.flushControlled=function(e){var n=Fe;Fe|=1;try{an(99,e)}finally{Fe=n,Fe===0&&(_n(),Wt())}},u.flushDiscreteUpdates=function(){!(Fe&49)&&(ss(),mn())},u.flushPassiveEffects=mn,u.flushSync=xl,u.focusWithin=function(e,n){if(!Ct)throw Error(d(363));for(e=qi(e),n=Sl(e,n),n=Array.from(n),e=0;er&&(r=_)),_ component higher in the tree to provide a loading indicator or placeholder to display.`)}xt!==5&&(xt=2),G=zi(G,A),_e=_;do{switch(_e.tag){case 3:p=G,_e.flags|=4096,n&=-n,_e.lanes|=n;var st=al(_e,p,n);bo(_e,st);break e;case 1:p=G;var Ge=_e.type,nt=_e.stateNode;if(!(_e.flags&64)&&(typeof Ge.getDerivedStateFromError=="function"||nt!==null&&typeof nt.componentDidCatch=="function"&&(rn===null||!rn.has(nt)))){_e.flags|=4096,n&=-n,_e.lanes|=n;var mt=ul(_e,p,n);bo(_e,mt);break e}}_e=_e.return}while(_e!==null)}bl(r)}catch(Ze){n=Ze,gt===r&&r!==null&&(gt=r=r.return);continue}break}while(!0)}function Rl(){var e=oi.current;return oi.current=Qr,e===null?Qr:e}function Or(e,n){var r=Fe;Fe|=16;var l=Rl();At===e&&bt===n||Zn(e,n);do try{as();break}catch(a){Cl(e,a)}while(!0);if(_i(),Fe=r,oi.current=l,gt!==null)throw Error(d(261));return At=null,bt=0,xt}function as(){for(;gt!==null;)Pl(gt)}function us(){for(;gt!==null&&!$l();)Pl(gt)}function Pl(e){var n=Ll(e.alternate,e,Dn);e.memoizedProps=e.pendingProps,n===null?bl(e):gt=n,Ki.current=null}function bl(e){var n=e;do{var r=n.alternate;if(e=n.return,n.flags&2048){if(r=Xl(n),r!==null){r.flags&=2047,gt=r;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(r=Zl(r,n,Dn),r!==null){gt=r;return}if(r=n,r.tag!==24&&r.tag!==23||r.memoizedState===null||Dn&1073741824||!(r.mode&4)){for(var l=0,a=r.child;a!==null;)l|=a.lanes|a.childLanes,a=a.sibling;r.childLanes=l}e!==null&&!(e.flags&2048)&&(e.firstEffect===null&&(e.firstEffect=n.firstEffect),n.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=n.firstEffect),e.lastEffect=n.lastEffect),1wt()-to?Zn(e,0):Xi|=r),$t(e,n)}function hs(e,n){var r=e.stateNode;r!==null&&r.delete(n),n=0,n===0&&(n=e.mode,n&2?n&4?(dn===0&&(dn=Jn),n=Bn(62914560&~dn),n===0&&(n=4194304)):n=Vn()===99?1:2:n=1),r=Ut(),e=ci(e,n),e!==null&&(Lr(e,n,r),$t(e,r))}var Ll;Ll=function(e,n,r){var l=n.lanes;if(e!==null)if(e.memoizedProps!==n.pendingProps||Le.current)Zt=!0;else if(r&l)Zt=!!(e.flags&16384);else{switch(Zt=!1,n.tag){case 3:el(n),Ni();break;case 5:Mo(n);break;case 1:Oe(n.type)&&et(n);break;case 4:Pi(n,n.stateNode.containerInfo);break;case 10:Co(n,n.memoizedProps.value);break;case 13:if(n.memoizedState!==null)return r&n.child.childLanes?tl(e,n,r):(ne(ft,ft.current&1),n=cn(e,n,r),n!==null?n.sibling:null);ne(ft,ft.current&1);break;case 19:if(l=(r&n.childLanes)!==0,e.flags&64){if(l)return ll(e,n,r);n.flags|=64}var a=n.memoizedState;if(a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ne(ft,ft.current),l)break;return null;case 23:case 24:return n.lanes=0,ji(e,n,r)}return cn(e,n,r)}else Zt=!1;switch(n.lanes=0,n.tag){case 2:if(l=n.type,e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2),e=n.pendingProps,a=Be(n,Ee.current),Gn(n,r),a=Ti(null,n,l,e,a,r),n.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0){if(n.tag=1,n.memoizedState=null,n.updateQueue=null,Oe(l)){var p=!0;et(n)}else p=!1;n.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ci(n);var _=l.getDerivedStateFromProps;typeof _=="function"&&jr(n,l,_,e),a.updater=Ur,n.stateNode=a,a._reactInternals=n,Ri(n,l,e,r),n=Fi(null,n,l,!0,p,r)}else n.tag=0,jt(null,n,a,r),n=n.child;return n;case 16:a=n.elementType;e:{switch(e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2),e=n.pendingProps,p=a._init,a=p(a._payload),n.type=a,p=n.tag=ys(a),e=Yt(a,e),p){case 0:n=Ui(null,n,a,e,r);break e;case 1:n=Xo(null,n,a,e,r);break e;case 11:n=Jo(null,n,a,e,r);break e;case 14:n=Ko(null,n,a,Yt(a.type,e),l,r);break e}throw Error(d(306,a,""))}return n;case 0:return l=n.type,a=n.pendingProps,a=n.elementType===l?a:Yt(l,a),Ui(e,n,l,a,r);case 1:return l=n.type,a=n.pendingProps,a=n.elementType===l?a:Yt(l,a),Xo(e,n,l,a,r);case 3:if(el(n),l=n.updateQueue,e===null||l===null)throw Error(d(282));if(l=n.pendingProps,a=n.memoizedState,a=a!==null?a.element:null,Po(e,n),ar(n,l,null,r),l=n.memoizedState.element,l===a)Ni(),n=cn(e,n,r);else{if(a=n.stateNode,(p=a.hydrate)&&(at?(kn=it(n.stateNode.containerInfo),un=n,p=en=!0):p=!1),p){if(at&&(e=a.mutableSourceEagerHydrationData,e!=null))for(a=0;a=ve&&p>=Ve&&a<=Ie&&_<=_e){e.splice(n,1);break}else if(l!==ve||r.width!==G.width||_e_){if(!(p!==Ve||r.height!==G.height||Iea)){ve>l&&(G.width+=ve-l,G.x=l),Iep&&(G.height+=Ve-p,G.y=p),_e<_&&(G.height=_-Ve),e.splice(n,1);break}}}return e},u.findHostInstance=Il,u.findHostInstanceWithNoPortals=function(e){return e=Xe(e),e===null?null:e.tag===20?e.stateNode.instance:e.stateNode},u.findHostInstanceWithWarning=function(e){return Il(e)},u.flushControlled=function(e){var n=Fe;Fe|=1;try{an(99,e)}finally{Fe=n,Fe===0&&(_n(),Wt())}},u.flushDiscreteUpdates=function(){!(Fe&49)&&(ss(),mn())},u.flushPassiveEffects=mn,u.flushSync=xl,u.focusWithin=function(e,n){if(!Ct)throw Error(d(363));for(e=qi(e),n=Sl(e,n),n=Array.from(n),e=0;er&&(r=_)),_ ")+` No matching component was found for: - `)+e.join(" > ")}return null},u.getPublicRootInstance=function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return ct(e.child.stateNode);default:return e.child.stateNode}},u.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:Es,findFiberByHostInstance:e.findFiberByHostInstance||Ss,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")e=!1;else{var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n.isDisabled&&n.supportsFiber)try{Rt=n.inject(e),Mt=n}catch{}e=!0}return e},u.observeVisibleRects=function(e,n,r,l){if(!Ct)throw Error(d(363));e=Ji(e,n);var a=ir(e,r,l).disconnect;return{disconnect:function(){a()}}},u.registerMutableSourceForHydration=function(e,n){var r=n._getVersion;r=r(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,r]:e.mutableSourceEagerHydrationData.push(n,r)},u.runWithPriority=function(e,n){var r=rt;try{return rt=e,n()}finally{rt=r}},u.shouldSuspend=function(){return!1},u.unbatchedUpdates=function(e,n){var r=Fe;Fe&=-2,Fe|=8;try{return e(n)}finally{Fe=r,Fe===0&&(_n(),Wt())}},u.updateContainer=function(e,n,r,l){var a=n.current,p=Ut(),_=Cn(a);e:if(r){r=r._reactInternals;t:{if(Z(r)!==r||r.tag!==1)throw Error(d(170));var L=r;do{switch(L.tag){case 3:L=L.stateNode.context;break t;case 1:if(Oe(L.type)){L=L.stateNode.__reactInternalMemoizedMergedChildContext;break t}}L=L.return}while(L!==null);throw Error(d(171))}if(r.tag===1){var G=r.type;if(Oe(G)){r=We(r,G,L);break e}}r=L}else r=pe;return n.context===null?n.context=r:n.pendingContext=r,n=Sn(p,_),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),wn(a,n),pn(a,_,p),_},u}})(reactReconciler_production_min);var reactReconciler_production_minExports=reactReconciler_production_min.exports;reactReconciler.exports=reactReconciler_production_minExports;var reactReconcilerExports=reactReconciler.exports,sourceMap={},sourceMapGenerator={},base64Vlq={},base64$1={},intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");base64$1.encode=function(i){if(0<=i&&i>1;return s?-o:o}base64Vlq.encode=function(s){var o="",u,f=toVLQSigned(s);do u=f&VLQ_BASE_MASK,f>>>=VLQ_BASE_SHIFT,f>0&&(u|=VLQ_CONTINUATION_BIT),o+=base64.encode(u);while(f>0);return o};base64Vlq.decode=function(s,o,u){var f=s.length,c=0,m=0,d,C;do{if(o>=f)throw new Error("Expected more digits in base 64 VLQ value.");if(C=base64.decode(s.charCodeAt(o++)),C===-1)throw new Error("Invalid base64 digit: "+s.charAt(o-1));d=!!(C&VLQ_CONTINUATION_BIT),C&=VLQ_BASE_MASK,c=c+(C<m&&g.pop(),Z}}var C=d(function(g){var x=g,O=f(g);if(O){if(!O.path)return g;x=O.path}for(var te=i.isAbsolute(x),Z=[],we=0,Le=0;;)if(we=Le,Le=x.indexOf("/",we),Le===-1){Z.push(x.slice(we));break}else for(Z.push(x.slice(we,Le));Le=0;Le--)Ke=Z[Le],Ke==="."?Z.splice(Le,1):Ke===".."?Xe++:Xe>0&&(Ke===""?(Z.splice(Le+1,Xe),Xe=0):(Z.splice(Le,2),Xe--));return x=Z.join("/"),x===""&&(x=te?"/":"."),O?(O.path=x,c(O)):x});i.normalize=C;function E(b,g){b===""&&(b="."),g===""&&(g=".");var x=f(g),O=f(b);if(O&&(b=O.path||"/"),x&&!x.scheme)return O&&(x.scheme=O.scheme),c(x);if(x||g.match(u))return g;if(O&&!O.host&&!O.path)return O.host=g,c(O);var te=g.charAt(0)==="/"?g:C(b.replace(/\/+$/,"")+"/"+g);return O?(O.path=te,c(O)):te}i.join=E,i.isAbsolute=function(b){return b.charAt(0)==="/"||o.test(b)};function w(b,g){b===""&&(b="."),b=b.replace(/\/$/,"");for(var x=0;g.indexOf(b+"/")!==0;){var O=b.lastIndexOf("/");if(O<0||(b=b.slice(0,O),b.match(/^([^\/]+:\/)?\/*$/)))return g;++x}return Array(x+1).join("../")+g.substr(b.length+1)}i.relative=w;var ee=function(){var b=Object.create(null);return!("__proto__"in b)}();function V(b){return b}function re(b){return ie(b)?"$"+b:b}i.toSetString=ee?V:re;function z(b){return ie(b)?b.slice(1):b}i.fromSetString=ee?V:z;function ie(b){if(!b)return!1;var g=b.length;if(g<9||b.charCodeAt(g-1)!==95||b.charCodeAt(g-2)!==95||b.charCodeAt(g-3)!==111||b.charCodeAt(g-4)!==116||b.charCodeAt(g-5)!==111||b.charCodeAt(g-6)!==114||b.charCodeAt(g-7)!==112||b.charCodeAt(g-8)!==95||b.charCodeAt(g-9)!==95)return!1;for(var x=g-10;x>=0;x--)if(b.charCodeAt(x)!==36)return!1;return!0}function ce(b,g,x){var O=$(b.source,g.source);return O!==0||(O=b.originalLine-g.originalLine,O!==0)||(O=b.originalColumn-g.originalColumn,O!==0||x)||(O=b.generatedColumn-g.generatedColumn,O!==0)||(O=b.generatedLine-g.generatedLine,O!==0)?O:$(b.name,g.name)}i.compareByOriginalPositions=ce;function F(b,g,x){var O;return O=b.originalLine-g.originalLine,O!==0||(O=b.originalColumn-g.originalColumn,O!==0||x)||(O=b.generatedColumn-g.generatedColumn,O!==0)||(O=b.generatedLine-g.generatedLine,O!==0)?O:$(b.name,g.name)}i.compareByOriginalPositionsNoSource=F;function q(b,g,x){var O=b.generatedLine-g.generatedLine;return O!==0||(O=b.generatedColumn-g.generatedColumn,O!==0||x)||(O=$(b.source,g.source),O!==0)||(O=b.originalLine-g.originalLine,O!==0)||(O=b.originalColumn-g.originalColumn,O!==0)?O:$(b.name,g.name)}i.compareByGeneratedPositionsDeflated=q;function A(b,g,x){var O=b.generatedColumn-g.generatedColumn;return O!==0||x||(O=$(b.source,g.source),O!==0)||(O=b.originalLine-g.originalLine,O!==0)||(O=b.originalColumn-g.originalColumn,O!==0)?O:$(b.name,g.name)}i.compareByGeneratedPositionsDeflatedNoLine=A;function $(b,g){return b===g?0:b===null?1:g===null?-1:b>g?1:-1}function X(b,g){var x=b.generatedLine-g.generatedLine;return x!==0||(x=b.generatedColumn-g.generatedColumn,x!==0)||(x=$(b.source,g.source),x!==0)||(x=b.originalLine-g.originalLine,x!==0)||(x=b.originalColumn-g.originalColumn,x!==0)?x:$(b.name,g.name)}i.compareByGeneratedPositionsInflated=X;function J(b){return JSON.parse(b.replace(/^\)]}'[^\n]*\n/,""))}i.parseSourceMapInput=J;function K(b,g,x){if(g=g||"",b&&(b[b.length-1]!=="/"&&g[0]!=="/"&&(b+="/"),g=b+g),x){var O=f(x);if(!O)throw new Error("sourceMapURL could not be parsed");if(O.path){var te=O.path.lastIndexOf("/");te>=0&&(O.path=O.path.substring(0,te+1))}g=E(c(O),g)}return C(g)}i.computeSourceURL=K})(util$5);var arraySet={},util$4=util$5,has=Object.prototype.hasOwnProperty,hasNativeMap=typeof Map<"u";function ArraySet$2(){this._array=[],this._set=hasNativeMap?new Map:Object.create(null)}ArraySet$2.fromArray=function(s,o){for(var u=new ArraySet$2,f=0,c=s.length;f=0)return o}else{var u=util$4.toSetString(s);if(has.call(this._set,u))return this._set[u]}throw new Error('"'+s+'" is not in the set.')};ArraySet$2.prototype.at=function(s){if(s>=0&&so||u==o&&c>=f||util$3.compareByGeneratedPositionsInflated(i,s)<=0}function MappingList$1(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}MappingList$1.prototype.unsortedForEach=function(s,o){this._array.forEach(s,o)};MappingList$1.prototype.add=function(s){generatedPositionAfter(this._last,s)?(this._last=s,this._array.push(s)):(this._sorted=!1,this._array.push(s))};MappingList$1.prototype.toArray=function(){return this._sorted||(this._array.sort(util$3.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};mappingList.MappingList=MappingList$1;var base64VLQ$1=base64Vlq,util$2=util$5,ArraySet$1=arraySet.ArraySet,MappingList=mappingList.MappingList;function SourceMapGenerator$2(i){i||(i={}),this._file=util$2.getArg(i,"file",null),this._sourceRoot=util$2.getArg(i,"sourceRoot",null),this._skipValidation=util$2.getArg(i,"skipValidation",!1),this._ignoreInvalidMapping=util$2.getArg(i,"ignoreInvalidMapping",!1),this._sources=new ArraySet$1,this._names=new ArraySet$1,this._mappings=new MappingList,this._sourcesContents=null}SourceMapGenerator$2.prototype._version=3;SourceMapGenerator$2.fromSourceMap=function(s,o){var u=s.sourceRoot,f=new SourceMapGenerator$2(Object.assign(o||{},{file:s.file,sourceRoot:u}));return s.eachMapping(function(c){var m={generated:{line:c.generatedLine,column:c.generatedColumn}};c.source!=null&&(m.source=c.source,u!=null&&(m.source=util$2.relative(u,m.source)),m.original={line:c.originalLine,column:c.originalColumn},c.name!=null&&(m.name=c.name)),f.addMapping(m)}),s.sources.forEach(function(c){var m=c;u!==null&&(m=util$2.relative(u,c)),f._sources.has(m)||f._sources.add(m);var d=s.sourceContentFor(c);d!=null&&f.setSourceContent(c,d)}),f};SourceMapGenerator$2.prototype.addMapping=function(s){var o=util$2.getArg(s,"generated"),u=util$2.getArg(s,"original",null),f=util$2.getArg(s,"source",null),c=util$2.getArg(s,"name",null);!this._skipValidation&&this._validateMapping(o,u,f,c)===!1||(f!=null&&(f=String(f),this._sources.has(f)||this._sources.add(f)),c!=null&&(c=String(c),this._names.has(c)||this._names.add(c)),this._mappings.add({generatedLine:o.line,generatedColumn:o.column,originalLine:u!=null&&u.line,originalColumn:u!=null&&u.column,source:f,name:c}))};SourceMapGenerator$2.prototype.setSourceContent=function(s,o){var u=s;this._sourceRoot!=null&&(u=util$2.relative(this._sourceRoot,u)),o!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[util$2.toSetString(u)]=o):this._sourcesContents&&(delete this._sourcesContents[util$2.toSetString(u)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};SourceMapGenerator$2.prototype.applySourceMap=function(s,o,u){var f=o;if(o==null){if(s.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);f=s.file}var c=this._sourceRoot;c!=null&&(f=util$2.relative(c,f));var m=new ArraySet$1,d=new ArraySet$1;this._mappings.unsortedForEach(function(C){if(C.source===f&&C.originalLine!=null){var E=s.originalPositionFor({line:C.originalLine,column:C.originalColumn});E.source!=null&&(C.source=E.source,u!=null&&(C.source=util$2.join(u,C.source)),c!=null&&(C.source=util$2.relative(c,C.source)),C.originalLine=E.line,C.originalColumn=E.column,E.name!=null&&(C.name=E.name))}var w=C.source;w!=null&&!m.has(w)&&m.add(w);var ee=C.name;ee!=null&&!d.has(ee)&&d.add(ee)},this),this._sources=m,this._names=d,s.sources.forEach(function(C){var E=s.sourceContentFor(C);E!=null&&(u!=null&&(C=util$2.join(u,C)),c!=null&&(C=util$2.relative(c,C)),this.setSourceContent(C,E))},this)};SourceMapGenerator$2.prototype._validateMapping=function(s,o,u,f){if(o&&typeof o.line!="number"&&typeof o.column!="number"){var c="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(c),!1;throw new Error(c)}if(!(s&&"line"in s&&"column"in s&&s.line>0&&s.column>=0&&!o&&!u&&!f)){if(s&&"line"in s&&"column"in s&&o&&"line"in o&&"column"in o&&s.line>0&&s.column>=0&&o.line>0&&o.column>=0&&u)return;var c="Invalid mapping: "+JSON.stringify({generated:s,source:u,original:o,name:f});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(c),!1;throw new Error(c)}};SourceMapGenerator$2.prototype._serializeMappings=function(){for(var s=0,o=1,u=0,f=0,c=0,m=0,d="",C,E,w,ee,V=this._mappings.toArray(),re=0,z=V.length;re0){if(!util$2.compareByGeneratedPositionsInflated(E,V[re-1]))continue;C+=","}C+=base64VLQ$1.encode(E.generatedColumn-s),s=E.generatedColumn,E.source!=null&&(ee=this._sources.indexOf(E.source),C+=base64VLQ$1.encode(ee-m),m=ee,C+=base64VLQ$1.encode(E.originalLine-1-f),f=E.originalLine-1,C+=base64VLQ$1.encode(E.originalColumn-u),u=E.originalColumn,E.name!=null&&(w=this._names.indexOf(E.name),C+=base64VLQ$1.encode(w-c),c=w)),d+=C}return d};SourceMapGenerator$2.prototype._generateSourcesContent=function(s,o){return s.map(function(u){if(!this._sourcesContents)return null;o!=null&&(u=util$2.relative(o,u));var f=util$2.toSetString(u);return Object.prototype.hasOwnProperty.call(this._sourcesContents,f)?this._sourcesContents[f]:null},this)};SourceMapGenerator$2.prototype.toJSON=function(){var s={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(s.file=this._file),this._sourceRoot!=null&&(s.sourceRoot=this._sourceRoot),this._sourcesContents&&(s.sourcesContent=this._generateSourcesContent(s.sources,s.sourceRoot)),s};SourceMapGenerator$2.prototype.toString=function(){return JSON.stringify(this.toJSON())};sourceMapGenerator.SourceMapGenerator=SourceMapGenerator$2;var sourceMapConsumer={},binarySearch$1={};(function(i){i.GREATEST_LOWER_BOUND=1,i.LEAST_UPPER_BOUND=2;function s(o,u,f,c,m,d){var C=Math.floor((u-o)/2)+o,E=m(f,c[C],!0);return E===0?C:E>0?u-C>1?s(C,u,f,c,m,d):d==i.LEAST_UPPER_BOUND?u1?s(o,C,f,c,m,d):d==i.LEAST_UPPER_BOUND?C:o<0?-1:o}i.search=function(u,f,c,m){if(f.length===0)return-1;var d=s(-1,f.length,u,f,c,m||i.GREATEST_LOWER_BOUND);if(d<0)return-1;for(;d-1>=0&&c(f[d],f[d-1],!0)===0;)--d;return d}})(binarySearch$1);var quickSort$1={};function SortTemplate(i){function s(f,c,m){var d=f[c];f[c]=f[m],f[m]=d}function o(f,c){return Math.round(f+Math.random()*(c-f))}function u(f,c,m,d){if(m=0){var m=this._originalMappings[c];if(s.column===void 0)for(var d=m.originalLine;m&&m.originalLine===d;)f.push({line:util$1.getArg(m,"generatedLine",null),column:util$1.getArg(m,"generatedColumn",null),lastColumn:util$1.getArg(m,"lastGeneratedColumn",null)}),m=this._originalMappings[++c];else for(var C=m.originalColumn;m&&m.originalLine===o&&m.originalColumn==C;)f.push({line:util$1.getArg(m,"generatedLine",null),column:util$1.getArg(m,"generatedColumn",null),lastColumn:util$1.getArg(m,"lastGeneratedColumn",null)}),m=this._originalMappings[++c]}return f};sourceMapConsumer.SourceMapConsumer=SourceMapConsumer$1;function BasicSourceMapConsumer(i,s){var o=i;typeof i=="string"&&(o=util$1.parseSourceMapInput(i));var u=util$1.getArg(o,"version"),f=util$1.getArg(o,"sources"),c=util$1.getArg(o,"names",[]),m=util$1.getArg(o,"sourceRoot",null),d=util$1.getArg(o,"sourcesContent",null),C=util$1.getArg(o,"mappings"),E=util$1.getArg(o,"file",null);if(u!=this._version)throw new Error("Unsupported version: "+u);m&&(m=util$1.normalize(m)),f=f.map(String).map(util$1.normalize).map(function(w){return m&&util$1.isAbsolute(m)&&util$1.isAbsolute(w)?util$1.relative(m,w):w}),this._names=ArraySet.fromArray(c.map(String),!0),this._sources=ArraySet.fromArray(f,!0),this._absoluteSources=this._sources.toArray().map(function(w){return util$1.computeSourceURL(m,w,s)}),this.sourceRoot=m,this.sourcesContent=d,this._mappings=C,this._sourceMapURL=s,this.file=E}BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer$1.prototype);BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer$1;BasicSourceMapConsumer.prototype._findSourceIndex=function(i){var s=i;if(this.sourceRoot!=null&&(s=util$1.relative(this.sourceRoot,s)),this._sources.has(s))return this._sources.indexOf(s);var o;for(o=0;o0&&(i[s]=c,i[s+1]=f)}else if(u<20)for(let f=s;fs;c--){let m=i[c-1],d=i[c];if(compareGenerated(m,d)<=0)break;i[c-1]=d,i[c]=m}else quickSort(i,compareGenerated,s)}BasicSourceMapConsumer.prototype._parseMappings=function(s,o){var u=1,f=0,c=0,m=0,d=0,C=0,E=s.length,w=0,ee={},V=[],re=[],z,ie,ce,F;let q=0;for(;w1&&(z.source=d+ie[1],d+=ie[1],z.originalLine=c+ie[2],c=z.originalLine,z.originalLine+=1,z.originalColumn=m+ie[3],m=z.originalColumn,ie.length>4&&(z.name=C+ie[4],C+=ie[4])),re.push(z),typeof z.originalLine=="number"){let $=z.source;for(;V.length<=$;)V.push(null);V[$]===null&&(V[$]=[]),V[$].push(z)}}sortGenerated(re,q),this.__generatedMappings=re;for(var A=0;A=0){var f=this._generatedMappings[u];if(f.generatedLine===o.generatedLine){var c=util$1.getArg(f,"source",null);c!==null&&(c=this._sources.at(c),c=util$1.computeSourceURL(this.sourceRoot,c,this._sourceMapURL));var m=util$1.getArg(f,"name",null);return m!==null&&(m=this._names.at(m)),{source:c,line:util$1.getArg(f,"originalLine",null),column:util$1.getArg(f,"originalColumn",null),name:m}}}return{source:null,line:null,column:null,name:null}};BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(s){return s==null}):!1};BasicSourceMapConsumer.prototype.sourceContentFor=function(s,o){if(!this.sourcesContent)return null;var u=this._findSourceIndex(s);if(u>=0)return this.sourcesContent[u];var f=s;this.sourceRoot!=null&&(f=util$1.relative(this.sourceRoot,f));var c;if(this.sourceRoot!=null&&(c=util$1.urlParse(this.sourceRoot))){var m=f.replace(/^file:\/\//,"");if(c.scheme=="file"&&this._sources.has(m))return this.sourcesContent[this._sources.indexOf(m)];if((!c.path||c.path=="/")&&this._sources.has("/"+f))return this.sourcesContent[this._sources.indexOf("/"+f)]}if(o)return null;throw new Error('"'+f+'" is not in the SourceMap.')};BasicSourceMapConsumer.prototype.generatedPositionFor=function(s){var o=util$1.getArg(s,"source");if(o=this._findSourceIndex(o),o<0)return{line:null,column:null,lastColumn:null};var u={source:o,originalLine:util$1.getArg(s,"line"),originalColumn:util$1.getArg(s,"column")},f=this._findMapping(u,this._originalMappings,"originalLine","originalColumn",util$1.compareByOriginalPositions,util$1.getArg(s,"bias",SourceMapConsumer$1.GREATEST_LOWER_BOUND));if(f>=0){var c=this._originalMappings[f];if(c.source===u.source)return{line:util$1.getArg(c,"generatedLine",null),column:util$1.getArg(c,"generatedColumn",null),lastColumn:util$1.getArg(c,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};sourceMapConsumer.BasicSourceMapConsumer=BasicSourceMapConsumer;function IndexedSourceMapConsumer(i,s){var o=i;typeof i=="string"&&(o=util$1.parseSourceMapInput(i));var u=util$1.getArg(o,"version"),f=util$1.getArg(o,"sections");if(u!=this._version)throw new Error("Unsupported version: "+u);this._sources=new ArraySet,this._names=new ArraySet;var c={line:-1,column:0};this._sections=f.map(function(m){if(m.url)throw new Error("Support for url field in sections not implemented.");var d=util$1.getArg(m,"offset"),C=util$1.getArg(d,"line"),E=util$1.getArg(d,"column");if(C=0;o--)this.prepend(s[o]);else if(s[isSourceNode]||typeof s=="string")this.children.unshift(s);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+s);return this};SourceNode.prototype.walk=function(s){for(var o,u=0,f=this.children.length;u0){for(o=[],u=0;u=0?O=ee():J()}return A(g,"valueEnd"),E(),x&&mNumber.MAX_SAFE_INTEGER||O="a"&&O<="f"?x+=O.charCodeAt()-A_CODE+10:O>="0"&&O<="9"?x+=+O:K()}return String.fromCharCode(x)}function q(){for(var g="";i[m]>="0"&&i[m]<="9";)g+=ie();if(g.length)return g;b(),J()}function A(g,x){$(g,x,X())}function $(g,x,O){u[g]=u[g]||{},u[g][x]=O}function X(){return{line:f,column:c,pos:m}}function J(){throw new SyntaxError("Unexpected token "+i[m]+" in JSON at position "+m)}function K(){ce(),J()}function b(){if(m>=i.length)throw new SyntaxError("Unexpected end of JSON input")}};jsonSourceMap.stringify=function(i,s,o){if(!validType(i))return;var u=0,f,c,m=typeof o=="object"?o.space:o;switch(typeof m){case"number":var d=m>10?10:m<0?0:Math.floor(m);m=d&&$(d," "),f=d,c=d;break;case"string":m=m.slice(0,10),f=0,c=0;for(var C=0;C=0}var ESC_QUOTE=/"|\\/g,ESC_B=/[\b]/g,ESC_F=/\f/g,ESC_N=/\n/g,ESC_R=/\r/g,ESC_T=/\t/g;function quoted(i){return i=i.replace(ESC_QUOTE,"\\$&").replace(ESC_F,"\\f").replace(ESC_B,"\\b").replace(ESC_N,"\\n").replace(ESC_R,"\\r").replace(ESC_T,"\\t"),'"'+i+'"'}var ESC_0=/~/g,ESC_1=/\//g;function escapeJsonPointer(i){return i.replace(ESC_0,"~0").replace(ESC_1,"~1")}var hostConfig={},hasRequiredHostConfig;function requireHostConfig(){if(hasRequiredHostConfig)return hostConfig;hasRequiredHostConfig=1;var i=commonjsGlobal&&commonjsGlobal.__assign||function(){return i=Object.assign||function(E){for(var w,ee=1,V=arguments.length;ee ")}return null},u.getPublicRootInstance=function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return ct(e.child.stateNode);default:return e.child.stateNode}},u.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:Es,findFiberByHostInstance:e.findFiberByHostInstance||Ss,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")e=!1;else{var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n.isDisabled&&n.supportsFiber)try{Rt=n.inject(e),Mt=n}catch{}e=!0}return e},u.observeVisibleRects=function(e,n,r,l){if(!Ct)throw Error(d(363));e=Ji(e,n);var a=ir(e,r,l).disconnect;return{disconnect:function(){a()}}},u.registerMutableSourceForHydration=function(e,n){var r=n._getVersion;r=r(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,r]:e.mutableSourceEagerHydrationData.push(n,r)},u.runWithPriority=function(e,n){var r=rt;try{return rt=e,n()}finally{rt=r}},u.shouldSuspend=function(){return!1},u.unbatchedUpdates=function(e,n){var r=Fe;Fe&=-2,Fe|=8;try{return e(n)}finally{Fe=r,Fe===0&&(_n(),Wt())}},u.updateContainer=function(e,n,r,l){var a=n.current,p=Ut(),_=Cn(a);e:if(r){r=r._reactInternals;t:{if(Z(r)!==r||r.tag!==1)throw Error(d(170));var A=r;do{switch(A.tag){case 3:A=A.stateNode.context;break t;case 1:if(Oe(A.type)){A=A.stateNode.__reactInternalMemoizedMergedChildContext;break t}}A=A.return}while(A!==null);throw Error(d(171))}if(r.tag===1){var G=r.type;if(Oe(G)){r=We(r,G,A);break e}}r=A}else r=pe;return n.context===null?n.context=r:n.pendingContext=r,n=Sn(p,_),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),wn(a,n),pn(a,_,p),_},u}})(reactReconciler_production_min);var reactReconciler_production_minExports=reactReconciler_production_min.exports;reactReconciler.exports=reactReconciler_production_minExports;var reactReconcilerExports=reactReconciler.exports,sourceMap={},sourceMapGenerator={},base64Vlq={},base64$1={},intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");base64$1.encode=function(i){if(0<=i&&i>1;return s?-o:o}base64Vlq.encode=function(s){var o="",u,f=toVLQSigned(s);do u=f&VLQ_BASE_MASK,f>>>=VLQ_BASE_SHIFT,f>0&&(u|=VLQ_CONTINUATION_BIT),o+=base64.encode(u);while(f>0);return o};base64Vlq.decode=function(s,o,u){var f=s.length,c=0,m=0,d,C;do{if(o>=f)throw new Error("Expected more digits in base 64 VLQ value.");if(C=base64.decode(s.charCodeAt(o++)),C===-1)throw new Error("Invalid base64 digit: "+s.charAt(o-1));d=!!(C&VLQ_CONTINUATION_BIT),C&=VLQ_BASE_MASK,c=c+(C<m&&g.pop(),Z}}var C=d(function(g){var x=g,O=f(g);if(O){if(!O.path)return g;x=O.path}for(var te=i.isAbsolute(x),Z=[],we=0,Ae=0;;)if(we=Ae,Ae=x.indexOf("/",we),Ae===-1){Z.push(x.slice(we));break}else for(Z.push(x.slice(we,Ae));Ae=0;Ae--)Ke=Z[Ae],Ke==="."?Z.splice(Ae,1):Ke===".."?Xe++:Xe>0&&(Ke===""?(Z.splice(Ae+1,Xe),Xe=0):(Z.splice(Ae,2),Xe--));return x=Z.join("/"),x===""&&(x=te?"/":"."),O?(O.path=x,c(O)):x});i.normalize=C;function E(b,g){b===""&&(b="."),g===""&&(g=".");var x=f(g),O=f(b);if(O&&(b=O.path||"/"),x&&!x.scheme)return O&&(x.scheme=O.scheme),c(x);if(x||g.match(u))return g;if(O&&!O.host&&!O.path)return O.host=g,c(O);var te=g.charAt(0)==="/"?g:C(b.replace(/\/+$/,"")+"/"+g);return O?(O.path=te,c(O)):te}i.join=E,i.isAbsolute=function(b){return b.charAt(0)==="/"||o.test(b)};function w(b,g){b===""&&(b="."),b=b.replace(/\/$/,"");for(var x=0;g.indexOf(b+"/")!==0;){var O=b.lastIndexOf("/");if(O<0||(b=b.slice(0,O),b.match(/^([^\/]+:\/)?\/*$/)))return g;++x}return Array(x+1).join("../")+g.substr(b.length+1)}i.relative=w;var ee=function(){var b=Object.create(null);return!("__proto__"in b)}();function V(b){return b}function re(b){return ie(b)?"$"+b:b}i.toSetString=ee?V:re;function z(b){return ie(b)?b.slice(1):b}i.fromSetString=ee?V:z;function ie(b){if(!b)return!1;var g=b.length;if(g<9||b.charCodeAt(g-1)!==95||b.charCodeAt(g-2)!==95||b.charCodeAt(g-3)!==111||b.charCodeAt(g-4)!==116||b.charCodeAt(g-5)!==111||b.charCodeAt(g-6)!==114||b.charCodeAt(g-7)!==112||b.charCodeAt(g-8)!==95||b.charCodeAt(g-9)!==95)return!1;for(var x=g-10;x>=0;x--)if(b.charCodeAt(x)!==36)return!1;return!0}function ce(b,g,x){var O=$(b.source,g.source);return O!==0||(O=b.originalLine-g.originalLine,O!==0)||(O=b.originalColumn-g.originalColumn,O!==0||x)||(O=b.generatedColumn-g.generatedColumn,O!==0)||(O=b.generatedLine-g.generatedLine,O!==0)?O:$(b.name,g.name)}i.compareByOriginalPositions=ce;function F(b,g,x){var O;return O=b.originalLine-g.originalLine,O!==0||(O=b.originalColumn-g.originalColumn,O!==0||x)||(O=b.generatedColumn-g.generatedColumn,O!==0)||(O=b.generatedLine-g.generatedLine,O!==0)?O:$(b.name,g.name)}i.compareByOriginalPositionsNoSource=F;function q(b,g,x){var O=b.generatedLine-g.generatedLine;return O!==0||(O=b.generatedColumn-g.generatedColumn,O!==0||x)||(O=$(b.source,g.source),O!==0)||(O=b.originalLine-g.originalLine,O!==0)||(O=b.originalColumn-g.originalColumn,O!==0)?O:$(b.name,g.name)}i.compareByGeneratedPositionsDeflated=q;function L(b,g,x){var O=b.generatedColumn-g.generatedColumn;return O!==0||x||(O=$(b.source,g.source),O!==0)||(O=b.originalLine-g.originalLine,O!==0)||(O=b.originalColumn-g.originalColumn,O!==0)?O:$(b.name,g.name)}i.compareByGeneratedPositionsDeflatedNoLine=L;function $(b,g){return b===g?0:b===null?1:g===null?-1:b>g?1:-1}function X(b,g){var x=b.generatedLine-g.generatedLine;return x!==0||(x=b.generatedColumn-g.generatedColumn,x!==0)||(x=$(b.source,g.source),x!==0)||(x=b.originalLine-g.originalLine,x!==0)||(x=b.originalColumn-g.originalColumn,x!==0)?x:$(b.name,g.name)}i.compareByGeneratedPositionsInflated=X;function J(b){return JSON.parse(b.replace(/^\)]}'[^\n]*\n/,""))}i.parseSourceMapInput=J;function K(b,g,x){if(g=g||"",b&&(b[b.length-1]!=="/"&&g[0]!=="/"&&(b+="/"),g=b+g),x){var O=f(x);if(!O)throw new Error("sourceMapURL could not be parsed");if(O.path){var te=O.path.lastIndexOf("/");te>=0&&(O.path=O.path.substring(0,te+1))}g=E(c(O),g)}return C(g)}i.computeSourceURL=K})(util$5);var arraySet={},util$4=util$5,has=Object.prototype.hasOwnProperty,hasNativeMap=typeof Map<"u";function ArraySet$2(){this._array=[],this._set=hasNativeMap?new Map:Object.create(null)}ArraySet$2.fromArray=function(s,o){for(var u=new ArraySet$2,f=0,c=s.length;f=0)return o}else{var u=util$4.toSetString(s);if(has.call(this._set,u))return this._set[u]}throw new Error('"'+s+'" is not in the set.')};ArraySet$2.prototype.at=function(s){if(s>=0&&so||u==o&&c>=f||util$3.compareByGeneratedPositionsInflated(i,s)<=0}function MappingList$1(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}MappingList$1.prototype.unsortedForEach=function(s,o){this._array.forEach(s,o)};MappingList$1.prototype.add=function(s){generatedPositionAfter(this._last,s)?(this._last=s,this._array.push(s)):(this._sorted=!1,this._array.push(s))};MappingList$1.prototype.toArray=function(){return this._sorted||(this._array.sort(util$3.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};mappingList.MappingList=MappingList$1;var base64VLQ$1=base64Vlq,util$2=util$5,ArraySet$1=arraySet.ArraySet,MappingList=mappingList.MappingList;function SourceMapGenerator$2(i){i||(i={}),this._file=util$2.getArg(i,"file",null),this._sourceRoot=util$2.getArg(i,"sourceRoot",null),this._skipValidation=util$2.getArg(i,"skipValidation",!1),this._ignoreInvalidMapping=util$2.getArg(i,"ignoreInvalidMapping",!1),this._sources=new ArraySet$1,this._names=new ArraySet$1,this._mappings=new MappingList,this._sourcesContents=null}SourceMapGenerator$2.prototype._version=3;SourceMapGenerator$2.fromSourceMap=function(s,o){var u=s.sourceRoot,f=new SourceMapGenerator$2(Object.assign(o||{},{file:s.file,sourceRoot:u}));return s.eachMapping(function(c){var m={generated:{line:c.generatedLine,column:c.generatedColumn}};c.source!=null&&(m.source=c.source,u!=null&&(m.source=util$2.relative(u,m.source)),m.original={line:c.originalLine,column:c.originalColumn},c.name!=null&&(m.name=c.name)),f.addMapping(m)}),s.sources.forEach(function(c){var m=c;u!==null&&(m=util$2.relative(u,c)),f._sources.has(m)||f._sources.add(m);var d=s.sourceContentFor(c);d!=null&&f.setSourceContent(c,d)}),f};SourceMapGenerator$2.prototype.addMapping=function(s){var o=util$2.getArg(s,"generated"),u=util$2.getArg(s,"original",null),f=util$2.getArg(s,"source",null),c=util$2.getArg(s,"name",null);!this._skipValidation&&this._validateMapping(o,u,f,c)===!1||(f!=null&&(f=String(f),this._sources.has(f)||this._sources.add(f)),c!=null&&(c=String(c),this._names.has(c)||this._names.add(c)),this._mappings.add({generatedLine:o.line,generatedColumn:o.column,originalLine:u!=null&&u.line,originalColumn:u!=null&&u.column,source:f,name:c}))};SourceMapGenerator$2.prototype.setSourceContent=function(s,o){var u=s;this._sourceRoot!=null&&(u=util$2.relative(this._sourceRoot,u)),o!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[util$2.toSetString(u)]=o):this._sourcesContents&&(delete this._sourcesContents[util$2.toSetString(u)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};SourceMapGenerator$2.prototype.applySourceMap=function(s,o,u){var f=o;if(o==null){if(s.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);f=s.file}var c=this._sourceRoot;c!=null&&(f=util$2.relative(c,f));var m=new ArraySet$1,d=new ArraySet$1;this._mappings.unsortedForEach(function(C){if(C.source===f&&C.originalLine!=null){var E=s.originalPositionFor({line:C.originalLine,column:C.originalColumn});E.source!=null&&(C.source=E.source,u!=null&&(C.source=util$2.join(u,C.source)),c!=null&&(C.source=util$2.relative(c,C.source)),C.originalLine=E.line,C.originalColumn=E.column,E.name!=null&&(C.name=E.name))}var w=C.source;w!=null&&!m.has(w)&&m.add(w);var ee=C.name;ee!=null&&!d.has(ee)&&d.add(ee)},this),this._sources=m,this._names=d,s.sources.forEach(function(C){var E=s.sourceContentFor(C);E!=null&&(u!=null&&(C=util$2.join(u,C)),c!=null&&(C=util$2.relative(c,C)),this.setSourceContent(C,E))},this)};SourceMapGenerator$2.prototype._validateMapping=function(s,o,u,f){if(o&&typeof o.line!="number"&&typeof o.column!="number"){var c="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(c),!1;throw new Error(c)}if(!(s&&"line"in s&&"column"in s&&s.line>0&&s.column>=0&&!o&&!u&&!f)){if(s&&"line"in s&&"column"in s&&o&&"line"in o&&"column"in o&&s.line>0&&s.column>=0&&o.line>0&&o.column>=0&&u)return;var c="Invalid mapping: "+JSON.stringify({generated:s,source:u,original:o,name:f});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(c),!1;throw new Error(c)}};SourceMapGenerator$2.prototype._serializeMappings=function(){for(var s=0,o=1,u=0,f=0,c=0,m=0,d="",C,E,w,ee,V=this._mappings.toArray(),re=0,z=V.length;re0){if(!util$2.compareByGeneratedPositionsInflated(E,V[re-1]))continue;C+=","}C+=base64VLQ$1.encode(E.generatedColumn-s),s=E.generatedColumn,E.source!=null&&(ee=this._sources.indexOf(E.source),C+=base64VLQ$1.encode(ee-m),m=ee,C+=base64VLQ$1.encode(E.originalLine-1-f),f=E.originalLine-1,C+=base64VLQ$1.encode(E.originalColumn-u),u=E.originalColumn,E.name!=null&&(w=this._names.indexOf(E.name),C+=base64VLQ$1.encode(w-c),c=w)),d+=C}return d};SourceMapGenerator$2.prototype._generateSourcesContent=function(s,o){return s.map(function(u){if(!this._sourcesContents)return null;o!=null&&(u=util$2.relative(o,u));var f=util$2.toSetString(u);return Object.prototype.hasOwnProperty.call(this._sourcesContents,f)?this._sourcesContents[f]:null},this)};SourceMapGenerator$2.prototype.toJSON=function(){var s={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(s.file=this._file),this._sourceRoot!=null&&(s.sourceRoot=this._sourceRoot),this._sourcesContents&&(s.sourcesContent=this._generateSourcesContent(s.sources,s.sourceRoot)),s};SourceMapGenerator$2.prototype.toString=function(){return JSON.stringify(this.toJSON())};sourceMapGenerator.SourceMapGenerator=SourceMapGenerator$2;var sourceMapConsumer={},binarySearch$1={};(function(i){i.GREATEST_LOWER_BOUND=1,i.LEAST_UPPER_BOUND=2;function s(o,u,f,c,m,d){var C=Math.floor((u-o)/2)+o,E=m(f,c[C],!0);return E===0?C:E>0?u-C>1?s(C,u,f,c,m,d):d==i.LEAST_UPPER_BOUND?u1?s(o,C,f,c,m,d):d==i.LEAST_UPPER_BOUND?C:o<0?-1:o}i.search=function(u,f,c,m){if(f.length===0)return-1;var d=s(-1,f.length,u,f,c,m||i.GREATEST_LOWER_BOUND);if(d<0)return-1;for(;d-1>=0&&c(f[d],f[d-1],!0)===0;)--d;return d}})(binarySearch$1);var quickSort$1={};function SortTemplate(i){function s(f,c,m){var d=f[c];f[c]=f[m],f[m]=d}function o(f,c){return Math.round(f+Math.random()*(c-f))}function u(f,c,m,d){if(m=0){var m=this._originalMappings[c];if(s.column===void 0)for(var d=m.originalLine;m&&m.originalLine===d;)f.push({line:util$1.getArg(m,"generatedLine",null),column:util$1.getArg(m,"generatedColumn",null),lastColumn:util$1.getArg(m,"lastGeneratedColumn",null)}),m=this._originalMappings[++c];else for(var C=m.originalColumn;m&&m.originalLine===o&&m.originalColumn==C;)f.push({line:util$1.getArg(m,"generatedLine",null),column:util$1.getArg(m,"generatedColumn",null),lastColumn:util$1.getArg(m,"lastGeneratedColumn",null)}),m=this._originalMappings[++c]}return f};sourceMapConsumer.SourceMapConsumer=SourceMapConsumer$1;function BasicSourceMapConsumer(i,s){var o=i;typeof i=="string"&&(o=util$1.parseSourceMapInput(i));var u=util$1.getArg(o,"version"),f=util$1.getArg(o,"sources"),c=util$1.getArg(o,"names",[]),m=util$1.getArg(o,"sourceRoot",null),d=util$1.getArg(o,"sourcesContent",null),C=util$1.getArg(o,"mappings"),E=util$1.getArg(o,"file",null);if(u!=this._version)throw new Error("Unsupported version: "+u);m&&(m=util$1.normalize(m)),f=f.map(String).map(util$1.normalize).map(function(w){return m&&util$1.isAbsolute(m)&&util$1.isAbsolute(w)?util$1.relative(m,w):w}),this._names=ArraySet.fromArray(c.map(String),!0),this._sources=ArraySet.fromArray(f,!0),this._absoluteSources=this._sources.toArray().map(function(w){return util$1.computeSourceURL(m,w,s)}),this.sourceRoot=m,this.sourcesContent=d,this._mappings=C,this._sourceMapURL=s,this.file=E}BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer$1.prototype);BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer$1;BasicSourceMapConsumer.prototype._findSourceIndex=function(i){var s=i;if(this.sourceRoot!=null&&(s=util$1.relative(this.sourceRoot,s)),this._sources.has(s))return this._sources.indexOf(s);var o;for(o=0;o0&&(i[s]=c,i[s+1]=f)}else if(u<20)for(let f=s;fs;c--){let m=i[c-1],d=i[c];if(compareGenerated(m,d)<=0)break;i[c-1]=d,i[c]=m}else quickSort(i,compareGenerated,s)}BasicSourceMapConsumer.prototype._parseMappings=function(s,o){var u=1,f=0,c=0,m=0,d=0,C=0,E=s.length,w=0,ee={},V=[],re=[],z,ie,ce,F;let q=0;for(;w1&&(z.source=d+ie[1],d+=ie[1],z.originalLine=c+ie[2],c=z.originalLine,z.originalLine+=1,z.originalColumn=m+ie[3],m=z.originalColumn,ie.length>4&&(z.name=C+ie[4],C+=ie[4])),re.push(z),typeof z.originalLine=="number"){let $=z.source;for(;V.length<=$;)V.push(null);V[$]===null&&(V[$]=[]),V[$].push(z)}}sortGenerated(re,q),this.__generatedMappings=re;for(var L=0;L=0){var f=this._generatedMappings[u];if(f.generatedLine===o.generatedLine){var c=util$1.getArg(f,"source",null);c!==null&&(c=this._sources.at(c),c=util$1.computeSourceURL(this.sourceRoot,c,this._sourceMapURL));var m=util$1.getArg(f,"name",null);return m!==null&&(m=this._names.at(m)),{source:c,line:util$1.getArg(f,"originalLine",null),column:util$1.getArg(f,"originalColumn",null),name:m}}}return{source:null,line:null,column:null,name:null}};BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(s){return s==null}):!1};BasicSourceMapConsumer.prototype.sourceContentFor=function(s,o){if(!this.sourcesContent)return null;var u=this._findSourceIndex(s);if(u>=0)return this.sourcesContent[u];var f=s;this.sourceRoot!=null&&(f=util$1.relative(this.sourceRoot,f));var c;if(this.sourceRoot!=null&&(c=util$1.urlParse(this.sourceRoot))){var m=f.replace(/^file:\/\//,"");if(c.scheme=="file"&&this._sources.has(m))return this.sourcesContent[this._sources.indexOf(m)];if((!c.path||c.path=="/")&&this._sources.has("/"+f))return this.sourcesContent[this._sources.indexOf("/"+f)]}if(o)return null;throw new Error('"'+f+'" is not in the SourceMap.')};BasicSourceMapConsumer.prototype.generatedPositionFor=function(s){var o=util$1.getArg(s,"source");if(o=this._findSourceIndex(o),o<0)return{line:null,column:null,lastColumn:null};var u={source:o,originalLine:util$1.getArg(s,"line"),originalColumn:util$1.getArg(s,"column")},f=this._findMapping(u,this._originalMappings,"originalLine","originalColumn",util$1.compareByOriginalPositions,util$1.getArg(s,"bias",SourceMapConsumer$1.GREATEST_LOWER_BOUND));if(f>=0){var c=this._originalMappings[f];if(c.source===u.source)return{line:util$1.getArg(c,"generatedLine",null),column:util$1.getArg(c,"generatedColumn",null),lastColumn:util$1.getArg(c,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};sourceMapConsumer.BasicSourceMapConsumer=BasicSourceMapConsumer;function IndexedSourceMapConsumer(i,s){var o=i;typeof i=="string"&&(o=util$1.parseSourceMapInput(i));var u=util$1.getArg(o,"version"),f=util$1.getArg(o,"sections");if(u!=this._version)throw new Error("Unsupported version: "+u);this._sources=new ArraySet,this._names=new ArraySet;var c={line:-1,column:0};this._sections=f.map(function(m){if(m.url)throw new Error("Support for url field in sections not implemented.");var d=util$1.getArg(m,"offset"),C=util$1.getArg(d,"line"),E=util$1.getArg(d,"column");if(C=0;o--)this.prepend(s[o]);else if(s[isSourceNode]||typeof s=="string")this.children.unshift(s);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+s);return this};SourceNode.prototype.walk=function(s){for(var o,u=0,f=this.children.length;u0){for(o=[],u=0;u=0?O=ee():J()}return L(g,"valueEnd"),E(),x&&mNumber.MAX_SAFE_INTEGER||O="a"&&O<="f"?x+=O.charCodeAt()-A_CODE+10:O>="0"&&O<="9"?x+=+O:K()}return String.fromCharCode(x)}function q(){for(var g="";i[m]>="0"&&i[m]<="9";)g+=ie();if(g.length)return g;b(),J()}function L(g,x){$(g,x,X())}function $(g,x,O){u[g]=u[g]||{},u[g][x]=O}function X(){return{line:f,column:c,pos:m}}function J(){throw new SyntaxError("Unexpected token "+i[m]+" in JSON at position "+m)}function K(){ce(),J()}function b(){if(m>=i.length)throw new SyntaxError("Unexpected end of JSON input")}};jsonSourceMap.stringify=function(i,s,o){if(!validType(i))return;var u=0,f,c,m=typeof o=="object"?o.space:o;switch(typeof m){case"number":var d=m>10?10:m<0?0:Math.floor(m);m=d&&$(d," "),f=d,c=d;break;case"string":m=m.slice(0,10),f=0,c=0;for(var C=0;C=0}var ESC_QUOTE=/"|\\/g,ESC_B=/[\b]/g,ESC_F=/\f/g,ESC_N=/\n/g,ESC_R=/\r/g,ESC_T=/\t/g;function quoted(i){return i=i.replace(ESC_QUOTE,"\\$&").replace(ESC_F,"\\f").replace(ESC_B,"\\b").replace(ESC_N,"\\n").replace(ESC_R,"\\r").replace(ESC_T,"\\t"),'"'+i+'"'}var ESC_0=/~/g,ESC_1=/\//g;function escapeJsonPointer(i){return i.replace(ESC_0,"~0").replace(ESC_1,"~1")}var hostConfig={},hasRequiredHostConfig;function requireHostConfig(){if(hasRequiredHostConfig)return hostConfig;hasRequiredHostConfig=1;var i=commonjsGlobal&&commonjsGlobal.__assign||function(){return i=Object.assign||function(E){for(var w,ee=1,V=arguments.length;ee0&&A[A.length-1])&&(K[0]===6||K[0]===2)){ce=0;continue}if(K[0]===3&&(!A||K[1]>A[0]&&K[1]0&&L[L.length-1])&&(K[0]===6||K[0]===2)){ce=0;continue}if(K[0]===3&&(!L||K[1]>L[0]&&K[1] * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var arrFlatten=function(i){return flat(i,[])};function flat(i,s){for(var o=0,u,f=i.length;o>7),buf:function(ae){var h=C(function(v,R,B,oe){return v.concat(B===oe.length-1?Buffer.from([R,0]).readUInt16BE(0):oe.readUInt16BE(B))},[],ae);return Buffer.from(E(function(v){return(v<<1&65535)>>8},h))}(M.buf)}}),M}function ee(){return typeof Buffer<"u"}function V(){if(!ee())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function re(y){V();var N=C(function(h,v){return h+v},0,y);if(N%8!=0)throw new Error("The bits ["+y.join(", ")+"] add up to "+N+" which is not an even number of bytes; the total should be divisible by 8");var M,Y=N/8,ae=(M=function(h){return h>48},C(function(h,v){return h||(M(v)?v:h)},null,y));if(ae)throw new Error(ae+" bit range requested exceeds 48 bit (6 byte) Number max.");return new c(function(h,v){var R=Y+v;return R>h.length?b(v,Y.toString()+" bytes"):K(R,C(function(B,oe){var se=w(oe,B.buf);return{coll:B.coll.concat(se.v),buf:se.buf}},{coll:[],buf:h.slice(v,R)},y).coll)})}function z(y,N){return new c(function(M,Y){return V(),Y+N>M.length?b(Y,N+" bytes for "+y):K(Y+N,M.slice(Y,Y+N))})}function ie(y,N){if(typeof(M=N)!="number"||Math.floor(M)!==M||N<0||N>6)throw new Error(y+" requires integer length in range [0, 6].");var M}function ce(y){return ie("uintBE",y),z("uintBE("+y+")",y).map(function(N){return N.readUIntBE(0,y)})}function F(y){return ie("uintLE",y),z("uintLE("+y+")",y).map(function(N){return N.readUIntLE(0,y)})}function q(y){return ie("intBE",y),z("intBE("+y+")",y).map(function(N){return N.readIntBE(0,y)})}function A(y){return ie("intLE",y),z("intLE("+y+")",y).map(function(N){return N.readIntLE(0,y)})}function $(y){return y instanceof c}function X(y){return{}.toString.call(y)==="[object Array]"}function J(y){return ee()&&Buffer.isBuffer(y)}function K(y,N){return{status:!0,index:y,value:N,furthest:-1,expected:[]}}function b(y,N){return X(N)||(N=[N]),{status:!1,index:-1,value:null,furthest:y,expected:N}}function g(y,N){if(!N||y.furthest>N.furthest)return y;var M=y.furthest===N.furthest?function(Y,ae){if(function(){if(c._supportsSet!==void 0)return c._supportsSet;var Q=typeof Set<"u";return c._supportsSet=Q,Q}()&&Array.from){for(var h=new Set(Y),v=0;v=0;){if(v in M){Y=M[v].line,h===0&&(h=M[v].lineStart);break}(y.charAt(v)===` + */var arrFlatten=function(i){return flat(i,[])};function flat(i,s){for(var o=0,u,f=i.length;o>7),buf:function(ae){var h=C(function(v,R,B,oe){return v.concat(B===oe.length-1?Buffer.from([R,0]).readUInt16BE(0):oe.readUInt16BE(B))},[],ae);return Buffer.from(E(function(v){return(v<<1&65535)>>8},h))}(M.buf)}}),M}function ee(){return typeof Buffer<"u"}function V(){if(!ee())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function re(y){V();var N=C(function(h,v){return h+v},0,y);if(N%8!=0)throw new Error("The bits ["+y.join(", ")+"] add up to "+N+" which is not an even number of bytes; the total should be divisible by 8");var M,Y=N/8,ae=(M=function(h){return h>48},C(function(h,v){return h||(M(v)?v:h)},null,y));if(ae)throw new Error(ae+" bit range requested exceeds 48 bit (6 byte) Number max.");return new c(function(h,v){var R=Y+v;return R>h.length?b(v,Y.toString()+" bytes"):K(R,C(function(B,oe){var se=w(oe,B.buf);return{coll:B.coll.concat(se.v),buf:se.buf}},{coll:[],buf:h.slice(v,R)},y).coll)})}function z(y,N){return new c(function(M,Y){return V(),Y+N>M.length?b(Y,N+" bytes for "+y):K(Y+N,M.slice(Y,Y+N))})}function ie(y,N){if(typeof(M=N)!="number"||Math.floor(M)!==M||N<0||N>6)throw new Error(y+" requires integer length in range [0, 6].");var M}function ce(y){return ie("uintBE",y),z("uintBE("+y+")",y).map(function(N){return N.readUIntBE(0,y)})}function F(y){return ie("uintLE",y),z("uintLE("+y+")",y).map(function(N){return N.readUIntLE(0,y)})}function q(y){return ie("intBE",y),z("intBE("+y+")",y).map(function(N){return N.readIntBE(0,y)})}function L(y){return ie("intLE",y),z("intLE("+y+")",y).map(function(N){return N.readIntLE(0,y)})}function $(y){return y instanceof c}function X(y){return{}.toString.call(y)==="[object Array]"}function J(y){return ee()&&Buffer.isBuffer(y)}function K(y,N){return{status:!0,index:y,value:N,furthest:-1,expected:[]}}function b(y,N){return X(N)||(N=[N]),{status:!1,index:-1,value:null,furthest:y,expected:N}}function g(y,N){if(!N||y.furthest>N.furthest)return y;var M=y.furthest===N.furthest?function(Y,ae){if(function(){if(c._supportsSet!==void 0)return c._supportsSet;var Q=typeof Set<"u";return c._supportsSet=Q,Q}()&&Array.from){for(var h=new Set(Y),v=0;v=0;){if(v in M){Y=M[v].line,h===0&&(h=M[v].lineStart);break}(y.charAt(v)===` `||y.charAt(v)==="\r"&&y.charAt(v+1)!==` -`)&&(ae++,h===0&&(h=v+1)),v--}var R=Y+ae,B=N-h;return M[N]={line:R,lineStart:h},{offset:N,line:R+1,column:B+1}}function te(y){if(!$(y))throw new Error("not a parser: "+y)}function Z(y,N){return typeof y=="string"?y.charAt(N):y[N]}function we(y){if(typeof y!="number")throw new Error("not a number: "+y)}function Le(y){if(typeof y!="function")throw new Error("not a function: "+y)}function Ke(y){if(typeof y!="string")throw new Error("not a string: "+y)}var Xe=2,Tt=3,ct=8,On=5*ct,ye=4*ct,je=" ";function T(y,N){return new Array(N+1).join(y)}function $e(y,N,M){var Y=N-y.length;return Y<=0?y:T(M,Y)+y}function lt(y,N,M,Y){return{from:y-N>0?y-N:0,to:y+M>Y?Y:y+M}}function Ot(y,N){var M,Y,ae,h,v,R=N.index,B=R.offset,oe=1;if(B===y.length)return"Got the end of the input";if(J(y)){var se=B-B%ct,le=B-se,he=lt(se,On,ye+ct,y.length),Q=E(function(Ce){return E(function(qe){return $e(qe.toString(16),2,"0")},Ce)},function(Ce,qe){var ze=Ce.length,ke=[],it=0;if(ze<=qe)return[Ce.slice()];for(var ue=0;ue=4&&(M+=1),oe=2,ae=E(function(Ce){return Ce.length<=4?Ce.join(" "):Ce.slice(0,4).join(" ")+" "+Ce.slice(4).join(" ")},Q),(v=(8*(h.to>0?h.to-1:h.to)).toString(16).length)<2&&(v=2)}else{var xe=y.split(/\r\n|[\n\r\u2028\u2029]/);M=R.column-1,Y=R.line-1,h=lt(Y,Xe,Tt,xe.length),ae=xe.slice(h.from,h.to),v=h.to.toString().length}var Te=Y-h.from;return J(y)&&(v=(8*(h.to>0?h.to-1:h.to)).toString(16).length)<2&&(v=2),C(function(Ce,qe,ze){var ke,it=ze===Te,ue=it?"> ":je;return ke=J(y)?$e((8*(h.from+ze)).toString(16),v,"0"):$e((h.from+ze+1).toString(),v," "),[].concat(Ce,[ue+ke+" | "+qe],it?[je+T(" ",v)+" | "+$e("",M," ")+T("^",oe)]:[])},[],ae).join(` +`)&&(ae++,h===0&&(h=v+1)),v--}var R=Y+ae,B=N-h;return M[N]={line:R,lineStart:h},{offset:N,line:R+1,column:B+1}}function te(y){if(!$(y))throw new Error("not a parser: "+y)}function Z(y,N){return typeof y=="string"?y.charAt(N):y[N]}function we(y){if(typeof y!="number")throw new Error("not a number: "+y)}function Ae(y){if(typeof y!="function")throw new Error("not a function: "+y)}function Ke(y){if(typeof y!="string")throw new Error("not a string: "+y)}var Xe=2,Tt=3,ct=8,On=5*ct,ye=4*ct,je=" ";function T(y,N){return new Array(N+1).join(y)}function $e(y,N,M){var Y=N-y.length;return Y<=0?y:T(M,Y)+y}function lt(y,N,M,Y){return{from:y-N>0?y-N:0,to:y+M>Y?Y:y+M}}function Ot(y,N){var M,Y,ae,h,v,R=N.index,B=R.offset,oe=1;if(B===y.length)return"Got the end of the input";if(J(y)){var se=B-B%ct,le=B-se,he=lt(se,On,ye+ct,y.length),Q=E(function(Ce){return E(function(qe){return $e(qe.toString(16),2,"0")},Ce)},function(Ce,qe){var ze=Ce.length,ke=[],it=0;if(ze<=qe)return[Ce.slice()];for(var ue=0;ue=4&&(M+=1),oe=2,ae=E(function(Ce){return Ce.length<=4?Ce.join(" "):Ce.slice(0,4).join(" ")+" "+Ce.slice(4).join(" ")},Q),(v=(8*(h.to>0?h.to-1:h.to)).toString(16).length)<2&&(v=2)}else{var xe=y.split(/\r\n|[\n\r\u2028\u2029]/);M=R.column-1,Y=R.line-1,h=lt(Y,Xe,Tt,xe.length),ae=xe.slice(h.from,h.to),v=h.to.toString().length}var Te=Y-h.from;return J(y)&&(v=(8*(h.to>0?h.to-1:h.to)).toString(16).length)<2&&(v=2),C(function(Ce,qe,ze){var ke,it=ze===Te,ue=it?"> ":je;return ke=J(y)?$e((8*(h.from+ze)).toString(16),v,"0"):$e((h.from+ze+1).toString(),v," "),[].concat(Ce,[ue+ke+" | "+qe],it?[je+T(" ",v)+" | "+$e("",M," ")+T("^",oe)]:[])},[],ae).join(` `)}function yt(y,N){return[` `,"-- PARSING FAILED "+T("-",50),` @@ -731,16 +731,16 @@ No matching component was found for: `+M[0]:`Expected one of the following: `+M.join(", ")),` -`].join("");var M}function tt(y){return y.flags!==void 0?y.flags:[y.global?"g":"",y.ignoreCase?"i":"",y.multiline?"m":"",y.unicode?"u":"",y.sticky?"y":""].join("")}function St(){for(var y=[].slice.call(arguments),N=y.length,M=0;M=2?we(N):N=0;var M=function(ae){return RegExp("^(?:"+ae.source+")",tt(ae))}(y),Y=""+y;return c(function(ae,h){var v=M.exec(ae.slice(h));if(v){if(0<=N&&N<=v.length){var R=v[0],B=v[N];return K(h+R.length,B)}return b(h,"valid match group (0 to "+v.length+") in "+Y)}return b(h,Y)})}function at(y){return c(function(N,M){return K(M,y)})}function kt(y){return c(function(N,M){return b(M,y)})}function on(y){if($(y))return c(function(N,M){var Y=y._(N,M);return Y.index=M,Y.value="",Y});if(typeof y=="string")return on(ht(y));if(y instanceof RegExp)return on(vt(y));throw new Error("not a string, regexp, or parser: "+y)}function Bt(y){return te(y),c(function(N,M){var Y=y._(N,M),ae=N.slice(M,Y.index);return Y.status?b(M,'not "'+ae+'"'):K(M,null)})}function It(y){return Le(y),c(function(N,M){var Y=Z(N,M);return M=y.length?b(N,"any character/byte"):K(N+1,Z(y,N))}),tr=c(function(y,N){return K(y.length,y.slice(N))}),An=c(function(y,N){return N=2?we(N):N=0;var M=function(ae){return RegExp("^(?:"+ae.source+")",tt(ae))}(y),Y=""+y;return c(function(ae,h){var v=M.exec(ae.slice(h));if(v){if(0<=N&&N<=v.length){var R=v[0],B=v[N];return K(h+R.length,B)}return b(h,"valid match group (0 to "+v.length+") in "+Y)}return b(h,Y)})}function at(y){return c(function(N,M){return K(M,y)})}function kt(y){return c(function(N,M){return b(M,y)})}function on(y){if($(y))return c(function(N,M){var Y=y._(N,M);return Y.index=M,Y.value="",Y});if(typeof y=="string")return on(ht(y));if(y instanceof RegExp)return on(vt(y));throw new Error("not a string, regexp, or parser: "+y)}function Bt(y){return te(y),c(function(N,M){var Y=y._(N,M),ae=N.slice(M,Y.index);return Y.status?b(M,'not "'+ae+'"'):K(M,null)})}function It(y){return Ae(y),c(function(N,M){var Y=Z(N,M);return M=y.length?b(N,"any character/byte"):K(N+1,Z(y,N))}),tr=c(function(y,N){return K(y.length,y.slice(N))}),Ln=c(function(y,N){return N=0}).desc(N)},c.optWhitespace=or,c.Parser=c,c.range=function(y,N){return It(function(M){return y<=M&&M<=N}).desc(y+"-"+N)},c.regex=vt,c.regexp=vt,c.sepBy=gn,c.sepBy1=Ft,c.seq=St,c.seqMap=zt,c.seqObj=function(){for(var y,N={},M=0,Y=(y=arguments,Array.prototype.slice.call(y)),ae=Y.length,h=0;h255)throw new Error("Value specified to byte constructor ("+y+"=0x"+y.toString(16)+") is larger in value than a single byte.");var N=(y>15?"0x":"0x0")+y.toString(16);return c(function(M,Y){var ae=Z(M,Y);return ae===y?K(Y+1,ae):b(Y,N)})},buffer:function(y){return z("buffer",y).map(function(N){return Buffer.from(N)})},encodedString:function(y,N){return z("string",N).map(function(M){return M.toString(y)})},uintBE:ce,uint8BE:ce(1),uint16BE:ce(2),uint32BE:ce(4),uintLE:F,uint8LE:F(1),uint16LE:F(2),uint32LE:F(4),intBE:q,int8BE:q(1),int16BE:q(2),int32BE:q(4),intLE:A,int8LE:A(1),int16LE:A(2),int32LE:A(4),floatBE:z("floatBE",4).map(function(y){return y.readFloatBE(0)}),floatLE:z("floatLE",4).map(function(y){return y.readFloatLE(0)}),doubleBE:z("doubleBE",8).map(function(y){return y.readDoubleBE(0)}),doubleLE:z("doubleLE",8).map(function(y){return y.readDoubleLE(0)})},o.exports=c}])})})(parsimmon_umd_min);var parsimmon_umd_minExports=parsimmon_umd_min.exports;const P=getDefaultExportFromCjs(parsimmon_umd_minExports);var dist={},Parser$1={},TokenError$1={};Object.defineProperty(TokenError$1,"__esModule",{value:!0});TokenError$1.TokenError=void 0;class TokenError extends Error{constructor(s,o){if(super(s),this.message=s,this.token=o,o&&o.errors)o.errors.push(this);else throw this}inspect(){return"SyntaxError: "+this.message}}TokenError$1.TokenError=TokenError;Object.defineProperty(Parser$1,"__esModule",{value:!0});Parser$1.Parser=Parser$1.findRuleByName=Parser$1.parseRuleName=Parser$1.escapeRegExp=Parser$1.readToken=void 0;const UPPER_SNAKE_RE=/^[A-Z0-9_]+$/,decorationRE=/(\?|\+|\*)$/,preDecorationRE=/^(@|&|!)/,WS_RULE="WS",TokenError_1$1=TokenError$1;function readToken(i,s){let o=s.exec(i);return o&&o.index==0?o[0].length==0&&s.source.length>0?null:{type:null,text:o[0],rest:i.substr(o[0].length),start:0,end:o[0].length-1,fullText:o[0],errors:[],children:[],parent:null}:null}Parser$1.readToken=readToken;function escapeRegExp(i){return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}Parser$1.escapeRegExp=escapeRegExp;function fixRest(i){i.rest="",i.children&&i.children.forEach(s=>fixRest(s))}function fixPositions(i,s){i.start+=s,i.end+=s,i.children&&i.children.forEach(o=>fixPositions(o,i.start))}function agregateErrors(i,s){s.errors&&s.errors.length&&s.errors.forEach(o=>i.push(o)),s.children&&s.children.forEach(o=>agregateErrors(i,o))}function parseRuleName(i){let s=decorationRE.exec(i),o=preDecorationRE.exec(i),u=s&&s[0]||"",f=o&&o[0]||"",c={raw:i,name:i.replace(decorationRE,"").replace(preDecorationRE,""),isOptional:u=="?"||u=="*",allowRepetition:u=="+"||u=="*",atLeastOne:u=="+",lookupPositive:f=="&",lookupNegative:f=="!",pinned:f=="@",lookup:!1,isLiteral:!1};return c.isLiteral=c.name[0]=="'"||c.name[0]=='"',c.lookup=c.lookupNegative||c.lookupPositive,c}Parser$1.parseRuleName=parseRuleName;function findRuleByName(i,s){let o=parseRuleName(i);return s.cachedRules[o.name]||null}Parser$1.findRuleByName=findRuleByName;function stripRules(i,s){if(i.children){let o=i.children.filter(u=>u.type&&s.test(u.type));for(let u=0;ustripRules(u,s))}}const ignoreMissingRules=["EOF"];class Parser{constructor(s,o){this.grammarRules=s,this.options=o,this.cachedRules={},this.debug=o?o.debug===!0:!1;let u=[],f=[];if(s.forEach(c=>{let m=parseRuleName(c.name);if(m.name in this.cachedRules){u.push("Duplicated rule "+m.name);return}else this.cachedRules[m.name]=c;if(!c.bnf||!c.bnf.length){let d="Missing rule content, rule: "+c.name;u.indexOf(d)==-1&&u.push(d)}else c.bnf.forEach(d=>{if(typeof d[0]=="string"&&parseRuleName(d[0]).name==c.name){let E="Left recursion is not allowed, rule: "+c.name;u.indexOf(E)==-1&&u.push(E)}d.forEach(C=>{if(typeof C=="string"){let E=parseRuleName(C);!E.isLiteral&&f.indexOf(E.name)==-1&&ignoreMissingRules.indexOf(E.name)==-1&&f.push(E.name)}})});WS_RULE==c.name&&(c.implicitWs=!1),c.implicitWs&&f.indexOf(WS_RULE)==-1&&f.push(WS_RULE),c.recover&&f.indexOf(c.recover)==-1&&f.push(c.recover)}),f.forEach(c=>{c in this.cachedRules||u.push("Missing rule "+c)}),u.length)throw new Error(u.join(` +`),Vt=hn($n,Fn,Un).desc("newline"),yn=hn(Vt,Ln);c.all=tr,c.alt=hn,c.any=er,c.cr=Un,c.createLanguage=function(y){var N={};for(var M in y)({}).hasOwnProperty.call(y,M)&&function(Y){N[Y]=Nn(function(){return y[Y](N)})}(M);return N},c.crlf=$n,c.custom=function(y){return c(y(K,b))},c.digit=ln,c.digits=nr,c.empty=Nt,c.end=yn,c.eof=Ln,c.fail=kt,c.formatError=yt,c.index=Ct,c.isParser=$,c.lazy=Nn,c.letter=rr,c.letters=ir,c.lf=Fn,c.lookahead=on,c.makeFailure=b,c.makeSuccess=K,c.newline=Vt,c.noneOf=function(y){return It(function(N){return y.indexOf(N)<0}).desc("none of '"+y+"'")},c.notFollowedBy=Bt,c.of=at,c.oneOf=function(y){for(var N=y.split(""),M=0;M=0}).desc(N)},c.optWhitespace=or,c.Parser=c,c.range=function(y,N){return It(function(M){return y<=M&&M<=N}).desc(y+"-"+N)},c.regex=vt,c.regexp=vt,c.sepBy=gn,c.sepBy1=Ft,c.seq=St,c.seqMap=zt,c.seqObj=function(){for(var y,N={},M=0,Y=(y=arguments,Array.prototype.slice.call(y)),ae=Y.length,h=0;h255)throw new Error("Value specified to byte constructor ("+y+"=0x"+y.toString(16)+") is larger in value than a single byte.");var N=(y>15?"0x":"0x0")+y.toString(16);return c(function(M,Y){var ae=Z(M,Y);return ae===y?K(Y+1,ae):b(Y,N)})},buffer:function(y){return z("buffer",y).map(function(N){return Buffer.from(N)})},encodedString:function(y,N){return z("string",N).map(function(M){return M.toString(y)})},uintBE:ce,uint8BE:ce(1),uint16BE:ce(2),uint32BE:ce(4),uintLE:F,uint8LE:F(1),uint16LE:F(2),uint32LE:F(4),intBE:q,int8BE:q(1),int16BE:q(2),int32BE:q(4),intLE:L,int8LE:L(1),int16LE:L(2),int32LE:L(4),floatBE:z("floatBE",4).map(function(y){return y.readFloatBE(0)}),floatLE:z("floatLE",4).map(function(y){return y.readFloatLE(0)}),doubleBE:z("doubleBE",8).map(function(y){return y.readDoubleBE(0)}),doubleLE:z("doubleLE",8).map(function(y){return y.readDoubleLE(0)})},o.exports=c}])})})(parsimmon_umd_min);var parsimmon_umd_minExports=parsimmon_umd_min.exports;const P=getDefaultExportFromCjs(parsimmon_umd_minExports);var dist={},Parser$1={},TokenError$1={};Object.defineProperty(TokenError$1,"__esModule",{value:!0});TokenError$1.TokenError=void 0;class TokenError extends Error{constructor(s,o){if(super(s),this.message=s,this.token=o,o&&o.errors)o.errors.push(this);else throw this}inspect(){return"SyntaxError: "+this.message}}TokenError$1.TokenError=TokenError;Object.defineProperty(Parser$1,"__esModule",{value:!0});Parser$1.Parser=Parser$1.findRuleByName=Parser$1.parseRuleName=Parser$1.escapeRegExp=Parser$1.readToken=void 0;const UPPER_SNAKE_RE=/^[A-Z0-9_]+$/,decorationRE=/(\?|\+|\*)$/,preDecorationRE=/^(@|&|!)/,WS_RULE="WS",TokenError_1$1=TokenError$1;function readToken(i,s){let o=s.exec(i);return o&&o.index==0?o[0].length==0&&s.source.length>0?null:{type:null,text:o[0],rest:i.substr(o[0].length),start:0,end:o[0].length-1,fullText:o[0],errors:[],children:[],parent:null}:null}Parser$1.readToken=readToken;function escapeRegExp(i){return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}Parser$1.escapeRegExp=escapeRegExp;function fixRest(i){i.rest="",i.children&&i.children.forEach(s=>fixRest(s))}function fixPositions(i,s){i.start+=s,i.end+=s,i.children&&i.children.forEach(o=>fixPositions(o,i.start))}function agregateErrors(i,s){s.errors&&s.errors.length&&s.errors.forEach(o=>i.push(o)),s.children&&s.children.forEach(o=>agregateErrors(i,o))}function parseRuleName(i){let s=decorationRE.exec(i),o=preDecorationRE.exec(i),u=s&&s[0]||"",f=o&&o[0]||"",c={raw:i,name:i.replace(decorationRE,"").replace(preDecorationRE,""),isOptional:u=="?"||u=="*",allowRepetition:u=="+"||u=="*",atLeastOne:u=="+",lookupPositive:f=="&",lookupNegative:f=="!",pinned:f=="@",lookup:!1,isLiteral:!1};return c.isLiteral=c.name[0]=="'"||c.name[0]=='"',c.lookup=c.lookupNegative||c.lookupPositive,c}Parser$1.parseRuleName=parseRuleName;function findRuleByName(i,s){let o=parseRuleName(i);return s.cachedRules[o.name]||null}Parser$1.findRuleByName=findRuleByName;function stripRules(i,s){if(i.children){let o=i.children.filter(u=>u.type&&s.test(u.type));for(let u=0;ustripRules(u,s))}}const ignoreMissingRules=["EOF"];class Parser{constructor(s,o){this.grammarRules=s,this.options=o,this.cachedRules={},this.debug=o?o.debug===!0:!1;let u=[],f=[];if(s.forEach(c=>{let m=parseRuleName(c.name);if(m.name in this.cachedRules){u.push("Duplicated rule "+m.name);return}else this.cachedRules[m.name]=c;if(!c.bnf||!c.bnf.length){let d="Missing rule content, rule: "+c.name;u.indexOf(d)==-1&&u.push(d)}else c.bnf.forEach(d=>{if(typeof d[0]=="string"&&parseRuleName(d[0]).name==c.name){let E="Left recursion is not allowed, rule: "+c.name;u.indexOf(E)==-1&&u.push(E)}d.forEach(C=>{if(typeof C=="string"){let E=parseRuleName(C);!E.isLiteral&&f.indexOf(E.name)==-1&&ignoreMissingRules.indexOf(E.name)==-1&&f.push(E.name)}})});WS_RULE==c.name&&(c.implicitWs=!1),c.implicitWs&&f.indexOf(WS_RULE)==-1&&f.push(WS_RULE),c.recover&&f.indexOf(c.recover)==-1&&f.push(c.recover)}),f.forEach(c=>{c in this.cachedRules||u.push("Missing rule "+c)}),u.length)throw new Error(u.join(` `))}getAST(s,o){o||(o=this.grammarRules.filter(f=>!f.fragment&&f.name.indexOf("%")!=0)[0].name);let u=this.parse(s,o);if(u){agregateErrors(u.errors,u),fixPositions(u,0),stripRules(u,/^%/),(!this.options||!this.options.keepUpperRules)&&stripRules(u,UPPER_SNAKE_RE);let f=u.rest;f&&new TokenError_1$1.TokenError(`Unexpected end of input: `+f,u),fixRest(u),u.rest=f}return u}emitSource(){return"CANNOT EMIT SOURCE FROM BASE Parser"}parse(s,o,u=0){let f=null,c=parseRuleName(o),m,d=this.debug&&!UPPER_SNAKE_RE.test(c.name);d&&console.log(new Array(u).join("│ ")+"Trying to get "+o+" from "+JSON.stringify(s.split(` -`)[0]));let C=c.name,E=findRuleByName(c.name,this);if(c.name=="EOF"){if(s.length)return null;if(s.length==0)return{type:"EOF",text:"",rest:"",start:0,end:0,fullText:"",errors:[],children:[],parent:null}}try{if(!E&&c.isLiteral){let w=c.name.trim();if(w.startsWith('"')?w=JSON.parse(w):w.startsWith("'")&&(w=w.replace(/^'(.+)'$/,"$1").replace(/\\'/g,"'")),w==="")return{type:"%%EMPTY%%",text:"",rest:s,start:0,end:0,fullText:"",errors:[],children:[],parent:null};m=new RegExp(escapeRegExp(w)),C=null}}catch(w){return w instanceof ReferenceError&&console.error(w),null}if(m){let w=readToken(s,m);if(w)return w.type=C,w}else{let w=E.bnf;w instanceof Array&&w.forEach(ee=>{if(f)return;let V=null,re={type:c.name,text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:s};E.fragment&&(re.fragment=!0);let z=s,ie=0,ce=ee.length>0,F=!1;for(let q=0;q{J.start+=ie,J.end+=ie,J.parent=re,re.children.push(J)}):($.parent=re,re.children.push($))),A.lookup&&($.lookup=!0),d&&console.log(new Array(u+1).join("│ ")+"└─ "+$.type+" "+JSON.stringify($.text)),!A.lookup&&!$.lookup&&(re.text=re.text+$.text,re.end=re.text.length,z=z.substr($.text.length),ie+=$.text.length),re.rest=z}while($&&A.allowRepetition&&z.length&&!$.lookup)}else{let A=readToken(z,ee[q]);if(!A)return;d&&console.log(new Array(u+1).join("│ ")+"└> "+JSON.stringify(A.text)+ee[q].source),F=!0,A.start+=ie,A.end+=ie,re.text=re.text+A.text,re.end=re.text.length,z=z.substr(A.text.length),ie+=A.text.length,re.rest=z}F&&(f=re,d&&console.log(new Array(u).join("│ ")+"├<─┴< PUSHING "+f.type+" "+JSON.stringify(f.text)))}),f&&E.simplifyWhenOneChildren&&f.children.length==1&&(f=f.children[0])}return f||d&&console.log(o+" NOT RESOLVED FROM "+s),f}parseRecovery(s,o,u){if(s.recover&&o.length){let f=this.debug;f&&console.log(new Array(u+1).join("│ ")+"Trying to recover until token "+s.recover+" from "+JSON.stringify(o.split(` +`)[0]));let C=c.name,E=findRuleByName(c.name,this);if(c.name=="EOF"){if(s.length)return null;if(s.length==0)return{type:"EOF",text:"",rest:"",start:0,end:0,fullText:"",errors:[],children:[],parent:null}}try{if(!E&&c.isLiteral){let w=c.name.trim();if(w.startsWith('"')?w=JSON.parse(w):w.startsWith("'")&&(w=w.replace(/^'(.+)'$/,"$1").replace(/\\'/g,"'")),w==="")return{type:"%%EMPTY%%",text:"",rest:s,start:0,end:0,fullText:"",errors:[],children:[],parent:null};m=new RegExp(escapeRegExp(w)),C=null}}catch(w){return w instanceof ReferenceError&&console.error(w),null}if(m){let w=readToken(s,m);if(w)return w.type=C,w}else{let w=E.bnf;w instanceof Array&&w.forEach(ee=>{if(f)return;let V=null,re={type:c.name,text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:s};E.fragment&&(re.fragment=!0);let z=s,ie=0,ce=ee.length>0,F=!1;for(let q=0;q{J.start+=ie,J.end+=ie,J.parent=re,re.children.push(J)}):($.parent=re,re.children.push($))),L.lookup&&($.lookup=!0),d&&console.log(new Array(u+1).join("│ ")+"└─ "+$.type+" "+JSON.stringify($.text)),!L.lookup&&!$.lookup&&(re.text=re.text+$.text,re.end=re.text.length,z=z.substr($.text.length),ie+=$.text.length),re.rest=z}while($&&L.allowRepetition&&z.length&&!$.lookup)}else{let L=readToken(z,ee[q]);if(!L)return;d&&console.log(new Array(u+1).join("│ ")+"└> "+JSON.stringify(L.text)+ee[q].source),F=!0,L.start+=ie,L.end+=ie,re.text=re.text+L.text,re.end=re.text.length,z=z.substr(L.text.length),ie+=L.text.length,re.rest=z}F&&(f=re,d&&console.log(new Array(u).join("│ ")+"├<─┴< PUSHING "+f.type+" "+JSON.stringify(f.text)))}),f&&E.simplifyWhenOneChildren&&f.children.length==1&&(f=f.children[0])}return f||d&&console.log(o+" NOT RESOLVED FROM "+s),f}parseRecovery(s,o,u){if(s.recover&&o.length){let f=this.debug;f&&console.log(new Array(u+1).join("│ ")+"Trying to recover until token "+s.recover+" from "+JSON.stringify(o.split(` `)[0]+o.split(` -`)[1]));let c={type:"SyntaxError",text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:""},m;do if(m=this.parse(o,s.recover,u+1),m){new TokenError_1$1.TokenError('Unexpected input: "'+c.text+`" Expecting: ${s.name}`,c);break}else c.text=c.text+o[0],c.end=c.text.length,o=o.substr(1);while(!m&&o.length>0);if(c.text.length>0&&m)return f&&console.log(new Array(u+1).join("│ ")+"Recovered text: "+JSON.stringify(c.text)),c}return null}}Parser$1.Parser=Parser;Parser$1.default=Parser;var Grammars={},BNF$3={},SemanticHelpers={};Object.defineProperty(SemanticHelpers,"__esModule",{value:!0});SemanticHelpers.findChildrenByType=void 0;function findChildrenByType(i,s){return i.children?i.children.filter(o=>o.type==s):[]}SemanticHelpers.findChildrenByType=findChildrenByType;Object.defineProperty(BNF$3,"__esModule",{value:!0});const SemanticHelpers_1=SemanticHelpers,Parser_1$2=Parser$1;var BNF$2;(function(i){i.RULES=[{name:"syntax",bnf:[["RULE_EOL*","rule+"]]},{name:"rule",bnf:[['" "*','"<"',"rule-name",'">"','" "*','"::="',"firstExpression","otherExpression*",'" "*',"RULE_EOL+",'" "*']]},{name:"firstExpression",bnf:[['" "*',"list"]]},{name:"otherExpression",bnf:[['" "*','"|"','" "*',"list"]]},{name:"RULE_EOL",bnf:[['"\\r"'],['"\\n"']]},{name:"list",bnf:[["term",'" "*',"list"],["term"]]},{name:"term",bnf:[["literal"],['"<"',"rule-name",'">"']]},{name:"literal",bnf:[[`'"'`,"RULE_CHARACTER1*",`'"'`],[`"'"`,"RULE_CHARACTER2*",`"'"`]]},{name:"RULE_CHARACTER",bnf:[['" "'],["RULE_LETTER"],["RULE_DIGIT"],["RULE_SYMBOL"]]},{name:"RULE_LETTER",bnf:[['"A"'],['"B"'],['"C"'],['"D"'],['"E"'],['"F"'],['"G"'],['"H"'],['"I"'],['"J"'],['"K"'],['"L"'],['"M"'],['"N"'],['"O"'],['"P"'],['"Q"'],['"R"'],['"S"'],['"T"'],['"U"'],['"V"'],['"W"'],['"X"'],['"Y"'],['"Z"'],['"a"'],['"b"'],['"c"'],['"d"'],['"e"'],['"f"'],['"g"'],['"h"'],['"i"'],['"j"'],['"k"'],['"l"'],['"m"'],['"n"'],['"o"'],['"p"'],['"q"'],['"r"'],['"s"'],['"t"'],['"u"'],['"v"'],['"w"'],['"x"'],['"y"'],['"z"']]},{name:"RULE_DIGIT",bnf:[['"0"'],['"1"'],['"2"'],['"3"'],['"4"'],['"5"'],['"6"'],['"7"'],['"8"'],['"9"']]},{name:"RULE_SYMBOL",bnf:[['"-"'],['"_"'],['"!"'],['"#"'],['"$"'],['"%"'],['"&"'],['"("'],['")"'],['"*"'],['"+"'],['","'],['"-"'],['"."'],['"/"'],['":"'],['";"'],['"<"'],['"="'],['">"'],['"?"'],['"@"'],['"["'],['"\\"'],['"]"'],['"^"'],['"_"'],['"`"'],['"{"'],['"|"'],['"}"'],['"~"']]},{name:"RULE_CHARACTER1",bnf:[["RULE_CHARACTER"],[`"'"`]]},{name:"RULE_CHARACTER2",bnf:[["RULE_CHARACTER"],[`'"'`]]},{name:"rule-name",bnf:[["RULE_LETTER","RULE_CHAR*"]]},{name:"RULE_CHAR",bnf:[["RULE_LETTER"],["RULE_DIGIT"],['"_"'],['"-"']]}],i.defaultParser=new Parser_1$2.Parser(i.RULES,{debug:!1});function s(c){let m=SemanticHelpers_1.findChildrenByType(c,"term").map(d=>SemanticHelpers_1.findChildrenByType(d,"literal").concat(SemanticHelpers_1.findChildrenByType(d,"rule-name"))[0].text);return SemanticHelpers_1.findChildrenByType(c,"list").forEach(d=>{m=m.concat(s(d))}),m}function o(c,m=i.defaultParser){let d=m.getAST(c);if(!d)throw new Error("Could not parse "+c);if(d.errors&&d.errors.length)throw d.errors[0];let E=SemanticHelpers_1.findChildrenByType(d,"rule").map(w=>{let ee=SemanticHelpers_1.findChildrenByType(w,"rule-name")[0].text,V=SemanticHelpers_1.findChildrenByType(w,"firstExpression").concat(SemanticHelpers_1.findChildrenByType(w,"otherExpression")),re=[];return V.forEach(z=>{re.push(s(z))}),{name:ee,bnf:re}});return E.some(w=>w.name=="EOL")||E.push({name:"EOL",bnf:[['"\\r\\n"','"\\r"','"\\n"']]}),E}i.getRules=o;function u(c,m=i.defaultParser){return o(c.join(""),m)}i.Transform=u;class f extends Parser_1$2.Parser{constructor(m,d){const C=d&&d.debugRulesParser===!0?new Parser_1$2.Parser(i.RULES,{debug:!0}):i.defaultParser;super(o(m,C),d),this.source=m}emitSource(){return this.source}}i.Parser=f})(BNF$2||(BNF$2={}));BNF$3.default=BNF$2;var W3CEBNF={};Object.defineProperty(W3CEBNF,"__esModule",{value:!0});const Parser_1$1=Parser$1;var BNF$1;(function(i){i.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],i.defaultParser=new Parser_1$1.Parser(i.RULES,{debug:!1});const s=/^(!|&)/,o=/(\?|\+|\*)$/,u=/^%/;function f(F,q){if(typeof F=="string"){if(s.test(F))return"";if(u.test(F)){let $=o.exec(F),X=$?$[0]+" ":"";return c(F,q)?d(F,q)+X:"("+d(F,q)+")"+X}return F}else return F.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function c(F,q){let A=Parser_1$1.findRuleByName(F,q);return A&&A.bnf.length==1&&A.bnf[0].length==1&&(A.bnf[0][0]instanceof RegExp||A.bnf[0][0][0]=='"'||A.bnf[0][0][0]=="'")}function m(F,q){return F.map(A=>f(A,q)).join(" ")}function d(F,q){let A=Parser_1$1.findRuleByName(F,q);return A?A.bnf.map($=>m($,q)).join(" | "):"RULE_NOT_FOUND {"+F+"}"}function C(F){let q=[];return F.grammarRules.forEach(A=>{if(!/^%/.test(A.name)){let $=A.recover?" /* { recoverUntil="+A.recover+" } */":"";q.push(A.name+" ::= "+d(A.name,F)+$)}}),q.join(` -`)}i.emit=C;let E=0;function w(F,q){throw console.log("reberia restar "+q+" a "+F),new Error("Difference not supported yet")}function ee(F){return new RegExp(F.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function V(F,q,A){let $=null,X=[];return q.children.forEach((J,K)=>{J.type=="Minus"&&w($,J);let b=q.children[K+1];b=b&&b.type=="PrimaryDecoration"&&b.text||"";let g="";switch(J.type){case"SubItem":let x="%"+(A+E++);re(F,J,x),X.push(g+x+b);break;case"NCName":case"StringLiteral":X.push(g+J.text+b);break;case"CharCode":case"CharClass":if(b||g){let O={name:"%"+(A+E++),bnf:[[ee(J.text)]]};F.push(O),X.push(g+O.name+b)}else X.push(ee(J.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+J.type+" -> "+JSON.stringify(J.text))}$=J}),X}function re(F,q,A){let $=q.children.filter(K=>K.type=="SequenceOrDifference").map(K=>V(F,K,A)),X={name:A,bnf:$},J=null;$.forEach(K=>{J=J||K.recover,delete K.recover}),A.indexOf("%")==0&&(X.fragment=!0),J&&(X.recover=J),F.push(X)}function z(F,q=i.defaultParser){let A=q.getAST(F);if(!A)throw new Error("Could not parse "+F);if(A.errors&&A.errors.length)throw A.errors[0];let $=[];return A.children.filter(X=>X.type=="Production").map(X=>{let J=X.children.filter(K=>K.type=="NCName")[0].text;re($,X,J)}),$}i.getRules=z;function ie(F,q=i.defaultParser){return z(F.join(""),q)}i.Transform=ie;class ce extends Parser_1$1.Parser{constructor(q,A){const $=A&&A.debugRulesParser===!0?new Parser_1$1.Parser(i.RULES,{debug:!0}):i.defaultParser;super(z(q,$),A)}emitSource(){return C(this)}}i.Parser=ce})(BNF$1||(BNF$1={}));W3CEBNF.default=BNF$1;var Custom={};Object.defineProperty(Custom,"__esModule",{value:!0});const TokenError_1=TokenError$1,Parser_1=Parser$1;var BNF;(function(i){i.RULES=[{name:"Grammar",bnf:[["RULE_S*","Attributes?","RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","%Choice","RULE_WHITESPACE*","Attributes?","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Attributes",bnf:[['"{"',"Attribute","%Attributes*","RULE_S*",'"}"']]},{name:"%Attributes",bnf:[["RULE_S*",'","',"Attribute"]],fragment:!0},{name:"Attribute",bnf:[["RULE_S*","NCName","RULE_WHITESPACE*",'"="',"RULE_WHITESPACE*","AttributeValue"]]},{name:"AttributeValue",bnf:[["NCName"],[/[1-9][0-9]*/]]},{name:"%Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_S*",'"|"',"RULE_S*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["%Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","%Item"],["%Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"%Item",bnf:[["RULE_WHITESPACE*","PrimaryPreDecoration?","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"PrimaryPreDecoration",bnf:[['"&"'],['"!"'],['"~"']]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_S*","%Choice","RULE_S*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]]},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[[/[^*]/],['"*"+',/[^/]*/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],i.defaultParser=new Parser_1.Parser(i.RULES,{debug:!1});const s=/^(!|&)/,o=/(\?|\+|\*)$/,u=/^%/;function f(F,q){if(typeof F=="string"){let A=o.exec(F),$=s.exec(F),X=$?$[0]:"",J=A?A[0]+" ":"";return u.test(F)?c(F,q)?X+d(F,q)+J:X+"("+d(F,q)+")"+J:F.replace(s,X)}else return F.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function c(F,q){let A=Parser_1.findRuleByName(F,q);return A&&A.bnf.length==1&&A.bnf[0].length==1&&(A.bnf[0][0]instanceof RegExp||A.bnf[0][0][0]=='"'||A.bnf[0][0][0]=="'")}function m(F,q){return F.map(A=>f(A,q)).join(" ")}function d(F,q){let A=Parser_1.findRuleByName(F,q);return A?A.bnf.map($=>m($,q)).join(" | "):"RULE_NOT_FOUND {"+F+"}"}function C(F){let q=[];return F.grammarRules.forEach(A=>{if(!/^%/.test(A.name)){let $=A.recover?" { recoverUntil="+A.recover+" }":"";q.push(A.name+" ::= "+d(A.name,F)+$)}}),q.join(` -`)}i.emit=C;let E=0;function w(F,q){throw console.log("reberia restar "+q+" a "+F),new Error("Difference not supported yet")}function ee(F){return new RegExp(F.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function V(F,q,A,$){let X=null,J=[];return q.children.forEach((K,b)=>{K.type=="Minus"&&w(X,K);let g=q.children[b+1];g=g&&g.type=="PrimaryDecoration"&&g.text||"";let x="";X&&X.type=="PrimaryPreDecoration"&&(x=X.text);let O=x=="~"?1:void 0;switch(O&&(x=""),K.type){case"SubItem":let te="%"+(A+E++);re(F,K,te,$),J.push(x+te+g);break;case"NCName":J.push(x+K.text+g);break;case"StringLiteral":if(g||x||!/^['"/()a-zA-Z0-9&_.:=,+*\-\^\\]+$/.test(K.text))J.push(x+K.text+g);else for(const Z of K.text.slice(1,-1))$&&$.ignoreCase=="true"&&/[a-zA-Z]/.test(Z)?J.push(new RegExp("["+Z.toUpperCase()+Z.toLowerCase()+"]")):J.push(new RegExp(Parser_1.escapeRegExp(Z)));break;case"CharCode":case"CharClass":if(g||x){let Z={name:"%"+(A+E++),bnf:[[ee(K.text)]],pinned:O};F.push(Z),J.push(x+Z.name+g)}else J.push(ee(K.text));break;case"PrimaryPreDecoration":case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+K.type+" -> "+JSON.stringify(K.text))}X=K}),J}function re(F,q,A,$=void 0){let X=q.children.filter(g=>g.type=="Attributes")[0],J={};X&&X.children.forEach(g=>{let x=g.children.filter(O=>O.type=="NCName")[0].text;if(x in J)throw new TokenError_1.TokenError("Duplicated attribute "+x,g);J[x]=g.children.filter(O=>O.type=="AttributeValue")[0].text});let K=q.children.filter(g=>g.type=="SequenceOrDifference").map(g=>V(F,g,A,$||J)),b={name:A,bnf:K};if(A.indexOf("%")==0&&(b.fragment=!0),J.recoverUntil&&(b.recover=J.recoverUntil,b.bnf.length>1))throw new TokenError_1.TokenError("only one-option productions are suitable for error recovering",q);if("pin"in J){let g=parseInt(J.pin);if(isNaN(g)||(b.pinned=g),b.bnf.length>1)throw new TokenError_1.TokenError("only one-option productions are suitable for pinning",q)}"ws"in J?b.implicitWs=J.ws!="explicit":b.implicitWs=null,b.fragment=b.fragment||J.fragment=="true",b.simplifyWhenOneChildren=J.simplifyWhenOneChildren=="true",F.push(b)}function z(F,q=i.defaultParser){let A=q.getAST(F);if(!A)throw new Error("Could not parse "+F);if(A.errors&&A.errors.length)throw A.errors[0];let $=null,X=A.children.filter(b=>b.type=="Attributes")[0],J={};X&&X.children.forEach(b=>{let g=b.children.filter(x=>x.type=="NCName")[0].text;if(g in J)throw new TokenError_1.TokenError("Duplicated attribute "+g,b);J[g]=b.children.filter(x=>x.type=="AttributeValue")[0].text}),$=J.ws=="implicit";let K=[];return A.children.filter(b=>b.type=="Production").map(b=>{let g=b.children.filter(x=>x.type=="NCName")[0].text;re(K,b,g)}),K.forEach(b=>{b.implicitWs===null&&(b.implicitWs=$)}),K}i.getRules=z;function ie(F,q=i.defaultParser){return z(F.join(""),q)}i.Transform=ie;class ce extends Parser_1.Parser{constructor(q,A){const $=A&&A.debugRulesParser===!0?new Parser_1.Parser(i.RULES,{debug:!0}):i.defaultParser;super(z(q,$),A)}emitSource(){return C(this)}}i.Parser=ce})(BNF||(BNF={}));Custom.default=BNF;(function(i){Object.defineProperty(i,"__esModule",{value:!0});var s=BNF$3;Object.defineProperty(i,"BNF",{enumerable:!0,get:function(){return s.default}});var o=W3CEBNF;Object.defineProperty(i,"W3C",{enumerable:!0,get:function(){return o.default}});var u=Custom;Object.defineProperty(i,"Custom",{enumerable:!0,get:function(){return u.default}})})(Grammars);(function(i){Object.defineProperty(i,"__esModule",{value:!0});var s=Parser$1;Object.defineProperty(i,"Parser",{enumerable:!0,get:function(){return s.Parser}});var o=TokenError$1;Object.defineProperty(i,"TokenError",{enumerable:!0,get:function(){return o.TokenError}}),i.Grammars=Grammars})(dist);const toValue=i=>({name:"Value",value:i}),toExpression=i=>({name:"Expression",value:i}),toPath=i=>({name:"PathNode",path:i}),toQuery=(i,s)=>({name:"Query",key:i,value:s}),toConcatenatedNode=i=>i.length===1?i[0]:{name:"Concatenated",value:i},doubleQuote=P.string('"'),singleQuote=P.string("'"),backTick=P.string("`"),identifier=P.regex(/[\w\-@]+/).desc("identifier").map(toValue);let path;const futurePath=P.lazy(()=>path),nestedPath=futurePath.trim(P.optWhitespace).wrap(P.string("{{"),P.string("}}")).map(toPath),nestedExpression=P.regex(/[^`]*/).wrap(backTick,backTick).map(toExpression),segment=P.alt(identifier,nestedPath,nestedExpression).atLeast(1).map(flatten$1).map(toConcatenatedNode),optionallyQuotedSegment=P.alt(P.regex(/[^"]*/).wrap(doubleQuote,doubleQuote).map(toValue),P.regex(/[^']*/).wrap(singleQuote,singleQuote).map(toValue),segment),query=P.seq(optionallyQuotedSegment,P.string("=").times(1,3).trim(P.optWhitespace),optionallyQuotedSegment).map(([i,,s])=>toQuery(i,s)),brackets=P.alt(query,optionallyQuotedSegment).trim(P.optWhitespace).wrap(P.string("["),P.string("]")).many(),segmentAndBrackets=P.seqMap(segment,brackets,(i,s)=>[i,...s]);path=P.sepBy(segmentAndBrackets,P.string(".")).map(flatten$1);new dist.Grammars.W3C.Parser(` +`)[1]));let c={type:"SyntaxError",text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:""},m;do if(m=this.parse(o,s.recover,u+1),m){new TokenError_1$1.TokenError('Unexpected input: "'+c.text+`" Expecting: ${s.name}`,c);break}else c.text=c.text+o[0],c.end=c.text.length,o=o.substr(1);while(!m&&o.length>0);if(c.text.length>0&&m)return f&&console.log(new Array(u+1).join("│ ")+"Recovered text: "+JSON.stringify(c.text)),c}return null}}Parser$1.Parser=Parser;Parser$1.default=Parser;var Grammars={},BNF$3={},SemanticHelpers={};Object.defineProperty(SemanticHelpers,"__esModule",{value:!0});SemanticHelpers.findChildrenByType=void 0;function findChildrenByType(i,s){return i.children?i.children.filter(o=>o.type==s):[]}SemanticHelpers.findChildrenByType=findChildrenByType;Object.defineProperty(BNF$3,"__esModule",{value:!0});const SemanticHelpers_1=SemanticHelpers,Parser_1$2=Parser$1;var BNF$2;(function(i){i.RULES=[{name:"syntax",bnf:[["RULE_EOL*","rule+"]]},{name:"rule",bnf:[['" "*','"<"',"rule-name",'">"','" "*','"::="',"firstExpression","otherExpression*",'" "*',"RULE_EOL+",'" "*']]},{name:"firstExpression",bnf:[['" "*',"list"]]},{name:"otherExpression",bnf:[['" "*','"|"','" "*',"list"]]},{name:"RULE_EOL",bnf:[['"\\r"'],['"\\n"']]},{name:"list",bnf:[["term",'" "*',"list"],["term"]]},{name:"term",bnf:[["literal"],['"<"',"rule-name",'">"']]},{name:"literal",bnf:[[`'"'`,"RULE_CHARACTER1*",`'"'`],[`"'"`,"RULE_CHARACTER2*",`"'"`]]},{name:"RULE_CHARACTER",bnf:[['" "'],["RULE_LETTER"],["RULE_DIGIT"],["RULE_SYMBOL"]]},{name:"RULE_LETTER",bnf:[['"A"'],['"B"'],['"C"'],['"D"'],['"E"'],['"F"'],['"G"'],['"H"'],['"I"'],['"J"'],['"K"'],['"L"'],['"M"'],['"N"'],['"O"'],['"P"'],['"Q"'],['"R"'],['"S"'],['"T"'],['"U"'],['"V"'],['"W"'],['"X"'],['"Y"'],['"Z"'],['"a"'],['"b"'],['"c"'],['"d"'],['"e"'],['"f"'],['"g"'],['"h"'],['"i"'],['"j"'],['"k"'],['"l"'],['"m"'],['"n"'],['"o"'],['"p"'],['"q"'],['"r"'],['"s"'],['"t"'],['"u"'],['"v"'],['"w"'],['"x"'],['"y"'],['"z"']]},{name:"RULE_DIGIT",bnf:[['"0"'],['"1"'],['"2"'],['"3"'],['"4"'],['"5"'],['"6"'],['"7"'],['"8"'],['"9"']]},{name:"RULE_SYMBOL",bnf:[['"-"'],['"_"'],['"!"'],['"#"'],['"$"'],['"%"'],['"&"'],['"("'],['")"'],['"*"'],['"+"'],['","'],['"-"'],['"."'],['"/"'],['":"'],['";"'],['"<"'],['"="'],['">"'],['"?"'],['"@"'],['"["'],['"\\"'],['"]"'],['"^"'],['"_"'],['"`"'],['"{"'],['"|"'],['"}"'],['"~"']]},{name:"RULE_CHARACTER1",bnf:[["RULE_CHARACTER"],[`"'"`]]},{name:"RULE_CHARACTER2",bnf:[["RULE_CHARACTER"],[`'"'`]]},{name:"rule-name",bnf:[["RULE_LETTER","RULE_CHAR*"]]},{name:"RULE_CHAR",bnf:[["RULE_LETTER"],["RULE_DIGIT"],['"_"'],['"-"']]}],i.defaultParser=new Parser_1$2.Parser(i.RULES,{debug:!1});function s(c){let m=SemanticHelpers_1.findChildrenByType(c,"term").map(d=>SemanticHelpers_1.findChildrenByType(d,"literal").concat(SemanticHelpers_1.findChildrenByType(d,"rule-name"))[0].text);return SemanticHelpers_1.findChildrenByType(c,"list").forEach(d=>{m=m.concat(s(d))}),m}function o(c,m=i.defaultParser){let d=m.getAST(c);if(!d)throw new Error("Could not parse "+c);if(d.errors&&d.errors.length)throw d.errors[0];let E=SemanticHelpers_1.findChildrenByType(d,"rule").map(w=>{let ee=SemanticHelpers_1.findChildrenByType(w,"rule-name")[0].text,V=SemanticHelpers_1.findChildrenByType(w,"firstExpression").concat(SemanticHelpers_1.findChildrenByType(w,"otherExpression")),re=[];return V.forEach(z=>{re.push(s(z))}),{name:ee,bnf:re}});return E.some(w=>w.name=="EOL")||E.push({name:"EOL",bnf:[['"\\r\\n"','"\\r"','"\\n"']]}),E}i.getRules=o;function u(c,m=i.defaultParser){return o(c.join(""),m)}i.Transform=u;class f extends Parser_1$2.Parser{constructor(m,d){const C=d&&d.debugRulesParser===!0?new Parser_1$2.Parser(i.RULES,{debug:!0}):i.defaultParser;super(o(m,C),d),this.source=m}emitSource(){return this.source}}i.Parser=f})(BNF$2||(BNF$2={}));BNF$3.default=BNF$2;var W3CEBNF={};Object.defineProperty(W3CEBNF,"__esModule",{value:!0});const Parser_1$1=Parser$1;var BNF$1;(function(i){i.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],i.defaultParser=new Parser_1$1.Parser(i.RULES,{debug:!1});const s=/^(!|&)/,o=/(\?|\+|\*)$/,u=/^%/;function f(F,q){if(typeof F=="string"){if(s.test(F))return"";if(u.test(F)){let $=o.exec(F),X=$?$[0]+" ":"";return c(F,q)?d(F,q)+X:"("+d(F,q)+")"+X}return F}else return F.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function c(F,q){let L=Parser_1$1.findRuleByName(F,q);return L&&L.bnf.length==1&&L.bnf[0].length==1&&(L.bnf[0][0]instanceof RegExp||L.bnf[0][0][0]=='"'||L.bnf[0][0][0]=="'")}function m(F,q){return F.map(L=>f(L,q)).join(" ")}function d(F,q){let L=Parser_1$1.findRuleByName(F,q);return L?L.bnf.map($=>m($,q)).join(" | "):"RULE_NOT_FOUND {"+F+"}"}function C(F){let q=[];return F.grammarRules.forEach(L=>{if(!/^%/.test(L.name)){let $=L.recover?" /* { recoverUntil="+L.recover+" } */":"";q.push(L.name+" ::= "+d(L.name,F)+$)}}),q.join(` +`)}i.emit=C;let E=0;function w(F,q){throw console.log("reberia restar "+q+" a "+F),new Error("Difference not supported yet")}function ee(F){return new RegExp(F.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function V(F,q,L){let $=null,X=[];return q.children.forEach((J,K)=>{J.type=="Minus"&&w($,J);let b=q.children[K+1];b=b&&b.type=="PrimaryDecoration"&&b.text||"";let g="";switch(J.type){case"SubItem":let x="%"+(L+E++);re(F,J,x),X.push(g+x+b);break;case"NCName":case"StringLiteral":X.push(g+J.text+b);break;case"CharCode":case"CharClass":if(b||g){let O={name:"%"+(L+E++),bnf:[[ee(J.text)]]};F.push(O),X.push(g+O.name+b)}else X.push(ee(J.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+J.type+" -> "+JSON.stringify(J.text))}$=J}),X}function re(F,q,L){let $=q.children.filter(K=>K.type=="SequenceOrDifference").map(K=>V(F,K,L)),X={name:L,bnf:$},J=null;$.forEach(K=>{J=J||K.recover,delete K.recover}),L.indexOf("%")==0&&(X.fragment=!0),J&&(X.recover=J),F.push(X)}function z(F,q=i.defaultParser){let L=q.getAST(F);if(!L)throw new Error("Could not parse "+F);if(L.errors&&L.errors.length)throw L.errors[0];let $=[];return L.children.filter(X=>X.type=="Production").map(X=>{let J=X.children.filter(K=>K.type=="NCName")[0].text;re($,X,J)}),$}i.getRules=z;function ie(F,q=i.defaultParser){return z(F.join(""),q)}i.Transform=ie;class ce extends Parser_1$1.Parser{constructor(q,L){const $=L&&L.debugRulesParser===!0?new Parser_1$1.Parser(i.RULES,{debug:!0}):i.defaultParser;super(z(q,$),L)}emitSource(){return C(this)}}i.Parser=ce})(BNF$1||(BNF$1={}));W3CEBNF.default=BNF$1;var Custom={};Object.defineProperty(Custom,"__esModule",{value:!0});const TokenError_1=TokenError$1,Parser_1=Parser$1;var BNF;(function(i){i.RULES=[{name:"Grammar",bnf:[["RULE_S*","Attributes?","RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","%Choice","RULE_WHITESPACE*","Attributes?","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Attributes",bnf:[['"{"',"Attribute","%Attributes*","RULE_S*",'"}"']]},{name:"%Attributes",bnf:[["RULE_S*",'","',"Attribute"]],fragment:!0},{name:"Attribute",bnf:[["RULE_S*","NCName","RULE_WHITESPACE*",'"="',"RULE_WHITESPACE*","AttributeValue"]]},{name:"AttributeValue",bnf:[["NCName"],[/[1-9][0-9]*/]]},{name:"%Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_S*",'"|"',"RULE_S*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["%Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","%Item"],["%Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"%Item",bnf:[["RULE_WHITESPACE*","PrimaryPreDecoration?","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"PrimaryPreDecoration",bnf:[['"&"'],['"!"'],['"~"']]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_S*","%Choice","RULE_S*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]]},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[[/[^*]/],['"*"+',/[^/]*/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],i.defaultParser=new Parser_1.Parser(i.RULES,{debug:!1});const s=/^(!|&)/,o=/(\?|\+|\*)$/,u=/^%/;function f(F,q){if(typeof F=="string"){let L=o.exec(F),$=s.exec(F),X=$?$[0]:"",J=L?L[0]+" ":"";return u.test(F)?c(F,q)?X+d(F,q)+J:X+"("+d(F,q)+")"+J:F.replace(s,X)}else return F.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function c(F,q){let L=Parser_1.findRuleByName(F,q);return L&&L.bnf.length==1&&L.bnf[0].length==1&&(L.bnf[0][0]instanceof RegExp||L.bnf[0][0][0]=='"'||L.bnf[0][0][0]=="'")}function m(F,q){return F.map(L=>f(L,q)).join(" ")}function d(F,q){let L=Parser_1.findRuleByName(F,q);return L?L.bnf.map($=>m($,q)).join(" | "):"RULE_NOT_FOUND {"+F+"}"}function C(F){let q=[];return F.grammarRules.forEach(L=>{if(!/^%/.test(L.name)){let $=L.recover?" { recoverUntil="+L.recover+" }":"";q.push(L.name+" ::= "+d(L.name,F)+$)}}),q.join(` +`)}i.emit=C;let E=0;function w(F,q){throw console.log("reberia restar "+q+" a "+F),new Error("Difference not supported yet")}function ee(F){return new RegExp(F.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function V(F,q,L,$){let X=null,J=[];return q.children.forEach((K,b)=>{K.type=="Minus"&&w(X,K);let g=q.children[b+1];g=g&&g.type=="PrimaryDecoration"&&g.text||"";let x="";X&&X.type=="PrimaryPreDecoration"&&(x=X.text);let O=x=="~"?1:void 0;switch(O&&(x=""),K.type){case"SubItem":let te="%"+(L+E++);re(F,K,te,$),J.push(x+te+g);break;case"NCName":J.push(x+K.text+g);break;case"StringLiteral":if(g||x||!/^['"/()a-zA-Z0-9&_.:=,+*\-\^\\]+$/.test(K.text))J.push(x+K.text+g);else for(const Z of K.text.slice(1,-1))$&&$.ignoreCase=="true"&&/[a-zA-Z]/.test(Z)?J.push(new RegExp("["+Z.toUpperCase()+Z.toLowerCase()+"]")):J.push(new RegExp(Parser_1.escapeRegExp(Z)));break;case"CharCode":case"CharClass":if(g||x){let Z={name:"%"+(L+E++),bnf:[[ee(K.text)]],pinned:O};F.push(Z),J.push(x+Z.name+g)}else J.push(ee(K.text));break;case"PrimaryPreDecoration":case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+K.type+" -> "+JSON.stringify(K.text))}X=K}),J}function re(F,q,L,$=void 0){let X=q.children.filter(g=>g.type=="Attributes")[0],J={};X&&X.children.forEach(g=>{let x=g.children.filter(O=>O.type=="NCName")[0].text;if(x in J)throw new TokenError_1.TokenError("Duplicated attribute "+x,g);J[x]=g.children.filter(O=>O.type=="AttributeValue")[0].text});let K=q.children.filter(g=>g.type=="SequenceOrDifference").map(g=>V(F,g,L,$||J)),b={name:L,bnf:K};if(L.indexOf("%")==0&&(b.fragment=!0),J.recoverUntil&&(b.recover=J.recoverUntil,b.bnf.length>1))throw new TokenError_1.TokenError("only one-option productions are suitable for error recovering",q);if("pin"in J){let g=parseInt(J.pin);if(isNaN(g)||(b.pinned=g),b.bnf.length>1)throw new TokenError_1.TokenError("only one-option productions are suitable for pinning",q)}"ws"in J?b.implicitWs=J.ws!="explicit":b.implicitWs=null,b.fragment=b.fragment||J.fragment=="true",b.simplifyWhenOneChildren=J.simplifyWhenOneChildren=="true",F.push(b)}function z(F,q=i.defaultParser){let L=q.getAST(F);if(!L)throw new Error("Could not parse "+F);if(L.errors&&L.errors.length)throw L.errors[0];let $=null,X=L.children.filter(b=>b.type=="Attributes")[0],J={};X&&X.children.forEach(b=>{let g=b.children.filter(x=>x.type=="NCName")[0].text;if(g in J)throw new TokenError_1.TokenError("Duplicated attribute "+g,b);J[g]=b.children.filter(x=>x.type=="AttributeValue")[0].text}),$=J.ws=="implicit";let K=[];return L.children.filter(b=>b.type=="Production").map(b=>{let g=b.children.filter(x=>x.type=="NCName")[0].text;re(K,b,g)}),K.forEach(b=>{b.implicitWs===null&&(b.implicitWs=$)}),K}i.getRules=z;function ie(F,q=i.defaultParser){return z(F.join(""),q)}i.Transform=ie;class ce extends Parser_1.Parser{constructor(q,L){const $=L&&L.debugRulesParser===!0?new Parser_1.Parser(i.RULES,{debug:!0}):i.defaultParser;super(z(q,$),L)}emitSource(){return C(this)}}i.Parser=ce})(BNF||(BNF={}));Custom.default=BNF;(function(i){Object.defineProperty(i,"__esModule",{value:!0});var s=BNF$3;Object.defineProperty(i,"BNF",{enumerable:!0,get:function(){return s.default}});var o=W3CEBNF;Object.defineProperty(i,"W3C",{enumerable:!0,get:function(){return o.default}});var u=Custom;Object.defineProperty(i,"Custom",{enumerable:!0,get:function(){return u.default}})})(Grammars);(function(i){Object.defineProperty(i,"__esModule",{value:!0});var s=Parser$1;Object.defineProperty(i,"Parser",{enumerable:!0,get:function(){return s.Parser}});var o=TokenError$1;Object.defineProperty(i,"TokenError",{enumerable:!0,get:function(){return o.TokenError}}),i.Grammars=Grammars})(dist);const toValue=i=>({name:"Value",value:i}),toExpression=i=>({name:"Expression",value:i}),toPath=i=>({name:"PathNode",path:i}),toQuery=(i,s)=>({name:"Query",key:i,value:s}),toConcatenatedNode=i=>i.length===1?i[0]:{name:"Concatenated",value:i},doubleQuote=P.string('"'),singleQuote=P.string("'"),backTick=P.string("`"),identifier=P.regex(/[\w\-@]+/).desc("identifier").map(toValue);let path;const futurePath=P.lazy(()=>path),nestedPath=futurePath.trim(P.optWhitespace).wrap(P.string("{{"),P.string("}}")).map(toPath),nestedExpression=P.regex(/[^`]*/).wrap(backTick,backTick).map(toExpression),segment=P.alt(identifier,nestedPath,nestedExpression).atLeast(1).map(flatten$1).map(toConcatenatedNode),optionallyQuotedSegment=P.alt(P.regex(/[^"]*/).wrap(doubleQuote,doubleQuote).map(toValue),P.regex(/[^']*/).wrap(singleQuote,singleQuote).map(toValue),segment),query=P.seq(optionallyQuotedSegment,P.string("=").times(1,3).trim(P.optWhitespace),optionallyQuotedSegment).map(([i,,s])=>toQuery(i,s)),brackets=P.alt(query,optionallyQuotedSegment).trim(P.optWhitespace).wrap(P.string("["),P.string("]")).many(),segmentAndBrackets=P.seqMap(segment,brackets,(i,s)=>[i,...s]);path=P.sepBy(segmentAndBrackets,P.string(".")).map(flatten$1);new dist.Grammars.W3C.Parser(` value ::= segment_and_bracket (SEGMENT_SEPARATOR segment_and_bracket)* segment ::= concatenated | expression | modelRef | identifier concatenated ::= (expression | modelRef | identifier)+ @@ -764,8 +764,8 @@ CLOSE_CURL ::= "}" OPEN_BRACKET ::= "[" CLOSE_BRACKET ::= "]" BACK_TICK ::= "\`" -`);function getBindingSegments(i){return Array.isArray(i)?i:typeof i=="string"?i.split("."):i.asArray()}class BindingInstance{constructor(s,o=u=>new BindingInstance(u)){const u=Array.isArray(s)?s:s.split(".");this.split=u.map(f=>{if(typeof f=="number")return f;const c=Number(f);return isNaN(c)?f:c}),Object.freeze(this.split),this.joined=this.split.join("."),this.factory=o}asArray(){return this.split}asString(){return this.joined}contains(s){const o=s.asArray();if(o.length":11,"<=":11,">=":11,"<<":12,">>":12,">>>":12,"+":13,"-":13,"*":14,"/":14,"%":14};function throwError(i,s){const o=new Error(`${i} at character ${s}`);throw o.index=s,o.description=i,o}function createSpanningLocation(i,s){if(!(!i||!s))return{start:i.start,end:s.end}}function getMaxKeyLen(i){let s=0;return Object.keys(i).forEach(o=>{o.length>s&&Object.prototype.hasOwnProperty.call(i,o)&&(s=o.length)}),s}const maxUnopLen=getMaxKeyLen(unaryOps),maxBinopLen=getMaxKeyLen(binaryOps),literals={true:!0,false:!1,null:null,undefined:void 0},thisStr="this";function binaryPrecedence(i){return binaryOps[i]||0}function createBinaryExpression(i,s,o,u){let f;return i==="||"||i==="&&"?f="LogicalExpression":i==="="?f="Assignment":i==="+="||i==="-="||i==="&="||i==="|="?f="Modification":f="BinaryExpression",{__id:ExpNodeOpaqueIdentifier,type:f,operator:i,left:s,right:o,location:u}}function isDecimalDigit(i){return i>=48&&i<=57}function isIdentifierStart(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122}function isIdentifierPart(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57}function isModelRefStart(i,s){return i===OCURL_CODE&&s===OCURL_CODE}function parseExpression(i,s){var o;const u=(o=void 0)!=null?o:!0,f=i.charAt,c=i.charCodeAt,{length:m}=i;let d=0;const C=x=>({start:{character:x},end:{character:d}});function E(x){return f.call(i,x)}function w(x){return c.call(i,x)}function ee(){const x=[];let O=!1,te=!0,Z,we,Le;const Ke=d;for(++d;d0;){if(Object.prototype.hasOwnProperty.call(binaryOps,x))return d+=O,x;x=x.substr(0,--O)}return!1}function ie(){let x,O,te,Z=ce(),we=z();if(!we)return Z;let Le={value:we,prec:binaryPrecedence(we)},Ke=ce();Ke||throwError(`Expected expression after ${we}`,d);const Xe=[Z,Le,Ke];for(we=z();we&&(O=binaryPrecedence(we),O!==0);){for(Le={value:we,prec:O};Xe.length>2&&O<=Xe[Xe.length-2].prec;)Ke=Xe.pop(),we=Xe.pop().value,Z=Xe.pop(),x=createBinaryExpression(we,Z,Ke,createSpanningLocation(Z.location,Ke.location)),Xe.push(x);x=ce(),x||throwError(`Expected expression after ${we}`,d),Xe.push(Le,x),we=z()}for(te=Xe.length-1,x=Xe[te];te>1;)x=createBinaryExpression(Xe[te-1].value,Xe[te-2],x,createSpanningLocation(Xe[te-2].location,x.location)),te-=2;return x}function ce(){V();const x=w(d),O=d;if(isDecimalDigit(x)||x===PERIOD_CODE)return F();if(x===SQUOTE_CODE||x===DQUOTE_CODE)return q();if(isIdentifierStart(x)||x===OPAREN_CODE)return J();if(x===OBRACK_CODE)return b();if(isModelRefStart(x,w(d+1)))return A();if(x===OCURL_CODE)return ee();let te=i.substr(d,maxUnopLen),Z=te.length;for(;Z>0;){if(Object.prototype.hasOwnProperty.call(unaryOps,te))return d+=Z,{__id:ExpNodeOpaqueIdentifier,type:"UnaryExpression",operator:te,argument:ce(),prefix:!0,location:C(O)};te=te.substr(0,--Z)}return!1}function F(){let x="";const O=d;for(;isDecimalDigit(w(d));)x+=E(d++);if(w(d)===PERIOD_CODE)for(x+=E(d++);isDecimalDigit(w(d));)x+=E(d++);let te=E(d);if(te==="e"||te==="E"){for(x+=E(d++),te=E(d),(te==="+"||te==="-")&&(x+=E(d++));isDecimalDigit(w(d));)x+=E(d++);isDecimalDigit(w(d-1))||throwError(`Expected exponent (${x}${E(d)})`,d)}const Z=w(d);return isIdentifierStart(Z)?throwError(`Variable names cannot start with a number (${x}${E(d)})`,d):Z===PERIOD_CODE&&throwError("Unexpected period",d),{__id:ExpNodeOpaqueIdentifier,type:"Literal",value:parseFloat(x),raw:x,location:C(O)}}function q(){const x=E(d++);let O="",te=!1;const Z=d;for(;di.evaluate(s)?i.evaluate(o):u?i.evaluate(u):null;conditional.resolveParams=!1;function isErrorWithLocation(i){return i.index!==void 0&&i.description!==void 0}var NodeType;(function(i){i.Asset="asset",i.View="view",i.Applicability="applicability",i.Template="template",i.Value="value",i.MultiNode="multi-node",i.Switch="switch",i.Async="async",i.Unknown="unknown",i.Empty="empty"})(NodeType||(NodeType={}));NodeType.Empty;var IDSuffixContext=React15.createContext("root"),IndexSuffixStopContext=React15.createContext(!1),useGetIdPrefix=()=>React15.useContext(IDSuffixContext),IDSuffixProvider=i=>{const s=useGetIdPrefix();return React15.createElement(IDSuffixContext.Provider,{value:[s==="root"?void 0:s,i.suffix].filter(Boolean).join("-")},i.children)},IDProvider=i=>i.id?React15.createElement(IDSuffixContext.Provider,{value:i.id},i.children):React15.createElement(React15.Fragment,null,i.children),useIndexInSlot=i=>{const[s,o]=React15.useState(-1),u=React15.useContext(SlotContext);return React15.useEffect(()=>{if(!u?.isArray)throw new Error("Cannot get index in non-array slot");if(i.current&&u?.ref.current?.valueNode?.type==="array"){const c=distExports.flattenNodes(u.ref.current.valueNode.children).indexOf(i.current);c!==s&&o(c)}},[s,i,u?.isArray,u?.ref]),s},IDSuffixIndexProvider=i=>{const s=useIndexInSlot(i.wrapperRef);return React15.useContext(IndexSuffixStopContext)?React15.createElement(React15.Fragment,null,i.children):React15.createElement(IDSuffixProvider,{suffix:i.templateIndex??String(s)},React15.createElement(IndexSuffixStopContext.Provider,{value:!0},i.children))},OptionalIDSuffixProvider=i=>React15.useContext(SlotContext)?.isArray?React15.createElement(IDSuffixIndexProvider,{wrapperRef:i.wrapperRef,templateIndex:i.templateIndex},i.children):React15.createElement(React15.Fragment,null,i.children),ObjectWithIndexTracking=i=>{const s=React15.useRef(null);return React15.createElement(OptionalIDSuffixProvider,{wrapperRef:s},React15.createElement("obj",{ref:s},i.children))},OpaqueIdentifier=Symbol("TemplateStringType"),TemplateStringComponent=i=>reactExports.createElement("value",{value:i.value},null),createTemplateInstance=i=>{const s=i.strings.reduce((c,m,d)=>{const C=i.other[d];return typeof C=="string"?c+m+C:c+m+(C?.toRefString(i)??"")},"");if(i.nestedContext==="expression")try{parseExpression(s)}catch(c){if(c instanceof Error){let m;throw isErrorWithLocation(c)?m=`${c} in expression: \r +`);function getBindingSegments(i){return Array.isArray(i)?i:typeof i=="string"?i.split("."):i.asArray()}class BindingInstance{constructor(s,o=u=>new BindingInstance(u)){const u=Array.isArray(s)?s:s.split(".");this.split=u.map(f=>{if(typeof f=="number")return f;const c=Number(f);return isNaN(c)?f:c}),Object.freeze(this.split),this.joined=this.split.join("."),this.factory=o}asArray(){return this.split}asString(){return this.joined}contains(s){const o=s.asArray();if(o.length":11,"<=":11,">=":11,"<<":12,">>":12,">>>":12,"+":13,"-":13,"*":14,"/":14,"%":14};function throwError(i,s){const o=new Error(`${i} at character ${s}`);throw o.index=s,o.description=i,o}function createSpanningLocation(i,s){if(!(!i||!s))return{start:i.start,end:s.end}}function getMaxKeyLen(i){let s=0;return Object.keys(i).forEach(o=>{o.length>s&&Object.prototype.hasOwnProperty.call(i,o)&&(s=o.length)}),s}const maxUnopLen=getMaxKeyLen(unaryOps),maxBinopLen=getMaxKeyLen(binaryOps),literals={true:!0,false:!1,null:null,undefined:void 0},thisStr="this";function binaryPrecedence(i){return binaryOps[i]||0}function createBinaryExpression(i,s,o,u){let f;return i==="||"||i==="&&"?f="LogicalExpression":i==="="?f="Assignment":i==="+="||i==="-="||i==="&="||i==="|="?f="Modification":f="BinaryExpression",{__id:ExpNodeOpaqueIdentifier,type:f,operator:i,left:s,right:o,location:u}}function isDecimalDigit(i){return i>=48&&i<=57}function isIdentifierStart(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122}function isIdentifierPart(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57}function isModelRefStart(i,s){return i===OCURL_CODE&&s===OCURL_CODE}function parseExpression(i,s){var o;const u=(o=void 0)!=null?o:!0,f=i.charAt,c=i.charCodeAt,{length:m}=i;let d=0;const C=x=>({start:{character:x},end:{character:d}});function E(x){return f.call(i,x)}function w(x){return c.call(i,x)}function ee(){const x=[];let O=!1,te=!0,Z,we,Ae;const Ke=d;for(++d;d0;){if(Object.prototype.hasOwnProperty.call(binaryOps,x))return d+=O,x;x=x.substr(0,--O)}return!1}function ie(){let x,O,te,Z=ce(),we=z();if(!we)return Z;let Ae={value:we,prec:binaryPrecedence(we)},Ke=ce();Ke||throwError(`Expected expression after ${we}`,d);const Xe=[Z,Ae,Ke];for(we=z();we&&(O=binaryPrecedence(we),O!==0);){for(Ae={value:we,prec:O};Xe.length>2&&O<=Xe[Xe.length-2].prec;)Ke=Xe.pop(),we=Xe.pop().value,Z=Xe.pop(),x=createBinaryExpression(we,Z,Ke,createSpanningLocation(Z.location,Ke.location)),Xe.push(x);x=ce(),x||throwError(`Expected expression after ${we}`,d),Xe.push(Ae,x),we=z()}for(te=Xe.length-1,x=Xe[te];te>1;)x=createBinaryExpression(Xe[te-1].value,Xe[te-2],x,createSpanningLocation(Xe[te-2].location,x.location)),te-=2;return x}function ce(){V();const x=w(d),O=d;if(isDecimalDigit(x)||x===PERIOD_CODE)return F();if(x===SQUOTE_CODE||x===DQUOTE_CODE)return q();if(isIdentifierStart(x)||x===OPAREN_CODE)return J();if(x===OBRACK_CODE)return b();if(isModelRefStart(x,w(d+1)))return L();if(x===OCURL_CODE)return ee();let te=i.substr(d,maxUnopLen),Z=te.length;for(;Z>0;){if(Object.prototype.hasOwnProperty.call(unaryOps,te))return d+=Z,{__id:ExpNodeOpaqueIdentifier,type:"UnaryExpression",operator:te,argument:ce(),prefix:!0,location:C(O)};te=te.substr(0,--Z)}return!1}function F(){let x="";const O=d;for(;isDecimalDigit(w(d));)x+=E(d++);if(w(d)===PERIOD_CODE)for(x+=E(d++);isDecimalDigit(w(d));)x+=E(d++);let te=E(d);if(te==="e"||te==="E"){for(x+=E(d++),te=E(d),(te==="+"||te==="-")&&(x+=E(d++));isDecimalDigit(w(d));)x+=E(d++);isDecimalDigit(w(d-1))||throwError(`Expected exponent (${x}${E(d)})`,d)}const Z=w(d);return isIdentifierStart(Z)?throwError(`Variable names cannot start with a number (${x}${E(d)})`,d):Z===PERIOD_CODE&&throwError("Unexpected period",d),{__id:ExpNodeOpaqueIdentifier,type:"Literal",value:parseFloat(x),raw:x,location:C(O)}}function q(){const x=E(d++);let O="",te=!1;const Z=d;for(;di.evaluate(s)?i.evaluate(o):u?i.evaluate(u):null;conditional.resolveParams=!1;function isErrorWithLocation(i){return i.index!==void 0&&i.description!==void 0}var NodeType;(function(i){i.Asset="asset",i.View="view",i.Applicability="applicability",i.Template="template",i.Value="value",i.MultiNode="multi-node",i.Switch="switch",i.Async="async",i.Unknown="unknown",i.Empty="empty"})(NodeType||(NodeType={}));NodeType.Empty;var IDSuffixContext=React15.createContext("root"),IndexSuffixStopContext=React15.createContext(!1),useGetIdPrefix=()=>React15.useContext(IDSuffixContext),IDSuffixProvider=i=>{const s=useGetIdPrefix();return React15.createElement(IDSuffixContext.Provider,{value:[s==="root"?void 0:s,i.suffix].filter(Boolean).join("-")},i.children)},IDProvider=i=>i.id?React15.createElement(IDSuffixContext.Provider,{value:i.id},i.children):React15.createElement(React15.Fragment,null,i.children),useIndexInSlot=i=>{const[s,o]=React15.useState(-1),u=React15.useContext(SlotContext);return React15.useEffect(()=>{if(!u?.isArray)throw new Error("Cannot get index in non-array slot");if(i.current&&u?.ref.current?.valueNode?.type==="array"){const c=distExports.flattenNodes(u.ref.current.valueNode.children).indexOf(i.current);c!==s&&o(c)}},[s,i,u?.isArray,u?.ref]),s},IDSuffixIndexProvider=i=>{const s=useIndexInSlot(i.wrapperRef);return React15.useContext(IndexSuffixStopContext)?React15.createElement(React15.Fragment,null,i.children):React15.createElement(IDSuffixProvider,{suffix:i.templateIndex??String(s)},React15.createElement(IndexSuffixStopContext.Provider,{value:!0},i.children))},OptionalIDSuffixProvider=i=>React15.useContext(SlotContext)?.isArray?React15.createElement(IDSuffixIndexProvider,{wrapperRef:i.wrapperRef,templateIndex:i.templateIndex},i.children):React15.createElement(React15.Fragment,null,i.children),ObjectWithIndexTracking=i=>{const s=React15.useRef(null);return React15.createElement(OptionalIDSuffixProvider,{wrapperRef:s},React15.createElement("obj",{ref:s},i.children))},OpaqueIdentifier=Symbol("TemplateStringType"),TemplateStringComponent=i=>reactExports.createElement("value",{value:i.value},null),createTemplateInstance=i=>{const s=i.strings.reduce((c,m,d)=>{const C=i.other[d];return typeof C=="string"?c+m+C:c+m+(C?.toRefString(i)??"")},"");if(i.nestedContext==="expression")try{parseExpression(s)}catch(c){if(c instanceof Error){let m;throw isErrorWithLocation(c)?m=`${c} in expression: \r ${s.slice(0,c.index+1)+"█"+s.slice(c.index+1)}`:m=`${c} in expression ${s}`,new Error(m)}throw new Error(`Unknown problem parsing expression ${c}`)}const o=()=>i.toRefString({},s),u=()=>s;return{...reactExports.createElement(TemplateStringComponent,{value:o()},null),[OpaqueIdentifier]:!0,toString:o,toValue:u,toRefString:c=>i.toRefString(c,s)}},addBindingIndexes=i=>{let s=0;return i.replace(/_index_/g,()=>{const o=`_index${s>0?s:""}_`;return s+=1,o})},createBindingTemplateInstance=i=>{const s=createTemplateInstance({...i,strings:i.strings.map(o=>addBindingIndexes(o)),other:i.other.map(o=>typeof o=="string"?addBindingIndexes(o):o),toRefString:(o,u)=>`{{${u}}}`});return s.__type="binding",s},createExpressionTemplateInstance=i=>{const s=createTemplateInstance({...i,toRefString:(o,u)=>{if(o?.nestedContext==="expression")return u;const f=o?.nestedContext==="binding";return`${f?"`":"@["}${u}${f?"`":"]@"}`}});return s.__type="expression",s},binding=(i,...s)=>createBindingTemplateInstance({strings:i,other:s,nestedContext:"binding"}),expression$1=(i,...s)=>createExpressionTemplateInstance({strings:i,other:s,nestedContext:"expression"}),isTemplateStringInstance=i=>i!==null&&typeof i=="object"&&i[OpaqueIdentifier]===!0;function toArray(i){return Array.isArray(i)?i:[i]}function toJsonElement(i,s,o){const u=typeof s=="number"?{key:s}:null;return isTemplateStringInstance(i)?typeof s=="string"&&o?.propertiesToSkip?.includes(s)?reactExports.createElement("value",{...u},i.toValue()):reactExports.createElement("value",{...u},i.toRefString()):Array.isArray(i)?reactExports.createElement("array",{...u},i.map((f,c)=>toJsonElement(f,c,o))):typeof i=="object"&&i!==null?reactExports.createElement("obj",{...u},Object.keys(i).map(f=>reactExports.createElement("property",{key:f,name:f},toJsonElement(i[f],f,o)))):reactExports.createElement("value",{...u,value:i})}function toJsonProperties(i,s={propertiesToSkip:["applicability"]}){return Object.keys(i).map(o=>reactExports.createElement("property",{key:o,name:o},toJsonElement(i[o],o,s)))}function normalizeText(i){const{node:s,TextComp:o}=i,u=reactExports.Children.toArray(s);if(u.every(f=>reactExports.isValidElement(f)&&f.type!==TemplateStringComponent))return s;if(o)return reactExports.createElement(o,null,u);throw new Error("Tried to convert node to Text Asset, but no Component was supplied.")}function normalizeToCollection(i){const{node:s,CollectionComp:o}=i;if(reactExports.Children.count(s)>1&&reactExports.Children.toArray(s).every(u=>typeof u!="string")){if(!o)throw new Error("Tried to convert array to a collection asset, but no Component was given.");return reactExports.createElement(o,null,s)}return normalizeText({...i,node:s})}function flattenChildren(i){return reactExports.Children.toArray(i).reduce((o,u)=>u.type===reactExports.Fragment?o.concat(flattenChildren(u.props.children)):(o.push(u),o),[])}function mergeRefs(i){return s=>{i.forEach(o=>{typeof o=="function"?o(s):o!=null&&(o.current=s)})}}function getObjectReferences(i){const s={};for(const o in i)if(Object.prototype.hasOwnProperty.call(i,o)){const u=`${o}Ref`;s[u]={type:o}}return s}var SlotContext=React15.createContext(void 0),AssetWrapper=React15.forwardRef(function(s,o){const{children:u,...f}=s;return React15.createElement("obj",{ref:o},toJsonProperties(f),React15.createElement("property",{name:"asset"},u))}),GeneratedIDProperty=i=>{const s=useGetIdPrefix();return React15.createElement("property",{name:"id"},i.id??s)},Asset=React15.forwardRef((i,s)=>{const{id:o,type:u,applicability:f,children:c,...m}=i,d=React15.useContext(SlotContext),C=React15.useRef(null),E=d?.wrapInAsset?AssetWrapper:React15.Fragment;return React15.createElement(E,{ref:d?.wrapInAsset?mergeRefs([s,C]):void 0,...d?.wrapInAsset&&d?.additionalProperties?d?.additionalProperties:{}},React15.createElement(OptionalIDSuffixProvider,{wrapperRef:C},React15.createElement(SlotContext.Provider,{value:void 0},React15.createElement(IDProvider,{id:o},React15.createElement("obj",{ref:d?.wrapInAsset?void 0:mergeRefs([s,C])},React15.createElement(GeneratedIDProperty,{id:o}),React15.createElement("property",{name:"type"},u),f!==void 0&&React15.createElement("property",{name:"applicability"},React15.createElement("value",{value:typeof f=="boolean"?f:f.toValue()})),toJsonProperties(m),c)))))});Asset.displayName="Asset";Asset.defaultProps={id:void 0,children:void 0};var View=React15.forwardRef((i,s)=>{const{validation:o,children:u,...f}=i;return React15.createElement(Asset,{ref:s,...f},o&&React15.createElement("property",{key:"validation",name:"validation"},toJsonElement(o,"validation",{propertiesToSkip:["ref"]})),u)});View.displayName="View";View.defaultProps={id:void 0,children:void 0};var Slot=i=>{const{TextComp:s,CollectionComp:o}=i,u=flattenChildren(i.children),f=React15.useRef(null);return React15.createElement("property",{ref:f,name:i.name},React15.createElement(IDSuffixProvider,{suffix:i.name},React15.createElement(IndexSuffixStopContext.Provider,{value:!1},React15.createElement(SlotContext.Provider,{value:{ref:f,propertyName:i.name,wrapInAsset:i.wrapInAsset??!1,isArray:i.isArray??!1,additionalProperties:i.additionalProperties,TextComp:s,CollectionComp:o}},i.isArray&&React15.createElement("array",null,React15.Children.map(u,(c,m)=>React15.createElement(React15.Fragment,{key:`${i.name}-${m}`},normalizeText({node:c,TextComp:s})))),!i.isArray&&normalizeToCollection({node:u,TextComp:s,CollectionComp:o})))))};function createSlot(i){return s=>{const{children:o,...u}=s;return React15.createElement(Slot,{...i,additionalProperties:u},o)}}var SwitchContext=React15.createContext({}),Switch=i=>{const s=React15.useContext(SlotContext),o=React15.useRef(null);return React15.createElement("obj",{ref:o},React15.createElement(SwitchContext.Provider,{value:{...i,TextComp:s?.TextComp,CollectionComp:s?.CollectionComp}},React15.createElement(OptionalIDSuffixProvider,{wrapperRef:o},React15.createElement("property",{name:i.isDynamic?"dynamicSwitch":"staticSwitch"},React15.createElement(SlotContext.Provider,{value:void 0},React15.createElement("array",null,i.children))))),s?.additionalProperties&&toJsonProperties(s.additionalProperties))},findParentArray=i=>{if(i.type==="array")return i;if(i.parent)return findParentArray(i.parent);throw new Error("can't find parent array")},findArrayIndex=i=>{const s=findParentArray(i);return distExports.flattenNodes(s.children).indexOf(i)},Case=i=>{const s=React15.useContext(SlotContext),o=React15.useContext(SwitchContext),[u,f]=React15.useState(-1),c=React15.useRef(null);React15.useLayoutEffect(()=>{if(c.current){const d=findArrayIndex(c.current);d!==u&&f(d)}},[u]);let m=!0;return i.exp!==void 0&&(m=isTemplateStringInstance(i.exp)?i.exp.toValue():i.exp),React15.createElement("obj",{ref:c},React15.createElement("property",{name:"case"},React15.createElement("value",{value:m})),React15.createElement(IDSuffixProvider,{suffix:`${o.isDynamic?"dynamicSwitch":"staticSwitch"}-${u}`},React15.createElement(SlotContext.Provider,{value:s?{...s,wrapInAsset:!1}:void 0},React15.createElement("property",{name:"asset"},normalizeToCollection({node:i.children,TextComp:o?.TextComp,CollectionComp:o?.CollectionComp})))))};Switch.Case=Case;var TemplateContext=React15.createContext({depth:0});function addTemplateToObject(i,s,o){let u=i.properties.find(m=>m.keyNode.value==="template"&&m.valueNode?.type==="array");u||(u=new distExports.PropertyNode(new distExports.ValueNode("template"),new distExports.ArrayNode),u.parent=i,i.properties.push(u));const f=u.valueNode;f.items.push(s),s.parent=f;const c=i.properties.find(m=>m.keyNode.value===o&&m.valueNode?.type==="array");if(c){const m=i.properties.indexOf(c,1),d=i.properties[m]?.valueNode;if(d){const C=distExports.toJSON(d);Array.isArray(C)&&C.length===0&&i.properties.splice(m,1)}}return()=>{f.items=f.items.filter(m=>m!==s),f.children.length===0&&u&&i.properties.splice(i.properties.indexOf(u,1))}}var TemplateProvider=i=>{const s=React15.useContext(TemplateContext);return React15.createElement(TemplateContext.Provider,{value:{depth:s.depth+1}},i.children)},getParentObject=i=>{if(i.type==="object")return i;if(i.parent)return getParentObject(i.parent)},getParentProperty=i=>{if(i.type==="property")return i;if(i.parent)return getParentProperty(i.parent)},Template=i=>{const s=React15.useContext(TemplateContext),o=i.dynamic??!1,[u,f]=React15.useState(i.output),c=React15.useRef(null),m=React15.useRef(null),d=React15.useMemo(()=>new distExports.ProxyNode,[]);return React15.useLayoutEffect(()=>{const C=c.current&&getParentProperty(c.current);u===void 0&&C&&f(C.keyNode.value)},[c,u]),React15.useEffect(()=>{const C=d.items[0];if(c.current){const E=getParentObject(c.current);if(!E)throw new Error("Unable to find parent to add template to");return u?addTemplateToObject(E,C,u):void 0}},[c,u,d.items]),React15.createElement("proxy",{ref:c},React15.createElement(React15.Fragment,null,distExports.createPortal(React15.createElement(OptionalIDSuffixProvider,{wrapperRef:m,templateIndex:`_index${s.depth===0?"":s.depth}_`},React15.createElement(TemplateProvider,null,React15.createElement("object",null,React15.createElement("property",{name:"data"},i.data.toValue()),React15.createElement("property",{name:"output"},u),React15.createElement("property",{name:"value"},i.children),o&&React15.createElement("property",{name:"dynamic"},toJsonElement(o))))),d),React15.createElement("value",{ref:m,value:void 0})))},bindingSymbol=Symbol("binding"),SchemaTypeName=Symbol("Schema Rename"),isTypeDef=i=>i.type!==void 0,SchemaGenerator=class{children;generatedDataTypes;logger;hooks={createSchemaNode:new SyncWaterfallHook};constructor(i){this.children=[],this.generatedDataTypes=new Map,this.logger=i??console}toSchema=i=>{const s={ROOT:{}};for(this.children=[],this.generatedDataTypes.clear(),Object.keys(i).forEach(o=>{const u=i[o];s.ROOT[o]=this.hooks.createSchemaNode.call(this.processChild(o,u),u)});this.children.length>0;){const o=this.children.pop();if(o===void 0)break;const{name:u,child:f}=o,c={};Object.keys(f).forEach(m=>{const d=f[m];c[m]=this.hooks.createSchemaNode.call(this.processChild(m,d),d)}),s[u]=c}return s};processChild(i,s){if(isTypeDef(s))return s;let o,u;if(Array.isArray(s)){s.length>1&&this.logger.warn(`Type ${i} has multiple types in array, should only contain one top level object type. Only taking first defined type`);const f=s[0][SchemaTypeName]??i;o=this.makePlaceholderArrayType(f),[u]=s}else{const f=s[SchemaTypeName]??i;o=this.makePlaceholderType(f),u=s}if(this.children.push({name:o.type,child:u}),this.generatedDataTypes.has(o.type)){const f=this.generatedDataTypes.get(o.type);if(!dequal(u,this.generatedDataTypes.get(o.type)?.node)){f.count+=1;const c={...o,type:`${o.type}${f.count}`};this.logger.warn(`WARNING: Generated two intermediate types with the name: ${o.type} that are of different shapes, using artificial type ${c.type}`),o=c,this.children.pop(),this.children.push({name:o.type,child:u})}}return this.generatedDataTypes.set(o.type,{node:s,count:1}),o}makePlaceholderType=i=>({type:`${i}Type`});makePlaceholderArrayType(i){return{type:`${i}Type`,isArray:!0}}};function makeBindingsForObject(i,s=["_index_"]){const o=u=>{const f=new WeakMap;return{ownKeys(c){return Reflect.ownKeys(c)},get(c,m){const d=Object.keys(c);return Array.isArray(c[m])&&c[m].length>0&&c[m].every(E=>typeof E!="object")?[...c[m]]:(f.has(c)||f.set(c,binding`${u.join(".")}`),m===bindingSymbol?u:Array.isArray(c)&&(s.includes(m)||typeof m=="number")?new Proxy(c[0],o(u.concat([m]))):d.includes(m)&&typeof c[m]=="object"?new Proxy(c[m],o(u.concat([m]))):f.get(c)?.[m])}}};return new Proxy(i,o([]))}var getBindingFromObject=i=>{const s=i[bindingSymbol];if(!Array.isArray(s)||s.length===0)throw new Error(`Unable to get binding for ${i}`);return binding`${s.join(".")}`},getBindingStringFromObject=i=>getBindingFromObject(i).toString(),getRefStringFromObject=i=>getBindingFromObject(i).toRefString(),fingerprintContent=(i,s)=>{if(i!==null||i!==void 0){if(React15.isValidElement(i))return"view";if(typeof i=="object"&&"navigation"in i)return"flow";if(!s||s.includes("schema"))return"schema"}},parseNavigationExpressions=i=>{function s(o){function u(f){return f&&typeof f=="object"&&f.__type==="expression"?f.toValue():s(f)}if(Array.isArray(o))return o.map(u);if(typeof o=="object"){const f={...o};for(const[c,m]of Object.entries(f))f[c]=u(m);return f}return o}return s(i)},mergeSourceMaps=(i,s)=>{const o=new SourceMapGenerator;return i.forEach(({sourceMap:u,offsetIndexSearch:f,source:c})=>{const m=s.split(` `).findIndex(ie=>ie.includes(f)),d=c.split(` `).findIndex(ie=>ie.includes(f)),C=m-d,E=s.split(` diff --git a/next/_astro/PlayerPreview.C_fXK8Ns.js b/next/_astro/PlayerPreview.bT1BeelW.js similarity index 99% rename from next/_astro/PlayerPreview.C_fXK8Ns.js rename to next/_astro/PlayerPreview.bT1BeelW.js index eccf25bf..a2b67ba1 100644 --- a/next/_astro/PlayerPreview.C_fXK8Ns.js +++ b/next/_astro/PlayerPreview.bT1BeelW.js @@ -1,4 +1,4 @@ -import{j as N}from"./jsx-runtime.s_qdhQ62.js";import{R as l,r as p,g as Ue}from"./index.DRjF_FHU.js";import{R as ne,S as be,i as qe,j as He,l as Ke,c as Je}from"./index.DPFtMv8W.js";import"./index.BYU6oRFl.js";function te(){let e=()=>{},t=()=>{},r="pending";const n=new Promise((o,a)=>{e=i=>{r="success",o(i)},t=i=>{r="failure",a(i)}});return{resolve:e,status:r,reject:t,promise:n}}var O=Symbol("Subscribe -- Empty Value"),Ye=class{constructor(){this.callbacks=new Map,this.deferredResult=te(),this.lastValue=O,this.resetDeferred=null,this.publish=this.publish.bind(this),this.add=this.add.bind(this),this.remove=this.remove.bind(this)}async publish(e){await this.resetDeferred?.promise,this.lastValue=e,this.deferredResult.resolve(e),this.callbacks.forEach(t=>t(e))}add(e,t){const r=this.callbacks.size;return this.callbacks.set(r,e),this.lastValue!==O&&t?.initializeWithPreviousValue===!0&&e(this.lastValue),r}remove(e){this.callbacks.delete(e)}async reset(e){e&&(this.resetDeferred=te(),await e),this.lastValue!==O&&(this.deferredResult=te()),this.lastValue=O,this.callbacks.forEach(t=>t(void 0)),this.resetDeferred?.resolve(),this.resetDeferred=null}suspend(){if(this.lastValue===O)throw this.deferredResult.promise;return this.lastValue}get(){if(this.lastValue!==O)return this.lastValue}};function Ze(e){const[t,r]=l.useState(e.get());return l.useEffect(()=>{const n=e.add(o=>{r(o)},{initializeWithPreviousValue:!0});return()=>{e.remove(n)}},[e]),t}function oe(e,t){return oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},oe(e,t)}function Xe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,oe(e,t)}var Qe=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),t.length!==r.length||t.some(function(n,o){return!Object.is(n,r[o])})},xe={error:null},et=function(e){Xe(t,e);function t(){for(var n,o=arguments.length,a=new Array(o),i=0;i{if(e===t)return 0;const r=e;e.length>t.length&&(e=t,t=r);let n=e.length,o=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-o);)n--,o--;let a=0;for(;as?d>s?s+1:d:d>c?c+1:d;return s};de.exports=Re;de.exports.default=Re;var tt=de.exports;const rt=Ue(tt);var nt=Symbol.for("MetricsCorePlugin"),ot=class{constructor(e){this.name="RequestTimeWebPlugin",this.getRequestTime=e}apply(e){e.hooks.resolveRequestTime.tap(this.name,()=>this.getRequestTime())}},ue=l.createContext({}),C=e=>{const{registry:t}=l.useContext(ue);let r;if("type"in e&&"id"in e?r=e:"asset"in e&&(r=e.asset),!r)throw Error(`Cannot determine asset type for props: ${JSON.stringify(e)}`);if(typeof r!="object")throw Error(`Asset was not an object got (${typeof r}) instead: ${r}`);if(r.type===void 0){const o=r.id===void 0?JSON.stringify(e):`id: ${r.id}`;throw Error(`Asset is missing type for ${o}`)}if(!t||t.isRegistryEmpty())throw Error(`No asset found in registry. This could happen for one of the following reasons: +import{j as N}from"./jsx-runtime.s_qdhQ62.js";import{R as l,r as p,g as Ue}from"./index.DRjF_FHU.js";import{R as ne,c as be,i as qe,j as He,l as Ke,d as Je}from"./index.CZMVt0yS.js";import"./index.BYU6oRFl.js";function te(){let e=()=>{},t=()=>{},r="pending";const n=new Promise((o,a)=>{e=i=>{r="success",o(i)},t=i=>{r="failure",a(i)}});return{resolve:e,status:r,reject:t,promise:n}}var O=Symbol("Subscribe -- Empty Value"),Ye=class{constructor(){this.callbacks=new Map,this.deferredResult=te(),this.lastValue=O,this.resetDeferred=null,this.publish=this.publish.bind(this),this.add=this.add.bind(this),this.remove=this.remove.bind(this)}async publish(e){await this.resetDeferred?.promise,this.lastValue=e,this.deferredResult.resolve(e),this.callbacks.forEach(t=>t(e))}add(e,t){const r=this.callbacks.size;return this.callbacks.set(r,e),this.lastValue!==O&&t?.initializeWithPreviousValue===!0&&e(this.lastValue),r}remove(e){this.callbacks.delete(e)}async reset(e){e&&(this.resetDeferred=te(),await e),this.lastValue!==O&&(this.deferredResult=te()),this.lastValue=O,this.callbacks.forEach(t=>t(void 0)),this.resetDeferred?.resolve(),this.resetDeferred=null}suspend(){if(this.lastValue===O)throw this.deferredResult.promise;return this.lastValue}get(){if(this.lastValue!==O)return this.lastValue}};function Ze(e){const[t,r]=l.useState(e.get());return l.useEffect(()=>{const n=e.add(o=>{r(o)},{initializeWithPreviousValue:!0});return()=>{e.remove(n)}},[e]),t}function oe(e,t){return oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},oe(e,t)}function Xe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,oe(e,t)}var Qe=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),t.length!==r.length||t.some(function(n,o){return!Object.is(n,r[o])})},xe={error:null},et=function(e){Xe(t,e);function t(){for(var n,o=arguments.length,a=new Array(o),i=0;i{if(e===t)return 0;const r=e;e.length>t.length&&(e=t,t=r);let n=e.length,o=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-o);)n--,o--;let a=0;for(;as?d>s?s+1:d:d>c?c+1:d;return s};de.exports=Re;de.exports.default=Re;var tt=de.exports;const rt=Ue(tt);var nt=Symbol.for("MetricsCorePlugin"),ot=class{constructor(e){this.name="RequestTimeWebPlugin",this.getRequestTime=e}apply(e){e.hooks.resolveRequestTime.tap(this.name,()=>this.getRequestTime())}},ue=l.createContext({}),C=e=>{const{registry:t}=l.useContext(ue);let r;if("type"in e&&"id"in e?r=e:"asset"in e&&(r=e.asset),!r)throw Error(`Cannot determine asset type for props: ${JSON.stringify(e)}`);if(typeof r!="object")throw Error(`Asset was not an object got (${typeof r}) instead: ${r}`);if(r.type===void 0){const o=r.id===void 0?JSON.stringify(e):`id: ${r.id}`;throw Error(`Asset is missing type for ${o}`)}if(!t||t.isRegistryEmpty())throw Error(`No asset found in registry. This could happen for one of the following reasons: 1. You might have no assets registered or no plugins added to the Player instance. diff --git a/next/_astro/index.DPFtMv8W.js b/next/_astro/index.CZMVt0yS.js similarity index 66% rename from next/_astro/index.DPFtMv8W.js rename to next/_astro/index.CZMVt0yS.js index 6a863e07..76309c79 100644 --- a/next/_astro/index.DPFtMv8W.js +++ b/next/_astro/index.CZMVt0yS.js @@ -1,4 +1,14 @@ -import{g as qe,c as Sr,r as A,R as X}from"./index.DRjF_FHU.js";function Er(e,t){return Array.isArray(t)?t.includes(e):t===e}function ee(e,t,r){return e.context?e.callback(r,...t):e.callback(...t)}class kr{constructor(){this.interceptions=[],this.interceptionKeySet=new Set}isUsed(){return this.interceptions.length>0}intercept(t){this.interceptions.push(t),Object.keys(t).forEach(r=>{this.interceptionKeySet.add(r)})}tap(t){this.interceptionKeySet.has("tap")&&this.interceptions.forEach(r=>{var n;(n=r.tap)==null||n.call(r,t)})}call(t,...r){this.interceptionKeySet.has("call")&&this.interceptions.forEach(n=>{var i,o;n.context?(i=n.call)==null||i.call(n,t,...r):(o=n.call)==null||o.call(n,...r)})}loop(...t){this.interceptionKeySet.has("loop")&&this.interceptions.forEach(r=>{var n;(n=r.loop)==null||n.call(r,...t)})}error(t){if(this.interceptionKeySet.has("error")&&t instanceof Error){const r=t;this.interceptions.forEach(n=>{var i;(i=n.error)==null||i.call(n,r)})}}result(t){this.interceptionKeySet.has("result")&&this.interceptions.forEach(r=>{var n;(n=r.result)==null||n.call(r,t)})}done(){this.interceptionKeySet.has("done")&&this.interceptions.forEach(t=>{var r;(r=t.done)==null||r.call(t)})}}class te{constructor(){this.taps=[],this.interceptions=new kr}tap(t,r){const n=typeof t=="string"?{name:t,context:!1}:{context:!1,...t},o={key:Symbol(n.name),...n,callback:r};if(o.before){let s=this.taps.length;const l=new Set(Array.isArray(o.before)?o.before:[o.before]);for(s;s>0&&l.size>0;s--){const a=this.taps[s-1];if(l.has(a.name)&&l.delete(a.name),a.before&&Er(o.name,a.before))break}this.taps.splice(s,0,o)}else this.taps.push(o);return this.interceptions.tap(o),o}untap(t){this.taps=this.taps.filter(r=>r.key!==t.key)}isUsed(){return this.taps.length>0||this.interceptions.isUsed()}intercept(t){this.interceptions.intercept(t)}}class E extends te{call(...t){if(!this.isUsed())return;const r={};this.interceptions.call(r,...t);try{this.taps.forEach(n=>{ee(n,t,r)})}catch(n){throw this.interceptions.error(n),n}this.interceptions.done()}}class J extends te{call(...t){if(!this.isUsed())return;const r={};this.interceptions.call(r,...t);for(let n=0;nee(n,t,r))),this.interceptions.done()}}class Cs extends te{async call(...t){const r={};this.interceptions.call(r,...t);try{for(let n=0;n=0)&&(r[i]=e[i]);return r}function Or(e,t){if(e==null)return{};var r=kr(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ar(e,t){return Cr(e)||Tr(e,t)||Pr(e,t)||Vr()}function Cr(e){if(Array.isArray(e))return e}function Tr(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(a){i=!0,o=a}finally{try{!n&&s.return!=null&&s.return()}finally{if(i)throw o}}return r}}function Pr(e,t){if(e){if(typeof e=="string")return et(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return et(e,t)}}function et(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?e.apply(this,i):function(){for(var s=arguments.length,l=new Array(s),a=0;a1&&arguments[1]!==void 0?arguments[1]:{};ue.initial(e),ue.handler(t);var r={current:e},n=se(zr)(r,t),i=se(Lr)(r),o=se(ue.changes)(e),s=se(Ur)(r);function l(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return ue.selector(c),c(r.current)}function a(c){Rr(n,i,o,s)(c)}return[l,a]}function Ur(e,t){return ae(t)?t(e.current):t}function Lr(e,t){return e.current=rt(rt({},e.current),t),t}function zr(e,t,r){return ae(t)?t(e.current):Object.keys(r).forEach(function(n){var i;return(i=t[n])===null||i===void 0?void 0:i.call(t,e.current[n])}),r}var Hr={create:Fr},qr={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function Kr(e){return function t(){for(var r=this,n=arguments.length,i=new Array(n),o=0;o=e.length?e.apply(this,i):function(){for(var s=arguments.length,l=new Array(s),a=0;a{n.current=!1}:e,t)}var F=wn;function oe(){}function Y(e,t,r,n){return mn(e,n)||bn(e,t,r,n)}function mn(e,t){return e.editor.getModel(Nt(e,t))}function bn(e,t,r,n){return e.editor.createModel(t,r,n?Nt(e,n):void 0)}function Nt(e,t){return e.Uri.parse(t)}function Sn({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:a=!1,theme:c="light",loading:d="Loading...",options:h={},height:v="100%",width:p="100%",className:y,wrapperProps:g={},beforeMount:w=oe,onMount:b=oe}){let[k,x]=A.useState(!1),[I,C]=A.useState(!0),P=A.useRef(null),M=A.useRef(null),B=A.useRef(null),u=A.useRef(b),f=A.useRef(w),m=A.useRef(!1);xt(()=>{let T=Mt.init();return T.then(V=>(M.current=V)&&C(!1)).catch(V=>V?.type!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>P.current?N():T.cancel()}),F(()=>{if(P.current&&M.current){let T=P.current.getOriginalEditor(),V=Y(M.current,e||"",n||r||"text",o||"");V!==T.getModel()&&T.setModel(V)}},[o],k),F(()=>{if(P.current&&M.current){let T=P.current.getModifiedEditor(),V=Y(M.current,t||"",i||r||"text",s||"");V!==T.getModel()&&T.setModel(V)}},[s],k),F(()=>{let T=P.current.getModifiedEditor();T.getOption(M.current.editor.EditorOption.readOnly)?T.setValue(t||""):t!==T.getValue()&&(T.executeEdits("",[{range:T.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),T.pushUndoStop())},[t],k),F(()=>{P.current?.getModel()?.original.setValue(e||"")},[e],k),F(()=>{let{original:T,modified:V}=P.current.getModel();M.current.editor.setModelLanguage(T,n||r||"text"),M.current.editor.setModelLanguage(V,i||r||"text")},[r,n,i],k),F(()=>{M.current?.editor.setTheme(c)},[c],k),F(()=>{P.current?.updateOptions(h)},[h],k);let S=A.useCallback(()=>{if(!M.current)return;f.current(M.current);let T=Y(M.current,e||"",n||r||"text",o||""),V=Y(M.current,t||"",i||r||"text",s||"");P.current?.setModel({original:T,modified:V})},[r,t,i,e,n,o,s]),O=A.useCallback(()=>{!m.current&&B.current&&(P.current=M.current.editor.createDiffEditor(B.current,{automaticLayout:!0,...h}),S(),M.current?.editor.setTheme(c),x(!0),m.current=!0)},[h,c,S]);A.useEffect(()=>{k&&u.current(P.current,M.current)},[k]),A.useEffect(()=>{!I&&!k&&O()},[I,k,O]);function N(){let T=P.current?.getModel();l||T?.original?.dispose(),a||T?.modified?.dispose(),P.current?.dispose()}return X.createElement(Rt,{width:p,height:v,isEditorReady:k,loading:d,_ref:B,className:y,wrapperProps:g})}var En=Sn;A.memo(En);function kn(e){let t=A.useRef();return A.useEffect(()=>{t.current=e},[e]),t.current}var On=kn,he=new Map;function An({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:i,path:o,theme:s="light",line:l,loading:a="Loading...",options:c={},overrideServices:d={},saveViewState:h=!0,keepCurrentModel:v=!1,width:p="100%",height:y="100%",className:g,wrapperProps:w={},beforeMount:b=oe,onMount:k=oe,onChange:x,onValidate:I=oe}){let[C,P]=A.useState(!1),[M,B]=A.useState(!0),u=A.useRef(null),f=A.useRef(null),m=A.useRef(null),S=A.useRef(k),O=A.useRef(b),N=A.useRef(),T=A.useRef(n),V=On(o),Ye=A.useRef(!1),Oe=A.useRef(!1);xt(()=>{let $=Mt.init();return $.then(H=>(u.current=H)&&B(!1)).catch(H=>H?.type!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>f.current?br():$.cancel()}),F(()=>{let $=Y(u.current,e||n||"",t||i||"",o||r||"");$!==f.current?.getModel()&&(h&&he.set(V,f.current?.saveViewState()),f.current?.setModel($),h&&f.current?.restoreViewState(he.get(o)))},[o],C),F(()=>{f.current?.updateOptions(c)},[c],C),F(()=>{!f.current||n===void 0||(f.current.getOption(u.current.editor.EditorOption.readOnly)?f.current.setValue(n):n!==f.current.getValue()&&(Oe.current=!0,f.current.executeEdits("",[{range:f.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),f.current.pushUndoStop(),Oe.current=!1))},[n],C),F(()=>{let $=f.current?.getModel();$&&i&&u.current?.editor.setModelLanguage($,i)},[i],C),F(()=>{l!==void 0&&f.current?.revealLine(l)},[l],C),F(()=>{u.current?.editor.setTheme(s)},[s],C);let Xe=A.useCallback(()=>{if(!(!m.current||!u.current)&&!Ye.current){O.current(u.current);let $=o||r,H=Y(u.current,n||e||"",t||i||"",$||"");f.current=u.current?.editor.create(m.current,{model:H,automaticLayout:!0,...c},d),h&&f.current.restoreViewState(he.get($)),u.current.editor.setTheme(s),l!==void 0&&f.current.revealLine(l),P(!0),Ye.current=!0}},[e,t,r,n,i,o,c,d,h,s,l]);A.useEffect(()=>{C&&S.current(f.current,u.current)},[C]),A.useEffect(()=>{!M&&!C&&Xe()},[M,C,Xe]),T.current=n,A.useEffect(()=>{C&&x&&(N.current?.dispose(),N.current=f.current?.onDidChangeModelContent($=>{Oe.current||x(f.current.getValue(),$)}))},[C,x]),A.useEffect(()=>{if(C){let $=u.current.editor.onDidChangeMarkers(H=>{let Ae=f.current.getModel()?.uri;if(Ae&&H.find(Ce=>Ce.path===Ae.path)){let Ce=u.current.editor.getModelMarkers({resource:Ae});I?.(Ce)}});return()=>{$?.dispose()}}return()=>{}},[C,I]);function br(){N.current?.dispose(),v?h&&he.set(o,f.current.saveViewState()):f.current.getModel()?.dispose(),f.current.dispose()}return X.createElement(Rt,{width:p,height:y,isEditorReady:C,loading:a,_ref:m,className:g,wrapperProps:w})}var Cn=An,As=A.memo(Cn);function Tn(e,t){return Array.isArray(t)?t.includes(e):t===e}function ee(e,t,r){return e.context?e.callback(r,...t):e.callback(...t)}class Pn{constructor(){this.interceptions=[],this.interceptionKeySet=new Set}isUsed(){return this.interceptions.length>0}intercept(t){this.interceptions.push(t),Object.keys(t).forEach(r=>{this.interceptionKeySet.add(r)})}tap(t){this.interceptionKeySet.has("tap")&&this.interceptions.forEach(r=>{var n;(n=r.tap)==null||n.call(r,t)})}call(t,...r){this.interceptionKeySet.has("call")&&this.interceptions.forEach(n=>{var i,o;n.context?(i=n.call)==null||i.call(n,t,...r):(o=n.call)==null||o.call(n,...r)})}loop(...t){this.interceptionKeySet.has("loop")&&this.interceptions.forEach(r=>{var n;(n=r.loop)==null||n.call(r,...t)})}error(t){if(this.interceptionKeySet.has("error")&&t instanceof Error){const r=t;this.interceptions.forEach(n=>{var i;(i=n.error)==null||i.call(n,r)})}}result(t){this.interceptionKeySet.has("result")&&this.interceptions.forEach(r=>{var n;(n=r.result)==null||n.call(r,t)})}done(){this.interceptionKeySet.has("done")&&this.interceptions.forEach(t=>{var r;(r=t.done)==null||r.call(t)})}}class te{constructor(){this.taps=[],this.interceptions=new Pn}tap(t,r){const n=typeof t=="string"?{name:t,context:!1}:{context:!1,...t},o={key:Symbol(n.name),...n,callback:r};if(o.before){let s=this.taps.length;const l=new Set(Array.isArray(o.before)?o.before:[o.before]);for(s;s>0&&l.size>0;s--){const a=this.taps[s-1];if(l.has(a.name)&&l.delete(a.name),a.before&&Tn(o.name,a.before))break}this.taps.splice(s,0,o)}else this.taps.push(o);return this.interceptions.tap(o),o}untap(t){this.taps=this.taps.filter(r=>r.key!==t.key)}isUsed(){return this.taps.length>0||this.interceptions.isUsed()}intercept(t){this.interceptions.intercept(t)}}class E extends te{call(...t){if(!this.isUsed())return;const r={};this.interceptions.call(r,...t);try{this.taps.forEach(n=>{ee(n,t,r)})}catch(n){throw this.interceptions.error(n),n}this.interceptions.done()}}class J extends te{call(...t){if(!this.isUsed())return;const r={};this.interceptions.call(r,...t);for(let n=0;nee(n,t,r))),this.interceptions.done()}}class Ts extends te{async call(...t){const r={};this.interceptions.call(r,...t);try{for(let n=0;n{throw new this(t,...r)}}}var Z=ae.NestedError=K;K.getErrorReport=typeof new Error().stack=="string"?e=>e.stack:e=>`${e.name}: ${e.message}`;K.prototype.name="NestedError";function $e(e){try{return e instanceof Error?e:new Error(`Value that is not an instance of Error was thrown: ${e}`)}catch{return new Error("Failed to stringify non-instance of Error that was thrown.This is possibly due to the fact that toString() method of the valuedoesn't return a primitive value.")}}ae.toError=$e;function Ke(e,t,r,n,i){for(t=t.split?t.split("."):t,n=0;n{throw new this(t,...r)}}}var Z=le.NestedError=K;K.getErrorReport=typeof new Error().stack=="string"?e=>e.stack:e=>`${e.name}: ${e.message}`;K.prototype.name="NestedError";function $e(e){try{return e instanceof Error?e:new Error(`Value that is not an instance of Error was thrown: ${e}`)}catch{return new Error("Failed to stringify non-instance of Error that was thrown.This is possibly due to the fact that toString() method of the valuedoesn't return a primitive value.")}}le.toError=$e;function Ke(e,t,r,n,i){for(t=t.split?t.split("."):t,n=0;n=e.length||t<0?e:e.slice(0,t).concat(e.slice(t+1))}function _t(e,t,r){if(e[t]===r)return e;const n=e.length,i=Array(n);for(let o=0;o=0||(i[l]=e[l])}return i}function zt(e,t,r,n,i,o,...s){return s.length?z.call(null,!0,!1,e,t,r,n,i,o,...s):z(!0,!1,e,t,r,n,i,o)}function z(e,t,r,...n){let i=r;i==null&&Pt(Tt);let o=!1;for(let s=0;s{const e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e};var xr=Rr;const Ht=qe(xr);/*! queue-microtask. MIT License. Feross Aboukhadijeh */let et;var Nr=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:Sr):e=>(et||(et=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0));const Dr=qe(Nr);var qt={exports:{}};(function(e){var t=function(){var r=n({constructor:function(o,s){this.array=[],this.compare=s||i;for(var l=o.length,a=0;a=c;)if(h=(a+c)/2>>>0,v=l(s[h],o),v<0)c=h+1;else if(v>0)a=h-1;else{d=h;break}for(d===-1&&(d=a),d++,a=s.length-1;dd;)s[h]=s[--h];return s[d]=o,this},search:function(o){for(var s=this.array,l=this.compare,a=s.length-1,c=0,d,h;a>=c;)if(d=(a+c)/2>>>0,h=l(s[d],o),h<0)c=d+1;else if(h>0)a=d-1;else return d;return-1},remove:function(o){var s=this.search(o);return s>=0&&this.array.splice(s,1),this}});return r.comparing=function(o,s){return new r(s,function(l,a){return i(l[o],a[o])})},r;function n(o){var s=o.constructor;return s.prototype=o,s}function i(o,s){return os?1:0}}();e.exports=t})(qt);var _r=qt.exports;const Br=qe(_r);function Kt(e,t=[],r=new Map){for(const n of Object.keys(e)){const i=e[n],o=[...t,n];typeof i=="object"?Kt(i,o,r):r.set(o,i)}return r}function Ir(e){const t=Kt(e),r=n=>{for(const i of Array.from(t)){const[o,s]=i;if(Ke(n,o)!==s)return!1}return!0};return r.count=t.size,r}function jr(e){const t=r=>e===r;return t.count=1,t}var tt=()=>new Br([],e=>e.matcher.count),$r=class{constructor(e){this.store=tt(),e?.forEach(([t,r])=>{this.set(t,r)})}set(e,t){const r=typeof e=="object"?Ir(e):jr(e);this.store.insert({key:e,value:t,matcher:r})}get(e){for(const t of this.store.array)if(t.matcher(e))return t.value}forEach(e){for(const t of this.store.array)e(t)}clear(){this.store=tt()}isRegistryEmpty(){return this.store.array.length===0}},Fr=Object.defineProperty,Ur=(e,t)=>{for(var r in t)Fr(e,r,{get:t[r],enumerable:!0})},rt=e=>({name:"Value",value:e}),Lr=e=>({name:"Expression",value:e}),zr=e=>({name:"PathNode",path:e}),Hr=(e,t)=>({name:"Query",key:e,value:t}),qr=e=>e.length===1?e[0]:{name:"Concatenated",value:e},Kr=".",Te="{",Pe="}",nt="[",Gr="]",it="=",ue="'",Ve='"',he="`",st=e=>{if(!e)return!1;const t=e.charCodeAt(0);return!(t===32||t===34||t===39||t===40||t===41||t===42||t===46||t===61||t===91||t===93||t===96||t===123||t===125)},Wr=e=>{let t=1,r=e.charAt(0);const n=w=>{if(w&&r!==w)throw new Error(`Expected char: ${w} but got: ${r}`);return r=e.charAt(t),t+=1,r},i=()=>{for(;r===" ";)n()},o=()=>{if(!st(r))return;let w=r;for(;n()&&st(r);)w+=r;if(w){const b=Number(w);return w=isNaN(b)?w:b,rt(w)}},s=()=>{if(r===he){n(he);let w=r;for(;n()&&r!==he;)w+=r;if(n(he),w)return Lr(w)}},l=w=>{if(!r?.match(w))return;let b=r;for(;n()&&r?.match(w);)b+=r;if(b)return rt(b)},a=()=>{if(r===Te){n(Te),n(Te);const w=g();return n(Pe),n(Pe),w}},c=()=>a()??s()??o(),d=()=>{const w=[];let b=c();for(;b!==void 0;)w.push(b),b=c();if(w.length!==0)return qr(w)},h=()=>{if(i(),r===ue||r===Ve){const w=r===ue;n(w?ue:Ve);const b=l(/[^'"]+/);return n(w?ue:Ve),b}return c()},v=()=>{if(r!==it)return!1;for(;r===it;)n();return!0},p=()=>{if(r===nt){n(nt),i();let w=h();if(w){if(i(),v()){i();const b=h();w=Hr(w,b),i()}}else throw new Error("Expected identifier");return w&&n(Gr),w}},y=()=>{const w=[],b=d();if(b){w.push(b);let k=p();if(k?.name==="Value"){const x=Number(k.value);k.value=isNaN(x)||String(x)!==k.value?k.value:x}for(;k!==void 0;)w.push(k),k=p()}return w},g=()=>{const w=[];let b=y();for(;b!==void 0&&(w.push(...b),!(!r||r===Pe));){if(b.length===0&&r)throw new Error(`Unexpected character: ${r}`);n(Kr),b=y()}return zr(w)};try{return{status:!0,path:g()}}catch(w){return{status:!1,error:w.message}}};function W(e){return!(typeof e=="string"||Array.isArray(e))}function Qr(e){const t=parseInt(e,10);return isNaN(t)?e:t}function Yr(e){return Array.isArray(e)?e:typeof e=="string"?e.split("."):e.asArray()}function Xr(e,t,r){return e.findIndex(n=>n&&typeof n=="object"?n[t]==r:!1)}var Q=class Gt{constructor(t,r=n=>new Gt(n)){const n=Array.isArray(t)?t:t.split(".");this.split=n.map(i=>{if(typeof i=="number")return i;const o=Number(i);return isNaN(o)?i:o}),Object.freeze(this.split),this.joined=this.split.join("."),this.factory=r}asArray(){return this.split}asString(){return this.joined}contains(t){const r=t.asArray();if(r.length-1?l.split(".").forEach(a=>{n.path.push(Qr(a))}):n.path.push(l)}function s(l){const a=r?.beforeResolveNode.call(l,{...n,...t})??l;switch(a.name){case"Expression":case"PathNode":o(i(a));break;case"Value":o(a.value);break;case"Query":{const c=t.getValue(n.path)??[],{key:d,value:h}=a,v=i(d),p=h&&i(h),y=Xr(c,v,p);y===void 0||y===-1?(n.updates[[...n.path,c.length,v].join(".")]=p,n.path.push(c.length)):n.path.push(y);break}case"Concatenated":n.path.push(a.value.map(i).join(""));break;default:throw new Error(`Unsupported node type: ${a.name}`)}}return e.path.forEach(s),{path:n.path,updates:Object.keys(n.updates??{}).length>0?n.updates:void 0}}var Jr=/[\s()*=`{}'"[\]]/,Zr=/^[^.]+(\..+)*$/,en={get:()=>{throw new Error("Not Implemented")},set:()=>{throw new Error("Not Implemented")},evaluate:()=>{throw new Error("Not Implemented")}},tn=class{constructor(e){this.hooks={skipOptimization:new J,beforeResolveNode:new R},this.parserOptions={...en,...e},this.cache={},this.parseCache={},this.parse=this.parse.bind(this)}normalizePath(e,t){if(!Jr.test(e)&&Zr.test(e)&&this.hooks.skipOptimization.call(e)!==!0)return{path:e.split("."),updates:void 0};const r=this.parseCache[e]??Wr(e);if(this.parseCache[e]=r,typeof r!="object"||!r?.status)throw new TypeError(`Cannot normalize path "${e}": ${r?.error??"Unknown Error."}`);try{return Wt(r.path,t,this.hooks)}catch(n){throw new Z(`Cannot resolve binding: ${e}`,n)}}getBindingForNormalizedResult(e){const t=e.path.join(".");if(this.cache[t])return this.cache[t];const r=new Q(t===""?[]:e.path,this.parse);return this.cache[t]=r,r}parse(e,t={}){if(W(e))return e;const r={...this.parserOptions,...t};let n={};const i=Array.isArray(e)?e.join("."):String(e),o={getValue:a=>{const c=this.normalizePath(a.join("."),o);return r.get(this.getBindingForNormalizedResult(c))},evaluate:a=>r.evaluate(a),convertToPath:a=>{if(a===void 0)throw new Error("Attempted to convert undefined value to binding path");if(typeof a!="string"&&typeof a!="number"&&typeof a!="boolean")throw new Error(`Attempting to convert ${typeof a} to a binding path.`);const c=this.normalizePath(String(a),o);c.updates&&(n={...n,...c.updates});const d=c.path.join(".");if(d==="")throw new Error("Nested path resolved to an empty path");return d}},s=this.normalizePath(i,o);s.updates&&(n={...n,...s.updates});const l=Object.keys(n);if(!r.readOnly&&l.length>0){const a=l.map(c=>[this.parse(c),n[c]]);r.set(a)}return this.getBindingForNormalizedResult(s)}},rn=class{constructor(){this.readDeps=new Set,this.writeDeps=new Set,this.namedDependencySets={},this.namedSet="core",this.createSubset("core"),this.createSubset("children")}createSubset(e,t=!1){(t||!this.namedDependencySets[e])&&(this.namedDependencySets[e]={readDeps:new Set,writeDeps:new Set})}getDependencies(e){return e!==void 0?this.namedDependencySets?.[e]?.readDeps??new Set:this.readDeps}trackSubset(e){this.createSubset(e),this.namedSet=e}trackDefault(){this.namedSet="core"}getModified(e){return e!==void 0?this.namedDependencySets?.[e]?.writeDeps??new Set:this.writeDeps}readsBinding(e){return this.readDeps.has(e)}writesBinding(e){return this.writeDeps.has(e)}reset(){this.readDeps=new Set,this.writeDeps=new Set,this.namedDependencySets={},this.namedSet="core",this.createSubset("core",!0),this.createSubset("children",!0)}addReadDep(e,t=this.namedSet){t&&this.namedDependencySets?.[t]?.readDeps.add(e),this.readDeps.add(e)}addWriteDep(e,t=this.namedSet){t&&this.namedDependencySets?.[t]?.writeDeps.add(e),this.writeDeps.add(e)}addChildReadDep(e){this.addReadDep(e,"children")}},nn=class extends rn{constructor(e){super(),this.rootModel=e,this.set=this.set.bind(this),this.get=this.get.bind(this)}set(e,t){return e.forEach(([r])=>this.addWriteDep(r)),this.rootModel.set(e,t)}get(e,t){return this.addReadDep(e),this.rootModel.get(e,t)}delete(e,t){return this.addWriteDep(e),this.rootModel.delete(e,t)}},sn=class{get(){}set(){return[]}delete(){}},ot=new sn,on=new Q([]);function an(e,t){function r(n,i){const o=W(n)?n:t(n,{get:e.get,set:e.set,readOnly:i});if(!o)throw new Error("Unable to parse binding");return o}return{get(n,i){return e.get(r(n,!0),i)},set(n,i){return e.set(n.map(([o,s])=>[r(o,!1),s]),i)},delete(n,i){return e.delete(r(n,!1),i)}}}function Fe(e,t,r){return r?{get:(n,i)=>{const o=i??t;return e.get?e.get(n,o,r):r?.get(n,o)},set:(n,i)=>{const o=i??t;return e.set?e.set(n,o,r):r?.set(n,o)},delete:(n,i)=>{const o=i??t;return e.delete?e.delete(n,o,r):r?.delete(n,o)}}:e}function Me(e){if(e.length===0)return ot;if(e.length===1)return Fe(e[0]);function t(r){return e.reduce((i,o)=>Fe(o,r,i),void 0)??ot}return{get:(r,n)=>t(n)?.get(r,n),set:(r,n)=>t(n)?.set(r,n),delete:(r,n)=>t(n)?.delete(r,n)}}var ln=class{constructor(e=[]){this.hooks={onSet:new E},this.pipeline=e,this.effectiveDataModel=Me(this.pipeline)}setMiddleware(e){this.pipeline=e,this.effectiveDataModel=Me(e)}addMiddleware(e){this.pipeline=[...this.pipeline,e],this.effectiveDataModel=Me(this.pipeline)}reset(e={}){this.pipeline.forEach(t=>{"reset"in t&&t.reset?.()}),this.set([[on,e]])}set(e,t){const r=this.effectiveDataModel.set(e,t);return this.hooks.onSet.call(e),r}get(e,t){return this.effectiveDataModel.get(e,t)}delete(e,t){return this.effectiveDataModel.delete(e,t)}},Ue=class{constructor(e={}){this.model=e,this.get=this.get.bind(this),this.set=this.set.bind(this)}reset(e={}){this.model=e}get(e){return!e||!e.asString()?this.model:Ke(this.model,e.asArray())}set(e){const t=[];return e.forEach(([r,n])=>{const i=this.get(r);this.model=U(this.model,r.asArray(),n),t.push({binding:r,oldValue:i,newValue:n})}),t}delete(e){const t=e.parent();if(t){const r=this.get(t);r!==void 0&&(Array.isArray(r)?this.model=U(this.model,t.asArray(),Cr(r,e.key())):this.model=U(this.model,t.asArray(),Ct(r,e.key())))}}},j=Symbol("Expression Node ID");function Qt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.__id===j}var re=46,Re=44,at=39,lt=34,de=40,ct=41,xe=91,ut=93,cn=63,un=59,ht=58,ye=123,Ne=125,fe=!0,Yt={"-":fe,"!":fe,"~":fe,"+":fe},We={"=":3,"+=":3,"-=":3,"&=":3,"|=":3,"||":5,"&&":6,"|":7,"^":8,"&":9,"==":10,"!=":10,"===":10,"!==":10,"<":11,">":11,"<=":11,">=":11,"<<":12,">>":12,">>>":12,"+":13,"-":13,"*":14,"/":14,"%":14};function D(e,t){const r=new Error(`${e} at character ${t}`);throw r.index=t,r.description=e,r}function dt(e,t){if(!(!e||!t))return{start:e.start,end:t.end}}function Xt(e){let t=0;return Object.keys(e).forEach(r=>{r.length>t&&Object.prototype.hasOwnProperty.call(e,r)&&(t=r.length)}),t}var hn=Xt(Yt),dn=Xt(We),ft={true:!0,false:!1,null:null,undefined:void 0},fn="this";function pt(e){return We[e]||0}function gt(e,t,r,n){let i;return e==="||"||e==="&&"?i="LogicalExpression":e==="="?i="Assignment":e==="+="||e==="-="||e==="&="||e==="|="?i="Modification":i="BinaryExpression",{__id:j,type:i,operator:e,left:t,right:r,location:n}}function ne(e){return e>=48&&e<=57}function De(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122}function pn(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function gn(e,t){return e===ye&&t===ye}function vn(e,t){const r=t?.strict??!0,n=e.charAt,i=e.charCodeAt,{length:o}=e;let s=0;const l=u=>({start:{character:u},end:{character:s}});function a(u){return n.call(e,u)}function c(u){return i.call(e,u)}function d(){const u=[];let f=!1,m=!0,S,O,N;const T=s;for(++s;s0;){if(Object.prototype.hasOwnProperty.call(We,u))return s+=f,u;u=u.substr(0,--f)}return!1}function y(){let u,f,m,S=g(),O=p();if(!O)return S;let N={value:O,prec:pt(O)},T=g();T||D(`Expected expression after ${O}`,s);const V=[S,N,T];for(O=p();O&&(f=pt(O),f!==0);){for(N={value:O,prec:f};V.length>2&&f<=V[V.length-2].prec;)T=V.pop(),O=V.pop().value,S=V.pop(),u=gt(O,S,T,dt(S.location,T.location)),V.push(u);u=g(),u||D(`Expected expression after ${O}`,s),V.push(N,u),O=p()}for(m=V.length-1,u=V[m];m>1;)u=gt(V[m-1].value,V[m-2],u,dt(V[m-2].location,u.location)),m-=2;return u}function g(){h();const u=c(s),f=s;if(ne(u)||u===re)return w();if(u===at||u===lt)return b();if(De(u)||u===de)return C();if(u===xe)return M();if(gn(u,c(s+1)))return k();if(u===ye)return d();let m=e.substr(s,hn),S=m.length;for(;S>0;){if(Object.prototype.hasOwnProperty.call(Yt,m))return s+=S,{__id:j,type:"UnaryExpression",operator:m,argument:g(),prefix:!0,location:l(f)};m=m.substr(0,--S)}return!1}function w(){let u="";const f=s;for(;ne(c(s));)u+=a(s++);if(c(s)===re)for(u+=a(s++);ne(c(s));)u+=a(s++);let m=a(s);if(m==="e"||m==="E"){for(u+=a(s++),m=a(s),(m==="+"||m==="-")&&(u+=a(s++));ne(c(s));)u+=a(s++);ne(c(s-1))||D(`Expected exponent (${u}${a(s)})`,s)}const S=c(s);return De(S)?D(`Variable names cannot start with a number (${u}${a(s)})`,s):S===re&&D("Unexpected period",s),{__id:j,type:"Literal",value:parseFloat(u),raw:u,location:l(f)}}function b(){const u=a(s++);let f="",m=!1;const S=s;for(;sZt,deleteDataVal:()=>mn,getDataVal:()=>wn,setDataVal:()=>yn});var yn=(e,t,r)=>{e.model.set([[t,r]])},wn=(e,t)=>e.model.get(t),mn=(e,t)=>e.model.delete(t),Zt=(e,t,r,n)=>e.evaluate(t)?e.evaluate(r):n?e.evaluate(n):null;Zt.resolveParams=!1;function bn(e){return Qt(e)?!1:typeof e=="object"&&e!==null&&!Array.isArray(e)&&"value"in e}var er=(e,t,r)=>e.evaluate(t)&&e.evaluate(r);er.resolveParams=!1;var tr=(e,t,r)=>e.evaluate(t)||e.evaluate(r);tr.resolveParams=!1;var Sn={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>ee<=t,"&&":er,"||":tr,"!==":(e,t)=>e!==t,"===":(e,t)=>e===t,"|":(e,t)=>e|t,"&":(e,t)=>e&t,"+=":(e,t)=>e+t,"-=":(e,t)=>e-t,"&=":(e,t)=>e&t,"|=":(e,t)=>e|t},En={"-":e=>-e,"+":e=>Number(e),"!":e=>!e},kn=class{constructor(e){this.vars={},this.hooks={resolve:new R,resolveOptions:new R,beforeEvaluate:new R,onError:new J},this.expressionsCache=new Map,this.operators={binary:new Map(Object.entries(Sn)),unary:new Map(Object.entries(En)),expressions:new Map(Object.entries(Jt))},this.defaultHookOptions={...e,evaluate:t=>this.evaluate(t,this.defaultHookOptions),resolveNode:t=>this._execAST(t,this.defaultHookOptions)},this.hooks.resolve.tap("ExpressionEvaluator",this._resolveNode.bind(this)),this.evaluate=this.evaluate.bind(this)}reset(){this.expressionsCache.clear()}evaluate(e,t){const r=this.hooks.resolveOptions.call({...this.defaultHookOptions,...t,resolveNode:i=>this._execAST(i,r)});let n=this.hooks.beforeEvaluate.call(e,r)??e;for(;bn(n);)n=n.value;return typeof n=="number"||typeof n=="boolean"||n===void 0||n===null?n:Qt(n)?this._execAST(n,r):Array.isArray(n)?n.reduce((i,o)=>this.evaluate(o,t),null):this._execString(String(n),r)}addExpressionFunction(e,t){this.operators.expressions.set(e,t)}addBinaryOperator(e,t){this.operators.binary.set(e,t)}addUnaryOperator(e,t){this.operators.unary.set(e,t)}setExpressionVariable(e,t){this.vars[e]=t}getExpressionVariable(e){return this.vars[e]}_execAST(e,t){return this.hooks.resolve.call(void 0,e,t)}_execString(e,t){if(e==="")return e;const r=e.match(/^@\[(.*)\]@$/);let n=e;r&&([,n]=Array.from(r));let i;try{i=this.expressionsCache.get(n)??vn(n,{strict:t.strict}),this.expressionsCache.set(n,i)}catch(o){if(t.throwErrors||!this.hooks.onError.call(o))throw new Z(`Error parsing expression: ${e}`,o);return}try{return this._execAST(i,t)}catch(o){if(t.throwErrors||!this.hooks.onError.call(o))throw new Z(`Error evaluating expression: ${e}`,o)}}_resolveNode(e,t,r){const{resolveNode:n,model:i}=r,o={...r,evaluate:s=>this.evaluate(s,r)};if(t.type==="Literal")return t.value;if(t.type==="Identifier")return this.vars[t.name];if(t.type==="Compound"||t.type==="ThisExpression")throw new Error(`Expression type: ${t.type} is not supported`);if(t.type==="BinaryExpression"||t.type==="LogicalExpression"){const s=this.operators.binary.get(t.operator);return s?"resolveParams"in s?s.resolveParams===!1?s(o,t.left,t.right):s(o,n(t.left),n(t.right)):s(n(t.left),n(t.right)):void 0}if(t.type==="UnaryExpression"){const s=this.operators.unary.get(t.operator);return s?"resolveParams"in s?s(o,s.resolveParams===!1?t.argument:n(t.argument)):s(n(t.argument)):void 0}if(t.type==="Object"){const{attributes:s}=t,l={};return s.forEach(a=>{const c=n(a.key),d=n(a.value);l[c]=d}),l}if(t.type==="CallExpression"){const s=t.callTarget.name,l=this.operators.expressions.get(s);if(!l)throw new Error(`Unknown expression function: ${s}`);if("resolveParams"in l&&l.resolveParams===!1)return l(o,...t.args);const a=t.args.map(c=>n(c));return l(o,...a)}if(t.type==="ModelRef")return i.get(t.ref,{context:{model:r.model}});if(t.type==="MemberExpression"){const s=n(t.object),l=n(t.property);return s[l]}if(t.type==="Assignment"){if(t.left.type==="ModelRef"){const s=n(t.right);return i.set([[t.left.ref,s]]),s}if(t.left.type==="Identifier"){const s=n(t.right);return this.vars[t.left.name]=s,s}return}if(t.type==="ConditionalExpression"){const s=n(t.test)?t.consequent:t.alternate;return n(s)}if(t.type==="ArrayExpression")return t.elements.map(s=>n(s));if(t.type==="Modification"){const s=this.operators.binary.get(t.operator);if(s){let l;return"resolveParams"in s?s.resolveParams===!1?l=s(o,t.left,t.right):l=s(o,n(t.left),n(t.right)):l=s(n(t.left),n(t.right)),t.left.type==="ModelRef"?i.set([[t.left.ref,l]]):t.left.type==="Identifier"&&(this.vars[t.left.name]=l),l}return n(t.left)}}},On=class{constructor(){this.hooks={trace:new E,debug:new E,info:new E,warn:new E,error:new E,log:new E},this.logHandlers=new Set,this.trace=this.createHandler("trace"),this.debug=this.createHandler("debug"),this.info=this.createHandler("info"),this.warn=this.createHandler("warn"),this.error=this.createHandler("error")}createHandler(e){return(...t)=>{this.hooks[e].call(t),this.hooks.log.call(e,t),this.logHandlers.forEach(r=>r[e](...t))}}addHandler(e){this.logHandlers.add(e)}removeHandler(e){this.logHandlers.delete(e)}},An=class{constructor(e){this.trace=this.createHandler("trace"),this.debug=this.createHandler("debug"),this.info=this.createHandler("info"),this.warn=this.createHandler("warn"),this.error=this.createHandler("error"),this.proxiedLoggerProvider=e}createHandler(e){return(...t)=>{this.proxiedLoggerProvider()?.[e](...t)}}},vt=e=>e;function Cn(e){const t=new Map;if(!e.ROOT)return t;const r=[{node:e.ROOT,path:[],visited:new Set}];for(;r.length>0;){const n=r.shift();if(!n)break;const{node:i,path:o,visited:s}=n;Object.entries(i).forEach(([l,a])=>{const c=[...o,l],d=c.join(".");if(t.has(d))throw new Error("Path has already been processed. There's either a loop somewhere or a bug");if(s.has(a.type))throw new Error(`Path already contained type: ${a.type}. This likely indicates a loop in the schema`);t.set(d,a),a.isArray&&c.push("[]"),a.isRecord&&c.push("{}"),a.type&&e[a.type]&&r.push({path:c,node:e[a.type],visited:new Set([...s,a.type])})})}return t}var Tn=class{constructor(e){this.formatters=new Map,this.types=new Map,this.schema=new Map,this.bindingSchemaNormalizedCache=new Map,this.hooks={resolveTypeForBinding:new R},this.schema=e?Cn(e):new Map}addFormatters(e){e.forEach(t=>{this.formatters.set(t.name,t)})}addDataTypes(e){e.forEach(t=>{this.types.set(t.type,t)})}getValidationsForBinding(e){const t=this.getApparentType(e);if(t?.validation?.length)return t.validation.map(r=>({severity:"error",trigger:"change",...r}))}normalizeBinding(e){const t=this.bindingSchemaNormalizedCache.get(e);if(t)return t;let r=e.asArray(),n=r.map(i=>typeof i=="number"?"[]":i).join(".");return n&&(this.bindingSchemaNormalizedCache.set(e,n),r=n.split(".")),r.forEach(i=>{const o=r.map(s=>s===i?"{}":s).join(".");this.schema.get(o)&&(this.bindingSchemaNormalizedCache.set(e,o),r=o.split("."),n=o)}),n}getType(e){return this.hooks.resolveTypeForBinding.call(this.schema.get(this.normalizeBinding(e)),e)}getApparentType(e){const t=this.getType(e);if(t===void 0)return;const r=this.getTypeDefinition(t?.type);return r===void 0?t:{...r,...t,validation:[...t.validation??[],...r.validation??[]]}}getTypeDefinition(e){return this.types.get(e)}getFormatterForType(e){const{type:t,...r}=e,n=this.formatters.get(t);if(n)return{format:n.format?i=>n.format?.(i,r):vt,deformat:n.deformat?i=>n.deformat?.(i,r):vt}}getFormatter(e){const t=this.getApparentType(e);if(t?.format)return this.getFormatterForType(t.format)}},L="{{",_e="}}";function Pn(e){const t=e.indexOf(L);if(t===-1)return;let r=1,n=t+L.length,i=e.substring(t+L.length);for(;r>0&&i.length>0;){const o=i.indexOf(_e);if(o===-1)break;const s=i.indexOf(L);s!==-1&&s0&&r.forEach(i=>{n=U(n,[i],nr(e[i],t))}),n}default:return e}}function Qe(e,t){return nr(e,t)}function ir(e,t){const r=new Map(e),n=t.parent(),i=t.key();return r.forEach((o,s)=>{(t===s||t.contains(s))&&r.delete(s)}),typeof i=="number"&&Array.from(e.keys()).filter(s=>{if(n.contains(s)){const[l]=s.relative(n);return typeof l=="number"&&l>i}return!1}).sort().forEach(s=>{const[l,...a]=s.relative(n);if(typeof l=="number"){const c=[l-1,...a],d=n.descendent(c);r.set(d,r.get(s)),r.delete(s)}}),r}var Mn=class{constructor(e,t){this.validator=e,this.shadowModelPaths=new Map,this.logger=t?.logger,this.shouldIncludeInvalid=t?.shouldIncludeInvalid}set(e,t,r){const n=Fe(this,{...t,includeInvalid:!0},r),i=[],o=new Set;e.forEach(([c,d])=>{this.shadowModelPaths.set(c,d),o.add(c)});const s=[];this.shadowModelPaths.forEach((c,d)=>{const h=this.validator(d,n);h===void 0?i.push([d,c]):h instanceof Set?h.forEach(v=>{s.push(v.binding),!v.isStrong&&v.binding.asString()===d.asString()&&i.push([v.binding,c])}):o.has(d)&&(s.push(d),this.logger?.debug(`Invalid value for path: ${d.asString()} - ${h.severity} - ${h.message}`))});let l=[];if(r&&i.length>0){i.forEach(([d])=>this.shadowModelPaths.delete(d));const c=r.set(i,t);if(s.length===0)return c;l=c}const a=s.map(c=>({binding:c,oldValue:n.get(c),newValue:n.get(c),force:!0}));return[...l,...a]}get(e,t,r){let n=r?.get(e,t);return(this.shouldIncludeInvalid?.(t)??t?.includeInvalid===!0)&&this.shadowModelPaths.forEach((i,o)=>{if(o===e){n=i;return}e.contains(o)&&(n=U(n,o.relative(e),i))}),n}delete(e,t,r){return this.shadowModelPaths=ir(this.shadowModelPaths,e),r?.delete(e,t)}},Rn=class{constructor(){this.registry=new Map}get(e){return this.registry.get(e)}register(e,t){this.registry.set(e,t)}};function xn(e,t){return Object.hasOwnProperty.call(e,"template")&&Array.isArray(e?.template)&&e.template.length&&e.template.find(r=>r.output===t)}function yt(e){return e==="staticSwitch"||e==="dynamicSwitch"}function sr(e){return e==="template"}function Nn(e){if(e&&"value"in e&&typeof e.value=="object"&&typeof e.value?.id=="string")return e.value.id}var Dn={type:"empty"},_n=class{constructor(){this.hooks={onParseObject:new R,onCreateASTNode:new R,parseNode:new J}}parseView(e){const t=this.parseObject(e,"view");if(!t)throw new Error("Unable to parse object into a view");return t}createASTNode(e,t){const r=this.hooks.onCreateASTNode.call(e,t);return r===void 0?e:r}parseObject(e,t="value",r={templateDepth:0}){const n=this.hooks.parseNode.call(e,t,r);if(n||n===null)return n;const i=(a,c,d=[])=>{if(typeof c!="object"||c===null)return{value:c,children:[]};const h=this.hooks.onParseObject.call(c,t);if(!h)return a;const v=Array.isArray(h)?h.map((g,w)=>[w,g]):[...Object.entries(h),...Object.getOwnPropertySymbols(h).map(g=>[g,h[g]])],p={children:[],value:a};return v.reduce((g,w)=>{let{value:b}=g;const{children:k}=g,[x,I]=w,C=this.hooks.parseNode.call(I,"value",r,{path:d,key:x,parentObj:h});if(C)k.push(...C);else if(I&&typeof I=="object"){const P=i(g.value,I,[...d,x]);b=P.value,k.push(...P.children)}else b=U(g.value,[...d,x],I);return{value:b,children:k}},p)},{value:o,children:s}=i(void 0,e),l=o===void 0&&!s.length?void 0:{type:t,value:o};if(l&&s.length){const a=l;a.children=s,s.forEach(c=>{c.value.parent=a})}return this.hooks.onCreateASTNode.call(l,e)??null}};function Le(e,t){if(!e||!t)return!0;const r=Array.from(t.values()),n=Array.from(e.values());return r.find(i=>!!n.find(o=>o===i||o.contains(i)||i.contains(o)))!==void 0}function or(e){return{...e,data:{model:e.model,formatValue:(t,r)=>e.formatValue?e.formatValue(t,r):r,format:(t,r)=>e.format?e.format(W(t)?t:e.parseBinding(t),r):r},evaluate:t=>e.evaluator.evaluate(t,e)}}var Bn=e=>({get:(t,r)=>e.get(t,{context:{model:e},...r}),set:(t,r)=>e.set(t,{context:{model:e},...r}),delete:(t,r)=>e.delete(t,{context:{model:e},...r})}),In=class{constructor(e,t){this.hooks={skipResolve:new R,beforeUpdate:new E,afterUpdate:new E,resolveOptions:new R,beforeResolve:new R,resolve:new R,afterResolve:new R,afterNodeUpdate:new E},this.root=e,this.options=t,this.resolveCache=new Map,this.ASTMap=new Map,this.logger=t.logger,this.idCache=new Set}getSourceNode(e){return this.ASTMap.get(e)}update(e){this.hooks.beforeUpdate.call(e);const t=new Map;this.idCache.clear();const r=new Map(this.ASTMap);this.ASTMap.clear();const n=this.computeTree(this.root,void 0,e,t,or(this.options),void 0,r);return this.resolveCache=t,this.hooks.afterUpdate.call(n.value),n.value}getResolveCache(){return new Map(this.resolveCache)}getPreviousResult(e){if(!e)return;const t=this.resolveCache.size===0,r=Nn(e);if(r){if(this.idCache.has(r)){t&&(e.type==="asset"||e.type==="view"?this.logger?.error(`Cache conflict: Found Asset/View nodes that have conflicting ids: ${r}, may cause cache issues.`):e.type==="value"&&this.logger?.info(`Cache conflict: Found Value nodes that have conflicting ids: ${r}, may cause cache issues. To improve performance make value node IDs globally unique.`));return}this.idCache.add(r)}return this.resolveCache.get(e)}cloneNode(e){const t=Or(e);return Object.keys(t).forEach(r=>{if(r==="parent")return;const n=t[r];typeof n=="object"&&n!==null&&(t[r]=Array.isArray(n)?[...n]:{...n})}),t}computeTree(e,t,r,n,i,o,s){const l=new nn(i.data.model);l.trackSubset("core");const a=Bn(an(l,this.options.parseBinding)),c=this.hooks.resolveOptions.call({...i,data:{...i.data,model:a},evaluate:C=>this.options.evaluator.evaluate(C,{model:a}),node:e},e),d=this.getPreviousResult(e),h=d?.dependencies,v=Le(r,h),p=this.hooks.skipResolve.call(!v,e,c),y={...this.cloneNode(e),parent:o},g=this.hooks.beforeResolve.call(y,c)??{type:"empty"},w=g.type==="multi-node"&&o?.parent?.type==="multi-node"&&o.type==="value";if(d&&p){const C={...d,updated:!1},P=(M,B,u)=>{const{node:f}=M;this.ASTMap.set(f,B);const m={...M,updated:!1};n.set(B,m);const S=O=>{const N=s.get(O)??O,T=this.getPreviousResult(N);T&&P(T,N,B)};"children"in f?f.children?.forEach(({value:O})=>S(O)):f.type==="multi-node"&&f.values.forEach(S),this.hooks.afterNodeUpdate.call(B,u,m)};return d.node.parent=o,P(d,e,t),C}g.parent=o,c.node=g,this.ASTMap.set(g,e);let b=this.hooks.resolve.call(void 0,g,c),k=!G(d?.value,b);d&&!k&&(b=d?.value);const x=new Set;if(l.trackSubset("children"),"children"in g){const C=g.children?.map(P=>{const M=this.computeTree(P.value,e,r,n,c,g,s),{dependencies:B,node:u,updated:f,value:m}=M;if(B.forEach(S=>x.add(S)),m)if(u.type==="multi-node"&&!u.override){const S=Ar(Ke(b,P.path,[]),m);b=U(b,P.path,S)}else b=U(b,P.path,m);return k=k||f,{...P,value:u}});g.children=C}else if(g.type==="multi-node"){const C=[],P=w?o?.parent:e,M=g.values.map(B=>{const u=this.computeTree(B,P,r,n,c,g,s);return u.value!==void 0&&u.value!==null&&C.push(u.value),u.dependencies.forEach(f=>x.add(f)),k=k||u.updated,u.node});g.values=M,b=C}x.forEach(C=>l.addChildReadDep(C)),l.trackSubset("core"),d&&!k&&(b=d?.value),b=this.hooks.afterResolve.call(b,g,{...c,getDependencies:C=>l.getDependencies(C)});const I={node:g,updated:k,value:b,dependencies:new Set([...l.getDependencies(),...x])};return this.hooks.afterNodeUpdate.call(e,w?o?.parent:t,I),n.set(e,I),I}},jn=class{constructor(e,t,r){this.allValidations=new Set,this.byBinding=new Map,this.logger=r,this.parse(e,t)}parse(e,t){const r=e.validation;if(r!==void 0){if(!Array.isArray(r)){this.logger?.warn(`Unable to register view validations for id: ${e.id}. 'validation' property must be an Array.`);return}r.forEach(n=>{const i={trigger:"navigation",severity:"error",...n};this.allValidations.add(i);const{ref:o}=n;if(o){const s=t(o);this.byBinding.has(s)?this.byBinding.get(s)?.push(i):this.byBinding.set(s,[i])}})}}getValidationsForBinding(e){return this.byBinding.get(e)}},$n=class{constructor(e,t){this.hooks={onUpdate:new E,parser:new E,resolver:new E,onTemplatePluginCreated:new E,templatePlugin:new E},this.initialView=e,this.resolverOptions=t,this.hooks.onTemplatePluginCreated.tap("view",r=>{this.templatePlugin=r})}updateAsync(){const e=this.resolver?.update();this.lastUpdate=e,this.hooks.onUpdate.call(e)}update(e){if(this.rootNode===void 0){this.validationProvider=new jn(this.initialView,this.resolverOptions.parseBinding,this.resolverOptions.logger),this.templatePlugin?this.hooks.templatePlugin.call(this.templatePlugin):this.resolverOptions.logger?.warn("templatePlugin not set for View, legacy templates may not work");const r=new _n;this.hooks.parser.call(r),this.rootNode=r.parseView(this.initialView),this.resolver=new In(this.rootNode,{...this.resolverOptions,parseNode:r.parseObject.bind(r)}),this.hooks.resolver.call(this.resolver)}const t=this.resolver?.update(e);return this.lastUpdate===t?this.lastUpdate:(this.lastUpdate=t,this.hooks.onUpdate.call(t),t)}getValidationsForBinding(e){return this.validationProvider?.getValidationsForBinding(e)}},Fn=class{constructor(e){this.hooks={resolveTemplateSubstitutions:new R},this.options=e}parseTemplate(e,t,r){const{template:n,depth:i}=t,o=r.data.model.get(t.data);if(!o)return null;if(!Array.isArray(o))throw new Error(`Template using '${t.data}' but is not an array`);const s=[];return o.forEach((a,c)=>{const d=this.hooks.resolveTemplateSubstitutions.call([{expression:new RegExp(`_index${i||""}_`),value:String(c)}],{depth:i,data:a,index:c});let h=JSON.stringify(n);for(const{expression:p,value:y}of d){let g="g";typeof p=="object"&&(g=`${p.flags}${p.global?"":"g"}`),h=h.replace(new RegExp(p,g),y)}const v=e(JSON.parse(h),"value",{templateDepth:t.depth+1});v&&s.push(v)}),{type:"multi-node",override:!1,values:s}}applyParser(e){e.hooks.onCreateASTNode.tap("template",t=>t&&t.type==="template"&&!t.dynamic?this.parseTemplate(e.parseObject.bind(e),t,this.options):t),e.hooks.parseNode.tap("template",(t,r,n,i)=>{if(i&&sr(i.key))return t.map(o=>{const s=e.createASTNode({type:"template",depth:n.templateDepth??0,data:o.data,template:o.value,dynamic:o.dynamic??!1},o);if(s)return s.type==="multi-node"&&s.values.forEach(l=>{l.parent=s}),{path:[...i.path,o.output],value:s}}).filter(Boolean)})}applyResolverHooks(e){e.hooks.beforeResolve.tap("template",(t,r)=>t&&t.type==="template"&&t.dynamic?this.parseTemplate(r.parseNode,t,r):t)}apply(e){e.hooks.parser.tap("template",this.applyParser.bind(this)),e.hooks.resolver.tap("template",this.applyResolverHooks.bind(this))}},ar=(e,t)=>r=>{const n=r.indexOf(e);if(n===-1)return!1;const i=r.indexOf(t);return i===-1?!1:n{if(r.has(i))return;const o=e[i];let s=o;typeof o=="object"?s=lr(o,t,r):typeof o=="string"&&(s=wt(o,t)),s!==o&&(n=Tr(n,i,s))}),n}var cr=(e,t)=>{const r=e.parent;if(!r)return[];if("children"in r){const n=t.getSourceNode(e);return r.children?.find(i=>i.value===n)?.path??[]}return r.type!=="multi-node"?[]:cr(r,t)},Hn=class{constructor(){this.propertiesToSkipCache=new Map}applyResolver(e){e.hooks.resolve.tap("string-resolver",(t,r,n)=>{if(r.type==="empty"||r.type==="unknown")return null;if(r.type==="value"||r.type==="asset"||r.type==="view"){let i;r.type==="asset"||r.type==="view"?(i=new Set(r.plugins?.stringResolver?.propertiesToSkip??["exp"]),r.value?.id&&this.propertiesToSkipCache.set(r.value.id,i)):r.parent?.type==="multi-node"&&(r.parent?.parent?.type==="asset"||r.parent?.parent?.type==="view")&&r.parent.parent.value?.id&&this.propertiesToSkipCache.has(r.parent.parent.value.id)?i=this.propertiesToSkipCache.get(r.parent.parent.value.id):i=new Set(["exp"]);const o=cr(r,e);return o.length>0&&o.some(s=>i.has(s.toString()))?r.value:lr(r.value,n,i)}return t})}apply(e){e.hooks.resolver.tap("string-resolver",this.applyResolver.bind(this))}},qn=class{isApplicability(e){return e&&Object.prototype.hasOwnProperty.call(e,"applicability")}applyResolver(e){e.hooks.beforeResolve.tap("applicability",(t,r)=>{let n=t;if(t?.type==="applicability"){if(r.evaluate(t.expression)===!1)return null;n=t.value}return n})}applyParser(e){e.hooks.parseNode.tap("applicability",(t,r,n,i)=>{if(this.isApplicability(t)){const o=e.parseObject(Ct(t,"applicability"),r,n);if(!o)return i?[]:null;const s=e.createASTNode({type:"applicability",expression:t.applicability,value:o},t);return s?(s.type==="applicability"&&(s.value.parent=s),i?[{path:[...i.path,i.key],value:s}]:s):i?[]:null}})}apply(e){e.hooks.resolver.tap("applicability",this.applyResolver.bind(this)),e.hooks.parser.tap("applicability",this.applyParser.bind(this))}},Kn=class{constructor(e){this.options=e}resolveSwitch(e,t){for(const r of e.cases)if(t.evaluate(r.case))return r.value;return Dn}isSwitch(e){return e&&(Object.prototype.hasOwnProperty.call(e,"dynamicSwitch")||Object.prototype.hasOwnProperty.call(e,"staticSwitch"))}applyParser(e){e.hooks.onCreateASTNode.tap("switch",t=>t&&t.type==="switch"&&!t.dynamic?this.resolveSwitch(t,this.options):t),e.hooks.parseNode.tap("switch",(t,r,n,i)=>{if(this.isSwitch(t)||i&&yt(i.key)){const o=i&&yt(i.key)?{[i.key]:t}:t,s="dynamicSwitch"in o,a=(s?o.dynamicSwitch:o.staticSwitch).map(d=>{const{case:h,...v}=d,p=e.parseObject(v,"value",n);if(p)return{case:h,value:p}}).filter(Boolean),c=e.createASTNode({type:"switch",dynamic:s,cases:a},o);if(!c||c.type==="empty")return i?[]:null;if(c.type==="switch"&&c.cases.forEach(d=>{d.value.parent=c}),i){let d=[...i.path,i.key],h=c;if(c.type==="value"&&c.children?.length===1&&c.value===void 0){const v=c.children[0];d=[...d,...v.path],h=v.value}return[{path:d,value:h}]}return c}})}applyResolver(e){e.hooks.beforeResolve.tap("switch",(t,r)=>t&&t.type==="switch"&&t.dynamic?this.resolveSwitch(t,r):t)}apply(e){e.hooks.parser.tap("switch",this.applyParser.bind(this)),e.hooks.resolver.tap("switch",this.applyResolver.bind(this))}},Gn=class{applyParser(e){e.hooks.parseNode.tap("multi-node",(t,r,n,i)=>{if(i&&!sr(i.key)&&Array.isArray(t)){const o=t.map(l=>e.parseObject(l,"value",n)).filter(l=>!!l);if(!o.length)return[];const s=e.createASTNode({type:"multi-node",override:!xn(i.parentObj,i.key),values:o},t);return s?(s.type==="multi-node"&&s.values.forEach(l=>{l.parent=s}),[{path:[...i.path,i.key],value:s}]):[]}})}apply(e){e.hooks.parser.tap("multi-node",this.applyParser.bind(this))}},Wn=class{applyParser(e){e.hooks.parseNode.tap("asset",(t,r,n,i)=>{if(i?.key==="asset"&&typeof t=="object"){const o=e.parseObject(t,"asset",n);return o?[{path:[...i.path,i.key],value:o}]:[]}})}apply(e){e.hooks.parser.tap("asset",this.applyParser.bind(this))}},Qn=class{constructor(e,t,r){this.isTransitioning=!1,this.hooks={beforeStart:new J,onStart:new E,onEnd:new E,skipTransition:new J,beforeTransition:new R,resolveTransitionNode:new R,transition:new E,afterTransition:new E},this.id=e,this.flow=t,this.log=r?.logger,this.history=[],this.hooks.transition.tap("startPromise",async(n,i)=>{const o=i.value;this.flowPromise&&o.state_type==="END"&&this.flowPromise.resolve(o)})}async start(){if(this.flowPromise)return this.log?.warn("Already called start for flow"),this.flowPromise.promise;this.flow=this.hooks.beforeStart.call(this.flow)||this.flow,this.flow.onStart&&this.hooks.onStart.call(this.flow.onStart);const e=this.flow.startState;return e?(this.flowPromise=Ht(),this.pushHistory(e),this.flowPromise.promise):Promise.reject(new Error("No 'startState' defined for flow"))}transition(e,t){if(this.isTransitioning)throw new Error(`Transitioning while ongoing transition from ${this.currentState?.name} is in progress is not supported`);if(this.currentState?.value.state_type==="END"){this.log?.warn(`Skipping transition using ${e}. Already at and END state`);return}if(this.currentState===void 0)throw new Error("Cannot transition when there's no current state");if(t?.force)this.log?.debug("Forced transition. Skipping validation checks");else if(this.hooks.skipTransition.call(this.currentState)){this.log?.debug(`Skipping transition from ${this.currentState.name} b/c hook told us to`);return}const r=this.hooks.beforeTransition.call(this.currentState.value,e);if(!("transitions"in r))throw new Error(`No transitions defined for ${this.currentState.value}`);const{transitions:n}=r,i=n[e]||n["*"];if(i===void 0){this.log?.warn(`No transition from ${this.currentState.name} using ${e} or *`);return}return this.log?.debug(`Transitioning from ${this.currentState.name} to ${i} using ${e} `),this.pushHistory(i,t)}pushHistory(e,t){if(!Object.prototype.hasOwnProperty.call(this.flow,e))throw new Error(`No flow definition for: ${e} was found.`);let r=this.flow[e];if(!this.flow[e]||typeof r!="object"||!("state_type"in r)){this.log?.error(`Flow doesn't contain any states named: ${e}`);return}const n=this.currentState;this.isTransitioning=!0,r=this.hooks.resolveTransitionNode.call(r);const i={name:e,value:r};this.currentState=i,this.history.push(e),i.value.state_type==="END"&&this.flow.onEnd&&this.hooks.onEnd.call(this.flow.onEnd),this.hooks.transition.call(n,{...i}),this.isTransitioning=!1,this.hooks.afterTransition.call(this)}},Yn=class{constructor(e,t){this.hooks={flow:new E},this.navigation=e,this.navStack=[],this.log=t?.logger,this.start=this.start.bind(this),this.run=this.run.bind(this),this.transition=this.transition.bind(this),this.addNewFlow=this.addNewFlow.bind(this)}transition(e,t){if(this.current===void 0)throw new Error("Not currently in a flow. Cannot transition.");this.current.transition(e,t)}addNewFlow(e){this.navStack.push(e),this.current=e,this.hooks.flow.call(e)}async run(e){if(!Object.prototype.hasOwnProperty.call(this.navigation,e))return Promise.reject(new Error(`No flow defined for: ${e}`));const t=this.navigation[e];if(t===null||typeof t!="object")return Promise.reject(new Error(`Flow: ${e} needs to be an object`));this.log?.debug(`Starting flow: ${e}`);const r=new Qn(e,t,{logger:this.log});this.addNewFlow(r),r.hooks.afterTransition.tap("flow-controller",i=>{if(i.currentState?.value.state_type==="FLOW"){const o=i.currentState?.value.ref;this.log?.debug(`Loading subflow ${o}`),this.run(o).then(s=>{this.log?.debug(`Subflow ended. Using outcome: ${s.outcome}`),i.transition(s?.outcome)})}});const n=await r.start();return this.navStack.pop(),this.navStack.length>0&&(this.current=this.navStack[0]),n}async start(){return this.navigation.BEGIN?this.run(this.navigation.BEGIN):Promise.reject(new Error("Must supply a BEGIN state"))}},Xn=/%([a-zA-Z]+)/g;function Jn(e,t){return e.slice().replace(Xn,r=>t[r.slice(1)]||r)}var ie="validation-binding-tracker",Zn=class{constructor(e){this.trackedBindings=new Set,this.options=e}getBindings(){return this.trackedBindings}trackBinding(e){this.trackedBindings.has(e)||(this.trackedBindings.add(e),this.options.callbacks?.onAdd?.(e))}applyResolver(e){this.trackedBindings.clear();const t=new Map,r=new Map;let n;const i=new Map;let o=new Map;const s=new Map,l=new Map;e.hooks.beforeUpdate.tap(ie,a=>{n=a}),e.hooks.skipResolve.tap(ie,(a,c)=>{const d=i.get(c);return!a||!n||!d?a:new Set([...n].filter(v=>d.has(v))).size===0}),e.hooks.resolveOptions.tap(ie,(a,c)=>{if(a.validation===void 0)return a;t.delete(c);const d=h=>{const v=W(h)?h:this.options.parseBinding(h);t.has(c)?t.get(c)?.add(v):t.set(c,new Set([v]));let{parent:p}=c;for(;p;)if(r.has(p)){r.get(p)?.add(c);break}else p=p.parent;this.trackedBindings.add(v),this.options.callbacks?.onAdd?.(v)};return{...a,validation:{...a.validation,get:(h,v)=>(v?.track&&d(h),a.validation?._getValidationForBinding(h)?.getAll(v)?.find(g=>g.displayTarget==="field"||g.displayTarget===void 0)),getValidationsForBinding(h,v){return v?.track&&d(h),a.validation?._getValidationForBinding(h)?.getAll(v)??[]},getChildren:h=>{const v=new Array;return i.get(c)?.forEach(p=>{const y=a.validation?._getValidationForBinding(p)?.get();y&&(h===void 0||h===y.displayTarget)&&v.push(y)}),v},getValidationsForSection:()=>{const h=new Array;return s.get(c)?.forEach(v=>{const p=a.validation?._getValidationForBinding(v)?.get();p&&p.displayTarget==="section"&&h.push(p)}),h},register:h=>{h?.type==="section"&&(r.has(c)||r.set(c,new Set))},track:d}}}),e.hooks.afterNodeUpdate.tap(ie,(a,c,d)=>{const{updated:h,node:v}=d;if(l.set(v,a),h){const p=new Set(t.get(a));v.type==="multi-node"&&v.values.forEach(y=>o.get(y)?.forEach(g=>p.add(g))),"children"in v&&v.children&&v.children.forEach(y=>{o.get(y.value)?.forEach(g=>p.add(g))}),o.set(v,p)}else o.set(v,i.get(a)??new Set);a===e.root&&(this.trackedBindings=new Set(o.get(v)),i.clear(),o.forEach((p,y)=>{const g=l.get(y);g&&i.set(g,p)}),s.clear(),r.forEach((p,y)=>{const g=new Set;p.forEach(w=>{t.get(w)?.forEach(g.add,g)}),s.set(y,g)}),t.clear(),r.clear(),o=new Map)})}apply(e){e.hooks.resolver.tap(ie,this.applyResolver.bind(this))}},ei="schema",ti="view",ri=Symbol.for("validation-provider-name");function ni(e,t){if(e.size>t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function ii(e){return{value:e,type:e.severity,state:"none",isBlockingNavigation:!1}}var si=class{constructor(e,t,r,n){this.applicableValidations=[],this.validationsByState={load:[],change:[],navigation:[]},this.onDismiss=t,e.forEach(i=>{const{trigger:o}=i;if(this.validationsByState[o]){const s=ii(i);this.validationsByState[o].push(s)}else r?.warn(`Unknown validation trigger: ${o}`)}),this.weakBindings=n??new Set}get allValidations(){return Object.values(this.validationsByState).flat()}checkIfBlocking(e){if(e.state==="active"){const{isBlockingNavigation:t}=e;return t}return!1}getAll(){return this.applicableValidations.reduce((e,t)=>(t.state==="active"&&t.response&&e.push({...t.response,blocking:this.checkIfBlocking(t)}),e),[])}get(){const e=this.applicableValidations.find(t=>t.state==="active"&&t.response);if(e?.state==="active")return{...e.response,blocking:this.checkIfBlocking(e)}}runApplicableValidations(e,t,r){this.applicableValidations=this.applicableValidations.map(n=>{if(n.state==="dismissed")return n;const i=n.value.blocking??(n.value.severity==="warning"&&"once"||!0),o=U(n,["value","blocking"],i),s=i===!0||i==="once"&&!t;if(r==="navigation"&&o.state==="active"&&o.value.blocking!==!0&&o.value.severity==="warning"){const c=o;return c.dismissable&&c.response.dismiss&&(c.response.blocking!=="once"||!c.response.blocking)?c.response.dismiss():(c?.response.blocking==="once"&&(c.response.blocking=!1),c.dismissable=!0),c}const l=e(o.value),a={type:o.type,value:o.value,state:l?"active":"none",isBlockingNavigation:s,dismissable:o.value.severity==="warning"&&r==="navigation",response:l?{...o.value,message:l.message??"Something is broken",severity:o.value.severity,displayTarget:o.value.displayTarget??"field"}:void 0};return a.state==="active"&&o.value.severity==="warning"&&(a.response.dismiss=()=>{a.state="dismissed",this.onDismiss?.()}),a})}update(e,t,r){const n=[];if(!(e==="load"&&this.currentPhase!==void 0)){if(this.currentPhase==="navigation"||e===this.currentPhase){this.runApplicableValidations(r,t,e);return}e==="load"?(this.currentPhase="load",this.applicableValidations=[...this.validationsByState.load]):e==="change"&&this.currentPhase==="load"?(this.currentPhase="change",this.applicableValidations=[...this.applicableValidations,...this.validationsByState.change]):e==="navigation"&&(this.currentPhase==="load"||this.currentPhase==="change")&&(this.applicableValidations.forEach(i=>{i.type==="error"&&i.state==="active"&&i.isBlockingNavigation===!1||n.push(i)}),this.applicableValidations=[...n,...this.validationsByState.navigation,...this.currentPhase==="load"?this.validationsByState.change:[]],this.currentPhase="navigation"),this.runApplicableValidations(r,t,e)}}},oi=class{constructor(e,t){this.hooks={createValidatorRegistry:new E,onAddValidation:new R,onRemoveValidation:new R,resolveValidationProviders:new R,onTrackBinding:new E},this.validations=new Map,this.weakBindingTracker=new Set,this.schema=e,this.options=t,this.reset()}setOptions(e){this.options=e}getDataMiddleware(){return[{set:(e,t,r)=>r?.set(e,t)??[],get:(e,t,r)=>r?.get(e,t),delete:(e,t,r)=>(this.validations=ir(this.validations,e),r?.delete(e,t))},new Mn(e=>{if(!this.options)return;this.updateValidationsForBinding(e,"change",this.options);const t=this.getValidationForBinding(e);if(t?.get()?.severity==="error")return t.get();const r=new Set;if(this.validations.forEach((n,i)=>{Le(new Set([e]),n.weakBindings)&&n?.get()?.severity==="error"&&n?.weakBindings.forEach(o=>{o===i?r.add({binding:o,isStrong:!0}):r.add({binding:o,isStrong:!1})})}),r.size>0)return r},{logger:new An(()=>this.options?.logger)})]}getValidationProviders(){return this.providers?this.providers:(this.providers=this.hooks.resolveValidationProviders.call([{source:ei,provider:this.schema},{source:ti,provider:{getValidationsForBinding:e=>this.viewValidationProvider?.getValidationsForBinding?.(e),getValidationsForView:()=>this.viewValidationProvider?.getValidationsForView?.()}}]),this.providers)}reset(){this.validations.clear(),this.tracker=void 0}onView(e){if(this.validations.clear(),!this.options)return;const t=new Zn({...this.options,callbacks:{onAdd:r=>{if(!this.options||this.getValidationForBinding(r)!==void 0)return;const n=this.options.model.get(r),i=this.options.model.get(r,{ignoreDefaultValue:!0});n!==i&&this.options.model.set([[r,n]],{silent:!0}),this.updateValidationsForBinding(r,"load",this.options,()=>{e.update(new Set([r]))}),this.hooks.onTrackBinding.call(r)}}});this.tracker=t,this.viewValidationProvider=e,t.apply(e)}updateValidationsForBinding(e,t,r,n){const i=r??this.options;if(!i)throw new Error("Context is required for executing validations");if(t==="load"){const s=this.getValidationProviders().reduce((l,a)=>(l.push(...a.provider.getValidationsForBinding?.(e)?.map(c=>({...c,[ri]:a.source}))??[]),l),[]);if(s.length===0)return;this.validations.set(e,new si(s,n,this.options?.logger))}this.validations.get(e)?.update(t,!0,s=>{const l=this.validationRunner(s,e,i);if(this.weakBindingTracker.size>0){const a=this.validations.get(e);this.weakBindingTracker.forEach(c=>a.weakBindings.add(c))}return l?{message:l.message}:void 0}),t!=="load"&&this.validations.forEach((s,l)=>{l!==e&&Le(new Set([e]),s.weakBindings)&&s.update(t,!0,a=>{const c=this.validationRunner(a,l,i);return c?{message:c.message}:void 0})})}validationRunner(e,t,r=this.options){if(!r)throw new Error("No context provided to validation runner");const n=e.handler??this.getValidator(e.type),i=new Set,o={get(l,a){return i.add(W(l)?t:r.parseBinding(l)),r.model.get(l,{...a,includeInvalid:!0})},set:r.model.set,delete:r.model.delete},s=n?.({...r,evaluate:(l,a={model:o})=>r.evaluate(l,a),model:o,validation:e,schemaType:this.schema.getType(t)},r.model.get(t,{includeInvalid:!0,formatted:e.dataTarget==="formatted"}),e);if(this.weakBindingTracker=i,s){let{message:l}=s;const{parameters:a}=s;return e.message&&(l=Qe(e.message,{model:o,evaluate:r.evaluate}),a&&(l=Jn(l,a))),{message:l}}}updateValidationsForView(e){const t=e==="navigation",r=this.activeBindings,n=i=>{this.getBindings().forEach(o=>{this.validations.get(o)?.update(e,i,s=>{if(this.options)return this.validationRunner(s,o,this.options)})})};if(n(!t),t){const{activeBindings:i}=this;ni(i,r)&&n(!0)}}get activeBindings(){return new Set(Array.from(this.getBindings()).filter(e=>this.validations.get(e)?.get()!==void 0))}getValidator(e){if(this.validatorRegistry)return this.validatorRegistry.get(e);const t=new Rn;return this.hooks.createValidatorRegistry.call(t),this.validatorRegistry=t,t.get(e)}getBindings(){return this.tracker?.getBindings()??new Set}trackBinding(e){this.tracker?.trackBinding(e)}validateView(e="navigation"){this.updateValidationsForView(e);const t=new Map;let r=!0;return this.getBindings().forEach(n=>{this.getValidationForBinding(n)?.getAll()?.forEach(o=>{e==="navigation"&&o.blocking&&(this.options?.logger.debug(`Validation on binding: ${n.asString()} is preventing navigation. ${JSON.stringify(o)}`),r=!1),t.has(n)||t.set(n,o)})}),{canTransition:r,validations:t.size?t:void 0}}getValidationForBinding(e){return this.validations.get(e)}forView(e){return{_getValidationForBinding:t=>this.getValidationForBinding(W(t)?t:e(t)),getAll:()=>{const t=this.getBindings();if(t.size===0)return;const r=new Map;return t.forEach(n=>{const i=this.getValidationForBinding(n)?.get();i&&r.set(n,i)}),r.size===0?void 0:r},get(){throw new Error("Error Access be provided by the view plugin")},getValidationsForBinding(){throw new Error("Error rollup should be provided by the view plugin")},getChildren(){throw new Error("Error rollup should be provided by the view plugin")},getValidationsForSection(){throw new Error("Error rollup should be provided by the view plugin")},track:()=>{throw new Error("Tracking should be provided by the view plugin")},register:()=>{throw new Error("Section functionality should be provided by the view plugin")},type:t=>this.schema.getType(W(t)?t:e(t))}}},ai=class{constructor(e){this.updateCallback=e,this.state=new Map}removeKey(e){this.state.delete(e)}reset(){this.state.clear()}useSharedState(e){return t=>(this.state.has(e)||this.state.set(e,t),[this.state.get(e),r=>{const n=this.state.get(e);this.state.set(e,r),n!==r&&this.updateCallback?.()}])}getLocalStateFunction(e,t){return r=>{this.state.has(e)||this.state.set(e,[]),this.state.has(t)||this.state.set(t,0);const n=this.state.get(e),i=this.state.get(t);return this.state.set(t,i+1),n.length<=i&&n.push(r),[n[i],s=>{const l=n[i];n[i]=s,l!==s&&this.updateCallback?.()}]}}};function ze(e,t){return e===t?!0:e.parent?ze(e.parent,t):!1}var li=class{constructor(e){this.registry=e,this.stateStore=new Map,this.beforeResolveSymbol=Symbol("before resolve"),this.resolveSymbol=Symbol("resolve"),this.beforeResolveCountSymbol=Symbol("before resolve count"),this.resolveCountSymbol=Symbol("resolve count")}apply(e){e.hooks.view.tap("asset-transform",t=>{this.stateStore.clear(),t.hooks.resolver.tap("asset-transform",r=>{let n;const i=s=>{n=s,t.update(new Set)},o=(s,l)=>{let a;const c=l===this.resolveSymbol?this.resolveCountSymbol:this.beforeResolveCountSymbol,d=this.stateStore.get(s);return d?(a=d,a.removeKey(c)):(a=new ai(()=>{i(s)}),this.stateStore.set(s,a)),{useSharedState:h=>a.useSharedState(h),useLocalState:h=>a.getLocalStateFunction(l,c)(h)}};r.hooks.beforeResolve.tap("asset-transform",(s,l)=>{if(s&&(s.type==="asset"||s.type==="view")){const a=this.registry.get(s.value);if(a?.beforeResolve){const c=o(l.node??s,this.beforeResolveSymbol);return a.beforeResolve(s,l,c)}}return s}),r.hooks.afterUpdate.tap("asset-transform",()=>{n=void 0}),r.hooks.skipResolve.tap("asset-transform",(s,l)=>{if(!s||!n)return s;const a=ze(n,l),c=ze(l,n);return!a&&!c}),r.hooks.afterResolve.tap("asset-transform",(s,l,a)=>{if(l.type!=="asset"&&l.type!=="view")return s;const c=r.getSourceNode(l);if(!c)return s;const d=this.registry.get(s);if(d?.resolve){const h=o(c,this.resolveSymbol);return d?.resolve(s,a,h)}return s})})})}},ci=class{constructor(e,t){this.hooks={resolveView:new R,view:new E},this.transformRegistry=new $r,this.optimizeUpdates=!0,this.viewOptions=t,this.viewMap=e.reduce((n,i)=>(n[i.id]=i,n),{}),new li(this.transformRegistry).apply(this),t.flowController.hooks.flow.tap("viewController",n=>{n.hooks.transition.tap("viewController",(i,o)=>{o.value.state_type==="VIEW"?this.onView(o.value):this.currentView=void 0})});const r=(n,i=!1)=>{this.currentView&&(this.optimizeUpdates?this.queueUpdate(n,i):this.currentView.update())};t.model.hooks.onUpdate.tap("viewController",(n,i)=>{r(new Set(n.map(o=>o.binding)),i?.silent??!1)}),t.model.hooks.onDelete.tap("viewController",n=>{const i=n.parent(),o=n.key();r(typeof o=="number"&&i?new Set([i]):new Set([n]))})}queueUpdate(e,t=!1){this.pendingUpdate?.changedBindings?this.pendingUpdate.changedBindings=new Set([...this.pendingUpdate.changedBindings,...e]):this.pendingUpdate={changedBindings:e,scheduled:!1},!this.pendingUpdate.scheduled&&!t&&(this.pendingUpdate.scheduled=!0,Dr(()=>{const r=this.pendingUpdate?.changedBindings;this.pendingUpdate=void 0,this.currentView?.update(r)}))}getViewForRef(e){if(this.viewMap[e])return this.viewMap[e];const t=Object.keys(this.viewMap).find(r=>e===rr(r,{model:this.viewOptions.model,evaluate:this.viewOptions.evaluator.evaluate}));if(t&&this.viewMap[t])return this.viewMap[t]}onView(e){const t=e.ref,r=this.hooks.resolveView.call(this.getViewForRef(t),t,e);if(!r)throw new Error(`No view with id ${t}`);const n=new $n(r,this.viewOptions);this.currentView=n,this.hooks.view.call(n),n.update()}},ui=class{constructor(e,t){this.controller=e,this.logger=t}get(e,t){return this.controller.get(e,t)}set(e,t){return this.logger?.error("Error: Tried to set in a read only instance of the DataController"),[]}delete(e,t){this.logger?.error("Error: Tried to delete in a read only instance of the DataController")}},hi=class{constructor(e,t){this.hooks={resolve:new R,resolveDataStages:new R,resolveDefaultValue:new J,onDelete:new E,onSet:new E,onGet:new E,onUpdate:new E,format:new R,deformat:new R,serialize:new R},this.logger=t.logger;const r=t.middleware||[];this.baseMiddleware=[new Ue(e),...r],this.trash=new Set,this.pathResolver=t.pathResolver}getModel(){if(!this.model){const e=this.hooks.resolveDataStages.call(this.baseMiddleware),t=new ln;t.setMiddleware(e),this.model=t}return this.model}resolveDataValue(e,t,r){return r?this.hooks.deformat.call(t,e):t}set(e,t){let r=[];Array.isArray(e)?r=e.map(([s,l])=>{const a=this.pathResolver.parse(s);return[a,this.resolveDataValue(a,l,!!t?.formatted)]}):r=Object.keys(e).map(s=>{const l=this.pathResolver.parse(s),a=e[s];return[l,this.resolveDataValue(l,a,!!t?.formatted)]});const n=r.reduce((s,[l,a])=>{const c=this.get(l,{includeInvalid:!0}),d={binding:l,newValue:a,oldValue:c};return G(c,a)?this.logger?.debug(`Skipping update for path: ${l.asString()}. Value was unchanged: ${c}`):(s.push(d),this.logger?.debug(`Setting path: ${l.asString()} from: ${c} to: ${a}`)),s},[]),i=this.getModel().set(r,t),o=new Set(n.map(s=>s.binding));return i.forEach(s=>{!o.has(s.binding)&&(s.force===!0||!G(s.oldValue,s.newValue))&&(this.logger?.debug(`Path: ${s.binding.asString()} was changed from: ${s.oldValue} to: ${s.newValue}`),n.push(s))}),this.hooks.onSet.call(r),n.length>0&&this.hooks.onUpdate.call(n,t),i}resolve(e,t){return Array.isArray(e)||typeof e=="string"?this.pathResolver.parse(e,{readOnly:t}):e}get(e,t){const r=e instanceof Q?e:this.resolve(e,!0);let n=this.getModel().get(r,t);if(n===void 0&&!t?.ignoreDefaultValue){const i=this.hooks.resolveDefaultValue.call(r);i!==n&&(n=i)}return t?.formatted?n=this.hooks.format.call(n,r):t?.formatted===!1&&(n=this.hooks.deformat.call(n,r)),this.hooks.onGet.call(e,n),n}delete(e,t){if(typeof e!="string"&&!Array.isArray(e)&&!(e instanceof Q))throw new Error("Invalid arguments: delete expects a data path (string)");const r=e instanceof Q?e:this.resolve(e,!1),n=r.parent(),i=r.key(),o=this.get(n),s=typeof o=="object"&&o!==null&&Object.prototype.hasOwnProperty.call(o,i);this.getModel().delete(r,t),s&&!this.get(r)&&this.trash.add(r),this.hooks.onDelete.call(r)}serialize(){return this.hooks.serialize.call(this.get(""))}makeReadOnly(){return new ui(this,this.logger)}};function ur(e,t=[],r="."){return Object.keys(e).reduce((n,i)=>({...n,...Object.prototype.toString.call(e[i])==="[object Object]"?ur(e[i],t.concat([i])):{[t.concat([i]).join(r)]:e[i]}}),{})}function mt(e){const t=ur(e),r=[];return Object.keys(t).forEach(n=>{r.push([new Q(n),t[n]])}),r}var di=class{constructor(){this.store=new Map,this.tempStore=new Map}addConstants(e,t){this.store.has(t)?this.store.get(t)?.set(mt(e)):this.store.set(t,new Ue(e))}getConstants(e,t,r){const n=new Q(e);return this.tempStore.get(t)?.get(n)??this.store.get(t)?.get(n)??r}setTemporaryValues(e,t){this.tempStore.has(t)?this.tempStore.get(t)?.set(mt(e)):this.tempStore.set(t,new Ue(e))}clearTemporaryValues(e){e?this.tempStore.get(e)?.reset():this.tempStore.forEach(t=>{t.reset()})}},fi=class{constructor(){this.name="flow-exp-plugin"}apply(e){let t;const r=n=>{n&&(typeof n=="object"&&"exp"in n?t?.evaluate(n.exp):t?.evaluate(n))};e.hooks.expressionEvaluator.tap(this.name,n=>{t=n}),e.hooks.flowController.tap(this.name,n=>{n.hooks.flow.tap(this.name,i=>{i.hooks.onStart.tap(this.name,o=>r(o)),i.hooks.onEnd.tap(this.name,o=>r(o)),i.hooks.resolveTransitionNode.intercept({call:o=>{o?.onStart&&r(o.onStart)}})})})}},pi=e=>(r,n,i)=>e.getFormatterForType({type:i})?.format(n)??n,gi=class{constructor(){this.name="flow-exp-plugin"}apply(e){let t;e.hooks.schema.tap(this.name,r=>{t=pi(r)}),e.hooks.expressionEvaluator.tap(this.name,r=>{t&&r.addExpressionFunction("format",t),r.addExpressionFunction("log",(n,...i)=>{e.logger.info(...i)}),r.addExpressionFunction("debug",(n,...i)=>{e.logger.debug(...i)}),r.addExpressionFunction("eval",(n,...i)=>n.evaluate(...i))})}},vi={ref:Symbol("not-started"),status:"not-started"},yi=class{constructor(){this.name="default-view-plugin"}apply(e){e.hooks.viewController.tap(this.name,t=>{t.hooks.view.tap(this.name,r=>{const n=or(r.resolverOptions);new Wn().apply(r),new Kn(n).apply(r),new qn().apply(r),new Hn().apply(r);const i=new Fn(n);i.apply(r),r.hooks.onTemplatePluginCreated.call(i),new Gn().apply(r)})})}},wi="__VERSION__",mi="__GIT_COMMIT__",hr=class He{constructor(t){this.logger=new On,this.constantsController=new di,this.state=vi,this.hooks={flowController:new E,viewController:new E,view:new E,expressionEvaluator:new E,dataController:new E,schema:new E,validationController:new E,bindingParser:new E,state:new E,onStart:new E,onEnd:new E,resolveFlowContent:new R},t?.logger&&this.logger.addHandler(t.logger),this.config=t||{},this.config.plugins=[new gi,new yi,...this.config.plugins||[],new fi],this.config.plugins?.forEach(r=>{r.apply(this)})}getPlugins(){return this.config.plugins??[]}findPlugin(t){return this.config.plugins?.find(r=>r.symbol===t)}applyTo(t,r){const n=this.findPlugin(t);n&&r(n)}registerPlugin(t){t.apply(this),this.config.plugins?.push(t)}getVersion(){return He.info.version}getCommit(){return He.info.commit}getState(){return this.state}setState(t){this.state=t,this.hooks.state.call(t)}setupFlow(t){const r=this.hooks.resolveFlowContent.call(t),n=new Yn(r.navigation,{logger:this.logger});this.hooks.onStart.call(r),this.hooks.flowController.call(n);let i,o;const s=new tn({get:p=>o.get(p),set:p=>o.set(p),evaluate:p=>i.evaluate(p)});this.hooks.bindingParser.call(s);const l=s.parse,a=Ht(),c=new Tn(r.schema);this.hooks.schema.call(c);const d=new oi(c);this.hooks.validationController.call(d),o=new hi(r.data,{pathResolver:s,middleware:d.getDataMiddleware(),logger:this.logger}),o.hooks.format.tap("player",(p,y)=>{const g=c.getFormatter(y);return g?g.format(p):p}),o.hooks.deformat.tap("player",(p,y)=>{const g=c.getFormatter(y);return g?g.deformat(p):p}),o.hooks.resolveDefaultValue.tap("player",p=>c.getApparentType(p)?.default);let h;i=new kn({model:o,logger:this.logger}),this.hooks.expressionEvaluator.call(i),i.hooks.onError.tap("player",p=>(a.reject(p),!0));function v(p,y){return Qe(p,{model:o,evaluate:i.evaluate,formatted:y})}return n.hooks.flow.tap("player",p=>{p.hooks.beforeTransition.tap("player",(y,g)=>{const w=y.transitions[g]?g:"*";return y.onEnd&&y.transitions[w]&&(typeof y.onEnd=="object"&&"exp"in y.onEnd?i?.evaluate(y.onEnd.exp):i?.evaluate(y.onEnd)),!("transitions"in y)||!y.transitions[w]?y:U(y,["transitions",w],v(y.transitions[w]))}),p.hooks.skipTransition.tap("validation",y=>{if(y?.value.state_type==="VIEW"){const{canTransition:g,validations:w}=d.validateView("navigation");if(!g&&w){const b=new Set(w.keys());return h?.currentView?.update(b),!0}}}),p.hooks.resolveTransitionNode.tap("player",y=>{let g=y;return"ref"in y&&(g=U(y,["ref"],v(y.ref))),"param"in y&&(g=U(y,["param"],v(y.param,!1))),g}),p.hooks.transition.tap("player",(y,g)=>{g.value.state_type!=="VIEW"&&d.reset()}),p.hooks.afterTransition.tap("player",y=>{const g=y.currentState?.value;if(g&&g.state_type==="ACTION"){const{exp:w}=g;n?.transition(String(i?.evaluate(w)))}i.reset()})}),this.hooks.dataController.call(o),d.setOptions({parseBinding:l,model:o,logger:this.logger,evaluate:i.evaluate,constants:this.constantsController}),h=new ci(r.views||[],{evaluator:i,parseBinding:l,transition:n.transition,model:o,utils:{findPlugin:p=>this.findPlugin(p)},logger:this.logger,flowController:n,schema:c,format:(p,y)=>{const g=c.getFormatter(p);return g?.format?g.format(y):y},formatValue:(p,y)=>{const g=c.getFormatterForType(p);return g?.format?g.format(y):y},validation:{...d.forView(l),type:p=>c.getType(l(p))},constants:this.constantsController}),h.hooks.view.tap("player",p=>{d.onView(p),this.hooks.view.call(p)}),this.hooks.viewController.call(h),{start:()=>{n.start().then(p=>({endState:v(p,!1),data:o.serialize()})).then(a.resolve).catch(p=>{throw this.logger.error(`Something went wrong: ${p.message}`),p}).catch(a.reject).finally(()=>this.hooks.onEnd.call())},state:{status:"in-progress",flowResult:a.promise,controllers:{data:o,view:h,flow:n,schema:c,expression:i,binding:s,validation:d},fail:a.reject,flow:r,logger:this.logger}}}async start(t){const r=Symbol(t?.id??"payload"),n=i=>this.state.ref!==r?(this.logger.warn("Received update for a flow that's not the current one"),i):(this.setState(i),i);this.setState({status:"not-started",ref:r});try{const{state:i,start:o}=this.setupFlow(t);this.setState({ref:r,...i}),o();const s={ref:r,status:"completed",flow:i.flow,controllers:{data:i.controllers.data.makeReadOnly()}};return n({...await i.flowResult,...s})}catch(i){throw n({status:"error",ref:r,flow:t,error:i}),i}}};hr.info={version:wi,commit:mi};var Ps=hr;function bi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function St(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function Ei(e,t){if(e==null)return{};var r=Si(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ki(e,t){return Oi(e)||Ai(e,t)||Ci(e,t)||Ti()}function Oi(e){if(Array.isArray(e))return e}function Ai(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(a){i=!0,o=a}finally{try{!n&&s.return!=null&&s.return()}finally{if(i)throw o}}return r}}function Ci(e,t){if(e){if(typeof e=="string")return Et(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Et(e,t)}}function Et(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?e.apply(this,i):function(){for(var s=arguments.length,l=new Array(s),a=0;a1&&arguments[1]!==void 0?arguments[1]:{};pe.initial(e),pe.handler(t);var r={current:e},n=se(Ui)(r,t),i=se(Fi)(r),o=se(pe.changes)(e),s=se($i)(r);function l(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return pe.selector(c),c(r.current)}function a(c){Vi(n,i,o,s)(c)}return[l,a]}function $i(e,t){return le(t)?t(e.current):t}function Fi(e,t){return e.current=Ot(Ot({},e.current),t),t}function Ui(e,t,r){return le(t)?t(e.current):Object.keys(r).forEach(function(n){var i;return(i=t[n])===null||i===void 0?void 0:i.call(t,e.current[n])}),r}var Li={create:ji},zi={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function Hi(e){return function t(){for(var r=this,n=arguments.length,i=new Array(n),o=0;o=e.length?e.apply(this,i):function(){for(var s=arguments.length,l=new Array(s),a=0;a{n.current=!1}:e,t)}var F=gs;function oe(){}function Y(e,t,r,n){return vs(e,n)||ys(e,t,r,n)}function vs(e,t){return e.editor.getModel(mr(e,t))}function ys(e,t,r,n){return e.editor.createModel(t,r,n?mr(e,n):void 0)}function mr(e,t){return e.Uri.parse(t)}function ws({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:a=!1,theme:c="light",loading:d="Loading...",options:h={},height:v="100%",width:p="100%",className:y,wrapperProps:g={},beforeMount:w=oe,onMount:b=oe}){let[k,x]=A.useState(!1),[I,C]=A.useState(!0),P=A.useRef(null),M=A.useRef(null),B=A.useRef(null),u=A.useRef(b),f=A.useRef(w),m=A.useRef(!1);wr(()=>{let T=vr.init();return T.then(V=>(M.current=V)&&C(!1)).catch(V=>V?.type!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>P.current?N():T.cancel()}),F(()=>{if(P.current&&M.current){let T=P.current.getOriginalEditor(),V=Y(M.current,e||"",n||r||"text",o||"");V!==T.getModel()&&T.setModel(V)}},[o],k),F(()=>{if(P.current&&M.current){let T=P.current.getModifiedEditor(),V=Y(M.current,t||"",i||r||"text",s||"");V!==T.getModel()&&T.setModel(V)}},[s],k),F(()=>{let T=P.current.getModifiedEditor();T.getOption(M.current.editor.EditorOption.readOnly)?T.setValue(t||""):t!==T.getValue()&&(T.executeEdits("",[{range:T.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),T.pushUndoStop())},[t],k),F(()=>{P.current?.getModel()?.original.setValue(e||"")},[e],k),F(()=>{let{original:T,modified:V}=P.current.getModel();M.current.editor.setModelLanguage(T,n||r||"text"),M.current.editor.setModelLanguage(V,i||r||"text")},[r,n,i],k),F(()=>{M.current?.editor.setTheme(c)},[c],k),F(()=>{P.current?.updateOptions(h)},[h],k);let S=A.useCallback(()=>{if(!M.current)return;f.current(M.current);let T=Y(M.current,e||"",n||r||"text",o||""),V=Y(M.current,t||"",i||r||"text",s||"");P.current?.setModel({original:T,modified:V})},[r,t,i,e,n,o,s]),O=A.useCallback(()=>{!m.current&&B.current&&(P.current=M.current.editor.createDiffEditor(B.current,{automaticLayout:!0,...h}),S(),M.current?.editor.setTheme(c),x(!0),m.current=!0)},[h,c,S]);A.useEffect(()=>{k&&u.current(P.current,M.current)},[k]),A.useEffect(()=>{!I&&!k&&O()},[I,k,O]);function N(){let T=P.current?.getModel();l||T?.original?.dispose(),a||T?.modified?.dispose(),P.current?.dispose()}return X.createElement(yr,{width:p,height:v,isEditorReady:k,loading:d,_ref:B,className:y,wrapperProps:g})}var ms=ws;A.memo(ms);function bs(e){let t=A.useRef();return A.useEffect(()=>{t.current=e},[e]),t.current}var Ss=bs,ge=new Map;function Es({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:i,path:o,theme:s="light",line:l,loading:a="Loading...",options:c={},overrideServices:d={},saveViewState:h=!0,keepCurrentModel:v=!1,width:p="100%",height:y="100%",className:g,wrapperProps:w={},beforeMount:b=oe,onMount:k=oe,onChange:x,onValidate:I=oe}){let[C,P]=A.useState(!1),[M,B]=A.useState(!0),u=A.useRef(null),f=A.useRef(null),m=A.useRef(null),S=A.useRef(k),O=A.useRef(b),N=A.useRef(),T=A.useRef(n),V=Ss(o),Ye=A.useRef(!1),Oe=A.useRef(!1);wr(()=>{let $=vr.init();return $.then(H=>(u.current=H)&&B(!1)).catch(H=>H?.type!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>f.current?br():$.cancel()}),F(()=>{let $=Y(u.current,e||n||"",t||i||"",o||r||"");$!==f.current?.getModel()&&(h&&ge.set(V,f.current?.saveViewState()),f.current?.setModel($),h&&f.current?.restoreViewState(ge.get(o)))},[o],C),F(()=>{f.current?.updateOptions(c)},[c],C),F(()=>{!f.current||n===void 0||(f.current.getOption(u.current.editor.EditorOption.readOnly)?f.current.setValue(n):n!==f.current.getValue()&&(Oe.current=!0,f.current.executeEdits("",[{range:f.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),f.current.pushUndoStop(),Oe.current=!1))},[n],C),F(()=>{let $=f.current?.getModel();$&&i&&u.current?.editor.setModelLanguage($,i)},[i],C),F(()=>{l!==void 0&&f.current?.revealLine(l)},[l],C),F(()=>{u.current?.editor.setTheme(s)},[s],C);let Xe=A.useCallback(()=>{if(!(!m.current||!u.current)&&!Ye.current){O.current(u.current);let $=o||r,H=Y(u.current,n||e||"",t||i||"",$||"");f.current=u.current?.editor.create(m.current,{model:H,automaticLayout:!0,...c},d),h&&f.current.restoreViewState(ge.get($)),u.current.editor.setTheme(s),l!==void 0&&f.current.revealLine(l),P(!0),Ye.current=!0}},[e,t,r,n,i,o,c,d,h,s,l]);A.useEffect(()=>{C&&S.current(f.current,u.current)},[C]),A.useEffect(()=>{!M&&!C&&Xe()},[M,C,Xe]),T.current=n,A.useEffect(()=>{C&&x&&(N.current?.dispose(),N.current=f.current?.onDidChangeModelContent($=>{Oe.current||x(f.current.getValue(),$)}))},[C,x]),A.useEffect(()=>{if(C){let $=u.current.editor.onDidChangeMarkers(H=>{let Ae=f.current.getModel()?.uri;if(Ae&&H.find(Ce=>Ce.path===Ae.path)){let Ce=u.current.editor.getModelMarkers({resource:Ae});I?.(Ce)}});return()=>{$?.dispose()}}return()=>{}},[C,I]);function br(){N.current?.dispose(),v?h&&ge.set(o,f.current.saveViewState()):f.current.getModel()?.dispose(),f.current.dispose()}return X.createElement(yr,{width:p,height:y,isEditorReady:C,loading:a,_ref:m,className:g,wrapperProps:w})}var ks=Es,Vs=A.memo(ks);export{Ts as A,tn as B,kn as E,Ue as L,Gn as M,_n as P,$r as R,R as S,Fn as T,E as a,Cs as b,Vs as c,G as d,Tn as e,Wn as f,qn as g,Kn as h,As as i,Ps as j,vr as l,Qe as r,an as w}; + */const _t="INVALID_ARGS";function Bt(e){throw new Error(e)}function Ge(e){const t=Object.keys(e);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t}const Nn={}.hasOwnProperty;function be(e){if(Array.isArray(e))return e.slice();const t=e,r=Ge(t),n={};for(let i=0;i=e.length||t<0?e:e.slice(0,t).concat(e.slice(t+1))}function zt(e,t,r){if(e[t]===r)return e;const n=e.length,i=Array(n);for(let o=0;o=0||(i[l]=e[l])}return i}function Xt(e,t,r,n,i,o,...s){return s.length?z.call(null,!0,!1,e,t,r,n,i,o,...s):z(!0,!1,e,t,r,n,i,o)}function z(e,t,r,...n){let i=r;i==null&&Bt(_t);let o=!1;for(let s=0;s{const e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e};var In=Bn;const Jt=qe(In);/*! queue-microtask. MIT License. Feross Aboukhadijeh */let ot;var jn=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:Sr):e=>(ot||(ot=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0));const $n=qe(jn);var Zt={exports:{}};(function(e){var t=function(){var r=n({constructor:function(o,s){this.array=[],this.compare=s||i;for(var l=o.length,a=0;a=c;)if(h=(a+c)/2>>>0,v=l(s[h],o),v<0)c=h+1;else if(v>0)a=h-1;else{d=h;break}for(d===-1&&(d=a),d++,a=s.length-1;dd;)s[h]=s[--h];return s[d]=o,this},search:function(o){for(var s=this.array,l=this.compare,a=s.length-1,c=0,d,h;a>=c;)if(d=(a+c)/2>>>0,h=l(s[d],o),h<0)c=d+1;else if(h>0)a=d-1;else return d;return-1},remove:function(o){var s=this.search(o);return s>=0&&this.array.splice(s,1),this}});return r.comparing=function(o,s){return new r(s,function(l,a){return i(l[o],a[o])})},r;function n(o){var s=o.constructor;return s.prototype=o,s}function i(o,s){return os?1:0}}();e.exports=t})(Zt);var Fn=Zt.exports;const Un=qe(Fn);function er(e,t=[],r=new Map){for(const n of Object.keys(e)){const i=e[n],o=[...t,n];typeof i=="object"?er(i,o,r):r.set(o,i)}return r}function Ln(e){const t=er(e),r=n=>{for(const i of Array.from(t)){const[o,s]=i;if(Ke(n,o)!==s)return!1}return!0};return r.count=t.size,r}function zn(e){const t=r=>e===r;return t.count=1,t}var at=()=>new Un([],e=>e.matcher.count),Hn=class{constructor(e){this.store=at(),e?.forEach(([t,r])=>{this.set(t,r)})}set(e,t){const r=typeof e=="object"?Ln(e):zn(e);this.store.insert({key:e,value:t,matcher:r})}get(e){for(const t of this.store.array)if(t.matcher(e))return t.value}forEach(e){for(const t of this.store.array)e(t)}clear(){this.store=at()}isRegistryEmpty(){return this.store.array.length===0}},qn=Object.defineProperty,Kn=(e,t)=>{for(var r in t)qn(e,r,{get:t[r],enumerable:!0})},lt=e=>({name:"Value",value:e}),Gn=e=>({name:"Expression",value:e}),Wn=e=>({name:"PathNode",path:e}),Qn=(e,t)=>({name:"Query",key:e,value:t}),Yn=e=>e.length===1?e[0]:{name:"Concatenated",value:e},Xn=".",Me="{",Re="}",ct="[",Jn="]",ut="=",de="'",xe='"',fe="`",ht=e=>{if(!e)return!1;const t=e.charCodeAt(0);return!(t===32||t===34||t===39||t===40||t===41||t===42||t===46||t===61||t===91||t===93||t===96||t===123||t===125)},Zn=e=>{let t=1,r=e.charAt(0);const n=w=>{if(w&&r!==w)throw new Error(`Expected char: ${w} but got: ${r}`);return r=e.charAt(t),t+=1,r},i=()=>{for(;r===" ";)n()},o=()=>{if(!ht(r))return;let w=r;for(;n()&&ht(r);)w+=r;if(w){const b=Number(w);return w=isNaN(b)?w:b,lt(w)}},s=()=>{if(r===fe){n(fe);let w=r;for(;n()&&r!==fe;)w+=r;if(n(fe),w)return Gn(w)}},l=w=>{if(!r?.match(w))return;let b=r;for(;n()&&r?.match(w);)b+=r;if(b)return lt(b)},a=()=>{if(r===Me){n(Me),n(Me);const w=g();return n(Re),n(Re),w}},c=()=>a()??s()??o(),d=()=>{const w=[];let b=c();for(;b!==void 0;)w.push(b),b=c();if(w.length!==0)return Yn(w)},h=()=>{if(i(),r===de||r===xe){const w=r===de;n(w?de:xe);const b=l(/[^'"]+/);return n(w?de:xe),b}return c()},v=()=>{if(r!==ut)return!1;for(;r===ut;)n();return!0},p=()=>{if(r===ct){n(ct),i();let w=h();if(w){if(i(),v()){i();const b=h();w=Qn(w,b),i()}}else throw new Error("Expected identifier");return w&&n(Jn),w}},y=()=>{const w=[],b=d();if(b){w.push(b);let k=p();if(k?.name==="Value"){const x=Number(k.value);k.value=isNaN(x)||String(x)!==k.value?k.value:x}for(;k!==void 0;)w.push(k),k=p()}return w},g=()=>{const w=[];let b=y();for(;b!==void 0&&(w.push(...b),!(!r||r===Re));){if(b.length===0&&r)throw new Error(`Unexpected character: ${r}`);n(Xn),b=y()}return Wn(w)};try{return{status:!0,path:g()}}catch(w){return{status:!1,error:w.message}}};function W(e){return!(typeof e=="string"||Array.isArray(e))}function ei(e){const t=parseInt(e,10);return isNaN(t)?e:t}function ti(e){return Array.isArray(e)?e:typeof e=="string"?e.split("."):e.asArray()}function ri(e,t,r){return e.findIndex(n=>n&&typeof n=="object"?n[t]==r:!1)}var Q=class tr{constructor(t,r=n=>new tr(n)){const n=Array.isArray(t)?t:t.split(".");this.split=n.map(i=>{if(typeof i=="number")return i;const o=Number(i);return isNaN(o)?i:o}),Object.freeze(this.split),this.joined=this.split.join("."),this.factory=r}asArray(){return this.split}asString(){return this.joined}contains(t){const r=t.asArray();if(r.length-1?l.split(".").forEach(a=>{n.path.push(ei(a))}):n.path.push(l)}function s(l){const a=r?.beforeResolveNode.call(l,{...n,...t})??l;switch(a.name){case"Expression":case"PathNode":o(i(a));break;case"Value":o(a.value);break;case"Query":{const c=t.getValue(n.path)??[],{key:d,value:h}=a,v=i(d),p=h&&i(h),y=ri(c,v,p);y===void 0||y===-1?(n.updates[[...n.path,c.length,v].join(".")]=p,n.path.push(c.length)):n.path.push(y);break}case"Concatenated":n.path.push(a.value.map(i).join(""));break;default:throw new Error(`Unsupported node type: ${a.name}`)}}return e.path.forEach(s),{path:n.path,updates:Object.keys(n.updates??{}).length>0?n.updates:void 0}}var ni=/[\s()*=`{}'"[\]]/,ii=/^[^.]+(\..+)*$/,si={get:()=>{throw new Error("Not Implemented")},set:()=>{throw new Error("Not Implemented")},evaluate:()=>{throw new Error("Not Implemented")}},oi=class{constructor(e){this.hooks={skipOptimization:new J,beforeResolveNode:new R},this.parserOptions={...si,...e},this.cache={},this.parseCache={},this.parse=this.parse.bind(this)}normalizePath(e,t){if(!ni.test(e)&&ii.test(e)&&this.hooks.skipOptimization.call(e)!==!0)return{path:e.split("."),updates:void 0};const r=this.parseCache[e]??Zn(e);if(this.parseCache[e]=r,typeof r!="object"||!r?.status)throw new TypeError(`Cannot normalize path "${e}": ${r?.error??"Unknown Error."}`);try{return rr(r.path,t,this.hooks)}catch(n){throw new Z(`Cannot resolve binding: ${e}`,n)}}getBindingForNormalizedResult(e){const t=e.path.join(".");if(this.cache[t])return this.cache[t];const r=new Q(t===""?[]:e.path,this.parse);return this.cache[t]=r,r}parse(e,t={}){if(W(e))return e;const r={...this.parserOptions,...t};let n={};const i=Array.isArray(e)?e.join("."):String(e),o={getValue:a=>{const c=this.normalizePath(a.join("."),o);return r.get(this.getBindingForNormalizedResult(c))},evaluate:a=>r.evaluate(a),convertToPath:a=>{if(a===void 0)throw new Error("Attempted to convert undefined value to binding path");if(typeof a!="string"&&typeof a!="number"&&typeof a!="boolean")throw new Error(`Attempting to convert ${typeof a} to a binding path.`);const c=this.normalizePath(String(a),o);c.updates&&(n={...n,...c.updates});const d=c.path.join(".");if(d==="")throw new Error("Nested path resolved to an empty path");return d}},s=this.normalizePath(i,o);s.updates&&(n={...n,...s.updates});const l=Object.keys(n);if(!r.readOnly&&l.length>0){const a=l.map(c=>[this.parse(c),n[c]]);r.set(a)}return this.getBindingForNormalizedResult(s)}},ai=class{constructor(){this.readDeps=new Set,this.writeDeps=new Set,this.namedDependencySets={},this.namedSet="core",this.createSubset("core"),this.createSubset("children")}createSubset(e,t=!1){(t||!this.namedDependencySets[e])&&(this.namedDependencySets[e]={readDeps:new Set,writeDeps:new Set})}getDependencies(e){return e!==void 0?this.namedDependencySets?.[e]?.readDeps??new Set:this.readDeps}trackSubset(e){this.createSubset(e),this.namedSet=e}trackDefault(){this.namedSet="core"}getModified(e){return e!==void 0?this.namedDependencySets?.[e]?.writeDeps??new Set:this.writeDeps}readsBinding(e){return this.readDeps.has(e)}writesBinding(e){return this.writeDeps.has(e)}reset(){this.readDeps=new Set,this.writeDeps=new Set,this.namedDependencySets={},this.namedSet="core",this.createSubset("core",!0),this.createSubset("children",!0)}addReadDep(e,t=this.namedSet){t&&this.namedDependencySets?.[t]?.readDeps.add(e),this.readDeps.add(e)}addWriteDep(e,t=this.namedSet){t&&this.namedDependencySets?.[t]?.writeDeps.add(e),this.writeDeps.add(e)}addChildReadDep(e){this.addReadDep(e,"children")}},li=class extends ai{constructor(e){super(),this.rootModel=e,this.set=this.set.bind(this),this.get=this.get.bind(this)}set(e,t){return e.forEach(([r])=>this.addWriteDep(r)),this.rootModel.set(e,t)}get(e,t){return this.addReadDep(e),this.rootModel.get(e,t)}delete(e,t){return this.addWriteDep(e),this.rootModel.delete(e,t)}},ci=class{get(){}set(){return[]}delete(){}},dt=new ci,ui=new Q([]);function hi(e,t){function r(n,i){const o=W(n)?n:t(n,{get:e.get,set:e.set,readOnly:i});if(!o)throw new Error("Unable to parse binding");return o}return{get(n,i){return e.get(r(n,!0),i)},set(n,i){return e.set(n.map(([o,s])=>[r(o,!1),s]),i)},delete(n,i){return e.delete(r(n,!1),i)}}}function Fe(e,t,r){return r?{get:(n,i)=>{const o=i??t;return e.get?e.get(n,o,r):r?.get(n,o)},set:(n,i)=>{const o=i??t;return e.set?e.set(n,o,r):r?.set(n,o)},delete:(n,i)=>{const o=i??t;return e.delete?e.delete(n,o,r):r?.delete(n,o)}}:e}function Ne(e){if(e.length===0)return dt;if(e.length===1)return Fe(e[0]);function t(r){return e.reduce((i,o)=>Fe(o,r,i),void 0)??dt}return{get:(r,n)=>t(n)?.get(r,n),set:(r,n)=>t(n)?.set(r,n),delete:(r,n)=>t(n)?.delete(r,n)}}var di=class{constructor(e=[]){this.hooks={onSet:new E},this.pipeline=e,this.effectiveDataModel=Ne(this.pipeline)}setMiddleware(e){this.pipeline=e,this.effectiveDataModel=Ne(e)}addMiddleware(e){this.pipeline=[...this.pipeline,e],this.effectiveDataModel=Ne(this.pipeline)}reset(e={}){this.pipeline.forEach(t=>{"reset"in t&&t.reset?.()}),this.set([[ui,e]])}set(e,t){const r=this.effectiveDataModel.set(e,t);return this.hooks.onSet.call(e),r}get(e,t){return this.effectiveDataModel.get(e,t)}delete(e,t){return this.effectiveDataModel.delete(e,t)}},Ue=class{constructor(e={}){this.model=e,this.get=this.get.bind(this),this.set=this.set.bind(this)}reset(e={}){this.model=e}get(e){return!e||!e.asString()?this.model:Ke(this.model,e.asArray())}set(e){const t=[];return e.forEach(([r,n])=>{const i=this.get(r);this.model=U(this.model,r.asArray(),n),t.push({binding:r,oldValue:i,newValue:n})}),t}delete(e){const t=e.parent();if(t){const r=this.get(t);r!==void 0&&(Array.isArray(r)?this.model=U(this.model,t.asArray(),Rn(r,e.key())):this.model=U(this.model,t.asArray(),Dt(r,e.key())))}}},j=Symbol("Expression Node ID");function nr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.__id===j}var re=46,De=44,ft=39,pt=34,pe=40,gt=41,_e=91,vt=93,fi=63,pi=59,yt=58,we=123,Be=125,ge=!0,ir={"-":ge,"!":ge,"~":ge,"+":ge},We={"=":3,"+=":3,"-=":3,"&=":3,"|=":3,"||":5,"&&":6,"|":7,"^":8,"&":9,"==":10,"!=":10,"===":10,"!==":10,"<":11,">":11,"<=":11,">=":11,"<<":12,">>":12,">>>":12,"+":13,"-":13,"*":14,"/":14,"%":14};function D(e,t){const r=new Error(`${e} at character ${t}`);throw r.index=t,r.description=e,r}function wt(e,t){if(!(!e||!t))return{start:e.start,end:t.end}}function sr(e){let t=0;return Object.keys(e).forEach(r=>{r.length>t&&Object.prototype.hasOwnProperty.call(e,r)&&(t=r.length)}),t}var gi=sr(ir),vi=sr(We),mt={true:!0,false:!1,null:null,undefined:void 0},yi="this";function bt(e){return We[e]||0}function St(e,t,r,n){let i;return e==="||"||e==="&&"?i="LogicalExpression":e==="="?i="Assignment":e==="+="||e==="-="||e==="&="||e==="|="?i="Modification":i="BinaryExpression",{__id:j,type:i,operator:e,left:t,right:r,location:n}}function ne(e){return e>=48&&e<=57}function Ie(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122}function wi(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function mi(e,t){return e===we&&t===we}function bi(e,t){const r=t?.strict??!0,n=e.charAt,i=e.charCodeAt,{length:o}=e;let s=0;const l=u=>({start:{character:u},end:{character:s}});function a(u){return n.call(e,u)}function c(u){return i.call(e,u)}function d(){const u=[];let f=!1,m=!0,S,O,N;const T=s;for(++s;s0;){if(Object.prototype.hasOwnProperty.call(We,u))return s+=f,u;u=u.substr(0,--f)}return!1}function y(){let u,f,m,S=g(),O=p();if(!O)return S;let N={value:O,prec:bt(O)},T=g();T||D(`Expected expression after ${O}`,s);const V=[S,N,T];for(O=p();O&&(f=bt(O),f!==0);){for(N={value:O,prec:f};V.length>2&&f<=V[V.length-2].prec;)T=V.pop(),O=V.pop().value,S=V.pop(),u=St(O,S,T,wt(S.location,T.location)),V.push(u);u=g(),u||D(`Expected expression after ${O}`,s),V.push(N,u),O=p()}for(m=V.length-1,u=V[m];m>1;)u=St(V[m-1].value,V[m-2],u,wt(V[m-2].location,u.location)),m-=2;return u}function g(){h();const u=c(s),f=s;if(ne(u)||u===re)return w();if(u===ft||u===pt)return b();if(Ie(u)||u===pe)return C();if(u===_e)return M();if(mi(u,c(s+1)))return k();if(u===we)return d();let m=e.substr(s,gi),S=m.length;for(;S>0;){if(Object.prototype.hasOwnProperty.call(ir,m))return s+=S,{__id:j,type:"UnaryExpression",operator:m,argument:g(),prefix:!0,location:l(f)};m=m.substr(0,--S)}return!1}function w(){let u="";const f=s;for(;ne(c(s));)u+=a(s++);if(c(s)===re)for(u+=a(s++);ne(c(s));)u+=a(s++);let m=a(s);if(m==="e"||m==="E"){for(u+=a(s++),m=a(s),(m==="+"||m==="-")&&(u+=a(s++));ne(c(s));)u+=a(s++);ne(c(s-1))||D(`Expected exponent (${u}${a(s)})`,s)}const S=c(s);return Ie(S)?D(`Variable names cannot start with a number (${u}${a(s)})`,s):S===re&&D("Unexpected period",s),{__id:j,type:"Literal",value:parseFloat(u),raw:u,location:l(f)}}function b(){const u=a(s++);let f="",m=!1;const S=s;for(;sar,deleteDataVal:()=>ki,getDataVal:()=>Ei,setDataVal:()=>Si});var Si=(e,t,r)=>{e.model.set([[t,r]])},Ei=(e,t)=>e.model.get(t),ki=(e,t)=>e.model.delete(t),ar=(e,t,r,n)=>e.evaluate(t)?e.evaluate(r):n?e.evaluate(n):null;ar.resolveParams=!1;function Oi(e){return nr(e)?!1:typeof e=="object"&&e!==null&&!Array.isArray(e)&&"value"in e}var lr=(e,t,r)=>e.evaluate(t)&&e.evaluate(r);lr.resolveParams=!1;var cr=(e,t,r)=>e.evaluate(t)||e.evaluate(r);cr.resolveParams=!1;var Ai={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>ee<=t,"&&":lr,"||":cr,"!==":(e,t)=>e!==t,"===":(e,t)=>e===t,"|":(e,t)=>e|t,"&":(e,t)=>e&t,"+=":(e,t)=>e+t,"-=":(e,t)=>e-t,"&=":(e,t)=>e&t,"|=":(e,t)=>e|t},Ci={"-":e=>-e,"+":e=>Number(e),"!":e=>!e},Ti=class{constructor(e){this.vars={},this.hooks={resolve:new R,resolveOptions:new R,beforeEvaluate:new R,onError:new J},this.expressionsCache=new Map,this.operators={binary:new Map(Object.entries(Ai)),unary:new Map(Object.entries(Ci)),expressions:new Map(Object.entries(or))},this.defaultHookOptions={...e,evaluate:t=>this.evaluate(t,this.defaultHookOptions),resolveNode:t=>this._execAST(t,this.defaultHookOptions)},this.hooks.resolve.tap("ExpressionEvaluator",this._resolveNode.bind(this)),this.evaluate=this.evaluate.bind(this)}reset(){this.expressionsCache.clear()}evaluate(e,t){const r=this.hooks.resolveOptions.call({...this.defaultHookOptions,...t,resolveNode:i=>this._execAST(i,r)});let n=this.hooks.beforeEvaluate.call(e,r)??e;for(;Oi(n);)n=n.value;return typeof n=="number"||typeof n=="boolean"||n===void 0||n===null?n:nr(n)?this._execAST(n,r):Array.isArray(n)?n.reduce((i,o)=>this.evaluate(o,t),null):this._execString(String(n),r)}addExpressionFunction(e,t){this.operators.expressions.set(e,t)}addBinaryOperator(e,t){this.operators.binary.set(e,t)}addUnaryOperator(e,t){this.operators.unary.set(e,t)}setExpressionVariable(e,t){this.vars[e]=t}getExpressionVariable(e){return this.vars[e]}_execAST(e,t){return this.hooks.resolve.call(void 0,e,t)}_execString(e,t){if(e==="")return e;const r=e.match(/^@\[(.*)\]@$/);let n=e;r&&([,n]=Array.from(r));let i;try{i=this.expressionsCache.get(n)??bi(n,{strict:t.strict}),this.expressionsCache.set(n,i)}catch(o){if(t.throwErrors||!this.hooks.onError.call(o))throw new Z(`Error parsing expression: ${e}`,o);return}try{return this._execAST(i,t)}catch(o){if(t.throwErrors||!this.hooks.onError.call(o))throw new Z(`Error evaluating expression: ${e}`,o)}}_resolveNode(e,t,r){const{resolveNode:n,model:i}=r,o={...r,evaluate:s=>this.evaluate(s,r)};if(t.type==="Literal")return t.value;if(t.type==="Identifier")return this.vars[t.name];if(t.type==="Compound"||t.type==="ThisExpression")throw new Error(`Expression type: ${t.type} is not supported`);if(t.type==="BinaryExpression"||t.type==="LogicalExpression"){const s=this.operators.binary.get(t.operator);return s?"resolveParams"in s?s.resolveParams===!1?s(o,t.left,t.right):s(o,n(t.left),n(t.right)):s(n(t.left),n(t.right)):void 0}if(t.type==="UnaryExpression"){const s=this.operators.unary.get(t.operator);return s?"resolveParams"in s?s(o,s.resolveParams===!1?t.argument:n(t.argument)):s(n(t.argument)):void 0}if(t.type==="Object"){const{attributes:s}=t,l={};return s.forEach(a=>{const c=n(a.key),d=n(a.value);l[c]=d}),l}if(t.type==="CallExpression"){const s=t.callTarget.name,l=this.operators.expressions.get(s);if(!l)throw new Error(`Unknown expression function: ${s}`);if("resolveParams"in l&&l.resolveParams===!1)return l(o,...t.args);const a=t.args.map(c=>n(c));return l(o,...a)}if(t.type==="ModelRef")return i.get(t.ref,{context:{model:r.model}});if(t.type==="MemberExpression"){const s=n(t.object),l=n(t.property);return s[l]}if(t.type==="Assignment"){if(t.left.type==="ModelRef"){const s=n(t.right);return i.set([[t.left.ref,s]]),s}if(t.left.type==="Identifier"){const s=n(t.right);return this.vars[t.left.name]=s,s}return}if(t.type==="ConditionalExpression"){const s=n(t.test)?t.consequent:t.alternate;return n(s)}if(t.type==="ArrayExpression")return t.elements.map(s=>n(s));if(t.type==="Modification"){const s=this.operators.binary.get(t.operator);if(s){let l;return"resolveParams"in s?s.resolveParams===!1?l=s(o,t.left,t.right):l=s(o,n(t.left),n(t.right)):l=s(n(t.left),n(t.right)),t.left.type==="ModelRef"?i.set([[t.left.ref,l]]):t.left.type==="Identifier"&&(this.vars[t.left.name]=l),l}return n(t.left)}}},Pi=class{constructor(){this.hooks={trace:new E,debug:new E,info:new E,warn:new E,error:new E,log:new E},this.logHandlers=new Set,this.trace=this.createHandler("trace"),this.debug=this.createHandler("debug"),this.info=this.createHandler("info"),this.warn=this.createHandler("warn"),this.error=this.createHandler("error")}createHandler(e){return(...t)=>{this.hooks[e].call(t),this.hooks.log.call(e,t),this.logHandlers.forEach(r=>r[e](...t))}}addHandler(e){this.logHandlers.add(e)}removeHandler(e){this.logHandlers.delete(e)}},Vi=class{constructor(e){this.trace=this.createHandler("trace"),this.debug=this.createHandler("debug"),this.info=this.createHandler("info"),this.warn=this.createHandler("warn"),this.error=this.createHandler("error"),this.proxiedLoggerProvider=e}createHandler(e){return(...t)=>{this.proxiedLoggerProvider()?.[e](...t)}}},Et=e=>e;function Mi(e){const t=new Map;if(!e.ROOT)return t;const r=[{node:e.ROOT,path:[],visited:new Set}];for(;r.length>0;){const n=r.shift();if(!n)break;const{node:i,path:o,visited:s}=n;Object.entries(i).forEach(([l,a])=>{const c=[...o,l],d=c.join(".");if(t.has(d))throw new Error("Path has already been processed. There's either a loop somewhere or a bug");if(s.has(a.type))throw new Error(`Path already contained type: ${a.type}. This likely indicates a loop in the schema`);t.set(d,a),a.isArray&&c.push("[]"),a.isRecord&&c.push("{}"),a.type&&e[a.type]&&r.push({path:c,node:e[a.type],visited:new Set([...s,a.type])})})}return t}var Ri=class{constructor(e){this.formatters=new Map,this.types=new Map,this.schema=new Map,this.bindingSchemaNormalizedCache=new Map,this.hooks={resolveTypeForBinding:new R},this.schema=e?Mi(e):new Map}addFormatters(e){e.forEach(t=>{this.formatters.set(t.name,t)})}addDataTypes(e){e.forEach(t=>{this.types.set(t.type,t)})}getValidationsForBinding(e){const t=this.getApparentType(e);if(t?.validation?.length)return t.validation.map(r=>({severity:"error",trigger:"change",...r}))}normalizeBinding(e){const t=this.bindingSchemaNormalizedCache.get(e);if(t)return t;let r=e.asArray(),n=r.map(i=>typeof i=="number"?"[]":i).join(".");return n&&(this.bindingSchemaNormalizedCache.set(e,n),r=n.split(".")),r.forEach(i=>{const o=r.map(s=>s===i?"{}":s).join(".");this.schema.get(o)&&(this.bindingSchemaNormalizedCache.set(e,o),r=o.split("."),n=o)}),n}getType(e){return this.hooks.resolveTypeForBinding.call(this.schema.get(this.normalizeBinding(e)),e)}getApparentType(e){const t=this.getType(e);if(t===void 0)return;const r=this.getTypeDefinition(t?.type);return r===void 0?t:{...r,...t,validation:[...t.validation??[],...r.validation??[]]}}getTypeDefinition(e){return this.types.get(e)}getFormatterForType(e){const{type:t,...r}=e,n=this.formatters.get(t);if(n)return{format:n.format?i=>n.format?.(i,r):Et,deformat:n.deformat?i=>n.deformat?.(i,r):Et}}getFormatter(e){const t=this.getApparentType(e);if(t?.format)return this.getFormatterForType(t.format)}},L="{{",je="}}";function xi(e){const t=e.indexOf(L);if(t===-1)return;let r=1,n=t+L.length,i=e.substring(t+L.length);for(;r>0&&i.length>0;){const o=i.indexOf(je);if(o===-1)break;const s=i.indexOf(L);s!==-1&&s0&&r.forEach(i=>{n=U(n,[i],hr(e[i],t))}),n}default:return e}}function Qe(e,t){return hr(e,t)}function dr(e,t){const r=new Map(e),n=t.parent(),i=t.key();return r.forEach((o,s)=>{(t===s||t.contains(s))&&r.delete(s)}),typeof i=="number"&&Array.from(e.keys()).filter(s=>{if(n.contains(s)){const[l]=s.relative(n);return typeof l=="number"&&l>i}return!1}).sort().forEach(s=>{const[l,...a]=s.relative(n);if(typeof l=="number"){const c=[l-1,...a],d=n.descendent(c);r.set(d,r.get(s)),r.delete(s)}}),r}var Di=class{constructor(e,t){this.validator=e,this.shadowModelPaths=new Map,this.logger=t?.logger,this.shouldIncludeInvalid=t?.shouldIncludeInvalid}set(e,t,r){const n=Fe(this,{...t,includeInvalid:!0},r),i=[],o=new Set;e.forEach(([c,d])=>{this.shadowModelPaths.set(c,d),o.add(c)});const s=[];this.shadowModelPaths.forEach((c,d)=>{const h=this.validator(d,n);h===void 0?i.push([d,c]):h instanceof Set?h.forEach(v=>{s.push(v.binding),!v.isStrong&&v.binding.asString()===d.asString()&&i.push([v.binding,c])}):o.has(d)&&(s.push(d),this.logger?.debug(`Invalid value for path: ${d.asString()} - ${h.severity} - ${h.message}`))});let l=[];if(r&&i.length>0){i.forEach(([d])=>this.shadowModelPaths.delete(d));const c=r.set(i,t);if(s.length===0)return c;l=c}const a=s.map(c=>({binding:c,oldValue:n.get(c),newValue:n.get(c),force:!0}));return[...l,...a]}get(e,t,r){let n=r?.get(e,t);return(this.shouldIncludeInvalid?.(t)??t?.includeInvalid===!0)&&this.shadowModelPaths.forEach((i,o)=>{if(o===e){n=i;return}e.contains(o)&&(n=U(n,o.relative(e),i))}),n}delete(e,t,r){return this.shadowModelPaths=dr(this.shadowModelPaths,e),r?.delete(e,t)}},_i=class{constructor(){this.registry=new Map}get(e){return this.registry.get(e)}register(e,t){this.registry.set(e,t)}};function Bi(e,t){return Object.hasOwnProperty.call(e,"template")&&Array.isArray(e?.template)&&e.template.length&&e.template.find(r=>r.output===t)}function kt(e){return e==="staticSwitch"||e==="dynamicSwitch"}function fr(e){return e==="template"}function Ii(e){if(e&&"value"in e&&typeof e.value=="object"&&typeof e.value?.id=="string")return e.value.id}var ji={type:"empty"},$i=class{constructor(){this.hooks={onParseObject:new R,onCreateASTNode:new R,parseNode:new J}}parseView(e){const t=this.parseObject(e,"view");if(!t)throw new Error("Unable to parse object into a view");return t}createASTNode(e,t){const r=this.hooks.onCreateASTNode.call(e,t);return r===void 0?e:r}parseObject(e,t="value",r={templateDepth:0}){const n=this.hooks.parseNode.call(e,t,r);if(n||n===null)return n;const i=(a,c,d=[])=>{if(typeof c!="object"||c===null)return{value:c,children:[]};const h=this.hooks.onParseObject.call(c,t);if(!h)return a;const v=Array.isArray(h)?h.map((g,w)=>[w,g]):[...Object.entries(h),...Object.getOwnPropertySymbols(h).map(g=>[g,h[g]])],p={children:[],value:a};return v.reduce((g,w)=>{let{value:b}=g;const{children:k}=g,[x,I]=w,C=this.hooks.parseNode.call(I,"value",r,{path:d,key:x,parentObj:h});if(C)k.push(...C);else if(I&&typeof I=="object"){const P=i(g.value,I,[...d,x]);b=P.value,k.push(...P.children)}else b=U(g.value,[...d,x],I);return{value:b,children:k}},p)},{value:o,children:s}=i(void 0,e),l=o===void 0&&!s.length?void 0:{type:t,value:o};if(l&&s.length){const a=l;a.children=s,s.forEach(c=>{c.value.parent=a})}return this.hooks.onCreateASTNode.call(l,e)??null}};function Le(e,t){if(!e||!t)return!0;const r=Array.from(t.values()),n=Array.from(e.values());return r.find(i=>!!n.find(o=>o===i||o.contains(i)||i.contains(o)))!==void 0}function pr(e){return{...e,data:{model:e.model,formatValue:(t,r)=>e.formatValue?e.formatValue(t,r):r,format:(t,r)=>e.format?e.format(W(t)?t:e.parseBinding(t),r):r},evaluate:t=>e.evaluator.evaluate(t,e)}}var Fi=e=>({get:(t,r)=>e.get(t,{context:{model:e},...r}),set:(t,r)=>e.set(t,{context:{model:e},...r}),delete:(t,r)=>e.delete(t,{context:{model:e},...r})}),Ui=class{constructor(e,t){this.hooks={skipResolve:new R,beforeUpdate:new E,afterUpdate:new E,resolveOptions:new R,beforeResolve:new R,resolve:new R,afterResolve:new R,afterNodeUpdate:new E},this.root=e,this.options=t,this.resolveCache=new Map,this.ASTMap=new Map,this.logger=t.logger,this.idCache=new Set}getSourceNode(e){return this.ASTMap.get(e)}update(e){this.hooks.beforeUpdate.call(e);const t=new Map;this.idCache.clear();const r=new Map(this.ASTMap);this.ASTMap.clear();const n=this.computeTree(this.root,void 0,e,t,pr(this.options),void 0,r);return this.resolveCache=t,this.hooks.afterUpdate.call(n.value),n.value}getResolveCache(){return new Map(this.resolveCache)}getPreviousResult(e){if(!e)return;const t=this.resolveCache.size===0,r=Ii(e);if(r){if(this.idCache.has(r)){t&&(e.type==="asset"||e.type==="view"?this.logger?.error(`Cache conflict: Found Asset/View nodes that have conflicting ids: ${r}, may cause cache issues.`):e.type==="value"&&this.logger?.info(`Cache conflict: Found Value nodes that have conflicting ids: ${r}, may cause cache issues. To improve performance make value node IDs globally unique.`));return}this.idCache.add(r)}return this.resolveCache.get(e)}cloneNode(e){const t=Vn(e);return Object.keys(t).forEach(r=>{if(r==="parent")return;const n=t[r];typeof n=="object"&&n!==null&&(t[r]=Array.isArray(n)?[...n]:{...n})}),t}computeTree(e,t,r,n,i,o,s){const l=new li(i.data.model);l.trackSubset("core");const a=Fi(hi(l,this.options.parseBinding)),c=this.hooks.resolveOptions.call({...i,data:{...i.data,model:a},evaluate:C=>this.options.evaluator.evaluate(C,{model:a}),node:e},e),d=this.getPreviousResult(e),h=d?.dependencies,v=Le(r,h),p=this.hooks.skipResolve.call(!v,e,c),y={...this.cloneNode(e),parent:o},g=this.hooks.beforeResolve.call(y,c)??{type:"empty"},w=g.type==="multi-node"&&o?.parent?.type==="multi-node"&&o.type==="value";if(d&&p){const C={...d,updated:!1},P=(M,B,u)=>{const{node:f}=M;this.ASTMap.set(f,B);const m={...M,updated:!1};n.set(B,m);const S=O=>{const N=s.get(O)??O,T=this.getPreviousResult(N);T&&P(T,N,B)};"children"in f?f.children?.forEach(({value:O})=>S(O)):f.type==="multi-node"&&f.values.forEach(S),this.hooks.afterNodeUpdate.call(B,u,m)};return d.node.parent=o,P(d,e,t),C}g.parent=o,c.node=g,this.ASTMap.set(g,e);let b=this.hooks.resolve.call(void 0,g,c),k=!G(d?.value,b);d&&!k&&(b=d?.value);const x=new Set;if(l.trackSubset("children"),"children"in g){const C=g.children?.map(P=>{const M=this.computeTree(P.value,e,r,n,c,g,s),{dependencies:B,node:u,updated:f,value:m}=M;if(B.forEach(S=>x.add(S)),m)if(u.type==="multi-node"&&!u.override){const S=Mn(Ke(b,P.path,[]),m);b=U(b,P.path,S)}else b=U(b,P.path,m);return k=k||f,{...P,value:u}});g.children=C}else if(g.type==="multi-node"){const C=[],P=w?o?.parent:e,M=g.values.map(B=>{const u=this.computeTree(B,P,r,n,c,g,s);return u.value!==void 0&&u.value!==null&&C.push(u.value),u.dependencies.forEach(f=>x.add(f)),k=k||u.updated,u.node});g.values=M,b=C}x.forEach(C=>l.addChildReadDep(C)),l.trackSubset("core"),d&&!k&&(b=d?.value),b=this.hooks.afterResolve.call(b,g,{...c,getDependencies:C=>l.getDependencies(C)});const I={node:g,updated:k,value:b,dependencies:new Set([...l.getDependencies(),...x])};return this.hooks.afterNodeUpdate.call(e,w?o?.parent:t,I),n.set(e,I),I}},Li=class{constructor(e,t,r){this.allValidations=new Set,this.byBinding=new Map,this.logger=r,this.parse(e,t)}parse(e,t){const r=e.validation;if(r!==void 0){if(!Array.isArray(r)){this.logger?.warn(`Unable to register view validations for id: ${e.id}. 'validation' property must be an Array.`);return}r.forEach(n=>{const i={trigger:"navigation",severity:"error",...n};this.allValidations.add(i);const{ref:o}=n;if(o){const s=t(o);this.byBinding.has(s)?this.byBinding.get(s)?.push(i):this.byBinding.set(s,[i])}})}}getValidationsForBinding(e){return this.byBinding.get(e)}},zi=class{constructor(e,t){this.hooks={onUpdate:new E,parser:new E,resolver:new E,onTemplatePluginCreated:new E,templatePlugin:new E},this.initialView=e,this.resolverOptions=t,this.hooks.onTemplatePluginCreated.tap("view",r=>{this.templatePlugin=r})}updateAsync(){const e=this.resolver?.update();this.lastUpdate=e,this.hooks.onUpdate.call(e)}update(e){if(this.rootNode===void 0){this.validationProvider=new Li(this.initialView,this.resolverOptions.parseBinding,this.resolverOptions.logger),this.templatePlugin?this.hooks.templatePlugin.call(this.templatePlugin):this.resolverOptions.logger?.warn("templatePlugin not set for View, legacy templates may not work");const r=new $i;this.hooks.parser.call(r),this.rootNode=r.parseView(this.initialView),this.resolver=new Ui(this.rootNode,{...this.resolverOptions,parseNode:r.parseObject.bind(r)}),this.hooks.resolver.call(this.resolver)}const t=this.resolver?.update(e);return this.lastUpdate===t?this.lastUpdate:(this.lastUpdate=t,this.hooks.onUpdate.call(t),t)}getValidationsForBinding(e){return this.validationProvider?.getValidationsForBinding(e)}},Hi=class{constructor(e){this.hooks={resolveTemplateSubstitutions:new R},this.options=e}parseTemplate(e,t,r){const{template:n,depth:i}=t,o=r.data.model.get(t.data);if(!o)return null;if(!Array.isArray(o))throw new Error(`Template using '${t.data}' but is not an array`);const s=[];return o.forEach((a,c)=>{const d=this.hooks.resolveTemplateSubstitutions.call([{expression:new RegExp(`_index${i||""}_`),value:String(c)}],{depth:i,data:a,index:c});let h=JSON.stringify(n);for(const{expression:p,value:y}of d){let g="g";typeof p=="object"&&(g=`${p.flags}${p.global?"":"g"}`),h=h.replace(new RegExp(p,g),y)}const v=e(JSON.parse(h),"value",{templateDepth:t.depth+1});v&&s.push(v)}),{type:"multi-node",override:!1,values:s}}applyParser(e){e.hooks.onCreateASTNode.tap("template",t=>t&&t.type==="template"&&!t.dynamic?this.parseTemplate(e.parseObject.bind(e),t,this.options):t),e.hooks.parseNode.tap("template",(t,r,n,i)=>{if(i&&fr(i.key))return t.map(o=>{const s=e.createASTNode({type:"template",depth:n.templateDepth??0,data:o.data,template:o.value,dynamic:o.dynamic??!1},o);if(s)return s.type==="multi-node"&&s.values.forEach(l=>{l.parent=s}),{path:[...i.path,o.output],value:s}}).filter(Boolean)})}applyResolverHooks(e){e.hooks.beforeResolve.tap("template",(t,r)=>t&&t.type==="template"&&t.dynamic?this.parseTemplate(r.parseNode,t,r):t)}apply(e){e.hooks.parser.tap("template",this.applyParser.bind(this)),e.hooks.resolver.tap("template",this.applyResolverHooks.bind(this))}},gr=(e,t)=>r=>{const n=r.indexOf(e);if(n===-1)return!1;const i=r.indexOf(t);return i===-1?!1:n{if(r.has(i))return;const o=e[i];let s=o;typeof o=="object"?s=vr(o,t,r):typeof o=="string"&&(s=Ot(o,t)),s!==o&&(n=xn(n,i,s))}),n}var yr=(e,t)=>{const r=e.parent;if(!r)return[];if("children"in r){const n=t.getSourceNode(e);return r.children?.find(i=>i.value===n)?.path??[]}return r.type!=="multi-node"?[]:yr(r,t)},Wi=class{constructor(){this.propertiesToSkipCache=new Map}applyResolver(e){e.hooks.resolve.tap("string-resolver",(t,r,n)=>{if(r.type==="empty"||r.type==="unknown")return null;if(r.type==="value"||r.type==="asset"||r.type==="view"){let i;r.type==="asset"||r.type==="view"?(i=new Set(r.plugins?.stringResolver?.propertiesToSkip??["exp"]),r.value?.id&&this.propertiesToSkipCache.set(r.value.id,i)):r.parent?.type==="multi-node"&&(r.parent?.parent?.type==="asset"||r.parent?.parent?.type==="view")&&r.parent.parent.value?.id&&this.propertiesToSkipCache.has(r.parent.parent.value.id)?i=this.propertiesToSkipCache.get(r.parent.parent.value.id):i=new Set(["exp"]);const o=yr(r,e);return o.length>0&&o.some(s=>i.has(s.toString()))?r.value:vr(r.value,n,i)}return t})}apply(e){e.hooks.resolver.tap("string-resolver",this.applyResolver.bind(this))}},Qi=class{isApplicability(e){return e&&Object.prototype.hasOwnProperty.call(e,"applicability")}applyResolver(e){e.hooks.beforeResolve.tap("applicability",(t,r)=>{let n=t;if(t?.type==="applicability"){if(r.evaluate(t.expression)===!1)return null;n=t.value}return n})}applyParser(e){e.hooks.parseNode.tap("applicability",(t,r,n,i)=>{if(this.isApplicability(t)){const o=e.parseObject(Dt(t,"applicability"),r,n);if(!o)return i?[]:null;const s=e.createASTNode({type:"applicability",expression:t.applicability,value:o},t);return s?(s.type==="applicability"&&(s.value.parent=s),i?[{path:[...i.path,i.key],value:s}]:s):i?[]:null}})}apply(e){e.hooks.resolver.tap("applicability",this.applyResolver.bind(this)),e.hooks.parser.tap("applicability",this.applyParser.bind(this))}},Yi=class{constructor(e){this.options=e}resolveSwitch(e,t){for(const r of e.cases)if(t.evaluate(r.case))return r.value;return ji}isSwitch(e){return e&&(Object.prototype.hasOwnProperty.call(e,"dynamicSwitch")||Object.prototype.hasOwnProperty.call(e,"staticSwitch"))}applyParser(e){e.hooks.onCreateASTNode.tap("switch",t=>t&&t.type==="switch"&&!t.dynamic?this.resolveSwitch(t,this.options):t),e.hooks.parseNode.tap("switch",(t,r,n,i)=>{if(this.isSwitch(t)||i&&kt(i.key)){const o=i&&kt(i.key)?{[i.key]:t}:t,s="dynamicSwitch"in o,a=(s?o.dynamicSwitch:o.staticSwitch).map(d=>{const{case:h,...v}=d,p=e.parseObject(v,"value",n);if(p)return{case:h,value:p}}).filter(Boolean),c=e.createASTNode({type:"switch",dynamic:s,cases:a},o);if(!c||c.type==="empty")return i?[]:null;if(c.type==="switch"&&c.cases.forEach(d=>{d.value.parent=c}),i){let d=[...i.path,i.key],h=c;if(c.type==="value"&&c.children?.length===1&&c.value===void 0){const v=c.children[0];d=[...d,...v.path],h=v.value}return[{path:d,value:h}]}return c}})}applyResolver(e){e.hooks.beforeResolve.tap("switch",(t,r)=>t&&t.type==="switch"&&t.dynamic?this.resolveSwitch(t,r):t)}apply(e){e.hooks.parser.tap("switch",this.applyParser.bind(this)),e.hooks.resolver.tap("switch",this.applyResolver.bind(this))}},Xi=class{applyParser(e){e.hooks.parseNode.tap("multi-node",(t,r,n,i)=>{if(i&&!fr(i.key)&&Array.isArray(t)){const o=t.map(l=>e.parseObject(l,"value",n)).filter(l=>!!l);if(!o.length)return[];const s=e.createASTNode({type:"multi-node",override:!Bi(i.parentObj,i.key),values:o},t);return s?(s.type==="multi-node"&&s.values.forEach(l=>{l.parent=s}),[{path:[...i.path,i.key],value:s}]):[]}})}apply(e){e.hooks.parser.tap("multi-node",this.applyParser.bind(this))}},Ji=class{applyParser(e){e.hooks.parseNode.tap("asset",(t,r,n,i)=>{if(i?.key==="asset"&&typeof t=="object"){const o=e.parseObject(t,"asset",n);return o?[{path:[...i.path,i.key],value:o}]:[]}})}apply(e){e.hooks.parser.tap("asset",this.applyParser.bind(this))}},Zi=class{constructor(e,t,r){this.isTransitioning=!1,this.hooks={beforeStart:new J,onStart:new E,onEnd:new E,skipTransition:new J,beforeTransition:new R,resolveTransitionNode:new R,transition:new E,afterTransition:new E},this.id=e,this.flow=t,this.log=r?.logger,this.history=[],this.hooks.transition.tap("startPromise",async(n,i)=>{const o=i.value;this.flowPromise&&o.state_type==="END"&&this.flowPromise.resolve(o)})}async start(){if(this.flowPromise)return this.log?.warn("Already called start for flow"),this.flowPromise.promise;this.flow=this.hooks.beforeStart.call(this.flow)||this.flow,this.flow.onStart&&this.hooks.onStart.call(this.flow.onStart);const e=this.flow.startState;return e?(this.flowPromise=Jt(),this.pushHistory(e),this.flowPromise.promise):Promise.reject(new Error("No 'startState' defined for flow"))}transition(e,t){if(this.isTransitioning)throw new Error(`Transitioning while ongoing transition from ${this.currentState?.name} is in progress is not supported`);if(this.currentState?.value.state_type==="END"){this.log?.warn(`Skipping transition using ${e}. Already at and END state`);return}if(this.currentState===void 0)throw new Error("Cannot transition when there's no current state");if(t?.force)this.log?.debug("Forced transition. Skipping validation checks");else if(this.hooks.skipTransition.call(this.currentState)){this.log?.debug(`Skipping transition from ${this.currentState.name} b/c hook told us to`);return}const r=this.hooks.beforeTransition.call(this.currentState.value,e);if(!("transitions"in r))throw new Error(`No transitions defined for ${this.currentState.value}`);const{transitions:n}=r,i=n[e]||n["*"];if(i===void 0){this.log?.warn(`No transition from ${this.currentState.name} using ${e} or *`);return}return this.log?.debug(`Transitioning from ${this.currentState.name} to ${i} using ${e} `),this.pushHistory(i,t)}pushHistory(e,t){if(!Object.prototype.hasOwnProperty.call(this.flow,e))throw new Error(`No flow definition for: ${e} was found.`);let r=this.flow[e];if(!this.flow[e]||typeof r!="object"||!("state_type"in r)){this.log?.error(`Flow doesn't contain any states named: ${e}`);return}const n=this.currentState;this.isTransitioning=!0,r=this.hooks.resolveTransitionNode.call(r);const i={name:e,value:r};this.currentState=i,this.history.push(e),i.value.state_type==="END"&&this.flow.onEnd&&this.hooks.onEnd.call(this.flow.onEnd),this.hooks.transition.call(n,{...i}),this.isTransitioning=!1,this.hooks.afterTransition.call(this)}},es=class{constructor(e,t){this.hooks={flow:new E},this.navigation=e,this.navStack=[],this.log=t?.logger,this.start=this.start.bind(this),this.run=this.run.bind(this),this.transition=this.transition.bind(this),this.addNewFlow=this.addNewFlow.bind(this)}transition(e,t){if(this.current===void 0)throw new Error("Not currently in a flow. Cannot transition.");this.current.transition(e,t)}addNewFlow(e){this.navStack.push(e),this.current=e,this.hooks.flow.call(e)}async run(e){if(!Object.prototype.hasOwnProperty.call(this.navigation,e))return Promise.reject(new Error(`No flow defined for: ${e}`));const t=this.navigation[e];if(t===null||typeof t!="object")return Promise.reject(new Error(`Flow: ${e} needs to be an object`));this.log?.debug(`Starting flow: ${e}`);const r=new Zi(e,t,{logger:this.log});this.addNewFlow(r),r.hooks.afterTransition.tap("flow-controller",i=>{if(i.currentState?.value.state_type==="FLOW"){const o=i.currentState?.value.ref;this.log?.debug(`Loading subflow ${o}`),this.run(o).then(s=>{this.log?.debug(`Subflow ended. Using outcome: ${s.outcome}`),i.transition(s?.outcome)})}});const n=await r.start();return this.navStack.pop(),this.navStack.length>0&&(this.current=this.navStack[0]),n}async start(){return this.navigation.BEGIN?this.run(this.navigation.BEGIN):Promise.reject(new Error("Must supply a BEGIN state"))}},ts=/%([a-zA-Z]+)/g;function rs(e,t){return e.slice().replace(ts,r=>t[r.slice(1)]||r)}var ie="validation-binding-tracker",ns=class{constructor(e){this.trackedBindings=new Set,this.options=e}getBindings(){return this.trackedBindings}trackBinding(e){this.trackedBindings.has(e)||(this.trackedBindings.add(e),this.options.callbacks?.onAdd?.(e))}applyResolver(e){this.trackedBindings.clear();const t=new Map,r=new Map;let n;const i=new Map;let o=new Map;const s=new Map,l=new Map;e.hooks.beforeUpdate.tap(ie,a=>{n=a}),e.hooks.skipResolve.tap(ie,(a,c)=>{const d=i.get(c);return!a||!n||!d?a:new Set([...n].filter(v=>d.has(v))).size===0}),e.hooks.resolveOptions.tap(ie,(a,c)=>{if(a.validation===void 0)return a;t.delete(c);const d=h=>{const v=W(h)?h:this.options.parseBinding(h);t.has(c)?t.get(c)?.add(v):t.set(c,new Set([v]));let{parent:p}=c;for(;p;)if(r.has(p)){r.get(p)?.add(c);break}else p=p.parent;this.trackedBindings.add(v),this.options.callbacks?.onAdd?.(v)};return{...a,validation:{...a.validation,get:(h,v)=>(v?.track&&d(h),a.validation?._getValidationForBinding(h)?.getAll(v)?.find(g=>g.displayTarget==="field"||g.displayTarget===void 0)),getValidationsForBinding(h,v){return v?.track&&d(h),a.validation?._getValidationForBinding(h)?.getAll(v)??[]},getChildren:h=>{const v=new Array;return i.get(c)?.forEach(p=>{const y=a.validation?._getValidationForBinding(p)?.get();y&&(h===void 0||h===y.displayTarget)&&v.push(y)}),v},getValidationsForSection:()=>{const h=new Array;return s.get(c)?.forEach(v=>{const p=a.validation?._getValidationForBinding(v)?.get();p&&p.displayTarget==="section"&&h.push(p)}),h},register:h=>{h?.type==="section"&&(r.has(c)||r.set(c,new Set))},track:d}}}),e.hooks.afterNodeUpdate.tap(ie,(a,c,d)=>{const{updated:h,node:v}=d;if(l.set(v,a),h){const p=new Set(t.get(a));v.type==="multi-node"&&v.values.forEach(y=>o.get(y)?.forEach(g=>p.add(g))),"children"in v&&v.children&&v.children.forEach(y=>{o.get(y.value)?.forEach(g=>p.add(g))}),o.set(v,p)}else o.set(v,i.get(a)??new Set);a===e.root&&(this.trackedBindings=new Set(o.get(v)),i.clear(),o.forEach((p,y)=>{const g=l.get(y);g&&i.set(g,p)}),s.clear(),r.forEach((p,y)=>{const g=new Set;p.forEach(w=>{t.get(w)?.forEach(g.add,g)}),s.set(y,g)}),t.clear(),r.clear(),o=new Map)})}apply(e){e.hooks.resolver.tap(ie,this.applyResolver.bind(this))}},is="schema",ss="view",os=Symbol.for("validation-provider-name");function as(e,t){if(e.size>t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function ls(e){return{value:e,type:e.severity,state:"none",isBlockingNavigation:!1}}var cs=class{constructor(e,t,r,n){this.applicableValidations=[],this.validationsByState={load:[],change:[],navigation:[]},this.onDismiss=t,e.forEach(i=>{const{trigger:o}=i;if(this.validationsByState[o]){const s=ls(i);this.validationsByState[o].push(s)}else r?.warn(`Unknown validation trigger: ${o}`)}),this.weakBindings=n??new Set}get allValidations(){return Object.values(this.validationsByState).flat()}checkIfBlocking(e){if(e.state==="active"){const{isBlockingNavigation:t}=e;return t}return!1}getAll(){return this.applicableValidations.reduce((e,t)=>(t.state==="active"&&t.response&&e.push({...t.response,blocking:this.checkIfBlocking(t)}),e),[])}get(){const e=this.applicableValidations.find(t=>t.state==="active"&&t.response);if(e?.state==="active")return{...e.response,blocking:this.checkIfBlocking(e)}}runApplicableValidations(e,t,r){this.applicableValidations=this.applicableValidations.map(n=>{if(n.state==="dismissed")return n;const i=n.value.blocking??(n.value.severity==="warning"&&"once"||!0),o=U(n,["value","blocking"],i),s=i===!0||i==="once"&&!t;if(r==="navigation"&&o.state==="active"&&o.value.blocking!==!0&&o.value.severity==="warning"){const c=o;return c.dismissable&&c.response.dismiss&&(c.response.blocking!=="once"||!c.response.blocking)?c.response.dismiss():(c?.response.blocking==="once"&&(c.response.blocking=!1),c.dismissable=!0),c}const l=e(o.value),a={type:o.type,value:o.value,state:l?"active":"none",isBlockingNavigation:s,dismissable:o.value.severity==="warning"&&r==="navigation",response:l?{...o.value,message:l.message??"Something is broken",severity:o.value.severity,displayTarget:o.value.displayTarget??"field"}:void 0};return a.state==="active"&&o.value.severity==="warning"&&(a.response.dismiss=()=>{a.state="dismissed",this.onDismiss?.()}),a})}update(e,t,r){const n=[];if(!(e==="load"&&this.currentPhase!==void 0)){if(this.currentPhase==="navigation"||e===this.currentPhase){this.runApplicableValidations(r,t,e);return}e==="load"?(this.currentPhase="load",this.applicableValidations=[...this.validationsByState.load]):e==="change"&&this.currentPhase==="load"?(this.currentPhase="change",this.applicableValidations=[...this.applicableValidations,...this.validationsByState.change]):e==="navigation"&&(this.currentPhase==="load"||this.currentPhase==="change")&&(this.applicableValidations.forEach(i=>{i.type==="error"&&i.state==="active"&&i.isBlockingNavigation===!1||n.push(i)}),this.applicableValidations=[...n,...this.validationsByState.navigation,...this.currentPhase==="load"?this.validationsByState.change:[]],this.currentPhase="navigation"),this.runApplicableValidations(r,t,e)}}},us=class{constructor(e,t){this.hooks={createValidatorRegistry:new E,onAddValidation:new R,onRemoveValidation:new R,resolveValidationProviders:new R,onTrackBinding:new E},this.validations=new Map,this.weakBindingTracker=new Set,this.schema=e,this.options=t,this.reset()}setOptions(e){this.options=e}getDataMiddleware(){return[{set:(e,t,r)=>r?.set(e,t)??[],get:(e,t,r)=>r?.get(e,t),delete:(e,t,r)=>(this.validations=dr(this.validations,e),r?.delete(e,t))},new Di(e=>{if(!this.options)return;this.updateValidationsForBinding(e,"change",this.options);const t=this.getValidationForBinding(e);if(t?.get()?.severity==="error")return t.get();const r=new Set;if(this.validations.forEach((n,i)=>{Le(new Set([e]),n.weakBindings)&&n?.get()?.severity==="error"&&n?.weakBindings.forEach(o=>{o===i?r.add({binding:o,isStrong:!0}):r.add({binding:o,isStrong:!1})})}),r.size>0)return r},{logger:new Vi(()=>this.options?.logger)})]}getValidationProviders(){return this.providers?this.providers:(this.providers=this.hooks.resolveValidationProviders.call([{source:is,provider:this.schema},{source:ss,provider:{getValidationsForBinding:e=>this.viewValidationProvider?.getValidationsForBinding?.(e),getValidationsForView:()=>this.viewValidationProvider?.getValidationsForView?.()}}]),this.providers)}reset(){this.validations.clear(),this.tracker=void 0}onView(e){if(this.validations.clear(),!this.options)return;const t=new ns({...this.options,callbacks:{onAdd:r=>{if(!this.options||this.getValidationForBinding(r)!==void 0)return;const n=this.options.model.get(r),i=this.options.model.get(r,{ignoreDefaultValue:!0});n!==i&&this.options.model.set([[r,n]],{silent:!0}),this.updateValidationsForBinding(r,"load",this.options,()=>{e.update(new Set([r]))}),this.hooks.onTrackBinding.call(r)}}});this.tracker=t,this.viewValidationProvider=e,t.apply(e)}updateValidationsForBinding(e,t,r,n){const i=r??this.options;if(!i)throw new Error("Context is required for executing validations");if(t==="load"){const s=this.getValidationProviders().reduce((l,a)=>(l.push(...a.provider.getValidationsForBinding?.(e)?.map(c=>({...c,[os]:a.source}))??[]),l),[]);if(s.length===0)return;this.validations.set(e,new cs(s,n,this.options?.logger))}this.validations.get(e)?.update(t,!0,s=>{const l=this.validationRunner(s,e,i);if(this.weakBindingTracker.size>0){const a=this.validations.get(e);this.weakBindingTracker.forEach(c=>a.weakBindings.add(c))}return l?{message:l.message}:void 0}),t!=="load"&&this.validations.forEach((s,l)=>{l!==e&&Le(new Set([e]),s.weakBindings)&&s.update(t,!0,a=>{const c=this.validationRunner(a,l,i);return c?{message:c.message}:void 0})})}validationRunner(e,t,r=this.options){if(!r)throw new Error("No context provided to validation runner");const n=e.handler??this.getValidator(e.type),i=new Set,o={get(l,a){return i.add(W(l)?t:r.parseBinding(l)),r.model.get(l,{...a,includeInvalid:!0})},set:r.model.set,delete:r.model.delete},s=n?.({...r,evaluate:(l,a={model:o})=>r.evaluate(l,a),model:o,validation:e,schemaType:this.schema.getType(t)},r.model.get(t,{includeInvalid:!0,formatted:e.dataTarget==="formatted"}),e);if(this.weakBindingTracker=i,s){let{message:l}=s;const{parameters:a}=s;return e.message&&(l=Qe(e.message,{model:o,evaluate:r.evaluate}),a&&(l=rs(l,a))),{message:l}}}updateValidationsForView(e){const t=e==="navigation",r=this.activeBindings,n=i=>{this.getBindings().forEach(o=>{this.validations.get(o)?.update(e,i,s=>{if(this.options)return this.validationRunner(s,o,this.options)})})};if(n(!t),t){const{activeBindings:i}=this;as(i,r)&&n(!0)}}get activeBindings(){return new Set(Array.from(this.getBindings()).filter(e=>this.validations.get(e)?.get()!==void 0))}getValidator(e){if(this.validatorRegistry)return this.validatorRegistry.get(e);const t=new _i;return this.hooks.createValidatorRegistry.call(t),this.validatorRegistry=t,t.get(e)}getBindings(){return this.tracker?.getBindings()??new Set}trackBinding(e){this.tracker?.trackBinding(e)}validateView(e="navigation"){this.updateValidationsForView(e);const t=new Map;let r=!0;return this.getBindings().forEach(n=>{this.getValidationForBinding(n)?.getAll()?.forEach(o=>{e==="navigation"&&o.blocking&&(this.options?.logger.debug(`Validation on binding: ${n.asString()} is preventing navigation. ${JSON.stringify(o)}`),r=!1),t.has(n)||t.set(n,o)})}),{canTransition:r,validations:t.size?t:void 0}}getValidationForBinding(e){return this.validations.get(e)}forView(e){return{_getValidationForBinding:t=>this.getValidationForBinding(W(t)?t:e(t)),getAll:()=>{const t=this.getBindings();if(t.size===0)return;const r=new Map;return t.forEach(n=>{const i=this.getValidationForBinding(n)?.get();i&&r.set(n,i)}),r.size===0?void 0:r},get(){throw new Error("Error Access be provided by the view plugin")},getValidationsForBinding(){throw new Error("Error rollup should be provided by the view plugin")},getChildren(){throw new Error("Error rollup should be provided by the view plugin")},getValidationsForSection(){throw new Error("Error rollup should be provided by the view plugin")},track:()=>{throw new Error("Tracking should be provided by the view plugin")},register:()=>{throw new Error("Section functionality should be provided by the view plugin")},type:t=>this.schema.getType(W(t)?t:e(t))}}},hs=class{constructor(e){this.updateCallback=e,this.state=new Map}removeKey(e){this.state.delete(e)}reset(){this.state.clear()}useSharedState(e){return t=>(this.state.has(e)||this.state.set(e,t),[this.state.get(e),r=>{const n=this.state.get(e);this.state.set(e,r),n!==r&&this.updateCallback?.()}])}getLocalStateFunction(e,t){return r=>{this.state.has(e)||this.state.set(e,[]),this.state.has(t)||this.state.set(t,0);const n=this.state.get(e),i=this.state.get(t);return this.state.set(t,i+1),n.length<=i&&n.push(r),[n[i],s=>{const l=n[i];n[i]=s,l!==s&&this.updateCallback?.()}]}}};function ze(e,t){return e===t?!0:e.parent?ze(e.parent,t):!1}var ds=class{constructor(e){this.registry=e,this.stateStore=new Map,this.beforeResolveSymbol=Symbol("before resolve"),this.resolveSymbol=Symbol("resolve"),this.beforeResolveCountSymbol=Symbol("before resolve count"),this.resolveCountSymbol=Symbol("resolve count")}apply(e){e.hooks.view.tap("asset-transform",t=>{this.stateStore.clear(),t.hooks.resolver.tap("asset-transform",r=>{let n;const i=s=>{n=s,t.update(new Set)},o=(s,l)=>{let a;const c=l===this.resolveSymbol?this.resolveCountSymbol:this.beforeResolveCountSymbol,d=this.stateStore.get(s);return d?(a=d,a.removeKey(c)):(a=new hs(()=>{i(s)}),this.stateStore.set(s,a)),{useSharedState:h=>a.useSharedState(h),useLocalState:h=>a.getLocalStateFunction(l,c)(h)}};r.hooks.beforeResolve.tap("asset-transform",(s,l)=>{if(s&&(s.type==="asset"||s.type==="view")){const a=this.registry.get(s.value);if(a?.beforeResolve){const c=o(l.node??s,this.beforeResolveSymbol);return a.beforeResolve(s,l,c)}}return s}),r.hooks.afterUpdate.tap("asset-transform",()=>{n=void 0}),r.hooks.skipResolve.tap("asset-transform",(s,l)=>{if(!s||!n)return s;const a=ze(n,l),c=ze(l,n);return!a&&!c}),r.hooks.afterResolve.tap("asset-transform",(s,l,a)=>{if(l.type!=="asset"&&l.type!=="view")return s;const c=r.getSourceNode(l);if(!c)return s;const d=this.registry.get(s);if(d?.resolve){const h=o(c,this.resolveSymbol);return d?.resolve(s,a,h)}return s})})})}},fs=class{constructor(e,t){this.hooks={resolveView:new R,view:new E},this.transformRegistry=new Hn,this.optimizeUpdates=!0,this.viewOptions=t,this.viewMap=e.reduce((n,i)=>(n[i.id]=i,n),{}),new ds(this.transformRegistry).apply(this),t.flowController.hooks.flow.tap("viewController",n=>{n.hooks.transition.tap("viewController",(i,o)=>{o.value.state_type==="VIEW"?this.onView(o.value):this.currentView=void 0})});const r=(n,i=!1)=>{this.currentView&&(this.optimizeUpdates?this.queueUpdate(n,i):this.currentView.update())};t.model.hooks.onUpdate.tap("viewController",(n,i)=>{r(new Set(n.map(o=>o.binding)),i?.silent??!1)}),t.model.hooks.onDelete.tap("viewController",n=>{const i=n.parent(),o=n.key();r(typeof o=="number"&&i?new Set([i]):new Set([n]))})}queueUpdate(e,t=!1){this.pendingUpdate?.changedBindings?this.pendingUpdate.changedBindings=new Set([...this.pendingUpdate.changedBindings,...e]):this.pendingUpdate={changedBindings:e,scheduled:!1},!this.pendingUpdate.scheduled&&!t&&(this.pendingUpdate.scheduled=!0,$n(()=>{const r=this.pendingUpdate?.changedBindings;this.pendingUpdate=void 0,this.currentView?.update(r)}))}getViewForRef(e){if(this.viewMap[e])return this.viewMap[e];const t=Object.keys(this.viewMap).find(r=>e===ur(r,{model:this.viewOptions.model,evaluate:this.viewOptions.evaluator.evaluate}));if(t&&this.viewMap[t])return this.viewMap[t]}onView(e){const t=e.ref,r=this.hooks.resolveView.call(this.getViewForRef(t),t,e);if(!r)throw new Error(`No view with id ${t}`);const n=new zi(r,this.viewOptions);this.currentView=n,this.hooks.view.call(n),n.update()}},ps=class{constructor(e,t){this.controller=e,this.logger=t}get(e,t){return this.controller.get(e,t)}set(e,t){return this.logger?.error("Error: Tried to set in a read only instance of the DataController"),[]}delete(e,t){this.logger?.error("Error: Tried to delete in a read only instance of the DataController")}},gs=class{constructor(e,t){this.hooks={resolve:new R,resolveDataStages:new R,resolveDefaultValue:new J,onDelete:new E,onSet:new E,onGet:new E,onUpdate:new E,format:new R,deformat:new R,serialize:new R},this.logger=t.logger;const r=t.middleware||[];this.baseMiddleware=[new Ue(e),...r],this.trash=new Set,this.pathResolver=t.pathResolver}getModel(){if(!this.model){const e=this.hooks.resolveDataStages.call(this.baseMiddleware),t=new di;t.setMiddleware(e),this.model=t}return this.model}resolveDataValue(e,t,r){return r?this.hooks.deformat.call(t,e):t}set(e,t){let r=[];Array.isArray(e)?r=e.map(([s,l])=>{const a=this.pathResolver.parse(s);return[a,this.resolveDataValue(a,l,!!t?.formatted)]}):r=Object.keys(e).map(s=>{const l=this.pathResolver.parse(s),a=e[s];return[l,this.resolveDataValue(l,a,!!t?.formatted)]});const n=r.reduce((s,[l,a])=>{const c=this.get(l,{includeInvalid:!0}),d={binding:l,newValue:a,oldValue:c};return G(c,a)?this.logger?.debug(`Skipping update for path: ${l.asString()}. Value was unchanged: ${c}`):(s.push(d),this.logger?.debug(`Setting path: ${l.asString()} from: ${c} to: ${a}`)),s},[]),i=this.getModel().set(r,t),o=new Set(n.map(s=>s.binding));return i.forEach(s=>{!o.has(s.binding)&&(s.force===!0||!G(s.oldValue,s.newValue))&&(this.logger?.debug(`Path: ${s.binding.asString()} was changed from: ${s.oldValue} to: ${s.newValue}`),n.push(s))}),this.hooks.onSet.call(r),n.length>0&&this.hooks.onUpdate.call(n,t),i}resolve(e,t){return Array.isArray(e)||typeof e=="string"?this.pathResolver.parse(e,{readOnly:t}):e}get(e,t){const r=e instanceof Q?e:this.resolve(e,!0);let n=this.getModel().get(r,t);if(n===void 0&&!t?.ignoreDefaultValue){const i=this.hooks.resolveDefaultValue.call(r);i!==n&&(n=i)}return t?.formatted?n=this.hooks.format.call(n,r):t?.formatted===!1&&(n=this.hooks.deformat.call(n,r)),this.hooks.onGet.call(e,n),n}delete(e,t){if(typeof e!="string"&&!Array.isArray(e)&&!(e instanceof Q))throw new Error("Invalid arguments: delete expects a data path (string)");const r=e instanceof Q?e:this.resolve(e,!1),n=r.parent(),i=r.key(),o=this.get(n),s=typeof o=="object"&&o!==null&&Object.prototype.hasOwnProperty.call(o,i);this.getModel().delete(r,t),s&&!this.get(r)&&this.trash.add(r),this.hooks.onDelete.call(r)}serialize(){return this.hooks.serialize.call(this.get(""))}makeReadOnly(){return new ps(this,this.logger)}};function wr(e,t=[],r="."){return Object.keys(e).reduce((n,i)=>({...n,...Object.prototype.toString.call(e[i])==="[object Object]"?wr(e[i],t.concat([i])):{[t.concat([i]).join(r)]:e[i]}}),{})}function At(e){const t=wr(e),r=[];return Object.keys(t).forEach(n=>{r.push([new Q(n),t[n]])}),r}var vs=class{constructor(){this.store=new Map,this.tempStore=new Map}addConstants(e,t){this.store.has(t)?this.store.get(t)?.set(At(e)):this.store.set(t,new Ue(e))}getConstants(e,t,r){const n=new Q(e);return this.tempStore.get(t)?.get(n)??this.store.get(t)?.get(n)??r}setTemporaryValues(e,t){this.tempStore.has(t)?this.tempStore.get(t)?.set(At(e)):this.tempStore.set(t,new Ue(e))}clearTemporaryValues(e){e?this.tempStore.get(e)?.reset():this.tempStore.forEach(t=>{t.reset()})}},ys=class{constructor(){this.name="flow-exp-plugin"}apply(e){let t;const r=n=>{n&&(typeof n=="object"&&"exp"in n?t?.evaluate(n.exp):t?.evaluate(n))};e.hooks.expressionEvaluator.tap(this.name,n=>{t=n}),e.hooks.flowController.tap(this.name,n=>{n.hooks.flow.tap(this.name,i=>{i.hooks.onStart.tap(this.name,o=>r(o)),i.hooks.onEnd.tap(this.name,o=>r(o)),i.hooks.resolveTransitionNode.intercept({call:o=>{o?.onStart&&r(o.onStart)}})})})}},ws=e=>(r,n,i)=>e.getFormatterForType({type:i})?.format(n)??n,ms=class{constructor(){this.name="flow-exp-plugin"}apply(e){let t;e.hooks.schema.tap(this.name,r=>{t=ws(r)}),e.hooks.expressionEvaluator.tap(this.name,r=>{t&&r.addExpressionFunction("format",t),r.addExpressionFunction("log",(n,...i)=>{e.logger.info(...i)}),r.addExpressionFunction("debug",(n,...i)=>{e.logger.debug(...i)}),r.addExpressionFunction("eval",(n,...i)=>n.evaluate(...i))})}},bs={ref:Symbol("not-started"),status:"not-started"},Ss=class{constructor(){this.name="default-view-plugin"}apply(e){e.hooks.viewController.tap(this.name,t=>{t.hooks.view.tap(this.name,r=>{const n=pr(r.resolverOptions);new Ji().apply(r),new Yi(n).apply(r),new Qi().apply(r),new Wi().apply(r);const i=new Hi(n);i.apply(r),r.hooks.onTemplatePluginCreated.call(i),new Xi().apply(r)})})}},Es="__VERSION__",ks="__GIT_COMMIT__",mr=class He{constructor(t){this.logger=new Pi,this.constantsController=new vs,this.state=bs,this.hooks={flowController:new E,viewController:new E,view:new E,expressionEvaluator:new E,dataController:new E,schema:new E,validationController:new E,bindingParser:new E,state:new E,onStart:new E,onEnd:new E,resolveFlowContent:new R},t?.logger&&this.logger.addHandler(t.logger),this.config=t||{},this.config.plugins=[new ms,new Ss,...this.config.plugins||[],new ys],this.config.plugins?.forEach(r=>{r.apply(this)})}getPlugins(){return this.config.plugins??[]}findPlugin(t){return this.config.plugins?.find(r=>r.symbol===t)}applyTo(t,r){const n=this.findPlugin(t);n&&r(n)}registerPlugin(t){t.apply(this),this.config.plugins?.push(t)}getVersion(){return He.info.version}getCommit(){return He.info.commit}getState(){return this.state}setState(t){this.state=t,this.hooks.state.call(t)}setupFlow(t){const r=this.hooks.resolveFlowContent.call(t),n=new es(r.navigation,{logger:this.logger});this.hooks.onStart.call(r),this.hooks.flowController.call(n);let i,o;const s=new oi({get:p=>o.get(p),set:p=>o.set(p),evaluate:p=>i.evaluate(p)});this.hooks.bindingParser.call(s);const l=s.parse,a=Jt(),c=new Ri(r.schema);this.hooks.schema.call(c);const d=new us(c);this.hooks.validationController.call(d),o=new gs(r.data,{pathResolver:s,middleware:d.getDataMiddleware(),logger:this.logger}),o.hooks.format.tap("player",(p,y)=>{const g=c.getFormatter(y);return g?g.format(p):p}),o.hooks.deformat.tap("player",(p,y)=>{const g=c.getFormatter(y);return g?g.deformat(p):p}),o.hooks.resolveDefaultValue.tap("player",p=>c.getApparentType(p)?.default);let h;i=new Ti({model:o,logger:this.logger}),this.hooks.expressionEvaluator.call(i),i.hooks.onError.tap("player",p=>(a.reject(p),!0));function v(p,y){return Qe(p,{model:o,evaluate:i.evaluate,formatted:y})}return n.hooks.flow.tap("player",p=>{p.hooks.beforeTransition.tap("player",(y,g)=>{const w=y.transitions[g]?g:"*";return y.onEnd&&y.transitions[w]&&(typeof y.onEnd=="object"&&"exp"in y.onEnd?i?.evaluate(y.onEnd.exp):i?.evaluate(y.onEnd)),!("transitions"in y)||!y.transitions[w]?y:U(y,["transitions",w],v(y.transitions[w]))}),p.hooks.skipTransition.tap("validation",y=>{if(y?.value.state_type==="VIEW"){const{canTransition:g,validations:w}=d.validateView("navigation");if(!g&&w){const b=new Set(w.keys());return h?.currentView?.update(b),!0}}}),p.hooks.resolveTransitionNode.tap("player",y=>{let g=y;return"ref"in y&&(g=U(y,["ref"],v(y.ref))),"param"in y&&(g=U(y,["param"],v(y.param,!1))),g}),p.hooks.transition.tap("player",(y,g)=>{g.value.state_type!=="VIEW"&&d.reset()}),p.hooks.afterTransition.tap("player",y=>{const g=y.currentState?.value;if(g&&g.state_type==="ACTION"){const{exp:w}=g;n?.transition(String(i?.evaluate(w)))}i.reset()})}),this.hooks.dataController.call(o),d.setOptions({parseBinding:l,model:o,logger:this.logger,evaluate:i.evaluate,constants:this.constantsController}),h=new fs(r.views||[],{evaluator:i,parseBinding:l,transition:n.transition,model:o,utils:{findPlugin:p=>this.findPlugin(p)},logger:this.logger,flowController:n,schema:c,format:(p,y)=>{const g=c.getFormatter(p);return g?.format?g.format(y):y},formatValue:(p,y)=>{const g=c.getFormatterForType(p);return g?.format?g.format(y):y},validation:{...d.forView(l),type:p=>c.getType(l(p))},constants:this.constantsController}),h.hooks.view.tap("player",p=>{d.onView(p),this.hooks.view.call(p)}),this.hooks.viewController.call(h),{start:()=>{n.start().then(p=>({endState:v(p,!1),data:o.serialize()})).then(a.resolve).catch(p=>{throw this.logger.error(`Something went wrong: ${p.message}`),p}).catch(a.reject).finally(()=>this.hooks.onEnd.call())},state:{status:"in-progress",flowResult:a.promise,controllers:{data:o,view:h,flow:n,schema:c,expression:i,binding:s,validation:d},fail:a.reject,flow:r,logger:this.logger}}}async start(t){const r=Symbol(t?.id??"payload"),n=i=>this.state.ref!==r?(this.logger.warn("Received update for a flow that's not the current one"),i):(this.setState(i),i);this.setState({status:"not-started",ref:r});try{const{state:i,start:o}=this.setupFlow(t);this.setState({ref:r,...i}),o();const s={ref:r,status:"completed",flow:i.flow,controllers:{data:i.controllers.data.makeReadOnly()}};return n({...await i.flowResult,...s})}catch(i){throw n({status:"error",ref:r,flow:t,error:i}),i}}};mr.info={version:Es,commit:ks};var Vs=mr;export{Ji as A,oi as B,Ti as E,Ue as L,Xi as M,$i as P,Hn as R,Ri as S,Hi as T,Qi as a,Yi as b,R as c,As as d,G as e,E as f,Ps as g,Ts as h,Cs as i,Vs as j,Mt as l,Qe as r,hi as w}; diff --git a/next/index.html b/next/index.html index 74ebafdf..f76552c0 100644 --- a/next/index.html +++ b/next/index.html @@ -47,4 +47,4 @@

Why Player?

more details.

Plugin Ready

Player is designed from the ground up with plugins in mind. Read more about the 20+ provided plugins, or how to write your own.

What does it look like?

- \ No newline at end of file + \ No newline at end of file diff --git a/next/player/team/index.html b/next/player/team/index.html index e1459765..2e8567c9 100644 --- a/next/player/team/index.html +++ b/next/player/team/index.html @@ -72,4 +72,4 @@

The Player Team is comprised of a group of engineers at Intuit who are passionate about dynamic experiences. Our multidisciplinary background and our multi-platform experience has allowed our team to create and support the Player framework internally for the past few years. You may have seen some of the other open-source projects from out team including auto, design-systems-cli, hooks, proof, and more. We are excited to share our work with the open source community and see how Player grows in the years to come.

The Team

-
Spencer Hamm
Spencer Hamm
React, Core
Ketan Reddy
Ketan Reddy
Core, Tools
Mrigank Mehta
Mrigank Mehta
React, iOS, Android
Nancy Wu
Nancy Wu
iOS
Adam Dierkens
Adam Dierkens
React, Core
Jeremiah Zucker
Jeremiah Zucker
Android
Chloe Han
Chloe Han
React, iOS, Android
Marlon Ercillo
Marlon Ercillo
React
Tony Lin
Tony Lin
Android
Rafael Campos
Rafael Campos
Tools
Harris Borawski
Harris Borawski
iOS
Niharika Motukuri
Niharika Motukuri
React, iOS, Android
\ No newline at end of file +
Spencer Hamm
Spencer Hamm
React, Core
Harris Borawski
Harris Borawski
iOS
Chloe Han
Chloe Han
React, iOS, Android
Marlon Ercillo
Marlon Ercillo
React
Mrigank Mehta
Mrigank Mehta
React, iOS, Android
Nancy Wu
Nancy Wu
iOS
Rafael Campos
Rafael Campos
Tools
Tony Lin
Tony Lin
Android
Niharika Motukuri
Niharika Motukuri
React, iOS, Android
Adam Dierkens
Adam Dierkens
React, Core
Jeremiah Zucker
Jeremiah Zucker
Android
Ketan Reddy
Ketan Reddy
Core, Tools
\ No newline at end of file diff --git a/next/storybook-demo/project.json b/next/storybook-demo/project.json index 90352f3c..3f8584e6 100644 --- a/next/storybook-demo/project.json +++ b/next/storybook-demo/project.json @@ -1 +1 @@ -{"generatedAt":1733249131119,"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":1,"typescriptOptions":{"reactDocgen":false},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-webpack5","options":{}},"builder":"@storybook/builder-webpack5","renderer":"@storybook/react","language":"javascript","storybookPackages":{},"addons":{"storybook-dark-mode":{"version":null},"@storybook/addon-docs":{"version":"7.6.19"},"@player-ui/storybook":{"version":"0.10.0-next.10"},"@storybook/addon-webpack5-compiler-babel":{"version":"3.0.3"}}} +{"generatedAt":1733268719489,"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":1,"typescriptOptions":{"reactDocgen":false},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-webpack5","options":{}},"builder":"@storybook/builder-webpack5","renderer":"@storybook/react","language":"javascript","storybookPackages":{},"addons":{"storybook-dark-mode":{"version":null},"@storybook/addon-docs":{"version":"7.6.19"},"@player-ui/storybook":{"version":"0.10.0-next.11"},"@storybook/addon-webpack5-compiler-babel":{"version":"3.0.3"}}} diff --git a/next/tools/dsl-content-playground/index.html b/next/tools/dsl-content-playground/index.html index d56e18cf..25021c18 100644 --- a/next/tools/dsl-content-playground/index.html +++ b/next/tools/dsl-content-playground/index.html @@ -72,4 +72,4 @@ Content can be authored using JSON, or (preferred) with a TypeScript/React API. Below is a sample editor where you can explore authoring content using the DSL and our reference assets. -

\ No newline at end of file +

\ No newline at end of file diff --git a/next/tools/view-ast-explorer/index.html b/next/tools/view-ast-explorer/index.html index 05ccc099..33bfdc05 100644 --- a/next/tools/view-ast-explorer/index.html +++ b/next/tools/view-ast-explorer/index.html @@ -73,4 +73,4 @@ is often used during the transform phase to edit the content prior to rendering. Below is an interactive way of previewing the internal AST representation for the given content. -

\ No newline at end of file +

\ No newline at end of file