iobroker.javascript 9.0.12 → 9.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +1 -1
  2. package/admin/assets/{OpenAiDialog-Db5nBWtV.js → OpenAiDialog-BmcYPsVa.js} +1 -1
  3. package/admin/assets/{ScriptEditor-CuzI8bbK.js → ScriptEditor-BoSBgnK-.js} +1 -1
  4. package/admin/assets/{ScriptEditorVanillaMonaco-LjlfPO8c.js → ScriptEditorVanillaMonaco-Xge2wqgO.js} +1 -1
  5. package/admin/assets/{index-DzAZ7TKU.js → index-BMwfsknM.js} +1 -1
  6. package/admin/assets/index-Br_QjNUk.js +942 -0
  7. package/admin/assets/{index-ee1BGSYh.js → index-CePzv5-W.js} +5 -5
  8. package/admin/assets/{index-DoG44L1P.js → index-DZ3lKVw8.js} +1 -1
  9. package/admin/assets/{index-CpvUlHhu.js → index-DwcZPzOL.js} +4 -4
  10. package/admin/assets/{index-CtB5rga_.js → index-OIiv3PJA.js} +1 -1
  11. package/admin/custom/assets/{Components-DJLwk8Py.js → Components-DjQ_LxKw.js} +1 -1
  12. package/admin/custom/assets/{DefaultPropsProvider-BbFDEnmq.js → DefaultPropsProvider-B8ZCC-c2.js} +1 -1
  13. package/admin/custom/assets/{DefaultPropsProvider-B6-0SEtV.js → DefaultPropsProvider-DfdXSIBu.js} +1 -7
  14. package/admin/custom/assets/{FilledInput-CX9v1cwN.js → FilledInput-CSjr0QT8.js} +1 -1
  15. package/admin/custom/assets/{Tabs-bjxmjZcg.js → Tabs-CiTQkBjL.js} +1 -1
  16. package/admin/custom/assets/{ThemeProvider-CeD4z8mE.js → ThemeProvider-C50pIiW4.js} +1 -1
  17. package/admin/custom/assets/{createSvgIcon-DAmSzHRD.js → createSvgIcon-C7qUEvjp.js} +1 -1
  18. package/admin/custom/assets/createTheme-Bm92JF8u.js +8 -0
  19. package/admin/custom/assets/defaultTheme-BlO0eCf6.js +1 -0
  20. package/admin/custom/assets/hostInit-BJ6gSofk.js +1 -1
  21. package/admin/custom/assets/index-4wMOc304.js +1 -0
  22. package/admin/custom/assets/{index-CrVgzaLe.js → index-5CTGLw4h.js} +1 -1
  23. package/admin/custom/assets/index-BHN4DzE4.js +908 -0
  24. package/admin/custom/assets/{index-BM9YMTul.js → index-BkjEWGjf.js} +1 -1
  25. package/admin/custom/assets/{index-D-RbixT9.js → index-COcxCdeX.js} +4 -20
  26. package/admin/custom/assets/{index-DMiiPxNM.js → index-CnpybLRW.js} +1 -1
  27. package/admin/custom/assets/{index-CznMGPgM.js → index-Db8nkuMR.js} +1 -1
  28. package/admin/custom/assets/{index-1hRrucfm.js → index-Df6OaCxx.js} +1 -1
  29. package/admin/custom/assets/{index-EogeheIH.js → index-t-NMdeH5.js} +6 -6
  30. package/admin/custom/assets/index-u8R8UVCf.js +1393 -0
  31. package/admin/custom/assets/jsx-runtime-C1csJtRx.js +1 -0
  32. package/admin/custom/assets/leaflet-src-DpWQqQWv.js +1 -0
  33. package/admin/custom/assets/useEnhancedEffect-aUb-5tTL.js +1 -0
  34. package/admin/custom/assets/{useTheme-Y8PztM11.js → useTheme-Cgjfsi-1.js} +1 -1
  35. package/admin/custom/assets/useTheme-DFGylj2o.js +1 -0
  36. package/admin/custom/assets/{virtualExposes-BMbgFEvP.js → virtualExposes-C_DtjFte.js} +2 -2
  37. package/admin/custom/customComponents.js +2 -2
  38. package/admin/mf-manifest.json +1 -1
  39. package/admin/remoteEntry.js +2 -2
  40. package/admin/tab.html +1 -1
  41. package/io-package.json +2 -2
  42. package/package.json +1 -1
  43. package/admin/assets/index-XLsd8FZV.js +0 -942
  44. package/admin/custom/assets/createTheme-LEFpI6rM.js +0 -16
  45. package/admin/custom/assets/defaultTheme-2suHr_rQ.js +0 -1
  46. package/admin/custom/assets/index-BgpTxVrG.js +0 -9
  47. package/admin/custom/assets/index-CJimub3l.js +0 -1399
  48. package/admin/custom/assets/index-CPZpQ2Mb.js +0 -916
  49. package/admin/custom/assets/jsx-runtime-CJ3ByJW3.js +0 -9
  50. package/admin/custom/assets/leaflet-src-Dnh7srds.js +0 -4
  51. package/admin/custom/assets/useEnhancedEffect-COBJo-Ex.js +0 -8
  52. package/admin/custom/assets/useTheme-52mADBCy.js +0 -1
@@ -0,0 +1,1393 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Dx7rDE4p.js","./index-DcK0RDrH.js","./_commonjsHelpers-CE1G-McA.js","./ConfigCustomJavascriptSet__loadShare__react__loadShare__-BNbscXK6.js","./ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-jdUmHa_i.js"])))=>i.map(i=>d[i]);
2
+ import{C as qe,R as k}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__-BNbscXK6.js";import{a as Qr,c as ke,g as Xr}from"./_commonjsHelpers-CE1G-McA.js";import{C as R}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__-BqzgglHd.js";import{C as X,a as Zr,I as qr,D as Ti}from"./index-t-NMdeH5.js";import{C as H,A as es,a as _i}from"./ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-DaN0pfsw.js";import{R as ts}from"./ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__-N2_tx_mJ.js";import{F as ns}from"./FilledInput-CSjr0QT8.js";import{b as is}from"./createTheme-Bm92JF8u.js";import{r as rs,l as ss,i as os}from"./ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-jdUmHa_i.js";import{p as Tn}from"./index-DcK0RDrH.js";import{_ as as}from"./preload-helper-BDBacUwf.js";import"./DefaultPropsProvider-B8ZCC-c2.js";import"./defaultTheme-BlO0eCf6.js";import"./DefaultPropsProvider-DfdXSIBu.js";import"./jsx-runtime-C1csJtRx.js";import"./useEnhancedEffect-aUb-5tTL.js";import"./useTheme-Cgjfsi-1.js";const ls=Object.freeze(Object.defineProperty({__proto__:null,get ConfigGeneric(){return K},get ConfigPanel(){return ft},get JsonConfig(){return kl},get JsonConfigComponent(){return Yt}},Symbol.toStringTag,{value:"Module"}));var hs=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,cs=/[\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]/,us=/[\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]/,un={Space_Separator:hs,ID_Start:cs,ID_Continue:us},we={isSpaceSeparator(L){return typeof L=="string"&&un.Space_Separator.test(L)},isIdStartChar(L){return typeof L=="string"&&(L>="a"&&L<="z"||L>="A"&&L<="Z"||L==="$"||L==="_"||un.ID_Start.test(L))},isIdContinueChar(L){return typeof L=="string"&&(L>="a"&&L<="z"||L>="A"&&L<="Z"||L>="0"&&L<="9"||L==="$"||L==="_"||L==="‌"||L==="‍"||un.ID_Continue.test(L))},isDigit(L){return typeof L=="string"&&/[0-9]/.test(L)},isHexDigit(L){return typeof L=="string"&&/[0-9A-Fa-f]/.test(L)}};let Sn,Ae,Ue,Qt,et,Be,Se,_n,Tt;var ps=function(t,n){Sn=String(t),Ae="start",Ue=[],Qt=0,et=1,Be=0,Se=void 0,_n=void 0,Tt=void 0;do Se=ds(),ms[Ae]();while(Se.type!=="eof");return typeof n=="function"?Dn({"":Tt},"",n):Tt};function Dn(L,t,n){const l=L[t];if(l!=null&&typeof l=="object")if(Array.isArray(l))for(let v=0;v<l.length;v++){const a=String(v),u=Dn(l,a,n);u===void 0?delete l[a]:Object.defineProperty(l,a,{value:u,writable:!0,enumerable:!0,configurable:!0})}else for(const v in l){const a=Dn(l,v,n);a===void 0?delete l[v]:Object.defineProperty(l,v,{value:a,writable:!0,enumerable:!0,configurable:!0})}return n.call(L,t,l)}let le,oe,$t,Ve,ce;function ds(){for(le="default",oe="",$t=!1,Ve=1;;){ce=Ge();const L=ki[le]();if(L)return L}}function Ge(){if(Sn[Qt])return String.fromCodePoint(Sn.codePointAt(Qt))}function Z(){const L=Ge();return L===`
3
+ `?(et++,Be=0):L?Be+=L.length:Be++,L&&(Qt+=L.length),L}const ki={default(){switch(ce){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
4
+ `:case"\r":case"\u2028":case"\u2029":Z();return;case"/":Z(),le="comment";return;case void 0:return Z(),fe("eof")}if(we.isSpaceSeparator(ce)){Z();return}return ki[Ae]()},comment(){switch(ce){case"*":Z(),le="multiLineComment";return;case"/":Z(),le="singleLineComment";return}throw ge(Z())},multiLineComment(){switch(ce){case"*":Z(),le="multiLineCommentAsterisk";return;case void 0:throw ge(Z())}Z()},multiLineCommentAsterisk(){switch(ce){case"*":Z();return;case"/":Z(),le="default";return;case void 0:throw ge(Z())}Z(),le="multiLineComment"},singleLineComment(){switch(ce){case`
5
+ `:case"\r":case"\u2028":case"\u2029":Z(),le="default";return;case void 0:return Z(),fe("eof")}Z()},value(){switch(ce){case"{":case"[":return fe("punctuator",Z());case"n":return Z(),at("ull"),fe("null",null);case"t":return Z(),at("rue"),fe("boolean",!0);case"f":return Z(),at("alse"),fe("boolean",!1);case"-":case"+":Z()==="-"&&(Ve=-1),le="sign";return;case".":oe=Z(),le="decimalPointLeading";return;case"0":oe=Z(),le="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":oe=Z(),le="decimalInteger";return;case"I":return Z(),at("nfinity"),fe("numeric",1/0);case"N":return Z(),at("aN"),fe("numeric",NaN);case'"':case"'":$t=Z()==='"',oe="",le="string";return}throw ge(Z())},identifierNameStartEscape(){if(ce!=="u")throw ge(Z());Z();const L=xn();switch(L){case"$":case"_":break;default:if(!we.isIdStartChar(L))throw qn();break}oe+=L,le="identifierName"},identifierName(){switch(ce){case"$":case"_":case"‌":case"‍":oe+=Z();return;case"\\":Z(),le="identifierNameEscape";return}if(we.isIdContinueChar(ce)){oe+=Z();return}return fe("identifier",oe)},identifierNameEscape(){if(ce!=="u")throw ge(Z());Z();const L=xn();switch(L){case"$":case"_":case"‌":case"‍":break;default:if(!we.isIdContinueChar(L))throw qn();break}oe+=L,le="identifierName"},sign(){switch(ce){case".":oe=Z(),le="decimalPointLeading";return;case"0":oe=Z(),le="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":oe=Z(),le="decimalInteger";return;case"I":return Z(),at("nfinity"),fe("numeric",Ve*(1/0));case"N":return Z(),at("aN"),fe("numeric",NaN)}throw ge(Z())},zero(){switch(ce){case".":oe+=Z(),le="decimalPoint";return;case"e":case"E":oe+=Z(),le="decimalExponent";return;case"x":case"X":oe+=Z(),le="hexadecimal";return}return fe("numeric",Ve*0)},decimalInteger(){switch(ce){case".":oe+=Z(),le="decimalPoint";return;case"e":case"E":oe+=Z(),le="decimalExponent";return}if(we.isDigit(ce)){oe+=Z();return}return fe("numeric",Ve*Number(oe))},decimalPointLeading(){if(we.isDigit(ce)){oe+=Z(),le="decimalFraction";return}throw ge(Z())},decimalPoint(){switch(ce){case"e":case"E":oe+=Z(),le="decimalExponent";return}if(we.isDigit(ce)){oe+=Z(),le="decimalFraction";return}return fe("numeric",Ve*Number(oe))},decimalFraction(){switch(ce){case"e":case"E":oe+=Z(),le="decimalExponent";return}if(we.isDigit(ce)){oe+=Z();return}return fe("numeric",Ve*Number(oe))},decimalExponent(){switch(ce){case"+":case"-":oe+=Z(),le="decimalExponentSign";return}if(we.isDigit(ce)){oe+=Z(),le="decimalExponentInteger";return}throw ge(Z())},decimalExponentSign(){if(we.isDigit(ce)){oe+=Z(),le="decimalExponentInteger";return}throw ge(Z())},decimalExponentInteger(){if(we.isDigit(ce)){oe+=Z();return}return fe("numeric",Ve*Number(oe))},hexadecimal(){if(we.isHexDigit(ce)){oe+=Z(),le="hexadecimalInteger";return}throw ge(Z())},hexadecimalInteger(){if(we.isHexDigit(ce)){oe+=Z();return}return fe("numeric",Ve*Number(oe))},string(){switch(ce){case"\\":Z(),oe+=fs();return;case'"':if($t)return Z(),fe("string",oe);oe+=Z();return;case"'":if(!$t)return Z(),fe("string",oe);oe+=Z();return;case`
6
+ `:case"\r":throw ge(Z());case"\u2028":case"\u2029":vs(ce);break;case void 0:throw ge(Z())}oe+=Z()},start(){switch(ce){case"{":case"[":return fe("punctuator",Z())}le="value"},beforePropertyName(){switch(ce){case"$":case"_":oe=Z(),le="identifierName";return;case"\\":Z(),le="identifierNameStartEscape";return;case"}":return fe("punctuator",Z());case'"':case"'":$t=Z()==='"',le="string";return}if(we.isIdStartChar(ce)){oe+=Z(),le="identifierName";return}throw ge(Z())},afterPropertyName(){if(ce===":")return fe("punctuator",Z());throw ge(Z())},beforePropertyValue(){le="value"},afterPropertyValue(){switch(ce){case",":case"}":return fe("punctuator",Z())}throw ge(Z())},beforeArrayValue(){if(ce==="]")return fe("punctuator",Z());le="value"},afterArrayValue(){switch(ce){case",":case"]":return fe("punctuator",Z())}throw ge(Z())},end(){throw ge(Z())}};function fe(L,t){return{type:L,value:t,line:et,column:Be}}function at(L){for(const t of L){if(Ge()!==t)throw ge(Z());Z()}}function fs(){switch(Ge()){case"b":return Z(),"\b";case"f":return Z(),"\f";case"n":return Z(),`
7
+ `;case"r":return Z(),"\r";case"t":return Z()," ";case"v":return Z(),"\v";case"0":if(Z(),we.isDigit(Ge()))throw ge(Z());return"\0";case"x":return Z(),gs();case"u":return Z(),xn();case`
8
+ `:case"\u2028":case"\u2029":return Z(),"";case"\r":return Z(),Ge()===`
9
+ `&&Z(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw ge(Z());case void 0:throw ge(Z())}return Z()}function gs(){let L="",t=Ge();if(!we.isHexDigit(t)||(L+=Z(),t=Ge(),!we.isHexDigit(t)))throw ge(Z());return L+=Z(),String.fromCodePoint(parseInt(L,16))}function xn(){let L="",t=4;for(;t-- >0;){const n=Ge();if(!we.isHexDigit(n))throw ge(Z());L+=Z()}return String.fromCodePoint(parseInt(L,16))}const ms={start(){if(Se.type==="eof")throw lt();pn()},beforePropertyName(){switch(Se.type){case"identifier":case"string":_n=Se.value,Ae="afterPropertyName";return;case"punctuator":zt();return;case"eof":throw lt()}},afterPropertyName(){if(Se.type==="eof")throw lt();Ae="beforePropertyValue"},beforePropertyValue(){if(Se.type==="eof")throw lt();pn()},beforeArrayValue(){if(Se.type==="eof")throw lt();if(Se.type==="punctuator"&&Se.value==="]"){zt();return}pn()},afterPropertyValue(){if(Se.type==="eof")throw lt();switch(Se.value){case",":Ae="beforePropertyName";return;case"}":zt()}},afterArrayValue(){if(Se.type==="eof")throw lt();switch(Se.value){case",":Ae="beforeArrayValue";return;case"]":zt()}},end(){}};function pn(){let L;switch(Se.type){case"punctuator":switch(Se.value){case"{":L={};break;case"[":L=[];break}break;case"null":case"boolean":case"numeric":case"string":L=Se.value;break}if(Tt===void 0)Tt=L;else{const t=Ue[Ue.length-1];Array.isArray(t)?t.push(L):Object.defineProperty(t,_n,{value:L,writable:!0,enumerable:!0,configurable:!0})}if(L!==null&&typeof L=="object")Ue.push(L),Array.isArray(L)?Ae="beforeArrayValue":Ae="beforePropertyName";else{const t=Ue[Ue.length-1];t==null?Ae="end":Array.isArray(t)?Ae="afterArrayValue":Ae="afterPropertyValue"}}function zt(){Ue.pop();const L=Ue[Ue.length-1];L==null?Ae="end":Array.isArray(L)?Ae="afterArrayValue":Ae="afterPropertyValue"}function ge(L){return Xt(L===void 0?`JSON5: invalid end of input at ${et}:${Be}`:`JSON5: invalid character '${Mi(L)}' at ${et}:${Be}`)}function lt(){return Xt(`JSON5: invalid end of input at ${et}:${Be}`)}function qn(){return Be-=5,Xt(`JSON5: invalid identifier character at ${et}:${Be}`)}function vs(L){console.warn(`JSON5: '${Mi(L)}' in strings is not valid ECMAScript; consider escaping`)}function Mi(L){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[L])return t[L];if(L<" "){const n=L.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return L}function Xt(L){const t=new SyntaxError(L);return t.lineNumber=et,t.columnNumber=Be,t}var ys=function(t,n,l){const v=[];let a="",u,d,r="",c;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(l=n.space,c=n.quote,n=n.replacer),typeof n=="function")d=n;else if(Array.isArray(n)){u=[];for(const p of n){let f;typeof p=="string"?f=p:(typeof p=="number"||p instanceof String||p instanceof Number)&&(f=String(p)),f!==void 0&&u.indexOf(f)<0&&u.push(f)}}return l instanceof Number?l=Number(l):l instanceof String&&(l=String(l)),typeof l=="number"?l>0&&(l=Math.min(10,Math.floor(l)),r=" ".substr(0,l)):typeof l=="string"&&(r=l.substr(0,10)),e("",{"":t});function e(p,f){let g=f[p];switch(g!=null&&(typeof g.toJSON5=="function"?g=g.toJSON5(p):typeof g.toJSON=="function"&&(g=g.toJSON(p))),d&&(g=d.call(f,p,g)),g instanceof Number?g=Number(g):g instanceof String?g=String(g):g instanceof Boolean&&(g=g.valueOf()),g){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof g=="string")return i(g);if(typeof g=="number")return String(g);if(typeof g=="object")return Array.isArray(g)?s(g):o(g)}function i(p){const f={"'":.1,'"':.2},g={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let y="";for(let E=0;E<p.length;E++){const w=p[E];switch(w){case"'":case'"':f[w]++,y+=w;continue;case"\0":if(we.isDigit(p[E+1])){y+="\\x00";continue}}if(g[w]){y+=g[w];continue}if(w<" "){let m=w.charCodeAt(0).toString(16);y+="\\x"+("00"+m).substring(m.length);continue}y+=w}const A=c||Object.keys(f).reduce((E,w)=>f[E]<f[w]?E:w);return y=y.replace(new RegExp(A,"g"),g[A]),A+y+A}function o(p){if(v.indexOf(p)>=0)throw TypeError("Converting circular structure to JSON5");v.push(p);let f=a;a=a+r;let g=u||Object.keys(p),y=[];for(const E of g){const w=e(E,p);if(w!==void 0){let m=h(E)+":";r!==""&&(m+=" "),m+=w,y.push(m)}}let A;if(y.length===0)A="{}";else{let E;if(r==="")E=y.join(","),A="{"+E+"}";else{let w=`,
10
+ `+a;E=y.join(w),A=`{
11
+ `+a+E+`,
12
+ `+f+"}"}}return v.pop(),a=f,A}function h(p){if(p.length===0)return i(p);const f=String.fromCodePoint(p.codePointAt(0));if(!we.isIdStartChar(f))return i(p);for(let g=f.length;g<p.length;g++)if(!we.isIdContinueChar(String.fromCodePoint(p.codePointAt(g))))return i(p);return p}function s(p){if(v.indexOf(p)>=0)throw TypeError("Converting circular structure to JSON5");v.push(p);let f=a;a=a+r;let g=[];for(let A=0;A<p.length;A++){const E=e(String(A),p);g.push(E!==void 0?E:"null")}let y;if(g.length===0)y="[]";else if(r==="")y="["+g.join(",")+"]";else{let A=`,
13
+ `+a,E=g.join(A);y=`[
14
+ `+a+E+`,
15
+ `+f+"]"}return v.pop(),a=f,y}};const bs={parse:ps,stringify:ys};var Li=bs,kn={exports:{}};function ws(L){throw new Error('Could not dynamically require "'+L+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Jt={exports:{}};const Cs={},Es=Object.freeze(Object.defineProperty({__proto__:null,default:Cs},Symbol.toStringTag,{value:"Module"})),Ss=Qr(Es);var Ds=Jt.exports,ei;function xs(){return ei||(ei=1,(function(L,t){(function(n,l){L.exports=l()})(Ds,function(){var n=n||(function(l,v){var a;if(typeof window<"u"&&window.crypto&&(a=window.crypto),typeof self<"u"&&self.crypto&&(a=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a=globalThis.crypto),!a&&typeof window<"u"&&window.msCrypto&&(a=window.msCrypto),!a&&typeof ke<"u"&&ke.crypto&&(a=ke.crypto),!a&&typeof ws=="function")try{a=Ss}catch{}var u=function(){if(a){if(typeof a.getRandomValues=="function")try{return a.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a.randomBytes=="function")try{return a.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},d=Object.create||(function(){function y(){}return function(A){var E;return y.prototype=A,E=new y,y.prototype=null,E}})(),r={},c=r.lib={},e=c.Base=(function(){return{extend:function(y){var A=d(this);return y&&A.mixIn(y),(!A.hasOwnProperty("init")||this.init===A.init)&&(A.init=function(){A.$super.init.apply(this,arguments)}),A.init.prototype=A,A.$super=this,A},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var A in y)y.hasOwnProperty(A)&&(this[A]=y[A]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),i=c.WordArray=e.extend({init:function(y,A){y=this.words=y||[],A!=v?this.sigBytes=A:this.sigBytes=y.length*4},toString:function(y){return(y||h).stringify(this)},concat:function(y){var A=this.words,E=y.words,w=this.sigBytes,m=y.sigBytes;if(this.clamp(),w%4)for(var S=0;S<m;S++){var M=E[S>>>2]>>>24-S%4*8&255;A[w+S>>>2]|=M<<24-(w+S)%4*8}else for(var D=0;D<m;D+=4)A[w+D>>>2]=E[D>>>2];return this.sigBytes+=m,this},clamp:function(){var y=this.words,A=this.sigBytes;y[A>>>2]&=4294967295<<32-A%4*8,y.length=l.ceil(A/4)},clone:function(){var y=e.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var A=[],E=0;E<y;E+=4)A.push(u());return new i.init(A,y)}}),o=r.enc={},h=o.Hex={stringify:function(y){for(var A=y.words,E=y.sigBytes,w=[],m=0;m<E;m++){var S=A[m>>>2]>>>24-m%4*8&255;w.push((S>>>4).toString(16)),w.push((S&15).toString(16))}return w.join("")},parse:function(y){for(var A=y.length,E=[],w=0;w<A;w+=2)E[w>>>3]|=parseInt(y.substr(w,2),16)<<24-w%8*4;return new i.init(E,A/2)}},s=o.Latin1={stringify:function(y){for(var A=y.words,E=y.sigBytes,w=[],m=0;m<E;m++){var S=A[m>>>2]>>>24-m%4*8&255;w.push(String.fromCharCode(S))}return w.join("")},parse:function(y){for(var A=y.length,E=[],w=0;w<A;w++)E[w>>>2]|=(y.charCodeAt(w)&255)<<24-w%4*8;return new i.init(E,A)}},p=o.Utf8={stringify:function(y){try{return decodeURIComponent(escape(s.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return s.parse(unescape(encodeURIComponent(y)))}},f=c.BufferedBlockAlgorithm=e.extend({reset:function(){this._data=new i.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=p.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var A,E=this._data,w=E.words,m=E.sigBytes,S=this.blockSize,M=S*4,D=m/M;y?D=l.ceil(D):D=l.max((D|0)-this._minBufferSize,0);var _=D*S,F=l.min(_*4,m);if(_){for(var x=0;x<_;x+=S)this._doProcessBlock(w,x);A=w.splice(0,_),E.sigBytes-=F}return new i.init(A,F)},clone:function(){var y=e.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});c.Hasher=f.extend({cfg:e.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var A=this._doFinalize();return A},blockSize:16,_createHelper:function(y){return function(A,E){return new y.init(E).finalize(A)}},_createHmacHelper:function(y){return function(A,E){return new g.HMAC.init(y,E).finalize(A)}}});var g=r.algo={};return r})(Math);return n})})(Jt)),Jt.exports}var As=kn.exports;(function(L,t){(function(n,l){L.exports=l(xs())})(As,function(n){return(function(l){var v=n,a=v.lib,u=a.WordArray,d=a.Hasher,r=v.algo,c=[];(function(){for(var p=0;p<64;p++)c[p]=l.abs(l.sin(p+1))*4294967296|0})();var e=r.MD5=d.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(p,f){for(var g=0;g<16;g++){var y=f+g,A=p[y];p[y]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var E=this._hash.words,w=p[f+0],m=p[f+1],S=p[f+2],M=p[f+3],D=p[f+4],_=p[f+5],F=p[f+6],x=p[f+7],$=p[f+8],C=p[f+9],b=p[f+10],T=p[f+11],I=p[f+12],O=p[f+13],N=p[f+14],P=p[f+15],B=E[0],V=E[1],W=E[2],z=E[3];B=i(B,V,W,z,w,7,c[0]),z=i(z,B,V,W,m,12,c[1]),W=i(W,z,B,V,S,17,c[2]),V=i(V,W,z,B,M,22,c[3]),B=i(B,V,W,z,D,7,c[4]),z=i(z,B,V,W,_,12,c[5]),W=i(W,z,B,V,F,17,c[6]),V=i(V,W,z,B,x,22,c[7]),B=i(B,V,W,z,$,7,c[8]),z=i(z,B,V,W,C,12,c[9]),W=i(W,z,B,V,b,17,c[10]),V=i(V,W,z,B,T,22,c[11]),B=i(B,V,W,z,I,7,c[12]),z=i(z,B,V,W,O,12,c[13]),W=i(W,z,B,V,N,17,c[14]),V=i(V,W,z,B,P,22,c[15]),B=o(B,V,W,z,m,5,c[16]),z=o(z,B,V,W,F,9,c[17]),W=o(W,z,B,V,T,14,c[18]),V=o(V,W,z,B,w,20,c[19]),B=o(B,V,W,z,_,5,c[20]),z=o(z,B,V,W,b,9,c[21]),W=o(W,z,B,V,P,14,c[22]),V=o(V,W,z,B,D,20,c[23]),B=o(B,V,W,z,C,5,c[24]),z=o(z,B,V,W,N,9,c[25]),W=o(W,z,B,V,M,14,c[26]),V=o(V,W,z,B,$,20,c[27]),B=o(B,V,W,z,O,5,c[28]),z=o(z,B,V,W,S,9,c[29]),W=o(W,z,B,V,x,14,c[30]),V=o(V,W,z,B,I,20,c[31]),B=h(B,V,W,z,_,4,c[32]),z=h(z,B,V,W,$,11,c[33]),W=h(W,z,B,V,T,16,c[34]),V=h(V,W,z,B,N,23,c[35]),B=h(B,V,W,z,m,4,c[36]),z=h(z,B,V,W,D,11,c[37]),W=h(W,z,B,V,x,16,c[38]),V=h(V,W,z,B,b,23,c[39]),B=h(B,V,W,z,O,4,c[40]),z=h(z,B,V,W,w,11,c[41]),W=h(W,z,B,V,M,16,c[42]),V=h(V,W,z,B,F,23,c[43]),B=h(B,V,W,z,C,4,c[44]),z=h(z,B,V,W,I,11,c[45]),W=h(W,z,B,V,P,16,c[46]),V=h(V,W,z,B,S,23,c[47]),B=s(B,V,W,z,w,6,c[48]),z=s(z,B,V,W,x,10,c[49]),W=s(W,z,B,V,N,15,c[50]),V=s(V,W,z,B,_,21,c[51]),B=s(B,V,W,z,I,6,c[52]),z=s(z,B,V,W,M,10,c[53]),W=s(W,z,B,V,b,15,c[54]),V=s(V,W,z,B,m,21,c[55]),B=s(B,V,W,z,$,6,c[56]),z=s(z,B,V,W,P,10,c[57]),W=s(W,z,B,V,F,15,c[58]),V=s(V,W,z,B,O,21,c[59]),B=s(B,V,W,z,D,6,c[60]),z=s(z,B,V,W,T,10,c[61]),W=s(W,z,B,V,S,15,c[62]),V=s(V,W,z,B,C,21,c[63]),E[0]=E[0]+B|0,E[1]=E[1]+V|0,E[2]=E[2]+W|0,E[3]=E[3]+z|0},_doFinalize:function(){var p=this._data,f=p.words,g=this._nDataBytes*8,y=p.sigBytes*8;f[y>>>5]|=128<<24-y%32;var A=l.floor(g/4294967296),E=g;f[(y+64>>>9<<4)+15]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,f[(y+64>>>9<<4)+14]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,p.sigBytes=(f.length+1)*4,this._process();for(var w=this._hash,m=w.words,S=0;S<4;S++){var M=m[S];m[S]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}return w},clone:function(){var p=d.clone.call(this);return p._hash=this._hash.clone(),p}});function i(p,f,g,y,A,E,w){var m=p+(f&g|~f&y)+A+w;return(m<<E|m>>>32-E)+f}function o(p,f,g,y,A,E,w){var m=p+(f&y|g&~y)+A+w;return(m<<E|m>>>32-E)+f}function h(p,f,g,y,A,E,w){var m=p+(f^g^y)+A+w;return(m<<E|m>>>32-E)+f}function s(p,f,g,y,A,E,w){var m=p+(g^(f|~y))+A+w;return(m<<E|m>>>32-E)+f}v.MD5=d._createHelper(e),v.HmacMD5=d._createHmacHelper(e)})(Math),n.MD5})})(kn);var $s=kn.exports;const ti=Xr($s),Ts=window.innerWidth<=600?12:void 0;function dn(L){return Object.prototype.toString.call(L)==="[object Object]"}class K extends qe.Component{static DIFFERENT_VALUE="__different__";static DIFFERENT_LABEL="ra___different__";static NONE_VALUE="";static NONE_LABEL="ra_none";defaultValue;isError;lang;defaultSendToDone;sendToTimeout;noPlaceRequired;constructor(t){super(t),this.state={confirmDialog:!1,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},this.isError={},t.schema&&(t.custom?this.defaultValue=t.schema.defaultFunc?this.executeCustom(t.schema.defaultFunc,t.data,t.customObj,t.oContext.instanceObj,t.arrayIndex,t.globalData):t.schema.default:t.schema.type!=="state"&&(this.defaultValue=t.schema.defaultFunc?this.execute(t.schema.defaultFunc,t.schema.default,t.data,t.arrayIndex,t.globalData):t.schema.default)),this.lang=H.I18n.getLanguage()}componentDidMount(){this.props.oContext.registerOnForceUpdate&&this.props.oContext.registerOnForceUpdate(this.props.attr,this.onUpdate);const t=["select","autocomplete","autocompleteSendTo"];if(this.defaultValue!==void 0){const n=K.getValue(this.props.data,this.props.attr);(n===void 0||t.includes(this.props.schema.type)&&(n===""||n===null))&&setTimeout(()=>{this.props.custom?this.props.onChange(this.props.attr,this.defaultValue,()=>setTimeout(()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data),100)):(K.setValue(this.props.data,this.props.attr,this.defaultValue),this.props.onChange(this.props.data,void 0,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data)))},100)}else this.props.schema.defaultSendTo&&this.sendTo()}sendTo(){if(this.props.alive){this.defaultSendToDone=!0;let t=this.props.schema.data;if(t===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);try{t=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${n}`)}}else t={attr:this.props.attr,value:K.getValue(this.props.data,this.props.attr)};t===void 0&&(t=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.defaultSendTo,t).then(n=>{n!=null&&(this.props.custom?this.props.onChange(this.props.attr,n,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data)):(K.setValue(this.props.data,this.props.attr,n),this.props.onChange(this.props.data,void 0,()=>this.props.oContext.forceUpdate([this.props.attr],this.props.data))))})}else this.defaultSendToDone=!1,this.props.schema.allowSaveWithError||this.onError(this.props.attr,H.I18n.t("ra_Instance %s is not alive",this.props.oContext.instance.toString()))}componentWillUnmount(){this.props.oContext.registerOnForceUpdate&&this.props.oContext.registerOnForceUpdate(this.props.attr),this.sendToTimeout&&(clearTimeout(this.sendToTimeout),this.sendToTimeout=null)}onUpdate=t=>{const n=K.getValue(t||this.props.data,this.props.attr)||"";this.state.value!==n?this.setState({value:n}):this.forceUpdate()};static getValue(t,n){if(typeof n=="string")return K.getValue(t,n.split("."));if(n.length===1)return t[n[0]];const l=n.shift();if(typeof l=="string"&&typeof t[l]=="object")return K.getValue(t[l],n)}static setValue(t,n,l){if(typeof n=="string"){K.setValue(t,n.split("."),l);return}if(n.length===1)l===null?delete t[n[0]]:t[n[0]]=l;else{const v=n.shift();if(typeof v!="string")return;(!t[v]||typeof t[v]=="object")&&(t[v]=t[v]||{}),K.setValue(t[v],n,l)}}getText(t,n){if(!t)return"";if(typeof t=="string"){const l=n?t:H.I18n.t(t);return l.includes("${")?this.getPattern(l,null,n):l}return dn(t)?t.func?typeof t.func=="object"?this.getPattern(t.func[this.lang]||t.func.en||"",null,!0):this.getPattern(t.func,null,n):t[this.lang]||t.en||"":t.toString()}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const t=this.state.confirmData||this.props.schema.confirm;let n=null;return t.type==="warning"?n=k.createElement(X.Warning,null):t.type==="error"?n=k.createElement(X.Error,null):t.type==="info"&&(n=k.createElement(X.Info,null)),k.createElement(H.DialogConfirm,{title:this.getText(t.title)||H.I18n.t("ra_Please confirm"),text:this.getText(t.text),ok:this.getText(t.ok)||H.I18n.t("ra_Ok"),cancel:this.getText(t.cancel)||H.I18n.t("ra_Cancel"),icon:n||void 0,onClose:l=>this.setState({confirmDialog:!1},()=>{if(l){if(this.state.confirmCallback){const a=this.state.confirmCallback;this.setState({confirmCallback:null},()=>a(!0));return}const v=JSON.parse(JSON.stringify(this.props.data));this.state.confirmDepAttr&&K.setValue(v,this.state.confirmDepAttr,this.state.confirmDepNewValue),K.setValue(v,this.state.confirmAttr,this.state.confirmNewValue),this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null},()=>this.props.onChange(v))}else{const v=this.state.confirmCallback;this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},()=>{v&&v(!1)})}})})}getIcon(t){t=t||this.props.schema.icon;let n=null;return t==="auth"?n=k.createElement(X.Key,null):t==="send"?n=k.createElement(X.Send,null):t==="web"?n=k.createElement(X.Public,null):t==="warning"?n=k.createElement(X.Warning,null):t==="error"?n=k.createElement(X.Error,null):t==="info"?n=k.createElement(X.Info,null):t==="search"?n=k.createElement(X.Search,null):t==="book"?n=k.createElement(X.MenuBook,null):t==="help"?n=k.createElement(X.Help,null):t==="upload"?n=k.createElement(X.UploadFile,null):t==="edit"?n=k.createElement(X.Edit,null):t==="user"?n=k.createElement(X.Person,null):t==="group"?n=k.createElement(X.Group,null):t==="delete"?n=k.createElement(X.Delete,null):t==="refresh"?n=k.createElement(X.Refresh,null):t==="add"?n=k.createElement(X.Add,null):t==="unpair"?n=k.createElement(X.LinkOff,null):t==="pair"?n=k.createElement(X.Link,null):t==="save"?n=k.createElement(X.Save,null):t==="open"?n=k.createElement(X.OpenInNew,null):t&&((t.endsWith(".png")||t.endsWith(".svg")||t.endsWith(".jpg"))&&!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`./adapter/${this.props.oContext.adapterName}/${t}`),n=k.createElement(H.Icon,{src:t,style:{width:22,height:22}})),n}onChangeAsync(t,n){return new Promise(l=>{const v=this.onChange(t,n,l);v instanceof Promise&&v.catch(a=>console.error(`Cannot set value: ${a}`))})}onChange(t,n,l){const v=JSON.parse(JSON.stringify(this.props.data));if(K.setValue(v,t,n),this.props.schema.confirm&&this.execute(this.props.schema.confirm.condition,!1,v,this.props.arrayIndex,this.props.globalData))return new Promise(u=>{this.setState({confirmDialog:!0,confirmNewValue:n,confirmAttr:t,confirmData:null},()=>{typeof l=="function"?l():u()})});if(this.props.schema.confirmDependsOn)for(let u=0;u<this.props.schema.confirmDependsOn.length;u++){const d=this.props.schema.confirmDependsOn[u];if(d.confirm){const r=K.getValue(v,d.attr);if(this.execute(d.confirm.condition,!1,v,this.props.arrayIndex,this.props.globalData))return new Promise(c=>{this.setState({confirmDialog:!0,confirmNewValue:n,confirmAttr:t,confirmDepNewValue:r,confirmDepAttr:d.attr,confirmData:d.confirm},()=>{typeof l=="function"?l():c()})})}}const a=[];if(this.props.schema.onChangeDependsOn)for(let u=0;u<this.props.schema.onChangeDependsOn.length;u++){const d=this.props.schema.onChangeDependsOn[u];if(d.onChange){const r=K.getValue(v,d.attr);let c;this.props.custom?c=this.executeCustom(d.onChange.calculateFunc,v,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):c=this.execute(d.onChange.calculateFunc,r,v,this.props.arrayIndex,this.props.globalData),c!==r&&(K.setValue(v,d.attr,c),a.push(d.attr))}}if(this.props.schema.hiddenDependsOn)for(let u=0;u<this.props.schema.hiddenDependsOn.length;u++){const d=this.props.schema.hiddenDependsOn[u];d.hidden&&a.push(d.attr)}if(this.props.schema.labelDependsOn)for(let u=0;u<this.props.schema.labelDependsOn.length;u++){const d=this.props.schema.labelDependsOn[u];d.hidden&&a.push(d.attr)}if(this.props.schema.helpDependsOn)for(let u=0;u<this.props.schema.helpDependsOn.length;u++){const d=this.props.schema.helpDependsOn[u];d.hidden&&a.push(d.attr)}if(this.props.schema.onChange&&!this.props.schema.onChange.ignoreOwnChanges){const u=K.getValue(v,this.props.attr),d=this.props.custom?this.executeCustom(this.props.schema.onChange.calculateFunc,v,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):this.execute(this.props.schema.onChange.calculateFunc,u,v,this.props.arrayIndex,this.props.globalData);d!==u&&K.setValue(v,this.props.attr,d)}return this.props.custom?(this.props.onChange(t,n,()=>l&&l()),a!=null&&a.length&&a.forEach((u,d)=>setTimeout(()=>this.props.onChange(u,K.getValue(v,u)),d*50))):this.props.onChange(v,void 0,()=>{a.length&&this.props.oContext.forceUpdate(a,v),l&&l()}),Promise.resolve()}execute(t,n,l,v,a){let u;if(dn(t))u=t.func;else if(typeof t=="string")u=t;else return t;if(!u)return n;try{return new Function("data","originalData","_system","_alive","_common","_socket","_instance","arrayIndex","globalData","_changed",u.includes("return")?u:`return ${u}`)(l||this.props.data,this.props.originalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.oContext.instance,v,a,this.props.changed)}catch(d){return console.error(`Cannot execute ${JSON.stringify(t)}: ${d}`),n}}executeCustom(t,n,l,v,a,u){let d;if(dn(t))d=t.func;else if(typeof t=="string")d=t;else return t;if(!d)return null;try{return new Function("data","originalData","_system","instanceObj","customObj","_socket","arrayIndex","globalData","_changed",d.includes("return")?d:`return ${d}`)(n||this.props.data,this.props.originalData,this.props.oContext.systemConfig,v,l,this.props.oContext.socket,a,u,this.props.changed)}catch(r){return console.error(`Cannot execute ${d}: ${r}`),null}}calculate(t){let n,l,v,a;return this.props.custom?(n=t.validator?!this.executeCustom(t.validator,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,t.disabled===!0?l=!0:l=t.disabled?this.executeCustom(t.disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,t.hidden===!0?v=!0:v=t.hidden?this.executeCustom(t.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!1,a=t.defaultFunc?this.executeCustom(t.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):t.default):(n=t.validator?!this.execute(t.validator,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,t.disabled===!0?l=!0:l=t.disabled?this.execute(t.disabled,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,t.hidden===!0?v=!0:v=t.hidden?this.execute(t.hidden,!1,this.props.data,this.props.arrayIndex,this.props.globalData):!1,a=t.defaultFunc?this.execute(t.defaultFunc,t.default,this.props.data,this.props.arrayIndex,this.props.globalData):t.default),{error:n,disabled:l,hidden:v,defaultValue:a}}onError(t,n){n?this.isError[t]=n:delete this.isError[t],this.props.onError&&this.props.onError(t,n)}renderItem(t,n,l){return this.getText(this.props.schema.label)||this.getText(this.props.schema.text)}renderHelp(t,n,l){return n?k.createElement("a",{href:n,target:"_blank",rel:"noreferrer",style:{color:this.props.oContext.themeType==="dark"?"#a147ff":"#5b238f",textDecoration:"underline"}},this.getText(t,l)):(t=this.getText(t,l)||"",t&&(t.includes("<a ")||t.includes("<br")||t.includes("<b>")||t.includes("<i>"))?H.Utils.renderTextWithA(t):t)}static escapeString(t,n){return typeof t!="string"?"":(t=t.replace(/`/g,"\\`"),t=t.replace(/\${([^}]+)}/g,(l,v)=>{if(v&&typeof v=="string"&&v.startsWith("data.")){const a=K.getValue(n,v.replace(/^data\./,""));if(typeof a=="string"&&(a.includes("\\")||a.includes('"')))return`\${${v}.replace(/\\\\/g, '\\\\\\\\').replace(/"/g, '\\\\"')}`}return l}),t)}getPattern(t,n,l){if(n=n||this.props.data,!t)return"";let v;typeof t=="object"?t.func?v=t.func:(console.log(`Object must be stringified: ${JSON.stringify(t)}`),v=JSON.stringify(t)):v=t;try{if(this.props.custom)return new Function("data","originalData","arrayIndex","globalData","_system","instanceObj","customObj","_socket","_changed",`return \`${K.escapeString(v,n)}\``)(n,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.oContext.instanceObj,this.props.customObj,this.props.oContext.socket,this.props.changed);const u=new Function("data","originalData","arrayIndex","globalData","_system","_alive","_common","_socket","_changed",`return \`${K.escapeString(v,n)}\``)(n,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.changed);return l?u:H.I18n.t(u)}catch(a){return console.error(`Cannot execute ${v}: ${a}`),v}}render(){const t=this.props.schema;if(!t||this.props.expertMode===!1&&t.expertMode)return null;this.props.alive&&this.defaultSendToDone===!1&&(this.sendToTimeout=setTimeout(()=>{this.sendToTimeout=null,this.sendTo()},200));const{error:n,disabled:l,hidden:v,defaultValue:a}=this.calculate(t);if(v){if(Object.keys(this.isError).length&&(setTimeout(r=>Object.keys(r).forEach(c=>this.props.onError(c)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}),t.hideOnlyControl){const r=k.createElement(R.Grid2,{size:{xs:t.xs||Ts,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0},style:{marginBottom:0,textAlign:"left",...t.style,...this.props.oContext.themeType==="dark"?t.darkStyle:{}}});return t.newLine?k.createElement(k.Fragment,null,k.createElement("div",{style:{flexBasis:"100%",height:0}}),r):r}return null}t.validatorNoSaveOnError&&(n&&!Object.keys(this.isError).length?(this.isError={[this.props.attr]:t.validatorErrorText?H.I18n.t(t.validatorErrorText):!0},setTimeout(r=>Object.keys(r).forEach(c=>this.props.onError(c,r[c])),100,JSON.parse(JSON.stringify(this.isError)))):!n&&Object.keys(this.isError).length&&(setTimeout(r=>Object.keys(r).forEach(c=>this.props.onError(c)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}));const u=this.renderItem(n,l||this.props.commandRunning||this.props.disabled,a);if(this.noPlaceRequired)return u;const d=k.createElement(R.Grid2,{title:this.getText(t.tooltip),size:{xs:t.xs||12,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0},style:{marginBottom:0,textAlign:"left",width:t.type==="divider"||t.type==="header"?t.width||"100%":void 0,...t.style,...this.props.oContext.themeType==="dark"?t.darkStyle:{}}},this.props.schema.defaultSendTo&&this.props.schema.button?k.createElement(R.Grid2,{container:!0,style:{width:"100%"}},k.createElement(R.Grid2,{flex:1},u),k.createElement(R.Grid2,null,k.createElement(R.Button,{disabled:l,variant:"outlined",onClick:()=>this.sendTo(),title:this.props.schema.buttonTooltip?this.getText(this.props.schema.buttonTooltip,this.props.schema.buttonTooltipNoTranslation):H.I18n.t("ra_Request data by instance")},this.getText(this.props.schema.button)))):u);return t.newLine?k.createElement(k.Fragment,null,k.createElement("div",{style:{flexBasis:"100%",height:0}}),this.renderDialogConfirm(),d):this.state.confirmDialog?k.createElement(k.Fragment,null,this.renderDialogConfirm(),d):d}}const Oe={fullWidth:{width:"100%"},accordionSummary:L=>({backgroundColor:L.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)"}),accordionTitle:{},toolbar:L=>({backgroundColor:L.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.08)",borderRadius:"3px"}),tooltip:{pointerEvents:"none"}};class _s extends K{typingTimer=null;constructor(t){super(t),this.props.schema.items=this.props.schema.items||[]}componentDidMount(){super.componentDidMount();let t=K.getValue(this.props.data,this.props.attr)||[];Array.isArray(t)||(t=[]),this.setState({value:t,activeIndex:-1,iteration:0,accordionErrors:{}})}componentWillUnmount(){this.typingTimer&&(clearTimeout(this.typingTimer),this.typingTimer=null),super.componentWillUnmount()}onAccordionError=t=>(n,l)=>{const v={...this.state.accordionErrors};v[t]||(v[t]={}),l?v[t][n]=l:(delete v[t][n],Object.keys(v[t]).length===0&&delete v[t]),this.setState({accordionErrors:v}),this.props.onError(n,l)};hasAccordionErrors=t=>!!(this.state.accordionErrors[t]&&Object.keys(this.state.accordionErrors[t]).length>0);itemAccordion(t,n){const{value:l}=this.state,{schema:v}=this.props,a={type:"panel",items:v.items.reduce((u,d)=>(u[d.attr]=d,u),{}),style:{marginLeft:"-8px",marginTop:"10px",marginBottom:"10px"}};return k.createElement(ft,{oContext:this.props.oContext,index:n+this.state.iteration,arrayIndex:n,changed:this.props.changed,expertMode:this.props.expertMode,globalData:this.props.data,common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:t,custom:!0,schema:a,originalData:this.props.originalData,onChange:(u,d)=>{const r=JSON.parse(JSON.stringify(l));r[n][u]=d,this.setState({value:r},()=>this.onChangeWrapper(r))},onError:this.onAccordionError(n),table:this.props.table})}onDelete=t=>()=>{const n=JSON.parse(JSON.stringify(this.state.value));n.splice(t,1),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))};onClone=t=>()=>{const n=JSON.parse(JSON.stringify(this.state.value)),l=JSON.parse(JSON.stringify(n[t]));if(typeof this.props.schema.clone=="string"&&typeof l[this.props.schema.clone]=="string"){let v=1,a=l[this.props.schema.clone];const u=a.match(/(\d+)$/);for(u?(a=a.replace(u[0],""),v=parseInt(u[0],10)+1):a+="_";n.find(d=>d[this.props.schema.clone]===a+v.toString());)v++;l[this.props.schema.clone]=`${l[this.props.schema.clone]}_${v}`}n.splice(t,0,l),this.setState({value:n,activeIndex:-1,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))};onChangeWrapper=t=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout(n=>{this.typingTimer=null;const l=this.onChange(this.props.attr,n);l instanceof Promise&&l.catch(v=>this.onError(v))},300,t)};onAdd=()=>{const{schema:t}=this.props,n=JSON.parse(JSON.stringify(this.state.value)),l=t.items&&t.items.reduce((v,a)=>{let u;return a.defaultFunc?this.props.custom?u=a.defaultFunc?this.executeCustom(a.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,n.length,this.props.data):this.props.schema.default:u=a.defaultFunc?this.execute(a.defaultFunc,this.props.schema.default,this.props.data,n.length,this.props.data):this.props.schema.default:u=a.default===void 0?null:a.default,v[a.attr]=u,v},{});n.push(l),this.setState({value:n,activeIndex:n.length-1},()=>this.onChangeWrapper(n))};onMoveUp(t){const n=JSON.parse(JSON.stringify(this.state.value)),l=n[t];n.splice(t,1),n.splice(t-1,0,l);const v=this.state.activeIndex-1;this.setState({value:n,activeIndex:v,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))}onMoveDown(t){const n=JSON.parse(JSON.stringify(this.state.value)),l=n[t];n.splice(t,1),n.splice(t+1,0,l);const v=this.state.activeIndex+1;this.setState({value:n,activeIndex:v,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(n))}onExport=()=>{const{value:t}=this.state,n=JSON.stringify(t,null,2),l=`data:application/json;charset=utf-8,${encodeURIComponent(n)}`,v=`config_section_${new Date().toISOString().slice(0,19).replace(/:/g,"-")}.json`,a=document.createElement("a");a.setAttribute("href",l),a.setAttribute("download",v),a.click()};onImport=t=>{const n=document.createElement("input");n.type="file",n.accept=".json",n.onchange=l=>{var u;const v=(u=l.target.files)==null?void 0:u[0];if(!v)return;const a=new FileReader;a.onload=d=>{var r;try{const c=JSON.parse((r=d.target)==null?void 0:r.result);if(!Array.isArray(c)){alert(H.I18n.t("ra_Invalid JSON format. Expected an array."));return}let e;t?e=c:e=[...this.state.value,...c],this.setState({value:e,activeIndex:-1},()=>this.onChangeWrapper(e))}catch{alert(H.I18n.t("ra_Invalid JSON file."))}},a.readAsText(v)},n.click()};renderItem(){const{schema:t}=this.props,{value:n}=this.state;return n?k.createElement(R.Paper,null,t.label||!t.noDelete?k.createElement(R.Toolbar,{variant:"dense"},t.label?k.createElement(R.Typography,{variant:"h6",id:"tableTitle",component:"div"},this.getText(t.label)):null,t.noDelete?null:k.createElement(k.Fragment,null,k.createElement(R.Tooltip,{title:H.I18n.t("ra_Export configuration section")},k.createElement(R.IconButton,{size:"small",color:"primary",onClick:this.onExport},k.createElement(X.FileDownload,null))),k.createElement(R.Tooltip,{title:H.I18n.t("ra_Import and replace configuration section")},k.createElement(R.IconButton,{size:"small",color:"primary",onClick:()=>this.onImport(!0)},k.createElement(X.FileUpload,null))),k.createElement(R.Tooltip,{title:H.I18n.t("ra_Import and add configuration section")},k.createElement(R.IconButton,{size:"small",color:"primary",onClick:()=>this.onImport(!1)},k.createElement(X.AddCircle,null))),k.createElement(R.IconButton,{size:"small",color:"primary",onClick:this.onAdd},k.createElement(X.Add,null)))):null,n.map((l,v)=>k.createElement(R.Accordion,{key:`${l}_${v}`,expanded:this.state.activeIndex===v,onChange:(a,u)=>this.setState({activeIndex:u?v:-1})},k.createElement(R.AccordionSummary,{expandIcon:k.createElement(X.ExpandMore,null),sx:H.Utils.getStyle(this.props.oContext.theme,Oe.fullWidth,Oe.accordionSummary)},k.createElement(R.Box,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"}},k.createElement(R.Typography,{style:Oe.accordionTitle},l[t.titleAttr]),this.hasAccordionErrors(v)&&k.createElement(X.Error,{sx:{fontSize:20,color:"error.main"}}))),k.createElement(R.AccordionDetails,{style:{...t.style,...this.props.oContext.themeType?t.darkStyle:void 0}},this.itemAccordion(n[v],v),k.createElement(R.Toolbar,{sx:Oe.toolbar},v?k.createElement(R.Tooltip,{title:H.I18n.t("ra_Move up"),slotProps:{popper:{sx:Oe.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:()=>this.onMoveUp(v)},k.createElement(X.ArrowUpward,null))):k.createElement("div",{style:Oe.buttonEmpty}),v<n.length-1?k.createElement(R.Tooltip,{title:H.I18n.t("ra_Move down"),slotProps:{popper:{sx:Oe.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:()=>this.onMoveDown(v)},k.createElement(X.ArrowDownward,null))):k.createElement("div",{style:Oe.buttonEmpty}),t.noDelete?null:k.createElement(R.Tooltip,{title:H.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:Oe.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:this.onDelete(v)},k.createElement(X.Delete,null))),t.clone?k.createElement(R.Tooltip,{title:H.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:Oe.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:this.onClone(v)},k.createElement(X.ContentCopy,null))):null)))),!t.noDelete&&n.length>0?k.createElement(R.Toolbar,{variant:"dense",sx:Oe.rootTool},k.createElement(R.IconButton,{size:"small",color:"primary",onClick:this.onAdd},k.createElement(X.Add,null))):null,t.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null):null}}const ni={root:{width:"100%"},notAlive:{color:"#a30000"}};class ks extends K{componentDidMount(){super.componentDidMount();const t=this.getInstance();this.props.oContext.socket.getState(`${t}.alive`).then(n=>this.setState({alive:!!(n&&n.val),instance:t}))}getInstance(){let t=this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`;return t.includes("${")&&(t=this.getPattern(t,null,!0)),t&&!t.startsWith("system.adapter.")&&(t=`system.adapter.${t}`),t}renderItem(){if(this.getInstance()!==this.state.instance&&setTimeout(()=>{const n=this.getInstance();n?this.props.oContext.socket.getState(`${n}.alive`).then(l=>this.setState({alive:!!(l&&l.val),instance:n})):this.setState({alive:null,instance:n})},200),this.state.alive!==!1&&this.state.alive!==!0)return null;const t=this.state.instance.replace(/^system.adapter./,"");return k.createElement("div",{style:{...ni.root,...this.state.alive?void 0:ni.notAlive}},this.state.alive?this.props.schema.textAlive!==void 0?this.props.schema.textAlive?H.I18n.t(this.props.schema.textAlive,t):"":H.I18n.t("ra_Instance %s is alive",t):this.props.schema.textNotAlive!==void 0?this.props.schema.textNotAlive?H.I18n.t(this.props.schema.textNotAlive,t):"":H.I18n.t("ra_Instance %s is not alive",t))}}class Ms extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr),n=this.props.schema.options.map(l=>typeof l=="string"?{label:l,value:l}:JSON.parse(JSON.stringify(l)));Array.isArray(t)?(n.unshift({label:H.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n})):this.setState({value:t,selectOptions:n})}renderItem(t,n){if(!this.state.selectOptions)return null;let l;const v=JSON.parse(JSON.stringify(this.state.selectOptions));return Array.isArray(this.state.value)||this.state.value===K.DIFFERENT_VALUE?([...this.state.value].filter(u=>!v.find(d=>typeof d=="object"?d.value===u:d===u)).forEach(u=>v.push({label:u.toString(),value:u})),l={label:H.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE},v.unshift(l)):(l=this.state.value!==null&&this.state.value!==void 0&&v.find(u=>typeof u=="object"?u.value==this.state.value:u==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!l&&this.props.schema.freeSolo&&(l={value:this.state.value,label:this.state.value},v.push(l))),k.createElement(R.Autocomplete,{fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,value:l,options:v,isOptionEqualToValue:(u,d)=>u.value===d.value,filterOptions:(u,d)=>{const r=u.filter(c=>d.inputValue===""?!0:c.label.toLowerCase().includes(d.inputValue.toLowerCase())||c.value.toLowerCase().includes(d.inputValue.toLowerCase()));return this.props.schema.freeSolo&&d.inputValue!==""&&r.push({label:d.inputValue,value:d.inputValue}),r},onInputChange:u=>{if(!u||!this.props.schema.freeSolo)return;const d=u.target.value;d!==this.state.value&&this.setState({value:d},()=>this.onChange(this.props.attr,d))},onChange:(u,d)=>{const r=typeof d=="object"?d?d.value:"":d;r!==this.state.value&&this.setState({value:r},()=>this.onChange(this.props.attr,r))},getOptionLabel:u=>typeof u=="object"?(u==null?void 0:u.label)??"":"",renderInput:u=>k.createElement(R.TextField,{variant:"standard",...u,error:!!t,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:n})})}}class Ls extends K{initialized=!1;localContext;askInstance(){const t=K.getValue(this.props.data,this.props.attr),n=this.props.schema.options?this.props.schema.options.map(l=>typeof l=="string"?{label:l,value:l}:JSON.parse(JSON.stringify(l))):[];if(this.props.alive){let l=this.props.schema.data;if(l===void 0&&this.props.schema.jsonData){const v=this.getPattern(this.props.schema.jsonData,null,!0);try{typeof v=="string"&&(l=JSON.parse(v))}catch{console.error(`Cannot parse json data: ${JSON.stringify(l)}`)}}l===void 0&&(l=null),this.setState({loading:!0}),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",l).then(v=>{v&&Array.isArray(v)&&v.forEach(a=>n.push(typeof a=="string"?{label:a,value:a}:JSON.parse(JSON.stringify(a)))),Array.isArray(t)?(n.unshift({label:H.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n,loading:!1})):this.setState({value:t,selectOptions:n,loading:!1})}).catch(v=>{console.error("Error in autocompleteSendTo:",v),this.setState({loading:!1})})}else Array.isArray(t)?(n.unshift({label:H.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n})):this.setState({value:t,selectOptions:n})}getContext(){const t={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>t[n]=K.getValue(this.props.data,n)),JSON.stringify(t)}renderItem(t,n){if(this.props.alive){const u=this.getContext();(u!==this.localContext||!this.initialized)&&(this.localContext=u,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}let l;const v=this.state.selectOptions?JSON.parse(JSON.stringify(this.state.selectOptions)):[];return Array.isArray(this.state.value)||this.state.value===K.DIFFERENT_LABEL?([...this.state.value].filter(u=>!v.find(d=>d.value===u)).forEach(u=>v.push({label:u.toString(),value:u})),l={label:H.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE},v.unshift(l)):(l=this.state.value!==null&&this.state.value!==void 0&&v.find(u=>u.value==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!l&&this.props.schema.freeSolo&&(l={value:this.state.value,label:this.state.value},v.push(l)),l=l||null),v.length?k.createElement(R.Autocomplete,{value:l,fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,options:v,isOptionEqualToValue:(u,d)=>u.value===d.value,filterOptions:(u,d)=>{const r=u.filter(c=>d.inputValue===""?!0:c.label.toLowerCase().includes(d.inputValue.toLowerCase())||c.value.toLowerCase().includes(d.inputValue.toLowerCase()));return this.props.schema.freeSolo&&d.inputValue!==""&&r.push({label:d.inputValue,value:d.inputValue}),r},getOptionLabel:u=>(u==null?void 0:u.label)??"",onInputChange:u=>{if(!u||!this.props.schema.freeSolo)return;const d=u.target.value;d!==this.state.value&&this.setState({value:d},()=>this.onChange(this.props.attr,d))},onChange:(u,d)=>{const r=typeof d=="object"?d?d.value:"":d;r!==this.state.value&&this.setState({value:r},()=>this.onChange(this.props.attr,r))},renderInput:u=>k.createElement(R.TextField,{variant:"standard",...u,error:!!t,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:n,InputProps:{...u.InputProps,endAdornment:k.createElement(k.Fragment,null,this.state.loading?k.createElement(R.InputAdornment,{position:"end"},k.createElement(R.CircularProgress,{size:20})):null,u.InputProps.endAdornment)}})}):k.createElement(R.TextField,{variant:"standard",fullWidth:!0,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!t,disabled:n,inputProps:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0},InputProps:this.state.loading?{endAdornment:k.createElement(R.InputAdornment,{position:"end"},k.createElement(R.CircularProgress,{size:20}))}:void 0,onChange:u=>{const d=u.target.value;this.setState({value:d},()=>this.onChange(this.props.attr,(d||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const fn={fullWidth:{width:"100%"},flex:{display:"flex"},button:{height:48,marginLeft:4,minWidth:48}};class Is extends K{componentDidMount(){super.componentDidMount();const{data:t,attr:n}=this.props,l=K.getValue(t,n)||"";this.setState({value:l,showDialog:!1})}renderItem(t,n){const{schema:l,attr:v}=this.props,{value:a,showDialog:u}=this.state;return k.createElement(R.FormControl,{style:fn.fullWidth,variant:"standard"},l.label?k.createElement(R.InputLabel,{shrink:!0},this.getText(l.label)):null,k.createElement("div",{style:fn.flex},k.createElement(R.TextField,{variant:"standard",fullWidth:!0,value:a??"",error:!!t,disabled:n,placeholder:this.getText(l.placeholder),label:this.getText(l.label),helperText:this.renderHelp(l.help,l.helpLink,l.noTranslation),onChange:d=>{const r=d.target.value;this.setState({value:r},()=>this.onChange(v,r))}}),k.createElement(R.Button,{color:"grey",disabled:n,style:fn.button,size:"small",variant:"outlined",onClick:()=>this.setState({showDialog:!0})},"...")),u?k.createElement(H.DialogCron,{title:H.I18n.t("ra_Define schedule"),simple:l.simple,complex:l.complex,cron:a,onClose:()=>this.setState({showDialog:!1}),cancel:H.I18n.t("ra_Cancel"),ok:H.I18n.t("ra_Ok"),theme:this.props.oContext.theme,onOk:d=>this.setState({showDialog:!1,value:d},()=>this.onChange(v,d))}):null)}}class Fs extends K{async componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr),l=(await this.props.oContext.socket.getCertificates()).filter(v=>{const a=this.props.attr.toLowerCase();return a.includes(v.type)||v.type==="public"&&a.includes("cert")||v.type==="private"&&(a.includes("priv")||a.includes("key"))?!0:!!(v.type==="chained"&&(a.includes("chain")||a.includes("ca")))}).map(v=>({label:v.name,value:v.name}));l.unshift({label:H.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({value:t,selectOptions:l})}renderItem(t,n){var v,a;if(!this.state.selectOptions)return null;const l=(v=this.state.selectOptions)==null?void 0:v.find(u=>u.value===this.state.value);return k.createElement(R.FormControl,{style:{width:"100%"},variant:"standard"},this.props.schema.label?k.createElement(R.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,k.createElement(R.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:this.state.value,renderValue:()=>this.getText(l==null?void 0:l.label,this.props.schema.noTranslation!==!1),onChange:u=>this.setState({value:u.target.value},()=>this.onChange(this.props.attr,this.state.value))},(a=this.state.selectOptions)==null?void 0:a.map(u=>k.createElement(R.MenuItem,{key:u.value,value:u.value,style:u.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(u.label,this.props.schema.noTranslation!==!1)))),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const At={fullWidth:{width:"100%"},leWidth:{width:620,marginBottom:10},certWidth:{width:200,marginRight:10}};class Os extends K{async componentDidMount(){var d;super.componentDidMount();const t=await this.props.oContext.socket.getCertificates(),n=[],l=[],v=[];let a=[];const u=await this.props.oContext.socket.getObject("system.certificates");(d=u==null?void 0:u.native)!=null&&d.collections?a=Object.keys(u.native.collections):a=null,t.forEach(r=>{r.type==="public"?n.push({label:r.name,value:r.name}):r.type==="private"?l.push({label:r.name,value:r.name}):r.type==="chained"?v.push({label:r.name,value:r.name}):(n.push({label:r.name,value:r.name}),l.push({label:r.name,value:r.name}),v.push({label:r.name,value:r.name}))}),n.unshift({label:H.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),l.unshift({label:H.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),v.unshift({label:H.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({certsPublicOptions:n,certsChainOptions:v,certsPrivateOptions:l,collectionsOptions:a})}renderItem(t,n){var e,i,o,h,s,p,f;if(!this.state.certsPublicOptions||!this.state.certsPrivateOptions||!this.state.certsChainOptions)return null;const l=(K.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString(),v=K.getValue(this.props.data,this.props.schema.certPublicName||"certPublic"),a=K.getValue(this.props.data,this.props.schema.certPrivateName||"certPrivate"),u=K.getValue(this.props.data,this.props.schema.certChainedName||"certChained"),d=(e=this.state.certsPublicOptions)==null?void 0:e.find(g=>g.value===v),r=(i=this.state.certsPrivateOptions)==null?void 0:i.find(g=>g.value===a),c=(o=this.state.certsChainOptions)==null?void 0:o.find(g=>g.value===u);return k.createElement("div",{style:At.fullWidth},this.state.collectionsOptions?k.createElement(R.FormControl,{style:At.leWidth,variant:"standard"},k.createElement(R.InputLabel,{shrink:!0},"Let's encrypt"),k.createElement(R.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:l,onChange:g=>this.onChange(this.props.schema.leCollectionName||"leCollection",g.target.value==="false"?!1:g.target.value==="true"?!0:g.target.value)},k.createElement(R.MenuItem,{key:"_false",value:"false",style:{fontWeight:"bold"}},H.I18n.t("ra_Do not use let's encrypt")),k.createElement(R.MenuItem,{key:"_true",value:"true",style:{fontWeight:"bold"}},H.I18n.t("ra_Use all available let's encrypt certificates")),(h=this.state.collectionsOptions)==null?void 0:h.map(g=>k.createElement(R.MenuItem,{key:g,value:g},g)))):null,this.state.collectionsOptions?k.createElement("br",null):null,this.state.collectionsOptions&&l!=="false"?k.createElement("div",null,H.I18n.t("ra_Fallback custom certificates")):null,k.createElement(R.FormControl,{style:At.certWidth,variant:"standard"},k.createElement(R.InputLabel,{shrink:!0},H.I18n.t("ra_Public certificate")),k.createElement(R.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:v||"",renderValue:()=>this.getText(d==null?void 0:d.label,!0),onChange:g=>this.onChange(this.props.schema.certPublicName||"certPublic",g.target.value)},(s=this.state.certsPublicOptions)==null?void 0:s.map((g,y)=>k.createElement(R.MenuItem,{key:`${g.value}_${y}`,value:g.value,style:g.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(g.label,!0))))),k.createElement(R.FormControl,{style:At.certWidth,variant:"standard"},k.createElement(R.InputLabel,{shrink:!0},H.I18n.t("ra_Private certificate")),k.createElement(R.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:a||"",renderValue:()=>this.getText(r==null?void 0:r.label,!0),onChange:g=>this.onChange(this.props.schema.certPrivateName||"certPrivate",g.target.value)},(p=this.state.certsPrivateOptions)==null?void 0:p.map((g,y)=>k.createElement(R.MenuItem,{key:`${g.value}_${y}`,value:g.value,style:g.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(g.label,!0))))),k.createElement(R.FormControl,{style:At.certWidth,variant:"standard"},k.createElement(R.InputLabel,{shrink:!0},H.I18n.t("ra_Chained certificate")),k.createElement(R.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:u||"",renderValue:()=>this.getText(c==null?void 0:c.label,!0),onChange:g=>this.onChange(this.props.schema.certChainedName||"certChained",g.target.value)},(f=this.state.certsChainOptions)==null?void 0:f.map((g,y)=>k.createElement(R.MenuItem,{key:`${g.value}_${y}`,value:g.value,style:g.value===K.NONE_VALUE?{opacity:.5}:{}},this.getText(g.label,!0))))))}}class Rs extends K{async componentDidMount(){var l;super.componentDidMount();let t;const n=await this.props.oContext.socket.getObject("system.certificates");(l=n==null?void 0:n.native)!=null&&l.collections?t=Object.keys(n.native.collections):t=[],this.setState({collectionsOptions:t})}renderItem(t,n){var v;if(!this.state.collectionsOptions)return null;const l=(K.getValue(this.props.data,this.props.schema.leCollectionName||"leCollection")||"false").toString();return k.createElement(R.FormControl,{style:{width:"100%"},variant:"standard"},this.props.schema.label?k.createElement(R.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,k.createElement(R.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:l,onChange:a=>this.onChange(this.props.schema.leCollectionName||"leCollection",a.target.value==="false"?!1:a.target.value==="true"?!0:a.target.value)},k.createElement(R.MenuItem,{key:"_false",value:"false",style:{fontWeight:"bold"}},H.I18n.t("ra_Do not use let's encrypt")),k.createElement(R.MenuItem,{key:"_true",value:"true",style:{fontWeight:"bold"}},H.I18n.t("ra_Use all available let's encrypt certificates")),(v=this.state.collectionsOptions)==null?void 0:v.map(a=>k.createElement(R.MenuItem,{key:a,value:a},a))),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class Ns extends K{async componentDidMount(){super.componentDidMount();const t=await this.props.oContext.socket.getCurrentInstance();this.setState({requesting:!0},async()=>{const n=await this.props.oContext.socket.sendTo(t,"checkDocker",null);this.setState({requesting:!1,version:(n==null?void 0:n.version)||"",errorDocker:n?n.daemonRunning?"":H.I18n.t("ra_Docker is not installed or not running"):H.I18n.t("ra_No response from admin")})})}renderItem(t,n){const l=K.getValue(this.props.data,this.props.attr);return this.state.requesting?k.createElement(R.CircularProgress,null):this.state.errorDocker&&!l?k.createElement(R.FormHelperText,{style:{color:"orange"}},H.I18n.t("ra_Docker is not available"),": ",H.I18n.t(`ra_${this.state.errorDocker}`).replace(/^ra_/,"")):k.createElement(R.FormControl,{style:{width:"100%"},variant:"standard"},k.createElement(R.FormControlLabel,{onClick:v=>{if(v.preventDefault(),v.stopPropagation(),!n){const a=this.onChange(this.props.attr,!l);a instanceof Promise&&a.catch(u=>console.error(`Cannot set value: ${u}`))}},control:k.createElement(R.Checkbox,{checked:!!l,onChange:v=>{this.onChange(this.props.attr,v.target.checked)},disabled:n||!!this.state.errorDocker&&!l}),label:this.getText(this.props.schema.label)}),this.props.schema.hideVersion?null:k.createElement(R.FormHelperText,null,this.state.errorDocker?this.state.errorDocker:this.state.version),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const _e={fullWidth:{width:"100%"},licLabel:{fontWeight:"bold",minWidth:100,marginRight:10,textTransform:"capitalize",display:"inline-block"},errorTitle:L=>({color:L.palette.mode==="dark"?"#e39191":"#b62020"}),okTitle:L=>({color:L.palette.mode==="dark"?"#6fd56f":"#007c00"}),errorText:L=>({color:L.palette.mode==="dark"?"#e39191":"#b62020",mb:"30px"})};class Ze extends K{componentDidMount(){super.componentDidMount(),this.setState({_error:"",running:!1,showLicenseData:null,foundSuitableLicense:!1,licenseOfflineCheck:!1,result:null,allLicenses:null,askForUpdate:!1,showLinkToProfile:!1})}renderErrorDialog(){if(this.state._error&&!this.state.showLicenseData){let t=this.state._error;return this.state.allLicenses&&(t=[k.createElement("div",{key:"error"},t)],t.push(k.createElement(R.Button,{key:"button",variant:"contained",onClick:()=>window.open("https://iobroker.net/www/account/licenses","_blank")},H.I18n.t("iobroker.net"))),this.state.allLicenses.length?t.push(k.createElement(R.TableContainer,{key:"table"},k.createElement(R.Table,{size:"small"},k.createElement(R.TableHead,null,k.createElement(R.TableRow,null,k.createElement(R.TableCell,null,H.I18n.t("ra_Product")),k.createElement(R.TableCell,null,H.I18n.t("ra_Version")),k.createElement(R.TableCell,null,"UUID"),k.createElement(R.TableCell,null,H.I18n.t("ra_ValidTill")),k.createElement(R.TableCell,null,H.I18n.t("ra_Commercial")),k.createElement(R.TableCell,null,"ID"))),k.createElement(R.TableBody,null,this.state.allLicenses.map(n=>k.createElement(R.TableRow,{key:n.id},k.createElement(R.TableCell,{sx:n.validName?null:_e.errorText},n.license.product),k.createElement(R.TableCell,{sx:n.validVersion?null:_e.errorText},n.license.version),k.createElement(R.TableCell,{sx:n.validUuid?null:_e.errorText},n.license.uuid||"--"),k.createElement(R.TableCell,{sx:n.validTill?null:_e.errorText},n.license.validTill&&n.license.validTill!=="0000-00-00 00:00:00"?new Date(n.license.validTill).toLocaleDateString():"--"),k.createElement(R.TableCell,null,n.license.invoice!=="free"?n.license.invoice==="MANUALLY_CREATED"?"✓":n.license.invoice:"-"),k.createElement(R.TableCell,null,n.id))))))):(t.push(k.createElement("div",{key:"text1"},H.I18n.t("ra_No one license found in license manager"))),t.push(k.createElement("div",{key:"text2"},H.I18n.t("ra_Please create license"))))),k.createElement(R.Dialog,{open:!0,maxWidth:"xl",fullWidth:this.props.fullWidth!==void 0?this.props.fullWidth:!0,onClick:()=>this.setState({_error:"",allLicenses:null})},k.createElement(R.DialogTitle,null,H.I18n.t("ra_Error")),k.createElement(R.DialogContent,null,k.createElement(R.DialogContentText,null,t)),k.createElement(R.DialogActions,null,k.createElement(R.Button,{variant:"contained",onClick:()=>this.setState({_error:"",allLicenses:null}),color:"primary",autoFocus:!0,startIcon:k.createElement(X.Check,null)},H.I18n.t("ra_Ok"))))}return null}renderMessageDialog(){if(this.state.showLicenseData){const t=[],n=this.state.showLicenseData;return Object.keys(n).forEach(l=>{if(!(n[l]===null||n[l]===void 0))if(typeof n[l]=="object"){const v=n[l];Object.keys(v).forEach(a=>{v[a]!==null&&v[a]!==void 0&&(typeof v[a]=="object"?t.push(k.createElement("div",{key:a},k.createElement("div",{style:_e.licLabel},a,":"),JSON.stringify(v[a],null,2))):t.push(k.createElement("div",{key:a},k.createElement("div",{style:_e.licLabel},l," -",a,":"),v[a].toString())))})}else t.push(k.createElement("div",{key:l},k.createElement("div",{style:_e.licLabel},l.replace(/_/g," "),":"),n[l].toString()))}),t.push(k.createElement("div",{key:"checked"},k.createElement("div",{style:_e.licLabel},H.I18n.t("ra_Checked"),":"),this.state.licenseOfflineCheck?H.I18n.t("ra_locally"):H.I18n.t("ra_via internet"))),k.createElement(R.Dialog,{open:!0,onClose:()=>this.setState({showLicenseData:null})},k.createElement(R.DialogTitle,null,k.createElement(R.Box,{component:"span",sx:this.state.result?_e.okTitle:_e.errorTitle},H.I18n.t("ra_License %s",this.state.result?"OK":"INVALID"))),k.createElement(R.DialogContent,null,this.state.showLinkToProfile?k.createElement(R.Button,{variant:"contained",onClick:()=>window.open("https://iobroker.net/www/account/licenses","_blank")},"https://iobroker.net"):null,this.state._error?k.createElement(R.Box,{component:"div",sx:_e.errorText},this.state._error):null,t),k.createElement(R.DialogActions,null,k.createElement(R.Button,{onClick:()=>this.setState({showLicenseData:null,_error:""}),color:"primary",variant:"contained"},H.I18n.t("ra_Close"))))}return null}static parseJwt(t){const l=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),v=decodeURIComponent(atob(l).split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));try{return JSON.parse(v)}catch{return null}}static isVersionValid(t,n,l,v){if(!n||!t)return!0;let a=!0;const[u]=t.split(".");return n.startsWith(">=")?a=parseInt(u,10)>=parseInt(n.substring(2,10)):n.startsWith("<=")?a=parseInt(u,10)<=parseInt(n.substring(2,10)):n.startsWith(">")?a=parseInt(u,10)>parseInt(n.substring(1,10)):n.startsWith("<")?a=parseInt(u,10)<parseInt(n.substring(1,10)):n.startsWith("=")?a=parseInt(u,10)===parseInt(n.substring(1,10)):n.startsWith("==")?a=parseInt(u,10)===parseInt(n.substring(2,10)):n.startsWith("===")&&(a=parseInt(u,10)===parseInt(n.substring(3,10))),!0}async findInLicenseManager(t){var v,a,u,d;const n=await this.props.oContext.socket.getObject("system.licenses"),l=[];if((a=(v=n==null?void 0:n.native)==null?void 0:v.licenses)!=null&&a.length){let r=null;const c=Date.now();let e;if(this.props.schema.uuid){const o=await this.props.oContext.socket.getObject("system.meta.uuid");e=(u=o==null?void 0:o.native)==null?void 0:u.uuid}let i;if(this.props.schema.version){const o=await this.props.oContext.socket.getObject(`system.adapter.${t}`);i=(d=o==null?void 0:o.common)==null?void 0:d.version}n.native.licenses.forEach(o=>{const h=!o.validTill||o.validTill==="0000-00-00 00:00:00"||new Date(o.validTill).getTime()>c,s=(o.product||"").split("."),p=s[1]===t||t==="vis-2"&&s[1]==="vis",f=!e||!o.uuid||o.uuid===e,g=Ze.isVersionValid(i,o.version,o.invoice,t);(!r||o.invoice!=="free")&&h&&p&&f&&g&&(r=o),l.push({id:o.id,validName:p,validUuid:f,validVersion:g,validTill:h,license:o})}),r&&(l.find(o=>o.id===r.id).used=!0)}return l}async checkLicense(t,n){var d,r,c;let l;if(this.props.schema.uuid){const e=await this.props.oContext.socket.getObject("system.meta.uuid");l=(d=e==null?void 0:e.native)==null?void 0:d.uuid}let v;if(this.props.schema.version){const e=await this.props.oContext.socket.getObject(`system.adapter.${n}`);v=(r=e==null?void 0:e.common)==null?void 0:r.version}const a=new AbortController;let u=setTimeout(()=>{u=null,a.abort()},5e3);try{const e=await window.fetch("https://iobroker.net/api/v1/public/cert/",{method:"POST",body:JSON.stringify({json:t,uuid:l}),headers:{"Content-Type":"text/plain"},signal:a.signal});u&&clearTimeout(u);const i=await e.text();let o;try{o=JSON.parse(i)}catch{}if(o!=null&&o.error)try{const h=Ze.parseJwt(t),s=H.I18n.t(`ra_${h.error||o.error||"Unknown error"}`).replace(/^ra_/,"");return this.setState({_error:s,licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1})}catch{return console.log("Cannot parse license"),this.setState({_error:o.error,result:!1,running:!1})}else{let h=null;try{h=Ze.parseJwt(t)}catch{}if(o){const s=o.validTill||o.valid_till;if(s&&s!=="0000-00-00 00:00:00"&&new Date(s).getTime()<Date.now())return this.setState({_error:H.I18n.t("ra_License expired on %s",new Date(s).toLocaleString()),licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1});const p=(o.name||"").split(".");return p[1]===n||p[1]==="vis"&&n==="vis-2"?l&&!o.uuid&&n==="vis-2"?this.setState({_error:H.I18n.t("ra_License must be converted",o.uuid),showLinkToProfile:!0,licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1}):l&&o.uuid&&o.uuid!==l?this.setState({_error:H.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',o.uuid),licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1}):Ze.isVersionValid(v,o.version,o.invoice,n)?this.setState({licenseOfflineCheck:!1,showLicenseData:h,result:!0,running:!1}):this.setState({_error:H.I18n.t("ra_License is for version %s, but required version is %s",o.version,this.props.schema.version),licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1}):this.setState({_error:H.I18n.t('ra_License for other product "%s"',o.name),licenseOfflineCheck:!1,showLicenseData:h,result:!1,running:!1})}throw new Error("ra_Invalid answer from server")}}catch(e){if(((c=e==null?void 0:e.response)==null?void 0:c.status)===404)return this.setState({_error:H.I18n.t("ra_License does not exist"),result:!1,running:!1});try{const i=Ze.parseJwt(t),o=(i.name||"").split(".");return i.valid_till&&i.valid_till!=="0000-00-00 00:00:00"&&new Date(i.valid_till).getTime()<Date.now()?this.setState({_error:H.I18n.t("ra_License expired on %s",new Date(i.valid_till).toLocaleString()),showLicenseData:i,licenseOfflineCheck:!0,running:!1,result:!1}):o[1]===n?l&&i.uuid&&i.uuid!==l?this.setState({_error:H.I18n.t('ra_Serial number (UUID) "%s" in license is for other device.',i.uuid),showLicenseData:i,licenseOfflineCheck:!0,result:!1,running:!1}):Ze.isVersionValid(v,i.version,i.invoice,n)?this.setState({running:!1,result:!0,licenseOfflineCheck:!0,showLicenseData:i}):this.setState({_error:H.I18n.t("ra_License is for version %s, but required version is %s",i.version,this.props.schema.version),licenseOfflineCheck:!0,showLicenseData:i,result:!1,running:!1}):this.setState({_error:H.I18n.t('ra_License for other product "%s"',i.name),licenseOfflineCheck:!0,showLicenseData:i,result:!1,running:!1})}catch{return this.setState({_error:H.I18n.t("ra_Cannot decode license"),result:!1,licenseOfflineCheck:!0,running:!1})}}}renderAskForUpdate(){return this.state.askForUpdate?k.createElement(H.DialogConfirm,{text:H.I18n.t("ra_License not found in license manager. Do you want to read licenses from iobroker.net?"),ok:H.I18n.t("ra_Yes"),onClose:async t=>{if(t){this.setState({askForUpdate:!1});try{await this.props.oContext.socket.updateLicenses(null,null)}catch(n){window.alert(H.I18n.t("ra_Cannot read licenses: %s",n));return}await this._onClick(!0)}else this.setState({askForUpdate:!1,running:!1})}}):null}async _onClick(t){const n=this.props.oContext.adapterName==="vis-2"?"vis":this.props.oContext.adapterName;this.setState({running:!0});let l,v;if(this.props.data.useLicenseManager){if(v=await this.findInLicenseManager(n),l=v.find(a=>a.used),l&&(l=l.license.json),!l&&!t){this.setState({askForUpdate:!0});return}}else l=this.props.data.license;l?await this.checkLicense(l,n):this.props.data.useLicenseManager?this.setState({_error:H.I18n.t("ra_Suitable license not found in license manager"),result:!1,running:!1,allLicenses:v}):this.setState({_error:H.I18n.t("ra_Please enter the license"),result:!1,running:!1})}renderItem(){return k.createElement("div",{style:_e.fullWidth},k.createElement(R.Button,{variant:this.props.schema.variant||"outlined",color:this.props.schema.color||"primary",style:_e.fullWidth,disabled:!this.props.data.license&&!this.props.data.useLicenseManager||this.state.running,startIcon:k.createElement(X.Send,null),onClick:()=>this._onClick()},this.state.running?k.createElement(R.CircularProgress,{size:20,style:{marginRight:8}}):null,this.getText(this.props.schema.label||"ra_Check license",this.props.schema.noTranslation)),this.renderMessageDialog(),this.renderErrorDialog(),this.renderAskForUpdate())}}class Bs extends K{renderItem(t,n){const l=K.getValue(this.props.data,this.props.attr),v=Array.isArray(l);return k.createElement(R.FormControl,{style:{width:"100%"},variant:"standard"},k.createElement(R.FormControlLabel,{onClick:a=>{if(a.preventDefault(),a.stopPropagation(),!n){const u=this.onChange(this.props.attr,!l);u instanceof Promise&&u.catch(d=>console.error(`Cannot set value: ${d}`))}},control:k.createElement(R.Checkbox,{indeterminate:v,checked:!!l,onChange:a=>{let u;v?u=this.onChange(this.props.attr,!0):u=this.onChange(this.props.attr,a.target.checked),u instanceof Promise&&u.catch(d=>console.error(`Cannot set value: ${d}`))},disabled:n||this.props.schema.readOnly}),label:this.getText(this.props.schema.label)}),k.createElement(R.FormHelperText,{style:{color:"red"}},t?this.props.schema.validatorErrorText?H.I18n.t(this.props.schema.validatorErrorText):H.I18n.t("ra_Error"):null),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Ps={standard:R.Input,filled:ns,outlined:R.OutlinedInput},Ws=L=>{const t=L.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{},inputRoot:{display:"inline-flex",flexWrap:"wrap",flex:1,marginTop:0,minWidth:70,"&.mui-variant-outlined,&.mui-variant-filled":{boxSizing:"border-box"},"&.mui-variant-outlined":{paddingTop:"14px"},"&.mui-variant-filled":{paddingTop:"28px"}},input:{display:"inline-block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",appearance:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",float:"left",flex:1},chipContainer:{display:"flex",flexFlow:"row wrap",alignItems:"center",cursor:"text",marginBottom:"-2px",minHeight:40},outlined:{"& input":{height:16,paddingTop:"4px",paddingBottom:"12px",marginTop:"4px",marginBottom:"4px"}},standard:{marginTop:"18px"},filled:{"& input":{height:22,marginBottom:"4px",marginTop:"4px",paddingTop:0},"$marginDense & input":{height:26}},labeled:{},label:{top:4,"&$outlined&:not($labelShrink)":{top:2,"$marginDense &":{top:5}},"&$filled&:not($labelShrink)":{top:15,"$marginDense &":{top:20}}},labelShrink:{top:0},helperText:{marginBottom:-20},focused:{},disabled:{},underline:{"&:after":{borderBottom:`2px solid ${L.palette.primary[t?"dark":"light"]}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:L.transitions.create("transform",{duration:L.transitions.duration.shorter,easing:L.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:L.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:L.transitions.create("border-bottom-color",{duration:L.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):not($focused):not($error):before":{borderBottom:`2px solid ${L.palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{"&:after":{backgroundColor:L.palette.error.main,transform:"scaleX(1)"}},chip:{margin:"0 8px 8px 0",float:"left"},marginDense:{}}},Ht={BACKSPACE:8,DELETE:46,LEFT_ARROW:37,RIGHT_ARROW:39},zs=({value:L,isFocused:t,isDisabled:n,isReadOnly:l,handleClick:v,handleDelete:a,style:u},d)=>k.createElement(R.Chip,{key:d,style:{...u,pointerEvents:n||l?"none":void 0,backgroundColor:t?is[300]:void 0},onClick:v,onDelete:a,label:L});class Hs extends k.Component{labelRef;labelNode=null;input;newChipKeyCodes;newChipKeys;actualInput=null;inputBlurTimeout=null;_keyPressed;_preventChipCreation;styles={};styleTheme=null;constructor(t){super(t),this.state={chips:t.defaultValue||[],focusedChip:null,inputValue:"",isFocused:!1,chipsUpdated:!1,prevPropsValue:[],variant:this.props.variant||"standard"},this.newChipKeyCodes=t.newChipKeyCodes||[13],this.newChipKeys=t.newChipKeys||["Enter"],this.labelRef=k.createRef(),this.input=k.createRef()}componentDidMount(){this.state.variant==="outlined"&&(this.labelNode=ts.findDOMNode(this.labelRef.current),this.forceUpdate())}componentWillUnmount(){this.inputBlurTimeout&&clearTimeout(this.inputBlurTimeout)}static getDerivedStateFromProps(t,n){let l=null;return t.value&&t.value.length!==n.prevPropsValue.length&&(l={prevPropsValue:t.value},t.clearInputValueOnChange&&(l.inputValue="")),t.clearInputValueOnChange&&t.value&&t.value.length!==n.prevPropsValue.length&&(l={prevPropsValue:t.value,inputValue:""}),t.disabled&&(l={...l,focusedChip:null}),!n.chipsUpdated&&t.defaultValue&&(l={...l,chips:t.defaultValue}),l}focus=()=>{var t;(t=this.actualInput)==null||t.focus(),this.state.focusedChip&&this.setState({focusedChip:null})};handleInputBlur=t=>{this.props.onBlur&&this.props.onBlur(t),this.setState({isFocused:!1}),this.state.focusedChip&&this.setState({focusedChip:null});const n=t.target.value;let l;switch(this.props.blurBehavior||"clear"){case"add-or-clear":l={clearInputOnFail:!0};case"add":if(this.props.delayBeforeAdd){const v=(this.props.value||this.state.chips).length;this.inputBlurTimeout=setTimeout(()=>{const a=(this.props.value||this.state.chips).length;v===a?this.handleAddChip(n,l):this.clearInput()},150)}else this.handleAddChip(n,l);break;case"clear":this.clearInput();break}};handleInputFocus=t=>{var n,l;this.setState({isFocused:!0}),(l=(n=this.props).onFocus)==null||l.call(n,t)};handleKeyDown=t=>{const{focusedChip:n}=this.state;if(this._keyPressed=!1,this._preventChipCreation=!1,this.props.onKeyDown&&(this.props.onKeyDown(t),t.isDefaultPrevented()))return;const l=this.props.value||this.state.chips;if(this.newChipKeyCodes.includes(t.keyCode)||this.newChipKeys.includes(t.key)){this.handleAddChip(t.target.value)!==!1&&t.preventDefault();return}switch(t.keyCode){case Ht.BACKSPACE:t.target.value===""&&(n?(this.handleDeleteChip(l[n],n),n&&this.setState({focusedChip:n-1})):this.setState({focusedChip:l.length-1}));break;case Ht.DELETE:t.target.value===""&&n&&(this.handleDeleteChip(l[n],n),n<=l.length-1&&this.setState({focusedChip:n}));break;case Ht.LEFT_ARROW:n===null&&t.target.value===""&&l.length?this.setState({focusedChip:l.length-1}):n!==null&&n>0&&this.setState({focusedChip:n-1});break;case Ht.RIGHT_ARROW:n!==null&&n<l.length-1?this.setState({focusedChip:n+1}):this.setState({focusedChip:null});break;default:this.setState({focusedChip:null});break}};handleKeyUp=t=>{!this._preventChipCreation&&(this.newChipKeyCodes.includes(t.keyCode)||this.newChipKeys.includes(t.key))&&this._keyPressed?this.clearInput():this.updateInput(t.target.value),this.props.onKeyUp&&this.props.onKeyUp(t)};handleUpdateInput=t=>{(this.props.inputValue===null||this.props.inputValue===void 0)&&this.updateInput(t.target.value),this.props.onUpdateInput&&this.props.onUpdateInput(t)};handleAddChip(t,n){if(this.props.onBeforeAdd&&!this.props.onBeforeAdd(t))return this._preventChipCreation=!0,n&&n.clearInputOnFail&&this.clearInput(),!1;this.clearInput();const l=this.props.value||this.state.chips;return t.trim().length?((this.props.allowDuplicates||!l.includes(t))&&(this.props.value&&this.props.onAdd?this.props.onAdd(t):this.updateChips([...this.state.chips,t])),!0):!1}handleDeleteChip(t,n){if(this.props.value)this.props.onDelete&&this.props.onDelete(t,n);else{const l=this.state.chips.slice();if(l.splice(n,1)){let a=this.state.focusedChip;this.state.focusedChip===n?a=null:this.state.focusedChip!==null&&this.state.focusedChip>n&&(a=this.state.focusedChip-1),this.updateChips(l,{focusedChip:a})}}}updateChips(t,n={}){this.setState({chips:t,chipsUpdated:!0,...n}),this.props.onChange&&this.props.onChange(t)}clearInput(){this.updateInput("")}updateInput(t){this.setState({inputValue:t})}setActualInputRef=t=>{this.actualInput=t,this.props.inputRef&&this.props.inputRef(t)};render(){const{alwaysShowPlaceholder:t,chipRenderer:n=zs,className:l,disabled:v,disableUnderline:a,error:u,FormHelperTextProps:d,fullWidth:r,fullWidthInput:c,helperText:e,id:i,InputProps:o={},InputLabelProps:h={},inputValue:s,label:p,placeholder:f,readOnly:g,required:y,rootRef:A,value:E,margin:w}=this.props,m=this.state.variant;this.styleTheme!==this.props.theme.palette.mode&&(this.styleTheme=this.props.theme.palette.mode,this.styles=H.Utils.getStyle(this.props.theme,Ws));let S=E||this.state.chips||[];Array.isArray(S)||(S=(S||"").toString().split(/[,\s]+/).map(C=>C.trim()));const M=s??this.state.inputValue,D=(this.props.value||M).length||M.length,_=typeof h.shrink=="boolean"?h.shrink:p!==null&&(D||this.state.isFocused||S.length),F=S.map((C,b)=>n({value:C,isDisabled:!!v,isReadOnly:!!g,isFocused:this.state.focusedChip===b,handleClick:()=>this.setState({focusedChip:b}),handleDelete:()=>this.handleDeleteChip(C,b),style:this.styles.chip},b.toString())),x={};m==="outlined"&&(x.notched=!!_,x.labelWidth=_&&this.labelNode&&this.labelNode.offsetWidth||0),m!=="standard"?x.startAdornment=F:o.disableUnderline=!0;const $=Ps[m];return k.createElement(R.FormControl,{ref:A,fullWidth:r,className:l,sx:{...this.styles.root,...w==="dense"?this.styles.marginDense:{}},error:u,required:S.length>0?void 0:y,onClick:this.focus,disabled:v,variant:m,component:"div",margin:w},p&&k.createElement(R.InputLabel,{htmlFor:i,sx:{"&.MuiInputLabel-root":this.styles.label,"&.MuiInputLabel-shrink":this.styles.labelShrink},shrink:!!_,focused:this.state.isFocused,variant:m,ref:this.labelRef,required:y,component:"label",...h},p),k.createElement(R.Box,{component:"div",id:"input-chip-container",sx:{...this.styles[m],...this.styles.chipContainer,...this.state.isFocused?this.styles.focused:void 0,...!a&&m==="standard"?this.styles.underline:void 0,...v?this.styles.disabled:void 0,...p?this.styles.labeled:void 0,...u?this.styles.error:void 0}},m==="standard"&&F,k.createElement($,{ref:this.input,className:`mui-variant-${this.styles[m]} ${p?"mui-chip-with-label":"mui-chip-no-label"}`,sx:{"&.MuiInputBase-input":{...this.styles.input,...this.styles[m]},"&.MuiInputBase-root":{...this.styles.inputRoot}},id:i,value:M,onChange:this.handleUpdateInput,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,inputRef:this.setActualInputRef,disabled:v,fullWidth:c,placeholder:!D&&(_||p===null||p===void 0)||t?f:void 0,readOnly:g,...o,...x})),e&&k.createElement(R.FormHelperText,{...d,className:d==null?void 0:d.className,style:this.styles.helperText},e))}}class ii extends K{componentDidMount(){super.componentDidMount();const{data:t,attr:n}=this.props,l=K.getValue(t,n);if(this.props.schema.delimiter&&typeof l=="string"){const v=l.split(this.props.schema.delimiter).map(a=>a.trim()).filter(a=>a);this.setState({value:v})}else this.setState({value:l||[]})}renderItem(t,n){const{attr:l,schema:v}=this.props,{value:a}=this.state;return k.createElement(R.FormControl,{fullWidth:!0,variant:"standard"},k.createElement(Hs,{value:a,disabled:!!n,label:this.getText(v.label),error:!!t,onAdd:u=>{const d=JSON.parse(JSON.stringify(a));d.push(u),this.setState({value:d},()=>{let r;this.props.schema.delimiter?r=this.onChange(l,d.join(`${this.props.schema.delimiter} `)):r=this.onChange(l,d),r instanceof Promise&&r.catch(c=>console.error(c))})},theme:this.props.oContext.theme,onDelete:(u,d)=>{const r=JSON.parse(JSON.stringify(a));r.splice(d,1),this.setState({value:r},()=>{let c;this.props.schema.delimiter?c=this.onChange(l,r.join(`${this.props.schema.delimiter} `)):c=this.onChange(l,r),c instanceof Promise&&c.catch(e=>console.error(e))})}}),k.createElement(R.FormHelperText,null,H.I18n.t("ra_Press ENTER Key to add new item")),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class js extends K{renderColorDialog(){return!!this.state.showColorDialog&&k.createElement(R.Dialog,{onClose:()=>this.setState({showColorDialog:!1}),open:this.state.showColorDialog},k.createElement(Zr,{color:this.state.colorDialogValue,onChange:t=>this.setState({colorDialogValue:t.hex},()=>this.onChange(this.props.attr,this.state.colorDialogValue))}))}renderItem(t,n){const l=K.getValue(this.props.data,this.props.attr);let v=H.Utils.isUseBright(l,null);return v===null&&(v=void 0),k.createElement(k.Fragment,null,this.renderColorDialog(),k.createElement(R.TextField,{variant:"standard",disabled:!!n,style:{minWidth:100,width:"calc(100% - 8px)"},label:this.getText(this.props.schema.label),value:l||"",onClick:()=>!this.props.schema.readOnly&&this.setState({showColorDialog:!0,colorDialogValue:l||""}),onChange:a=>{const u=a.target.value,d=this.onChange(this.props.attr,u);d instanceof Promise&&d.catch(r=>console.error(`Cannot set value: ${r}`))},slotProps:{htmlInput:{style:{backgroundColor:l,color:v?"#FFF":"#000"},readOnly:this.props.schema.readOnly||!1},input:{endAdornment:!this.props.schema.readOnly&&l&&!this.props.schema.noClearButton?k.createElement(R.IconButton,{tabIndex:-1,size:"small",onClick:a=>{a.stopPropagation();const u=this.onChange(this.props.attr,"");u instanceof Promise&&u.catch(d=>console.error(`Cannot set value: ${d}`))}},k.createElement(X.Close,null)):void 0},inputLabel:{shrink:!0}}}))}}const gn={width:{width:"calc(100% - 85px)"},width50:{width:120,marginRight:5}};class Vs extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t});const n={};this.props.schema.useSystemName&&(n.useSystem=!!K.getValue(this.props.data,this.props.schema.useSystemName)),this.props.schema.longitudeName&&this.props.schema.latitudeName?(n.longitude=K.getValue(this.props.data,this.props.schema.longitudeName),n.latitude=K.getValue(this.props.data,this.props.schema.latitudeName),!n.longitude&&!n.latitude&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300)):!K.getValue(this.props.data,this.props.attr)&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300),Object.keys(n).length&&setTimeout(()=>this.setState(n),50)}async getSystemCoordinates(){const t=await this.props.oContext.socket.getCompactSystemConfig();if(t!=null&&t.common&&(t.common.longitude||t.common.latitude))if(window.alert(H.I18n.t("ra_Used system settings")),this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:t.common.longitude,latitude:t.common.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,t.common.longitude),await this.onChange(this.props.schema.latitudeName,t.common.latitude)});else{const n=t.common.latitude+(this.props.schema.divider||",")+t.common.longitude;this.setState({value:n},()=>{const l=this.onChange(this.props.attr,n);l instanceof Promise&&l.catch(v=>console.error(`Cannot set value: ${v}`))})}else window.alert(H.I18n.t("ra_Cannot determine position: System settings are empty and GPS detection is disabled in browser"))}getCoordinates(){navigator.geolocation?navigator.geolocation.getCurrentPosition(async t=>{if(t!=null&&t.coords)if(this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:t.coords.longitude,latitude:t.coords.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,t.coords.longitude||""),await this.onChange(this.props.schema.latitudeName,t.coords.latitude||"")});else{const n=t.coords.latitude+(this.props.schema.divider||",")+t.coords.longitude;this.setState({value:n},()=>{const l=this.onChange(this.props.attr,n);l instanceof Promise&&l.catch(v=>console.error(`Cannot set value: ${v}`))})}else await this.getSystemCoordinates()},async t=>{console.error(`Cannot determine coordinates from browser: ${t.message}`),await this.getSystemCoordinates()}):this.getSystemCoordinates().catch(t=>{console.error(`Cannot determine coordinates: ${t}`)})}renderItem(t,n){return k.createElement(k.Fragment,null,this.props.schema.useSystemName?k.createElement(R.FormControlLabel,{control:k.createElement(R.Checkbox,{checked:!!this.state.useSystem,onChange:l=>{const v=l.target.checked;v&&this.getSystemCoordinates().catch(a=>console.error(`Cannot determine coordinates: ${a}`)),this.setState({useSystem:v},()=>this.onChange(this.props.schema.useSystemName,v))}}),label:H.I18n.t("ra_Use system settings for position")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?k.createElement(R.TextField,{variant:"standard",style:gn.width50,value:this.state.longitude??"",error:!!t,disabled:this.state.useSystem||!!n,onChange:l=>{const v=l.target.value;this.setState({longitude:v},()=>{const a=this.onChange(this.props.schema.longitudeName,(v||"").trim());a instanceof Promise&&a.catch(u=>console.error(`Cannot set value: ${u}`))})},label:H.I18n.t("ra_Longitude")}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?k.createElement(R.TextField,{variant:"standard",style:gn.width50,value:this.state.latitude??"",error:!!t,disabled:this.state.useSystem||!!n,onChange:l=>{const v=l.target.value;this.setState({latitude:v},()=>this.onChange(this.props.schema.latitudeName,(v||"").trim()))},label:H.I18n.t("ra_Latitude")}):null,!this.props.schema.longitudeName||!this.props.schema.latitudeName?k.createElement(R.TextField,{variant:"standard",style:gn.width,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!t,disabled:!!n,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.state.useSystem}},onChange:l=>{const v=l.target.value;this.setState({value:v},()=>this.onChange(this.props.attr,(v||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):null,this.state.useSystem?null:k.createElement(R.Fab,{size:"small",onClick:()=>this.getCoordinates(),title:H.I18n.t("ra_Take browser position"),style:{marginRight:4}},k.createElement(X.LocationOn,null)),this.state.useSystem?null:k.createElement(R.Fab,{size:"small",onClick:()=>this.getSystemCoordinates(),title:H.I18n.t("ra_Take position from system settings")},k.createElement(X.GpsFixed,null)))}}os({name:"iobroker_admin",shared:{"@iobroker/adapter-react-v5":{lib:()=>es,version:"*"},"@mui/icons-material":{lib:()=>qr,version:"*"},"@iobroker/json-config":{lib:()=>ls,version:"*"}},remotes:[]});class _t extends K{static runningLoads={};constructor(t){super(t),Object.assign(this.state,{Component:null,error:""})}async componentDidMount(){if(!this.props.schema.url){console.error("URL is empty. Cannot load custom component!"),this.setState({error:"URL is empty. Cannot load custom component!"});return}let t;this.props.schema.url.startsWith("http:")||this.props.schema.url.startsWith("https:")?t=this.props.schema.url:this.props.schema.url.startsWith("./")?t=`${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\./,"")}`:t=`${window.location.protocol}//${window.location.host}/adapter/${this.props.oContext.adapterName}/${this.props.schema.url}`;const[n,l,...v]=this.props.schema.name.split("/"),a=v.join("/");if(!t){console.error('Cannot find URL for custom component! Please define "url" as "custom/customComponents.js" in the schema');return}if(!n||!l||!a){console.error('Invalid format of "name"! Please define "name" as "ConfigCustomBackItUpSet/Components/AdapterExist" in the schema');return}let u=_t.runningLoads[`${t}!${l}`];if(!(u instanceof Promise)){let d;if(this.props.schema.i18n===!0){const r=t.lastIndexOf("/");let c;r!==-1?c=t.substring(0,r):c=t;const e=H.I18n.getLanguage(),i=`${c}/i18n/${e}.json`;d=fetch(i).then(o=>o.json()).then(o=>H.I18n.extendTranslations(o,e)).catch(o=>{if(e!=="en"){fetch(`${c}/i18n/en.json`).then(h=>h.json()).then(h=>H.I18n.extendTranslations(h,e)).catch(h=>console.log(`Cannot load i18n "${i}": ${h}`));return}console.log(`Cannot load i18n "${i}": ${o}`)})}else if(this.props.schema.i18n&&typeof this.props.schema.i18n=="object")try{H.I18n.extendTranslations(this.props.schema.i18n)}catch(r){console.error(`Cannot import i18n: ${r}`)}try{console.log(t,n,l,a),rs([{name:n,entry:t,type:this.props.schema.bundlerType||void 0}]),u=ss(`${n}/${l}`),d instanceof Promise&&(u=Promise.all([u,d]).then(r=>r[0])),_t.runningLoads[`${t}!${l}`]=u}catch(r){console.error(r),this.setState({error:`Cannot import from ${this.props.schema.url}: ${r}`})}}try{const d=(await u).default;if(d!=null&&d[a])this.setState({Component:d[a]});else{const r=Object.keys(d||{});console.error("URL is empty. Cannot load custom component!"),this.setState({error:`Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${r.join(", ")}`})}}catch(d){console.error(d),this.setState({error:`Cannot import from ${this.props.schema.url}: ${d}`})}}render(){const t=this.state.Component,n=this.props.schema||{},l=t?k.createElement(t,{...this.props,socket:this.props.oContext.socket,theme:this.props.oContext.theme,themeType:this.props.oContext.themeType,instance:this.props.oContext.instance,adapterName:this.props.oContext.adapterName,systemConfig:this.props.oContext.systemConfig,forceUpdate:this.props.oContext.forceUpdate}):this.state.error?k.createElement("div",null,this.state.error):k.createElement(R.LinearProgress,null);return n.newLine?k.createElement(k.Fragment,null,k.createElement("div",{style:{flexBasis:"100%",height:0}}),l):l}}class Us extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t})}renderItem(t,n){return k.createElement(_i.DatePicker,{sx:l=>({width:"100%",borderBottom:`1px solid ${l.palette.text.primary}`,"& fieldset":{display:"none"},"& input":{padding:`${l.spacing(1.5)} 0 4px 0`},"& .MuiInputAdornment-root":{marginLeft:0,marginTop:1},"& label":{transform:"translate(0px, -9px) scale(0.75)"}}),format:this.props.oContext.systemConfig.dateFormat.toLowerCase().replace("mm","MM"),disabled:!!n,value:this.state.value,onChange:l=>{this.setState({value:l},()=>this.onChange(this.props.attr,this.state.value))},label:this.getText(this.props.schema.label)})}}class Gs extends K{renderItem(){if(!this.props.schema)return null;if(this.props.oContext.DeviceManager){const n=this.props.oContext.DeviceManager;return k.createElement(n,{uploadImagesToInstance:`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,title:this.getText(this.props.schema.label),socket:this.props.oContext.socket,selectedInstance:`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,themeName:this.props.themeName,theme:this.props.oContext.theme,themeType:this.props.oContext.themeType,isFloatComma:this.props.oContext.isFloatComma,dateFormat:this.props.oContext.dateFormat})}return k.createElement("div",null,"DeviceManager not found")}}const Re={fullWidth:{width:"100%"},uploadDiv:{position:"relative",width:"100%"},uploadDivDragging:{opacity:1,background:"rgba(128,255,128,0.1)"},uploadCenterDiv:{margin:5,border:"3px dashed grey",borderRadius:5,width:"100%",height:"100%",position:"absolute",display:"flex"},uploadCenterIcon:{paddingTop:10,width:48,height:48},uploadCenterText:{fontSize:16},uploadCenterTextAndIcon:{textAlign:"center",position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},disabledOpacity:{opacity:.3,cursor:"default"},error:{border:"2px solid red"},deleteButton:{},selectedImage:{height:40,width:40,display:"inline-block",marginRight:8}},Ks=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],Js=["mp3","ogg","wav","aac"],Ys=["avi","mp4","mov"],Qs=["txt","log","html","htm"],Xs=["json","js","ts"];class en extends K{dropzoneRef;imagePrefix;objectID;path;constructor(t){super(t),this.dropzoneRef=k.createRef(),this.imagePrefix=this.props.oContext.imagePrefix===void 0?"./files":this.props.oContext.imagePrefix}componentDidMount(){super.componentDidMount(),this.objectID=(this.props.schema.objectID||"0_userdata.0").replace("%INSTANCE%",(this.props.oContext.instance||0).toString()),this.path=this.props.schema.upload,this.path&&(this.path==="/"?this.path="":this.path.endsWith("/")||(this.path=`${this.path}/`)),this.updateFiles().then(()=>{const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t}),this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(n=>console.error(`Cannot subscribe: ${n}`))})}onFolderChanged=(t,n)=>{this.path&&n.startsWith(this.path)&&this.updateFiles().catch(l=>console.error(`Cannot update files: ${l}`))};componentWillUnmount(){this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(t=>console.error(`Cannot subscribe: ${t}`)),super.componentWillUnmount()}async updateFiles(){const t=await this.readFiles(this.props.schema.pattern);await new Promise(n=>this.setState({files:t},n))}async readFolder(t,n,l){try{const v=await this.props.oContext.socket.readDir(this.objectID,t.replace(/^\//,"")||null);for(let a=0;a<v.length;a++){const u=v[a];if(u.isDir)await this.readFolder(`${t+u.file}/`,n,l);else{let d=!1;l==="*.*"&&u.file.includes(".")||!l||l==="*"||l===".*"&&u.file.startsWith(".")?d=!0:d=new RegExp(`^${l.replace(/\./g,"\\.").replace(/\*/g,".*")}$`).test(u.file),d&&n.push({name:t+u.file,size:u.stats?H.Utils.formatBytes(u.stats.size):"--"})}}}catch(v){console.error(`Cannot read "${t}": ${v}`)}return n}async readFiles(t){const n=[];t=t||this.props.schema.pattern,t||(t="**/*.*");let l;const v=t.lastIndexOf("/");if(v===-1?l=t:l=t.substring(v+1),t.startsWith("**"))await this.readFolder("/",n,l);else{const a=t.lastIndexOf("/");if(a===-1)await this.readFolder("/",n,l);else{const u=t.substring(0,a+1);await this.readFolder(u,n,l)}}return n}onDrop(t){const n=t[0],l=new FileReader,v=this.props.schema.maxSize||2*1024*1024;l.onabort=()=>console.log("file reading was aborted"),l.onerror=()=>console.log("file reading has failed"),l.onload=()=>{if(n.size>v){window.alert(H.I18n.t("File is too big. Max %sk allowed. Try use SVG.",Math.round(v/1024)));return}this.props.oContext.socket.writeFile64(this.objectID,this.path+n.name,l.result).then(()=>this.updateFiles()).then(()=>this.setState({value:this.path+n.name},()=>this.onChange(this.props.attr,this.path+n.name))).catch(a=>window.alert(`Cannot upload file: ${a}`))},l.readAsArrayBuffer(n)}renderDeleteDialog(){return this.state.deleteFile?k.createElement(H.DialogConfirm,{title:H.I18n.t("ra_Are you sure?"),text:H.I18n.t("ra_File will be deleted"),ok:H.I18n.t("ra_Delete"),cancel:H.I18n.t("ra_Cancel"),onClose:t=>{const n=this.state.deleteFile;this.setState({deleteFile:""},()=>{t&&this.props.oContext.socket.deleteFile(this.objectID,n).then(()=>this.updateFiles()).catch(l=>window.alert(`Cannot delete file: ${l}`))})}}):null}static base64ToArrayBuffer(t){const n=window.atob(t),l=n.length,v=new Uint8Array(l);for(let a=0;a<l;a++)v[a]=n.charCodeAt(a);return v.buffer}loadFile(){return this.props.oContext.socket.readFile(this.objectID,this.state.value,!0)}play(){this.loadFile().then(t=>{if(typeof AudioContext<"u"){const n=new AudioContext,l=en.base64ToArrayBuffer(t.file);n.decodeAudioData(l,v=>{const a=n.createBufferSource();a.buffer=v,a.connect(n.destination),a.start(0)},v=>window.alert(`Cannot play: ${v.message}`))}})}getFileIcon(t){return t!=null&&t.extension?Ks.includes(t.extension)?k.createElement("div",{style:{...Re.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.objectID}/${t.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):Js.includes(t.extension)?k.createElement(X.MusicNote,null):Qs.includes(t.extension)?k.createElement(X.Article,null):Ys.includes(t.extension)?k.createElement(X.Videocam,null):Xs.includes(t.extension)?k.createElement(X.Code,null):null:null}renderItem(t,n){if(!this.state.files)return null;const l=[];this.props.schema.withFolder||this.state.files.forEach(e=>{const i=e.name.lastIndexOf("/");if(i===-1)l.includes("/")||l.push("/");else{const o=e.name.substring(0,i+1);l.includes(o)||l.push(o)}});const v=this.state.files.map(e=>({value:e.name,label:!this.props.schema.withFolder&&l.length===1?`${e.name.substring(l[0].length)}`:`${e.name}${this.props.schema.noSize?"":`(${e.size})`}`,extension:e.name.toLowerCase().split(".").pop()}));this.props.schema.noNone||v.unshift({label:H.I18n.t("ra_none"),value:""});const a=v.find(e=>e.value===this.state.value);let u=0;this.props.schema.upload&&u++,this.props.schema.refresh&&u++;const d=this.state.value&&(this.state.value.endsWith(".mp3")||this.state.value.endsWith(".ogg")||this.state.value.endsWith(".wav"));d&&u++;const r=k.createElement("div",{style:Re.fullWidth},k.createElement(R.FormControl,{variant:"standard",style:{width:`calc(100% - ${u*42}px)`}},this.props.schema.label?k.createElement(R.InputLabel,null,this.getText(this.props.schema.label)):null,k.createElement(R.Select,{variant:"standard",error:!!t,disabled:!!n,value:this.state.value||"_",renderValue:()=>k.createElement(k.Fragment,null,this.getFileIcon(a),k.createElement("span",null,(a==null?void 0:a.label)||"")),onChange:e=>{this.setState({value:e.target.value==="_"?"":e.target.value},()=>this.onChange(this.props.attr,this.state.value))}},v.map(e=>k.createElement(R.MenuItem,{key:e.value,value:e.value},k.createElement(R.ListItemIcon,null,this.getFileIcon(e)),k.createElement(R.ListItemText,null,e.label),this.props.schema.delete&&a.value?k.createElement(R.IconButton,{style:Re.deleteButton,size:"small",onClick:()=>this.setState({deleteFile:a.value})},k.createElement(X.Delete,null)):null))),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null),this.props.schema.refresh&&k.createElement(R.IconButton,{onClick:()=>this.updateFiles()},k.createElement(X.Refresh,null)),this.props.schema.upload&&k.createElement(R.IconButton,{onClick:()=>{var e;return(e=this.dropzoneRef.current)==null?void 0:e.open()}},k.createElement(X.UploadFile,null)),d&&k.createElement(R.IconButton,{style:{color:"#00FF00"},onClick:()=>this.play()},k.createElement(X.PlayArrow,null)));if(!this.props.schema.upload)return k.createElement(k.Fragment,null,r,this.renderDeleteDialog());let c={"*/*":[]};if(this.props.schema.fileTypes==="image"?c={"image/*":[".png",".jpg",".svg",".gif",".apng",".avif",".webp"]}:this.props.schema.fileTypes==="audio"?c={"audio/*":[".mp3",".ogg",".wav",".mp4"]}:this.props.schema.fileTypes==="text"&&(c={"text/plain":[".txt"]}),this.props.schema.pattern){const e=this.props.schema.pattern.split("/").pop().toLowerCase().replace(/.*\./,"");e==="png"||e==="jpg"||e==="svg"||e==="gif"||e==="apng"||e==="avif"||e==="webp"?c={"image/*":[".png",".jpg",".svg",".gif",".apng",".avif",".webp"]}:e==="mp3"||e==="ogg"||e==="wav"?c={"audio/*":[".mp3",".ogg",".wav",".mp4"]}:e==="ics"?c={"text/calendar":[".ics"]}:e==="txt"?c={"text/plain":[".txt"]}:e==="pem"?c={"text/plain":[".pem"]}:c={"*/*":[`.${e}`]}}return k.createElement(Ti,{ref:this.dropzoneRef,multiple:!1,accept:c,noKeyboard:!0,noClick:!0,maxSize:this.props.schema.maxSize||2*1024*1024,onDragEnter:()=>{this.setState({uploadFile:"dragging"})},onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(e,i)=>{var o,h,s;this.setState({uploadFile:!1}),e.length?this.onDrop(e):window.alert(((s=(h=(o=i==null?void 0:i[0])==null?void 0:o.errors)==null?void 0:h[0])==null?void 0:s.message)||H.I18n.t("Cannot upload"))}},({getRootProps:e,getInputProps:i})=>k.createElement("div",{style:{...Re.uploadDiv,...this.state.uploadFile==="dragging"?Re.uploadDivDragging:void 0,...n?Re.disabledOpacity:void 0},...e()},k.createElement("input",{...i()}),this.state.uploadFile==="dragging"?k.createElement("div",{style:{...Re.uploadCenterDiv,...this.state.uploadError?Re.error:void 0}},k.createElement("div",{style:Re.uploadCenterTextAndIcon},k.createElement(X.UploadFile,{style:Re.uploadCenterIcon}),k.createElement("div",{style:Re.uploadCenterText},this.state.uploadFile==="dragging"?H.I18n.t("ra_Drop file here"):H.I18n.t("ra_Place your files here or click here to open the browse dialog")))):null,r,this.renderDeleteDialog()))}}const jt={fullWidth:{width:"100%"},fullWidthOneButton:{width:"calc(100% - 69px)",marginRight:4},fullWidthIcon:{width:"calc(100% - 119px)",marginRight:4},selectedImage:{height:40,width:40,display:"inline-block",marginRight:8}},Zs=["jpg","jpeg","svg","png","webp","gif","apng","avif","webp"],qs=["mp3","ogg","wav","aac"],eo=["avi","mp4","mov"],to=["txt","log","html","htm"],no=["json","js","ts"];class io extends K{imagePrefix="../..";componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.imagePrefix=this.props.oContext.imagePrefix===void 0?"./files":this.props.oContext.imagePrefix,this.setState({value:t??""})}static getDerivedStateFromProps(t,n){const l=K.getValue(t.data,t.attr);return l==null||l.toString().trim()!==(n.value||"").toString().trim()?{value:l??""}:null}loadFile(){const t=this.state.value.indexOf("/");if(t!==-1){const n=this.state.value.substring(0,t),l=this.state.value.substring(t+1);return this.props.oContext.socket.readFile(n,l,!0)}return Promise.resolve(null)}play(){this.loadFile().then(t=>{if(typeof AudioContext<"u"&&(t!=null&&t.file)){const n=new AudioContext,l=en.base64ToArrayBuffer(t.file);n.decodeAudioData(l,v=>{const a=n.createBufferSource();a.buffer=v,a.connect(n.destination),a.start(0)},v=>window.alert(`Cannot play: ${v.message}`))}})}getIcon(){const t=this.state.value.split(".").pop().toLowerCase();return Zs.includes(t)?k.createElement("div",{style:{...jt.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.state.value})`,backgroundSize:"contain",backgroundRepeat:"no-repeat"}}):qs.includes(t)?k.createElement(R.IconButton,{style:{color:"#00FF00"},onClick:()=>this.play()},k.createElement(X.PlayArrow,null)):to.includes(t)?k.createElement(X.Article,null):eo.includes(t)?k.createElement(X.Videocam,null):no.includes(t)?k.createElement(X.Code,null):null}renderFileBrowser(){return this.state.showFileBrowser?k.createElement(H.DialogSelectFile,{imagePrefix:this.props.oContext.imagePrefix,socket:this.props.oContext.socket,selected:this.state.value,onClose:()=>this.setState({showFileBrowser:!1}),onOk:t=>{const n=Array.isArray(t)?t[0]:t;this.setState({value:n},()=>this.onChange(this.props.attr,this.props.schema.trim===!1?n:(n||"").trim()))},selectOnlyFolders:this.props.schema.selectOnlyFolders,allowUpload:this.props.schema.allowUpload,allowDownload:this.props.schema.allowDownload,allowCreateFolder:this.props.schema.allowCreateFolder,allowView:this.props.schema.allowView,showToolbar:this.props.schema.showToolbar,limitPath:this.props.schema.limitPath,theme:this.props.oContext.theme}):null}renderItem(t,n){const l=this.getIcon();return k.createElement("div",{style:jt.fullWidth},l,k.createElement(R.TextField,{variant:"standard",style:l?jt.fullWidthIcon:jt.fullWidthOneButton,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!t,disabled:!!n,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:!!this.props.schema.disableEdit}},onChange:v=>{const a=v.target.value;this.setState({value:a},()=>this.onChange(this.props.attr,this.props.schema.trim===!1?a:(a||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}),k.createElement(R.Button,{disabled:n,variant:"outlined",onClick:()=>this.setState({showFileBrowser:!0})},"..."),this.renderFileBrowser())}}class ro extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("functions").then(n=>{const l=Object.keys(n).map(v=>({value:this.props.schema.short?v.replace("enum.functions.",""):v,label:this.getText(n[v].common.name),obj:n[v]}));this.props.schema.allowDeactivate!==!1&&l.unshift({label:H.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({value:t,selectOptions:l})})}renderItem(t,n){if(!this.state.selectOptions)return null;const l=this.state.selectOptions.find(v=>v.value===this.state.value);return k.createElement(R.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?k.createElement(R.InputLabel,null,this.getText(this.props.schema.label)):null,k.createElement(R.Select,{variant:"standard",error:!!t,disabled:!!n,value:this.state.value||"_",renderValue:()=>l?l.obj?k.createElement(H.TextWithIcon,{value:l.obj,themeType:this.props.oContext.themeType,lang:H.I18n.getLanguage()}):l.label:"",onChange:v=>{this.setState({value:v.target.value==="_"?"":v.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(v=>k.createElement(R.MenuItem,{key:v.value,value:v.value,style:v.value===K.DIFFERENT_VALUE?{opacity:.5}:{}},v.obj?k.createElement(H.TextWithIcon,{value:v.obj,themeType:this.props.oContext.themeType,lang:H.I18n.getLanguage()}):v.label))),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class so extends K{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getHostByIp(this.props.common.host).then(t=>{this.props.schema.listenOnAllPorts||(t=t.filter(n=>n.address!=="0.0.0.0"&&n.address!=="::")),this.props.schema.onlyIp4?t=t.filter(n=>n.family==="ipv4"):this.props.schema.onlyIp6&&(t=t.filter(n=>n.family==="ipv6")),this.props.schema.noInternal&&(t=t.filter(n=>!n.internal)),t.forEach(n=>{n.address==="0.0.0.0"?n.name=`[IPv4] 0.0.0.0 - ${H.I18n.t("ra_Listen on all IPs")}`:n.address==="::"&&(n.name=`[IPv6] :: - ${H.I18n.t("ra_Listen on all IPs")}`)}),this.setState({ips:t})}).catch(t=>console.error(t))}renderItem(t,n){var a,u;const l=K.getValue(this.props.data,this.props.attr),v=(a=this.state.ips)==null?void 0:a.find(d=>d.address===l);return k.createElement(R.FormControl,{fullWidth:!0,variant:"standard"},this.state.ips&&this.props.schema.label?k.createElement(R.InputLabel,null,this.getText(this.props.schema.label)):null,this.state.ips?k.createElement(R.Select,{variant:"standard",error:!!t,disabled:!!n,value:l,renderValue:d=>(v==null?void 0:v.name)||d,onChange:d=>this.onChange(this.props.attr,d.target.value)},(u=this.state.ips)==null?void 0:u.map((d,r)=>k.createElement(R.MenuItem,{key:r,value:d.address},d.name))):k.createElement(R.TextField,{fullWidth:!0,variant:"standard",error:!!t,disabled:!!n,value:l,onChange:d=>this.onChange(this.props.attr,d.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class oo extends K{initialized=!1;localContext;componentDidMount(){super.componentDidMount(),this.askInstance()}askInstance(){if(this.props.alive){let t=this.props.schema.data;if(t===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);if(n)try{t=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${JSON.stringify(t)}`)}}t===void 0&&(t=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",t).then(n=>this.setState({image:n||""}))}}getContext(){const t={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>t[n]=K.getValue(this.props.data,n)),JSON.stringify(t)}renderItem(){if(this.props.alive){const t=this.getContext();(t!==this.localContext||!this.initialized)&&(this.localContext=t,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}return this.state.image===void 0?null:k.createElement("img",{alt:"dynamic content",src:this.state.image,style:{width:this.props.schema.width||"100%",height:this.props.schema.height}})}}class ao extends K{index;constructor(t){super(t),this.index=Date.now()}componentDidMount(){if(super.componentDidMount(),this.props.schema.base64){const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t})}else this.props.oContext.socket.fileExists(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).then(t=>t&&this.loadImage())}_getUrl(t){t&&(this.index=Date.now());let n=`files/${this.props.oContext.adapterName}.${this.props.oContext.instance}/${this.props.attr}?t=${this.index}`;return window.location.port==="3000"&&(n=`${window.location.protocol}//${window.location.hostname}:8081/${n}`),n}loadImage(){fetch(this._getUrl()).then(t=>t.blob()).then(t=>{const n=new FileReader;n.onload=()=>{this.setState({value:n.result})},n.readAsDataURL(t)}).catch(t=>console.error(t))}renderItem(t,n){return k.createElement(R.FormControl,{fullWidth:!0,variant:"standard"},this.props.schema.label?k.createElement(R.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,k.createElement(H.UploadImage,{error:!!t,disabled:n,accept:this.props.schema.accept,crop:this.props.schema.crop,maxSize:this.props.schema.maxSize||256*1024,icon:this.state.value||void 0,removeIconFunc:()=>this.setState({value:null},()=>{if(this.props.schema.base64){const l=this.onChange(this.props.attr,this.state.value);l instanceof Promise&&l.catch(v=>console.error(`Cannot set value: ${v}`))}else this.props.oContext.socket.deleteFile(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).catch(l=>console.error(l))}),onChange:l=>this.setState({value:l},()=>{if(this.props.schema.base64){const v=this.onChange(this.props.attr,this.state.value);v instanceof Promise&&v.catch(a=>console.error(`Cannot set value: ${a}`))}else l.startsWith("data")&&(l=l.split(",")[1]);this.props.oContext.socket.writeFile64(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr,l).catch(v=>console.error(v))})}),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class lo extends K{renderItem(){return k.createElement(H.InfoBox,{type:this.props.schema.boxType||"info",closeable:this.props.schema.closeable!==void 0?this.props.schema.closeable:!0,storeId:this.props.schema.closed!==void 0?void 0:`${!!this.props.oContext.adapterName} ${this.props.attr}`,closed:this.props.schema.closed,style:{width:"100%",...this.props.schema.style}},this.props.schema.title?k.createElement(R.Box,{component:"div",sx:{fontWeight:"bold",fontSize:"larger"}},this.getText(this.props.schema.title)):null,this.getText(this.props.schema.text))}}const ri={icon:{width:20,height:20,marginRight:4}};class ho extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);let n=this.props.schema.adapter;n==="_dataSources"&&(n=void 0),this.props.oContext.socket.getAdapterInstances(n,!0).then(async l=>{this.props.schema.adapter==="_dataSources"?l=l.filter(a=>{var u;return(u=a==null?void 0:a.common)==null?void 0:u.getHistory}):this.props.schema.adapter?l=l.filter(a=>a==null?void 0:a._id.startsWith(`system.adapter.${this.props.schema.adapter}.`)):this.props.schema.adapters&&Array.isArray(this.props.schema.adapters)&&(l=l.filter(a=>{var u;return this.props.schema.adapters.includes((u=a==null?void 0:a.common)==null?void 0:u.name)})),this.props.schema.onlyEnabled&&(l=l.filter(a=>{var u;return(u=a==null?void 0:a.common)==null?void 0:u.enabled}));const v=l.map(a=>({value:this.props.schema.long?a._id:this.props.schema.short?a._id.split(".").pop():a._id.replace(/^system\.adapter\./,""),label:`${a.common.name} [${a._id.replace(/^system\.adapter\./,"")}]`,icon:`adapter/${a.common.name}/${a.common.icon}`}));v.sort((a,u)=>a.value>u.value?1:a.value<u.value?-1:0),this.props.schema.allowDeactivate!==!1&&v.unshift({label:H.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.props.schema.all&&v.unshift({label:H.I18n.t("sch_all"),value:"*"}),this.setState({value:t||"",selectOptions:v}),await this.props.oContext.socket.subscribeObject(`system.adapter.${n?`${n}.`:""}*`,this.onInstancesUpdate)}).catch(l=>console.error(`Cannot get instances: ${l}`))}componentWillUnmount(){this.props.oContext.socket.unsubscribeObject("system.adapter.*",this.onInstancesUpdate).then(()=>{}),super.componentWillUnmount()}onInstancesUpdate=(t,n)=>{if(!t.match(/^system\.adapter\.[-_a-z\d]+\.\d+$/))return;const l=this.props.schema.long?t:this.props.schema.short?t.split(".").pop():t.replace(/^system\.adapter\./,""),v=this.state.selectOptions.findIndex(a=>a.value===l);if(n){if(this.props.schema.adapter==="_dataSources"&&(!n.common||!n.common.getHistory))return;if(v===-1){const a=JSON.parse(JSON.stringify(this.state.selectOptions)),u=typeof n.common.name=="object"?n.common.name[H.I18n.getLanguage()]||n.common.name.en:n.common.name;a.push({value:this.props.schema.long?n._id:this.props.schema.short?n._id.split(".").pop():n._id.replace(/^system\.adapter\./,""),label:`${u} [${n._id.replace(/^system\.adapter\./,"")}]`,icon:`adapter/${u}/${n.common.icon}`}),a.sort((d,r)=>d.label>r.label?1:d.label<r.label?-1:0),this.setState({selectOptions:a})}}else if(v!==-1){const a=JSON.parse(JSON.stringify(this.state.selectOptions)),u={};this.state.value===a[v].value&&(u.value=K.NONE_VALUE),a.splice(v,1),u.selectOptions=a,this.setState(u)}};renderItem(t,n){var v;if(!this.state.selectOptions)return null;const l=(v=this.state.selectOptions)==null?void 0:v.find(a=>a.value===this.state.value);return k.createElement(R.FormControl,{fullWidth:!0,key:this.props.attr,variant:"standard"},this.props.schema.label?k.createElement(R.InputLabel,{shrink:!0},this.getText(this.props.schema.label)):null,k.createElement(R.Select,{variant:"standard",error:!!t,displayEmpty:!0,disabled:!!n,value:this.state.value,renderValue:()=>k.createElement("span",{style:{display:"flex"}},l!=null&&l.icon?k.createElement("img",{src:`./${l.icon}`,alt:l.value,style:ri.icon}):null,this.getText(l==null?void 0:l.label,!0)),onChange:a=>this.setState({value:a.target.value},()=>this.onChange(this.props.attr,this.state.value))},this.state.selectOptions.map(a=>k.createElement(R.MenuItem,{key:a.value,value:a.value,style:a.value===K.NONE_VALUE?{opacity:.5}:{}},a.icon?k.createElement("img",{src:`./${a.icon}`,alt:a.value,style:ri.icon}):null,this.getText(a.label,!0)))),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const si={address:{fontSize:"smaller",opacity:.5,marginLeft:8}};class co extends K{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getObject(`system.host.${this.props.common.host}`).then(t=>{var l,v;const n=[];if((v=(l=t==null?void 0:t.native)==null?void 0:l.hardware)!=null&&v.networkInterfaces){const a=t.native.hardware.networkInterfaces;Object.keys(a).forEach(u=>{if(this.props.schema.ignoreInternal&&!a[u].find(r=>!r.internal)||this.props.schema.ignoreLoopback&&a[u].find(r=>r.address==="127.0.0.1"||r.address==="::1"))return;let d=a[u].find(r=>r.family==="IPv4");d||=a[u].find(r=>r.family==="IPv6"),n.push({value:u,address:d.address})})}this.setState({interfaces:n})}).catch(t=>window.alert(`Cannot read interfaces: ${t}`))}renderItem(t,n){var a,u,d;const l=K.getValue(this.props.data,this.props.attr),v=(a=this.state.interfaces)==null?void 0:a.find(r=>r.value===l);return k.createElement(R.FormControl,{fullWidth:!0,variant:"standard"},(u=this.state.interfaces)!=null&&u.length&&this.props.schema.label?k.createElement(R.InputLabel,null,this.getText(this.props.schema.label)):null,(d=this.state.interfaces)!=null&&d.length?k.createElement(R.Select,{variant:"standard",error:!!t,disabled:!!n,value:l,renderValue:r=>v?k.createElement("span",null,v.value,k.createElement("span",{style:si.address},v.address)):r,onChange:r=>this.onChange(this.props.attr,r.target.value)},this.state.interfaces.map((r,c)=>k.createElement(R.MenuItem,{key:c,value:r.value},k.createElement("span",null,r.value,k.createElement("span",{style:si.address},r.address))))):k.createElement(R.TextField,{fullWidth:!0,variant:"standard",error:!!t,disabled:!!n,value:l,onChange:r=>this.onChange(this.props.attr,r.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const vt={modalDialog:{minWidth:400,maxWidth:800},overflowHidden:{display:"flex",overflow:"hidden"},titleIcon:{marginRight:5},content:{fontSize:16},languageButton:{position:"absolute",right:8,top:8},languageButtonActive:{color:"primary.main"}},uo=({toggleTranslation:L,noTranslation:t,title:n,fullWidth:l,help:v,maxWidth:a,progress:u,icon:d,applyDisabled:r,applyButton:c,onClose:e,children:i,titleButtonApply:o,titleButtonClose:h,onApply:s,textInput:p,defaultValue:f,overflowHidden:g})=>{const[y,A]=qe.useState(f);qe.useEffect(()=>{A(f)},[f]);const E=R.useTheme(),w=R.useMediaQuery(E.breakpoints.down("md"));let m=null;return d&&(m=d),k.createElement(R.Dialog,{open:!0,maxWidth:w?!1:a||"md",fullWidth:!!l,fullScreen:w,disableEscapeKeyDown:!1,onClose:e,sx:{"& .MuiPaper-root":w?{}:vt.modalDialog}},n&&k.createElement(R.DialogTitle,null,d?k.createElement(m,{style:vt.titleIcon}):null,n,H.I18n.getLanguage()!=="en"&&L?k.createElement(R.IconButton,{size:"large",style:{...vt.languageButton,...t?vt.languageButtonActive:{}},onClick:()=>L(),title:H.I18n.t("Disable/Enable translation")},k.createElement(X.Language,null)):null),k.createElement(R.DialogContent,{sx:{...g?vt.overflowHidden:{},...vt.content},style:{paddingTop:8}},p&&k.createElement(R.TextField,{autoComplete:"off",fullWidth:!0,autoFocus:!0,variant:"outlined",size:"medium",multiline:!0,value:y,onChange:S=>A(S.target.value)}),i,v?k.createElement("div",null,v):null),k.createElement(R.DialogActions,null,c!==!1&&k.createElement(R.Button,{startIcon:k.createElement(X.Check,null),disabled:u||r&&f===y,onClick:()=>s&&s(p?y:""),variant:"contained",color:"primary"},H.I18n.t(o||"Ok")),k.createElement(R.Button,{color:"grey",onClick:()=>e&&e(),disabled:u,variant:"contained",startIcon:k.createElement(X.Close,null)},H.I18n.t(h||"Cancel"))))};var wt={},ut={},Ii={exports:{}};(function(L,t){(function(){var n="ace",l=(function(){return this})();!l&&typeof window<"u"&&(l=window);var v=function(e,i,o){if(typeof e!="string"){v.original?v.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(o=i),v.modules[e]||(v.payloads[e]=o,v.modules[e]=null)};v.modules={},v.payloads={};var a=function(e,i,o){if(typeof i=="string"){var h=r(e,i);if(h!=null)return o&&o(),h}else if(Object.prototype.toString.call(i)==="[object Array]"){for(var s=[],p=0,f=i.length;p<f;++p){var g=r(e,i[p]);if(g==null&&u.original)return;s.push(g)}return o&&o.apply(null,s)||!0}},u=function(e,i){var o=a("",e,i);return o==null&&u.original?u.original.apply(this,arguments):o},d=function(e,i){if(i.indexOf("!")!==-1){var o=i.split("!");return d(e,o[0])+"!"+d(e,o[1])}if(i.charAt(0)=="."){var h=e.split("/").slice(0,-1).join("/");for(i=h+"/"+i;i.indexOf(".")!==-1&&s!=i;){var s=i;i=i.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return i},r=function(e,i){i=d(e,i);var o=v.modules[i];if(!o){if(o=v.payloads[i],typeof o=="function"){var h={},s={id:i,uri:"",exports:h,packaged:!0},p=function(g,y){return a(i,g,y)},f=o(p,h,s);h=f||s.exports,v.modules[i]=h,delete v.payloads[i]}o=v.modules[i]=h||o}return o};function c(e){var i=l;l[e]||(l[e]={}),i=l[e],(!i.define||!i.define.packaged)&&(v.original=i.define,i.define=v,i.define.packaged=!0),(!i.require||!i.require.packaged)&&(u.original=i.require,i.require=u,i.require.packaged=!0)}c(n)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(n,l,v){function a(u,d,r){Object.defineProperty(u,d,{value:r,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||a(String.prototype,"startsWith",function(u,d){return d=d||0,this.lastIndexOf(u,d)===d}),String.prototype.endsWith||a(String.prototype,"endsWith",function(u,d){var r=this;(d===void 0||d>r.length)&&(d=r.length),d-=u.length;var c=r.indexOf(u,d);return c!==-1&&c===d}),String.prototype.repeat||a(String.prototype,"repeat",function(u){for(var d="",r=this;u>0;)u&1&&(d+=r),(u>>=1)&&(r+=r);return d}),String.prototype.includes||a(String.prototype,"includes",function(u,d){return this.indexOf(u,d)!=-1}),Object.assign||(Object.assign=function(u){if(u==null)throw new TypeError("Cannot convert undefined or null to object");for(var d=Object(u),r=1;r<arguments.length;r++){var c=arguments[r];c!=null&&Object.keys(c).forEach(function(e){d[e]=c[e]})}return d}),Object.values||(Object.values=function(u){return Object.keys(u).map(function(d){return u[d]})}),Array.prototype.find||a(Array.prototype,"find",function(u){for(var d=this.length,r=arguments[1],c=0;c<d;c++){var e=this[c];if(u.call(r,e,c,this))return e}}),Array.prototype.findIndex||a(Array.prototype,"findIndex",function(u){for(var d=this.length,r=arguments[1],c=0;c<d;c++){var e=this[c];if(u.call(r,e,c,this))return c}}),Array.prototype.includes||a(Array.prototype,"includes",function(u,d){return this.indexOf(u,d)!=-1}),Array.prototype.fill||a(Array.prototype,"fill",function(u){for(var d=this,r=d.length>>>0,c=arguments[1],e=c>>0,i=e<0?Math.max(r+e,0):Math.min(e,r),o=arguments[2],h=o===void 0?r:o>>0,s=h<0?Math.max(r+h,0):Math.min(h,r);i<s;)d[i]=u,i++;return d}),Array.of||a(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(n,l,v){n("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(n,l,v){l.deepCopy=function a(u){if(typeof u!="object"||!u)return u;var d;if(Array.isArray(u)){d=[];for(var r=0;r<u.length;r++)d[r]=a(u[r]);return d}if(Object.prototype.toString.call(u)!=="[object Object]")return u;d={};for(var r in u)d[r]=a(u[r]);return d}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(n,l,v){l.last=function(d){return d[d.length-1]},l.stringReverse=function(d){return d.split("").reverse().join("")},l.stringRepeat=function(d,r){for(var c="";r>0;)r&1&&(c+=d),(r>>=1)&&(d+=d);return c};var a=/^\s\s*/,u=/\s\s*$/;l.stringTrimLeft=function(d){return d.replace(a,"")},l.stringTrimRight=function(d){return d.replace(u,"")},l.copyObject=function(d){var r={};for(var c in d)r[c]=d[c];return r},l.copyArray=function(d){for(var r=[],c=0,e=d.length;c<e;c++)d[c]&&typeof d[c]=="object"?r[c]=this.copyObject(d[c]):r[c]=d[c];return r},l.deepCopy=n("./deep_copy").deepCopy,l.arrayToMap=function(d){for(var r={},c=0;c<d.length;c++)r[d[c]]=1;return r},l.createMap=function(d){var r=Object.create(null);for(var c in d)r[c]=d[c];return r},l.arrayRemove=function(d,r){for(var c=0;c<=d.length;c++)r===d[c]&&d.splice(c,1)},l.escapeRegExp=function(d){return d.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},l.escapeHTML=function(d){return(""+d).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},l.getMatchOffsets=function(d,r){var c=[];return d.replace(r,function(e){c.push({offset:arguments[arguments.length-2],length:e.length})}),c},l.deferredCall=function(d){var r=null,c=function(){r=null,d()},e=function(i){return e.cancel(),r=setTimeout(c,i||0),e};return e.schedule=e,e.call=function(){return this.cancel(),d(),e},e.cancel=function(){return clearTimeout(r),r=null,e},e.isPending=function(){return r},e},l.delayedCall=function(d,r){var c=null,e=function(){c=null,d()},i=function(o){c==null&&(c=setTimeout(e,o||r))};return i.delay=function(o){c&&clearTimeout(c),c=setTimeout(e,o||r)},i.schedule=i,i.call=function(){this.cancel(),d()},i.cancel=function(){c&&clearTimeout(c),c=null},i.isPending=function(){return c},i},l.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},l.skipEmptyMatch=function(d,r,c){return c&&d.codePointAt(r)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(n,l,v){l.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},l.getOS=function(){return l.isMac?l.OS.MAC:l.isLinux?l.OS.LINUX:l.OS.WINDOWS};var a=typeof navigator=="object"?navigator:{},u=(/mac|win|linux/i.exec(a.platform)||["other"])[0].toLowerCase(),d=a.userAgent||"",r=a.appName||"";l.isWin=u=="win",l.isMac=u=="mac",l.isLinux=u=="linux",l.isIE=r=="Microsoft Internet Explorer"||r.indexOf("MSAppHost")>=0?parseFloat((d.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((d.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),l.isOldIE=l.isIE&&l.isIE<9,l.isGecko=l.isMozilla=d.match(/ Gecko\/\d+/),l.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",l.isWebKit=parseFloat(d.split("WebKit/")[1])||void 0,l.isChrome=parseFloat(d.split(" Chrome/")[1])||void 0,l.isSafari=parseFloat(d.split(" Safari/")[1])&&!l.isChrome||void 0,l.isEdge=parseFloat(d.split(" Edge/")[1])||void 0,l.isAIR=d.indexOf("AdobeAIR")>=0,l.isAndroid=d.indexOf("Android")>=0,l.isChromeOS=d.indexOf(" CrOS ")>=0,l.isIOS=/iPad|iPhone|iPod/.test(d)&&!window.MSStream,l.isIOS&&(l.isMac=!0),l.isMobile=l.isIOS||l.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(n,l,v){var a=n("./useragent"),u="http://www.w3.org/1999/xhtml";l.buildDom=function o(h,s,p){if(typeof h=="string"&&h){var f=document.createTextNode(h);return s&&s.appendChild(f),f}if(!Array.isArray(h))return h&&h.appendChild&&s&&s.appendChild(h),h;if(typeof h[0]!="string"||!h[0]){for(var g=[],y=0;y<h.length;y++){var A=o(h[y],s,p);A&&g.push(A)}return g}var E=document.createElement(h[0]),w=h[1],m=1;w&&typeof w=="object"&&!Array.isArray(w)&&(m=2);for(var y=m;y<h.length;y++)o(h[y],E,p);return m==2&&Object.keys(w).forEach(function(S){var M=w[S];S==="class"?E.className=Array.isArray(M)?M.join(" "):M:typeof M=="function"||S=="value"||S[0]=="$"?E[S]=M:S==="ref"?p&&(p[M]=E):S==="style"?typeof M=="string"&&(E.style.cssText=M):M!=null&&E.setAttribute(S,M)}),s&&s.appendChild(E),E},l.getDocumentHead=function(o){return o||(o=document),o.head||o.getElementsByTagName("head")[0]||o.documentElement},l.createElement=function(o,h){return document.createElementNS?document.createElementNS(h||u,o):document.createElement(o)},l.removeChildren=function(o){o.innerHTML=""},l.createTextNode=function(o,h){var s=h?h.ownerDocument:document;return s.createTextNode(o)},l.createFragment=function(o){var h=o?o.ownerDocument:document;return h.createDocumentFragment()},l.hasCssClass=function(o,h){var s=(o.className+"").split(/\s+/g);return s.indexOf(h)!==-1},l.addCssClass=function(o,h){l.hasCssClass(o,h)||(o.className+=" "+h)},l.removeCssClass=function(o,h){for(var s=o.className.split(/\s+/g);;){var p=s.indexOf(h);if(p==-1)break;s.splice(p,1)}o.className=s.join(" ")},l.toggleCssClass=function(o,h){for(var s=o.className.split(/\s+/g),p=!0;;){var f=s.indexOf(h);if(f==-1)break;p=!1,s.splice(f,1)}return p&&s.push(h),o.className=s.join(" "),p},l.setCssClass=function(o,h,s){s?l.addCssClass(o,h):l.removeCssClass(o,h)},l.hasCssString=function(o,h){var s=0,p;if(h=h||document,p=h.querySelectorAll("style")){for(;s<p.length;)if(p[s++].id===o)return!0}},l.removeElementById=function(o,h){h=h||document,h.getElementById(o)&&h.getElementById(o).remove()};var d,r=[];l.useStrictCSP=function(o){d=o,o==!1?c():r||(r=[])};function c(){var o=r;r=null,o&&o.forEach(function(h){e(h[0],h[1])})}function e(o,h,s){if(!(typeof document>"u")){if(r){if(s)c();else if(s===!1)return r.push([o,h])}if(!d){var p=s;!s||!s.getRootNode?p=document:(p=s.getRootNode(),(!p||p==s)&&(p=document));var f=p.ownerDocument||p;if(h&&l.hasCssString(h,p))return null;h&&(o+=`
16
+ /*# sourceURL=ace/css/`+h+" */");var g=l.createElement("style");g.appendChild(f.createTextNode(o)),h&&(g.id=h),p==f&&(p=l.getDocumentHead(f)),p.insertBefore(g,p.firstChild)}}}if(l.importCssString=e,l.importCssStylsheet=function(o,h){l.buildDom(["link",{rel:"stylesheet",href:o}],l.getDocumentHead(h))},l.$fixPositionBug=function(o){var h=o.getBoundingClientRect();if(o.style.left){var s=parseFloat(o.style.left),p=+h.left;Math.abs(s-p)>1&&(o.style.left=2*s-p+"px")}if(o.style.right){var s=parseFloat(o.style.right),p=window.innerWidth-h.right;Math.abs(s-p)>1&&(o.style.right=2*s-p+"px")}if(o.style.top){var s=parseFloat(o.style.top),p=+h.top;Math.abs(s-p)>1&&(o.style.top=2*s-p+"px")}if(o.style.bottom){var s=parseFloat(o.style.bottom),p=window.innerHeight-h.bottom;Math.abs(s-p)>1&&(o.style.bottom=2*s-p+"px")}},l.scrollbarWidth=function(o){var h=l.createElement("ace_inner");h.style.width="100%",h.style.minWidth="0px",h.style.height="200px",h.style.display="block";var s=l.createElement("ace_outer"),p=s.style;p.position="absolute",p.left="-10000px",p.overflow="hidden",p.width="200px",p.minWidth="0px",p.height="150px",p.display="block",s.appendChild(h);var f=o&&o.documentElement||document&&document.documentElement;if(!f)return 0;f.appendChild(s);var g=h.offsetWidth;p.overflow="scroll";var y=h.offsetWidth;return g===y&&(y=s.clientWidth),f.removeChild(s),g-y},l.computedStyle=function(o,h){return window.getComputedStyle(o,"")||{}},l.setStyle=function(o,h,s){o[h]!==s&&(o[h]=s)},l.HAS_CSS_ANIMATION=!1,l.HAS_CSS_TRANSFORMS=!1,l.HI_DPI=a.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,a.isChromeOS&&(l.HI_DPI=!1),typeof document<"u"){var i=document.createElement("div");l.HI_DPI&&i.style.transform!==void 0&&(l.HAS_CSS_TRANSFORMS=!0),!a.isEdge&&typeof i.style.animationName<"u"&&(l.HAS_CSS_ANIMATION=!0),i=null}l.HAS_CSS_TRANSFORMS?l.translate=function(o,h,s){o.style.transform="translate("+Math.round(h)+"px, "+Math.round(s)+"px)"}:l.translate=function(o,h,s){o.style.top=Math.round(s)+"px",o.style.left=Math.round(h)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(n,l,v){var a=n("./dom");l.get=function(u,d){var r=new XMLHttpRequest;r.open("GET",u,!0),r.onreadystatechange=function(){r.readyState===4&&d(r.responseText)},r.send(null)},l.loadScript=function(u,d){var r=a.getDocumentHead(),c=document.createElement("script");c.src=u,r.appendChild(c),c.onload=c.onreadystatechange=function(e,i){(i||!c.readyState||c.readyState=="loaded"||c.readyState=="complete")&&(c=c.onload=c.onreadystatechange=null,i||d())}},l.qualifyURL=function(u){var d=document.createElement("a");return d.href=u,d.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(n,l,v){l.inherits=function(a,u){a.super_=u,a.prototype=Object.create(u.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})},l.mixin=function(a,u){for(var d in u)a[d]=u[d];return a},l.implement=function(a,u){l.mixin(a,u)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(n,l,v){var a={},u=function(){this.propagationStopped=!0},d=function(){this.defaultPrevented=!0};a._emit=a._dispatchEvent=function(r,c){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var e=this._eventRegistry[r]||[],i=this._defaultHandlers[r];if(!(!e.length&&!i)){(typeof c!="object"||!c)&&(c={}),c.type||(c.type=r),c.stopPropagation||(c.stopPropagation=u),c.preventDefault||(c.preventDefault=d),e=e.slice();for(var o=0;o<e.length&&(e[o](c,this),!c.propagationStopped);o++);if(i&&!c.defaultPrevented)return i(c,this)}},a._signal=function(r,c){var e=(this._eventRegistry||{})[r];if(e){e=e.slice();for(var i=0;i<e.length;i++)e[i](c,this)}},a.once=function(r,c){var e=this;if(this.on(r,function i(){e.off(r,i),c.apply(null,arguments)}),!c)return new Promise(function(i){c=i})},a.setDefaultHandler=function(r,c){var e=this._defaultHandlers;if(e||(e=this._defaultHandlers={_disabled_:{}}),e[r]){var i=e[r],o=e._disabled_[r];o||(e._disabled_[r]=o=[]),o.push(i);var h=o.indexOf(c);h!=-1&&o.splice(h,1)}e[r]=c},a.removeDefaultHandler=function(r,c){var e=this._defaultHandlers;if(e){var i=e._disabled_[r];if(e[r]==c)i&&this.setDefaultHandler(r,i.pop());else if(i){var o=i.indexOf(c);o!=-1&&i.splice(o,1)}}},a.on=a.addEventListener=function(r,c,e){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[r];return i||(i=this._eventRegistry[r]=[]),i.indexOf(c)==-1&&i[e?"unshift":"push"](c),c},a.off=a.removeListener=a.removeEventListener=function(r,c){this._eventRegistry=this._eventRegistry||{};var e=this._eventRegistry[r];if(e){var i=e.indexOf(c);i!==-1&&e.splice(i,1)}},a.removeAllListeners=function(r){r||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[r]=void 0),this._defaultHandlers&&(this._defaultHandlers[r]=void 0)},l.EventEmitter=a}),ace.define("ace/lib/report_error",["require","exports","module"],function(n,l,v){l.reportError=function(u,d){var r=new Error(u);r.data=d,typeof console=="object"&&console.error&&console.error(r),setTimeout(function(){throw r})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(n,l,v){var a={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor gutter","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions","editor.tooltip.disable-editing":"Editing is disabled"};l.defaultEnglishMessages=a}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(n,l,v){"no use strict";var a=n("./oop"),u=n("./event_emitter").EventEmitter,d=n("./report_error").reportError,r=n("./default_english_messages").defaultEnglishMessages,c={setOptions:function(s){Object.keys(s).forEach(function(p){this.setOption(p,s[p])},this)},getOptions:function(s){var p={};if(s)Array.isArray(s)||(s=Object.keys(s));else{var f=this.$options;s=Object.keys(f).filter(function(g){return!f[g].hidden})}return s.forEach(function(g){p[g]=this.getOption(g)},this),p},setOption:function(s,p){if(this["$"+s]!==p){var f=this.$options[s];if(!f)return e('misspelled option "'+s+'"');if(f.forwardTo)return this[f.forwardTo]&&this[f.forwardTo].setOption(s,p);f.handlesSet||(this["$"+s]=p),f&&f.set&&f.set.call(this,p)}},getOption:function(s){var p=this.$options[s];return p?p.forwardTo?this[p.forwardTo]&&this[p.forwardTo].getOption(s):p&&p.get?p.get.call(this):this["$"+s]:e('misspelled option "'+s+'"')}};function e(s){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var i,o,h=(function(){function s(){this.$defaultOptions={},i=r,o="dollarSigns"}return s.prototype.defineOptions=function(p,f,g){return p.$options||(this.$defaultOptions[f]=p.$options={}),Object.keys(g).forEach(function(y){var A=g[y];typeof A=="string"&&(A={forwardTo:A}),A.name||(A.name=y),p.$options[A.name]=A,"initialValue"in A&&(p["$"+A.name]=A.initialValue)}),a.implement(p,c),this},s.prototype.resetOptions=function(p){Object.keys(p.$options).forEach(function(f){var g=p.$options[f];"value"in g&&p.setOption(f,g.value)})},s.prototype.setDefaultValue=function(p,f,g){if(!p){for(p in this.$defaultOptions)if(this.$defaultOptions[p][f])break;if(!this.$defaultOptions[p][f])return!1}var y=this.$defaultOptions[p]||(this.$defaultOptions[p]={});y[f]&&(y.forwardTo?this.setDefaultValue(y.forwardTo,f,g):y[f].value=g)},s.prototype.setDefaultValues=function(p,f){Object.keys(f).forEach(function(g){this.setDefaultValue(p,g,f[g])},this)},s.prototype.setMessages=function(p,f){i=p,f&&f.placeholders&&(o=f.placeholders)},s.prototype.nls=function(p,f,g){i[p]||(e("No message found for the key '"+p+"' in messages with id "+i.$id+", trying to find a translation for the default string '"+f+"'."),i[f]||e("No message found for the default string '"+f+"' in the provided messages. Falling back to the default English message."));var y=i[p]||i[f]||f;return g&&(o==="dollarSigns"&&(y=y.replace(/\$(\$|[\d]+)/g,function(A,E){return E=="$"?"$":g[E]})),o==="curlyBrackets"&&(y=y.replace(/\{([^\}]+)\}/g,function(A,E){return g[E]}))),y},s})();h.prototype.warn=e,h.prototype.reportError=d,a.implement(h.prototype,u),l.AppConfig=h}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(n,l,v){v.exports=`.ace-tm .ace_gutter {
17
+ background: #f0f0f0;
18
+ color: #333;
19
+ }
20
+
21
+ .ace-tm .ace_print-margin {
22
+ width: 1px;
23
+ background: #e8e8e8;
24
+ }
25
+
26
+ .ace-tm .ace_fold {
27
+ background-color: #6B72E6;
28
+ }
29
+
30
+ .ace-tm {
31
+ background-color: #FFFFFF;
32
+ color: black;
33
+ }
34
+
35
+ .ace-tm .ace_cursor {
36
+ color: black;
37
+ }
38
+
39
+ .ace-tm .ace_invisible {
40
+ color: rgb(191, 191, 191);
41
+ }
42
+
43
+ .ace-tm .ace_storage,
44
+ .ace-tm .ace_keyword {
45
+ color: blue;
46
+ }
47
+
48
+ .ace-tm .ace_constant {
49
+ color: rgb(197, 6, 11);
50
+ }
51
+
52
+ .ace-tm .ace_constant.ace_buildin {
53
+ color: rgb(88, 72, 246);
54
+ }
55
+
56
+ .ace-tm .ace_constant.ace_language {
57
+ color: rgb(88, 92, 246);
58
+ }
59
+
60
+ .ace-tm .ace_constant.ace_library {
61
+ color: rgb(6, 150, 14);
62
+ }
63
+
64
+ .ace-tm .ace_invalid {
65
+ background-color: rgba(255, 0, 0, 0.1);
66
+ color: red;
67
+ }
68
+
69
+ .ace-tm .ace_support.ace_function {
70
+ color: rgb(60, 76, 114);
71
+ }
72
+
73
+ .ace-tm .ace_support.ace_constant {
74
+ color: rgb(6, 150, 14);
75
+ }
76
+
77
+ .ace-tm .ace_support.ace_type,
78
+ .ace-tm .ace_support.ace_class {
79
+ color: rgb(109, 121, 222);
80
+ }
81
+
82
+ .ace-tm .ace_keyword.ace_operator {
83
+ color: rgb(104, 118, 135);
84
+ }
85
+
86
+ .ace-tm .ace_string {
87
+ color: rgb(3, 106, 7);
88
+ }
89
+
90
+ .ace-tm .ace_comment {
91
+ color: rgb(76, 136, 107);
92
+ }
93
+
94
+ .ace-tm .ace_comment.ace_doc {
95
+ color: rgb(0, 102, 255);
96
+ }
97
+
98
+ .ace-tm .ace_comment.ace_doc.ace_tag {
99
+ color: rgb(128, 159, 191);
100
+ }
101
+
102
+ .ace-tm .ace_constant.ace_numeric {
103
+ color: rgb(0, 0, 205);
104
+ }
105
+
106
+ .ace-tm .ace_variable {
107
+ color: rgb(49, 132, 149);
108
+ }
109
+
110
+ .ace-tm .ace_xml-pe {
111
+ color: rgb(104, 104, 91);
112
+ }
113
+
114
+ .ace-tm .ace_entity.ace_name.ace_function {
115
+ color: #0000A2;
116
+ }
117
+
118
+
119
+ .ace-tm .ace_heading {
120
+ color: rgb(12, 7, 255);
121
+ }
122
+
123
+ .ace-tm .ace_list {
124
+ color:rgb(185, 6, 144);
125
+ }
126
+
127
+ .ace-tm .ace_meta.ace_tag {
128
+ color:rgb(0, 22, 142);
129
+ }
130
+
131
+ .ace-tm .ace_string.ace_regex {
132
+ color: rgb(255, 0, 0)
133
+ }
134
+
135
+ .ace-tm .ace_marker-layer .ace_selection {
136
+ background: rgb(181, 213, 255);
137
+ }
138
+ .ace-tm.ace_multiselect .ace_selection.ace_start {
139
+ box-shadow: 0 0 3px 0px white;
140
+ }
141
+ .ace-tm .ace_marker-layer .ace_step {
142
+ background: rgb(252, 255, 0);
143
+ }
144
+
145
+ .ace-tm .ace_marker-layer .ace_stack {
146
+ background: rgb(164, 229, 101);
147
+ }
148
+
149
+ .ace-tm .ace_marker-layer .ace_bracket {
150
+ margin: -1px 0 0 -1px;
151
+ border: 1px solid rgb(192, 192, 192);
152
+ }
153
+
154
+ .ace-tm .ace_marker-layer .ace_active-line {
155
+ background: rgba(0, 0, 0, 0.07);
156
+ }
157
+
158
+ .ace-tm .ace_gutter-active-line {
159
+ background-color : #dcdcdc;
160
+ }
161
+
162
+ .ace-tm .ace_marker-layer .ace_selected-word {
163
+ background: rgb(250, 250, 255);
164
+ border: 1px solid rgb(200, 200, 250);
165
+ }
166
+
167
+ .ace-tm .ace_indent-guide {
168
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
169
+ }
170
+
171
+ .ace-tm .ace_indent-guide-active {
172
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
173
+ }
174
+ `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(n,l,v){l.isDark=!1,l.cssClass="ace-tm",l.cssText=n("./textmate-css"),l.$id="ace/theme/textmate";var a=n("../lib/dom");a.importCssString(l.cssText,l.cssClass,!1)}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(n,l,v){"no use strict";var a=n("./lib/lang"),u=n("./lib/net"),d=n("./lib/dom"),r=n("./lib/app_config").AppConfig;v.exports=l=new r;var c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};l.get=function(h){if(!c.hasOwnProperty(h))throw new Error("Unknown config key: "+h);return c[h]},l.set=function(h,s){if(c.hasOwnProperty(h))c[h]=s;else if(this.setDefaultValue("",h,s)==!1)throw new Error("Unknown config key: "+h);h=="useStrictCSP"&&d.useStrictCSP(s)},l.all=function(){return a.copyObject(c)},l.$modes={},l.moduleUrl=function(h,s){if(c.$moduleUrls[h])return c.$moduleUrls[h];var p=h.split("/");s=s||p[p.length-2]||"";var f=s=="snippets"?"/":"-",g=p[p.length-1];if(s=="worker"&&f=="-"){var y=new RegExp("^"+s+"[\\-_]|[\\-_]"+s+"$","g");g=g.replace(y,"")}(!g||g==s)&&p.length>1&&(g=p[p.length-2]);var A=c[s+"Path"];return A==null?A=c.basePath:f=="/"&&(s=f=""),A&&A.slice(-1)!="/"&&(A+="/"),A+s+f+g+this.get("suffix")},l.setModuleUrl=function(h,s){return c.$moduleUrls[h]=s};var e=function(h,s){if(h==="ace/theme/textmate"||h==="./theme/textmate")return s(null,n("./theme/textmate"));if(i)return i(h,s);console.error("loader is not configured")},i;l.setLoader=function(h){i=h},l.dynamicModules=Object.create(null),l.$loading={},l.$loaded={},l.loadModule=function(h,s){var p;if(Array.isArray(h))var f=h[0],g=h[1];else if(typeof h=="string")var g=h;var y=function(A){if(A&&!l.$loading[g])return s&&s(A);if(l.$loading[g]||(l.$loading[g]=[]),l.$loading[g].push(s),!(l.$loading[g].length>1)){var E=function(){e(g,function(w,m){m&&(l.$loaded[g]=m),l._emit("load.module",{name:g,module:m});var S=l.$loading[g];l.$loading[g]=null,S.forEach(function(M){M&&M(m)})})};if(!l.get("packaged"))return E();u.loadScript(l.moduleUrl(g,f),E),o()}};if(l.dynamicModules[g])l.dynamicModules[g]().then(function(A){A.default?y(A.default):y(A)});else{try{p=this.$require(g)}catch{}y(p||l.$loaded[g])}},l.$require=function(h){if(typeof v.require=="function"){var s="require";return v[s](h)}},l.setModuleLoader=function(h,s){l.dynamicModules[h]=s};var o=function(){!c.basePath&&!c.workerPath&&!c.modePath&&!c.themePath&&!Object.keys(c.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),o=function(){})};l.version="1.43.4"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(n,l,v){n("./lib/fixoldbrowsers");var a=n("./config");a.setLoader(function(c,e){n([c],function(i){e(null,i)})});var u=(function(){return this||typeof window<"u"&&window})();v.exports=function(c){a.init=d,a.$require=n,c.require=n},d(!0);function d(c){if(!(!u||!u.document)){a.set("packaged",c||n.packaged||v.packaged||u.define&&(void 0).packaged);var e={},i="",o=document.currentScript||document._currentScript,h=o&&o.ownerDocument||document;o&&o.src&&(i=o.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var s=h.getElementsByTagName("script"),p=0;p<s.length;p++){var f=s[p],g=f.src||f.getAttribute("src");if(g){for(var y=f.attributes,A=0,E=y.length;A<E;A++){var w=y[A];w.name.indexOf("data-ace-")===0&&(e[r(w.name.replace(/^data-ace-/,""))]=w.value)}var m=g.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);m&&(i=m[1])}}i&&(e.base=e.base||i,e.packaged=!0),e.basePath=e.base,e.workerPath=e.workerPath||e.base,e.modePath=e.modePath||e.base,e.themePath=e.themePath||e.base,delete e.base;for(var S in e)typeof e[S]<"u"&&a.set(S,e[S])}}function r(c){return c.replace(/-(.)/g,function(e,i){return i.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(n,l,v){var a=(function(){function u(d,r,c,e){this.start={row:d,column:r},this.end={row:c,column:e}}return u.prototype.isEqual=function(d){return this.start.row===d.start.row&&this.end.row===d.end.row&&this.start.column===d.start.column&&this.end.column===d.end.column},u.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},u.prototype.contains=function(d,r){return this.compare(d,r)==0},u.prototype.compareRange=function(d){var r,c=d.end,e=d.start;return r=this.compare(c.row,c.column),r==1?(r=this.compare(e.row,e.column),r==1?2:r==0?1:0):r==-1?-2:(r=this.compare(e.row,e.column),r==-1?-1:r==1?42:0)},u.prototype.comparePoint=function(d){return this.compare(d.row,d.column)},u.prototype.containsRange=function(d){return this.comparePoint(d.start)==0&&this.comparePoint(d.end)==0},u.prototype.intersects=function(d){var r=this.compareRange(d);return r==-1||r==0||r==1},u.prototype.isEnd=function(d,r){return this.end.row==d&&this.end.column==r},u.prototype.isStart=function(d,r){return this.start.row==d&&this.start.column==r},u.prototype.setStart=function(d,r){typeof d=="object"?(this.start.column=d.column,this.start.row=d.row):(this.start.row=d,this.start.column=r)},u.prototype.setEnd=function(d,r){typeof d=="object"?(this.end.column=d.column,this.end.row=d.row):(this.end.row=d,this.end.column=r)},u.prototype.inside=function(d,r){return this.compare(d,r)==0?!(this.isEnd(d,r)||this.isStart(d,r)):!1},u.prototype.insideStart=function(d,r){return this.compare(d,r)==0?!this.isEnd(d,r):!1},u.prototype.insideEnd=function(d,r){return this.compare(d,r)==0?!this.isStart(d,r):!1},u.prototype.compare=function(d,r){return!this.isMultiLine()&&d===this.start.row?r<this.start.column?-1:r>this.end.column?1:0:d<this.start.row?-1:d>this.end.row?1:this.start.row===d?r>=this.start.column?0:-1:this.end.row===d?r<=this.end.column?0:1:0},u.prototype.compareStart=function(d,r){return this.start.row==d&&this.start.column==r?-1:this.compare(d,r)},u.prototype.compareEnd=function(d,r){return this.end.row==d&&this.end.column==r?1:this.compare(d,r)},u.prototype.compareInside=function(d,r){return this.end.row==d&&this.end.column==r?1:this.start.row==d&&this.start.column==r?-1:this.compare(d,r)},u.prototype.clipRows=function(d,r){if(this.end.row>r)var c={row:r+1,column:0};else if(this.end.row<d)var c={row:d,column:0};if(this.start.row>r)var e={row:r+1,column:0};else if(this.start.row<d)var e={row:d,column:0};return u.fromPoints(e||this.start,c||this.end)},u.prototype.extend=function(d,r){var c=this.compare(d,r);if(c==0)return this;if(c==-1)var e={row:d,column:r};else var i={row:d,column:r};return u.fromPoints(e||this.start,i||this.end)},u.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},u.prototype.isMultiLine=function(){return this.start.row!==this.end.row},u.prototype.clone=function(){return u.fromPoints(this.start,this.end)},u.prototype.collapseRows=function(){return this.end.column==0?new u(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new u(this.start.row,0,this.end.row,0)},u.prototype.toScreenRange=function(d){var r=d.documentToScreenPosition(this.start),c=d.documentToScreenPosition(this.end);return new u(r.row,r.column,c.row,c.column)},u.prototype.moveBy=function(d,r){this.start.row+=d,this.start.column+=r,this.end.row+=d,this.end.column+=r},u})();a.fromPoints=function(u,d){return new a(u.row,u.column,d.row,d.column)},a.comparePoints=function(u,d){return u.row-d.row||u.column-d.column},l.Range=a}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(n,l,v){for(var a=n("./oop"),u={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},d={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},r=0;r<10;r++)d["Digit"+r]=48+r,d["Numpad"+r]=96+r,u.PRINTABLE_KEYS[48+r]=""+r,u.FUNCTION_KEYS[96+r]="Numpad"+r;for(var r=65;r<91;r++){var c=String.fromCharCode(r+32);d["Key"+c.toUpperCase()]=r,u.PRINTABLE_KEYS[r]=c}for(var r=1;r<13;r++)d["F"+r]=111+r,u.FUNCTION_KEYS[111+r]="F"+r;var e={Shift:16,Control:17,Alt:18,Meta:224};for(var i in e)d[i]=d[i+"Left"]=d[i+"Right"]=e[i];l.$codeToKeyCode=d,u.PRINTABLE_KEYS[173]="-";for(var o in u.FUNCTION_KEYS){var h=u.FUNCTION_KEYS[o].toLowerCase();u[h]=parseInt(o,10)}for(var o in u.PRINTABLE_KEYS){var h=u.PRINTABLE_KEYS[o].toLowerCase();u[h]=parseInt(o,10)}a.mixin(u,u.MODIFIER_KEYS),a.mixin(u,u.PRINTABLE_KEYS),a.mixin(u,u.FUNCTION_KEYS),u.enter=u.return,u.escape=u.esc,u.del=u.delete,(function(){for(var s=["cmd","ctrl","alt","shift"],p=Math.pow(2,s.length);p--;)u.KEY_MODS[p]=s.filter(function(f){return p&u.KEY_MODS[f]}).join("-")+"-"})(),u.KEY_MODS[0]="",u.KEY_MODS[-1]="input-",a.mixin(l,u),l.default=l,l.keyCodeToString=function(s){var p=u[s];return typeof p!="string"&&(p=String.fromCharCode(s)),p.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(n,l,v){var a=n("./keys"),u=n("./useragent"),d=null,r=0,c;function e(){c=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return c={passive:!1},!0}})}catch{}}function i(){return c==null&&e(),c}function o(A,E,w){this.elem=A,this.type=E,this.callback=w}o.prototype.destroy=function(){s(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var h=l.addListener=function(A,E,w,m){A.addEventListener(E,w,i()),m&&m.$toDestroy.push(new o(A,E,w))},s=l.removeListener=function(A,E,w){A.removeEventListener(E,w,i())};l.stopEvent=function(A){return l.stopPropagation(A),l.preventDefault(A),!1},l.stopPropagation=function(A){A.stopPropagation&&A.stopPropagation()},l.preventDefault=function(A){A.preventDefault&&A.preventDefault()},l.getButton=function(A){return A.type=="dblclick"?0:A.type=="contextmenu"||u.isMac&&A.ctrlKey&&!A.altKey&&!A.shiftKey?2:A.button},l.capture=function(A,E,w){var m=A&&A.ownerDocument||document;function S(M){E&&E(M),w&&w(M),s(m,"mousemove",E),s(m,"mouseup",S),s(m,"dragstart",S)}return h(m,"mousemove",E),h(m,"mouseup",S),h(m,"dragstart",S),S},l.addMouseWheelListener=function(A,E,w){h(A,"wheel",function(m){var S=.15,M=m.deltaX||0,D=m.deltaY||0;switch(m.deltaMode){case m.DOM_DELTA_PIXEL:m.wheelX=M*S,m.wheelY=D*S;break;case m.DOM_DELTA_LINE:var _=15;m.wheelX=M*_,m.wheelY=D*_;break;case m.DOM_DELTA_PAGE:var F=150;m.wheelX=M*F,m.wheelY=D*F;break}E(m)},w)},l.addMultiMouseDownListener=function(A,E,w,m,S){var M=0,D,_,F,x={2:"dblclick",3:"tripleclick",4:"quadclick"};function $(C){if(l.getButton(C)!==0?M=0:C.detail>1?(M++,M>4&&(M=1)):M=1,u.isIE){var b=Math.abs(C.clientX-D)>5||Math.abs(C.clientY-_)>5;(!F||b)&&(M=1),F&&clearTimeout(F),F=setTimeout(function(){F=null},E[M-1]||600),M==1&&(D=C.clientX,_=C.clientY)}if(C._clicks=M,w[m]("mousedown",C),M>4)M=0;else if(M>1)return w[m](x[M],C)}Array.isArray(A)||(A=[A]),A.forEach(function(C){h(C,"mousedown",$,S)})};function p(A){return 0|(A.ctrlKey?1:0)|(A.altKey?2:0)|(A.shiftKey?4:0)|(A.metaKey?8:0)}l.getModifierString=function(A){return a.KEY_MODS[p(A)]};function f(A,E,w){var m=p(E);if(!w&&E.code&&(w=a.$codeToKeyCode[E.code]||w),!u.isMac&&d){if(E.getModifierState&&(E.getModifierState("OS")||E.getModifierState("Win"))&&(m|=8),d.altGr)if((3&m)!=3)d.altGr=0;else return;if(w===18||w===17){var S=E.location;if(w===17&&S===1)d[w]==1&&(r=E.timeStamp);else if(w===18&&m===3&&S===2){var M=E.timeStamp-r;M<50&&(d.altGr=!0)}}}if(w in a.MODIFIER_KEYS&&(w=-1),!(!m&&w===13&&E.location===3&&(A(E,m,-w),E.defaultPrevented))){if(u.isChromeOS&&m&8){if(A(E,m,w),E.defaultPrevented)return;m&=-9}return!m&&!(w in a.FUNCTION_KEYS)&&!(w in a.PRINTABLE_KEYS)?!1:A(E,m,w)}}l.addCommandKeyListener=function(A,E,w){var m=null;h(A,"keydown",function(S){d[S.keyCode]=(d[S.keyCode]||0)+1;var M=f(E,S,S.keyCode);return m=S.defaultPrevented,M},w),h(A,"keypress",function(S){m&&(S.ctrlKey||S.altKey||S.shiftKey||S.metaKey)&&(l.stopEvent(S),m=null)},w),h(A,"keyup",function(S){d[S.keyCode]=null},w),d||(g(),h(window,"focus",g))};function g(){d=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!u.isOldIE){var y=1;l.nextTick=function(A,E){E=E||window;var w="zero-timeout-message-"+y++,m=function(S){S.data==w&&(l.stopPropagation(S),s(E,"message",m),A())};h(E,"message",m),E.postMessage(w,"*")}}l.$idleBlocked=!1,l.onIdle=function(A,E){return setTimeout(function w(){l.$idleBlocked?setTimeout(w,100):A()},E)},l.$idleBlockId=null,l.blockIdle=function(A){l.$idleBlockId&&clearTimeout(l.$idleBlockId),l.$idleBlocked=!0,l.$idleBlockId=setTimeout(function(){l.$idleBlocked=!1},A||100)},l.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),l.nextFrame?l.nextFrame=l.nextFrame.bind(window):l.nextFrame=function(A){setTimeout(A,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(n,l,v){var a;v.exports={lineMode:!1,pasteCancelled:function(){return a&&a>Date.now()-50?!0:a=!1},cancel:function(){a=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(n,l,v){var a=n("../lib/event"),u=n("../config").nls,d=n("../lib/useragent"),r=n("../lib/dom"),c=n("../lib/lang"),e=n("../clipboard"),i=d.isChrome<18,o=d.isIE,h=d.isChrome>63,s=400,p=n("../lib/keys"),f=p.KEY_MODS,g=d.isIOS,y=g?/\s/:/\n/,A=d.isMobile,E=(function(){function w(m,S){var M=this;this.host=S,this.text=r.createElement("textarea"),this.text.className="ace_text-input",this.text.setAttribute("wrap","off"),this.text.setAttribute("autocomplete","off"),this.text.setAttribute("autocorrect","off"),this.text.setAttribute("autocapitalize","off"),this.text.setAttribute("spellcheck","false"),this.text.style.opacity="0",m.insertBefore(this.text,m.firstChild),this.copied=!1,this.pasted=!1,this.inComposition=!1,this.sendingText=!1,this.tempStyle="",A||(this.text.style.fontSize="1px"),this.commandMode=!1,this.ignoreFocusEvents=!1,this.lastValue="",this.lastSelectionStart=0,this.lastSelectionEnd=0,this.lastRestoreEnd=0,this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,this.numberOfExtraLines=0;try{this.$isFocused=document.activeElement===this.text}catch{}this.cancelComposition=this.cancelComposition.bind(this),this.setAriaOptions({role:"textbox"}),a.addListener(this.text,"blur",function(D){M.ignoreFocusEvents||(S.onBlur(D),M.$isFocused=!1)},S),a.addListener(this.text,"focus",function(D){if(!M.ignoreFocusEvents){if(M.$isFocused=!0,d.isEdge)try{if(!document.hasFocus())return}catch{}S.onFocus(D),d.isEdge?setTimeout(M.resetSelection.bind(M)):M.resetSelection()}},S),this.$focusScroll=!1,S.on("beforeEndOperation",function(){var D=S.curOp,_=D&&D.command&&D.command.name;if(_!="insertstring"){var F=_&&(D.docChanged||D.selectionChanged);M.inComposition&&F&&(M.lastValue=M.text.value="",M.onCompositionEnd()),M.resetSelection()}}),S.on("changeSelection",this.setAriaLabel.bind(this)),this.resetSelection=g?this.$resetSelectionIOS:this.$resetSelection,this.$isFocused&&S.onFocus(),this.inputHandler=null,this.afterContextMenu=!1,a.addCommandKeyListener(this.text,function(D,_,F){if(!M.inComposition)return S.onCommandKey(D,_,F)},S),a.addListener(this.text,"select",this.onSelect.bind(this),S),a.addListener(this.text,"input",this.onInput.bind(this),S),a.addListener(this.text,"cut",this.onCut.bind(this),S),a.addListener(this.text,"copy",this.onCopy.bind(this),S),a.addListener(this.text,"paste",this.onPaste.bind(this),S),(!("oncut"in this.text)||!("oncopy"in this.text)||!("onpaste"in this.text))&&a.addListener(m,"keydown",function(D){if(!(d.isMac&&!D.metaKey||!D.ctrlKey))switch(D.keyCode){case 67:M.onCopy(D);break;case 86:M.onPaste(D);break;case 88:M.onCut(D);break}},S),this.syncComposition=c.delayedCall(this.onCompositionUpdate.bind(this),50).schedule.bind(null,null),a.addListener(this.text,"compositionstart",this.onCompositionStart.bind(this),S),a.addListener(this.text,"compositionupdate",this.onCompositionUpdate.bind(this),S),a.addListener(this.text,"keyup",this.onKeyup.bind(this),S),a.addListener(this.text,"keydown",this.syncComposition.bind(this),S),a.addListener(this.text,"compositionend",this.onCompositionEnd.bind(this),S),this.closeTimeout,a.addListener(this.text,"mouseup",this.$onContextMenu.bind(this),S),a.addListener(this.text,"mousedown",function(D){D.preventDefault(),M.onContextMenuClose()},S),a.addListener(S.renderer.scroller,"contextmenu",this.$onContextMenu.bind(this),S),a.addListener(this.text,"contextmenu",this.$onContextMenu.bind(this),S),g&&this.addIosSelectionHandler(m,S,this.text)}return w.prototype.addIosSelectionHandler=function(m,S,M){var D=this,_=null,F=!1;M.addEventListener("keydown",function($){_&&clearTimeout(_),F=!0},!0),M.addEventListener("keyup",function($){_=setTimeout(function(){F=!1},100)},!0);var x=function($){if(document.activeElement===M&&!(F||D.inComposition||S.$mouseHandler.isMousePressed)&&!D.copied){var C=M.selectionStart,b=M.selectionEnd,T=null,I=0;if(C==0?T=p.up:C==1?T=p.home:b>D.lastSelectionEnd&&D.lastValue[b]==`
175
+ `?T=p.end:C<D.lastSelectionStart&&D.lastValue[C-1]==" "?(T=p.left,I=f.option):C<D.lastSelectionStart||C==D.lastSelectionStart&&D.lastSelectionEnd!=D.lastSelectionStart&&C==b?T=p.left:b>D.lastSelectionEnd&&D.lastValue.slice(0,b).split(`
176
+ `).length>2?T=p.down:b>D.lastSelectionEnd&&D.lastValue[b-1]==" "?(T=p.right,I=f.option):(b>D.lastSelectionEnd||b==D.lastSelectionEnd&&D.lastSelectionEnd!=D.lastSelectionStart&&C==b)&&(T=p.right),C!==b&&(I|=f.shift),T){var O=S.onCommandKey({},I,T);if(!O&&S.commands){T=p.keyCodeToString(T);var N=S.commands.findKeyCommand(I,T);N&&S.execCommand(N)}D.lastSelectionStart=C,D.lastSelectionEnd=b,D.resetSelection("")}}};document.addEventListener("selectionchange",x),S.on("destroy",function(){document.removeEventListener("selectionchange",x)})},w.prototype.onContextMenuClose=function(){var m=this;clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout(function(){m.tempStyle&&(m.text.style.cssText=m.tempStyle,m.tempStyle=""),m.host.renderer.$isMousePressed=!1,m.host.renderer.$keepTextAreaAtCursor&&m.host.renderer.$moveTextAreaToCursor()},0)},w.prototype.$onContextMenu=function(m){this.host.textInput.onContextMenu(m),this.onContextMenuClose()},w.prototype.onKeyup=function(m){m.keyCode==27&&this.text.value.length<this.text.selectionStart&&(this.inComposition||(this.lastValue=this.text.value),this.lastSelectionStart=this.lastSelectionEnd=-1,this.resetSelection()),this.syncComposition()},w.prototype.cancelComposition=function(){this.ignoreFocusEvents=!0,this.text.blur(),this.text.focus(),this.ignoreFocusEvents=!1},w.prototype.onCompositionStart=function(m){if(!(this.inComposition||!this.host.onCompositionStart||this.host.$readOnly)&&(this.inComposition={},!this.commandMode)){m.data&&(this.inComposition.useTextareaForIME=!1),setTimeout(this.onCompositionUpdate.bind(this),0),this.host._signal("compositionStart"),this.host.on("mousedown",this.cancelComposition);var S=this.host.getSelectionRange();S.end.row=S.start.row,S.end.column=S.start.column,this.inComposition.markerRange=S,this.inComposition.selectionStart=this.lastSelectionStart,this.host.onCompositionStart(this.inComposition),this.inComposition.useTextareaForIME?(this.lastValue=this.text.value="",this.lastSelectionStart=0,this.lastSelectionEnd=0):(this.text.msGetInputContext&&(this.inComposition.context=this.text.msGetInputContext()),this.text.getInputContext&&(this.inComposition.context=this.text.getInputContext()))}},w.prototype.onCompositionUpdate=function(){if(!(!this.inComposition||!this.host.onCompositionUpdate||this.host.$readOnly)){if(this.commandMode)return this.cancelComposition();if(this.inComposition.useTextareaForIME)this.host.onCompositionUpdate(this.text.value);else{var m=this.text.value;this.sendText(m),this.inComposition.markerRange&&(this.inComposition.context&&(this.inComposition.markerRange.start.column=this.inComposition.selectionStart=this.inComposition.context.compositionStartOffset),this.inComposition.markerRange.end.column=this.inComposition.markerRange.start.column+this.lastSelectionEnd-this.inComposition.selectionStart+this.lastRestoreEnd)}}},w.prototype.onCompositionEnd=function(m){!this.host.onCompositionEnd||this.host.$readOnly||(this.inComposition=!1,this.host.onCompositionEnd(),this.host.off("mousedown",this.cancelComposition),m&&this.onInput())},w.prototype.onCut=function(m){this.doCopy(m,!0)},w.prototype.onCopy=function(m){this.doCopy(m,!1)},w.prototype.onPaste=function(m){var S=this.handleClipboardData(m);e.pasteCancelled()||(typeof S=="string"?(S&&this.host.onPaste(S,m),d.isIE&&setTimeout(this.resetSelection),a.preventDefault(m)):(this.text.value="",this.pasted=!0))},w.prototype.doCopy=function(m,S){var M=this,D=this.host.getCopyText();if(!D)return a.preventDefault(m);this.handleClipboardData(m,D)?(g&&(this.resetSelection(D),this.copied=D,setTimeout(function(){M.copied=!1},10)),S?this.host.onCut():this.host.onCopy(),a.preventDefault(m)):(this.copied=!0,this.text.value=D,this.text.select(),setTimeout(function(){M.copied=!1,M.resetSelection(),S?M.host.onCut():M.host.onCopy()}))},w.prototype.handleClipboardData=function(m,S,M){var D=m.clipboardData||window.clipboardData;if(!(!D||i)){var _=o||M?"Text":"text/plain";try{return S?D.setData(_,S)!==!1:D.getData(_)}catch(F){if(!M)return this.handleClipboardData(F,S,!0)}}},w.prototype.onInput=function(m){if(this.inComposition)return this.onCompositionUpdate();if(m&&m.inputType){if(m.inputType=="historyUndo")return this.host.execCommand("undo");if(m.inputType=="historyRedo")return this.host.execCommand("redo")}var S=this.text.value,M=this.sendText(S,!0);(S.length>s+100||y.test(M)||A&&this.lastSelectionStart<1&&this.lastSelectionStart==this.lastSelectionEnd)&&this.resetSelection()},w.prototype.sendText=function(m,S){if(this.afterContextMenu&&(this.afterContextMenu=!1),this.pasted)return this.resetSelection(),m&&this.host.onPaste(m),this.pasted=!1,"";for(var M=this.text.selectionStart,D=this.text.selectionEnd,_=this.lastSelectionStart,F=this.lastValue.length-this.lastSelectionEnd,x=m,$=m.length-M,C=m.length-D,b=0;_>0&&this.lastValue[b]==m[b];)b++,_--;for(x=x.slice(b),b=1;F>0&&this.lastValue.length-b>this.lastSelectionStart-1&&this.lastValue[this.lastValue.length-b]==m[m.length-b];)b++,F--;$-=b-1,C-=b-1;var T=x.length-b+1;if(T<0&&(_=-T,T=0),x=x.slice(0,T),!S&&!x&&!$&&!_&&!F&&!C)return"";this.sendingText=!0;var I=!1;return d.isAndroid&&x==". "&&(x=" ",I=!0),x&&!_&&!F&&!$&&!C||this.commandMode?this.host.onTextInput(x):this.host.onTextInput(x,{extendLeft:_,extendRight:F,restoreStart:$,restoreEnd:C}),this.sendingText=!1,this.lastValue=m,this.lastSelectionStart=M,this.lastSelectionEnd=D,this.lastRestoreEnd=C,I?`
177
+ `:x},w.prototype.onSelect=function(m){var S=this;if(!this.inComposition){var M=function(D){return D.selectionStart===0&&D.selectionEnd>=S.lastValue.length&&D.value===S.lastValue&&S.lastValue&&D.selectionEnd!==S.lastSelectionEnd};this.copied?this.copied=!1:M(this.text)?(this.host.selectAll(),this.resetSelection()):A&&this.text.selectionStart!=this.lastSelectionStart&&this.resetSelection()}},w.prototype.$resetSelectionIOS=function(m){if(!(!this.$isFocused||this.copied&&!m||this.sendingText)){m||(m="");var S=`
178
+ ab`+m+`cde fg
179
+ `;S!=this.text.value&&(this.text.value=this.lastValue=S);var M=4,D=4+(m.length||(this.host.selection.isEmpty()?0:1));(this.lastSelectionStart!=M||this.lastSelectionEnd!=D)&&this.text.setSelectionRange(M,D),this.lastSelectionStart=M,this.lastSelectionEnd=D}},w.prototype.$resetSelection=function(){var m=this;if(!(this.inComposition||this.sendingText)&&!(!this.$isFocused&&!this.afterContextMenu)){this.inComposition=!0;var S=0,M=0,D="",_=function(N,P){for(var B=P,V=1;V<=N-m.rowStart&&V<2*m.numberOfExtraLines+1;V++)B+=m.host.session.getLine(N-V).length+1;return B};if(this.host.session){var F=this.host.selection,x=F.getRange(),$=F.cursor.row;$===this.rowEnd+1?(this.rowStart=this.rowEnd+1,this.rowEnd=this.rowStart+2*this.numberOfExtraLines):$===this.rowStart-1?(this.rowEnd=this.rowStart-1,this.rowStart=this.rowEnd-2*this.numberOfExtraLines):($<this.rowStart-1||$>this.rowEnd+1)&&(this.rowStart=$>this.numberOfExtraLines?$-this.numberOfExtraLines:0,this.rowEnd=$>this.numberOfExtraLines?$+this.numberOfExtraLines:2*this.numberOfExtraLines);for(var C=[],b=this.rowStart;b<=this.rowEnd;b++)C.push(this.host.session.getLine(b));if(D=C.join(`
180
+ `),S=_(x.start.row,x.start.column),M=_(x.end.row,x.end.column),x.start.row<this.rowStart){var T=this.host.session.getLine(this.rowStart-1);S=x.start.row<this.rowStart-1?0:S,M+=T.length+1,D=T+`
181
+ `+D}else if(x.end.row>this.rowEnd){var I=this.host.session.getLine(this.rowEnd+1);M=x.end.row>this.rowEnd+1?I.length:x.end.column,M+=D.length+1,D=D+`
182
+ `+I}else A&&$>0&&(D=`
183
+ `+D,M+=1,S+=1);D.length>s&&(S<s&&M<s?D=D.slice(0,s):(D=`
184
+ `,S==M?S=M=0:(S=0,M=1)));var O=D+`
185
+
186
+ `;O!=this.lastValue&&(this.text.value=this.lastValue=O,this.lastSelectionStart=this.lastSelectionEnd=O.length)}if(this.afterContextMenu&&(this.lastSelectionStart=this.text.selectionStart,this.lastSelectionEnd=this.text.selectionEnd),this.lastSelectionEnd!=M||this.lastSelectionStart!=S||this.text.selectionEnd!=this.lastSelectionEnd)try{this.text.setSelectionRange(S,M),this.lastSelectionStart=S,this.lastSelectionEnd=M}catch{}this.inComposition=!1}},w.prototype.setHost=function(m){this.host=m},w.prototype.setNumberOfExtraLines=function(m){if(this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,m<0){this.numberOfExtraLines=0;return}this.numberOfExtraLines=m},w.prototype.setAriaLabel=function(){var m="";if(this.host.$textInputAriaLabel&&(m+="".concat(this.host.$textInputAriaLabel,", ")),this.host.session){var S=this.host.session.selection.cursor.row;m+=u("text-input.aria-label","Cursor at row $0",[S+1])}this.text.setAttribute("aria-label",m)},w.prototype.setAriaOptions=function(m){m.activeDescendant?(this.text.setAttribute("aria-haspopup","true"),this.text.setAttribute("aria-autocomplete",m.inline?"both":"list"),this.text.setAttribute("aria-activedescendant",m.activeDescendant)):(this.text.setAttribute("aria-haspopup","false"),this.text.setAttribute("aria-autocomplete","both"),this.text.removeAttribute("aria-activedescendant")),m.role&&this.text.setAttribute("role",m.role),m.setLabel&&(this.text.setAttribute("aria-roledescription",u("text-input.aria-roledescription","editor")),this.setAriaLabel())},w.prototype.focus=function(){var m=this;if(this.setAriaOptions({setLabel:this.host.renderer.enableKeyboardAccessibility}),this.tempStyle||h||this.$focusScroll=="browser")return this.text.focus({preventScroll:!0});var S=this.text.style.top;this.text.style.position="fixed",this.text.style.top="0px";try{var M=this.text.getBoundingClientRect().top!=0}catch{return}var D=[];if(M)for(var _=this.text.parentElement;_&&_.nodeType==1;)D.push(_),_.setAttribute("ace_nocontext","true"),!_.parentElement&&_.getRootNode?_=_.getRootNode().host:_=_.parentElement;this.text.focus({preventScroll:!0}),M&&D.forEach(function(F){F.removeAttribute("ace_nocontext")}),setTimeout(function(){m.text.style.position="",m.text.style.top=="0px"&&(m.text.style.top=S)},0)},w.prototype.blur=function(){this.text.blur()},w.prototype.isFocused=function(){return this.$isFocused},w.prototype.setInputHandler=function(m){this.inputHandler=m},w.prototype.getInputHandler=function(){return this.inputHandler},w.prototype.getElement=function(){return this.text},w.prototype.setCommandMode=function(m){this.commandMode=m,this.text.readOnly=!1},w.prototype.setReadOnly=function(m){this.commandMode||(this.text.readOnly=m)},w.prototype.setCopyWithEmptySelection=function(m){},w.prototype.onContextMenu=function(m){this.afterContextMenu=!0,this.resetSelection(),this.host._emit("nativecontextmenu",{target:this.host,domEvent:m}),this.moveToMouse(m,!0)},w.prototype.moveToMouse=function(m,S){var M=this;this.tempStyle||(this.tempStyle=this.text.style.cssText),this.text.style.cssText=(S?"z-index:100000;":"")+(d.isIE?"opacity:0.1;":"")+"text-indent: -"+(this.lastSelectionStart+this.lastSelectionEnd)*this.host.renderer.characterWidth*.5+"px;";var D=this.host.container.getBoundingClientRect(),_=r.computedStyle(this.host.container),F=D.top+(parseInt(_.borderTopWidth)||0),x=D.left+(parseInt(_.borderLeftWidth)||0),$=D.bottom-F-this.text.clientHeight-2,C=function(b){r.translate(M.text,b.clientX-x-2,Math.min(b.clientY-F-2,$))};C(m),m.type=="mousedown"&&(this.host.renderer.$isMousePressed=!0,clearTimeout(this.closeTimeout),d.isWin&&a.capture(this.host.container,C,this.onContextMenuClose.bind(this)))},w.prototype.destroy=function(){this.text.parentElement&&this.text.parentElement.removeChild(this.text)},w})();l.TextInput=E,l.$setUserAgentForTests=function(w,m){A=w,g=m}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(n,l,v){var a=n("../lib/useragent"),u=0,d=550,r=(function(){function i(o){o.$clickSelection=null;var h=o.editor;h.setDefaultHandler("mousedown",this.onMouseDown.bind(o)),h.setDefaultHandler("dblclick",this.onDoubleClick.bind(o)),h.setDefaultHandler("tripleclick",this.onTripleClick.bind(o)),h.setDefaultHandler("quadclick",this.onQuadClick.bind(o)),h.setDefaultHandler("mousewheel",this.onMouseWheel.bind(o));var s=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];s.forEach(function(p){o[p]=this[p]},this),o.selectByLines=this.extendSelectionBy.bind(o,"getLineRange"),o.selectByWords=this.extendSelectionBy.bind(o,"getWordRange")}return i.prototype.onMouseDown=function(o){var h=o.inSelection(),s=o.getDocumentPosition();this.mousedownEvent=o;var p=this.editor,f=o.getButton();if(f!==0){var g=p.getSelectionRange(),y=g.isEmpty();(y||f==1)&&p.selection.moveToPosition(s),f==2&&(p.textInput.onContextMenu(o.domEvent),a.isMozilla||o.preventDefault());return}if(this.mousedownEvent.time=Date.now(),h&&!p.isFocused()&&(p.focus(),this.$focusTimeout&&!this.$clickSelection&&!p.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(o);return}return this.captureMouse(o),this.startSelect(s,o.domEvent._clicks>1),o.preventDefault()},i.prototype.startSelect=function(o,h){o=o||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var s=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?s.selection.selectToPosition(o):h||s.selection.moveToPosition(o),h||this.select(),s.setStyle("ace_selecting"),this.setState("select"))},i.prototype.select=function(){var o,h=this.editor,s=h.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var p=this.$clickSelection.comparePoint(s);if(p==-1)o=this.$clickSelection.end;else if(p==1)o=this.$clickSelection.start;else{var f=e(this.$clickSelection,s,h.session);s=f.cursor,o=f.anchor}h.selection.setSelectionAnchor(o.row,o.column)}h.selection.selectToPosition(s),h.renderer.scrollCursorIntoView()},i.prototype.extendSelectionBy=function(o){var h,s=this.editor,p=s.renderer.screenToTextCoordinates(this.x,this.y),f=s.selection[o](p.row,p.column);if(this.$clickSelection){var g=this.$clickSelection.comparePoint(f.start),y=this.$clickSelection.comparePoint(f.end);if(g==-1&&y<=0)h=this.$clickSelection.end,(f.end.row!=p.row||f.end.column!=p.column)&&(p=f.start);else if(y==1&&g>=0)h=this.$clickSelection.start,(f.start.row!=p.row||f.start.column!=p.column)&&(p=f.end);else if(g==-1&&y==1)p=f.end,h=f.start;else{var A=e(this.$clickSelection,p,s.session);p=A.cursor,h=A.anchor}s.selection.setSelectionAnchor(h.row,h.column)}s.selection.selectToPosition(p),s.renderer.scrollCursorIntoView()},i.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},i.prototype.focusWait=function(){var o=c(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),h=Date.now();(o>u||h-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},i.prototype.onDoubleClick=function(o){var h=o.getDocumentPosition(),s=this.editor,p=s.session,f=p.getBracketRange(h);f?(f.isEmpty()&&(f.start.column--,f.end.column++),this.setState("select")):(f=s.selection.getWordRange(h.row,h.column),this.setState("selectByWords")),this.$clickSelection=f,this.select()},i.prototype.onTripleClick=function(o){var h=o.getDocumentPosition(),s=this.editor;this.setState("selectByLines");var p=s.getSelectionRange();p.isMultiLine()&&p.contains(h.row,h.column)?(this.$clickSelection=s.selection.getLineRange(p.start.row),this.$clickSelection.end=s.selection.getLineRange(p.end.row).end):this.$clickSelection=s.selection.getLineRange(h.row),this.select()},i.prototype.onQuadClick=function(o){var h=this.editor;h.selectAll(),this.$clickSelection=h.getSelectionRange(),this.setState("selectAll")},i.prototype.onMouseWheel=function(o){if(!o.getAccelKey()){o.getShiftKey()&&o.wheelY&&!o.wheelX&&(o.wheelX=o.wheelY,o.wheelY=0);var h=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var s=this.$lastScroll,p=o.domEvent.timeStamp,f=p-s.t,g=f?o.wheelX/f:s.vx,y=f?o.wheelY/f:s.vy;f<d&&(g=(g+s.vx)/2,y=(y+s.vy)/2);var A=Math.abs(g/y),E=!1;if(A>=1&&h.renderer.isScrollableBy(o.wheelX*o.speed,0)&&(E=!0),A<=1&&h.renderer.isScrollableBy(0,o.wheelY*o.speed)&&(E=!0),E)s.allowed=p;else if(p-s.allowed<d){var w=Math.abs(g)<=1.5*Math.abs(s.vx)&&Math.abs(y)<=1.5*Math.abs(s.vy);w?(E=!0,s.allowed=p):s.allowed=0}if(s.t=p,s.vx=g,s.vy=y,E)return h.renderer.scrollBy(o.wheelX*o.speed,o.wheelY*o.speed),o.stop()}},i})();r.prototype.selectEnd=r.prototype.selectByLinesEnd,r.prototype.selectAllEnd=r.prototype.selectByLinesEnd,r.prototype.selectByWordsEnd=r.prototype.selectByLinesEnd,l.DefaultHandlers=r;function c(i,o,h,s){return Math.sqrt(Math.pow(h-i,2)+Math.pow(s-o,2))}function e(i,o,h){if(i.start.row==i.end.row)var s=2*o.column-i.start.column-i.end.column;else if(i.start.row==i.end.row-1&&!i.start.column&&!i.end.column)var s=3*o.column-2*h.getLine(i.start.row).length;else var s=2*o.row-i.start.row-i.end.row;return s<0?{cursor:i.start,anchor:i.end}:{cursor:i.end,anchor:i.start}}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(n,l,v){var a=n("../lib/event"),u=n("../lib/useragent"),d=(function(){function r(c,e){this.speed,this.wheelX,this.wheelY,this.domEvent=c,this.editor=e,this.x=this.clientX=c.clientX,this.y=this.clientY=c.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return r.prototype.stopPropagation=function(){a.stopPropagation(this.domEvent),this.propagationStopped=!0},r.prototype.preventDefault=function(){a.preventDefault(this.domEvent),this.defaultPrevented=!0},r.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},r.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},r.prototype.getGutterRow=function(){var c=this.getDocumentPosition().row,e=this.editor.session.documentToScreenRow(c,0),i=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return e-i},r.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var c=this.editor,e=c.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var i=this.getDocumentPosition();this.$inSelection=e.contains(i.row,i.column)}return this.$inSelection},r.prototype.getButton=function(){return a.getButton(this.domEvent)},r.prototype.getShiftKey=function(){return this.domEvent.shiftKey},r.prototype.getAccelKey=function(){return u.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},r})();l.MouseEvent=d}),ace.define("ace/lib/scroll",["require","exports","module"],function(n,l,v){l.preventParentScroll=function(u){u.stopPropagation();var d=u.currentTarget,r=d.scrollHeight>d.clientHeight;r||u.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(n,l,v){var a=this&&this.__extends||(function(){var p=function(f,g){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,A){y.__proto__=A}||function(y,A){for(var E in A)Object.prototype.hasOwnProperty.call(A,E)&&(y[E]=A[E])},p(f,g)};return function(f,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");p(f,g);function y(){this.constructor=f}f.prototype=g===null?Object.create(g):(y.prototype=g.prototype,new y)}})(),u=this&&this.__values||function(p){var f=typeof Symbol=="function"&&Symbol.iterator,g=f&&p[f],y=0;if(g)return g.call(p);if(p&&typeof p.length=="number")return{next:function(){return p&&y>=p.length&&(p=void 0),{value:p&&p[y++],done:!p}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},d=n("./lib/dom");n("./lib/event");var r=n("./range").Range,c=n("./lib/scroll").preventParentScroll,e="ace_tooltip",i=(function(){function p(f){this.isOpen=!1,this.$element=null,this.$parentNode=f}return p.prototype.$init=function(){return this.$element=d.createElement("div"),this.$element.className=e,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},p.prototype.getElement=function(){return this.$element||this.$init()},p.prototype.setText=function(f){this.getElement().textContent=f},p.prototype.setHtml=function(f){this.getElement().innerHTML=f},p.prototype.setPosition=function(f,g){this.getElement().style.left=f+"px",this.getElement().style.top=g+"px"},p.prototype.setClassName=function(f){d.addCssClass(this.getElement(),f)},p.prototype.setTheme=function(f){this.theme&&(this.theme.isDark&&d.removeCssClass(this.getElement(),"ace_dark"),this.theme.cssClass&&d.removeCssClass(this.getElement(),this.theme.cssClass)),f.isDark&&d.addCssClass(this.getElement(),"ace_dark"),f.cssClass&&d.addCssClass(this.getElement(),f.cssClass),this.theme={isDark:f.isDark,cssClass:f.cssClass}},p.prototype.show=function(f,g,y){f!=null&&this.setText(f),g!=null&&y!=null&&this.setPosition(g,y),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},p.prototype.hide=function(f){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=e,this.isOpen=!1)},p.prototype.getHeight=function(){return this.getElement().offsetHeight},p.prototype.getWidth=function(){return this.getElement().offsetWidth},p.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},p})(),o=(function(){function p(){this.popups=[]}return p.prototype.addPopup=function(f){this.popups.push(f),this.updatePopups()},p.prototype.removePopup=function(f){var g=this.popups.indexOf(f);g!==-1&&(this.popups.splice(g,1),this.updatePopups())},p.prototype.updatePopups=function(){var f,g,y,A;this.popups.sort(function(x,$){return $.priority-x.priority});var E=[];try{for(var w=u(this.popups),m=w.next();!m.done;m=w.next()){var S=m.value,M=!0;try{for(var D=(y=void 0,u(E)),_=D.next();!_.done;_=D.next()){var F=_.value;if(this.doPopupsOverlap(F,S)){M=!1;break}}}catch(x){y={error:x}}finally{try{_&&!_.done&&(A=D.return)&&A.call(D)}finally{if(y)throw y.error}}M?E.push(S):S.hide()}}catch(x){f={error:x}}finally{try{m&&!m.done&&(g=w.return)&&g.call(w)}finally{if(f)throw f.error}}},p.prototype.doPopupsOverlap=function(f,g){var y=f.getElement().getBoundingClientRect(),A=g.getElement().getBoundingClientRect();return y.left<A.right&&y.right>A.left&&y.top<A.bottom&&y.bottom>A.top},p})(),h=new o;l.popupManager=h,l.Tooltip=i;var s=(function(p){a(f,p);function f(g){g===void 0&&(g=document.body);var y=p.call(this,g)||this;y.timeout=void 0,y.lastT=0,y.idleTime=350,y.lastEvent=void 0,y.onMouseOut=y.onMouseOut.bind(y),y.onMouseMove=y.onMouseMove.bind(y),y.waitForHover=y.waitForHover.bind(y),y.hide=y.hide.bind(y);var A=y.getElement();return A.style.whiteSpace="pre-wrap",A.style.pointerEvents="auto",A.addEventListener("mouseout",y.onMouseOut),A.tabIndex=-1,A.addEventListener("blur",function(){A.contains(document.activeElement)||this.hide()}.bind(y)),A.addEventListener("wheel",c),y}return f.prototype.addToEditor=function(g){g.on("mousemove",this.onMouseMove),g.on("mousedown",this.hide);var y=g.renderer.getMouseEventTarget();y&&typeof y.removeEventListener=="function"&&y.addEventListener("mouseout",this.onMouseOut,!0)},f.prototype.removeFromEditor=function(g){g.off("mousemove",this.onMouseMove),g.off("mousedown",this.hide);var y=g.renderer.getMouseEventTarget();y&&typeof y.removeEventListener=="function"&&y.removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},f.prototype.onMouseMove=function(g,y){this.lastEvent=g,this.lastT=Date.now();var A=y.$mouseHandler.isMousePressed;if(this.isOpen){var E=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(E.row,E.column)||A||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||A||(this.lastEvent=g,this.timeout=setTimeout(this.waitForHover,this.idleTime))},f.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var g=Date.now()-this.lastT;if(this.idleTime-g>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-g);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},f.prototype.isOutsideOfText=function(g){var y=g.editor,A=g.getDocumentPosition(),E=y.session.getLine(A.row);if(A.column==E.length){var w=y.renderer.pixelToScreenCoordinates(g.clientX,g.clientY),m=y.session.documentToScreenPosition(A.row,A.column);if(m.column!=w.column||m.row!=w.row)return!0}return!1},f.prototype.setDataProvider=function(g){this.$gatherData=g},f.prototype.showForRange=function(g,y,A,E){if(!(E&&E!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var w=g.renderer;this.isOpen||(h.addPopup(this),this.$registerCloseEvents(),this.setTheme(w.theme)),this.isOpen=!0,this.range=r.fromPoints(y.start,y.end);var m=w.textToScreenCoordinates(y.start.row,y.start.column),S=w.scroller.getBoundingClientRect();m.pageX<S.left&&(m.pageX=S.left);var M=this.getElement();M.innerHTML="",M.appendChild(A),M.style.maxHeight="",M.style.display="block",this.$setPosition(g,m,!0,y),d.$fixPositionBug(M)}},f.prototype.$setPosition=function(g,y,A,E){var w=10;A&&this.addMarker(E,g.session);var m=g.renderer,S=this.getElement(),M=S.offsetHeight,D=S.offsetWidth,_=y.pageY,F=y.pageX,x=window.innerHeight-_-m.lineHeight,$=this.$shouldPlaceAbove(M,_,x-w);S.style.maxHeight=($?_:x)-w+"px",S.style.top=$?"":_+m.lineHeight+"px",S.style.bottom=$?window.innerHeight-_+"px":"",S.style.left=Math.min(F,window.innerWidth-D-w)+"px"},f.prototype.$shouldPlaceAbove=function(g,y,A){return!(y-g<0&&y<A)},f.prototype.addMarker=function(g,y){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=y,this.marker=y&&y.addMarker(g,"ace_highlight-marker","text")},f.prototype.hide=function(g){g&&this.$fromKeyboard&&g.type=="keydown"&&g.code=="Escape"||!g&&document.activeElement==this.getElement()||g&&g.target&&(g.type!="keydown"||g.ctrlKey||g.metaKey)&&this.$element.contains(g.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$fromKeyboard=!1,this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,h.removePopup(this)))},f.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},f.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},f.prototype.onMouseOut=function(g){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!g.relatedTarget||this.getElement().contains(g.relatedTarget)||g&&g.currentTarget.contains(g.relatedTarget)||g.relatedTarget.classList.contains("ace_content")||this.hide())},f})(i);l.HoverTooltip=s}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/mouse/mouse_event","ace/tooltip","ace/config","ace/range"],function(n,l,v){var a=this&&this.__extends||(function(){var s=function(p,f){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,y){g.__proto__=y}||function(g,y){for(var A in y)Object.prototype.hasOwnProperty.call(y,A)&&(g[A]=y[A])},s(p,f)};return function(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");s(p,f);function g(){this.constructor=p}p.prototype=f===null?Object.create(f):(g.prototype=f.prototype,new g)}})(),u=this&&this.__values||function(s){var p=typeof Symbol=="function"&&Symbol.iterator,f=p&&s[p],g=0;if(f)return f.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&g>=s.length&&(s=void 0),{value:s&&s[g++],done:!s}}};throw new TypeError(p?"Object is not iterable.":"Symbol.iterator is not defined.")},d=n("../lib/dom"),r=n("./mouse_event").MouseEvent,c=n("../tooltip").HoverTooltip,e=n("../config").nls,i=n("../range").Range;function o(s){var p=s.editor,f=p.renderer.$gutterLayer;s.$tooltip=new h(p),s.$tooltip.addToEditor(p),s.$tooltip.setDataProvider(function(g,y){var A=g.getDocumentPosition().row;s.$tooltip.showTooltip(A)}),s.editor.setDefaultHandler("guttermousedown",function(g){if(!(!p.isFocused()||g.getButton()!=0)){var y=f.getRegion(g);if(y!="foldWidgets"){var A=g.getDocumentPosition().row,E=p.session.selection;if(g.getShiftKey())E.selectTo(A,0);else{if(g.domEvent.detail==2)return p.selectAll(),g.preventDefault();s.$clickSelection=p.selection.getLineRange(A)}return s.setState("selectByLines"),s.captureMouse(g),g.preventDefault()}}})}l.GutterHandler=o;var h=(function(s){a(p,s);function p(f){var g=s.call(this,f.container)||this;g.id="gt"+ ++p.$uid,g.editor=f,g.visibleTooltipRow;var y=g.getElement();return y.setAttribute("role","tooltip"),y.setAttribute("id",g.id),y.style.pointerEvents="auto",g.idleTime=50,g.onDomMouseMove=g.onDomMouseMove.bind(g),g.onDomMouseOut=g.onDomMouseOut.bind(g),g.setClassName("ace_gutter-tooltip"),g}return p.prototype.onDomMouseMove=function(f){var g=new r(f,this.editor);this.onMouseMove(g,this.editor)},p.prototype.onDomMouseOut=function(f){var g=new r(f,this.editor);this.onMouseOut(g)},p.prototype.addToEditor=function(f){var g=f.renderer.$gutter;g.addEventListener("mousemove",this.onDomMouseMove),g.addEventListener("mouseout",this.onDomMouseOut),s.prototype.addToEditor.call(this,f)},p.prototype.removeFromEditor=function(f){var g=f.renderer.$gutter;g.removeEventListener("mousemove",this.onDomMouseMove),g.removeEventListener("mouseout",this.onDomMouseOut),s.prototype.removeFromEditor.call(this,f)},p.prototype.destroy=function(){this.editor&&this.removeFromEditor(this.editor),s.prototype.destroy.call(this)},Object.defineProperty(p,"annotationLabels",{get:function(){return{error:{singular:e("gutter-tooltip.aria-label.error.singular","error"),plural:e("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:e("gutter-tooltip.aria-label.security.singular","security finding"),plural:e("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:e("gutter-tooltip.aria-label.warning.singular","warning"),plural:e("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:e("gutter-tooltip.aria-label.info.singular","information message"),plural:e("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:e("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:e("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),p.prototype.showTooltip=function(f){var g,y=this.editor.renderer.$gutterLayer,A=y.$annotations[f],E;A?E={displayText:Array.from(A.displayText),type:Array.from(A.type)}:E={displayText:[],type:[]};var w=y.session.getFoldLine(f);if(w&&y.$showFoldedAnnotations){for(var m={error:[],security:[],warning:[],info:[],hint:[]},S={error:1,security:2,warning:3,info:4,hint:5},M,D=f+1;D<=w.end.row;D++)if(y.$annotations[D])for(var _=0;_<y.$annotations[D].text.length;_++){var F=y.$annotations[D].type[_];m[F].push(y.$annotations[D].text[_]),(!M||S[F]<S[M])&&(M=F)}if(["error","security","warning"].includes(M)){var x="".concat(p.annotationsToSummaryString(m)," in folded code.");E.displayText.push(x),E.type.push(M+"_fold")}}if(E.displayText.length===0)return this.hide();for(var $={error:[],security:[],warning:[],info:[],hint:[]},C=y.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",D=0;D<E.displayText.length;D++){var b=d.createElement("span"),T=d.createElement("span");(g=T.classList).add.apply(g,["ace_".concat(E.type[D]),C]),T.setAttribute("aria-label","".concat(p.annotationLabels[E.type[D].replace("_fold","")].singular)),T.setAttribute("role","img"),T.appendChild(d.createTextNode(" ")),b.appendChild(T),b.appendChild(d.createTextNode(E.displayText[D])),b.appendChild(d.createElement("br")),$[E.type[D].replace("_fold","")].push(b)}var I=d.createElement("span");$.error.forEach(function(P){return I.appendChild(P)}),$.security.forEach(function(P){return I.appendChild(P)}),$.warning.forEach(function(P){return I.appendChild(P)}),$.info.forEach(function(P){return I.appendChild(P)}),$.hint.forEach(function(P){return I.appendChild(P)}),I.setAttribute("aria-live","polite");var O=this.$findLinkedAnnotationNode(f);O&&O.setAttribute("aria-describedby",this.id);var N=i.fromPoints({row:f,column:0},{row:f,column:0});this.showForRange(this.editor,N,I),this.visibleTooltipRow=f,this.editor._signal("showGutterTooltip",this)},p.prototype.$setPosition=function(f,g,y,A){var E=this.$findCellByRow(A.start.row);if(E){var w=E&&E.element,m=w&&w.querySelector(".ace_gutter_annotation");if(m){var S=m.getBoundingClientRect();if(S){var M={pageX:S.right,pageY:S.top};return s.prototype.$setPosition.call(this,f,M,!1,A)}}}},p.prototype.$shouldPlaceAbove=function(f,g,y){return y<f},p.prototype.$findLinkedAnnotationNode=function(f){var g=this.$findCellByRow(f);if(g){var y=g.element;if(y.childNodes.length>2)return y.childNodes[2]}},p.prototype.$findCellByRow=function(f){return this.editor.renderer.$gutterLayer.$lines.cells.find(function(g){return g.row===f})},p.prototype.hide=function(f){if(this.isOpen){if(this.$element.removeAttribute("aria-live"),this.visibleTooltipRow!=null){var g=this.$findLinkedAnnotationNode(this.visibleTooltipRow);g&&g.removeAttribute("aria-describedby")}this.visibleTooltipRow=void 0,this.editor._signal("hideGutterTooltip",this),s.prototype.hide.call(this,f)}},p.annotationsToSummaryString=function(f){var g,y,A=[],E=["error","security","warning","info","hint"];try{for(var w=u(E),m=w.next();!m.done;m=w.next()){var S=m.value;if(f[S].length){var M=f[S].length===1?p.annotationLabels[S].singular:p.annotationLabels[S].plural;A.push("".concat(f[S].length," ").concat(M))}}}catch(D){g={error:D}}finally{try{m&&!m.done&&(y=w.return)&&y.call(w)}finally{if(g)throw g.error}}return A.join(", ")},p.prototype.isOutsideOfText=function(f){var g=f.editor,y=g.renderer.$gutter.getBoundingClientRect();return!(f.clientX>=y.left&&f.clientX<=y.right&&f.clientY>=y.top&&f.clientY<=y.bottom)},p})(c);h.$uid=0,l.GutterTooltip=h}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(n,l,v){var a=n("../lib/dom"),u=n("../lib/event"),d=n("../lib/useragent"),r=200,c=200,e=5;function i(h){var s=h.editor,p=a.createElement("div");p.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",p.textContent=" ";var f=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];f.forEach(function(W){h[W]=this[W]},this),s.on("mousedown",this.onMouseDown.bind(h));var g=s.container,y,A,E,w,m,S,M=0,D,_,F,x,$;this.onDragStart=function(W){if(this.cancelDrag||!g.draggable){var z=this;return setTimeout(function(){z.startSelect(),z.captureMouse(W)},0),W.preventDefault()}m=s.getSelectionRange();var U=W.dataTransfer;U.effectAllowed=s.getReadOnly()?"copy":"copyMove",s.container.appendChild(p),U.setDragImage&&U.setDragImage(p,0,0),setTimeout(function(){s.container.removeChild(p)}),U.clearData(),U.setData("Text",s.session.getTextRange()),_=!0,this.setState("drag")},this.onDragEnd=function(W){if(g.draggable=!1,_=!1,this.setState(null),!s.getReadOnly()){var z=W.dataTransfer.dropEffect;!D&&z=="move"&&s.session.remove(s.getSelectionRange()),s.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(W){if(!(s.getReadOnly()||!B(W.dataTransfer)))return A=W.clientX,E=W.clientY,y||I(),M++,W.dataTransfer.dropEffect=D=V(W),u.preventDefault(W)},this.onDragOver=function(W){if(!(s.getReadOnly()||!B(W.dataTransfer)))return A=W.clientX,E=W.clientY,y||(I(),M++),N!==null&&(N=null),W.dataTransfer.dropEffect=D=V(W),u.preventDefault(W)},this.onDragLeave=function(W){if(M--,M<=0&&y)return O(),D=null,u.preventDefault(W)},this.onDrop=function(W){if(S){var z=W.dataTransfer;if(_)switch(D){case"move":m.contains(S.row,S.column)?m={start:S,end:S}:m=s.moveText(m,S);break;case"copy":m=s.moveText(m,S,!0);break}else{var U=z.getData("Text");m={start:S,end:s.session.insert(S,U)},s.focus(),D=null}return O(),u.preventDefault(W)}},u.addListener(g,"dragstart",this.onDragStart.bind(h),s),u.addListener(g,"dragend",this.onDragEnd.bind(h),s),u.addListener(g,"dragenter",this.onDragEnter.bind(h),s),u.addListener(g,"dragover",this.onDragOver.bind(h),s),u.addListener(g,"dragleave",this.onDragLeave.bind(h),s),u.addListener(g,"drop",this.onDrop.bind(h),s);function C(W,z){var U=Date.now(),G=!z||W.row!=z.row,Y=!z||W.column!=z.column;if(!x||G||Y)s.moveCursorToPosition(W),x=U,$={x:A,y:E};else{var Q=o($.x,$.y,A,E);Q>e?x=null:U-x>=c&&(s.renderer.scrollCursorIntoView(),x=null)}}function b(W,z){var U=Date.now(),G=s.renderer.layerConfig.lineHeight,Y=s.renderer.layerConfig.characterWidth,Q=s.renderer.scroller.getBoundingClientRect(),q={x:{left:A-Q.left,right:Q.right-A},y:{top:E-Q.top,bottom:Q.bottom-E}},te=Math.min(q.x.left,q.x.right),re=Math.min(q.y.top,q.y.bottom),ue={row:W.row,column:W.column};te/Y<=2&&(ue.column+=q.x.left<q.x.right?-3:2),re/G<=1&&(ue.row+=q.y.top<q.y.bottom?-1:1);var me=W.row!=ue.row,Ce=W.column!=ue.column,ve=!z||W.row!=z.row;me||Ce&&!ve?F?U-F>=r&&s.renderer.scrollCursorIntoView(ue):F=U:F=null}function T(){var W=S;S=s.renderer.screenToTextCoordinates(A,E),C(S,W),b(S,W)}function I(){m=s.selection.toOrientedRange(),y=s.session.addMarker(m,"ace_selection",s.getSelectionStyle()),s.clearSelection(),s.isFocused()&&s.renderer.$cursorLayer.setBlinking(!1),clearInterval(w),T(),w=setInterval(T,20),M=0,u.addListener(document,"mousemove",P)}function O(){clearInterval(w),s.session.removeMarker(y),y=null,s.selection.fromOrientedRange(m),s.isFocused()&&!_&&s.$resetCursorStyle(),m=null,S=null,M=0,F=null,x=null,u.removeListener(document,"mousemove",P)}var N=null;function P(){N==null&&(N=setTimeout(function(){N!=null&&y&&O()},20))}function B(W){var z=W.types;return!z||Array.prototype.some.call(z,function(U){return U=="text/plain"||U=="Text"})}function V(W){var z=["copy","copymove","all","uninitialized"],U=["move","copymove","linkmove","all","uninitialized"],G=d.isMac?W.altKey:W.ctrlKey,Y="uninitialized";try{Y=W.dataTransfer.effectAllowed.toLowerCase()}catch{}var Q="none";return G&&z.indexOf(Y)>=0?Q="copy":U.indexOf(Y)>=0?Q="move":z.indexOf(Y)>=0&&(Q="copy"),Q}}(function(){this.dragWait=function(){var h=Date.now()-this.mousedownEvent.time;h>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var h=this.editor.container;h.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(h){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var h=this.editor,s=h.container;s.draggable=!0,h.renderer.$cursorLayer.setBlinking(!1),h.setStyle("ace_dragging");var p=d.isWin?"default":"move";h.renderer.setCursorStyle(p),this.setState("dragReady")},this.onMouseDrag=function(h){var s=this.editor.container;if(d.isIE&&this.state=="dragReady"){var p=o(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);p>3&&s.dragDrop()}if(this.state==="dragWait"){var p=o(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);p>0&&(s.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(h){if(this.$dragEnabled){this.mousedownEvent=h;var s=this.editor,p=h.inSelection(),f=h.getButton(),g=h.domEvent.detail||1;if(g===1&&f===0&&p){if(h.editor.inMultiSelectMode&&(h.getAccelKey()||h.getShiftKey()))return;this.mousedownEvent.time=Date.now();var y=h.domEvent.target||h.domEvent.srcElement;if("unselectable"in y&&(y.unselectable="on"),s.getDragDelay()){if(d.isWebKit){this.cancelDrag=!0;var A=s.container;A.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(h,this.onMouseDrag.bind(this)),h.defaultPrevented=!0}}}}).call(i.prototype);function o(h,s,p,f){return Math.sqrt(Math.pow(p-h,2)+Math.pow(f-s,2))}l.DragdropHandler=i}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(n,l,v){var a=n("./mouse_event").MouseEvent,u=n("../lib/event"),d=n("../lib/dom");l.addTouchListeners=function(r,c){var e="scroll",i,o,h,s,p,f,g=0,y,A=0,E=0,w=0,m,S;function M(){var C=window.navigator&&window.navigator.clipboard,b=!1,T=function(){var N=c.getCopyText(),P=c.session.getUndoManager().hasUndo();S.replaceChild(d.buildDom(b?["span",!N&&I("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],N&&I("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],N&&I("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],C&&I("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],P&&I("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],I("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],I("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),S.firstChild)},I=function(N){return c.commands.canExecute(N,c)},O=function(N){var P=N.target.getAttribute("action");if(P=="more"||!b)return b=!b,T();P=="paste"?C.readText().then(function(B){c.execCommand(P,B)}):P&&((P=="cut"||P=="copy")&&(C?C.writeText(c.getCopyText()):document.execCommand("copy")),c.execCommand(P)),S.firstChild.style.display="none",b=!1,P!="openCommandPalette"&&c.focus()};S=d.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(N){e="menu",N.stopPropagation(),N.preventDefault(),c.textInput.focus()},ontouchend:function(N){N.stopPropagation(),N.preventDefault(),O(N)},onclick:O},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],c.container)}function D(){if(!c.getOption("enableMobileMenu")){S&&_();return}S||M();var C=c.selection.cursor,b=c.renderer.textToScreenCoordinates(C.row,C.column),T=c.renderer.textToScreenCoordinates(0,0).pageX,I=c.renderer.scrollLeft,O=c.container.getBoundingClientRect();S.style.top=b.pageY-O.top-3+"px",b.pageX-O.left<O.width-70?(S.style.left="",S.style.right="10px"):(S.style.right="",S.style.left=T+I-O.left+"px"),S.style.display="",S.firstChild.style.display="none",c.on("input",_)}function _(C){S&&(S.style.display="none"),c.off("input",_)}function F(){p=null,clearTimeout(p);var C=c.selection.getRange(),b=C.contains(y.row,y.column);(C.isEmpty()||!b)&&(c.selection.moveToPosition(y),c.selection.selectWord()),e="wait",D()}function x(){p=null,clearTimeout(p),c.selection.moveToPosition(y);var C=A>=2?c.selection.getLineRange(y.row):c.session.getBracketRange(y);C&&!C.isEmpty()?c.selection.setRange(C):c.selection.selectWord(),e="wait"}u.addListener(r,"contextmenu",function(C){if(m){var b=c.textInput.getElement();b.focus()}},c),u.addListener(r,"touchstart",function(C){var b=C.touches;if(p||b.length>1){clearTimeout(p),p=null,h=-1,e="zoom";return}m=c.$mouseHandler.isMousePressed=!0;var T=c.renderer.layerConfig.lineHeight,I=c.renderer.layerConfig.lineHeight,O=C.timeStamp;s=O;var N=b[0],P=N.clientX,B=N.clientY;Math.abs(i-P)+Math.abs(o-B)>T&&(h=-1),i=C.clientX=P,o=C.clientY=B,E=w=0;var V=new a(C,c);if(y=V.getDocumentPosition(),O-h<500&&b.length==1&&!g)A++,C.preventDefault(),C.button=0,x();else{A=0;var W=c.selection.cursor,z=c.selection.isEmpty()?W:c.selection.anchor,U=c.renderer.$cursorLayer.getPixelPosition(W,!0),G=c.renderer.$cursorLayer.getPixelPosition(z,!0),Y=c.renderer.scroller.getBoundingClientRect(),Q=c.renderer.layerConfig.offset,q=c.renderer.scrollLeft,te=function(me,Ce){return me=me/I,Ce=Ce/T-.75,me*me+Ce*Ce};if(C.clientX<Y.left){e="zoom";return}var re=te(C.clientX-Y.left-U.left+q,C.clientY-Y.top-U.top+Q),ue=te(C.clientX-Y.left-G.left+q,C.clientY-Y.top-G.top+Q);re<3.5&&ue<3.5&&(e=re>ue?"cursor":"anchor"),ue<3.5?e="anchor":re<3.5?e="cursor":e="scroll",p=setTimeout(F,450)}h=O},c),u.addListener(r,"touchend",function(C){m=c.$mouseHandler.isMousePressed=!1,f&&clearInterval(f),e=="zoom"?(e="",g=0):p?(c.selection.moveToPosition(y),g=0,D()):e=="scroll"?($(),_()):D(),clearTimeout(p),p=null},c),u.addListener(r,"touchmove",function(C){p&&(clearTimeout(p),p=null);var b=C.touches;if(!(b.length>1||e=="zoom")){var T=b[0],I=i-T.clientX,O=o-T.clientY;if(e=="wait")if(I*I+O*O>4)e="cursor";else return C.preventDefault();i=T.clientX,o=T.clientY,C.clientX=T.clientX,C.clientY=T.clientY;var N=C.timeStamp,P=N-s;if(s=N,e=="scroll"){var B=new a(C,c);B.speed=1,B.wheelX=I,B.wheelY=O,10*Math.abs(I)<Math.abs(O)&&(I=0),10*Math.abs(O)<Math.abs(I)&&(O=0),P!=0&&(E=I/P,w=O/P),c._emit("mousewheel",B),B.propagationStopped||(E=w=0)}else{var V=new a(C,c),W=V.getDocumentPosition();e=="cursor"?c.selection.moveCursorToPosition(W):e=="anchor"&&c.selection.setSelectionAnchor(W.row,W.column),c.renderer.scrollCursorIntoView(W),C.preventDefault()}}},c);function $(){g+=60,f=setInterval(function(){g--<=0&&(clearInterval(f),f=null),Math.abs(E)<.01&&(E=0),Math.abs(w)<.01&&(w=0),g<20&&(E=.9*E),g<20&&(w=.9*w);var C=c.session.getScrollTop();c.renderer.scrollBy(10*E,10*w),C==c.session.getScrollTop()&&(g=0)},10)}}}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(n,l,v){var a=n("../lib/event"),u=n("../lib/useragent"),d=n("./default_handlers").DefaultHandlers,r=n("./default_gutter_handler").GutterHandler,c=n("./mouse_event").MouseEvent,e=n("./dragdrop_handler").DragdropHandler,i=n("./touch_handler").addTouchListeners,o=n("../config"),h=(function(){function s(p){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var f=this;this.editor=p,new d(this),new r(this),new e(this);var g=function(E){var w=!document.hasFocus||!document.hasFocus()||!p.isFocused()&&document.activeElement==(p.textInput&&p.textInput.getElement());w&&window.focus(),p.focus(),setTimeout(function(){p.isFocused()||p.focus()})},y=p.renderer.getMouseEventTarget();a.addListener(y,"click",this.onMouseEvent.bind(this,"click"),p),a.addListener(y,"mousemove",this.onMouseMove.bind(this,"mousemove"),p),a.addMultiMouseDownListener([y,p.renderer.scrollBarV&&p.renderer.scrollBarV.inner,p.renderer.scrollBarH&&p.renderer.scrollBarH.inner,p.textInput&&p.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",p),a.addMouseWheelListener(p.container,this.onMouseWheel.bind(this,"mousewheel"),p),i(p.container,p);var A=p.renderer.$gutter;a.addListener(A,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),p),a.addListener(A,"click",this.onMouseEvent.bind(this,"gutterclick"),p),a.addListener(A,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),p),a.addListener(A,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),p),a.addListener(y,"mousedown",g,p),a.addListener(A,"mousedown",g,p),u.isIE&&p.renderer.scrollBarV&&(a.addListener(p.renderer.scrollBarV.element,"mousedown",g,p),a.addListener(p.renderer.scrollBarH.element,"mousedown",g,p)),p.on("mousemove",function(E){if(!(f.state||f.$dragDelay||!f.$dragEnabled)){var w=p.renderer.screenToTextCoordinates(E.x,E.y),m=p.session.selection.getRange(),S=p.renderer;!m.isEmpty()&&m.insideStart(w.row,w.column)?S.setCursorStyle("default"):S.setCursorStyle("")}},p)}return s.prototype.onMouseEvent=function(p,f){this.editor.session&&this.editor._emit(p,new c(f,this.editor))},s.prototype.onMouseMove=function(p,f){var g=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!g||!g.length||this.editor._emit(p,new c(f,this.editor))},s.prototype.onMouseWheel=function(p,f){var g=new c(f,this.editor);g.speed=this.$scrollSpeed*2,g.wheelX=f.wheelX,g.wheelY=f.wheelY,this.editor._emit(p,g)},s.prototype.setState=function(p){this.state=p},s.prototype.captureMouse=function(p,f){this.x=p.x,this.y=p.y,this.isMousePressed=!0;var g=this.editor,y=this.editor.renderer;y.$isMousePressed=!0;var A=this,E=!0,w=function(_){if(_){if(u.isWebKit&&!_.which&&A.releaseMouse)return A.releaseMouse();A.x=_.clientX,A.y=_.clientY,f&&f(_),A.mouseEvent=new c(_,A.editor),A.$mouseMoved=!0}},m=function(_){g.off("beforeEndOperation",D),E=!1,g.session&&S(),A[A.state+"End"]&&A[A.state+"End"](_),A.state="",A.isMousePressed=y.$isMousePressed=!1,y.$keepTextAreaAtCursor&&y.$moveTextAreaToCursor(),A.$onCaptureMouseMove=A.releaseMouse=null,_&&A.onMouseEvent("mouseup",_),g.endOperation()},S=function(){A[A.state]&&A[A.state](),A.$mouseMoved=!1},M=function(){E&&(S(),a.nextFrame(M))};if(u.isOldIE&&p.domEvent.type=="dblclick")return setTimeout(function(){m(p)});var D=function(_){A.releaseMouse&&g.curOp.command.name&&g.curOp.selectionChanged&&(A[A.state+"End"]&&A[A.state+"End"](),A.state="",A.releaseMouse())};g.on("beforeEndOperation",D),g.startOperation({command:{name:"mouse"}}),A.$onCaptureMouseMove=w,A.releaseMouse=a.capture(this.editor.container,w,m),M()},s.prototype.cancelContextMenu=function(){var p=function(f){f&&f.domEvent&&f.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",p),f&&f.domEvent&&a.stopEvent(f.domEvent))}.bind(this);setTimeout(p,10),this.editor.on("nativecontextmenu",p)},s.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse(),this.$tooltip&&this.$tooltip.destroy()},s})();h.prototype.releaseMouse=null,o.defineOptions(h.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:u.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0}}),l.MouseHandler=h}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(n,l,v){var a=n("../lib/dom"),u=(function(){function d(r){r.on("click",function(c){var e=c.getDocumentPosition(),i=r.session,o=i.getFoldAt(e.row,e.column,1);o&&(c.getAccelKey()?i.removeFold(o):i.expandFold(o),c.stop());var h=c.domEvent&&c.domEvent.target;h&&a.hasCssClass(h,"ace_inline_button")&&a.hasCssClass(h,"ace_toggle_wrap")&&(i.setOption("wrap",!i.getUseWrapMode()),r.renderer.scrollCursorIntoView())}),r.on("gutterclick",function(c){var e=r.renderer.$gutterLayer.getRegion(c);if(e=="foldWidgets"){var i=c.getDocumentPosition().row,o=r.session;o.foldWidgets&&o.foldWidgets[i]&&r.session.onFoldWidgetClick(i,c),r.isFocused()||r.focus(),c.stop()}}),r.on("gutterdblclick",function(c){var e=r.renderer.$gutterLayer.getRegion(c);if(e=="foldWidgets"){var i=c.getDocumentPosition().row,o=r.session,h=o.getParentFoldRangeData(i,!0),s=h.range||h.firstRange;if(s){i=s.start.row;var p=o.getFoldAt(i,o.getLine(i).length,1);p?o.removeFold(p):(o.addFold("...",s),r.renderer.scrollCursorIntoView({row:s.start.row,column:0}))}c.stop()}})}return d})();l.FoldHandler=u}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(n,l,v){var a=n("../lib/keys"),u=n("../lib/event"),d=(function(){function r(c){this.$editor=c,this.$data={editor:c},this.$handlers=[],this.setDefaultHandler(c.commands)}return r.prototype.setDefaultHandler=function(c){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=c,this.addKeyboardHandler(c,0)},r.prototype.setKeyboardHandler=function(c){var e=this.$handlers;if(e[e.length-1]!=c){for(;e[e.length-1]&&e[e.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(e[e.length-1]);this.addKeyboardHandler(c,1)}},r.prototype.addKeyboardHandler=function(c,e){if(c){typeof c=="function"&&!c.handleKeyboard&&(c.handleKeyboard=c);var i=this.$handlers.indexOf(c);i!=-1&&this.$handlers.splice(i,1),e==null?this.$handlers.push(c):this.$handlers.splice(e,0,c),i==-1&&c.attach&&c.attach(this.$editor)}},r.prototype.removeKeyboardHandler=function(c){var e=this.$handlers.indexOf(c);return e==-1?!1:(this.$handlers.splice(e,1),c.detach&&c.detach(this.$editor),!0)},r.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},r.prototype.getStatusText=function(){var c=this.$data,e=c.editor;return this.$handlers.map(function(i){return i.getStatusText&&i.getStatusText(e,c)||""}).filter(Boolean).join(" ")},r.prototype.$callKeyboardHandlers=function(c,e,i,o){for(var h,s=!1,p=this.$editor.commands,f=this.$handlers.length;f--&&(h=this.$handlers[f].handleKeyboard(this.$data,c,e,i,o),!(!(!h||!h.command)&&(h.command=="null"?s=!0:s=p.exec(h.command,this.$editor,h.args,o),s&&o&&c!=-1&&h.passEvent!=!0&&h.command.passEvent!=!0&&u.stopEvent(o),s))););return!s&&c==-1&&(h={command:"insertstring"},s=p.exec("insertstring",this.$editor,e)),s&&this.$editor._signal&&this.$editor._signal("keyboardActivity",h),s},r.prototype.onCommandKey=function(c,e,i){var o=a.keyCodeToString(i);return this.$callKeyboardHandlers(e,o,i,c)},r.prototype.onTextInput=function(c){return this.$callKeyboardHandlers(-1,c)},r})();l.KeyBinding=d}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(n,l,v){var a=0,u=0,d=!1,r=!1,c=!1,e=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],i=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],o=0,h=1,s=0,p=1,f=2,g=3,y=4,A=5,E=6,w=7,m=8,S=9,M=10,D=11,_=12,F=13,x=14,$=15,C=16,b=17,T=18,I=[T,T,T,T,T,T,T,T,T,E,A,E,m,A,T,T,T,T,T,T,T,T,T,T,T,T,T,T,A,A,A,E,m,y,y,D,D,D,y,y,y,y,y,M,S,M,S,S,f,f,f,f,f,f,f,f,f,f,S,y,y,y,y,y,y,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,y,y,y,y,y,y,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,y,y,y,y,T,T,T,T,T,T,A,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,S,y,D,D,D,D,y,y,y,y,s,y,y,T,y,y,D,D,f,f,y,s,y,y,y,f,s,y,y,y,y,y],O=[m,m,m,m,m,m,m,m,m,m,m,T,T,T,s,p,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,m,A,F,x,$,C,b,S,D,D,D,D,D,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,S,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,m];function N(W,z,U,G){var Y=a?i:e,Q=null,q=null,te=null,re=0,ue=null,me=null,Ce=-1,ve=null,$e=null,Lt=[];if(!G)for(ve=0,G=[];ve<U;ve++)G[ve]=V(W[ve]);for(u=a,d=!1,r=!1,c=!1,$e=0;$e<U;$e++){if(Q=re,Lt[$e]=q=B(W,G,Lt,$e),re=Y[Q][q],ue=re&240,re&=15,z[$e]=te=Y[re][5],ue>0)if(ue==16){for(ve=Ce;ve<$e;ve++)z[ve]=1;Ce=-1}else Ce=-1;if(me=Y[re][6],me)Ce==-1&&(Ce=$e);else if(Ce>-1){for(ve=Ce;ve<$e;ve++)z[ve]=te;Ce=-1}G[$e]==A&&(z[$e]=0),u|=te}if(c){for(ve=0;ve<U;ve++)if(G[ve]==E){z[ve]=a;for(var gt=ve-1;gt>=0&&G[gt]==m;gt--)z[gt]=a}}}function P(W,z,U){if(!(u<W)){if(W==1&&a==h&&!r){U.reverse();return}for(var G=U.length,Y=0,Q,q,te,re;Y<G;){if(z[Y]>=W){for(Q=Y+1;Q<G&&z[Q]>=W;)Q++;for(q=Y,te=Q-1;q<te;q++,te--)re=U[q],U[q]=U[te],U[te]=re;Y=Q}Y++}}}function B(W,z,U,G){var Y=z[G],Q,q,te,re;switch(Y){case s:case p:d=!1;case y:case g:return Y;case f:return d?g:f;case w:return d=!0,p;case m:return y;case S:return G<1||G+1>=z.length||(Q=U[G-1])!=f&&Q!=g||(q=z[G+1])!=f&&q!=g?y:(d&&(q=g),q==Q?q:y);case M:return Q=G>0?U[G-1]:A,Q==f&&G+1<z.length&&z[G+1]==f?f:y;case D:if(G>0&&U[G-1]==f)return f;if(d)return y;for(re=G+1,te=z.length;re<te&&z[re]==D;)re++;return re<te&&z[re]==f?f:y;case _:for(te=z.length,re=G+1;re<te&&z[re]==_;)re++;if(re<te){var ue=W[G],me=ue>=1425&&ue<=2303||ue==64286;if(Q=z[re],me&&(Q==p||Q==w))return p}return G<1||(Q=z[G-1])==A?y:U[G-1];case A:return d=!1,r=!0,a;case E:return c=!0,y;case F:case x:case C:case b:case $:d=!1;case T:return y}}function V(W){var z=W.charCodeAt(0),U=z>>8;return U==0?z>191?s:I[z]:U==5?/[\u0591-\u05f4]/.test(W)?p:s:U==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(W)?_:/[\u0660-\u0669\u066b-\u066c]/.test(W)?g:z==1642?D:/[\u06f0-\u06f9]/.test(W)?f:w:U==32&&z<=8287?O[z&255]:U==254&&z>=65136?w:y}l.L=s,l.R=p,l.EN=f,l.ON_R=3,l.AN=4,l.R_H=5,l.B=6,l.RLE=7,l.DOT="·",l.doBidiReorder=function(W,z,U){if(W.length<2)return{};var G=W.split(""),Y=new Array(G.length),Q=new Array(G.length),q=[];a=U?h:o,N(G,q,G.length,z);for(var te=0;te<Y.length;Y[te]=te,te++);P(2,q,Y),P(1,q,Y);for(var te=0;te<Y.length-1;te++)z[te]===g?q[te]=l.AN:q[te]===p&&(z[te]>w&&z[te]<F||z[te]===y||z[te]===T)?q[te]=l.ON_R:te>0&&G[te-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(G[te])&&(q[te-1]=q[te]=l.R_H,te++);G[G.length-1]===l.DOT&&(q[G.length-1]=l.B),G[0]==="‫"&&(q[0]=l.RLE);for(var te=0;te<Y.length;te++)Q[te]=q[Y[te]];return{logicalFromVisual:Y,bidiLevels:Q}},l.hasBidiCharacters=function(W,z){for(var U=!1,G=0;G<W.length;G++)z[G]=V(W.charAt(G)),!U&&(z[G]==p||z[G]==w||z[G]==g)&&(U=!0);return U},l.getVisualFromLogicalIdx=function(W,z){for(var U=0;U<z.logicalFromVisual.length;U++)if(z.logicalFromVisual[U]==W)return U;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(n,l,v){var a=n("./lib/bidiutil"),u=n("./lib/lang"),d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,r=(function(){function c(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=a,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=d.test(e.getValue())}return c.prototype.isBidiRow=function(e,i,o){return this.seenBidi?(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(i,o),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},c.prototype.onChange=function(e){this.seenBidi?this.currentRow=null:e.action=="insert"&&d.test(e.lines.join(`
187
+ `))&&(this.seenBidi=!0,this.currentRow=null)},c.prototype.getDocumentRow=function(){var e=0,i=this.session.$screenRowCache;if(i.length){var o=this.session.$getRowCacheIndex(i,this.currentRow);o>=0&&(e=this.session.$docRowCache[o])}return e},c.prototype.getSplitIndex=function(){var e=0,i=this.session.$screenRowCache;if(i.length)for(var o,h=this.session.$getRowCacheIndex(i,this.currentRow);this.currentRow-e>0&&(o=this.session.$getRowCacheIndex(i,this.currentRow-e-1),o===h);)h=o,e++;else e=this.currentRow;return e},c.prototype.updateRowLine=function(e,i){e===void 0&&(e=this.getDocumentRow());var o=e===this.session.getLength()-1,h=o?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(i===void 0&&(i=this.getSplitIndex()),i>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[a.L],this.line=i<s.length?this.line.substring(s[i-1],s[i]):this.line.substring(s[s.length-1])):this.line=this.line.substring(0,s[i]),i==s.length&&(this.line+=this.showInvisibles?h:a.DOT))}else this.line+=this.showInvisibles?h:a.DOT;var p=this.session,f=0,g;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(y,A){return y===" "||p.isFullWidth(y.charCodeAt(0))?(g=y===" "?p.getScreenTabSize(A+f):2,f+=g-1,u.stringRepeat(a.DOT,g)):y}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==a.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},c.prototype.updateBidiMap=function(){var e=[];a.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=a.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},c.prototype.markAsDirty=function(){this.currentRow=null},c.prototype.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var i=this.characterWidth=e.$characterSize.width,o=e.$measureCharWidth("ה");this.charWidths[a.L]=this.charWidths[a.EN]=this.charWidths[a.ON_R]=i,this.charWidths[a.R]=this.charWidths[a.AN]=o,this.charWidths[a.R_H]=o*.45,this.charWidths[a.B]=this.charWidths[a.RLE]=0,this.currentRow=null}},c.prototype.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},c.prototype.setEolChar=function(e){this.EOL=e},c.prototype.setContentWidth=function(e){this.contentWidth=e},c.prototype.isRtlLine=function(e){return this.$isRtl?!0:e!=null?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir},c.prototype.setRtlDirection=function(e,i){for(var o=e.getCursorPosition(),h=e.selection.getSelectionAnchor().row;h<=o.row;h++)!i&&e.session.getLine(h).charAt(0)===e.session.$bidiHandler.RLE?e.session.doc.removeInLine(h,0,1):i&&e.session.getLine(h).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:h},e.session.$bidiHandler.RLE)},c.prototype.getPosLeft=function(e){e-=this.wrapIndent;var i=this.line.charAt(0)===this.RLE?1:0,o=e>i?this.session.getOverwrite()?e:e-1:i,h=a.getVisualFromLogicalIdx(o,this.bidiMap),s=this.bidiMap.bidiLevels,p=0;!this.session.getOverwrite()&&e<=i&&s[h]%2!==0&&h++;for(var f=0;f<h;f++)p+=this.charWidths[s[f]];return!this.session.getOverwrite()&&e>i&&s[h]%2===0&&(p+=this.charWidths[s[h]]),this.wrapIndent&&(p+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(p+=this.rtlLineOffset),p},c.prototype.getSelections=function(e,i){var o=this.bidiMap,h=o.bidiLevels,s,p=[],f=0,g=Math.min(e,i)-this.wrapIndent,y=Math.max(e,i)-this.wrapIndent,A=!1,E=!1,w=0;this.wrapIndent&&(f+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var m,S=0;S<h.length;S++)m=o.logicalFromVisual[S],s=h[S],A=m>=g&&m<y,A&&!E?w=f:!A&&E&&p.push({left:w,width:f-w}),f+=this.charWidths[s],E=A;if(A&&S===h.length&&p.push({left:w,width:f-w}),this.isRtlDir)for(var M=0;M<p.length;M++)p[M].left+=this.rtlLineOffset;return p},c.prototype.offsetToCol=function(o){this.isRtlDir&&(o-=this.rtlLineOffset);var i=0,o=Math.max(o,0),h=0,s=0,p=this.bidiMap.bidiLevels,f=this.charWidths[p[s]];for(this.wrapIndent&&(o-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);o>h+f/2;){if(h+=f,s===p.length-1){f=0;break}f=this.charWidths[p[++s]]}return s>0&&p[s-1]%2!==0&&p[s]%2===0?(o<h&&s--,i=this.bidiMap.logicalFromVisual[s]):s>0&&p[s-1]%2===0&&p[s]%2!==0?i=1+(o>h?this.bidiMap.logicalFromVisual[s]:this.bidiMap.logicalFromVisual[s-1]):this.isRtlDir&&s===p.length-1&&f===0&&p[s-1]%2===0||!this.isRtlDir&&s===0&&p[s]%2!==0?i=1+this.bidiMap.logicalFromVisual[s]:(s>0&&p[s-1]%2!==0&&f!==0&&s--,i=this.bidiMap.logicalFromVisual[s]),i===0&&this.isRtlDir&&i++,i+this.wrapIndent},c})();l.BidiHandler=r}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(n,l,v){var a=n("./lib/oop"),u=n("./lib/lang"),d=n("./lib/event_emitter").EventEmitter,r=n("./range").Range,c=(function(){function e(i){this.session=i,this.doc=i.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var o=this;this.cursor.on("change",function(h){o.$cursorChanged=!0,o.$silent||o._emit("changeCursor"),!o.$isEmpty&&!o.$silent&&o._emit("changeSelection"),!o.$keepDesiredColumnOnChange&&h.old.column!=h.value.column&&(o.$desiredColumn=null)}),this.anchor.on("change",function(){o.$anchorChanged=!0,!o.$isEmpty&&!o.$silent&&o._emit("changeSelection")})}return e.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},e.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},e.prototype.getCursor=function(){return this.lead.getPosition()},e.prototype.setAnchor=function(i,o){this.$isEmpty=!1,this.anchor.setPosition(i,o)},e.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},e.prototype.getSelectionLead=function(){return this.lead.getPosition()},e.prototype.isBackwards=function(){var i=this.anchor,o=this.lead;return i.row>o.row||i.row==o.row&&i.column>o.column},e.prototype.getRange=function(){var i=this.anchor,o=this.lead;return this.$isEmpty?r.fromPoints(o,o):this.isBackwards()?r.fromPoints(o,i):r.fromPoints(i,o)},e.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},e.prototype.setRange=function(i,o){var h=o?i.end:i.start,s=o?i.start:i.end;this.$setSelection(h.row,h.column,s.row,s.column)},e.prototype.$setSelection=function(i,o,h,s){if(!this.$silent){var p=this.$isEmpty,f=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(i,o),this.cursor.setPosition(h,s),this.$isEmpty=!r.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||p!=this.$isEmpty||f)&&this._emit("changeSelection")}},e.prototype.$moveSelection=function(i){var o=this.lead;this.$isEmpty&&this.setSelectionAnchor(o.row,o.column),i.call(this)},e.prototype.selectTo=function(i,o){this.$moveSelection(function(){this.moveCursorTo(i,o)})},e.prototype.selectToPosition=function(i){this.$moveSelection(function(){this.moveCursorToPosition(i)})},e.prototype.moveTo=function(i,o){this.clearSelection(),this.moveCursorTo(i,o)},e.prototype.moveToPosition=function(i){this.clearSelection(),this.moveCursorToPosition(i)},e.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},e.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},e.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},e.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},e.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},e.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},e.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},e.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},e.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},e.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},e.prototype.getWordRange=function(i,o){if(typeof o>"u"){var h=i||this.lead;i=h.row,o=h.column}return this.session.getWordRange(i,o)},e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},e.prototype.selectAWord=function(){var i=this.getCursor(),o=this.session.getAWordRange(i.row,i.column);this.setSelectionRange(o)},e.prototype.getLineRange=function(i,o){var h=typeof i=="number"?i:this.lead.row,s,p=this.session.getFoldLine(h);return p?(h=p.start.row,s=p.end.row):s=h,o===!0?new r(h,0,s,this.session.getLine(s).length):new r(h,0,s+1,0)},e.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},e.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},e.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},e.prototype.wouldMoveIntoSoftTab=function(i,o,h){var s=i.column,p=i.column+o;return h<0&&(s=i.column-o,p=i.column),this.session.isTabStop(i)&&this.doc.getLine(i.row).slice(s,p).split(" ").length-1==o},e.prototype.moveCursorLeft=function(){var i=this.lead.getPosition(),o;if(o=this.session.getFoldAt(i.row,i.column,-1))this.moveCursorTo(o.start.row,o.start.column);else if(i.column===0)i.row>0&&this.moveCursorTo(i.row-1,this.doc.getLine(i.row-1).length);else{var h=this.session.getTabSize();this.wouldMoveIntoSoftTab(i,h,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-h):this.moveCursorBy(0,-1)}},e.prototype.moveCursorRight=function(){var i=this.lead.getPosition(),o;if(o=this.session.getFoldAt(i.row,i.column,1))this.moveCursorTo(o.end.row,o.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var h=this.session.getTabSize(),i=this.lead;this.wouldMoveIntoSoftTab(i,h,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,h):this.moveCursorBy(0,1)}},e.prototype.moveCursorLineStart=function(){var i=this.lead.row,o=this.lead.column,h=this.session.documentToScreenRow(i,o),s=this.session.screenToDocumentPosition(h,0),p=this.session.getDisplayLine(i,null,s.row,s.column),f=p.match(/^\s*/);f[0].length!=o&&!this.session.$useEmacsStyleLineStart&&(s.column+=f[0].length),this.moveCursorToPosition(s)},e.prototype.moveCursorLineEnd=function(){var i=this.lead,o=this.session.getDocumentLastRowColumnPosition(i.row,i.column);if(this.lead.column==o.column){var h=this.session.getLine(o.row);if(o.column==h.length){var s=h.search(/\s+$/);s>0&&(o.column=s)}}this.moveCursorTo(o.row,o.column)},e.prototype.moveCursorFileEnd=function(){var i=this.doc.getLength()-1,o=this.doc.getLine(i).length;this.moveCursorTo(i,o)},e.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},e.prototype.moveCursorLongWordRight=function(){var i=this.lead.row,o=this.lead.column,h=this.doc.getLine(i),s=h.substring(o);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var p=this.session.getFoldAt(i,o,1);if(p){this.moveCursorTo(p.end.row,p.end.column);return}if(this.session.nonTokenRe.exec(s)&&(o+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,s=h.substring(o)),o>=h.length){this.moveCursorTo(i,h.length),this.moveCursorRight(),i<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(s)&&(o+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(i,o)},e.prototype.moveCursorLongWordLeft=function(){var i=this.lead.row,o=this.lead.column,h;if(h=this.session.getFoldAt(i,o,-1)){this.moveCursorTo(h.start.row,h.start.column);return}var s=this.session.getFoldStringAt(i,o,-1);s==null&&(s=this.doc.getLine(i).substring(0,o));var p=u.stringReverse(s);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(p)&&(o-=this.session.nonTokenRe.lastIndex,p=p.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),o<=0){this.moveCursorTo(i,0),this.moveCursorLeft(),i>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(p)&&(o-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(i,o)},e.prototype.$shortWordEndIndex=function(i){var o=0,h,s=/\s/,p=this.session.tokenRe;if(p.lastIndex=0,this.session.tokenRe.exec(i))o=this.session.tokenRe.lastIndex;else{for(;(h=i[o])&&s.test(h);)o++;if(o<1){for(p.lastIndex=0;(h=i[o])&&!p.test(h);)if(p.lastIndex=0,o++,s.test(h))if(o>2){o--;break}else{for(;(h=i[o])&&s.test(h);)o++;if(o>2)break}}}return p.lastIndex=0,o},e.prototype.moveCursorShortWordRight=function(){var i=this.lead.row,o=this.lead.column,h=this.doc.getLine(i),s=h.substring(o),p=this.session.getFoldAt(i,o,1);if(p)return this.moveCursorTo(p.end.row,p.end.column);if(o==h.length){var f=this.doc.getLength();do i++,s=this.doc.getLine(i);while(i<f&&/^\s*$/.test(s));/^\s+/.test(s)||(s=""),o=0}var g=this.$shortWordEndIndex(s);this.moveCursorTo(i,o+g)},e.prototype.moveCursorShortWordLeft=function(){var i=this.lead.row,o=this.lead.column,h;if(h=this.session.getFoldAt(i,o,-1))return this.moveCursorTo(h.start.row,h.start.column);var s=this.session.getLine(i).substring(0,o);if(o===0){do i--,s=this.doc.getLine(i);while(i>0&&/^\s*$/.test(s));o=s.length,/\s+$/.test(s)||(s="")}var p=u.stringReverse(s),f=this.$shortWordEndIndex(p);return this.moveCursorTo(i,o-f)},e.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},e.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},e.prototype.moveCursorBy=function(i,o){var h=this.session.documentToScreenPosition(this.lead.row,this.lead.column),s;if(o===0&&(i!==0&&(this.session.$bidiHandler.isBidiRow(h.row,this.lead.row)?(s=this.session.$bidiHandler.getPosLeft(h.column),h.column=Math.round(s/this.session.$bidiHandler.charWidths[0])):s=h.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?h.column=this.$desiredColumn:this.$desiredColumn=h.column),i!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var p=this.session.lineWidgets[this.lead.row];i<0?i-=p.rowsAbove||0:i>0&&(i+=p.rowCount-(p.rowsAbove||0))}var f=this.session.screenToDocumentPosition(h.row+i,h.column,s);i!==0&&o===0&&f.row===this.lead.row&&(f.column,this.lead.column),this.moveCursorTo(f.row,f.column+o,o===0)},e.prototype.moveCursorToPosition=function(i){this.moveCursorTo(i.row,i.column)},e.prototype.moveCursorTo=function(i,o,h){var s=this.session.getFoldAt(i,o,1);s&&(i=s.start.row,o=s.start.column),this.$keepDesiredColumnOnChange=!0;var p=this.session.getLine(i);/[\uDC00-\uDFFF]/.test(p.charAt(o))&&p.charAt(o-1)&&(this.lead.row==i&&this.lead.column==o+1?o=o-1:o=o+1),this.lead.setPosition(i,o),this.$keepDesiredColumnOnChange=!1,h||(this.$desiredColumn=null)},e.prototype.moveCursorToScreen=function(i,o,h){var s=this.session.screenToDocumentPosition(i,o);this.moveCursorTo(s.row,s.column,h)},e.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},e.prototype.fromOrientedRange=function(i){this.setSelectionRange(i,i.cursor==i.start),this.$desiredColumn=i.desiredColumn||this.$desiredColumn},e.prototype.toOrientedRange=function(i){var o=this.getRange();return i?(i.start.column=o.start.column,i.start.row=o.start.row,i.end.column=o.end.column,i.end.row=o.end.row):i=o,i.cursor=this.isBackwards()?i.start:i.end,i.desiredColumn=this.$desiredColumn,i},e.prototype.getRangeOfMovements=function(i){var o=this.getCursor();try{i(this);var h=this.getCursor();return r.fromPoints(o,h)}catch{return r.fromPoints(o,o)}finally{this.moveCursorToPosition(o)}},e.prototype.toJSON=function(){if(this.rangeCount)var i=this.ranges.map(function(o){var h=o.clone();return h.isBackwards=o.cursor==o.start,h});else{var i=this.getRange();i.isBackwards=this.isBackwards()}return i},e.prototype.fromJSON=function(i){if(i.start==null)if(this.rangeList&&i.length>1){this.toSingleRange(i[0]);for(var o=i.length;o--;){var h=r.fromPoints(i[o].start,i[o].end);i[o].isBackwards&&(h.cursor=h.start),this.addRange(h,!0)}return}else i=i[0];this.rangeList&&this.toSingleRange(i),this.setSelectionRange(i,i.isBackwards)},e.prototype.isEqual=function(i){if((i.length||this.rangeCount)&&i.length!=this.rangeCount)return!1;if(!i.length||!this.ranges)return this.getRange().isEqual(i);for(var o=this.ranges.length;o--;)if(!this.ranges[o].isEqual(i[o]))return!1;return!0},e})();c.prototype.setSelectionAnchor=c.prototype.setAnchor,c.prototype.getSelectionAnchor=c.prototype.getAnchor,c.prototype.setSelectionRange=c.prototype.setRange,a.implement(c.prototype,d),l.Selection=c}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(n,l,v){var a=n("./lib/report_error").reportError,u=2e3,d=(function(){function r(c){this.splitRegex,this.states=c,this.regExps={},this.matchMappings={};for(var e in this.states){for(var i=this.states[e],o=[],h=0,s=this.matchMappings[e]={defaultToken:"text"},p="g",f=[],g=0;g<i.length;g++){var y=i[g];if(y.defaultToken&&(s.defaultToken=y.defaultToken),y.caseInsensitive&&p.indexOf("i")===-1&&(p+="i"),y.unicode&&p.indexOf("u")===-1&&(p+="u"),y.regex!=null){y.regex instanceof RegExp&&(y.regex=y.regex.toString().slice(1,-1));var A=y.regex,E=new RegExp("(?:("+A+")|(.))").exec("a").length-2;Array.isArray(y.token)?y.token.length==1||E==1?y.token=y.token[0]:E-1!=y.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:y,groupCount:E-1}),y.token=y.token[0]):(y.tokenArray=y.token,y.token=null,y.onMatch=this.$arrayTokens):typeof y.token=="function"&&!y.onMatch&&(E>1?y.onMatch=this.$applyToken:y.onMatch=y.token),E>1&&(/\\\d/.test(y.regex)?A=y.regex.replace(/\\([0-9]+)/g,function(w,m){return"\\"+(parseInt(m,10)+h+1)}):(E=1,A=this.removeCapturingGroups(y.regex)),!y.splitRegex&&typeof y.token!="string"&&f.push(y)),s[h]=g,h+=E,o.push(A),y.onMatch||(y.onMatch=null)}}o.length||(s[0]=0,o.push("$")),f.forEach(function(w){w.splitRegex=this.createSplitterRegexp(w.regex,p)},this),this.regExps[e]=new RegExp("("+o.join(")|(")+")|($)",p)}}return r.prototype.$setMaxTokenCount=function(c){u=c|0},r.prototype.$applyToken=function(c){var e=this.splitRegex.exec(c).slice(1),i=this.token.apply(this,e);if(typeof i=="string")return[{type:i,value:c}];for(var o=[],h=0,s=i.length;h<s;h++)e[h]&&(o[o.length]={type:i[h],value:e[h]});return o},r.prototype.$arrayTokens=function(c){if(!c)return[];var e=this.splitRegex.exec(c);if(!e)return"text";for(var i=[],o=this.tokenArray,h=0,s=o.length;h<s;h++)e[h+1]&&(i[i.length]={type:o[h],value:e[h+1]});return i},r.prototype.removeCapturingGroups=function(c){var e=c.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(i,o){return o?"(?:":i});return e},r.prototype.createSplitterRegexp=function(c,e){if(c.indexOf("(?=")!=-1){var i=0,o=!1,h={};c.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(s,p,f,g,y,A){return o?o=y!="]":y?o=!0:g?(i==h.stack&&(h.end=A+1,h.stack=-1),i--):f&&(i++,f.length!=1&&(h.stack=i,h.start=A)),s}),h.end!=null&&/^\)*$/.test(c.substr(h.end))&&(c=c.substring(0,h.start)+c.substr(h.end))}return c.charAt(0)!="^"&&(c="^"+c),c.charAt(c.length-1)!="$"&&(c+="$"),new RegExp(c,(e||"").replace("g",""))},r.prototype.getLineTokens=function(c,e){if(e&&typeof e!="string"){var i=e.slice(0);e=i[0],e==="#tmp"&&(i.shift(),e=i.shift())}else var i=[];var o=e||"start",h=this.states[o];h||(o="start",h=this.states[o]);var s=this.matchMappings[o],p=this.regExps[o];p.lastIndex=0;for(var f,g=[],y=0,A=0,E={type:null,value:""};f=p.exec(c);){var w=s.defaultToken,m=null,S=f[0],M=p.lastIndex;if(M-S.length>y){var D=c.substring(y,M-S.length);E.type==w?E.value+=D:(E.type&&g.push(E),E={type:w,value:D})}for(var _=0;_<f.length-2;_++)if(f[_+1]!==void 0){m=h[s[_]],m.onMatch?w=m.onMatch(S,o,i,c):w=m.token,m.next&&(typeof m.next=="string"?o=m.next:o=m.next(o,i),h=this.states[o],h||(this.reportError("state doesn't exist",o),o="start",h=this.states[o]),s=this.matchMappings[o],y=M,p=this.regExps[o],p.lastIndex=M),m.consumeLineEnd&&(y=M);break}if(S){if(typeof w=="string")(!m||m.merge!==!1)&&E.type===w?E.value+=S:(E.type&&g.push(E),E={type:w,value:S});else if(w){E.type&&g.push(E),E={type:null,value:""};for(var _=0;_<w.length;_++)g.push(w[_])}}if(y==c.length)break;if(y=M,A++>u){for(A>2*c.length&&this.reportError("infinite loop with in ace tokenizer",{startState:e,line:c});y<c.length;)E.type&&g.push(E),E={value:c.substring(y,y+=500),type:"overflow"};o="start",i=[];break}}return E.type&&g.push(E),i.length>1&&i[0]!==o&&i.unshift("#tmp",o),{tokens:g,state:i.length?i:o}},r})();d.prototype.reportError=a,l.Tokenizer=d}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(n,l,v){var a=n("../lib/deep_copy").deepCopy,u;u=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(c,e){if(!e){for(var i in c)this.$rules[i]=c[i];return}for(var i in c){for(var o=c[i],h=0;h<o.length;h++){var s=o[h];(s.next||s.onMatch)&&(typeof s.next=="string"&&s.next.indexOf(e)!==0&&(s.next=e+s.next),s.nextState&&s.nextState.indexOf(e)!==0&&(s.nextState=e+s.nextState))}this.$rules[e+i]=o}},this.getRules=function(){return this.$rules},this.embedRules=function(c,e,i,o,h){var s=typeof c=="function"?new c().getRules():c;if(o)for(var p=0;p<o.length;p++)o[p]=e+o[p];else{o=[];for(var f in s)o.push(e+f)}if(this.addRules(s,e),i)for(var g=Array.prototype[h?"push":"unshift"],p=0;p<o.length;p++)g.apply(this.$rules[o[p]],a(i));this.$embeds||(this.$embeds=[]),this.$embeds.push(e)},this.getEmbeds=function(){return this.$embeds};var d=function(c,e){return(c!="start"||e.length)&&e.unshift(this.nextState,c),this.nextState},r=function(c,e){return e.shift(),e.shift()||"start"};this.normalizeRules=function(){var c=0,e=this.$rules;function i(o){var h=e[o];h.processed=!0;for(var s=0;s<h.length;s++){var p=h[s],f=null;Array.isArray(p)&&(f=p,p={}),!p.regex&&p.start&&(p.regex=p.start,p.next||(p.next=[]),p.next.push({defaultToken:p.token},{token:p.token+".end",regex:p.end||p.start,next:"pop"}),p.token=p.token+".start",p.push=!0);var g=p.next||p.push;if(g&&Array.isArray(g)){var y=p.stateName;y||(y=p.token,typeof y!="string"&&(y=y[0]||""),e[y]&&(y+=c++)),e[y]=g,p.next=y,i(y)}else g=="pop"&&(p.next=r);if(p.push&&(p.nextState=p.next||p.push,p.next=d,delete p.push),p.rules)for(var A in p.rules)e[A]?e[A].push&&e[A].push.apply(e[A],p.rules[A]):e[A]=p.rules[A];var E=typeof p=="string"?p:p.include;if(E&&(E==="$self"&&(E="start"),Array.isArray(E)?f=E.map(function(m){return e[m]}):f=e[E]),f){var w=[s,1].concat(f);p.noEscape&&(w=w.filter(function(m){return!m.next})),h.splice.apply(h,w),s--}p.keywordMap&&(p.token=this.createKeywordMapper(p.keywordMap,p.defaultToken||"text",p.caseInsensitive),delete p.defaultToken)}}Object.keys(e).forEach(i,this)},this.createKeywordMapper=function(c,e,i,o){var h=Object.create(null);return this.$keywordList=[],Object.keys(c).forEach(function(s){for(var p=c[s],f=p.split(o||"|"),g=f.length;g--;){var y=f[g];this.$keywordList.push(y),i&&(y=y.toLowerCase()),h[y]=s}},this),c=null,i?function(s){return h[s.toLowerCase()]||e}:function(s){return h[s]||e}},this.getKeywords=function(){return this.$keywords}}).call(u.prototype),l.TextHighlightRules=u}),ace.define("ace/mode/behaviour",["require","exports","module"],function(n,l,v){var a;a=function(){this.$behaviours={}},(function(){this.add=function(u,d,r){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[u]:this.$behaviours[u]={}}this.$behaviours[u][d]=r},this.addBehaviours=function(u){for(var d in u)for(var r in u[d])this.add(d,r,u[d][r])},this.remove=function(u){this.$behaviours&&this.$behaviours[u]&&delete this.$behaviours[u]},this.inherit=function(u,d){if(typeof u=="function")var r=new u().getBehaviours(d);else var r=u.getBehaviours(d);this.addBehaviours(r)},this.getBehaviours=function(u){if(u){for(var d={},r=0;r<u.length;r++)this.$behaviours[u[r]]&&(d[u[r]]=this.$behaviours[u[r]]);return d}else return this.$behaviours}}).call(a.prototype),l.Behaviour=a}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(n,l,v){var a=n("./range").Range,u=(function(){function d(r,c,e){this.$session=r,this.$row=c,this.$rowTokens=r.getTokens(c);var i=r.getTokenAt(c,e);this.$tokenIndex=i?i.index:-1}return d.prototype.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},d.prototype.stepForward=function(){this.$tokenIndex+=1;for(var r;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,r||(r=this.$session.getLength()),this.$row>=r)return this.$row=r-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},d.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},d.prototype.getCurrentTokenRow=function(){return this.$row},d.prototype.getCurrentTokenColumn=function(){var r=this.$rowTokens,c=this.$tokenIndex,e=r[c].start;if(e!==void 0)return e;for(e=0;c>0;)c-=1,e+=r[c].value.length;return e},d.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},d.prototype.getCurrentTokenRange=function(){var r=this.$rowTokens[this.$tokenIndex],c=this.getCurrentTokenColumn();return new a(this.$row,c,this.$row,c+r.value.length)},d})();l.TokenIterator=u}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(n,l,v){var a=n("../../lib/oop"),u=n("../behaviour").Behaviour,d=n("../../token_iterator").TokenIterator,r=n("../../lib/lang"),c=["text","paren.rparen","rparen","paren","punctuation.operator"],e=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],i,o={},h={'"':'"',"'":"'"},s=function(g){var y=-1;if(g.multiSelect&&(y=g.selection.index,o.rangeCount!=g.multiSelect.rangeCount&&(o={rangeCount:g.multiSelect.rangeCount})),o[y])return i=o[y];i=o[y]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(g,y,A,E){var w=g.end.row-g.start.row;return{text:A+y+E,selection:[0,g.start.column+1,w,g.end.column+(w?0:1)]}},f;f=function(g){g=g||{},this.add("braces","insertion",function(y,A,E,w,m){var S=E.getCursorPosition(),M=w.doc.getLine(S.row);if(m=="{"){s(E);var D=E.getSelectionRange(),_=w.doc.getTextRange(D),F=w.getTokenAt(S.row,S.column);if(_!==""&&_!=="{"&&E.getWrapBehavioursEnabled())return p(D,_,"{","}");if(F&&/(?:string)\.quasi|\.xml/.test(F.type)){var x=[/tag\-(?:open|name)/,/attribute\-name/];return x.some(function(N){return N.test(F.type)})||/(string)\.quasi/.test(F.type)&&F.value[S.column-F.start-1]!=="$"?void 0:(f.recordAutoInsert(E,w,"}"),{text:"{}",selection:[1,1]})}else if(f.isSaneInsertion(E,w))return/[\]\}\)]/.test(M[S.column])||E.inMultiSelectMode||g.braces?(f.recordAutoInsert(E,w,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert(E,w,"{"),{text:"{",selection:[1,1]})}else if(m=="}"){s(E);var $=M.substring(S.column,S.column+1);if($=="}"){var C=w.$findOpeningBracket("}",{column:S.column+1,row:S.row});if(C!==null&&f.isAutoInsertedClosing(S,M,m))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(m==`
188
+ `||m==`\r
189
+ `){s(E);var b="";f.isMaybeInsertedClosing(S,M)&&(b=r.stringRepeat("}",i.maybeInsertedBrackets),f.clearMaybeInsertedClosing());var $=M.substring(S.column,S.column+1);if($==="}"){var T=w.findMatchingBracket({row:S.row,column:S.column+1},"}");if(!T)return null;var I=this.$getIndent(w.getLine(T.row))}else if(b)var I=this.$getIndent(M);else{f.clearMaybeInsertedClosing();return}var O=I+w.getTabString();return{text:`
190
+ `+O+`
191
+ `+I+b,selection:[1,O.length,1,O.length]}}else f.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(y,A,E,w,m){var S=w.doc.getTextRange(m);if(!m.isMultiLine()&&S=="{"){s(E);var M=w.doc.getLine(m.start.row),D=M.substring(m.end.column,m.end.column+1);if(D=="}")return m.end.column++,m;i.maybeInsertedBrackets--}}),this.add("parens","insertion",function(y,A,E,w,m){if(m=="("){s(E);var S=E.getSelectionRange(),M=w.doc.getTextRange(S);if(M!==""&&E.getWrapBehavioursEnabled())return p(S,M,"(",")");if(f.isSaneInsertion(E,w))return f.recordAutoInsert(E,w,")"),{text:"()",selection:[1,1]}}else if(m==")"){s(E);var D=E.getCursorPosition(),_=w.doc.getLine(D.row),F=_.substring(D.column,D.column+1);if(F==")"){var x=w.$findOpeningBracket(")",{column:D.column+1,row:D.row});if(x!==null&&f.isAutoInsertedClosing(D,_,m))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(y,A,E,w,m){var S=w.doc.getTextRange(m);if(!m.isMultiLine()&&S=="("){s(E);var M=w.doc.getLine(m.start.row),D=M.substring(m.start.column+1,m.start.column+2);if(D==")")return m.end.column++,m}}),this.add("brackets","insertion",function(y,A,E,w,m){if(m=="["){s(E);var S=E.getSelectionRange(),M=w.doc.getTextRange(S);if(M!==""&&E.getWrapBehavioursEnabled())return p(S,M,"[","]");if(f.isSaneInsertion(E,w))return f.recordAutoInsert(E,w,"]"),{text:"[]",selection:[1,1]}}else if(m=="]"){s(E);var D=E.getCursorPosition(),_=w.doc.getLine(D.row),F=_.substring(D.column,D.column+1);if(F=="]"){var x=w.$findOpeningBracket("]",{column:D.column+1,row:D.row});if(x!==null&&f.isAutoInsertedClosing(D,_,m))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(y,A,E,w,m){var S=w.doc.getTextRange(m);if(!m.isMultiLine()&&S=="["){s(E);var M=w.doc.getLine(m.start.row),D=M.substring(m.start.column+1,m.start.column+2);if(D=="]")return m.end.column++,m}}),this.add("string_dquotes","insertion",function(y,A,E,w,m){var S=w.$mode.$quotes||h;if(m.length==1&&S[m]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(m)!=-1)return;s(E);var M=m,D=E.getSelectionRange(),_=w.doc.getTextRange(D);if(_!==""&&(_.length!=1||!S[_])&&E.getWrapBehavioursEnabled())return p(D,_,M,M);if(!_){var F=E.getCursorPosition(),x=w.doc.getLine(F.row),$=x.substring(F.column-1,F.column),C=x.substring(F.column,F.column+1),b=w.getTokenAt(F.row,F.column),T=w.getTokenAt(F.row,F.column+1);if($=="\\"&&b&&/escape/.test(b.type))return null;var I=b&&/string|escape/.test(b.type),O=!T||/string|escape/.test(T.type),N;if(C==M)N=I!==O,N&&/string\.end/.test(T.type)&&(N=!1);else{if(I&&!O||I&&O)return null;var P=w.$mode.tokenRe;P.lastIndex=0;var B=P.test($);P.lastIndex=0;var V=P.test(C),W=w.$mode.$pairQuotesAfter,z=W&&W[M]&&W[M].test($);if(!z&&B||V||C&&!/[\s;,.})\]\\]/.test(C))return null;var U=x[F.column-2];if($==M&&(U==M||P.test(U)))return null;N=!0}return{text:N?M+M:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(y,A,E,w,m){var S=w.$mode.$quotes||h,M=w.doc.getTextRange(m);if(!m.isMultiLine()&&S.hasOwnProperty(M)){s(E);var D=w.doc.getLine(m.start.row),_=D.substring(m.start.column+1,m.start.column+2);if(_==M)return m.end.column++,m}}),g.closeDocComment!==!1&&this.add("doc comment end","insertion",function(y,A,E,w,m){if(y==="doc-start"&&(m===`
192
+ `||m===`\r
193
+ `)&&E.selection.isEmpty()){var S=E.getCursorPosition();if(S.column===0)return;for(var M=w.doc.getLine(S.row),D=w.doc.getLine(S.row+1),_=w.getTokens(S.row),F=0,x=0;x<_.length;x++){F+=_[x].value.length;var $=_[x];if(F>=S.column){if(F===S.column){if(!/\.doc/.test($.type))return;if(/\*\//.test($.value)){var C=_[x+1];if(!C||!/\.doc/.test(C.type))return}}var b=S.column-(F-$.value.length),T=$.value.indexOf("*/"),I=$.value.indexOf("/**",T>-1?T+2:0);if(I!==-1&&b>I&&b<I+3||T!==-1&&I!==-1&&b>=T&&b<=I||!/\.doc/.test($.type))return;break}}var O=this.$getIndent(M);if(/\s*\*/.test(D))return/^\s*\*/.test(M)?{text:m+O+"* ",selection:[1,2+O.length,1,2+O.length]}:{text:m+O+" * ",selection:[1,3+O.length,1,3+O.length]};if(/\/\*\*/.test(M.substring(0,S.column)))return{text:m+O+" * "+m+" "+O+"*/",selection:[1,4+O.length,1,4+O.length]}}})},f.isSaneInsertion=function(g,y){var A=g.getCursorPosition(),E=new d(y,A.row,A.column);if(!this.$matchTokenType(E.getCurrentToken()||"text",c)){if(/[)}\]]/.test(g.session.getLine(A.row)[A.column]))return!0;var w=new d(y,A.row,A.column+1);if(!this.$matchTokenType(w.getCurrentToken()||"text",c))return!1}return E.stepForward(),E.getCurrentTokenRow()!==A.row||this.$matchTokenType(E.getCurrentToken()||"text",e)},f.$matchTokenType=function(g,y){return y.indexOf(g.type||g)>-1},f.recordAutoInsert=function(g,y,A){var E=g.getCursorPosition(),w=y.doc.getLine(E.row);this.isAutoInsertedClosing(E,w,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=E.row,i.autoInsertedLineEnd=A+w.substr(E.column),i.autoInsertedBrackets++},f.recordMaybeInsert=function(g,y,A){var E=g.getCursorPosition(),w=y.doc.getLine(E.row);this.isMaybeInsertedClosing(E,w)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=E.row,i.maybeInsertedLineStart=w.substr(0,E.column)+A,i.maybeInsertedLineEnd=w.substr(E.column),i.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(g,y,A){return i.autoInsertedBrackets>0&&g.row===i.autoInsertedRow&&A===i.autoInsertedLineEnd[0]&&y.substr(g.column)===i.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(g,y){return i.maybeInsertedBrackets>0&&g.row===i.maybeInsertedRow&&y.substr(g.column)===i.maybeInsertedLineEnd&&y.substr(0,g.column)==i.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},a.inherits(f,u),l.CstyleBehaviour=f}),ace.define("ace/unicode",["require","exports","module"],function(n,l,v){for(var a=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],u=0,d=[],r=0;r<a.length;r+=2)d.push(u+=a[r]),a[r+1]&&d.push(45,u+=a[r+1]);l.wordChars=String.fromCharCode.apply(null,d)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(n,l,v){var a=n("../config"),u=n("../tokenizer").Tokenizer,d=n("./text_highlight_rules").TextHighlightRules,r=n("./behaviour/cstyle").CstyleBehaviour,c=n("../unicode"),e=n("../lib/lang"),i=n("../token_iterator").TokenIterator,o=n("../range").Range,h;h=function(){this.HighlightRules=d},(function(){this.$defaultBehaviour=new r,this.tokenRe=new RegExp("^["+c.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+c.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new u(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(s,p,f,g){var y=p.doc,A=!0,E=!0,w=1/0,m=p.getTabSize(),S=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var _=this.lineCommentStart.map(e.escapeRegExp).join("|"),M=this.lineCommentStart[0];else var _=e.escapeRegExp(this.lineCommentStart),M=this.lineCommentStart;_=new RegExp("^(\\s*)(?:"+_+") ?"),S=p.getUseSoftTabs();var $=function(V,W){var z=V.match(_);if(z){var U=z[1].length,G=z[0].length;!T(V,U,G)&&z[0][G-1]==" "&&G--,y.removeInLine(W,U,G)}},b=M+" ",x=function(V,W){(!A||/\S/.test(V))&&(T(V,w,w)?y.insertInLine({row:W,column:w},b):y.insertInLine({row:W,column:w},M))},C=function(V,W){return _.test(V)},T=function(V,W,z){for(var U=0;W--&&V.charAt(W)==" ";)U++;if(U%m!=0)return!1;for(var U=0;V.charAt(z++)==" ";)U++;return m>2?U%m!=m-1:U%m==0}}else{if(!this.blockComment)return!1;var M=this.blockComment.start,D=this.blockComment.end,_=new RegExp("^(\\s*)(?:"+e.escapeRegExp(M)+")"),F=new RegExp("(?:"+e.escapeRegExp(D)+")\\s*$"),x=function(N,P){C(N,P)||(!A||/\S/.test(N))&&(y.insertInLine({row:P,column:N.length},D),y.insertInLine({row:P,column:w},M))},$=function(N,P){var B;(B=N.match(F))&&y.removeInLine(P,N.length-B[0].length,N.length),(B=N.match(_))&&y.removeInLine(P,B[1].length,B[0].length)},C=function(N,P){if(_.test(N))return!0;for(var B=p.getTokens(P),V=0;V<B.length;V++)if(B[V].type==="comment")return!0}}function I(N){for(var P=f;P<=g;P++)N(y.getLine(P),P)}var O=1/0;I(function(N,P){var B=N.search(/\S/);B!==-1?(B<w&&(w=B),E&&!C(N,P)&&(E=!1)):O>N.length&&(O=N.length)}),w==1/0&&(w=O,A=!1,E=!1),S&&w%m!=0&&(w=Math.floor(w/m)*m),I(E?$:x)},this.toggleBlockComment=function(s,p,f,g){var y=this.blockComment;if(y){!y.start&&y[0]&&(y=y[0]);var A=new i(p,g.row,g.column),E=A.getCurrentToken();p.selection;var w=p.selection.toOrientedRange(),m,S;if(E&&/comment/.test(E.type)){for(var M,D;E&&/comment/.test(E.type);){var _=E.value.indexOf(y.start);if(_!=-1){var F=A.getCurrentTokenRow(),x=A.getCurrentTokenColumn()+_;M=new o(F,x,F,x+y.start.length);break}E=A.stepBackward()}for(var A=new i(p,g.row,g.column),E=A.getCurrentToken();E&&/comment/.test(E.type);){var _=E.value.indexOf(y.end);if(_!=-1){var F=A.getCurrentTokenRow(),x=A.getCurrentTokenColumn()+_;D=new o(F,x,F,x+y.end.length);break}E=A.stepForward()}D&&p.remove(D),M&&(p.remove(M),m=M.start.row,S=-y.start.length)}else S=y.start.length,m=f.start.row,p.insert(f.end,y.end),p.insert(f.start,y.start);w.start.row==m&&(w.start.column+=S),w.end.row==m&&(w.end.column+=S),p.selection.fromOrientedRange(w)}},this.getNextLineIndent=function(s,p,f){return this.$getIndent(p)},this.checkOutdent=function(s,p,f){return!1},this.autoOutdent=function(s,p,f){},this.$getIndent=function(s){return s.match(/^\s*/)[0]},this.createWorker=function(s){return null},this.createModeDelegates=function(s){this.$embeds=[],this.$modes={};for(var p in s)if(s[p]){var f=s[p],g=f.prototype.$id,y=a.$modes[g];y||(a.$modes[g]=y=new f),a.$modes[p]||(a.$modes[p]=y),this.$embeds.push(p),this.$modes[p]=y}for(var A=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],E=function(m){(function(S){var M=A[m],D=S[M];S[A[m]]=function(){return this.$delegator(M,arguments,D)}})(w)},w=this,p=0;p<A.length;p++)E(p)},this.$delegator=function(s,p,f){var g=p[0]||"start";if(typeof g!="string"){if(Array.isArray(g[2])){var y=g[2][g[2].length-1],A=this.$modes[y];if(A)return A[s].apply(A,[g[1]].concat([].slice.call(p,1)))}g=g[0]||"start"}for(var E=0;E<this.$embeds.length;E++)if(this.$modes[this.$embeds[E]]){var w=g.split(this.$embeds[E]);if(!w[0]&&w[1]){p[0]=w[1];var A=this.$modes[this.$embeds[E]];return A[s].apply(A,p)}}var m=f.apply(this,p);return f?m:void 0},this.transformAction=function(s,p,f,g,y){if(this.$behaviour){var A=this.$behaviour.getBehaviours();for(var E in A)if(A[E][p]){var w=A[E][p].apply(this,arguments);if(w)return w}}},this.getKeywords=function(s){if(!this.completionKeywords){var p=this.$tokenizer.rules,f=[];for(var g in p)for(var y=p[g],A=0,E=y.length;A<E;A++)if(typeof y[A].token=="string")/keyword|support|storage/.test(y[A].token)&&f.push(y[A].regex);else if(typeof y[A].token=="object"){for(var w=0,m=y[A].token.length;w<m;w++)if(/keyword|support|storage/.test(y[A].token[w])){var g=y[A].regex.match(/\(.+?\)/g)[w];f.push(g.substr(1,g.length-2))}}this.completionKeywords=f}return s?f.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(s,p,f,g){var y=this.$keywordList||this.$createKeywordList();return y.map(function(A){return{name:A,value:A,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(h.prototype),l.Mode=h}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(n,l,v){var a=n("./lib/dom"),u=(function(){function d(r){this.session=r,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return d.prototype.getRowLength=function(r){var c;return this.lineWidgets?c=this.lineWidgets[r]&&this.lineWidgets[r].rowCount||0:c=0,!this.$useWrapMode||!this.$wrapData[r]?1+c:this.$wrapData[r].length+1+c},d.prototype.$getWidgetScreenLength=function(){var r=0;return this.lineWidgets.forEach(function(c){c&&c.rowCount&&!c.hidden&&(r+=c.rowCount)}),r},d.prototype.$onChangeEditor=function(r){this.attach(r.editor)},d.prototype.attach=function(r){r&&r.widgetManager&&r.widgetManager!=this&&r.widgetManager.detach(),this.editor!=r&&(this.detach(),this.editor=r,r&&(r.widgetManager=this,r.renderer.on("beforeRender",this.measureWidgets),r.renderer.on("afterRender",this.renderWidgets)))},d.prototype.detach=function(r){var c=this.editor;if(c){this.editor=null,c.widgetManager=null,c.renderer.off("beforeRender",this.measureWidgets),c.renderer.off("afterRender",this.renderWidgets);var e=this.session.lineWidgets;e&&e.forEach(function(i){i&&i.el&&i.el.parentNode&&(i._inDocument=!1,i.el.parentNode.removeChild(i.el))})}},d.prototype.updateOnFold=function(r,c){var e=c.lineWidgets;if(!(!e||!r.action)){for(var i=r.data,o=i.start.row,h=i.end.row,s=r.action=="add",p=o+1;p<h;p++)e[p]&&(e[p].hidden=s);e[h]&&(s?e[o]?e[h].hidden=s:e[o]=e[h]:(e[o]==e[h]&&(e[o]=void 0),e[h].hidden=s))}},d.prototype.updateOnChange=function(r){var c=this.session.lineWidgets;if(c){var e=r.start.row,i=r.end.row-e;if(i!==0)if(r.action=="remove"){var o=c.splice(e+1,i);!c[e]&&o[o.length-1]&&(c[e]=o.pop()),o.forEach(function(s){s&&this.removeLineWidget(s)},this),this.$updateRows()}else{var h=new Array(i);c[e]&&c[e].column!=null&&r.start.column>c[e].column&&e++,h.unshift(e,0),c.splice.apply(c,h),this.$updateRows()}}},d.prototype.$updateRows=function(){var r=this.session.lineWidgets;if(r){var c=!0;r.forEach(function(e,i){if(e)for(c=!1,e.row=i;e.$oldWidget;)e.$oldWidget.row=i,e=e.$oldWidget}),c&&(this.session.lineWidgets=null)}},d.prototype.$registerLineWidget=function(r){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var c=this.session.lineWidgets[r.row];return c&&(r.$oldWidget=c,c.el&&c.el.parentNode&&(c.el.parentNode.removeChild(c.el),c._inDocument=!1)),this.session.lineWidgets[r.row]=r,r},d.prototype.addLineWidget=function(r){if(this.$registerLineWidget(r),r.session=this.session,!this.editor)return r;var c=this.editor.renderer;r.html&&!r.el&&(r.el=a.createElement("div"),r.el.innerHTML=r.html),r.text&&!r.el&&(r.el=a.createElement("div"),r.el.textContent=r.text),r.el&&(a.addCssClass(r.el,"ace_lineWidgetContainer"),r.className&&a.addCssClass(r.el,r.className),r.el.style.position="absolute",r.el.style.zIndex="5",c.container.appendChild(r.el),r._inDocument=!0,r.coverGutter||(r.el.style.zIndex="3"),r.pixelHeight==null&&(r.pixelHeight=r.el.offsetHeight)),r.rowCount==null&&(r.rowCount=r.pixelHeight/c.layerConfig.lineHeight);var e=this.session.getFoldAt(r.row,0);if(r.$fold=e,e){var i=this.session.lineWidgets;r.row==e.end.row&&!i[e.start.row]?i[e.start.row]=r:r.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:r.row}}}),this.$updateRows(),this.renderWidgets(null,c),this.onWidgetChanged(r),r},d.prototype.removeLineWidget=function(r){if(r._inDocument=!1,r.session=null,r.el&&r.el.parentNode&&r.el.parentNode.removeChild(r.el),r.editor&&r.editor.destroy)try{r.editor.destroy()}catch{}if(this.session.lineWidgets){var c=this.session.lineWidgets[r.row];if(c==r)this.session.lineWidgets[r.row]=r.$oldWidget,r.$oldWidget&&this.onWidgetChanged(r.$oldWidget);else for(;c;){if(c.$oldWidget==r){c.$oldWidget=r.$oldWidget;break}c=c.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:r.row}}}),this.$updateRows()},d.prototype.getWidgetsAtRow=function(r){for(var c=this.session.lineWidgets,e=c&&c[r],i=[];e;)i.push(e),e=e.$oldWidget;return i},d.prototype.onWidgetChanged=function(r){this.session._changedWidgets.push(r),this.editor&&this.editor.renderer.updateFull()},d.prototype.measureWidgets=function(r,c){var e=this.session._changedWidgets,i=c.layerConfig;if(!(!e||!e.length)){for(var o=1/0,h=0;h<e.length;h++){var s=e[h];if(!(!s||!s.el)&&s.session==this.session){if(!s._inDocument){if(this.session.lineWidgets[s.row]!=s)continue;s._inDocument=!0,c.container.appendChild(s.el)}s.h=s.el.offsetHeight,s.fixedWidth||(s.w=s.el.offsetWidth,s.screenWidth=Math.ceil(s.w/i.characterWidth));var p=s.h/i.lineHeight;s.coverLine&&(p-=this.session.getRowLineCount(s.row),p<0&&(p=0)),s.rowCount!=p&&(s.rowCount=p,s.row<o&&(o=s.row))}}o!=1/0&&(this.session._emit("changeFold",{data:{start:{row:o}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},d.prototype.renderWidgets=function(r,c){var e=c.layerConfig,i=this.session.lineWidgets;if(i){for(var o=Math.min(this.firstRow,e.firstRow),h=Math.max(this.lastRow,e.lastRow,i.length);o>0&&!i[o];)o--;this.firstRow=e.firstRow,this.lastRow=e.lastRow,c.$cursorLayer.config=e;for(var s=o;s<=h;s++){var p=i[s];if(!(!p||!p.el)){if(p.hidden){p.el.style.top=-100-(p.pixelHeight||0)+"px";continue}p._inDocument||(p._inDocument=!0,c.container.appendChild(p.el));var f=c.$cursorLayer.getPixelPosition({row:s,column:0},!0).top;p.coverLine||(f+=e.lineHeight*this.session.getRowLineCount(p.row)),p.el.style.top=f-e.offset+"px";var g=p.coverGutter?0:c.gutterWidth;p.fixedWidth||(g-=c.scrollLeft),p.el.style.left=g+"px",p.fullWidth&&p.screenWidth&&(p.el.style.minWidth=e.width+2*e.padding+"px"),p.fixedWidth?p.el.style.right=c.scrollBar.getWidth()+"px":p.el.style.right=""}}}},d})();l.LineWidgets=u}),ace.define("ace/apply_delta",["require","exports","module"],function(n,l,v){l.applyDelta=function(a,u,d){var r=u.start.row,c=u.start.column,e=a[r]||"";switch(u.action){case"insert":var i=u.lines;if(i.length===1)a[r]=e.substring(0,c)+u.lines[0]+e.substring(c);else{var o=[r,1].concat(u.lines);a.splice.apply(a,o),a[r]=e.substring(0,c)+a[r],a[r+u.lines.length-1]+=e.substring(c)}break;case"remove":var h=u.end.column,s=u.end.row;r===s?a[r]=e.substring(0,c)+e.substring(h):a.splice(r,s-r+1,e.substring(0,c)+a[s].substring(h));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(n,l,v){var a=n("./lib/oop"),u=n("./lib/event_emitter").EventEmitter,d=(function(){function e(i,o,h){this.$onChange=this.onChange.bind(this),this.attach(i),typeof o!="number"?this.setPosition(o.row,o.column):this.setPosition(o,h)}return e.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},e.prototype.getDocument=function(){return this.document},e.prototype.onChange=function(i){if(!(i.start.row==i.end.row&&i.start.row!=this.row)&&!(i.start.row>this.row)){var o=c(i,{row:this.row,column:this.column},this.$insertRight);this.setPosition(o.row,o.column,!0)}},e.prototype.setPosition=function(i,o,h){var s;if(h?s={row:i,column:o}:s=this.$clipPositionToDocument(i,o),!(this.row==s.row&&this.column==s.column)){var p={row:this.row,column:this.column};this.row=s.row,this.column=s.column,this._signal("change",{old:p,value:s})}},e.prototype.detach=function(){this.document.off("change",this.$onChange)},e.prototype.attach=function(i){this.document=i||this.document,this.document.on("change",this.$onChange)},e.prototype.$clipPositionToDocument=function(i,o){var h={};return i>=this.document.getLength()?(h.row=Math.max(0,this.document.getLength()-1),h.column=this.document.getLine(h.row).length):i<0?(h.row=0,h.column=0):(h.row=i,h.column=Math.min(this.document.getLine(h.row).length,Math.max(0,o))),o<0&&(h.column=0),h},e})();d.prototype.$insertRight=!1,a.implement(d.prototype,u);function r(e,i,o){var h=o?e.column<=i.column:e.column<i.column;return e.row<i.row||e.row==i.row&&h}function c(e,i,o){var h=e.action=="insert",s=(h?1:-1)*(e.end.row-e.start.row),p=(h?1:-1)*(e.end.column-e.start.column),f=e.start,g=h?f:e.end;return r(i,f,o)?{row:i.row,column:i.column}:r(g,i,!o)?{row:i.row+s,column:i.column+(i.row==g.row?p:0)}:{row:f.row,column:f.column}}l.Anchor=d}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(n,l,v){var a=n("./lib/oop"),u=n("./apply_delta").applyDelta,d=n("./lib/event_emitter").EventEmitter,r=n("./range").Range,c=n("./anchor").Anchor,e=(function(){function i(o){this.$lines=[""],o.length===0?this.$lines=[""]:Array.isArray(o)?this.insertMergedLines({row:0,column:0},o):this.insert({row:0,column:0},o)}return i.prototype.setValue=function(o){var h=this.getLength()-1;this.remove(new r(0,0,h,this.getLine(h).length)),this.insert({row:0,column:0},o||"")},i.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},i.prototype.createAnchor=function(o,h){return new c(this,o,h)},i.prototype.$detectNewLine=function(o){var h=o.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=h?h[1]:`
194
+ `,this._signal("changeNewLineMode")},i.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
195
+ `;case"unix":return`
196
+ `;default:return this.$autoNewLine||`
197
+ `}},i.prototype.setNewLineMode=function(o){this.$newLineMode!==o&&(this.$newLineMode=o,this._signal("changeNewLineMode"))},i.prototype.getNewLineMode=function(){return this.$newLineMode},i.prototype.isNewLine=function(o){return o==`\r
198
+ `||o=="\r"||o==`
199
+ `},i.prototype.getLine=function(o){return this.$lines[o]||""},i.prototype.getLines=function(o,h){return this.$lines.slice(o,h+1)},i.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},i.prototype.getLength=function(){return this.$lines.length},i.prototype.getTextRange=function(o){return this.getLinesForRange(o).join(this.getNewLineCharacter())},i.prototype.getLinesForRange=function(o){var h;if(o.start.row===o.end.row)h=[this.getLine(o.start.row).substring(o.start.column,o.end.column)];else{h=this.getLines(o.start.row,o.end.row),h[0]=(h[0]||"").substring(o.start.column);var s=h.length-1;o.end.row-o.start.row==s&&(h[s]=h[s].substring(0,o.end.column))}return h},i.prototype.insertLines=function(o,h){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(o,h)},i.prototype.removeLines=function(o,h){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(o,h)},i.prototype.insertNewLine=function(o){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(o,["",""])},i.prototype.insert=function(o,h){return this.getLength()<=1&&this.$detectNewLine(h),this.insertMergedLines(o,this.$split(h))},i.prototype.insertInLine=function(o,h){var s=this.clippedPos(o.row,o.column),p=this.pos(o.row,o.column+h.length);return this.applyDelta({start:s,end:p,action:"insert",lines:[h]},!0),this.clonePos(p)},i.prototype.clippedPos=function(o,h){var s=this.getLength();o===void 0?o=s:o<0?o=0:o>=s&&(o=s-1,h=void 0);var p=this.getLine(o);return h==null&&(h=p.length),h=Math.min(Math.max(h,0),p.length),{row:o,column:h}},i.prototype.clonePos=function(o){return{row:o.row,column:o.column}},i.prototype.pos=function(o,h){return{row:o,column:h}},i.prototype.$clipPosition=function(o){var h=this.getLength();return o.row>=h?(o.row=Math.max(0,h-1),o.column=this.getLine(h-1).length):(o.row=Math.max(0,o.row),o.column=Math.min(Math.max(o.column,0),this.getLine(o.row).length)),o},i.prototype.insertFullLines=function(o,h){o=Math.min(Math.max(o,0),this.getLength());var s=0;o<this.getLength()?(h=h.concat([""]),s=0):(h=[""].concat(h),o--,s=this.$lines[o].length),this.insertMergedLines({row:o,column:s},h)},i.prototype.insertMergedLines=function(o,h){var s=this.clippedPos(o.row,o.column),p={row:s.row+h.length-1,column:(h.length==1?s.column:0)+h[h.length-1].length};return this.applyDelta({start:s,end:p,action:"insert",lines:h}),this.clonePos(p)},i.prototype.remove=function(o){var h=this.clippedPos(o.start.row,o.start.column),s=this.clippedPos(o.end.row,o.end.column);return this.applyDelta({start:h,end:s,action:"remove",lines:this.getLinesForRange({start:h,end:s})}),this.clonePos(h)},i.prototype.removeInLine=function(o,h,s){var p=this.clippedPos(o,h),f=this.clippedPos(o,s);return this.applyDelta({start:p,end:f,action:"remove",lines:this.getLinesForRange({start:p,end:f})},!0),this.clonePos(p)},i.prototype.removeFullLines=function(o,h){o=Math.min(Math.max(0,o),this.getLength()-1),h=Math.min(Math.max(0,h),this.getLength()-1);var s=h==this.getLength()-1&&o>0,p=h<this.getLength()-1,f=s?o-1:o,g=s?this.getLine(f).length:0,y=p?h+1:h,A=p?0:this.getLine(y).length,E=new r(f,g,y,A),w=this.$lines.slice(o,h+1);return this.applyDelta({start:E.start,end:E.end,action:"remove",lines:this.getLinesForRange(E)}),w},i.prototype.removeNewLine=function(o){o<this.getLength()-1&&o>=0&&this.applyDelta({start:this.pos(o,this.getLine(o).length),end:this.pos(o+1,0),action:"remove",lines:["",""]})},i.prototype.replace=function(o,h){if(o instanceof r||(o=r.fromPoints(o.start,o.end)),h.length===0&&o.isEmpty())return o.start;if(h==this.getTextRange(o))return o.end;this.remove(o);var s;return h?s=this.insert(o.start,h):s=o.start,s},i.prototype.applyDeltas=function(o){for(var h=0;h<o.length;h++)this.applyDelta(o[h])},i.prototype.revertDeltas=function(o){for(var h=o.length-1;h>=0;h--)this.revertDelta(o[h])},i.prototype.applyDelta=function(o,h){var s=o.action=="insert";(s?o.lines.length<=1&&!o.lines[0]:!r.comparePoints(o.start,o.end))||(s&&o.lines.length>2e4?this.$splitAndapplyLargeDelta(o,2e4):(u(this.$lines,o,h),this._signal("change",o)))},i.prototype.$safeApplyDelta=function(o){var h=this.$lines.length;(o.action=="remove"&&o.start.row<h&&o.end.row<h||o.action=="insert"&&o.start.row<=h)&&this.applyDelta(o)},i.prototype.$splitAndapplyLargeDelta=function(o,h){for(var s=o.lines,p=s.length-h+1,f=o.start.row,g=o.start.column,y=0,A=0;y<p;y=A){A+=h-1;var E=s.slice(y,A);E.push(""),this.applyDelta({start:this.pos(f+y,g),end:this.pos(f+A,g=0),action:o.action,lines:E},!0)}o.lines=s.slice(y),o.start.row=f+y,o.start.column=g,this.applyDelta(o,!0)},i.prototype.revertDelta=function(o){this.$safeApplyDelta({start:this.clonePos(o.start),end:this.clonePos(o.end),action:o.action=="insert"?"remove":"insert",lines:o.lines.slice()})},i.prototype.indexToPosition=function(o,h){for(var s=this.$lines||this.getAllLines(),p=this.getNewLineCharacter().length,f=h||0,g=s.length;f<g;f++)if(o-=s[f].length+p,o<0)return{row:f,column:o+s[f].length+p};return{row:g-1,column:o+s[g-1].length+p}},i.prototype.positionToIndex=function(o,h){for(var s=this.$lines||this.getAllLines(),p=this.getNewLineCharacter().length,f=0,g=Math.min(o.row,s.length),y=h||0;y<g;++y)f+=s[y].length+p;return f+o.column},i.prototype.$split=function(o){return o.split(/\r\n|\r|\n/)},i})();e.prototype.$autoNewLine="",e.prototype.$newLineMode="auto",a.implement(e.prototype,d),l.Document=e}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(n,l,v){var a=n("./lib/oop"),u=n("./lib/event_emitter").EventEmitter,d=(function(){function r(c,e){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=c;var i=this;this.$worker=function(){if(i.running){for(var o=new Date,h=i.currentLine,s=-1,p=i.doc,f=h;i.lines[h];)h++;var g=p.getLength(),y=0;for(i.running=!1;h<g;){i.$tokenizeRow(h),s=h;do h++;while(i.lines[h]);if(y++,y%5===0&&new Date-o>20){i.running=setTimeout(i.$worker,20);break}}i.currentLine=h,s==-1&&(s=h),f<=s&&i.fireUpdateEvent(f,s)}}}return r.prototype.setTokenizer=function(c){this.tokenizer=c,this.lines=[],this.states=[],this.start(0)},r.prototype.setDocument=function(c){this.doc=c,this.lines=[],this.states=[],this.stop()},r.prototype.fireUpdateEvent=function(c,e){var i={first:c,last:e};this._signal("update",{data:i})},r.prototype.start=function(c){this.currentLine=Math.min(c||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},r.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},r.prototype.$updateOnChange=function(c){var e=c.start.row,i=c.end.row-e;if(i===0)this.lines[e]=null;else if(c.action=="remove")this.lines.splice(e,i+1,null),this.states.splice(e,i+1,null);else{var o=Array(i+1);o.unshift(e,1),this.lines.splice.apply(this.lines,o),this.states.splice.apply(this.states,o)}this.currentLine=Math.min(e,this.currentLine,this.doc.getLength()),this.stop()},r.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},r.prototype.getTokens=function(c){return this.lines[c]||this.$tokenizeRow(c)},r.prototype.getState=function(c){return this.currentLine==c&&this.$tokenizeRow(c),this.states[c]||"start"},r.prototype.$tokenizeRow=function(c){var e=this.doc.getLine(c),i=this.states[c-1],o=this.tokenizer.getLineTokens(e,i,c);return this.states[c]+""!=o.state+""?(this.states[c]=o.state,this.lines[c+1]=null,this.currentLine>c+1&&(this.currentLine=c+1)):this.currentLine==c&&(this.currentLine=c+1),this.lines[c]=o.tokens},r.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},r})();a.implement(d.prototype,u),l.BackgroundTokenizer=d}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(n,l,v){var a=n("./lib/lang"),u=n("./range").Range,d=(function(){function r(c,e,i){i===void 0&&(i="text"),this.setRegexp(c),this.clazz=e,this.type=i,this.docLen=0}return r.prototype.setRegexp=function(c){this.regExp+""!=c+""&&(this.regExp=c,this.cache=[])},r.prototype.update=function(c,e,i,o){if(this.regExp){for(var h=o.firstRow,s=o.lastRow,p={},f=i.$editor&&i.$editor.$search,g=f&&f.$isMultilineSearch(i.$editor.getLastSearchOptions()),y=h;y<=s;y++){var A=this.cache[y];if(A==null||i.getValue().length!=this.docLen){if(g){A=[];var E=f.$multiLineForward(i,this.regExp,y,s);if(E){var w=E.endRow<=s?E.endRow-1:s;w>y&&(y=w),A.push(new u(E.startRow,E.startCol,E.endRow,E.endCol))}A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES))}else A=a.getMatchOffsets(i.getLine(y),this.regExp),A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES)),A=A.map(function(D){return new u(y,D.offset,y,D.offset+D.length)});this.cache[y]=A.length?A:""}if(A.length!==0)for(var m=A.length;m--;){var S=A[m].toScreenRange(i),M=S.toString();p[M]||(p[M]=!0,e.drawSingleLineMarker(c,S,this.clazz,o))}}this.docLen=i.getValue().length}},r})();d.prototype.MAX_RANGES=500,l.SearchHighlight=d}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(n,l,v){var a=(function(){function w(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return w.prototype.addSession=function(m){this.$session=m},w.prototype.add=function(m,S,M){if(!this.$fromUndo&&m!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),S===!1||!this.lastDeltas){this.lastDeltas=[];var D=this.$undoStack.length;D>this.$undoDepth-1&&this.$undoStack.splice(0,D-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),m.id=this.$rev=++this.$maxRev}(m.action=="remove"||m.action=="insert")&&(this.$lastDelta=m),this.lastDeltas.push(m)}},w.prototype.addSelection=function(m,S){this.selections.push({value:m,rev:S||this.$rev})},w.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},w.prototype.markIgnored=function(m,S){S==null&&(S=this.$rev+1);for(var M=this.$undoStack,D=M.length;D--;){var _=M[D][0];if(_.id<=m)break;_.id<S&&(_.ignore=!0)}this.lastDeltas=null},w.prototype.getSelection=function(m,S){for(var M=this.selections,D=M.length;D--;){var _=M[D];if(_.rev<m)return S&&(_=M[D+1]),_}},w.prototype.getRevision=function(){return this.$rev},w.prototype.getDeltas=function(m,S){S==null&&(S=this.$rev+1);for(var M=this.$undoStack,D=null,_=0,F=M.length;F--;){var x=M[F][0];if(x.id<S&&!D&&(D=F+1),x.id<=m){_=F+1;break}}return M.slice(_,D)},w.prototype.getChangedRanges=function(m,S){S==null&&(S=this.$rev+1)},w.prototype.getChangedLines=function(m,S){S==null&&(S=this.$rev+1)},w.prototype.undo=function(m,S){this.lastDeltas=null;var M=this.$undoStack;if(u(M,M.length)){m||(m=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var D=M.pop(),_=null;return D&&(_=m.undoChanges(D,S),this.$redoStack.push(D),this.$syncRev()),this.$fromUndo=!1,_}},w.prototype.redo=function(m,S){if(this.lastDeltas=null,m||(m=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var M=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);E(this.$redoStack,M),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(F){F[0].id=++this.$maxRev},this)}var D=this.$redoStack.pop(),_=null;return D&&(_=m.redoChanges(D,S),this.$undoStack.push(D),this.$syncRev()),this.$fromUndo=!1,_},w.prototype.$syncRev=function(){var m=this.$undoStack,S=m[m.length-1],M=S&&S[0].id||0;this.$redoStackBaseRev=M,this.$rev=M},w.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},w.prototype.canUndo=function(){return this.$undoStack.length>0},w.prototype.canRedo=function(){return this.$redoStack.length>0},w.prototype.bookmark=function(m){m==null&&(m=this.$rev),this.mark=m},w.prototype.isAtBookmark=function(){return this.$rev===this.mark},w.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},w.prototype.fromJSON=function(m){this.reset(),this.$undoStack=m.$undoStack,this.$redoStack=m.$redoStack},w.prototype.$prettyPrint=function(m){return m?i(m):i(this.$undoStack)+`
200
+ ---
201
+ `+i(this.$redoStack)},w})();a.prototype.hasUndo=a.prototype.canUndo,a.prototype.hasRedo=a.prototype.canRedo,a.prototype.isClean=a.prototype.isAtBookmark,a.prototype.markClean=a.prototype.bookmark;function u(w,m){for(var S=m;S--;){var M=w[S];if(M&&!M[0].ignore){for(;S<m-1;){var D=s(w[S],w[S+1]);w[S]=D[0],w[S+1]=D[1],S++}return!0}}}var d=n("./range").Range,r=d.comparePoints;d.comparePoints;function c(w){return{row:w.row,column:w.column}}function e(w){return{start:c(w.start),end:c(w.end),action:w.action,lines:w.lines.slice()}}function i(w){if(w=w||this,Array.isArray(w))return w.map(i).join(`
202
+ `);var m="";return w.action?(m=w.action=="insert"?"+":"-",m+="["+w.lines+"]"):w.value&&(Array.isArray(w.value)?m=w.value.map(o).join(`
203
+ `):m=o(w.value)),w.start&&(m+=o(w)),(w.id||w.rev)&&(m+=" ("+(w.id||w.rev)+")"),m}function o(w){return w.start.row+":"+w.start.column+"=>"+w.end.row+":"+w.end.column}function h(w,m){var S=w.action=="insert",M=m.action=="insert";if(S&&M)if(r(m.start,w.end)>=0)f(m,w,-1);else if(r(m.start,w.start)<=0)f(w,m,1);else return null;else if(S&&!M)if(r(m.start,w.end)>=0)f(m,w,-1);else if(r(m.end,w.start)<=0)f(w,m,-1);else return null;else if(!S&&M)if(r(m.start,w.start)>=0)f(m,w,1);else if(r(m.start,w.start)<=0)f(w,m,1);else return null;else if(!S&&!M)if(r(m.start,w.start)>=0)f(m,w,1);else if(r(m.end,w.start)<=0)f(w,m,-1);else return null;return[m,w]}function s(w,m){for(var S=w.length;S--;)for(var M=0;M<m.length;M++)if(!h(w[S],m[M])){for(;S<w.length;){for(;M--;)h(m[M],w[S]);M=m.length,S++}return[w,m]}return w.selectionBefore=m.selectionBefore=w.selectionAfter=m.selectionAfter=null,[m,w]}function p(w,m){var S=w.action=="insert",M=m.action=="insert";if(S&&M)r(w.start,m.start)<0?f(m,w,1):f(w,m,1);else if(S&&!M)r(w.start,m.end)>=0?f(w,m,-1):(r(w.start,m.start)<=0||f(w,d.fromPoints(m.start,w.start),-1),f(m,w,1));else if(!S&&M)r(m.start,w.end)>=0?f(m,w,-1):(r(m.start,w.start)<=0||f(m,d.fromPoints(w.start,m.start),-1),f(w,m,1));else if(!S&&!M)if(r(m.start,w.end)>=0)f(m,w,-1);else if(r(m.end,w.start)<=0)f(w,m,-1);else{var D,_;return r(w.start,m.start)<0&&(D=w,w=y(w,m.start)),r(w.end,m.end)>0&&(_=y(w,m.end)),g(m.end,w.start,w.end,-1),_&&!D&&(w.lines=_.lines,w.start=_.start,w.end=_.end,_=w),[m,D,_].filter(Boolean)}return[m,w]}function f(w,m,S){g(w.start,m.start,m.end,S),g(w.end,m.start,m.end,S)}function g(w,m,S,M){w.row==(M==1?m:S).row&&(w.column+=M*(S.column-m.column)),w.row+=M*(S.row-m.row)}function y(w,m){var S=w.lines,M=w.end;w.end=c(m);var D=w.end.row-w.start.row,_=S.splice(D,S.length),F=D?m.column:m.column-w.start.column;S.push(_[0].substring(0,F)),_[0]=_[0].substr(F);var x={start:c(m),end:M,lines:_,action:w.action};return x}function A(w,m){m=e(m);for(var S=w.length;S--;){for(var M=w[S],D=0;D<M.length;D++){var _=M[D],F=p(_,m);m=F[0],F.length!=2&&(F[2]?(M.splice(D+1,1,F[1],F[2]),D++):F[1]||(M.splice(D,1),D--))}M.length||w.splice(S,1)}return w}function E(w,m){for(var S=0;S<m.length;S++)for(var M=m[S],D=0;D<M.length;D++)A(w,M[D])}l.UndoManager=a}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(n,l,v){var a=n("../range").Range,u=(function(){function d(r,c){this.foldData=r,Array.isArray(c)?this.folds=c:c=this.folds=[c];var e=c[c.length-1];this.range=new a(c[0].start.row,c[0].start.column,e.end.row,e.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(i){i.setFoldLine(this)},this)}return d.prototype.shiftRow=function(r){this.start.row+=r,this.end.row+=r,this.folds.forEach(function(c){c.start.row+=r,c.end.row+=r})},d.prototype.addFold=function(r){if(r.sameRow){if(r.start.row<this.startRow||r.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(r),this.folds.sort(function(c,e){return-c.range.compareEnd(e.start.row,e.start.column)}),this.range.compareEnd(r.start.row,r.start.column)>0?(this.end.row=r.end.row,this.end.column=r.end.column):this.range.compareStart(r.end.row,r.end.column)<0&&(this.start.row=r.start.row,this.start.column=r.start.column)}else if(r.start.row==this.end.row)this.folds.push(r),this.end.row=r.end.row,this.end.column=r.end.column;else if(r.end.row==this.start.row)this.folds.unshift(r),this.start.row=r.start.row,this.start.column=r.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");r.foldLine=this},d.prototype.containsRow=function(r){return r>=this.start.row&&r<=this.end.row},d.prototype.walk=function(r,c,e){var i=0,o=this.folds,h,s,p,f=!0;c==null&&(c=this.end.row,e=this.end.column);for(var g=0;g<o.length;g++){if(h=o[g],s=h.range.compareStart(c,e),s==-1){r(null,c,e,i,f);return}if(p=r(null,h.start.row,h.start.column,i,f),p=!p&&r(h.placeholder,h.start.row,h.start.column,i),p||s===0)return;f=!h.sameRow,i=h.end.column}r(null,c,e,i,f)},d.prototype.getNextFoldTo=function(r,c){for(var e,i,o=0;o<this.folds.length;o++){if(e=this.folds[o],i=e.range.compareEnd(r,c),i==-1)return{fold:e,kind:"after"};if(i===0)return{fold:e,kind:"inside"}}return null},d.prototype.addRemoveChars=function(r,c,e){var i=this.getNextFoldTo(r,c),o,h;if(i){if(o=i.fold,i.kind=="inside"&&o.start.column!=c&&o.start.row!=r)window.console&&window.console.log(r,c,o);else if(o.start.row==r){h=this.folds;var s=h.indexOf(o);for(s===0&&(this.start.column+=e),s;s<h.length;s++){if(o=h[s],o.start.column+=e,!o.sameRow)return;o.end.column+=e}this.end.column+=e}}},d.prototype.split=function(r,c){var e=this.getNextFoldTo(r,c);if(!e||e.kind=="inside")return null;var i=e.fold,o=this.folds,h=this.foldData,s=o.indexOf(i),p=o[s-1];this.end.row=p.end.row,this.end.column=p.end.column,o=o.splice(s,o.length-s);var f=new d(h,o);return h.splice(h.indexOf(this)+1,0,f),f},d.prototype.merge=function(r){for(var c=r.folds,e=0;e<c.length;e++)this.addFold(c[e]);var i=this.foldData;i.splice(i.indexOf(r),1)},d.prototype.toString=function(){var r=[this.range.toString()+": ["];return this.folds.forEach(function(c){r.push(" "+c.toString())}),r.push("]"),r.join(`
204
+ `)},d.prototype.idxToPosition=function(r){for(var c=0,e=0;e<this.folds.length;e++){var i=this.folds[e];if(r-=i.start.column-c,r<0)return{row:i.start.row,column:i.start.column+r};if(r-=i.placeholder.length,r<0)return i.start;c=i.end.column}return{row:this.end.row,column:this.end.column+r}},d})();l.FoldLine=u}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(n,l,v){var a=n("./range").Range,u=a.comparePoints,d=(function(){function r(){this.ranges=[],this.$bias=1}return r.prototype.pointIndex=function(c,e,i){for(var o=this.ranges,h=i||0;h<o.length;h++){var s=o[h],p=u(c,s.end);if(!(p>0)){var f=u(c,s.start);return p===0?e&&f!==0?-h-2:h:f>0||f===0&&!e?h:-h-1}}return-h-1},r.prototype.add=function(c){var e=!c.isEmpty(),i=this.pointIndex(c.start,e);i<0&&(i=-i-1);var o=this.pointIndex(c.end,e,i);return o<0?o=-o-1:o++,this.ranges.splice(i,o-i,c)},r.prototype.addList=function(c){for(var e=[],i=c.length;i--;)e.push.apply(e,this.add(c[i]));return e},r.prototype.substractPoint=function(c){var e=this.pointIndex(c);if(e>=0)return this.ranges.splice(e,1)},r.prototype.merge=function(){var c=[],e=this.ranges;e=e.sort(function(p,f){return u(p.start,f.start)});for(var i=e[0],o,h=1;h<e.length;h++){o=i,i=e[h];var s=u(o.end,i.start);s<0||s==0&&!o.isEmpty()&&!i.isEmpty()||(u(o.end,i.end)<0&&(o.end.row=i.end.row,o.end.column=i.end.column),e.splice(h,1),c.push(i),i=o,h--)}return this.ranges=e,c},r.prototype.contains=function(c,e){return this.pointIndex({row:c,column:e})>=0},r.prototype.containsPoint=function(c){return this.pointIndex(c)>=0},r.prototype.rangeAtPoint=function(c){var e=this.pointIndex(c);if(e>=0)return this.ranges[e]},r.prototype.clipRows=function(c,e){var i=this.ranges;if(i[0].start.row>e||i[i.length-1].start.row<c)return[];var o=this.pointIndex({row:c,column:0});o<0&&(o=-o-1);var h=this.pointIndex({row:e,column:0},o);h<0&&(h=-h-1);for(var s=[],p=o;p<h;p++)s.push(i[p]);return s},r.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},r.prototype.attach=function(c){this.session&&this.detach(),this.session=c,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},r.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},r.prototype.$onChange=function(c){for(var e=c.start,i=c.end,o=e.row,h=i.row,s=this.ranges,p=0,f=s.length;p<f;p++){var g=s[p];if(g.end.row>=o)break}if(c.action=="insert")for(var y=h-o,A=-e.column+i.column;p<f;p++){var g=s[p];if(g.start.row>o)break;if(g.start.row==o&&g.start.column>=e.column&&(g.start.column==e.column&&this.$bias<=0||(g.start.column+=A,g.start.row+=y)),g.end.row==o&&g.end.column>=e.column){if(g.end.column==e.column&&this.$bias<0)continue;g.end.column==e.column&&A>0&&p<f-1&&g.end.column>g.start.column&&g.end.column==s[p+1].start.column&&(g.end.column-=A),g.end.column+=A,g.end.row+=y}}else for(var y=o-h,A=e.column-i.column;p<f;p++){var g=s[p];if(g.start.row>h)break;g.end.row<h&&(o<g.end.row||o==g.end.row&&e.column<g.end.column)?(g.end.row=o,g.end.column=e.column):g.end.row==h?g.end.column<=i.column?(y||g.end.column>e.column)&&(g.end.column=e.column,g.end.row=e.row):(g.end.column+=A,g.end.row+=y):g.end.row>h&&(g.end.row+=y),g.start.row<h&&(o<g.start.row||o==g.start.row&&e.column<g.start.column)?(g.start.row=o,g.start.column=e.column):g.start.row==h?g.start.column<=i.column?(y||g.start.column>e.column)&&(g.start.column=e.column,g.start.row=e.row):(g.start.column+=A,g.start.row+=y):g.start.row>h&&(g.start.row+=y)}if(y!=0&&p<f)for(;p<f;p++){var g=s[p];g.start.row+=y,g.end.row+=y}},r})();d.prototype.comparePoints=u,l.RangeList=d}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(n,l,v){var a=this&&this.__extends||(function(){var o=function(h,s){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,f){p.__proto__=f}||function(p,f){for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(p[g]=f[g])},o(h,s)};return function(h,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");o(h,s);function p(){this.constructor=h}h.prototype=s===null?Object.create(s):(p.prototype=s.prototype,new p)}})(),u=n("../range_list").RangeList,d=(function(o){a(h,o);function h(s,p){var f=o.call(this)||this;return f.foldLine=null,f.placeholder=p,f.range=s,f.start=s.start,f.end=s.end,f.sameRow=s.start.row==s.end.row,f.subFolds=f.ranges=[],f}return h.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},h.prototype.setFoldLine=function(s){this.foldLine=s,this.subFolds.forEach(function(p){p.setFoldLine(s)})},h.prototype.clone=function(){var s=this.range.clone(),p=new h(s,this.placeholder);return this.subFolds.forEach(function(f){p.subFolds.push(f.clone())}),p.collapseChildren=this.collapseChildren,p},h.prototype.addSubFold=function(s){if(!this.range.isEqual(s)){c(s,this.start);for(var A=s.start.row,E=s.start.column,p=0,f=-1;p<this.subFolds.length&&(f=this.subFolds[p].range.compare(A,E),f==1);p++);var g=this.subFolds[p],y=0;if(f==0){if(g.range.containsRange(s))return g.addSubFold(s);y=1}for(var A=s.range.end.row,E=s.range.end.column,w=p,f=-1;w<this.subFolds.length&&(f=this.subFolds[w].range.compare(A,E),f==1);w++);f==0&&w++;for(var m=this.subFolds.splice(p,w-p,s),S=f==0?m.length-1:m.length,M=y;M<S;M++)s.addSubFold(m[M]);return s.setFoldLine(this.foldLine),s}},h.prototype.restoreRange=function(s){return i(s,this.start)},h})(u);function r(o,h){o.row-=h.row,o.row==0&&(o.column-=h.column)}function c(o,h){r(o.start,h),r(o.end,h)}function e(o,h){o.row==0&&(o.column+=h.column),o.row+=h.row}function i(o,h){e(o.start,h),e(o.end,h)}l.Fold=d}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],function(n,l,v){var a=n("../range").Range,u=n("./fold_line").FoldLine,d=n("./fold").Fold,r=n("../token_iterator").TokenIterator,c=n("../mouse/mouse_event").MouseEvent;function e(){this.getFoldAt=function(i,o,h){var s=this.getFoldLine(i);if(!s)return null;for(var p=s.folds,f=0;f<p.length;f++){var g=p[f].range;if(g.contains(i,o)){if(h==1&&g.isEnd(i,o)&&!g.isEmpty())continue;if(h==-1&&g.isStart(i,o)&&!g.isEmpty())continue;return p[f]}}},this.getFoldsInRange=function(i){var o=i.start,h=i.end,s=this.$foldData,p=[];o.column+=1,h.column-=1;for(var f=0;f<s.length;f++){var g=s[f].range.compareRange(i);if(g!=2){if(g==-2)break;for(var y=s[f].folds,A=0;A<y.length;A++){var E=y[A];if(g=E.range.compareRange(i),g==-2)break;if(g==2)continue;if(g==42)break;p.push(E)}}}return o.column-=1,h.column+=1,p},this.getFoldsInRangeList=function(i){if(Array.isArray(i)){var o=[];i.forEach(function(h){o=o.concat(this.getFoldsInRange(h))},this)}else var o=this.getFoldsInRange(i);return o},this.getAllFolds=function(){for(var i=[],o=this.$foldData,h=0;h<o.length;h++)for(var s=0;s<o[h].folds.length;s++)i.push(o[h].folds[s]);return i},this.getFoldStringAt=function(i,o,h,s){if(s=s||this.getFoldLine(i),!s)return null;for(var p={end:{column:0}},f,g,y=0;y<s.folds.length;y++){g=s.folds[y];var A=g.range.compareEnd(i,o);if(A==-1){f=this.getLine(g.start.row).substring(p.end.column,g.start.column);break}else if(A===0)return null;p=g}return f||(f=this.getLine(g.start.row).substring(p.end.column)),h==-1?f.substring(0,o-p.end.column):h==1?f.substring(o-p.end.column):f},this.getFoldLine=function(i,o){var h=this.$foldData,s=0;for(o&&(s=h.indexOf(o)),s==-1&&(s=0),s;s<h.length;s++){var p=h[s];if(p.start.row<=i&&p.end.row>=i)return p;if(p.end.row>i)return null}return null},this.getNextFoldLine=function(i,o){var h=this.$foldData,s=0;for(o&&(s=h.indexOf(o)),s==-1&&(s=0),s;s<h.length;s++){var p=h[s];if(p.end.row>=i)return p}return null},this.getFoldedRowCount=function(i,o){for(var h=this.$foldData,s=o-i+1,p=0;p<h.length;p++){var f=h[p],g=f.end.row,y=f.start.row;if(g>=o){y<o&&(y>=i?s-=o-y:s=0);break}else g>=i&&(y>=i?s-=g-y:s-=g-i+1)}return s},this.$addFoldLine=function(i){return this.$foldData.push(i),this.$foldData.sort(function(o,h){return o.start.row-h.start.row}),i},this.addFold=function(i,o){var h=this.$foldData,s=!1,p;i instanceof d?p=i:(p=new d(o,i),p.collapseChildren=o.collapseChildren),this.$clipRangeToDocument(p.range);var f=p.start.row,g=p.start.column,y=p.end.row,A=p.end.column,E=this.getFoldAt(f,g,1),w=this.getFoldAt(y,A,-1);if(E&&w==E)return E.addSubFold(p);E&&!E.range.isStart(f,g)&&this.removeFold(E),w&&!w.range.isEnd(y,A)&&this.removeFold(w);var m=this.getFoldsInRange(p.range);m.length>0&&(this.removeFolds(m),p.collapseChildren||m.forEach(function(_){p.addSubFold(_)}));for(var S=0;S<h.length;S++){var M=h[S];if(y==M.start.row){M.addFold(p),s=!0;break}else if(f==M.end.row){if(M.addFold(p),s=!0,!p.sameRow){var D=h[S+1];if(D&&D.start.row==y){M.merge(D);break}}break}else if(y<=M.start.row)break}return s||(M=this.$addFoldLine(new u(this.$foldData,p))),this.$useWrapMode?this.$updateWrapData(M.start.row,M.start.row):this.$updateRowLengthCache(M.start.row,M.start.row),this.$modified=!0,this._signal("changeFold",{data:p,action:"add"}),p},this.addFolds=function(i){i.forEach(function(o){this.addFold(o)},this)},this.removeFold=function(i){var o=i.foldLine,h=o.start.row,s=o.end.row,p=this.$foldData,f=o.folds;if(f.length==1)p.splice(p.indexOf(o),1);else if(o.range.isEnd(i.end.row,i.end.column))f.pop(),o.end.row=f[f.length-1].end.row,o.end.column=f[f.length-1].end.column;else if(o.range.isStart(i.start.row,i.start.column))f.shift(),o.start.row=f[0].start.row,o.start.column=f[0].start.column;else if(i.sameRow)f.splice(f.indexOf(i),1);else{var g=o.split(i.start.row,i.start.column);f=g.folds,f.shift(),g.start.row=f[0].start.row,g.start.column=f[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(h,s):this.$updateRowLengthCache(h,s)),this.$modified=!0,this._signal("changeFold",{data:i,action:"remove"})},this.removeFolds=function(i){for(var o=[],h=0;h<i.length;h++)o.push(i[h]);o.forEach(function(s){this.removeFold(s)},this),this.$modified=!0},this.expandFold=function(i){this.removeFold(i),i.subFolds.forEach(function(o){i.restoreRange(o),this.addFold(o)},this),i.collapseChildren>0&&this.foldAll(i.start.row+1,i.end.row,i.collapseChildren-1),i.subFolds=[]},this.expandFolds=function(i){i.forEach(function(o){this.expandFold(o)},this)},this.unfold=function(i,o){var h,s;if(i==null)h=new a(0,0,this.getLength(),0),o==null&&(o=!0);else if(typeof i=="number")h=new a(i,0,i,this.getLine(i).length);else if("row"in i)h=a.fromPoints(i,i);else{if(Array.isArray(i))return s=[],i.forEach(function(f){s=s.concat(this.unfold(f))},this),s;h=i}s=this.getFoldsInRangeList(h);for(var p=s;s.length==1&&a.comparePoints(s[0].start,h.start)<0&&a.comparePoints(s[0].end,h.end)>0;)this.expandFolds(s),s=this.getFoldsInRangeList(h);if(o!=!1?this.removeFolds(s):this.expandFolds(s),p.length)return p},this.isRowFolded=function(i,o){return!!this.getFoldLine(i,o)},this.getRowFoldEnd=function(i,o){var h=this.getFoldLine(i,o);return h?h.end.row:i},this.getRowFoldStart=function(i,o){var h=this.getFoldLine(i,o);return h?h.start.row:i},this.getFoldDisplayLine=function(i,o,h,s,p){s==null&&(s=i.start.row),p==null&&(p=0),o==null&&(o=i.end.row),h==null&&(h=this.getLine(o).length);var f=this.doc,g="";return i.walk(function(y,A,E,w){if(!(A<s)){if(A==s){if(E<p)return;w=Math.max(p,w)}y!=null?g+=y:g+=f.getLine(A).substring(w,E)}},o,h),g},this.getDisplayLine=function(i,o,h,s){var p=this.getFoldLine(i);if(p)return this.getFoldDisplayLine(p,i,o,h,s);var f;return f=this.doc.getLine(i),f.substring(s||0,o||f.length)},this.$cloneFoldData=function(){var i=[];return i=this.$foldData.map(function(o){var h=o.folds.map(function(s){return s.clone()});return new u(i,h)}),i},this.toggleFold=function(i){var o=this.selection,h=o.getRange(),s,p;if(h.isEmpty()){var f=h.start;if(s=this.getFoldAt(f.row,f.column),s){this.expandFold(s);return}else if(i){var g=this.getFoldLine(f.row);g&&this.expandFolds(g.folds);return}else(p=this.findMatchingBracket(f))?h.comparePoint(p)==1?h.end=p:(h.start=p,h.start.column++,h.end.column--):(p=this.findMatchingBracket({row:f.row,column:f.column+1}))?(h.comparePoint(p)==1?h.end=p:h.start=p,h.start.column++):h=this.getCommentFoldRange(f.row,f.column)||h}else{var y=this.getFoldsInRange(h);if(i&&y.length){this.expandFolds(y);return}else y.length==1&&(s=y[0])}if(s||(s=this.getFoldAt(h.start.row,h.start.column)),s&&s.range.toString()==h.toString()){this.expandFold(s);return}var A="...";if(!h.isMultiLine()){if(A=this.getTextRange(h),A.length<4)return;A=A.trim().substring(0,2)+".."}this.addFold(A,h)},this.getCommentFoldRange=function(i,o,h){var s=new r(this,i,o),p=s.getCurrentToken(),f=p&&p.type;if(p&&/^comment|string/.test(f)){f=f.match(/comment|string/)[0],f=="comment"&&(f+="|doc-start|\\.doc");var g=new RegExp(f),y=new a;if(h!=1){do p=s.stepBackward();while(p&&g.test(p.type));p=s.stepForward()}y.start.row=s.getCurrentTokenRow(),y.start.column=s.getCurrentTokenColumn()+p.value.length,s=new r(this,i,o);var A=this.getState(s.$row);if(h!=-1){var E=-1;do if(p=s.stepForward(),E==-1){var w=this.getState(s.$row);A.toString()!==w.toString()&&(E=s.$row)}else if(s.$row>E)break;while(p&&g.test(p.type));p=s.stepBackward()}else p=s.getCurrentToken();return y.end.row=s.getCurrentTokenRow(),y.end.column=s.getCurrentTokenColumn(),y.start.row==y.end.row&&y.start.column>y.end.column?void 0:y}},this.foldAll=function(i,o,h,s){h==null&&(h=1e5);var p=this.foldWidgets;if(p){o=o||this.getLength(),i=i||0;for(var f=i;f<o;f++)if(p[f]==null&&(p[f]=this.getFoldWidget(f)),p[f]=="start"&&!(s&&!s(f))){var g=this.getFoldWidgetRange(f);g&&g.isMultiLine()&&g.end.row<=o&&g.start.row>=i&&(f=g.end.row,g.collapseChildren=h,this.addFold("...",g))}}},this.foldToLevel=function(i){for(this.foldAll();i-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var i=this;this.foldAll(null,null,null,function(o){for(var h=i.getTokens(o),s=0;s<h.length;s++){var p=h[s];if(!(p.type=="text"&&/^\s+$/.test(p.value)))return!!/comment/.test(p.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(i){if(!this.$foldStyles[i])throw new Error("invalid fold style: "+i+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=i){this.$foldStyle=i,i=="manual"&&this.unfold();var o=this.$foldMode;this.$setFolding(null),this.$setFolding(o)}},this.$setFolding=function(i){if(this.$foldMode!=i){if(this.$foldMode=i,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!i||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=i.getFoldWidget.bind(i,this,this.$foldStyle),this.getFoldWidgetRange=i.getFoldWidgetRange.bind(i,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)}},this.getParentFoldRangeData=function(i,o){var h=this.foldWidgets;if(!h||o&&h[i])return{};for(var s=i-1,p;s>=0;){var f=h[s];if(f==null&&(f=h[s]=this.getFoldWidget(s)),f=="start"){var g=this.getFoldWidgetRange(s);if(p||(p=g),g&&g.end.row>=i)break}s--}return{range:s!==-1&&g,firstRange:p}},this.onFoldWidgetClick=function(i,o){o instanceof c&&(o=o.domEvent);var h={children:o.shiftKey,all:o.ctrlKey||o.metaKey,siblings:o.altKey},s=this.$toggleFoldWidget(i,h);if(!s){var p=o.target||o.srcElement;p&&/ace_fold-widget/.test(p.className)&&(p.className+=" ace_invalid")}},this.$toggleFoldWidget=function(i,o){if(this.getFoldWidget){var h=this.getFoldWidget(i),s=this.getLine(i),p=h==="end"?-1:1,f=this.getFoldAt(i,p===-1?0:s.length,p);if(f)return o.children||o.all?this.removeFold(f):this.expandFold(f),f;var g=this.getFoldWidgetRange(i,!0);if(g&&!g.isMultiLine()&&(f=this.getFoldAt(g.start.row,g.start.column,1),f&&g.isEqual(f.range)))return this.removeFold(f),f;if(o.siblings){var y=this.getParentFoldRangeData(i);if(y.range)var A=y.range.start.row+1,E=y.range.end.row;this.foldAll(A,E,o.all?1e4:0)}else o.children?(E=g?g.end.row:this.getLength(),this.foldAll(i+1,E,o.all?1e4:0)):g&&(o.all&&(g.collapseChildren=1e4),this.addFold("...",g));return g}},this.toggleFoldWidget=function(i){var o=this.selection.getCursor().row;o=this.getRowFoldStart(o);var h=this.$toggleFoldWidget(o,{});if(!h){var s=this.getParentFoldRangeData(o,!0);if(h=s.range||s.firstRange,h){o=h.start.row;var p=this.getFoldAt(o,this.getLine(o).length,1);p?this.removeFold(p):this.addFold("...",h)}}},this.updateFoldWidgets=function(i){var o=i.start.row,h=i.end.row-o;if(h===0)this.foldWidgets[o]=null;else if(i.action=="remove")this.foldWidgets.splice(o,h+1,null);else{var s=Array(h+1);s.unshift(o,1),this.foldWidgets.splice.apply(this.foldWidgets,s)}},this.tokenizerUpdateFoldWidgets=function(i){var o=i.data;o.first!=o.last&&this.foldWidgets.length>o.first&&this.foldWidgets.splice(o.first,this.foldWidgets.length)}}l.Folding=e}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(n,l,v){var a=n("../token_iterator").TokenIterator,u=n("../range").Range;function d(){this.findMatchingBracket=function(r,c){if(r.column==0)return null;var e=c||this.getLine(r.row).charAt(r.column-1);if(e=="")return null;var i=e.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],r):this.$findOpeningBracket(i[2],r):null},this.getBracketRange=function(r){var c=this.getLine(r.row),e=!0,i,o=c.charAt(r.column-1),h=o&&o.match(/([\(\[\{])|([\)\]\}])/);if(h||(o=c.charAt(r.column),r={row:r.row,column:r.column+1},h=o&&o.match(/([\(\[\{])|([\)\]\}])/),e=!1),!h)return null;if(h[1]){var s=this.$findClosingBracket(h[1],r);if(!s)return null;i=u.fromPoints(r,s),e||(i.end.column++,i.start.column--),i.cursor=i.end}else{var s=this.$findOpeningBracket(h[2],r);if(!s)return null;i=u.fromPoints(s,r),e||(i.start.column++,i.end.column--),i.cursor=i.start}return i},this.getMatchingBracketRanges=function(r,c){var e=this.getLine(r.row),i=/([\(\[\{])|([\)\]\}])/,o=!c&&e.charAt(r.column-1),h=o&&o.match(i);if(h||(o=(c===void 0||c)&&e.charAt(r.column),r={row:r.row,column:r.column+1},h=o&&o.match(i)),!h)return null;var s=new u(r.row,r.column-1,r.row,r.column),p=h[1]?this.$findClosingBracket(h[1],r):this.$findOpeningBracket(h[2],r);if(!p)return[s];var f=new u(p.row,p.column,p.row,p.column+1);return[s,f]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(r,c,e){var i=this.$brackets[r],o=1,h=new a(this,c.row,c.column),s=h.getCurrentToken();if(s||(s=h.stepForward()),!!s){e||(e=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var p=c.column-h.getCurrentTokenColumn()-2,f=s.value;;){for(;p>=0;){var g=f.charAt(p);if(g==i){if(o-=1,o==0)return{row:h.getCurrentTokenRow(),column:p+h.getCurrentTokenColumn()}}else g==r&&(o+=1);p-=1}do s=h.stepBackward();while(s&&!e.test(s.type));if(s==null)break;f=s.value,p=f.length-1}return null}},this.$findClosingBracket=function(r,c,e){var i=this.$brackets[r],o=1,h=new a(this,c.row,c.column),s=h.getCurrentToken();if(s||(s=h.stepForward()),!!s){e||(e=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var p=c.column-h.getCurrentTokenColumn();;){for(var f=s.value,g=f.length;p<g;){var y=f.charAt(p);if(y==i){if(o-=1,o==0)return{row:h.getCurrentTokenRow(),column:p+h.getCurrentTokenColumn()}}else y==r&&(o+=1);p+=1}do s=h.stepForward();while(s&&!e.test(s.type));if(s==null)break;p=0}return null}},this.getMatchingTags=function(r){var c=new a(this,r.row,r.column),e=this.$findTagName(c);if(e){var i=c.stepBackward();return i.value==="<"?this.$findClosingTag(c,e):this.$findOpeningTag(c,e)}},this.$findTagName=function(r){var c=r.getCurrentToken(),e=!1,i=!1;if(c&&c.type.indexOf("tag-name")===-1)do i?c=r.stepBackward():c=r.stepForward(),c&&(c.value==="/>"?i=!0:c.type.indexOf("tag-name")!==-1&&(e=!0));while(c&&!e);return c},this.$findClosingTag=function(r,c){var e,i=c.value,o=c.value,h=0,s=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+1);c=r.stepForward();var p=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+c.value.length),f=!1;do{if(e=c,e.type.indexOf("tag-close")!==-1&&!f){var g=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+1);f=!0}if(c=r.stepForward(),c){if(c.value===">"&&!f){var g=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+1);f=!0}if(c.type.indexOf("tag-name")!==-1){if(i=c.value,o===i){if(e.value==="<")h++;else if(e.value==="</"&&(h--,h<0)){r.stepBackward();var y=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+2);c=r.stepForward();var A=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+c.value.length);if(c.type.indexOf("tag-close")===-1&&(c=r.stepForward()),c&&c.value===">")var E=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+1);else return}}}else if(o===i&&c.value==="/>"&&(h--,h<0))var y=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+2),A=y,E=A,g=new u(p.end.row,p.end.column,p.end.row,p.end.column+1)}}while(c&&h>=0);if(s&&g&&y&&E&&p&&A)return{openTag:new u(s.start.row,s.start.column,g.end.row,g.end.column),closeTag:new u(y.start.row,y.start.column,E.end.row,E.end.column),openTagName:p,closeTagName:A}},this.$findOpeningTag=function(r,c){var e=r.getCurrentToken(),i=c.value,o=0,h=r.getCurrentTokenRow(),s=r.getCurrentTokenColumn(),p=s+2,f=new u(h,s,h,p);r.stepForward();var g=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+c.value.length);if(c.type.indexOf("tag-close")===-1&&(c=r.stepForward()),!(!c||c.value!==">")){var y=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+1);r.stepBackward(),r.stepBackward();do if(c=e,h=r.getCurrentTokenRow(),s=r.getCurrentTokenColumn(),p=s+c.value.length,e=r.stepBackward(),c){if(c.type.indexOf("tag-name")!==-1){if(i===c.value)if(e.value==="<"){if(o++,o>0){var A=new u(h,s,h,p),E=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+1);do c=r.stepForward();while(c&&c.value!==">");var w=new u(r.getCurrentTokenRow(),r.getCurrentTokenColumn(),r.getCurrentTokenRow(),r.getCurrentTokenColumn()+1)}}else e.value==="</"&&o--}else if(c.value==="/>"){for(var m=0,S=e;S;){if(S.type.indexOf("tag-name")!==-1&&S.value===i){o--;break}else if(S.value==="<")break;S=r.stepBackward(),m++}for(var M=0;M<m;M++)r.stepForward()}}while(e&&o<=0);if(E&&w&&f&&y&&A&&g)return{openTag:new u(E.start.row,E.start.column,w.end.row,w.end.column),closeTag:new u(f.start.row,f.start.column,y.end.row,y.end.column),openTagName:A,closeTagName:g}}}}l.BracketMatch=d}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(n,l,v){var a=n("./lib/oop"),u=n("./lib/lang"),d=n("./bidihandler").BidiHandler,r=n("./config"),c=n("./lib/event_emitter").EventEmitter,e=n("./selection").Selection,i=n("./mode/text").Mode,o=n("./range").Range,h=n("./line_widgets").LineWidgets,s=n("./document").Document,p=n("./background_tokenizer").BackgroundTokenizer,f=n("./search_highlight").SearchHighlight,g=n("./undomanager").UndoManager,y=(function(){function x($,C){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$editor=null,this.prevOp={},this.$foldData=[],this.id="session"+ ++x.$uid,this.$foldData.toString=function(){return this.join(`
205
+ `)},this.$gutterCustomWidgets={},this.bgTokenizer=new p(new i().getTokenizer(),this);var b=this;this.bgTokenizer.on("update",function(T){b._signal("tokenizerUpdate",T)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof $!="object"||!$.getLine)&&($=new s($)),this.setDocument($),this.selection=new e(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new d(this),r.resetOptions(this),this.setMode(C),r._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return x.prototype.$initOperationListeners=function(){var $=this;this.curOp=null,this.on("change",function(){$.curOp||($.startOperation(),$.curOp.selectionBefore=$.$lastSel),$.curOp.docChanged=!0},!0),this.on("changeSelection",function(){$.curOp||($.startOperation(),$.curOp.selectionBefore=$.$lastSel),$.curOp.selectionChanged=!0},!0),this.$operationResetTimer=u.delayedCall(this.endOperation.bind(this,!0))},x.prototype.startOperation=function($){if(this.curOp){if(!$||this.curOp.command)return;this.prevOp=this.curOp}$||($={}),this.$operationResetTimer.schedule(),this.curOp={command:$.command||{},args:$.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",$)},x.prototype.endOperation=function($){if(this.curOp){if($&&$.returnValue===!1){this.curOp=null,this._signal("endOperation",$);return}if($==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var C=this.selection.toJSON();this.curOp.selectionAfter=C,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(C),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",$)}},x.prototype.setDocument=function($){this.doc&&this.doc.off("change",this.$onChange),this.doc=$,$.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},x.prototype.getDocument=function(){return this.doc},Object.defineProperty(x.prototype,"widgetManager",{get:function(){var $=new h(this);return this.widgetManager=$,this.$editor&&$.attach(this.$editor),$},set:function($){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:$})},enumerable:!1,configurable:!0}),x.prototype.$resetRowCache=function($){if(!$){this.$docRowCache=[],this.$screenRowCache=[];return}var C=this.$docRowCache.length,b=this.$getRowCacheIndex(this.$docRowCache,$)+1;C>b&&(this.$docRowCache.splice(b,C),this.$screenRowCache.splice(b,C))},x.prototype.$getRowCacheIndex=function($,C){for(var b=0,T=$.length-1;b<=T;){var I=b+T>>1,O=$[I];if(C>O)b=I+1;else if(C<O)T=I-1;else return I}return b-1},x.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},x.prototype.onChangeFold=function($){var C=$.data;this.$resetRowCache(C.start.row)},x.prototype.onChange=function($){this.$modified=!0,this.$bidiHandler.onChange($),this.$resetRowCache($.start.row);var C=this.$updateInternalDataOnChange($);!this.$fromUndo&&this.$undoManager&&(C&&C.length&&(this.$undoManager.add({action:"removeFolds",folds:C},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add($,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange($),this._signal("change",$)},x.prototype.onSelectionChange=function(){this._signal("changeSelection")},x.prototype.setValue=function($){this.doc.setValue($),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},x.fromJSON=function($){typeof $=="string"&&($=JSON.parse($));var C=new g;C.$undoStack=$.history.undo,C.$redoStack=$.history.redo,C.mark=$.history.mark,C.$rev=$.history.rev;var b=new x($.value);return $.folds.forEach(function(T){b.addFold("...",o.fromPoints(T.start,T.end))}),b.setAnnotations($.annotations),b.setBreakpoints($.breakpoints),b.setMode($.mode),b.setScrollLeft($.scrollLeft),b.setScrollTop($.scrollTop),b.setUndoManager(C),b.selection.fromJSON($.selection),b},x.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function($){return $.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},x.prototype.toString=function(){return this.doc.getValue()},x.prototype.getSelection=function(){return this.selection},x.prototype.getState=function($){return this.bgTokenizer.getState($)},x.prototype.getTokens=function($){return this.bgTokenizer.getTokens($)},x.prototype.getTokenAt=function($,C){var b=this.bgTokenizer.getTokens($),T,I=0;if(C==null){var O=b.length-1;I=this.getLine($).length}else for(var O=0;O<b.length&&(I+=b[O].value.length,!(I>=C));O++);return T=b[O],T?(T.index=O,T.start=I-T.value.length,T):null},x.prototype.setUndoManager=function($){if(this.$undoManager=$,this.$informUndoManager&&this.$informUndoManager.cancel(),$){var C=this;$.addSession(this),this.$syncInformUndoManager=function(){C.$informUndoManager.cancel(),C.mergeUndoDeltas=!1},this.$informUndoManager=u.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},x.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},x.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},x.prototype.getTabString=function(){return this.getUseSoftTabs()?u.stringRepeat(" ",this.getTabSize()):" "},x.prototype.setUseSoftTabs=function($){this.setOption("useSoftTabs",$)},x.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},x.prototype.setTabSize=function($){this.setOption("tabSize",$)},x.prototype.getTabSize=function(){return this.$tabSize},x.prototype.isTabStop=function($){return this.$useSoftTabs&&$.column%this.$tabSize===0},x.prototype.setNavigateWithinSoftTabs=function($){this.setOption("navigateWithinSoftTabs",$)},x.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},x.prototype.setOverwrite=function($){this.setOption("overwrite",$)},x.prototype.getOverwrite=function(){return this.$overwrite},x.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},x.prototype.addGutterDecoration=function($,C){this.$decorations[$]||(this.$decorations[$]=""),this.$decorations[$]+=" "+C,this._signal("changeBreakpoint",{})},x.prototype.removeGutterCustomWidget=function($){this.$editor&&this.$editor.renderer.$gutterLayer.$removeCustomWidget($)},x.prototype.addGutterCustomWidget=function($,C){this.$editor&&this.$editor.renderer.$gutterLayer.$addCustomWidget($,C)},x.prototype.removeGutterDecoration=function($,C){this.$decorations[$]=(this.$decorations[$]||"").replace(" "+C,""),this._signal("changeBreakpoint",{})},x.prototype.getBreakpoints=function(){return this.$breakpoints},x.prototype.setBreakpoints=function($){this.$breakpoints=[];for(var C=0;C<$.length;C++)this.$breakpoints[$[C]]="ace_breakpoint";this._signal("changeBreakpoint",{})},x.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},x.prototype.setBreakpoint=function($,C){C===void 0&&(C="ace_breakpoint"),C?this.$breakpoints[$]=C:delete this.$breakpoints[$],this._signal("changeBreakpoint",{})},x.prototype.clearBreakpoint=function($){delete this.$breakpoints[$],this._signal("changeBreakpoint",{})},x.prototype.addMarker=function($,C,b,T){var I=this.$markerId++,O={range:$,type:b||"line",renderer:typeof b=="function"?b:null,clazz:C,inFront:!!T,id:I};return T?(this.$frontMarkers[I]=O,this._signal("changeFrontMarker")):(this.$backMarkers[I]=O,this._signal("changeBackMarker")),I},x.prototype.addDynamicMarker=function($,C){if($.update){var b=this.$markerId++;return $.id=b,$.inFront=!!C,C?(this.$frontMarkers[b]=$,this._signal("changeFrontMarker")):(this.$backMarkers[b]=$,this._signal("changeBackMarker")),$}},x.prototype.removeMarker=function($){var C=this.$frontMarkers[$]||this.$backMarkers[$];if(C){var b=C.inFront?this.$frontMarkers:this.$backMarkers;delete b[$],this._signal(C.inFront?"changeFrontMarker":"changeBackMarker")}},x.prototype.getMarkers=function($){return $?this.$frontMarkers:this.$backMarkers},x.prototype.highlight=function($){if(!this.$searchHighlight){var C=new f(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(C)}this.$searchHighlight.setRegexp($)},x.prototype.highlightLines=function($,C,b,T){typeof C!="number"&&(b=C,C=$),b||(b="ace_step");var I=new o($,0,C,1/0);return I.id=this.addMarker(I,b,"fullLine",T),I},x.prototype.setAnnotations=function($){this.$annotations=$,this._signal("changeAnnotation",{})},x.prototype.getAnnotations=function(){return this.$annotations||[]},x.prototype.clearAnnotations=function(){this.setAnnotations([])},x.prototype.$detectNewLine=function($){var C=$.match(/^.*?(\r?\n)/m);C?this.$autoNewLine=C[1]:this.$autoNewLine=`
206
+ `},x.prototype.getWordRange=function($,C){var b=this.getLine($),T=!1;if(C>0&&(T=!!b.charAt(C-1).match(this.tokenRe)),T||(T=!!b.charAt(C).match(this.tokenRe)),T)var I=this.tokenRe;else if(/^\s+$/.test(b.slice(C-1,C+1)))var I=/\s/;else var I=this.nonTokenRe;var O=C;if(O>0){do O--;while(O>=0&&b.charAt(O).match(I));O++}for(var N=C;N<b.length&&b.charAt(N).match(I);)N++;return new o($,O,$,N)},x.prototype.getAWordRange=function($,C){for(var b=this.getWordRange($,C),T=this.getLine(b.end.row);T.charAt(b.end.column).match(/[ \t]/);)b.end.column+=1;return b},x.prototype.setNewLineMode=function($){this.doc.setNewLineMode($)},x.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},x.prototype.setUseWorker=function($){this.setOption("useWorker",$)},x.prototype.getUseWorker=function(){return this.$useWorker},x.prototype.onReloadTokenizer=function($){var C=$.data;this.bgTokenizer.start(C.first),this._signal("tokenizerUpdate",$)},x.prototype.setMode=function($,C){if($&&typeof $=="object"){if($.getTokenizer)return this.$onChangeMode($);var b=$,T=b.path}else T=$||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new i),this.$modes[T]&&!b){this.$onChangeMode(this.$modes[T]),C&&C();return}this.$modeId=T,r.loadModule(["mode",T],function(I){if(!this.destroyed){if(this.$modeId!==T)return C&&C();this.$modes[T]&&!b?this.$onChangeMode(this.$modes[T]):I&&I.Mode&&(I=new I.Mode(b),b||(this.$modes[T]=I,I.$id=T),this.$onChangeMode(I)),C&&C()}}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},x.prototype.$onChangeMode=function($,C){if(C||(this.$modeId=$.$id),this.$mode!==$){var b=this.$mode;this.$mode=$,this.$stopWorker(),this.$useWorker&&this.$startWorker();var T=$.getTokenizer();if(T.on!==void 0){var I=this.onReloadTokenizer.bind(this);T.on("update",I)}this.bgTokenizer.setTokenizer(T),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=$.tokenRe,this.nonTokenRe=$.nonTokenRe,C||($.attachToSession&&$.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding($.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:b,mode:$}))}},x.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},x.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch($){r.warn("Could not load worker",$),this.$worker=null}},x.prototype.getMode=function(){return this.$mode},x.prototype.setScrollTop=function($){this.$scrollTop===$||isNaN($)||(this.$scrollTop=$,this._signal("changeScrollTop",$))},x.prototype.getScrollTop=function(){return this.$scrollTop},x.prototype.setScrollLeft=function($){this.$scrollLeft===$||isNaN($)||(this.$scrollLeft=$,this._signal("changeScrollLeft",$))},x.prototype.getScrollLeft=function(){return this.$scrollLeft},x.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},x.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var $=0;return this.lineWidgets.forEach(function(C){C&&C.screenWidth>$&&($=C.screenWidth)}),this.lineWidgetWidth=$},x.prototype.$computeWidth=function($){if(this.$modified||$){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var C=this.doc.getAllLines(),b=this.$rowLengthCache,T=0,I=0,O=this.$foldData[I],N=O?O.start.row:1/0,P=C.length,B=0;B<P;B++){if(B>N){if(B=O.end.row+1,B>=P)break;O=this.$foldData[I++],N=O?O.start.row:1/0}b[B]==null&&(b[B]=this.$getStringScreenWidth(C[B])[0]),b[B]>T&&(T=b[B])}this.screenWidth=T}},x.prototype.getLine=function($){return this.doc.getLine($)},x.prototype.getLines=function($,C){return this.doc.getLines($,C)},x.prototype.getLength=function(){return this.doc.getLength()},x.prototype.getTextRange=function($){return this.doc.getTextRange($||this.selection.getRange())},x.prototype.insert=function($,C){return this.doc.insert($,C)},x.prototype.remove=function($){return this.doc.remove($)},x.prototype.removeFullLines=function($,C){return this.doc.removeFullLines($,C)},x.prototype.undoChanges=function($,C){if($.length){this.$fromUndo=!0;for(var b=$.length-1;b!=-1;b--){var T=$[b];T.action=="insert"||T.action=="remove"?this.doc.revertDelta(T):T.folds&&this.addFolds(T.folds)}!C&&this.$undoSelect&&($.selectionBefore?this.selection.fromJSON($.selectionBefore):this.selection.setRange(this.$getUndoSelection($,!0))),this.$fromUndo=!1}},x.prototype.redoChanges=function($,C){if($.length){this.$fromUndo=!0;for(var b=0;b<$.length;b++){var T=$[b];(T.action=="insert"||T.action=="remove")&&this.doc.$safeApplyDelta(T)}!C&&this.$undoSelect&&($.selectionAfter?this.selection.fromJSON($.selectionAfter):this.selection.setRange(this.$getUndoSelection($,!1))),this.$fromUndo=!1}},x.prototype.setUndoSelect=function($){this.$undoSelect=$},x.prototype.$getUndoSelection=function($,C){function b(P){return C?P.action!=="insert":P.action==="insert"}for(var T,I,O=0;O<$.length;O++){var N=$[O];if(N.start){if(!T){b(N)?T=o.fromPoints(N.start,N.end):T=o.fromPoints(N.start,N.start);continue}b(N)?(I=N.start,T.compare(I.row,I.column)==-1&&T.setStart(I),I=N.end,T.compare(I.row,I.column)==1&&T.setEnd(I)):(I=N.start,T.compare(I.row,I.column)==-1&&(T=o.fromPoints(N.start,N.start)))}}return T},x.prototype.replace=function($,C){return this.doc.replace($,C)},x.prototype.moveText=function($,C,b){var T=this.getTextRange($),I=this.getFoldsInRange($),O=o.fromPoints(C,C);if(!b){this.remove($);var N=$.start.row-$.end.row,P=N?-$.end.column:$.start.column-$.end.column;P&&(O.start.row==$.end.row&&O.start.column>$.end.column&&(O.start.column+=P),O.end.row==$.end.row&&O.end.column>$.end.column&&(O.end.column+=P)),N&&O.start.row>=$.end.row&&(O.start.row+=N,O.end.row+=N)}if(O.end=this.insert(O.start,T),I.length){var B=$.start,V=O.start,N=V.row-B.row,P=V.column-B.column;this.addFolds(I.map(function(U){return U=U.clone(),U.start.row==B.row&&(U.start.column+=P),U.end.row==B.row&&(U.end.column+=P),U.start.row+=N,U.end.row+=N,U}))}return O},x.prototype.indentRows=function($,C,b){b=b.replace(/\t/g,this.getTabString());for(var T=$;T<=C;T++)this.doc.insertInLine({row:T,column:0},b)},x.prototype.outdentRows=function($){for(var C=$.collapseRows(),b=new o(0,0,0,0),T=this.getTabSize(),I=C.start.row;I<=C.end.row;++I){var O=this.getLine(I);b.start.row=I,b.end.row=I;for(var N=0;N<T&&O.charAt(N)==" ";++N);N<T&&O.charAt(N)==" "?(b.start.column=N,b.end.column=N+1):(b.start.column=0,b.end.column=N),this.remove(b)}},x.prototype.$moveLines=function($,C,b){if($=this.getRowFoldStart($),C=this.getRowFoldEnd(C),b<0){var T=this.getRowFoldStart($+b);if(T<0)return 0;var I=T-$}else if(b>0){var T=this.getRowFoldEnd(C+b);if(T>this.doc.getLength()-1)return 0;var I=T-C}else{$=this.$clipRowToDocument($),C=this.$clipRowToDocument(C);var I=C-$+1}var O=new o($,0,C,Number.MAX_VALUE),N=this.getFoldsInRange(O).map(function(B){return B=B.clone(),B.start.row+=I,B.end.row+=I,B}),P=b==0?this.doc.getLines($,C):this.doc.removeFullLines($,C);return this.doc.insertFullLines($+I,P),N.length&&this.addFolds(N),I},x.prototype.moveLinesUp=function($,C){return this.$moveLines($,C,-1)},x.prototype.moveLinesDown=function($,C){return this.$moveLines($,C,1)},x.prototype.duplicateLines=function($,C){return this.$moveLines($,C,0)},x.prototype.$clipRowToDocument=function($){return Math.max(0,Math.min($,this.doc.getLength()-1))},x.prototype.$clipColumnToRow=function($,C){return C<0?0:Math.min(this.doc.getLine($).length,C)},x.prototype.$clipPositionToDocument=function($,C){if(C=Math.max(0,C),$<0)$=0,C=0;else{var b=this.doc.getLength();$>=b?($=b-1,C=this.doc.getLine(b-1).length):C=Math.min(this.doc.getLine($).length,C)}return{row:$,column:C}},x.prototype.$clipRangeToDocument=function($){$.start.row<0?($.start.row=0,$.start.column=0):$.start.column=this.$clipColumnToRow($.start.row,$.start.column);var C=this.doc.getLength()-1;return $.end.row>C?($.end.row=C,$.end.column=this.doc.getLine(C).length):$.end.column=this.$clipColumnToRow($.end.row,$.end.column),$},x.prototype.setUseWrapMode=function($){if($!=this.$useWrapMode){if(this.$useWrapMode=$,this.$modified=!0,this.$resetRowCache(0),$){var C=this.getLength();this.$wrapData=Array(C),this.$updateWrapData(0,C-1)}this._signal("changeWrapMode")}},x.prototype.getUseWrapMode=function(){return this.$useWrapMode},x.prototype.setWrapLimitRange=function($,C){(this.$wrapLimitRange.min!==$||this.$wrapLimitRange.max!==C)&&(this.$wrapLimitRange={min:$,max:C},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},x.prototype.adjustWrapLimit=function($,C){var b=this.$wrapLimitRange;b.max<0&&(b={min:C,max:C});var T=this.$constrainWrapLimit($,b.min,b.max);return T!=this.$wrapLimit&&T>1?(this.$wrapLimit=T,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},x.prototype.$constrainWrapLimit=function($,C,b){return C&&($=Math.max(C,$)),b&&($=Math.min(b,$)),$},x.prototype.getWrapLimit=function(){return this.$wrapLimit},x.prototype.setWrapLimit=function($){this.setWrapLimitRange($,$)},x.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},x.prototype.$updateInternalDataOnChange=function($){var C=this.$useWrapMode,b=$.action,T=$.start,I=$.end,O=T.row,N=I.row,P=N-O,B=null;if(this.$updating=!0,P!=0)if(b==="remove"){this[C?"$wrapData":"$rowLengthCache"].splice(O,P);var V=this.$foldData;B=this.getFoldsInRange($),this.removeFolds(B);var W=this.getFoldLine(I.row),z=0;if(W){W.addRemoveChars(I.row,I.column,T.column-I.column),W.shiftRow(-P);var U=this.getFoldLine(O);U&&U!==W&&(U.merge(W),W=U),z=V.indexOf(W)+1}for(z;z<V.length;z++){var W=V[z];W.start.row>=I.row&&W.shiftRow(-P)}N=O}else{var G=Array(P);G.unshift(O,0);var Y=C?this.$wrapData:this.$rowLengthCache;Y.splice.apply(Y,G);var V=this.$foldData,W=this.getFoldLine(O),z=0;if(W){var Q=W.range.compareInside(T.row,T.column);Q==0?(W=W.split(T.row,T.column),W&&(W.shiftRow(P),W.addRemoveChars(N,0,I.column-T.column))):Q==-1&&(W.addRemoveChars(O,0,I.column-T.column),W.shiftRow(P)),z=V.indexOf(W)+1}for(z;z<V.length;z++){var W=V[z];W.start.row>=O&&W.shiftRow(P)}}else{P=Math.abs($.start.column-$.end.column),b==="remove"&&(B=this.getFoldsInRange($),this.removeFolds(B),P=-P);var W=this.getFoldLine(O);W&&W.addRemoveChars(O,T.column,P)}return C&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,C?this.$updateWrapData(O,N):this.$updateRowLengthCache(O,N),B},x.prototype.$updateRowLengthCache=function($,C){this.$rowLengthCache[$]=null,this.$rowLengthCache[C]=null},x.prototype.$updateWrapData=function($,C){var b=this.doc.getAllLines(),T=this.getTabSize(),I=this.$wrapData,O=this.$wrapLimit,N,P,B=$;for(C=Math.min(C,b.length-1);B<=C;)P=this.getFoldLine(B,P),P?(N=[],P.walk(function(V,W,z,U){var G;if(V!=null){G=this.$getDisplayTokens(V,N.length),G[0]=w;for(var Y=1;Y<G.length;Y++)G[Y]=m}else G=this.$getDisplayTokens(b[W].substring(U,z),N.length);N=N.concat(G)}.bind(this),P.end.row,b[P.end.row].length+1),I[P.start.row]=this.$computeWrapSplits(N,O,T),B=P.end.row+1):(N=this.$getDisplayTokens(b[B]),I[B]=this.$computeWrapSplits(N,O,T),B++)},x.prototype.$computeWrapSplits=function($,C,b){if($.length==0)return[];var T=[],I=$.length,O=0,N=0,P=this.$wrapAsCode,B=this.$indentedSoftWrap,V=C<=Math.max(2*b,8)||B===!1?0:Math.floor(C/2);function W(){var Q=0;if(V===0)return Q;if(B)for(var q=0;q<$.length;q++){var te=$[q];if(te==M)Q+=1;else if(te==D)Q+=b;else{if(te==_)continue;break}}return P&&B!==!1&&(Q+=b),Math.min(Q,V)}function z(Q){for(var q=Q-O,te=O;te<Q;te++){var re=$[te];(re===12||re===2)&&(q-=1)}T.length||(U=W(),T.indent=U),N+=q,T.push(N),O=Q}for(var U=0;I-O>C-U;){var G=O+C-U;if($[G-1]>=M&&$[G]>=M){z(G);continue}if($[G]==w||$[G]==m){for(G;G!=O-1&&$[G]!=w;G--);if(G>O){z(G);continue}for(G=O+C,G;G<$.length&&$[G]==m;G++);if(G==$.length)break;z(G);continue}for(var Y=Math.max(G-(C-(C>>2)),O-1);G>Y&&$[G]<w;)G--;if(P){for(;G>Y&&$[G]<w;)G--;for(;G>Y&&$[G]==S;)G--}else for(;G>Y&&$[G]<M;)G--;if(G>Y){z(++G);continue}G=O+C,$[G]==E&&G--,z(G-U)}return T},x.prototype.$getDisplayTokens=function($,C){var b=[],T;C=C||0;for(var I=0;I<$.length;I++){var O=$.charCodeAt(I);if(O==9){T=this.getScreenTabSize(b.length+C),b.push(D);for(var N=1;N<T;N++)b.push(_)}else O==32?b.push(M):O>39&&O<48||O>57&&O<64?b.push(S):O>=4352&&F(O)?b.push(A,E):b.push(A)}return b},x.prototype.$getStringScreenWidth=function($,C,b){if(C==0)return[0,0];C==null&&(C=1/0),b=b||0;var T,I;for(I=0;I<$.length&&(T=$.charCodeAt(I),T==9?b+=this.getScreenTabSize(b):T>=4352&&F(T)?b+=2:b+=1,!(b>C));I++);return[b,I]},x.prototype.getRowLength=function($){var C=1;return this.lineWidgets&&(C+=this.lineWidgets[$]&&this.lineWidgets[$].rowCount||0),!this.$useWrapMode||!this.$wrapData[$]?C:this.$wrapData[$].length+C},x.prototype.getRowLineCount=function($){return!this.$useWrapMode||!this.$wrapData[$]?1:this.$wrapData[$].length+1},x.prototype.getRowWrapIndent=function($){if(this.$useWrapMode){var C=this.screenToDocumentPosition($,Number.MAX_VALUE),b=this.$wrapData[C.row];return b.length&&b[0]<C.column?b.indent:0}else return 0},x.prototype.getScreenLastRowColumn=function($){var C=this.screenToDocumentPosition($,Number.MAX_VALUE);return this.documentToScreenColumn(C.row,C.column)},x.prototype.getDocumentLastRowColumn=function($,C){var b=this.documentToScreenRow($,C);return this.getScreenLastRowColumn(b)},x.prototype.getDocumentLastRowColumnPosition=function($,C){var b=this.documentToScreenRow($,C);return this.screenToDocumentPosition(b,Number.MAX_VALUE/10)},x.prototype.getRowSplitData=function($){if(this.$useWrapMode)return this.$wrapData[$]},x.prototype.getScreenTabSize=function($){return this.$tabSize-($%this.$tabSize|0)},x.prototype.screenToDocumentRow=function($,C){return this.screenToDocumentPosition($,C).row},x.prototype.screenToDocumentColumn=function($,C){return this.screenToDocumentPosition($,C).column},x.prototype.screenToDocumentPosition=function($,C,b){if($<0)return{row:0,column:0};var T,I=0,O=0,N,P=0,B=0,V=this.$screenRowCache,W=this.$getRowCacheIndex(V,$),z=V.length;if(z&&W>=0)var P=V[W],I=this.$docRowCache[W],U=$>V[z-1];else var U=!z;for(var G=this.getLength()-1,Y=this.getNextFoldLine(I),Q=Y?Y.start.row:1/0;P<=$&&(B=this.getRowLength(I),!(P+B>$||I>=G));)P+=B,I++,I>Q&&(I=Y.end.row+1,Y=this.getNextFoldLine(I,Y),Q=Y?Y.start.row:1/0),U&&(this.$docRowCache.push(I),this.$screenRowCache.push(P));if(Y&&Y.start.row<=I)T=this.getFoldDisplayLine(Y),I=Y.start.row;else{if(P+B<=$||I>G)return{row:G,column:this.getLine(G).length};T=this.getLine(I),Y=null}var q=0,te=Math.floor($-P);if(this.$useWrapMode){var re=this.$wrapData[I];re&&(N=re[te],te>0&&re.length&&(q=re.indent,O=re[te-1]||re[re.length-1],T=T.substring(O)))}return b!==void 0&&this.$bidiHandler.isBidiRow(P+te,I,te)&&(C=this.$bidiHandler.offsetToCol(b)),O+=this.$getStringScreenWidth(T,C-q)[1],this.$useWrapMode&&O>=N&&(O=N-1),Y?Y.idxToPosition(O):{row:I,column:O}},x.prototype.documentToScreenPosition=function($,C){if(typeof C>"u")var b=this.$clipPositionToDocument($.row,$.column);else b=this.$clipPositionToDocument($,C);$=b.row,C=b.column;var T=0,I=null,O=null;O=this.getFoldAt($,C,1),O&&($=O.start.row,C=O.start.column);var N,P=0,B=this.$docRowCache,V=this.$getRowCacheIndex(B,$),W=B.length;if(W&&V>=0)var P=B[V],T=this.$screenRowCache[V],z=$>B[W-1];else var z=!W;for(var U=this.getNextFoldLine(P),G=U?U.start.row:1/0;P<$;){if(P>=G){if(N=U.end.row+1,N>$)break;U=this.getNextFoldLine(N,U),G=U?U.start.row:1/0}else N=P+1;T+=this.getRowLength(P),P=N,z&&(this.$docRowCache.push(P),this.$screenRowCache.push(T))}var Y="";U&&P>=G?(Y=this.getFoldDisplayLine(U,$,C),I=U.start.row):(Y=this.getLine($).substring(0,C),I=$);var Q=0;if(this.$useWrapMode){var q=this.$wrapData[I];if(q){for(var te=0;Y.length>=q[te];)T++,te++;Y=Y.substring(q[te-1]||0,Y.length),Q=te>0?q.indent:0}}return this.lineWidgets&&this.lineWidgets[P]&&this.lineWidgets[P].rowsAbove&&(T+=this.lineWidgets[P].rowsAbove),{row:T,column:Q+this.$getStringScreenWidth(Y)[0]}},x.prototype.documentToScreenColumn=function($,C){return this.documentToScreenPosition($,C).column},x.prototype.documentToScreenRow=function($,C){return this.documentToScreenPosition($,C).row},x.prototype.getScreenLength=function(){var $=0,C=null;if(this.$useWrapMode)for(var I=this.$wrapData.length,O=0,T=0,C=this.$foldData[T++],N=C?C.start.row:1/0;O<I;){var P=this.$wrapData[O];$+=P?P.length+1:1,O++,O>N&&(O=C.end.row+1,C=this.$foldData[T++],N=C?C.start.row:1/0)}else{$=this.getLength();for(var b=this.$foldData,T=0;T<b.length;T++)C=b[T],$-=C.end.row-C.start.row}return this.lineWidgets&&($+=this.$getWidgetScreenLength()),$},x.prototype.$setFontMetrics=function($){this.$enableVarChar&&(this.$getStringScreenWidth=function(C,b,T){if(b===0)return[0,0];b||(b=1/0),T=T||0;var I,O;for(O=0;O<C.length&&(I=C.charAt(O),I===" "?T+=this.getScreenTabSize(T):T+=$.getCharacterWidth(I),!(T>b));O++);return[T,O]})},x.prototype.getPrecedingCharacter=function(){var $=this.selection.getCursor();if($.column===0)return $.row===0?"":this.doc.getNewLineCharacter();var C=this.getLine($.row);return C[$.column-1]},x.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.endOperation(),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection&&(this.selection.off("changeCursor",this.$onSelectionChange),this.selection.off("changeSelection",this.$onSelectionChange)),this.selection.detach()},x})();y.$uid=0,y.prototype.$modes=r.$modes,y.prototype.getValue=y.prototype.toString,y.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},y.prototype.$overwrite=!1,y.prototype.$mode=null,y.prototype.$modeId=null,y.prototype.$scrollTop=0,y.prototype.$scrollLeft=0,y.prototype.$wrapLimit=80,y.prototype.$useWrapMode=!1,y.prototype.$wrapLimitRange={min:null,max:null},y.prototype.lineWidgets=null,y.prototype.isFullWidth=F,a.implement(y.prototype,c);var A=1,E=2,w=3,m=4,S=9,M=10,D=11,_=12;function F(x){return x<4352?!1:x>=4352&&x<=4447||x>=4515&&x<=4519||x>=4602&&x<=4607||x>=9001&&x<=9002||x>=11904&&x<=11929||x>=11931&&x<=12019||x>=12032&&x<=12245||x>=12272&&x<=12283||x>=12288&&x<=12350||x>=12353&&x<=12438||x>=12441&&x<=12543||x>=12549&&x<=12589||x>=12593&&x<=12686||x>=12688&&x<=12730||x>=12736&&x<=12771||x>=12784&&x<=12830||x>=12832&&x<=12871||x>=12880&&x<=13054||x>=13056&&x<=19903||x>=19968&&x<=42124||x>=42128&&x<=42182||x>=43360&&x<=43388||x>=44032&&x<=55203||x>=55216&&x<=55238||x>=55243&&x<=55291||x>=63744&&x<=64255||x>=65040&&x<=65049||x>=65072&&x<=65106||x>=65108&&x<=65126||x>=65128&&x<=65131||x>=65281&&x<=65376||x>=65504&&x<=65510}n("./edit_session/folding").Folding.call(y.prototype),n("./edit_session/bracket_match").BracketMatch.call(y.prototype),r.defineOptions(y.prototype,"session",{wrap:{set:function(x){if(!x||x=="off"?x=!1:x=="free"?x=!0:x=="printMargin"?x=-1:typeof x=="string"&&(x=parseInt(x,10)||!1),this.$wrap!=x)if(this.$wrap=x,!x)this.setUseWrapMode(!1);else{var $=typeof x=="number"?x:null;this.setWrapLimitRange($,$),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(x){x=x=="auto"?this.$mode.type!="text":x!="text",x!=this.$wrapAsCode&&(this.$wrapAsCode=x,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(x){this.$useWorker=x,this.$stopWorker(),x&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(x){x=parseInt(x),x>0&&this.$tabSize!==x&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=x,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(x){this.setFoldStyle(x)},handlesSet:!0},overwrite:{set:function(x){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(x){this.doc.setNewLineMode(x)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(x){this.setMode(x)},get:function(){return this.$modeId},handlesSet:!0}}),l.EditSession=y}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(n,l,v){var a=n("./lib/lang"),u=n("./lib/oop"),d=n("./range").Range,r=(function(){function o(){this.$options={}}return o.prototype.set=function(h){return u.mixin(this.$options,h),this},o.prototype.getOptions=function(){return a.copyObject(this.$options)},o.prototype.setOptions=function(h){this.$options=h},o.prototype.find=function(h){var s=this.$options,p=this.$matchIterator(h,s);if(!p)return!1;var f=null;return p.forEach(function(g,y,A,E){return f=new d(g,y,A,E),y==E&&s.start&&s.start.start&&s.skipCurrent!=!1&&f.isEqual(s.start)?(f=null,!1):!0}),f},o.prototype.findAll=function(h){var s=this.$options;if(!s.needle)return[];this.$assembleRegExp(s);var p=s.range,f=p?h.getLines(p.start.row,p.end.row):h.doc.getAllLines(),g=[],y=s.re;if(s.$isMultiLine){var A=y.length,E=f.length-A,w;e:for(var m=y.offset||0;m<=E;m++){for(var S=0;S<A;S++)if(f[m+S].search(y[S])==-1)continue e;var M=f[m],D=f[m+A-1],_=M.length-M.match(y[0])[0].length,F=D.match(y[A-1])[0].length;w&&w.end.row===m&&w.end.column>_||(g.push(w=new d(m,_,m+A-1,F)),A>2&&(m=m+A-2))}}else for(var x,$=0;$<f.length;$++)if(this.$isMultilineSearch(s)){var C=f.length-1;if(x=this.$multiLineForward(h,y,$,C),x){var b=x.endRow<=C?x.endRow-1:C;b>$&&($=b),g.push(new d(x.startRow,x.startCol,x.endRow,x.endCol))}}else{x=a.getMatchOffsets(f[$],y);for(var S=0;S<x.length;S++){var T=x[S];g.push(new d($,T.offset,$,T.offset+T.length))}}if(p){for(var I=p.start.column,O=p.end.column,$=0,S=g.length-1;$<S&&g[$].start.column<I&&g[$].start.row==0;)$++;for(var N=p.end.row-p.start.row;$<S&&g[S].end.column>O&&g[S].end.row==N;)S--;for(g=g.slice($,S+1),$=0,S=g.length;$<S;$++)g[$].start.row+=p.start.row,g[$].end.row+=p.start.row}return g},o.prototype.parseReplaceString=function(h){for(var s={DollarSign:36,Ampersand:38,Digit0:48,Digit1:49,Digit9:57,Backslash:92,n:110,t:116},p="",f=0,g=h.length;f<g;f++){var y=h.charCodeAt(f);if(y===s.Backslash){if(f++,f>=g){p+="\\";break}var A=h.charCodeAt(f);switch(A){case s.Backslash:p+="\\";break;case s.n:p+=`
207
+ `;break;case s.t:p+=" ";break}continue}if(y===s.DollarSign){if(f++,f>=g){p+="$";break}var E=h.charCodeAt(f);if(E===s.DollarSign){p+="$$";continue}if(E===s.Digit0||E===s.Ampersand){p+="$&";continue}if(s.Digit1<=E&&E<=s.Digit9){p+="$"+h[f];continue}}p+=h[f]}return p||h},o.prototype.replace=function(h,s){var p=this.$options,f=this.$assembleRegExp(p);if(p.$isMultiLine)return s;if(f){var g=this.$isMultilineSearch(p);g&&(h=h.replace(/\r\n|\r|\n/g,`
208
+ `));var y=f.exec(h);if(!y||!g&&y[0].length!=h.length)return null;if(s=p.regExp?this.parseReplaceString(s):s.replace(/\$/g,"$$$$"),s=h.replace(f,s),p.preserveCase){s=s.split("");for(var A=Math.min(h.length,h.length);A--;){var E=h[A];E&&E.toLowerCase()!=E?s[A]=s[A].toUpperCase():s[A]=s[A].toLowerCase()}s=s.join("")}return s}},o.prototype.$assembleRegExp=function(h,s){if(h.needle instanceof RegExp)return h.re=h.needle;var p=h.needle;if(!h.needle)return h.re=!1;h.regExp||(p=a.escapeRegExp(p));var f=h.caseSensitive?"gm":"gmi";try{new RegExp(p,"u"),h.$supportsUnicodeFlag=!0,f+="u"}catch{h.$supportsUnicodeFlag=!1}if(h.wholeWord&&(p=c(p,h)),h.$isMultiLine=!s&&/[\n\r]/.test(p),h.$isMultiLine)return h.re=this.$assembleMultilineRegExp(p,f);try{var g=new RegExp(p,f)}catch{g=!1}return h.re=g},o.prototype.$assembleMultilineRegExp=function(h,s){for(var p=h.replace(/\r\n|\r|\n/g,`$
209
+ ^`).split(`
210
+ `),f=[],g=0;g<p.length;g++)try{f.push(new RegExp(p[g],s))}catch{return!1}return f},o.prototype.$isMultilineSearch=function(h){return h.re&&/\\r\\n|\\r|\\n/.test(h.re.source)&&h.regExp&&!h.$isMultiLine},o.prototype.$multiLineForward=function(h,s,p,f){for(var g,y=i(h,p),A=p;A<=f;){for(var E=0;E<y&&!(A>f);E++){var w=h.getLine(A++);g=g==null?w:g+`
211
+ `+w}var m=s.exec(g);if(s.lastIndex=0,m){var S=g.slice(0,m.index).split(`
212
+ `),M=m[0].split(`
213
+ `),D=p+S.length-1,_=S[S.length-1].length,F=D+M.length-1,x=M.length==1?_+M[0].length:M[M.length-1].length;return{startRow:D,startCol:_,endRow:F,endCol:x}}}return null},o.prototype.$multiLineBackward=function(h,s,p,f,g){for(var y,A=i(h,f),E=h.getLine(f).length-p,w=f;w>=g;){for(var m=0;m<A&&w>=g;m++){var S=h.getLine(w--);y=y==null?S:S+`
214
+ `+y}var M=e(y,s,E);if(M){var D=y.slice(0,M.index).split(`
215
+ `),_=M[0].split(`
216
+ `),F=w+D.length,x=D[D.length-1].length,$=F+_.length-1,C=_.length==1?x+_[0].length:_[_.length-1].length;return{startRow:F,startCol:x,endRow:$,endCol:C}}}return null},o.prototype.$matchIterator=function(h,s){var p=this.$assembleRegExp(s);if(!p)return!1;var f=this.$isMultilineSearch(s),g=this.$multiLineForward,y=this.$multiLineBackward,A=s.backwards==!0,E=s.skipCurrent!=!1,w=p.unicode,m=s.range,S=s.start;S||(S=m?m[A?"end":"start"]:h.selection.getRange()),S.start&&(S=S[E!=A?"end":"start"]);var M=m?m.start.row:0,D=m?m.end.row:h.getLength()-1;if(A)var _=function($){var C=S.row;if(!x(C,S.column,$)){for(C--;C>=M;C--)if(x(C,Number.MAX_VALUE,$))return;if(s.wrap!=!1){for(C=D,M=S.row;C>=M;C--)if(x(C,Number.MAX_VALUE,$))return}}};else var _=function(C){var b=S.row;if(!x(b,S.column,C)){for(b=b+1;b<=D;b++)if(x(b,0,C))return;if(s.wrap!=!1){for(b=M,D=S.row;b<=D;b++)if(x(b,0,C))return}}};if(s.$isMultiLine)var F=p.length,x=function($,C,b){var T=A?$-F+1:$;if(!(T<0||T+F>h.getLength())){var I=h.getLine(T),O=I.search(p[0]);if(!(!A&&O<C||O===-1)){for(var N=1;N<F;N++)if(I=h.getLine(T+N),I.search(p[N])==-1)return;var P=I.match(p[F-1])[0].length;if(!(A&&P>C)&&b(T,O,T+F-1,P))return!0}}};else if(A)var x=function(C,b,T){if(f){var I=y(h,p,b,C,M);if(!I)return!1;if(T(I.startRow,I.startCol,I.endRow,I.endCol))return!0}else{var O=h.getLine(C),N=[],P,B=0;for(p.lastIndex=0;P=p.exec(O);){var V=P[0].length;if(B=P.index,!V){if(B>=O.length)break;p.lastIndex=B+=a.skipEmptyMatch(O,B,w)}if(P.index+V>b)break;N.push(P.index,V)}for(var W=N.length-1;W>=0;W-=2){var z=N[W-1],V=N[W];if(T(C,z,C,z+V))return!0}}};else var x=function(C,b,T){if(p.lastIndex=b,f){var I=g(h,p,C,D);if(I){var O=I.endRow<=D?I.endRow-1:D;O>C&&(C=O)}if(!I)return!1;if(T(I.startRow,I.startCol,I.endRow,I.endCol))return!0}else for(var N=h.getLine(C),P,B;B=p.exec(N);){var V=B[0].length;if(P=B.index,T(C,P,C,P+V))return!0;if(!V&&(p.lastIndex=P+=a.skipEmptyMatch(N,P,w),P>=N.length))return!1}};return{forEach:_}},o})();function c(o,h){var s=a.supportsLookbehind();function p(A,E){E===void 0&&(E=!0);var w=s&&h.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return w.test(A)||h.regExp?s&&h.$supportsUnicodeFlag?E?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var f=Array.from(o),g=f[0],y=f[f.length-1];return p(g)+o+p(y,!1)}function e(o,h,s){for(var p=null,f=0;f<=o.length;){h.lastIndex=f;var g=h.exec(o);if(!g)break;var y=g.index+g[0].length;if(y>o.length-s)break;(!p||y>p.index+p[0].length)&&(p=g),f=g.index+1}return p}function i(o,h){var s=5e3,p={row:h,column:0},f=o.doc.positionToIndex(p),g=f+s,y=o.doc.indexToPosition(g),A=y.row;return A+1}l.Search=r}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(n,l,v){var a=this&&this.__extends||(function(){var o=function(h,s){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,f){p.__proto__=f}||function(p,f){for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(p[g]=f[g])},o(h,s)};return function(h,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");o(h,s);function p(){this.constructor=h}h.prototype=s===null?Object.create(s):(p.prototype=s.prototype,new p)}})(),u=n("../lib/keys"),d=n("../lib/useragent"),r=u.KEY_MODS,c=(function(){function o(h,s){this.$init(h,s,!1)}return o.prototype.$init=function(h,s,p){this.platform=s||(d.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(h),this.$singleCommand=p},o.prototype.addCommand=function(h){this.commands[h.name]&&this.removeCommand(h),this.commands[h.name]=h,h.bindKey&&this._buildKeyHash(h)},o.prototype.removeCommand=function(h,s){var p=h&&(typeof h=="string"?h:h.name);h=this.commands[p],s||delete this.commands[p];var f=this.commandKeyBinding;for(var g in f){var y=f[g];if(y==h)delete f[g];else if(Array.isArray(y)){var A=y.indexOf(h);A!=-1&&(y.splice(A,1),y.length==1&&(f[g]=y[0]))}}},o.prototype.bindKey=function(h,s,p){if(typeof h=="object"&&h&&(p==null&&(p=h.position),h=h[this.platform]),!!h){if(typeof s=="function")return this.addCommand({exec:s,bindKey:h,name:s.name||h});h.split("|").forEach(function(f){var g="";if(f.indexOf(" ")!=-1){var y=f.split(/\s+/);f=y.pop(),y.forEach(function(w){var m=this.parseKeys(w),S=r[m.hashId]+m.key;g+=(g?" ":"")+S,this._addCommandToBinding(g,"chainKeys")},this),g+=" "}var A=this.parseKeys(f),E=r[A.hashId]+A.key;this._addCommandToBinding(g+E,s,p)},this)}},o.prototype._addCommandToBinding=function(h,s,p){var f=this.commandKeyBinding,g;if(!s)delete f[h];else if(!f[h]||this.$singleCommand)f[h]=s;else{Array.isArray(f[h])?(g=f[h].indexOf(s))!=-1&&f[h].splice(g,1):f[h]=[f[h]],typeof p!="number"&&(p=e(s));var y=f[h];for(g=0;g<y.length;g++){var A=y[g],E=e(A);if(E>p)break}y.splice(g,0,s)}},o.prototype.addCommands=function(h){h&&Object.keys(h).forEach(function(s){var p=h[s];if(p){if(typeof p=="string")return this.bindKey(p,s);typeof p=="function"&&(p={exec:p}),typeof p=="object"&&(p.name||(p.name=s),this.addCommand(p))}},this)},o.prototype.removeCommands=function(h){Object.keys(h).forEach(function(s){this.removeCommand(h[s])},this)},o.prototype.bindKeys=function(h){Object.keys(h).forEach(function(s){this.bindKey(s,h[s])},this)},o.prototype._buildKeyHash=function(h){this.bindKey(h.bindKey,h)},o.prototype.parseKeys=function(h){var s=h.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(E){return E}),p=s.pop(),f=u[p];if(u.FUNCTION_KEYS[f])p=u.FUNCTION_KEYS[f].toLowerCase();else if(s.length){if(s.length==1&&s[0]=="shift")return{key:p.toUpperCase(),hashId:-1}}else return{key:p,hashId:-1};for(var g=0,y=s.length;y--;){var A=u.KEY_MODS[s[y]];if(A==null)return typeof console<"u"&&console.error("invalid modifier "+s[y]+" in "+h),!1;g|=A}return{key:p,hashId:g}},o.prototype.findKeyCommand=function(h,s){var p=r[h]+s;return this.commandKeyBinding[p]},o.prototype.handleKeyboard=function(h,s,p,f){if(!(f<0)){var g=r[s]+p,y=this.commandKeyBinding[g];return h.$keyChain&&(h.$keyChain+=" "+g,y=this.commandKeyBinding[h.$keyChain]||y),y&&(y=="chainKeys"||y[y.length-1]=="chainKeys")?(h.$keyChain=h.$keyChain||g,{command:"null"}):(h.$keyChain&&((!s||s==4)&&p.length==1?h.$keyChain=h.$keyChain.slice(0,-g.length-1):(s==-1||f>0)&&(h.$keyChain="")),{command:y})}},o.prototype.getStatusText=function(h,s){return s.$keyChain||""},o})();function e(o){return typeof o=="object"&&o.bindKey&&o.bindKey.position||(o.isDefault?-100:0)}var i=(function(o){a(h,o);function h(s,p){var f=o.call(this,s,p)||this;return f.$singleCommand=!0,f}return h})(c);i.call=function(o,h,s){c.prototype.$init.call(o,h,s,!0)},c.call=function(o,h,s){c.prototype.$init.call(o,h,s,!1)},l.HashHandler=i,l.MultiHashHandler=c}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(n,l,v){var a=this&&this.__extends||(function(){var e=function(i,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,s){h.__proto__=s}||function(h,s){for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(h[p]=s[p])},e(i,o)};return function(i,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");e(i,o);function h(){this.constructor=i}i.prototype=o===null?Object.create(o):(h.prototype=o.prototype,new h)}})(),u=n("../lib/oop"),d=n("../keyboard/hash_handler").MultiHashHandler,r=n("../lib/event_emitter").EventEmitter,c=(function(e){a(i,e);function i(o,h){var s=e.call(this,h,o)||this;return s.byName=s.commands,s.setDefaultHandler("exec",function(p){return p.args?p.command.exec(p.editor,p.args,p.event,!1):p.command.exec(p.editor,{},p.event,!0)}),s}return i.prototype.exec=function(o,h,s){if(Array.isArray(o)){for(var p=o.length;p--;)if(this.exec(o[p],h,s))return!0;return!1}typeof o=="string"&&(o=this.commands[o]);var f={editor:h,command:o,args:s};return this.canExecute(o,h)?(f.returnValue=this._emit("exec",f),this._signal("afterExec",f),f.returnValue!==!1):(this._signal("commandUnavailable",f),!1)},i.prototype.canExecute=function(o,h){return typeof o=="string"&&(o=this.commands[o]),!(!o||h&&h.$readOnly&&!o.readOnly||this.$checkCommandState!=!1&&o.isAvailable&&!o.isAvailable(h))},i.prototype.toggleRecording=function(o){if(!this.$inReplay)return o&&o._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(h){this.macro.push([h.command,h.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},i.prototype.replay=function(o){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(o);try{this.$inReplay=!0,this.macro.forEach(function(h){typeof h=="string"?this.exec(h,o):this.exec(h[0],o,h[1])},this)}finally{this.$inReplay=!1}}},i.prototype.trimMacro=function(o){return o.map(function(h){return typeof h[0]!="string"&&(h[0]=h[0].name),h[1]||(h=h[0]),h})},i})(d);u.implement(c.prototype,r),l.CommandManager=c}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(n,l,v){var a=n("../lib/lang"),u=n("../config"),d=n("../range").Range;function r(e,i){return{win:e,mac:i}}l.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:r("Ctrl-,","Command-,"),exec:function(e){u.loadModule("ace/ext/settings_menu",function(i){i.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:r("Alt-E","F4"),exec:function(e){u.loadModule("ace/ext/error_marker",function(i){i.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:r("Alt-Shift-E","Shift-F4"),exec:function(e){u.loadModule("ace/ext/error_marker",function(i){i.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:r("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:r(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:r("Ctrl-L","Command-L"),exec:function(e,i){typeof i=="number"&&!isNaN(i)&&e.gotoLine(i),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:r("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:r("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:r("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:r("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:r(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:r(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:r("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:r("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:r("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:r("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:r("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:r("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:r("Ctrl-F","Command-F"),exec:function(e){u.loadModule("ace/ext/searchbox",function(i){i.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:r("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:r("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:r("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:r("Up","Up|Ctrl-P"),exec:function(e,i){e.navigateUp(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:r("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:r("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:r("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:r("Down","Down|Ctrl-N"),exec:function(e,i){e.navigateDown(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:r("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:r("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:r("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:r("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:r("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:r("Left","Left|Ctrl-B"),exec:function(e,i){e.navigateLeft(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:r("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:r("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:r("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:r("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:r("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:r("Right","Right|Ctrl-F"),exec:function(e,i){e.navigateRight(i.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:r(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:r("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:r(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:r("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:r("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:r("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:r("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:r("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:r("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:r("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:r(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var i=e.$copyWithEmptySelection&&e.selection.isEmpty(),o=i?e.selection.getLineRange():e.selection.getRange();e._emit("cut",o),o.isEmpty()||e.session.remove(o),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,i){e.$handlePaste(i)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:r("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:r("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:r("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:r("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:r("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:r("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:r("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:r("Ctrl-H","Command-Option-F"),exec:function(e){u.loadModule("ace/ext/searchbox",function(i){i.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:r("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:r("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:r("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:r("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:r("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:r("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:r("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:r("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:r("Shift-Delete",null),exec:function(e){if(e.selection.isEmpty())e.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:r("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:r("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:r("Ctrl-Shift-Backspace",null),exec:function(e){var i=e.selection.getRange();i.start.column=0,e.session.remove(i)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:r("Ctrl-Shift-Delete",null),exec:function(e){var i=e.selection.getRange();i.end.column=Number.MAX_VALUE,e.session.remove(i)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:r("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:r("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:r("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:r("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:r("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:r("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,i){e.insert(i)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,i){e.insert(a.stringRepeat(i.text||"",i.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:r(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:r("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:r("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:r("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:r(null,null),exec:function(e){e.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:r("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var i=e.selection.getRange();i.start.column=i.end.column=0,i.end.row++,e.selection.setRange(i,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:r("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:r(null,null),exec:function(e){for(var i=e.selection.isBackwards(),o=i?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),h=i?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),s=e.session.doc.getLine(o.row).length,p=e.session.doc.getTextRange(e.selection.getRange()),f=p.replace(/\n\s*/," ").length,g=e.session.doc.getLine(o.row),y=o.row+1;y<=h.row+1;y++){var A=a.stringTrimLeft(a.stringTrimRight(e.session.doc.getLine(y)));A.length!==0&&(A=" "+A),g+=A}h.row+1<e.session.doc.getLength()-1&&(g+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new d(o.row,0,h.row+2,0),g),f>0?(e.selection.moveCursorTo(o.row,o.column),e.selection.selectTo(o.row,o.column+f)):(s=e.session.doc.getLine(o.row).length>s?s+1:s,e.selection.moveCursorTo(o.row,s))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:r(null,null),exec:function(e){var i=e.session.doc.getLength()-1,o=e.session.doc.getLine(i).length,h=e.selection.rangeList.ranges,s=[];h.length<1&&(h=[e.selection.getRange()]);for(var p=0;p<h.length;p++)p==h.length-1&&(h[p].end.row===i&&h[p].end.column===o||s.push(new d(h[p].end.row,h[p].end.column,i,o))),p===0?h[p].start.row===0&&h[p].start.column===0||s.push(new d(0,0,h[p].start.row,h[p].start.column)):s.push(new d(h[p-1].end.row,h[p-1].end.column,h[p].start.row,h[p].start.column));e.exitMultiSelectMode(),e.clearSelection();for(var p=0;p<s.length;p++)e.selection.addRange(s[p],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(e){e.selection.clearSelection(),e.navigateLineEnd(),e.insert(`
217
+ `)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(e){e.selection.clearSelection();var i=e.getCursorPosition();e.selection.moveTo(i.row-1,Number.MAX_VALUE),e.insert(`
218
+ `),i.row===0&&e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(e){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),e.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:r("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:r(null,null),exec:function(e){e.prompt({$type:"modes"})},readOnly:!0}];for(var c=1;c<9;c++)l.commands.push({name:"foldToLevel"+c,description:"Fold To Level "+c,level:c,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys"],function(n,l,v){var a=n("../lib/keys"),u=(function(){function r(c){this.editor=c,this.gutterLayer=c.renderer.$gutterLayer,this.element=c.renderer.$gutter,this.lines=c.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=this.editor.$mouseHandler.$tooltip}return r.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},r.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},r.prototype.$onGutterKeyDown=function(c){if(this.annotationTooltip.isOpen){c.preventDefault(),c.keyCode===a.escape&&this.annotationTooltip.hide();return}if(c.target===this.element){if(c.keyCode!=a.enter)return;c.preventDefault();var e=this.editor.getCursorPosition().row;this.editor.isRowVisible(e)||this.editor.scrollToLine(e,!0,!0),setTimeout(function(){var i=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),o=this.$findNearestFoldLaneWidget(i),h=this.$findNearestAnnotation(i);if(!(o===null&&h===null)){var s=this.$findClosestNumber(o,h,i);if(s===o)if(this.activeLane="fold",this.activeRowIndex=o,this.$isCustomWidgetVisible(o)){this.$focusCustomWidget(this.activeRowIndex);return}else{this.$focusFoldWidget(this.activeRowIndex);return}else{this.activeRowIndex=h,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}}}.bind(this),10);return}this.$handleGutterKeyboardInteraction(c),setTimeout(function(){this.editor._signal("gutterkeydown",new d(c,this))}.bind(this),10)},r.prototype.$handleGutterKeyboardInteraction=function(c){if(c.keyCode===a.tab){c.preventDefault();return}if(c.keyCode===a.escape){c.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(c.keyCode===a.up){switch(c.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(c.keyCode===a.down){switch(c.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(c.keyCode===a.left){c.preventDefault(),this.$switchLane("annotation");return}if(c.keyCode===a.right){c.preventDefault(),this.$switchLane("fold");return}if(c.keyCode===a.enter||c.keyCode===a.space){switch(c.preventDefault(),this.activeLane){case"fold":var e=this.$rowIndexToRow(this.activeRowIndex),i=this.editor.session.$gutterCustomWidgets[e];if(i)i.callbacks&&i.callbacks.onClick&&i.callbacks.onClick(c,e);else if(this.gutterLayer.session.foldWidgets[e]==="start"){this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),c),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==e&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(e),this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex)),this.annotationTooltip.$fromKeyboard=!0;break}return}},r.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hide()},r.prototype.$isFoldWidgetVisible=function(c){var e=this.editor.isRowFullyVisible(this.$rowIndexToRow(c)),i=this.$getFoldWidget(c).style.display!=="none";return e&&i},r.prototype.$isCustomWidgetVisible=function(c){var e=this.editor.isRowFullyVisible(this.$rowIndexToRow(c)),i=!!this.$getCustomWidget(c);return e&&i},r.prototype.$isAnnotationVisible=function(c){var e=this.editor.isRowFullyVisible(this.$rowIndexToRow(c)),i=this.$getAnnotation(c).style.display!=="none";return e&&i},r.prototype.$getFoldWidget=function(c){var e=this.lines.get(c),i=e.element;return i.childNodes[1]},r.prototype.$getCustomWidget=function(c){var e=this.lines.get(c),i=e.element;return i.childNodes[3]},r.prototype.$getAnnotation=function(c){var e=this.lines.get(c),i=e.element;return i.childNodes[2]},r.prototype.$findNearestFoldLaneWidget=function(c){if(this.$isCustomWidgetVisible(c)||this.$isFoldWidgetVisible(c))return c;for(var e=0;c-e>0||c+e<this.lines.getLength()-1;){if(e++,c-e>=0&&this.$isCustomWidgetVisible(c-e))return c-e;if(c+e<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(c+e))return c+e;if(c-e>=0&&this.$isFoldWidgetVisible(c-e))return c-e;if(c+e<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(c+e))return c+e}return null},r.prototype.$findNearestAnnotation=function(c){if(this.$isAnnotationVisible(c))return c;for(var e=0;c-e>0||c+e<this.lines.getLength()-1;){if(e++,c-e>=0&&this.$isAnnotationVisible(c-e))return c-e;if(c+e<=this.lines.getLength()-1&&this.$isAnnotationVisible(c+e))return c+e}return null},r.prototype.$focusFoldWidget=function(c){if(c!=null){var e=this.$getFoldWidget(c);e.classList.add(this.editor.renderer.keyboardFocusClassName),e.focus()}},r.prototype.$focusCustomWidget=function(c){if(c!=null){var e=this.$getCustomWidget(c);e&&(e.classList.add(this.editor.renderer.keyboardFocusClassName),e.focus())}},r.prototype.$focusAnnotation=function(c){if(c!=null){var e=this.$getAnnotation(c);e.classList.add(this.editor.renderer.keyboardFocusClassName),e.focus()}},r.prototype.$blurFoldWidget=function(c){var e=this.$getFoldWidget(c);e.classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur()},r.prototype.$blurCustomWidget=function(c){var e=this.$getCustomWidget(c);e&&(e.classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur())},r.prototype.$blurAnnotation=function(c){var e=this.$getAnnotation(c);e.classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur()},r.prototype.$moveFoldWidgetUp=function(){for(var c=this.activeRowIndex;c>0;)if(c--,this.$isFoldWidgetVisible(c)||this.$isCustomWidgetVisible(c)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=c,this.$isFoldWidgetVisible(c)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},r.prototype.$moveFoldWidgetDown=function(){for(var c=this.activeRowIndex;c<this.lines.getLength()-1;)if(c++,this.$isFoldWidgetVisible(c)||this.$isCustomWidgetVisible(c)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=c,this.$isFoldWidgetVisible(c)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},r.prototype.$moveAnnotationUp=function(){for(var c=this.activeRowIndex;c>0;)if(c--,this.$isAnnotationVisible(c)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=c,this.$focusAnnotation(this.activeRowIndex);return}},r.prototype.$moveAnnotationDown=function(){for(var c=this.activeRowIndex;c<this.lines.getLength()-1;)if(c++,this.$isAnnotationVisible(c)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=c,this.$focusAnnotation(this.activeRowIndex);return}},r.prototype.$findClosestNumber=function(c,e,i){return c===null?e:e===null||Math.abs(i-c)<=Math.abs(i-e)?c:e},r.prototype.$switchLane=function(c){switch(c){case"annotation":if(this.activeLane==="annotation")break;var e=this.$findNearestAnnotation(this.activeRowIndex);if(e==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=e,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var i=this.$findNearestFoldLaneWidget(this.activeRowIndex);if(i===null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$isCustomWidgetVisible(i)?this.$focusCustomWidget(this.activeRowIndex):this.$focusFoldWidget(this.activeRowIndex);break}},r.prototype.$rowIndexToRow=function(c){var e=this.lines.get(c);return e?e.row:null},r.prototype.$rowToRowIndex=function(c){for(var e=0;e<this.lines.getLength();e++){var i=this.lines.get(e);if(i.row==c)return e}return null},r})();l.GutterKeyboardHandler=u;var d=(function(){function r(c,e){this.gutterKeyboardHandler=e,this.domEvent=c}return r.prototype.getKey=function(){return a.keyCodeToString(this.domEvent.keyCode)},r.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},r.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},r.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},r})();l.GutterKeyboardEvent=d}),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys","ace/lib/event","ace/tooltip"],function(n,l,v){var a=this&&this.__values||function(C){var b=typeof Symbol=="function"&&Symbol.iterator,T=b&&C[b],I=0;if(T)return T.call(C);if(C&&typeof C.length=="number")return{next:function(){return C&&I>=C.length&&(C=void 0),{value:C&&C[I++],done:!C}}};throw new TypeError(b?"Object is not iterable.":"Symbol.iterator is not defined.")},u=n("./lib/oop"),d=n("./lib/dom"),r=n("./lib/lang"),c=n("./lib/useragent"),e=n("./keyboard/textinput").TextInput,i=n("./mouse/mouse_handler").MouseHandler,o=n("./mouse/fold_handler").FoldHandler,h=n("./keyboard/keybinding").KeyBinding,s=n("./edit_session").EditSession,p=n("./search").Search,f=n("./range").Range,g=n("./lib/event_emitter").EventEmitter,y=n("./commands/command_manager").CommandManager,A=n("./commands/default_commands").commands,E=n("./config"),w=n("./token_iterator").TokenIterator,m=n("./keyboard/gutter_handler").GutterKeyboardHandler,S=n("./config").nls,M=n("./clipboard"),D=n("./lib/keys"),_=n("./lib/event"),F=n("./tooltip").HoverTooltip,x=(function(){function C(b,T,I){this.id="editor"+ ++C.$uid,this.session,this.$toDestroy=[];var O=b.getContainerElement();this.container=O,this.renderer=b,this.commands=new y(c.isMac?"mac":"win",A),typeof document=="object"&&(this.textInput=new e(b.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new i(this),new o(this)),this.keyBinding=new h(this),this.$search=new p().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=r.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(N,P){P._$emitInputEvent.schedule(31)}),this.setSession(T||I&&I.session||new s("")),E.resetOptions(this),I&&this.setOptions(I),E._signal("editor",this)}return C.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},C.prototype.startOperation=function(b){this.session.startOperation(b)},C.prototype.endOperation=function(b){this.session.endOperation(b)},C.prototype.onStartOperation=function(b){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,b||(this.previousCommand=null)},C.prototype.onEndOperation=function(b){if(this.curOp&&this.session){if(b&&b.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var T=this.curOp.command,I=T&&T.scrollIntoView;if(I){switch(I){case"center-animate":I="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var O=this.selection.getRange(),N=this.renderer.layerConfig;(O.start.row>=N.lastRow||O.end.row<=N.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}I=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},C.prototype.$historyTracker=function(b){if(this.$mergeUndoDeltas){var T=this.prevOp,I=this.$mergeableCommands,O=T.command&&b.command.name==T.command.name;if(b.command.name=="insertstring"){var N=b.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),O=O&&this.mergeNextCommand&&(!/\s/.test(N)||/\s/.test(T.args)),this.mergeNextCommand=!0}else O=O&&I.indexOf(b.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(O=!1),O?this.session.mergeUndoDeltas=!0:I.indexOf(b.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},C.prototype.setKeyboardHandler=function(b,T){if(b&&typeof b=="string"&&b!="ace"){this.$keybindingId=b;var I=this;E.loadModule(["keybinding",b],function(O){I.$keybindingId==b&&I.keyBinding.setKeyboardHandler(O&&O.handler),T&&T()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(b),T&&T()},C.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},C.prototype.setSession=function(b){if(this.session!=b){this.curOp&&this.endOperation(),this.curOp={};var T=this.session;if(T){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange),this.session.off("startOperation",this.$onStartOperation),this.session.off("endOperation",this.$onEndOperation);var I=this.session.getSelection();I.off("changeCursor",this.$onCursorChange),I.off("changeSelection",this.$onSelectionChange)}this.session=b,b?(this.$onDocumentChange=this.onDocumentChange.bind(this),b.on("change",this.$onDocumentChange),this.renderer.setSession(b),this.$onChangeMode=this.onChangeMode.bind(this),b.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),b.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),b.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),b.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),b.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),b.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=b.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.$onStartOperation=this.onStartOperation.bind(this),this.session.on("startOperation",this.$onStartOperation),this.$onEndOperation=this.onEndOperation.bind(this),this.session.on("endOperation",this.$onEndOperation),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(b)),this._signal("changeSession",{session:b,oldSession:T}),this.curOp=null,T&&T._signal("changeEditor",{oldEditor:this}),T&&(T.$editor=null),b&&b._signal("changeEditor",{editor:this}),b&&(b.$editor=this),b&&!b.destroyed&&b.bgTokenizer.scheduleStart()}},C.prototype.getSession=function(){return this.session},C.prototype.setValue=function(b,T){return this.session.doc.setValue(b),T?T==1?this.navigateFileEnd():T==-1&&this.navigateFileStart():this.selectAll(),b},C.prototype.getValue=function(){return this.session.getValue()},C.prototype.getSelection=function(){return this.selection},C.prototype.resize=function(b){this.renderer.onResize(b)},C.prototype.setTheme=function(b,T){this.renderer.setTheme(b,T)},C.prototype.getTheme=function(){return this.renderer.getTheme()},C.prototype.setStyle=function(b,T){this.renderer.setStyle(b,T)},C.prototype.unsetStyle=function(b){this.renderer.unsetStyle(b)},C.prototype.getFontSize=function(){return this.getOption("fontSize")||d.computedStyle(this.container).fontSize},C.prototype.setFontSize=function(b){this.setOption("fontSize",b)},C.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var b=this;this.$highlightPending=!0,setTimeout(function(){b.$highlightPending=!1;var T=b.session;if(!(!T||T.destroyed)){T.$bracketHighlight&&(T.$bracketHighlight.markerIds.forEach(function(U){T.removeMarker(U)}),T.$bracketHighlight=null);var I=b.getCursorPosition(),O=b.getKeyboardHandler(),N=O&&O.$getDirectionForHighlight&&O.$getDirectionForHighlight(b),P=T.getMatchingBracketRanges(I,N);if(!P){var B=new w(T,I.row,I.column),V=B.getCurrentToken();if(V&&/\b(?:tag-open|tag-name)/.test(V.type)){var W=T.getMatchingTags(I);W&&(P=[W.openTagName.isEmpty()?W.openTag:W.openTagName,W.closeTagName.isEmpty()?W.closeTag:W.closeTagName])}}if(!P&&T.$mode.getMatching&&(P=T.$mode.getMatching(b.session)),!P){b.getHighlightIndentGuides()&&b.renderer.$textLayer.$highlightIndentGuide();return}var z="ace_bracket";Array.isArray(P)?P.length==1&&(z="ace_error_bracket"):P=[P],P.length==2&&(f.comparePoints(P[0].end,P[1].start)==0?P=[f.fromPoints(P[0].start,P[1].end)]:f.comparePoints(P[0].start,P[1].end)==0&&(P=[f.fromPoints(P[1].start,P[0].end)])),T.$bracketHighlight={ranges:P,markerIds:P.map(function(U){return T.addMarker(U,z,"text")})},b.getHighlightIndentGuides()&&b.renderer.$textLayer.$highlightIndentGuide()}},50)}},C.prototype.focus=function(){this.textInput.focus()},C.prototype.isFocused=function(){return this.textInput.isFocused()},C.prototype.blur=function(){this.textInput.blur()},C.prototype.onFocus=function(b){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",b))},C.prototype.onBlur=function(b){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",b))},C.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},C.prototype.onDocumentChange=function(b){var T=this.session.$useWrapMode,I=b.start.row==b.end.row?b.end.row:1/0;this.renderer.updateLines(b.start.row,I,T),this._signal("change",b),this.$cursorChange()},C.prototype.onTokenizerUpdate=function(b){var T=b.data;this.renderer.updateLines(T.first,T.last)},C.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},C.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},C.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},C.prototype.$updateHighlightActiveLine=function(){var b=this.getSession(),T;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(T=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(T=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(T=!1)),b.$highlightLineMarker&&!T)b.removeMarker(b.$highlightLineMarker.id),b.$highlightLineMarker=null;else if(!b.$highlightLineMarker&&T){var I=new f(T.row,T.column,T.row,1/0);I.id=b.addMarker(I,"ace_active-line","screenLine"),b.$highlightLineMarker=I}else T&&(b.$highlightLineMarker.start.row=T.row,b.$highlightLineMarker.end.row=T.row,b.$highlightLineMarker.start.column=T.column,b._signal("changeBackMarker"))},C.prototype.onSelectionChange=function(b){var T=this.session;if(T.$selectionMarker&&T.removeMarker(T.$selectionMarker),T.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var I=this.selection.getRange(),O=this.getSelectionStyle();T.$selectionMarker=T.addMarker(I,"ace_selection",O)}var N=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(N),this._signal("changeSelection")},C.prototype.$getSelectionHighLightRegexp=function(){var b=this.session,T=this.getSelectionRange();if(!(T.isEmpty()||T.isMultiLine())){var I=T.start.column,O=T.end.column,N=b.getLine(T.start.row),P=N.substring(I,O);if(!(P.length>5e3||!/[\w\d]/.test(P))){var B=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:P}),V=N.substring(I-1,O+1);if(B.test(V))return B}}},C.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},C.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},C.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},C.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},C.prototype.onChangeMode=function(b){this.renderer.updateText(),this._emit("changeMode",b)},C.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},C.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},C.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},C.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},C.prototype.getCopyText=function(){var b=this.getSelectedText(),T=this.session.doc.getNewLineCharacter(),I=!1;if(!b&&this.$copyWithEmptySelection){I=!0;for(var O=this.selection.getAllRanges(),N=0;N<O.length;N++){var P=O[N];N&&O[N-1].start.row==P.start.row||(b+=this.session.getLine(P.start.row)+T)}}var B={text:b};return this._signal("copy",B),M.lineMode=I?B.text:!1,B.text},C.prototype.onCopy=function(){this.commands.exec("copy",this)},C.prototype.onCut=function(){this.commands.exec("cut",this)},C.prototype.onPaste=function(b,T){var I={text:b,event:T};this.commands.exec("paste",this,I)},C.prototype.$handlePaste=function(b){typeof b=="string"&&(b={text:b}),this._signal("paste",b);var T=b.text,I=T===M.lineMode,O=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)I?O.insert({row:this.selection.lead.row,column:0},T):this.insert(T);else if(I)this.selection.rangeList.ranges.forEach(function(z){O.insert({row:z.start.row,column:0},T)});else{var N=T.split(/\r\n|\r|\n/),P=this.selection.rangeList.ranges,B=N.length==2&&(!N[0]||!N[1]);if(N.length!=P.length||B)return this.commands.exec("insertstring",this,T);for(var V=P.length;V--;){var W=P[V];W.isEmpty()||O.remove(W),O.insert(W.start,N[V])}}},C.prototype.execCommand=function(b,T){return this.commands.exec(b,this,T)},C.prototype.insert=function(b,T){var I=this.session,O=I.getMode(),N=this.getCursorPosition();if(this.getBehavioursEnabled()&&!T){var P=O.transformAction(I.getState(N.row),"insertion",this,I,b);P&&(b!==P.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),b=P.text)}if(b==" "&&(b=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&b.indexOf(`
219
+ `)==-1){var B=f.fromPoints(N,N);B.end.column+=b.length,this.session.remove(B)}}else{var B=this.getSelectionRange();N=this.session.remove(B),this.clearSelection()}if(b==`
220
+ `||b==`\r
221
+ `){var U=I.getLine(N.row);if(N.column>U.search(/\S|$/)){var V=U.substr(N.column).search(/\S|$/);I.doc.removeInLine(N.row,N.column,N.column+V)}}this.clearSelection();var W=N.column,z=I.getState(N.row),U=I.getLine(N.row),G=O.checkOutdent(z,U,b);if(I.insert(N,b),P&&P.selection&&(P.selection.length==2?this.selection.setSelectionRange(new f(N.row,W+P.selection[0],N.row,W+P.selection[1])):this.selection.setSelectionRange(new f(N.row+P.selection[0],P.selection[1],N.row+P.selection[2],P.selection[3]))),this.$enableAutoIndent){if(I.getDocument().isNewLine(b)){var Y=O.getNextLineIndent(z,U.slice(0,N.column),I.getTabString());I.insert({row:N.row+1,column:0},Y)}G&&O.autoOutdent(z,I,N.row)}},C.prototype.autoIndent=function(){for(var b=this.session,T=b.getMode(),I=this.selection.isEmpty()?[new f(0,0,b.doc.getLength()-1,0)]:this.selection.getAllRanges(),O="",N="",P="",B=b.getTabString(),V=0;V<I.length;V++)for(var W=I[V].start.row,z=I[V].end.row,U=W;U<=z;U++){U>0&&(O=b.getState(U-1),N=b.getLine(U-1),P=T.getNextLineIndent(O,N,B));var G=b.getLine(U),Y=T.$getIndent(G);if(P!==Y){if(Y.length>0){var Q=new f(U,0,U,Y.length);b.remove(Q)}P.length>0&&b.insert({row:U,column:0},P)}T.autoOutdent(O,b,U)}},C.prototype.onTextInput=function(b,T){if(!T)return this.keyBinding.onTextInput(b);this.startOperation({command:{name:"insertstring"}});var I=this.applyComposition.bind(this,b,T);this.selection.rangeCount?this.forEachSelection(I):I(),this.endOperation()},C.prototype.applyComposition=function(b,T){if(T.extendLeft||T.extendRight){var I=this.selection.getRange();I.start.column-=T.extendLeft,I.end.column+=T.extendRight,I.start.column<0&&(I.start.row--,I.start.column+=this.session.getLine(I.start.row).length+1),this.selection.setRange(I),!b&&!I.isEmpty()&&this.remove()}if((b||!this.selection.isEmpty())&&this.insert(b,!0),T.restoreStart||T.restoreEnd){var I=this.selection.getRange();I.start.column-=T.restoreStart,I.end.column-=T.restoreEnd,this.selection.setRange(I)}},C.prototype.onCommandKey=function(b,T,I){return this.keyBinding.onCommandKey(b,T,I)},C.prototype.setOverwrite=function(b){this.session.setOverwrite(b)},C.prototype.getOverwrite=function(){return this.session.getOverwrite()},C.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},C.prototype.setScrollSpeed=function(b){this.setOption("scrollSpeed",b)},C.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},C.prototype.setDragDelay=function(b){this.setOption("dragDelay",b)},C.prototype.getDragDelay=function(){return this.getOption("dragDelay")},C.prototype.setSelectionStyle=function(b){this.setOption("selectionStyle",b)},C.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},C.prototype.setHighlightActiveLine=function(b){this.setOption("highlightActiveLine",b)},C.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},C.prototype.setHighlightGutterLine=function(b){this.setOption("highlightGutterLine",b)},C.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},C.prototype.setHighlightSelectedWord=function(b){this.setOption("highlightSelectedWord",b)},C.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},C.prototype.setAnimatedScroll=function(b){this.renderer.setAnimatedScroll(b)},C.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},C.prototype.setShowInvisibles=function(b){this.renderer.setShowInvisibles(b)},C.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},C.prototype.setDisplayIndentGuides=function(b){this.renderer.setDisplayIndentGuides(b)},C.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},C.prototype.setHighlightIndentGuides=function(b){this.renderer.setHighlightIndentGuides(b)},C.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},C.prototype.setShowPrintMargin=function(b){this.renderer.setShowPrintMargin(b)},C.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},C.prototype.setPrintMarginColumn=function(b){this.renderer.setPrintMarginColumn(b)},C.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},C.prototype.setReadOnly=function(b){this.setOption("readOnly",b)},C.prototype.getReadOnly=function(){return this.getOption("readOnly")},C.prototype.setBehavioursEnabled=function(b){this.setOption("behavioursEnabled",b)},C.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},C.prototype.setWrapBehavioursEnabled=function(b){this.setOption("wrapBehavioursEnabled",b)},C.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},C.prototype.setShowFoldWidgets=function(b){this.setOption("showFoldWidgets",b)},C.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},C.prototype.setFadeFoldWidgets=function(b){this.setOption("fadeFoldWidgets",b)},C.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},C.prototype.remove=function(b){this.selection.isEmpty()&&(b=="left"?this.selection.selectLeft():this.selection.selectRight());var T=this.getSelectionRange();if(this.getBehavioursEnabled()){var I=this.session,O=I.getState(T.start.row),N=I.getMode().transformAction(O,"deletion",this,I,T);if(T.end.column===0){var P=I.getTextRange(T);if(P[P.length-1]==`
222
+ `){var B=I.getLine(T.end.row);/^\s+$/.test(B)&&(T.end.column=B.length)}}N&&(T=N)}this.session.remove(T),this.clearSelection()},C.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},C.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var b=this.getSelectionRange();b.start.column==b.end.column&&b.start.row==b.end.row&&(b.end.column=0,b.end.row++),this.session.remove(b),this.clearSelection()},C.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var b=this.getCursorPosition();this.insert(`
223
+ `),this.moveCursorToPosition(b)},C.prototype.setGhostText=function(b,T){this.renderer.setGhostText(b,T)},C.prototype.removeGhostText=function(){this.renderer.removeGhostText()},C.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var b=this.getCursorPosition(),T=b.column;if(T!==0){var I=this.session.getLine(b.row),O,N;T<I.length?(O=I.charAt(T)+I.charAt(T-1),N=new f(b.row,T-1,b.row,T+1)):(O=I.charAt(T-1)+I.charAt(T-2),N=new f(b.row,T-2,b.row,T)),this.session.replace(N,O),this.session.selection.moveToPosition(N.end)}}},C.prototype.toLowerCase=function(){var b=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var T=this.getSelectionRange(),I=this.session.getTextRange(T);this.session.replace(T,I.toLowerCase()),this.selection.setSelectionRange(b)},C.prototype.toUpperCase=function(){var b=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var T=this.getSelectionRange(),I=this.session.getTextRange(T);this.session.replace(T,I.toUpperCase()),this.selection.setSelectionRange(b)},C.prototype.indent=function(){var b=this.session,T=this.getSelectionRange();if(T.start.row<T.end.row){var I=this.$getSelectedRows();b.indentRows(I.first,I.last," ");return}else if(T.start.column<T.end.column){var O=b.getTextRange(T);if(!/^\s+$/.test(O)){var I=this.$getSelectedRows();b.indentRows(I.first,I.last," ");return}}var N=b.getLine(T.start.row),P=T.start,B=b.getTabSize(),V=b.documentToScreenColumn(P.row,P.column);if(this.session.getUseSoftTabs())var W=B-V%B,z=r.stringRepeat(" ",W);else{for(var W=V%B;N[T.start.column-1]==" "&&W;)T.start.column--,W--;this.selection.setSelectionRange(T),z=" "}return this.insert(z)},C.prototype.blockIndent=function(){var b=this.$getSelectedRows();this.session.indentRows(b.first,b.last," ")},C.prototype.blockOutdent=function(){var b=this.session.getSelection();this.session.outdentRows(b.getRange())},C.prototype.sortLines=function(){for(var b=this.$getSelectedRows(),T=this.session,I=[],O=b.first;O<=b.last;O++)I.push(T.getLine(O));I.sort(function(B,V){return B.toLowerCase()<V.toLowerCase()?-1:B.toLowerCase()>V.toLowerCase()?1:0});for(var N=new f(0,0,0,0),O=b.first;O<=b.last;O++){var P=T.getLine(O);N.start.row=O,N.end.row=O,N.end.column=P.length,T.replace(N,I[O-b.first])}},C.prototype.toggleCommentLines=function(){var b=this.session.getState(this.getCursorPosition().row),T=this.$getSelectedRows();this.session.getMode().toggleCommentLines(b,this.session,T.first,T.last)},C.prototype.toggleBlockComment=function(){var b=this.getCursorPosition(),T=this.session.getState(b.row),I=this.getSelectionRange();this.session.getMode().toggleBlockComment(T,this.session,I,b)},C.prototype.getNumberAt=function(b,T){var I=/[\-]?[0-9]+(?:\.[0-9]+)?/g;I.lastIndex=0;for(var O=this.session.getLine(b);I.lastIndex<T;){var N=I.exec(O);if(N.index<=T&&N.index+N[0].length>=T){var P={value:N[0],start:N.index,end:N.index+N[0].length};return P}}return null},C.prototype.modifyNumber=function(b){var T=this.selection.getCursor().row,I=this.selection.getCursor().column,O=new f(T,I-1,T,I),N=this.session.getTextRange(O);if(!isNaN(parseFloat(N))&&isFinite(N)){var P=this.getNumberAt(T,I);if(P){var B=P.value.indexOf(".")>=0?P.start+P.value.indexOf(".")+1:P.end,V=P.start+P.value.length-B,W=parseFloat(P.value);W*=Math.pow(10,V),B!==P.end&&I<B?b*=Math.pow(10,P.end-I-1):b*=Math.pow(10,P.end-I),W+=b,W/=Math.pow(10,V);var z=W.toFixed(V),U=new f(T,P.start,T,P.end);this.session.replace(U,z),this.moveCursorTo(T,Math.max(P.start+1,I+z.length-P.value.length))}}else this.toggleWord()},C.prototype.toggleWord=function(){var b=this.selection.getCursor().row,T=this.selection.getCursor().column;this.selection.selectWord();var I=this.getSelectedText(),O=this.selection.getWordRange().start.column,N=I.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),P=T-O-1;P<0&&(P=0);var B=0,V=0,W=this;I.match(/[A-Za-z0-9_]+/)&&N.forEach(function(ue,me){V=B+ue.length,P>=B&&P<=V&&(I=ue,W.selection.clearSelection(),W.moveCursorTo(b,B+O),W.selection.selectTo(b,V+O)),B=V});for(var z=this.$toggleWordPairs,U,G=0;G<z.length;G++)for(var Y=z[G],Q=0;Q<=1;Q++){var q=+!Q,te=I.match(new RegExp("^\\s?_?("+r.escapeRegExp(Y[Q])+")\\s?$","i"));if(te){var re=I.match(new RegExp("([_]|^|\\s)("+r.escapeRegExp(te[1])+")($|\\s)","g"));re&&(U=I.replace(new RegExp(r.escapeRegExp(Y[Q]),"i"),function(ue){var me=Y[q];return ue.toUpperCase()==ue?me=me.toUpperCase():ue.charAt(0).toUpperCase()==ue.charAt(0)&&(me=me.substr(0,0)+Y[q].charAt(0).toUpperCase()+me.substr(1)),me}),this.insert(U),U="")}}},C.prototype.findLinkAt=function(b,T){var I,O,N=this.session.getLine(b),P=N.split(/((?:https?|ftp):\/\/[\S]+)/),B=T;B<0&&(B=0);var V=0,W=0,z;try{for(var U=a(P),G=U.next();!G.done;G=U.next()){var Y=G.value;if(W=V+Y.length,B>=V&&B<=W&&Y.match(/((?:https?|ftp):\/\/[\S]+)/)){z=Y.replace(/[\s:.,'";}\]]+$/,"");break}V=W}}catch(Q){I={error:Q}}finally{try{G&&!G.done&&(O=U.return)&&O.call(U)}finally{if(I)throw I.error}}return z},C.prototype.openLink=function(){var b=this.selection.getCursor(),T=this.findLinkAt(b.row,b.column);return T&&window.open(T,"_blank"),T!=null},C.prototype.removeLines=function(){var b=this.$getSelectedRows();this.session.removeFullLines(b.first,b.last),this.clearSelection()},C.prototype.duplicateSelection=function(){var b=this.selection,T=this.session,I=b.getRange(),O=b.isBackwards();if(I.isEmpty()){var N=I.start.row;T.duplicateLines(N,N)}else{var P=O?I.start:I.end,B=T.insert(P,T.getTextRange(I));I.start=P,I.end=B,b.setSelectionRange(I,O)}},C.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},C.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},C.prototype.moveText=function(b,T,I){return this.session.moveText(b,T,I)},C.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},C.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},C.prototype.$moveLines=function(b,T){var I,O,N=this.selection;if(!N.inMultiSelectMode||this.inVirtualSelectionMode){var P=N.toOrientedRange();I=this.$getSelectedRows(P),O=this.session.$moveLines(I.first,I.last,T?0:b),T&&b==-1&&(O=0),P.moveBy(O,0),N.fromOrientedRange(P)}else{var B=N.rangeList.ranges;N.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var V=0,W=0,z=B.length,U=0;U<z;U++){var G=U;B[U].moveBy(V,0),I=this.$getSelectedRows(B[U]);for(var Y=I.first,Q=I.last;++U<z;){W&&B[U].moveBy(W,0);var q=this.$getSelectedRows(B[U]);if(T&&q.first!=Q)break;if(!T&&q.first>Q+1)break;Q=q.last}for(U--,V=this.session.$moveLines(Y,Q,T?0:b),T&&b==-1&&(G=U+1);G<=U;)B[G].moveBy(V,0),G++;T||(V=0),W+=V}N.fromOrientedRange(N.ranges[0]),N.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},C.prototype.$getSelectedRows=function(b){return b=(b||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(b.start.row),last:this.session.getRowFoldEnd(b.end.row)}},C.prototype.onCompositionStart=function(b){this.renderer.showComposition(b)},C.prototype.onCompositionUpdate=function(b){this.renderer.setCompositionText(b)},C.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},C.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},C.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},C.prototype.isRowVisible=function(b){return b>=this.getFirstVisibleRow()&&b<=this.getLastVisibleRow()},C.prototype.isRowFullyVisible=function(b){return b>=this.renderer.getFirstFullyVisibleRow()&&b<=this.renderer.getLastFullyVisibleRow()},C.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},C.prototype.$moveByPage=function(b,T){var I=this.renderer,O=this.renderer.layerConfig,N=b*Math.floor(O.height/O.lineHeight);T===!0?this.selection.$moveSelection(function(){this.moveCursorBy(N,0)}):T===!1&&(this.selection.moveCursorBy(N,0),this.selection.clearSelection());var P=I.scrollTop;I.scrollBy(0,N*O.lineHeight),T!=null&&I.scrollCursorIntoView(null,.5),I.animateScrolling(P)},C.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},C.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},C.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},C.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},C.prototype.scrollPageDown=function(){this.$moveByPage(1)},C.prototype.scrollPageUp=function(){this.$moveByPage(-1)},C.prototype.scrollToRow=function(b){this.renderer.scrollToRow(b)},C.prototype.scrollToLine=function(b,T,I,O){this.renderer.scrollToLine(b,T,I,O)},C.prototype.centerSelection=function(){var b=this.getSelectionRange(),T={row:Math.floor(b.start.row+(b.end.row-b.start.row)/2),column:Math.floor(b.start.column+(b.end.column-b.start.column)/2)};this.renderer.alignCursor(T,.5)},C.prototype.getCursorPosition=function(){return this.selection.getCursor()},C.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},C.prototype.getSelectionRange=function(){return this.selection.getRange()},C.prototype.selectAll=function(){this.selection.selectAll()},C.prototype.clearSelection=function(){this.selection.clearSelection()},C.prototype.moveCursorTo=function(b,T){this.selection.moveCursorTo(b,T)},C.prototype.moveCursorToPosition=function(b){this.selection.moveCursorToPosition(b)},C.prototype.jumpToMatching=function(b,T){var I=this.getCursorPosition(),O=new w(this.session,I.row,I.column),N=O.getCurrentToken(),P=0;N&&N.type.indexOf("tag-name")!==-1&&(N=O.stepBackward());var B=N||O.stepForward();if(B){var V,W=!1,z={},U=I.column-B.start,G,Y={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(B.value.match(/[{}()\[\]]/g)){for(;U<B.value.length&&!W;U++)if(Y[B.value[U]])switch(G=Y[B.value[U]]+"."+B.type.replace("rparen","lparen"),isNaN(z[G])&&(z[G]=0),B.value[U]){case"(":case"[":case"{":z[G]++;break;case")":case"]":case"}":z[G]--,z[G]===-1&&(V="bracket",W=!0);break}}else B.type.indexOf("tag-name")!==-1&&(isNaN(z[B.value])&&(z[B.value]=0),N.value==="<"&&P>1?z[B.value]++:N.value==="</"&&z[B.value]--,z[B.value]===-1&&(V="tag",W=!0));W||(N=B,P++,B=O.stepForward(),U=0)}while(B&&!W);if(V){var Q,q;if(V==="bracket")Q=this.session.getBracketRange(I),Q||(Q=new f(O.getCurrentTokenRow(),O.getCurrentTokenColumn()+U-1,O.getCurrentTokenRow(),O.getCurrentTokenColumn()+U-1),q=Q.start,(T||q.row===I.row&&Math.abs(q.column-I.column)<2)&&(Q=this.session.getBracketRange(q)));else if(V==="tag"){if(!B||B.type.indexOf("tag-name")===-1)return;if(Q=new f(O.getCurrentTokenRow(),O.getCurrentTokenColumn()-2,O.getCurrentTokenRow(),O.getCurrentTokenColumn()-2),Q.compare(I.row,I.column)===0){var te=this.session.getMatchingTags(I);te&&(te.openTag.contains(I.row,I.column)?(Q=te.closeTag,q=Q.start):(Q=te.openTag,te.closeTag.start.row===I.row&&te.closeTag.start.column===I.column?q=Q.end:q=Q.start))}q=q||Q.start}q=Q&&Q.cursor||q,q&&(b?Q&&T?this.selection.setRange(Q):Q&&Q.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(q.row,q.column):this.selection.moveTo(q.row,q.column))}}},C.prototype.gotoLine=function(b,T,I){this.selection.clearSelection(),this.session.unfold({row:b-1,column:T||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(b-1,T||0),this.isRowFullyVisible(b-1)||this.scrollToLine(b-1,!0,I)},C.prototype.navigateTo=function(b,T){this.selection.moveTo(b,T)},C.prototype.navigateUp=function(b){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var T=this.selection.anchor.getPosition();return this.moveCursorToPosition(T)}this.selection.clearSelection(),this.selection.moveCursorBy(-b||-1,0)},C.prototype.navigateDown=function(b){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var T=this.selection.anchor.getPosition();return this.moveCursorToPosition(T)}this.selection.clearSelection(),this.selection.moveCursorBy(b||1,0)},C.prototype.navigateLeft=function(b){if(this.selection.isEmpty())for(b=b||1;b--;)this.selection.moveCursorLeft();else{var T=this.getSelectionRange().start;this.moveCursorToPosition(T)}this.clearSelection()},C.prototype.navigateRight=function(b){if(this.selection.isEmpty())for(b=b||1;b--;)this.selection.moveCursorRight();else{var T=this.getSelectionRange().end;this.moveCursorToPosition(T)}this.clearSelection()},C.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},C.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},C.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},C.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},C.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},C.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},C.prototype.replace=function(b,T){T&&this.$search.set(T);var I=this.$search.find(this.session),O=0;return I&&(this.$tryReplace(I,b)&&(O=1),this.selection.setSelectionRange(I),this.renderer.scrollSelectionIntoView(I.start,I.end)),O},C.prototype.replaceAll=function(b,T){T&&this.$search.set(T);var I=this.$search.findAll(this.session),O=0;if(!I.length)return O;var N=this.getSelectionRange();this.selection.moveTo(0,0);for(var P=I.length-1;P>=0;--P)this.$tryReplace(I[P],b)&&O++;return this.selection.setSelectionRange(N),O},C.prototype.$tryReplace=function(b,T){var I=this.session.getTextRange(b);return T=this.$search.replace(I,T),T!==null?(b.end=this.session.replace(b,T),b):null},C.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},C.prototype.find=function(b,T,I){T||(T={}),typeof b=="string"||b instanceof RegExp?T.needle=b:typeof b=="object"&&u.mixin(T,b);var O=this.selection.getRange();T.needle==null&&(b=this.session.getTextRange(O)||this.$search.$options.needle,b||(O=this.session.getWordRange(O.start.row,O.start.column),b=this.session.getTextRange(O)),this.$search.set({needle:b})),this.$search.set(T),T.start||this.$search.set({start:O});var N=this.$search.find(this.session);if(T.preventScroll)return N;if(N)return this.revealRange(N,I),N;T.backwards?O.start=O.end:O.end=O.start,this.selection.setRange(O)},C.prototype.findNext=function(b,T){this.find({skipCurrent:!0,backwards:!1},b,T)},C.prototype.findPrevious=function(b,T){this.find(b,{skipCurrent:!0,backwards:!0},T)},C.prototype.revealRange=function(b,T){this.session.unfold(b),this.selection.setSelectionRange(b);var I=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(b.start,b.end,.5),T!==!1&&this.renderer.animateScrolling(I)},C.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},C.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},C.prototype.destroy=function(){this.destroyed=!0,this.$toDestroy&&(this.$toDestroy.forEach(function(b){b.destroy()}),this.$toDestroy=[]),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},C.prototype.setAutoScrollEditorIntoView=function(b){if(b){var T,I=this,O=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var N=this.$scrollAnchor;N.style.cssText="position:absolute",this.container.insertBefore(N,this.container.firstChild);var P=this.on("changeSelection",function(){O=!0}),B=this.renderer.on("beforeRender",function(){O&&(T=I.renderer.container.getBoundingClientRect())}),V=this.renderer.on("afterRender",function(){if(O&&T&&(I.isFocused()||I.searchBox&&I.searchBox.isFocused())){var W=I.renderer,z=W.$cursorLayer.$pixelPos,U=W.layerConfig,G=z.top-U.offset;z.top>=0&&G+T.top<0?O=!0:z.top<U.height&&z.top+T.top+U.lineHeight>window.innerHeight?O=!1:O=null,O!=null&&(N.style.top=G+"px",N.style.left=z.left+"px",N.style.height=U.lineHeight+"px",N.scrollIntoView(O)),O=T=null}});this.setAutoScrollEditorIntoView=function(W){W||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",P),this.renderer.off("afterRender",V),this.renderer.off("beforeRender",B))}}},C.prototype.$resetCursorStyle=function(){var b=this.$cursorStyle||"ace",T=this.renderer.$cursorLayer;T&&(T.setSmoothBlinking(/smooth/.test(b)),T.isBlinking=!this.$readOnly&&b!="wide",d.setCssClass(T.element,"ace_slim-cursors",/slim/.test(b)))},C.prototype.prompt=function(b,T,I){var O=this;E.loadModule("ace/ext/prompt",function(N){N.prompt(O,b,T,I)})},C})();x.$uid=0,x.prototype.curOp=null,x.prototype.prevOp={},x.prototype.$mergeableCommands=["backspace","del","insertstring"],x.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],u.implement(x.prototype,g),E.defineOptions(x.prototype,"editor",{selectionStyle:{set:function(C){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:C})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(C){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(C){var b=this;if(this.textInput.setReadOnly(C),!this.destroyed){this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(I){var O=!1;if(I&&I.type=="keydown"){if(I&&I.key&&!I.ctrlKey&&!I.metaKey&&(I.key==" "&&I.preventDefault(),O=I.key.length==1),!O)return}else I&&I.type!=="exec"&&(O=!0);if(O){b.hoverTooltip||(b.hoverTooltip=new F);var N=d.createElement("div");N.textContent=S("editor.tooltip.disable-editing","Editing is disabled"),b.hoverTooltip.isOpen||b.hoverTooltip.showForRange(b,b.getSelectionRange(),N)}else b.hoverTooltip&&b.hoverTooltip.isOpen&&b.hoverTooltip.hide()});var T=this.textInput.getElement();C?(_.addListener(T,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(_.removeListener(T,"keydown",this.$readOnlyCallback),this.commands.off("exec",this.$readOnlyCallback),this.commands.off("commandUnavailable",this.$readOnlyCallback),this.hoverTooltip&&(this.hoverTooltip.destroy(),this.hoverTooltip=null))}},initialValue:!1},copyWithEmptySelection:{set:function(C){this.textInput.setCopyWithEmptySelection(C)},initialValue:!1},cursorStyle:{set:function(C){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(C){this.setAutoScrollEditorIntoView(C)}},keyboardHandler:{set:function(C){this.setKeyboardHandler(C)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(C){this.session.setValue(C)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(C){this.setSession(C)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(C){this.renderer.$gutterLayer.setShowLineNumbers(C),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),C&&this.$relativeLineNumbers?$.attach(this):$.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(C){this.$showLineNumbers&&C?$.attach(this):$.detach(this)}},placeholder:{set:function(C){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var b=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(b&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),d.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!b&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),d.addCssClass(this.container,"ace_hasPlaceholder");var T=d.createElement("div");T.className="ace_placeholder",T.textContent=this.$placeholder||"",this.renderer.placeholderNode=T,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!b&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(C){var b={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(O){O.blur(),O.renderer.scroller.focus()},readOnly:!0},T=function(O){if(O.target==this.renderer.scroller&&O.keyCode===D.enter){O.preventDefault();var N=this.getCursorPosition().row;this.isRowVisible(N)||this.scrollToLine(N,!0,!0),this.focus()}},I;C?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(c.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",S("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",S("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",T.bind(this)),this.commands.addCommand(b),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",S("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",S("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),I||(I=new m(this)),I.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",T.bind(this)),this.commands.removeCommand(b),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),I&&I.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(C){this.$textInputAriaLabel=C},initialValue:""},enableMobileMenu:{set:function(C){this.$enableMobileMenu=C},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var $={getText:function(C,b){return(Math.abs(C.selection.lead.row-b)||b+1+(b<9?"·":""))+""},getWidth:function(C,b,T){return Math.max(b.toString().length,(T.lastRow+1).toString().length,2)*T.characterWidth},update:function(C,b){b.renderer.$loop.schedule(b.renderer.CHANGE_GUTTER)},attach:function(C){C.renderer.$gutterLayer.$renderer=this,C.on("changeSelection",this.update),this.update(null,C)},detach:function(C){C.renderer.$gutterLayer.$renderer==this&&(C.renderer.$gutterLayer.$renderer=null),C.off("changeSelection",this.update),this.update(null,C)}};l.Editor=x}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(n,l,v){var a=n("../lib/dom"),u=(function(){function d(r,c){this.element=r,this.canvasHeight=c||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return d.prototype.moveContainer=function(r){a.translate(this.element,0,-(r.firstRowScreen*r.lineHeight%this.canvasHeight)-r.offset*this.$offsetCoefficient)},d.prototype.pageChanged=function(r,c){return Math.floor(r.firstRowScreen*r.lineHeight/this.canvasHeight)!==Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)},d.prototype.computeLineTop=function(r,c,e){var i=c.firstRowScreen*c.lineHeight,o=Math.floor(i/this.canvasHeight),h=e.documentToScreenRow(r,0)*c.lineHeight;return h-o*this.canvasHeight},d.prototype.computeLineHeight=function(r,c,e){return c.lineHeight*e.getRowLineCount(r)},d.prototype.getLength=function(){return this.cells.length},d.prototype.get=function(r){return this.cells[r]},d.prototype.shift=function(){this.$cacheCell(this.cells.shift())},d.prototype.pop=function(){this.$cacheCell(this.cells.pop())},d.prototype.push=function(r){if(Array.isArray(r)){this.cells.push.apply(this.cells,r);for(var c=a.createFragment(this.element),e=0;e<r.length;e++)c.appendChild(r[e].element);this.element.appendChild(c)}else this.cells.push(r),this.element.appendChild(r.element)},d.prototype.unshift=function(r){if(Array.isArray(r)){this.cells.unshift.apply(this.cells,r);for(var c=a.createFragment(this.element),e=0;e<r.length;e++)c.appendChild(r[e].element);this.element.firstChild?this.element.insertBefore(c,this.element.firstChild):this.element.appendChild(c)}else this.cells.unshift(r),this.element.insertAdjacentElement("afterbegin",r.element)},d.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},d.prototype.$cacheCell=function(r){r&&(r.element.remove(),this.cellCache.push(r))},d.prototype.createCell=function(r,c,e,i){var o=this.cellCache.pop();if(!o){var h=a.createElement("div");i&&i(h),this.element.appendChild(h),o={element:h,text:"",row:r}}return o.row=r,o},d})();l.Lines=u}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],function(n,l,v){var a=n("../lib/dom"),u=n("../lib/oop"),d=n("../lib/lang"),r=n("../lib/event_emitter").EventEmitter,c=n("./lines").Lines,e=n("../config").nls,i=(function(){function h(s){this.$showCursorMarker=null,this.element=a.createElement("div"),this.element.className="ace_layer ace_gutter-layer",s.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new c(this.element),this.$lines.$offsetCoefficient=1}return h.prototype.setSession=function(s){this.session&&this.session.off("change",this.$updateAnnotations),this.session=s,s&&s.on("change",this.$updateAnnotations)},h.prototype.addGutterDecoration=function(s,p){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(s,p)},h.prototype.removeGutterDecoration=function(s,p){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(s,p)},h.prototype.setAnnotations=function(s){this.$annotations=[];for(var p=0;p<s.length;p++){var f=s[p],g=f.row,y=this.$annotations[g];y||(y=this.$annotations[g]={text:[],type:[],displayText:[]});var A=f.text,E=f.text,w=f.type;A=A?d.escapeHTML(A):f.html||"",E=E||f.html||"",y.text.indexOf(A)===-1&&(y.text.push(A),y.type.push(w),y.displayText.push(E));var m=f.className;m?y.className=m:w==="error"?y.className=" ace_error":w==="security"&&!/\bace_error\b/.test(y.className)?y.className=" ace_security":w==="warning"&&!/\bace_(error|security)\b/.test(y.className)?y.className=" ace_warning":w==="info"&&!y.className?y.className=" ace_info":w==="hint"&&!y.className&&(y.className=" ace_hint")}},h.prototype.$updateAnnotations=function(s){if(this.$annotations.length){var p=s.start.row,f=s.end.row-p;if(f!==0)if(s.action=="remove")this.$annotations.splice(p,f+1,null);else{var g=new Array(f+1);g.unshift(p,1),this.$annotations.splice.apply(this.$annotations,g)}}},h.prototype.update=function(s){this.config=s;var p=this.session,f=s.firstRow,g=Math.min(s.lastRow+s.gutterOffset,p.getLength()-1);this.oldLastRow=g,this.config=s,this.$lines.moveContainer(s),this.$updateCursorRow();for(var y=p.getNextFoldLine(f),A=y?y.start.row:1/0,E=null,w=-1,m=f;;){if(m>A&&(m=y.end.row+1,y=p.getNextFoldLine(m,y),A=y?y.start.row:1/0),m>g){for(;this.$lines.getLength()>w+1;)this.$lines.pop();break}E=this.$lines.get(++w),E?E.row=m:(E=this.$lines.createCell(m,s,this.session,o),this.$lines.push(E)),this.$renderCell(E,s,y,m),m++}this._signal("afterRender"),this.$updateGutterWidth(s),this.$showCursorMarker&&this.$highlightGutterLine&&this.$updateCursorMarker()},h.prototype.$updateGutterWidth=function(s){var p=this.session,f=p.gutterRenderer||this.$renderer,g=p.$firstLineNumber,y=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||p.$useWrapMode)&&(y=p.getLength()+g-1);var A=f?f.getWidth(p,y,s):y.toString().length*s.characterWidth,E=this.$padding||this.$computePadding();A+=E.left+E.right,A!==this.gutterWidth&&!isNaN(A)&&(this.gutterWidth=A,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",A))},h.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var s=this.session.selection.getCursor();this.$cursorRow!==s.row&&(this.$cursorRow=s.row)}},h.prototype.updateLineHighlight=function(){if(this.$showCursorMarker&&this.$updateCursorMarker(),!!this.$highlightGutterLine){var s=this.session.selection.cursor.row;if(this.$cursorRow=s,!(this.$cursorCell&&this.$cursorCell.row==s)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var p=this.$lines.cells;this.$cursorCell=null;for(var f=0;f<p.length;f++){var g=p[f];if(g.row>=this.$cursorRow){if(g.row>this.$cursorRow){var y=this.session.getFoldLine(this.$cursorRow);if(f>0&&y&&y.start.row==p[f-1].row)g=p[f-1];else break}g.element.className="ace_gutter-active-line "+g.element.className,this.$cursorCell=g;break}}}}},h.prototype.$updateCursorMarker=function(){if(this.session){var s=this.session;this.$highlightElement||(this.$highlightElement=a.createElement("div"),this.$highlightElement.className="ace_gutter-cursor",this.$highlightElement.style.pointerEvents="none",this.element.appendChild(this.$highlightElement));var p=s.selection.cursor,f=this.config,g=this.$lines,y=f.firstRowScreen*f.lineHeight,A=Math.floor(y/g.canvasHeight),E=s.documentToScreenRow(p)*f.lineHeight,w=E-A*g.canvasHeight;a.setStyle(this.$highlightElement.style,"height",f.lineHeight+"px"),a.setStyle(this.$highlightElement.style,"top",w+"px")}},h.prototype.scrollLines=function(s){var p=this.config;if(this.config=s,this.$updateCursorRow(),this.$lines.pageChanged(p,s))return this.update(s);this.$lines.moveContainer(s);var f=Math.min(s.lastRow+s.gutterOffset,this.session.getLength()-1),g=this.oldLastRow;if(this.oldLastRow=f,!p||g<s.firstRow)return this.update(s);if(f<p.firstRow)return this.update(s);if(p.firstRow<s.firstRow)for(var y=this.session.getFoldedRowCount(p.firstRow,s.firstRow-1);y>0;y--)this.$lines.shift();if(g>f)for(var y=this.session.getFoldedRowCount(f+1,g);y>0;y--)this.$lines.pop();s.firstRow<p.firstRow&&this.$lines.unshift(this.$renderLines(s,s.firstRow,p.firstRow-1)),f>g&&this.$lines.push(this.$renderLines(s,g+1,f)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(s)},h.prototype.$renderLines=function(s,p,f){for(var g=[],y=p,A=this.session.getNextFoldLine(y),E=A?A.start.row:1/0;y>E&&(y=A.end.row+1,A=this.session.getNextFoldLine(y,A),E=A?A.start.row:1/0),!(y>f);){var w=this.$lines.createCell(y,s,this.session,o);this.$renderCell(w,s,A,y),g.push(w),y++}return g},h.prototype.$renderCell=function(s,p,f,g){var y=s.element,A=this.session,E=y.childNodes[0],w=y.childNodes[1],m=y.childNodes[2],S=y.childNodes[3],M=m.firstChild,D=A.$firstLineNumber,_=A.$breakpoints,F=A.$decorations,x=A.gutterRenderer||this.$renderer,$=this.$showFoldWidgets&&A.foldWidgets,C=f?f.start.row:Number.MAX_VALUE,b=p.lineHeight+"px",T=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",I=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",O=(x?x.getText(A,g):g+D).toString();if(this.$highlightGutterLine&&(g==this.$cursorRow||f&&g<this.$cursorRow&&g>=C&&this.$cursorRow<=f.end.row)&&(T+="ace_gutter-active-line ",this.$cursorCell!=s&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=s)),_[g]&&(T+=_[g]),F[g]&&(T+=F[g]),this.$annotations[g]&&g!==C&&(T+=this.$annotations[g].className),$){var N=$[g];N==null&&(N=$[g]=A.getFoldWidget(g))}if(N){var P="ace_fold-widget ace_"+N,B=N=="start"&&g==C&&g<f.end.row;if(B){P+=" ace_closed";for(var V="",W=!1,z=g+1;z<=f.end.row;z++)if(this.$annotations[z]){if(this.$annotations[z].className===" ace_error"){W=!0,V=" ace_error_fold";break}this.$annotations[z].className===" ace_security"?(W=!0,V=" ace_security_fold"):this.$annotations[z].className===" ace_warning"&&V!==" ace_security_fold"&&(W=!0,V=" ace_warning_fold")}T+=V}else P+=" ace_open";w.className!=P&&(w.className=P),a.setStyle(w.style,"height",b),a.setStyle(w.style,"display","inline-block"),w.setAttribute("role","button"),w.setAttribute("tabindex","-1");var U=A.getFoldWidgetRange(g);U?w.setAttribute("aria-label",e("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[U.start.row+1,U.end.row+1])):f?w.setAttribute("aria-label",e("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[f.start.row+1,f.end.row+1])):w.setAttribute("aria-label",e("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[g+1])),B?(w.setAttribute("aria-expanded","false"),w.setAttribute("title",e("gutter.code-folding.closed.title","Unfold code"))):(w.setAttribute("aria-expanded","true"),w.setAttribute("title",e("gutter.code-folding.open.title","Fold code")))}else w&&(a.setStyle(w.style,"display","none"),w.setAttribute("tabindex","0"),w.removeAttribute("role"),w.removeAttribute("aria-label"));var G=this.session.$gutterCustomWidgets[g];if(G?this.$addCustomWidget(g,G,s):S&&this.$removeCustomWidget(g,s),W&&this.$showFoldedAnnotations){m.className="ace_gutter_annotation",M.className=I,M.className+=V,a.setStyle(M.style,"height",b),a.setStyle(m.style,"display","block"),a.setStyle(m.style,"height",b);var Y;switch(V){case" ace_error_fold":Y=e("gutter.annotation.aria-label.error","Error, read annotations row $0",[O]);break;case" ace_security_fold":Y=e("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[O]);break;case" ace_warning_fold":Y=e("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[O]);break}m.setAttribute("aria-label",Y),m.setAttribute("tabindex","-1"),m.setAttribute("role","button")}else if(this.$annotations[g]){m.className="ace_gutter_annotation",M.className=I,this.$useSvgGutterIcons?M.className+=this.$annotations[g].className:y.classList.add(this.$annotations[g].className.replace(" ","")),a.setStyle(M.style,"height",b),a.setStyle(m.style,"display","block"),a.setStyle(m.style,"height",b);var Y;switch(this.$annotations[g].className){case" ace_error":Y=e("gutter.annotation.aria-label.error","Error, read annotations row $0",[O]);break;case" ace_security":Y=e("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[O]);break;case" ace_warning":Y=e("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[O]);break;case" ace_info":Y=e("gutter.annotation.aria-label.info","Info, read annotations row $0",[O]);break;case" ace_hint":Y=e("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[O]);break}m.setAttribute("aria-label",Y),m.setAttribute("tabindex","-1"),m.setAttribute("role","button")}else a.setStyle(m.style,"display","none"),m.removeAttribute("aria-label"),m.removeAttribute("role"),m.setAttribute("tabindex","0");return O!==E.data&&(E.data=O),y.className!=T&&(y.className=T),a.setStyle(s.element.style,"height",this.$lines.computeLineHeight(g,p,A)+"px"),a.setStyle(s.element.style,"top",this.$lines.computeLineTop(g,p,A)+"px"),s.text=O,m.style.display==="none"&&w.style.display==="none"&&!G?s.element.setAttribute("aria-hidden",!0):s.element.setAttribute("aria-hidden",!1),s},h.prototype.setHighlightGutterLine=function(s){this.$highlightGutterLine=s,!s&&this.$highlightElement&&(this.$highlightElement.remove(),this.$highlightElement=null)},h.prototype.setShowLineNumbers=function(s){this.$renderer=!s&&{getWidth:function(){return 0},getText:function(){return""}}},h.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},h.prototype.setShowFoldWidgets=function(s){s?a.addCssClass(this.element,"ace_folding-enabled"):a.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=s,this.$padding=null},h.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},h.prototype.$hideFoldWidget=function(s,p){var f=p||this.$getGutterCell(s);if(f&&f.element){var g=f.element.childNodes[1];g&&a.setStyle(g.style,"display","none")}},h.prototype.$showFoldWidget=function(s,p){var f=p||this.$getGutterCell(s);if(f&&f.element){var g=f.element.childNodes[1];g&&this.session.foldWidgets&&this.session.foldWidgets[f.row]&&a.setStyle(g.style,"display","inline-block")}},h.prototype.$getGutterCell=function(s){var p=this.$lines.cells,f=0,g=p.length-1;if(!(s<p[0].row||s>p[g].row)){for(;f<=g;){var y=Math.floor((f+g)/2),A=p[y];if(A.row>s)g=y-1;else if(A.row<s)f=y+1;else return A}return A}},h.prototype.$addCustomWidget=function(s,p,f){var g=p.className,y=p.label,A=p.title,E=p.callbacks;this.session.$gutterCustomWidgets[s]={className:g,label:y,title:A,callbacks:E},this.$hideFoldWidget(s,f);var w=f||this.$getGutterCell(s);if(w&&w.element){var m=w.element.querySelector(".ace_custom-widget");m&&m.remove(),m=a.createElement("span"),m.className="ace_custom-widget ".concat(g),m.setAttribute("tabindex","-1"),m.setAttribute("role","button"),m.setAttribute("aria-label",y),m.setAttribute("title",A),a.setStyle(m.style,"display","inline-block"),a.setStyle(m.style,"height","inherit"),E&&E.onClick&&m.addEventListener("click",function(S){E.onClick(S,s),S.stopPropagation()}),w.element.appendChild(m)}},h.prototype.$removeCustomWidget=function(s,p){delete this.session.$gutterCustomWidgets[s],this.$showFoldWidget(s,p);var f=p||this.$getGutterCell(s);if(f&&f.element){var g=f.element.querySelector(".ace_custom-widget");g&&f.element.removeChild(g)}},h.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var s=a.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(s.borderLeftWidth)||0)+(parseInt(s.paddingLeft)||0)+1,this.$padding.right=(parseInt(s.borderRightWidth)||0)+(parseInt(s.paddingRight)||0),this.$padding},h.prototype.getRegion=function(s){var p=this.$padding||this.$computePadding(),f=this.element.getBoundingClientRect();if(s.x<p.left+f.left)return"markers";if(this.$showFoldWidgets&&s.x>f.right-p.right)return"foldWidgets"},h})();i.prototype.$fixedWidth=!1,i.prototype.$highlightGutterLine=!0,i.prototype.$renderer=void 0,i.prototype.$showLineNumbers=!0,i.prototype.$showFoldWidgets=!0,u.implement(i.prototype,r);function o(h){var s=document.createTextNode("");h.appendChild(s);var p=a.createElement("span");h.appendChild(p);var f=a.createElement("span");h.appendChild(f);var g=a.createElement("span");return f.appendChild(g),h}l.Gutter=i}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(n,l,v){var a=n("../range").Range,u=n("../lib/dom"),d=(function(){function c(e){this.element=u.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}return c.prototype.setPadding=function(e){this.$padding=e},c.prototype.setSession=function(e){this.session=e},c.prototype.setMarkers=function(e){this.markers=e},c.prototype.elt=function(e,i){var o=this.i!=-1&&this.element.childNodes[this.i];o?this.i++:(o=document.createElement("div"),this.element.appendChild(o),this.i=-1),o.style.cssText=i,o.className=e},c.prototype.update=function(e){if(e){this.config=e,this.i=0;var i;for(var o in this.markers){var h=this.markers[o];if(!h.range){h.update(i,this,this.session,e);continue}var s=h.range.clipRows(e.firstRow,e.lastRow);if(!s.isEmpty())if(s=s.toScreenRange(this.session),h.renderer){var p=this.$getTop(s.start.row,e),f=this.$padding+s.start.column*e.characterWidth;h.renderer(i,s,f,p,e)}else h.type=="fullLine"?this.drawFullLineMarker(i,s,h.clazz,e):h.type=="screenLine"?this.drawScreenLineMarker(i,s,h.clazz,e):s.isMultiLine()?h.type=="text"?this.drawTextMarker(i,s,h.clazz,e):this.drawMultiLineMarker(i,s,h.clazz,e):this.drawSingleLineMarker(i,s,h.clazz+" ace_start ace_br15",e)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},c.prototype.$getTop=function(e,i){return(e-i.firstRowScreen)*i.lineHeight},c.prototype.drawTextMarker=function(e,i,o,h,s){for(var p=this.session,f=i.start.row,g=i.end.row,y=f,A=0,E=0,w=p.getScreenLastRowColumn(y),m=new a(y,i.start.column,y,E);y<=g;y++)m.start.row=m.end.row=y,m.start.column=y==f?i.start.column:p.getRowWrapIndent(y),m.end.column=w,A=E,E=w,w=y+1<g?p.getScreenLastRowColumn(y+1):y==g?0:i.end.column,this.drawSingleLineMarker(e,m,o+(y==f?" ace_start":"")+" ace_br"+r(y==f||y==f+1&&i.start.column,A<E,E>w,y==g),h,y==g?0:1,s)},c.prototype.drawMultiLineMarker=function(e,i,o,h,s){var p=this.$padding,f=h.lineHeight,g=this.$getTop(i.start.row,h),y=p+i.start.column*h.characterWidth;if(s=s||"",this.session.$bidiHandler.isBidiRow(i.start.row)){var A=i.clone();A.end.row=A.start.row,A.end.column=this.session.getLine(A.start.row).length,this.drawBidiSingleLineMarker(e,A,o+" ace_br1 ace_start",h,null,s)}else this.elt(o+" ace_br1 ace_start","height:"+f+"px;right:"+p+"px;top:"+g+"px;left:"+y+"px;"+(s||""));if(this.session.$bidiHandler.isBidiRow(i.end.row)){var A=i.clone();A.start.row=A.end.row,A.start.column=0,this.drawBidiSingleLineMarker(e,A,o+" ace_br12",h,null,s)}else{g=this.$getTop(i.end.row,h);var E=i.end.column*h.characterWidth;this.elt(o+" ace_br12","height:"+f+"px;width:"+E+"px;top:"+g+"px;left:"+p+"px;"+(s||""))}if(f=(i.end.row-i.start.row-1)*h.lineHeight,!(f<=0)){g=this.$getTop(i.start.row+1,h);var w=(i.start.column?1:0)|(i.end.column?0:8);this.elt(o+(w?" ace_br"+w:""),"height:"+f+"px;right:"+p+"px;top:"+g+"px;left:"+p+"px;"+(s||""))}},c.prototype.drawSingleLineMarker=function(e,i,o,h,s,p){if(this.session.$bidiHandler.isBidiRow(i.start.row))return this.drawBidiSingleLineMarker(e,i,o,h,s,p);var f=h.lineHeight,g=(i.end.column+(s||0)-i.start.column)*h.characterWidth,y=this.$getTop(i.start.row,h),A=this.$padding+i.start.column*h.characterWidth;this.elt(o,"height:"+f+"px;width:"+g+"px;top:"+y+"px;left:"+A+"px;"+(p||""))},c.prototype.drawBidiSingleLineMarker=function(e,i,o,h,s,p){var f=h.lineHeight,g=this.$getTop(i.start.row,h),y=this.$padding,A=this.session.$bidiHandler.getSelections(i.start.column,i.end.column);A.forEach(function(E){this.elt(o,"height:"+f+"px;width:"+(E.width+(s||0))+"px;top:"+g+"px;left:"+(y+E.left)+"px;"+(p||""))},this)},c.prototype.drawFullLineMarker=function(e,i,o,h,s){var p=this.$getTop(i.start.row,h),f=h.lineHeight;i.start.row!=i.end.row&&(f+=this.$getTop(i.end.row,h)-p),this.elt(o,"height:"+f+"px;top:"+p+"px;left:0;right:0;"+(s||""))},c.prototype.drawScreenLineMarker=function(e,i,o,h,s){var p=this.$getTop(i.start.row,h),f=h.lineHeight;this.elt(o,"height:"+f+"px;top:"+p+"px;left:0;right:0;"+(s||""))},c})();d.prototype.$padding=0;function r(c,e,i,o){return(c?1:0)|(e?2:0)|(i?4:0)|(o?8:0)}l.Marker=d}),ace.define("ace/layer/text_util",["require","exports","module"],function(n,l,v){var a=new Set(["text","rparen","lparen"]);l.isTextToken=function(u){return a.has(u)}}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(n,l,v){var a=n("../lib/oop"),u=n("../lib/dom"),d=n("../lib/lang"),r=n("./lines").Lines,c=n("../lib/event_emitter").EventEmitter,e=n("../config").nls,i=n("./text_util").isTextToken,o=(function(){function h(s){this.dom=u,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",s.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new r(this.element)}return h.prototype.$updateEolChar=function(){var s=this.session.doc,p=s.getNewLineCharacter()==`
224
+ `&&s.getNewLineMode()!="windows",f=p?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=f)return this.EOL_CHAR=f,!0},h.prototype.setPadding=function(s){this.$padding=s,this.element.style.margin="0 "+s+"px"},h.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},h.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},h.prototype.$setFontMetrics=function(s){this.$fontMetrics=s,this.$fontMetrics.on("changeCharacterSize",function(p){this._signal("changeCharacterSize",p)}.bind(this)),this.$pollSizeChanges()},h.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},h.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},h.prototype.setSession=function(s){this.session=s,s&&this.$computeTabString()},h.prototype.setShowInvisibles=function(s){return this.showInvisibles==s?!1:(this.showInvisibles=s,typeof s=="string"?(this.showSpaces=/tab/i.test(s),this.showTabs=/space/i.test(s),this.showEOL=/eol/i.test(s)):this.showSpaces=this.showTabs=this.showEOL=s,this.$computeTabString(),!0)},h.prototype.setDisplayIndentGuides=function(s){return this.displayIndentGuides==s?!1:(this.displayIndentGuides=s,this.$computeTabString(),!0)},h.prototype.setHighlightIndentGuides=function(s){return this.$highlightIndentGuides===s?!1:(this.$highlightIndentGuides=s,s)},h.prototype.$computeTabString=function(){var s=this.session.getTabSize();this.tabSize=s;for(var p=this.$tabStrings=[0],f=1;f<s+1;f++)if(this.showTabs){var g=this.dom.createElement("span");g.className="ace_invisible ace_invisible_tab",g.textContent=d.stringRepeat(this.TAB_CHAR,f),p.push(g)}else p.push(this.dom.createTextNode(d.stringRepeat(" ",f),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var y="ace_indent-guide",A=this.showSpaces?" ace_invisible ace_invisible_space":"",E=this.showSpaces?d.stringRepeat(this.SPACE_CHAR,this.tabSize):d.stringRepeat(" ",this.tabSize),w=this.showTabs?" ace_invisible ace_invisible_tab":"",m=this.showTabs?d.stringRepeat(this.TAB_CHAR,this.tabSize):E,g=this.dom.createElement("span");g.className=y+A,g.textContent=E,this.$tabStrings[" "]=g;var g=this.dom.createElement("span");g.className=y+w,g.textContent=m,this.$tabStrings[" "]=g}},h.prototype.updateLines=function(s,p,f){if(this.config.lastRow!=s.lastRow||this.config.firstRow!=s.firstRow)return this.update(s);this.config=s;for(var g=Math.max(p,s.firstRow),y=Math.min(f,s.lastRow),A=this.element.childNodes,E=0,m=s.firstRow;m<g;m++){var S=this.session.getFoldLine(m);if(S)if(S.containsRow(g)){g=S.start.row;break}else m=S.end.row;E++}for(var w=!1,m=g,S=this.session.getNextFoldLine(m),M=S?S.start.row:1/0;m>M&&(m=S.end.row+1,S=this.session.getNextFoldLine(m,S),M=S?S.start.row:1/0),!(m>y);){var D=A[E++];if(D){this.dom.removeChildren(D),this.$renderLine(D,m,m==M?S:!1),w&&(D.style.top=this.$lines.computeLineTop(m,s,this.session)+"px");var _=s.lineHeight*this.session.getRowLength(m)+"px";D.style.height!=_&&(w=!0,D.style.height=_)}m++}if(w)for(;E<this.$lines.cells.length;){var F=this.$lines.cells[E++];F.element.style.top=this.$lines.computeLineTop(F.row,s,this.session)+"px"}},h.prototype.scrollLines=function(s){var p=this.config;if(this.config=s,this.$lines.pageChanged(p,s))return this.update(s);this.$lines.moveContainer(s);var f=s.lastRow,g=p?p.lastRow:-1;if(!p||g<s.firstRow)return this.update(s);if(f<p.firstRow)return this.update(s);if(!p||p.lastRow<s.firstRow)return this.update(s);if(s.lastRow<p.firstRow)return this.update(s);if(p.firstRow<s.firstRow)for(var y=this.session.getFoldedRowCount(p.firstRow,s.firstRow-1);y>0;y--)this.$lines.shift();if(p.lastRow>s.lastRow)for(var y=this.session.getFoldedRowCount(s.lastRow+1,p.lastRow);y>0;y--)this.$lines.pop();s.firstRow<p.firstRow&&this.$lines.unshift(this.$renderLinesFragment(s,s.firstRow,p.firstRow-1)),s.lastRow>p.lastRow&&this.$lines.push(this.$renderLinesFragment(s,p.lastRow+1,s.lastRow)),this.$highlightIndentGuide()},h.prototype.$renderLinesFragment=function(s,p,f){for(var g=[],y=p,A=this.session.getNextFoldLine(y),E=A?A.start.row:1/0;y>E&&(y=A.end.row+1,A=this.session.getNextFoldLine(y,A),E=A?A.start.row:1/0),!(y>f);){var w=this.$lines.createCell(y,s,this.session),m=w.element;this.dom.removeChildren(m),u.setStyle(m.style,"height",this.$lines.computeLineHeight(y,s,this.session)+"px"),u.setStyle(m.style,"top",this.$lines.computeLineTop(y,s,this.session)+"px"),this.$renderLine(m,y,y==E?A:!1),this.$useLineGroups()?m.className="ace_line_group":m.className="ace_line",g.push(w),y++}return g},h.prototype.update=function(s){this.$lines.moveContainer(s),this.config=s;for(var p=s.firstRow,f=s.lastRow,g=this.$lines;g.getLength();)g.pop();g.push(this.$renderLinesFragment(s,p,f))},h.prototype.$renderToken=function(s,p,f,g){for(var y=this,A=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,E=this.dom.createFragment(this.element),w,m=0;w=A.exec(g);){var S=w[1],M=w[2],D=w[3],_=w[4],F=w[5];if(!(!y.showSpaces&&M)){var x=m!=w.index?g.slice(m,w.index):"";if(m=w.index+w[0].length,x&&E.appendChild(this.dom.createTextNode(x,this.element)),S){var $=y.session.getScreenTabSize(p+w.index),C=y.$tabStrings[$].cloneNode(!0);C.charCount=1,E.appendChild(C),p+=$-1}else if(M)if(y.showSpaces){var b=this.dom.createElement("span");b.className="ace_invisible ace_invisible_space",b.textContent=d.stringRepeat(y.SPACE_CHAR,M.length),E.appendChild(b)}else E.appendChild(this.dom.createTextNode(M,this.element));else if(D){var b=this.dom.createElement("span");b.className="ace_invisible ace_invisible_space ace_invalid",b.textContent=d.stringRepeat(y.SPACE_CHAR,D.length),E.appendChild(b)}else if(_){p+=1;var b=this.dom.createElement("span");b.style.width=y.config.characterWidth*2+"px",b.className=y.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",b.textContent=y.showSpaces?y.SPACE_CHAR:_,E.appendChild(b)}else if(F){p+=1;var b=this.dom.createElement("span");b.style.width=y.config.characterWidth*2+"px",b.className="ace_cjk",b.textContent=F,E.appendChild(b)}}}if(E.appendChild(this.dom.createTextNode(m?g.slice(m):g,this.element)),i(f.type))s.appendChild(E);else{var T="ace_"+f.type.replace(/\./g," ace_"),b=this.dom.createElement("span");f.type=="fold"&&(b.style.width=f.value.length*this.config.characterWidth+"px",b.setAttribute("title",e("inline-fold.closed.title","Unfold code"))),b.className=T,b.appendChild(E),s.appendChild(b)}return p+g.length},h.prototype.renderIndentGuide=function(s,p,f){var g=p.search(this.$indentGuideRe);if(g<=0||g>=f)return p;if(p[0]==" "){g-=g%this.tabSize;for(var y=g/this.tabSize,A=0;A<y;A++)s.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),p.substr(g)}else if(p[0]==" "){for(var A=0;A<g;A++)s.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),p.substr(g)}return this.$highlightIndentGuide(),p},h.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var s=this.session.doc.$lines;if(s){var p=this.session.selection.getCursor(),f=/^\s*/.exec(this.session.doc.getLine(p.row))[0].length,g=Math.floor(f/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:g,start:p.row};var y=this.session.$bracketHighlight;if(y){for(var A=this.session.$bracketHighlight.ranges,E=0;E<A.length;E++)if(p.row!==A[E].start.row){this.$highlightIndentGuideMarker.end=A[E].start.row+1,p.row>A[E].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&s[p.row]!==""&&p.column===s[p.row].length){this.$highlightIndentGuideMarker.dir=1;for(var E=p.row+1;E<s.length;E++){var w=s[E],m=/^\s*/.exec(w)[0].length;if(w!==""&&(this.$highlightIndentGuideMarker.end=E,m<=f))break}}this.$renderHighlightIndentGuide()}}},h.prototype.$clearActiveIndentGuide=function(){for(var s=this.element.querySelectorAll(".ace_indent-guide-active"),p=0;p<s.length;p++)s[p].classList.remove("ace_indent-guide-active")},h.prototype.$setIndentGuideActive=function(s,p){var f=this.session.doc.getLine(s.row);if(f!==""){var g=s.element;if(s.element.classList&&s.element.classList.contains("ace_line_group"))if(s.element.childNodes.length>0)g=s.element.childNodes[0];else return;var y=g.childNodes;if(y){var A=y[p-1];A&&A.classList&&A.classList.contains("ace_indent-guide")&&A.classList.add("ace_indent-guide-active")}}},h.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var s=this.$lines.cells;this.$clearActiveIndentGuide();var p=this.$highlightIndentGuideMarker.indentLevel;if(p!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var f=0;f<s.length;f++){var g=s[f];if(this.$highlightIndentGuideMarker.end&&g.row>=this.$highlightIndentGuideMarker.start+1){if(g.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(g,p)}}else for(var f=s.length-1;f>=0;f--){var g=s[f];if(this.$highlightIndentGuideMarker.end&&g.row<this.$highlightIndentGuideMarker.start){if(g.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(g,p)}}}},h.prototype.$createLineElement=function(s){var p=this.dom.createElement("div");return p.className="ace_line",p.style.height=this.config.lineHeight+"px",p},h.prototype.$renderWrappedLine=function(s,p,f){var g=0,y=0,A=f[0],E=0,w=this.$createLineElement();s.appendChild(w);for(var m=0;m<p.length;m++){var S=p[m],M=S.value;if(m==0&&this.displayIndentGuides){if(g=M.length,M=this.renderIndentGuide(w,M,A),!M)continue;g-=M.length}if(g+M.length<A)E=this.$renderToken(w,E,S,M),g+=M.length;else{for(;g+M.length>=A;){E=this.$renderToken(w,E,S,M.substring(0,A-g)),M=M.substring(A-g),g=A,w=this.$createLineElement(),s.appendChild(w);var D=this.dom.createTextNode(d.stringRepeat(" ",f.indent),this.element);D.charCount=0,w.appendChild(D),y++,E=0,A=f[y]||Number.MAX_VALUE}M.length!=0&&(g+=M.length,E=this.$renderToken(w,E,S,M))}}f[f.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(w,E,null,"",!0)},h.prototype.$renderSimpleLine=function(s,p){for(var f=0,g=0;g<p.length;g++){var y=p[g],A=y.value;if(!(g==0&&this.displayIndentGuides&&(A=this.renderIndentGuide(s,A),!A))){if(f+A.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(s,f,y,A);f=this.$renderToken(s,f,y,A)}}},h.prototype.$renderOverflowMessage=function(s,p,f,g,y){f&&this.$renderToken(s,p,f,g.slice(0,this.MAX_LINE_LENGTH-p));var A=this.dom.createElement("span");A.className="ace_inline_button ace_keyword ace_toggle_wrap",A.textContent=y?"<hide>":"<click to see more...>",s.appendChild(A)},h.prototype.$renderLine=function(s,p,f){if(!f&&f!=!1&&(f=this.session.getFoldLine(p)),f)var g=this.$getFoldLineTokens(p,f);else var g=this.session.getTokens(p);var y=s;if(g.length){var A=this.session.getRowSplitData(p);if(A&&A.length){this.$renderWrappedLine(s,g,A);var y=s.lastChild}else{var y=s;this.$useLineGroups()&&(y=this.$createLineElement(),s.appendChild(y)),this.$renderSimpleLine(y,g)}}else this.$useLineGroups()&&(y=this.$createLineElement(),s.appendChild(y));if(this.showEOL&&y){f&&(p=f.end.row);var E=this.dom.createElement("span");E.className="ace_invisible ace_invisible_eol",E.textContent=p==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,y.appendChild(E)}},h.prototype.$getFoldLineTokens=function(s,p){var f=this.session,g=[];function y(E,w,m){for(var S=0,M=0;M+E[S].value.length<w;)if(M+=E[S].value.length,S++,S==E.length)return;if(M!=w){var D=E[S].value.substring(w-M);D.length>m-w&&(D=D.substring(0,m-w)),g.push({type:E[S].type,value:D}),M=w+D.length,S+=1}for(;M<m&&S<E.length;){var D=E[S].value;D.length+M>m?g.push({type:E[S].type,value:D.substring(0,m-M)}):g.push(E[S]),M+=D.length,S+=1}}var A=f.getTokens(s);return p.walk(function(E,w,m,S,M){E!=null?g.push({type:"fold",value:E}):(M&&(A=f.getTokens(w)),A.length&&y(A,S,m))},p.end.row,this.session.getLine(p.end.row).length),g},h.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},h})();o.prototype.EOF_CHAR="¶",o.prototype.EOL_CHAR_LF="¬",o.prototype.EOL_CHAR_CRLF="¤",o.prototype.EOL_CHAR=o.prototype.EOL_CHAR_LF,o.prototype.TAB_CHAR="—",o.prototype.SPACE_CHAR="·",o.prototype.$padding=0,o.prototype.MAX_LINE_LENGTH=1e4,o.prototype.showInvisibles=!1,o.prototype.showSpaces=!1,o.prototype.showTabs=!1,o.prototype.showEOL=!1,o.prototype.displayIndentGuides=!0,o.prototype.$highlightIndentGuides=!0,o.prototype.$tabStrings=[],o.prototype.destroy={},o.prototype.onChangeTabSize=o.prototype.$computeTabString,a.implement(o.prototype,c),l.Text=o}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(n,l,v){var a=n("../lib/dom"),u=(function(){function d(r){this.element=a.createElement("div"),this.element.className="ace_layer ace_cursor-layer",r.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),a.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return d.prototype.$updateOpacity=function(r){for(var c=this.cursors,e=c.length;e--;)a.setStyle(c[e].style,"opacity",r?"":"0")},d.prototype.$startCssAnimation=function(){for(var r=this.cursors,c=r.length;c--;)r[c].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&a.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},d.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,a.removeCssClass(this.element,"ace_animate-blinking")},d.prototype.setPadding=function(r){this.$padding=r},d.prototype.setSession=function(r){this.session=r},d.prototype.setBlinking=function(r){r!=this.isBlinking&&(this.isBlinking=r,this.restartTimer())},d.prototype.setBlinkInterval=function(r){r!=this.blinkInterval&&(this.blinkInterval=r,this.restartTimer())},d.prototype.setSmoothBlinking=function(r){r!=this.smoothBlinking&&(this.smoothBlinking=r,a.setCssClass(this.element,"ace_smooth-blinking",r),this.$updateCursors(!0),this.restartTimer())},d.prototype.addCursor=function(){var r=a.createElement("div");return r.className="ace_cursor",this.element.appendChild(r),this.cursors.push(r),r},d.prototype.removeCursor=function(){if(this.cursors.length>1){var r=this.cursors.pop();return r.parentNode.removeChild(r),r}},d.prototype.hideCursor=function(){this.isVisible=!1,a.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},d.prototype.showCursor=function(){this.isVisible=!0,a.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},d.prototype.restartTimer=function(){var r=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,a.removeCssClass(this.element,"ace_smooth-blinking")),r(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&a.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),a.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var c=function(){this.timeoutId=setTimeout(function(){r(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){r(!0),c()},this.blinkInterval),c()}},d.prototype.getPixelPosition=function(r,c){if(!this.config||!this.session)return{left:0,top:0};r||(r=this.session.selection.getCursor());var e=this.session.documentToScreenPosition(r),i=this.$padding+(this.session.$bidiHandler.isBidiRow(e.row,r.row)?this.session.$bidiHandler.getPosLeft(e.column):e.column*this.config.characterWidth),o=(e.row-(c?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:i,top:o}},d.prototype.isCursorInView=function(r,c){return r.top>=0&&r.top<c.maxHeight},d.prototype.update=function(r){this.config=r;var c=this.session.$selectionMarkers,e=0,i=0;(c===void 0||c.length===0)&&(c=[{cursor:null}]);for(var e=0,o=c.length;e<o;e++){var h=this.getPixelPosition(c[e].cursor,!0);if(!((h.top>r.height+r.offset||h.top<0)&&e>1)){var s=this.cursors[i++]||this.addCursor(),p=s.style;this.drawCursor?this.drawCursor(s,h,r,c[e],this.session):this.isCursorInView(h,r)?(a.setStyle(p,"display","block"),a.translate(s,h.left,h.top),a.setStyle(p,"width",Math.round(r.characterWidth)+"px"),a.setStyle(p,"height",r.lineHeight+"px")):a.setStyle(p,"display","none")}}for(;this.cursors.length>i;)this.removeCursor();var f=this.session.getOverwrite();this.$setOverwrite(f),this.$pixelPos=h,this.restartTimer()},d.prototype.$setOverwrite=function(r){r!=this.overwrite&&(this.overwrite=r,r?a.addCssClass(this.element,"ace_overwrite-cursors"):a.removeCssClass(this.element,"ace_overwrite-cursors"))},d.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},d})();u.prototype.$padding=0,u.prototype.drawCursor=null,l.Cursor=u}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(n,l,v){var a=this&&this.__extends||(function(){var s=function(p,f){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,y){g.__proto__=y}||function(g,y){for(var A in y)Object.prototype.hasOwnProperty.call(y,A)&&(g[A]=y[A])},s(p,f)};return function(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");s(p,f);function g(){this.constructor=p}p.prototype=f===null?Object.create(f):(g.prototype=f.prototype,new g)}})(),u=n("./lib/oop"),d=n("./lib/dom"),r=n("./lib/event"),c=n("./lib/event_emitter").EventEmitter,e=32768,i=(function(){function s(p,f){this.element=d.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+f,this.inner=d.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),p.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,r.addListener(this.element,"scroll",this.onScroll.bind(this)),r.addListener(this.element,"mousedown",r.preventDefault)}return s.prototype.setVisible=function(p){this.element.style.display=p?"":"none",this.isVisible=p,this.coeff=1},s})();u.implement(i.prototype,c);var o=(function(s){a(p,s);function p(f,g){var y=s.call(this,f,"-v")||this;return y.scrollTop=0,y.scrollHeight=0,g.$scrollbarWidth=y.width=d.scrollbarWidth(f.ownerDocument),y.inner.style.width=y.element.style.width=(y.width||15)+5+"px",y.$minWidth=0,y}return p.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var f=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-f)/(this.coeff-f)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},p.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},p.prototype.setHeight=function(f){this.element.style.height=f+"px"},p.prototype.setScrollHeight=function(f){this.scrollHeight=f,f>e?(this.coeff=e/f,f=e):this.coeff!=1&&(this.coeff=1),this.inner.style.height=f+"px"},p.prototype.setScrollTop=function(f){this.scrollTop!=f&&(this.skipEvent=!0,this.scrollTop=f,this.element.scrollTop=f*this.coeff)},p})(i);o.prototype.setInnerHeight=o.prototype.setScrollHeight;var h=(function(s){a(p,s);function p(f,g){var y=s.call(this,f,"-h")||this;return y.scrollLeft=0,y.height=g.$scrollbarWidth,y.inner.style.height=y.element.style.height=(y.height||15)+5+"px",y}return p.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},p.prototype.getHeight=function(){return this.isVisible?this.height:0},p.prototype.setWidth=function(f){this.element.style.width=f+"px"},p.prototype.setInnerWidth=function(f){this.inner.style.width=f+"px"},p.prototype.setScrollWidth=function(f){this.inner.style.width=f+"px"},p.prototype.setScrollLeft=function(f){this.scrollLeft!=f&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=f)},p})(i);l.ScrollBar=o,l.ScrollBarV=o,l.ScrollBarH=h,l.VScrollBar=o,l.HScrollBar=h}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(n,l,v){var a=this&&this.__extends||(function(){var h=function(s,p){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var y in g)Object.prototype.hasOwnProperty.call(g,y)&&(f[y]=g[y])},h(s,p)};return function(s,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");h(s,p);function f(){this.constructor=s}s.prototype=p===null?Object.create(p):(f.prototype=p.prototype,new f)}})(),u=n("./lib/oop"),d=n("./lib/dom"),r=n("./lib/event"),c=n("./lib/event_emitter").EventEmitter;d.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
225
+ position: absolute;
226
+ background: rgba(128, 128, 128, 0.6);
227
+ -moz-box-sizing: border-box;
228
+ box-sizing: border-box;
229
+ border: 1px solid #bbb;
230
+ border-radius: 2px;
231
+ z-index: 8;
232
+ }
233
+ .ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {
234
+ position: absolute;
235
+ z-index: 6;
236
+ background: none;
237
+ overflow: hidden!important;
238
+ }
239
+ .ace_editor>.ace_sb-v {
240
+ z-index: 6;
241
+ right: 0;
242
+ top: 0;
243
+ width: 12px;
244
+ }
245
+ .ace_editor>.ace_sb-v div {
246
+ z-index: 8;
247
+ right: 0;
248
+ width: 100%;
249
+ }
250
+ .ace_editor>.ace_sb-h {
251
+ bottom: 0;
252
+ left: 0;
253
+ height: 12px;
254
+ }
255
+ .ace_editor>.ace_sb-h div {
256
+ bottom: 0;
257
+ height: 100%;
258
+ }
259
+ .ace_editor>.ace_sb_grabbed {
260
+ z-index: 8;
261
+ background: #000;
262
+ }`,"ace_scrollbar.css",!1);var e=(function(){function h(s,p){this.element=d.createElement("div"),this.element.className="ace_sb"+p,this.inner=d.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,s.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,r.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return h.prototype.setVisible=function(s){this.element.style.display=s?"":"none",this.isVisible=s,this.coeff=1},h})();u.implement(e.prototype,c);var i=(function(h){a(s,h);function s(p,f){var g=h.call(this,p,"-v")||this;return g.scrollTop=0,g.scrollHeight=0,g.parent=p,g.width=g.VScrollWidth,g.renderer=f,g.inner.style.width=g.element.style.width=(g.width||15)+"px",g.$minWidth=0,g}return s.prototype.onMouseDown=function(p,f){if(p==="mousedown"&&!(r.getButton(f)!==0||f.detail===2)){if(f.target===this.inner){var g=this,y=f.clientY,A=function(_){y=_.clientY},E=function(){clearInterval(M)},w=f.clientY,m=this.thumbTop,S=function(){if(y!==void 0){var _=g.scrollTopFromThumbTop(m+y-w);_!==g.scrollTop&&g._emit("scroll",{data:_})}};r.capture(this.inner,A,E);var M=setInterval(S,20);return r.preventDefault(f)}var D=f.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(D)}),r.preventDefault(f)}},s.prototype.getHeight=function(){return this.height},s.prototype.scrollTopFromThumbTop=function(p){var f=p*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return f=f>>0,f<0?f=0:f>this.pageHeight-this.viewHeight&&(f=this.pageHeight-this.viewHeight),f},s.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},s.prototype.setHeight=function(p){this.height=Math.max(0,p),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},s.prototype.setScrollHeight=function(p,f){this.pageHeight===p&&!f||(this.pageHeight=p,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},s.prototype.setScrollTop=function(p){this.scrollTop=p,p<0&&(p=0),this.thumbTop=p*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},s})(e);i.prototype.setInnerHeight=i.prototype.setScrollHeight;var o=(function(h){a(s,h);function s(p,f){var g=h.call(this,p,"-h")||this;return g.scrollLeft=0,g.scrollWidth=0,g.height=g.HScrollHeight,g.inner.style.height=g.element.style.height=(g.height||12)+"px",g.renderer=f,g}return s.prototype.onMouseDown=function(p,f){if(p==="mousedown"&&!(r.getButton(f)!==0||f.detail===2)){if(f.target===this.inner){var g=this,y=f.clientX,A=function(_){y=_.clientX},E=function(){clearInterval(M)},w=f.clientX,m=this.thumbLeft,S=function(){if(y!==void 0){var _=g.scrollLeftFromThumbLeft(m+y-w);_!==g.scrollLeft&&g._emit("scroll",{data:_})}};r.capture(this.inner,A,E);var M=setInterval(S,20);return r.preventDefault(f)}var D=f.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(D)}),r.preventDefault(f)}},s.prototype.getHeight=function(){return this.isVisible?this.height:0},s.prototype.scrollLeftFromThumbLeft=function(p){var f=p*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return f=f>>0,f<0?f=0:f>this.pageWidth-this.viewWidth&&(f=this.pageWidth-this.viewWidth),f},s.prototype.setWidth=function(p){this.width=Math.max(0,p),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},s.prototype.setScrollWidth=function(p,f){this.pageWidth===p&&!f||(this.pageWidth=p,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},s.prototype.setScrollLeft=function(p){this.scrollLeft=p,p<0&&(p=0),this.thumbLeft=p*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},s})(e);o.prototype.setInnerWidth=o.prototype.setScrollWidth,l.ScrollBar=i,l.ScrollBarV=i,l.ScrollBarH=o,l.VScrollBar=i,l.HScrollBar=o}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(n,l,v){var a=n("./lib/event"),u=(function(){function d(r,c){this.onRender=r,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=c||window;var e=this;this._flush=function(i){e.pending=!1;var o=e.changes;if(o&&(a.blockIdle(100),e.changes=0,e.onRender(o)),e.changes){if(e.$recursionLimit--<0)return;e.schedule()}else e.$recursionLimit=2}}return d.prototype.schedule=function(r){this.changes=this.changes|r,this.changes&&!this.pending&&(a.nextFrame(this._flush),this.pending=!0)},d.prototype.clear=function(r){var c=this.changes;return this.changes=0,c},d})();l.RenderLoop=u}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(n,l,v){var a=n("../lib/oop"),u=n("../lib/dom"),d=n("../lib/lang"),r=n("../lib/event"),c=n("../lib/useragent"),e=n("../lib/event_emitter").EventEmitter,i=512,o=typeof ResizeObserver=="function",h=200,s=(function(){function p(f){this.el=u.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=u.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=u.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),f.appendChild(this.el),this.$measureNode.textContent=d.stringRepeat("X",i),this.$characterSize={width:0,height:0},o?this.$addObserver():this.checkForSizeChanges()}return p.prototype.$setMeasureNodeStyles=function(f,g){f.width=f.height="auto",f.left=f.top="0px",f.visibility="hidden",f.position="absolute",f.whiteSpace="pre",c.isIE<8?f["font-family"]="inherit":f.font="inherit",f.overflow=g?"hidden":"visible"},p.prototype.checkForSizeChanges=function(f){if(f===void 0&&(f=this.$measureSizes()),f&&(this.$characterSize.width!==f.width||this.$characterSize.height!==f.height)){this.$measureNode.style.fontWeight="bold";var g=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=f,this.charSizes=Object.create(null),this.allowBoldFonts=g&&g.width===f.width&&g.height===f.height,this._emit("changeCharacterSize",{data:f})}},p.prototype.$addObserver=function(){var f=this;this.$observer=new window.ResizeObserver(function(g){f.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},p.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var f=this;return this.$pollSizeChangesTimer=r.onIdle(function g(){f.checkForSizeChanges(),r.onIdle(g,500)},500)},p.prototype.setPolling=function(f){f?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},p.prototype.$measureSizes=function(f){var g={height:(f||this.$measureNode).clientHeight,width:(f||this.$measureNode).clientWidth/i};return g.width===0||g.height===0?null:g},p.prototype.$measureCharWidth=function(f){this.$main.textContent=d.stringRepeat(f,i);var g=this.$main.getBoundingClientRect();return g.width/i},p.prototype.getCharacterWidth=function(f){var g=this.charSizes[f];return g===void 0&&(g=this.charSizes[f]=this.$measureCharWidth(f)/this.$characterSize.width),g},p.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},p.prototype.$getZoom=function(f){return!f||!f.parentElement?1:(Number(window.getComputedStyle(f).zoom)||1)*this.$getZoom(f.parentElement)},p.prototype.$initTransformMeasureNodes=function(){var f=function(g,y){return["div",{style:"position: absolute;top:"+g+"px;left:"+y+"px;"}]};this.els=u.buildDom([f(0,0),f(h,0),f(0,h),f(h,h)],this.el)},p.prototype.transformCoordinates=function(f,g){if(f){var y=this.$getZoom(this.el);f=m(1/y,f)}function A(P,B,V){var W=P[1]*B[0]-P[0]*B[1];return[(-B[1]*V[0]+B[0]*V[1])/W,(+P[1]*V[0]-P[0]*V[1])/W]}function E(P,B){return[P[0]-B[0],P[1]-B[1]]}function w(P,B){return[P[0]+B[0],P[1]+B[1]]}function m(P,B){return[P*B[0],P*B[1]]}this.els||this.$initTransformMeasureNodes();function S(P){var B=P.getBoundingClientRect();return[B.left,B.top]}var M=S(this.els[0]),D=S(this.els[1]),_=S(this.els[2]),F=S(this.els[3]),x=A(E(F,D),E(F,_),E(w(D,_),w(F,M))),$=m(1+x[0],E(D,M)),C=m(1+x[1],E(_,M));if(g){var b=g,T=x[0]*b[0]/h+x[1]*b[1]/h+1,I=w(m(b[0],$),m(b[1],C));return w(m(1/T/h,I),M)}var O=E(f,M),N=A(E($,m(x[0],O)),E(C,m(x[1],O)),O);return m(h,N)},p})();s.prototype.$characterSize={width:0,height:0},a.implement(s.prototype,e),l.FontMetrics=s}),ace.define("ace/css/editor-css",["require","exports","module"],function(n,l,v){v.exports=`
263
+ .ace_br1 {border-top-left-radius : 3px;}
264
+ .ace_br2 {border-top-right-radius : 3px;}
265
+ .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
266
+ .ace_br4 {border-bottom-right-radius: 3px;}
267
+ .ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}
268
+ .ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}
269
+ .ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}
270
+ .ace_br8 {border-bottom-left-radius : 3px;}
271
+ .ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}
272
+ .ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}
273
+ .ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}
274
+ .ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
275
+ .ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
276
+ .ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
277
+ .ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
278
+
279
+
280
+ .ace_editor {
281
+ position: relative;
282
+ overflow: hidden;
283
+ padding: 0;
284
+ font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;
285
+ direction: ltr;
286
+ text-align: left;
287
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
288
+ forced-color-adjust: none;
289
+ }
290
+
291
+ .ace_scroller {
292
+ position: absolute;
293
+ overflow: hidden;
294
+ top: 0;
295
+ bottom: 0;
296
+ background-color: inherit;
297
+ -ms-user-select: none;
298
+ -moz-user-select: none;
299
+ -webkit-user-select: none;
300
+ user-select: none;
301
+ cursor: text;
302
+ }
303
+
304
+ .ace_content {
305
+ position: absolute;
306
+ box-sizing: border-box;
307
+ min-width: 100%;
308
+ contain: style size layout;
309
+ font-variant-ligatures: no-common-ligatures;
310
+ }
311
+ .ace_invisible {
312
+ font-variant-ligatures: none;
313
+ }
314
+
315
+ .ace_keyboard-focus:focus {
316
+ box-shadow: inset 0 0 0 2px #5E9ED6;
317
+ outline: none;
318
+ }
319
+
320
+ .ace_dragging .ace_scroller:before{
321
+ position: absolute;
322
+ top: 0;
323
+ left: 0;
324
+ right: 0;
325
+ bottom: 0;
326
+ content: '';
327
+ background: rgba(250, 250, 250, 0.01);
328
+ z-index: 1000;
329
+ }
330
+ .ace_dragging.ace_dark .ace_scroller:before{
331
+ background: rgba(0, 0, 0, 0.01);
332
+ }
333
+
334
+ .ace_gutter {
335
+ position: absolute;
336
+ overflow : hidden;
337
+ width: auto;
338
+ top: 0;
339
+ bottom: 0;
340
+ left: 0;
341
+ cursor: default;
342
+ z-index: 4;
343
+ -ms-user-select: none;
344
+ -moz-user-select: none;
345
+ -webkit-user-select: none;
346
+ user-select: none;
347
+ contain: style size layout;
348
+ }
349
+
350
+ .ace_gutter-active-line {
351
+ position: absolute;
352
+ left: 0;
353
+ right: 0;
354
+ }
355
+
356
+ .ace_scroller.ace_scroll-left:after {
357
+ content: "";
358
+ position: absolute;
359
+ top: 0;
360
+ right: 0;
361
+ bottom: 0;
362
+ left: 0;
363
+ box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
364
+ pointer-events: none;
365
+ }
366
+
367
+ .ace_gutter-cell, .ace_gutter-cell_svg-icons {
368
+ position: absolute;
369
+ top: 0;
370
+ left: 0;
371
+ right: 0;
372
+ padding-left: 19px;
373
+ padding-right: 6px;
374
+ background-repeat: no-repeat;
375
+ }
376
+
377
+ .ace_gutter-cell_svg-icons .ace_gutter_annotation {
378
+ margin-left: -14px;
379
+ float: left;
380
+ }
381
+
382
+ .ace_gutter-cell .ace_gutter_annotation {
383
+ margin-left: -19px;
384
+ float: left;
385
+ }
386
+
387
+ .ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold, .ace_gutter-cell.ace_security, .ace_icon.ace_security, .ace_icon.ace_security_fold {
388
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");
389
+ background-repeat: no-repeat;
390
+ background-position: 2px center;
391
+ }
392
+
393
+ .ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {
394
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");
395
+ background-repeat: no-repeat;
396
+ background-position: 2px center;
397
+ }
398
+
399
+ .ace_gutter-cell.ace_info, .ace_icon.ace_info, .ace_gutter-cell.ace_hint, .ace_icon.ace_hint {
400
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
401
+ background-repeat: no-repeat;
402
+ background-position: 2px center;
403
+ }
404
+
405
+ .ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info, .ace_dark .ace_gutter-cell.ace_hint, .ace_dark .ace_icon.ace_hint {
406
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
407
+ }
408
+
409
+ .ace_icon_svg.ace_error {
410
+ -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");
411
+ background-color: crimson;
412
+ }
413
+ .ace_icon_svg.ace_security {
414
+ -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iZGFya29yYW5nZSIgZmlsbD0ibm9uZSIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogICAgICAgIDxwYXRoIGNsYXNzPSJzdHJva2UtbGluZWpvaW4tcm91bmQiIGQ9Ik04IDE0LjgzMDdDOCAxNC44MzA3IDIgMTIuOTA0NyAyIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOEM3Ljk4OTk5IDEuMzQ5MTggMTAuNjkgMy4yNjU0OCAxNCAzLjI2NTQ4VjguMDg5OTJDMTQgMTIuOTA0NyA4IDE0LjgzMDcgOCAxNC44MzA3WiIvPgogICAgICAgIDxwYXRoIGQ9Ik0yIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOCIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMy45OSA4LjA4OTkyVjMuMjY1NDhDMTAuNjggMy4yNjU0OCA4IDEuMzQ5MTggOCAxLjM0OTE4Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggNFY5Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggMTBWMTIiLz4KICAgIDwvZz4KPC9zdmc+");
415
+ background-color: crimson;
416
+ }
417
+ .ace_icon_svg.ace_warning {
418
+ -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");
419
+ background-color: darkorange;
420
+ }
421
+ .ace_icon_svg.ace_info {
422
+ -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");
423
+ background-color: royalblue;
424
+ }
425
+ .ace_icon_svg.ace_hint {
426
+ -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0ic2lsdmVyIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTYgMTRIMTAiLz4KICAgICAgICA8cGF0aCBkPSJNOCAxMUg5QzkgOS40NzAwMiAxMiA4LjU0MDAyIDEyIDUuNzYwMDJDMTIuMDIgNC40MDAwMiAxMS4zOSAzLjM2MDAyIDEwLjQzIDIuNjcwMDJDOSAxLjY0MDAyIDcuMDAwMDEgMS42NDAwMiA1LjU3MDAxIDIuNjcwMDJDNC42MTAwMSAzLjM2MDAyIDMuOTggNC40MDAwMiA0IDUuNzYwMDJDNCA4LjU0MDAyIDcuMDAwMDEgOS40NzAwMiA3LjAwMDAxIDExSDhaIi8+CiAgICA8L2c+Cjwvc3ZnPg==");
427
+ background-color: silver;
428
+ }
429
+
430
+ .ace_icon_svg.ace_error_fold {
431
+ -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
432
+ background-color: crimson;
433
+ }
434
+ .ace_icon_svg.ace_security_fold {
435
+ -webkit-mask-image: url("data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTcgMTQiIGZpbGw9Im5vbmUiPgogICAgPHBhdGggZD0iTTEwLjAwMDEgMTMuNjk5MkMxMC4wMDAxIDEzLjY5OTIgMTEuOTI0MSAxMy40NzYzIDEzIDEyLjY5OTJDMTQuNDEzOSAxMS42NzgxIDE2IDEwLjUgMTYuMTI1MSA2LjgxMTI2VjIuNTg5ODdDMTYuMTI1MSAyLjU0NzY4IDE2LjEyMjEgMi41MDYxOSAxNi4xMTY0IDIuNDY1NTlWMS43MTQ4NUgxNS4yNDE0TDE1LjIzMDcgMS43MTQ4NEwxNC42MjUxIDEuNjk5MjJWNi44MTEyM0MxNC42MjUxIDguNTEwNjEgMTQuNjI1MSA5LjQ2NDYxIDEyLjc4MjQgMTEuNzIxQzEyLjE1ODYgMTIuNDg0OCAxMC4wMDAxIDEzLjY5OTIgMTAuMDAwMSAxMy42OTkyWiIgZmlsbD0iY3JpbXNvbiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuMzM2MDkgMC4zNjc0NzVDNy4wMzIxNCAwLjE1MjY1MiA2LjYyNTQ4IDAuMTUzNjE0IDYuMzIyNTMgMC4zNjk5OTdMNi4zMDg2OSAwLjM3OTU1NEM2LjI5NTUzIDAuMzg4NTg4IDYuMjczODggMC40MDMyNjYgNi4yNDQxNyAwLjQyMjc4OUM2LjE4NDcxIDAuNDYxODYgNi4wOTMyMSAwLjUyMDE3MSA1Ljk3MzEzIDAuNTkxMzczQzUuNzMyNTEgMC43MzQwNTkgNS4zNzk5IDAuOTI2ODY0IDQuOTQyNzkgMS4xMjAwOUM0LjA2MTQ0IDEuNTA5NyAyLjg3NTQxIDEuODgzNzcgMS41ODk4NCAxLjg4Mzc3SDAuNzE0ODQ0VjIuNzU4NzdWNi45ODAxNUMwLjcxNDg0NCA5LjQ5Mzc0IDIuMjg4NjYgMTEuMTk3MyAzLjcwMjU0IDEyLjIxODVDNC40MTg0NSAxMi43MzU1IDUuMTI4NzQgMTMuMTA1MyA1LjY1NzMzIDEzLjM0NTdDNS45MjI4NCAxMy40NjY0IDYuMTQ1NjYgMTMuNTU1OSA2LjMwNDY1IDEzLjYxNjFDNi4zODQyMyAxMy42NDYyIDYuNDQ4MDUgMTMuNjY5IDYuNDkzNDkgMTMuNjg0OEM2LjUxNjIyIDEzLjY5MjcgNi41MzQzOCAxMy42OTg5IDYuNTQ3NjQgMTMuNzAzM0w2LjU2MzgyIDEzLjcwODdMNi41NjkwOCAxMy43MTA0TDYuNTcwOTkgMTMuNzExTDYuODM5ODQgMTMuNzUzM0w2LjU3MjQyIDEzLjcxMTVDNi43NDYzMyAxMy43NjczIDYuOTMzMzUgMTMuNzY3MyA3LjEwNzI3IDEzLjcxMTVMNy4xMDg3IDEzLjcxMUw3LjExMDYxIDEzLjcxMDRMNy4xMTU4NyAxMy43MDg3TDcuMTMyMDUgMTMuNzAzM0M3LjE0NTMxIDEzLjY5ODkgNy4xNjM0NiAxMy42OTI3IDcuMTg2MTkgMTMuNjg0OEM3LjIzMTY0IDEzLjY2OSA3LjI5NTQ2IDEzLjY0NjIgNy4zNzUwMyAxMy42MTYxQzcuNTM0MDMgMTMuNTU1OSA3Ljc1Njg1IDEzLjQ2NjQgOC4wMjIzNiAxMy4zNDU3QzguNTUwOTUgMTMuMTA1MyA5LjI2MTIzIDEyLjczNTUgOS45NzcxNSAxMi4yMTg1QzExLjM5MSAxMS4xOTczIDEyLjk2NDggOS40OTM3NyAxMi45NjQ4IDYuOTgwMThWMi43NTg4QzEyLjk2NDggMi43MTY2IDEyLjk2MTkgMi42NzUxMSAxMi45NTYxIDIuNjM0NTFWMS44ODM3N0gxMi4wODExQzEyLjA3NzUgMS44ODM3NyAxMi4wNzQgMS44ODM3NyAxMi4wNzA0IDEuODgzNzdDMTAuNzk3OSAxLjg4MDA0IDkuNjE5NjIgMS41MTEwMiA4LjczODk0IDEuMTI0ODZDOC43MzUzNCAxLjEyMzI3IDguNzMxNzQgMS4xMjE2OCA4LjcyODE0IDEuMTIwMDlDOC4yOTEwMyAwLjkyNjg2NCA3LjkzODQyIDAuNzM0MDU5IDcuNjk3NzkgMC41OTEzNzNDNy41Nzc3MiAwLjUyMDE3MSA3LjQ4NjIyIDAuNDYxODYgNy40MjY3NiAwLjQyMjc4OUM3LjM5NzA1IDAuNDAzMjY2IDcuMzc1MzkgMC4zODg1ODggNy4zNjIyNCAwLjM3OTU1NEw3LjM0ODk2IDAuMzcwMzVDNy4zNDg5NiAwLjM3MDM1IDcuMzQ4NDcgMC4zNzAwMiA3LjM0NTYzIDAuMzc0MDU0TDcuMzM3NzkgMC4zNjg2NTlMNy4zMzYwOSAwLjM2NzQ3NVpNOC4wMzQ3MSAyLjcyNjkxQzguODYwNCAzLjA5MDYzIDkuOTYwNjYgMy40NjMwOSAxMS4yMDYxIDMuNTg5MDdWNi45ODAxNUgxMS4yMTQ4QzExLjIxNDggOC42Nzk1MyAxMC4xNjM3IDkuOTI1MDcgOC45NTI1NCAxMC43OTk4QzguMzU1OTUgMTEuMjMwNiA3Ljc1Mzc0IDExLjU0NTQgNy4yOTc5NiAxMS43NTI3QzcuMTE2NzEgMTEuODM1MSA2Ljk2MDYyIDExLjg5OTYgNi44Mzk4NCAxMS45NDY5QzYuNzE5MDYgMTEuODk5NiA2LjU2Mjk3IDExLjgzNTEgNi4zODE3MyAxMS43NTI3QzUuOTI1OTUgMTEuNTQ1NCA1LjMyMzczIDExLjIzMDYgNC43MjcxNSAxMC43OTk4QzMuNTE2MDMgOS45MjUwNyAyLjQ2NDg0IDguNjc5NTUgMi40NjQ4NCA2Ljk4MDE4VjMuNTg5MDlDMy43MTczOCAzLjQ2MjM5IDQuODIzMDggMy4wODYzOSA1LjY1MDMzIDIuNzIwNzFDNi4xNDIyOCAyLjUwMzI0IDYuNTQ0ODUgMi4yODUzNyA2LjgzMjU0IDIuMTE2MjRDNy4xMjE4MSAyLjI4NTM1IDcuNTI3IDIuNTAzNTIgOC4wMjE5NiAyLjcyMTMxQzguMDI2MiAyLjcyMzE3IDguMDMwNDUgMi43MjUwNCA4LjAzNDcxIDIuNzI2OTFaTTUuOTY0ODQgMy40MDE0N1Y3Ljc3NjQ3SDcuNzE0ODRWMy40MDE0N0g1Ljk2NDg0Wk01Ljk2NDg0IDEwLjQwMTVWOC42NTE0N0g3LjcxNDg0VjEwLjQwMTVINS45NjQ4NFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
436
+ background-color: crimson;
437
+ }
438
+ .ace_icon_svg.ace_warning_fold {
439
+ -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");
440
+ background-color: darkorange;
441
+ }
442
+
443
+ .ace_scrollbar {
444
+ contain: strict;
445
+ position: absolute;
446
+ right: 0;
447
+ bottom: 0;
448
+ z-index: 6;
449
+ }
450
+
451
+ .ace_scrollbar-inner {
452
+ position: absolute;
453
+ cursor: text;
454
+ left: 0;
455
+ top: 0;
456
+ }
457
+
458
+ .ace_scrollbar-v{
459
+ overflow-x: hidden;
460
+ overflow-y: scroll;
461
+ top: 0;
462
+ }
463
+
464
+ .ace_scrollbar-h {
465
+ overflow-x: scroll;
466
+ overflow-y: hidden;
467
+ left: 0;
468
+ }
469
+
470
+ .ace_print-margin {
471
+ position: absolute;
472
+ height: 100%;
473
+ }
474
+
475
+ .ace_text-input {
476
+ position: absolute;
477
+ z-index: 0;
478
+ width: 0.5em;
479
+ height: 1em;
480
+ opacity: 0;
481
+ background: transparent;
482
+ -moz-appearance: none;
483
+ appearance: none;
484
+ border: none;
485
+ resize: none;
486
+ outline: none;
487
+ overflow: hidden;
488
+ font: inherit;
489
+ padding: 0 1px;
490
+ margin: 0 -1px;
491
+ contain: strict;
492
+ -ms-user-select: text;
493
+ -moz-user-select: text;
494
+ -webkit-user-select: text;
495
+ user-select: text;
496
+ /*with \`pre-line\` chrome inserts &nbsp; instead of space*/
497
+ white-space: pre!important;
498
+ }
499
+ .ace_text-input.ace_composition {
500
+ background: transparent;
501
+ color: inherit;
502
+ z-index: 1000;
503
+ opacity: 1;
504
+ }
505
+ .ace_composition_placeholder { color: transparent }
506
+ .ace_composition_marker {
507
+ border-bottom: 1px solid;
508
+ position: absolute;
509
+ border-radius: 0;
510
+ margin-top: 1px;
511
+ }
512
+
513
+ [ace_nocontext=true] {
514
+ transform: none!important;
515
+ filter: none!important;
516
+ clip-path: none!important;
517
+ mask : none!important;
518
+ contain: none!important;
519
+ perspective: none!important;
520
+ mix-blend-mode: initial!important;
521
+ z-index: auto;
522
+ }
523
+
524
+ .ace_layer {
525
+ z-index: 1;
526
+ position: absolute;
527
+ overflow: hidden;
528
+ /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
529
+ word-wrap: normal;
530
+ white-space: pre;
531
+ height: 100%;
532
+ width: 100%;
533
+ box-sizing: border-box;
534
+ /* setting pointer-events: auto; on node under the mouse, which changes
535
+ during scroll, will break mouse wheel scrolling in Safari */
536
+ pointer-events: none;
537
+ }
538
+
539
+ .ace_gutter-layer {
540
+ position: relative;
541
+ width: auto;
542
+ text-align: right;
543
+ pointer-events: auto;
544
+ height: 1000000px;
545
+ contain: style size layout;
546
+ }
547
+
548
+ .ace_text-layer {
549
+ font: inherit !important;
550
+ position: absolute;
551
+ height: 1000000px;
552
+ width: 1000000px;
553
+ contain: style size layout;
554
+ }
555
+
556
+ .ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {
557
+ contain: style size layout;
558
+ position: absolute;
559
+ top: 0;
560
+ left: 0;
561
+ right: 0;
562
+ }
563
+
564
+ .ace_hidpi .ace_text-layer,
565
+ .ace_hidpi .ace_gutter-layer,
566
+ .ace_hidpi .ace_content,
567
+ .ace_hidpi .ace_gutter {
568
+ contain: strict;
569
+ }
570
+ .ace_hidpi .ace_text-layer > .ace_line,
571
+ .ace_hidpi .ace_text-layer > .ace_line_group {
572
+ contain: strict;
573
+ }
574
+
575
+ .ace_cjk {
576
+ display: inline-block;
577
+ text-align: center;
578
+ }
579
+
580
+ .ace_cursor-layer {
581
+ z-index: 4;
582
+ }
583
+
584
+ .ace_cursor {
585
+ z-index: 4;
586
+ position: absolute;
587
+ box-sizing: border-box;
588
+ border-left: 2px solid;
589
+ /* workaround for smooth cursor repaintng whole screen in chrome */
590
+ transform: translatez(0);
591
+ }
592
+
593
+ .ace_multiselect .ace_cursor {
594
+ border-left-width: 1px;
595
+ }
596
+
597
+ .ace_slim-cursors .ace_cursor {
598
+ border-left-width: 1px;
599
+ }
600
+
601
+ .ace_overwrite-cursors .ace_cursor {
602
+ border-left-width: 0;
603
+ border-bottom: 1px solid;
604
+ }
605
+
606
+ .ace_hidden-cursors .ace_cursor {
607
+ opacity: 0.2;
608
+ }
609
+
610
+ .ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {
611
+ opacity: 0;
612
+ }
613
+
614
+ .ace_smooth-blinking .ace_cursor {
615
+ transition: opacity 0.18s;
616
+ }
617
+
618
+ .ace_animate-blinking .ace_cursor {
619
+ animation-duration: 1000ms;
620
+ animation-timing-function: step-end;
621
+ animation-name: blink-ace-animate;
622
+ animation-iteration-count: infinite;
623
+ }
624
+
625
+ .ace_animate-blinking.ace_smooth-blinking .ace_cursor {
626
+ animation-duration: 1000ms;
627
+ animation-timing-function: ease-in-out;
628
+ animation-name: blink-ace-animate-smooth;
629
+ }
630
+
631
+ @keyframes blink-ace-animate {
632
+ from, to { opacity: 1; }
633
+ 60% { opacity: 0; }
634
+ }
635
+
636
+ @keyframes blink-ace-animate-smooth {
637
+ from, to { opacity: 1; }
638
+ 45% { opacity: 1; }
639
+ 60% { opacity: 0; }
640
+ 85% { opacity: 0; }
641
+ }
642
+
643
+ .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {
644
+ position: absolute;
645
+ z-index: 3;
646
+ }
647
+
648
+ .ace_marker-layer .ace_selection {
649
+ position: absolute;
650
+ z-index: 5;
651
+ }
652
+
653
+ .ace_marker-layer .ace_bracket {
654
+ position: absolute;
655
+ z-index: 6;
656
+ }
657
+
658
+ .ace_marker-layer .ace_error_bracket {
659
+ position: absolute;
660
+ border-bottom: 1px solid #DE5555;
661
+ border-radius: 0;
662
+ }
663
+
664
+ .ace_marker-layer .ace_active-line {
665
+ position: absolute;
666
+ z-index: 2;
667
+ }
668
+
669
+ .ace_marker-layer .ace_selected-word {
670
+ position: absolute;
671
+ z-index: 4;
672
+ box-sizing: border-box;
673
+ }
674
+
675
+ .ace_line .ace_fold {
676
+ box-sizing: border-box;
677
+
678
+ display: inline-block;
679
+ height: 11px;
680
+ margin-top: -2px;
681
+ vertical-align: middle;
682
+
683
+ background-image:
684
+ url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
685
+ url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
686
+ background-repeat: no-repeat, repeat-x;
687
+ background-position: center center, top left;
688
+ color: transparent;
689
+
690
+ border: 1px solid black;
691
+ border-radius: 2px;
692
+
693
+ cursor: pointer;
694
+ pointer-events: auto;
695
+ }
696
+
697
+ .ace_dark .ace_fold {
698
+ }
699
+
700
+ .ace_fold:hover{
701
+ background-image:
702
+ url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
703
+ url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
704
+ }
705
+
706
+ .ace_tooltip {
707
+ background-color: #f5f5f5;
708
+ border: 1px solid gray;
709
+ border-radius: 1px;
710
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
711
+ color: black;
712
+ padding: 3px 4px;
713
+ position: fixed;
714
+ z-index: 999999;
715
+ box-sizing: border-box;
716
+ cursor: default;
717
+ white-space: pre-wrap;
718
+ word-wrap: break-word;
719
+ line-height: normal;
720
+ font-style: normal;
721
+ font-weight: normal;
722
+ letter-spacing: normal;
723
+ pointer-events: none;
724
+ overflow: auto;
725
+ max-width: min(33em, 66vw);
726
+ overscroll-behavior: contain;
727
+ }
728
+ .ace_tooltip pre {
729
+ white-space: pre-wrap;
730
+ }
731
+
732
+ .ace_tooltip.ace_dark {
733
+ background-color: #636363;
734
+ color: #fff;
735
+ }
736
+
737
+ .ace_tooltip:focus {
738
+ outline: 1px solid #5E9ED6;
739
+ }
740
+
741
+ .ace_icon {
742
+ display: inline-block;
743
+ width: 18px;
744
+ vertical-align: top;
745
+ }
746
+
747
+ .ace_icon_svg {
748
+ display: inline-block;
749
+ width: 12px;
750
+ vertical-align: top;
751
+ -webkit-mask-repeat: no-repeat;
752
+ -webkit-mask-size: 12px;
753
+ -webkit-mask-position: center;
754
+ }
755
+
756
+ .ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {
757
+ padding-right: 13px;
758
+ }
759
+
760
+ .ace_fold-widget, .ace_custom-widget {
761
+ box-sizing: border-box;
762
+
763
+ margin: 0 -12px 0 1px;
764
+ display: none;
765
+ width: 11px;
766
+ vertical-align: top;
767
+
768
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
769
+ background-repeat: no-repeat;
770
+ background-position: center;
771
+
772
+ border-radius: 3px;
773
+
774
+ border: 1px solid transparent;
775
+ cursor: pointer;
776
+ pointer-events: auto;
777
+ }
778
+
779
+ .ace_custom-widget {
780
+ background: none;
781
+ }
782
+
783
+ .ace_folding-enabled .ace_fold-widget {
784
+ display: inline-block;
785
+ }
786
+
787
+ .ace_fold-widget.ace_end {
788
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
789
+ }
790
+
791
+ .ace_fold-widget.ace_closed {
792
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
793
+ }
794
+
795
+ .ace_fold-widget:hover {
796
+ border: 1px solid rgba(0, 0, 0, 0.3);
797
+ background-color: rgba(255, 255, 255, 0.2);
798
+ box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
799
+ }
800
+
801
+ .ace_fold-widget:active {
802
+ border: 1px solid rgba(0, 0, 0, 0.4);
803
+ background-color: rgba(0, 0, 0, 0.05);
804
+ box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
805
+ }
806
+ /**
807
+ * Dark version for fold widgets
808
+ */
809
+ .ace_dark .ace_fold-widget {
810
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
811
+ }
812
+ .ace_dark .ace_fold-widget.ace_end {
813
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
814
+ }
815
+ .ace_dark .ace_fold-widget.ace_closed {
816
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
817
+ }
818
+ .ace_dark .ace_fold-widget:hover {
819
+ box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
820
+ background-color: rgba(255, 255, 255, 0.1);
821
+ }
822
+ .ace_dark .ace_fold-widget:active {
823
+ box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
824
+ }
825
+
826
+ .ace_inline_button {
827
+ border: 1px solid lightgray;
828
+ display: inline-block;
829
+ margin: -1px 8px;
830
+ padding: 0 5px;
831
+ pointer-events: auto;
832
+ cursor: pointer;
833
+ }
834
+ .ace_inline_button:hover {
835
+ border-color: gray;
836
+ background: rgba(200,200,200,0.2);
837
+ display: inline-block;
838
+ pointer-events: auto;
839
+ }
840
+
841
+ .ace_fold-widget.ace_invalid {
842
+ background-color: #FFB4B4;
843
+ border-color: #DE5555;
844
+ }
845
+
846
+ .ace_fade-fold-widgets .ace_fold-widget {
847
+ transition: opacity 0.4s ease 0.05s;
848
+ opacity: 0;
849
+ }
850
+
851
+ .ace_fade-fold-widgets:hover .ace_fold-widget {
852
+ transition: opacity 0.05s ease 0.05s;
853
+ opacity:1;
854
+ }
855
+
856
+ .ace_underline {
857
+ text-decoration: underline;
858
+ }
859
+
860
+ .ace_bold {
861
+ font-weight: bold;
862
+ }
863
+
864
+ .ace_nobold .ace_bold {
865
+ font-weight: normal;
866
+ }
867
+
868
+ .ace_italic {
869
+ font-style: italic;
870
+ }
871
+
872
+
873
+ .ace_error-marker {
874
+ background-color: rgba(255, 0, 0,0.2);
875
+ position: absolute;
876
+ z-index: 9;
877
+ }
878
+
879
+ .ace_highlight-marker {
880
+ background-color: rgba(255, 255, 0,0.2);
881
+ position: absolute;
882
+ z-index: 8;
883
+ }
884
+
885
+ .ace_mobile-menu {
886
+ position: absolute;
887
+ line-height: 1.5;
888
+ border-radius: 4px;
889
+ -ms-user-select: none;
890
+ -moz-user-select: none;
891
+ -webkit-user-select: none;
892
+ user-select: none;
893
+ background: white;
894
+ box-shadow: 1px 3px 2px grey;
895
+ border: 1px solid #dcdcdc;
896
+ color: black;
897
+ }
898
+ .ace_dark > .ace_mobile-menu {
899
+ background: #333;
900
+ color: #ccc;
901
+ box-shadow: 1px 3px 2px grey;
902
+ border: 1px solid #444;
903
+
904
+ }
905
+ .ace_mobile-button {
906
+ padding: 2px;
907
+ cursor: pointer;
908
+ overflow: hidden;
909
+ }
910
+ .ace_mobile-button:hover {
911
+ background-color: #eee;
912
+ opacity:1;
913
+ }
914
+ .ace_mobile-button:active {
915
+ background-color: #ddd;
916
+ }
917
+
918
+ .ace_placeholder {
919
+ position: relative;
920
+ font-family: arial;
921
+ transform: scale(0.9);
922
+ transform-origin: left;
923
+ white-space: pre;
924
+ opacity: 0.7;
925
+ margin: 0 10px;
926
+ z-index: 1;
927
+ }
928
+
929
+ .ace_ghost_text {
930
+ opacity: 0.5;
931
+ font-style: italic;
932
+ }
933
+
934
+ .ace_ghost_text_container > div {
935
+ white-space: pre;
936
+ }
937
+
938
+ .ghost_text_line_wrapped::after {
939
+ content: "↩";
940
+ position: absolute;
941
+ }
942
+
943
+ .ace_lineWidgetContainer.ace_ghost_text {
944
+ margin: 0px 4px
945
+ }
946
+
947
+ .ace_screenreader-only {
948
+ position:absolute;
949
+ left:-10000px;
950
+ top:auto;
951
+ width:1px;
952
+ height:1px;
953
+ overflow:hidden;
954
+ }
955
+
956
+ .ace_hidden_token {
957
+ display: none;
958
+ }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(n,l,v){var a=n("../lib/dom"),u=n("../lib/oop"),d=n("../lib/event_emitter").EventEmitter,r=(function(){function c(e,i){this.renderer=i,this.pixelRatio=1,this.maxHeight=i.layerConfig.maxHeight,this.lineHeight=i.layerConfig.lineHeight,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},this.setScrollBarV(e)}return c.prototype.$createCanvas=function(){this.canvas=a.createElement("canvas"),this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7",this.canvas.style.position="absolute"},c.prototype.setScrollBarV=function(e){this.$createCanvas(),this.scrollbarV=e,e.element.appendChild(this.canvas),this.setDimensions()},c.prototype.$updateDecorators=function(e){if(typeof this.canvas.getContext!="function")return;var i=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;this.setDimensions(e);var o=this.canvas.getContext("2d");function h($,C){return $.priority<C.priority?-1:$.priority>C.priority?1:0}var s=this.renderer.session.$annotations;if(o.clearRect(0,0,this.canvas.width,this.canvas.height),s){var p={info:1,warning:2,error:3};s.forEach(function($){$.priority=p[$.type]||null}),s=s.sort(h);for(var f=0;f<s.length;f++){var g=s[f].row,y=this.getVerticalOffsetForRow(g),A=y+this.lineHeight,E=Math.round(this.heightRatio*y),w=Math.round(this.heightRatio*A),m=Math.round((E+w)/2),S=w-m;S<this.halfMinDecorationHeight&&(S=this.halfMinDecorationHeight),m-S<0&&(m=S),m+S>this.canvasHeight&&(m=this.canvasHeight-S);var M=m-S,D=m+S,_=D-M;o.fillStyle=i[s[f].type]||null,o.fillRect(0,M,Math.round(this.oneZoneWidth-1),_)}}var F=this.renderer.session.selection.getCursor();if(F){var x=Math.round(this.getVerticalOffsetForRow(F.row)*this.heightRatio);o.fillStyle="rgba(0, 0, 0, 0.5)",o.fillRect(0,x,this.canvasWidth,2)}},c.prototype.getVerticalOffsetForRow=function(e){e=e|0;var i=this.renderer.session.documentToScreenRow(e,0)*this.lineHeight;return i},c.prototype.setDimensions=function(e){e=e||this.renderer.layerConfig,this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height,this.canvasWidth=this.scrollbarV.width||this.canvasWidth,this.setZoneWidth(),this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.maxHeight<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight},c.prototype.setZoneWidth=function(){this.oneZoneWidth=this.canvasWidth},c.prototype.destroy=function(){this.canvas.parentNode.removeChild(this.canvas)},c})();u.implement(r.prototype,d),l.Decorator=r}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(n,l,v){var a=n("./lib/oop"),u=n("./lib/dom"),d=n("./lib/lang"),r=n("./config"),c=n("./layer/gutter").Gutter,e=n("./layer/marker").Marker,i=n("./layer/text").Text,o=n("./layer/cursor").Cursor,h=n("./scrollbar").HScrollBar,s=n("./scrollbar").VScrollBar,p=n("./scrollbar_custom").HScrollBar,f=n("./scrollbar_custom").VScrollBar,g=n("./renderloop").RenderLoop,y=n("./layer/font_metrics").FontMetrics,A=n("./lib/event_emitter").EventEmitter,E=n("./css/editor-css"),w=n("./layer/decorators").Decorator,m=n("./lib/useragent"),S=n("./layer/text_util").isTextToken;u.importCssString(E,"ace_editor.css",!1);var M=(function(){function D(_,F){var x=this;this.container=_||u.createElement("div"),u.addCssClass(this.container,"ace_editor"),u.HI_DPI&&u.addCssClass(this.container,"ace_hidpi"),this.setTheme(F),r.get("useStrictCSP")==null&&r.set("useStrictCSP",!1),this.$gutter=u.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=u.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=u.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new c(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new e(this.content);var $=this.$textLayer=new i(this.content);this.canvas=$.element,this.$markerFront=new e(this.content),this.$cursorLayer=new o(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new s(this.container,this),this.scrollBarH=new h(this.container,this),this.scrollBarV.on("scroll",function(C){x.$scrollAnimation||x.session.setScrollTop(C.data-x.scrollMargin.top)}),this.scrollBarH.on("scroll",function(C){x.$scrollAnimation||x.session.setScrollLeft(C.data-x.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new y(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(C){x.updateCharacterSize(),x.onResize(!0,x.gutterWidth,x.$size.width,x.$size.height),x._signal("changeCharacterSize",C)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new g(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),r.resetOptions(this),r._signal("renderer",this)}return D.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),u.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},D.prototype.setSession=function(_){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=_,_&&this.scrollMargin.top&&_.getScrollTop()<=0&&_.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(_),this.$markerBack.setSession(_),this.$markerFront.setSession(_),this.$gutterLayer.setSession(_),this.$textLayer.setSession(_),_&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},D.prototype.updateLines=function(_,F,x){if(F===void 0&&(F=1/0),this.$changedLines?(this.$changedLines.firstRow>_&&(this.$changedLines.firstRow=_),this.$changedLines.lastRow<F&&(this.$changedLines.lastRow=F)):this.$changedLines={firstRow:_,lastRow:F},this.$changedLines.lastRow<this.layerConfig.firstRow)if(x)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},D.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},D.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},D.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},D.prototype.updateFull=function(_){_?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},D.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},D.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},D.prototype.onResize=function(_,F,x,$){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=_?1:0;var C=this.container;$||($=C.clientHeight||C.scrollHeight),!$&&this.$maxLines&&this.lineHeight>1&&(!C.style.height||C.style.height=="0px")&&(C.style.height="1px",$=C.clientHeight||C.scrollHeight),x||(x=C.clientWidth||C.scrollWidth);var b=this.$updateCachedSize(_,F,x,$);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!x&&!$)return this.resizing=0;_&&(this.$gutterLayer.$padding=null),_?this.$renderChanges(b|this.$changes,!0):this.$loop.schedule(b|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},D.prototype.$updateCachedSize=function(_,F,x,$){$-=this.$extraHeight||0;var C=0,b=this.$size,T={width:b.width,height:b.height,scrollerHeight:b.scrollerHeight,scrollerWidth:b.scrollerWidth};if($&&(_||b.height!=$)&&(b.height=$,C|=this.CHANGE_SIZE,b.scrollerHeight=b.height,this.$horizScroll&&(b.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(b.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",C=C|this.CHANGE_SCROLL),x&&(_||b.width!=x)){C|=this.CHANGE_SIZE,b.width=x,F==null&&(F=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=F,u.setStyle(this.scrollBarH.element.style,"left",F+"px"),u.setStyle(this.scroller.style,"left",F+this.margin.left+"px"),b.scrollerWidth=Math.max(0,x-F-this.scrollBarV.getWidth()-this.margin.h),u.setStyle(this.$gutter.style,"left",this.margin.left+"px");var I=this.scrollBarV.getWidth()+"px";u.setStyle(this.scrollBarH.element.style,"right",I),u.setStyle(this.scroller.style,"right",I),u.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(b.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||_)&&(C|=this.CHANGE_FULL)}return b.$dirty=!x||!$,C&&this._signal("resize",T),C},D.prototype.onGutterResize=function(_){var F=this.$showGutter?_:0;F!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,F,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},D.prototype.adjustWrapLimit=function(){var _=this.$size.scrollerWidth-this.$padding*2,F=Math.floor(_/this.characterWidth);return this.session.adjustWrapLimit(F,this.$showPrintMargin&&this.$printMarginColumn)},D.prototype.setAnimatedScroll=function(_){this.setOption("animatedScroll",_)},D.prototype.getAnimatedScroll=function(){return this.$animatedScroll},D.prototype.setShowInvisibles=function(_){this.setOption("showInvisibles",_),this.session.$bidiHandler.setShowInvisibles(_)},D.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},D.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},D.prototype.setDisplayIndentGuides=function(_){this.setOption("displayIndentGuides",_)},D.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},D.prototype.setHighlightIndentGuides=function(_){this.setOption("highlightIndentGuides",_)},D.prototype.setShowPrintMargin=function(_){this.setOption("showPrintMargin",_)},D.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},D.prototype.setPrintMarginColumn=function(_){this.setOption("printMarginColumn",_)},D.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},D.prototype.getShowGutter=function(){return this.getOption("showGutter")},D.prototype.setShowGutter=function(_){return this.setOption("showGutter",_)},D.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},D.prototype.setFadeFoldWidgets=function(_){this.setOption("fadeFoldWidgets",_)},D.prototype.setHighlightGutterLine=function(_){this.setOption("highlightGutterLine",_)},D.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},D.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var _=u.createElement("div");_.className="ace_layer ace_print-margin-layer",this.$printMarginEl=u.createElement("div"),this.$printMarginEl.className="ace_print-margin",_.appendChild(this.$printMarginEl),this.content.insertBefore(_,this.content.firstChild)}var F=this.$printMarginEl.style;F.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",F.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},D.prototype.getContainerElement=function(){return this.container},D.prototype.getMouseEventTarget=function(){return this.scroller},D.prototype.getTextAreaContainer=function(){return this.container},D.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var _=this.textarea.style,F=this.$composition;if(!this.$keepTextAreaAtCursor&&!F){u.translate(this.textarea,-100,0);return}var x=this.$cursorLayer.$pixelPos;if(x){F&&F.markerRange&&(x=this.$cursorLayer.getPixelPosition(F.markerRange.start,!0));var $=this.layerConfig,C=x.top,b=x.left;C-=$.offset;var T=F&&F.useTextareaForIME||m.isMobile?this.lineHeight:1;if(C<0||C>$.height-T){u.translate(this.textarea,0,0);return}var I=1,O=this.$size.height-T;if(!F)C+=this.lineHeight;else if(F.useTextareaForIME){var N=this.textarea.value;I=this.characterWidth*this.session.$getStringScreenWidth(N)[0]}else C+=this.lineHeight+2;b-=this.scrollLeft,b>this.$size.scrollerWidth-I&&(b=this.$size.scrollerWidth-I),b+=this.gutterWidth+this.margin.left,u.setStyle(_,"height",T+"px"),u.setStyle(_,"width",I+"px"),u.translate(this.textarea,Math.min(b,this.$size.scrollerWidth-I),Math.min(C,O))}}},D.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},D.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},D.prototype.getLastFullyVisibleRow=function(){var _=this.layerConfig,F=_.lastRow,x=this.session.documentToScreenRow(F,0)*_.lineHeight;return x-this.session.getScrollTop()>_.height-_.lineHeight?F-1:F},D.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},D.prototype.setPadding=function(_){this.$padding=_,this.$textLayer.setPadding(_),this.$cursorLayer.setPadding(_),this.$markerFront.setPadding(_),this.$markerBack.setPadding(_),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},D.prototype.setScrollMargin=function(_,F,x,$){var C=this.scrollMargin;C.top=_|0,C.bottom=F|0,C.right=$|0,C.left=x|0,C.v=C.top+C.bottom,C.h=C.left+C.right,C.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-C.top),this.updateFull()},D.prototype.setMargin=function(_,F,x,$){var C=this.margin;C.top=_|0,C.bottom=F|0,C.right=$|0,C.left=x|0,C.v=C.top+C.bottom,C.h=C.left+C.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},D.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},D.prototype.setHScrollBarAlwaysVisible=function(_){this.setOption("hScrollBarAlwaysVisible",_)},D.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},D.prototype.setVScrollBarAlwaysVisible=function(_){this.setOption("vScrollBarAlwaysVisible",_)},D.prototype.$updateScrollBarV=function(){var _=this.layerConfig.maxHeight,F=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(_-=(F-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>_-F&&(_=this.scrollTop+F,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(_+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},D.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},D.prototype.freeze=function(){this.$frozen=!0},D.prototype.unfreeze=function(){this.$frozen=!1},D.prototype.$renderChanges=function(_,F){if(this.$changes&&(_|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!_&&!F){this.$changes|=_;return}if(this.$size.$dirty)return this.$changes|=_,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",_),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var x=this.layerConfig;if(_&this.CHANGE_FULL||_&this.CHANGE_SIZE||_&this.CHANGE_TEXT||_&this.CHANGE_LINES||_&this.CHANGE_SCROLL||_&this.CHANGE_H_SCROLL){if(_|=this.$computeLayerConfig()|this.$loop.clear(),x.firstRow!=this.layerConfig.firstRow&&x.firstRowScreen==this.layerConfig.firstRowScreen){var $=this.scrollTop+(x.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;$>0&&(this.scrollTop=$,_=_|this.CHANGE_SCROLL,_|=this.$computeLayerConfig()|this.$loop.clear())}x=this.layerConfig,this.$updateScrollBarV(),_&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),u.translate(this.content,-this.scrollLeft,-x.offset);var C=x.width+2*this.$padding+"px",b=x.minHeight+"px";u.setStyle(this.content.style,"width",C),u.setStyle(this.content.style,"height",b)}if(_&this.CHANGE_H_SCROLL&&(u.translate(this.content,-this.scrollLeft,-x.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),_&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(x),this.$showGutter&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x),this.$markerBack.update(x),this.$markerFront.update(x),this.$cursorLayer.update(x),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}if(_&this.CHANGE_SCROLL){this.$changedLines=null,_&this.CHANGE_TEXT||_&this.CHANGE_LINES?this.$textLayer.update(x):this.$textLayer.scrollLines(x),this.$showGutter&&(_&this.CHANGE_GUTTER||_&this.CHANGE_LINES?this.$gutterLayer.update(x):this.$gutterLayer.scrollLines(x)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x),this.$markerBack.update(x),this.$markerFront.update(x),this.$cursorLayer.update(x),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}_&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(x),this.$showGutter&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):_&this.CHANGE_LINES?((this.$updateLines()||_&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):_&this.CHANGE_TEXT||_&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)):_&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(x),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(x)),_&this.CHANGE_CURSOR&&(this.$cursorLayer.update(x),this.$moveTextAreaToCursor()),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(x),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(x),this._signal("afterRender",_)},D.prototype.$autosize=function(){var _=this.session.getScreenLength()*this.lineHeight,F=this.$maxLines*this.lineHeight,x=Math.min(F,Math.max((this.$minLines||1)*this.lineHeight,_))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(x+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&x>this.$maxPixelHeight&&(x=this.$maxPixelHeight);var $=x<=2*this.lineHeight,C=!$&&_>F;if(x!=this.desiredHeight||this.$size.height!=this.desiredHeight||C!=this.$vScroll){C!=this.$vScroll&&(this.$vScroll=C,this.scrollBarV.setVisible(C));var b=this.container.clientWidth;this.container.style.height=x+"px",this.$updateCachedSize(!0,this.$gutterWidth,b,x),this.desiredHeight=x,this._signal("autosize")}},D.prototype.$computeLayerConfig=function(){var _=this.session,F=this.$size,x=F.height<=2*this.lineHeight,$=this.session.getScreenLength(),C=$*this.lineHeight,b=this.$getLongestLine(),T=!x&&(this.$hScrollBarAlwaysVisible||F.scrollerWidth-b-2*this.$padding<0),I=this.$horizScroll!==T;I&&(this.$horizScroll=T,this.scrollBarH.setVisible(T));var O=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),x=F.height<=2*this.lineHeight);var N=F.scrollerHeight+this.lineHeight,P=!this.$maxLines&&this.$scrollPastEnd?(F.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;C+=P;var B=this.scrollMargin;this.session.setScrollTop(Math.max(-B.top,Math.min(this.scrollTop,C-F.scrollerHeight+B.bottom))),this.session.setScrollLeft(Math.max(-B.left,Math.min(this.scrollLeft,b+2*this.$padding-F.scrollerWidth+B.right)));var V=!x&&(this.$vScrollBarAlwaysVisible||F.scrollerHeight-C+P<0||this.scrollTop>B.top),W=O!==V;W&&(this.$vScroll=V,this.scrollBarV.setVisible(V));var z=this.scrollTop%this.lineHeight,U=Math.ceil(N/this.lineHeight)-1,G=Math.max(0,Math.round((this.scrollTop-z)/this.lineHeight)),Y=G+U,Q,q,te=this.lineHeight;G=_.screenToDocumentRow(G,0);var re=_.getFoldLine(G);re&&(G=re.start.row),Q=_.documentToScreenRow(G,0),q=_.getRowLength(G)*te,Y=Math.min(_.screenToDocumentRow(Y,0),_.getLength()-1),N=F.scrollerHeight+_.getRowLength(Y)*te+q,z=this.scrollTop-Q*te,z<0&&Q>0&&(Q=Math.max(0,Q+Math.floor(z/te)),z=this.scrollTop-Q*te);var ue=0;return(this.layerConfig.width!=b||I)&&(ue=this.CHANGE_H_SCROLL),(I||W)&&(ue|=this.$updateCachedSize(!0,this.gutterWidth,F.width,F.height),this._signal("scrollbarVisibilityChanged"),W&&(b=this.$getLongestLine())),this.layerConfig={width:b,padding:this.$padding,firstRow:G,firstRowScreen:Q,lastRow:Y,lineHeight:te,characterWidth:this.characterWidth,minHeight:N,maxHeight:C,offset:z,gutterOffset:te?Math.max(0,Math.ceil((z+F.height-F.scrollerHeight)/te)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(b-this.$padding),ue},D.prototype.$updateLines=function(){if(this.$changedLines){var _=this.$changedLines.firstRow,F=this.$changedLines.lastRow;this.$changedLines=null;var x=this.layerConfig;if(!(_>x.lastRow+1)&&!(F<x.firstRow)){if(F===1/0){this.$showGutter&&this.$gutterLayer.update(x),this.$textLayer.update(x);return}return this.$textLayer.updateLines(x,_,F),!0}}},D.prototype.$getLongestLine=function(){var _=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(_+=1),this.$textLayer&&_>this.$textLayer.MAX_LINE_LENGTH&&(_=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(_*this.characterWidth))},D.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},D.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},D.prototype.addGutterDecoration=function(_,F){this.$gutterLayer.addGutterDecoration(_,F)},D.prototype.removeGutterDecoration=function(_,F){this.$gutterLayer.removeGutterDecoration(_,F)},D.prototype.updateBreakpoints=function(_){this._rows=_,this.$loop.schedule(this.CHANGE_GUTTER)},D.prototype.setAnnotations=function(_){this.$gutterLayer.setAnnotations(_),this.$loop.schedule(this.CHANGE_GUTTER)},D.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},D.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},D.prototype.showCursor=function(){this.$cursorLayer.showCursor()},D.prototype.scrollSelectionIntoView=function(_,F,x){this.scrollCursorIntoView(_,x),this.scrollCursorIntoView(F,x)},D.prototype.scrollCursorIntoView=function(_,F,x){if(this.$size.scrollerHeight!==0){var $=this.$cursorLayer.getPixelPosition(_),C=$.left,b=$.top,T=x&&x.top||0,I=x&&x.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var O=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;O+T>b?(F&&O+T>b+this.lineHeight&&(b-=F*this.$size.scrollerHeight),b===0&&(b=-this.scrollMargin.top),this.session.setScrollTop(b)):O+this.$size.scrollerHeight-I<b+this.lineHeight&&(F&&O+this.$size.scrollerHeight-I<b-this.lineHeight&&(b+=F*this.$size.scrollerHeight),this.session.setScrollTop(b+this.lineHeight+I-this.$size.scrollerHeight));var N=this.scrollLeft,P=2*this.layerConfig.characterWidth;C-P<N?(C-=P,C<this.$padding+P&&(C=-this.scrollMargin.left),this.session.setScrollLeft(C)):(C+=P,N+this.$size.scrollerWidth<C+this.characterWidth?this.session.setScrollLeft(Math.round(C+this.characterWidth-this.$size.scrollerWidth)):N<=this.$padding&&C-N<this.characterWidth&&this.session.setScrollLeft(0))}},D.prototype.getScrollTop=function(){return this.session.getScrollTop()},D.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},D.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},D.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},D.prototype.scrollToRow=function(_){this.session.setScrollTop(_*this.lineHeight)},D.prototype.alignCursor=function(_,F){typeof _=="number"&&(_={row:_,column:0});var x=this.$cursorLayer.getPixelPosition(_),$=this.$size.scrollerHeight-this.lineHeight,C=x.top-$*(F||0);return this.session.setScrollTop(C),C},D.prototype.$calcSteps=function(_,F){var x=0,$=this.STEPS,C=[],b=function(T,I,O){return O*(Math.pow(T-1,3)+1)+I};for(x=0;x<$;++x)C.push(b(x/this.STEPS,_,F-_));return C},D.prototype.scrollToLine=function(_,F,x,$){var C=this.$cursorLayer.getPixelPosition({row:_,column:0}),b=C.top;F&&(b-=this.$size.scrollerHeight/2);var T=this.scrollTop;this.session.setScrollTop(b),x!==!1&&this.animateScrolling(T,$)},D.prototype.animateScrolling=function(_,F){var x=this.scrollTop;if(!this.$animatedScroll)return;var $=this;if(_==x)return;if(this.$scrollAnimation){var C=this.$scrollAnimation.steps;if(C.length&&(_=C[0],_==x))return}var b=$.$calcSteps(_,x);this.$scrollAnimation={from:_,to:x,steps:b},clearInterval(this.$timer),$.session.setScrollTop(b.shift()),$.session.$scrollTop=x;function T(){$.$timer=clearInterval($.$timer),$.$scrollAnimation=null,$.$stopAnimation=!1,F&&F()}this.$timer=setInterval(function(){if($.$stopAnimation){T();return}if(!$.session)return clearInterval($.$timer);b.length?($.session.setScrollTop(b.shift()),$.session.$scrollTop=x):x!=null?($.session.$scrollTop=-1,$.session.setScrollTop(x),x=null):T()},10)},D.prototype.scrollToY=function(_){this.scrollTop!==_&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=_)},D.prototype.scrollToX=function(_){this.scrollLeft!==_&&(this.scrollLeft=_),this.$loop.schedule(this.CHANGE_H_SCROLL)},D.prototype.scrollTo=function(_,F){this.session.setScrollTop(F),this.session.setScrollLeft(_)},D.prototype.scrollBy=function(_,F){F&&this.session.setScrollTop(this.session.getScrollTop()+F),_&&this.session.setScrollLeft(this.session.getScrollLeft()+_)},D.prototype.isScrollableBy=function(_,F){if(F<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||F>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||_<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||_>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},D.prototype.pixelToScreenCoordinates=function(_,F){var x;if(this.$hasCssTransforms){x={top:0,left:0};var $=this.$fontMetrics.transformCoordinates([_,F]);_=$[1]-this.gutterWidth-this.margin.left,F=$[0]}else x=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-x.left-this.$padding,b=C/this.characterWidth,T=Math.floor((F+this.scrollTop-x.top)/this.lineHeight),I=this.$blockCursor?Math.floor(b):Math.round(b);return{row:T,column:I,side:b-I>0?1:-1,offsetX:C}},D.prototype.screenToTextCoordinates=function(_,F){var x;if(this.$hasCssTransforms){x={top:0,left:0};var $=this.$fontMetrics.transformCoordinates([_,F]);_=$[1]-this.gutterWidth-this.margin.left,F=$[0]}else x=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-x.left-this.$padding,b=C/this.characterWidth,T=this.$blockCursor?Math.floor(b):Math.round(b),I=Math.floor((F+this.scrollTop-x.top)/this.lineHeight);return this.session.screenToDocumentPosition(I,Math.max(T,0),C)},D.prototype.textToScreenCoordinates=function(_,F){var x=this.scroller.getBoundingClientRect(),$=this.session.documentToScreenPosition(_,F),C=this.$padding+(this.session.$bidiHandler.isBidiRow($.row,_)?this.session.$bidiHandler.getPosLeft($.column):Math.round($.column*this.characterWidth)),b=$.row*this.lineHeight;return{pageX:x.left+C-this.scrollLeft,pageY:x.top+b-this.scrollTop}},D.prototype.visualizeFocus=function(){u.addCssClass(this.container,"ace_focus")},D.prototype.visualizeBlur=function(){u.removeCssClass(this.container,"ace_focus")},D.prototype.showComposition=function(_){this.$composition=_,_.cssText||(_.cssText=this.textarea.style.cssText),_.useTextareaForIME==null&&(_.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(u.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):_.markerId=this.session.addMarker(_.markerRange,"ace_composition_marker","text")},D.prototype.setCompositionText=function(_){var F=this.session.selection.cursor;this.addToken(_,"composition_placeholder",F.row,F.column),this.$moveTextAreaToCursor()},D.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),u.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var _=this.session.selection.cursor;this.removeExtraToken(_.row,_.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},D.prototype.setGhostText=function(_,F){var x=this.session.selection.cursor,$=F||{row:x.row,column:x.column};this.removeGhostText();var C=this.$calculateWrappedTextChunks(_,$);this.addToken(C[0].text,"ghost_text",$.row,$.column),this.$ghostText={text:_,position:{row:$.row,column:$.column}};var b=u.createElement("div");if(C.length>1){var T=this.hideTokensAfterPosition($.row,$.column),I;C.slice(1).forEach(function(W){var z=u.createElement("div"),U=u.createElement("span");U.className="ace_ghost_text",W.wrapped&&(z.className="ghost_text_line_wrapped"),W.text.length===0&&(W.text=" "),U.appendChild(u.createTextNode(W.text)),z.appendChild(U),b.appendChild(z),I=z}),T.forEach(function(W){var z=u.createElement("span");S(W.type)||(z.className="ace_"+W.type.replace(/\./g," ace_")),z.appendChild(u.createTextNode(W.value)),I.appendChild(z)}),this.$ghostTextWidget={el:b,row:$.row,column:$.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var O=this.$cursorLayer.getPixelPosition($,!0),N=this.container,P=N.getBoundingClientRect().height,B=C.length*this.lineHeight,V=B<P-O.top;if(V)return;B<P?this.scrollBy(0,(C.length-1)*this.lineHeight):this.scrollToRow($.row)}},D.prototype.$calculateWrappedTextChunks=function(_,F){var x=this.$size.scrollerWidth-this.$padding*2,$=Math.floor(x/this.characterWidth)-2;$=$<=0?60:$;for(var C=_.split(/\r?\n/),b=[],T=0;T<C.length;T++){var I=this.session.$getDisplayTokens(C[T],F.column),O=this.session.$computeWrapSplits(I,$,this.session.$tabSize);if(O.length>0){var N=0;O.push(C[T].length);for(var P=0;P<O.length;P++){var B=C[T].slice(N,O[P]);b.push({text:B,wrapped:!0}),N=O[P]}}else b.push({text:C[T],wrapped:!1})}return b},D.prototype.removeGhostText=function(){if(this.$ghostText){var _=this.$ghostText.position;this.removeExtraToken(_.row,_.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},D.prototype.addToken=function(_,F,x,$){var C=this.session;C.bgTokenizer.lines[x]=null;var b={type:F,value:_},T=C.getTokens(x);if($==null||!T.length)T.push(b);else for(var I=0,O=0;O<T.length;O++){var N=T[O];if(I+=N.value.length,$<=I){var P=N.value.length-(I-$),B=N.value.slice(0,P),V=N.value.slice(P);T.splice(O,1,{type:N.type,value:B},b,{type:N.type,value:V});break}}this.updateLines(x,x)},D.prototype.hideTokensAfterPosition=function(_,F){for(var x=this.session.getTokens(_),$=0,C=!1,b=[],T=0;T<x.length;T++){var I=x[T];if($+=I.value.length,I.type!=="ghost_text"){if(C){b.push({type:I.type,value:I.value}),I.type="hidden_token";continue}$===F&&(C=!0)}}return this.updateLines(_,_),b},D.prototype.removeExtraToken=function(_,F){this.session.bgTokenizer.lines[_]=null,this.updateLines(_,_)},D.prototype.setTheme=function(_,F){var x=this;if(this.$themeId=_,x._dispatchEvent("themeChange",{theme:_}),!_||typeof _=="string"){var $=_||this.$options.theme.initialValue;r.loadModule(["theme",$],C)}else C(_);function C(b){if(x.$themeId!=_)return F&&F();if(!b||!b.cssClass)throw new Error("couldn't load module "+_+" or it didn't call define");b.$id&&(x.$themeId=b.$id),u.importCssString(b.cssText,b.cssClass,x.container),x.theme&&u.removeCssClass(x.container,x.theme.cssClass);var T="padding"in b?b.padding:"padding"in(x.theme||{})?4:x.$padding;if(x.$padding&&T!=x.$padding&&x.setPadding(T),x.$gutterLayer){var I=b.$showGutterCursorMarker;I&&!x.$gutterLayer.$showCursorMarker?x.$gutterLayer.$showCursorMarker="theme":!I&&x.$gutterLayer.$showCursorMarker=="theme"&&(x.$gutterLayer.$showCursorMarker=null)}x.$theme=b.cssClass,x.theme=b,u.addCssClass(x.container,b.cssClass),u.setCssClass(x.container,"ace_dark",b.isDark),x.$size&&(x.$size.width=0,x.$updateSizeAsync()),x._dispatchEvent("themeLoaded",{theme:b}),F&&F(),m.isSafari&&x.scroller&&(x.scroller.style.background="red",x.scroller.style.background="")}},D.prototype.getTheme=function(){return this.$themeId},D.prototype.setStyle=function(_,F){u.setCssClass(this.container,_,F!==!1)},D.prototype.unsetStyle=function(_){u.removeCssClass(this.container,_)},D.prototype.setCursorStyle=function(_){u.setStyle(this.scroller.style,"cursor",_)},D.prototype.setMouseCursor=function(_){u.setStyle(this.scroller.style,"cursor",_)},D.prototype.attachToShadowRoot=function(){u.importCssString(E,"ace_editor.css",this.container)},D.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},D.prototype.$updateCustomScrollbar=function(_){var F=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),_===!0?(this.scrollBarV=new f(this.container,this),this.scrollBarH=new p(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(x){F.$scrollAnimation||F.session.setScrollTop(x.data-F.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(x){F.$scrollAnimation||F.session.setScrollLeft(x.data-F.scrollMargin.left)}),this.$scrollDecorator?(this.$scrollDecorator.setScrollBarV(this.scrollBarV),this.$scrollDecorator.$updateDecorators()):(this.$scrollDecorator=new w(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators())):(this.scrollBarV=new s(this.container,this),this.scrollBarH=new h(this.container,this),this.scrollBarV.addEventListener("scroll",function(x){F.$scrollAnimation||F.session.setScrollTop(x.data-F.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(x){F.$scrollAnimation||F.session.setScrollLeft(x.data-F.scrollMargin.left)}))},D.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var _=this;this.$resizeTimer=d.delayedCall(function(){_.destroyed||_.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(F){var x=F[0].contentRect.width,$=F[0].contentRect.height;Math.abs(_.$size.width-x)>1||Math.abs(_.$size.height-$)>1?_.$resizeTimer.delay():_.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},D})();M.prototype.CHANGE_CURSOR=1,M.prototype.CHANGE_MARKER=2,M.prototype.CHANGE_GUTTER=4,M.prototype.CHANGE_SCROLL=8,M.prototype.CHANGE_LINES=16,M.prototype.CHANGE_TEXT=32,M.prototype.CHANGE_SIZE=64,M.prototype.CHANGE_MARKER_BACK=128,M.prototype.CHANGE_MARKER_FRONT=256,M.prototype.CHANGE_FULL=512,M.prototype.CHANGE_H_SCROLL=1024,M.prototype.$changes=0,M.prototype.$padding=null,M.prototype.$frozen=!1,M.prototype.STEPS=8,a.implement(M.prototype,A),r.defineOptions(M.prototype,"renderer",{useResizeObserver:{set:function(D){!D&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):D&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(D){this.$textLayer.setShowInvisibles(D)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(D){typeof D=="number"&&(this.$printMarginColumn=D),this.$showPrintMargin=!!D,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(D){this.$gutter.style.display=D?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(D){this.$gutterLayer.$useSvgGutterIcons=D},initialValue:!1},showFoldedAnnotations:{set:function(D){this.$gutterLayer.$showFoldedAnnotations=D},initialValue:!1},fadeFoldWidgets:{set:function(D){u.setCssClass(this.$gutter,"ace_fade-fold-widgets",D)},initialValue:!1},showFoldWidgets:{set:function(D){this.$gutterLayer.setShowFoldWidgets(D),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(D){this.$textLayer.setDisplayIndentGuides(D)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(D){this.$textLayer.setHighlightIndentGuides(D)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(D){this.$gutterLayer.setHighlightGutterLine(D),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(D){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(D){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(D){typeof D=="number"&&(D=D+"px"),this.container.style.fontSize=D,this.updateFontSize()},initialValue:12},fontFamily:{set:function(D){this.container.style.fontFamily=D,this.updateFontSize()}},maxLines:{set:function(D){this.updateFull()}},minLines:{set:function(D){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(D){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(D){D=+D||0,this.$scrollPastEnd!=D&&(this.$scrollPastEnd=D,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(D){this.$gutterLayer.$fixedWidth=!!D,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(D){this.$updateCustomScrollbar(D)},initialValue:!1},theme:{set:function(D){this.setTheme(D)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!m.isMobile&&!m.isIE}}),l.VirtualRenderer=M}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(n,l,v){var a=n("../lib/oop"),u=n("../lib/net"),d=n("../lib/event_emitter").EventEmitter,r=n("../config");function c(h){var s="importScripts('"+u.qualifyURL(h)+"');";try{return new Blob([s],{type:"application/javascript"})}catch{var p=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,f=new p;return f.append(s),f.getBlob("application/javascript")}}function e(h){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(r.get("loadWorkerFromBlob")){var s=c(h),p=window.URL||window.webkitURL,f=p.createObjectURL(s);return new Worker(f)}return new Worker(h)}var i=function(h){h.postMessage||(h=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=h,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){a.implement(this,d),this.$createWorkerFromOldConfig=function(h,s,p,f,g){if(n.nameToUrl&&!n.toUrl&&(n.toUrl=n.nameToUrl),r.get("packaged")||!n.toUrl)f=f||r.moduleUrl(s,"worker");else{var y=this.$normalizePath;f=f||y(n.toUrl("ace/worker/worker.js",null,"_"));var A={};h.forEach(function(E){A[E]=y(n.toUrl(E,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=e(f),g&&this.send("importScripts",g),this.$worker.postMessage({init:!0,tlns:A,module:s,classname:p}),this.$worker},this.onMessage=function(h){var s=h.data;switch(s.type){case"event":this._signal(s.name,{data:s.data});break;case"call":var p=this.callbacks[s.id];p&&(p(s.data),delete this.callbacks[s.id]);break;case"error":this.reportError(s.data);break;case"log":window.console&&console.log&&console.log.apply(console,s.data);break}},this.reportError=function(h){window.console&&console.error&&console.error(h)},this.$normalizePath=function(h){return u.qualifyURL(h)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(h){h.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(h,s){this.$worker.postMessage({command:h,args:s})},this.call=function(h,s,p){if(p){var f=this.callbackId++;this.callbacks[f]=p,s.push(f)}this.send(h,s)},this.emit=function(h,s){try{s.data&&s.data.err&&(s.data.err={message:s.data.err.message,stack:s.data.err.stack,code:s.data.err.code}),this.$worker&&this.$worker.postMessage({event:h,data:{data:s.data}})}catch(p){console.error(p.stack)}},this.attachToDocument=function(h){this.$doc&&this.terminate(),this.$doc=h,this.call("setValue",[h.getValue()]),h.on("change",this.changeListener,!0)},this.changeListener=function(h){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),h.action=="insert"?this.deltaQueue.push(h.start,h.lines):this.deltaQueue.push(h.start,h.end)},this.$sendDeltaQueue=function(){var h=this.deltaQueue;h&&(this.deltaQueue=null,h.length>50&&h.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:h}))}}).call(i.prototype);var o=function(h,s,p){var f=null,g=!1,y=Object.create(d),A=[],E=new i({messageBuffer:A,terminate:function(){},postMessage:function(m){A.push(m),f&&(g?setTimeout(w):w())}});E.setEmitSync=function(m){g=m};var w=function(){var m=A.shift();m.command?f[m.command].apply(f,m.args):m.event&&y._signal(m.event,m.data)};return y.postMessage=function(m){E.onMessage({data:m})},y.callback=function(m,S){this.postMessage({type:"call",id:S,data:m})},y.emit=function(m,S){this.postMessage({type:"event",name:m,data:S})},r.loadModule(["worker",s],function(m){for(f=new m[p](y);A.length;)w()}),E};l.UIWorkerClient=o,l.WorkerClient=i,l.createWorker=e}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(n,l,v){var a=n("./range").Range,u=n("./lib/event_emitter").EventEmitter,d=n("./lib/oop"),r=(function(){function c(e,i,o,h,s,p){var f=this;this.length=i,this.session=e,this.doc=e.getDocument(),this.mainClass=s,this.othersClass=p,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=h,this.$onCursorChange=function(){setTimeout(function(){f.onCursorChange()})},this.$pos=o;var g=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=g.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}return c.prototype.setup=function(){var e=this,i=this.doc,o=this.session;this.selectionBefore=o.selection.toJSON(),o.selection.inMultiSelectMode&&o.selection.toSingleRange(),this.pos=i.createAnchor(this.$pos.row,this.$pos.column);var h=this.pos;h.$insertRight=!0,h.detach(),h.markerId=o.addMarker(new a(h.row,h.column,h.row,h.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(s){var p=i.createAnchor(s.row,s.column);p.$insertRight=!0,p.detach(),e.others.push(p)}),o.setUndoSelect(!1)},c.prototype.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,i=this;this.othersActive=!0,this.others.forEach(function(o){o.markerId=e.addMarker(new a(o.row,o.column,o.row,o.column+i.length),i.othersClass,null,!1)})}},c.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},c.prototype.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var i=e;if(i.start.row===i.end.row&&i.start.row===this.pos.row){this.$updating=!0;var o=e.action==="insert"?i.end.column-i.start.column:i.start.column-i.end.column,h=i.start.column>=this.pos.column&&i.start.column<=this.pos.column+this.length+1,s=i.start.column-this.pos.column;if(this.updateAnchors(e),h&&(this.length+=o),h&&!this.session.$fromUndo){if(e.action==="insert")for(var p=this.others.length-1;p>=0;p--){var f=this.others[p],g={row:f.row,column:f.column+s};this.doc.insertMergedLines(g,e.lines)}else if(e.action==="remove")for(var p=this.others.length-1;p>=0;p--){var f=this.others[p],g={row:f.row,column:f.column+s};this.doc.remove(new a(g.row,g.column,g.row,g.column-o))}}this.$updating=!1,this.updateMarkers()}},c.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var i=this.others.length;i--;)this.others[i].onChange(e);this.updateMarkers()},c.prototype.updateMarkers=function(){if(!this.$updating){var e=this,i=this.session,o=function(s,p){i.removeMarker(s.markerId),s.markerId=i.addMarker(new a(s.row,s.column,s.row,s.column+e.length),p,null,!1)};o(this.pos,this.mainClass);for(var h=this.others.length;h--;)o(this.others[h],this.othersClass)}},c.prototype.onCursorChange=function(e){if(!(this.$updating||!this.session)){var i=this.session.selection.getCursor();i.row===this.pos.row&&i.column>=this.pos.column&&i.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},c.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},c.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var e=this.session.getUndoManager(),i=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,o=0;o<i;o++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},c})();d.implement(r.prototype,u),l.PlaceHolder=r}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(n,l,v){var a=n("../lib/event"),u=n("../lib/useragent");function d(c,e){return c.row==e.row&&c.column==e.column}function r(c){var e=c.domEvent,i=e.altKey,o=e.shiftKey,h=e.ctrlKey,s=c.getAccelKey(),p=c.getButton();if(h&&u.isMac&&(p=e.button),c.editor.inMultiSelectMode&&p==2){c.editor.textInput.onContextMenu(c.domEvent);return}if(!h&&!i&&!s){p===0&&c.editor.inMultiSelectMode&&c.editor.exitMultiSelectMode();return}if(p===0){var f=c.editor,g=f.selection,y=f.inMultiSelectMode,A=c.getDocumentPosition(),E=g.getCursor(),w=c.inSelection()||g.isEmpty()&&d(A,E),m=c.x,S=c.y,M=function(B){m=B.clientX,S=B.clientY},D=f.session,_=f.renderer.pixelToScreenCoordinates(m,S),F=_,x;if(f.$mouseHandler.$enableJumpToDef)h&&i||s&&i?x=o?"block":"add":i&&f.$blockSelectEnabled&&(x="block");else if(s&&!i){if(x="add",!y&&o)return}else i&&f.$blockSelectEnabled&&(x="block");if(x&&u.isMac&&e.ctrlKey&&f.$mouseHandler.cancelContextMenu(),x=="add"){if(!y&&w)return;if(!y){var $=g.toOrientedRange();f.addSelectionMarker($)}var C=g.rangeList.rangeAtPoint(A);f.inVirtualSelectionMode=!0,o&&(C=null,$=g.ranges[0]||$,f.removeSelectionMarker($)),f.once("mouseup",function(){var B=g.toOrientedRange();C&&B.isEmpty()&&d(C.cursor,B.cursor)?g.substractPoint(B.cursor):(o?g.substractPoint($.cursor):$&&(f.removeSelectionMarker($),g.addRange($)),g.addRange(B)),f.inVirtualSelectionMode=!1})}else if(x=="block"){c.stop(),f.inVirtualSelectionMode=!0;var b,T=[],I=function(){var B=f.renderer.pixelToScreenCoordinates(m,S),V=D.screenToDocumentPosition(B.row,B.column,B.offsetX);d(F,B)&&d(V,g.lead)||(F=B,f.selection.moveToPosition(V),f.renderer.scrollCursorIntoView(),f.removeSelectionMarkers(T),T=g.rectangularRangeBlock(F,_),f.$mouseHandler.$clickSelection&&T.length==1&&T[0].isEmpty()&&(T[0]=f.$mouseHandler.$clickSelection.clone()),T.forEach(f.addSelectionMarker,f),f.updateSelectionMarkers())};y&&!s?g.toSingleRange():!y&&s&&(b=g.toOrientedRange(),f.addSelectionMarker(b)),o?_=D.documentToScreenPosition(g.lead):g.moveToPosition(A),F={row:-1,column:-1};var O=function(B){I(),clearInterval(P),f.removeSelectionMarkers(T),T.length||(T=[g.toOrientedRange()]),b&&(f.removeSelectionMarker(b),g.toSingleRange(b));for(var V=0;V<T.length;V++)g.addRange(T[V]);f.inVirtualSelectionMode=!1,f.$mouseHandler.$clickSelection=null},N=I;a.capture(f.container,M,O);var P=setInterval(function(){N()},20);return c.preventDefault()}}}l.onMouseDown=r}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(n,l,v){l.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(u){u.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(u){u.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(u){u.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(u){u.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(u){u.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(u){u.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(u){u.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(u){u.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(u){u.multiSelect.rangeCount>1?u.multiSelect.joinSelections():u.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(u){u.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(u){u.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(u){u.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],l.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(u){u.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(u){return u&&u.inMultiSelectMode}}];var a=n("../keyboard/hash_handler").HashHandler;l.keyboardHandler=new a(l.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(n,l,v){var a=n("./range_list").RangeList,u=n("./range").Range,d=n("./selection").Selection,r=n("./mouse/multi_select_handler").onMouseDown,c=n("./lib/event"),e=n("./lib/lang"),i=n("./commands/multi_select_commands");l.commands=i.defaultCommands.concat(i.multiSelectCommands);var o=n("./search").Search,h=new o;function s(E,w,m){return h.$options.wrap=!0,h.$options.needle=w,h.$options.backwards=m==-1,h.find(E)}var p=n("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(p.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(E,w){if(E){if(!this.inMultiSelectMode&&this.rangeCount===0){var m=this.toOrientedRange();if(this.rangeList.add(m),this.rangeList.add(E),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),w||this.fromOrientedRange(E);this.rangeList.removeAll(),this.rangeList.add(m),this.$onAddRange(m)}E.cursor||(E.cursor=E.end);var S=this.rangeList.add(E);return this.$onAddRange(E),S.length&&this.$onRemoveRange(S),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),w||this.fromOrientedRange(E)}},this.toSingleRange=function(E){E=E||this.ranges[0];var w=this.rangeList.removeAll();w.length&&this.$onRemoveRange(w),E&&this.fromOrientedRange(E)},this.substractPoint=function(E){var w=this.rangeList.substractPoint(E);if(w)return this.$onRemoveRange(w),w[0]},this.mergeOverlappingRanges=function(){var E=this.rangeList.merge();E.length&&this.$onRemoveRange(E)},this.$onAddRange=function(E){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(E),this._signal("addRange",{range:E})},this.$onRemoveRange=function(E){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var w=this.rangeList.ranges.pop();E.push(w),this.rangeCount=0}for(var m=E.length;m--;){var S=this.ranges.indexOf(E[m]);this.ranges.splice(S,1)}this._signal("removeRange",{ranges:E}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),w=w||this.ranges[0],w&&!w.isEqual(this.getRange())&&this.fromOrientedRange(w)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new a,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var E=this.ranges.length?this.ranges:[this.getRange()],w=[],m=0;m<E.length;m++){var S=E[m],M=S.start.row,D=S.end.row;if(M===D)w.push(S.clone());else{for(w.push(new u(M,S.start.column,M,this.session.getLine(M).length));++M<D;)w.push(this.getLineRange(M,!0));w.push(new u(D,0,D,S.end.column))}m==0&&!this.isBackwards()&&(w=w.reverse())}this.toSingleRange();for(var m=w.length;m--;)this.addRange(w[m])},this.joinSelections=function(){var E=this.rangeList.ranges,w=E[E.length-1],m=u.fromPoints(E[0].start,w.end);this.toSingleRange(),this.setSelectionRange(m,w.cursor==w.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var E=this.rangeList.ranges,w=E[E.length-1],m=u.fromPoints(E[0].start,w.end);this.toSingleRange(),this.setSelectionRange(m,w.cursor==w.start)}else{var S=this.session.documentToScreenPosition(this.cursor),M=this.session.documentToScreenPosition(this.anchor),D=this.rectangularRangeBlock(S,M);D.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(E,w,m){var S=[],M=E.column<w.column;if(M)var D=E.column,_=w.column,F=E.offsetX,x=w.offsetX;else var D=w.column,_=E.column,F=w.offsetX,x=E.offsetX;var $=E.row<w.row;if($)var C=E.row,b=w.row;else var C=w.row,b=E.row;D<0&&(D=0),C<0&&(C=0),C==b&&(m=!0);for(var T,I=C;I<=b;I++){var O=u.fromPoints(this.session.screenToDocumentPosition(I,D,F),this.session.screenToDocumentPosition(I,_,x));if(O.isEmpty()){if(T&&g(O.end,T))break;T=O.end}O.cursor=M?O.start:O.end,S.push(O)}if($&&S.reverse(),!m){for(var N=S.length-1;S[N].isEmpty()&&N>0;)N--;if(N>0)for(var P=0;S[P].isEmpty();)P++;for(var B=N;B>=P;B--)S[B].isEmpty()&&S.splice(B,1)}return S}}).call(d.prototype);var f=n("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(E){E.cursor||(E.cursor=E.end);var w=this.getSelectionStyle();return E.marker=this.session.addMarker(E,"ace_selection",w),this.session.$selectionMarkers.push(E),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,E},this.removeSelectionMarker=function(E){if(E.marker){this.session.removeMarker(E.marker);var w=this.session.$selectionMarkers.indexOf(E);w!=-1&&this.session.$selectionMarkers.splice(w,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(E){for(var w=this.session.$selectionMarkers,m=E.length;m--;){var S=E[m];if(S.marker){this.session.removeMarker(S.marker);var M=w.indexOf(S);M!=-1&&w.splice(M,1)}}this.session.selectionMarkerCount=w.length},this.$onAddRange=function(E){this.addSelectionMarker(E.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(E){this.removeSelectionMarkers(E.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(E){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(i.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(E){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(i.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(E){var w=E.command,m=E.editor;if(m.multiSelect){if(w.multiSelectAction)w.multiSelectAction=="forEach"?S=m.forEachSelection(w,E.args):w.multiSelectAction=="forEachLine"?S=m.forEachSelection(w,E.args,!0):w.multiSelectAction=="single"?(m.exitMultiSelectMode(),S=w.exec(m,E.args||{})):S=w.multiSelectAction(m,E.args||{});else{var S=w.exec(m,E.args||{});m.multiSelect.addRange(m.multiSelect.toOrientedRange()),m.multiSelect.mergeOverlappingRanges()}return S}},this.forEachSelection=function(E,w,m){if(!this.inVirtualSelectionMode){var S=m&&m.keepOrder,M=m==!0||m&&m.$byLines,D=this.session,_=this.selection,F=_.rangeList,x=(S?_:F).ranges,$;if(!x.length)return E.exec?E.exec(this,w||{}):E(this,w||{});var C=_._eventRegistry;_._eventRegistry={};var b=new d(D);this.inVirtualSelectionMode=!0;for(var T=x.length;T--;){if(M)for(;T>0&&x[T].start.row==x[T-1].end.row;)T--;b.fromOrientedRange(x[T]),b.index=T,this.selection=D.selection=b;var I=E.exec?E.exec(this,w||{}):E(this,w||{});!$&&I!==void 0&&($=I),b.toOrientedRange(x[T])}b.detach(),this.selection=D.selection=_,this.inVirtualSelectionMode=!1,_._eventRegistry=C,_.mergeOverlappingRanges(),_.ranges[0]&&_.fromOrientedRange(_.ranges[0]);var O=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),O&&O.from==O.to&&this.renderer.animateScrolling(O.from),$}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var E="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var w=this.multiSelect.rangeList.ranges,m=[],S=0;S<w.length;S++)m.push(this.session.getTextRange(w[S]));var M=this.session.getDocument().getNewLineCharacter();E=m.join(M),E.length==(m.length-1)*M.length&&(E="")}else this.selection.isEmpty()||(E=this.session.getTextRange(this.getSelectionRange()));return E},this.$checkMultiselectChange=function(E,w){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var m=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&w==this.multiSelect.anchor)return;var S=w==this.multiSelect.anchor?m.cursor==m.start?m.end:m.start:m.cursor;S.row!=w.row||this.session.$clipPositionToDocument(S.row,S.column).column!=w.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(E,w,m){if(w=w||{},w.needle=E||w.needle,w.needle==null){var S=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();w.needle=this.session.getTextRange(S)}this.$search.set(w);var M=this.$search.findAll(this.session);if(!M.length)return 0;var D=this.multiSelect;m||D.toSingleRange(M[0]);for(var _=M.length;_--;)D.addRange(M[_],!0);return S&&D.rangeList.rangeAtPoint(S.start)&&D.addRange(S,!0),M.length},this.selectMoreLines=function(E,w){var m=this.selection.toOrientedRange(),S=m.cursor==m.end,M=this.session.documentToScreenPosition(m.cursor);this.selection.$desiredColumn&&(M.column=this.selection.$desiredColumn);var D=this.session.screenToDocumentPosition(M.row+E,M.column);if(m.isEmpty())var F=D;else var _=this.session.documentToScreenPosition(S?m.end:m.start),F=this.session.screenToDocumentPosition(_.row+E,_.column);if(S){var x=u.fromPoints(D,F);x.cursor=x.start}else{var x=u.fromPoints(F,D);x.cursor=x.end}if(x.desiredColumn=M.column,!this.selection.inMultiSelectMode)this.selection.addRange(m);else if(w)var $=m.cursor;this.selection.addRange(x),$&&this.selection.substractPoint($)},this.transposeSelections=function(E){for(var w=this.session,m=w.multiSelect,S=m.ranges,M=S.length;M--;){var D=S[M];if(D.isEmpty()){var _=w.getWordRange(D.start.row,D.start.column);D.start.row=_.start.row,D.start.column=_.start.column,D.end.row=_.end.row,D.end.column=_.end.column}}m.mergeOverlappingRanges();for(var F=[],M=S.length;M--;){var D=S[M];F.unshift(w.getTextRange(D))}E<0?F.unshift(F.pop()):F.push(F.shift());for(var M=S.length;M--;){var D=S[M],x=D.clone();w.replace(D,F[M]),D.start.row=x.start.row,D.start.column=x.start.column}m.fromOrientedRange(m.ranges[0])},this.selectMore=function(E,w,m){var S=this.session,M=S.multiSelect,D=M.toOrientedRange();if(!(D.isEmpty()&&(D=S.getWordRange(D.start.row,D.start.column),D.cursor=E==-1?D.start:D.end,this.multiSelect.addRange(D),m))){var _=S.getTextRange(D),F=s(S,_,E);F&&(F.cursor=E==-1?F.start:F.end,this.session.unfold(F),this.multiSelect.addRange(F),this.renderer.scrollCursorIntoView(null,.5)),w&&this.multiSelect.substractPoint(D.cursor)}},this.alignCursors=function(){var E=this.session,w=E.multiSelect,m=w.ranges,S=-1,M=m.filter(function(N){if(N.cursor.row==S)return!0;S=N.cursor.row});if(!m.length||M.length==m.length-1){var D=this.selection.getRange(),_=D.start.row,F=D.end.row,x=_==F;if(x){var $=this.session.getLength(),C;do C=this.session.getLine(F);while(/[=:]/.test(C)&&++F<$);do C=this.session.getLine(_);while(/[=:]/.test(C)&&--_>0);_<0&&(_=0),F>=$&&(F=$-1)}var b=this.session.removeFullLines(_,F);b=this.$reAlignText(b,x),this.session.insert({row:_,column:0},b.join(`
959
+ `)+`
960
+ `),x||(D.start.column=0,D.end.column=b[b.length-1].length),this.selection.setRange(D)}else{M.forEach(function(N){w.substractPoint(N.cursor)});var T=0,I=1/0,O=m.map(function(N){var P=N.cursor,B=E.getLine(P.row),V=B.substr(P.column).search(/\S/g);return V==-1&&(V=0),P.column>T&&(T=P.column),V<I&&(I=V),V});m.forEach(function(N,P){var B=N.cursor,V=T-B.column,W=O[P]-I;V>W?E.insert(B,e.stringRepeat(" ",V-W)):E.remove(new u(B.row,B.column,B.row,B.column-V+W)),N.start.column=N.end.column=T,N.start.row=N.end.row=B.row,N.cursor=N.end}),w.fromOrientedRange(m[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(E,w){var m=!0,S=!0,M,D,_;return E.map(function(b){var T=b.match(/(\s*)(.*?)(\s*)([=:].*)/);return T?M==null?(M=T[1].length,D=T[2].length,_=T[3].length,T):(M+D+_!=T[1].length+T[2].length+T[3].length&&(S=!1),M!=T[1].length&&(m=!1),M>T[1].length&&(M=T[1].length),D<T[2].length&&(D=T[2].length),_>T[3].length&&(_=T[3].length),T):[b]}).map(w?x:m?S?$:x:C);function F(b){return e.stringRepeat(" ",b)}function x(b){return b[2]?F(M)+b[2]+F(D-b[2].length+_)+b[4].replace(/^([=:])\s+/,"$1 "):b[0]}function $(b){return b[2]?F(M+D-b[2].length)+b[2]+F(_)+b[4].replace(/^([=:])\s+/,"$1 "):b[0]}function C(b){return b[2]?F(M)+b[2]+F(_)+b[4].replace(/^([=:])\s+/,"$1 "):b[0]}}}).call(f.prototype);function g(E,w){return E.row==w.row&&E.column==w.column}l.onSessionChange=function(E){var w=E.session;w&&!w.multiSelect&&(w.$selectionMarkers=[],w.selection.$initRangeList(),w.multiSelect=w.selection),this.multiSelect=w&&w.multiSelect;var m=E.oldSession;m&&(m.multiSelect.off("addRange",this.$onAddRange),m.multiSelect.off("removeRange",this.$onRemoveRange),m.multiSelect.off("multiSelect",this.$onMultiSelect),m.multiSelect.off("singleSelect",this.$onSingleSelect),m.multiSelect.lead.off("change",this.$checkMultiselectChange),m.multiSelect.anchor.off("change",this.$checkMultiselectChange)),w&&(w.multiSelect.on("addRange",this.$onAddRange),w.multiSelect.on("removeRange",this.$onRemoveRange),w.multiSelect.on("multiSelect",this.$onMultiSelect),w.multiSelect.on("singleSelect",this.$onSingleSelect),w.multiSelect.lead.on("change",this.$checkMultiselectChange),w.multiSelect.anchor.on("change",this.$checkMultiselectChange)),w&&this.inMultiSelectMode!=w.selection.inMultiSelectMode&&(w.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function y(E){E.$multiselectOnSessionChange||(E.$onAddRange=E.$onAddRange.bind(E),E.$onRemoveRange=E.$onRemoveRange.bind(E),E.$onMultiSelect=E.$onMultiSelect.bind(E),E.$onSingleSelect=E.$onSingleSelect.bind(E),E.$multiselectOnSessionChange=l.onSessionChange.bind(E),E.$checkMultiselectChange=E.$checkMultiselectChange.bind(E),E.$multiselectOnSessionChange(E),E.on("changeSession",E.$multiselectOnSessionChange),E.on("mousedown",r),E.commands.addCommands(i.defaultCommands),A(E))}function A(E){if(!E.textInput)return;var w=E.textInput.getElement(),m=!1;c.addListener(w,"keydown",function(M){var D=M.keyCode==18&&!(M.ctrlKey||M.shiftKey||M.metaKey);E.$blockSelectEnabled&&D?m||(E.renderer.setMouseCursor("crosshair"),m=!0):m&&S()},E),c.addListener(w,"keyup",S,E),c.addListener(w,"blur",S,E);function S(M){m&&(E.renderer.setMouseCursor(""),m=!1)}}l.MultiSelect=y,n("./config").defineOptions(f.prototype,"editor",{enableMultiselect:{set:function(E){y(this),E?this.on("mousedown",r):this.off("mousedown",r)},value:!0},enableBlockSelect:{set:function(E){this.$blockSelectEnabled=E},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(n,l,v){var a=n("../../range").Range,u=l.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(d,r,c){var e=d.getLine(c);return this.foldingStartMarker.test(e)?"start":r=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(e)?"end":""},this.getFoldWidgetRange=function(d,r,c){return null},this.indentationBlock=function(d,r,c){var e=/\S/,i=d.getLine(r),o=i.search(e);if(o!=-1){for(var h=c||i.length,s=d.getLength(),p=r,f=r;++r<s;){var g=d.getLine(r).search(e);if(g!=-1){if(g<=o){var y=d.getTokenAt(r,0);if(!y||y.type!=="string")break}f=r}}if(f>p){var A=d.getLine(f).length;return new a(p,h,f,A)}}},this.openingBracketBlock=function(d,r,c,e,i){var o={row:c,column:e+1},h=d.$findClosingBracket(r,o,i);if(h){var s=d.foldWidgets[h.row];return s==null&&(s=d.getFoldWidget(h.row)),s=="start"&&h.row>o.row&&(h.row--,h.column=d.getLine(h.row).length),a.fromPoints(o,h)}},this.closingBracketBlock=function(d,r,c,e,i){var o={row:c,column:e},h=d.$findOpeningBracket(r,o);if(h)return h.column++,o.column--,a.fromPoints(h,o)}}).call(u.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(n,l,v){var a=n("../lib/dom"),u=n("../range").Range,d=n("../config").nls;function r(e,i,o){for(var h=0,s=e.length-1;h<=s;){var p=h+s>>1,f=o(i,e[p]);if(f>0)h=p+1;else if(f<0)s=p-1;else return p}return-(h+1)}function c(e,i,o){var h=e.getAnnotations().sort(u.comparePoints);if(h.length){var s=r(h,{row:i,column:-1},u.comparePoints);s<0&&(s=-s-1),s>=h.length?s=o>0?0:h.length-1:s===0&&o<0&&(s=h.length-1);var p=h[s];if(!(!p||!o)){if(p.row===i){do p=h[s+=o];while(p&&p.row===i);if(!p)return h.slice()}var f=[];i=p.row;do f[o<0?"unshift":"push"](p),p=h[s+=o];while(p&&p.row==i);return f.length&&f}}}l.showErrorMarker=function(e,i){var o=e.session,h=e.getCursorPosition(),s=h.row,p=o.widgetManager.getWidgetsAtRow(s).filter(function(M){return M.type=="errorMarker"})[0];p?p.destroy():s-=i;var f=c(o,s,i),g;if(f){var y=f[0];h.column=(y.pos&&typeof y.column!="number"?y.pos.sc:y.column)||0,h.row=y.row,g=e.renderer.$gutterLayer.$annotations[h.row]}else{if(p)return;g={displayText:[d("error-marker.good-state","Looks good!")],className:"ace_ok"}}e.session.unfold(h.row),e.selection.moveToPosition(h);var A={row:h.row,fixedWidth:!0,coverGutter:!0,el:a.createElement("div"),type:"errorMarker"},E=A.el.appendChild(a.createElement("div")),w=A.el.appendChild(a.createElement("div"));w.className="error_widget_arrow "+g.className;var m=e.renderer.$cursorLayer.getPixelPosition(h).left;w.style.left=m+e.renderer.gutterWidth-5+"px",A.el.className="error_widget_wrapper",E.className="error_widget "+g.className,g.displayText.forEach(function(M,D){E.appendChild(a.createTextNode(M)),D<g.displayText.length-1&&E.appendChild(a.createElement("br"))}),E.appendChild(a.createElement("div"));var S=function(M,D,_){if(D===0&&(_==="esc"||_==="return"))return A.destroy(),{command:"null"}};A.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(S),o.widgetManager.removeLineWidget(A),e.off("changeSelection",A.destroy),e.off("changeSession",A.destroy),e.off("mouseup",A.destroy),e.off("change",A.destroy))},e.keyBinding.addKeyboardHandler(S),e.on("changeSelection",A.destroy),e.on("changeSession",A.destroy),e.on("mouseup",A.destroy),e.on("change",A.destroy),e.session.widgetManager.addLineWidget(A),A.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:A.el.offsetHeight})},a.importCssString(`
961
+ .error_widget_wrapper {
962
+ background: inherit;
963
+ color: inherit;
964
+ border:none
965
+ }
966
+ .error_widget {
967
+ border-top: solid 2px;
968
+ border-bottom: solid 2px;
969
+ margin: 5px 0;
970
+ padding: 10px 40px;
971
+ white-space: pre-wrap;
972
+ }
973
+ .error_widget.ace_error, .error_widget_arrow.ace_error{
974
+ border-color: #ff5a5a
975
+ }
976
+ .error_widget.ace_warning, .error_widget_arrow.ace_warning{
977
+ border-color: #F1D817
978
+ }
979
+ .error_widget.ace_info, .error_widget_arrow.ace_info{
980
+ border-color: #5a5a5a
981
+ }
982
+ .error_widget.ace_ok, .error_widget_arrow.ace_ok{
983
+ border-color: #5aaa5a
984
+ }
985
+ .error_widget_arrow {
986
+ position: absolute;
987
+ border: solid 5px;
988
+ border-top-color: transparent!important;
989
+ border-right-color: transparent!important;
990
+ border-left-color: transparent!important;
991
+ top: -5px;
992
+ }
993
+ `,"error_marker.css",!1)}),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(n,l,v){n("./loader_build")(l);var a=n("./lib/dom"),u=n("./range").Range,d=n("./editor").Editor,r=n("./edit_session").EditSession,c=n("./undomanager").UndoManager,e=n("./virtual_renderer").VirtualRenderer;n("./worker/worker_client"),n("./keyboard/hash_handler"),n("./placeholder"),n("./multi_select"),n("./mode/folding/fold_mode"),n("./theme/textmate"),n("./ext/error_marker"),l.config=n("./config"),l.edit=function(o,h){if(typeof o=="string"){var s=o;if(o=document.getElementById(s),!o)throw new Error("ace.edit can't find div #"+s)}if(o&&o.env&&o.env.editor instanceof d)return o.env.editor;var p="";if(o&&/input|textarea/i.test(o.tagName)){var f=o;p=f.value,o=a.createElement("pre"),f.parentNode.replaceChild(o,f)}else o&&(p=o.textContent,o.innerHTML="");var g=l.createEditSession(p),y=new d(new e(o),g,h),A={document:g,editor:y,onResize:y.resize.bind(y,null)};return f&&(A.textarea=f),y.on("destroy",function(){A.editor.container.env=null}),y.container.env=y.env=A,y},l.createEditSession=function(o,h){var s=new r(o,h);return s.setUndoManager(new c),s},l.Range=u,l.Editor=d,l.EditSession=r,l.UndoManager=c,l.VirtualRenderer=e;var i=l.config.version;l.version=i}),(function(){ace.require(["ace/ace"],function(n){n&&(n.config.init(!0),n.define=ace.define);var l=(function(){return this})();!l&&typeof window<"u"&&(l=window),!l&&typeof self<"u"&&(l=self),l.ace||(l.ace=n);for(var v in n)n.hasOwnProperty(v)&&(l.ace[v]=n[v]);l.ace.default=l.ace,L&&(L.exports=l.ace)})})()})(Ii);var Zt=Ii.exports,qt={exports:{}};qt.exports;(function(L,t){var n=200,l="__lodash_hash_undefined__",v=1,a=2,u=9007199254740991,d="[object Arguments]",r="[object Array]",c="[object AsyncFunction]",e="[object Boolean]",i="[object Date]",o="[object Error]",h="[object Function]",s="[object GeneratorFunction]",p="[object Map]",f="[object Number]",g="[object Null]",y="[object Object]",A="[object Promise]",E="[object Proxy]",w="[object RegExp]",m="[object Set]",S="[object String]",M="[object Symbol]",D="[object Undefined]",_="[object WeakMap]",F="[object ArrayBuffer]",x="[object DataView]",$="[object Float32Array]",C="[object Float64Array]",b="[object Int8Array]",T="[object Int16Array]",I="[object Int32Array]",O="[object Uint8Array]",N="[object Uint8ClampedArray]",P="[object Uint16Array]",B="[object Uint32Array]",V=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,z=/^(?:0|[1-9]\d*)$/,U={};U[$]=U[C]=U[b]=U[T]=U[I]=U[O]=U[N]=U[P]=U[B]=!0,U[d]=U[r]=U[F]=U[e]=U[x]=U[i]=U[o]=U[h]=U[p]=U[f]=U[y]=U[w]=U[m]=U[S]=U[_]=!1;var G=typeof ke=="object"&&ke&&ke.Object===Object&&ke,Y=typeof self=="object"&&self&&self.Object===Object&&self,Q=G||Y||Function("return this")(),q=t&&!t.nodeType&&t,te=q&&!0&&L&&!L.nodeType&&L,re=te&&te.exports===q,ue=re&&G.process,me=(function(){try{return ue&&ue.binding&&ue.binding("util")}catch{}})(),Ce=me&&me.isTypedArray;function ve(j,J){for(var ee=-1,ne=j==null?0:j.length,de=0,ae=[];++ee<ne;){var be=j[ee];J(be,ee,j)&&(ae[de++]=be)}return ae}function $e(j,J){for(var ee=-1,ne=J.length,de=j.length;++ee<ne;)j[de+ee]=J[ee];return j}function Lt(j,J){for(var ee=-1,ne=j==null?0:j.length;++ee<ne;)if(J(j[ee],ee,j))return!0;return!1}function gt(j,J){for(var ee=-1,ne=Array(j);++ee<j;)ne[ee]=J(ee);return ne}function Vi(j){return function(J){return j(J)}}function Ui(j,J){return j.has(J)}function Gi(j,J){return j==null?void 0:j[J]}function Ki(j){var J=-1,ee=Array(j.size);return j.forEach(function(ne,de){ee[++J]=[de,ne]}),ee}function Ji(j,J){return function(ee){return j(J(ee))}}function Yi(j){var J=-1,ee=Array(j.size);return j.forEach(function(ne){ee[++J]=ne}),ee}var Qi=Array.prototype,Xi=Function.prototype,It=Object.prototype,rn=Q["__core-js_shared__"],On=Xi.toString,Pe=It.hasOwnProperty,Rn=(function(){var j=/[^.]+$/.exec(rn&&rn.keys&&rn.keys.IE_PROTO||"");return j?"Symbol(src)_1."+j:""})(),Nn=It.toString,Zi=RegExp("^"+On.call(Pe).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bn=re?Q.Buffer:void 0,Ft=Q.Symbol,Pn=Q.Uint8Array,Wn=It.propertyIsEnumerable,qi=Qi.splice,nt=Ft?Ft.toStringTag:void 0,zn=Object.getOwnPropertySymbols,er=Bn?Bn.isBuffer:void 0,tr=Ji(Object.keys,Object),sn=mt(Q,"DataView"),Et=mt(Q,"Map"),on=mt(Q,"Promise"),an=mt(Q,"Set"),ln=mt(Q,"WeakMap"),St=mt(Object,"create"),nr=st(sn),ir=st(Et),rr=st(on),sr=st(an),or=st(ln),Hn=Ft?Ft.prototype:void 0,hn=Hn?Hn.valueOf:void 0;function it(j){var J=-1,ee=j==null?0:j.length;for(this.clear();++J<ee;){var ne=j[J];this.set(ne[0],ne[1])}}function ar(){this.__data__=St?St(null):{},this.size=0}function lr(j){var J=this.has(j)&&delete this.__data__[j];return this.size-=J?1:0,J}function hr(j){var J=this.__data__;if(St){var ee=J[j];return ee===l?void 0:ee}return Pe.call(J,j)?J[j]:void 0}function cr(j){var J=this.__data__;return St?J[j]!==void 0:Pe.call(J,j)}function ur(j,J){var ee=this.__data__;return this.size+=this.has(j)?0:1,ee[j]=St&&J===void 0?l:J,this}it.prototype.clear=ar,it.prototype.delete=lr,it.prototype.get=hr,it.prototype.has=cr,it.prototype.set=ur;function ze(j){var J=-1,ee=j==null?0:j.length;for(this.clear();++J<ee;){var ne=j[J];this.set(ne[0],ne[1])}}function pr(){this.__data__=[],this.size=0}function dr(j){var J=this.__data__,ee=Rt(J,j);if(ee<0)return!1;var ne=J.length-1;return ee==ne?J.pop():qi.call(J,ee,1),--this.size,!0}function fr(j){var J=this.__data__,ee=Rt(J,j);return ee<0?void 0:J[ee][1]}function gr(j){return Rt(this.__data__,j)>-1}function mr(j,J){var ee=this.__data__,ne=Rt(ee,j);return ne<0?(++this.size,ee.push([j,J])):ee[ne][1]=J,this}ze.prototype.clear=pr,ze.prototype.delete=dr,ze.prototype.get=fr,ze.prototype.has=gr,ze.prototype.set=mr;function rt(j){var J=-1,ee=j==null?0:j.length;for(this.clear();++J<ee;){var ne=j[J];this.set(ne[0],ne[1])}}function vr(){this.size=0,this.__data__={hash:new it,map:new(Et||ze),string:new it}}function yr(j){var J=Nt(this,j).delete(j);return this.size-=J?1:0,J}function br(j){return Nt(this,j).get(j)}function wr(j){return Nt(this,j).has(j)}function Cr(j,J){var ee=Nt(this,j),ne=ee.size;return ee.set(j,J),this.size+=ee.size==ne?0:1,this}rt.prototype.clear=vr,rt.prototype.delete=yr,rt.prototype.get=br,rt.prototype.has=wr,rt.prototype.set=Cr;function Ot(j){var J=-1,ee=j==null?0:j.length;for(this.__data__=new rt;++J<ee;)this.add(j[J])}function Er(j){return this.__data__.set(j,l),this}function Sr(j){return this.__data__.has(j)}Ot.prototype.add=Ot.prototype.push=Er,Ot.prototype.has=Sr;function Ke(j){var J=this.__data__=new ze(j);this.size=J.size}function Dr(){this.__data__=new ze,this.size=0}function xr(j){var J=this.__data__,ee=J.delete(j);return this.size=J.size,ee}function Ar(j){return this.__data__.get(j)}function $r(j){return this.__data__.has(j)}function Tr(j,J){var ee=this.__data__;if(ee instanceof ze){var ne=ee.__data__;if(!Et||ne.length<n-1)return ne.push([j,J]),this.size=++ee.size,this;ee=this.__data__=new rt(ne)}return ee.set(j,J),this.size=ee.size,this}Ke.prototype.clear=Dr,Ke.prototype.delete=xr,Ke.prototype.get=Ar,Ke.prototype.has=$r,Ke.prototype.set=Tr;function _r(j,J){var ee=Bt(j),ne=!ee&&Vr(j),de=!ee&&!ne&&cn(j),ae=!ee&&!ne&&!de&&Xn(j),be=ee||ne||de||ae,Ee=be?gt(j.length,String):[],De=Ee.length;for(var ye in j)Pe.call(j,ye)&&!(be&&(ye=="length"||de&&(ye=="offset"||ye=="parent")||ae&&(ye=="buffer"||ye=="byteLength"||ye=="byteOffset")||Pr(ye,De)))&&Ee.push(ye);return Ee}function Rt(j,J){for(var ee=j.length;ee--;)if(Kn(j[ee][0],J))return ee;return-1}function kr(j,J,ee){var ne=J(j);return Bt(j)?ne:$e(ne,ee(j))}function Dt(j){return j==null?j===void 0?D:g:nt&&nt in Object(j)?Nr(j):jr(j)}function jn(j){return xt(j)&&Dt(j)==d}function Vn(j,J,ee,ne,de){return j===J?!0:j==null||J==null||!xt(j)&&!xt(J)?j!==j&&J!==J:Mr(j,J,ee,ne,Vn,de)}function Mr(j,J,ee,ne,de,ae){var be=Bt(j),Ee=Bt(J),De=be?r:Je(j),ye=Ee?r:Je(J);De=De==d?y:De,ye=ye==d?y:ye;var Te=De==y,Fe=ye==y,xe=De==ye;if(xe&&cn(j)){if(!cn(J))return!1;be=!0,Te=!1}if(xe&&!Te)return ae||(ae=new Ke),be||Xn(j)?Un(j,J,ee,ne,de,ae):Or(j,J,De,ee,ne,de,ae);if(!(ee&v)){var Me=Te&&Pe.call(j,"__wrapped__"),Le=Fe&&Pe.call(J,"__wrapped__");if(Me||Le){var Ye=Me?j.value():j,He=Le?J.value():J;return ae||(ae=new Ke),de(Ye,He,ee,ne,ae)}}return xe?(ae||(ae=new Ke),Rr(j,J,ee,ne,de,ae)):!1}function Lr(j){if(!Qn(j)||zr(j))return!1;var J=Jn(j)?Zi:W;return J.test(st(j))}function Ir(j){return xt(j)&&Yn(j.length)&&!!U[Dt(j)]}function Fr(j){if(!Hr(j))return tr(j);var J=[];for(var ee in Object(j))Pe.call(j,ee)&&ee!="constructor"&&J.push(ee);return J}function Un(j,J,ee,ne,de,ae){var be=ee&v,Ee=j.length,De=J.length;if(Ee!=De&&!(be&&De>Ee))return!1;var ye=ae.get(j);if(ye&&ae.get(J))return ye==J;var Te=-1,Fe=!0,xe=ee&a?new Ot:void 0;for(ae.set(j,J),ae.set(J,j);++Te<Ee;){var Me=j[Te],Le=J[Te];if(ne)var Ye=be?ne(Le,Me,Te,J,j,ae):ne(Me,Le,Te,j,J,ae);if(Ye!==void 0){if(Ye)continue;Fe=!1;break}if(xe){if(!Lt(J,function(He,ot){if(!Ui(xe,ot)&&(Me===He||de(Me,He,ee,ne,ae)))return xe.push(ot)})){Fe=!1;break}}else if(!(Me===Le||de(Me,Le,ee,ne,ae))){Fe=!1;break}}return ae.delete(j),ae.delete(J),Fe}function Or(j,J,ee,ne,de,ae,be){switch(ee){case x:if(j.byteLength!=J.byteLength||j.byteOffset!=J.byteOffset)return!1;j=j.buffer,J=J.buffer;case F:return!(j.byteLength!=J.byteLength||!ae(new Pn(j),new Pn(J)));case e:case i:case f:return Kn(+j,+J);case o:return j.name==J.name&&j.message==J.message;case w:case S:return j==J+"";case p:var Ee=Ki;case m:var De=ne&v;if(Ee||(Ee=Yi),j.size!=J.size&&!De)return!1;var ye=be.get(j);if(ye)return ye==J;ne|=a,be.set(j,J);var Te=Un(Ee(j),Ee(J),ne,de,ae,be);return be.delete(j),Te;case M:if(hn)return hn.call(j)==hn.call(J)}return!1}function Rr(j,J,ee,ne,de,ae){var be=ee&v,Ee=Gn(j),De=Ee.length,ye=Gn(J),Te=ye.length;if(De!=Te&&!be)return!1;for(var Fe=De;Fe--;){var xe=Ee[Fe];if(!(be?xe in J:Pe.call(J,xe)))return!1}var Me=ae.get(j);if(Me&&ae.get(J))return Me==J;var Le=!0;ae.set(j,J),ae.set(J,j);for(var Ye=be;++Fe<De;){xe=Ee[Fe];var He=j[xe],ot=J[xe];if(ne)var Zn=be?ne(ot,He,xe,J,j,ae):ne(He,ot,xe,j,J,ae);if(!(Zn===void 0?He===ot||de(He,ot,ee,ne,ae):Zn)){Le=!1;break}Ye||(Ye=xe=="constructor")}if(Le&&!Ye){var Pt=j.constructor,Wt=J.constructor;Pt!=Wt&&"constructor"in j&&"constructor"in J&&!(typeof Pt=="function"&&Pt instanceof Pt&&typeof Wt=="function"&&Wt instanceof Wt)&&(Le=!1)}return ae.delete(j),ae.delete(J),Le}function Gn(j){return kr(j,Kr,Br)}function Nt(j,J){var ee=j.__data__;return Wr(J)?ee[typeof J=="string"?"string":"hash"]:ee.map}function mt(j,J){var ee=Gi(j,J);return Lr(ee)?ee:void 0}function Nr(j){var J=Pe.call(j,nt),ee=j[nt];try{j[nt]=void 0;var ne=!0}catch{}var de=Nn.call(j);return ne&&(J?j[nt]=ee:delete j[nt]),de}var Br=zn?function(j){return j==null?[]:(j=Object(j),ve(zn(j),function(J){return Wn.call(j,J)}))}:Jr,Je=Dt;(sn&&Je(new sn(new ArrayBuffer(1)))!=x||Et&&Je(new Et)!=p||on&&Je(on.resolve())!=A||an&&Je(new an)!=m||ln&&Je(new ln)!=_)&&(Je=function(j){var J=Dt(j),ee=J==y?j.constructor:void 0,ne=ee?st(ee):"";if(ne)switch(ne){case nr:return x;case ir:return p;case rr:return A;case sr:return m;case or:return _}return J});function Pr(j,J){return J=J??u,!!J&&(typeof j=="number"||z.test(j))&&j>-1&&j%1==0&&j<J}function Wr(j){var J=typeof j;return J=="string"||J=="number"||J=="symbol"||J=="boolean"?j!=="__proto__":j===null}function zr(j){return!!Rn&&Rn in j}function Hr(j){var J=j&&j.constructor,ee=typeof J=="function"&&J.prototype||It;return j===ee}function jr(j){return Nn.call(j)}function st(j){if(j!=null){try{return On.call(j)}catch{}try{return j+""}catch{}}return""}function Kn(j,J){return j===J||j!==j&&J!==J}var Vr=jn((function(){return arguments})())?jn:function(j){return xt(j)&&Pe.call(j,"callee")&&!Wn.call(j,"callee")},Bt=Array.isArray;function Ur(j){return j!=null&&Yn(j.length)&&!Jn(j)}var cn=er||Yr;function Gr(j,J){return Vn(j,J)}function Jn(j){if(!Qn(j))return!1;var J=Dt(j);return J==h||J==s||J==c||J==E}function Yn(j){return typeof j=="number"&&j>-1&&j%1==0&&j<=u}function Qn(j){var J=typeof j;return j!=null&&(J=="object"||J=="function")}function xt(j){return j!=null&&typeof j=="object"}var Xn=Ce?Vi(Ce):Ir;function Kr(j){return Ur(j)?_r(j):Fr(j)}function Jr(){return[]}function Yr(){return!1}L.exports=Gr})(qt,qt.exports);var Fi=qt.exports,Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.getAceInstance=Ne.debounce=Ne.editorEvents=Ne.editorOptions=void 0;var po=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"];Ne.editorOptions=po;var fo=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"];Ne.editorEvents=fo;var go=function(){var L;return typeof window>"u"?(ke.window={},L=Zt,delete ke.window):window.ace?(L=window.ace,L.acequire=window.ace.require||window.ace.acequire):L=Zt,L};Ne.getAceInstance=go;var mo=function(L,t){var n=null;return function(){var l=this,v=arguments;clearTimeout(n),n=setTimeout(function(){L.apply(l,v)},t)}};Ne.debounce=mo;var vo=ut&&ut.__extends||(function(){var L=function(t,n){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,v){l.__proto__=v}||function(l,v){for(var a in v)Object.prototype.hasOwnProperty.call(v,a)&&(l[a]=v[a])},L(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");L(t,n);function l(){this.constructor=t}t.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}})(),An=ut&&ut.__assign||function(){return An=Object.assign||function(L){for(var t,n=1,l=arguments.length;n<l;n++){t=arguments[n];for(var v in t)Object.prototype.hasOwnProperty.call(t,v)&&(L[v]=t[v])}return L},An.apply(this,arguments)};Object.defineProperty(ut,"__esModule",{value:!0});var yo=Zt,ie=Tn,oi=qe,Vt=Fi,bt=Ne,ai=(0,bt.getAceInstance)(),bo=(function(L){vo(t,L);function t(n){var l=L.call(this,n)||this;return bt.editorEvents.forEach(function(v){l[v]=l[v].bind(l)}),l.debounce=bt.debounce,l}return t.prototype.isInShadow=function(n){for(var l=n&&n.parentNode;l;){if(l.toString()==="[object ShadowRoot]")return!0;l=l.parentNode}return!1},t.prototype.componentDidMount=function(){var n=this,l=this.props,v=l.className,a=l.onBeforeLoad,u=l.onValidate,d=l.mode,r=l.focus,c=l.theme,e=l.fontSize,i=l.lineHeight,o=l.value,h=l.defaultValue,s=l.showGutter,p=l.wrapEnabled,f=l.showPrintMargin,g=l.scrollMargin,y=g===void 0?[0,0,0,0]:g,A=l.keyboardHandler,E=l.onLoad,w=l.commands,m=l.annotations,S=l.markers,M=l.placeholder;this.editor=ai.edit(this.refEditor),a&&a(ai);for(var D=Object.keys(this.props.editorProps),_=0;_<D.length;_++)this.editor[D[_]]=this.props.editorProps[D[_]];this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),this.editor.renderer.setScrollMargin(y[0],y[1],y[2],y[3]),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.getSession().setMode(typeof d=="string"?"ace/mode/".concat(d):d),c&&c!==""&&this.editor.setTheme("ace/theme/".concat(c)),this.editor.setFontSize(typeof e=="number"?"".concat(e,"px"):e),i&&(this.editor.container.style.lineHeight=typeof i=="number"?"".concat(i,"px"):"".concat(i),this.editor.renderer.updateFontSize()),this.editor.getSession().setValue(h||o||""),this.props.navigateToFileEnd&&this.editor.navigateFileEnd(),this.editor.renderer.setShowGutter(s),this.editor.getSession().setUseWrapMode(p),this.editor.setShowPrintMargin(f),this.editor.on("focus",this.onFocus),this.editor.on("blur",this.onBlur),this.editor.on("copy",this.onCopy),this.editor.on("paste",this.onPaste),this.editor.on("change",this.onChange),this.editor.on("input",this.onInput),M&&this.updatePlaceholder(),this.editor.getSession().selection.on("changeSelection",this.onSelectionChange),this.editor.getSession().selection.on("changeCursor",this.onCursorChange),u&&this.editor.getSession().on("changeAnnotation",function(){var x=n.editor.getSession().getAnnotations();n.props.onValidate(x)}),this.editor.session.on("changeScrollTop",this.onScroll),this.editor.getSession().setAnnotations(m||[]),S&&S.length>0&&this.handleMarkers(S);var F=this.editor.$options;bt.editorOptions.forEach(function(x){F.hasOwnProperty(x)?n.editor.setOption(x,n.props[x]):n.props[x]&&console.warn("ReactAce: editor option ".concat(x," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))}),this.handleOptions(this.props),Array.isArray(w)&&w.forEach(function(x){typeof x.exec=="string"?n.editor.commands.bindKey(x.bindKey,x.exec):n.editor.commands.addCommand(x)}),A&&this.editor.setKeyboardHandler("ace/keyboard/"+A),v&&(this.refEditor.className+=" "+v),E&&E(this.editor),this.editor.resize(),r&&this.editor.focus()},t.prototype.componentDidUpdate=function(n){for(var l=n,v=this.props,a=0;a<bt.editorOptions.length;a++){var u=bt.editorOptions[a];v[u]!==l[u]&&this.editor.setOption(u,v[u])}if(v.className!==l.className){var d=this.refEditor.className,r=d.trim().split(" "),c=l.className.trim().split(" ");c.forEach(function(o){var h=r.indexOf(o);r.splice(h,1)}),this.refEditor.className=" "+v.className+" "+r.join(" ")}var e=this.editor&&v.value!=null&&this.editor.getValue()!==v.value;if(e){this.silent=!0;var i=this.editor.session.selection.toJSON();this.editor.setValue(v.value,v.cursorStart),this.editor.session.selection.fromJSON(i),this.silent=!1}v.placeholder!==l.placeholder&&this.updatePlaceholder(),v.mode!==l.mode&&this.editor.getSession().setMode(typeof v.mode=="string"?"ace/mode/".concat(v.mode):v.mode),v.theme!==l.theme&&this.editor.setTheme("ace/theme/"+v.theme),v.keyboardHandler!==l.keyboardHandler&&(v.keyboardHandler?this.editor.setKeyboardHandler("ace/keyboard/"+v.keyboardHandler):this.editor.setKeyboardHandler(null)),v.fontSize!==l.fontSize&&this.editor.setFontSize(typeof v.fontSize=="number"?"".concat(v.fontSize,"px"):v.fontSize),v.lineHeight!==l.lineHeight&&(this.editor.container.style.lineHeight=typeof v.lineHeight=="number"?"".concat(v.lineHeight,"px"):v.lineHeight,this.editor.renderer.updateFontSize()),v.wrapEnabled!==l.wrapEnabled&&this.editor.getSession().setUseWrapMode(v.wrapEnabled),v.showPrintMargin!==l.showPrintMargin&&this.editor.setShowPrintMargin(v.showPrintMargin),v.showGutter!==l.showGutter&&this.editor.renderer.setShowGutter(v.showGutter),Vt(v.setOptions,l.setOptions)||this.handleOptions(v),(e||!Vt(v.annotations,l.annotations))&&this.editor.getSession().setAnnotations(v.annotations||[]),!Vt(v.markers,l.markers)&&Array.isArray(v.markers)&&this.handleMarkers(v.markers),Vt(v.scrollMargin,l.scrollMargin)||this.handleScrollMargins(v.scrollMargin),(n.height!==this.props.height||n.width!==this.props.width)&&this.editor.resize(),this.props.focus&&!n.focus&&this.editor.focus()},t.prototype.handleScrollMargins=function(n){n===void 0&&(n=[0,0,0,0]),this.editor.renderer.setScrollMargin(n[0],n[1],n[2],n[3])},t.prototype.componentWillUnmount=function(){this.editor&&(this.editor.destroy(),this.editor=null)},t.prototype.onChange=function(n){if(this.editor&&this.props.onChange&&!this.silent){var l=this.editor.getValue();this.props.onChange(l,n)}},t.prototype.onSelectionChange=function(n){if(this.props.onSelectionChange){var l=this.editor.getSelection();this.props.onSelectionChange(l,n)}},t.prototype.onCursorChange=function(n){if(this.props.onCursorChange){var l=this.editor.getSelection();this.props.onCursorChange(l,n)}},t.prototype.onInput=function(n){this.props.onInput&&this.props.onInput(n),this.props.placeholder&&this.updatePlaceholder()},t.prototype.onFocus=function(n){this.props.onFocus&&this.props.onFocus(n,this.editor)},t.prototype.onBlur=function(n){this.props.onBlur&&this.props.onBlur(n,this.editor)},t.prototype.onCopy=function(n){var l=n.text;this.props.onCopy&&this.props.onCopy(l)},t.prototype.onPaste=function(n){var l=n.text;this.props.onPaste&&this.props.onPaste(l)},t.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},t.prototype.handleOptions=function(n){for(var l=Object.keys(n.setOptions),v=0;v<l.length;v++)this.editor.setOption(l[v],n.setOptions[l[v]])},t.prototype.handleMarkers=function(n){var l=this,v=this.editor.getSession().getMarkers(!0);for(var a in v)v.hasOwnProperty(a)&&this.editor.getSession().removeMarker(v[a].id);v=this.editor.getSession().getMarkers(!1);for(var a in v)v.hasOwnProperty(a)&&v[a].clazz!=="ace_active-line"&&v[a].clazz!=="ace_selected-word"&&this.editor.getSession().removeMarker(v[a].id);n.forEach(function(u){var d=u.startRow,r=u.startCol,c=u.endRow,e=u.endCol,i=u.className,o=u.type,h=u.inFront,s=h===void 0?!1:h,p=new yo.Range(d,r,c,e);l.editor.getSession().addMarker(p,i,o,s)})},t.prototype.updatePlaceholder=function(){var n=this.editor,l=this.props.placeholder,v=!n.session.getValue().length,a=n.renderer.placeholderNode;!v&&a?(n.renderer.scroller.removeChild(n.renderer.placeholderNode),n.renderer.placeholderNode=null):v&&!a?(a=n.renderer.placeholderNode=document.createElement("div"),a.textContent=l||"",a.className="ace_comment ace_placeholder",a.style.padding="0 9px",a.style.position="absolute",a.style.zIndex="3",n.renderer.scroller.appendChild(a)):v&&a&&(a.textContent=l)},t.prototype.updateRef=function(n){this.refEditor=n},t.prototype.render=function(){var n=this.props,l=n.name,v=n.width,a=n.height,u=n.style,d=An({width:v,height:a},u);return oi.createElement("div",{ref:this.updateRef,id:l,style:d})},t.propTypes={mode:ie.oneOfType([ie.string,ie.object]),focus:ie.bool,theme:ie.string,name:ie.string,className:ie.string,height:ie.string,width:ie.string,fontSize:ie.oneOfType([ie.number,ie.string]),lineHeight:ie.oneOfType([ie.number,ie.string]),showGutter:ie.bool,onChange:ie.func,onCopy:ie.func,onPaste:ie.func,onFocus:ie.func,onInput:ie.func,onBlur:ie.func,onScroll:ie.func,value:ie.string,defaultValue:ie.string,onLoad:ie.func,onSelectionChange:ie.func,onCursorChange:ie.func,onBeforeLoad:ie.func,onValidate:ie.func,minLines:ie.number,maxLines:ie.number,readOnly:ie.bool,highlightActiveLine:ie.bool,tabSize:ie.number,showPrintMargin:ie.bool,cursorStart:ie.number,debounceChangePeriod:ie.number,editorProps:ie.object,setOptions:ie.object,style:ie.object,scrollMargin:ie.array,annotations:ie.array,markers:ie.array,keyboardHandler:ie.string,wrapEnabled:ie.bool,enableSnippets:ie.bool,enableBasicAutocompletion:ie.oneOfType([ie.bool,ie.array]),enableLiveAutocompletion:ie.oneOfType([ie.bool,ie.array]),navigateToFileEnd:ie.bool,commands:ie.array,placeholder:ie.string},t.defaultProps={name:"ace-editor",focus:!1,mode:"",theme:"",height:"500px",width:"500px",fontSize:12,enableSnippets:!1,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,placeholder:null,navigateToFileEnd:!0},t})(oi.Component);ut.default=bo;var kt={},tt={},Oi={exports:{}};(function(L,t){ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(n,l,v){var a=n("./lib/oop");n("./lib/lang");var u=n("./lib/event_emitter").EventEmitter,d=n("./editor").Editor,r=n("./virtual_renderer").VirtualRenderer,c=n("./edit_session").EditSession,e;e=function(i,o,h){this.BELOW=1,this.BESIDE=0,this.$container=i,this.$theme=o,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(h||1),this.$cEditor=this.$editors[0],this.on("focus",function(s){this.$cEditor=s}.bind(this))},(function(){a.implement(this,u),this.$createEditor=function(){var i=document.createElement("div");i.className=this.$editorCSS,i.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(i);var o=new d(new r(i,this.$theme));return o.on("focus",function(){this._emit("focus",o)}.bind(this)),this.$editors.push(o),o.setFontSize(this.$fontSize),o},this.setSplits=function(i){var o;if(i<1)throw"The number of splits have to be > 0!";if(i!=this.$splits){if(i>this.$splits){for(;this.$splits<this.$editors.length&&this.$splits<i;)o=this.$editors[this.$splits],this.$container.appendChild(o.container),o.setFontSize(this.$fontSize),this.$splits++;for(;this.$splits<i;)this.$createEditor(),this.$splits++}else for(;this.$splits>i;)o=this.$editors[this.$splits-1],this.$container.removeChild(o.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(i){return this.$editors[i]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(i){this.$editors.forEach(function(o){o.setTheme(i)})},this.setKeyboardHandler=function(i){this.$editors.forEach(function(o){o.setKeyboardHandler(i)})},this.forEach=function(i,o){this.$editors.forEach(i,o)},this.$fontSize="",this.setFontSize=function(i){this.$fontSize=i,this.forEach(function(o){o.setFontSize(i)})},this.$cloneSession=function(i){var o=new c(i.getDocument(),i.getMode()),h=i.getUndoManager();return o.setUndoManager(h),o.setTabSize(i.getTabSize()),o.setUseSoftTabs(i.getUseSoftTabs()),o.setOverwrite(i.getOverwrite()),o.setBreakpoints(i.getBreakpoints()),o.setUseWrapMode(i.getUseWrapMode()),o.setUseWorker(i.getUseWorker()),o.setWrapLimitRange(i.$wrapLimitRange.min,i.$wrapLimitRange.max),o.$foldData=i.$cloneFoldData(),o},this.setSession=function(i,o){var h;o==null?h=this.$cEditor:h=this.$editors[o];var s=this.$editors.some(function(p){return p.session===i});return s&&(i=this.$cloneSession(i)),h.setSession(i),i},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(i){this.$orientation!=i&&(this.$orientation=i,this.resize())},this.resize=function(){var i=this.$container.clientWidth,o=this.$container.clientHeight,h;if(this.$orientation==this.BESIDE)for(var s=i/this.$splits,p=0;p<this.$splits;p++)h=this.$editors[p],h.container.style.width=s+"px",h.container.style.top="0px",h.container.style.left=p*s+"px",h.container.style.height=o+"px",h.resize();else for(var f=o/this.$splits,p=0;p<this.$splits;p++)h=this.$editors[p],h.container.style.width=i+"px",h.container.style.top=p*f+"px",h.container.style.left="0px",h.container.style.height=f+"px",h.resize()}}).call(e.prototype),l.Split=e}),ace.define("ace/ext/split",["require","exports","module","ace/ext/split","ace/split"],function(n,l,v){v.exports=n("../split")}),(function(){ace.require(["ace/ext/split"],function(n){L&&(L.exports=n)})})()})(Oi);var wo=Oi.exports,Co="Expected a function",Ri="__lodash_hash_undefined__",Eo="[object Function]",So="[object GeneratorFunction]",Do="[object Symbol]",xo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ao=/^\w*$/,$o=/^\./,To=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_o=/[\\^$.*+?()[\]{}|]/g,ko=/\\(\\)?/g,Mo=/^\[object .+?Constructor\]$/,Lo=typeof ke=="object"&&ke&&ke.Object===Object&&ke,Io=typeof self=="object"&&self&&self.Object===Object&&self,Mn=Lo||Io||Function("return this")();function Fo(L,t){return L==null?void 0:L[t]}function Oo(L){var t=!1;if(L!=null&&typeof L.toString!="function")try{t=!!(L+"")}catch{}return t}var Ro=Array.prototype,No=Function.prototype,Ni=Object.prototype,mn=Mn["__core-js_shared__"],li=(function(){var L=/[^.]+$/.exec(mn&&mn.keys&&mn.keys.IE_PROTO||"");return L?"Symbol(src)_1."+L:""})(),Bi=No.toString,Ln=Ni.hasOwnProperty,Pi=Ni.toString,Bo=RegExp("^"+Bi.call(Ln).replace(_o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hi=Mn.Symbol,Po=Ro.splice,Wo=Wi(Mn,"Map"),Mt=Wi(Object,"create"),ci=hi?hi.prototype:void 0,ui=ci?ci.toString:void 0;function pt(L){var t=-1,n=L?L.length:0;for(this.clear();++t<n;){var l=L[t];this.set(l[0],l[1])}}function zo(){this.__data__=Mt?Mt(null):{}}function Ho(L){return this.has(L)&&delete this.__data__[L]}function jo(L){var t=this.__data__;if(Mt){var n=t[L];return n===Ri?void 0:n}return Ln.call(t,L)?t[L]:void 0}function Vo(L){var t=this.__data__;return Mt?t[L]!==void 0:Ln.call(t,L)}function Uo(L,t){var n=this.__data__;return n[L]=Mt&&t===void 0?Ri:t,this}pt.prototype.clear=zo;pt.prototype.delete=Ho;pt.prototype.get=jo;pt.prototype.has=Vo;pt.prototype.set=Uo;function Ct(L){var t=-1,n=L?L.length:0;for(this.clear();++t<n;){var l=L[t];this.set(l[0],l[1])}}function Go(){this.__data__=[]}function Ko(L){var t=this.__data__,n=tn(t,L);if(n<0)return!1;var l=t.length-1;return n==l?t.pop():Po.call(t,n,1),!0}function Jo(L){var t=this.__data__,n=tn(t,L);return n<0?void 0:t[n][1]}function Yo(L){return tn(this.__data__,L)>-1}function Qo(L,t){var n=this.__data__,l=tn(n,L);return l<0?n.push([L,t]):n[l][1]=t,this}Ct.prototype.clear=Go;Ct.prototype.delete=Ko;Ct.prototype.get=Jo;Ct.prototype.has=Yo;Ct.prototype.set=Qo;function dt(L){var t=-1,n=L?L.length:0;for(this.clear();++t<n;){var l=L[t];this.set(l[0],l[1])}}function Xo(){this.__data__={hash:new pt,map:new(Wo||Ct),string:new pt}}function Zo(L){return nn(this,L).delete(L)}function qo(L){return nn(this,L).get(L)}function ea(L){return nn(this,L).has(L)}function ta(L,t){return nn(this,L).set(L,t),this}dt.prototype.clear=Xo;dt.prototype.delete=Zo;dt.prototype.get=qo;dt.prototype.has=ea;dt.prototype.set=ta;function tn(L,t){for(var n=L.length;n--;)if(pa(L[n][0],t))return n;return-1}function na(L,t){t=oa(t,L)?[t]:sa(t);for(var n=0,l=t.length;L!=null&&n<l;)L=L[ca(t[n++])];return n&&n==l?L:void 0}function ia(L){if(!Hi(L)||la(L))return!1;var t=da(L)||Oo(L)?Bo:Mo;return t.test(ua(L))}function ra(L){if(typeof L=="string")return L;if(Fn(L))return ui?ui.call(L):"";var t=L+"";return t=="0"&&1/L==-1/0?"-0":t}function sa(L){return zi(L)?L:ha(L)}function nn(L,t){var n=L.__data__;return aa(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Wi(L,t){var n=Fo(L,t);return ia(n)?n:void 0}function oa(L,t){if(zi(L))return!1;var n=typeof L;return n=="number"||n=="symbol"||n=="boolean"||L==null||Fn(L)?!0:Ao.test(L)||!xo.test(L)||t!=null&&L in Object(t)}function aa(L){var t=typeof L;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?L!=="__proto__":L===null}function la(L){return!!li&&li in L}var ha=In(function(L){L=ga(L);var t=[];return $o.test(L)&&t.push(""),L.replace(To,function(n,l,v,a){t.push(v?a.replace(ko,"$1"):l||n)}),t});function ca(L){if(typeof L=="string"||Fn(L))return L;var t=L+"";return t=="0"&&1/L==-1/0?"-0":t}function ua(L){if(L!=null){try{return Bi.call(L)}catch{}try{return L+""}catch{}}return""}function In(L,t){if(typeof L!="function"||t&&typeof t!="function")throw new TypeError(Co);var n=function(){var l=arguments,v=t?t.apply(this,l):l[0],a=n.cache;if(a.has(v))return a.get(v);var u=L.apply(this,l);return n.cache=a.set(v,u),u};return n.cache=new(In.Cache||dt),n}In.Cache=dt;function pa(L,t){return L===t||L!==L&&t!==t}var zi=Array.isArray;function da(L){var t=Hi(L)?Pi.call(L):"";return t==Eo||t==So}function Hi(L){var t=typeof L;return!!L&&(t=="object"||t=="function")}function fa(L){return!!L&&typeof L=="object"}function Fn(L){return typeof L=="symbol"||fa(L)&&Pi.call(L)==Do}function ga(L){return L==null?"":ra(L)}function ma(L,t,n){var l=L==null?void 0:na(L,t);return l===void 0?n:l}var va=ma,ya=tt&&tt.__extends||(function(){var L=function(t,n){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,v){l.__proto__=v}||function(l,v){for(var a in v)Object.prototype.hasOwnProperty.call(v,a)&&(l[a]=v[a])},L(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");L(t,n);function l(){this.constructor=t}t.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}})(),$n=tt&&tt.__assign||function(){return $n=Object.assign||function(L){for(var t,n=1,l=arguments.length;n<l;n++){t=arguments[n];for(var v in t)Object.prototype.hasOwnProperty.call(t,v)&&(L[v]=t[v])}return L},$n.apply(this,arguments)};Object.defineProperty(tt,"__esModule",{value:!0});var ct=Ne,vn=(0,ct.getAceInstance)(),ba=Zt,wa=wo,se=Tn,pi=qe,yn=Fi,je=va,Ca=(function(L){ya(t,L);function t(n){var l=L.call(this,n)||this;return ct.editorEvents.forEach(function(v){l[v]=l[v].bind(l)}),l.debounce=ct.debounce,l}return t.prototype.isInShadow=function(n){for(var l=n&&n.parentNode;l;){if(l.toString()==="[object ShadowRoot]")return!0;l=l.parentNode}return!1},t.prototype.componentDidMount=function(){var n=this,l=this.props,v=l.className,a=l.onBeforeLoad,u=l.mode,d=l.focus,r=l.theme,c=l.fontSize,e=l.value,i=l.defaultValue,o=l.cursorStart,h=l.showGutter,s=l.wrapEnabled,p=l.showPrintMargin,f=l.scrollMargin,g=f===void 0?[0,0,0,0]:f,y=l.keyboardHandler,A=l.onLoad,E=l.commands,w=l.annotations,m=l.markers,S=l.splits;this.editor=vn.edit(this.refEditor),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.setTheme("ace/theme/".concat(r)),a&&a(vn);var M=Object.keys(this.props.editorProps),D=new wa.Split(this.editor.container,"ace/theme/".concat(r),S);this.editor.env.split=D,this.splitEditor=D.getEditor(0),this.split=D,this.editor.setShowPrintMargin(!1),this.editor.renderer.setShowGutter(!1);var _=this.splitEditor.$options;this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),D.forEach(function(x,$){for(var C=0;C<M.length;C++)x[M[C]]=n.props.editorProps[M[C]];var b=je(i,$),T=je(e,$,"");x.session.setUndoManager(new vn.UndoManager),x.setTheme("ace/theme/".concat(r)),x.renderer.setScrollMargin(g[0],g[1],g[2],g[3]),x.getSession().setMode("ace/mode/".concat(u)),x.setFontSize(c),x.renderer.setShowGutter(h),x.getSession().setUseWrapMode(s),x.setShowPrintMargin(p),x.on("focus",n.onFocus),x.on("blur",n.onBlur),x.on("input",n.onInput),x.on("copy",n.onCopy),x.on("paste",n.onPaste),x.on("change",n.onChange),x.getSession().selection.on("changeSelection",n.onSelectionChange),x.getSession().selection.on("changeCursor",n.onCursorChange),x.session.on("changeScrollTop",n.onScroll),x.setValue(b===void 0?T:b,o);var I=je(w,$,[]),O=je(m,$,[]);x.getSession().setAnnotations(I),O&&O.length>0&&n.handleMarkers(O,x);for(var C=0;C<ct.editorOptions.length;C++){var N=ct.editorOptions[C];_.hasOwnProperty(N)?x.setOption(N,n.props[N]):n.props[N]&&console.warn("ReaceAce: editor option ".concat(N," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))}n.handleOptions(n.props,x),Array.isArray(E)&&E.forEach(function(P){typeof P.exec=="string"?x.commands.bindKey(P.bindKey,P.exec):x.commands.addCommand(P)}),y&&x.setKeyboardHandler("ace/keyboard/"+y)}),v&&(this.refEditor.className+=" "+v),d&&this.splitEditor.focus();var F=this.editor.env.split;F.setOrientation(this.props.orientation==="below"?F.BELOW:F.BESIDE),F.resize(!0),A&&A(F)},t.prototype.componentDidUpdate=function(n){var l=this,v=n,a=this.props,u=this.editor.env.split;if(a.splits!==v.splits&&u.setSplits(a.splits),a.orientation!==v.orientation&&u.setOrientation(a.orientation==="below"?u.BELOW:u.BESIDE),u.forEach(function(e,i){a.mode!==v.mode&&e.getSession().setMode("ace/mode/"+a.mode),a.keyboardHandler!==v.keyboardHandler&&(a.keyboardHandler?e.setKeyboardHandler("ace/keyboard/"+a.keyboardHandler):e.setKeyboardHandler(null)),a.fontSize!==v.fontSize&&e.setFontSize(a.fontSize),a.wrapEnabled!==v.wrapEnabled&&e.getSession().setUseWrapMode(a.wrapEnabled),a.showPrintMargin!==v.showPrintMargin&&e.setShowPrintMargin(a.showPrintMargin),a.showGutter!==v.showGutter&&e.renderer.setShowGutter(a.showGutter);for(var o=0;o<ct.editorOptions.length;o++){var h=ct.editorOptions[o];a[h]!==v[h]&&e.setOption(h,a[h])}yn(a.setOptions,v.setOptions)||l.handleOptions(a,e);var s=je(a.value,i,"");if(e.getValue()!==s){l.silent=!0;var p=e.session.selection.toJSON();e.setValue(s,a.cursorStart),e.session.selection.fromJSON(p),l.silent=!1}var f=je(a.annotations,i,[]),g=je(v.annotations,i,[]);yn(f,g)||e.getSession().setAnnotations(f);var y=je(a.markers,i,[]),A=je(v.markers,i,[]);!yn(y,A)&&Array.isArray(y)&&l.handleMarkers(y,e)}),a.className!==v.className){var d=this.refEditor.className,r=d.trim().split(" "),c=v.className.trim().split(" ");c.forEach(function(e){var i=r.indexOf(e);r.splice(i,1)}),this.refEditor.className=" "+a.className+" "+r.join(" ")}a.theme!==v.theme&&u.setTheme("ace/theme/"+a.theme),a.focus&&!v.focus&&this.splitEditor.focus(),(a.height!==this.props.height||a.width!==this.props.width)&&this.editor.resize()},t.prototype.componentWillUnmount=function(){this.editor.destroy(),this.editor=null},t.prototype.onChange=function(n){if(this.props.onChange&&!this.silent){var l=[];this.editor.env.split.forEach(function(v){l.push(v.getValue())}),this.props.onChange(l,n)}},t.prototype.onSelectionChange=function(n){if(this.props.onSelectionChange){var l=[];this.editor.env.split.forEach(function(v){l.push(v.getSelection())}),this.props.onSelectionChange(l,n)}},t.prototype.onCursorChange=function(n){if(this.props.onCursorChange){var l=[];this.editor.env.split.forEach(function(v){l.push(v.getSelection())}),this.props.onCursorChange(l,n)}},t.prototype.onFocus=function(n){this.props.onFocus&&this.props.onFocus(n)},t.prototype.onInput=function(n){this.props.onInput&&this.props.onInput(n)},t.prototype.onBlur=function(n){this.props.onBlur&&this.props.onBlur(n)},t.prototype.onCopy=function(n){this.props.onCopy&&this.props.onCopy(n)},t.prototype.onPaste=function(n){this.props.onPaste&&this.props.onPaste(n)},t.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},t.prototype.handleOptions=function(n,l){for(var v=Object.keys(n.setOptions),a=0;a<v.length;a++)l.setOption(v[a],n.setOptions[v[a]])},t.prototype.handleMarkers=function(n,l){var v=l.getSession().getMarkers(!0);for(var a in v)v.hasOwnProperty(a)&&l.getSession().removeMarker(v[a].id);v=l.getSession().getMarkers(!1);for(var a in v)v.hasOwnProperty(a)&&l.getSession().removeMarker(v[a].id);n.forEach(function(u){var d=u.startRow,r=u.startCol,c=u.endRow,e=u.endCol,i=u.className,o=u.type,h=u.inFront,s=h===void 0?!1:h,p=new ba.Range(d,r,c,e);l.getSession().addMarker(p,i,o,s)})},t.prototype.updateRef=function(n){this.refEditor=n},t.prototype.render=function(){var n=this.props,l=n.name,v=n.width,a=n.height,u=n.style,d=$n({width:v,height:a},u);return pi.createElement("div",{ref:this.updateRef,id:l,style:d})},t.propTypes={className:se.string,debounceChangePeriod:se.number,defaultValue:se.arrayOf(se.string),focus:se.bool,fontSize:se.oneOfType([se.number,se.string]),height:se.string,mode:se.string,name:se.string,onBlur:se.func,onChange:se.func,onCopy:se.func,onFocus:se.func,onInput:se.func,onLoad:se.func,onPaste:se.func,onScroll:se.func,orientation:se.string,showGutter:se.bool,splits:se.number,theme:se.string,value:se.arrayOf(se.string),width:se.string,onSelectionChange:se.func,onCursorChange:se.func,onBeforeLoad:se.func,minLines:se.number,maxLines:se.number,readOnly:se.bool,highlightActiveLine:se.bool,tabSize:se.number,showPrintMargin:se.bool,cursorStart:se.number,editorProps:se.object,setOptions:se.object,style:se.object,scrollMargin:se.array,annotations:se.array,markers:se.array,keyboardHandler:se.string,wrapEnabled:se.bool,enableBasicAutocompletion:se.oneOfType([se.bool,se.array]),enableLiveAutocompletion:se.oneOfType([se.bool,se.array]),commands:se.array},t.defaultProps={name:"ace-editor",focus:!1,orientation:"beside",splits:2,mode:"",theme:"",height:"500px",width:"500px",value:[],fontSize:12,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1},t})(pi.Component);tt.default=Ca;var ji={exports:{}};(function(L){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},n=-1,l=1,v=0;t.Diff=function(a,u){return[a,u]},t.prototype.diff_main=function(a,u,d,r){typeof r>"u"&&(this.Diff_Timeout<=0?r=Number.MAX_VALUE:r=new Date().getTime()+this.Diff_Timeout*1e3);var c=r;if(a==null||u==null)throw new Error("Null input. (diff_main)");if(a==u)return a?[new t.Diff(v,a)]:[];typeof d>"u"&&(d=!0);var e=d,i=this.diff_commonPrefix(a,u),o=a.substring(0,i);a=a.substring(i),u=u.substring(i),i=this.diff_commonSuffix(a,u);var h=a.substring(a.length-i);a=a.substring(0,a.length-i),u=u.substring(0,u.length-i);var s=this.diff_compute_(a,u,e,c);return o&&s.unshift(new t.Diff(v,o)),h&&s.push(new t.Diff(v,h)),this.diff_cleanupMerge(s),s},t.prototype.diff_compute_=function(a,u,d,r){var c;if(!a)return[new t.Diff(l,u)];if(!u)return[new t.Diff(n,a)];var e=a.length>u.length?a:u,i=a.length>u.length?u:a,o=e.indexOf(i);if(o!=-1)return c=[new t.Diff(l,e.substring(0,o)),new t.Diff(v,i),new t.Diff(l,e.substring(o+i.length))],a.length>u.length&&(c[0][0]=c[2][0]=n),c;if(i.length==1)return[new t.Diff(n,a),new t.Diff(l,u)];var h=this.diff_halfMatch_(a,u);if(h){var s=h[0],p=h[1],f=h[2],g=h[3],y=h[4],A=this.diff_main(s,f,d,r),E=this.diff_main(p,g,d,r);return A.concat([new t.Diff(v,y)],E)}return d&&a.length>100&&u.length>100?this.diff_lineMode_(a,u,r):this.diff_bisect_(a,u,r)},t.prototype.diff_lineMode_=function(a,u,d){var r=this.diff_linesToChars_(a,u);a=r.chars1,u=r.chars2;var c=r.lineArray,e=this.diff_main(a,u,!1,d);this.diff_charsToLines_(e,c),this.diff_cleanupSemantic(e),e.push(new t.Diff(v,""));for(var i=0,o=0,h=0,s="",p="";i<e.length;){switch(e[i][0]){case l:h++,p+=e[i][1];break;case n:o++,s+=e[i][1];break;case v:if(o>=1&&h>=1){e.splice(i-o-h,o+h),i=i-o-h;for(var f=this.diff_main(s,p,!1,d),g=f.length-1;g>=0;g--)e.splice(i,0,f[g]);i=i+f.length}h=0,o=0,s="",p="";break}i++}return e.pop(),e},t.prototype.diff_bisect_=function(a,u,d){for(var r=a.length,c=u.length,e=Math.ceil((r+c)/2),i=e,o=2*e,h=new Array(o),s=new Array(o),p=0;p<o;p++)h[p]=-1,s[p]=-1;h[i+1]=0,s[i+1]=0;for(var f=r-c,g=f%2!=0,y=0,A=0,E=0,w=0,m=0;m<e&&!(new Date().getTime()>d);m++){for(var S=-m+y;S<=m-A;S+=2){var M=i+S,D;S==-m||S!=m&&h[M-1]<h[M+1]?D=h[M+1]:D=h[M-1]+1;for(var _=D-S;D<r&&_<c&&a.charAt(D)==u.charAt(_);)D++,_++;if(h[M]=D,D>r)A+=2;else if(_>c)y+=2;else if(g){var F=i+f-S;if(F>=0&&F<o&&s[F]!=-1){var x=r-s[F];if(D>=x)return this.diff_bisectSplit_(a,u,D,_,d)}}}for(var $=-m+E;$<=m-w;$+=2){var F=i+$,x;$==-m||$!=m&&s[F-1]<s[F+1]?x=s[F+1]:x=s[F-1]+1;for(var C=x-$;x<r&&C<c&&a.charAt(r-x-1)==u.charAt(c-C-1);)x++,C++;if(s[F]=x,x>r)w+=2;else if(C>c)E+=2;else if(!g){var M=i+f-$;if(M>=0&&M<o&&h[M]!=-1){var D=h[M],_=i+D-M;if(x=r-x,D>=x)return this.diff_bisectSplit_(a,u,D,_,d)}}}}return[new t.Diff(n,a),new t.Diff(l,u)]},t.prototype.diff_bisectSplit_=function(a,u,d,r,c){var e=a.substring(0,d),i=u.substring(0,r),o=a.substring(d),h=u.substring(r),s=this.diff_main(e,i,!1,c),p=this.diff_main(o,h,!1,c);return s.concat(p)},t.prototype.diff_linesToChars_=function(a,u){var d=[],r={};d[0]="";function c(h){for(var s="",p=0,f=-1,g=d.length;f<h.length-1;){f=h.indexOf(`
994
+ `,p),f==-1&&(f=h.length-1);var y=h.substring(p,f+1);(r.hasOwnProperty?r.hasOwnProperty(y):r[y]!==void 0)?s+=String.fromCharCode(r[y]):(g==e&&(y=h.substring(p),f=h.length),s+=String.fromCharCode(g),r[y]=g,d[g++]=y),p=f+1}return s}var e=4e4,i=c(a);e=65535;var o=c(u);return{chars1:i,chars2:o,lineArray:d}},t.prototype.diff_charsToLines_=function(a,u){for(var d=0;d<a.length;d++){for(var r=a[d][1],c=[],e=0;e<r.length;e++)c[e]=u[r.charCodeAt(e)];a[d][1]=c.join("")}},t.prototype.diff_commonPrefix=function(a,u){if(!a||!u||a.charAt(0)!=u.charAt(0))return 0;for(var d=0,r=Math.min(a.length,u.length),c=r,e=0;d<c;)a.substring(e,c)==u.substring(e,c)?(d=c,e=d):r=c,c=Math.floor((r-d)/2+d);return c},t.prototype.diff_commonSuffix=function(a,u){if(!a||!u||a.charAt(a.length-1)!=u.charAt(u.length-1))return 0;for(var d=0,r=Math.min(a.length,u.length),c=r,e=0;d<c;)a.substring(a.length-c,a.length-e)==u.substring(u.length-c,u.length-e)?(d=c,e=d):r=c,c=Math.floor((r-d)/2+d);return c},t.prototype.diff_commonOverlap_=function(a,u){var d=a.length,r=u.length;if(d==0||r==0)return 0;d>r?a=a.substring(d-r):d<r&&(u=u.substring(0,d));var c=Math.min(d,r);if(a==u)return c;for(var e=0,i=1;;){var o=a.substring(c-i),h=u.indexOf(o);if(h==-1)return e;i+=h,(h==0||a.substring(c-i)==u.substring(0,i))&&(e=i,i++)}},t.prototype.diff_halfMatch_=function(a,u){if(this.Diff_Timeout<=0)return null;var d=a.length>u.length?a:u,r=a.length>u.length?u:a;if(d.length<4||r.length*2<d.length)return null;var c=this;function e(A,E,w){for(var m=A.substring(w,w+Math.floor(A.length/4)),S=-1,M="",D,_,F,x;(S=E.indexOf(m,S+1))!=-1;){var $=c.diff_commonPrefix(A.substring(w),E.substring(S)),C=c.diff_commonSuffix(A.substring(0,w),E.substring(0,S));M.length<C+$&&(M=E.substring(S-C,S)+E.substring(S,S+$),D=A.substring(0,w-C),_=A.substring(w+$),F=E.substring(0,S-C),x=E.substring(S+$))}return M.length*2>=A.length?[D,_,F,x,M]:null}var i=e(d,r,Math.ceil(d.length/4)),o=e(d,r,Math.ceil(d.length/2)),h;if(!i&&!o)return null;o?i?h=i[4].length>o[4].length?i:o:h=o:h=i;var s,p,f,g;a.length>u.length?(s=h[0],p=h[1],f=h[2],g=h[3]):(f=h[0],g=h[1],s=h[2],p=h[3]);var y=h[4];return[s,p,f,g,y]},t.prototype.diff_cleanupSemantic=function(a){for(var u=!1,d=[],r=0,c=null,e=0,i=0,o=0,h=0,s=0;e<a.length;)a[e][0]==v?(d[r++]=e,i=h,o=s,h=0,s=0,c=a[e][1]):(a[e][0]==l?h+=a[e][1].length:s+=a[e][1].length,c&&c.length<=Math.max(i,o)&&c.length<=Math.max(h,s)&&(a.splice(d[r-1],0,new t.Diff(n,c)),a[d[r-1]+1][0]=l,r--,r--,e=r>0?d[r-1]:-1,i=0,o=0,h=0,s=0,c=null,u=!0)),e++;for(u&&this.diff_cleanupMerge(a),this.diff_cleanupSemanticLossless(a),e=1;e<a.length;){if(a[e-1][0]==n&&a[e][0]==l){var p=a[e-1][1],f=a[e][1],g=this.diff_commonOverlap_(p,f),y=this.diff_commonOverlap_(f,p);g>=y?(g>=p.length/2||g>=f.length/2)&&(a.splice(e,0,new t.Diff(v,f.substring(0,g))),a[e-1][1]=p.substring(0,p.length-g),a[e+1][1]=f.substring(g),e++):(y>=p.length/2||y>=f.length/2)&&(a.splice(e,0,new t.Diff(v,p.substring(0,y))),a[e-1][0]=l,a[e-1][1]=f.substring(0,f.length-y),a[e+1][0]=n,a[e+1][1]=p.substring(y),e++),e++}e++}},t.prototype.diff_cleanupSemanticLossless=function(a){function u(y,A){if(!y||!A)return 6;var E=y.charAt(y.length-1),w=A.charAt(0),m=E.match(t.nonAlphaNumericRegex_),S=w.match(t.nonAlphaNumericRegex_),M=m&&E.match(t.whitespaceRegex_),D=S&&w.match(t.whitespaceRegex_),_=M&&E.match(t.linebreakRegex_),F=D&&w.match(t.linebreakRegex_),x=_&&y.match(t.blanklineEndRegex_),$=F&&A.match(t.blanklineStartRegex_);return x||$?5:_||F?4:m&&!M&&D?3:M||D?2:m||S?1:0}for(var d=1;d<a.length-1;){if(a[d-1][0]==v&&a[d+1][0]==v){var r=a[d-1][1],c=a[d][1],e=a[d+1][1],i=this.diff_commonSuffix(r,c);if(i){var o=c.substring(c.length-i);r=r.substring(0,r.length-i),c=o+c.substring(0,c.length-i),e=o+e}for(var h=r,s=c,p=e,f=u(r,c)+u(c,e);c.charAt(0)===e.charAt(0);){r+=c.charAt(0),c=c.substring(1)+e.charAt(0),e=e.substring(1);var g=u(r,c)+u(c,e);g>=f&&(f=g,h=r,s=c,p=e)}a[d-1][1]!=h&&(h?a[d-1][1]=h:(a.splice(d-1,1),d--),a[d][1]=s,p?a[d+1][1]=p:(a.splice(d+1,1),d--))}d++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(a){for(var u=!1,d=[],r=0,c=null,e=0,i=!1,o=!1,h=!1,s=!1;e<a.length;)a[e][0]==v?(a[e][1].length<this.Diff_EditCost&&(h||s)?(d[r++]=e,i=h,o=s,c=a[e][1]):(r=0,c=null),h=s=!1):(a[e][0]==n?s=!0:h=!0,c&&(i&&o&&h&&s||c.length<this.Diff_EditCost/2&&i+o+h+s==3)&&(a.splice(d[r-1],0,new t.Diff(n,c)),a[d[r-1]+1][0]=l,r--,c=null,i&&o?(h=s=!0,r=0):(r--,e=r>0?d[r-1]:-1,h=s=!1),u=!0)),e++;u&&this.diff_cleanupMerge(a)},t.prototype.diff_cleanupMerge=function(a){a.push(new t.Diff(v,""));for(var u=0,d=0,r=0,c="",e="",i;u<a.length;)switch(a[u][0]){case l:r++,e+=a[u][1],u++;break;case n:d++,c+=a[u][1],u++;break;case v:d+r>1?(d!==0&&r!==0&&(i=this.diff_commonPrefix(e,c),i!==0&&(u-d-r>0&&a[u-d-r-1][0]==v?a[u-d-r-1][1]+=e.substring(0,i):(a.splice(0,0,new t.Diff(v,e.substring(0,i))),u++),e=e.substring(i),c=c.substring(i)),i=this.diff_commonSuffix(e,c),i!==0&&(a[u][1]=e.substring(e.length-i)+a[u][1],e=e.substring(0,e.length-i),c=c.substring(0,c.length-i))),u-=d+r,a.splice(u,d+r),c.length&&(a.splice(u,0,new t.Diff(n,c)),u++),e.length&&(a.splice(u,0,new t.Diff(l,e)),u++),u++):u!==0&&a[u-1][0]==v?(a[u-1][1]+=a[u][1],a.splice(u,1)):u++,r=0,d=0,c="",e="";break}a[a.length-1][1]===""&&a.pop();var o=!1;for(u=1;u<a.length-1;)a[u-1][0]==v&&a[u+1][0]==v&&(a[u][1].substring(a[u][1].length-a[u-1][1].length)==a[u-1][1]?(a[u][1]=a[u-1][1]+a[u][1].substring(0,a[u][1].length-a[u-1][1].length),a[u+1][1]=a[u-1][1]+a[u+1][1],a.splice(u-1,1),o=!0):a[u][1].substring(0,a[u+1][1].length)==a[u+1][1]&&(a[u-1][1]+=a[u+1][1],a[u][1]=a[u][1].substring(a[u+1][1].length)+a[u+1][1],a.splice(u+1,1),o=!0)),u++;o&&this.diff_cleanupMerge(a)},t.prototype.diff_xIndex=function(a,u){var d=0,r=0,c=0,e=0,i;for(i=0;i<a.length&&(a[i][0]!==l&&(d+=a[i][1].length),a[i][0]!==n&&(r+=a[i][1].length),!(d>u));i++)c=d,e=r;return a.length!=i&&a[i][0]===n?e:e+(u-c)},t.prototype.diff_prettyHtml=function(a){for(var u=[],d=/&/g,r=/</g,c=/>/g,e=/\n/g,i=0;i<a.length;i++){var o=a[i][0],h=a[i][1],s=h.replace(d,"&amp;").replace(r,"&lt;").replace(c,"&gt;").replace(e,"&para;<br>");switch(o){case l:u[i]='<ins style="background:#e6ffe6;">'+s+"</ins>";break;case n:u[i]='<del style="background:#ffe6e6;">'+s+"</del>";break;case v:u[i]="<span>"+s+"</span>";break}}return u.join("")},t.prototype.diff_text1=function(a){for(var u=[],d=0;d<a.length;d++)a[d][0]!==l&&(u[d]=a[d][1]);return u.join("")},t.prototype.diff_text2=function(a){for(var u=[],d=0;d<a.length;d++)a[d][0]!==n&&(u[d]=a[d][1]);return u.join("")},t.prototype.diff_levenshtein=function(a){for(var u=0,d=0,r=0,c=0;c<a.length;c++){var e=a[c][0],i=a[c][1];switch(e){case l:d+=i.length;break;case n:r+=i.length;break;case v:u+=Math.max(d,r),d=0,r=0;break}}return u+=Math.max(d,r),u},t.prototype.diff_toDelta=function(a){for(var u=[],d=0;d<a.length;d++)switch(a[d][0]){case l:u[d]="+"+encodeURI(a[d][1]);break;case n:u[d]="-"+a[d][1].length;break;case v:u[d]="="+a[d][1].length;break}return u.join(" ").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(a,u){for(var d=[],r=0,c=0,e=u.split(/\t/g),i=0;i<e.length;i++){var o=e[i].substring(1);switch(e[i].charAt(0)){case"+":try{d[r++]=new t.Diff(l,decodeURI(o))}catch{throw new Error("Illegal escape in diff_fromDelta: "+o)}break;case"-":case"=":var h=parseInt(o,10);if(isNaN(h)||h<0)throw new Error("Invalid number in diff_fromDelta: "+o);var s=a.substring(c,c+=h);e[i].charAt(0)=="="?d[r++]=new t.Diff(v,s):d[r++]=new t.Diff(n,s);break;default:if(e[i])throw new Error("Invalid diff operation in diff_fromDelta: "+e[i])}}if(c!=a.length)throw new Error("Delta length ("+c+") does not equal source text length ("+a.length+").");return d},t.prototype.match_main=function(a,u,d){if(a==null||u==null||d==null)throw new Error("Null input. (match_main)");return d=Math.max(0,Math.min(d,a.length)),a==u?0:a.length?a.substring(d,d+u.length)==u?d:this.match_bitap_(a,u,d):-1},t.prototype.match_bitap_=function(a,u,d){if(u.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var r=this.match_alphabet_(u),c=this;function e(D,_){var F=D/u.length,x=Math.abs(d-_);return c.Match_Distance?F+x/c.Match_Distance:x?1:F}var i=this.Match_Threshold,o=a.indexOf(u,d);o!=-1&&(i=Math.min(e(0,o),i),o=a.lastIndexOf(u,d+u.length),o!=-1&&(i=Math.min(e(0,o),i)));var h=1<<u.length-1;o=-1;for(var s,p,f=u.length+a.length,g,y=0;y<u.length;y++){for(s=0,p=f;s<p;)e(y,d+p)<=i?s=p:f=p,p=Math.floor((f-s)/2+s);f=p;var A=Math.max(1,d-p+1),E=Math.min(d+p,a.length)+u.length,w=Array(E+2);w[E+1]=(1<<y)-1;for(var m=E;m>=A;m--){var S=r[a.charAt(m-1)];if(y===0?w[m]=(w[m+1]<<1|1)&S:w[m]=(w[m+1]<<1|1)&S|((g[m+1]|g[m])<<1|1)|g[m+1],w[m]&h){var M=e(y,m-1);if(M<=i)if(i=M,o=m-1,o>d)A=Math.max(1,2*d-o);else break}}if(e(y+1,d)>i)break;g=w}return o},t.prototype.match_alphabet_=function(a){for(var u={},d=0;d<a.length;d++)u[a.charAt(d)]=0;for(var d=0;d<a.length;d++)u[a.charAt(d)]|=1<<a.length-d-1;return u},t.prototype.patch_addContext_=function(a,u){if(u.length!=0){if(a.start2===null)throw Error("patch not initialized");for(var d=u.substring(a.start2,a.start2+a.length1),r=0;u.indexOf(d)!=u.lastIndexOf(d)&&d.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)r+=this.Patch_Margin,d=u.substring(a.start2-r,a.start2+a.length1+r);r+=this.Patch_Margin;var c=u.substring(a.start2-r,a.start2);c&&a.diffs.unshift(new t.Diff(v,c));var e=u.substring(a.start2+a.length1,a.start2+a.length1+r);e&&a.diffs.push(new t.Diff(v,e)),a.start1-=c.length,a.start2-=c.length,a.length1+=c.length+e.length,a.length2+=c.length+e.length}},t.prototype.patch_make=function(a,u,d){var r,c;if(typeof a=="string"&&typeof u=="string"&&typeof d>"u")r=a,c=this.diff_main(r,u,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(a&&typeof a=="object"&&typeof u>"u"&&typeof d>"u")c=a,r=this.diff_text1(c);else if(typeof a=="string"&&u&&typeof u=="object"&&typeof d>"u")r=a,c=u;else if(typeof a=="string"&&typeof u=="string"&&d&&typeof d=="object")r=a,c=d;else throw new Error("Unknown call format to patch_make.");if(c.length===0)return[];for(var e=[],i=new t.patch_obj,o=0,h=0,s=0,p=r,f=r,g=0;g<c.length;g++){var y=c[g][0],A=c[g][1];switch(!o&&y!==v&&(i.start1=h,i.start2=s),y){case l:i.diffs[o++]=c[g],i.length2+=A.length,f=f.substring(0,s)+A+f.substring(s);break;case n:i.length1+=A.length,i.diffs[o++]=c[g],f=f.substring(0,s)+f.substring(s+A.length);break;case v:A.length<=2*this.Patch_Margin&&o&&c.length!=g+1?(i.diffs[o++]=c[g],i.length1+=A.length,i.length2+=A.length):A.length>=2*this.Patch_Margin&&o&&(this.patch_addContext_(i,p),e.push(i),i=new t.patch_obj,o=0,p=f,h=s);break}y!==l&&(h+=A.length),y!==n&&(s+=A.length)}return o&&(this.patch_addContext_(i,p),e.push(i)),e},t.prototype.patch_deepCopy=function(a){for(var u=[],d=0;d<a.length;d++){var r=a[d],c=new t.patch_obj;c.diffs=[];for(var e=0;e<r.diffs.length;e++)c.diffs[e]=new t.Diff(r.diffs[e][0],r.diffs[e][1]);c.start1=r.start1,c.start2=r.start2,c.length1=r.length1,c.length2=r.length2,u[d]=c}return u},t.prototype.patch_apply=function(a,u){if(a.length==0)return[u,[]];a=this.patch_deepCopy(a);var d=this.patch_addPadding(a);u=d+u+d,this.patch_splitMax(a);for(var r=0,c=[],e=0;e<a.length;e++){var i=a[e].start2+r,o=this.diff_text1(a[e].diffs),h,s=-1;if(o.length>this.Match_MaxBits?(h=this.match_main(u,o.substring(0,this.Match_MaxBits),i),h!=-1&&(s=this.match_main(u,o.substring(o.length-this.Match_MaxBits),i+o.length-this.Match_MaxBits),(s==-1||h>=s)&&(h=-1))):h=this.match_main(u,o,i),h==-1)c[e]=!1,r-=a[e].length2-a[e].length1;else{c[e]=!0,r=h-i;var p;if(s==-1?p=u.substring(h,h+o.length):p=u.substring(h,s+this.Match_MaxBits),o==p)u=u.substring(0,h)+this.diff_text2(a[e].diffs)+u.substring(h+o.length);else{var f=this.diff_main(o,p,!1);if(o.length>this.Match_MaxBits&&this.diff_levenshtein(f)/o.length>this.Patch_DeleteThreshold)c[e]=!1;else{this.diff_cleanupSemanticLossless(f);for(var g=0,y,A=0;A<a[e].diffs.length;A++){var E=a[e].diffs[A];E[0]!==v&&(y=this.diff_xIndex(f,g)),E[0]===l?u=u.substring(0,h+y)+E[1]+u.substring(h+y):E[0]===n&&(u=u.substring(0,h+y)+u.substring(h+this.diff_xIndex(f,g+E[1].length))),E[0]!==n&&(g+=E[1].length)}}}}}return u=u.substring(d.length,u.length-d.length),[u,c]},t.prototype.patch_addPadding=function(a){for(var u=this.Patch_Margin,d="",r=1;r<=u;r++)d+=String.fromCharCode(r);for(var r=0;r<a.length;r++)a[r].start1+=u,a[r].start2+=u;var c=a[0],e=c.diffs;if(e.length==0||e[0][0]!=v)e.unshift(new t.Diff(v,d)),c.start1-=u,c.start2-=u,c.length1+=u,c.length2+=u;else if(u>e[0][1].length){var i=u-e[0][1].length;e[0][1]=d.substring(e[0][1].length)+e[0][1],c.start1-=i,c.start2-=i,c.length1+=i,c.length2+=i}if(c=a[a.length-1],e=c.diffs,e.length==0||e[e.length-1][0]!=v)e.push(new t.Diff(v,d)),c.length1+=u,c.length2+=u;else if(u>e[e.length-1][1].length){var i=u-e[e.length-1][1].length;e[e.length-1][1]+=d.substring(0,i),c.length1+=i,c.length2+=i}return d},t.prototype.patch_splitMax=function(a){for(var u=this.Match_MaxBits,d=0;d<a.length;d++)if(!(a[d].length1<=u)){var r=a[d];a.splice(d--,1);for(var c=r.start1,e=r.start2,i="";r.diffs.length!==0;){var o=new t.patch_obj,h=!0;for(o.start1=c-i.length,o.start2=e-i.length,i!==""&&(o.length1=o.length2=i.length,o.diffs.push(new t.Diff(v,i)));r.diffs.length!==0&&o.length1<u-this.Patch_Margin;){var s=r.diffs[0][0],p=r.diffs[0][1];s===l?(o.length2+=p.length,e+=p.length,o.diffs.push(r.diffs.shift()),h=!1):s===n&&o.diffs.length==1&&o.diffs[0][0]==v&&p.length>2*u?(o.length1+=p.length,c+=p.length,h=!1,o.diffs.push(new t.Diff(s,p)),r.diffs.shift()):(p=p.substring(0,u-o.length1-this.Patch_Margin),o.length1+=p.length,c+=p.length,s===v?(o.length2+=p.length,e+=p.length):h=!1,o.diffs.push(new t.Diff(s,p)),p==r.diffs[0][1]?r.diffs.shift():r.diffs[0][1]=r.diffs[0][1].substring(p.length))}i=this.diff_text2(o.diffs),i=i.substring(i.length-this.Patch_Margin);var f=this.diff_text1(r.diffs).substring(0,this.Patch_Margin);f!==""&&(o.length1+=f.length,o.length2+=f.length,o.diffs.length!==0&&o.diffs[o.diffs.length-1][0]===v?o.diffs[o.diffs.length-1][1]+=f:o.diffs.push(new t.Diff(v,f))),h||a.splice(++d,0,o)}}},t.prototype.patch_toText=function(a){for(var u=[],d=0;d<a.length;d++)u[d]=a[d];return u.join("")},t.prototype.patch_fromText=function(a){var u=[];if(!a)return u;for(var d=a.split(`
995
+ `),r=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;r<d.length;){var e=d[r].match(c);if(!e)throw new Error("Invalid patch string: "+d[r]);var i=new t.patch_obj;for(u.push(i),i.start1=parseInt(e[1],10),e[2]===""?(i.start1--,i.length1=1):e[2]=="0"?i.length1=0:(i.start1--,i.length1=parseInt(e[2],10)),i.start2=parseInt(e[3],10),e[4]===""?(i.start2--,i.length2=1):e[4]=="0"?i.length2=0:(i.start2--,i.length2=parseInt(e[4],10)),r++;r<d.length;){var o=d[r].charAt(0);try{var h=decodeURI(d[r].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+h)}if(o=="-")i.diffs.push(new t.Diff(n,h));else if(o=="+")i.diffs.push(new t.Diff(l,h));else if(o==" ")i.diffs.push(new t.Diff(v,h));else{if(o=="@")break;if(o!=="")throw new Error('Invalid patch mode "'+o+'" in: '+h)}r++}}return u},t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},t.patch_obj.prototype.toString=function(){var a,u;this.length1===0?a=this.start1+",0":this.length1==1?a=this.start1+1:a=this.start1+1+","+this.length1,this.length2===0?u=this.start2+",0":this.length2==1?u=this.start2+1:u=this.start2+1+","+this.length2;for(var d=["@@ -"+a+" +"+u+` @@
996
+ `],r,c=0;c<this.diffs.length;c++){switch(this.diffs[c][0]){case l:r="+";break;case n:r="-";break;case v:r=" ";break}d[c+1]=r+encodeURI(this.diffs[c][1])+`
997
+ `}return d.join("").replace(/%20/g," ")},L.exports=t,L.exports.diff_match_patch=t,L.exports.DIFF_DELETE=n,L.exports.DIFF_INSERT=l,L.exports.DIFF_EQUAL=v})(ji);var Ea=ji.exports,Sa=kt&&kt.__extends||(function(){var L=function(t,n){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,v){l.__proto__=v}||function(l,v){for(var a in v)Object.prototype.hasOwnProperty.call(v,a)&&(l[a]=v[a])},L(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");L(t,n);function l(){this.constructor=t}t.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}})();Object.defineProperty(kt,"__esModule",{value:!0});var pe=Tn,di=qe,Da=tt,xa=Ea,Aa=(function(L){Sa(t,L);function t(n){var l=L.call(this,n)||this;return l.state={value:l.props.value},l.onChange=l.onChange.bind(l),l.diff=l.diff.bind(l),l}return t.prototype.componentDidUpdate=function(){var n=this.props.value;n!==this.state.value&&this.setState({value:n})},t.prototype.onChange=function(n){this.setState({value:n}),this.props.onChange&&this.props.onChange(n)},t.prototype.diff=function(){var n=new xa,l=this.state.value[0],v=this.state.value[1];if(l.length===0&&v.length===0)return[];var a=n.diff_main(l,v);n.diff_cleanupSemantic(a);var u=this.generateDiffedLines(a),d=this.setCodeMarkers(u);return d},t.prototype.generateDiffedLines=function(n){var l={DIFF_EQUAL:0,DIFF_DELETE:-1,DIFF_INSERT:1},v={left:[],right:[]},a={left:1,right:1};return n.forEach(function(u){var d=u[0],r=u[1],c=r.split(`
998
+ `).length-1;if(r.length!==0){var e=r[0],i=r[r.length-1],o=0;switch(d){case l.DIFF_EQUAL:a.left+=c,a.right+=c;break;case l.DIFF_DELETE:e===`
999
+ `&&(a.left++,c--),o=c,o===0&&v.right.push({startLine:a.right,endLine:a.right}),i===`
1000
+ `&&(o-=1),v.left.push({startLine:a.left,endLine:a.left+o}),a.left+=c;break;case l.DIFF_INSERT:e===`
1001
+ `&&(a.right++,c--),o=c,o===0&&v.left.push({startLine:a.left,endLine:a.left}),i===`
1002
+ `&&(o-=1),v.right.push({startLine:a.right,endLine:a.right+o}),a.right+=c;break;default:throw new Error("Diff type was not defined.")}}}),v},t.prototype.setCodeMarkers=function(n){n===void 0&&(n={left:[],right:[]});for(var l=[],v={left:[],right:[]},a=0;a<n.left.length;a++){var u={startRow:n.left[a].startLine-1,endRow:n.left[a].endLine,type:"text",className:"codeMarker"};v.left.push(u)}for(var a=0;a<n.right.length;a++){var u={startRow:n.right[a].startLine-1,endRow:n.right[a].endLine,type:"text",className:"codeMarker"};v.right.push(u)}return l[0]=v.left,l[1]=v.right,l},t.prototype.render=function(){var n=this.diff();return di.createElement(Da.default,{name:this.props.name,className:this.props.className,focus:this.props.focus,orientation:this.props.orientation,splits:this.props.splits,mode:this.props.mode,theme:this.props.theme,height:this.props.height,width:this.props.width,fontSize:this.props.fontSize,showGutter:this.props.showGutter,onChange:this.onChange,onPaste:this.props.onPaste,onLoad:this.props.onLoad,onScroll:this.props.onScroll,minLines:this.props.minLines,maxLines:this.props.maxLines,readOnly:this.props.readOnly,highlightActiveLine:this.props.highlightActiveLine,showPrintMargin:this.props.showPrintMargin,tabSize:this.props.tabSize,cursorStart:this.props.cursorStart,editorProps:this.props.editorProps,style:this.props.style,scrollMargin:this.props.scrollMargin,setOptions:this.props.setOptions,wrapEnabled:this.props.wrapEnabled,enableBasicAutocompletion:this.props.enableBasicAutocompletion,enableLiveAutocompletion:this.props.enableLiveAutocompletion,value:this.state.value,markers:n})},t.propTypes={cursorStart:pe.number,editorProps:pe.object,enableBasicAutocompletion:pe.bool,enableLiveAutocompletion:pe.bool,focus:pe.bool,fontSize:pe.number,height:pe.string,highlightActiveLine:pe.bool,maxLines:pe.number,minLines:pe.number,mode:pe.string,name:pe.string,className:pe.string,onLoad:pe.func,onPaste:pe.func,onScroll:pe.func,onChange:pe.func,orientation:pe.string,readOnly:pe.bool,scrollMargin:pe.array,setOptions:pe.object,showGutter:pe.bool,showPrintMargin:pe.bool,splits:pe.number,style:pe.object,tabSize:pe.number,theme:pe.string,value:pe.array,width:pe.string,wrapEnabled:pe.bool},t.defaultProps={cursorStart:1,editorProps:{},enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,focus:!1,fontSize:12,height:"500px",highlightActiveLine:!0,maxLines:null,minLines:null,mode:"",name:"ace-editor",onLoad:null,onScroll:null,onPaste:null,onChange:null,orientation:"beside",readOnly:!1,scrollMargin:[0,0,0,0],setOptions:{},showGutter:!0,showPrintMargin:!0,splits:2,style:{},tabSize:4,theme:"github",value:["",""],width:"500px",wrapEnabled:!0},t})(di.Component);kt.default=Aa;Object.defineProperty(wt,"__esModule",{value:!0});wt.diff=wt.split=void 0;var $a=ut,Ta=kt;wt.diff=Ta.default;var _a=tt;wt.split=_a.default;var ka=wt.default=$a.default,Ma={exports:{}};(function(L,t){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(n,l,v){var a=n("../lib/oop"),u=n("./text_highlight_rules").TextHighlightRules,d=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};a.inherits(d,u),l.JsonHighlightRules=d}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(n,l,v){var a=n("../range").Range,u=function(){};(function(){this.checkOutdent=function(d,r){return/^\s+$/.test(d)?/^\s*\}/.test(r):!1},this.autoOutdent=function(d,r){var c=d.getLine(r),e=c.match(/^(\s*\})/);if(!e)return 0;var i=e[1].length,o=d.findMatchingBracket({row:r,column:i});if(!o||o.row==r)return 0;var h=this.$getIndent(d.getLine(o.row));d.replace(new a(r,0,r,i-1),h)},this.$getIndent=function(d){return d.match(/^\s*/)[0]}}).call(u.prototype),l.MatchingBraceOutdent=u}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(n,l,v){var a=n("../../lib/oop"),u=n("../../range").Range,d=n("./fold_mode").FoldMode,r=l.FoldMode=function(c){c&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+c.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+c.end)))};a.inherits(r,d),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(c,e,i){var o=c.getLine(i);if(this.singleLineBlockCommentRe.test(o)&&!this.startRegionRe.test(o)&&!this.tripleStarBlockCommentRe.test(o))return"";var h=this._getFoldWidgetBase(c,e,i);return!h&&this.startRegionRe.test(o)?"start":h},this.getFoldWidgetRange=function(c,e,i,o){var h=c.getLine(i);if(this.startRegionRe.test(h))return this.getCommentRegionBlock(c,h,i);var f=h.match(this.foldingStartMarker);if(f){var s=f.index;if(f[1])return this.openingBracketBlock(c,f[1],i,s);var p=c.getCommentFoldRange(i,s+f[0].length,1);return p&&!p.isMultiLine()&&(o?p=this.getSectionRange(c,i):e!="all"&&(p=null)),p}if(e!=="markbegin"){var f=h.match(this.foldingStopMarker);if(f){var s=f.index+f[0].length;return f[1]?this.closingBracketBlock(c,f[1],i,s):c.getCommentFoldRange(i,s,-1)}}},this.getSectionRange=function(c,e){var i=c.getLine(e),o=i.search(/\S/),h=e,s=i.length;e+=1;for(var p=e,f=c.getLength();++e<f;){i=c.getLine(e);var g=i.search(/\S/);if(g!==-1){if(o>g)break;var y=this.getFoldWidgetRange(c,"all",e);if(y){if(y.start.row<=h)break;if(y.isMultiLine())e=y.end.row;else if(o==g)break}p=e}}return new u(h,s,p,c.getLine(p).length)},this.getCommentRegionBlock=function(c,e,i){for(var o=e.search(/\s*$/),h=c.getLength(),s=i,p=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,f=1;++i<h;){e=c.getLine(i);var g=p.exec(e);if(g&&(g[1]?f--:f++,!f))break}var y=i;if(y>s)return new u(s,o,y,e.length)}}.call(r.prototype)}),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle","ace/worker/worker_client"],function(n,l,v){var a=n("../lib/oop"),u=n("./text").Mode,d=n("./json_highlight_rules").JsonHighlightRules,r=n("./matching_brace_outdent").MatchingBraceOutdent,c=n("./folding/cstyle").FoldMode,e=n("../worker/worker_client").WorkerClient,i=function(){this.HighlightRules=d,this.$outdent=new r,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new c};a.inherits(i,u),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(o,h,s){var p=this.$getIndent(h);if(o=="start"){var f=h.match(/^.*[\{\(\[]\s*$/);f&&(p+=s)}return p},this.checkOutdent=function(o,h,s){return this.$outdent.checkOutdent(h,s)},this.autoOutdent=function(o,h,s){this.$outdent.autoOutdent(h,s)},this.createWorker=function(o){var h=new e(["ace"],"ace/mode/json_worker","JsonWorker");return h.attachToDocument(o.getDocument()),h.on("annotate",function(s){o.setAnnotations(s.data)}),h.on("terminate",function(){o.clearAnnotations()}),h},this.$id="ace/mode/json"}.call(i.prototype),l.Mode=i}),(function(){ace.require(["ace/mode/json"],function(n){L&&(L.exports=n)})})()})(Ma);var La={exports:{}};(function(L,t){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(n,l,v){var a=n("../lib/oop"),u=n("./text_highlight_rules").TextHighlightRules,d=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};a.inherits(d,u),l.JsonHighlightRules=d}),ace.define("ace/mode/json5_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/json_highlight_rules"],function(n,l,v){var a=n("../lib/oop"),u=n("./json_highlight_rules").JsonHighlightRules,d=function(){u.call(this);var r=[{token:"variable",regex:/[a-zA-Z$_\u00a1-\uffff][\w$\u00a1-\uffff]*\s*(?=:)/},{token:"variable",regex:/['](?:(?:\\.)|(?:[^'\\]))*?[']\s*(?=:)/},{token:"constant.language.boolean",regex:/(?:null)\b/},{token:"string",regex:/'/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/'|$/,next:"start"},{defaultToken:"string"}]},{token:"string",regex:/"(?![^"]*":)/,next:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,consumeLineEnd:!0},{token:"string",regex:/"|$/,next:"start"},{defaultToken:"string"}]},{token:"constant.numeric",regex:/[+-]?(?:Infinity|NaN)\b/}];for(var c in this.$rules)this.$rules[c].unshift.apply(this.$rules[c],r);this.normalizeRules()};a.inherits(d,u),l.Json5HighlightRules=d}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(n,l,v){var a=n("../range").Range,u=function(){};(function(){this.checkOutdent=function(d,r){return/^\s+$/.test(d)?/^\s*\}/.test(r):!1},this.autoOutdent=function(d,r){var c=d.getLine(r),e=c.match(/^(\s*\})/);if(!e)return 0;var i=e[1].length,o=d.findMatchingBracket({row:r,column:i});if(!o||o.row==r)return 0;var h=this.$getIndent(d.getLine(o.row));d.replace(new a(r,0,r,i-1),h)},this.$getIndent=function(d){return d.match(/^\s*/)[0]}}).call(u.prototype),l.MatchingBraceOutdent=u}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(n,l,v){var a=n("../../lib/oop"),u=n("../../range").Range,d=n("./fold_mode").FoldMode,r=l.FoldMode=function(c){c&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+c.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+c.end)))};a.inherits(r,d),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(c,e,i){var o=c.getLine(i);if(this.singleLineBlockCommentRe.test(o)&&!this.startRegionRe.test(o)&&!this.tripleStarBlockCommentRe.test(o))return"";var h=this._getFoldWidgetBase(c,e,i);return!h&&this.startRegionRe.test(o)?"start":h},this.getFoldWidgetRange=function(c,e,i,o){var h=c.getLine(i);if(this.startRegionRe.test(h))return this.getCommentRegionBlock(c,h,i);var f=h.match(this.foldingStartMarker);if(f){var s=f.index;if(f[1])return this.openingBracketBlock(c,f[1],i,s);var p=c.getCommentFoldRange(i,s+f[0].length,1);return p&&!p.isMultiLine()&&(o?p=this.getSectionRange(c,i):e!="all"&&(p=null)),p}if(e!=="markbegin"){var f=h.match(this.foldingStopMarker);if(f){var s=f.index+f[0].length;return f[1]?this.closingBracketBlock(c,f[1],i,s):c.getCommentFoldRange(i,s,-1)}}},this.getSectionRange=function(c,e){var i=c.getLine(e),o=i.search(/\S/),h=e,s=i.length;e+=1;for(var p=e,f=c.getLength();++e<f;){i=c.getLine(e);var g=i.search(/\S/);if(g!==-1){if(o>g)break;var y=this.getFoldWidgetRange(c,"all",e);if(y){if(y.start.row<=h)break;if(y.isMultiLine())e=y.end.row;else if(o==g)break}p=e}}return new u(h,s,p,c.getLine(p).length)},this.getCommentRegionBlock=function(c,e,i){for(var o=e.search(/\s*$/),h=c.getLength(),s=i,p=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,f=1;++i<h;){e=c.getLine(i);var g=p.exec(e);if(g&&(g[1]?f--:f++,!f))break}var y=i;if(y>s)return new u(s,o,y,e.length)}}.call(r.prototype)}),ace.define("ace/mode/json5",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json5_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"],function(n,l,v){var a=n("../lib/oop"),u=n("./text").Mode,d=n("./json5_highlight_rules").Json5HighlightRules,r=n("./matching_brace_outdent").MatchingBraceOutdent,c=n("./folding/cstyle").FoldMode,e=function(){this.HighlightRules=d,this.$outdent=new r,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new c};a.inherits(e,u),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.checkOutdent=function(i,o,h){return this.$outdent.checkOutdent(o,h)},this.autoOutdent=function(i,o,h){this.$outdent.autoOutdent(o,h)},this.$id="ace/mode/json5"}.call(e.prototype),l.Mode=e}),(function(){ace.require(["ace/mode/json5"],function(n){L&&(L.exports=n)})})()})(La);var Ia={};(function(L){function t(v,a){for(var u=v,d="";u;){var r=a[u];if(typeof r=="string")return r+d;if(r)return r.location.replace(/\/*$/,"/")+(d||r.main||r.name);if(r===!1)return"";var c=u.lastIndexOf("/");if(c===-1)break;d=u.substr(c)+d,u=u.slice(0,c)}return v}if(!(typeof L.window<"u"&&L.document)&&!(L.require&&L.define)){L.console||(L.console=function(){var v=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:v})},L.console.error=L.console.warn=L.console.log=L.console.trace=L.console),L.window=L,L.ace=L,L.onerror=function(v,a,u,d,r){postMessage({type:"error",data:{message:v,data:r&&r.data,file:a,line:u,col:d,stack:r&&r.stack}})},L.normalizeModule=function(v,a){if(a.indexOf("!")!==-1){var u=a.split("!");return L.normalizeModule(v,u[0])+"!"+L.normalizeModule(v,u[1])}if(a.charAt(0)=="."){var d=v.split("/").slice(0,-1).join("/");for(a=(d?d+"/":"")+a;a.indexOf(".")!==-1&&r!=a;){var r=a;a=a.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return a},L.require=function(v,a){if(a||(a=v,v=null),!a.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");a=L.normalizeModule(v,a);var u=L.require.modules[a];if(u)return u.initialized||(u.initialized=!0,u.exports=u.factory().exports),u.exports;if(!L.require.tlns)return console.log("unable to load "+a);var d=t(a,L.require.tlns);return d.slice(-3)!=".js"&&(d+=".js"),L.require.id=a,L.require.modules[a]={},importScripts(d),L.require(v,a)},L.require.modules={},L.require.tlns={},L.define=function(v,a,u){if(arguments.length==2?(u=a,typeof v!="string"&&(a=v,v=L.require.id)):arguments.length==1&&(u=v,a=[],v=L.require.id),typeof u!="function"){L.require.modules[v]={exports:u,initialized:!0};return}a.length||(a=["require","exports","module"]);var d=function(r){return L.require(v,r)};L.require.modules[v]={exports:{},factory:function(){var r=this,c=u.apply(this,a.slice(0,u.length).map(function(e){switch(e){case"require":return d;case"exports":return r.exports;case"module":return r;default:return d(e)}}));return c&&(r.exports=c),r}}},L.define.amd={},L.require.tlns={},L.initBaseUrls=function(v){for(var a in v)this.require.tlns[a]=v[a]},L.initSender=function(){var v=L.require("ace/lib/event_emitter").EventEmitter,a=L.require("ace/lib/oop"),u=function(){};return function(){a.implement(this,v),this.callback=function(d,r){postMessage({type:"call",id:r,data:d})},this.emit=function(d,r){postMessage({type:"event",name:d,data:r})}}.call(u.prototype),new u};var n=L.main=null,l=L.sender=null;L.onmessage=function(v){var a=v.data;if(a.event&&l)l._signal(a.event,a.data);else if(a.command)if(n[a.command])n[a.command].apply(n,a.args);else{if(!L[a.command])throw new Error("Unknown command:"+a.command);L[a.command].apply(L,a.args)}else if(a.init){L.initBaseUrls(a.tlns),l=L.sender=L.initSender();var u=this.require(a.module)[a.classname];n=L.main=new u(l)}}}})(Ia),ace.define("ace/lib/oop",[],function(L,t,n){t.inherits=function(l,v){l.super_=v,l.prototype=Object.create(v.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(l,v){for(var a in v)l[a]=v[a];return l},t.implement=function(l,v){t.mixin(l,v)}}),ace.define("ace/apply_delta",[],function(L,t,n){t.applyDelta=function(l,v,a){var u=v.start.row,d=v.start.column,r=l[u]||"";switch(v.action){case"insert":var c=v.lines;if(c.length===1)l[u]=r.substring(0,d)+v.lines[0]+r.substring(d);else{var e=[u,1].concat(v.lines);l.splice.apply(l,e),l[u]=r.substring(0,d)+l[u],l[u+v.lines.length-1]+=r.substring(d)}break;case"remove":var i=v.end.column,o=v.end.row;u===o?l[u]=r.substring(0,d)+r.substring(i):l.splice(u,o-u+1,r.substring(0,d)+l[o].substring(i))}}}),ace.define("ace/lib/event_emitter",[],function(L,t,n){var l={},v=function(){this.propagationStopped=!0},a=function(){this.defaultPrevented=!0};l._emit=l._dispatchEvent=function(u,d){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[u]||[],c=this._defaultHandlers[u];if(!(!r.length&&!c)){(typeof d!="object"||!d)&&(d={}),d.type||(d.type=u),d.stopPropagation||(d.stopPropagation=v),d.preventDefault||(d.preventDefault=a),r=r.slice();for(var e=0;e<r.length&&(r[e](d,this),!d.propagationStopped);e++);if(c&&!d.defaultPrevented)return c(d,this)}},l._signal=function(u,d){var r=(this._eventRegistry||{})[u];if(r){r=r.slice();for(var c=0;c<r.length;c++)r[c](d,this)}},l.once=function(u,d){var r=this;if(this.on(u,function c(){r.off(u,c),d.apply(null,arguments)}),!d)return new Promise(function(c){d=c})},l.setDefaultHandler=function(u,d){var r=this._defaultHandlers;if(r||(r=this._defaultHandlers={_disabled_:{}}),r[u]){var c=r[u],e=r._disabled_[u];e||(r._disabled_[u]=e=[]),e.push(c);var i=e.indexOf(d);i!=-1&&e.splice(i,1)}r[u]=d},l.removeDefaultHandler=function(u,d){var r=this._defaultHandlers;if(r){var c=r._disabled_[u];if(r[u]==d)c&&this.setDefaultHandler(u,c.pop());else if(c){var e=c.indexOf(d);e!=-1&&c.splice(e,1)}}},l.on=l.addEventListener=function(u,d,r){this._eventRegistry=this._eventRegistry||{};var c=this._eventRegistry[u];return c||(c=this._eventRegistry[u]=[]),c.indexOf(d)==-1&&c[r?"unshift":"push"](d),d},l.off=l.removeListener=l.removeEventListener=function(u,d){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[u];if(r){var c=r.indexOf(d);c!==-1&&r.splice(c,1)}},l.removeAllListeners=function(u){u||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[u]=void 0),this._defaultHandlers&&(this._defaultHandlers[u]=void 0)},t.EventEmitter=l}),ace.define("ace/range",[],function(L,t,n){var l=(function(){function v(a,u,d,r){this.start={row:a,column:u},this.end={row:d,column:r}}return v.prototype.isEqual=function(a){return this.start.row===a.start.row&&this.end.row===a.end.row&&this.start.column===a.start.column&&this.end.column===a.end.column},v.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},v.prototype.contains=function(a,u){return this.compare(a,u)==0},v.prototype.compareRange=function(a){var u,d=a.end,r=a.start;return u=this.compare(d.row,d.column),u==1?(u=this.compare(r.row,r.column),u==1?2:u==0?1:0):u==-1?-2:(u=this.compare(r.row,r.column),u==-1?-1:u==1?42:0)},v.prototype.comparePoint=function(a){return this.compare(a.row,a.column)},v.prototype.containsRange=function(a){return this.comparePoint(a.start)==0&&this.comparePoint(a.end)==0},v.prototype.intersects=function(a){var u=this.compareRange(a);return u==-1||u==0||u==1},v.prototype.isEnd=function(a,u){return this.end.row==a&&this.end.column==u},v.prototype.isStart=function(a,u){return this.start.row==a&&this.start.column==u},v.prototype.setStart=function(a,u){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=u)},v.prototype.setEnd=function(a,u){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=u)},v.prototype.inside=function(a,u){return this.compare(a,u)==0?!(this.isEnd(a,u)||this.isStart(a,u)):!1},v.prototype.insideStart=function(a,u){return this.compare(a,u)==0?!this.isEnd(a,u):!1},v.prototype.insideEnd=function(a,u){return this.compare(a,u)==0?!this.isStart(a,u):!1},v.prototype.compare=function(a,u){return!this.isMultiLine()&&a===this.start.row?u<this.start.column?-1:u>this.end.column?1:0:a<this.start.row?-1:a>this.end.row?1:this.start.row===a?u>=this.start.column?0:-1:this.end.row===a?u<=this.end.column?0:1:0},v.prototype.compareStart=function(a,u){return this.start.row==a&&this.start.column==u?-1:this.compare(a,u)},v.prototype.compareEnd=function(a,u){return this.end.row==a&&this.end.column==u?1:this.compare(a,u)},v.prototype.compareInside=function(a,u){return this.end.row==a&&this.end.column==u?1:this.start.row==a&&this.start.column==u?-1:this.compare(a,u)},v.prototype.clipRows=function(a,u){if(this.end.row>u)var d={row:u+1,column:0};else if(this.end.row<a)var d={row:a,column:0};if(this.start.row>u)var r={row:u+1,column:0};else if(this.start.row<a)var r={row:a,column:0};return v.fromPoints(r||this.start,d||this.end)},v.prototype.extend=function(a,u){var d=this.compare(a,u);if(d==0)return this;if(d==-1)var r={row:a,column:u};else var c={row:a,column:u};return v.fromPoints(r||this.start,c||this.end)},v.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},v.prototype.isMultiLine=function(){return this.start.row!==this.end.row},v.prototype.clone=function(){return v.fromPoints(this.start,this.end)},v.prototype.collapseRows=function(){return this.end.column==0?new v(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new v(this.start.row,0,this.end.row,0)},v.prototype.toScreenRange=function(a){var u=a.documentToScreenPosition(this.start),d=a.documentToScreenPosition(this.end);return new v(u.row,u.column,d.row,d.column)},v.prototype.moveBy=function(a,u){this.start.row+=a,this.start.column+=u,this.end.row+=a,this.end.column+=u},v})();l.fromPoints=function(v,a){return new l(v.row,v.column,a.row,a.column)},l.comparePoints=function(v,a){return v.row-a.row||v.column-a.column},t.Range=l}),ace.define("ace/anchor",[],function(L,t,n){function l(r,c,e){var i=e?r.column<=c.column:r.column<c.column;return r.row<c.row||r.row==c.row&&i}function v(r,c,e){var i=r.action=="insert",o=(i?1:-1)*(r.end.row-r.start.row),h=(i?1:-1)*(r.end.column-r.start.column),s=r.start,p=i?s:r.end;return l(c,s,e)?{row:c.row,column:c.column}:l(p,c,!e)?{row:c.row+o,column:c.column+(c.row==p.row?h:0)}:{row:s.row,column:s.column}}var a=L("./lib/oop"),u=L("./lib/event_emitter").EventEmitter,d=(function(){function r(c,e,i){this.$onChange=this.onChange.bind(this),this.attach(c),typeof e!="number"?this.setPosition(e.row,e.column):this.setPosition(e,i)}return r.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},r.prototype.getDocument=function(){return this.document},r.prototype.onChange=function(c){if(!(c.start.row==c.end.row&&c.start.row!=this.row)&&!(c.start.row>this.row)){var e=v(c,{row:this.row,column:this.column},this.$insertRight);this.setPosition(e.row,e.column,!0)}},r.prototype.setPosition=function(c,e,i){var o;if(i?o={row:c,column:e}:o=this.$clipPositionToDocument(c,e),!(this.row==o.row&&this.column==o.column)){var h={row:this.row,column:this.column};this.row=o.row,this.column=o.column,this._signal("change",{old:h,value:o})}},r.prototype.detach=function(){this.document.off("change",this.$onChange)},r.prototype.attach=function(c){this.document=c||this.document,this.document.on("change",this.$onChange)},r.prototype.$clipPositionToDocument=function(c,e){var i={};return c>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):c<0?(i.row=0,i.column=0):(i.row=c,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,e))),e<0&&(i.column=0),i},r})();d.prototype.$insertRight=!1,a.implement(d.prototype,u),t.Anchor=d}),ace.define("ace/document",[],function(L,t,n){var l=L("./lib/oop"),v=L("./apply_delta").applyDelta,a=L("./lib/event_emitter").EventEmitter,u=L("./range").Range,d=L("./anchor").Anchor,r=(function(){function c(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)}return c.prototype.setValue=function(e){var i=this.getLength()-1;this.remove(new u(0,0,i,this.getLine(i).length)),this.insert({row:0,column:0},e||"")},c.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},c.prototype.createAnchor=function(e,i){return new d(this,e,i)},c.prototype.$detectNewLine=function(e){var i=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=i?i[1]:`
1003
+ `,this._signal("changeNewLineMode")},c.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
1004
+ `;case"unix":return`
1005
+ `;default:return this.$autoNewLine||`
1006
+ `}},c.prototype.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},c.prototype.getNewLineMode=function(){return this.$newLineMode},c.prototype.isNewLine=function(e){return e==`\r
1007
+ `||e=="\r"||e==`
1008
+ `},c.prototype.getLine=function(e){return this.$lines[e]||""},c.prototype.getLines=function(e,i){return this.$lines.slice(e,i+1)},c.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},c.prototype.getLength=function(){return this.$lines.length},c.prototype.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},c.prototype.getLinesForRange=function(e){var i;if(e.start.row===e.end.row)i=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{i=this.getLines(e.start.row,e.end.row),i[0]=(i[0]||"").substring(e.start.column);var o=i.length-1;e.end.row-e.start.row==o&&(i[o]=i[o].substring(0,e.end.column))}return i},c.prototype.insertLines=function(e,i){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,i)},c.prototype.removeLines=function(e,i){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,i)},c.prototype.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},c.prototype.insert=function(e,i){return this.getLength()<=1&&this.$detectNewLine(i),this.insertMergedLines(e,this.$split(i))},c.prototype.insertInLine=function(e,i){var o=this.clippedPos(e.row,e.column),h=this.pos(e.row,e.column+i.length);return this.applyDelta({start:o,end:h,action:"insert",lines:[i]},!0),this.clonePos(h)},c.prototype.clippedPos=function(e,i){var o=this.getLength();e===void 0?e=o:e<0?e=0:e>=o&&(e=o-1,i=void 0);var h=this.getLine(e);return i==null&&(i=h.length),i=Math.min(Math.max(i,0),h.length),{row:e,column:i}},c.prototype.clonePos=function(e){return{row:e.row,column:e.column}},c.prototype.pos=function(e,i){return{row:e,column:i}},c.prototype.$clipPosition=function(e){var i=this.getLength();return e.row>=i?(e.row=Math.max(0,i-1),e.column=this.getLine(i-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},c.prototype.insertFullLines=function(e,i){e=Math.min(Math.max(e,0),this.getLength());var o=0;e<this.getLength()?(i=i.concat([""]),o=0):(i=[""].concat(i),e--,o=this.$lines[e].length),this.insertMergedLines({row:e,column:o},i)},c.prototype.insertMergedLines=function(e,i){var o=this.clippedPos(e.row,e.column),h={row:o.row+i.length-1,column:(i.length==1?o.column:0)+i[i.length-1].length};return this.applyDelta({start:o,end:h,action:"insert",lines:i}),this.clonePos(h)},c.prototype.remove=function(e){var i=this.clippedPos(e.start.row,e.start.column),o=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:i,end:o,action:"remove",lines:this.getLinesForRange({start:i,end:o})}),this.clonePos(i)},c.prototype.removeInLine=function(e,i,o){var h=this.clippedPos(e,i),s=this.clippedPos(e,o);return this.applyDelta({start:h,end:s,action:"remove",lines:this.getLinesForRange({start:h,end:s})},!0),this.clonePos(h)},c.prototype.removeFullLines=function(e,i){e=Math.min(Math.max(0,e),this.getLength()-1),i=Math.min(Math.max(0,i),this.getLength()-1);var o=i==this.getLength()-1&&e>0,h=i<this.getLength()-1,s=o?e-1:e,p=o?this.getLine(s).length:0,f=h?i+1:i,g=h?0:this.getLine(f).length,y=new u(s,p,f,g),A=this.$lines.slice(e,i+1);return this.applyDelta({start:y.start,end:y.end,action:"remove",lines:this.getLinesForRange(y)}),A},c.prototype.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},c.prototype.replace=function(e,i){if(e instanceof u||(e=u.fromPoints(e.start,e.end)),i.length===0&&e.isEmpty())return e.start;if(i==this.getTextRange(e))return e.end;this.remove(e);var o;return i?o=this.insert(e.start,i):o=e.start,o},c.prototype.applyDeltas=function(e){for(var i=0;i<e.length;i++)this.applyDelta(e[i])},c.prototype.revertDeltas=function(e){for(var i=e.length-1;i>=0;i--)this.revertDelta(e[i])},c.prototype.applyDelta=function(e,i){var o=e.action=="insert";(o?e.lines.length<=1&&!e.lines[0]:!u.comparePoints(e.start,e.end))||(o&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(v(this.$lines,e,i),this._signal("change",e)))},c.prototype.$safeApplyDelta=function(e){var i=this.$lines.length;(e.action=="remove"&&e.start.row<i&&e.end.row<i||e.action=="insert"&&e.start.row<=i)&&this.applyDelta(e)},c.prototype.$splitAndapplyLargeDelta=function(e,i){for(var o=e.lines,h=o.length-i+1,s=e.start.row,p=e.start.column,f=0,g=0;f<h;f=g){g+=i-1;var y=o.slice(f,g);y.push(""),this.applyDelta({start:this.pos(s+f,p),end:this.pos(s+g,p=0),action:e.action,lines:y},!0)}e.lines=o.slice(f),e.start.row=s+f,e.start.column=p,this.applyDelta(e,!0)},c.prototype.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:e.action=="insert"?"remove":"insert",lines:e.lines.slice()})},c.prototype.indexToPosition=function(e,i){for(var o=this.$lines||this.getAllLines(),h=this.getNewLineCharacter().length,s=i||0,p=o.length;s<p;s++)if(e-=o[s].length+h,e<0)return{row:s,column:e+o[s].length+h};return{row:p-1,column:e+o[p-1].length+h}},c.prototype.positionToIndex=function(e,i){for(var o=this.$lines||this.getAllLines(),h=this.getNewLineCharacter().length,s=0,p=Math.min(e.row,o.length),f=i||0;f<p;++f)s+=o[f].length+h;return s+e.column},c.prototype.$split=function(e){return e.split(/\r\n|\r|\n/)},c})();r.prototype.$autoNewLine="",r.prototype.$newLineMode="auto",l.implement(r.prototype,a),t.Document=r}),ace.define("ace/lib/deep_copy",[],function(L,t,n){t.deepCopy=function l(v){if(typeof v!="object"||!v)return v;var a;if(Array.isArray(v)){a=[];for(var u=0;u<v.length;u++)a[u]=l(v[u]);return a}if(Object.prototype.toString.call(v)!=="[object Object]")return v;a={};for(var u in v)a[u]=l(v[u]);return a}}),ace.define("ace/lib/lang",[],function(L,t,n){t.last=function(a){return a[a.length-1]},t.stringReverse=function(a){return a.split("").reverse().join("")},t.stringRepeat=function(a,u){for(var d="";u>0;)u&1&&(d+=a),(u>>=1)&&(a+=a);return d};var l=/^\s\s*/,v=/\s\s*$/;t.stringTrimLeft=function(a){return a.replace(l,"")},t.stringTrimRight=function(a){return a.replace(v,"")},t.copyObject=function(a){var u={};for(var d in a)u[d]=a[d];return u},t.copyArray=function(a){for(var u=[],d=0,r=a.length;d<r;d++)a[d]&&typeof a[d]=="object"?u[d]=this.copyObject(a[d]):u[d]=a[d];return u},t.deepCopy=L("./deep_copy").deepCopy,t.arrayToMap=function(a){for(var u={},d=0;d<a.length;d++)u[a[d]]=1;return u},t.createMap=function(a){var u=Object.create(null);for(var d in a)u[d]=a[d];return u},t.arrayRemove=function(a,u){for(var d=0;d<=a.length;d++)u===a[d]&&a.splice(d,1)},t.escapeRegExp=function(a){return a.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(a){return(""+a).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(a,u){var d=[];return a.replace(u,function(r){d.push({offset:arguments[arguments.length-2],length:r.length})}),d},t.deferredCall=function(a){var u=null,d=function(){u=null,a()},r=function(c){return r.cancel(),u=setTimeout(d,c||0),r};return r.schedule=r,r.call=function(){return this.cancel(),a(),r},r.cancel=function(){return clearTimeout(u),u=null,r},r.isPending=function(){return u},r},t.delayedCall=function(a,u){var d=null,r=function(){d=null,a()},c=function(e){d==null&&(d=setTimeout(r,e||u))};return c.delay=function(e){d&&clearTimeout(d),d=setTimeout(r,e||u)},c.schedule=c,c.call=function(){this.cancel(),a()},c.cancel=function(){d&&clearTimeout(d),d=null},c.isPending=function(){return d},c},t.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},t.skipEmptyMatch=function(a,u,d){return d&&a.codePointAt(u)>65535?2:1}}),ace.define("ace/worker/mirror",[],function(L,t,n){var l=L("../document").Document,v=L("../lib/lang"),a=t.Mirror=function(u){this.sender=u;var d=this.doc=new l(""),r=this.deferredUpdate=v.delayedCall(this.onUpdate.bind(this)),c=this;u.on("change",function(e){var i=e.data;if(i[0].start)d.applyDeltas(i);else for(var o=0;o<i.length;o+=2){var h,s;if(Array.isArray(i[o+1])?h={action:"insert",start:i[o],lines:i[o+1]}:h={action:"remove",start:i[o],end:i[o+1]},(h.action=="insert"?h.start:h.end).row>=d.$lines.length)throw s=new Error("Invalid delta"),s.data={path:c.$path,linesLength:d.$lines.length,start:h.start,end:h.end},s;d.applyDelta(h,!0)}if(c.$timeout)return r.schedule(c.$timeout);c.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(u){this.$timeout=u},this.setValue=function(u){this.doc.setValue(u),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(u){this.sender.callback(this.doc.getValue(),u)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(a.prototype)}),ace.define("ace/mode/json/json_parse",[],function(L,t,n){var l,v,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
1009
+ `,r:"\r",t:" "},u,d=function(f){throw{name:"SyntaxError",message:f,at:l,text:u}},r=function(f){return f&&f!==v&&d("Expected '"+f+"' instead of '"+v+"'"),v=u.charAt(l),l+=1,v},c=function(){var f,g="";for(v==="-"&&(g="-",r("-"));v>="0"&&v<="9";)g+=v,r();if(v===".")for(g+=".";r()&&v>="0"&&v<="9";)g+=v;if(v==="e"||v==="E")for(g+=v,r(),(v==="-"||v==="+")&&(g+=v,r());v>="0"&&v<="9";)g+=v,r();if(f=+g,!isNaN(f))return f;d("Bad number")},e=function(){var f,g,y="",A;if(v==='"')for(;r();){if(v==='"')return r(),y;if(v==="\\")if(r(),v==="u"){for(A=0,g=0;g<4&&(f=parseInt(r(),16),!!isFinite(f));g+=1)A=A*16+f;y+=String.fromCharCode(A)}else{if(typeof a[v]!="string")break;y+=a[v]}else{if(v==`
1010
+ `||v=="\r")break;y+=v}}d("Bad string")},i=function(){for(;v&&v<=" ";)r()},o=function(){switch(v){case"t":return r("t"),r("r"),r("u"),r("e"),!0;case"f":return r("f"),r("a"),r("l"),r("s"),r("e"),!1;case"n":return r("n"),r("u"),r("l"),r("l"),null}d("Unexpected '"+v+"'")},h,s=function(){var f=[];if(v==="["){if(r("["),i(),v==="]")return r("]"),f;for(;v;){if(f.push(h()),i(),v==="]")return r("]"),f;r(","),i()}}d("Bad array")},p=function(){var f,g={};if(v==="{"){if(r("{"),i(),v==="}")return r("}"),g;for(;v;){if(f=e(),i(),r(":"),Object.hasOwnProperty.call(g,f)&&d('Duplicate key "'+f+'"'),g[f]=h(),i(),v==="}")return r("}"),g;r(","),i()}}d("Bad object")};return h=function(){switch(i(),v){case"{":return p();case"[":return s();case'"':return e();case"-":return c();default:return v>="0"&&v<="9"?c():o()}},function(f,g){var y;return u=f,l=0,v=" ",y=h(),i(),v&&d("Syntax error"),typeof g=="function"?(function A(E,w){var m,S,M=E[w];if(M&&typeof M=="object")for(m in M)Object.hasOwnProperty.call(M,m)&&(S=A(M,m),S!==void 0?M[m]=S:delete M[m]);return g.call(E,w,M)})({"":y},""):y}}),ace.define("ace/mode/json_worker",[],function(L,t,n){var l=L("../lib/oop"),v=L("../worker/mirror").Mirror,a=L("./json/json_parse"),u=t.JsonWorker=function(d){v.call(this,d),this.setTimeout(200)};l.inherits(u,v),function(){this.onUpdate=function(){var d=this.doc.getValue(),r=[];try{d&&a(d)}catch(e){var c=this.doc.indexToPosition(e.at-1);r.push({row:c.row,column:c.column,text:e.message,type:"error"})}this.sender.emit("annotate",r)}}.call(u.prototype)});var Fa={exports:{}};(function(L,t){ace.define("ace/theme/clouds_midnight-css",["require","exports","module"],function(n,l,v){v.exports=`.ace-clouds-midnight .ace_gutter {
1011
+ background: #232323;
1012
+ color: #929292
1013
+ }
1014
+
1015
+ .ace-clouds-midnight .ace_print-margin {
1016
+ width: 1px;
1017
+ background: #232323
1018
+ }
1019
+
1020
+ .ace-clouds-midnight {
1021
+ background-color: #191919;
1022
+ color: #929292
1023
+ }
1024
+
1025
+ .ace-clouds-midnight .ace_cursor {
1026
+ color: #7DA5DC
1027
+ }
1028
+
1029
+ .ace-clouds-midnight .ace_marker-layer .ace_selection {
1030
+ background: #000000
1031
+ }
1032
+
1033
+ .ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {
1034
+ box-shadow: 0 0 3px 0px #191919;
1035
+ }
1036
+
1037
+ .ace-clouds-midnight .ace_marker-layer .ace_step {
1038
+ background: rgb(102, 82, 0)
1039
+ }
1040
+
1041
+ .ace-clouds-midnight .ace_marker-layer .ace_bracket {
1042
+ margin: -1px 0 0 -1px;
1043
+ border: 1px solid #BFBFBF
1044
+ }
1045
+
1046
+ .ace-clouds-midnight .ace_marker-layer .ace_active-line {
1047
+ background: rgba(215, 215, 215, 0.031)
1048
+ }
1049
+
1050
+ .ace-clouds-midnight .ace_gutter-active-line {
1051
+ background-color: rgba(215, 215, 215, 0.031)
1052
+ }
1053
+
1054
+ .ace-clouds-midnight .ace_marker-layer .ace_selected-word {
1055
+ border: 1px solid #000000
1056
+ }
1057
+
1058
+ .ace-clouds-midnight .ace_invisible {
1059
+ color: #666
1060
+ }
1061
+
1062
+ .ace-clouds-midnight .ace_keyword,
1063
+ .ace-clouds-midnight .ace_meta,
1064
+ .ace-clouds-midnight .ace_support.ace_constant.ace_property-value {
1065
+ color: #927C5D
1066
+ }
1067
+
1068
+ .ace-clouds-midnight .ace_keyword.ace_operator {
1069
+ color: #4B4B4B
1070
+ }
1071
+
1072
+ .ace-clouds-midnight .ace_keyword.ace_other.ace_unit {
1073
+ color: #366F1A
1074
+ }
1075
+
1076
+ .ace-clouds-midnight .ace_constant.ace_language {
1077
+ color: #39946A
1078
+ }
1079
+
1080
+ .ace-clouds-midnight .ace_constant.ace_numeric {
1081
+ color: #46A609
1082
+ }
1083
+
1084
+ .ace-clouds-midnight .ace_constant.ace_character.ace_entity {
1085
+ color: #A165AC
1086
+ }
1087
+
1088
+ .ace-clouds-midnight .ace_invalid {
1089
+ color: #FFFFFF;
1090
+ background-color: #E92E2E
1091
+ }
1092
+
1093
+ .ace-clouds-midnight .ace_fold {
1094
+ background-color: #927C5D;
1095
+ border-color: #929292
1096
+ }
1097
+
1098
+ .ace-clouds-midnight .ace_storage,
1099
+ .ace-clouds-midnight .ace_support.ace_class,
1100
+ .ace-clouds-midnight .ace_support.ace_function,
1101
+ .ace-clouds-midnight .ace_support.ace_other,
1102
+ .ace-clouds-midnight .ace_support.ace_type {
1103
+ color: #E92E2E
1104
+ }
1105
+
1106
+ .ace-clouds-midnight .ace_string {
1107
+ color: #5D90CD
1108
+ }
1109
+
1110
+ .ace-clouds-midnight .ace_comment {
1111
+ color: #3C403B
1112
+ }
1113
+
1114
+ .ace-clouds-midnight .ace_entity.ace_name.ace_tag,
1115
+ .ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {
1116
+ color: #606060
1117
+ }
1118
+
1119
+ .ace-clouds-midnight .ace_indent-guide {
1120
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y
1121
+ }
1122
+
1123
+ .ace-clouds-midnight .ace_indent-guide-active {
1124
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;
1125
+ }
1126
+ `}),ace.define("ace/theme/clouds_midnight",["require","exports","module","ace/theme/clouds_midnight-css","ace/lib/dom"],function(n,l,v){l.isDark=!0,l.cssClass="ace-clouds-midnight",l.cssText=n("./clouds_midnight-css");var a=n("../lib/dom");a.importCssString(l.cssText,l.cssClass,!1)}),(function(){ace.require(["ace/theme/clouds_midnight"],function(n){L&&(L.exports=n)})})()})(Fa);var Oa={exports:{}};(function(L,t){ace.define("ace/theme/chrome-css",["require","exports","module"],function(n,l,v){v.exports=`.ace-chrome .ace_gutter {
1127
+ background: #ebebeb;
1128
+ color: #333;
1129
+ overflow : hidden;
1130
+ }
1131
+
1132
+ .ace-chrome .ace_print-margin {
1133
+ width: 1px;
1134
+ background: #e8e8e8;
1135
+ }
1136
+
1137
+ .ace-chrome {
1138
+ background-color: #FFFFFF;
1139
+ color: black;
1140
+ }
1141
+
1142
+ .ace-chrome .ace_cursor {
1143
+ color: black;
1144
+ }
1145
+
1146
+ .ace-chrome .ace_invisible {
1147
+ color: rgb(191, 191, 191);
1148
+ }
1149
+
1150
+ .ace-chrome .ace_constant.ace_buildin {
1151
+ color: rgb(88, 72, 246);
1152
+ }
1153
+
1154
+ .ace-chrome .ace_constant.ace_language {
1155
+ color: rgb(88, 92, 246);
1156
+ }
1157
+
1158
+ .ace-chrome .ace_constant.ace_library {
1159
+ color: rgb(6, 150, 14);
1160
+ }
1161
+
1162
+ .ace-chrome .ace_invalid {
1163
+ background-color: rgb(153, 0, 0);
1164
+ color: white;
1165
+ }
1166
+
1167
+ .ace-chrome .ace_fold {
1168
+ }
1169
+
1170
+ .ace-chrome .ace_support.ace_function {
1171
+ color: rgb(60, 76, 114);
1172
+ }
1173
+
1174
+ .ace-chrome .ace_support.ace_constant {
1175
+ color: rgb(6, 150, 14);
1176
+ }
1177
+
1178
+ .ace-chrome .ace_support.ace_type,
1179
+ .ace-chrome .ace_support.ace_class
1180
+ .ace-chrome .ace_support.ace_other {
1181
+ color: rgb(109, 121, 222);
1182
+ }
1183
+
1184
+ .ace-chrome .ace_variable.ace_parameter {
1185
+ font-style:italic;
1186
+ color:#FD971F;
1187
+ }
1188
+ .ace-chrome .ace_keyword.ace_operator {
1189
+ color: rgb(104, 118, 135);
1190
+ }
1191
+
1192
+ .ace-chrome .ace_comment {
1193
+ color: #236e24;
1194
+ }
1195
+
1196
+ .ace-chrome .ace_comment.ace_doc {
1197
+ color: #236e24;
1198
+ }
1199
+
1200
+ .ace-chrome .ace_comment.ace_doc.ace_tag {
1201
+ color: #236e24;
1202
+ }
1203
+
1204
+ .ace-chrome .ace_constant.ace_numeric {
1205
+ color: rgb(0, 0, 205);
1206
+ }
1207
+
1208
+ .ace-chrome .ace_variable {
1209
+ color: rgb(49, 132, 149);
1210
+ }
1211
+
1212
+ .ace-chrome .ace_xml-pe {
1213
+ color: rgb(104, 104, 91);
1214
+ }
1215
+
1216
+ .ace-chrome .ace_entity.ace_name.ace_function {
1217
+ color: #0000A2;
1218
+ }
1219
+
1220
+
1221
+ .ace-chrome .ace_heading {
1222
+ color: rgb(12, 7, 255);
1223
+ }
1224
+
1225
+ .ace-chrome .ace_list {
1226
+ color:rgb(185, 6, 144);
1227
+ }
1228
+
1229
+ .ace-chrome .ace_marker-layer .ace_selection {
1230
+ background: rgb(181, 213, 255);
1231
+ }
1232
+
1233
+ .ace-chrome .ace_marker-layer .ace_step {
1234
+ background: rgb(252, 255, 0);
1235
+ }
1236
+
1237
+ .ace-chrome .ace_marker-layer .ace_stack {
1238
+ background: rgb(164, 229, 101);
1239
+ }
1240
+
1241
+ .ace-chrome .ace_marker-layer .ace_bracket {
1242
+ margin: -1px 0 0 -1px;
1243
+ border: 1px solid rgb(192, 192, 192);
1244
+ }
1245
+
1246
+ .ace-chrome .ace_marker-layer .ace_active-line {
1247
+ background: rgba(0, 0, 0, 0.07);
1248
+ }
1249
+
1250
+ .ace-chrome .ace_gutter-active-line {
1251
+ background-color : #dcdcdc;
1252
+ }
1253
+
1254
+ .ace-chrome .ace_marker-layer .ace_selected-word {
1255
+ background: rgb(250, 250, 255);
1256
+ border: 1px solid rgb(200, 200, 250);
1257
+ }
1258
+
1259
+ .ace-chrome .ace_storage,
1260
+ .ace-chrome .ace_keyword,
1261
+ .ace-chrome .ace_meta.ace_tag {
1262
+ color: rgb(147, 15, 128);
1263
+ }
1264
+
1265
+ .ace-chrome .ace_string.ace_regex {
1266
+ color: rgb(255, 0, 0)
1267
+ }
1268
+
1269
+ .ace-chrome .ace_string {
1270
+ color: #1A1AA6;
1271
+ }
1272
+
1273
+ .ace-chrome .ace_entity.ace_other.ace_attribute-name {
1274
+ color: #994409;
1275
+ }
1276
+
1277
+ .ace-chrome .ace_indent-guide {
1278
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
1279
+ }
1280
+
1281
+ .ace-chrome .ace_indent-guide-active {
1282
+ background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
1283
+ }
1284
+ `}),ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(n,l,v){l.isDark=!1,l.cssClass="ace-chrome",l.cssText=n("./chrome-css");var a=n("../lib/dom");a.importCssString(l.cssText,l.cssClass,!1)}),(function(){ace.require(["ace/theme/chrome"],function(n){L&&(L.exports=n)})})()})(Oa);var Ra={exports:{}};(function(L,t){ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(n,l,v){function a(m){var S=new Date().toLocaleString("en-us",m);return S.length==1?"0"+S:S}var u=n("./lib/dom"),d=n("./lib/oop"),r=n("./lib/event_emitter").EventEmitter,c=n("./lib/lang"),e=n("./range").Range,i=n("./range_list").RangeList,o=n("./keyboard/hash_handler").HashHandler,h=n("./tokenizer").Tokenizer,s=n("./clipboard"),p={CURRENT_WORD:function(m){return m.session.getTextRange(m.session.getWordRange())},SELECTION:function(m,S,M){var D=m.session.getTextRange();return M?D.replace(/\n\r?([ \t]*\S)/g,`
1285
+ `+M+"$1"):D},CURRENT_LINE:function(m){return m.session.getLine(m.getCursorPosition().row)},PREV_LINE:function(m){return m.session.getLine(m.getCursorPosition().row-1)},LINE_INDEX:function(m){return m.getCursorPosition().row},LINE_NUMBER:function(m){return m.getCursorPosition().row+1},SOFT_TABS:function(m){return m.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(m){return m.session.getTabSize()},CLIPBOARD:function(m){return s.getText&&s.getText()},FILENAME:function(m){return/[^/\\]*$/.exec(this.FILEPATH(m))[0]},FILENAME_BASE:function(m){return/[^/\\]*$/.exec(this.FILEPATH(m))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(m){return this.FILEPATH(m).replace(/[^/\\]*$/,"")},FILEPATH:function(m){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(m){var S=m.session.$mode||{};return S.blockComment&&S.blockComment.start||""},BLOCK_COMMENT_END:function(m){var S=m.session.$mode||{};return S.blockComment&&S.blockComment.end||""},LINE_COMMENT:function(m){var S=m.session.$mode||{};return S.lineCommentStart||""},CURRENT_YEAR:a.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:a.bind(null,{year:"2-digit"}),CURRENT_MONTH:a.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:a.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:a.bind(null,{month:"short"}),CURRENT_DATE:a.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:a.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:a.bind(null,{weekday:"short"}),CURRENT_HOUR:a.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:a.bind(null,{minute:"2-digit"}),CURRENT_SECOND:a.bind(null,{second:"2-digit"})};p.SELECTED_TEXT=p.SELECTION;var f=(function(){function m(){this.snippetMap={},this.snippetNameMap={},this.variables=p}return m.prototype.getTokenizer=function(){return m.$tokenizer||this.createTokenizer()},m.prototype.createTokenizer=function(){function S(_){return _=_.substr(1),/^\d+$/.test(_)?[{tabstopId:parseInt(_,10)}]:[{text:_}]}function M(_){return"(?:[^\\\\"+_+"]|\\\\.)"}var D={regex:"/("+M("/")+"+)/",onMatch:function(_,F,x){var $=x[0];return $.fmtString=!0,$.guard=_.slice(1,-1),$.flag="",""},next:"formatString"};return m.$tokenizer=new h({start:[{regex:/\\./,onMatch:function(_,F,x){var $=_[1];return($=="}"&&x.length||"`$\\".indexOf($)!=-1)&&(_=$),[_]}},{regex:/}/,onMatch:function(_,F,x){return[x.length?x.shift():_]}},{regex:/\$(?:\d+|\w+)/,onMatch:S},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(_,F,x){var $=S(_.substr(1));return x.unshift($[0]),$},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+M("\\|")+"*\\|",onMatch:function(_,F,x){var $=_.slice(1,-1).replace(/\\[,|\\]|,/g,function(C){return C.length==2?C[1]:"\0"}).split("\0").map(function(C){return{value:C}});return x[0].choices=$,[$[0]]},next:"start"},D,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(_,F,x){return x.length&&x[0].expectElse?(x[0].expectElse=!1,x[0].ifEnd={elseEnd:x[0]},[x[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(_,F,x){var $=_[1];return $=="}"&&x.length||"`$\\".indexOf($)!=-1?_=$:$=="n"?_=`
1286
+ `:$=="t"?_=" ":"ulULE".indexOf($)!=-1&&(_={changeCase:$,local:$>"a"}),[_]}},{regex:"/\\w*}",onMatch:function(_,F,x){var $=x.shift();return $&&($.flag=_.slice(1,-1)),this.next=$&&$.tabstopId?"start":"",[$||_]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(_,F,x){return[{text:_.slice(1)}]}},{regex:/\${\w+/,onMatch:function(_,F,x){var $={text:_.slice(2)};return x.unshift($),[$]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(_,F,x){var $=x.shift();return this.next=$&&$.tabstopId?"start":"",[$||_]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(_,F,x){var $=x[0];return $.formatFunction=_.slice(2,-1),[x.shift()]},next:"formatString"},D,{regex:/:[\?\-+]?/,onMatch:function(_,F,x){_[1]=="+"&&(x[0].ifEnd=x[0]),_[1]=="?"&&(x[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),m.$tokenizer},m.prototype.tokenizeTmSnippet=function(S,M){return this.getTokenizer().getLineTokens(S,M).tokens.map(function(D){return D.value||D})},m.prototype.getVariableValue=function(S,M,D){if(/^\d+$/.test(M))return(this.variables.__||{})[M]||"";if(/^[A-Z]\d+$/.test(M))return(this.variables[M[0]+"__"]||{})[M.substr(1)]||"";if(M=M.replace(/^TM_/,""),!this.variables.hasOwnProperty(M))return"";var _=this.variables[M];return typeof _=="function"&&(_=this.variables[M](S,M,D)),_??""},m.prototype.tmStrFormat=function(S,M,D){if(!M.fmt)return S;var _=M.flag||"",F=M.guard;F=new RegExp(F,_.replace(/[^gim]/g,""));var x=typeof M.fmt=="string"?this.tokenizeTmSnippet(M.fmt,"formatString"):M.fmt,$=this,C=S.replace(F,function(){var b=$.variables.__;$.variables.__=[].slice.call(arguments);for(var T=$.resolveVariables(x,D),I="E",O=0;O<T.length;O++){var N=T[O];if(typeof N=="object")if(T[O]="",N.changeCase&&N.local){var P=T[O+1];P&&typeof P=="string"&&(N.changeCase=="u"?T[O]=P[0].toUpperCase():T[O]=P[0].toLowerCase(),T[O+1]=P.substr(1))}else N.changeCase&&(I=N.changeCase);else I=="U"?T[O]=N.toUpperCase():I=="L"&&(T[O]=N.toLowerCase())}return $.variables.__=b,T.join("")});return C},m.prototype.tmFormatFunction=function(S,M,D){return M.formatFunction=="upcase"?S.toUpperCase():M.formatFunction=="downcase"?S.toLowerCase():S},m.prototype.resolveVariables=function(S,M){function D(I){var O=S.indexOf(I,$+1);O!=-1&&($=O)}for(var _=[],F="",x=!0,$=0;$<S.length;$++){var C=S[$];if(typeof C=="string"){_.push(C),C==`
1287
+ `?(x=!0,F=""):x&&(F=/^\t*/.exec(C)[0],x=/\S/.test(C));continue}if(C){if(x=!1,C.fmtString){var b=S.indexOf(C,$+1);b==-1&&(b=S.length),C.fmt=S.slice($+1,b),$=b}if(C.text){var T=this.getVariableValue(M,C.text,F)+"";C.fmtString&&(T=this.tmStrFormat(T,C,M)),C.formatFunction&&(T=this.tmFormatFunction(T,C,M)),T&&!C.ifEnd?(_.push(T),D(C)):!T&&C.ifEnd&&D(C.ifEnd)}else C.elseEnd?D(C.elseEnd):(C.tabstopId!=null||C.changeCase!=null)&&_.push(C)}}return _},m.prototype.getDisplayTextForSnippet=function(S,M){var D=g.call(this,S,M);return D.text},m.prototype.insertSnippetForSelection=function(S,M,D){D===void 0&&(D={});var _=g.call(this,S,M,D),F=S.getSelectionRange(),x=S.session.replace(F,_.text),$=new y(S),C=S.inVirtualSelectionMode&&S.selection.index;$.addTabstops(_.tabstops,F.start,x,C)},m.prototype.insertSnippet=function(S,M,D){D===void 0&&(D={});var _=this;if(S.inVirtualSelectionMode)return _.insertSnippetForSelection(S,M,D);S.forEachSelection(function(){_.insertSnippetForSelection(S,M,D)},null,{keepOrder:!0}),S.tabstopManager&&S.tabstopManager.tabNext()},m.prototype.$getScope=function(S){var M=S.session.$mode.$id||"";if(M=M.split("/").pop(),M==="html"||M==="php"){M==="php"&&!S.session.$mode.inlinePhp&&(M="html");var D=S.getCursorPosition(),_=S.session.getState(D.row);typeof _=="object"&&(_=_[0]),_.substring&&(_.substring(0,3)=="js-"?M="javascript":_.substring(0,4)=="css-"?M="css":_.substring(0,4)=="php-"&&(M="php"))}return M},m.prototype.getActiveScopes=function(S){var M=this.$getScope(S),D=[M],_=this.snippetMap;return _[M]&&_[M].includeScopes&&D.push.apply(D,_[M].includeScopes),D.push("_"),D},m.prototype.expandWithTab=function(S,M){var D=this,_=S.forEachSelection(function(){return D.expandSnippetForSelection(S,M)},null,{keepOrder:!0});return _&&S.tabstopManager&&S.tabstopManager.tabNext(),_},m.prototype.expandSnippetForSelection=function(S,M){var D=S.getCursorPosition(),_=S.session.getLine(D.row),F=_.substring(0,D.column),x=_.substr(D.column),$=this.snippetMap,C;return this.getActiveScopes(S).some(function(b){var T=$[b];return T&&(C=this.findMatchingSnippet(T,F,x)),!!C},this),C?(M&&M.dryRun||(S.session.doc.removeInLine(D.row,D.column-C.replaceBefore.length,D.column+C.replaceAfter.length),this.variables.M__=C.matchBefore,this.variables.T__=C.matchAfter,this.insertSnippetForSelection(S,C.content),this.variables.M__=this.variables.T__=null),!0):!1},m.prototype.findMatchingSnippet=function(S,M,D){for(var _=S.length;_--;){var F=S[_];if(!(F.startRe&&!F.startRe.test(M))&&!(F.endRe&&!F.endRe.test(D))&&!(!F.startRe&&!F.endRe))return F.matchBefore=F.startRe?F.startRe.exec(M):[""],F.matchAfter=F.endRe?F.endRe.exec(D):[""],F.replaceBefore=F.triggerRe?F.triggerRe.exec(M)[0]:"",F.replaceAfter=F.endTriggerRe?F.endTriggerRe.exec(D)[0]:"",F}},m.prototype.register=function(S,M){function D(b){return b&&!/^\^?\(.*\)\$?$|^\\b$/.test(b)&&(b="(?:"+b+")"),b||""}function _(b,T,I){return b=D(b),T=D(T),b=T+b,b&&b[b.length-1]!="$"&&(b+="$"),new RegExp(b)}function F(b){b.scope||(b.scope=M||"_"),M=b.scope,x[M]||(x[M]=[],$[M]={});var T=$[M];if(b.name){var I=T[b.name];I&&C.unregister(I),T[b.name]=b}x[M].push(b),b.prefix&&(b.tabTrigger=b.prefix),!b.content&&b.body&&(b.content=Array.isArray(b.body)?b.body.join(`
1288
+ `):b.body),b.tabTrigger&&!b.trigger&&(!b.guard&&/^\w/.test(b.tabTrigger)&&(b.guard="\\b"),b.trigger=c.escapeRegExp(b.tabTrigger)),!(!b.trigger&&!b.guard&&!b.endTrigger&&!b.endGuard)&&(b.startRe=_(b.trigger,b.guard),b.triggerRe=new RegExp(b.trigger),b.endRe=_(b.endTrigger,b.endGuard),b.endTriggerRe=new RegExp(b.endTrigger))}var x=this.snippetMap,$=this.snippetNameMap,C=this;S||(S=[]),Array.isArray(S)?S.forEach(F):Object.keys(S).forEach(function(b){F(S[b])}),this._signal("registerSnippets",{scope:M})},m.prototype.unregister=function(S,M){function D(x){var $=F[x.scope||M];if($&&$[x.name]){delete $[x.name];var C=_[x.scope||M],b=C&&C.indexOf(x);b>=0&&C.splice(b,1)}}var _=this.snippetMap,F=this.snippetNameMap;S.content?D(S):Array.isArray(S)&&S.forEach(D)},m.prototype.parseSnippetFile=function(S){S=S.replace(/\r/g,"");for(var M=[],D={},_=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,F;F=_.exec(S);){if(F[1])try{D=JSON.parse(F[1]),M.push(D)}catch{}if(F[4])D.content=F[4].replace(/^\t/gm,""),M.push(D),D={};else{var x=F[2],$=F[3];if(x=="regex"){var C=/\/((?:[^\/\\]|\\.)*)|$/g;D.guard=C.exec($)[1],D.trigger=C.exec($)[1],D.endTrigger=C.exec($)[1],D.endGuard=C.exec($)[1]}else x=="snippet"?(D.tabTrigger=$.match(/^\S*/)[0],D.name||(D.name=$)):x&&(D[x]=$)}}return M},m.prototype.getSnippetByName=function(S,M){var D=this.snippetNameMap,_;return this.getActiveScopes(M).some(function(F){var x=D[F];return x&&(_=x[S]),!!_},this),_},m})();d.implement(f.prototype,r);var g=function(m,S,M){function D(G){for(var Y=[],Q=0;Q<G.length;Q++){var q=G[Q];if(typeof q=="object"){if(T[q.tabstopId])continue;var te=G.lastIndexOf(q,Q-1);q=Y[te]||{tabstopId:q.tabstopId}}Y[Q]=q}return Y}M===void 0&&(M={});var _=m.getCursorPosition(),F=m.session.getLine(_.row),x=m.session.getTabString(),$=F.match(/^\s*/)[0];_.column<$.length&&($=$.slice(0,_.column)),S=S.replace(/\r/g,"");var C=this.tokenizeTmSnippet(S);C=this.resolveVariables(C,m),C=C.map(function(G){return G==`
1289
+ `&&!M.excludeExtraIndent?G+$:typeof G=="string"?G.replace(/\t/g,x):G});var b=[];C.forEach(function(G,Y){if(typeof G=="object"){var Q=G.tabstopId,q=b[Q];if(q||(q=b[Q]=[],q.index=Q,q.value="",q.parents={}),q.indexOf(G)===-1){G.choices&&!q.choices&&(q.choices=G.choices),q.push(G);var te=C.indexOf(G,Y+1);if(te!==-1){var re=C.slice(Y+1,te),ue=re.some(function(me){return typeof me=="object"});ue&&!q.value?q.value=re:re.length&&(!q.value||typeof q.value!="string")&&(q.value=re.join(""))}}}}),b.forEach(function(G){G.length=0});for(var T={},I=0;I<C.length;I++){var O=C[I];if(typeof O=="object"){var N=O.tabstopId,P=b[N],B=C.indexOf(O,I+1);if(T[N]){T[N]===O&&(delete T[N],Object.keys(T).forEach(function(G){P.parents[G]=!0}));continue}T[N]=O;var V=P.value;typeof V!="string"?V=D(V):O.fmt&&(V=this.tmStrFormat(V,O,m)),C.splice.apply(C,[I+1,Math.max(0,B-I)].concat(V,O)),P.indexOf(O)===-1&&P.push(O)}}var W=0,z=0,U="";return C.forEach(function(G){if(typeof G=="string"){var Y=G.split(`
1290
+ `);Y.length>1?(z=Y[Y.length-1].length,W+=Y.length-1):z+=G.length,U+=G}else G&&(G.start?G.end={row:W,column:z}:G.start={row:W,column:z})}),{text:U,tabstops:b,tokens:C}},y=(function(){function m(S){if(this.index=0,this.ranges=[],this.tabstops=[],S.tabstopManager)return S.tabstopManager;S.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=c.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(S)}return m.prototype.attach=function(S){this.$openTabstops=null,this.selectedTabstop=null,this.editor=S,this.session=S.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},m.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},m.prototype.onChange=function(S){for(var M=S.action[0]=="r",D=this.selectedTabstop||{},_=D.parents||{},F=this.tabstops.slice(),x=0;x<F.length;x++){var $=F[x],C=$==D||_[$.index];if($.rangeList.$bias=C?0:1,S.action=="remove"&&$!==D){var b=$.parents&&$.parents[D.index],T=$.rangeList.pointIndex(S.start,b);T=T<0?-T-1:T+1;var I=$.rangeList.pointIndex(S.end,b);I=I<0?-I-1:I-1;for(var O=$.rangeList.ranges.slice(T,I),N=0;N<O.length;N++)this.removeRange(O[N])}$.rangeList.$onChange(S)}var P=this.session;!this.$inChange&&M&&P.getLength()==1&&!P.getValue()&&this.detach()},m.prototype.updateLinkedFields=function(){var S=this.selectedTabstop;if(!(!S||!S.hasLinkedRanges||!S.firstNonLinked)){this.$inChange=!0;for(var M=this.session,D=M.getTextRange(S.firstNonLinked),_=0;_<S.length;_++){var F=S[_];if(F.linked){var x=F.original,$=l.snippetManager.tmStrFormat(D,x,this.editor);M.replace(F,$)}}this.$inChange=!1}},m.prototype.onAfterExec=function(S){S.command&&!S.command.readOnly&&this.updateLinkedFields()},m.prototype.onChangeSelection=function(){if(this.editor){for(var S=this.editor.selection.lead,M=this.editor.selection.anchor,D=this.editor.selection.isEmpty(),_=0;_<this.ranges.length;_++)if(!this.ranges[_].linked){var F=this.ranges[_].contains(S.row,S.column),x=D||this.ranges[_].contains(M.row,M.column);if(F&&x)return}this.detach()}},m.prototype.onChangeSession=function(){this.detach()},m.prototype.tabNext=function(S){var M=this.tabstops.length,D=this.index+(S||1);D=Math.min(Math.max(D,1),M),D==M&&(D=0),this.selectTabstop(D),this.updateTabstopMarkers(),D===0&&this.detach()},m.prototype.selectTabstop=function(S){this.$openTabstops=null;var M=this.tabstops[this.index];if(M&&this.addTabstopMarkers(M),this.index=S,M=this.tabstops[this.index],!(!M||!M.length)){this.selectedTabstop=M;var D=M.firstNonLinked||M;if(M.choices&&(D.cursor=D.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(D);else{var _=this.editor.multiSelect;_.toSingleRange(D);for(var F=0;F<M.length;F++)M.hasLinkedRanges&&M[F].linked||_.addRange(M[F].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},m.prototype.addTabstops=function(S,M,D){var _=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!S[0]){var F=e.fromPoints(D,D);E(F.start,M),E(F.end,M),S[0]=[F],S[0].index=0}var x=this.index,$=[x+1,0],C=this.ranges,b=this.snippetId=(this.snippetId||0)+1;S.forEach(function(T,I){var O=this.$openTabstops[I]||T;O.snippetId=b;for(var N=0;N<T.length;N++){var P=T[N],B=e.fromPoints(P.start,P.end||P.start);A(B.start,M),A(B.end,M),B.original=P,B.tabstop=O,C.push(B),O!=T?O.unshift(B):O[N]=B,P.fmtString||O.firstNonLinked&&_?(B.linked=!0,O.hasLinkedRanges=!0):O.firstNonLinked||(O.firstNonLinked=B)}O.firstNonLinked||(O.hasLinkedRanges=!1),O===T&&($.push(O),this.$openTabstops[I]=O),this.addTabstopMarkers(O),O.rangeList=O.rangeList||new i,O.rangeList.$bias=0,O.rangeList.addList(O)},this),$.length>2&&(this.tabstops.length&&$.push($.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,$))},m.prototype.addTabstopMarkers=function(S){var M=this.session;S.forEach(function(D){D.markerId||(D.markerId=M.addMarker(D,"ace_snippet-marker","text"))})},m.prototype.removeTabstopMarkers=function(S){var M=this.session;S.forEach(function(D){M.removeMarker(D.markerId),D.markerId=null})},m.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var S=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&S--,this.tabstops.forEach(function(M){M.snippetId===S?this.addTabstopMarkers(M):this.removeTabstopMarkers(M)},this)}},m.prototype.removeRange=function(S){var M=S.tabstop.indexOf(S);M!=-1&&S.tabstop.splice(M,1),M=this.ranges.indexOf(S),M!=-1&&this.ranges.splice(M,1),M=S.tabstop.rangeList.ranges.indexOf(S),M!=-1&&S.tabstop.splice(M,1),this.session.removeMarker(S.markerId),S.tabstop.length||(M=this.tabstops.indexOf(S.tabstop),M!=-1&&this.tabstops.splice(M,1),this.tabstops.length||this.detach())},m})();y.prototype.keyboardHandler=new o,y.prototype.keyboardHandler.bindKeys({Tab:function(m){l.snippetManager&&l.snippetManager.expandWithTab(m)||(m.tabstopManager.tabNext(1),m.renderer.scrollCursorIntoView())},"Shift-Tab":function(m){m.tabstopManager.tabNext(-1),m.renderer.scrollCursorIntoView()},Esc:function(m){m.tabstopManager.detach()}});var A=function(m,S){m.row==0&&(m.column+=S.column),m.row+=S.row},E=function(m,S){m.row==S.row&&(m.column-=S.column),m.row-=S.row};u.importCssString(`
1291
+ .ace_snippet-marker {
1292
+ -moz-box-sizing: border-box;
1293
+ box-sizing: border-box;
1294
+ background: rgba(194, 193, 208, 0.09);
1295
+ border: 1px dotted rgba(211, 208, 235, 0.62);
1296
+ position: absolute;
1297
+ }`,"snippets.css",!1),l.snippetManager=new f;var w=n("./editor").Editor;(function(){this.insertSnippet=function(m,S){return l.snippetManager.insertSnippet(this,m,S)},this.expandSnippet=function(m){return l.snippetManager.expandWithTab(this,m)}}).call(w.prototype)}),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config","ace/lib/useragent"],function(n,l,v){var a=n("../virtual_renderer").VirtualRenderer,u=n("../editor").Editor,d=n("../range").Range,r=n("../lib/event"),c=n("../lib/lang"),e=n("../lib/dom"),i=n("../config").nls,o=n("./../lib/useragent"),h=function(A){return"suggest-aria-id:".concat(A)},s=o.isSafari?"menu":"listbox",p=o.isSafari?"menuitem":"option",f=o.isSafari?"aria-current":"aria-selected",g=function(A){var E=new a(A);E.$maxLines=4;var w=new u(E);return w.setHighlightActiveLine(!1),w.setShowPrintMargin(!1),w.renderer.setShowGutter(!1),w.renderer.setHighlightGutterLine(!1),w.$mouseHandler.$focusTimeout=0,w.$highlightTagPending=!0,w},y=(function(){function A(E){var w=e.createElement("div"),m=g(w);E&&E.appendChild(w),w.style.display="none",m.renderer.content.style.cursor="default",m.renderer.setStyle("ace_autocomplete"),m.renderer.$textLayer.element.setAttribute("role",s),m.renderer.$textLayer.element.setAttribute("aria-roledescription",i("autocomplete.popup.aria-roledescription","Autocomplete suggestions")),m.renderer.$textLayer.element.setAttribute("aria-label",i("autocomplete.popup.aria-label","Autocomplete suggestions")),m.renderer.textarea.setAttribute("aria-hidden","true"),m.setOption("displayIndentGuides",!1),m.setOption("dragDelay",150);var S=function(){};m.focus=S,m.$isFocused=!0,m.renderer.$cursorLayer.restartTimer=S,m.renderer.$cursorLayer.element.style.opacity="0",m.renderer.$maxLines=8,m.renderer.$keepTextAreaAtCursor=!1,m.setHighlightActiveLine(!1),m.session.highlight(""),m.session.$searchHighlight.clazz="ace_highlight-marker",m.on("mousedown",function(C){var b=C.getDocumentPosition();m.selection.moveToPosition(b),_.start.row=_.end.row=b.row,C.stop()});var M,D=new d(-1,0,-1,1/0),_=new d(-1,0,-1,1/0);_.id=m.session.addMarker(_,"ace_active-line","fullLine"),m.setSelectOnHover=function(C){C?D.id&&(m.session.removeMarker(D.id),D.id=null):D.id=m.session.addMarker(D,"ace_line-hover","fullLine")},m.setSelectOnHover(!1),m.on("mousemove",function(C){if(!M){M=C;return}if(!(M.x==C.x&&M.y==C.y)){M=C,M.scrollTop=m.renderer.scrollTop,m.isMouseOver=!0;var b=M.getDocumentPosition().row;D.start.row!=b&&(D.id||m.setRow(b),x(b))}}),m.renderer.on("beforeRender",function(){if(M&&D.start.row!=-1){M.$pos=null;var C=M.getDocumentPosition().row;D.id||m.setRow(C),x(C,!0)}}),m.renderer.on("afterRender",function(){for(var C=m.renderer.$textLayer,b=C.config.firstRow,T=C.config.lastRow;b<=T;b++){var I=C.element.childNodes[b-C.config.firstRow];I.setAttribute("role",p),I.setAttribute("aria-roledescription",i("autocomplete.popup.item.aria-roledescription","item")),I.setAttribute("aria-setsize",m.data.length),I.setAttribute("aria-describedby","doc-tooltip"),I.setAttribute("aria-posinset",b+1);var O=m.getData(b);if(O){var N="".concat(O.caption||O.value).concat(O.meta?", ".concat(O.meta):"");I.setAttribute("aria-label",N)}var P=I.querySelectorAll(".ace_completion-highlight");P.forEach(function(B){B.setAttribute("role","mark")})}}),m.renderer.on("afterRender",function(){var C=m.getRow(),b=m.renderer.$textLayer,T=b.element.childNodes[C-b.config.firstRow],I=document.activeElement;if(T!==m.selectedNode&&m.selectedNode&&(e.removeCssClass(m.selectedNode,"ace_selected"),m.selectedNode.removeAttribute(f),m.selectedNode.removeAttribute("id")),I.removeAttribute("aria-activedescendant"),m.selectedNode=T,T){var O=h(C);e.addCssClass(T,"ace_selected"),T.id=O,b.element.setAttribute("aria-activedescendant",O),I.setAttribute("aria-activedescendant",O),T.setAttribute(f,"true")}});var F=function(){x(-1)},x=function(C,b){C!==D.start.row&&(D.start.row=D.end.row=C,b||m.session._emit("changeBackMarker"),m._emit("changeHoverMarker"))};m.getHoveredRow=function(){return D.start.row},r.addListener(m.container,"mouseout",function(){m.isMouseOver=!1,F()}),m.on("hide",F),m.on("changeSelection",F),m.session.doc.getLength=function(){return m.data.length},m.session.doc.getLine=function(C){var b=m.data[C];return typeof b=="string"?b:b&&b.value||""};var $=m.session.bgTokenizer;return $.$tokenizeRow=function(C){function b(G,Y){G&&I.push({type:(T.className||"")+(Y||""),value:G})}var T=m.data[C],I=[];if(!T)return I;typeof T=="string"&&(T={value:T});for(var O=T.caption||T.value||T.name,N=O.toLowerCase(),P=(m.filterText||"").toLowerCase(),B=0,V=0,W=0;W<=P.length;W++)if(W!=V&&(T.matchMask&1<<W||W==P.length)){var z=P.slice(V,W);V=W;var U=N.indexOf(z,B);if(U==-1)continue;b(O.slice(B,U),""),B=U+z.length,b(O.slice(U,B),"completion-highlight")}return b(O.slice(B,O.length),""),I.push({type:"completion-spacer",value:" "}),T.meta&&I.push({type:"completion-meta",value:T.meta}),T.message&&I.push({type:"completion-message",value:T.message}),I},$.$updateOnChange=S,$.start=S,m.session.$computeWidth=function(){return this.screenWidth=0},m.isOpen=!1,m.isTopdown=!1,m.autoSelect=!0,m.filterText="",m.isMouseOver=!1,m.data=[],m.setData=function(C,b){m.filterText=b||"",m.setValue(c.stringRepeat(`
1298
+ `,C.length),-1),m.data=C||[],m.setRow(0)},m.getData=function(C){return m.data[C]},m.getRow=function(){return _.start.row},m.setRow=function(C){C=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,C)),_.start.row!=C&&(m.selection.clearSelection(),_.start.row=_.end.row=C||0,m.session._emit("changeBackMarker"),m.moveCursorTo(C||0,0),m.isOpen&&m._signal("select"))},m.on("changeSelection",function(){m.isOpen&&m.setRow(m.selection.lead.row),m.renderer.scrollCursorIntoView()}),m.hide=function(){this.container.style.display="none",m.anchorPos=null,m.anchor=null,m.isOpen&&(m.isOpen=!1,this._signal("hide"))},m.tryShow=function(C,b,T,I){if(!I&&m.isOpen&&m.anchorPos&&m.anchor&&m.anchorPos.top===C.top&&m.anchorPos.left===C.left&&m.anchor===T)return!0;var O=this.container,N=this.renderer.scrollBar.width||10,P=window.innerHeight-N,B=window.innerWidth-N,V=this.renderer,W=V.$maxLines*b*1.4,z={top:0,bottom:0},U=P-C.top-3*this.$borderSize-b,G=C.top-3*this.$borderSize;T||(G<=U||U>=W?T="bottom":T="top"),T==="top"?(z.bottom=C.top-this.$borderSize,z.top=z.bottom-W):T==="bottom"&&(z.top=C.top+b+this.$borderSize,z.bottom=z.top+W);var Y=z.top>=0&&z.bottom<=P;if(!I&&!Y)return!1;Y?V.$maxPixelHeight=null:T==="top"?V.$maxPixelHeight=G:V.$maxPixelHeight=U,T==="top"?(O.style.top="",O.style.bottom=P+N-z.bottom+"px",m.isTopdown=!1):(O.style.top=z.top+"px",O.style.bottom="",m.isTopdown=!0),O.style.display="";var Q=C.left;return Q+O.offsetWidth>B&&(Q=B-O.offsetWidth),O.style.left=Q+"px",O.style.right="",m.isOpen||(m.isOpen=!0,this._signal("show"),M=null),m.anchorPos=C,m.anchor=T,e.$fixPositionBug(O),!0},m.show=function(C,b,T){this.tryShow(C,b,T?"bottom":void 0,!0)},m.goTo=function(C){var b=this.getRow(),T=this.session.getLength()-1;switch(C){case"up":b=b<=0?T:b-1;break;case"down":b=b>=T?-1:b+1;break;case"start":b=0;break;case"end":b=T}this.setRow(b)},m.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},m.$imageSize=0,m.$borderSize=1,m}return A})();e.importCssString(`
1299
+ .ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
1300
+ background-color: #CAD6FA;
1301
+ z-index: 1;
1302
+ }
1303
+ .ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
1304
+ background-color: #3a674e;
1305
+ }
1306
+ .ace_editor.ace_autocomplete .ace_line-hover {
1307
+ border: 1px solid #abbffe;
1308
+ margin-top: -1px;
1309
+ background: rgba(233,233,253,0.4);
1310
+ position: absolute;
1311
+ z-index: 2;
1312
+ }
1313
+ .ace_dark.ace_editor.ace_autocomplete .ace_line-hover {
1314
+ border: 1px solid rgba(109, 150, 13, 0.8);
1315
+ background: rgba(58, 103, 78, 0.62);
1316
+ }
1317
+ .ace_completion-meta {
1318
+ opacity: 0.5;
1319
+ margin-left: 0.9em;
1320
+ }
1321
+ .ace_completion-message {
1322
+ margin-left: 0.9em;
1323
+ color: blue;
1324
+ }
1325
+ .ace_editor.ace_autocomplete .ace_completion-highlight{
1326
+ color: #2d69c7;
1327
+ }
1328
+ .ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{
1329
+ color: #93ca12;
1330
+ }
1331
+ .ace_editor.ace_autocomplete {
1332
+ width: 300px;
1333
+ z-index: 200000;
1334
+ border: 1px lightgray solid;
1335
+ position: fixed;
1336
+ box-shadow: 2px 3px 5px rgba(0,0,0,.2);
1337
+ line-height: 1.4;
1338
+ background: #fefefe;
1339
+ color: #111;
1340
+ }
1341
+ .ace_dark.ace_editor.ace_autocomplete {
1342
+ border: 1px #484747 solid;
1343
+ box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);
1344
+ line-height: 1.4;
1345
+ background: #25282c;
1346
+ color: #c1c1c1;
1347
+ }
1348
+ .ace_autocomplete .ace_text-layer {
1349
+ width: calc(100% - 8px);
1350
+ }
1351
+ .ace_autocomplete .ace_line {
1352
+ display: flex;
1353
+ align-items: center;
1354
+ }
1355
+ .ace_autocomplete .ace_line > * {
1356
+ min-width: 0;
1357
+ flex: 0 0 auto;
1358
+ }
1359
+ .ace_autocomplete .ace_line .ace_ {
1360
+ flex: 0 1 auto;
1361
+ overflow: hidden;
1362
+ text-overflow: ellipsis;
1363
+ }
1364
+ .ace_autocomplete .ace_completion-spacer {
1365
+ flex: 1;
1366
+ }
1367
+ .ace_autocomplete.ace_loading:after {
1368
+ content: "";
1369
+ position: absolute;
1370
+ top: 0px;
1371
+ height: 2px;
1372
+ width: 8%;
1373
+ background: blue;
1374
+ z-index: 100;
1375
+ animation: ace_progress 3s infinite linear;
1376
+ animation-delay: 300ms;
1377
+ transform: translateX(-100%) scaleX(1);
1378
+ }
1379
+ @keyframes ace_progress {
1380
+ 0% { transform: translateX(-100%) scaleX(1) }
1381
+ 50% { transform: translateX(625%) scaleX(2) }
1382
+ 100% { transform: translateX(1500%) scaleX(3) }
1383
+ }
1384
+ @media (prefers-reduced-motion) {
1385
+ .ace_autocomplete.ace_loading:after {
1386
+ transform: translateX(625%) scaleX(2);
1387
+ animation: none;
1388
+ }
1389
+ }
1390
+ `,"autocompletion.css",!1),l.AcePopup=y,l.$singleLineEditor=g,l.getAriaId=h}),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(n,l,v){var a=(function(){function u(d){this.editor=d,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return u.prototype.setScreenReaderContent=function(d){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var c=this.popup.getRow(),e=this.popup.renderer.$textLayer,i=e.element.childNodes[c-e.config.firstRow];if(i){for(var o="doc-tooltip ",h=0;h<this._lines.length;h++)o+="ace-inline-screenreader-line-".concat(h," ");i.setAttribute("aria-describedby",o)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=d.split(/\r\n|\r|\n/);var r=this.createCodeBlock();this.screenReaderDiv.appendChild(r)},u.prototype.destroy=function(){this.screenReaderDiv.remove()},u.prototype.createCodeBlock=function(){var d=document.createElement("pre");d.setAttribute("id","ace-inline-screenreader");for(var r=0;r<this._lines.length;r++){var c=document.createElement("code");c.setAttribute("id","ace-inline-screenreader-line-".concat(r));var e=document.createTextNode(this._lines[r]);c.appendChild(e),d.appendChild(c)}return d},u})();l.AceInlineScreenReader=a}),ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],function(n,l,v){var a=n("../snippets").snippetManager,u=n("./inline_screenreader").AceInlineScreenReader,d=(function(){function r(){this.editor=null}return r.prototype.show=function(c,e,i){if(i=i||"",c&&this.editor&&this.editor!==c&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!c||!e)return!1;this.inlineScreenReader||(this.inlineScreenReader=new u(c));var o=e.snippet?a.getDisplayTextForSnippet(c,e.snippet):e.value;return e.hideInlinePreview||!o||!o.startsWith(i)?!1:(this.editor=c,this.inlineScreenReader.setScreenReaderContent(o),o=o.slice(i.length),o===""?c.removeGhostText():c.setGhostText(o),!0)},r.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},r.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},r.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null)},r})();l.AceInline=d}),ace.define("ace/autocomplete/util",["require","exports","module"],function(n,l,v){l.parForEach=function(u,d,r){var c=0,e=u.length;e===0&&r();for(var i=0;i<e;i++)d(u[i],function(o,h){c++,c===e&&r(o,h)})};var a=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;l.retrievePrecedingIdentifier=function(u,d,r){r=r||a;for(var c=[],e=d-1;e>=0&&r.test(u[e]);e--)c.push(u[e]);return c.reverse().join("")},l.retrieveFollowingIdentifier=function(u,d,r){r=r||a;for(var c=[],e=d;e<u.length&&r.test(u[e]);e++)c.push(u[e]);return c},l.getCompletionPrefix=function(u){var d=u.getCursorPosition(),r=u.session.getLine(d.row),c;return u.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(i){!c&&i&&(c=this.retrievePrecedingIdentifier(r,d.column,i))}.bind(this))}.bind(this)),c||this.retrievePrecedingIdentifier(r,d.column)},l.triggerAutocomplete=function(u,r){var r=r??u.session.getPrecedingCharacter();return u.completers.some(function(c){if(c.triggerCharacters&&Array.isArray(c.triggerCharacters))return c.triggerCharacters.includes(r)})}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"],function(n,l,v){var a=n("./keyboard/hash_handler").HashHandler,u=n("./autocomplete/popup").AcePopup,d=n("./autocomplete/inline").AceInline,r=n("./autocomplete/popup").getAriaId,c=n("./autocomplete/util"),e=n("./lib/lang"),i=n("./lib/dom"),o=n("./snippets").snippetManager,h=n("./config"),s=n("./lib/event"),p=n("./lib/scroll").preventParentScroll,f=function(E,w){w.completer&&w.completer.destroy()},g=(function(){function E(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new a,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=e.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=e.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=e.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=e.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=e.delayedCall(function(){var w=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!w||this.editor.completers.length===0||(this.completions=new A(E.completionsForLoading),this.openPopup(this.editor,w.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0))}.bind(this),this.stickySelectionDelay)}return Object.defineProperty(E,"completionsForLoading",{get:function(){return[{caption:h.nls("autocomplete.loading","Loading..."),value:""}]},enumerable:!1,configurable:!0}),E.prototype.$init=function(){return this.popup=new u(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(w){this.insertMatch(),w.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupShow.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),s.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup.renderer.on("afterRender",this.$onPopupRender.bind(this)),this.popup},E.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new d,this.inlineRenderer},E.prototype.getPopup=function(){return this.popup||this.$init()},E.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1},E.prototype.$seen=function(w){!this.hasSeen.has(w)&&w&&w.completer&&w.completer.onSeen&&typeof w.completer.onSeen=="function"&&(w.completer.onSeen(this.editor,w),this.hasSeen.add(w))},E.prototype.$onPopupChange=function(w){if(this.inlineRenderer&&this.inlineEnabled){var m=w?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(m),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule()}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null)},E.prototype.$updateGhostText=function(w){var m=this.base.row,S=this.base.column,M=this.editor.getCursorPosition().column,D=this.editor.session.getLine(m).slice(S,M);this.inlineRenderer.show(this.editor,w,D)?this.$seen(w):this.inlineRenderer.hide()},E.prototype.$onPopupRender=function(){var w=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var m=this.popup.getFirstVisibleRow();m<=this.popup.getLastVisibleRow();m++){var S=this.popup.getData(m);S&&(!w||S.hideInlinePreview)&&this.$seen(S)}},E.prototype.$onPopupShow=function(w){this.$onPopupChange(w),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},E.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var w=this.editor.container.parentNode,m=[];w;)m.push(w),w.addEventListener("scroll",this.onLayoutChange,{passive:!0}),w=w.parentNode;this.$elements=m}},E.prototype.unObserveLayoutChanges=function(){var w=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(m){m.removeEventListener("scroll",w.onLayoutChange,{passive:!0})}),this.$elements=null},E.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},E.prototype.$updatePopupPosition=function(){var w=this.editor,m=w.renderer,S=m.layerConfig.lineHeight,M=m.$cursorLayer.getPixelPosition(this.base,!0);M.left-=this.popup.getTextLeftOffset();var D=w.container.getBoundingClientRect();M.top+=D.top-m.layerConfig.offset,M.left+=D.left-w.renderer.scrollLeft,M.left+=m.gutterWidth;var _={top:M.top,left:M.left};m.$ghostText&&m.$ghostTextWidget&&this.base.row===m.$ghostText.position.row&&(_.top+=m.$ghostTextWidget.el.offsetHeight);var F=w.container.getBoundingClientRect().bottom-S,x=F<_.top?{top:F,left:_.left}:_;this.popup.tryShow(x,S,"bottom")||this.popup.tryShow(M,S,"top")||this.popup.show(M,S)},E.prototype.openPopup=function(w,m,S){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var M=this.popup.getRow(),D=this.popup.data[M];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:r(this.popup.getRow()),inline:this.inlineEnabled}),w.keyBinding.addKeyboardHandler(this.keyboardHandler);var _;this.stickySelection&&(_=this.popup.data.indexOf(D)),(!_||_===-1)&&(_=0),this.popup.setRow(this.autoSelect?_:-1),_===M&&D!==this.completions.filtered[_]&&this.$onPopupChange();var F=this.inlineRenderer&&this.inlineEnabled;if(_===M&&F){var x=this.popup.getData(this.popup.getRow());this.$updateGhostText(x)}S||(this.popup.setTheme(w.getTheme()),this.popup.setFontSize(w.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},E.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},E.prototype.changeListener=function(w){var m=this.editor.selection.lead;(m.row!=this.base.row||m.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},E.prototype.blurListener=function(w){var m=document.activeElement,S=this.editor.textInput.getElement(),M=w.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(w.relatedTarget),D=this.popup&&this.popup.container;m!=S&&m.parentNode!=D&&!M&&m!=this.tooltipNode&&w.relatedTarget!=S&&this.detach()},E.prototype.mousedownListener=function(w){this.detach()},E.prototype.mousewheelListener=function(w){this.popup&&!this.popup.isMouseOver&&this.detach()},E.prototype.mouseOutListener=function(w){this.popup.isOpen&&this.$updatePopupPosition()},E.prototype.goTo=function(w){this.popup.goTo(w)},E.prototype.insertMatch=function(w,m){if(w||(w=this.popup.getData(this.popup.getRow())),!w)return!1;if(w.value==="")return this.detach();var S=this.completions,M=this.getCompletionProvider().insertMatch(this.editor,w,S.filterText,m);return this.completions==S&&this.detach(),M},E.prototype.showPopup=function(w,m){this.editor&&this.detach(),this.activated=!0,this.editor=w,w.completer!=this&&(w.completer&&w.completer.detach(),w.completer=this),w.on("changeSelection",this.changeListener),w.on("blur",this.blurListener),w.on("mousedown",this.mousedownListener),w.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,m)},E.prototype.getCompletionProvider=function(w){return this.completionProvider||(this.completionProvider=new y(w)),this.completionProvider},E.prototype.gatherCompletions=function(w,m){return this.getCompletionProvider().gatherCompletions(w,m)},E.prototype.updateCompletions=function(w,m){if(w&&this.base&&this.completions){var M=this.editor.getCursorPosition(),D=this.editor.session.getTextRange({start:this.base,end:M});if(D==this.completions.filterText)return;if(this.completions.setFilter(D),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==D&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,D,w);return}if(m&&m.matches){var M=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(M.row,M.column),this.base.$insertRight=!0,this.completions=new A(m.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",w)}var S=this.editor.getSession(),M=this.editor.getCursorPosition(),D=c.getCompletionPrefix(this.editor);this.base=S.doc.createAnchor(M.row,M.column-D.length),this.base.$insertRight=!0;var _={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:D,pos:M}).provideCompletions(this.editor,_,function(F,x,$){var C=x.filtered,b=c.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),$){if(!C.length){var T=!this.autoShown&&this.emptyMessage;if(typeof T=="function"&&(T=this.emptyMessage(b)),T){var I=[{caption:T,value:""}];this.completions=new A(I),this.openPopup(this.editor,b,w),this.popup.renderer.setStyle("ace_loading",!1),this.popup.renderer.setStyle("ace_empty-message",!0);return}return this.detach()}if(C.length==1&&C[0].value==b&&!C[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&C.length==1)return this.insertMatch(C[0])}this.completions=!$&&this.showLoadingState?new A(E.completionsForLoading.concat(C),x.filterText):x,this.openPopup(this.editor,b,w),this.popup.renderer.setStyle("ace_empty-message",!1),this.popup.renderer.setStyle("ace_loading",!$)}.bind(this)),this.showLoadingState&&!this.autoShown&&(!this.popup||!this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2)},E.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},E.prototype.updateDocTooltip=function(){var w=this.popup,m=this.completions&&this.completions.filtered,S=m&&(m[w.getHoveredRow()]||m[w.getRow()]),M=null;if(!S||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var D=this.editor.completers.length,_=0;_<D;_++){var F=this.editor.completers[_];if(F.getDocTooltip&&S.completerId===F.id){M=F.getDocTooltip(S);break}}if(!M&&typeof S!="string"&&(M=S),typeof M=="string"&&(M={docText:M}),!M||!M.docHTML&&!M.docText)return this.hideDocTooltip();this.showDocTooltip(M)},E.prototype.showDocTooltip=function(w){this.tooltipNode||(this.tooltipNode=i.createElement("div"),this.tooltipNode.style.margin="0",this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.style.overscrollBehavior="contain",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"),this.tooltipNode.addEventListener("wheel",p));var m=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(m.isDark?"ace_dark ":"")+(m.cssClass||"");var S=this.tooltipNode;w.docHTML?S.innerHTML=w.docHTML:w.docText&&(S.textContent=w.docText),S.parentNode||this.popup.container.appendChild(this.tooltipNode);var M=this.popup,D=M.container.getBoundingClientRect(),_=400,F=300,x=M.renderer.scrollBar.width||10,$=D.left,C=window.innerWidth-D.right-x,b=M.isTopdown?D.top:window.innerHeight-x-D.bottom,T=[Math.min(C/_,1),Math.min($/_,1),Math.min(b/F*.9)],I=Math.max.apply(Math,T),O=S.style;O.display="block",I==T[0]?(O.left=D.right+1+"px",O.right="",O.maxWidth=_*I+"px",O.top=D.top+"px",O.bottom="",O.maxHeight=Math.min(window.innerHeight-x-D.top,F)+"px"):I==T[1]?(O.right=window.innerWidth-D.left+"px",O.left="",O.maxWidth=_*I+"px",O.top=D.top+"px",O.bottom="",O.maxHeight=Math.min(window.innerHeight-x-D.top,F)+"px"):I==T[2]&&(O.left=window.innerWidth-D.left+"px",O.maxWidth=Math.min(_,window.innerWidth)+"px",M.isTopdown?(O.top=D.bottom+"px",O.left=D.left+"px",O.right="",O.bottom="",O.maxHeight=Math.min(window.innerHeight-x-D.bottom,F)+"px"):(O.top=M.container.offsetTop-S.offsetHeight+"px",O.left=D.left+"px",O.right="",O.bottom="",O.maxHeight=Math.min(M.container.offsetTop,F)+"px"))},E.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var w=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==w&&this.editor.focus(),this.tooltipNode=null,w.parentNode&&w.parentNode.removeChild(w)}},E.prototype.onTooltipClick=function(w){for(var m=w.target;m&&m!=this.tooltipNode;){if(m.nodeName=="A"&&m.href){m.rel="noreferrer",m.target="_blank";break}m=m.parentNode}},E.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var w=this.popup.container;w&&w.parentNode&&w.parentNode.removeChild(w)}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",f),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},E.for=function(w){return w.completer instanceof E||(w.completer&&(w.completer.destroy(),w.completer=null),h.get("sharedPopups")?(E.$sharedInstance||(E.$sharedInstance=new E),w.completer=E.$sharedInstance):(w.completer=new E,w.once("destroy",f))),w.completer},E})();g.prototype.commands={Up:function(E){E.completer.goTo("up")},Down:function(E){E.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(E){E.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(E){E.completer.goTo("end")},Esc:function(E){E.completer.detach()},Return:function(E){return E.completer.insertMatch()},"Shift-Return":function(E){E.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(E){var w=E.completer.insertMatch();if(w||E.tabstopManager)return w;E.completer.goTo("down")},Backspace:function(E){E.execCommand("backspace");var w=c.getCompletionPrefix(E);!w&&E.completer&&E.completer.detach()},PageUp:function(E){E.completer.popup.gotoPageUp()},PageDown:function(E){E.completer.popup.gotoPageDown()}},g.startCommand={name:"startAutocomplete",exec:function(E,w){var m=g.for(E);m.autoInsert=!1,m.autoSelect=!0,m.autoShown=!1,m.showPopup(E,w),m.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var y=(function(){function E(w){this.initialPosition=w,this.active=!0}return E.prototype.insertByIndex=function(w,m,S){return!this.completions||!this.completions.filtered?!1:this.insertMatch(w,this.completions.filtered[m],S)},E.prototype.insertMatch=function(w,m,S){if(!m)return!1;if(w.startOperation({command:{name:"insertMatch"}}),m.completer&&m.completer.insertMatch)m.completer.insertMatch(w,m);else{if(!this.completions)return!1;var M=this.completions.filterText.length,D=0;if(m.range&&m.range.start.row===m.range.end.row&&(M-=this.initialPosition.prefix.length,M+=this.initialPosition.pos.column-m.range.start.column,D+=m.range.end.column-this.initialPosition.pos.column),M||D){var _;w.selection.getAllRanges?_=w.selection.getAllRanges():_=[w.getSelectionRange()];for(var F=0,x;x=_[F];F++)x.start.column-=M,x.end.column+=D,w.session.remove(x)}m.snippet?o.insertSnippet(w,m.snippet):this.$insertString(w,m),m.completer&&m.completer.onInsert&&typeof m.completer.onInsert=="function"&&m.completer.onInsert(w,m),m.command&&m.command==="startAutocomplete"&&w.execCommand(m.command)}return w.endOperation(),!0},E.prototype.$insertString=function(w,m){var S=m.value||m;w.execCommand("insertstring",S)},E.prototype.gatherCompletions=function(w,m){var S=w.getSession(),M=w.getCursorPosition(),D=c.getCompletionPrefix(w),_=[];this.completers=w.completers;var F=w.completers.length;return w.completers.forEach(function(x,$){x.getCompletions(w,S,M,D,function(C,b){x.hideInlinePreview&&(b=b.map(function(T){return Object.assign(T,{hideInlinePreview:x.hideInlinePreview})})),!C&&b&&(_=_.concat(b)),m(null,{prefix:c.getCompletionPrefix(w),matches:_,finished:--F===0})})}),!0},E.prototype.provideCompletions=function(w,m,S){var M=function(x){var $=x.prefix,C=x.matches;this.completions=new A(C),m.exactMatch&&(this.completions.exactMatch=!0),m.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter($),(x.finished||this.completions.filtered.length)&&S(null,this.completions,x.finished)}.bind(this),D=!0,_=null;if(this.gatherCompletions(w,function(x,$){if(this.active){x&&(S(x,[],!0),this.detach());var C=$.prefix;if(C.indexOf($.prefix)===0){if(D){_=$;return}M($)}}}.bind(this)),D=!1,_){var F=_;_=null,M(F)}},E.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(w){typeof w.cancel=="function"&&w.cancel()})},E})(),A=(function(){function E(w,m){this.all=w,this.filtered=w,this.filterText=m||"",this.exactMatch=!1,this.ignoreCaption=!1}return E.prototype.setFilter=function(w){if(w.length>this.filterText&&w.lastIndexOf(this.filterText,0)===0)var m=this.filtered;else var m=this.all;this.filterText=w,m=this.filterCompletions(m,this.filterText),m=m.sort(function(M,D){return D.exactMatch-M.exactMatch||D.$score-M.$score||(M.caption||M.value).localeCompare(D.caption||D.value)});var S=null;m=m.filter(function(M){var D=M.snippet||M.caption||M.value;return D===S?!1:(S=D,!0)}),this.filtered=m},E.prototype.filterCompletions=function(w,m){var S=[],M=m.toUpperCase(),D=m.toLowerCase();e:for(var _=0,F;F=w[_];_++){if(F.skipFilter){F.$score=F.score,S.push(F);continue}var x=!this.ignoreCaption&&F.caption||F.value||F.snippet;if(x){var $=-1,C=0,b=0,T,I;if(this.exactMatch){if(m!==x.substr(0,m.length))continue e}else{var O=x.toLowerCase().indexOf(D);if(O>-1)b=O;else for(var N=0;N<m.length;N++){var P=x.indexOf(D[N],$+1),B=x.indexOf(M[N],$+1);if(T=P>=0&&(B<0||P<B)?P:B,T<0)continue e;I=T-$-1,I>0&&($===-1&&(b+=10),b+=I,C|=1<<N),$=T}}F.matchMask=C,F.exactMatch=b?0:1,F.$score=(F.score||0)-b,S.push(F)}}return S},E})();l.Autocomplete=g,l.CompletionProvider=y,l.FilteredList=A}),ace.define("ace/marker_group",["require","exports","module"],function(n,l,v){var a=(function(){function u(d,r){r&&(this.markerType=r.markerType),this.markers=[],this.session=d,d.addDynamicMarker(this)}return u.prototype.getMarkerAtPosition=function(d){return this.markers.find(function(r){return r.range.contains(d.row,d.column)})},u.prototype.markersComparator=function(d,r){return d.range.start.row-r.range.start.row},u.prototype.setMarkers=function(d){this.markers=d.sort(this.markersComparator).slice(0,this.MAX_MARKERS),this.session._signal("changeBackMarker")},u.prototype.update=function(d,r,c,e){if(!(!this.markers||!this.markers.length))for(var i=e.firstRow,o=e.lastRow,h,s=0,p=0,f=0;f<this.markers.length;f++){var g=this.markers[f];if(!(g.range.end.row<i)&&!(g.range.start.row>o)&&(g.range.start.row===p?s++:(p=g.range.start.row,s=0),!(s>200))){var y=g.range.clipRows(i,o);if(!(y.start.row===y.end.row&&y.start.column===y.end.column)){var A=y.toScreenRange(c);if(A.isEmpty()){h=c.getNextFoldLine(y.end.row,h),h&&h.end.row>y.end.row&&(i=h.end.row);continue}this.markerType==="fullLine"?r.drawFullLineMarker(d,A,g.className,e):A.isMultiLine()?this.markerType==="line"?r.drawMultiLineMarker(d,A,g.className,e):r.drawTextMarker(d,A,g.className,e):r.drawSingleLineMarker(d,A,g.className+" ace_br15",e)}}}},u})();a.prototype.MAX_MARKERS=1e4,l.MarkerGroup=a}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(n,l,v){function a(c,e){var i=c.getTextRange(d.fromPoints({row:0,column:0},e));return i.split(r).length-1}function u(c,e){var i=a(c,e),o=c.getValue().split(r),h=Object.create(null),s=o[i];return o.forEach(function(p,f){if(!(!p||p===s)){var g=Math.abs(i-f),y=o.length-g;h[p]?h[p]=Math.max(y,h[p]):h[p]=y}}),h}var d=n("../range").Range,r=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;l.getCompletions=function(c,e,i,o,h){var s=u(e,i),p=Object.keys(s);h(null,p.map(function(f){return{caption:f,value:f,score:s[f],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/marker_group","ace/autocomplete/text_completer","ace/editor","ace/config"],function(n,l,v){var a=n("../snippets").snippetManager,u=n("../autocomplete").Autocomplete,d=n("../config"),r=n("../lib/lang"),c=n("../autocomplete/util"),e=n("../marker_group").MarkerGroup,i=n("../autocomplete/text_completer"),o={getCompletions:function(D,_,F,x,$){if(_.$mode.completer)return _.$mode.completer.getCompletions(D,_,F,x,$);var C=D.session.getState(F.row),b=_.$mode.getCompletions(C,_,F,x);b=b.map(function(T){return T.completerId=o.id,T}),$(null,b)},id:"keywordCompleter"},h=function(D){var _={};return D.replace(/\${(\d+)(:(.*?))?}/g,function(F,x,$,C){return _[x]=C||""}).replace(/\$(\d+?)/g,function(F,x){return _[x]})},s={getCompletions:function(D,_,F,x,$){var C=[],b=_.getTokenAt(F.row,F.column);b&&b.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?C.push("html-tag"):C=a.getActiveScopes(D);var T=a.snippetMap,I=[];C.forEach(function(O){for(var N=T[O]||[],P=N.length;P--;){var B=N[P],V=B.name||B.tabTrigger;V&&I.push({caption:V,snippet:B.content,meta:B.tabTrigger&&!B.name?B.tabTrigger+"⇥ ":"snippet",completerId:s.id})}},this),$(null,I)},getDocTooltip:function(D){D.snippet&&!D.docHTML&&(D.docHTML=["<b>",r.escapeHTML(D.caption),"</b>","<hr></hr>",r.escapeHTML(h(D.snippet))].join(""))},id:"snippetCompleter"},p=[s,i,o];l.setCompleters=function(D){p.length=0,D&&p.push.apply(p,D)},l.addCompleter=function(D){p.push(D)},l.textCompleter=i,l.keyWordCompleter=o,l.snippetCompleter=s;var f={name:"expandSnippet",exec:function(D){return a.expandWithTab(D)},bindKey:"Tab"},g=function(D,_){y(_.session.$mode)},y=function(D){typeof D=="string"&&(D=d.$modes[D]),D&&(a.files||(a.files={}),A(D.$id,D.snippetFileId),D.modes&&D.modes.forEach(y))},A=function(D,_){!_||!D||a.files[D]||(a.files[D]={},d.loadModule(_,function(F){F&&(a.files[D]=F,!F.snippets&&F.snippetText&&(F.snippets=a.parseSnippetFile(F.snippetText)),a.register(F.snippets||[],F.scope),F.includeScopes&&(a.snippetMap[F.scope].includeScopes=F.includeScopes,F.includeScopes.forEach(function(x){y("ace/mode/"+x)})))}))},E=function(D){var _=D.editor,F=_.completer&&_.completer.activated;if(D.command.name==="backspace")F&&!c.getCompletionPrefix(_)&&_.completer.detach();else if(D.command.name==="insertstring"&&!F){w=D;var x=D.editor.$liveAutocompletionDelay;x?m.delay(x):S(D)}},w,m=r.delayedCall(function(){S(w)},0),S=function(D){var _=D.editor,F=c.getCompletionPrefix(_),x=D.args,$=c.triggerAutocomplete(_,x);if(F&&F.length>=_.$liveAutocompletionThreshold||$){var C=u.for(_);C.autoShown=!0,C.showPopup(_)}},M=n("../editor").Editor;n("../config").defineOptions(M.prototype,"editor",{enableBasicAutocompletion:{set:function(D){D?(u.for(this),this.completers||(this.completers=Array.isArray(D)?D:p),this.commands.addCommand(u.startCommand)):this.commands.removeCommand(u.startCommand)},value:!1},enableLiveAutocompletion:{set:function(D){D?(this.completers||(this.completers=Array.isArray(D)?D:p),this.commands.on("afterExec",E)):this.commands.off("afterExec",E)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(D){D?(this.commands.addCommand(f),this.on("changeMode",g),g(null,this)):(this.commands.removeCommand(f),this.off("changeMode",g))},value:!1}}),l.MarkerGroup=e}),(function(){ace.require(["ace/ext/language_tools"],function(n){L&&(L.exports=n)})})()})(Ra);const fi={jsonError:{border:"1px solid red",minHeight:200},jsonNoError:{border:"1px solid #00000000",minHeight:200}};function Na(L){return k.createElement(ka,{style:L.error===!0?fi.jsonError:L.error===!1?fi.jsonNoError:void 0,mode:L.mode||"json",width:"100%",height:"100%",showPrintMargin:L.editValueMode,showGutter:L.editValueMode,highlightActiveLine:L.editValueMode,defaultValue:L.defaultValue,theme:L.themeType==="dark"?"clouds_midnight":"chrome",value:L.value,readOnly:!L.onChange,onChange:t=>{var n;return(n=L.onChange)==null?void 0:n.call(L,t)},name:L.name||"UNIQUE_ID_OF_DIV1",fontSize:L.fontSize||14,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:L.editValueMode,tabSize:L.editValueMode?2:void 0},editorProps:{$blockScrolling:!0}})}const bn={flex:{display:"flex"},button:{height:48,minWidth:48},wrapper:{width:"calc(100vw - 40px)",height:"calc(100vh - 188px)"}};class Ba extends K{componentDidMount(){super.componentDidMount();const{data:t,attr:n}=this.props,l=K.getValue(t,n)||"{}";this.setState({value:l,initialized:!0,jsonError:this.validateJson(l)})}validateJson(t){let n=!1;if(this.props.schema.validateJson!==!1&&(t||!this.props.schema.allowEmpty))try{this.props.schema.json5?Li.parse(t):JSON.parse(t)}catch(l){console.log("Error in JSON",l),n=!0}return n}renderItem(t,n){if(!this.state.initialized)return null;const{schema:l,data:v,attr:a}=this.props,{value:u,showSelectId:d}=this.state,r=l.readOnly===!0;return k.createElement(R.FormControl,{fullWidth:!0,variant:"standard"},k.createElement("div",{style:bn.flex},k.createElement(R.Button,{color:"grey",disabled:n,style:bn.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},H.I18n.t("ra_JSON editor"))),d?k.createElement(uo,{title:this.getText(l.label),overflowHidden:!0,applyDisabled:this.state.jsonError&&this.props.schema.doNotApplyWithError||r,onClose:()=>this.setState({showSelectId:!1,value:K.getValue(v,a)||{}}),onApply:r?void 0:()=>this.setState({showSelectId:!1},()=>this.onChange(a,u))},k.createElement("div",{style:{...bn.wrapper,border:this.state.jsonError?"2px solid red":"2px solid transparent"}},k.createElement(Na,{mode:this.props.schema.json5?"json5":"json",value:typeof u=="object"?JSON.stringify(u):u,onChange:r?void 0:c=>this.setState({value:c,jsonError:this.validateJson(c)}),name:"ConfigJsonEditor",themeType:this.props.oContext.themeType}))):null,l.help||this.state.jsonError?k.createElement(R.FormHelperText,null,this.state.jsonError?H.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Pa=[{value:"en",label:"English"},{value:"de",label:"Deutsch"},{value:"ru",label:"русский"},{value:"pt",label:"Portugues"},{value:"nl",label:"Nederlands"},{value:"fr",label:"français"},{value:"it",label:"Italiano"},{value:"es",label:"Espanol"},{value:"pl",label:"Polski"},{value:"uk",label:"Український"},{value:"zh-cn",label:"简体中文"}];class Wa extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr),n=[...Pa];this.props.schema.system?n.unshift({value:"",label:H.I18n.t("ra_System language")}):n.unshift({value:"",label:H.I18n.t("ra_none")}),this.setState({value:this.props.schema.system?t||"":t||H.I18n.getLanguage(),selectOptions:n})}renderItem(t,n){var v,a;if(!this.state.selectOptions)return null;const l=(v=this.state.selectOptions)==null?void 0:v.find(u=>u.value===this.state.value||!u.value&&!this.state.value);return k.createElement(R.FormControl,{fullWidth:!0,variant:"standard"},this.props.schema.label?k.createElement(R.InputLabel,null,this.getText(this.props.schema.label)):null,k.createElement(R.Select,{variant:"standard",error:!!t,disabled:n,value:this.state.value||"_",renderValue:()=>this.getText(l==null?void 0:l.label,this.props.schema.noTranslation),onChange:u=>{let{value:d}=u.target;d==="_"&&(d=""),this.setState({value:d},()=>{const r=this.onChange(this.props.attr,d);if(r instanceof Promise&&r.catch(c=>console.error(c)),this.props.schema.changeGuiLanguage)if(d){if(d===H.I18n.getLanguage())return;H.I18n.setLanguage(d),this.props.oContext.changeLanguage&&this.props.oContext.changeLanguage()}else this.props.oContext.socket.getSystemConfig().then(c=>{c.common.language!==H.I18n.getLanguage()&&c.common.language&&(H.I18n.setLanguage(c.common.language),this.props.oContext.changeLanguage&&this.props.oContext.changeLanguage())}).catch(c=>console.error(`Cannot read system config: ${c}`))})}},(a=this.state.selectOptions)==null?void 0:a.map(u=>k.createElement(R.MenuItem,{key:u.value,value:u.value},u.label))),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class za extends K{scrollRef;constructor(t){super(t),this.scrollRef=k.createRef()}scrolledDown(){return this.scrollRef.current?this.scrollRef.current.offsetHeight+this.scrollRef.current.scrollTop>=this.scrollRef.current.scrollHeight:!1}componentDidMount(){super.componentDidMount(),K.getValue(this.props.data,this.props.attr)||(this.props.schema.licenseUrl?(this.setState({showLicenseDialog:!0,loading:!0,scrolledDown:!1}),fetch(this.props.schema.licenseUrl).then(t=>t.text()).then(t=>this.setState({license:t,loading:!1})).catch(t=>this.setState({license:t.toString(),loading:!1,error:!0,scrolledDown:!1}))):this.setState({showLicenseDialog:!0,scrolledDown:!1}),setTimeout(()=>{this.scrollRef.current&&(this.scrolledDown()?this.setState({scrolledDown:!0}):this.scrollRef.current.addEventListener("scroll",()=>{!this.state.scrolledDown&&this.scrolledDown()&&this.setState({scrolledDown:!0})}))},1e3))}renderItem(t,n){return this.state.showLicenseDialog?k.createElement(R.Dialog,{maxWidth:"lg",open:!0,onClose:(l,v)=>{v!=="escapeKeyDown"&&v!=="backdropClick"&&this.setState({showLicenseDialog:!1})}},k.createElement(R.DialogTitle,null,this.props.schema.title?H.I18n.t(this.props.schema.title):H.I18n.t("ra_License agreement")),k.createElement(R.DialogContent,null,this.props.schema.licenseUrl?k.createElement(k.Fragment,null,this.state.loading?k.createElement(R.LinearProgress,null):null,k.createElement("pre",{ref:this.scrollRef,style:{width:"100%",height:"100%",overflowY:"auto",fontSize:14}},this.state.license)):null,!this.props.schema.licenseUrl&&this.props.schema.texts?k.createElement("div",{ref:this.scrollRef,style:{width:"100%",height:"100%",overflowY:"auto",fontSize:14}},this.props.schema.texts.map((l,v)=>this.props.schema.noTranslation?k.createElement("p",{key:v},l):k.createElement("p",{key:v},H.I18n.t(l)))):null),k.createElement(R.DialogActions,null,this.props.schema.checkBox?k.createElement(R.FormControlLabel,{control:k.createElement(R.Checkbox,{disabled:n,checked:!!this.state.licenseChecked,onClick:()=>this.setState({licenseChecked:!this.state.licenseChecked})}),label:H.I18n.t(this.props.schema.checkBox)}):null,k.createElement(R.Button,{disabled:n||this.state.loading||this.state.error||this.props.schema.checkBox&&!this.state.licenseChecked||!this.state.scrolledDown,onClick:()=>{this.setState({showLicenseDialog:!1});const l=this.onChange(this.props.attr,!0);l instanceof Promise&&l.catch(v=>console.error(`Cannot set value: ${v}`))},color:"primary",variant:"contained",startIcon:k.createElement(X.Check,null)},this.props.schema.agreeText?H.I18n.t(this.props.schema.agreeText):H.I18n.t("ra_Accept license")),k.createElement(R.Button,{onClick:()=>{this.setState({showLicenseDialog:!1}),setTimeout(()=>this.setState({showLicenseDialog:!0}),2e3)},color:"grey",variant:"contained",startIcon:k.createElement(X.Close,null)},H.I18n.t("ra_Close")))):null}}const gi={indeterminate:{opacity:.5},control:{flexDirection:"row",width:"100%"}};class Ha extends K{updateTimeout;componentDidMount(){super.componentDidMount();let t=K.getValue(this.props.data,this.props.attr);if(t==null&&(t=""),Array.isArray(t)&&this.props.oContext.multiEdit){t=K.DIFFERENT_VALUE,this.setState({_value:t,oldValue:t});return}this.setState({_value:t.toString(),oldValue:t.toString()})}static getDerivedStateFromProps(t,n){if(t.schema.min!==void 0&&t.schema.min<0||t.schema.max!==void 0&&t.schema.max<0)return null;const l=K.getValue(t.data,t.attr);return t.oContext.multiEdit&&n._value===K.DIFFERENT_VALUE?{_value:K.DIFFERENT_VALUE}:l==null||n.oldValue===null||n.oldValue===void 0||l.toString()!==parseFloat(n._value).toString()&&l.toString()!==n.oldValue.toString()?{_value:l}:null}checkValue(t){if(t==null||(t=t.toString().trim().replace(",","."),t==="-"))return null;const n=t===""?0:parseFloat(t);return t!==""&&Number.isNaN(n)?"ra_Not a number":t!==""&&window.isFinite(n)?this.props.schema.min!==void 0&&n<this.props.schema.min?"ra_Too small":this.props.schema.max!==void 0&&n>this.props.schema.max?"ra_Too big":t===""||t==="-"||Number.isNaN(n)?"ra_Not a number":null:"ra_Not a number"}renderItem(t,n){var a;const l=Array.isArray(this.state._value)||this.state._value===K.DIFFERENT_VALUE;if(this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=void 0,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=void 0),l){const u=K.getValue(this.props.data,this.props.attr),d=(u==null?void 0:u.filter(r=>r||r===0).map(r=>({label:r.toString(),value:r})))||[];return d.unshift({label:H.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),k.createElement(R.Autocomplete,{style:gi.indeterminate,fullWidth:!0,freeSolo:!0,value:d[0],getOptionSelected:(r,c)=>r.label===c.label,onChange:(r,c)=>{const e=this.onChange(this.props.attr,c==null?void 0:c.value,()=>{this.setState({_value:c==null?void 0:c.value,oldValue:this.state._value})});e instanceof Promise&&e.catch(i=>console.error(i))},options:d,getOptionLabel:r=>r.label,renderInput:r=>k.createElement(R.TextField,{...r,label:this.getText(this.props.schema.label),variant:"standard",slotProps:{htmlInput:{...r.inputProps,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):void 0}},error:!!t,placeholder:this.getText(this.props.schema.placeholder),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:!!n})})}!t&&this.state._value!==null&&this.state._value!==void 0&&this.state._value&&(t=this.checkValue(this.state._value),t&&(t=H.I18n.t(t)));const v=parseFloat(((a=this.state._value)==null?void 0:a.toString().replace(",","."))||"");return k.createElement(R.FormControl,{variant:"standard",style:gi.control},k.createElement(R.TextField,{sx:{"& .up-down":{display:"none"},"&:hover .up-down":{display:"block"}},variant:"standard",type:Number.isNaN(v)?"text":this.props.schema.min!==void 0&&this.props.schema.min>=0?"number":"text",fullWidth:!0,slotProps:{htmlInput:{min:this.props.schema.min,max:this.props.schema.max,step:this.props.schema.step,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):null}},value:this.state._value===null||this.state._value===void 0?"":this.state._value,error:!!t,disabled:!!n,onChange:u=>{const d=u.target.value,r=this.checkValue(d);r?this.onError(this.props.attr,H.I18n.t(r)):this.onError(this.props.attr),this.setState({_value:d,oldValue:this.state._value},()=>{const c=parseFloat(d.toString().replace(",","."));Number.isNaN(c)?this.onChange(this.props.attr,d.toString().replace(",",".")):this.onChange(this.props.attr,c)})},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:t&&typeof t=="string"?t:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}))}}class ja extends K{authWindow;oid;url;constructor(t){super(t),this.state={...this.state,accessTokens:"",success:!1,blocked:!1,running:!1,pressed:!1},this.url=`https://oauth2.iobroker.in/${t.schema.identifier}?redirect=true`,t.schema.scope&&(this.url+=`&scope=${encodeURIComponent(t.schema.scope)}`),this.oid=`${this.props.oContext.adapterName}.${this.props.oContext.instance}.${this.props.schema.saveTokenIn||"oauth2Tokens"}`}async componentDidMount(){super.componentDidMount(),window.addEventListener?window.addEventListener("message",this.onMessage,!1):window.attachEvent("onmessage",this.onMessage,!1),await this.props.oContext.socket.subscribeState(this.oid,this.onTokensUpdated);const t=await this.props.oContext.socket.getState(this.oid);if(t){const n=JSON.parse(t.val);new Date(n.access_token_expires_on).getTime()>Date.now()&&this.setState({accessTokens:t.val})}}onTokensUpdated=(t,n)=>{if(n!=null&&n.val){const l=JSON.parse(n.val);if(new Date(l.access_token_expires_on).getTime()>Date.now()){this.state.accessTokens!==n.val&&this.setState({accessTokens:n.val});return}}this.setState({accessTokens:""})};componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener?window.removeEventListener("message",this.onMessage,!1):window.detachEvent("onmessage",this.onMessage,!1),this.props.oContext.socket.unsubscribeState(this.oid,this.onTokensUpdated)}saveToken(t){try{t&&!t.startsWith("{")&&(t=atob(t));const n=JSON.parse(t);n.access_token&&n.refresh_token&&n.expires_in&&(n.access_token_expires_on||=new Date(Date.now()+n.expires_in*1e3).toISOString(),this.props.oContext.socket.setState(this.oid,JSON.stringify(n),!0).catch(l=>console.log(`Error occurred: ${l.toString()}`)))}catch(n){console.warn(n)}}onMessage=t=>{var n,l,v;if(t.origin==="https://oauth2.iobroker.in"&&(typeof t.data=="string"&&t.data.startsWith(`${this.props.schema.identifier}-authentication:`)||typeof t.message=="string"&&t.message.startsWith(`${this.props.schema.identifier}-authentication:`))){const a=(t.data||t.message).split(":");a[1]==="success"?(this.setState({accessTokens:a[2],success:!0,pressed:!1},()=>this.saveToken(this.state.accessTokens)),(n=this.authWindow)==null||n.postMessage("close",t.origin),this.authWindow=null):(v=(l=this.props).onError)==null||v.call(l,a[2])}};onOpenUrl(){this.authWindow=window.open(this.url,this.props.schema.identifier),!this.authWindow||this.authWindow.closed||typeof this.authWindow.closed>"u"?this.setState({blocked:!0}):this.setState({pressed:!0})}renderItem(){let t="";if(this.state.accessTokens)try{const v=JSON.parse(this.state.accessTokens);t=new Date(v.access_token_expires_on).toLocaleString()}catch{}let n;this.state.accessTokens?n=this.props.schema.refreshLabel?this.getText(this.props.schema.refreshLabel):H.I18n.t("ra_Renew %s access",this.props.schema.identifier[0].toUpperCase()+this.props.schema.identifier.slice(1)):n=this.props.schema.label?this.getText(this.props.schema.label):H.I18n.t("ra_Get %s access",this.props.schema.identifier[0].toUpperCase()+this.props.schema.identifier.slice(1));const l=this.getIcon();return k.createElement("div",{style:{width:"100%",margin:"0 0 1rem 0"}},k.createElement(R.Button,{disabled:this.state.running,endIcon:l||k.createElement(X.CloudUpload,null),variant:"contained",onClick:()=>this.onOpenUrl()},n),this.state.blocked?k.createElement("div",{style:{color:"red",fontSize:16,marginTop:20}},H.I18n.t("ra_Please allow popups in your browser for this page!")):null,this.state.accessTokens?k.createElement("div",{style:{color:"green",fontSize:16,marginTop:20}},this.props.alive?H.I18n.t("ra_Successfully authorized. Token valid till %s and will be automatically renewed.",t):H.I18n.t("ra_Successfully authorized. Token valid till %s but it can expire as the instance is not running.",t)):null,this.state.pressed?k.createElement(k.Fragment,null,k.createElement("div",{style:{width:"100%",margin:"1rem 0 1rem 0"}},k.createElement("span",{style:{marginRight:4}},`${H.I18n.t("ra_If the button above does not work, you can authorize manually this app by visiting this url")}`,":"),k.createElement("br",null),k.createElement("a",{target:this.props.schema.identifier,href:this.url,rel:"noreferrer"},this.url)),k.createElement(R.TextField,{value:this.state.accessTokens,label:H.I18n.t("ra_Enter the code from that page here"),variant:"standard",onChange:v=>{let a=v.target.value;a&&!a.startsWith("{")&&(a=atob(a));try{const u=JSON.parse(a);u.access_token&&(u.access_token_expires_on=new Date(Date.now()+(u.expires_in-10)*1e3).toISOString(),this.setState({accessTokens:JSON.stringify(u)},()=>this.saveToken(this.state.accessTokens)))}catch{}},fullWidth:!0})):null)}}const mi={flex:{display:"flex"},button:{height:48,marginLeft:4,minWidth:48}};class Va extends K{componentDidMount(){super.componentDidMount();const{data:t,attr:n}=this.props,l=K.getValue(t,n)||"";this.setState({value:l,initialized:!0})}renderItem(t,n){if(!this.state.initialized)return null;const l=this.props.oContext.socket,{schema:v,attr:a}=this.props,{value:u,showSelectId:d}=this.state;return k.createElement(R.FormControl,{fullWidth:!0,variant:"standard"},v.label?k.createElement(R.InputLabel,{shrink:!0},this.getText(v.label)):null,k.createElement("div",{style:mi.flex},k.createElement(R.TextField,{variant:"standard",fullWidth:!0,value:u,error:!!t,disabled:n,placeholder:this.getText(v.placeholder),label:this.getText(v.label),helperText:this.renderHelp(v.help,v.helpLink,v.noTranslation),onChange:r=>{const c=r.target.value;this.setState({value:c},()=>this.onChange(a,c))}}),k.createElement(R.Button,{color:"grey",disabled:n,style:mi.button,size:"small",variant:"outlined",onClick:()=>this.setState({showSelectId:!0})},"...")),d?k.createElement(H.DialogSelectID,{imagePrefix:this.props.oContext.imagePrefix===void 0?"../..":this.props.oContext.imagePrefix,dialogName:`admin.${this.props.oContext.adapterName}`,filterFunc:v.filterFunc,themeType:this.props.oContext.themeType,theme:this.props.oContext.theme,types:v.types?Array.isArray(v.types)?v.types:[v.types]:void 0,customFilter:v.customFilter,filters:v.filters,socket:l,selected:u,root:v.root,onClose:()=>this.setState({showSelectId:!1}),onOk:r=>this.setState({showSelectId:!1,value:r},()=>this.onChange(a,r))}):null)}}const wn={fullWidth:{width:"100%",display:"inline-block"},halfWidth1:{width:"calc(50% - 5px)",display:"inline-block",marginRight:8},halfWidth2:{width:"calc(50% - 5px)",display:"inline-block"}},Ut="____ppp____";class Ua extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.setState({_repeat:t?Ut:"",_visible:!1,value:t?Ut:"",_notEqual:!1})}onChangePassword(t,n){t===void 0&&(t=this.state.value),n===void 0&&(n=this.state._repeat);const l=!!this.props.schema.repeat&&n!==t;this.setState({value:t,_repeat:n,_notEqual:l},()=>{if(l)this.onError(this.props.attr,H.I18n.t("ra_Passwords are not equal!"));else{this.onError(this.props.attr);const v=this.onChange(this.props.attr,t);v instanceof Promise&&v.catch(a=>this.onError(this.props.attr,a))}})}renderItem(t,n){if(this.state._notEqual===void 0)return null;const l=k.createElement(R.TextField,{variant:"standard",fullWidth:!0,type:this.state._visible&&this.state.value!==Ut?"text":"password",value:this.state.value,error:!!t||this.state._notEqual,disabled:!!n,onChange:v=>this.onChangePassword(v.target.value),label:this.getText(this.props.schema.label),slotProps:{input:{autoComplete:"new-password",endAdornment:this.state.value&&this.state.value!==Ut&&this.props.schema.visible&&!n&&!this.props.schema.readOnly?k.createElement(R.InputAdornment,{position:"end"},k.createElement(R.IconButton,{size:"large",tabIndex:-1,onClick:v=>{v.preventDefault(),v.stopPropagation(),this.setState({_visible:!this.state._visible})},edge:"end"},this.state._visible?k.createElement(X.VisibilityOff,null):k.createElement(X.Visibility,null))):void 0},htmlInput:{autoComplete:"new-password",form:{autoComplete:"off"},maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1}},helperText:this.state._notEqual?H.I18n.t("ra_Passwords are not equal!"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)});if(this.props.schema.repeat&&!this.props.schema.readOnly){const v=this.state._visible?null:k.createElement(R.TextField,{variant:"standard",fullWidth:!0,type:"password",value:this.state._repeat,error:!!t||this.state._notEqual,disabled:!!n,onChange:a=>this.onChangePassword(void 0,a.target.value),label:`${this.getText(this.props.schema.label)} (${H.I18n.t("ra_repeat")})`,slotProps:{input:{autoComplete:"new-password"},htmlInput:{autoComplete:"new-password",form:{autoComplete:"off"},maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},helperText:this.state._notEqual?H.I18n.t("ra_Passwords are not equal!"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)});return k.createElement("div",{style:wn.fullWidth},k.createElement("div",{style:wn.halfWidth1},l),k.createElement("div",{style:wn.halfWidth2},v))}return l}}class Ga extends K{renderItem(t,n){return k.createElement(R.TextField,{variant:"standard",fullWidth:!0,disabled:!!n,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?k.createElement(R.IconButton,{tabIndex:-1,size:"small",onClick:()=>{H.Utils.copyToClipboard(this.getPattern(this.props.schema.pattern,null,this.props.schema.noTranslation)),window.alert(H.I18n.t("ra_Copied"))}},k.createElement(H.IconCopy,null)):void 0}},value:this.getPattern(this.props.schema.pattern,null,!0),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const Ka={warning:{"& .Mui-error":{color:"orange"}}};class Ja extends K{updateTimeout;async componentDidMount(){super.componentDidMount();let t=K.getValue(this.props.data,this.props.attr);t==null&&(t=""),this.setState({_value:t.toString(),oldValue:t.toString()});const n=await this.props.oContext.socket.getAdapterInstances(),l=`system.adapter.${this.props.oContext.adapterName}.${this.props.oContext.instance}`,v=await this.props.oContext.socket.getObject(l),a=v==null?void 0:v.common.host,u=[];n.forEach(d=>{var c,e,i,o;if(!d||d._id===l||d.common.host!==a||!((c=d.native)!=null&&c.bind))return;if(d!=null&&d.native&&d.native.secure&&d.native.leEnabled&&d.native.leUpdate){const h=parseInt(d.native.leCheckPort||d.native.lePort,10);h&&u.push({name:`${d._id.replace("system.adapter.","")} (LE)`,port:h,v6bind:d.native.bind.includes(":")?d.native.bind:d.native.v6bind,bind:d.native.bind,enabled:!!((e=d.common)!=null&&e.enabled)})}const r=parseInt((i=d==null?void 0:d.native)==null?void 0:i.port,10);r&&u.push({name:d._id.replace("system.adapter.",""),bind:d.native.bind,v6bind:d.native.bind.includes(":")?d.native.bind:d.native.v6bind,port:r,enabled:!!((o=d.common)!=null&&o.enabled)})}),this.setState({ports:u})}static getDerivedStateFromProps(t,n){const l=K.getValue(t.data,t.attr);return l==null||n.oldValue===null||n.oldValue===void 0||l.toString()!==parseInt(n._value,10).toString()&&l.toString()!==n.oldValue.toString()?{_value:l}:null}checkValue(t){if(t==null)return null;const n=this.props.schema.min===void 0?20:this.props.schema.min,l=this.props.schema.max||65535;t=t.toString().trim();const v=t===""?0:parseInt(t,10);return t!==""&&Number.isNaN(v)?"ra_Not a number":t!==""&&window.isFinite(Number(t))?v<n?"ra_Too small":v>l?"ra_Too big":t===""||t==="-"||Number.isNaN(v)?"ra_Not a number":null:"ra_Not a number"}renderItem(t,n){this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=void 0,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=void 0);const l=this.props.schema.min===void 0?20:this.props.schema.min,v=this.props.schema.max||65535;let a;if(this.state.ports){const u=parseInt(this.state._value,10);if(u){const d=this.props.data.bind,r=this.state.ports.filter(e=>{if(e.port!==u)return!1;const i=e.bind,o=e.v6bind;return!d||!i||d==="0.0.0.0"||i==="0.0.0.0"||d==="::"||o==="::"||d===i||d===o});let c=r.findIndex(e=>e.port===u&&e.enabled);if(c!==-1){const e=this.state.ports.find(i=>i.port===u&&i.enabled&&r.some(o=>o.name===i.name&&o.bind===i.bind));t=H.I18n.t("ra_Port is already used by %s",(e==null?void 0:e.name)||r[c].name)}else if(c=r.findIndex(e=>e.port===u&&!e.enabled),c!==-1){a=!0;const e=this.state.ports.find(i=>i.port===u&&!i.enabled&&r.some(o=>o.name===i.name&&o.bind===i.bind));t=H.I18n.t("ra_Port could be used by %s",(e==null?void 0:e.name)||r[c].name)}}}return!t&&this.state._value!==null&&this.state._value!==void 0&&(t=this.checkValue(this.state._value),typeof t=="string"&&(t=H.I18n.t(t))),k.createElement(R.TextField,{variant:"standard",type:"number",fullWidth:!0,slotProps:{htmlInput:{min:l,max:v,readOnly:this.props.schema.readOnly||!1}},value:this.state._value===null||this.state._value===void 0?"":this.state._value,error:!!t,disabled:!!n,sx:a?Ka.warning:void 0,onChange:u=>{const d=Number(u.target.value.toString().replace(/[^0-9]/g,"")).toString(),r=this.checkValue(d);r?this.onError(this.props.attr,H.I18n.t(r)):this.onError(this.props.attr),this.setState({_value:d,oldValue:this.state._value},()=>{if(d.trim()===parseInt(d,10).toString()){const c=this.onChange(this.props.attr,parseInt(d,10)||0);c instanceof Promise&&c.catch(e=>{console.error(`Cannot set value for ${this.props.attr}: ${e}`)})}})},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:t&&typeof t=="string"?t:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}class Ya extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums("rooms").then(n=>{const l=Object.keys(n).map(v=>({value:this.props.schema.short?v.replace("enum.rooms.",""):v,label:this.getText(n[v].common.name),obj:n[v]}));this.props.schema.allowDeactivate!==!1&&l.unshift({label:H.I18n.t(K.NONE_LABEL),value:K.NONE_VALUE}),this.setState({value:t,selectOptions:l})}).catch(n=>console.error(`Cannot get enums: ${n}`))}renderItem(t,n){if(!this.state.selectOptions)return null;const l=this.state.selectOptions.find(v=>v.value===this.state.value);return k.createElement(R.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?k.createElement(R.InputLabel,null,this.getText(this.props.schema.label)):null,k.createElement(R.Select,{variant:"standard",error:!!t,disabled:!!n,value:this.state.value||"_",renderValue:()=>l?l.obj?k.createElement(H.TextWithIcon,{value:l.obj,themeType:this.props.oContext.themeType,lang:H.I18n.getLanguage()}):l.label:"",onChange:v=>{this.setState({value:v.target.value==="_"?"":v.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(v=>k.createElement(R.MenuItem,{key:v.value,value:v.value,style:v.value===K.DIFFERENT_VALUE?{opacity:.5}:{}},v.obj?k.createElement(H.TextWithIcon,{value:v.obj,themeType:this.props.oContext.themeType,lang:H.I18n.getLanguage()}):v.label))),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Qa={noMargin:{"&>div":{marginTop:0}}};class Xa extends K{initialValue="";componentDidMount(){super.componentDidMount();let t=K.getValue(this.props.data,this.props.attr);this.props.schema.multiple&&(typeof t=="string"?t=[t]:t==null&&(t=[]));const n=[];(this.props.schema.options||[]).forEach(l=>{const v=l;Array.isArray(v.items)?(n.push({label:this.getText(l.label,this.props.schema.noTranslation),value:l.value,group:!0,color:l.color}),v.items.forEach(a=>n.push({label:this.getText(a.label,this.props.schema.noTranslation),value:a.value,hidden:a.hidden,color:l.color}))):n.push({label:this.getText(l.label,this.props.schema.noTranslation),value:l.value,hidden:l.hidden,color:l.color})}),Array.isArray(t)&&!this.props.schema.multiple?(this.initialValue=[...t],n.unshift({label:H.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),this.setState({value:K.DIFFERENT_VALUE,selectOptions:n})):this.setState({value:t,selectOptions:n})}_getValue(){let t=this.state.value===null||this.state.value===void 0?K.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof t=="string"?t=[t]:t==null&&(t=[])),t}renderItem(t,n){if(!this.state.selectOptions)return null;const l=(this.state.selectOptions||[]).filter(u=>u.hidden?this.props.custom?!this.executeCustom(u.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!this.execute(u.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!0),v=this._getValue(),a=this.props.schema.multiple?null:l.find(u=>u.value==v);return k.createElement(R.FormControl,{variant:"standard",fullWidth:!0,sx:this.props.table!==void 0&&Qa.noMargin,id:`jsonSelect_${this.props.attr}_${this.props.index||this.props.index===0?this.props.index:""}`},this.props.schema.label?k.createElement(R.InputLabel,null,this.getText(this.props.schema.label)):null,k.createElement(R.Select,{variant:"standard",error:!!t,multiple:this.props.schema.multiple,disabled:!!n,value:v||"_",renderValue:u=>this.props.schema.multiple?k.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:.5}},u.map(d=>{const r=l.find(c=>c.value===d);if(r||this.props.schema.showAllValues!==!1){const c=(r==null?void 0:r.label)||d;return k.createElement(R.Chip,{key:d,label:c})}return null})):a!=null&&a.color?k.createElement("div",{style:{color:a.color}},(a==null?void 0:a.label)===void 0?u:a.label):(a==null?void 0:a.label)===void 0?u:a.label,onChange:u=>{this.setState({value:u.target.value==="_"?"":u.target.value},()=>{let d;this.state.value===K.DIFFERENT_VALUE?d=this.onChange(this.props.attr,this.initialValue):d=this.onChange(this.props.attr,this.state.value),d instanceof Promise&&d.catch(r=>console.error(r))})}},l.map((u,d)=>u.group?k.createElement(R.ListSubheader,{key:d,style:{color:u.color}},u.label):k.createElement(R.MenuItem,{key:d,value:u.value,style:u.value===K.DIFFERENT_VALUE?{opacity:.5}:{}},this.props.schema.multiple?k.createElement(R.Checkbox,{checked:v.includes(u.value),onClick:()=>{const r=JSON.parse(JSON.stringify(this._getValue())),c=v.indexOf(u.value);c!==-1?r.splice(c,1):(r.push(u.value),r.sort()),this.setState({value:r},()=>this.onChange(this.props.attr,r))}}):null,k.createElement(R.ListItemText,{primary:u.label,style:{color:u.color}})))),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const Za={menuPaper:{maxHeight:800}};class qa extends K{initialized=!1;localContext;askInstance(){if(this.props.alive){let t=this.props.schema.data;if(t===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);try{t=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${n}`)}}t===void 0&&(t=null),this.setState({running:!0},()=>{this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",t).then(n=>this.setState({list:n,running:!1})).catch(n=>{console.error(`Cannot send command: ${n}`)})})}else{const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t,running:!1})}}getContext(){const t={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>t[n]=K.getValue(this.props.data,n)),JSON.stringify(t)}_getValue(){let t=this.state.value===null||this.state.value===void 0?K.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof t=="string"?t=[t]:t==null&&(t=[])),t}renderItem(t,n){if(this.props.alive){const u=this.getContext();(u!==this.localContext||!this.initialized)&&(this.localContext=u,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}const l=this._getValue();if(!this.props.alive||!this.state.running&&!Array.isArray(this.state.list))return this.props.schema.multiple||this.props.schema.manual===!1?H.I18n.t("ra_Cannot retrieve options, as instance is offline"):k.createElement(R.TextField,{variant:"standard",fullWidth:!0,value:l,error:!!t,disabled:!!n,onChange:u=>{const d=u.target.value;this.setState({value:d},()=>this.onChange(this.props.attr,(d||"").trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),slotProps:{input:{endAdornment:this.state.value&&!this.props.schema.noClearButton?k.createElement(R.InputAdornment,{position:"end"},k.createElement(R.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({value:""},()=>this.onChange(this.props.attr,""))},k.createElement(X.Close,null))):null}}});if(this.state.running)return k.createElement(R.CircularProgress,{size:"24"});const v=this.state.list.filter(u=>u.hidden?this.props.custom?!this.executeCustom(u.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!this.execute(u.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!0),a=v.find(u=>u.value===l);return k.createElement(R.FormControl,{variant:"standard",fullWidth:!0},this.props.schema.label?k.createElement(R.InputLabel,null,this.getText(this.props.schema.label)):null,k.createElement(R.Select,{variant:"standard",error:!!t,multiple:this.props.schema.multiple,disabled:!!n,sx:{"&.MuiSelect-paper":this.props.schema.multiple?Za.menuPaper:void 0},value:l,renderValue:u=>this.props.schema.multiple?k.createElement(R.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5}},u.map(d=>{const r=v.find(c=>c.value===d);if(r||this.props.schema.showAllValues!==!1){const c=(r==null?void 0:r.label)||d;return k.createElement(R.Chip,{key:d,label:c})}return null})):this.getText((a==null?void 0:a.label)||u,this.props.schema.noTranslation),onChange:u=>{const d=this.onChange(this.props.attr,u.target.value);d instanceof Promise&&d.catch(r=>console.error(`Cannot set value: ${r}`))}},v.map((u,d)=>u.group?k.createElement(R.ListSubheader,{key:d},this.getText(u.label,this.props.schema.noTranslation)):k.createElement(R.MenuItem,{key:d,value:u.value},this.props.schema.multiple?k.createElement(R.Checkbox,{checked:l.includes(u.value),onClick:()=>{const r=JSON.parse(JSON.stringify(this._getValue())),c=l.indexOf(u.value);c!==-1?r.splice(c,1):(r.push(u.value),r.sort()),this.setState({value:r},()=>this.onChange(this.props.attr,r))}}):null,k.createElement(R.ListItemText,{primary:u.label})))),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}const vi={fullWidth:{width:"100%"}};function Qe(L){return L.split(".").reduce((t,n)=>(t<<8)+parseInt(n,10),0)>>>0}function el(L,t){var v,a;const n=(a=(v=L==null?void 0:L.native)==null?void 0:v.hardware)==null?void 0:a.networkInterfaces;if(!n)return null;let l;return Object.keys(n).forEach(u=>n[u].forEach(d=>{d.internal||t.includes(":")&&d.family!=="IPv6"||t.includes(".")&&!t.match(/[^.\d]/)&&d.family!=="IPv4"||(d.family==="IPv4"&&!d.address.startsWith("172")&&(t==="127.0.0.0"||t==="localhost"||t.match(/[^.\d]/))?l=d.address:l||(d.family==="IPv4"&&t.includes(".")&&(Qe(t)&Qe(d.netmask),Qe(d.address)&Qe(d.netmask)),l=d.address))})),l||Object.keys(n).forEach(u=>n[u].forEach(d=>{d.internal||t.includes(":")&&d.family!=="IPv6"||t.includes(".")&&!t.match(/[^.\d]/)&&d.family!=="IPv4"||(d.family==="IPv6"&&(t==="127.0.0.0"||t==="localhost"||t.match(/[^.\d]/))?l=d.address:l||(d.family==="IPv4"&&t.includes(".")&&(Qe(t)&Qe(d.netmask),Qe(d.address)&Qe(d.netmask)),l=d.address))})),l||Object.keys(n).forEach(u=>{n[u].forEach(d=>{d.internal||t.includes(":")&&d.family!=="IPv6"||t.includes(".")&&!t.match(/[^.\d]/)&&d.family!=="IPv4"||(t==="127.0.0.0"||t==="localhost"||t.match(/[^.\d]/),l=d.address)})}),l||Object.keys(n).forEach(u=>{n[u].forEach(d=>{d.internal||(l=d.address)})}),l}class yi extends K{async componentDidMount(){var n;super.componentDidMount();let t=window.location.hostname;if(this.props.schema.openUrl){const l=await this.props.oContext.socket.getCurrentInstance(),v=await this.props.oContext.socket.getObject(`system.adapter.${l}`);if(v){const a=await this.props.oContext.socket.getObject(`system.host.${(n=v==null?void 0:v.common)==null?void 0:n.host}`);if(a){const u=el(a,window.location.hostname);if(u)t=`${u}:${window.location.port}`;else{console.warn(`Cannot find suitable IP in host ${v.common.host} for ${v._id}`);return}}}}await new Promise(l=>{this.setState({_error:"",_message:"",hostname:t},l)}),this.props.schema.onLoaded&&this._onClick()}renderErrorDialog(){return this.state._error?k.createElement(H.DialogError,{text:this.state._error,onClose:()=>this.setState({_error:""})}):null}renderMessageDialog(){return this.state._message?k.createElement(H.DialogMessage,{text:this.state._message,onClose:()=>this.setState({_message:""})}):null}_onClick(){this.props.oContext.onCommandRunning(!0),this.setState({running:!0});const t=`${window.location.protocol}//${window.location.host}${window.location.pathname.replace(/\/index\.html$/,"")}`,n=`${window.location.protocol}//${this.state.hostname.split(":").length>3?`[${this.state.hostname}]`:this.state.hostname}${window.location.pathname.replace(/\/index\.html$/,"")}`;let l=this.props.schema.data;if(l===void 0&&this.props.schema.jsonData){const a=this.getPattern(this.props.schema.jsonData,{_origin:t,_originIp:n,...this.props.data},!0);try{l=JSON.parse(a)}catch{console.error(`Cannot parse json data: ${a}`)}}l===void 0&&(l=null),this.props.schema.openUrl&&!l&&(l={_origin:t,_originIp:n});let v;this.props.schema.timeout&&(v=setTimeout(()=>{this.props.oContext.onCommandRunning(!1),this.setState({_error:H.I18n.t("ra_Request timed out"),running:!1})},parseInt(this.props.schema.timeout,10)||1e4)),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",l).then(async a=>{var u,d,r,c,e;if(v&&(clearTimeout(v),v=void 0),a!=null&&a.error)if(this.props.schema.error&&this.props.schema.error[a.error]){let i=this.getText(this.props.schema.error[a.error]);(u=a.args)==null||u.forEach(o=>i=i.replace("%s",o)),this.setState({_error:i})}else this.setState({_error:a.error?typeof a.error=="string"?H.I18n.t(a.error):JSON.stringify(a.error):H.I18n.t("ra_Error")});else{if(a!=null&&a.command){(r=(d=this.props.oContext).onBackEndCommand)==null||r.call(d,a.command);return}if(a!=null&&a.reloadBrowser&&this.props.schema.reloadBrowser)window.location.reload();else if(a!=null&&a.openUrl&&this.props.schema.openUrl)window.open(a.openUrl,a.window||this.props.schema.window||"_blank");else if(a!=null&&a.result&&((c=this.props.schema.result)!=null&&c[a.result])){let i=this.getText(this.props.schema.result[a.result]);(e=a.args)==null||e.forEach(o=>i=i.replace("%s",o)),window.alert(i)}if(a!=null&&a.native&&this.props.schema.useNative){for(const[i,o]of Object.entries(a.native))await this.onChangeAsync(i,o);setTimeout(()=>this.props.oContext.forceUpdate(Object.keys(a.native),this.props.data),300)}else a!=null&&a.result?window.alert(typeof a.result=="object"?JSON.stringify(a.result):a.result):window.alert(H.I18n.t("ra_Ok"));a!=null&&a.saveConfig&&this.props.onChange(null,null,null,!0)}}).catch(a=>{this.props.schema.error&&this.props.schema.error[a.toString()]?this.setState({_error:this.getText(this.props.schema.error[a.toString()])}):this.setState({_error:H.I18n.t(a.toString())||H.I18n.t("ra_Error")})}).then(()=>{this.props.oContext.onCommandRunning(!1),this.setState({running:!1})})}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const t=this.state.confirmData||this.props.schema.confirm;let n=null;return t.type==="warning"?n=k.createElement(X.Warning,null):t.type==="error"?n=k.createElement(X.Error,null):t.type==="info"&&(n=k.createElement(X.Info,null)),k.createElement(H.DialogConfirm,{title:this.getText(t.title)||H.I18n.t("ra_Please confirm"),text:this.getText(t.text),ok:this.getText(t.ok)||H.I18n.t("ra_Ok"),cancel:this.getText(t.cancel)||H.I18n.t("ra_Cancel"),icon:n||void 0,onClose:l=>this.setState({confirmDialog:!1},()=>l&&this._onClick())})}renderItem(t,n){const l=this.getIcon();return k.createElement("div",{style:vi.fullWidth},k.createElement(R.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...vi.fullWidth,...this.props.schema.controlStyle||void 0},disabled:n||!this.props.alive,startIcon:l,title:this.props.alive?this.getText(this.props.schema.title)||"":H.I18n.t("ra_Instance is not alive"),onClick:()=>{this.props.schema.confirm?this.setState({confirmDialog:!0}):this._onClick()}},this.props.schema.showProcess&&this.state.running?k.createElement(R.CircularProgress,{size:20,style:{marginRight:8}}):null,this.getText(this.props.schema.label,this.props.schema.noTranslation)),this.renderErrorDialog(),this.renderMessageDialog())}}const tl={fullWidth:{width:"100%"}};class nl extends K{async _onClick(){var l,v;let t=this.props.schema.val;if(typeof t=="string"&&t.includes("${")){t=this.getPattern(t,null,!0);const a=await this.props.oContext.socket.getObject(this.props.schema.id);((l=a==null?void 0:a.common)==null?void 0:l.type)==="number"?t=parseFloat(t):((v=a==null?void 0:a.common)==null?void 0:v.type)==="boolean"&&(t=t==="true"||t===!0||t==="1"||t===1)}const n=(this.props.schema.id||"").replace(/%INSTANCE%/g,(this.props.oContext.instance||0).toString());try{await this.props.oContext.socket.setState(n,{val:t,ack:!!this.props.schema.ack}),this.props.schema.okText&&window.alert(this.getText(this.props.schema.okText))}catch(a){this.props.schema.error&&this.props.schema.error[a.toString()]?window.alert(this.getText(this.props.schema.error[a.toString()])):window.alert(H.I18n.t(a.toString())||H.I18n.t("ra_Error"))}}renderDialogConfirm(){if(!this.state.confirmDialog)return null;const t=this.state.confirmData||this.props.schema.confirm;let n=null;return t.type==="warning"?n=k.createElement(X.Warning,null):t.type==="error"?n=k.createElement(X.Error,null):t.type==="info"&&(n=k.createElement(X.Info,null)),k.createElement(H.DialogConfirm,{title:this.getText(t.title)||H.I18n.t("ra_Please confirm"),text:this.getText(t.text),ok:this.getText(t.ok)||H.I18n.t("ra_Ok"),cancel:this.getText(t.cancel)||H.I18n.t("ra_Cancel"),icon:n,onClose:l=>this.setState({confirmDialog:!1},()=>l&&this._onClick())})}renderItem(t,n){const l=this.getIcon();return k.createElement(R.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:tl.fullWidth,disabled:n,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0}):await this._onClick()},startIcon:l||void 0},this.getText(this.props.schema.label,this.props.schema.noTranslation))}}const bi={fullWidth:{width:"100%"},slider:{marginLeft:10,marginRight:10,width:"calc(100% - 20px)"}};class il extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.setState({_value:t})}static getDerivedStateFromProps(t,n){if(t.schema.min!==void 0&&t.schema.min<0||t.schema.max!==void 0&&t.schema.max<0)return null;const l=K.getValue(t.data,t.attr);return l==null||l.toString()!==parseFloat(n._value).toString()?{_value:l}:null}renderItem(t,n){const l=this.props.schema.min||0,v=this.props.schema.max||100,a=this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):"",u=[{value:l,label:l+a},{value:v,label:v+a}];return k.createElement(R.Box,{style:bi.fullWidth},this.props.schema.label?k.createElement(R.Typography,{gutterBottom:!0},this.getText(this.props.schema.label)):null,k.createElement(R.Slider,{style:bi.slider,value:this.state._value,getAriaValueText:d=>d+a,step:this.props.schema.step||(v-l)/100,valueLabelDisplay:"auto",marks:u,min:l,max:v,disabled:!!n,onChange:d=>{const r=d.target.value;this.setState({_value:r},()=>this.onChange(this.props.attr,r))}}),this.props.schema.help?k.createElement(R.Typography,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}function Xe(L,t){return L==="edit"||L==="rename"?k.createElement(X.Edit,{style:t}):L==="delete"?k.createElement(X.Delete,{style:t}):L==="refresh"?k.createElement(X.Refresh,{style:t}):L==="newDevice"||L==="new"||L==="add"?k.createElement(X.Add,{style:t}):L==="discover"||L==="search"?k.createElement(X.Search,{style:t}):L==="unpairDevice"||L==="unpair"?k.createElement(X.LinkOff,{style:t}):L==="pairDevice"||L==="pair"?k.createElement(X.Link,{style:t}):L==="identify"?k.createElement(X.NotListedLocation,{style:t}):L==="play"?k.createElement(X.PlayArrow,{style:t}):L==="stop"?k.createElement(X.Stop,{style:t}):L==="pause"?k.createElement(X.Pause,{style:t}):L==="forward"||L==="next"?k.createElement(X.FastForward,{style:t}):L==="rewind"||L==="previous"?k.createElement(X.FastRewind,{style:t}):L==="lamp"||L==="light"?k.createElement(X.Lightbulb,{style:t}):L==="backlight"?k.createElement(X.Fluorescent,{style:t}):L==="dimmer"?k.createElement(X.WbIncandescent,{style:t}):L==="socket"?k.createElement(X.Power,{style:t}):L==="settings"?k.createElement(X.Settings,{style:t}):L==="users"||L==="group"?k.createElement(X.Group,{style:t}):L==="user"?k.createElement(X.Person,{style:t}):L==="qrcode"?k.createElement(X.QrCode,{style:t}):L==="connection"?k.createElement(X.Wifi,{style:t}):L==="no-connection"?k.createElement(X.WifiOff,{style:t}):L==="visible"?k.createElement(X.Visibility,{style:t}):null}function rl(L,t){return typeof t=="string"?{"@keyframes newStateAnimationOnceColor":{"0%":{color:t},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"newStateAnimationOnceColor 2s ease-in-out"}:{"@keyframes newStateAnimationOnce":{"0%":{color:"#00f900"},"80%":{color:L.palette.mode==="dark"?"#518851":"#008000"},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"newStateAnimationOnce 2s ease-in-out"}}class sl extends K{controlTimeout=null;delayedUpdate={timer:null,value:null};getObjectID(){let t=(this.props.schema.oid||"").toString();return t.includes("${")&&(t=this.getPattern(t,null,!0)),this.props.schema.foreign?t:`${this.props.schema.system?"system.adapter.":""}${this.props.oContext.adapterName}.${this.props.oContext.instance||0}.${t}`}async componentDidMount(){var l,v;super.componentDidMount();const t=await this.props.oContext.socket.getObject(this.getObjectID());if((l=t==null?void 0:t.common)!=null&&l.states&&!this.props.schema.options){if(Array.isArray((v=t==null?void 0:t.common)==null?void 0:v.states)){const a={};t.common.states.forEach((u,d)=>{a[d.toString()]=u}),t.common.states=a}Object.keys(t.common.states).length||(t.common.states=void 0)}const n=this.props.schema.control||this.detectType(t);try{const a=await this.props.oContext.socket.getState(this.getObjectID());this.setState({stateValue:a?a.val:null,controlType:n,obj:t},async()=>{await this.props.oContext.socket.subscribeState(this.getObjectID(),this.onStateChanged)})}catch(a){console.error(`Cannot get state ${this.getObjectID()}: ${a}`),this.setState({controlType:n,obj:t})}}componentWillUnmount(){super.componentWillUnmount(),this.props.oContext.socket.unsubscribeState(this.getObjectID(),this.onStateChanged),this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.controlTimeout&&(clearTimeout(this.controlTimeout),this.controlTimeout=null,this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1).catch(t=>console.error(`Cannot control value: ${t.toString()}`)))}onStateChanged=(t,n)=>{let l=n?n.val:null;this.state.controlType==="button"||this.state.controlType==="switch"?(l=!!l,this.state.stateValue!==l&&this.setState({stateValue:l})):l!==null&&(this.state.controlType==="slider"||this.state.controlType==="number")?(l=parseFloat(l),console.log(`${Date.now()} Received new value: ${l}`),l!==this.state.stateValue?(this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.delayedUpdate.value=l,this.delayedUpdate.timer=setTimeout(()=>{this.setState({stateValue:this.delayedUpdate.value})},500)):this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null)):this.state.stateValue.toString()!==l.toString()&&this.setState({stateValue:l})};detectType(t){if(t||={},t.common||={},t.common.type==="boolean"){if(this.props.schema.controlled!==!1){if(t.common.read===!1||this.props.schema.controlled===!0)return"button";if(t.common.write||this.props.schema.controlled===!0)return"switch"}return"text"}return t.common.type==="number"&&this.props.schema.controlled!==!1?t.common.write||this.props.schema.controlled===!0?t.common.states||this.props.schema.options?"select":t.common.max!==void 0?"slider":"input":"text":t.common.write&&this.props.schema.controlled!==!1?t.common.states||this.props.schema.options?"select":"input":"text"}getNormalizedStates(){let t;return this.props.schema.options?t=this.props.schema.options.map(n=>typeof n=="string"?{value:n,label:this.getText(n,this.props.schema.noTranslation)}:{value:n.value,label:this.getText(n.label,this.props.schema.noTranslation),color:n.color}):this.state.obj.common.states?(t=[],Object.keys(this.state.obj.common.states).forEach(n=>{t.push({value:n,label:this.getText(this.state.obj.common.states[n],this.props.schema.noTranslation)})})):t=[],t}renderItem(t,n){var v,a,u,d,r;if(!this.state.obj)return null;let l;if(this.state.controlType==="select"||!this.state.controlType&&(this.state.obj.common.type==="number"||this.state.obj.common.type==="string")&&this.state.obj.common.write!==!1&&(this.props.schema.options||this.state.obj.common.states)){const c=this.getNormalizedStates(),e=c.find(i=>i.value===this.state.stateValue);l=k.createElement(R.FormControl,{fullWidth:!0},k.createElement(R.InputLabel,null,"$",this.getText(this.props.schema.label)),k.createElement(R.Select,{value:this.state.stateValue,disabled:!!this.props.schema.readOnly||n,onChange:i=>{this.setState({stateValue:i.target.value},()=>{let o=this.state.stateValue;this.state.obj.common.type==="number"&&(o=parseFloat(o.toString().replace(",","."))),this.props.oContext.socket.setState(this.getObjectID(),o,!1)})},renderValue:i=>e!=null&&e.color?k.createElement("div",{style:{color:e.color}},e.label):i},c.map(i=>k.createElement(R.MenuItem,{key:(i.value??"").toString(),value:i.value,style:{color:i.color}},"$",i.label))))}else if(this.state.controlType==="button"||!this.state.controlType&&this.state.obj.common.type==="boolean"&&(this.state.obj.common.write&&this.state.obj.common.read===!1||(v=this.state.obj.common.role)!=null&&v.includes("button"))){let c=null;this.props.schema.falseImage&&(c=Xe(this.props.schema.falseImage));const e=this.getText(this.props.schema.falseText||this.props.schema.label,this.props.schema.noTranslation);!e&&c?l=k.createElement(R.IconButton,{style:this.props.schema.falseTextStyle,disabled:!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async i=>{i&&await this.props.oContext.socket.setState(this.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}}):await this.props.oContext.socket.setState(this.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}},c):l=k.createElement(R.Button,{variant:this.props.schema.variant||"contained",startIcon:c,style:this.props.schema.falseTextStyle,disabled:n||!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async i=>{i&&await this.props.oContext.socket.setState(this.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}}):await this.props.oContext.socket.setState(this.getObjectID(),this.props.schema.buttonValue!==void 0?this.props.schema.buttonValue:!0,!1)}},e||this.getObjectID().split(".").pop())}else if(this.state.controlType==="input"||!this.state.controlType&&this.state.obj.common.write&&this.state.obj.common.type==="string")l=k.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",gap:8,alignItems:"baseline"}},k.createElement(R.TextField,{style:{flex:1},value:this.state.stateValue,variant:"standard",disabled:!!this.props.schema.readOnly||n,slotProps:{input:{endAdornment:this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||void 0},htmlInput:{readOnly:!!this.props.schema.readOnly}},onKeyUp:c=>{this.props.schema.setOnEnterKey&&c.key==="Enter"&&this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1)},onChange:c=>{this.setState({stateValue:c.target.value},()=>{this.props.schema.setOnEnterKey||this.props.schema.showEnterButton||(this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{this.controlTimeout=null;let e=this.state.stateValue;this.state.obj.common.type==="number"&&(e=parseFloat(e.toString().replace(",","."))),await this.props.oContext.socket.setState(this.getObjectID(),e,!1)},this.props.schema.controlDelay||0))})},label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}),this.props.schema.showEnterButton&&!this.props.schema.readOnly&&k.createElement(R.Button,{variant:"outlined",disabled:n,onClick:()=>{this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1)}},this.getText(typeof this.props.schema.showEnterButton=="string"?this.props.schema.showEnterButton:"Set")));else{let c;this.props.schema.size==="normal"?c=16:this.props.schema.size==="large"?c=20:typeof this.props.schema.size=="number"&&(c=this.props.schema.size);let e=this.getText(this.props.schema.label,this.props.schema.noTranslation);const i={display:"flex",alignItems:"center",fontSize:c||"1rem",gap:8};this.props.schema.narrow||(i.width="100%",i.justifyContent="space-between"),e.trim()&&!e.trim().endsWith(":")&&this.props.schema.addColon&&(e=`${e.trim()}:`);let o;this.props.schema.blinkOnUpdate&&(o=rl(this.props.oContext.theme,this.props.schema.blinkOnUpdate));let h;this.props.schema.labelIcon&&(h=k.createElement(H.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let s;if(e&&h?s=k.createElement("div",{style:{whiteSpace:"nowrap"}},h,e):e?s=k.createElement("div",{style:{whiteSpace:"nowrap"}},e):h&&(s=h),this.state.controlType==="switch"||!this.state.controlType&&this.state.obj.common.type==="boolean"&&(this.state.obj.common.write&&this.state.obj.common.read!==!1||(a=this.state.obj.common.role)!=null&&a.includes("switch"))){let p=null;const f=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(p=Xe(this.props.schema.falseImage,f?{marginLeft:8}:void 0));let g=null;const y=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(g=Xe(this.props.schema.trueImage,y?{marginRight:8}:void 0)),l=k.createElement(R.Switch,{checked:!!this.state.stateValue,disabled:!!this.props.schema.readOnly||n,onChange:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async A=>{A&&await this.props.oContext.socket.setState(this.getObjectID(),!this.state.stateValue,!1)}}):await this.props.oContext.socket.setState(this.getObjectID(),!this.state.stateValue,!1)}}),(f||p||y||g)&&(l=k.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:14}},k.createElement("span",{style:this.props.schema.falseTextStyle},f,p),l,k.createElement("span",{style:this.props.schema.trueTextStyle},g,y))),s&&(l=k.createElement("div",{style:i},s,l))}else if(this.state.controlType==="slider"||!this.state.controlType&&this.state.obj.common.type==="number"&&(this.state.obj.common.write&&(this.state.obj.common.max!==void 0||this.state.obj.common.unit==="%")||(u=this.state.obj.common.role)!=null&&u.includes("slider")||(d=this.state.obj.common.role)!=null&&d.includes("dimmer")||(r=this.state.obj.common.role)!=null&&r.includes("blind"))){let p=null;const f=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(p=Xe(this.props.schema.falseImage,f?{marginLeft:8}:void 0));let g=null;const y=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(g=Xe(this.props.schema.trueImage,y?{marginRight:8}:void 0));const A=this.props.schema.min===void 0?this.state.obj.common.min||0:this.props.schema.min,E=this.props.schema.max===void 0?this.state.obj.common.max===void 0?100:this.state.obj.common.max:this.props.schema.max,w=this.props.schema.step===void 0?this.state.obj.common.step||1:this.props.schema.step;l=k.createElement(R.Slider,{style:{width:"100%",flexGrow:1},min:A,max:E,disabled:!!this.props.schema.readOnly||n,step:w,value:this.state.stateValue,valueLabelDisplay:"auto",valueLabelFormat:m=>`${m}${this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||""}`,onChange:(m,S)=>{this.setState({stateValue:S},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{console.log(`${Date.now()} Send new value: ${this.state.stateValue}`),this.controlTimeout=null,await this.props.oContext.socket.setState(this.getObjectID(),this.state.stateValue,!1)},this.props.schema.controlDelay||0)})}}),(f||p||y||g)&&(l=k.createElement("div",{style:{display:"flex",width:"100%",flexGrow:1,alignItems:"center"}},k.createElement("span",{style:{marginRight:16,...this.props.schema.falseTextStyle}},f,p),l,k.createElement("span",{style:{marginLeft:16,...this.props.schema.trueTextStyle}},g,y))),s&&(l=k.createElement("div",{style:i},s,l))}else if(this.state.obj.common.type==="number"&&this.state.obj.common.write&&!this.state.controlType){const p=this.props.schema.min===void 0?this.state.obj.common.min===void 0?void 0:this.state.obj.common.min:this.props.schema.min,f=this.props.schema.max===void 0?this.state.obj.common.max===void 0?void 0:this.state.obj.common.max:this.props.schema.max,g=this.props.schema.step===void 0?this.state.obj.common.step===void 0?void 0:this.state.obj.common.step:this.props.schema.step;l=k.createElement(R.TextField,{variant:"standard",style:{width:"100%"},value:this.state.stateValue,type:"number",disabled:!!this.props.schema.readOnly||n,slotProps:{htmlInput:{min:p,max:f,step:g,readOnly:!!this.props.schema.readOnly},input:{endAdornment:this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||void 0}},onChange:y=>{this.setState({stateValue:y.target.value},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{this.controlTimeout=null;const A=parseFloat(this.state.stateValue);await this.props.oContext.socket.setState(this.getObjectID(),A,!1)},this.props.schema.controlDelay||0)})},label:this.getText(this.props.schema.label,this.props.schema.noTranslation),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}else if(this.state.obj.common.type==="boolean"){let p=null,f,g;this.state.stateValue?(f=this.getText(this.props.schema.trueText,this.props.schema.noTranslation),this.props.schema.trueImage&&(p=Xe(this.props.schema.falseImage,f?{marginRight:8}:void 0)),g=this.props.schema.trueTextStyle):(f=this.getText(this.props.schema.falseText,this.props.schema.noTranslation),this.props.schema.falseImage&&(p=Xe(this.props.schema.falseImage,f?{marginLeft:8}:void 0)),g=this.props.schema.falseTextStyle),g=Object.assign(i,g),l=k.createElement("div",{style:g},s,k.createElement(R.Box,{style:{display:"flex",alignItems:"center",gap:8},sx:o,key:this.props.schema.blinkOnUpdate?f:void 0},p,f||(this.state.stateValue?H.I18n.t("ra_true"):H.I18n.t("ra_false"))))}else{const p=this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit;let f=this.state.stateValue;if(f!=null&&(this.props.schema.options||this.state.obj.common.states)){const E=this.getNormalizedStates().find(w=>w.value===f);E&&(f=E.label)}let g,y;this.state.controlType==="html"?(y=(f||"").toString(),g=k.createElement("span",{dangerouslySetInnerHTML:{__html:f}})):this.state.stateValue===null?(g="null",y=g):this.state.stateValue===void 0?(g="undefined",y=g):(g=f.toString(),y=g),l=k.createElement("div",{style:i},s,k.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:4}},k.createElement(R.Box,{sx:o,key:this.props.schema.blinkOnUpdate?y:void 0},g),p?k.createElement("span",{style:{opacity:.7,fontSize:"smaller"}},p):null))}}return l}}const Cn={fullWidth:L=>({width:"100%",backgroundColor:L.palette.mode==="dark"?"#FFF":"#000",borderStyle:"hidden"}),primary:L=>({backgroundColor:L.palette.primary.main}),secondary:L=>({backgroundColor:L.palette.secondary.main})};class ol extends K{renderItem(){return k.createElement(R.Box,{component:"hr",sx:H.Utils.getStyle(this.props.oContext.theme,Cn.fullWidth,this.props.schema.color==="primary"?Cn.primary:this.props.schema.color==="secondary"?Cn.secondary:{backgroundColor:this.props.schema.color||(this.props.oContext.themeType==="dark"?"#333":"#ddd")},{height:this.props.schema.color?this.props.schema.height||2:this.props.schema.height||1})})}}const al={header:L=>({width:"100%",background:L.palette.primary.main,color:L.palette.primary.contrastText,padding:"4px !important",borderRadius:"3px",marginBlockEnd:0,marginBlockStart:0})};class ll extends K{renderItem(){let t="h5";switch((this.props.schema.size||5).toString()){case"1":t="h1";break;case"2":t="h2";break;case"3":t="h3";break;case"4":t="h4";break;case"5":default:t="h5";break}return k.createElement(R.Box,{component:t,sx:al.header},this.getText(this.props.schema.label||this.props.schema.text,this.props.schema.noTranslation))}}class hl extends K{renderItem(){let t=this.props.schema.src;return t&&!t.startsWith(".")&&!t.startsWith("http")&&!t.startsWith(`adapter/${this.props.oContext.adapterName}/`)&&!t.startsWith(`./adapter/${this.props.oContext.adapterName}/`)&&(t=`adapter/${this.props.oContext.adapterName}/${t}`),k.createElement("img",{src:t,style:{cursor:this.props.schema.href?"pointer":void 0,width:"100%",height:"100%"},onClick:this.props.schema.href?()=>this.props.schema.href&&window.open(this.props.schema.href,"_blank"):null,alt:""})}}function wi(L,t,n){return typeof n=="string"?{"@keyframes newValueAnimationOnceColor":{"0%":{color:t?`${n} !important`:n},"100%":{color:L.palette.mode==="dark"?t?"#fff !important":"#fff":t?"#000 !important":"#000"}},animation:"newValueAnimationOnceColor 2s ease-in-out"}:{"@keyframes newValueAnimationOnce":{"0%":{color:t?"#00f900 !important":"#00f900"},"80%":{color:L.palette.mode==="dark"?t?"#518851 !important":"#518851":t?"#008000 !important":"#008000"},"100%":{color:L.palette.mode==="dark"?t?"#fff !important":"#fff":t?"#000 !important":"#000"}},animation:"newValueAnimationOnce 2s ease-in-out"}}function Ci(L,t){return typeof t=="string"?{"@keyframes blinkAnimationColor":{"0%":{color:t},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"blinkAnimationColor 2s ease-in-out infinite"}:{"@keyframes blinkAnimation":{"0%":{color:"#00f900"},"80%":{color:L.palette.mode==="dark"?"#518851":"#008000"},"100%":{color:L.palette.mode==="dark"?"#fff":"#000"}},animation:"blinkAnimation 2s ease-in-out infinite"}}const yt={label:{fontWeight:"bold",whiteSpace:"nowrap"},valueImage:{maxHeight:"100%"},valueAndUnit:{display:"flex",gap:4,alignItems:"baseline"},value:{},unit:{fontSize:"smaller",opacity:.7}};class cl extends K{renderItem(t){let n=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);this.props.schema.addColon&&typeof n=="string"&&!n.trim().endsWith(":")&&(n=`${n.trim()}:`),n&&(n.includes("<a ")||n.includes("<br")||n.includes("<b>")||n.includes("<i>"))&&(n=H.Utils.renderTextWithA(n));let l;this.props.schema.size==="normal"?l=16:this.props.schema.size==="large"?l=20:typeof this.props.schema.size=="number"&&(l=this.props.schema.size);const v={width:"100%",height:"100%",display:"flex",alignItems:"center",position:"relative",fontSize:l};this.props.schema.narrow?v.gap=8:v.justifyContent="space-between";let a,u;this.props.schema.data&&typeof this.props.schema.data=="object"&&this.props.schema.data.en?u=this.getText(this.props.schema.data):typeof this.props.schema.data=="object"||this.props.schema.data===void 0||this.props.schema.data===null?u=JSON.stringify(this.props.schema.data):typeof this.props.schema.data=="number"?(u=this.props.schema.data.toString(),this.props.oContext.isFloatComma&&(u=u.replace(".",","))):(!this.props.schema.booleanAsCheckbox||typeof this.props.schema.data!="boolean")&&(u=this.props.schema.data.toString());let d=!1;if(this.props.schema.booleanAsCheckbox&&typeof this.props.schema.data=="boolean")a=k.createElement(R.Checkbox,{checked:!!a,disabled:!0,size:this.props.schema.size==="small"?"small":this.props.schema.size==="large"?"large":void 0});else if(u.startsWith("data:image/"))a=k.createElement("div",{style:{...yt.value,...yt.valueImage,...this.props.schema.styleValue||void 0}},k.createElement(H.Icon,{src:u}));else{const i={...yt.value,...this.props.schema.styleValue||void 0};this.props.schema.html?a=k.createElement("div",{style:i,dangerouslySetInnerHTML:{__html:u}}):Array.isArray(this.props.schema.data)?(d=!0,a=k.createElement("div",{style:i},this.props.schema.data.map((o,h)=>k.createElement("div",{key:h},typeof o=="object"||o===null||o===void 0?JSON.stringify(o):o)))):u.includes(`
1391
+ `)?(d=!0,a=k.createElement("div",{style:i},H.Utils.renderTextWithA(u))):a=k.createElement("div",{style:i},u)}if(this.props.schema.blinkOnUpdate&&this.props.schema.blink){const i=wi(this.props.oContext.theme,!0,this.props.schema.blinkOnUpdate),o=Ci(this.props.oContext.theme,this.props.schema.blink);a=k.createElement(R.Box,{key:u,sx:{...i,...o}},a)}else if(this.props.schema.blinkOnUpdate){const i=wi(this.props.oContext.theme,!1,this.props.schema.blinkOnUpdate);a=k.createElement(R.Box,{key:u,sx:i},a)}else if(this.props.schema.blink){const i=Ci(this.props.oContext.theme,this.props.schema.blink);a=k.createElement(R.Box,{sx:i},a)}this.props.schema.unit&&(a=k.createElement("div",{style:yt.valueAndUnit},a,k.createElement("div",{style:{...yt.unit,...this.props.schema.styleUnit||void 0}},this.getText(this.props.schema.unit,this.props.schema.noTranslation))));let r;this.props.schema.labelIcon&&(r=k.createElement(H.Icon,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let c;this.props.schema.copyToClipboard&&(c=k.createElement(X.ContentCopy,{className:"staticCopyButton",style:{position:"absolute",top:"calc(50% - 12px)",right:0,cursor:"pointer"},onClick:()=>{H.Utils.copyToClipboard(u),window.alert(H.I18n.t("ra_Copied"))}}));const e={"& .staticCopyButton":{display:"none"},"& .staticCopyButton:action":{transform:"scale(0.9)"},"&:hover .staticCopyButton":{display:"block"}};return this.props.schema.highlight&&(e["&:hover"]={backgroundColor:this.props.oContext.themeType==="dark"?"#51515180":"#b8b8b880"}),d&&(v.alignItems="top"),k.createElement(R.Box,{component:"div",style:v,sx:e},k.createElement("div",{style:{...yt.label,...this.props.schema.styleLabel||void 0}},r,n),a,c)}}const Ei={fullWidth:{height:"100%",width:"100%"},link:L=>({textDecoration:"underline",color:L.palette.mode==="dark"?"#4dabf5":"#254e72",cursor:"pointer"})};function Si(L,t,n){let l,v="";L?L.toString().startsWith("#")||L.toString().startsWith("/")?(l=t||"_self",v=L):L.startsWith("http://")||L.startsWith("https://")?(l=t||"_blank",v=L):(v=`#tab-instances/config/${n}/${L}`,l=t||"_self"):(v=`#tab-instances/config/${n}`,l=t||"_self"),l==="_self"?setTimeout(a=>{a.startsWith("#")?window.location.hash=a:a.startsWith("/")?v=`${window.location.protocol}:${window.location.host}${v}`:(a.startsWith("http://")||a.startsWith("https://"))&&(window.location.href=a)},100,v):(v.startsWith("#")?v=`${window.location.protocol}:${window.location.host}${window.location.pathname}${v}`:v.startsWith("/")&&(v=`${window.location.protocol}:${window.location.host}${v}`),window.open(v,l))}class Di extends K{renderItem(t,n){if(this.props.schema.button){const v=this.getIcon();return k.createElement(R.Button,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||"grey",style:{...Ei.fullWidth,...this.props.schema.controlStyle||void 0},disabled:n,startIcon:v,onClick:this.props.schema.href?()=>{const a=this.props.schema.href?this.getText(this.props.schema.href,!0):null;a&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:"link",url:a,target:this.props.schema.target,close:this.props.schema.close}):Si(a,this.props.schema.target,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:null},this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation))}let l=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);return l&&(l.includes("<a ")||l.includes("<br")||l.includes("<b>")||l.includes("<i>"))&&(l=H.Utils.renderTextWithA(l)),k.createElement(R.Box,{component:"span",style:{...this.props.schema.controlStyle||void 0},sx:this.props.schema.href?Ei.link:void 0,onClick:this.props.schema.href?()=>{const v=this.props.schema.href?this.getText(this.props.schema.href,!0):null;v&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:"link",url:v,target:this.props.schema.target||"_blank",close:this.props.schema.close}):Si(v,this.props.schema.target||"_blank",`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:null},l)}}const En=1024*1024,he={paper:{width:"100%",marginBottom:16,backgroundColor:"rgba(255, 255, 255, 0.1)"},headerText:{width:"100%"},table:{minWidth:750},label:{display:"flex",justifyContent:"space-between"},title:{flex:"1 1 100%"},rootTool:{paddingLeft:16,paddingRight:8},silver:{opacity:.2},flex:{display:"flex",alignItems:"baseline"},filteredOut:{padding:10,display:"flex",textAlign:"center"},buttonEmpty:{width:34,display:"inline-block"},buttonCell:{whiteSpace:"nowrap"},dropZone:{width:"100%",height:100,position:"relative"},dropZoneEmpty:{},uploadDiv:{position:"relative",width:"100%",minHeight:300,opacity:.9,marginTop:30,cursor:"pointer",outline:"none"},uploadDivDragging:{opacity:1,background:"rgba(128,255,128,0.1)"},uploadCenterDiv:{margin:5,border:"3px dashed grey",borderRadius:5,width:"calc(100% - 10px)",height:"calc(100% - 10px)",minHeight:300,position:"relative",display:"flex"},uploadCenterIcon:{paddingTop:10,width:48,height:48},uploadCenterText:{fontSize:16},uploadCenterTextAndIcon:{textAlign:"center",position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},tooltip:{pointerEvents:"none"}};function ul(L,t,n){t=t||"key";const l=[];return Object.keys(L).forEach(v=>{const a={};a[t]=v,n?(a[n]=L[v],l.push(a)):l.push(Object.assign(a,L[v]))}),l}function xi(L,t,n){t=t||"key";const l={};return L.forEach(v=>{let a=v[t];a==null&&(a=""),delete v[t],n?l[a]=v[n]:l[a]=v}),l}function pl(L,t){let n="";for(let l=0;l<t.length;l++)n+=String.fromCharCode(L[l%L.length].charCodeAt(0)^t.charCodeAt(l));return n}function dl(L,t){let n="";for(let l=0;l<t.length;l++)n+=String.fromCharCode(L[l%L.length].charCodeAt(0)^t.charCodeAt(l));return n}class Ie extends K{filterRefs;typingTimer=null;resizeTimeout=null;secret="Zgfr56gFe87jJOM";refDiv;constructor(t){super(t),this.filterRefs={},this.props.schema.items=this.props.schema.items||[],this.props.schema.items.forEach(n=>{n.filter&&(this.filterRefs[n.attr]=qe.createRef())}),this.refDiv=k.createRef()}async componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr)||[];let n;if(this.props.schema.objKeyName?n=ul(t,this.props.schema.objKeyName,this.props.schema.objValueName):n=t,Array.isArray(n)||(n=[]),this.props.schema.encryptedAttributes){const l=await this.props.oContext.socket.getCompactSystemConfig();this.secret=(l==null?void 0:l.native.secret)||this.secret,t.forEach(v=>{this.props.schema.encryptedAttributes.forEach(a=>{v[a]&&(v[a]=dl(this.secret,v[a]))})})}this.setState({value:n,visibleValue:null,orderBy:"",order:"asc",iteration:0,filterOn:[],width:0,tableErrors:{}},()=>this.validateUniqueProps())}componentWillUnmount(){this.typingTimer&&(clearTimeout(this.typingTimer),this.typingTimer=null),this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),super.componentWillUnmount()}itemTable(t,n,l){var d;const{schema:v}=this.props,a=(d=v.items)==null?void 0:d.find(r=>r.attr===t);if(!a)return null;const u={items:{[t]:a}};return k.createElement(ft,{oContext:this.props.oContext,alive:this.props.alive,arrayIndex:l,changed:this.props.changed,common:this.props.common,expertMode:this.props.expertMode,custom:!0,data:n,globalData:this.props.data,index:l+this.state.iteration,onChange:(r,c)=>{const e=JSON.parse(JSON.stringify(this.state.value));e[l][r]=c,this.setState({value:e},()=>{this.validateUniqueProps(),this.onChangeWrapper(e,!0)})},onError:this.onTableRowError(l),originalData:this.props.originalData,schema:u,table:!0,themeName:this.props.themeName})}validateUniqueProps(){if(!this.props.schema.uniqueColumns)return;let t=null,n=null;for(const l of this.props.schema.uniqueColumns){const v=[];this.state.value.find(u=>{const d=u[l];return v.includes(d)?(t||(t=l,n=d),this.onError(l,"is not unique"),!0):(v.push(d),!1)})||this.onError(l,null)}t?this.setState({errorMessage:H.I18n.t('Non-allowed duplicate entry "%s" in column "%s"',n,t)}):this.setState({errorMessage:""})}onTableRowError=t=>(n,l)=>{const v={...this.state.tableErrors};v[t]||(v[t]={}),l?v[t][n]=l:(delete v[t][n],Object.keys(v[t]).length===0&&delete v[t]),this.setState({tableErrors:v}),this.props.onError(n,l)};static descendingComparator(t,n,l){return n[l]<t[l]?-1:n[l]>t[l]?1:0}static getComparator(t,n){return t==="desc"?(l,v)=>Ie.descendingComparator(l,v,n):(l,v)=>-Ie.descendingComparator(l,v,n)}static getFilterValue(t){var n,l,v;return(v=(l=(n=t==null?void 0:t.current)==null?void 0:n.children[0])==null?void 0:l.children[0])==null?void 0:v.value}static setFilterValue(t,n){return t.current.children[0].children[0].value=n}handleRequestSort=(t,n=!1)=>{const{order:l,orderBy:v}=this.state,u=n?l:v===t&&l==="asc"?"desc":"asc",d=this.stableSort(u,t);JSON.stringify(d)!==JSON.stringify(this.state.value)&&this.setState({value:d,order:u,orderBy:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,d))};stableSort=(t,n)=>{const{value:l}=this.state,v=Ie.getComparator(t,n),a=l.map((u,d)=>({el:u,index:d}));return a.sort((u,d)=>{const r=v(u.el,d.el);return r!==0?r:u.index-d.index}),a.map(u=>u.el)};renderShowHideFilter(t){return t.filter?k.createElement(R.IconButton,{title:H.I18n.t("ra_Show/hide filter input"),size:"small",onClick:()=>{const n=[...this.state.filterOn],l=this.state.filterOn.indexOf(t.attr);l===-1?n.push(t.attr):n.splice(l,1),this.setState({filterOn:n},()=>{l&&Ie.getFilterValue(this.filterRefs[t.attr])&&(Ie.setFilterValue(this.filterRefs[t.attr],""),this.applyFilter())})}},this.state.filterOn.includes(t.attr)?k.createElement(X.FilterAltOff,null):k.createElement(X.FilterAlt,null)):null}renderImportExportButtons(t){return k.createElement(k.Fragment,null,!t.noDelete&&t.import?k.createElement(R.Tooltip,{title:H.I18n.t("ra_Import data from %s file","CSV"),slotProps:{popper:{sx:he.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:()=>this.setState({showImportDialog:!0})},k.createElement(X.UploadFile,null))):null,t.export?k.createElement(R.Tooltip,{title:H.I18n.t("ra_Export data to %s file","CSV"),slotProps:{popper:{sx:he.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:()=>this.onExport()},k.createElement(X.Download,null))):null,t.noDelete?null:k.createElement(R.IconButton,{disabled:!0,size:"small"},k.createElement(X.Delete,null)))}renderAddButton(t){return k.createElement(R.Tooltip,{title:t?H.I18n.t("ra_Cannot add items with set filter"):H.I18n.t("ra_Add row"),slotProps:{popper:{sx:he.tooltip}}},k.createElement("span",null,k.createElement(R.IconButton,{size:"small",color:"primary",disabled:!!t&&!this.props.schema.allowAddByFilter,onClick:this.onAdd},k.createElement(X.Add,null))))}enhancedTableHead(t,n){var u;const{schema:l}=this.props,{order:v,orderBy:a}=this.state;return k.createElement(R.TableHead,null,k.createElement(R.TableRow,null,(u=l.items)==null?void 0:u.map((d,r)=>this.renderOneFilter({schema:l,style:{width:d.width},showAddButton:!r&&!l.noDelete,headCell:d,order:v,orderBy:a,index:r,doAnyFilterSet:n})),!l.noDelete&&k.createElement(R.TableCell,{style:{paddingLeft:20,paddingRight:20,width:t,textAlign:"right"},padding:"checkbox"},this.renderImportExportButtons(l))))}onDelete=t=>()=>{const n=JSON.parse(JSON.stringify(this.state.value));n.splice(t,1);const l={...this.state.tableErrors};l[t]&&(Object.keys(l[t]).forEach(a=>{this.props.onError(a,void 0)}),delete l[t]);const v={};Object.keys(l).forEach(a=>{const u=parseInt(a,10);u>t?v[u-1]=l[u]:v[u]=l[u]}),this.setState({value:n,iteration:this.state.iteration+1e4,tableErrors:v},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))};onExport(){const{schema:t}=this.props,{value:n}=this.state,v=[t.items.map(d=>d.attr).join(";")];n.forEach(d=>{const r=[];t.items.forEach(c=>{d[c.attr]&&typeof d[c.attr]=="string"&&d[c.attr].includes(";")?r.push(`"${d[c.attr]}"`):r.push(d[c.attr]===void 0||d[c.attr]===null?"":d[c.attr])}),v.push(r.join(";"))});const a=document.createElement("a");a.setAttribute("href",`data:text/csv;charset=utf-8,${encodeURIComponent(v.join(`
1392
+ `))}`);const u=new Date;a.setAttribute("download",`${u.getFullYear()}_${(u.getMonth()+1).toString().padStart(2,"0")}_${u.getDate().toString().padStart(2,"0")}_${this.props.oContext.adapterName}.${this.props.oContext.instance}_${this.props.attr}.csv`),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)}onImport(t){var u;const n=t.split(`
1393
+ `).map(d=>d.replace("\r","").trim()),{schema:l}=this.props,v=n.shift().split(";").filter(d=>d&&l.items.find(r=>r.attr===d)),a=[];n.forEach(d=>{const r=d.split(";"),c={};for(let e=0;e<r.length;e++){let i=r[e];if(i.startsWith('"')){for(i=i.substring(1);e<r.length&&!i.endsWith('"');)i+=`;${r[++e]}`;i=i.substring(0,i.length-1)}let o=i;if(i==="true")o=!0;else if(i==="false")o=!1;else if(window.isFinite(i)){const h=this.props.schema.items.find(s=>s.attr===v[e]);h&&h.type==="number"?o=parseFloat(i):o=i}else o=i;c[v[e]]=o}a.push(c)}),a.length?(u=this.state.value)!=null&&u.length?this.setState({showTypeOfImportDialog:a,showImportDialog:!1}):this.setState({value:a,showImportDialog:!1}):window.alert("ra_No data found in file")}onClone=t=>()=>{const n=JSON.parse(JSON.stringify(this.state.value)),l=JSON.parse(JSON.stringify(n[t]));if(typeof this.props.schema.clone=="string"&&typeof l[this.props.schema.clone]=="string"){let v=1,a=l[this.props.schema.clone];const u=a.match(/(\d+)$/);for(u?(a=a.replace(u[0],""),v=parseInt(u[0],10)+1):a+="_";n.find(d=>d[this.props.schema.clone]===a+v.toString());)v++;l[this.props.schema.clone]=`${l[this.props.schema.clone]}_${v}`}n.splice(t,0,l),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))};onChangeWrapper=(t,n)=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout((l,v)=>{this.typingTimer=null;let a;if(this.props.schema.encryptedAttributes){const u=JSON.parse(JSON.stringify(l));if(u.forEach(d=>{this.props.schema.encryptedAttributes.forEach(r=>{d[r]&&(d[r]=pl(this.secret,d[r]))})}),this.props.schema.objKeyName){const d=xi(u,this.props.schema.objKeyName,this.props.schema.objValueName);a=this.onChange(this.props.attr,d)}else a=this.onChange(this.props.attr,u)}else if(this.props.schema.objKeyName){const u=xi(JSON.parse(JSON.stringify(l)),this.props.schema.objKeyName,this.props.schema.objValueName);a=this.onChange(this.props.attr,u)}else a=this.onChange(this.props.attr,l);a instanceof Promise&&a.catch(u=>console.error(`Cannot save: ${u}`)),v&&(this.applyFilter(!1,l),this.handleRequestSort(this.state.orderBy,!0))},300,t,n)};onAdd=()=>{var v;const{schema:t}=this.props,n=JSON.parse(JSON.stringify(this.state.value)),l=(v=t.items)==null?void 0:v.reduce((a,u)=>{let d;return u.defaultFunc?this.props.custom?d=u.defaultFunc?this.executeCustom(u.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,n.length,this.props.data):this.props.schema.default:d=u.defaultFunc?this.execute(u.defaultFunc,this.props.schema.default,this.props.data,n.length,this.props.data):this.props.schema.default:d=u.default===void 0?null:u.default,a[u.attr]=d,a},{});n.push(l),this.setState({value:n},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))};isAnyFilterSet(){return!!Object.keys(this.filterRefs).find(t=>Ie.getFilterValue(this.filterRefs[t]))}applyFilter=(t,n,l)=>{n=n||this.state.value;let v=n.map((a,u)=>u);if(Object.keys(this.filterRefs).forEach(a=>{let u=Ie.getFilterValue(this.filterRefs[a]);!t&&u?(u=u.toLowerCase(),v=v.filter(d=>n[d]&&n[d][a]&&n[d][a].toLowerCase().includes(u))):this.filterRefs[a].current&&Ie.setFilterValue(this.filterRefs[a],"")}),v.length===n.length&&(v=null),v===null&&this.state.visibleValue===null){l&&l();return}JSON.stringify(v)!==JSON.stringify(this.state.visibleValue)?this.setState({visibleValue:v},()=>l&&l()):l&&l()};onMoveUp(t){const n=JSON.parse(JSON.stringify(this.state.value)),l=n[t];n.splice(t,1),n.splice(t-1,0,l),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))}onMoveDown(t){const n=JSON.parse(JSON.stringify(this.state.value)),l=n[t];n.splice(t,1),n.splice(t+1,0,l),this.setState({value:n,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(n)))}onDrop(t){const n=t[0],l=new FileReader;l.onabort=()=>console.log("file reading was aborted"),l.onerror=()=>console.log("file reading has failed"),l.onload=()=>{if(n.size>En){window.alert(H.I18n.t("ra_File is too big. Max %sk allowed. Try use SVG.",Math.round(En/1024)));return}const v=new Uint8Array(l.result).reduce((a,u)=>a+String.fromCharCode(u),"");this.onImport(v)},l.readAsArrayBuffer(n)}showTypeOfImportDialog(){return this.state.showTypeOfImportDialog?k.createElement(R.Dialog,{open:!0,onClose:()=>this.setState({showTypeOfImportDialog:!1}),maxWidth:"md"},k.createElement(R.DialogTitle,null,H.I18n.t("ra_Append or replace?")),k.createElement(R.DialogContent,null,H.I18n.t("ra_Append %s entries or replace existing?",this.state.showTypeOfImportDialog.length)),k.createElement(R.DialogActions,null,k.createElement(R.Button,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>{const t=JSON.parse(JSON.stringify(this.state.value));this.state.showTypeOfImportDialog.forEach(n=>t.push(n)),this.setState({value:t,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))}},H.I18n.t("ra_Append")),k.createElement(R.Button,{variant:"contained",color:"secondary",autoFocus:!0,onClick:()=>{const t=this.state.showTypeOfImportDialog;this.setState({value:t,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,null,()=>this.onChangeWrapper(t)))}},H.I18n.t("ra_Replace")))):null}showImportDialog(){return this.state.showImportDialog?k.createElement(R.Dialog,{open:!0,onClose:()=>this.setState({showImportDialog:!1}),sx:{"& .MuiDialog-paper":{minHeight:500}},maxWidth:"md",fullWidth:!0},k.createElement(R.DialogTitle,null,H.I18n.t("ra_Import from %s","CSV")),k.createElement(R.DialogContent,null,k.createElement(Ti,{multiple:!1,accept:{"text/csv":[".csv"]},maxSize:En,onDragEnter:()=>this.setState({uploadFile:"dragging"}),onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(t,n)=>{this.setState({uploadFile:!1}),t.length?this.onDrop(t):window.alert(n&&n[0]&&n[0].errors&&n[0].errors[0]&&n[0].errors[0].message||H.I18n.t("ra_Cannot upload"))}},({getRootProps:t,getInputProps:n})=>k.createElement("div",{style:{...he.uploadDiv,...this.state.uploadFile==="dragging"?he.uploadDivDragging:void 0,...he.dropZone,...this.state.icon?void 0:he.dropZoneEmpty},...t()},k.createElement("input",{...n()}),k.createElement("div",{style:he.uploadCenterDiv},k.createElement("div",{style:he.uploadCenterTextAndIcon},k.createElement(X.UploadFile,{style:he.uploadCenterIcon}),k.createElement("div",{style:he.uploadCenterText},this.state.uploadFile==="dragging"?H.I18n.t("ra_Drop file here"):H.I18n.t("ra_Place your files here or click here to open the browse dialog"))))))),k.createElement(R.DialogActions,null,k.createElement(R.Button,{variant:"contained",onClick:()=>this.setState({showImportDialog:!1}),color:"primary",startIcon:k.createElement(X.Close,null)},H.I18n.t("Cancel")))):null}renderOneFilter(t){return k.createElement(R.TableCell,{key:`${t.headCell.attr}_${t.index}`,style:t.style,align:"left",sortDirection:t.orderBy===t.headCell.attr?t.order:!1},k.createElement("div",{style:{...he.flex,...t.schema.showFirstAddOnTop?{flexDirection:"column"}:void 0}},t.showAddButton?this.renderAddButton(t.doAnyFilterSet):null,t.headCell.sort&&k.createElement(R.TableSortLabel,{active:!0,style:t.orderBy!==t.headCell.attr?he.silver:void 0,direction:t.orderBy===t.headCell.attr?t.order:"asc",onClick:()=>this.handleRequestSort(t.headCell.attr)}),t.headCell.filter&&this.state.filterOn.includes(t.headCell.attr)?k.createElement(R.TextField,{variant:"standard",ref:this.filterRefs[t.headCell.attr],onChange:()=>this.applyFilter(),title:H.I18n.t("ra_You can filter entries by entering here some text"),slotProps:{input:{endAdornment:Ie.getFilterValue(this.filterRefs[t.headCell.attr])&&k.createElement(R.InputAdornment,{position:"end"},k.createElement(R.IconButton,{size:"small",tabIndex:-1,onClick:()=>{Ie.setFilterValue(this.filterRefs[t.headCell.attr],""),this.applyFilter()}},k.createElement(X.Close,null)))}},fullWidth:!0,placeholder:this.getText(t.headCell.title)}):k.createElement("span",{style:he.headerText},this.getText(t.headCell.title)),this.renderShowHideFilter(t.headCell)))}enhancedFilterCard(){var u;const{schema:t}=this.props,{order:n,orderBy:l}=this.state;let v;this.props.schema.compact&&(v={paddingTop:1,paddingBottom:1});const a=!t.noDelete&&t.import||t.export;return a||t.items.find(d=>d.sort||d.filter)?k.createElement(R.Grid2,{size:{xs:t.xs||12,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0}},k.createElement(R.Card,null,k.createElement(R.Paper,{style:he.paper},k.createElement(R.Accordion,{style:he.paper},k.createElement(R.AccordionSummary,{expandIcon:k.createElement(X.ExpandMore,null)},k.createElement(R.Typography,null,H.I18n.t("ra_Filter and Data Actions"))),k.createElement(R.AccordionDetails,null,k.createElement(R.Table,null,k.createElement(R.TableBody,null,((u=t.items)==null?void 0:u.find(d=>d.sort||d.filter))&&t.items.map((d,r)=>k.createElement(R.TableRow,{key:`${d.attr}_${r}`},this.renderOneFilter({schema:t,style:v,showAddButton:!1,headCell:d,order:n,orderBy:l,index:r,doAnyFilterSet:!1}))),a?k.createElement(R.TableRow,null,k.createElement(R.TableCell,{align:"left",style:v},k.createElement("span",{style:he.headerText},H.I18n.t("ra_Actions"))),k.createElement(R.TableCell,{style:v},this.renderImportExportButtons(t))):null))))))):null}enhancedBottomCard(){const{schema:t}=this.props;let n;this.props.schema.compact&&(n={paddingTop:1,paddingBottom:1});const l=this.isAnyFilterSet();return k.createElement(R.Grid2,{size:{xs:t.xs||12,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0}},k.createElement(R.Card,null,k.createElement(R.Paper,{style:he.paper},k.createElement(R.Table,null,k.createElement(R.TableBody,null,k.createElement(R.TableRow,null,k.createElement(R.TableCell,{colSpan:t.items.length+1,style:n},this.renderAddButton(l))))))))}renderCards(){const{schema:t}=this.props;let{visibleValue:n}=this.state,l;this.props.schema.compact&&(l={paddingTop:1,paddingBottom:1}),n||=this.state.value.map((a,u)=>u);const v=this.isAnyFilterSet();return k.createElement(R.Grid2,{container:!0},this.showImportDialog(),this.showTypeOfImportDialog(),this.enhancedFilterCard(),n.map((a,u)=>{var d;return k.createElement(R.Grid2,{key:`${a}_${u}`,size:{xs:t.xs||12,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0}},k.createElement(R.Card,null,k.createElement(R.Paper,{style:he.paper},k.createElement(R.Table,null,k.createElement(R.TableBody,null,(d=t.items)==null?void 0:d.map(r=>k.createElement(R.TableRow,{key:`${r.attr}_${a}`},k.createElement(R.TableCell,{align:"left",style:l},k.createElement("span",{style:he.headerText},this.getText(r.title))),k.createElement(R.TableCell,{align:"left",style:l},this.itemTable(r.attr,this.state.value[a],a)))),!t.noDelete&&k.createElement(R.TableRow,null,k.createElement(R.TableCell,{align:"left",style:l},k.createElement("span",{style:he.headerText},this.getText("Actions"))),k.createElement(R.TableCell,{align:"left",style:l},!v&&!this.state.orderBy?k.createElement(R.Tooltip,{title:H.I18n.t("ra_Move up"),slotProps:{popper:{sx:he.tooltip}}},k.createElement("span",null,k.createElement(R.IconButton,{size:"small",onClick:()=>this.onMoveUp(a),disabled:u===0},k.createElement(X.ArrowUpward,null)))):null,!v&&!this.state.orderBy?k.createElement(R.Tooltip,{title:H.I18n.t("ra_Move down"),slotProps:{popper:{sx:he.tooltip}}},k.createElement("span",null,k.createElement(R.IconButton,{size:"small",onClick:()=>this.onMoveDown(a),disabled:u===n.length-1},k.createElement(X.ArrowDownward,null)))):null,k.createElement(R.Tooltip,{title:H.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:he.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:this.onDelete(a)},k.createElement(X.Delete,null))),this.props.schema.clone?k.createElement(R.Tooltip,{title:H.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:he.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:this.onClone(a)},k.createElement(X.ContentCopy,null))):null)))))))}),this.enhancedBottomCard())}renderTable(){const{schema:t}=this.props;let{visibleValue:n}=this.state;n=n||this.state.value.map((a,u)=>u);const l=this.isAnyFilterSet();let v;return this.props.schema.compact&&(v={paddingTop:1,paddingBottom:1}),k.createElement(R.Paper,{style:he.paper},this.showImportDialog(),this.showTypeOfImportDialog(),t.label?k.createElement("div",{style:he.label},k.createElement(R.Toolbar,{variant:"dense",style:he.rootTool},k.createElement(R.Typography,{style:he.title,variant:"h6",id:"tableTitle",component:"div"},this.getText(t.label)))):null,k.createElement(R.TableContainer,null,k.createElement(R.Table,{style:he.table,size:"small"},this.enhancedTableHead(!l&&!this.state.orderBy?120:64,l),k.createElement(R.TableBody,null,n.map((a,u)=>{var d;return k.createElement(R.TableRow,{hover:!0,key:`${a}_${u}`},(d=t.items)==null?void 0:d.map(r=>k.createElement(R.TableCell,{key:`${r.attr}_${a}`,align:"left",style:v},this.itemTable(r.attr,this.state.value[a],a))),!t.noDelete&&k.createElement(R.TableCell,{align:"left",style:{...v,...he.buttonCell}},!l&&!this.state.orderBy?u?k.createElement(R.Tooltip,{title:H.I18n.t("ra_Move up"),slotProps:{popper:{sx:he.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:()=>this.onMoveUp(a)},k.createElement(X.ArrowUpward,null))):k.createElement("div",{style:he.buttonEmpty}):null,!l&&!this.state.orderBy?u<n.length-1?k.createElement(R.Tooltip,{title:H.I18n.t("ra_Move down"),slotProps:{popper:{sx:he.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:()=>this.onMoveDown(a)},k.createElement(X.ArrowDownward,null))):k.createElement("div",{style:he.buttonEmpty}):null,k.createElement(R.Tooltip,{title:H.I18n.t("ra_Delete current row"),slotProps:{popper:{sx:he.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:this.onDelete(a)},k.createElement(X.Delete,null))),this.props.schema.clone?k.createElement(R.Tooltip,{title:H.I18n.t("ra_Clone current row"),slotProps:{popper:{sx:he.tooltip}}},k.createElement(R.IconButton,{size:"small",onClick:this.onClone(a)},k.createElement(X.ContentCopy,null))):null))}),!t.noDelete&&n.length>=(t.showSecondAddAt||5)?k.createElement(R.TableRow,null,k.createElement(R.TableCell,{colSpan:t.items.length+1,style:{...v}},this.renderAddButton(l))):null)),!n.length&&this.state.value.length?k.createElement("div",{style:he.filteredOut},k.createElement(R.Typography,{style:he.title,variant:"h6",id:"tableTitle",component:"div"},H.I18n.t("ra_All items are filtered out"),k.createElement(R.IconButton,{size:"small",onClick:()=>this.applyFilter(!0)},k.createElement(X.Close,null)))):null),t.help?k.createElement(R.FormHelperText,{style:{paddingLeft:16}},this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null,this.state.errorMessage?k.createElement("div",{style:{display:"flex",padding:"5px"}},k.createElement(X.Warning,{color:"error"}),k.createElement("span",{style:{color:"red",alignSelf:"center"}},this.state.errorMessage)):null)}componentDidUpdate(){var t;(t=this.refDiv.current)!=null&&t.clientWidth&&this.refDiv.current.clientWidth!==this.state.width&&(this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{var n;this.resizeTimeout=null,this.setState({width:(n=this.refDiv.current)==null?void 0:n.clientWidth})},50))}getCurrentBreakpoint(){return this.state.width?this.state.width<600?"xs":this.state.width<900?"sm":this.state.width<1200?"md":this.state.width<1536?"lg":"xl":"md"}renderItem(){const{schema:t}=this.props;if(!this.state.value||!Array.isArray(this.state.value))return null;const n=this.getCurrentBreakpoint();let l;return n&&(t.useCardFor||["xs"]).includes(n)?l=this.renderCards():l=this.renderTable(),k.createElement("div",{ref:this.refDiv,style:{width:"100%"}},l)}}const Gt={indeterminate:{opacity:.5},label:{width:"100%",fontSize:14,marginBottom:2},helper:{width:"100%",fontSize:12},error:{width:"100%",fontSize:12,color:"#FF0000"}};class fl extends K{updateTimeout=null;componentDidMount(){super.componentDidMount();let t=K.getValue(this.props.data,this.props.attr);if(Array.isArray(t)&&this.props.oContext.multiEdit){t=K.DIFFERENT_VALUE,this.setState({value:t,oldValue:t,jsonError:!1});return}this.setState({value:t,oldValue:t,jsonError:this.validateJson(t)})}validateJson(t){let n=!1;if(this.props.schema.validateJson&&(t||!this.props.schema.allowEmpty))try{JSON.parse(t)}catch(l){console.log("Error in JSON",l),n=!0}return n}static getDerivedStateFromProps(t,n){if(t.oContext.multiEdit&&n.value===K.DIFFERENT_VALUE)return{value:K.DIFFERENT_VALUE};let l=K.getValue(t.data,t.attr);return l!=null&&(l=l.toString()),l==null||l!==n.value&&l!==n.oldValue?{value:l}:null}renderItem(t,n){const l=Array.isArray(this.state.value)||this.state.value===K.DIFFERENT_VALUE;if(this.props.schema.time){let u="";return typeof this.state.value=="number"?this.state.value&&this.state.value<9466596e5?u=new Date(this.state.value*1e3).toLocaleString():u=new Date(this.state.value).toLocaleString():typeof this.state.value=="string"&&(u=new Date(this.state.value).toLocaleString()),k.createElement(R.TextField,{variant:"standard",fullWidth:!0,value:u,error:!!t||!!this.state.jsonError,disabled:!!n,slotProps:{htmlInput:{readOnly:!0}},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}if(this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=null,this.setState({oldValue:null})},30)):this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=null),l){const u=K.getValue(this.props.data,this.props.attr),d=(u==null?void 0:u.filter(r=>r||r===0).map(r=>({label:r.toString()||"",value:r})))||[];return d.unshift({label:H.I18n.t(K.DIFFERENT_LABEL),value:K.DIFFERENT_VALUE}),k.createElement(R.Autocomplete,{style:Gt.indeterminate,fullWidth:!0,value:d[0],onChange:(r,c)=>{const e=c?c.value:"",i=this.onChange(this.props.attr,e,()=>{this.setState({value:e,oldValue:e,jsonError:this.validateJson(c)})});i instanceof Promise&&i.catch(o=>console.error(`Cannot set value: ${o}`))},options:d,getOptionLabel:r=>r.label,renderInput:r=>k.createElement(R.TextField,{variant:"standard",...r,error:!!t,placeholder:this.getText(this.props.schema.placeholder),slotProps:{htmlInput:{...r.inputProps,maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1}},label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:!!n})})}let v,a;if((this.props.schema.readOnly||n)&&this.props.schema.copyToClipboard?(this.props.schema.minRows>1&&(a={position:"absolute",right:3,top:20,zIndex:1e3}),v=k.createElement(R.IconButton,{tabIndex:-1,style:a,size:"small",onClick:()=>{H.Utils.copyToClipboard(this.state.value),window.alert(H.I18n.t("ra_Copied"))}},k.createElement(H.IconCopy,null))):!this.props.schema.readOnly&&!n&&this.state.value&&!this.props.schema.noClearButton&&(this.props.schema.minRows>1&&(a={position:"absolute",right:3,top:20,zIndex:1e3}),v=k.createElement(R.IconButton,{style:a,size:"small",tabIndex:-1,onClick:()=>this.setState({value:"",oldValue:this.state.value},()=>this.onChange(this.props.attr,""))},k.createElement(X.Close,null)),this.props.schema.minRows<=1&&(v=k.createElement(R.InputAdornment,{position:"end"},v))),this.props.schema.minRows>1){const u=this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation);return k.createElement("div",{style:{width:"100%",position:"relative"}},this.props.schema.label?k.createElement("div",{style:Gt.label},this.getText(this.props.schema.label)):null,k.createElement(R.TextareaAutosize,{style:{width:"100%",resize:"vertical",backgroundColor:this.props.oContext.themeType==="dark"?"#363636":"#cccccc",color:this.props.oContext.themeType==="dark"?"#fff":"#111"},minRows:this.props.schema.minRows,maxRows:this.props.schema.maxRows,value:this.state.value===null||this.state.value===void 0?"":this.state.value,disabled:!!n,readOnly:this.props.schema.readOnly||!1,onChange:d=>{const r=d.target.value;this.setState({value:r,oldValue:this.state.value,jsonError:this.validateJson(r)},()=>this.onChange(this.props.attr,r||""))},placeholder:this.getText(this.props.schema.placeholder)}),u||t||this.state.jsonError?k.createElement("div",{style:t?Gt.error:Gt.helper},t||(this.state.jsonError?H.I18n.t("ra_Invalid JSON"):u)):null)}return k.createElement(R.TextField,{variant:"standard",fullWidth:!0,value:this.state.value===null||this.state.value===void 0?"":this.state.value,error:!!t||!!this.state.jsonError,disabled:!!n,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:v}},onChange:u=>{const d=u.target.value;this.setState({value:d,oldValue:this.state.value,jsonError:this.validateJson(d)},()=>this.onChange(this.props.attr,d))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.state.jsonError?H.I18n.t("ra_Invalid JSON"):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const gl={fullWidth:{width:"100%"}};class ml extends K{initialized=!1;localContext;askInstance(){if(this.props.alive){let t=this.props.schema.data;if(t===void 0&&this.props.schema.jsonData){const n=this.getPattern(this.props.schema.jsonData,null,!0);try{t=JSON.parse(n)}catch{console.error(`Cannot parse json data: ${n}`)}}t===void 0&&(t=null),this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.schema.command||"send",t).then(n=>{if(typeof n=="object"){const l=n;this.setState({text:l.text||"",style:l.style,icon:l.icon,iconStyle:l.iconStyle})}else typeof n=="string"&&this.setState({text:n||""})}).catch(n=>console.error(`Cannot send command: ${n}`))}}getLocalContext(){const t={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(n=>t[n]=K.getValue(this.props.data,n)),JSON.stringify(t)}renderItem(){if(this.props.alive){const n=this.getLocalContext();(n!==this.localContext||!this.initialized)&&(this.localContext=n,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}if(this.state.text===void 0)return null;let t=null;return this.state.icon&&(t=Xe(this.state.icon,{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}),t||(t=k.createElement(H.Icon,{src:this.state.icon,style:{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}}))),this.props.schema.container==="text"?k.createElement(R.TextField,{variant:"standard",fullWidth:!0,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?k.createElement(R.IconButton,{tabIndex:-1,size:"small",onClick:()=>{H.Utils.copyToClipboard(this.state.text),window.alert(H.I18n.t("ra_Copied"))}},k.createElement(H.IconCopy,null)):void 0}},value:this.state.text,label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):k.createElement("div",{style:{...gl.fullWidth,...this.state.style||void 0}},t,this.props.schema.container==="html"?k.createElement("span",{dangerouslySetInnerHTML:{__html:this.state.text||""}}):this.state.text)}}class vl extends K{componentDidMount(){super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);this.setState({value:t})}renderItem(t,n){const l=this.props.schema.returnFormat!=="HH:mm:ss",v=new Date(Date.parse(`Thu, 01 Jan 1970 ${this.state.value||"00:00:00"}`));return k.createElement(_i.TimePicker,{sx:a=>({width:"100%",borderBottom:`1px solid ${a.palette.text.primary}`,"& fieldset":{display:"none"},"& input":{padding:`${a.spacing(1.5)} 0 4px 0`},"& .MuiInputAdornment-root":{marginLeft:0,marginTop:1},"& label":{transform:"translate(0px, -9px) scale(0.75)"}}),ampm:this.props.oContext.systemConfig.dateFormat.includes("/"),timeSteps:this.props.schema.timeSteps||this.props.schema.timesteps||{hours:1,minutes:5,seconds:5},format:this.props.schema.format||"HH:mm:ss",disabled:!!n,value:v,onChange:a=>{let u;u=a instanceof Date?a.toTimeString().split(" ")[0]:a.toTimeString(),l&&(u=u.split(":").slice(0,2).join(":")),this.setState({value:u},()=>this.onChange(this.props.attr,this.state.value))},views:this.props.schema.views||["hours","minutes","seconds"],label:this.getText(this.props.schema.label)})}}function yl(L,t){let n;return t&&L.substring(0,t.length)===t?n=L.substring(t.length+1):n=L,n=n.replace(/\./g,"/").replace(/_/g," "),n}class bl extends K{componentDidMount(){var n;super.componentDidMount();const t=K.getValue(this.props.data,this.props.attr);if(!t&&((n=this.props.customObj)!=null&&n._id)){const l=yl(this.props.customObj._id,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);this.setState({value:l})}else this.setState({value:t||""})}renderItem(t,n){return k.createElement(R.TextField,{variant:"standard",fullWidth:!0,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},value:this.state.value,error:!!t,disabled:n,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),onChange:l=>{const v=l.target.value;this.setState({value:v},()=>this.onChange(this.props.attr,v))}})}}class wl extends K{async componentDidMount(){var n;super.componentDidMount();const t=await this.props.oContext.socket.getObject("system.meta.uuid");this.setState({uuid:((n=t==null?void 0:t.native)==null?void 0:n.uuid)||"unknown"})}renderItem(t,n){return k.createElement(R.TextField,{variant:"standard",fullWidth:!0,error:!!t,disabled:!!n,slotProps:{htmlInput:{readOnly:!0},input:{endAdornment:k.createElement(R.IconButton,{tabIndex:-1,onClick:()=>{H.Utils.copyToClipboard(this.state.uuid),window.alert(H.I18n.t("ra_Copied %s",this.state.uuid))}},k.createElement(X.ContentCopy,null))}},value:this.state.uuid||"",label:this.getText(this.props.schema.label)||H.I18n.t("ra_Serial number (UUID)"),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}}const Ai={icon:{width:16,height:16,marginRight:8}};class Cl extends K{componentDidMount(){super.componentDidMount(),this.props.oContext.socket.getUsers().then(t=>{const n={},l=H.I18n.getLanguage();this.props.schema.short?t.forEach(v=>{var a,u;return n[v._id]={color:(a=v.common)==null?void 0:a.color,icon:(u=v.common)==null?void 0:u.icon,name:H.Utils.getObjectNameFromObj(v,l)}}):t.forEach(v=>{var a,u;return n[v._id.replace(/^system\.user\./,"")]={color:(a=v.common)==null?void 0:a.color,icon:(u=v.common)==null?void 0:u.icon,name:H.Utils.getObjectNameFromObj(v,l)}}),this.setState({users:n})}).catch(t=>console.error(`Cannot get users: ${t}`))}renderItem(t,n){var v,a;const l=K.getValue(this.props.data,this.props.attr);return k.createElement(R.FormControl,{variant:"standard",fullWidth:!0},this.state.users&&this.props.schema.label?k.createElement(R.InputLabel,null,this.getText(this.props.schema.label)):null,this.state.users?k.createElement(R.Select,{variant:"standard",error:!!t,disabled:!!n,value:l,renderValue:u=>{var d,r,c;return k.createElement("span",null,this.state.users&&((d=this.state.users[u])!=null&&d.icon)?k.createElement(H.Icon,{src:this.state.users&&((r=this.state.users[u])==null?void 0:r.icon),style:Ai.icon}):null,this.state.users&&((c=this.state.users[u])==null?void 0:c.name)||u||"")},style:{color:this.state.users&&((v=this.state.users[l])==null?void 0:v.color)||void 0,backgroundColor:H.Utils.getInvertedColor(this.state.users&&((a=this.state.users[l])==null?void 0:a.color),this.props.oContext.themeType)},onChange:u=>this.onChange(this.props.attr,u.target.value)},this.state.users&&Object.keys(this.state.users).map(u=>k.createElement(R.MenuItem,{style:{color:this.state.users[u].color||void 0,backgroundColor:H.Utils.getInvertedColor(this.state.users[u].color,this.props.oContext.themeType)},key:u,value:u},this.state.users[u].icon?k.createElement(H.Icon,{src:this.state.users[u].icon,style:Ai.icon}):null,this.state.users[u].name))):k.createElement(R.TextField,{variant:"standard",error:!!t,disabled:!!n,value:l,onChange:u=>this.onChange(this.props.attr,u.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?k.createElement(R.FormHelperText,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}}class El extends K{async componentDidMount(){super.componentDidMount();const t=await as(()=>import("./index-Dx7rDE4p.js").then(n=>n.i),__vite__mapDeps([0,1,2,3,4]),import.meta.url);this.setState({QRCode:t.default})}renderItem(){const t=this.state.QRCode;return t?k.createElement(t,{value:this.props.schema.data,size:this.props.schema.size,fgColor:this.props.schema.fgColor,bgColor:this.props.schema.bgColor,level:this.props.schema.level}):null}}const Sl={accordion:_s,alive:ks,autocomplete:Ms,autocompleteSendTo:Ls,certCollection:Rs,certificate:Fs,certificates:Os,checkbox:Bs,checkDocker:Ns,checkLicense:Ze,chip:ii,chips:ii,color:js,coordinates:Vs,cron:Is,custom:_t,datePicker:Us,deviceManager:Gs,divider:ol,file:io,fileSelector:en,func:ro,header:ll,image:ao,imageSendTo:oo,infoBox:lo,instance:ho,interface:co,ip:so,jsonEditor:Ba,language:Wa,license:za,number:Ha,oauth2:ja,objectId:Va,password:Ua,pattern:Ga,port:Ja,qrCode:El,room:Ya,select:Xa,selectSendTo:qa,sendto:yi,sendTo:yi,setState:nl,slider:il,state:sl,staticImage:hl,staticInfo:cl,staticLink:Di,staticText:Di,table:Ie,text:fl,textSendTo:ml,timePicker:vl,topic:bl,uuid:wl,user:Cl},We={fullWidth:{width:"100%"},paper:{margin:1,width:"auto !important",overflowY:"auto",paddingBottom:1},paperWithIcons:{height:"calc(100vh - 259px) !important"},paperWithoutIcons:{height:"calc(100vh - 235px) !important"},padding:{padding:"10px"},heading:{},primary:L=>({backgroundColor:L.palette.primary.main,color:L.palette.mode==="dark"?"inherit":"#FFF"}),secondary:L=>({backgroundColor:L.palette.secondary.main})};class ft extends K{componentDidMount(){var t;super.componentDidMount(),(t=this.props.schema)!=null&&t.collapsable&&this.setState({expanded:(window._localStorage||window.localStorage).getItem(`${this.props.oContext.adapterName}.${this.props.attr}`)==="true"})}renderItems(t,n){return t?Object.keys(t).map(l=>{if(this.props.oContext.multiEdit&&t[l].noMultiEdit)return null;const v=t[l].type||"panel";let a,u="Use this.props.oContext.socket!";return v==="custom"?(t[l].url?a=_t:this.props.oContext.customs&&this.props.oContext.customs[t[l].component]?a=this.props.oContext.customs[t[l].component]:(console.error(`Cannot find custom component: ${t[l].component}`),a=K),u=this.props.oContext.socket):v==="panel"?a=ft:a=Sl[v]||K,k.createElement(a,{socket:u,globalData:this.props.globalData,oContext:this.props.oContext,key:`${l}_${this.props.index===void 0?"":this.props.index}`,index:this.props.index,changed:this.props.changed,arrayIndex:this.props.arrayIndex,expertMode:this.props.expertMode,commandRunning:this.props.commandRunning,style:We.panel,common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:this.props.data,originalData:this.props.originalData,onError:this.props.onError,onChange:this.props.onChange,disabled:n,customObj:this.props.customObj,custom:this.props.custom,schema:t[l],attr:l,table:this.props.table})}):null}render(){const t=this.props.schema;if(!t)return null;const{disabled:n,hidden:l}=this.calculate(t),v=this.props.schema.items,a=this.props.schema.style||{};if(l){if(t.hideOnlyControl){const d=k.createElement(R.Grid2,{size:{xs:t.xs||void 0,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0},sx:H.Utils.getStyle(this.props.oContext.theme,{marginBottom:0,textAlign:"left"},a,this.props.oContext.themeType==="dark"&&t.darkStyle)});return t.newLine?k.createElement(k.Fragment,null,k.createElement("div",{style:{flexBasis:"100%",height:0}}),d):d}return null}if(this.props.table)return this.renderItems(v,n);if(this.props.custom)return k.createElement(R.Grid2,{key:`${this.props.attr}_${this.props.index}`,container:!0,style:We.fullWidth,columnSpacing:2,rowSpacing:1,sx:a},this.renderItems(v,n));let u;if(t.collapsable)u=k.createElement(R.Accordion,{key:`${this.props.attr}_${this.props.index}`,style:We.fullWidth,expanded:!!this.state.expanded,onChange:()=>{(window._localStorage||window.localStorage).setItem(`${this.props.oContext.adapterName}.${this.props.attr}`,this.state.expanded?"false":"true"),this.setState({expanded:!this.state.expanded})}},k.createElement(R.AccordionSummary,{expandIcon:k.createElement(X.ExpandMore,null),sx:H.Utils.getStyle(this.props.oContext.theme,a,this.props.oContext.themeType&&t.darkStyle,t.color==="primary"?We.primary:t.color==="secondary"&&We.secondary,{width:"100%"})},k.createElement(R.Typography,{style:We.heading},this.getText(t.label))),k.createElement(R.AccordionDetails,null,k.createElement(R.Grid2,{container:!0,columnSpacing:2,rowSpacing:1,sx:{...a,width:"100%",padding:"10px"}},this.renderItems(v,n))));else{const d=H.Utils.getStyle(this.props.oContext.theme,this.props.style,a,{width:"100%"},this.props.isParentTab&&We.paper,this.props.isParentTab&&(this.props.withoutSaveButtons?this.props.withIcons?{height:"calc(100% - 88px) !important"}:{height:"calc(100% - 64px) !important"}:this.props.withIcons?We.paperWithIcons:We.paperWithoutIcons));u=k.createElement(R.Box,{component:"div",key:`${this.props.attr}_${this.props.index}`,className:this.props.className,sx:d},k.createElement(R.Grid2,{container:!0,columnSpacing:2,rowSpacing:1,sx:H.Utils.getStyle(this.props.oContext.theme,{width:"100%"},this.props.isParentTab&&We.padding,this.props.schema.innerStyle)},this.renderItems(v,n)))}if(!this.props.isParentTab){const d=k.createElement(R.Grid2,{title:this.getText(t.tooltip),size:{xs:t.xs||void 0,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0},sx:{marginBottom:0,textAlign:"left",...a}},u);return t.newLine?k.createElement(k.Fragment,null,k.createElement("div",{style:{flexBasis:"100%",height:0}}),d):d}return u}}const Kt={tabs:{height:"100%",width:"100%"},panel:{width:"100%",display:"block"},panelWithIcons:{height:"calc(100% - 72px)"},panelWithoutIcons:{height:"calc(100% - 48px)"}};class Dl extends K{resizeTimeout=null;refDiv;constructor(t){super(t);let n;if(this.props.root){const l=(window.location.hash||"").replace(/^#/,"").split("/");if(l.length>=3&&l[1]==="config"){const v=l[3],a=parseInt(v,10);v&&a.toString()===v?a>=0&&a<Object.keys(this.props.schema.items).length&&(n=Object.keys(this.props.schema.items)[a]):v&&Object.keys(this.props.schema.items).includes(v)&&(n=v),window.addEventListener("hashchange",this.onHashTabsChanged,!1)}}n===void 0&&(n=(window._localStorage||window.localStorage).getItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`)||Object.keys(this.props.schema.items)[0],Object.keys(this.props.schema.items).includes(n)||(n=Object.keys(this.props.schema.items)[0])),this.refDiv=k.createRef(),Object.assign(this.state,{tab:n,width:0,openMenu:null,tabErrors:{}})}onTabError=(t,n)=>{const l=this.state.tab;if(!l){this.props.onError(t,n);return}const v={...this.state.tabErrors};v[l]||(v[l]={}),n?v[l][t]=n:(delete v[l][t],Object.keys(v[l]).length===0&&delete v[l]),this.setState({tabErrors:v}),this.props.onError(t,n)};hasTabErrors=t=>!!(this.state.tabErrors[t]&&Object.keys(this.state.tabErrors[t]).length>0);componentWillUnmount(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),window.removeEventListener("hashchange",this.onHashTabsChanged,!1),super.componentWillUnmount()}onHashTabsChanged=()=>{const t=(window.location.hash||"").replace(/^#/,"").split("/");if(t.length>3&&t[1]==="config"){const n=t[3],l=parseInt(n,10);let v;l.toString()===n?l>=0&&l<Object.keys(this.props.schema.items).length&&(v=Object.keys(this.props.schema.items)[l]):Object.keys(this.props.schema.items).includes(n)&&(v=n),v!==void 0&&v!==this.state.tab&&((window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`,v),this.setState({tab:v}))}};getCurrentBreakpoint(){if(!this.state.width)return"md";if(!this.state.initialBreakpoint){let t;return this.state.width<600?t="xs":this.state.width<900?t="sm":this.state.width<1200?t="md":this.state.width<1536?t="lg":t="xl",setTimeout(()=>{this.setState({initialBreakpoint:t})},50),t}return this.state.initialBreakpoint}componentDidUpdate(){var t;!this.state.initialBreakpoint&&((t=this.refDiv.current)!=null&&t.clientWidth)&&this.refDiv.current.clientWidth!==this.state.width&&(this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{var n;this.resizeTimeout=null,this.setState({width:(n=this.refDiv.current)==null?void 0:n.clientWidth})},50))}onMenuChange(t){(window._localStorage||window.localStorage).setItem(`${this.props.dialogName||"App"}.${this.props.oContext.adapterName}`,t),this.setState({tab:t},()=>{if(this.props.root){const n=(window.location.hash||"").split("/");n.length>=3&&n[1]==="config"&&(n[3]=this.state.tab,window.location.hash=n.join("/"))}})}render(){const t=this.props.schema.items;let n=!1;const l=[];Object.keys(t).map(u=>{let d;if(t[u].expertMode&&!this.props.expertMode)return;if(this.props.custom){if(this.executeCustom(t[u].hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData))return;d=this.executeCustom(t[u].disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData)}else{if(this.execute(t[u].hidden,!1,this.props.data,this.props.index,this.props.globalData))return;d=this.execute(t[u].disabled,!1,this.props.data,this.props.index,this.props.globalData)}const r=this.getIcon(t[u].icon);n=n||!!r,l.push({icon:r,disabled:d,label:this.getText(t[u].label),name:u})}),l.find(u=>u.name===this.state.tab)||setTimeout(()=>this.setState({tab:l[0].name}),50);const v=this.getCurrentBreakpoint();let a;return v==="xs"&&l.length>2?a=k.createElement(R.Toolbar,{style:{top:2,backgroundColor:this.props.oContext.themeType==="dark"?"#222":"#DDD"},variant:"dense"},k.createElement(R.IconButton,{onClick:u=>this.setState({openMenu:u.currentTarget})},k.createElement(X.Menu,null)),this.state.openMenu?k.createElement(R.Menu,{open:!0,anchorEl:this.state.openMenu,onClose:()=>this.setState({openMenu:null})},l.map(u=>{const d=this.hasTabErrors(u.name);return k.createElement(R.MenuItem,{disabled:u.disabled,key:u.name,onClick:()=>{this.setState({openMenu:null},()=>this.onMenuChange(u.name))},selected:u.name===this.state.tab,sx:d?{color:"error.main"}:void 0},n?k.createElement(R.ListItemIcon,null,u.icon):null,k.createElement(R.Box,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"}},u.label,d&&k.createElement(X.Error,{sx:{fontSize:16,color:"error.main"}})))})):null):a=k.createElement(R.Tabs,{variant:"scrollable",scrollButtons:"auto",style:this.props.schema.tabsStyle,value:this.state.tab,onChange:(u,d)=>this.onMenuChange(d)},l.map(u=>{const d=this.hasTabErrors(u.name),r=d?k.createElement(R.Box,{sx:{display:"flex",alignItems:"center",gap:.5}},u.label,k.createElement(X.Error,{sx:{fontSize:16,color:"error.main"}})):u.label;return k.createElement(R.Tab,{id:u.name,wrapped:!0,disabled:u.disabled,key:u.name,value:u.name,iconPosition:this.props.schema.iconPosition||"start",icon:u.icon,label:r,sx:d?{"& .MuiTab-wrapper":{color:"error.main"}}:void 0})})),k.createElement("div",{style:Kt.tabs,ref:this.refDiv},a,k.createElement(ft,{oContext:this.props.oContext,withoutSaveButtons:this.props.withoutSaveButtons,isParentTab:!0,changed:this.props.changed,key:this.state.tab,expertMode:this.props.expertMode,index:1001,arrayIndex:this.props.arrayIndex,globalData:this.props.globalData,commandRunning:this.props.commandRunning,style:{...Kt.panel,...n?Kt.panelWithIcons:Kt.panelWithoutIcons},common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:this.props.data,originalData:this.props.originalData,onChange:this.props.onChange,onError:this.onTabError,customObj:this.props.customObj,custom:this.props.custom,schema:t[this.state.tab],table:this.props.table,withIcons:n}))}}const xl={root:{width:"100%",height:"100%"}};class Yt extends qe.Component{forceUpdateHandlers;errorTimeout=null;errorCached=null;oContext;constructor(t){super(t),this.state={originalData:JSON.stringify(this.props.data),changed:!1,errors:{},updateData:this.props.updateData||0,systemConfig:null,alive:!1,commandRunning:!1,schema:JSON.parse(JSON.stringify(this.props.schema))},this.forceUpdateHandlers={},this.buildDependencies(this.state.schema),this.readData()}static getDerivedStateFromProps(t,n){return t.updateData!==n.updateData?{updateData:t.updateData,originalData:JSON.stringify(t.data),schema:JSON.parse(JSON.stringify(t.schema))}:null}static async loadI18n(t,n,l){if(n===!0||n&&typeof n=="string"){const v=H.I18n.getLanguage(),a=typeof n=="string"?n:"i18n";let u=await t.fileExists(`${l}.admin`,`${a}/${v}.json`),d;if(u?d=`${a}/${v}.json`:(u=await t.fileExists(`${l}.admin`,`${a}/${v}/translations.json`),u?d=`${a}/${v}/translations.json`:v!=="en"&&(u=await t.fileExists(`${l}.admin`,`${a}/en.json`),u?d=`${a}/en.json`:(u=await t.fileExists(`${l}.admin`,`${a}/en/translations.json`),u&&(d=`${a}/en/translations.json`)))),d){const r=await t.readFile(`${l}.admin`,d);let c;r.file!==void 0?c=r.file:c=r;try{const e=JSON.parse(c);H.I18n.extendTranslations(e,v)}catch(e){return console.error(`Cannot parse language file "${l}.admin/${d}: ${e}`),""}return d}return console.warn(`Cannot find i18n for ${l} / ${d}`),""}return n&&typeof n=="object"&&H.I18n.extendTranslations(n),""}onCommandRunning=t=>this.setState({commandRunning:t});readData(){this.props.socket.getCompactSystemConfig().then(t=>this.props.socket.getState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`).then(n=>this.setState({systemConfig:t.common,alive:!!(n&&n.val)},()=>{this.updateContext(!0),this.props.custom||this.props.socket.subscribeState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,this.onAlive)}))).catch(t=>console.error(`Cannot read system config: ${t}`))}onAlive=(t,n)=>{!!(n!=null&&n.val)!==this.state.alive&&this.setState({alive:!!(n!=null&&n.val)})};onChange=(t,n,l,v)=>{if(this.props.onValueChange)this.props.onValueChange(t,n,v),l&&l();else if(t&&this.props.onChange){const a={changed:JSON.stringify(t)!==this.state.originalData};this.setState(a,()=>{this.props.onChange(t,a.changed,v),l&&l()})}else v&&this.props.onChange(null,null,v)};onError=(t,n)=>{this.errorCached=this.errorCached||JSON.parse(JSON.stringify(this.state.errors));const l=this.errorCached;n?l[t]=n:delete l[t],this.errorTimeout&&clearTimeout(this.errorTimeout),JSON.stringify(l)!==JSON.stringify(this.state.errors)?this.errorTimeout=setTimeout(()=>this.setState({errors:this.errorCached},()=>{this.errorTimeout=null,this.errorCached=null,this.props.onError(!!Object.keys(this.state.errors).length)}),50):this.errorCached=null};flatten(t,n){return n=n||{},t.items&&Object.keys(t.items).forEach(l=>{n[l]=t.items[l],this.flatten(t.items[l],n)}),n}buildDependencies(t){const n=this.flatten(t);Object.keys(n).forEach(l=>{var v,a,u,d,r,c,e,i,o,h;(v=n[l].confirm)!=null&&v.alsoDependsOn&&((a=n[l].confirm)==null||a.alsoDependsOn.forEach(s=>{if(!n[s])console.error(`[JsonConfigComponent] Attribute ${s} does not exist!`),s.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${s.replace(/^data\./,"")}" instead of "${s}"`);else{n[s].confirmDependsOn=n[s].confirmDependsOn||[];const p={...n[l],attr:l};p.confirm&&(p.confirm.cancel="Undo"),n[s].confirmDependsOn.push(p)}})),(u=n[l].onChange)!=null&&u.alsoDependsOn&&((d=n[l].onChange)==null||d.alsoDependsOn.forEach(s=>{if(!n[s])console.error(`[JsonConfigComponent] Attribute ${s} does not exist!`),s.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${s.replace(/^data\./,"")}" instead of "${s}"`);else{n[s].onChangeDependsOn=n[s].onChangeDependsOn||[];const p={...n[l],attr:l};n[s].onChangeDependsOn.push(p)}})),(r=n[l].hidden)!=null&&r.alsoDependsOn&&((c=n[l].hidden)==null||c.alsoDependsOn.forEach(s=>{if(!n[s])console.error(`[JsonConfigComponent] Attribute ${s} does not exist!`),s.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${s.replace(/^data\./,"")}" instead of "${s}"`);else{n[s].hiddenDependsOn=n[s].hiddenDependsOn||[];const p={...n[l],attr:l};n[s].hiddenDependsOn.push(p)}})),(e=n[l].label)!=null&&e.alsoDependsOn&&((i=n[l].label)==null||i.alsoDependsOn.forEach(s=>{if(!n[s])console.error(`[JsonConfigComponent] Attribute ${s} does not exist!`),s.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${s.replace(/^data\./,"")}" instead of "${s}"`);else{n[s].labelDependsOn=n[s].labelDependsOn||[];const p={...n[l],attr:l};n[s].labelDependsOn.push(p)}})),(o=n[l].help)!=null&&o.alsoDependsOn&&((h=n[l].help)==null||h.alsoDependsOn.forEach(s=>{if(!n[s])console.error(`[JsonConfigComponent] Attribute ${s} does not exist!`),s.startsWith("data.")&&console.warn(`[JsonConfigComponent] please use "${s.replace(/^data\./,"")}" instead of "${s}"`);else{n[s].helpDependsOn=n[s].helpDependsOn||[];const p={...n[l],attr:l};n[s].helpDependsOn.push(p)}}))})}updateContext(t){this.oContext={DeviceManager:this.props.DeviceManager,adapterName:this.props.adapterName,changeLanguage:this.changeLanguage,common:this.props.common,customs:this.props.customs,dateFormat:this.props.dateFormat,embedded:this.props.embedded,forceUpdate:this.forceAttrUpdate,imagePrefix:this.props.imagePrefix,instance:this.props.instance,instanceObj:this.props.instanceObj,isFloatComma:this.props.isFloatComma,multiEdit:this.props.multiEdit,onBackEndCommand:this.props.onBackEndCommand,onCommandRunning:this.onCommandRunning,onValueChange:this.props.onValueChange,registerOnForceUpdate:this.registerOnForceUpdate,socket:this.props.socket,systemConfig:this.state.systemConfig,theme:this.props.theme,themeType:this.props.themeType,_themeName:this.props.themeName,updateData:this.state.updateData},t&&this.forceUpdate()}renderItem(t){return t.type==="tabs"?k.createElement(Dl,{withoutSaveButtons:this.props.withoutSaveButtons,oContext:this.oContext,alive:this.state.alive,changed:this.state.changed,commandRunning:this.state.commandRunning,common:this.props.common,custom:this.props.custom,customObj:this.props.customObj,data:this.props.data,onChange:this.onChange,onError:(n,l)=>this.onError(n,l),originalData:JSON.parse(this.state.originalData),root:!0,schema:t,expertMode:this.props.expertMode,themeName:this.props.themeName}):t.type==="panel"||!t.type?k.createElement(ft,{withoutSaveButtons:this.props.withoutSaveButtons,oContext:this.oContext,alive:this.state.alive,changed:this.state.changed,commandRunning:this.state.commandRunning,common:this.props.common,custom:this.props.custom,customObj:this.props.customObj,data:this.props.data,expertMode:this.props.expertMode,index:1e3,isParentTab:!this.props.embedded&&!this.props.withoutSaveButtons,onChange:this.onChange,onError:(n,l)=>this.onError(n,l),originalData:JSON.parse(this.state.originalData),root:!0,schema:t,themeName:this.props.themeName}):(console.error(`Unknown item type in root: ${JSON.stringify(t)}`),null)}changeLanguage=()=>{this.forceUpdate()};forceAttrUpdate=(t,n)=>{Array.isArray(t)?t.forEach(l=>this.forceUpdateHandlers[l]&&this.forceUpdateHandlers[l](n)):this.forceUpdateHandlers[t]&&this.forceUpdateHandlers[t](n)};registerOnForceUpdate=(t,n)=>{n?this.forceUpdateHandlers[t]=n:this.forceUpdateHandlers[t]&&delete this.forceUpdateHandlers[t]};render(){return!this.state.systemConfig||!this.oContext?k.createElement(R.LinearProgress,null):(this.oContext._themeName!==this.props.themeName&&(this.oContext._themeName=this.props.themeName,setTimeout(()=>this.updateContext(!0),0)),k.createElement("div",{style:{...!this.props.embedded||this.props.withoutSaveButtons?xl.root:void 0,...this.props.style,...this.state.schema.style}},this.renderItem(this.state.schema)))}}const ht={root:{width:"100%",height:"100%",overflow:"hidden",position:"relative"},scroll:{height:"calc(100% - 48px)",overflowY:"auto"},exportImportButtons:{position:"absolute",top:5,right:0,zIndex:3},button:{marginRight:"5px"},tooltip:{pointerEvents:"none"}};function Al(L,t){let n="";for(let l=0;l<t.length;l++)n+=String.fromCharCode(L[l%L.length].charCodeAt(0)^t.charCodeAt(l));return n}function $l(L,t){let n="";for(let l=0;l<t.length;l++)n+=String.fromCharCode(L[l%L.length].charCodeAt(0)^t.charCodeAt(l));return n}function Tl(L,t){if(typeof t!="string")return t;if(!t.startsWith("$/aes-192-cbc:")||!/^[0-9a-f]{48}$/.test(L))return Al(L,t);const n=t.split(":",3),l=window.CryptoJS.enc.Hex.parse(L),v=window.CryptoJS.enc.Hex.parse(n[1]),a=window.CryptoJS.lib.CipherParams.create({ciphertext:window.CryptoJS.enc.Hex.parse(n[2])}),u=window.CryptoJS.AES.decrypt(a,l,{iv:v});return window.CryptoJS.enc.Utf8.stringify(u)}function _l(L,t,n){if(typeof t!="string")return t;if(!/^[0-9a-f]{48}$/.test(L))return $l(L,t);let l;l=window.CryptoJS.lib.WordArray.random(128/8);const v=window.CryptoJS.enc.Hex.parse(L),a=window.CryptoJS.AES.encrypt(t,v,{iv:l}).ciphertext;return`$/aes-192-cbc:${window.CryptoJS.enc.Hex.stringify(l)}:${a}`}function $i(L,t){var n;return document.getElementById(t)?(n=document.getElementById(t))==null?void 0:n.onload:new Promise(l=>{const v=document.createElement("script");v.setAttribute("id",t),v.onload=l,v.src=L,document.getElementsByTagName("head")[0].appendChild(v)})}let kl=class extends H.Router{fileSubscribed=[];fileLangSubscribed="";secret;constructor(t){super(t),this.state={updateData:0,changed:!1,confirmDialog:!1,theme:H.Theme(t.themeName),saveConfigDialog:!1,hash:"_"},this.secret=t.secret||"",this.getInstanceObject().then(n=>this.getConfigFile().then(l=>Yt.loadI18n(this.props.socket,l==null?void 0:l.i18n,this.props.adapterName).then(v=>{v&&(this.fileLangSubscribed||(this.fileLangSubscribed=v,this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange))),n?this.setState({schema:l,data:n.native,common:n.common,hash:ti(JSON.stringify(l)).toString()}):window.alert(`Instance system.adapter.${this.props.adapterName}.${this.props.instance} not found!`)})))}componentWillUnmount(){super.componentWillUnmount(),this.fileSubscribed.length&&(this.props.socket.unsubscribeFiles(`${this.props.adapterName}.admin`,this.fileSubscribed,this.onFileChange),this.fileSubscribed=[]),this.fileLangSubscribed&&(this.props.socket.unsubscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange),this.fileLangSubscribed="")}handleFileSelect=t=>{const n=t.target.files[0];if(n){const l=new FileReader;l.onload=v=>{if(!v.target)return;const a=v.target.result;try{const u=JSON.parse(a);this.setState({data:u,changed:JSON.stringify(u)!==JSON.stringify(this.state.originalData)})}catch{window.alert(H.I18n.t("[JsonConfig] Failed to parse JSON file"))}},l.readAsText(n)}else window.alert(H.I18n.t("[JsonConfig] Failed to open JSON File"))};getExportImportButtons(){return k.createElement("div",{style:ht.exportImportButtons},k.createElement(R.Tooltip,{title:this.props.t("Import settings from JSON file"),slotProps:{popper:{sx:ht.tooltip}}},k.createElement(R.Fab,{size:"small",sx:{"&.MuiFab-root":ht.button},onClick:()=>{const t=document.createElement("input");t.setAttribute("type","file"),t.setAttribute("id","files"),t.setAttribute("opacity",0),t.addEventListener("change",n=>this.handleFileSelect(n),!1),t.click()}},k.createElement(X.Publish,null))),k.createElement(R.Tooltip,{title:this.props.t("Export setting to JSON file"),slotProps:{popper:{sx:ht.tooltip}}},k.createElement(R.Fab,{size:"small",sx:{"&.MuiFab-root":ht.button},onClick:()=>{this.state.data&&H.Utils.generateFile(`${this.props.adapterName}.${this.props.instance}.json`,this.state.data)}},k.createElement(X.Publish,{style:{transform:"rotate(180deg)"}}))))}onFileChange=async(t,n,l)=>{var v;if(t===`${this.props.adapterName}.admin`&&l){if(n===this.fileLangSubscribed)try{await Yt.loadI18n(this.props.socket,(v=this.state.schema)==null?void 0:v.i18n,this.props.adapterName),this.setState({hash:`${this.state.hash}1`})}catch{}else if(this.fileSubscribed.includes(n))try{const a=await this.getConfigFile(this.fileSubscribed[0]);this.setState({schema:a,hash:ti(JSON.stringify(a)).toString()})}catch{}}};async getInstanceObject(){var t;try{const n=await this.props.socket.getObject(`system.adapter.${this.props.adapterName}.${this.props.instance}`);if(Array.isArray(n.encryptedNative)){if(!this.secret){const l=await this.props.socket.getSystemConfig();await $i("../../lib/js/crypto-js/crypto-js.js","crypto-js"),this.secret=l.native.secret}return(t=n.encryptedNative)==null||t.forEach(l=>{n.native[l]&&(n.native[l]=Tl(this.secret,n.native[l]))}),n}return n}catch(n){window.alert(`[JsonConfig] Cannot read instance object: ${n}`)}return null}renderDialogConfirm(){return this.state.confirmDialog?k.createElement(H.DialogConfirm,{title:H.I18n.t("ra_Please confirm"),text:H.I18n.t("ra_Some data are not stored. Discard?"),ok:H.I18n.t("ra_Discard"),cancel:H.I18n.t("ra_Cancel"),onClose:t=>this.setState({confirmDialog:!1},()=>t&&H.Router.doNavigate(null))}):null}async scanForInclude(t,n){if(typeof t["#include"]=="string"){const v=await this._getConfigFile(t["#include"],[...n]);return delete t["#include"],v&&(t={...t,...v}),t}const l=Object.keys(t);for(let v=0;v<l.length;v++)t[l[v]]&&typeof t[l[v]]=="object"&&(t[l[v]]=await this.scanForInclude(t[l[v]],n));return t}async getConfigFile(t){return this._getConfigFile(t)}async _getConfigFile(t,n){if(t=t||"jsonConfig.json5",n=n||[],n.includes(t))return window.alert(`[JsonConfig] Circular reference in file: ${t} => ${n.join(" => ")}`),null;n.push(t);try{await this.props.socket.fileExists(`${this.props.adapterName}.admin`,t)||(t="jsonConfig.json");const v=await this.props.socket.readFile(`${this.props.adapterName}.admin`,t);let a="",u="";if(v.file!==void 0&&(u=v.file),typeof u=="string")a=u;else if(u.type==="Buffer"){let d="";const r=new Uint8Array(u.data),c=r.byteLength;for(let e=0;e<c;e++)d+=String.fromCharCode(r[e]);a=d}this.fileSubscribed.includes(t)||(this.fileSubscribed.push(t),await this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,t,this.onFileChange));try{return await this.scanForInclude(Li.parse(a),n)}catch(d){window.alert("[JsonConfig] Cannot parse json5 config!"),console.log(d)}}catch(l){this.state.schema||window.alert(`[JsonConfig] Cannot read file "${t}: ${l}`)}return null}renderSaveConfigDialog(){return this.state.saveConfigDialog?k.createElement(H.DialogConfirm,{title:H.I18n.t("ra_Please confirm"),text:H.I18n.t("Save configuration?"),ok:H.I18n.t("ra_Save"),cancel:H.I18n.t("ra_Cancel"),onClose:t=>this.setState({saveConfigDialog:!1},()=>t&&this.onSave(!0))}):null}findAttr(t,n){if(n=n||this.state.schema,n!=null&&n.items){if(t in n.items)return n.items[t];for(const l of Object.values(n.items)){const v=this.findAttr(t,l);if(v)return v}}return null}postProcessing(t,n,l){if(l=l||this.state.schema,!t){console.error(`Data is empty in postProcessing: ${n}, ${JSON.stringify(l)}`);return}const v=t[n];if(l.items)if(l.type==="table"){const a=v;if(!Array.isArray(a))return;for(const u of a)for(const d of l.items)this.postProcessing(u,d.attr,d)}else for(const[a,u]of Object.entries(l.items)){if(u.type==="panel"||u.type==="tabs"||u.type==="accordion")return;this.postProcessing(t,a,u)}else if(n&&typeof v=="string")if(l.type==="text")l.trim!==!1&&(t[n]=v.trim());else if(l.type==="ip")t[n]=v.trim();else if(l.type==="number"){const a=parseFloat(v.toString().replace(",","."));l.min!==void 0&&a<l.min?t[n]=l.min:l.max!==void 0&&a>l.max?t[n]=l.max:t[n]=a}else if(l.type==="port"){const a=parseInt(v.toString(),10);l.min!==void 0&&a<l.min?t[n]=l.min:l.max!==void 0&&a>l.max&&(t[n]=l.max),t[n]!==0&&a<20?t[n]=20:a>65535?t[n]=65535:t[n]=a}else l.type==="checkbox"&&(t[n]=t[n]===!0||t[n]==="true"||t[n]==="on"||t[n]===1||t[n]==="1")}async onSave(t,n){if(t){const l=await this.getInstanceObject();if(!l){console.error("Something went wrong: may be no connection?"),window.alert("Something went wrong: may be no connection?");return}if(!this.state.data||!this.state.schema)return;const v={};for(const u of Object.keys(this.state.data)){const d=this.findAttr(u);(!d||!d.doNotSave||d.type==="state")&&!u.startsWith("_")?K.setValue(l.native,u,this.state.data[u]):(K.setValue(l.native,u,null),v[u]=this.state.data[u])}try{const u=JSON.parse(JSON.stringify(l));if(Array.isArray(u.encryptedNative)){await $i("../../lib/js/crypto-js/crypto-js.js","crypto-js");for(const d of u.encryptedNative)u.native[d]&&(u.native[d]=_l(this.secret,u.native[d]))}await this.props.socket.setObject(u._id,u)}catch(u){window.alert(`[JsonConfig] Cannot set object: ${u}`)}const a={...l.native,...v};console.log(a),this.setState({changed:!1,data:a,updateData:this.state.updateData+1,originalData:a},()=>n&&H.Router.doNavigate(null))}else this.state.changed?this.setState({confirmDialog:!0}):H.Router.doNavigate(null)}componentDidUpdate(t,n){n.changed!==this.state.changed&&this.props.configStored(!this.state.changed)}async componentDidMount(){const t=`${window.location.protocol}//${window.location.host}${window.location.pathname}validate_config/${this.props.adapterName}`;console.log(`fetch ${t}`),await fetch(t)}render(){return!this.state.data||!this.state.schema?k.createElement(R.LinearProgress,null):k.createElement("div",{style:ht.root},this.renderDialogConfirm(),this.getExportImportButtons(),this.renderSaveConfigDialog(),k.createElement(Yt,{key:this.state.hash,style:ht.scroll,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,adapterName:this.props.adapterName,instance:this.props.instance,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat,schema:this.state.schema,common:this.state.common,expertMode:this.props.expertMode,data:this.state.data,updateData:this.state.updateData,onError:t=>this.setState({error:t}),onChange:(t,n,l)=>{l&&this.state.error&&(window.alert(H.I18n.t("Cannot save configuration because of error in configuration")),l=!1),l&&!this.state.changed&&!n&&(l=!1),t?this.setState({data:t,changed:n,saveConfigDialog:l}):l!==void 0&&this.setState({saveConfigDialog:l})},DeviceManager:this.props.DeviceManager,theme:this.state.theme}),k.createElement(H.SaveCloseButtons,{isIFrame:!1,dense:!0,paddingLeft:0,newReact:!0,theme:this.state.theme,noTextOnButtons:this.props.width==="xs"||this.props.width==="sm"||this.props.width==="md",changed:!!(this.state.error||this.state.changed),error:!!this.state.error,onSave:t=>this.onSave(!0,t),onClose:()=>this.onSave(!1)}))}};export{K as ConfigGeneric,ft as ConfigPanel,kl as JsonConfig,Yt as JsonConfigComponent};