@gramlot/gramlot 0.3.26 → 0.3.30

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 (213) hide show
  1. package/assets/icons/chart.svg +1 -0
  2. package/dist/components/audio/__init__.py +13 -0
  3. package/dist/components/audio/assets/collection.js +3 -0
  4. package/dist/components/audio/assets/index.js +3 -0
  5. package/dist/components/audio/commands.json +7 -0
  6. package/dist/components/audio/grammar.json +335 -0
  7. package/dist/components/charts/__init__.py +13 -0
  8. package/dist/components/charts/assets/collection.js +47 -0
  9. package/dist/components/charts/assets/files/55ea01207028f76d844678511f29fc800f8a1e67a8a0fe80470128677847ad32-echarts-gl.txt +29 -0
  10. package/dist/components/charts/assets/files/63727832aaf62004a2b249c933e327f3c90caf49e41a72f4bf436edf632cbda8-vega.txt +27 -0
  11. package/dist/components/charts/assets/files/8c45d9eaf50c2f72dd9c7ab9ef440788ba58a3538484b5c51c1f17d5128752e7-plotly.txt +21 -0
  12. package/dist/components/charts/assets/files/8f989229699b4fe2f1a0432d0e9edc338a8a911e250e2d1b01ecd770a5f5b1bd-uplot.txt +21 -0
  13. package/dist/components/charts/assets/files/c8fa058cba98f7f288b5d8fa4116f441d6dacb25b96da859e518c973fff41d0c-claygl.txt +23 -0
  14. package/dist/components/charts/assets/index.js +3 -0
  15. package/dist/components/charts/assets/modules/chunk-2CCTLZE7.js +76 -0
  16. package/dist/components/charts/assets/modules/chunk-RMRBEYTI.js +1 -0
  17. package/dist/components/charts/assets/modules/echarts-gl-CXVTZA6G.js +4409 -0
  18. package/dist/components/charts/assets/modules/plotly.min-4LB7HE7P.js +3596 -0
  19. package/dist/components/charts/assets/modules/uPlot.esm-5JJNHHRF.js +3 -0
  20. package/dist/components/charts/assets/modules/uPlot.min-N3E3FA74.js +1 -0
  21. package/dist/components/charts/assets/modules/vega.module-2QCOVQ3A.js +13 -0
  22. package/dist/components/charts/commands.json +7 -0
  23. package/dist/components/charts/grammar.json +1113 -0
  24. package/dist/components/chat/__init__.py +1 -1
  25. package/dist/components/chat/assets/collection.js +3 -3
  26. package/dist/components/chat/assets/index.js +1 -1
  27. package/dist/components/drawing/__init__.py +15 -0
  28. package/dist/components/drawing/assets/collection.js +28 -0
  29. package/dist/components/drawing/assets/index.js +3 -0
  30. package/dist/components/drawing/commands.json +7 -0
  31. package/dist/components/drawing/grammar.json +110 -0
  32. package/dist/components/editors/__init__.py +2 -2
  33. package/dist/components/editors/assets/collection.js +18 -18
  34. package/dist/components/editors/assets/index.js +1 -1
  35. package/dist/components/editors/assets/modules/{prose-mirror-engine-GMZPJPNN.js → prose-mirror-engine-DQEAEIMV.js} +2 -2
  36. package/dist/components/editors/grammar.json +150 -0
  37. package/dist/components/grid/__init__.py +1 -1
  38. package/dist/components/grid/assets/collection.js +63 -33
  39. package/dist/components/grid/assets/index.js +1 -1
  40. package/dist/components/grid/grammar.json +279 -0
  41. package/dist/components/grouplets/__init__.py +1 -1
  42. package/dist/components/grouplets/assets/collection.js +3 -3
  43. package/dist/components/grouplets/assets/index.js +1 -1
  44. package/dist/components/inputs/__init__.py +3 -2
  45. package/dist/components/inputs/assets/collection.js +38 -23
  46. package/dist/components/inputs/assets/index.js +1 -1
  47. package/dist/components/inputs/grammar.json +1533 -321
  48. package/dist/components/layout/__init__.py +1 -1
  49. package/dist/components/layout/assets/collection.js +27 -23
  50. package/dist/components/layout/assets/index.js +1 -1
  51. package/dist/components/layout/grammar.json +85 -0
  52. package/dist/components/selection_trial/__init__.py +1 -1
  53. package/dist/components/selection_trial/assets/collection.js +3 -3
  54. package/dist/components/selection_trial/assets/index.js +1 -1
  55. package/dist/components/tree/__init__.py +1 -1
  56. package/dist/components/tree/assets/collection.js +12 -12
  57. package/dist/components/tree/assets/index.js +1 -1
  58. package/dist/components/tree/grammar.json +126 -0
  59. package/dist/components/typst/__init__.py +1 -1
  60. package/dist/components/typst/assets/collection.js +3 -3
  61. package/dist/components/typst/assets/index.js +1 -1
  62. package/dist/components/uploads/__init__.py +1 -1
  63. package/dist/components/uploads/assets/collection.js +9 -9
  64. package/dist/components/uploads/assets/index.js +1 -1
  65. package/dist/components/vizabi/__init__.py +13 -0
  66. package/dist/components/vizabi/assets/collection.js +22 -0
  67. package/dist/components/vizabi/assets/index.js +3 -0
  68. package/dist/components/vizabi/commands.json +7 -0
  69. package/dist/components/vizabi/grammar.json +128 -0
  70. package/dist/gramlot.js +1190 -256
  71. package/dist/gramlot.min.js +85 -52
  72. package/dist/standard-collections.js +2 -0
  73. package/package.json +12 -4
  74. package/src/binding/grid-struct.js +2 -2
  75. package/src/binding/runtime.js +10 -0
  76. package/src/binding/validation-context.js +2 -1
  77. package/src/bootstrap.js +1 -1
  78. package/src/builder/gramlot-builder.d.ts +15 -2
  79. package/src/builder/gramlot-builder.js +22 -3
  80. package/src/builder/source.js +24 -1
  81. package/src/components/audio-analysis-session.js +65 -0
  82. package/src/components/audio.js +44 -0
  83. package/src/components/bases.js +11 -7
  84. package/src/components/border-container.js +6 -3
  85. package/src/components/buttons.js +47 -3
  86. package/src/components/chart-bar3d-options.js +30 -0
  87. package/src/components/chart-controls.js +83 -0
  88. package/src/components/chart-data-view.js +52 -0
  89. package/src/components/chart-data.js +42 -0
  90. package/src/components/chart-domains.js +46 -0
  91. package/src/components/chart-engines/echarts-options.js +50 -0
  92. package/src/components/chart-engines/echarts.js +82 -0
  93. package/src/components/chart-engines/index.js +22 -0
  94. package/src/components/chart-engines/plotly-map.js +34 -0
  95. package/src/components/chart-engines/plotly-spatial.js +35 -0
  96. package/src/components/chart-engines/plotly.js +138 -0
  97. package/src/components/chart-engines/uplot.js +57 -0
  98. package/src/components/chart-engines/vega.js +101 -0
  99. package/src/components/chart-fields.js +110 -0
  100. package/src/components/chart-geographic-options.js +47 -0
  101. package/src/components/chart-geojson.js +60 -0
  102. package/src/components/chart-geometry.js +11 -0
  103. package/src/components/chart-map-anchors.js +24 -0
  104. package/src/components/chart-map-bar3d-options.js +41 -0
  105. package/src/components/chart-map-data.js +25 -0
  106. package/src/components/chart-map-labels.js +8 -0
  107. package/src/components/chart-map-options.js +20 -0
  108. package/src/components/chart-pane.js +91 -0
  109. package/src/components/chart-renderer.js +58 -0
  110. package/src/components/chart-sample-view.js +32 -0
  111. package/src/components/chart-spatial-options.js +40 -0
  112. package/src/components/chart-time.js +84 -0
  113. package/src/components/chart-timeline.js +70 -0
  114. package/src/components/chart-types/area.js +2 -0
  115. package/src/components/chart-types/bar.js +2 -0
  116. package/src/components/chart-types/bar3D.js +2 -0
  117. package/src/components/chart-types/donut.js +2 -0
  118. package/src/components/chart-types/horizontalBar.js +2 -0
  119. package/src/components/chart-types/index.js +26 -0
  120. package/src/components/chart-types/line.js +2 -0
  121. package/src/components/chart-types/line3D.js +2 -0
  122. package/src/components/chart-types/lines3D.js +2 -0
  123. package/src/components/chart-types/map.js +2 -0
  124. package/src/components/chart-types/map3D.js +2 -0
  125. package/src/components/chart-types/mapBar3D.js +2 -0
  126. package/src/components/chart-types/pie.js +2 -0
  127. package/src/components/chart-types/polygons3D.js +2 -0
  128. package/src/components/chart-types/scatter.js +2 -0
  129. package/src/components/chart-types/scatter3D.js +2 -0
  130. package/src/components/chart-types/stackedArea.js +2 -0
  131. package/src/components/chart-types/stackedBar.js +2 -0
  132. package/src/components/chart-types/surface.js +2 -0
  133. package/src/components/charts.js +152 -0
  134. package/src/components/check-box-text-editor.js +88 -0
  135. package/src/components/check-box-text.js +193 -0
  136. package/src/components/check-box-tree.js +62 -0
  137. package/src/components/choice-editor.js +35 -18
  138. package/src/components/choice-field-styles.js +14 -0
  139. package/src/components/choices.js +5 -0
  140. package/src/components/database-choices.js +9 -6
  141. package/src/components/drawing.js +199 -0
  142. package/src/components/field-state.js +8 -1
  143. package/src/components/grid-cell-editor.js +83 -19
  144. package/src/components/grid-check-sets.js +98 -0
  145. package/src/components/grid-column-filters.js +198 -0
  146. package/src/components/grid-grammar.json +65 -0
  147. package/src/components/grid-header-interaction.js +3 -1
  148. package/src/components/grid-rows.js +2 -2
  149. package/src/components/grid-search-box.js +38 -22
  150. package/src/components/grid-search-styles.js +13 -14
  151. package/src/components/grid-search.js +8 -1
  152. package/src/components/grid-structure.js +13 -2
  153. package/src/components/grid-styles.js +34 -2
  154. package/src/components/grid.js +67 -10
  155. package/src/components/image-uploader.js +2 -2
  156. package/src/components/inputs.js +21 -12
  157. package/src/components/labelbox.js +5 -1
  158. package/src/components/licenses/claygl.txt +23 -0
  159. package/src/components/licenses/echarts-gl.txt +29 -0
  160. package/src/components/licenses/plotly.txt +21 -0
  161. package/src/components/licenses/uplot.txt +21 -0
  162. package/src/components/licenses/vega.txt +27 -0
  163. package/src/components/menus.js +19 -11
  164. package/src/components/parameters.js +6 -2
  165. package/src/components/toolbar-overflow.js +12 -8
  166. package/src/components/tree.js +31 -8
  167. package/src/components/typed-editor.js +18 -7
  168. package/src/components/validation.js +1 -1
  169. package/src/components/vizabi-session.js +66 -0
  170. package/src/components/vizabi.js +66 -0
  171. package/src/components/window-surface.js +20 -9
  172. package/src/components/windows.js +1 -1
  173. package/src/editing-session.d.ts +1 -0
  174. package/src/editing-session.js +113 -15
  175. package/src/editor-values.js +57 -0
  176. package/src/gramlot.d.ts +2 -0
  177. package/src/gramlot.js +9 -4
  178. package/src/handlers/device-handler.js +32 -32
  179. package/src/handlers/source-handler.d.ts +2 -2
  180. package/src/ide-documents.js +19 -3
  181. package/src/ide-runtime.d.ts +1 -0
  182. package/src/ide-runtime.js +45 -31
  183. package/src/index.d.ts +2 -1
  184. package/src/renderer/drag-drop.js +1 -0
  185. package/src/renderer/gramlot-renderer.d.ts +3 -0
  186. package/src/renderer/gramlot-renderer.js +16 -4
  187. package/src/server/assets.d.ts +3 -0
  188. package/src/server/assets.js +9 -0
  189. package/src/server/gramlot-server.d.ts +1 -1
  190. package/src/server/gramlot-server.js +2 -1
  191. package/src/server/index.d.ts +1 -1
  192. package/src/server/index.js +1 -1
  193. package/src/server/source-import.d.ts +1 -1
  194. package/src/server/source-import.js +5 -1
  195. package/src/server/visual-editor.d.ts +1 -1
  196. package/src/server/visual-editor.js +44 -34
  197. package/src/source-picker.d.ts +1 -1
  198. package/src/source-picker.js +1 -2
  199. package/src/stores/bag-collection-view.js +79 -17
  200. package/src/stores/collection-filter.js +2 -1
  201. package/src/stores/column-filter.js +49 -0
  202. package/src/stores/id-set.js +10 -0
  203. package/src/view/controls.js +8 -0
  204. package/src/view/html.js +10 -1
  205. package/src/view/label-menu.js +61 -0
  206. package/src/view/labelbox.js +15 -2
  207. package/src/visual-editor-canvas.js +29 -0
  208. package/src/visual-editor-catalogue.js +34 -0
  209. package/src/visual-editor.d.ts +5 -0
  210. package/src/visual-editor.js +244 -26
  211. package/themes/gramlot-base/theme.css +84 -36
  212. package/tools/gramlot-tools-inspector.js +170 -506
  213. package/tools/inspector-agent.js +1 -1
@@ -0,0 +1,22 @@
1
+ var tu=Object.create;var Tn=Object.defineProperty;var ru=Object.getOwnPropertyDescriptor;var nu=Object.getOwnPropertyNames;var iu=Object.getPrototypeOf,su=Object.prototype.hasOwnProperty;var Pe=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Oi=(t,e)=>{for(var r in e)Tn(t,r,{get:e[r],enumerable:!0})},An=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of nu(e))!su.call(t,i)&&i!==r&&Tn(t,i,{get:()=>e[i],enumerable:!(n=ru(e,i))||n.enumerable});return t},Vt=(t,e,r)=>(An(t,e,"default"),r&&An(r,e,"default")),Bi=(t,e,r)=>(r=t!=null?tu(iu(t)):{},An(e||!t||!t.__esModule?Tn(r,"default",{value:t,enumerable:!0}):r,t));var st=Pe(re=>{"use strict";function Ia(t,e,r){if(r===void 0&&(r=Array.prototype),t&&typeof r.find=="function")return r.find.call(t,e);for(var n=0;n<t.length;n++)if(it(t,n)){var i=t[n];if(e.call(void 0,i,n,t))return i}}function wt(t,e){return e===void 0&&(e=Object),e&&typeof e.getOwnPropertyDescriptors=="function"&&(t=e.create(null,e.getOwnPropertyDescriptors(t))),e&&typeof e.freeze=="function"?e.freeze(t):t}function it(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Oa(t,e){if(t===null||typeof t!="object")throw new TypeError("target is not an object");for(var r in e)it(e,r)&&(t[r]=e[r]);return t}var hs=wt({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function Ba(t){return it(hs,t.toLowerCase())}var ds=wt({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ma(t){return it(ds,t.toLowerCase())}var Jt=wt({script:!1,style:!1,textarea:!0,title:!0});function Ra(t){var e=t.toLowerCase();return it(Jt,e)&&!Jt[e]}function Fa(t){var e=t.toLowerCase();return it(Jt,e)&&Jt[e]}function ps(t){return t===Zt.HTML}function ka(t){return ps(t)||t===Zt.XML_XHTML_APPLICATION}var Zt=wt({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),La=Object.keys(Zt).map(function(t){return Zt[t]});function Ua(t){return La.indexOf(t)>-1}var Pa=wt({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});re.assign=Oa;re.find=Ia;re.freeze=wt;re.HTML_BOOLEAN_ATTRIBUTES=hs;re.HTML_RAW_TEXT_ELEMENTS=Jt;re.HTML_VOID_ELEMENTS=ds;re.hasDefaultHTMLNamespace=ka;re.hasOwn=it;re.isHTMLBooleanAttribute=Ba;re.isHTMLRawTextElement=Ra;re.isHTMLEscapableRawTextElement=Fa;re.isHTMLMimeType=ps;re.isHTMLVoidElement=Ma;re.isValidMimeType=Ua;re.MIME_TYPE=Zt;re.NAMESPACE=Pa});var rr=Pe(tr=>{"use strict";var qa=st();function gs(t,e){t.prototype=Object.create(Error.prototype,{constructor:{value:t},name:{value:t.name,enumerable:!0,writable:e}})}var Kt=qa.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),Es=Object.keys(Kt);function ws(t){return typeof t=="number"&&t>=1&&t<=25}function $a(t){return typeof t=="string"&&t.substring(t.length-Kt.Error.length)===Kt.Error}function er(t,e){ws(t)?(this.name=Es[t],this.message=e||""):(this.message=t,this.name=$a(e)?e:Kt.Error),Error.captureStackTrace&&Error.captureStackTrace(this,er)}gs(er,!0);Object.defineProperties(er.prototype,{code:{enumerable:!0,get:function(){var t=Es.indexOf(this.name);return ws(t)?t:0}}});var ys={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},$n=Object.entries(ys);for(Qt=0;Qt<$n.length;Qt++)ms=$n[Qt][0],er[ms]=$n[Qt][1];var ms,Qt;function Vn(t,e,r){this.message=t,this.locator=e,this.cause=r,Error.captureStackTrace&&Error.captureStackTrace(this,Vn)}gs(Vn);tr.DOMException=er;tr.DOMExceptionName=Kt;tr.ExceptionCode=ys;tr.ParseError=Vn});var Gn=Pe(N=>{"use strict";function _s(t){try{typeof t!="function"&&(t=RegExp);var e=new t("\u{1D306}","u").exec("\u{1D306}");return!!e&&e[0].length===2}catch{}return!1}var At=_s();function He(t){if(t.source[0]!=="[")throw new Error(t+" can not be used with chars");return t.source.slice(1,t.source.lastIndexOf("]"))}function yt(t,e){if(t.source[0]!=="[")throw new Error("/"+t.source+"/ can not be used with chars_without");if(!e||typeof e!="string")throw new Error(JSON.stringify(e)+" is not a valid search");if(t.source.indexOf(e)===-1)throw new Error('"'+e+'" is not is /'+t.source+"/");if(e==="-"&&t.source.indexOf(e)!==1)throw new Error('"'+e+'" is not at the first postion of /'+t.source+"/");return new RegExp(t.source.replace(e,""),At?"u":"")}function I(t){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(r){var n=typeof r=="string";if(n&&e===void 0&&r==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?r:r.source}).join(""),At?"u":"")}function v(t){if(arguments.length===0)throw new Error("no parameters provided");return I.apply(v,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var Va="\uFFFD",Xe=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;At&&(Xe=I("[",He(Xe),"\\u{10000}-\\u{10FFFF}","]"));var ja=new RegExp("[^"+He(Xe)+"]",At?"u":""),qr=/[\x20\x09\x0D\x0A]/,za=He(qr),L=I(qr,"+"),q=I(qr,"*"),nr=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;At&&(nr=I("[",He(nr),"\\u{10000}-\\u{10FFFF}","]"));var Ha=He(nr),Hn=I("[",Ha,He(/[-.0-9\xB7]/),He(/[\u0300-\u036F\u203F-\u2040]/),"]"),pe=I(nr,Hn,"*"),Xa=I("^",pe,"$"),Ds=I(Hn,"+"),Ya=I("&",pe,";"),Wa=v(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),ir=v(Ya,"|",Wa),sr=I("%",pe,";"),Xn=v(I('"',v(/[^%&"]/,"|",sr,"|",ir),"*",'"'),"|",I("'",v(/[^%&']/,"|",sr,"|",ir),"*","'")),Ga=v('"',v(/[^<&"]/,"|",ir),"*",'"',"|","'",v(/[^<&']/,"|",ir),"*","'"),Ja=yt(nr,":"),Za=yt(Hn,":"),jn=I(Ja,Za,"*"),Qa=I("^",jn,"$"),or=I(jn,v(":",jn),"?"),Ka=I("^",or,"$"),el=I("(",or,")"),Dt=v(/"[^"]*"|'[^']*'/),tl=I(/^<\?/,"(",pe,")",v(L,"(?!",qr,")(",Xe,"*?)"),"?",/\?>/),As=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,ur=v('"',As,'*"',"|","'",yt(As,"'"),"*'"),Ns="<!--",xs="-->",rl=I(Ns,v(yt(Xe,"-"),"|",I("-",yt(Xe,"-"))),"*",xs),Ts="#PCDATA",nl=v(I(/\(/,q,Ts,v(q,/\|/,q,or),"*",q,/\)\*/),"|",I(/\(/,q,Ts,q,/\)/)),il=/[?*+]?/,sl=I(/\([^>]+\)/,il),ol=v("EMPTY","|","ANY","|",nl,"|",sl),ul="<!ELEMENT",al=I(ul,L,v(or,"|",sr),L,v(ol,"|",sr),q,">"),ll=I("NOTATION",L,/\(/,q,pe,v(q,/\|/,q,pe),"*",q,/\)/),cl=I(/\(/,q,Ds,v(q,/\|/,q,Ds),"*",q,/\)/),fl=v(ll,"|",cl),hl=v(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",fl),dl=v(/#REQUIRED|#IMPLIED/,"|",v(v("#FIXED",L),"?",Ga)),pl=v(L,pe,L,hl,L,dl),ml="<!ATTLIST",gl=I(ml,L,pe,pl,"*",q,">"),zn="about:legacy-compat",El=v('"'+zn+'"',"|","'"+zn+"'"),Yn="SYSTEM",$r="PUBLIC",Vr=v(v(Yn,L,Dt),"|",v($r,L,ur,L,Dt)),wl=I("^",v(v(Yn,L,"(?<SystemLiteralOnly>",Dt,")"),"|",v($r,L,"(?<PubidLiteral>",ur,")",L,"(?<SystemLiteral>",Dt,")"))),yl=I("^",ur,"$"),Dl=I("^",Dt,"$"),Al=v(L,"NDATA",L,pe),Tl=v(Xn,"|",v(Vr,Al,"?")),Cs="<!ENTITY",bl=I(Cs,L,pe,L,Tl,q,">"),vl=v(Xn,"|",Vr),_l=I(Cs,L,"%",L,pe,L,vl,q,">"),Nl=v(bl,"|",_l),xl=I($r,L,ur),Cl=I("<!NOTATION",L,pe,L,v(Vr,"|",xl),q,">"),Wn=I(q,"=",q),bs=/1[.]\d+/,Sl=I(L,"version",Wn,v("'",bs,"'","|",'"',bs,'"')),vs=/[A-Za-z][-A-Za-z0-9._]*/,Il=v(L,"encoding",Wn,v('"',vs,'"',"|","'",vs,"'")),Ol=v(L,"standalone",Wn,v("'",v("yes","|","no"),"'","|",'"',v("yes","|","no"),'"')),Bl=I(/^<\?xml/,Sl,Il,"?",Ol,"?",q,/\?>/),Ml="<!DOCTYPE",Rl="<![CDATA[",Fl="]]>",kl=/<!\[CDATA\[/,Ll=/\]\]>/,Ul=I(Xe,"*?",Ll),Pl=I(kl,Ul);N.chars=He;N.chars_without=yt;N.detectUnicodeSupport=_s;N.reg=I;N.regg=v;N.ABOUT_LEGACY_COMPAT=zn;N.ABOUT_LEGACY_COMPAT_SystemLiteral=El;N.AttlistDecl=gl;N.CDATA_START=Rl;N.CDATA_END=Fl;N.CDSect=Pl;N.Char=Xe;N.Comment=rl;N.COMMENT_START=Ns;N.COMMENT_END=xs;N.DOCTYPE_DECL_START=Ml;N.elementdecl=al;N.EntityDecl=Nl;N.EntityValue=Xn;N.ExternalID=Vr;N.ExternalID_match=wl;N.Name=pe;N.Name_exact=Xa;N.NCName_exact=Qa;N.NotationDecl=Cl;N.Reference=ir;N.PEReference=sr;N.PI=tl;N.PUBLIC=$r;N.PubidLiteral=ur;N.PubidLiteral_match=yl;N.QName=or;N.QName_exact=Ka;N.QName_group=el;N.S=L;N.SChar_s=za;N.S_OPT=q;N.SYSTEM=Yn;N.SystemLiteral=Dt;N.SystemLiteral_match=Dl;N.InvalidChar=ja;N.UNICODE_REPLACEMENT_CHARACTER=Va;N.UNICODE_SUPPORT=At;N.XMLDecl=Bl});var si=Pe(j=>{"use strict";var ye=st(),Ie=ye.find,ql=ye.hasDefaultHTMLNamespace,bt=ye.hasOwn,$l=ye.isHTMLMimeType,Vl=ye.isHTMLRawTextElement,jl=ye.isHTMLVoidElement,ar=ye.MIME_TYPE,Oe=ye.NAMESPACE,le=Symbol(),Fs=rr(),y=Fs.DOMException,ue=Fs.DOMExceptionName,V=Gn();function fe(t){if(t!==le)throw new TypeError("Illegal constructor")}function zl(t){return t!==""}function Hl(t){return t?t.split(/[\t\n\f\r ]+/).filter(zl):[]}function Xl(t,e){return bt(t,e)||(t[e]=!0),t}function Ss(t){if(!t)return[];var e=Hl(t);return Object.keys(e.reduce(Xl,{}))}function Yl(t){return function(e){return t&&t.indexOf(e)!==-1}}function ks(t){if(!V.QName_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+t+'"')}function Zn(t,e){ks(e),t=t||null;var r=null,n=e;if(e.indexOf(":")>=0){var i=e.split(":");r=i[0],n=i[1]}if(r!==null&&t===null)throw new y(y.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(r==="xml"&&t!==ye.NAMESPACE.XML)throw new y(y.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((r==="xmlns"||e==="xmlns")&&t!==ye.NAMESPACE.XMLNS)throw new y(y.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(t===ye.NAMESPACE.XMLNS&&r!=="xmlns"&&e!=="xmlns")throw new y(y.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[t,r,n]}function Nt(t,e){for(var r in t)bt(t,r)&&(e[r]=t[r])}function he(t,e){var r=t.prototype;if(!(r instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,Nt(r,n),t.prototype=r=n}r.constructor!=t&&(typeof t!="function"&&console.error("unknown Class:"+t),r.constructor=t)}var de={},we=de.ELEMENT_NODE=1,vt=de.ATTRIBUTE_NODE=2,lr=de.TEXT_NODE=3,Ls=de.CDATA_SECTION_NODE=4,Us=de.ENTITY_REFERENCE_NODE=5,Wl=de.ENTITY_NODE=6,Qn=de.PROCESSING_INSTRUCTION_NODE=7,Kn=de.COMMENT_NODE=8,Tt=de.DOCUMENT_NODE=9,Ps=de.DOCUMENT_TYPE_NODE=10,Ye=de.DOCUMENT_FRAGMENT_NODE=11,Gl=de.NOTATION_NODE=12,$=ye.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function qs(t,e){if(e.length<t.length)return qs(e,t);var r=null;for(var n in t){if(t[n]!==e[n])return r;r=t[n]}return r}function Is(t){return t.guid||(t.guid=Math.random()),t.guid}function J(){}J.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t){var e;typeof t=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:t}:t?e={requireWellFormed:!!t.requireWellFormed,splitCDATASections:t.splitCDATASections!==!1,nodeFilter:t.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var r=[],n=0;n<this.length;n++)ii(this[n],r,null,e);return r.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}};J.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Se(t,e){this._node=t,this._refresh=e,Xr(this)}function Xr(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var r=t._refresh(t._node);if(Zs(t,"length",r.length),!t.$$length||r.length<t.$$length)for(var n=r.length;n in t;n++)bt(t,n)&&delete t[n];Nt(r,t),t._inc=e}}Se.prototype.item=function(t){return Xr(this),this[t]||null};he(Se,J);function _t(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function $s(t,e){for(var r=0;r<t.length;){if(t[r]===e)return r;r++}}function ei(t,e,r){if(!e)return t._noNsIndex;var n=t._nsIndex[e];return!n&&r&&(n=t._nsIndex[e]=Object.create(null)),n}function Jl(t,e,r){var n=ei(t,e,!1),i=n&&n[r];return i||null}function Zl(t,e){ei(t,e.namespaceURI,!0)[e.localName]=e}function Ql(t,e){var r=ei(t,e.namespaceURI,!1);r&&delete r[e.localName]}function Kl(t,e,r,n){if(n?e[$s(e,n)]=r:(e[e.length]=r,e.length++),Zl(e,r),t){r.ownerElement=t;var i=t.ownerDocument;i&&(n&&zs(i,t,n),ec(i,t,r))}}function Os(t,e,r){var n=$s(e,r);if(n>=0){for(var i=e.length-1;n<=i;)e[n]=e[++n];if(e.length=i,Ql(e,r),t){var s=t.ownerDocument;s&&zs(s,t,r),r.ownerElement=null}}}_t.prototype={length:0,item:J.prototype.item,getNamedItem:function(t){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());for(var e=0;e<this.length;){var r=this[e];if(r.nodeName===t)return r;e++}return null},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!==this._ownerElement)throw new y(y.INUSE_ATTRIBUTE_ERR);var r=Jl(this,t.namespaceURI,t.localName);return r===t?t:(Kl(this._ownerElement,this,t,r),r)},setNamedItemNS:function(t){return this.setNamedItem(t)},removeNamedItem:function(t){var e=this.getNamedItem(t);if(!e)throw new y(y.NOT_FOUND_ERR,t);return Os(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var r=this.getNamedItemNS(t,e);if(!r)throw new y(y.NOT_FOUND_ERR,t?t+" : "+e:e);return Os(this._ownerElement,this,r),r},getNamedItemNS:function(t,e){t||(t=null);for(var r=0;r<this.length;){var n=this[r];if(n.localName===e&&n.namespaceURI===t)return n;r++}return null}};_t.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Vs(){}Vs.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,r){var n=ar.XML_APPLICATION;t===Oe.HTML?n=ar.XML_XHTML_APPLICATION:t===Oe.SVG&&(n=ar.XML_SVG_IMAGE);var i=new Le(le,{contentType:n});if(i.implementation=this,i.childNodes=new J,i.doctype=r||null,r&&i.appendChild(r),e){var s=i.createElementNS(t,e);i.appendChild(s)}return i},createDocumentType:function(t,e,r,n){ks(t);var i=new Gr(le);return i.name=t,i.nodeName=t,i.publicId=e||"",i.systemId=r||"",i.internalSubset=n||"",i.childNodes=new J,i},createHTMLDocument:function(t){var e=new Le(le,{contentType:ar.HTML});if(e.implementation=this,e.childNodes=new J,t!==!1){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var r=e.createElement("html");e.appendChild(r);var n=e.createElement("head");if(r.appendChild(n),typeof t=="string"){var i=e.createElement("title");i.appendChild(e.createTextNode(t)),n.appendChild(i)}r.appendChild(e.createElement("body"))}return e}};function B(t){fe(t)}B.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var t=this.getRootNode();return t&&t.nodeType===t.DOCUMENT_NODE},contains:function(t){if(!t)return!1;var e=t;do{if(this===e)return!0;e=e.parentNode}while(e);return!1},getRootNode:function(t){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},isEqualNode:function(t){if(!t)return!1;for(var e=[{node:this,other:t}];e.length>0;){var r=e.pop(),n=r.node,i=r.other;if(n.nodeType!==i.nodeType)return!1;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==i.name||n.publicId!==i.publicId||n.systemId!==i.systemId)return!1;break;case n.ELEMENT_NODE:if(n.namespaceURI!==i.namespaceURI||n.prefix!==i.prefix||n.localName!==i.localName||n.attributes.length!==i.attributes.length)return!1;for(var s=0;s<n.attributes.length;s++){var o=n.attributes.item(s),u=i.getAttributeNodeNS(o.namespaceURI,o.localName);if(!u)return!1;e.push({node:o,other:u})}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==i.namespaceURI||n.localName!==i.localName||n.value!==i.value)return!1;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==i.target||n.data!==i.data)return!1;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==i.data)return!1;break}if(n.childNodes.length!==i.childNodes.length)return!1;for(var s=n.childNodes.length-1;s>=0;s--)e.push({node:n.childNodes[s],other:i.childNodes[s]})}return!0},isSameNode:function(t){return this===t},insertBefore:function(t,e){return Hr(this,t,e)},replaceChild:function(t,e){Hr(this,t,e,Ys),e&&this.removeChild(e)},removeChild:function(t){return Hs(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(t){return Js(this.ownerDocument||this,this,t)},normalize:function(){ne(this,null,{enter:function(t){for(var e=t.firstChild;e;){var r=e.nextSibling;if(r!==null&&r.nodeType===lr&&e.nodeType===lr){for(var n=[],i=r;i!==null&&i.nodeType===lr;)n.push(i.data),i=i.nextSibling;for(var s=e.nextSibling;s!==i;){var o=s.nextSibling;s.parentNode=null,s.previousSibling=null,s.nextSibling=null,s=o}e.nextSibling=i,i!==null?i.previousSibling=e:t.lastChild=e,e.appendData(n.join("")),ti(t.ownerDocument,t),e=i}else e=r}return!0}})},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},lookupPrefix:function(t){for(var e=this;e;){var r=e._nsMap;if(r){for(var n in r)if(bt(r,n)&&r[n]===t)return n}e=e.nodeType==vt?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var r=e._nsMap;if(r&&bt(r,t))return r[t];e=e.nodeType==vt?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return e==null},compareDocumentPosition:function(t){if(this===t)return 0;var e=t,r=this,n=null,i=null;if(e instanceof ot&&(n=e,e=n.ownerElement),r instanceof ot&&(i=r,r=i.ownerElement,n&&e&&r===e))for(var s=0,o;o=r.attributes[s];s++){if(o===n)return $.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+$.DOCUMENT_POSITION_PRECEDING;if(o===i)return $.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+$.DOCUMENT_POSITION_FOLLOWING}if(!e||!r||r.ownerDocument!==e.ownerDocument)return $.DOCUMENT_POSITION_DISCONNECTED+$.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(Is(r.ownerDocument)>Is(e.ownerDocument)?$.DOCUMENT_POSITION_FOLLOWING:$.DOCUMENT_POSITION_PRECEDING);if(i&&e===r)return $.DOCUMENT_POSITION_CONTAINS+$.DOCUMENT_POSITION_PRECEDING;if(n&&e===r)return $.DOCUMENT_POSITION_CONTAINED_BY+$.DOCUMENT_POSITION_FOLLOWING;for(var u=[],l=e.parentNode;l;){if(!i&&l===r)return $.DOCUMENT_POSITION_CONTAINED_BY+$.DOCUMENT_POSITION_FOLLOWING;u.push(l),l=l.parentNode}u.reverse();for(var a=[],c=r.parentNode;c;){if(!n&&c===e)return $.DOCUMENT_POSITION_CONTAINS+$.DOCUMENT_POSITION_PRECEDING;a.push(c),c=c.parentNode}a.reverse();var f=qs(u,a);for(var h in f.childNodes){var d=f.childNodes[h];if(d===r)return $.DOCUMENT_POSITION_FOLLOWING;if(d===e)return $.DOCUMENT_POSITION_PRECEDING;if(a.indexOf(d)>=0)return $.DOCUMENT_POSITION_FOLLOWING;if(u.indexOf(d)>=0)return $.DOCUMENT_POSITION_PRECEDING}return 0}};function js(t){return t=="<"&&"&lt;"||t==">"&&"&gt;"||t=="&"&&"&amp;"||t=='"'&&"&quot;"||"&#"+t.charCodeAt()+";"}Nt(de,B);Nt(de,B.prototype);Nt($,B);Nt($,B.prototype);function zr(t,e){ne(t,null,{enter:function(r){return e(r)?ne.STOP:!0}})}function ne(t,e,r){for(var n=[{node:t,context:e,phase:ne.ENTER}];n.length>0;){var i=n.pop();if(i.phase===ne.ENTER){var s=r.enter(i.node,i.context);if(s===ne.STOP)return ne.STOP;if(n.push({node:i.node,context:s,phase:ne.EXIT}),s==null)continue;for(var o=i.node.lastChild;o;)n.push({node:o,context:s,phase:ne.ENTER}),o=o.previousSibling}else r.exit&&r.exit(i.node,i.context)}}ne.STOP=Symbol("walkDOM.STOP");ne.ENTER=0;ne.EXIT=1;function Le(t,e){fe(t);var r=e||{};this.ownerDocument=this,this.contentType=r.contentType||ar.XML_APPLICATION,this.type=$l(this.contentType)?"html":"xml"}function ec(t,e,r){t&&t._inc++;var n=r.namespaceURI;n===Oe.XMLNS&&(e._nsMap[r.prefix?r.localName:""]=r.value)}function zs(t,e,r,n){t&&t._inc++;var i=r.namespaceURI;i===Oe.XMLNS&&delete e._nsMap[r.prefix?r.localName:""]}function ti(t,e,r){if(t&&t._inc){t._inc++;var n=e.childNodes;if(r&&!r.nextSibling)n[n.length++]=r;else{for(var i=e.firstChild,s=0;i;)n[s++]=i,i=i.nextSibling;n.length=s,delete n[n.length]}}}function Hs(t,e){if(t!==e.parentNode)throw new y(y.NOT_FOUND_ERR,"child's parent is not parent");var r=e.previousSibling,n=e.nextSibling;return r?r.nextSibling=n:t.firstChild=n,n?n.previousSibling=r:t.lastChild=r,ti(t.ownerDocument,t),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function tc(t){return t&&(t.nodeType===B.DOCUMENT_NODE||t.nodeType===B.DOCUMENT_FRAGMENT_NODE||t.nodeType===B.ELEMENT_NODE)}function rc(t){return t&&(t.nodeType===B.CDATA_SECTION_NODE||t.nodeType===B.COMMENT_NODE||t.nodeType===B.DOCUMENT_FRAGMENT_NODE||t.nodeType===B.DOCUMENT_TYPE_NODE||t.nodeType===B.ELEMENT_NODE||t.nodeType===B.PROCESSING_INSTRUCTION_NODE||t.nodeType===B.TEXT_NODE)}function We(t){return t&&t.nodeType===B.DOCUMENT_TYPE_NODE}function ke(t){return t&&t.nodeType===B.ELEMENT_NODE}function Xs(t){return t&&t.nodeType===B.TEXT_NODE}function Bs(t,e){var r=t.childNodes||[];if(Ie(r,ke)||We(e))return!1;var n=Ie(r,We);return!(e&&n&&r.indexOf(n)>r.indexOf(e))}function Ms(t,e){var r=t.childNodes||[];function n(s){return ke(s)&&s!==e}if(Ie(r,n))return!1;var i=Ie(r,We);return!(e&&i&&r.indexOf(i)>r.indexOf(e))}function nc(t,e,r){if(!tc(t))throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+t.nodeType);if(r&&r.parentNode!==t)throw new y(y.NOT_FOUND_ERR,"child not in parent");if(!rc(e)||We(e)&&t.nodeType!==B.DOCUMENT_NODE)throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function ic(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===B.DOCUMENT_FRAGMENT_NODE){var s=i.filter(ke);if(s.length>1||Ie(i,Xs))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(s.length===1&&!Bs(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ke(e)&&!Bs(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(We(e)){if(Ie(n,We))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var o=Ie(n,ke);if(r&&n.indexOf(o)<n.indexOf(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!r&&o)throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function Ys(t,e,r){var n=t.childNodes||[],i=e.childNodes||[];if(e.nodeType===B.DOCUMENT_FRAGMENT_NODE){var s=i.filter(ke);if(s.length>1||Ie(i,Xs))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(s.length===1&&!Ms(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ke(e)&&!Ms(t,r))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(We(e)){if(Ie(n,function(l){return We(l)&&l!==r}))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var o=Ie(n,ke);if(r&&n.indexOf(o)<n.indexOf(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function Hr(t,e,r,n){nc(t,e,r),t.nodeType===B.DOCUMENT_NODE&&(n||ic)(t,e,r);var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===Ye){var s=e.firstChild;if(s==null)return e;var o=e.lastChild}else s=o=e;var u=r?r.previousSibling:t.lastChild;s.previousSibling=u,o.nextSibling=r,u?u.nextSibling=s:t.firstChild=s,r==null?t.lastChild=o:r.previousSibling=o;do s.parentNode=t;while(s!==o&&(s=s.nextSibling));return ti(t.ownerDocument||t,t,e),e.nodeType==Ye&&(e.firstChild=e.lastChild=null),e}Le.prototype={implementation:null,nodeName:"#document",nodeType:Tt,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType===Ye){for(var r=t.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,e),r=n}return t}return Hr(this,t,e),t.ownerDocument=this,this.documentElement===null&&t.nodeType===we&&(this.documentElement=t),t},removeChild:function(t){var e=Hs(this,t);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(t,e){Hr(this,t,e,Ys),t.ownerDocument=this,e&&this.removeChild(e),ke(t)&&(this.documentElement=t)},importNode:function(t,e){return sc(this,t,e)},getElementById:function(t){var e=null;return zr(this.documentElement,function(r){if(r.nodeType==we&&r.getAttribute("id")==t)return e=r,!0}),e},createElement:function(t){var e=new Ue(le);e.ownerDocument=this,this.type==="html"&&(t=t.toLowerCase()),ql(this.contentType)&&(e.namespaceURI=Oe.HTML),e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new J;var r=e.attributes=new _t;return r._ownerElement=e,e},createDocumentFragment:function(){var t=new xt(le);return t.ownerDocument=this,t.childNodes=new J,t},createTextNode:function(t){var e=new cr(le);return e.ownerDocument=this,e.childNodes=new J,e.appendData(t),e},createComment:function(t){var e=new Yr(le);return e.ownerDocument=this,e.childNodes=new J,e.appendData(t),e},createCDATASection:function(t){if(t.indexOf("]]>")!==-1)throw new y(y.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new Wr(le);return e.ownerDocument=this,e.childNodes=new J,e.appendData(t),e},createProcessingInstruction:function(t,e){var r=new Zr(le);return r.ownerDocument=this,r.childNodes=new J,r.nodeName=r.target=t,r.nodeValue=r.data=e,r},createAttribute:function(t){if(!V.QName_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in name "'+t+'"');return this.type==="html"&&(t=t.toLowerCase()),this._createAttribute(t)},_createAttribute:function(t){var e=new ot(le);return e.ownerDocument=this,e.childNodes=new J,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){if(!V.Name_exact.test(t))throw new y(y.INVALID_CHARACTER_ERR,'not a valid xml name "'+t+'"');if(this.type==="html")throw new y("document is an html document",ue.NotSupportedError);var e=new Jr(le);return e.ownerDocument=this,e.childNodes=new J,e.nodeName=t,e},createElementNS:function(t,e){var r=Zn(t,e),n=new Ue(le),i=n.attributes=new _t;return n.childNodes=new J,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],i._ownerElement=n,n},createAttributeNS:function(t,e){var r=Zn(t,e),n=new ot(le);return n.ownerDocument=this,n.childNodes=new J,n.nodeName=e,n.name=e,n.specified=!0,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],n}};he(Le,B);function Ue(t){fe(t),this._nsMap=Object.create(null)}Ue.prototype={nodeType:we,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===Oe.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(t){return!!this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e?e.value:null},getAttributeNode:function(t){return this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase()),this.attributes.getNamedItem(t)},setAttribute:function(t,e){this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());var r=this.getAttributeNode(t);r?r.value=r.nodeValue=""+e:(r=this.ownerDocument._createAttribute(t),r.value=r.nodeValue=""+e,this.setAttributeNode(r))},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);r&&this.removeAttributeNode(r)},hasAttributeNS:function(t,e){return this.getAttributeNodeNS(t,e)!=null},getAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);return r?r.value:null},setAttributeNS:function(t,e,r){var n=Zn(t,e),i=n[2],s=this.getAttributeNodeNS(t,i);s?s.value=s.nodeValue=""+r:(s=this.ownerDocument.createAttributeNS(t,e),s.value=s.nodeValue=""+r,this.setAttributeNode(s))},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByClassName:function(t){var e=Ss(t);return new Se(this,function(r){var n=[];return e.length>0&&zr(r,function(i){if(i!==r&&i.nodeType===we){var s=i.getAttribute("class");if(s){var o=t===s;if(!o){var u=Ss(s);o=e.every(Yl(u))}o&&n.push(i)}}}),n})},getElementsByTagName:function(t){var e=(this.nodeType===Tt?this:this.ownerDocument).type==="html",r=t.toLowerCase();return new Se(this,function(n){var i=[];return zr(n,function(s){if(!(s===n||s.nodeType!==we))if(t==="*")i.push(s);else{var o=s.getQualifiedName(),u=e&&s.namespaceURI===Oe.HTML?r:t;o===u&&i.push(s)}}),i})},getElementsByTagNameNS:function(t,e){return new Se(this,function(r){var n=[];return zr(r,function(i){i!==r&&i.nodeType===we&&(t==="*"||i.namespaceURI===t)&&(e==="*"||i.localName==e)&&n.push(i)}),n})}};Le.prototype.getElementsByClassName=Ue.prototype.getElementsByClassName;Le.prototype.getElementsByTagName=Ue.prototype.getElementsByTagName;Le.prototype.getElementsByTagNameNS=Ue.prototype.getElementsByTagNameNS;he(Ue,B);function ot(t){fe(t),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}ot.prototype.nodeType=vt;he(ot,B);function Ge(t){fe(t)}Ge.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,r){var n=this.data.substring(0,t),i=this.data.substring(t+e);r=n+r+i,this.nodeValue=this.data=r,this.length=r.length}};he(Ge,B);function cr(t){fe(t)}cr.prototype={nodeName:"#text",nodeType:lr,splitText:function(t){var e=this.data,r=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};he(cr,Ge);function Yr(t){fe(t)}Yr.prototype={nodeName:"#comment",nodeType:Kn};he(Yr,Ge);function Wr(t){fe(t)}Wr.prototype={nodeName:"#cdata-section",nodeType:Ls};he(Wr,cr);function Gr(t){fe(t)}Gr.prototype.nodeType=Ps;he(Gr,B);function ri(t){fe(t)}ri.prototype.nodeType=Gl;he(ri,B);function ni(t){fe(t)}ni.prototype.nodeType=Wl;he(ni,B);function Jr(t){fe(t)}Jr.prototype.nodeType=Us;he(Jr,B);function xt(t){fe(t)}xt.prototype.nodeName="#document-fragment";xt.prototype.nodeType=Ye;he(xt,B);function Zr(t){fe(t)}Zr.prototype.nodeType=Qn;he(Zr,Ge);function Ws(){}Ws.prototype.serializeToString=function(t,e){return Gs.call(t,e)};B.prototype.toString=Gs;function Gs(t){var e;typeof t=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:t}:t!=null?e={requireWellFormed:!!t.requireWellFormed,splitCDATASections:t.splitCDATASections!==!1,nodeFilter:t.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var r=[],n=this.nodeType===Tt&&this.documentElement||this,i=n.prefix,s=n.namespaceURI;if(s&&i==null){var i=n.lookupPrefix(s);if(i==null)var o=[{namespace:s,prefix:null}]}return ii(this,r,o,e),r.join("")}function Rs(t,e,r){var n=t.prefix||"",i=t.namespaceURI;if(!i||n==="xml"&&i===Oe.XML||i===Oe.XMLNS)return!1;for(var s=r.length;s--;){var o=r[s];if(o.prefix===n)return o.namespace!==i}return!0}function jr(t,e,r,n){if(n&&!V.QName_exact.test(e))throw new y('The attribute name "'+e+'" is not a valid XML QName',ue.InvalidStateError);t.push(" ",e,'="',r.replace(/[<>&"\t\n\r]/g,js),'"')}function ii(t,e,r,n){r||(r=[]);var i=n.nodeFilter,s=n.requireWellFormed,o=n.splitCDATASections,u=t.nodeType===Tt?t:t.ownerDocument,l=u.type==="html";ne(t,{ns:r},{enter:function(a,c){var f=c.ns;if(i)if(a=i(a),a){if(typeof a=="string")return e.push(a),null}else return null;switch(a.nodeType){case we:var h=a.attributes,d=h.length,m=a.tagName,p=m;if(!l&&!a.prefix&&a.namespaceURI){for(var g,w=0;w<h.length;w++)if(h.item(w).name==="xmlns"){g=h.item(w).value;break}if(!g)for(var T=f.length-1;T>=0;T--){var D=f[T];if(D.prefix===""&&D.namespace===a.namespaceURI){g=D.namespace;break}}if(g!==a.namespaceURI)for(var T=f.length-1;T>=0;T--){var D=f[T];if(D.namespace===a.namespaceURI){D.prefix&&(p=D.prefix+":"+m);break}}}if(s&&!V.QName_exact.test(p))throw new y('The element name "'+p+'" is not a valid XML QName',ue.InvalidStateError);e.push("<",p);for(var x=f.slice(),O=0;O<d;O++){var R=h.item(O);R.prefix=="xmlns"?x.push({prefix:R.localName,namespace:R.value}):R.nodeName=="xmlns"&&x.push({prefix:"",namespace:R.value})}for(var O=0;O<d;O++){var R=h.item(O);if(Rs(R,l,x)){var H=R.prefix||"",Q=R.namespaceURI;jr(e,H?"xmlns:"+H:"xmlns",Q,s),x.push({prefix:H,namespace:Q})}var K=i?i(R):R;K&&(typeof K=="string"?e.push(K):jr(e,K.name,K.value,s))}if(m===p&&Rs(a,l,x)){var Me=a.prefix||"",Q=a.namespaceURI;jr(e,Me?"xmlns:"+Me:"xmlns",Q,s),x.push({prefix:Me,namespace:Q})}var W=!a.firstChild;if(W&&(l||a.namespaceURI===Oe.HTML)&&(W=jl(m)),W)return e.push("/>"),null;if(e.push(">"),l&&Vl(m)){for(var ae=a.firstChild;ae;)ae.data?e.push(ae.data):ii(ae,e,x.slice(),n),ae=ae.nextSibling;return e.push("</",p,">"),null}return{ns:x,tag:p};case Tt:case Ye:if(s&&a.nodeType===Tt&&a.documentElement==null)throw new y("The Document has no documentElement",ue.InvalidStateError);return{ns:f};case vt:return jr(e,a.name,a.value,s),null;case lr:if(s&&V.InvalidChar.test(a.data))throw new y("The Text node data contains characters outside the XML Char production",ue.InvalidStateError);return e.push(a.data.replace(/[<&>]/g,js)),null;case Ls:if(s&&a.data.indexOf("]]>")!==-1)throw new y('The CDATASection data contains "]]>"',ue.InvalidStateError);return o?e.push(V.CDATA_START,a.data.replace(/]]>/g,"]]]]><![CDATA[>"),V.CDATA_END):e.push(V.CDATA_START,a.data,V.CDATA_END),null;case Kn:if(s){if(V.InvalidChar.test(a.data))throw new y("The comment node data contains characters outside the XML Char production",ue.InvalidStateError);if(a.data.indexOf("--")!==-1||a.data[a.data.length-1]==="-")throw new y('The comment node data contains "--" or ends with "-"',ue.InvalidStateError)}return e.push(V.COMMENT_START,a.data,V.COMMENT_END),null;case Ps:var ge=a.publicId,U=a.systemId;if(s){if(!V.Name_exact.test(a.name))throw new y('The doctype name "'+a.name+'" is not a valid XML Name',ue.InvalidStateError);if(ge&&!V.PubidLiteral_match.test(ge))throw new y("DocumentType publicId is not a valid PubidLiteral",ue.InvalidStateError);if(U&&U!=="."&&!V.SystemLiteral_match.test(U))throw new y("DocumentType systemId is not a valid SystemLiteral",ue.InvalidStateError);if(a.internalSubset&&a.internalSubset.indexOf("]>")!==-1)throw new y('DocumentType internalSubset contains "]>"',ue.InvalidStateError)}return e.push(V.DOCTYPE_DECL_START," ",a.name),ge?(e.push(" ",V.PUBLIC," ",ge),U&&U!=="."&&e.push(" ",U)):U&&U!=="."&&e.push(" ",V.SYSTEM," ",U),a.internalSubset&&e.push(" [",a.internalSubset,"]"),e.push(">"),null;case Qn:if(s){if(!V.NCName_exact.test(a.target)||a.target.toLowerCase()==="xml")throw new y('The processing instruction target "'+a.target+'" is not a valid XML NCName or is reserved',ue.InvalidStateError);if(V.InvalidChar.test(a.data))throw new y("The ProcessingInstruction data contains characters outside the XML Char production",ue.InvalidStateError);if(a.data.indexOf("?>")!==-1)throw new y('The ProcessingInstruction data contains "?>"',ue.InvalidStateError)}return e.push("<?",a.target," ",a.data,"?>"),null;case Us:if(s&&!V.Name_exact.test(a.nodeName))throw new y('The entity reference name "'+a.nodeName+'" is not a valid XML Name',ue.InvalidStateError);return e.push("&",a.nodeName,";"),null;default:return e.push("??",a.nodeName),null}},exit:function(a,c){c&&c.tag&&e.push("</",c.tag,">")}})}function sc(t,e,r){var n;return ne(e,null,{enter:function(i,s){var o=i.cloneNode(!1);o.ownerDocument=t,o.parentNode=null,s===null?n=o:s.appendChild(o);var u=i.nodeType===vt||r;return u?o:null}}),n}function Js(t,e,r){var n;return ne(e,null,{enter:function(i,s){var o=new i.constructor(le);for(var u in i)if(bt(i,u)){var l=i[u];typeof l!="object"&&l!=o[u]&&(o[u]=l)}i.childNodes&&(o.childNodes=new J),o.ownerDocument=t;var a=r;switch(o.nodeType){case we:var c=i.attributes,f=o.attributes=new _t,h=c.length;f._ownerElement=o;for(var d=0;d<h;d++)o.setAttributeNode(Js(t,c.item(d),!0));break;case vt:a=!0}return s!==null?s.appendChild(o):n=o,a?o:null}}),n}function Zs(t,e,r){t[e]=r}function Jn(t){for(var e=[],r=t.firstChild;r;)r.nodeType===we&&e.push(r),r=r.nextSibling;return e}try{Object.defineProperty&&(Object.defineProperty(Se.prototype,"length",{get:function(){return Xr(this),this.$$length}}),Object.defineProperty(B.prototype,"textContent",{get:function(){if(this.nodeType===we||this.nodeType===Ye){var t=[];return ne(this,null,{enter:function(e){if(e.nodeType===we||e.nodeType===Ye)return!0;if(e.nodeType===Qn||e.nodeType===Kn)return null;t.push(e.nodeValue)}}),t.join("")}return this.nodeValue},set:function(t){switch(this.nodeType){case we:case Ye:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),Object.defineProperty(Ge.prototype,"data",{get:function(){return this._data!=null?this._data:""},set:function(t){this._data=t,this.length=typeof t=="string"?t.length:0}}),Object.defineProperty(Ge.prototype,"nodeValue",{get:function(){return this.data},set:function(t){this.data=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ue.prototype,"children",{get:function(){return new Se(this,Jn)}}),Object.defineProperty(Le.prototype,"children",{get:function(){return new Se(this,Jn)}}),Object.defineProperty(xt.prototype,"children",{get:function(){return new Se(this,Jn)}}),Zs=function(t,e,r){t["$$"+e]=r})}catch{}j._updateLiveList=Xr;j.Attr=ot;j.CDATASection=Wr;j.CharacterData=Ge;j.Comment=Yr;j.Document=Le;j.DocumentFragment=xt;j.DocumentType=Gr;j.DOMImplementation=Vs;j.Element=Ue;j.Entity=ni;j.EntityReference=Jr;j.LiveNodeList=Se;j.NamedNodeMap=_t;j.Node=B;j.NodeList=J;j.Notation=ri;j.Text=cr;j.ProcessingInstruction=Zr;j.walkDOM=ne;j.XMLSerializer=Ws});var Ks=Pe(fr=>{"use strict";var Qs=st().freeze;fr.XML_ENTITIES=Qs({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});fr.HTML_ENTITIES=Qs({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
2
+ `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});fr.entityMap=fr.HTML_ENTITIES});var ao=Pe(Kr=>{"use strict";var Bt=st(),C=Gn(),no=rr(),oc=Bt.isHTMLEscapableRawTextElement,uc=Bt.isHTMLMimeType,ac=Bt.isHTMLRawTextElement,pr=Bt.hasOwn,eo=Bt.NAMESPACE,lc=no.ParseError,cc=no.DOMException,Ct=0,Je=1,St=2,hr=3,It=4,Ot=5,dr=6,Qr=7;function io(){}io.prototype={parse:function(t,e,r){var n=this.domBuilder;n.startDocument(),pc(e,e=Object.create(null)),fc(t,e,r,n,this.errorHandler),n.endDocument()}};var oi=/&#?\w+;?/g;function fc(t,e,r,n,i){var s=uc(n.mimeType);t.indexOf(C.UNICODE_REPLACEMENT_CHARACTER)>=0&&i.warning("Unicode replacement character detected, source encoding issues?");function o(F){if(F>65535){F-=65536;var Ee=55296+(F>>10),br=56320+(F&1023);return String.fromCharCode(Ee,br)}else return String.fromCharCode(F)}function u(F){var Ee=F[F.length-1]===";"?F:F+";";if(!s&&Ee!==F)return i.error("EntityRef: expecting ;"),F;var br=C.Reference.exec(Ee);if(!br||br[0].length!==Ee.length)return i.error("entity not matching Reference production: "+F),F;var vr=Ee.slice(1,-1);return pr(r,vr)?r[vr]:vr.charAt(0)==="#"?o(parseInt(vr.substring(1).replace("x","0x"))):(i.error("entity not found:"+F),F)}function l(F){if(F>g){var Ee=t.substring(g,F).replace(oi,u);h&&d(g),n.characters(Ee,0,F-g),g=F}}var a=0,c=0,f=/\r\n?|\n|$/g,h=n.locator;function d(F,Ee){for(;F>=c&&(Ee=f.exec(t));)a=c,c=Ee.index+Ee[0].length,h.lineNumber++;h.columnNumber=F-a+1}for(var m=[{currentNSMap:e}],p=[],g=0;;){try{var w=t.indexOf("<",g);if(w<0){if(!s&&p.length>0)return i.fatalError("unclosed xml tag(s): "+p.join(", "));if(!t.substring(g).match(/^\s*$/)){var T=n.doc,D=T.createTextNode(t.substring(g));if(T.documentElement)return i.error("Extra content at the end of the document");T.appendChild(D),n.currentElement=D}return}if(w>g){var x=t.substring(g,w);!s&&p.length===0&&(x=x.replace(new RegExp(C.S_OPT.source,"g"),""),x&&i.error("Unexpected content outside root element: '"+x+"'")),l(w)}switch(t.charAt(w+1)){case"/":var S=t.indexOf(">",w+2),O=t.substring(w+2,S>0?S:void 0);if(!O)return i.fatalError("end tag name missing");var R=C.reg("^",C.QName_group,C.S_OPT,"$"),H=S>0&&R.exec(O);if(!H){var Q=S>0&&C.reg("^",C.QName_group).exec(O);if(s&&Q)i.warning('end tag name contains invalid trailing characters: "'+O+'"'),H=Q;else if(Q&&new RegExp(R.source,R.flags+"m").test(O))i.error('end tag name is followed by a line break and trailing content: "'+O+'"'),H=Q;else return i.fatalError('end tag name contains invalid characters: "'+O+'"')}if(!n.currentElement&&!n.doc.documentElement)return;var K=p[p.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(K!==H[1]){var Me=H[1].toLowerCase();if(!s||K.toLowerCase()!==Me)return i.fatalError('Opening and ending tag mismatch: "'+K+'" != "'+O+'"')}var W=m.pop();p.pop();var ae=W.localNSMap;if(n.endElement(W.uri,W.localName,K),ae)for(var ge in ae)pr(ae,ge)&&n.endPrefixMapping(ge);S++;break;case"?":h&&d(w),S=gc(t,w,n,i);break;case"!":h&&d(w),S=oo(t,w,n,i,s);break;default:h&&d(w);var U=new uo,X=m[m.length-1].currentNSMap,S=hc(t,w,U,X,u,i,s),Si=U.length;if(U.closed||(s&&Bt.isHTMLVoidElement(U.tagName)?U.closed=!0:p.push(U.tagName)),h&&Si){for(var eu=to(h,{}),Dn=0;Dn<Si;Dn++){var Ii=U[Dn];d(Ii.offset),Ii.locator=to(h,{})}n.locator=eu,ro(U,n,X)&&m.push(U),n.locator=h}else ro(U,n,X)&&m.push(U);s&&!U.closed?S=dc(t,S,U.tagName,u,n):S++}}catch(F){if(F instanceof lc)throw F;if(F instanceof cc)return i.fatalError("Error constructing the DOM: "+F.name+": "+F.message,F);i.error("element parse error: "+F),S=-1}S>g?g=S:l(Math.max(w,g)+1)}}function to(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function hc(t,e,r,n,i,s,o){function u(d,m,p){if(pr(r.attributeNames,d))return s.fatalError("Attribute "+d+" redefined");if(!o&&m.indexOf("<")>=0)return s.fatalError("Unescaped '<' not allowed in attributes values");r.addValue(d,m.replace(/[\t\n\r]/g," ").replace(oi,i),p)}for(var l,a,c=++e,f=Ct;;){var h=t.charAt(c);if(f===Ct&&h==="<")throw new Error("unexpected < in tag name: "+t.slice(e,c));switch(h){case"=":if(f===Je)l=t.slice(e,c),f=hr;else if(f===St)f=hr;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(f===hr||f===Je)if(f===Je&&(s.warning('attribute value must after "="'),l=t.slice(e,c)),e=c+1,c=t.indexOf(h,e),c>0)a=t.slice(e,c),u(l,a,e-1),f=Ot;else throw new Error("attribute value no end '"+h+"' match");else if(f==It)a=t.slice(e,c),u(l,a,e),s.warning('attribute "'+l+'" missed start quot('+h+")!!"),e=c+1,f=Ot;else throw new Error('attribute value must after "="');break;case"/":switch(f){case Ct:r.setTagName(t.slice(e,c));case Ot:case dr:case Qr:f=Qr,r.closed=!0;case It:case Je:break;case St:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),f==Ct&&r.setTagName(t.slice(e,c)),c;case">":switch(f){case Ct:r.setTagName(t.slice(e,c));case Ot:case dr:case Qr:break;case It:case Je:a=t.slice(e,c),a.slice(-1)==="/"&&(r.closed=!0,a=a.slice(0,-1));case St:f===St&&(a=l),f==It?(s.warning('attribute "'+a+'" missed quot(")!'),u(l,a,e)):(o||s.warning('attribute "'+a+'" missed value!! "'+a+'" instead!!'),u(a,a,e));break;case hr:if(!o)return s.fatalError(`AttValue: ' or " expected`)}return c;case"\x80":h=" ";default:if(h<=" ")switch(f){case Ct:r.setTagName(t.slice(e,c)),f=dr;break;case Je:l=t.slice(e,c),f=St;break;case It:var a=t.slice(e,c);s.warning('attribute "'+a+'" missed quot(")!!'),u(l,a,e);case Ot:f=dr;break}else switch(f){case St:o||s.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),u(l,l,e),e=c,f=Je;break;case Ot:s.warning('attribute space is required"'+l+'"!!');case dr:f=Je,e=c;break;case hr:f=It,e=c;break;case Qr:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function ro(t,e,r){for(var n=t.tagName,i=null,f=t.length;f--;){var s=t[f],o=s.qName,u=s.value,h=o.indexOf(":");if(h>0)var l=s.prefix=o.slice(0,h),a=o.slice(h+1),c=l==="xmlns"&&a;else a=o,l=null,c=o==="xmlns"&&"";s.localName=a,c!==!1&&(i==null&&(i=Object.create(null),r=Object.create(r)),r[c]=i[c]=u,s.uri=eo.XMLNS,e.startPrefixMapping(c,u))}for(var f=t.length;f--;)s=t[f],s.prefix&&(s.prefix==="xml"&&(s.uri=eo.XML),s.prefix!=="xmlns"&&(s.uri=r[s.prefix]));var h=n.indexOf(":");h>0?(l=t.prefix=n.slice(0,h),a=t.localName=n.slice(h+1)):(l=null,a=t.localName=n);var d=t.uri=r[l||""];if(e.startElement(d,a,n,t),t.closed){if(e.endElement(d,a,n),i)for(l in i)pr(i,l)&&e.endPrefixMapping(l)}else return t.currentNSMap=r,t.localNSMap=i,!0}function dc(t,e,r,n,i){var s=oc(r);if(s||ac(r)){var o=new RegExp("</"+r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+">","ig");o.lastIndex=e;var u=o.exec(t),l=u?u.index:-1;if(l<0)return e+1;var a=t.substring(e+1,l);return s&&(a=a.replace(oi,n)),i.characters(a,0,a.length),l}return e+1}function pc(t,e){for(var r in t)pr(t,r)&&(e[r]=t[r])}function so(t,e){var r=e;function n(c){return c=c||0,t.charAt(r+c)}function i(c){c=c||1,r+=c}function s(){for(var c=0;r<t.length;){var f=n();if(f!==" "&&f!==`
3
+ `&&f!==" "&&f!=="\r")return c;c++,i()}return-1}function o(){return t.substring(r)}function u(c){return t.substring(r,r+c.length)===c}function l(c){return t.substring(r,r+c.length).toUpperCase()===c.toUpperCase()}function a(c){var f=C.reg("^",c),h=f.exec(o());return h?(i(h[0].length),h[0]):null}return{char:n,getIndex:function(){return r},getMatch:a,getSource:function(){return t},skip:i,skipBlanks:s,substringFromIndex:o,substringStartsWith:u,substringStartsWithCaseInsensitive:l}}function mc(t,e){function r(u,l){var a=C.PI.exec(u.substringFromIndex());return a?a[1].toLowerCase()==="xml"?l.fatalError("xml declaration is only allowed at the start of the document, but found at position "+u.getIndex()):(u.skip(a[0].length),a[0]):l.fatalError("processing instruction is not well-formed at position "+u.getIndex())}var n=t.getSource();if(t.char()==="["){t.skip(1);for(var i=t.getIndex();t.getIndex()<n.length;){if(t.skipBlanks(),t.char()==="]"){var s=n.substring(i,t.getIndex());return t.skip(1),s}var o=null;if(t.char()==="<"&&t.char(1)==="!")switch(t.char(2)){case"E":t.char(3)==="L"?o=t.getMatch(C.elementdecl):t.char(3)==="N"&&(o=t.getMatch(C.EntityDecl));break;case"A":o=t.getMatch(C.AttlistDecl);break;case"N":o=t.getMatch(C.NotationDecl);break;case"-":o=t.getMatch(C.Comment);break}else if(t.char()==="<"&&t.char(1)==="?")o=r(t,e);else if(t.char()==="%")o=t.getMatch(C.PEReference);else return e.fatalError("Error detected in Markup declaration");if(!o)return e.fatalError("Error in internal subset at position "+t.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}function oo(t,e,r,n,i){var s=so(t,e);switch(i?s.char(2).toUpperCase():s.char(2)){case"-":var o=s.getMatch(C.Comment);return o?(r.comment(o,C.COMMENT_START.length,o.length-C.COMMENT_START.length-C.COMMENT_END.length),s.getIndex()):n.fatalError("comment is not well-formed at position "+s.getIndex());case"[":var u=s.getMatch(C.CDSect);return u?!i&&!r.currentElement?n.fatalError("CDATA outside of element"):(r.startCDATA(),r.characters(u,C.CDATA_START.length,u.length-C.CDATA_START.length-C.CDATA_END.length),r.endCDATA(),s.getIndex()):n.fatalError("Invalid CDATA starting at position "+e);case"D":{if(r.doc&&r.doc.documentElement)return n.fatalError("Doctype not allowed inside or after documentElement at position "+s.getIndex());if(i?!s.substringStartsWithCaseInsensitive(C.DOCTYPE_DECL_START):!s.substringStartsWith(C.DOCTYPE_DECL_START))return n.fatalError("Expected "+C.DOCTYPE_DECL_START+" at position "+s.getIndex());if(s.skip(C.DOCTYPE_DECL_START.length),s.skipBlanks()<1)return n.fatalError("Expected whitespace after "+C.DOCTYPE_DECL_START+" at position "+s.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=s.getMatch(C.Name),!l.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+s.getIndex());if(i&&l.name.toLowerCase()!=="html"&&n.warning("Unexpected DOCTYPE in HTML document at position "+s.getIndex()),s.skipBlanks(),s.substringStartsWith(C.PUBLIC)||s.substringStartsWith(C.SYSTEM)){var a=C.ExternalID_match.exec(s.substringFromIndex());if(!a)return n.fatalError("doctype external id is not well-formed at position "+s.getIndex());a.groups.SystemLiteralOnly!==void 0?l.systemId=a.groups.SystemLiteralOnly:(l.systemId=a.groups.SystemLiteral,l.publicId=a.groups.PubidLiteral),s.skip(a[0].length)}else if(i&&s.substringStartsWithCaseInsensitive(C.SYSTEM)){if(s.skip(C.SYSTEM.length),s.skipBlanks()<1)return n.fatalError("Expected whitespace after "+C.SYSTEM+" at position "+s.getIndex());if(l.systemId=s.getMatch(C.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return n.fatalError("Expected "+C.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+C.SYSTEM+" at position "+s.getIndex())}return i&&l.systemId&&!C.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+s.getIndex()),i||(s.skipBlanks(),l.internalSubset=mc(s,n)),s.skipBlanks(),s.char()!==">"?n.fatalError("doctype not terminated with > at position "+s.getIndex()):(s.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),s.getIndex())}default:return n.fatalError('Not well-formed XML starting with "<!" at position '+e)}}function gc(t,e,r,n){var i=t.substring(e).match(C.PI);if(!i)return n.fatalError("Invalid processing instruction starting at position "+e);if(i[1].toLowerCase()==="xml"){if(e>0)return n.fatalError("processing instruction at position "+e+" is an xml declaration which is only at the start of the document");if(!C.XMLDecl.test(t.substring(e)))return n.fatalError("xml declaration is not well-formed")}return r.processingInstruction(i[1],i[2]),e+i[0].length}function uo(){this.attributeNames=Object.create(null)}uo.prototype={setTagName:function(t){if(!C.QName_exact.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,r){if(!C.QName_exact.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:r}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}};Kr.XMLReader=io;Kr.parseUtils=so;Kr.parseDoctypeCommentOrCData=oo});var go=Pe(Rt=>{"use strict";var ut=st(),Ec=si(),wc=rr(),lo=Ks(),yc=ao(),Dc=Ec.DOMImplementation,Ac=ut.hasDefaultHTMLNamespace,Tc=ut.isHTMLMimeType,bc=ut.isValidMimeType,ho=ut.MIME_TYPE,ui=ut.NAMESPACE,co=wc.ParseError,vc=yc.XMLReader;function po(t){return t.replace(/\r[\n\u0085]/g,`
4
+ `).replace(/[\r\u0085\u2028\u2029]/g,`
5
+ `)}function mo(t){if(t=t||{},t.locator===void 0&&(t.locator=!0),this.assign=t.assign||ut.assign,this.domHandler=t.domHandler||tn,this.onError=t.onError||t.errorHandler,t.errorHandler&&typeof t.errorHandler!="function")throw new TypeError("errorHandler object is no longer supported, switch to onError!");t.errorHandler&&t.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=t.normalizeLineEndings||po,this.locator=!!t.locator,this.xmlns=this.assign(Object.create(null),t.xmlns)}mo.prototype.parseFromString=function(t,e){if(!bc(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var r=this.assign(Object.create(null),this.xmlns),n=lo.XML_ENTITIES,i=r[""]||null;Ac(e)?(n=lo.HTML_ENTITIES,i=ui.HTML):e===ho.XML_SVG_IMAGE&&(i=ui.SVG),r[""]=i,r.xml=r.xml||ui.XML;var s=new this.domHandler({mimeType:e,defaultNamespace:i,onError:this.onError}),o=this.locator?{}:void 0;this.locator&&s.setDocumentLocator(o);var u=new vc;u.errorHandler=s,u.domBuilder=s;var l=!ut.isHTMLMimeType(e);return l&&typeof t!="string"&&u.errorHandler.fatalError("source is not a string"),u.parse(this.normalizeLineEndings(String(t)),r,n),s.doc.documentElement||u.errorHandler.fatalError("missing root element"),s.doc};function tn(t){var e=t||{};this.mimeType=e.mimeType||ho.XML_APPLICATION,this.defaultNamespace=e.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=e.onError}function Mt(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}tn.prototype={startDocument:function(){var t=new Dc;this.doc=Tc(this.mimeType)?t.createHTMLDocument(!1):t.createDocument(this.defaultNamespace,"")},startElement:function(t,e,r,n){var i=this.doc,s=i.createElementNS(t,r||e),o=n.length;en(this,s),this.currentElement=s,this.locator&&Mt(this.locator,s);for(var u=0;u<o;u++){var t=n.getURI(u),l=n.getValue(u),r=n.getQName(u),a=i.createAttributeNS(t,r);this.locator&&Mt(n.getLocator(u),a),a.value=a.nodeValue=l,s.setAttributeNode(a)}},endElement:function(t,e,r){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var r=this.doc.createProcessingInstruction(t,e);this.locator&&Mt(this.locator,r),en(this,r)},ignorableWhitespace:function(t,e,r){},characters:function(t,e,r){if(t=fo.apply(this,arguments),t){if(this.cdata)var n=this.doc.createCDATASection(t);else var n=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(t)&&this.doc.appendChild(n),this.locator&&Mt(this.locator,n)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){t&&(t.lineNumber=0),this.locator=t},comment:function(t,e,r){t=fo.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&Mt(this.locator,n),en(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,r,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var s=i.createDocumentType(t,e,r,n);this.locator&&Mt(this.locator,s),en(this,s),this.doc.doctype=s}},reportError:function(t,e){if(typeof this.onError=="function")try{this.onError(t,e,this)}catch(r){throw new co("Reporting "+t+' "'+e+'" caused '+r,this.locator)}else console.error("[xmldom "+t+"] "+e,_c(this.locator))},warning:function(t){this.reportError("warning",t)},error:function(t){this.reportError("error",t)},fatalError:function(t,e){throw this.reportError("fatalError",t),new co(t,this.locator,e)}};function _c(t){if(t)return`
6
+ @#[line:`+t.lineNumber+",col:"+t.columnNumber+"]"}function fo(t,e,r){return typeof t=="string"?t.substr(e,r):t.length>=e+r||e?new java.lang.String(t,e,r)+"":t}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(t){tn.prototype[t]=function(){return null}});function en(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}function Nc(t){if(t==="error")throw"onErrorStopParsing"}function xc(){throw"onWarningStopParsing"}Rt.__DOMHandler=tn;Rt.DOMParser=mo;Rt.normalizeLineEndings=po;Rt.onErrorStopParsing=Nc;Rt.onWarningStopParsing=xc});var ai=Pe(M=>{"use strict";var Ft=st();M.assign=Ft.assign;M.hasDefaultHTMLNamespace=Ft.hasDefaultHTMLNamespace;M.isHTMLMimeType=Ft.isHTMLMimeType;M.isValidMimeType=Ft.isValidMimeType;M.MIME_TYPE=Ft.MIME_TYPE;M.NAMESPACE=Ft.NAMESPACE;var rn=rr();M.DOMException=rn.DOMException;M.DOMExceptionName=rn.DOMExceptionName;M.ExceptionCode=rn.ExceptionCode;M.ParseError=rn.ParseError;var Z=si();M.Attr=Z.Attr;M.CDATASection=Z.CDATASection;M.CharacterData=Z.CharacterData;M.Comment=Z.Comment;M.Document=Z.Document;M.DocumentFragment=Z.DocumentFragment;M.DocumentType=Z.DocumentType;M.DOMImplementation=Z.DOMImplementation;M.Element=Z.Element;M.Entity=Z.Entity;M.EntityReference=Z.EntityReference;M.LiveNodeList=Z.LiveNodeList;M.NamedNodeMap=Z.NamedNodeMap;M.Node=Z.Node;M.NodeList=Z.NodeList;M.Notation=Z.Notation;M.ProcessingInstruction=Z.ProcessingInstruction;M.Text=Z.Text;M.XMLSerializer=Z.XMLSerializer;var nn=go();M.DOMParser=nn.DOMParser;M.normalizeLineEndings=nn.normalizeLineEndings;M.onErrorStopParsing=nn.onErrorStopParsing;M.onWarningStopParsing=nn.onWarningStopParsing});import{Bag as Of}from"@gramlot/gramlot";var Re={};Oi(Re,{defineCollection:()=>bn});Vt(Re,Uf);import*as Uf from"@gramlot/gramlot/components";import{defineCollection as ou}from"@gramlot/gramlot/components";function bn(t){if(t.name!=="vizabi")throw new Error("Unexpected bundled collection");let e=[],r={};t.css?.forEach((n,i)=>{n.href=e[i].href});for(let[n,i]of Object.entries(t.assets??{}))i.href=r[n].href;return ou({...t,css:e,assets:r})}function Mi(t,e){return t.parameters=uu(t.constructor.gramlotComponent,e),Object.fromEntries(Object.entries(e).filter(([r])=>!Object.hasOwn(t.parameters,r)))}function uu(t,e){return Object.fromEntries(Object.entries(t.parameters).map(([r,n])=>[r,Object.hasOwn(e,r)?e[r]:n.default]))}function vn(t){return class extends t{constructor(){super();let e=this.attachShadow({mode:"open"}),r=this.ownerDocument.createElement("style");r.textContent=`:host{box-sizing:border-box;display:block;min-width:0;font:inherit;color:var(--gramlot-ink,CanvasText)}
7
+ *,*::before,*::after{box-sizing:border-box}.control-box{min-width:0}slot{display:contents}
8
+ ::slotted(*){min-width:0;max-width:100%}`,this.controlBox=this.ownerDocument.createElement("div"),this.controlBox.className="control-box",this.control=this.controlBox,this.control.id="control",this.control.append(this.ownerDocument.createElement("slot")),e.append(r,this.controlBox)}projectAttributes(e){return Mi(this,e)}}}vn.parameters={};/*!
9
+ * decimal.js v10.6.0
10
+ * An arbitrary-precision Decimal type for JavaScript.
11
+ * https://github.com/MikeMcl/decimal.js
12
+ * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
13
+ * MIT Licence
14
+ */var mt=9e15,je=1e9,_n="0123456789abcdef",xr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Cr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Nn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-mt,maxE:mt,crypto:!1},Li,Fe,_=!0,Ir="[DecimalError] ",Ve=Ir+"Invalid argument: ",Ui=Ir+"Precision limit exceeded",Pi=Ir+"crypto unavailable",qi="[object Decimal]",se=Math.floor,G=Math.pow,au=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,lu=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,cu=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,$i=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ae=1e7,b=7,fu=9007199254740991,hu=xr.length-1,xn=Cr.length-1,E={toStringTag:qi};E.absoluteValue=E.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),A(t)};E.ceil=function(){return A(new this.constructor(this),this.e+1,2)};E.clampedTo=E.clamp=function(t,e){var r,n=this,i=n.constructor;if(t=new i(t),e=new i(e),!t.s||!e.s)return new i(NaN);if(t.gt(e))throw Error(Ve+e);return r=n.cmp(t),r<0?t:n.cmp(e)>0?e:new i(n)};E.comparedTo=E.cmp=function(t){var e,r,n,i,s=this,o=s.d,u=(t=new s.constructor(t)).d,l=s.s,a=t.s;if(!o||!u)return!l||!a?NaN:l!==a?l:o===u?0:!o^l<0?1:-1;if(!o[0]||!u[0])return o[0]?l:u[0]?-a:0;if(l!==a)return l;if(s.e!==t.e)return s.e>t.e^l<0?1:-1;for(n=o.length,i=u.length,e=0,r=n<i?n:i;e<r;++e)if(o[e]!==u[e])return o[e]>u[e]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};E.cosine=E.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+b,n.rounding=1,r=du(n,Xi(n,r)),n.precision=t,n.rounding=e,A(Fe==2||Fe==3?r.neg():r,t,e,!0)):new n(1):new n(NaN)};E.cubeRoot=E.cbrt=function(){var t,e,r,n,i,s,o,u,l,a,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(_=!1,s=c.s*G(c.s*c,1/3),!s||Math.abs(s)==1/0?(r=te(c.d),t=c.e,(s=(t-r.length+1)%3)&&(r+=s==1||s==-2?"0":"00"),s=G(r,1/3),t=se((t+1)/3)-(t%3==(t<0?-1:2)),s==1/0?r="5e"+t:(r=s.toExponential(),r=r.slice(0,r.indexOf("e")+1)+t),n=new f(r),n.s=c.s):n=new f(s.toString()),o=(t=f.precision)+3;;)if(u=n,l=u.times(u).times(u),a=l.plus(c),n=P(a.plus(c).times(u),a.plus(l),o+2,1),te(u.d).slice(0,o)===(r=te(n.d)).slice(0,o))if(r=r.slice(o-3,o+1),r=="9999"||!i&&r=="4999"){if(!i&&(A(u,t+1,0),u.times(u).times(u).eq(c))){n=u;break}o+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(A(n,t+1,1),e=!n.times(n).times(n).eq(c));break}return _=!0,A(n,t,f.rounding,e)};E.decimalPlaces=E.dp=function(){var t,e=this.d,r=NaN;if(e){if(t=e.length-1,r=(t-se(this.e/b))*b,t=e[t],t)for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r};E.dividedBy=E.div=function(t){return P(this,new this.constructor(t))};E.dividedToIntegerBy=E.divToInt=function(t){var e=this,r=e.constructor;return A(P(e,new r(t),0,1,1),r.precision,r.rounding)};E.equals=E.eq=function(t){return this.cmp(t)===0};E.floor=function(){return A(new this.constructor(this),this.e+1,3)};E.greaterThan=E.gt=function(t){return this.cmp(t)>0};E.greaterThanOrEqualTo=E.gte=function(t){var e=this.cmp(t);return e==1||e===0};E.hyperbolicCosine=E.cosh=function(){var t,e,r,n,i,s=this,o=s.constructor,u=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return u;r=o.precision,n=o.rounding,o.precision=r+Math.max(s.e,s.sd())+4,o.rounding=1,i=s.d.length,i<32?(t=Math.ceil(i/3),e=(1/Br(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),s=gt(o,1,s.times(e),new o(1),!0);for(var l,a=t,c=new o(8);a--;)l=s.times(s),s=u.minus(l.times(c.minus(l.times(c))));return A(s,o.precision=r,o.rounding=n,!0)};E.hyperbolicSine=E.sinh=function(){var t,e,r,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(e=s.precision,r=s.rounding,s.precision=e+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<3)i=gt(s,2,i,i,!0);else{t=1.4*Math.sqrt(n),t=t>16?16:t|0,i=i.times(1/Br(5,t)),i=gt(s,2,i,i,!0);for(var o,u=new s(5),l=new s(16),a=new s(20);t--;)o=i.times(i),i=i.times(u.plus(o.times(l.times(o).plus(a))))}return s.precision=e,s.rounding=r,A(i,e,r,!0)};E.hyperbolicTangent=E.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,P(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)};E.inverseCosine=E.acos=function(){var t=this,e=t.constructor,r=t.abs().cmp(1),n=e.precision,i=e.rounding;return r!==-1?r===0?t.isNeg()?Ne(e,n,i):new e(0):new e(NaN):t.isZero()?Ne(e,n+4,i).times(.5):(e.precision=n+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=n,e.rounding=i,t.times(2))};E.inverseHyperbolicCosine=E.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,_=!1,r=r.times(r).minus(1).sqrt().plus(r),_=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)};E.inverseHyperbolicSine=E.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,_=!1,r=r.times(r).plus(1).sqrt().plus(r),_=!0,n.precision=t,n.rounding=e,r.ln())};E.inverseHyperbolicTangent=E.atanh=function(){var t,e,r,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=s.precision,e=s.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?A(new s(i),t,e,!0):(s.precision=r=n-i.e,i=P(i.plus(1),new s(1).minus(i),r+t,1),s.precision=t+4,s.rounding=1,i=i.ln(),s.precision=t,s.rounding=e,i.times(.5))):new s(NaN)};E.inverseSine=E.asin=function(){var t,e,r,n,i=this,s=i.constructor;return i.isZero()?new s(i):(e=i.abs().cmp(1),r=s.precision,n=s.rounding,e!==-1?e===0?(t=Ne(s,r+4,n).times(.5),t.s=i.s,t):new s(NaN):(s.precision=r+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=r,s.rounding=n,i.times(2)))};E.inverseTangent=E.atan=function(){var t,e,r,n,i,s,o,u,l,a=this,c=a.constructor,f=c.precision,h=c.rounding;if(a.isFinite()){if(a.isZero())return new c(a);if(a.abs().eq(1)&&f+4<=xn)return o=Ne(c,f+4,h).times(.25),o.s=a.s,o}else{if(!a.s)return new c(NaN);if(f+4<=xn)return o=Ne(c,f+4,h).times(.5),o.s=a.s,o}for(c.precision=u=f+10,c.rounding=1,r=Math.min(28,u/b+2|0),t=r;t;--t)a=a.div(a.times(a).plus(1).sqrt().plus(1));for(_=!1,e=Math.ceil(u/b),n=1,l=a.times(a),o=new c(a),i=a;t!==-1;)if(i=i.times(l),s=o.minus(i.div(n+=2)),i=i.times(l),o=s.plus(i.div(n+=2)),o.d[e]!==void 0)for(t=e;o.d[t]===s.d[t]&&t--;);return r&&(o=o.times(2<<r-1)),_=!0,A(o,c.precision=f,c.rounding=h,!0)};E.isFinite=function(){return!!this.d};E.isInteger=E.isInt=function(){return!!this.d&&se(this.e/b)>this.d.length-2};E.isNaN=function(){return!this.s};E.isNegative=E.isNeg=function(){return this.s<0};E.isPositive=E.isPos=function(){return this.s>0};E.isZero=function(){return!!this.d&&this.d[0]===0};E.lessThan=E.lt=function(t){return this.cmp(t)<0};E.lessThanOrEqualTo=E.lte=function(t){return this.cmp(t)<1};E.logarithm=E.log=function(t){var e,r,n,i,s,o,u,l,a=this,c=a.constructor,f=c.precision,h=c.rounding,d=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),r=t.d,t.s<0||!r||!r[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(r=a.d,a.s<0||!r||!r[0]||a.eq(1))return new c(r&&!r[0]?-1/0:a.s!=1?NaN:r?0:1/0);if(e)if(r.length>1)s=!0;else{for(i=r[0];i%10===0;)i/=10;s=i!==1}if(_=!1,u=f+d,o=$e(a,u),n=e?Sr(c,u+10):$e(t,u),l=P(o,n,u,1),jt(l.d,i=f,h))do if(u+=10,o=$e(a,u),n=e?Sr(c,u+10):$e(t,u),l=P(o,n,u,1),!s){+te(l.d).slice(i+1,i+15)+1==1e14&&(l=A(l,f+1,0));break}while(jt(l.d,i+=10,h));return _=!0,A(l,f,h)};E.minus=E.sub=function(t){var e,r,n,i,s,o,u,l,a,c,f,h,d=this,m=d.constructor;if(t=new m(t),!d.d||!t.d)return!d.s||!t.s?t=new m(NaN):d.d?t.s=-t.s:t=new m(t.d||d.s!==t.s?d:NaN),t;if(d.s!=t.s)return t.s=-t.s,d.plus(t);if(a=d.d,h=t.d,u=m.precision,l=m.rounding,!a[0]||!h[0]){if(h[0])t.s=-t.s;else if(a[0])t=new m(d);else return new m(l===3?-0:0);return _?A(t,u,l):t}if(r=se(t.e/b),c=se(d.e/b),a=a.slice(),s=c-r,s){for(f=s<0,f?(e=a,s=-s,o=h.length):(e=h,r=c,o=a.length),n=Math.max(Math.ceil(u/b),o)+2,s>n&&(s=n,e.length=1),e.reverse(),n=s;n--;)e.push(0);e.reverse()}else{for(n=a.length,o=h.length,f=n<o,f&&(o=n),n=0;n<o;n++)if(a[n]!=h[n]){f=a[n]<h[n];break}s=0}for(f&&(e=a,a=h,h=e,t.s=-t.s),o=a.length,n=h.length-o;n>0;--n)a[o++]=0;for(n=h.length;n>s;){if(a[--n]<h[n]){for(i=n;i&&a[--i]===0;)a[i]=Ae-1;--a[i],a[n]+=Ae}a[n]-=h[n]}for(;a[--o]===0;)a.pop();for(;a[0]===0;a.shift())--r;return a[0]?(t.d=a,t.e=Or(a,r),_?A(t,u,l):t):new m(l===3?-0:0)};E.modulo=E.mod=function(t){var e,r=this,n=r.constructor;return t=new n(t),!r.d||!t.s||t.d&&!t.d[0]?new n(NaN):!t.d||r.d&&!r.d[0]?A(new n(r),n.precision,n.rounding):(_=!1,n.modulo==9?(e=P(r,t.abs(),0,3,1),e.s*=t.s):e=P(r,t,0,n.modulo,1),e=e.times(t),_=!0,r.minus(e))};E.naturalExponential=E.exp=function(){return Cn(this)};E.naturalLogarithm=E.ln=function(){return $e(this)};E.negated=E.neg=function(){var t=new this.constructor(this);return t.s=-t.s,A(t)};E.plus=E.add=function(t){var e,r,n,i,s,o,u,l,a,c,f=this,h=f.constructor;if(t=new h(t),!f.d||!t.d)return!f.s||!t.s?t=new h(NaN):f.d||(t=new h(t.d||f.s===t.s?f:NaN)),t;if(f.s!=t.s)return t.s=-t.s,f.minus(t);if(a=f.d,c=t.d,u=h.precision,l=h.rounding,!a[0]||!c[0])return c[0]||(t=new h(f)),_?A(t,u,l):t;if(s=se(f.e/b),n=se(t.e/b),a=a.slice(),i=s-n,i){for(i<0?(r=a,i=-i,o=c.length):(r=c,n=s,o=a.length),s=Math.ceil(u/b),o=s>o?s+1:o+1,i>o&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(o=a.length,i=c.length,o-i<0&&(i=o,r=c,c=a,a=r),e=0;i;)e=(a[--i]=a[i]+c[i]+e)/Ae|0,a[i]%=Ae;for(e&&(a.unshift(e),++n),o=a.length;a[--o]==0;)a.pop();return t.d=a,t.e=Or(a,n),_?A(t,u,l):t};E.precision=E.sd=function(t){var e,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Ve+t);return r.d?(e=Vi(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e};E.round=function(){var t=this,e=t.constructor;return A(new e(t),t.e+1,e.rounding)};E.sine=E.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+b,n.rounding=1,r=mu(n,Xi(n,r)),n.precision=t,n.rounding=e,A(Fe>2?r.neg():r,t,e,!0)):new n(NaN)};E.squareRoot=E.sqrt=function(){var t,e,r,n,i,s,o=this,u=o.d,l=o.e,a=o.s,c=o.constructor;if(a!==1||!u||!u[0])return new c(!a||a<0&&(!u||u[0])?NaN:u?o:1/0);for(_=!1,a=Math.sqrt(+o),a==0||a==1/0?(e=te(u),(e.length+l)%2==0&&(e+="0"),a=Math.sqrt(e),l=se((l+1)/2)-(l<0||l%2),a==1/0?e="5e"+l:(e=a.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new c(e)):n=new c(a.toString()),r=(l=c.precision)+3;;)if(s=n,n=s.plus(P(o,s,r+2,1)).times(.5),te(s.d).slice(0,r)===(e=te(n.d)).slice(0,r))if(e=e.slice(r-3,r+1),e=="9999"||!i&&e=="4999"){if(!i&&(A(s,l+1,0),s.times(s).eq(o))){n=s;break}r+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(A(n,l+1,1),t=!n.times(n).eq(o));break}return _=!0,A(n,l,c.rounding,t)};E.tangent=E.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,r=r.sin(),r.s=1,r=P(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,A(Fe==2||Fe==4?r.neg():r,t,e,!0)):new n(NaN)};E.times=E.mul=function(t){var e,r,n,i,s,o,u,l,a,c=this,f=c.constructor,h=c.d,d=(t=new f(t)).d;if(t.s*=c.s,!h||!h[0]||!d||!d[0])return new f(!t.s||h&&!h[0]&&!d||d&&!d[0]&&!h?NaN:!h||!d?t.s/0:t.s*0);for(r=se(c.e/b)+se(t.e/b),l=h.length,a=d.length,l<a&&(s=h,h=d,d=s,o=l,l=a,a=o),s=[],o=l+a,n=o;n--;)s.push(0);for(n=a;--n>=0;){for(e=0,i=l+n;i>n;)u=s[i]+d[n]*h[i-n-1]+e,s[i--]=u%Ae|0,e=u/Ae|0;s[i]=(s[i]+e)%Ae|0}for(;!s[--o];)s.pop();return e?++r:s.shift(),t.d=s,t.e=Or(s,r),_?A(t,f.precision,f.rounding):t};E.toBinary=function(t,e){return Sn(this,2,t,e)};E.toDecimalPlaces=E.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(ce(t,0,je),e===void 0?e=n.rounding:ce(e,0,8),A(r,t+r.e+1,e))};E.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=xe(n,!0):(ce(t,0,je),e===void 0?e=i.rounding:ce(e,0,8),n=A(new i(n),t+1,e),r=xe(n,!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r};E.toFixed=function(t,e){var r,n,i=this,s=i.constructor;return t===void 0?r=xe(i):(ce(t,0,je),e===void 0?e=s.rounding:ce(e,0,8),n=A(new s(i),t+i.e+1,e),r=xe(n,!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};E.toFraction=function(t){var e,r,n,i,s,o,u,l,a,c,f,h,d=this,m=d.d,p=d.constructor;if(!m)return new p(d);if(a=r=new p(1),n=l=new p(0),e=new p(n),s=e.e=Vi(m)-d.e-1,o=s%b,e.d[0]=G(10,o<0?b+o:o),t==null)t=s>0?e:a;else{if(u=new p(t),!u.isInt()||u.lt(a))throw Error(Ve+u);t=u.gt(e)?s>0?e:a:u}for(_=!1,u=new p(te(m)),c=p.precision,p.precision=s=m.length*b*2;f=P(u,e,0,1,1),i=r.plus(f.times(n)),i.cmp(t)!=1;)r=n,n=i,i=a,a=l.plus(f.times(i)),l=i,i=e,e=u.minus(f.times(i)),u=i;return i=P(t.minus(r),n,0,1,1),l=l.plus(i.times(a)),r=r.plus(i.times(n)),l.s=a.s=d.s,h=P(a,n,s,1).minus(d).abs().cmp(P(l,r,s,1).minus(d).abs())<1?[a,n]:[l,r],p.precision=c,_=!0,h};E.toHexadecimal=E.toHex=function(t,e){return Sn(this,16,t,e)};E.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),t==null){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),e===void 0?e=n.rounding:ce(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(_=!1,r=P(r,t,0,e,1).times(t),_=!0,A(r)):(t.s=r.s,r=t),r};E.toNumber=function(){return+this};E.toOctal=function(t,e){return Sn(this,8,t,e)};E.toPower=E.pow=function(t){var e,r,n,i,s,o,u=this,l=u.constructor,a=+(t=new l(t));if(!u.d||!t.d||!u.d[0]||!t.d[0])return new l(G(+u,a));if(u=new l(u),u.eq(1))return u;if(n=l.precision,s=l.rounding,t.eq(1))return A(u,n,s);if(e=se(t.e/b),e>=t.d.length-1&&(r=a<0?-a:a)<=fu)return i=ji(l,u,r,n),t.s<0?new l(1).div(i):A(i,n,s);if(o=u.s,o<0){if(e<t.d.length-1)return new l(NaN);if((t.d[e]&1)==0&&(o=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=o,u}return r=G(+u,a),e=r==0||!isFinite(r)?se(a*(Math.log("0."+te(u.d))/Math.LN10+u.e+1)):new l(r+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?o/0:0):(_=!1,l.rounding=u.s=1,r=Math.min(12,(e+"").length),i=Cn(t.times($e(u,n+r)),n),i.d&&(i=A(i,n+5,1),jt(i.d,n,s)&&(e=n+10,i=A(Cn(t.times($e(u,e+r)),e),e+5,1),+te(i.d).slice(n+1,n+15)+1==1e14&&(i=A(i,n+1,0)))),i.s=o,_=!0,l.rounding=s,A(i,n,s))};E.toPrecision=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=xe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ce(t,1,je),e===void 0?e=i.rounding:ce(e,0,8),n=A(new i(n),t,e),r=xe(n,t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r};E.toSignificantDigits=E.toSD=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(ce(t,1,je),e===void 0?e=n.rounding:ce(e,0,8)),A(new n(r),t,e)};E.toString=function(){var t=this,e=t.constructor,r=xe(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r};E.truncated=E.trunc=function(){return A(new this.constructor(this),this.e+1,1)};E.valueOf=E.toJSON=function(){var t=this,e=t.constructor,r=xe(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};function te(t){var e,r,n,i=t.length-1,s="",o=t[0];if(i>0){for(s+=o,e=1;e<i;e++)n=t[e]+"",r=b-n.length,r&&(s+=qe(r)),s+=n;o=t[e],n=o+"",r=b-n.length,r&&(s+=qe(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}function ce(t,e,r){if(t!==~~t||t<e||t>r)throw Error(Ve+t)}function jt(t,e,r,n){var i,s,o,u;for(s=t[0];s>=10;s/=10)--e;return--e<0?(e+=b,i=0):(i=Math.ceil((e+1)/b),e%=b),s=G(10,b-e),u=t[i]%s|0,n==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),o=r<4&&u==99999||r>3&&u==49999||u==5e4||u==0):o=(r<4&&u+1==s||r>3&&u+1==s/2)&&(t[i+1]/s/100|0)==G(10,e-2)-1||(u==s/2||u==0)&&(t[i+1]/s/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),o=(n||r<4)&&u==9999||!n&&r>3&&u==4999):o=((n||r<4)&&u+1==s||!n&&r>3&&u+1==s/2)&&(t[i+1]/s/1e3|0)==G(10,e-3)-1,o}function _r(t,e,r){for(var n,i=[0],s,o=0,u=t.length;o<u;){for(s=i.length;s--;)i[s]*=e;for(i[0]+=_n.indexOf(t.charAt(o++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function du(t,e){var r,n,i;if(e.isZero())return e;n=e.d.length,n<32?(r=Math.ceil(n/3),i=(1/Br(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),t.precision+=r,e=gt(t,1,e.times(i),new t(1));for(var s=r;s--;){var o=e.times(e);e=o.times(o).minus(o).times(8).plus(1)}return t.precision-=r,e}var P=(function(){function t(n,i,s){var o,u=0,l=n.length;for(n=n.slice();l--;)o=n[l]*i+u,n[l]=o%s|0,u=o/s|0;return u&&n.unshift(u),n}function e(n,i,s,o){var u,l;if(s!=o)l=s>o?1:-1;else for(u=l=0;u<s;u++)if(n[u]!=i[u]){l=n[u]>i[u]?1:-1;break}return l}function r(n,i,s,o){for(var u=0;s--;)n[s]-=u,u=n[s]<i[s]?1:0,n[s]=u*o+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,o,u,l){var a,c,f,h,d,m,p,g,w,T,D,x,O,R,H,Q,K,Me,W,ae,ge=n.constructor,U=n.s==i.s?1:-1,X=n.d,S=i.d;if(!X||!X[0]||!S||!S[0])return new ge(!n.s||!i.s||(X?S&&X[0]==S[0]:!S)?NaN:X&&X[0]==0||!S?U*0:U/0);for(l?(d=1,c=n.e-i.e):(l=Ae,d=b,c=se(n.e/d)-se(i.e/d)),W=S.length,K=X.length,w=new ge(U),T=w.d=[],f=0;S[f]==(X[f]||0);f++);if(S[f]>(X[f]||0)&&c--,s==null?(R=s=ge.precision,o=ge.rounding):u?R=s+(n.e-i.e)+1:R=s,R<0)T.push(1),m=!0;else{if(R=R/d+2|0,f=0,W==1){for(h=0,S=S[0],R++;(f<K||h)&&R--;f++)H=h*l+(X[f]||0),T[f]=H/S|0,h=H%S|0;m=h||f<K}else{for(h=l/(S[0]+1)|0,h>1&&(S=t(S,h,l),X=t(X,h,l),W=S.length,K=X.length),Q=W,D=X.slice(0,W),x=D.length;x<W;)D[x++]=0;ae=S.slice(),ae.unshift(0),Me=S[0],S[1]>=l/2&&++Me;do h=0,a=e(S,D,W,x),a<0?(O=D[0],W!=x&&(O=O*l+(D[1]||0)),h=O/Me|0,h>1?(h>=l&&(h=l-1),p=t(S,h,l),g=p.length,x=D.length,a=e(p,D,g,x),a==1&&(h--,r(p,W<g?ae:S,g,l))):(h==0&&(a=h=1),p=S.slice()),g=p.length,g<x&&p.unshift(0),r(D,p,x,l),a==-1&&(x=D.length,a=e(S,D,W,x),a<1&&(h++,r(D,W<x?ae:S,x,l))),x=D.length):a===0&&(h++,D=[0]),T[f++]=h,a&&D[0]?D[x++]=X[Q]||0:(D=[X[Q]],x=1);while((Q++<K||D[0]!==void 0)&&R--);m=D[0]!==void 0}T[0]||T.shift()}if(d==1)w.e=c,Li=m;else{for(f=1,h=T[0];h>=10;h/=10)f++;w.e=f+c*d-1,A(w,u?s+w.e+1:s,o,m)}return w}})();function A(t,e,r,n){var i,s,o,u,l,a,c,f,h,d=t.constructor;e:if(e!=null){if(f=t.d,!f)return t;for(i=1,u=f[0];u>=10;u/=10)i++;if(s=e-i,s<0)s+=b,o=e,c=f[h=0],l=c/G(10,i-o-1)%10|0;else if(h=Math.ceil((s+1)/b),u=f.length,h>=u)if(n){for(;u++<=h;)f.push(0);c=l=0,i=1,s%=b,o=s-b+1}else break e;else{for(c=u=f[h],i=1;u>=10;u/=10)i++;s%=b,o=s-b+i,l=o<0?0:c/G(10,i-o-1)%10|0}if(n=n||e<0||f[h+1]!==void 0||(o<0?c:c%G(10,i-o-1)),a=r<4?(l||n)&&(r==0||r==(t.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(s>0?o>0?c/G(10,i-o):0:f[h-1])%10&1||r==(t.s<0?8:7)),e<1||!f[0])return f.length=0,a?(e-=t.e+1,f[0]=G(10,(b-e%b)%b),t.e=-e||0):f[0]=t.e=0,t;if(s==0?(f.length=h,u=1,h--):(f.length=h+1,u=G(10,b-s),f[h]=o>0?(c/G(10,i-o)%G(10,o)|0)*u:0),a)for(;;)if(h==0){for(s=1,o=f[0];o>=10;o/=10)s++;for(o=f[0]+=u,u=1;o>=10;o/=10)u++;s!=u&&(t.e++,f[0]==Ae&&(f[0]=1));break}else{if(f[h]+=u,f[h]!=Ae)break;f[h--]=0,u=1}for(s=f.length;f[--s]===0;)f.pop()}return _&&(t.e>d.maxE?(t.d=null,t.e=NaN):t.e<d.minE&&(t.e=0,t.d=[0])),t}function xe(t,e,r){if(!t.isFinite())return Hi(t);var n,i=t.e,s=te(t.d),o=s.length;return e?(r&&(n=r-o)>0?s=s.charAt(0)+"."+s.slice(1)+qe(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(t.e<0?"e":"e+")+t.e):i<0?(s="0."+qe(-i-1)+s,r&&(n=r-o)>0&&(s+=qe(n))):i>=o?(s+=qe(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+qe(n))):((n=i+1)<o&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(s+="."),s+=qe(n))),s}function Or(t,e){var r=t[0];for(e*=b;r>=10;r/=10)e++;return e}function Sr(t,e,r){if(e>hu)throw _=!0,r&&(t.precision=r),Error(Ui);return A(new t(xr),e,1,!0)}function Ne(t,e,r){if(e>xn)throw Error(Ui);return A(new t(Cr),e,r,!0)}function Vi(t){var e=t.length-1,r=e*b+1;if(e=t[e],e){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function qe(t){for(var e="";t--;)e+="0";return e}function ji(t,e,r,n){var i,s=new t(1),o=Math.ceil(n/b+4);for(_=!1;;){if(r%2&&(s=s.times(e),Fi(s.d,o)&&(i=!0)),r=se(r/2),r===0){r=s.d.length-1,i&&s.d[r]===0&&++s.d[r];break}e=e.times(e),Fi(e.d,o)}return _=!0,s}function Ri(t){return t.d[t.d.length-1]&1}function zi(t,e,r){for(var n,i,s=new t(e[0]),o=0;++o<e.length;){if(i=new t(e[o]),!i.s){s=i;break}n=s.cmp(i),(n===r||n===0&&s.s===r)&&(s=i)}return s}function Cn(t,e){var r,n,i,s,o,u,l,a=0,c=0,f=0,h=t.constructor,d=h.rounding,m=h.precision;if(!t.d||!t.d[0]||t.e>17)return new h(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(e==null?(_=!1,l=m):l=e,u=new h(.03125);t.e>-2;)t=t.times(u),f+=5;for(n=Math.log(G(2,f))/Math.LN10*2+5|0,l+=n,r=s=o=new h(1),h.precision=l;;){if(s=A(s.times(t),l,1),r=r.times(++c),u=o.plus(P(s,r,l,1)),te(u.d).slice(0,l)===te(o.d).slice(0,l)){for(i=f;i--;)o=A(o.times(o),l,1);if(e==null)if(a<3&&jt(o.d,l-n,d,a))h.precision=l+=10,r=s=u=new h(1),c=0,a++;else return A(o,h.precision=m,d,_=!0);else return h.precision=m,o}o=u}}function $e(t,e){var r,n,i,s,o,u,l,a,c,f,h,d=1,m=10,p=t,g=p.d,w=p.constructor,T=w.rounding,D=w.precision;if(p.s<0||!g||!g[0]||!p.e&&g[0]==1&&g.length==1)return new w(g&&!g[0]?-1/0:p.s!=1?NaN:g?0:p);if(e==null?(_=!1,c=D):c=e,w.precision=c+=m,r=te(g),n=r.charAt(0),Math.abs(s=p.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(t),r=te(p.d),n=r.charAt(0),d++;s=p.e,n>1?(p=new w("0."+r),s++):p=new w(n+"."+r.slice(1))}else return a=Sr(w,c+2,D).times(s+""),p=$e(new w(n+"."+r.slice(1)),c-m).plus(a),w.precision=D,e==null?A(p,D,T,_=!0):p;for(f=p,l=o=p=P(p.minus(1),p.plus(1),c,1),h=A(p.times(p),c,1),i=3;;){if(o=A(o.times(h),c,1),a=l.plus(P(o,new w(i),c,1)),te(a.d).slice(0,c)===te(l.d).slice(0,c))if(l=l.times(2),s!==0&&(l=l.plus(Sr(w,c+2,D).times(s+""))),l=P(l,new w(d),c,1),e==null)if(jt(l.d,c-m,T,u))w.precision=c+=m,a=o=p=P(f.minus(1),f.plus(1),c,1),h=A(p.times(p),c,1),i=u=1;else return A(l,w.precision=D,T,_=!0);else return w.precision=D,l;l=a,i+=2}}function Hi(t){return String(t.s*t.s/0)}function Nr(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%b,r<0&&(n+=b),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=b;n<i;)t.d.push(+e.slice(n,n+=b));e=e.slice(n),n=b-e.length}else n-=i;for(;n--;)e+="0";t.d.push(+e),_&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function pu(t,e){var r,n,i,s,o,u,l,a,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),$i.test(e))return Nr(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(lu.test(e))r=16,e=e.toLowerCase();else if(au.test(e))r=2;else if(cu.test(e))r=8;else throw Error(Ve+e);for(s=e.search(/p/i),s>0?(l=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),s=e.indexOf("."),o=s>=0,n=t.constructor,o&&(e=e.replace(".",""),u=e.length,s=u-s,i=ji(n,new n(r),s,s*2)),a=_r(e,r,Ae),c=a.length-1,s=c;a[s]===0;--s)a.pop();return s<0?new n(t.s*0):(t.e=Or(a,c),t.d=a,_=!1,o&&(t=P(t,i,u*4)),l&&(t=t.times(Math.abs(l)<54?G(2,l):zt.pow(2,l))),_=!0,t)}function mu(t,e){var r,n=e.d.length;if(n<3)return e.isZero()?e:gt(t,2,e,e);r=1.4*Math.sqrt(n),r=r>16?16:r|0,e=e.times(1/Br(5,r)),e=gt(t,2,e,e);for(var i,s=new t(5),o=new t(16),u=new t(20);r--;)i=e.times(e),e=e.times(s.plus(i.times(o.times(i).minus(u))));return e}function gt(t,e,r,n,i){var s,o,u,l,a=1,c=t.precision,f=Math.ceil(c/b);for(_=!1,l=r.times(r),u=new t(n);;){if(o=P(u.times(l),new t(e++*e++),c,1),u=i?n.plus(o):n.minus(o),n=P(o.times(l),new t(e++*e++),c,1),o=u.plus(n),o.d[f]!==void 0){for(s=f;o.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=n,n=o,o=s,a++}return _=!0,o.d.length=f+1,o}function Br(t,e){for(var r=t;--e;)r*=t;return r}function Xi(t,e){var r,n=e.s<0,i=Ne(t,t.precision,1),s=i.times(.5);if(e=e.abs(),e.lte(s))return Fe=n?4:1,e;if(r=e.divToInt(i),r.isZero())Fe=n?3:2;else{if(e=e.minus(r.times(i)),e.lte(s))return Fe=Ri(r)?n?2:3:n?4:1,e;Fe=Ri(r)?n?1:4:n?3:2}return e.minus(i).abs()}function Sn(t,e,r,n){var i,s,o,u,l,a,c,f,h,d=t.constructor,m=r!==void 0;if(m?(ce(r,1,je),n===void 0?n=d.rounding:ce(n,0,8)):(r=d.precision,n=d.rounding),!t.isFinite())c=Hi(t);else{for(c=xe(t),o=c.indexOf("."),m?(i=2,e==16?r=r*4-3:e==8&&(r=r*3-2)):i=e,o>=0&&(c=c.replace(".",""),h=new d(1),h.e=c.length-o,h.d=_r(xe(h),10,i),h.e=h.d.length),f=_r(c,10,i),s=l=f.length;f[--l]==0;)f.pop();if(!f[0])c=m?"0p+0":"0";else{if(o<0?s--:(t=new d(t),t.d=f,t.e=s,t=P(t,h,r,n,0,i),f=t.d,s=t.e,a=Li),o=f[r],u=i/2,a=a||f[r+1]!==void 0,a=n<4?(o!==void 0||a)&&(n===0||n===(t.s<0?3:2)):o>u||o===u&&(n===4||a||n===6&&f[r-1]&1||n===(t.s<0?8:7)),f.length=r,a)for(;++f[--r]>i-1;)f[r]=0,r||(++s,f.unshift(1));for(l=f.length;!f[l-1];--l);for(o=0,c="";o<l;o++)c+=_n.charAt(f[o]);if(m){if(l>1)if(e==16||e==8){for(o=e==16?4:3,--l;l%o;l++)c+="0";for(f=_r(c,i,e),l=f.length;!f[l-1];--l);for(o=1,c="1.";o<l;o++)c+=_n.charAt(f[o])}else c=c.charAt(0)+"."+c.slice(1);c=c+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)c="0"+c;c="0."+c}else if(++s>l)for(s-=l;s--;)c+="0";else s<l&&(c=c.slice(0,s)+"."+c.slice(s))}c=(e==16?"0x":e==2?"0b":e==8?"0o":"")+c}return t.s<0?"-"+c:c}function Fi(t,e){if(t.length>e)return t.length=e,!0}function gu(t){return new this(t).abs()}function Eu(t){return new this(t).acos()}function wu(t){return new this(t).acosh()}function yu(t,e){return new this(t).plus(e)}function Du(t){return new this(t).asin()}function Au(t){return new this(t).asinh()}function Tu(t){return new this(t).atan()}function bu(t){return new this(t).atanh()}function vu(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,s=n+4;return!t.s||!e.s?r=new this(NaN):!t.d&&!e.d?(r=Ne(this,s,1).times(e.s>0?.25:.75),r.s=t.s):!e.d||t.isZero()?(r=e.s<0?Ne(this,n,i):new this(0),r.s=t.s):!t.d||e.isZero()?(r=Ne(this,s,1).times(.5),r.s=t.s):e.s<0?(this.precision=s,this.rounding=1,r=this.atan(P(t,e,s,1)),e=Ne(this,s,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(P(t,e,s,1)),r}function _u(t){return new this(t).cbrt()}function Nu(t){return A(t=new this(t),t.e+1,2)}function xu(t,e,r){return new this(t).clamp(e,r)}function Cu(t){if(!t||typeof t!="object")throw Error(Ir+"Object expected");var e,r,n,i=t.defaults===!0,s=["precision",1,je,"rounding",0,8,"toExpNeg",-mt,0,"toExpPos",0,mt,"maxE",0,mt,"minE",-mt,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(r=s[e],i&&(this[r]=Nn[r]),(n=t[r])!==void 0)if(se(n)===n&&n>=s[e+1]&&n<=s[e+2])this[r]=n;else throw Error(Ve+r+": "+n);if(r="crypto",i&&(this[r]=Nn[r]),(n=t[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Pi);else this[r]=!1;else throw Error(Ve+r+": "+n);return this}function Su(t){return new this(t).cos()}function Iu(t){return new this(t).cosh()}function Yi(t){var e,r,n;function i(s){var o,u,l,a=this;if(!(a instanceof i))return new i(s);if(a.constructor=i,ki(s)){a.s=s.s,_?!s.d||s.e>i.maxE?(a.e=NaN,a.d=null):s.e<i.minE?(a.e=0,a.d=[0]):(a.e=s.e,a.d=s.d.slice()):(a.e=s.e,a.d=s.d?s.d.slice():s.d);return}if(l=typeof s,l==="number"){if(s===0){a.s=1/s<0?-1:1,a.e=0,a.d=[0];return}if(s<0?(s=-s,a.s=-1):a.s=1,s===~~s&&s<1e7){for(o=0,u=s;u>=10;u/=10)o++;_?o>i.maxE?(a.e=NaN,a.d=null):o<i.minE?(a.e=0,a.d=[0]):(a.e=o,a.d=[s]):(a.e=o,a.d=[s]);return}if(s*0!==0){s||(a.s=NaN),a.e=NaN,a.d=null;return}return Nr(a,s.toString())}if(l==="string")return(u=s.charCodeAt(0))===45?(s=s.slice(1),a.s=-1):(u===43&&(s=s.slice(1)),a.s=1),$i.test(s)?Nr(a,s):pu(a,s);if(l==="bigint")return s<0?(s=-s,a.s=-1):a.s=1,Nr(a,s.toString());throw Error(Ve+s)}if(i.prototype=E,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Cu,i.clone=Yi,i.isDecimal=ki,i.abs=gu,i.acos=Eu,i.acosh=wu,i.add=yu,i.asin=Du,i.asinh=Au,i.atan=Tu,i.atanh=bu,i.atan2=vu,i.cbrt=_u,i.ceil=Nu,i.clamp=xu,i.cos=Su,i.cosh=Iu,i.div=Ou,i.exp=Bu,i.floor=Mu,i.hypot=Ru,i.ln=Fu,i.log=ku,i.log10=Uu,i.log2=Lu,i.max=Pu,i.min=qu,i.mod=$u,i.mul=Vu,i.pow=ju,i.random=zu,i.round=Hu,i.sign=Xu,i.sin=Yu,i.sinh=Wu,i.sqrt=Gu,i.sub=Ju,i.sum=Zu,i.tan=Qu,i.tanh=Ku,i.trunc=ea,t===void 0&&(t={}),t&&t.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return i.config(t),i}function Ou(t,e){return new this(t).div(e)}function Bu(t){return new this(t).exp()}function Mu(t){return A(t=new this(t),t.e+1,3)}function Ru(){var t,e,r=new this(0);for(_=!1,t=0;t<arguments.length;)if(e=new this(arguments[t++]),e.d)r.d&&(r=r.plus(e.times(e)));else{if(e.s)return _=!0,new this(1/0);r=e}return _=!0,r.sqrt()}function ki(t){return t instanceof zt||t&&t.toStringTag===qi||!1}function Fu(t){return new this(t).ln()}function ku(t,e){return new this(t).log(e)}function Lu(t){return new this(t).log(2)}function Uu(t){return new this(t).log(10)}function Pu(){return zi(this,arguments,-1)}function qu(){return zi(this,arguments,1)}function $u(t,e){return new this(t).mod(e)}function Vu(t,e){return new this(t).mul(e)}function ju(t,e){return new this(t).pow(e)}function zu(t){var e,r,n,i,s=0,o=new this(1),u=[];if(t===void 0?t=this.precision:ce(t,1,je),n=Math.ceil(t/b),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));s<n;)i=e[s],i>=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);s<n;)i=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((e[s+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,s):(u.push(i%1e7),s+=4);s=n/4}else throw Error(Pi);else for(;s<n;)u[s++]=Math.random()*1e7|0;for(n=u[--s],t%=b,n&&t&&(i=G(10,b-t),u[s]=(n/i|0)*i);u[s]===0;s--)u.pop();if(s<0)r=0,u=[0];else{for(r=-1;u[0]===0;r-=b)u.shift();for(n=1,i=u[0];i>=10;i/=10)n++;n<b&&(r-=b-n)}return o.e=r,o.d=u,o}function Hu(t){return A(t=new this(t),t.e+1,this.rounding)}function Xu(t){return t=new this(t),t.d?t.d[0]?t.s:0*t.s:t.s||NaN}function Yu(t){return new this(t).sin()}function Wu(t){return new this(t).sinh()}function Gu(t){return new this(t).sqrt()}function Ju(t,e){return new this(t).sub(e)}function Zu(){var t=0,e=arguments,r=new this(e[t]);for(_=!1;r.s&&++t<e.length;)r=r.plus(e[t]);return _=!0,A(r,this.precision,this.rounding)}function Qu(t){return new this(t).tan()}function Ku(t){return new this(t).tanh()}function ea(t){return A(t=new this(t),t.e+1,1)}E[Symbol.for("nodejs.util.inspect.custom")]=E.toString;E[Symbol.toStringTag]="Decimal";var zt=E.constructor=Yi(Nn);xr=new zt(xr);Cr=new zt(Cr);var Wi=zt;var ta=20,ra=1,et=1e6,Gi=1e6,na=-7,ia=21,sa=!1,Ht="[big.js] ",tt=Ht+"Invalid ",Mr=tt+"decimal places",oa=tt+"rounding mode",Ji=Ht+"Division by zero",k={},Ce=void 0,ua=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function Zi(){function t(e){var r=this;if(!(r instanceof t))return e===Ce?Zi():new t(e);if(e instanceof t)r.s=e.s,r.e=e.e,r.c=e.c.slice();else{if(typeof e!="string"){if(t.strict===!0&&typeof e!="bigint")throw TypeError(tt+"value");e=e===0&&1/e<0?"-0":String(e)}aa(r,e)}r.constructor=t}return t.prototype=k,t.DP=ta,t.RM=ra,t.NE=na,t.PE=ia,t.strict=sa,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function aa(t,e){var r,n,i;if(!ua.test(e))throw Error(tt+"number");for(t.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),i=e.length,n=0;n<i&&e.charAt(n)=="0";)++n;if(n==i)t.c=[t.e=0];else{for(;i>0&&e.charAt(--i)=="0";);for(t.e=r-n-1,t.c=[],r=0;n<=i;)t.c[r++]=+e.charAt(n++)}return t}function rt(t,e,r,n){var i=t.c;if(r===Ce&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(oa);if(e<1)n=r===3&&(n||!!i[0])||e===0&&(r===1&&i[0]>=5||r===2&&(i[0]>5||i[0]===5&&(n||i[1]!==Ce))),i.length=1,n?(t.e=t.e-e+1,i[0]=1):i[0]=t.e=0;else if(e<i.length){if(n=r===1&&i[e]>=5||r===2&&(i[e]>5||i[e]===5&&(n||i[e+1]!==Ce||i[e-1]&1))||r===3&&(n||!!i[0]),i.length=e,n){for(;++i[--e]>9;)if(i[e]=0,e===0){++t.e,i.unshift(1);break}}for(e=i.length;!i[--e];)i.pop()}return t}function nt(t,e,r){var n=t.e,i=t.c.join(""),s=i.length;if(e)i=i.charAt(0)+(s>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>s)for(n-=s;n--;)i+="0";else n<s&&(i=i.slice(0,n)+"."+i.slice(n));else s>1&&(i=i.charAt(0)+"."+i.slice(1));return t.s<0&&r?"-"+i:i}k.abs=function(){var t=new this.constructor(this);return t.s=1,t};k.cmp=function(t){var e,r=this,n=r.c,i=(t=new r.constructor(t)).c,s=r.s,o=t.s,u=r.e,l=t.e;if(!n[0]||!i[0])return n[0]?s:i[0]?-o:0;if(s!=o)return s;if(e=s<0,u!=l)return u>l^e?1:-1;for(o=(u=n.length)<(l=i.length)?u:l,s=-1;++s<o;)if(n[s]!=i[s])return n[s]>i[s]^e?1:-1;return u==l?0:u>l^e?1:-1};k.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,s=e.s==t.s?1:-1,o=r.DP;if(o!==~~o||o<0||o>et)throw Error(Mr);if(!i[0])throw Error(Ji);if(!n[0])return t.s=s,t.c=[t.e=0],t;var u,l,a,c,f,h=i.slice(),d=u=i.length,m=n.length,p=n.slice(0,u),g=p.length,w=t,T=w.c=[],D=0,x=o+(w.e=e.e-t.e)+1;for(w.s=s,s=x<0?0:x,h.unshift(0);g++<u;)p.push(0);do{for(a=0;a<10;a++){if(u!=(g=p.length))c=u>g?1:-1;else for(f=-1,c=0;++f<u;)if(i[f]!=p[f]){c=i[f]>p[f]?1:-1;break}if(c<0){for(l=g==u?i:h;g;){if(p[--g]<l[g]){for(f=g;f&&!p[--f];)p[f]=9;--p[f],p[g]+=10}p[g]-=l[g]}for(;!p[0];)p.shift()}else break}T[D++]=c?a:++a,p[0]&&c?p[g]=n[d]||0:p=[n[d]]}while((d++<m||p[0]!==Ce)&&s--);return!T[0]&&D!=1&&(T.shift(),w.e--,x--),D>x&&rt(w,x,r.RM,p[0]!==Ce),w};k.eq=function(t){return this.cmp(t)===0};k.gt=function(t){return this.cmp(t)>0};k.gte=function(t){return this.cmp(t)>-1};k.lt=function(t){return this.cmp(t)<0};k.lte=function(t){return this.cmp(t)<1};k.minus=k.sub=function(t){var e,r,n,i,s=this,o=s.constructor,u=s.s,l=(t=new o(t)).s;if(u!=l)return t.s=-l,s.plus(t);var a=s.c.slice(),c=s.e,f=t.c,h=t.e;if(!a[0]||!f[0])return f[0]?t.s=-l:a[0]?t=new o(s):t.s=1,t;if(u=c-h){for((i=u<0)?(u=-u,n=a):(h=c,n=f),n.reverse(),l=u;l--;)n.push(0);n.reverse()}else for(r=((i=a.length<f.length)?a:f).length,u=l=0;l<r;l++)if(a[l]!=f[l]){i=a[l]<f[l];break}if(i&&(n=a,a=f,f=n,t.s=-t.s),(l=(r=f.length)-(e=a.length))>0)for(;l--;)a[e++]=0;for(l=e;r>u;){if(a[--r]<f[r]){for(e=r;e&&!a[--e];)a[e]=9;--a[e],a[r]+=10}a[r]-=f[r]}for(;a[--l]===0;)a.pop();for(;a[0]===0;)a.shift(),--h;return a[0]||(t.s=1,a=[h=0]),t.c=a,t.e=h,t};k.mod=function(t){var e,r=this,n=r.constructor,i=r.s,s=(t=new n(t)).s;if(!t.c[0])throw Error(Ji);return r.s=t.s=1,e=t.cmp(r)==1,r.s=i,t.s=s,e?new n(r):(i=n.DP,s=n.RM,n.DP=n.RM=0,r=r.div(t),n.DP=i,n.RM=s,this.minus(r.times(t)))};k.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t};k.plus=k.add=function(t){var e,r,n,i=this,s=i.constructor;if(t=new s(t),i.s!=t.s)return t.s=-t.s,i.minus(t);var o=i.e,u=i.c,l=t.e,a=t.c;if(!u[0]||!a[0])return a[0]||(u[0]?t=new s(i):t.s=i.s),t;if(u=u.slice(),e=o-l){for(e>0?(l=o,n=a):(e=-e,n=u),n.reverse();e--;)n.push(0);n.reverse()}for(u.length-a.length<0&&(n=a,a=u,u=n),e=a.length,r=0;e;u[e]%=10)r=(u[--e]=u[e]+a[e]+r)/10|0;for(r&&(u.unshift(r),++l),e=u.length;u[--e]===0;)u.pop();return t.c=u,t.e=l,t};k.pow=function(t){var e=this,r=new e.constructor("1"),n=r,i=t<0;if(t!==~~t||t<-Gi||t>Gi)throw Error(tt+"exponent");for(i&&(t=-t);t&1&&(n=n.times(e)),t>>=1,!!t;)e=e.times(e);return i?r.div(n):n};k.prec=function(t,e){if(t!==~~t||t<1||t>et)throw Error(tt+"precision");return rt(new this.constructor(this),t,e)};k.round=function(t,e){if(t===Ce)t=0;else if(t!==~~t||t<-et||t>et)throw Error(Mr);return rt(new this.constructor(this),t+this.e+1,e)};k.sqrt=function(){var t,e,r,n=this,i=n.constructor,s=n.s,o=n.e,u=new i("0.5");if(!n.c[0])return new i(n);if(s<0)throw Error(Ht+"No square root");s=Math.sqrt(+nt(n,!0,!0)),s===0||s===1/0?(e=n.c.join(""),e.length+o&1||(e+="0"),s=Math.sqrt(e),o=((o+1)/2|0)-(o<0||o&1),t=new i((s==1/0?"5e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+o)):t=new i(s+""),o=t.e+(i.DP+=4);do r=t,t=u.times(r.plus(n.div(r)));while(r.c.slice(0,o).join("")!==t.c.slice(0,o).join(""));return rt(t,(i.DP-=4)+t.e+1,i.RM)};k.times=k.mul=function(t){var e,r=this,n=r.constructor,i=r.c,s=(t=new n(t)).c,o=i.length,u=s.length,l=r.e,a=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!s[0])return t.c=[t.e=0],t;for(t.e=l+a,o<u&&(e=i,i=s,s=e,a=o,o=u,u=a),e=new Array(a=o+u);a--;)e[a]=0;for(l=u;l--;){for(u=0,a=o+l;a>l;)u=e[a]+s[l]*i[a-l-1]+u,e[a--]=u%10,u=u/10|0;e[a]=u}for(u?++t.e:e.shift(),l=e.length;!e[--l];)e.pop();return t.c=e,t};k.toExponential=function(t,e){var r=this,n=r.c[0];if(t!==Ce){if(t!==~~t||t<0||t>et)throw Error(Mr);for(r=rt(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return nt(r,!0,!!n)};k.toFixed=function(t,e){var r=this,n=r.c[0];if(t!==Ce){if(t!==~~t||t<0||t>et)throw Error(Mr);for(r=rt(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return nt(r,!1,!!n)};k[Symbol.for("nodejs.util.inspect.custom")]=k.toJSON=k.toString=function(){var t=this,e=t.constructor;return nt(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};k.toNumber=function(){var t=+nt(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(Ht+"Imprecise conversion");return t};k.toPrecision=function(t,e){var r=this,n=r.constructor,i=r.c[0];if(t!==Ce){if(t!==~~t||t<1||t>et)throw Error(tt+"precision");for(r=rt(new n(r),t,e);r.c.length<t;)r.c.push(0)}return nt(r,t<=r.e||r.e<=n.NE||r.e>=n.PE,!!i)};k.valueOf=function(){var t=this,e=t.constructor;if(e.strict===!0)throw Error(Ht+"valueOf disallowed");return nt(t,t.e<=e.NE||t.e>=e.PE,!0)};var la=Zi(),Qi=la;var qn={};Oi(qn,{DecodeError:()=>oe,Decoder:()=>be,EXT_TIMESTAMP:()=>On,Encoder:()=>Et,ExtData:()=>Te,ExtensionCodec:()=>ze,decode:()=>us,decodeArrayStream:()=>cs,decodeAsync:()=>ls,decodeMulti:()=>as,decodeMultiStream:()=>fs,decodeTimestampExtension:()=>kn,decodeTimestampToTimeSpec:()=>Fn,encode:()=>kr,encodeDateToTimeSpec:()=>Mn,encodeTimeSpecToTimestamp:()=>Bn,encodeTimestampExtension:()=>Rn});function Ki(t){let e=t.length,r=0,n=0;for(;n<e;){let i=t.charCodeAt(n++);if((i&4294967168)===0){r++;continue}else if((i&4294965248)===0)r+=2;else{if(i>=55296&&i<=56319&&n<e){let s=t.charCodeAt(n);(s&64512)===56320&&(++n,i=((i&1023)<<10)+(s&1023)+65536)}(i&4294901760)===0?r+=3:r+=4}}return r}function ca(t,e,r){let n=t.length,i=r,s=0;for(;s<n;){let o=t.charCodeAt(s++);if((o&4294967168)===0){e[i++]=o;continue}else if((o&4294965248)===0)e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<n){let u=t.charCodeAt(s);(u&64512)===56320&&(++s,o=((o&1023)<<10)+(u&1023)+65536)}(o&4294901760)===0?(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128):(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128)}e[i++]=o&63|128}}var fa=new TextEncoder,ha=50;function da(t,e,r){fa.encodeInto(t,e.subarray(r))}function es(t,e,r){t.length>ha?da(t,e,r):ca(t,e,r)}var pa=4096;function In(t,e,r){let n=e,i=n+r,s=[],o="";for(;n<i;){let u=t[n++];if((u&128)===0)s.push(u);else if((u&224)===192){let l=t[n++]&63;s.push((u&31)<<6|l)}else if((u&240)===224){let l=t[n++]&63,a=t[n++]&63;s.push((u&31)<<12|l<<6|a)}else if((u&248)===240){let l=t[n++]&63,a=t[n++]&63,c=t[n++]&63,f=(u&7)<<18|l<<12|a<<6|c;f>65535&&(f-=65536,s.push(f>>>10&1023|55296),f=56320|f&1023),s.push(f)}else s.push(u);s.length>=pa&&(o+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(o+=String.fromCharCode(...s)),o}var ma=new TextDecoder,ga=200;function Ea(t,e,r){let n=t.subarray(e,e+r);return ma.decode(n)}function ts(t,e,r){return r>ga?Ea(t,e,r):In(t,e,r)}var Te=class{type;data;constructor(e,r){this.type=e,this.data=r}};var oe=class t extends Error{constructor(e){super(e);let r=Object.create(t.prototype);Object.setPrototypeOf(this,r),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:t.name})}};function rs(t,e,r){let n=r/4294967296,i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function Rr(t,e,r){let n=Math.floor(r/4294967296),i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function Fr(t,e){let r=t.getInt32(e),n=t.getUint32(e+4);return r*4294967296+n}function ns(t,e){let r=t.getUint32(e),n=t.getUint32(e+4);return r*4294967296+n}var On=-1,wa=4294967296-1,ya=17179869184-1;function Bn({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=ya)if(e===0&&t<=wa){let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t),r}else{let r=t/4294967296,n=t&4294967295,i=new Uint8Array(8),s=new DataView(i.buffer);return s.setUint32(0,e<<2|r&3),s.setUint32(4,n),i}else{let r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,e),Rr(n,4,t),r}}function Mn(t){let e=t.getTime(),r=Math.floor(e/1e3),n=(e-r*1e3)*1e6,i=Math.floor(n/1e9);return{sec:r+i,nsec:n-i*1e9}}function Rn(t){if(t instanceof Date){let e=Mn(t);return Bn(e)}else return null}function Fn(t){let e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{let r=e.getUint32(0),n=e.getUint32(4),i=(r&3)*4294967296+n,s=r>>>2;return{sec:i,nsec:s}}case 12:{let r=Fr(e,4),n=e.getUint32(0);return{sec:r,nsec:n}}default:throw new oe(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function kn(t){let e=Fn(t);return new Date(e.sec*1e3+e.nsec/1e6)}var is={type:On,encode:Rn,decode:kn};var ze=class t{static defaultCodec=new t;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(is)}register({type:e,encode:r,decode:n}){if(e>=0)this.encoders[e]=r,this.decoders[e]=n;else{let i=-1-e;this.builtInEncoders[i]=r,this.builtInDecoders[i]=n}}tryToEncode(e,r){for(let n=0;n<this.builtInEncoders.length;n++){let i=this.builtInEncoders[n];if(i!=null){let s=i(e,r);if(s!=null){let o=-1-n;return new Te(o,s)}}}for(let n=0;n<this.encoders.length;n++){let i=this.encoders[n];if(i!=null){let s=i(e,r);if(s!=null){let o=n;return new Te(o,s)}}}return e instanceof Te?e:null}decode(e,r,n){let i=r<0?this.builtInDecoders[-1-r]:this.decoders[r];return i?i(e,r,n):new Te(r,e)}};function Da(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function Xt(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Da(t)?new Uint8Array(t):Uint8Array.from(t)}var Aa=100,Ta=2048,Et=class t{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??ze.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??Aa,this.initialBufferSize=e?.initialBufferSize??Ta,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,r){if(r>this.maxDepth)throw new Error(`Too deep objects in depth ${r}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,r)}ensureBufferSizeToWrite(e){let r=this.pos+e;this.view.byteLength<r&&this.resizeBuffer(r*2)}resizeBuffer(e){let r=new ArrayBuffer(e),n=new Uint8Array(r),i=new DataView(r);n.set(this.bytes),this.view=i,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let n=Ki(e);this.ensureBufferSizeToWrite(5+n),this.writeStringHeader(n),es(e,this.bytes,this.pos),this.pos+=n}encodeObject(e,r){let n=this.extensionCodec.tryToEncode(e,this.context);if(n!=null)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,r);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,r);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let r=e.byteLength;if(r<256)this.writeU8(196),this.writeU8(r);else if(r<65536)this.writeU8(197),this.writeU16(r);else if(r<4294967296)this.writeU8(198),this.writeU32(r);else throw new Error(`Too large binary: ${r}`);let n=Xt(e);this.writeU8a(n)}encodeArray(e,r){let n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else if(n<4294967296)this.writeU8(221),this.writeU32(n);else throw new Error(`Too large array: ${n}`);for(let i of e)this.doEncode(i,r+1)}countWithoutUndefined(e,r){let n=0;for(let i of r)e[i]!==void 0&&n++;return n}encodeMap(e,r){let n=Object.keys(e);this.sortKeys&&n.sort();let i=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(let s of n){let o=e[s];this.ignoreUndefined&&o===void 0||(this.encodeString(s),this.doEncode(o,r+1))}}encodeExtension(e){if(typeof e.data=="function"){let n=e.data(this.pos+6),i=n.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(n);return}let r=e.data.length;if(r===1)this.writeU8(212);else if(r===2)this.writeU8(213);else if(r===4)this.writeU8(214);else if(r===8)this.writeU8(215);else if(r===16)this.writeU8(216);else if(r<256)this.writeU8(199),this.writeU8(r);else if(r<65536)this.writeU8(200),this.writeU16(r);else if(r<4294967296)this.writeU8(201),this.writeU32(r);else throw new Error(`Too large extension object: ${r}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let r=e.length;this.ensureBufferSizeToWrite(r),this.bytes.set(e,this.pos),this.pos+=r}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),rs(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),Rr(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function kr(t,e){return new Et(e).encodeSharedRef(t)}function Lr(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}var ba=16,va=16,Ur=class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=ba,r=va){this.maxKeyLength=e,this.maxLengthPerKey=r,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,r,n){let i=this.caches[n-1];e:for(let s of i){let o=s.bytes;for(let u=0;u<n;u++)if(o[u]!==e[r+u])continue e;return s.str}return null}store(e,r){let n=this.caches[e.length-1],i={bytes:e,str:r};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=i:n.push(i)}decode(e,r,n){let i=this.find(e,r,n);if(i!=null)return this.hit++,i;this.miss++;let s=In(e,r,n),o=Uint8Array.prototype.slice.call(e,r,r+n);return this.store(o,s),s}};var Ln="array",Gt="map_key",os="map_value",_a=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new oe("The type of key must be string or number but "+typeof t)},Un=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let r=this.getUninitializedStateFromPool();r.type=Ln,r.position=0,r.size=e,r.array=new Array(e)}pushMapState(e){let r=this.getUninitializedStateFromPool();r.type=Gt,r.readCount=0,r.size=e,r.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===Ln){let n=e;n.size=0,n.array=void 0,n.position=0,n.type=void 0}if(e.type===Gt||e.type===os){let n=e;n.size=0,n.map=void 0,n.readCount=0,n.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},Wt=-1,Pn=new DataView(new ArrayBuffer(0)),Na=new Uint8Array(Pn.buffer);try{Pn.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var ss=new RangeError("Insufficient data"),xa=new Ur,be=class t{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=Pn;bytes=Na;headByte=Wt;stack=new Un;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??ze.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:xa,this.mapKeyConverter=e?.mapKeyConverter??_a}clone(){return new t({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=Wt,this.stack.reset()}setBuffer(e){let r=Xt(e);this.bytes=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===Wt&&!this.hasRemaining(1))this.setBuffer(e);else{let r=this.bytes.subarray(this.pos),n=Xt(e),i=new Uint8Array(r.length+n.length);i.set(r),i.set(n,r.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:r,pos:n}=this;return new RangeError(`Extra ${r.byteLength-n} of ${r.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let r=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return r}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let r=!1,n;for await(let u of e){if(r)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(u);try{n=this.doDecodeSync(),r=!0}catch(l){if(!(l instanceof RangeError))throw l}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}let{headByte:i,pos:s,totalPos:o}=this;throw new RangeError(`Insufficient data in parsing ${Lr(i)} at ${o} (${s} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,r){if(this.entered){yield*this.clone().decodeMultiAsync(e,r);return}try{this.entered=!0;let n=r,i=-1;for await(let s of e){if(r&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(i=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(o){if(!(o instanceof RangeError))throw o}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){let e=this.readHeadByte(),r;if(e>=224)r=e-256;else if(e<192)if(e<128)r=e;else if(e<144){let i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e<160){let i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else{let i=e-160;r=this.decodeString(i,0)}else if(e===192)r=null;else if(e===194)r=!1;else if(e===195)r=!0;else if(e===202)r=this.readF32();else if(e===203)r=this.readF64();else if(e===204)r=this.readU8();else if(e===205)r=this.readU16();else if(e===206)r=this.readU32();else if(e===207)this.useBigInt64?r=this.readU64AsBigInt():r=this.readU64();else if(e===208)r=this.readI8();else if(e===209)r=this.readI16();else if(e===210)r=this.readI32();else if(e===211)this.useBigInt64?r=this.readI64AsBigInt():r=this.readI64();else if(e===217){let i=this.lookU8();r=this.decodeString(i,1)}else if(e===218){let i=this.lookU16();r=this.decodeString(i,2)}else if(e===219){let i=this.lookU32();r=this.decodeString(i,4)}else if(e===220){let i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else if(e===221){let i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else if(e===222){let i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e===223){let i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e===196){let i=this.lookU8();r=this.decodeBinary(i,1)}else if(e===197){let i=this.lookU16();r=this.decodeBinary(i,2)}else if(e===198){let i=this.lookU32();r=this.decodeBinary(i,4)}else if(e===212)r=this.decodeExtension(1,0);else if(e===213)r=this.decodeExtension(2,0);else if(e===214)r=this.decodeExtension(4,0);else if(e===215)r=this.decodeExtension(8,0);else if(e===216)r=this.decodeExtension(16,0);else if(e===199){let i=this.lookU8();r=this.decodeExtension(i,1)}else if(e===200){let i=this.lookU16();r=this.decodeExtension(i,2)}else if(e===201){let i=this.lookU32();r=this.decodeExtension(i,4)}else throw new oe(`Unrecognized type byte: ${Lr(e)}`);this.complete();let n=this.stack;for(;n.length>0;){let i=n.top();if(i.type===Ln)if(i.array[i.position]=r,i.position++,i.position===i.size)r=i.array,n.release(i);else continue e;else if(i.type===Gt){if(r==="__proto__")throw new oe("The key __proto__ is not allowed");i.key=this.mapKeyConverter(r),i.type=os;continue e}else if(i.map[i.key]=r,i.readCount++,i.readCount===i.size)r=i.map,n.release(i);else{i.key=null,i.type=Gt;continue e}}return r}}readHeadByte(){return this.headByte===Wt&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=Wt}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new oe(`Unrecognized array type byte: ${Lr(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new oe(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new oe(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,r){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,r):this.decodeBinary(e,r)}decodeUtf8String(e,r){if(e>this.maxStrLength)throw new oe(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+r+e)throw ss;let n=this.pos+r,i;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?i=this.keyDecoder.decode(this.bytes,n,e):i=ts(this.bytes,n,e),this.pos+=r+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===Gt:!1}decodeBinary(e,r){if(e>this.maxBinLength)throw new oe(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+r))throw ss;let n=this.pos+r,i=this.bytes.subarray(n,n+e);return this.pos+=r+e,i}decodeExtension(e,r){if(e>this.maxExtLength)throw new oe(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let n=this.view.getInt8(this.pos+r),i=this.decodeBinary(e,r+1);return this.extensionCodec.decode(i,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){let e=ns(this.view,this.pos);return this.pos+=8,e}readI64(){let e=Fr(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function us(t,e){return new be(e).decode(t)}function as(t,e){return new be(e).decodeMulti(t)}function Ca(t){return t[Symbol.asyncIterator]!=null}async function*Sa(t){let e=t.getReader();try{for(;;){let{done:r,value:n}=await e.read();if(r)return;yield n}}finally{e.releaseLock()}}function Pr(t){return Ca(t)?t:Sa(t)}async function ls(t,e){let r=Pr(t);return new be(e).decodeAsync(r)}function cs(t,e){let r=Pr(t);return new be(e).decodeArrayStream(r)}function fs(t,e){let r=Pr(t);return new be(e).decodeStream(r)}var sn=Bi(ai(),1),li=Wi,ci=Qi,Be=qn,Eo=sn.DOMParser,wo=sn.XMLSerializer;var yo=Be!==null;function Do(){if(!yo)throw new Error("@msgpack/msgpack is required for MessagePack support. Install with: npm install @msgpack/msgpack")}var Ao=Cc();function Cc(){if(!yo)return null;let t=new TextEncoder,e=new TextDecoder,r=new Be.ExtensionCodec;return r.register({type:-1,encode:n=>{if(n instanceof Date){let i=Ze(n);if(i==="D"||i==="H")return null}return Be.encodeTimestampExtension(n)},decode:n=>Be.decodeTimestampExtension(n)}),r.register({type:1,encode:n=>ee(n)?t.encode(n.toString()):null,decode:n=>kt(e.decode(n))}),r.register({type:2,encode:n=>{if(n instanceof Date&&Ze(n)==="D"){let i=n.getUTCFullYear(),s=String(n.getUTCMonth()+1).padStart(2,"0"),o=String(n.getUTCDate()).padStart(2,"0");return t.encode(`${i}-${s}-${o}`)}return null},decode:n=>new Date(e.decode(n)+"T00:00:00.000Z")}),r.register({type:3,encode:n=>{if(n instanceof Date&&Ze(n)==="H"){let i=String(n.getUTCHours()).padStart(2,"0"),s=String(n.getUTCMinutes()).padStart(2,"0"),o=String(n.getUTCSeconds()).padStart(2,"0"),u=String(n.getUTCMilliseconds()).padStart(3,"0");return t.encode(`${i}:${s}:${o}.${u}`)}return null},decode:n=>{let i=e.decode(n),s=i.indexOf("."),o=s>=0?i.substring(0,s):i,u=s>=0?i.substring(s+1):"0",[l,a,c]=o.split(":"),f=Math.round(+u.substring(0,3));return new Date(Date.UTC(1970,0,1,+l,+a,+c,f))}}),r.register({type:4,encode:n=>{let i=fi(n);if(i!==null){let[s,o]=i;return t.encode(`${s}:${o(n)}`)}return null},decode:n=>{let i=e.decode(n),s=i.indexOf(":"),o=i.slice(0,s),u=i.slice(s+1),l=Qe[o];if(l!==void 0){let[,a]=l;return a(u)}return`${u}::${o}`}}),r}function To(t){return Do(),Be.encode(t,{extensionCodec:Ao})}function bo(t){return Do(),Be.decode(t,{extensionCodec:Ao})}function un(t,e=!1){let r=an(t);if(r===null)return[!1,String(t)];let[n,i,s]=r;return s&&!e?[!1,String(t)]:[!0,`${i(t)}::${n}`]}function hi(t){if(!t.includes("::"))return[!1,t];let e=t.lastIndexOf("::"),r=t.slice(0,e),n=t.slice(e+2),i=Qe[n];if(i===void 0)return[!1,t];let[,s]=i;return[!0,s(r)]}function on(t,e,r){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let n={};for(let[i,s]of Object.entries(t))n[i]=on(s,e,r);return n}return Array.isArray(t)?t.map(n=>on(n,e,r)):r(t)?e(t):t}function di(t){let e=an(t);if(e!==null){let[r,n,i]=e;return i?[t,!1]:[`${n(t)}::${r}`,!0]}if(Array.isArray(t)){let r=!1;return[t.map(i=>{let[s,o]=di(i);return o&&(r=!0),s}),r]}if(t!==null&&typeof t=="object"){let r=!1,n={};for(let[i,s]of Object.entries(t)){let[o,u]=di(s);u&&(r=!0),n[i]=o}return[n,r]}return[t,!1]}function Sc(t,e=!1){let[r,n]=un(t,e);if(r)return n;let[i,s]=di(t),o=JSON.stringify(i);return s?`${o}::JS`:o}function Ic(t){return JSON.stringify(t)}function Oc(t){if(!Be)throw new Error("@msgpack/msgpack is required for MessagePack support");return Be.encode(t)}function De(t,e=null,{raw:r=!1,qs:n=!1,_forceSuffix:i=!1}={}){if(n)return`${_o(t)}::QS`;if(r){if(e===null||e==="json")return Ic(t);if(e==="msgpack")return Oc(t);throw e==="xml"?new Error("raw=true is not supported for XML transport"):new Error(`Unknown transport: ${e}`)}if(e===null||e==="json"){let s=Sc(t,i);return e==="json"?`"${s}"`:s}else{if(e==="xml")return`<?xml version="1.0" ?><tytx_root>${vo(t)}</tytx_root>`;if(e==="msgpack")return To(t);throw new Error(`Unknown transport: ${e}`)}}var Lt,pi;typeof window<"u"&&window.DOMParser?(Lt=window.DOMParser,pi=window.XMLSerializer):(Lt=Eo,pi=wo);function No(t){if(t===null||typeof t!="object"||Array.isArray(t))return!1;let e=Object.keys(t);if(e.length!==1)return!1;let r=t[e[0]];return r!==null&&typeof r=="object"&&"value"in r}function xo(t,e,r){let n=t.createElement(e),i=r.attrs||{},s=r.value;for(let[o,u]of Object.entries(i))n.setAttribute(o,De(u,null,{_forceSuffix:!0}));if(Array.isArray(s))for(let o of s)if(No(o)){let[u]=Object.keys(o),l=o[u],a=xo(t,u,l);n.appendChild(a)}else{n.textContent=De(s);break}else n.textContent=De(s);return n}function vo(t){if(!Lt)throw new Error("XML support requires @xmldom/xmldom package in Node.js");if(No(t)){let[e]=Object.keys(t),r=t[e],n=new Lt().parseFromString("<root/>","text/xml"),i=xo(n,e,r);return new pi().serializeToString(i)}else return De(t)}function mi(t){let e={};for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=Y(i.value)}let r=[];for(let n=0;n<t.childNodes.length;n++){let i=t.childNodes[n];i.nodeType===1&&r.push(i)}if(r.length>0)if(r.length===1){let n=r[0],i=mi(n);return{attrs:e,value:{[n.tagName]:i}}}else{let n=[];for(let i of r){let s=mi(i);n.push({[i.tagName]:s})}return{attrs:e,value:n}}return{attrs:e,value:Y(t.textContent)}}function Co(t){if(!Lt)throw new Error("XML support requires @xmldom/xmldom package in Node.js");let n=new Lt().parseFromString(t,"text/xml").documentElement;if(n.tagName==="tytx_root"){let s=null;for(let o=0;o<n.childNodes.length;o++)if(n.childNodes[o].nodeType===1){s=n.childNodes[o];break}if(!s)return Y(n.textContent);n=s}let i=mi(n);return{[n.tagName]:i}}function Bc(t){return typeof t=="string"}function Mc(t){let[e,r]=hi(t);if(e)return r;let n=t;n.endsWith("::JS")&&(n=n.slice(0,-4));let i;try{i=JSON.parse(n)}catch{return t}return on(i,Rc,Bc)}function Rc(t){return t.includes("::")?hi(t)[1]:t}function Fc(t){let e=Co(t);return typeof e=="string"?Y(e):e}function kc(t){return bo(t)}function Y(t,e=null){if(t===null)return null;if(e===null||e==="json"){let r=t;return e==="json"&&t.startsWith('"')&&t.endsWith('"')&&(r=t.slice(1,-1)),Mc(r)}else{if(e==="xml")return Fc(t);if(e==="msgpack")return kc(t);throw new Error(`Unknown transport: ${e}`)}}function _o(t){if(Array.isArray(t))return t.map(e=>String(e)).join("&");if(t!==null&&typeof t=="object"){let e=[];for(let[r,n]of Object.entries(t)){let[i,s]=un(n,!0);i?e.push(`${r}=${s}`):e.push(`${r}=${n}`)}return e.join("&")}throw new TypeError(`toQs expects object or array, got ${typeof t}`)}function So(t){if(!t)return[];let e=t.split("&"),r=e.map(o=>o.includes("=")),n=r.every(Boolean),i=!r.some(Boolean);if(!n&&!i)throw new Error("QS format error: mixed items with and without '='");if(i)return e.map(o=>Y(o));let s={};for(let o of e){let u=o.indexOf("="),l=o.slice(0,u),a=o.slice(u+1);s[l]=Y(a)}return s}var Oo=li||ci||Number,Lc=li?"decimal.js":ci?"big.js":"number";function kt(t){return new Oo(t)}function ee(t){return Lc==="number"?!1:t instanceof Oo}function Ze(t){let e=t.getUTCFullYear()===1970&&t.getUTCMonth()===0&&t.getUTCDate()===1,r=t.getUTCHours()===0&&t.getUTCMinutes()===0&&t.getUTCSeconds()===0&&t.getUTCMilliseconds()===0;return e&&!r?"H":r&&!e?"D":"DHZ"}function Uc(t){return t.toString()}function Pc(t){let e=t.getUTCFullYear(),r=String(t.getUTCMonth()+1).padStart(2,"0"),n=String(t.getUTCDate()).padStart(2,"0");return`${e}-${r}-${n}`}function qc(t){return t.toISOString()}function $c(t){let e=String(t.getUTCHours()).padStart(2,"0"),r=String(t.getUTCMinutes()).padStart(2,"0"),n=String(t.getUTCSeconds()).padStart(2,"0"),i=String(t.getUTCMilliseconds()).padStart(3,"0");return`${e}:${r}:${n}.${i}`}function Vc(t){return t?"true":"false"}function jc(t){return t.toString()}function zc(t){return t.toString()}function Hc(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode.apply(null,t.subarray(r,r+32768));return btoa(e)}var ln=[],gi=new Map;function fi(t){if(t===null||typeof t!="object")return null;for(let e=Object.getPrototypeOf(t);e!==null;e=Object.getPrototypeOf(e))for(let[r,n,i,s]of ln)if(r.prototype===e)return[n,i,s];return null}function an(t){if(t===null)return["NN",()=>"",!0];if(ee(t))return["N",Uc,!1];if(t instanceof Uint8Array)return["RAW",Hc,!1];if(t instanceof Date){let e=Ze(t);return e==="D"?["D",Pc,!1]:e==="H"?["H",$c,!1]:["DHZ",qc,!1]}return typeof t=="boolean"?["B",Vc,!0]:typeof t=="number"?Number.isInteger(t)?["L",jc,!0]:["R",zc,!0]:fi(t)}function Xc(t){return kt(t)}function Yc(t){let[e,r,n]=t.split("-").map(Number);return new Date(Date.UTC(e,r-1,n,0,0,0,0))}function Io(t){return new Date(t)}function Wc(t){let[e,r,n]=t.split(":"),[i,s]=n.split(".");return new Date(Date.UTC(1970,0,1,Number(e),Number(r),Number(i),Number(s||0)))}function Gc(t){return t.toLowerCase()==="true"}function Jc(t){return parseInt(t,10)}function Zc(t){return parseFloat(t)}function Qc(t){return t}function Kc(t){return null}var ef=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function tf(t){if(!ef.test(t))throw new Error(`RAW payload is not standard padded base64: '${t}'`);let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function rf(t){return So(t)}var nf=/^[A-Z]+$/,Qe={N:[Object,Xc],D:[Date,Yc],DH:[Date,Io],DHZ:[Date,Io],H:[Date,Wc],L:[Number,Jc],R:[Number,Zc],T:[String,Qc],B:[Boolean,Gc],QS:[Object,rf],NN:[null,Kc],RAW:[Uint8Array,tf]};function Ei(t){return Object.hasOwn(Qe,t)?Qe[t][0]:null}function wi(t,e,r,n,i=!1){if(typeof e!="string"||!nf.test(e))throw new Error(`TYTX suffix '${e}' is invalid: expected uppercase ASCII letters only`);let s=Qe[e];if(s!==void 0&&s[0]!==t){let o=s[0]===null?"null":s[0].name;throw new Error(`TYTX suffix '${e}' is already registered for ${o}`)}ln=ln.filter(([o])=>o!==t),ln.push([t,e,r,i]),Qe[e]=[t,n]}function yi(t,e){gi.set(t,e)}function Ut(t){return gi.has(t)?gi.get(t):{}}function Di(t){if(t==null||t==="")return null;if(typeof t=="string"||typeof t=="boolean"||typeof t=="number"&&Number.isFinite(t)||t instanceof Date&&Number.isFinite(t.getTime())||ee(t)&&t.isFinite())return t;throw new TypeError("Column filters require loaded scalar values")}function at(t){return De(Di(t))}function Bo(t){if(!Array.isArray(t))throw new TypeError("Column selection requires an array or null");return Object.freeze([...new Map(t.map(e=>{let r=at(e);return[r,Y(r)]})).values()])}function Mo(t){if(t===null)return null;let{from:e,to:r,dtype:n,timeZone:i}=t;if(!["D","DH","DHZ"].includes(n))throw new TypeError("Date range requires a date column");for(let s of[e,r])if(s!==null&&(!(s instanceof Date)||!Number.isFinite(s.getTime())||s.getUTCHours()||s.getUTCMinutes()||s.getUTCSeconds()||s.getUTCMilliseconds()))throw new TypeError("Date bounds require civil dates");if(e&&r&&e>r)throw new RangeError("From must not be after To.");if(n==="DHZ"&&!i)throw new TypeError("DHZ requires a timeZone");return e||r?Object.freeze({from:e?.toISOString().slice(0,10)??null,to:r?.toISOString().slice(0,10)??null,dtype:n,timeZone:i}):null}function cn(t,e){if(!e)return!0;if(t==null||t==="")return!1;if(!(t instanceof Date)||!Number.isFinite(t.getTime()))throw new TypeError("Date range requires date values");let r;if(e.dtype==="DHZ"){let n=new Intl.DateTimeFormat("en",{timeZone:e.timeZone,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(t),i=s=>n.find(o=>o.type===s).value;r=`${i("year")}-${i("month")}-${i("day")}`}else r=t.toISOString().slice(0,10);return(!e.from||r>=e.from)&&(!e.to||r<=e.to)}function lt(t,e){return e===2?t%4===0&&(t%100!==0||t%400===0)?29:28:[4,6,9,11].includes(e)?30:31}function me(t,e,r){if(![t,e,r].every(Number.isInteger)||t<1||t>9999||e<1||e>12||r<1||r>lt(t,e))throw new RangeError("Date must exist in Gregorian years 0001\u20139999.");return`${String(t).padStart(4,"0")}-${String(e).padStart(2,"0")}-${String(r).padStart(2,"0")}`}function ct(t){if(typeof t!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(t))throw new RangeError("Expected a civil date in YYYY-MM-DD format.");let e=t.split("-").map(Number);return me(...e),e}function mr(t,e,r){let n=t-1,i=365*n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400)+r-1;for(let s=1;s<e;s++)i+=lt(t,s);return i}function gr(t,e){let r=mr(...ct(t))+e;if(!Number.isSafeInteger(r)||r<0||r>mr(9999,12,31))throw new RangeError("Date offset exceeds Gregorian years 0001\u20139999.");let n=1,i=1e4;for(;i-n>1;){let o=Math.floor((n+i)/2);mr(o,1,1)<=r?n=o:i=o}r-=mr(n,1,1);let s=1;for(;r>=lt(n,s);)r-=lt(n,s++);return me(n,s,r+1)}function Ai(t){return gr(t,-(mr(...ct(t))%7))}function Ro(t,e,r=0,n=1){let i=t*12+e-1+r,s=Math.floor(i/12),o=(i%12+12)%12+1,u=i+n-1,l=Math.floor(u/12),a=(u%12+12)%12+1;return{start:me(s,o,1),end:me(l,a,lt(l,a))}}var fn={en:{months:{january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12,jan:1,feb:2,mar:3,apr:4,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},weekdays:{monday:0,tuesday:1,wednesday:2,thursday:3,friday:4,saturday:5,sunday:6,mon:0,tue:1,wed:2,thu:3,fri:4,sat:5,sun:6},quarters:{"1st quarter":1,"2nd quarter":2,"3rd quarter":3,"4th quarter":4,q1:1,q2:2,q3:3,q4:4},keywords:{today:["today"],yesterday:["yesterday"],tomorrow:["tomorrow"],this_week:["this week","week"],last_week:["last week"],next_week:["next week"],this_month:["this month","month"],last_month:["last month"],next_month:["next month"],last:["last"],next:["next"],articles:["the"],from:["from","between"],to:["to","and"],no_period:["no period","always"]},date_order:{default:"MDY",GB:"DMY",AU:"DMY",IE:"DMY",NZ:"DMY",IN:"DMY"}},it:{months:{gennaio:1,febbraio:2,marzo:3,aprile:4,maggio:5,giugno:6,luglio:7,agosto:8,settembre:9,ottobre:10,novembre:11,dicembre:12,gen:1,feb:2,mar:3,apr:4,mag:5,giu:6,lug:7,ago:8,set:9,ott:10,nov:11,dic:12},weekdays:{luned\u00EC:0,marted\u00EC:1,mercoled\u00EC:2,gioved\u00EC:3,venerd\u00EC:4,sabato:5,domenica:6,lun:0,mar:1,mer:2,gio:3,ven:4,sab:5,dom:6},quarters:{"1\xBA trimestre":1,"2\xBA trimestre":2,"3\xBA trimestre":3,"4\xBA trimestre":4,"1\xB0 trimestre":1,"2\xB0 trimestre":2,"3\xB0 trimestre":3,"4\xB0 trimestre":4,t1:1,t2:2,t3:3,t4:4,q1:1,q2:2,q3:3,q4:4},keywords:{today:["oggi"],yesterday:["ieri"],tomorrow:["domani"],this_week:["questa settimana","settimana"],last_week:["settimana scorsa"],next_week:["settimana prossima"],this_month:["questo mese","mese"],last_month:["mese scorso"],next_month:["mese prossimo"],last:["scorso","scorsa"],next:["prossimo","prossima"],articles:["il","lo","la"],from:["da","dal","dalla","tra","fra"],to:["a","al","alla","e"],no_period:["-","senza periodo","sempre"]},date_order:{default:"DMY"}}};function Fo(t){if(typeof t!="string")throw new RangeError("A supported locale is required.");let e=t.replaceAll("-","_"),r=e.indexOf("_"),n=(r<0?e:e.slice(0,r)).toLowerCase(),i=(r<0?"":e.slice(r+1)).toUpperCase();if(!Object.hasOwn(fn,n))throw new RangeError(`Unsupported locale: ${t}`);let s=fn[n];return{dictionary:s,phrases:u=>[...new Set([...s.keywords[u],...fn.en.keywords[u]])],order:s.date_order[i]??s.date_order.default}}var ft=/^(?:\d{4}|\d{2})$/,ko=/^\d{1,2}$/,Er=(t,e)=>({ok:!1,error:{code:t,message:e}}),dt=(t="UNRECOGNIZED_EXPRESSION",e="Text is not a supported date expression.")=>{throw Object.assign(new SyntaxError(e),{code:t})},Po=(t,e)=>Object.hasOwn(t,e);function ht(t,e){if(t.length===4)return Number(t);let r=e.year+e.twoDigitYearAhead-100;return r+((Number(t)-r)%100+100)%100}function of(t,e){if(t.includes(";")){let i=t.split(";").map(s=>s.trim());return i.length!==2?dt("INVALID_RANGE","A range must have exactly two endpoints."):{bounds:i,range:!0}}if(e.phrases("no_period").includes(t))return{bounds:["",""],range:!0};let r=e.phrases("to"),n=e.phrases("from");for(let i of r)if(t.startsWith(`${i} `))return{bounds:["",t.slice(i.length+1).trim()],range:!0};for(let i of r){let s=` ${i} `;if(!t.includes(s))continue;for(let u of n)if(t.startsWith(`${u} `)){t=t.slice(u.length+1);break}let o=t.split(s).map(u=>u.trim());return o.length!==2?dt("INVALID_RANGE","A range must have exactly two endpoints."):{bounds:o,range:!0}}for(let i of n)if(t.startsWith(`${i} `))return{bounds:[t.slice(i.length+1).trim(),""],range:!0};return{bounds:[t,t],range:!1}}function uf(t,e,r){let n=[[t,0]],i=/^(.+?)\s*([+-])\s*(\d+)$/.exec(t);i&&n.push([i[1],Number(i[2]+i[3])]);let s={today:0,yesterday:-1,tomorrow:1,this_week:0,last_week:-1,next_week:1,this_month:0,last_month:-1,next_month:1};for(let[o,u]of n)for(let[l,a]of Object.entries(s))if(e.phrases(l).includes(o)){if(l.endsWith("_week"))return gr(Ai(e.workdate),(a+u)*7+(r?6:0));if(l.endsWith("_month")){let c=Ro(e.year,e.month,a+u);return r?c.end:c.start}return gr(e.workdate,a+u)}return null}function af(t,e,r){let n=Object.entries(e.dictionary.quarters).sort((i,s)=>s[0].length-i[0].length);for(let[i,s]of n){let o;if(t===i)o=null;else if(t.startsWith(i)&&ft.test(t.slice(i.length).trim()))o=ht(t.slice(i.length).trim(),e);else if(t.endsWith(i)&&ft.test(t.slice(0,-i.length).trim()))o=ht(t.slice(0,-i.length).trim(),e);else continue;return{year:o,month:r?s*3:s*3-2}}return null}function Lo(t,e){if(Po(e.months,t))return e.months[t];let r=/^m(\d{1,2})$/.exec(t);return r&&Number(r[1])>=1&&Number(r[1])<=12?Number(r[1]):null}function lf(t,e){let r=t.split(/\s+/),n=r.map((a,c)=>Lo(a,e.dictionary)?c:-1).filter(a=>a>=0);if(!n.length)return null;if(n.length!==1)return dt();let i=n[0],s=Lo(r[i],e.dictionary),o=r.slice(0,i),u=r.slice(i+1),l=[...o,...u];if(l.length===1&&e.phrases("last").includes(l[0]))return{year:e.year-(s>e.month?1:0),month:s};if(l.length===1&&e.phrases("next").includes(l[0]))return{year:e.year+(s<e.month?1:0),month:s};if(!l.length)return{year:null,month:s};if(!o.length&&u.length===1&&ft.test(u[0]))return{year:ht(u[0],e),month:s};if(o.length===1&&ko.test(o[0])){if(!u.length)return me(e.year,s,Number(o[0]));if(u.length===1&&ft.test(u[0]))return me(ht(u[0],e),s,Number(o[0]))}return!o.length&&u.length===2&&ko.test(u[0])&&ft.test(u[1])?me(ht(u[1],e),s,Number(u[0])):dt()}function cf(t,e){let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(r)return me(...r.slice(1).map(Number));let n=/^(\d{1,4})[/\-. ]+(\d{1,4})[/\-. ]+(\d{1,4})$/.exec(t),i={};if(n)e.order.split("").forEach((u,l)=>{i[u]=n[l+1]});else if(/^(?:\d{6}|\d{8})$/.test(t)){let u=t.length===8?4:2;for(let l of e.order){let a=l==="Y"?u:2;i[l]=t.slice(0,a),t=t.slice(a)}}else return null;if(!ft.test(i.Y)||i.D.length>2||i.M.length>2)return dt();let s=Number(i.D),o=Number(i.M);return n&&o>12&&s<=12&&([s,o]=[o,s]),me(ht(i.Y,e),o,s)}function Uo(t,e,r){if(!t)return null;let n=e.phrases("articles");if(t=t.split(/\s+/).filter(s=>!n.includes(s)).join(" "),!t)return dt();if(ft.test(t))return me(ht(t,e),r?12:1,r?31:1);let i=uf(t,e,r)??af(t,e,r)??lf(t,e);return i!==null?i:Po(e.dictionary.weekdays,t)?gr(Ai(e.workdate),e.dictionary.weekdays[t]):cf(t,e)??dt()}function ff(t,e,r){if(t===null||typeof t=="string")return t;let n=t.year??r.year,i=typeof e=="string"?ct(e)[0]:e?.year,s=typeof e=="string"?ct(e)[1]:e?.month;return i&&(n>i&&(n=i),n===i&&t.month>s&&n--),me(n,t.month,1)}function hf(t,e,r){if(t===null||typeof t=="string")return t;let n=t.year??r.year;if(e!==null){let[i,s]=ct(e);n<i&&(n=i),n===i&&s>t.month&&n++}return me(n,t.month,lt(n,t.month))}function Ti(t,e={}){if(!e||typeof e!="object"||Array.isArray(e))return Er("INVALID_CONTEXT","Options must provide a civil workdate and supported locale.");let r;try{let{locale:n="it-IT",workdate:i,twoDigitYearAhead:s=20}=e,[o,u]=ct(i);if(!Number.isInteger(s)||s<0||s>99)throw new RangeError("twoDigitYearAhead must be an integer from 0 to 99.");r={...Fo(n),workdate:i,year:o,month:u,twoDigitYearAhead:s}}catch(n){return Er("INVALID_CONTEXT",n.message)}if(typeof t!="string")return Er("INVALID_INPUT","Expression must be a string.");try{let n=t.toLowerCase().trim().replaceAll(",",""),{bounds:i,range:s}=of(n,r),o=Uo(i[1],r,!0),u=Uo(i[0],r,!1),l=ff(u,o,r),a=hf(o,l,r);return!s&&typeof u=="string"&&l===a?{ok:!0,kind:"date",date:l}:{ok:!0,kind:"period",start:l,end:a}}catch(n){if(n instanceof RangeError)return Er("INVALID_DATE",n.message);if(n instanceof SyntaxError)return Er(n.code,n.message);throw n}}var Pt=new Map;function hn(t,e,r){let n=JSON.stringify([t,e,r]),i=Pt.get(n);if(i)Pt.delete(n);else{let s=t?Intl.DateTimeFormat:Intl.NumberFormat;if(!s.supportedLocalesOf([e]).length)throw new RangeError(`Unsupported format locale: ${e}`);i=new s(e,r),Pt.size===64&&Pt.delete(Pt.keys().next().value)}return Pt.set(n,i),i}function $o(t){if(t!=null&&(typeof t!="string"||/[{}]/.test(t.replaceAll("{}",""))))throw new RangeError("This formatter mask supports only {} placeholders")}function qo(t,e){return $o(e),e==null?t:e.replaceAll("{}",()=>t)}function df(t){if(t instanceof Date)return Ze(t);if(ee(t))return"N";if(typeof t=="number")return Number.isInteger(t)?"L":"R";throw new TypeError("Formatting requires finite JavaScript numbers, TYTX Decimal values or valid Date objects")}function pf(t,e,{pattern:r="short",locale:n,timeZone:i}){if(!["short","medium","long","full"].includes(r))throw new RangeError("Temporal formatting currently supports short, medium, long and full only");if(e==="DHZ"&&(typeof i!="string"||!i))throw new TypeError("DHZ formatting currently requires an explicit timeZone");let s={timeZone:e==="DHZ"?i:"UTC"};return e!=="H"&&(s.dateStyle=r),e!=="D"&&(s.timeStyle=r),hn(!0,n,s).format(t)}function dn(t){let e=/^(-|\()?(#,##0|0+)(?:\.(0*#*))?(\))?$/.exec(t);if(!e||e[1]==="("!=(e[4]===")")||t.endsWith("."))throw new RangeError(`Unsupported numeric pattern section: ${t}`);let r=e[3]??"";return{prefix:e[1]??"",suffix:e[4]??"",intl:{useGrouping:e[2].startsWith("#,##")?"always":!1,minimumIntegerDigits:e[2].replace("#,##","").length,minimumFractionDigits:r.replaceAll("#","").length,maximumFractionDigits:r.length}}}function mf(t){let e=t.split(";");if(e.length>3)throw new RangeError("Numeric patterns support at most three sections");let r=dn(e[0]);if(r.prefix||r.suffix)throw new RangeError("Positive-section affixes are not implemented");let n=e.length===3?e[1]:null;n!==null&&n!==""&&n!=="-"&&dn(n);let i=e.length>1?dn(e.at(-1)):null;return{positive:r,zero:n,negative:i}}function Vo(t,e={},r={}){if(t===null)return"";if(typeof e=="string"&&(e={pattern:e}),!e||typeof e!="object"||Array.isArray(e))throw new TypeError("Format options must be a pattern string or an options object");for(let g of Object.keys(e))if(!["pattern","locale","mask","dtype","timeZone"].includes(g))throw new RangeError(`Unsupported format option: ${g}`);e={...e,locale:e.locale??r.locale,timeZone:e.timeZone??r.timeZone};let n=e.dtype===void 0?df(t):e.dtype,i=["D","H","DHZ"].includes(n);if(!i&&!["L","R","N"].includes(n))throw new RangeError(`Unsupported format dtype: ${n}`);if(i){if(!(t instanceof Date)||!Number.isFinite(t.getTime()))throw new TypeError(`${n} requires a valid Date object`)}else if(!(typeof t=="number"&&Number.isFinite(t))&&!(ee(t)&&!["NaN","Infinity","-Infinity"].includes(t.toString())))throw new TypeError(`${n} formatting requires finite JavaScript numbers or TYTX Decimal values`);if(n==="L"&&!Number.isInteger(t))throw new TypeError("L formatting requires an integer");let{pattern:s,locale:o,mask:u}=e;if(!i&&typeof s!="string")throw new TypeError("Numeric formatting currently requires an explicit pattern");if(typeof o!="string"||!o)throw new TypeError("Formatting currently requires an explicit locale");if($o(u),i){let g=pf(t,n,e);return qo(g,u)}let{positive:l,zero:a,negative:c}=mf(s),f=hn(!1,o,l.intl),h=ee(t),d=h?t.eq(0):t===0,m=h?t.lt(0):t<0;if(h&&hn(!1,"en",{useGrouping:!1}).format("9007199254740993")!=="9007199254740993")throw new Error("This browser cannot format Decimal without precision loss");let p;if(d&&a!==null){if(a==="")return"";if(a==="-")p="-";else{let g=dn(a);p=g.prefix+hn(!1,o,g.intl).format(0)+g.suffix}}else{let g=m&&c?c:l,w=h?(m&&c?t.abs():t).toString():m&&c?-t:t===0?0:t;p=g.prefix+f.format(w)+g.suffix}return qo(p,u)}function jo(t){if(t===null)return null;let{value:e,columns:r,dtype:n,locale:i}=t;if(typeof e!="string"||!Array.isArray(r)||!r.length||r.some(a=>typeof a!="string"||!a||a==="rowidx")||!["T","L","R","N","D"].includes(n))throw new TypeError("Invalid collection filter");if(!e.trim())return null;if(n==="T"){let a=t.literal===!0?e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):e,c=new RegExp(a,"i");return f=>c.test(r.map(h=>gf(f(h),i,t.timeZone)).join(" "))}if(r.length!==1)throw new TypeError("Typed filters require one column");let s=/^\s*(<=|>=|==|!=|[<>=!#])\s*(.+?)\s*$/.exec(e);if(!s)throw new Error("Enter a comparison, for example > 100 or = 12.");let[,o,u]=s,l;if(n==="D"){let a=new Date,c=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`,f=Ti(u,{locale:i,workdate:c});if(!f.ok||f.kind!=="date")throw new Error("Enter one complete date after the comparison.");l=new Date(`${f.date}T00:00:00Z`)}else l=Ef(u,i);return a=>{let c=a(r[0]);if(c==null)return!1;if(n==="D"?!(c instanceof Date)||!Number.isFinite(c.getTime()):!(typeof c=="number"&&Number.isFinite(c)||ee(c)&&c.isFinite()))throw new TypeError(`Filter value does not match ${n}`);let f=ee(l)?-l.comparedTo(c):c<l?-1:c>l?1:0;switch(o){case"=":case"==":return f===0;case"!":case"#":case"!=":return f!==0;case"<":return f<0;case">":return f>0;case"<=":return f<=0;case">=":return f>=0}}}function gf(t,e,r){return t==null?"":typeof t=="string"||typeof t=="boolean"?String(t):Vo(t,{pattern:t instanceof Date?"short":"#,##0.####################"},{locale:e,timeZone:r})}function Ef(t,e){let r=new Intl.NumberFormat(e).formatToParts(-12345.6),n=r.find(l=>l.type==="decimal").value,i=r.find(l=>l.type==="group")?.value,s=r.find(l=>l.type==="minusSign").value,o=t.replaceAll(s,"-");if(i&&o.includes(i)){let a=o.split(n)[0].replace(/^[+-]/,"").split(i),c=new Intl.NumberFormat(e).formatToParts(1234567890123).filter(d=>d.type==="integer").map(d=>d.value.length),f=c.at(-1),h=c.at(-2);if(o.split(n).slice(1).some(d=>d.includes(i))||!/^\d+$/.test(a[0])||a[0].length>h||a.slice(1).some((d,m)=>!/^\d+$/.test(d)||d.length!==(m===a.length-2?f:h)))throw new Error("Invalid numeric grouping.");o=o.replaceAll(i,"")}if(o=o.replace(n,"."),!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(o))throw new Error("Enter a complete number.");let u=kt(o);if(!ee(u)||!u.isFinite())throw new Error("A finite Decimal backend is required.");return u}function zo(t,e){return(","+t+",").includes(","+e+",")}function Ho(t){if(typeof t!="string")throw new TypeError("grid checked must refer to a string (empty string for an empty set)");return t}function Xo(t){if(typeof t!="string"||!t||t.includes(","))throw new TypeError("grid checkedField requires nonempty text IDs without commas");return t}var Yo={network:{maxAttempts:3,delay:1,backoff:2,jitter:!0,on:["TypeError","NetworkError","AbortError"]},aggressive:{maxAttempts:5,delay:.5,backoff:2,jitter:!0,on:["Error"]},gentle:{maxAttempts:2,delay:2,backoff:1.5,jitter:!1,on:["TypeError","NetworkError"]}};function wf(t){let e=t._retryPolicy;return e==null?null:typeof e=="string"?Yo[e]||null:e}function yf(t,e){return e.some(r=>r==="Error"?!0:t.name===r||t.constructor.name===r)}function Df(t){return new Promise(e=>setTimeout(e,t))}async function Af(t,e){if(!e)return t();let r=e.maxAttempts||3,n=e.delay||1,i=e.backoff||2,s=e.jitter!==!1,o=e.on||["Error"],u=null,l=n*1e3;for(let a=0;a<r;a++)try{let c=t();return c instanceof Promise?await c:c}catch(c){if(u=c,a<r-1&&yf(c,o)){let f=l;s&&(f*=1+Math.random()*.1),await Df(f),l*=i}else throw c}throw u}var ie=class t{static classKwargs={cacheTime:0,readOnly:!1,asBag:null,retryPolicy:null};static classArgs=[];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy"]);constructor(e={}){let n={...this.constructor.classKwargs,...e};for(let s of["interval","reactive"])if(Object.hasOwn(n,s))throw new TypeError(`Removed resolver option: ${s}. Schedule updates in the application; use reset() and read explicitly.`);this.cacheTime=n.cacheTime,this._readOnly=n.readOnly,this._asBag=n.asBag,this._retryPolicy=n.retryPolicy,this._kw={};let i=this.constructor.internalParams;for(let[s,o]of Object.entries(n))i.has(s)||(this._kw[s]=o);this._lastUpdate=null,this._node=null,this._lastEffectiveFingerprint=null,this._cachedValue=null,this.init()}init(){}setNode(e){e!==this._node&&!this.readOnly&&this._lastUpdate!==null&&this.reset(),this._node=e,this.onSetResolver(e)}onSetResolver(e){}get node(){return this._node}get cacheTime(){return this._cacheTime}set cacheTime(e){if(typeof e=="boolean")throw new TypeError("cacheTime must be numeric; use a negative value for infinite caching");this._cacheTime=e}get readOnly(){return this._readOnly}get expired(){return this._cacheTime<0?this._lastUpdate===null:this._cacheTime===0||this._lastUpdate===null?!0:(Date.now()-this._lastUpdate)/1e3>this._cacheTime}reset(...e){if(e.length)throw new TypeError("reset() takes no arguments. It invalidates the cache for the next explicit read.");this._lastUpdate=null,this._lastEffectiveFingerprint=null}get cachedValue(){return!this.readOnly&&this._node?this._node._value:this._cachedValue}set cachedValue(e){!this.readOnly&&this._node?this._node.setValue(e,!1):this._cachedValue=e}_computeEffectiveFingerprint(e){return JSON.stringify(Object.entries(e).sort())}_buildEffectiveKw(){let e={...this._kw};if(this._node&&this._node.attr)for(let r of Object.keys(this._kw))Object.hasOwn(this._node.attr,r)&&(e[r]=this._node.attr[r]);return e}resolve(e={}){let{static:r=!1,...n}=e;if(r)return this._node?this._node._value:this.cachedValue;let i=this._buildEffectiveKw();if(Object.keys(n).length>0)return this._load({...i,...n},o=>this._prepareValue(o));let s=this._computeEffectiveFingerprint(i);return s===this._lastEffectiveFingerprint&&!this.expired?this.cachedValue:(this._lastEffectiveFingerprint=s,this._load(i,o=>this._finalize(o)))}_load(e,r){let n=wf(this),i=()=>this.load(e);if(n)return Af(i,n).then(r);let s=i();return s&&typeof s.then=="function"?s.then(r):r(s)}_finalize(e){return e=this._prepareValue(e),this._lastUpdate=Date.now(),(!this.readOnly||this.cacheTime!==0)&&(this.cachedValue=e),e}_prepareValue(e){let r;return this._asBag===!0?r=!0:this._asBag===!1?r=!1:r=!this._readOnly,r&&e!==null&&e!==void 0&&(e=this._convertToBag(e)),e}_convertToBag(e){let r=t._BagClass;if(!r||e&&typeof e._htraverse=="function")return e;if(typeof e=="string"){if(e=e.trim(),e.startsWith("<")&&r.fromXml)return r.fromXml(e);if((e.startsWith("{")||e.startsWith("["))&&r.fromTytx)return r.fromTytx(e)}return e}static registerBagClass(e){t._BagClass=e}load(e){return null}};ie._BagClass=null;var wr=class extends ie{static classKwargs={cacheTime:0,readOnly:!1,asBag:!1,retryPolicy:null,callback:null};static classArgs=["callback"];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy","callback"]);constructor(e={}){typeof e=="function"&&(e={callback:e}),super(e),this._callback=e.callback||null}load(e){return this._callback?this._callback.call(this,e):null}};var pt=class t{constructor(e,r,n=null,i=null,s=null,o=null,u=null,l=!0){this.label=r,this._value=null,this._attr={},this._parentBag=null,this._resolver=null,this._nodeSubscribers={},this._onChangedValue=null,this.nodeTag=o,this.xmlTag=u,this._compiled=null,this.parentBag=e,i&&this.setAttr(i,!1,!0,l),n!==null&&this.setValue(n,!1),s&&(this.resolver=s)}get parentBag(){return this._parentBag}set parentBag(e){e===null&&this._value?.parentNode===this&&this._value.setBackref(),this._parentBag=e,e?.backref&&this._value&&typeof this._value._htraverse=="function"&&this._value.setBackref(this,e)}get value(){return this.getValue()}set value(e){this.setValue(e)}getValue(e=!1,r=null,n={}){if(r!==null){let i=Y(`${r}::QS`);if(Array.isArray(i)){let s=i.length?i:Object.keys(this._attr),o=s.map(l=>{let a=this.getAttr(l);return!e&&a instanceof ie?a.resolve():a}),u=l=>i.length===0?Object.fromEntries(s.map((a,c)=>[a,l[c]])):l.length===1?l[0]:l;return o.some(l=>l&&typeof l.then=="function")?Promise.all(o).then(u):u(o)}else{if(!this._resolver)throw new Error("Cannot use kwargs syntax without resolver");n={...n,...i}}}return this._resolver!==null?this._resolver.resolve({static:e,...n}):this._value}setValue(e,r=!0,n=null,i=null,s=!0,o=null,u=!1){e instanceof ie?(this.resolver=e,e=null):e instanceof t&&(n=n||{},Object.assign(n,e._attr),e.resolver&&(this.resolver=e.resolver),e=e._value);let l=this._value;l!==e&&l?.parentNode===this&&l.setBackref(),this._value=e;let a=l!==this._value,c=r??!0,f=null;if(n!==null){let d={...this._attr};this.setAttr(n,!1,i,s);let m=this._buildAttrDiff(d,this._attr);f=Object.keys(m).length>0?m:null}r=c&&(a||f!==null);let h=f?a?"upd_value_attr":"upd_attrs":"upd_value";if(this._onChangedValue&&this._onChangedValue(this,e,l,c),r){let d=f!==null?{oldvalue:l,attrs_diff:f}:{oldvalue:l};for(let m of Object.values(this._nodeSubscribers))m({node:this,info:d,evt:h})}this._parentBag!==null&&this._parentBag.backref&&(e&&typeof e._htraverse=="function"&&e.setBackref(this,this._parentBag),r&&this._parentBag._onNodeChanged(this,[this.label],h,l,f,o,u))}replace(e){if(!(e instanceof t))throw new TypeError("BagNode.replace expects a BagNode");if(e===this)return this;let r=e.staticValue;r&&typeof r._htraverse=="function"&&(r=r.createChildBag().replace(r));let n=null;e.resolver&&(n=Object.create(Object.getPrototypeOf(e.resolver),Object.getOwnPropertyDescriptors(e.resolver)),n._node=null,n._kw={...e.resolver._kw});let i=this._value,s={...this._attr},o=this.resolver;o&&o._node===this&&(o._node=null),this.resolver=n,this.setValue(r,!1,{...e.attr},!1,!1,null);let u=this._buildAttrDiff(s,this._attr),l=Object.keys(u).length?u:null,a=i!==r||o!==n;if(a||l){let c=l?a?"upd_value_attr":"upd_attrs":"upd_value",f=l?{oldvalue:i,attrs_diff:l}:{oldvalue:i};for(let h of Object.values(this._nodeSubscribers))h({node:this,info:f,evt:c});this._parentBag!==null&&this._parentBag.backref&&this._parentBag._onNodeChanged(this,[this.label],c,i,l)}return this}get staticValue(){return this._value}set staticValue(e){this._value=e}get resolver(){return this._resolver}set resolver(e){this._resolver=e,e&&e.setNode&&e.setNode(this)}resetResolver(){if(!this._resolver)throw new Error("Cannot reset resolver: node has no resolver");this._resolver.reset(),this.setValue(null)}get attr(){return this._attr}getAttr(e=null,r=null){return e?e in this._attr?this._attr[e]:r:this._attr}_buildAttrDiff(e,r){let n={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(let s of i){let o=s in e?e[s]:null,u=s in r?r[s]:null;o!==u&&(n[s]={old:o,new:u})}return n}setAttr(e=null,r=!0,n=!0,i=!0){let s=e||{},o=Object.keys(this._nodeSubscribers).length>0,l=r&&(o||this._parentBag!==null&&this._parentBag.backref)?{...this._attr}:null;if(n?Object.assign(this._attr,s):this._attr={...s},i)for(let a of Object.keys(this._attr))this._attr[a]===null&&delete this._attr[a];if(r&&l!==null){let a=this._buildAttrDiff(l,this._attr);if(Object.keys(a).length>0&&o)for(let c of Object.values(this._nodeSubscribers))c({node:this,info:{attrs_diff:a},evt:"upd_attrs"});if(Object.keys(a).length>0&&this._parentBag!==null&&this._parentBag.backref){let c=r===!0?"true":String(r);this._parentBag._onNodeChanged(this,[this.label],"upd_attrs",null,a,c)}}}delAttr(...e){for(let r of e)if(typeof r=="string"&&r.includes(","))for(let n of r.split(","))delete this._attr[n.trim()];else delete this._attr[r]}hasAttr(e,r=null){return e in this._attr?r!==null?this._attr[e]===r:!0:!1}getInheritedAttributes(){let e={};return this._parentBag&&this._parentBag.parentNode&&(e=this._parentBag.parentNode.getInheritedAttributes()),{...e,...this._attr}}subscribe(e,r){this._nodeSubscribers[e]=r}unsubscribe(e){delete this._nodeSubscribers[e]}get compiled(){return this._compiled||(this._compiled={}),this._compiled}get isBranch(){return this._value!=null&&typeof this._value._htraverse=="function"}get position(){return this._parentBag===null?null:this._parentBag._nodes.index(this.label)}get fullpath(){if(this._parentBag!==null){let e=this._parentBag.fullpath;return e?`${e}.${this.label}`:this.label}return null}get parentNode(){return this._parentBag?this._parentBag.parentNode:null}attributeOwnerNode(e,r=null){let n=this;if(r===null)for(;n&&!(e in n._attr);)n=n.parentNode;else for(;n&&n._attr[e]!==r;)n=n.parentNode;return n}asTuple(){return[this.label,this.value,this._attr,this._resolver||null]}isEqual(e){if(!(e instanceof t)||this.label!==e.label)return!1;let r=Object.keys(this._attr),n=Object.keys(e._attr);if(r.length!==n.length)return!1;for(let i of r)if(this._attr[i]!==e._attr[i])return!1;return this._resolver!==null?this._resolver===e._resolver:this._value&&typeof this._value.equalTo=="function"?this._value.equalTo(e._value):this._value&&typeof this._value.isEqual=="function"?this._value.isEqual(e._value):this._value===e._value}diff(e){if(this.label!==e.label)return`Other label: ${e.label}`;let r=Object.keys(this._attr),n=Object.keys(e._attr);return r.length!==n.length||r.some(i=>this._attr[i]!==e._attr[i])?`attributes self:${JSON.stringify(this._attr)} --- other:${JSON.stringify(e._attr)}`:this._value!==e._value?`value self:${this._value} --- other:${e._value}`:null}toJson(e=!0){let r=this.value;return r&&typeof r.toJson=="function"&&(r=r.toJson(e,!0)),{label:this.label,value:r,attr:this._attr}}toString(){return`BagNode : ${this.label}`}};var yr=class t{constructor(){this._dict=Object.create(null),this._list=[],this._parentBag=null}index(e){if(e in this._dict)return this._list.findIndex(n=>n.label===e);let r=e.match(/^#(\d+)$/);if(r){let n=parseInt(r[1],10);return n<this._list.length?n:-1}if(r=e.match(/^#(\w*)=(.*)$/),r){let[,n,i]=r,s=i.includes("::")?Y(i):i;return n?this._list.findIndex(o=>o.getAttr(n)===s):this._list.findIndex(o=>o._value===s)}return-1}_parsePosition(e){let r=this._list.length;if(e==null||e===">")return r;if(typeof e=="number")return e<0&&(e=r+e),Math.max(0,Math.min(e,r));if(e==="<")return 0;if(e.startsWith("#")){let n=this._parseSharpIndex(e.slice(1),e);return Math.min(n,r)}if(e.startsWith("<")){let n=e.slice(1);if(n.startsWith("#")){let s=this._parseSharpIndex(n.slice(1),e);return Math.min(s,r)}let i=this.index(n);if(i<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return i}if(e.startsWith(">")){let n=e.slice(1);if(n.startsWith("#")){let s=this._parseSharpIndex(n.slice(1),e);return Math.min(s+1,r)}let i=this.index(n);if(i<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return i+1}throw new Error(`Invalid node_position '${e}': unrecognized syntax`)}_parseSharpIndex(e,r){if(!/^-?\d+$/.test(e))throw new Error(`Invalid node_position '${r}': '${e}' is not an integer`);let n=parseInt(e,10);if(n<0)throw new Error(`Invalid node_position '${r}': negative index not allowed in '#n' syntax`);return n}get(e){if(typeof e=="number")return e>=0&&e<this._list.length?this._list[e]:null;if(e.startsWith("#")){let r=this.index(e);return r>=0?this._list[r]:null}return this._dict[e]||null}set(e,r,n=">",i=null,s=null,o=null,u=!1,l=!0,a=null,c=!0,f=!1,h=null){let d=null;if(e.includes("?")&&([e,d]=e.split("?",2)),e==null||e.startsWith("#"))throw new Error("Cannot create new node with #n syntax");if(d){let p=d.split("&");if(p.length===1)i={[p[0]]:r};else{if(!Array.isArray(r)||r.length!==p.length)throw new Error("Wrong attributes assignment");i={};for(let g=0;g<p.length;g++)i[p[g]]=r[g]}r=null}let m=this._dict[e];if(m)h&&(m.nodeTag=h),o!==null&&(o===!1?m.resolver=null:m.resolver=o),d?m.setAttr(i,c,!0,l):m.setValue(r,c,i,u,l,a,f);else{let p=s&&s.nodeClass?s.nodeClass:pt;m=new p(s,e,d?null:r,i,o,h,null,l);let g=this._parsePosition(n);this._dict[e]=m,this._list.splice(g,0,m),c&&s&&s.backref&&s._onNodeInserted(m,g,null,a,f)}return f&&m.setValue(null,!1),m}pop(e){let r=this.get(e);if(r){delete this._dict[r.label];let n=this._list.indexOf(r);return n>=0&&this._list.splice(n,1),r}return null}has(e){return e in this._dict}get length(){return this._list.length}clear(){this._dict=Object.create(null),this._list=[]}keys(){return this._list.map(e=>e.label)}values(){return this._list.map(e=>e.getValue())}items(){return this._list.map(e=>[e.label,e.getValue()])}[Symbol.iterator](){return this._list[Symbol.iterator]()}move(e,r,n=!0){if(r<0)return;let i=Array.isArray(e)?e:[e];if(i.length===0||r>=this._list.length)return;let s=this._list[r].label;if(i.length>1){let o=[...i].sort((c,f)=>c-f),u=o[0]<r?1:0,l=[];for(let c=o.length-1;c>=0;c--){let f=o[c];if(f>=0&&f<this._list.length){let h=this._list[f];this._list.splice(f,1),l.push(h),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(h,f)}}let a=this.index(s);a<0&&(a=this._list.length),a+=u;for(let c of l)this._list.splice(a,0,c),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(c,a)}else{let o=i[0];if(o===r||o<0||o>=this._list.length)return;let u=this._list[o];this._list.splice(o,1),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(u,o),this._list.splice(r,0,u),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(u,r)}}isEqual(e){if(!(e instanceof t)||this._list.length!==e._list.length)return!1;for(let r=0;r<this._list.length;r++){let n=this._list[r],i=e._list[r];if(!n.isEqual(i))return!1}return!0}};var Zo=Bi(ai(),1);var bi="::RSLV:",Tf=new Map,bf=new Map,pn=new WeakMap,z=class extends Error{constructor(e){super(e),this.name="BagSerializationError"}},Dr=class extends ie{constructor(e){super({asBag:!1}),pn.set(this,e)}get payload(){return pn.get(this)}load(){throw new z("This resolver is opaque; local execution is unavailable")}};function Wo(t){if(!t||typeof t!="object"||Array.isArray(t)||typeof t.resolver_module!="string"||typeof t.resolver_class!="string"||!Array.isArray(t.args??[])||!t.kwargs||typeof t.kwargs!="object"||Array.isArray(t.kwargs))throw new z("Invalid resolver description")}function Go(t,e=new Set){if(!(t===null||typeof t=="string"||typeof t=="boolean")&&!(typeof t=="number"&&Number.isFinite(t))){if(typeof t!="object"||e.has(t)||!Array.isArray(t)&&Object.getPrototypeOf(t)!==Object.prototype&&Object.getPrototypeOf(t)!==null)throw new z("Resolver parameters must be JSON data; callbacks cannot travel");e.add(t);for(let r of Object.values(t))Go(r,e);e.delete(t)}}function Ar(t){if(pn.has(t))return pn.get(t);let e=bf.get(t.constructor);if(!e)throw new z(`Unregistered resolver: ${t.constructor.name}`);let r=e.encode(t),n={resolver_module:e.module,resolver_class:e.name,args:r.args??[],kwargs:r.kwargs??{}};return Wo(n),Go(n),bi+JSON.stringify(n)}function mn(t){if(typeof t!="string"||!t.startsWith(bi))return null;let e=t.slice(bi.length);if(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+$/.test(e))return new Dr(t);let r;try{r=JSON.parse(e)}catch{throw new z("Invalid resolver JSON or signed token")}Wo(r);let n=Tf.get(JSON.stringify([r.resolver_module,r.resolver_class]));if(!n)return new Dr(t);let i=n.decode({args:r.args??[],kwargs:r.kwargs});if(!(i instanceof n.cls))throw new z("Resolver decoder returned an incompatible instance");return i}function gn(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,r instanceof ie?Ar(r):r]))}function vi(t){return Object.fromEntries(Object.entries(t||{}).map(([e,r])=>[e,mn(r)??r]))}var ve="__cls";function qt(t,e){return t!==null&&t.tytxSuffix===e?t:Ei(e)}function vf(t){let e=t.tytxSuffix,r=Object.entries(Ut(e)).filter(([,n])=>n===t).map(([n])=>n);if(r.length===0)throw new z(`${t.name} is not in the TYTX subtype dictionary of '${e}'`);if(r.length>1)throw new z(`${t.name} is in the TYTX subtype dictionary of '${e}' under several names: ${r.sort().join(", ")}`);return r[0]}function _i(t,e){let r=Ut(t);if(!Object.hasOwn(r,e))throw new z(`Unknown Bag class '${e}' for TYTX type '${t}'`);return r[e]}function Ni(t,e){return t===e?null:vf(t)}function*Qo(t,e=[]){for(let r of t){let n=[...e,r.label];yield[n,r];let i=r.getValue(!0);!r.resolver&&i instanceof _e&&(yield*Qo(i,n))}}function _f(t){let e=t.toISOString(),r=t.getUTCFullYear()===1970&&t.getUTCMonth()===0&&t.getUTCDate()===1,n=t.getUTCHours()===0&&t.getUTCMinutes()===0&&t.getUTCSeconds()===0&&t.getUTCMilliseconds()===0;if(n&&!r)return e.slice(0,e.indexOf("T"));let i=e.replace(/\.000Z$/,"Z");return r&&!n?i.slice(i.indexOf("T")+1):i}function $t(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function Ke(t){return typeof t=="string"?t.includes("::")?`${t}::T`:t:Array.isArray(t)?t.map(Ke):$t(t)?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,Ke(r)])):t}function xi(t){if(!$t(t))throw new TypeError("Bag options must be an object");let{recursive:e=!0}=t;if(typeof e!="boolean")throw new TypeError("recursive must be a boolean");return e}var Jo=!1,_e=class t{static tytxSuffix="X";constructor(e=null,r={}){this._nodes=new yr,this._backref=!1,this._parent=null,this._parentNode=null,this._rootAttributes=null,this._updSubscribers={},this._insSubscribers={},this._delSubscribers={},xi(r),e!=null&&this.fillFrom(e,r)}get parent(){return this._parent}set parent(e){this._parent=e}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e}get backref(){return!!this._backref}get nodeClass(){return pt}createChildBag(){return new this.constructor}get fullpath(){if(this._parent!==null&&this._parentNode!==null){let e=this._parent.fullpath;return e?`${e}.${this._parentNode.label}`:this._parentNode.label}return null}relativePath(e){let r=[],n=e;for(;n!==null;){if(n.parentBag===this)return r.push(n.label),r.reverse(),r.join(".");r.push(n.label),n=n.parentNode}return null}get length(){return this._nodes.length}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}get attributes(){return this._parentNode!==null?this._parentNode.getAttr():{}}get rootAttributes(){return this._rootAttributes}set rootAttributes(e){this._rootAttributes=e!==null?{...e}:null}_htraverseBefore(e){let r=this,n;for(typeof e=="string"?(e=e.replace(/\.\.\//g,"#parent."),n=e.split(".").filter(i=>i)):n=[...e];n.length&&n[0]==="#parent"&&r!==null;)n.shift(),r=r.parent;return[r,n]}_htraverse(e,r=!1,n=!0){let[i,s]=this._htraverseBefore(e);if(i===null)return[null,null];if(s.length===0)return[i,""];for(;s.length>1&&i instanceof t;){let o=s[0];if(o==="#parent"){if(i.parent===null||i.parent===void 0)break;s.shift(),i=i.parent;continue}let u=i._nodes.get(o);if(!u)break;let l=u.getValue(n);if(l instanceof t)s.shift(),i=l;else if(r){let a=i.createChildBag();u.setValue(a,!0,null,!0,!0,"autocreate"),s.shift(),i=a}else break}if(!r)return s.length>1?[null,null]:[i,s[0]];for(;s.length>1;){let o=s.shift();if(o.startsWith("#"))throw new Tr("Not existing index in #n syntax");let u=i.createChildBag();i._nodes.set(o,u,">",null,i,null,!1,!0,"autocreate"),i=u}return[i,s[0]]}get(e,r=null,n=!0,i={}){if(!e)return this;if(e==="#parent")return this.parent;let s=null;e.includes("?")&&([e,s]=e.split("?",2));let o=this._nodes.get(e);return o?o.getValue(n,s,i):r}getItem(e,r=null,n=!1,i={}){if(!e)return this;let[s,o]=this._htraverse(e,!1,n);return s instanceof t?s.get(o,r,n,i):r}setItem(e,r,n=null,i=">",s=!1,o=!0,u=null,l=!1,a=!0,c=null,f=null){if(e==="")throw new RangeError("setItem requires a non-empty path");let[h,d]=this._htraverse(e,!0);return h._nodes.set(d,r,i,n,h,c,s,o,u,a,l,f)}_pop(e,r=null){let n=this._nodes.index(e);if(n>=0){let i=this._nodes.pop(n);return this.backref&&this._onNodeDeleted(i,n,null,r),i}return null}pop(e,r=null,n=null){let i=this.popNode(e,n);return i?i.value:r}delItem(e,r=null,n=null){return this.pop(e,r,n)}popNode(e,r=null){let[n,i]=this._htraverse(e,!1,!0);if(!n||!i)return null;let s=n._nodes.get(i);if(!s)return null;try{return n._pop(i,r)}finally{s.parentBag===n&&n._nodes._dict[s.label]!==s&&(s.parentBag=null)}}clear(){let e=[...this._nodes];this._nodes.clear(),this.backref&&this._onNodeDeleted(e,-1);for(let r of e)r.parentBag=null}getNode(e,r=!0,n=!1,i=null){if(e==null||e==="")return this.parentNode;if(typeof e=="number")return this._nodes.get(e);typeof e=="string"&&(e=e.split("?",1)[0]);let[s,o]=this._htraverse(e,n,r);if(s instanceof t&&o){let u=s._nodes.get(o);if(u)return u;if(n)return s._nodes.set(o,i,">",null,s,null,!1,!0,"autocreate"),s._nodes.get(o)}return null}setBackref(e=null,r=null){let n=this._backref;if(this._backref=!0,this._parent=r,this._parentNode=e,!n){this._nodes._parentBag=this;for(let i of this)i.parentBag=this}}delParentRef(){this._parent=null,this._parentNode=null,this._backref=!1}clearBackref(){if(this._backref){this._backref=!1,this._parent=null,this._parentNode=null,this._nodes._parentBag=null;for(let e of this){e.parentBag=null;let r=e.getValue(!0);r instanceof t&&r.clearBackref()}}}_onNodeChanged(e,r,n,i=null,s=null,o=null,u=!1){for(let l of Object.values(this._updSubscribers))l({node:e,pathlist:r,oldvalue:i,attrs_diff:s,evt:n,reason:o,fired:u});this._parent&&this._parentNode&&this._parent._onNodeChanged(e,[this._parentNode.label,...r],n,i,s,o,u)}_onNodeInserted(e,r,n=null,i=null,s=!1){let o=e.parentBag,u=e.getValue(!0);o!==null&&o.backref&&u instanceof t&&u.setBackref(e,o),n===null&&(n=[]);for(let l of Object.values(this._insSubscribers))l({node:e,pathlist:n,ind:r,evt:"ins",reason:i,fired:s});this._parent&&this._parentNode&&this._parent._onNodeInserted(e,r,[this._parentNode.label,...n],i,s)}_onNodeDeleted(e,r,n=null,i=null){for(let s of Object.values(this._delSubscribers))s({node:e,pathlist:n,ind:r,evt:"del",reason:i});this._parent&&this._parentNode&&(n===null&&(n=[]),this._parent._onNodeDeleted(e,r,[this._parentNode.label,...n],i))}_subscribe(e,r,n){n!=null&&(r[e]=n)}subscribe(e,r={}){if(Object.hasOwn(r,"timer")||Object.hasOwn(r,"interval"))throw new TypeError("Timer subscriptions were removed. Schedule polling in the application.");let{update:n=null,insert:i=null,delete:s=null,any:o=null}=r;this.backref||this.setBackref(),this._subscribe(e,this._updSubscribers,n||o),this._subscribe(e,this._insSubscribers,i||o),this._subscribe(e,this._delSubscribers,s||o)}unsubscribe(e,r={}){if(Object.hasOwn(r,"timer")||Object.hasOwn(r,"interval"))throw new TypeError("Timer subscriptions were removed. Schedule polling in the application.");let{update:n=!1,insert:i=!1,delete:s=!1,any:o=!1}=r;(n||o)&&delete this._updSubscribers[e],(i||o)&&delete this._insSubscribers[e],(s||o)&&delete this._delSubscribers[e]}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}keys(){return this._nodes.keys()}values(){return this._nodes.values()}items(){return[...this._nodes].map(e=>({key:e.label,value:e.getValue()}))}get nodes(){return this.getNodes()}node(e){return this._nodes.get(e)}setAttr(e=null,r=null,n=!0){let i=t.prototype.getNode.call(this,e,!0,!0);i&&i.setAttr(r,!0,!0,n)}getAttr(e=null,r=null,n=null){let i=this.getNode(e);return i?i.getAttr(r,n):n}delAttr(e=null,...r){let n=this.getNode(e);n&&n.delAttr(...r)}getInheritedAttributes(){return this._parentNode?this._parentNode.getInheritedAttributes():{}}getNodes(e=null){return e?[...this._nodes].filter(r=>e(r)):[...this._nodes]}getNodeByValue(e,r){for(let n of this._nodes){let i=n.value;if(i instanceof t){if(i.getItem(e)===r)return n}else if(i&&i.get&&i.get(e)===r)return n}return null}getNodeByAttr(e,r,n=!1,i=!1){let s=r===void 0,o=n&&typeof r=="string"?r.toLowerCase():r,u=l=>{let a=[];for(let c of l._nodes){if(e in c.attr){let f=n&&typeof c.attr[e]=="string"?c.attr[e].toLowerCase():c.attr[e];if(s||f==o)return c}if(c._value instanceof t)if(i){let f=u(c._value);if(f)return f}else a.push(c._value)}for(let c of a){let f=u(c);if(f)return f}return null};return u(this)}isEmpty(e=!1,r=!1){if(this._nodes.length===0)return!0;for(let n of this._nodes){if(n._resolver!==null)return!1;let i=n.getValue(!0);if(i!=null&&!(e&&i===0)&&!(r&&i===""))return!1}return!0}query(e=null,r=null,n=!1,i=!1,s=!0,o=!0,u=null,l=!0){e||(e="#k,#v,#a");let a=this,c;if(typeof e=="string"){if(e.includes(":")){let[d,m]=e.split(":");a=this.getItem(d),e=m}c=e.split(",").map(d=>d.trim())}else c=e;let f=(d,m,p,g,w)=>{if(m==="#k")return d.label;if(m==="#p")return p;if(m==="#n")return d;if(typeof m=="function")return m(d);if(m==="#v"){let T=w();return g&&T instanceof t?null:T}else if(m.startsWith("#v.")){let T=m.split(".").slice(1).join("."),D=w();return D&&D.getItem?D.getItem(T):null}else{if(m==="#__v")return d.getValue(!0);if(m.startsWith("#a")){let T=m.includes(".")?m.split(".").slice(1).join("."):null;return d.getAttr(T)}else{let T=w();return T&&T.getItem?T.getItem(m):null}}};function*h(){let d=0;function*m(p,g){for(let w of p._nodes){let T=g?`${g}.${w.label}`:w.label,D=!1,x,O=()=>(D||(x=w.getValue(l),D=!0),x);if((s&&o||(O()instanceof t?o:s))&&(r===null||r(w))&&(yield c.length===1?f(w,c[0],T,i,O):c.map(H=>f(w,H,T,i,O)),d++,u!==null&&d>=u))return;if(i){let H=O();if(H instanceof t&&(yield*m(H,T),u!==null&&d>=u))return}}}yield*m(a,"")}return n?h():[...h()]}getLeaves(){let e=[],r=(n,i)=>{for(let s of n._nodes){let o=i?`${i}.${s.label}`:s.label,u=s.getValue(!1);u instanceof t?r(u,o):e.push([o,u])}};return r(this,""),e}digest(e=null,r=null,n=!1){typeof r=="boolean"&&(console.warn("Bag.digest(what, asColumns) is deprecated; use digest(what, null, asColumns)."),n=r,r=null);let i=this.query(e,r,!1,!1,!0,!0,null,!1);if(n){if(!i||i.length===0)return(typeof e=="string"?e:"#k,#v,#a").split(",").map(l=>l.trim()).map(()=>[]);let s=[...i];if(s.length&&Array.isArray(s[0])){let o=s[0].length,u=[];for(let l=0;l<o;l++)u.push(s.map(a=>a[l]));return u}return[s]}return[...i]}columns(e,r=!1){typeof e=="string"&&(e=e.split(","));let n=r?"#a.":"",i=e.map(s=>`${n}${s}`).join(",");return this.digest(i,null,!0)}sum(e="#v",r=!1,n=null){if(r!=null&&typeof r!="boolean")throw new TypeError("sum strict must be a boolean; pass condition as the third argument");if(n!=null&&typeof n!="function")throw new TypeError("sum condition must be callable; deep is no longer supported");let i=s=>{let o=0,u=!1;for(let l of this.query(s,n)){if(l==null||l===""){u=!0;continue}if(typeof l!="number"&&typeof l!="boolean"){if(r)throw new TypeError(`sum encountered non-numeric value: ${typeof l}`);continue}o+=l}return r&&u?null:o};return e.includes(",")?e.split(",").map(s=>i(s.trim())):i(e)}sort(e="#k:a"){let r=(i,s)=>i==null?[-1,""]:s&&typeof i=="string"?[0,i.toLowerCase()]:[0,i],n=(i,s)=>i[0]!==s[0]?i[0]-s[0]:i[1]<s[1]?-1:i[1]>s[1]?1:0;if(typeof e=="function")this._nodes._list.sort((i,s)=>{let o=e(i),u=e(s);return o<u?-1:o>u?1:0});else{let i=e.split(",");i.reverse();for(let s of i){let o,u;s.includes(":")?[o,u]=s.split(":",2):(o=s,u="a"),o=o.trim(),u=u.trim();let l=u==="d"||u==="D",a=u==="a"||u==="d",c;if(o.toLowerCase()==="#k")c=f=>r(f.label,a);else if(o.toLowerCase()==="#v")c=f=>r(f.value,a);else if(o.toLowerCase().startsWith("#a.")){let f=o.slice(3);c=h=>r(h.getAttr(f),a)}else c=f=>{let h=f.value,d=h instanceof t?h.getItem(o):h?h[o]:null;return r(d,a)};this._nodes._list.sort((f,h)=>{let d=n(c(f),c(h));return l?-d:d})}}return this}equalTo(e){return e instanceof t?this._nodes.isEqual(e._nodes):!1}has(e){if(typeof e=="string"){let r=null;e.includes("?")&&([e,r]=e.split("?",2));let n=this.getNode(e);return n===null?!1:r===null?!0:r.split("&").every(i=>i in n.attr)}else if(e&&e.label!==void 0)return[...this._nodes].includes(e);return!1}getResolver(e){let r=this.getNode(e);return r?r.resolver:null}setResolver(e,r){let n=this.getNode(e);n||(this.setItem(e,null),n=this.getNode(e)),n.resolver=r}setCallbackItem(e,r,n={}){let i=new wr({callback:r,...n});this.setResolver(e,i)}move(e,r,n=!0){this._nodes.move(e,r,n)}asDict(e=!1,r=!1,n=!1,i=!1){let s={};for(let o of this._nodes){let u=o.value;if(i&&u==null)continue;let l=o.label;e&&(l=String(l)),r&&(l=l.toLowerCase()),n&&u instanceof t&&(u=t.prototype.asDict.call(u,e,r,n,i)),Object.defineProperty(s,l,{value:u,enumerable:!0,writable:!0,configurable:!0})}return s}setdefault(e,r=null){let n=this.getNode(e);return n?n.value:(this.setItem(e,r),r)}deepcopy(e=!1){let r=this.createChildBag();for(let n of this._nodes){let i=n.getValue(!e);i instanceof t&&(i=i.deepcopy(e));let s=new r.nodeClass(r,n.label,i);s.setAttr({...n.attr},!1,!1,!1),s.nodeTag=n.nodeTag,s.xmlTag=n.xmlTag,r._nodes._list.push(s),r._nodes._dict[s.label]=s}return r}update(e,r=null,n=null,i=!1){if(!(e instanceof t)){for(let s in e){let o=e[s];(!i||o!==null||!this._nodes.has(s))&&this.setItem(s,o,null,">",!1,!1,n,!1,n!==!1)}return}for(let s of[...e]){let o=s.label,u=r==="static"?s.resolver:null,l=u?null:s.getValue(),a=s.attr.__replace;delete s.attr.__replace;let c=this._nodes.get(o);if(c)if(c.setAttr(s.attr,n===null?!0:n,!0,!1),s.nodeTag!=null&&(c.nodeTag=s.nodeTag),s.xmlTag!=null&&(c.xmlTag=s.xmlTag),u)c.resolver=u,c.setValue(null,n===null?!0:n,null,null,!1,n);else{s.resolver&&(c.resolver=null);let f=c.getValue();l instanceof t&&f instanceof t&&!a?f.update(l,r,n,i):(!i||l!==null)&&c.setValue(l,n===null?!0:n,null,null,!1,n)}else{let f=this.setItem(o,u||l,s.attr,">",!1,!1,n,!1,n!==!1);f.nodeTag=s.nodeTag,f.xmlTag=s.xmlTag}}}_fillFromBag(e){this.clear();for(let r of e){let n=new this.nodeClass(this,r.label);n.replace(r),n.nodeTag=r.nodeTag,n.xmlTag=r.xmlTag,this._nodes._list.push(n),this._nodes._dict[n.label]=n}}_appendLiteral(e,r,n=null,i=null,s=null){if(typeof e!="string")throw new TypeError("Bag labels must be strings");let o=new this.nodeClass(this,e,null,n,i,s,null,!1);return r instanceof ie?o.resolver=r:o._value=r,this._nodes._dict[e]=o,this._nodes._list.push(o),o}fillFrom(e=null,r={}){let n=xi(r);if(e!=null&&!$t(e)&&!Array.isArray(e))throw new TypeError("Bag source must be a dictionary, array or null");let i=this.createChildBag(),s=new Set,o=(u,l,a)=>{if(s.has(l))throw new TypeError(`Cyclic Bag source at ${a}`);s.add(l);try{let c=Array.isArray(l)?String(l.length).length+1:0,f=Array.isArray(l)?Array.from(l,(h,d)=>[`r_${String(d).padStart(c,"0")}`,h]):Object.entries(l);if(!Array.isArray(l)&&Object.getOwnPropertySymbols(l).some(h=>Object.prototype.propertyIsEnumerable.call(l,h)))throw new TypeError(`Bag labels must be strings at ${a}`);for(let[h,d]of f){let m=d;n&&($t(m)||Array.isArray(m))&&(m=this.createChildBag(),o(m,d,`${a}[${JSON.stringify(h)}]`)),u._appendLiteral(h,m)}}finally{s.delete(l)}};return e!=null&&o(i,e,"$"),this._replacePrepared(i)}_loadSource(e,r={}){return this.fillFrom(e,r)}replace(e){if(!(e instanceof t))throw new TypeError("Bag.replace expects a Bag");if(e===this)return this;let r=this.createChildBag();return r._fillFromBag(e),this._replacePrepared(r)}_replacePrepared(e){for(let n of this._nodes){n.parentBag=null;let i=n.getValue(!0);i instanceof t&&i.clearBackref()}let r=this._nodes;this._nodes=e._nodes,e._nodes=r,this._nodes._parentBag=this.backref?this:null,e._nodes._parentBag=null;for(let n of this._nodes)n.parentBag=this;for(let n of e._nodes)n._parentBag=e;return this.backref&&this.parent&&this.parentNode&&this.parent._onNodeChanged(this.parentNode,[this.parentNode.label],"upd_value",e),this}forEach(e,{static:r=!0,deep:n=!1,kwargs:i={}}={}){if(typeof e!="function")throw new TypeError("forEach requires a callback");let s=(o,u)=>{for(let l=0;l<o._nodes.length;l++){let a=o._nodes._list[l],c={...u};"_pathlist"in u&&(c._pathlist=[...u._pathlist,a.label]),"_indexlist"in u&&(c._indexlist=[...u._indexlist,l]);let f=e(a,c,l);if(f)return f;if(f==null&&n){let h=a.getValue(r);if(h instanceof t){let d=s(h,c);if(d)return d}}}return null};return s(this,i)}*traverse(){for(let e of this._nodes){yield e;let r=e.getValue(!0);r instanceof t&&(yield*r.traverse())}}*_iterNodesWithPaths(e=!0,r=""){for(let n of this._nodes){let i=r?`${r}.${n.label}`:n.label;yield[i,n];let s=n.getValue(e);s instanceof t&&(yield*s._iterNodesWithPaths(e,i))}}*_nodeFlattener(e=null){let r=e!==null,n=r?Object.create(null):null,i=0,s=new Map([["[]",this.constructor]]);for(let[o,u]of Qo(this)){let l=o.slice(0,-1),a=JSON.stringify(o),c=JSON.stringify(l),f=u.getValue(!0),h,d=null;if(u.resolver)h=Ar(u.resolver);else if(f instanceof t){let g=f.constructor,w=g.tytxSuffix;s.set(a,g),d=Ni(g,qt(s.get(c),w)),h=`::${w}`}else f===null?h="::NN":h=Ke(f);if(u.attr&&Object.hasOwn(u.attr,ve))throw new z(`node '${o}': the attribute '${ve}' is reserved for the Bag class name`);let m=gn(Ke(u.attr));d!==null&&(m[ve]=d);let p=u.nodeTag;r?(yield[l.length?n[c]:null,u.label,p,h,m],f instanceof t&&(n[a]=i,e[i]=o,i++)):yield[l,u.label,p,h,m]}}toTytx(e="json",r=!1){let n=this._toTytxPayload(r),i=this.constructor.tytxSuffix;if(e==="json")return`${n}::${i}`;if(e==="msgpack")return kr(new Te(4,new TextEncoder().encode(`${i}:${n}`)));throw new TypeError(`Unsupported transport: ${e}`)}_toTytxPayload(e=!1){let r;if(e){let s={};r={rows:[...this._nodeFlattener(s)],paths:s}}else r={rows:[...this._nodeFlattener(null)]};let n=this.constructor,i=Ni(n,qt(null,n.tytxSuffix));return i!==null&&(r[ve]=i),r.rows=r.rows.map(([s,o,u,l,a])=>[Ke(s),Ke(o),Ke(u),l,a]),r.paths&&(r.paths=Ke(r.paths)),De(r)}static fromTytx(e,r="json",n={}){if($t(r)&&(n=r,r="json"),xi(n),typeof e!="string"&&!(e instanceof Uint8Array))throw new TypeError("fromTytx requires serialized text or bytes");if(r!=="json"&&r!=="msgpack")throw new TypeError(`Unsupported transport: ${r}`);r==="json"&&e instanceof Uint8Array&&(e=new TextDecoder().decode(e));let i=Y(e,r==="json"?null:r);if(i instanceof t)return i;if(!$t(i)&&!Array.isArray(i))throw new TypeError("fromTytx requires a dictionary, array or typed Bag root");return new this(i,n)}static _fromTytxPayload(e){let r=this.tytxSuffix;if(e==="")return new(qt(null,r));let n=Y(e);if(!n||!Array.isArray(n.rows))throw new z("Invalid TYTX Bag: expected rows");let i=n.paths,s=i!=null,o=Object.hasOwn(n,ve)?_i(r,n[ve]):qt(null,r),u=new o,l=new Map([["[]",u]]);for(let a of n.rows){if(!Array.isArray(a)||a.length!==5)throw new z("Invalid TYTX Bag row");let[c,f,h,d,m]=a,p=c??"";if(s){if(c!==null&&!Object.hasOwn(i,c))throw new z(`Unknown TYTX parent reference: ${c}`);p=c===null?"":i[c]}if(typeof p=="string"&&(p=p?p.split("."):[]),!Array.isArray(p))throw new z("Invalid TYTX parent path");let g=JSON.stringify(p);if(!l.has(g))throw new z(`Missing or undecodable TYTX parent branch: ${p}`);let w=l.get(g),T=JSON.stringify([...p,f]),D=d,x=mn(D),O=vi(m),R=Object.hasOwn(O,ve)?O[ve]:null;if(delete O[ve],D instanceof t){let Q=D.constructor.tytxSuffix,K=R!==null?_i(Q,R):qt(w.constructor,Q);D=new K,l.set(T,D)}else if(R!==null)throw new z(`node '${T}': the attribute '${ve}' is reserved for the Bag class name of a branch`);let H=w._appendLiteral(f,x?null:D,O,x);H.nodeTag=h??null}return u}toXml(e={}){let{pretty:r=!1,encoding:n="UTF-8",docHeader:i=null,selfClosedTags:s=null}=e,o=this._bagToXml(s,r);return i===!0?o=`<?xml version='1.0' encoding='${n}'?>
15
+ ${o}`:typeof i=="string"&&(o=`${i}
16
+ ${o}`),o}_bagToXml(e=null,r=!1,n=0){let i=[];for(let s of this._nodes)i.push((r?" ".repeat(n):"")+this._nodeToXml(s,e,r,n));return i.join(r?`
17
+ `:"")}_nodeToXml(e,r=null,n=!1,i=0){let s=e.xmlTag||e.nodeTag||e.label,o=this._sanitizeTag(s),u=[];if(o!==s&&u.push(`_tag="${this._escapeAttr(s)}"`),e.resolver&&u.push(`_resolver="${this._escapeAttr(Ar(e.resolver))}"`),e.attr)for(let[h,d]of Object.entries(gn(e.attr)))d!==null&&d!==!1&&d!==void 0&&u.push(`${h}="${this._escapeAttr(String(d))}"`);let l=u.length?" "+u.join(" "):"",a=e.resolver?null:e.getValue(!0);if(a&&typeof a._bagToXml=="function"){n=n&&e.attr?.["xml:space"]!=="preserve";let h=a._bagToXml(r,n,i+1);return h?n?`<${o}${l}>
18
+ ${h}
19
+ ${" ".repeat(i)}</${o}>`:`<${o}${l}>${h}</${o}>`:r===null||r.includes(o)?`<${o}${l}/>`:`<${o}${l}></${o}>`}if(a==null||a==="")return r===null||r.includes(o)?`<${o}${l}/>`:`<${o}${l}></${o}>`;let c=a instanceof Date&&!Number.isNaN(a.getTime())?_f(a):String(a),f=this._escapeXml(c);return`<${o}${l}>${f}</${o}>`}_sanitizeTag(e){return e?e.replace(/[^a-zA-Z0-9_\-.:]/g,"_"):"_none_"}_escapeXml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}_escapeAttr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}static fromXml(e,r={}){let{tagAttribute:n=null}=r,i;if(typeof DOMParser<"u"){i=new DOMParser().parseFromString(e,"application/xml");let o=i.querySelector("parsererror");if(o)throw new Error(`XML parse error: ${o.textContent}`)}else i=new Zo.DOMParser().parseFromString(e,"application/xml");return this._xmlElementToBag(i.documentElement,n)}static _xmlElementToBag(e,r=null){let n=new this,i=Array.from(e.childNodes).filter(s=>s.nodeType===1);for(let s of i){let o=s.tagName,u={};for(let p=0;p<s.attributes.length;p++){let g=s.attributes[p];u[g.name]=g.value}let l=mn(u._resolver);l&&delete u._resolver;let a=String(u._T||"").toUpperCase()==="BAG";Object.assign(u,vi(u));let c=o;"_tag"in u&&(c=u._tag,delete u._tag),r&&r in u&&(c=u[r],delete u[r]);let f=c,h=1;for(;n.getNode(c);)c=`${f}_${h++}`;let d=Array.from(s.childNodes).filter(p=>p.nodeType===1),m;if(d.length>0||a){let p=this._xmlElementToBag(s,r);m=n.setItem(c,p,Object.keys(u).length>0?u:null)}else{let p=s.textContent||"";m=n.setItem(c,p,Object.keys(u).length>0?u:null)}l&&(m.resolver=l),m.xmlTag=o}return n}static async fromUrl(e,r={}){let{timeout:n=30}=r,i={};n&&(i.signal=AbortSignal.timeout(n*1e3));let s=await fetch(e,i),o=s.headers.get("content-type")||"",u=await s.text();if(o.includes("json"))return t.fromTytx(u);if(o.includes("xml"))return t.fromXml(u);let l=u.trim();if(l.startsWith("<"))return t.fromXml(u);if(l.startsWith("{")||l.startsWith("["))return t.fromTytx(u);throw new Tr(`Unsupported content-type: ${o}`)}toJson(e=!0){let r=[];for(let n of this._nodes)r.push(this._nodeToJsonDict(n,e));return e?De(r):JSON.stringify(r)}_nodeToJsonDict(e,r){let n=e.resolver?null:e.getValue(!0);if(n&&typeof n._nodeToJsonDict=="function"){let s=[];for(let o of n._nodes)s.push(n._nodeToJsonDict(o,r));n=s}let i={label:e.label,value:n,attr:gn(e.attr)};return e.nodeTag!==null&&(i.tag=e.nodeTag),e.resolver&&(i.resolver=Ar(e.resolver)),i}static fromJson(e,r={}){return Jo||(console.warn("Bag.fromJson is deprecated; use Bag.fromTytx"),Jo=!0),this.fromTytx(e,"json",r)}toStringTree(e=!0,r=null,n="",i=!0){r===null&&(r=new Map);let s=[],o=[...this._nodes];for(let u=0;u<o.length;u++){let l=o[u],a=u===o.length-1,c=l.getValue(e),f=l.getAttr(),h="",d=Object.keys(f);d.length>0&&(h=" ["+d.map(w=>`${w}=${JSON.stringify(f[w])}`).join(", ")+"]");let m=a?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",p=n+(a?" ":"\u2502 ");if(c instanceof t){let g=l,w=c.backref?"(*)":"";if(r.has(g))s.push(`${n}${m}${l.label}${w}${h} \u2192 (circular ref)`);else{r.set(g,l.label),s.push(`${n}${m}${l.label}${w}${h}`);let T=c.toStringTree(e,r,p,a);T&&s.push(T)}}else{let g;if(c===null)g="null";else if(c===void 0)g="undefined";else if(c instanceof ArrayBuffer||c instanceof Uint8Array){let w=new TextDecoder("utf-8",{fatal:!1}),T=c instanceof ArrayBuffer?new Uint8Array(c):c;g=w.decode(T)}else typeof c=="string"?c.length>50?g=JSON.stringify(c.slice(0,47)+"..."):g=JSON.stringify(c):g=String(c);s.push(`${n}${m}${l.label}: ${g}${h}`)}}return s.join(`
20
+ `)}toString(e=!0,r=null,n=""){r||(r=new Set);let i=[],s=[...this._nodes];for(let o=0;o<s.length;o++){let u=s[o],l=o===s.length-1,a=u.getValue(e),c="",f=u.attr;f&&Object.keys(f).length>0&&(c=` [${Object.entries(f).map(([p,g])=>`${p}=${JSON.stringify(g)}`).join(", ")}]`);let h=l?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",d=n+(l?" ":"\u2502 ");if(a&&typeof a._htraverse=="function"){let m=u;if(r.has(m))i.push(`${n}${h}${u.label}${c} \u2192 (circular ref)`);else{r.add(m),i.push(`${n}${h}${u.label}${c}`);let p=a.toString(e,r,d);p&&i.push(p)}}else{let m;a==null?m="null":typeof a=="string"&&a.length>50?m=JSON.stringify(a.slice(0,47)+"..."):typeof a=="string"?m=JSON.stringify(a):m=String(a),i.push(`${n}${h}${u.label}: ${m}${c}`)}}return i.join(`
21
+ `)}},Tr=class extends Error{constructor(e){super(e),this.name="BagException"}};ie.registerBagClass(_e);wi(_e,"X",t=>t._toTytxPayload(),t=>_e._fromTytxPayload(t));yi(_e.tytxSuffix,{...Ut(_e.tytxSuffix),Bag:_e});function Ci(t,e){let r=[],n=Object.freeze({full:e.full,rows:Object.freeze([...e.rows])});for(let i of[...t])if(t.has(i))try{i(n)}catch(s){r.push(s)}if(r.length)throw new AggregateError(r,"Collection notification failed")}var En=class{#i;#u=null;#a=new Set;#n=new Map;#t="";#e=new Map;#s=null;constructor(e){this.bindStore(e)}get bag(){return this.#i.bag}get rowMode(){return this.#i.rowMode}get sortedBy(){return this.#t}get criteria(){return Ko(this.#t)}get filter(){return this.#e.get("search")?.definition??null}get filterSignature(){return JSON.stringify([...this.#e].map(([e,{definition:r}])=>[e,r]))}get filterContributions(){return Object.freeze([...this.#e].map(([e,r])=>Object.freeze([e,Object.freeze({...r})])))}copyFiltersFrom(e){this.filterSignature!==e.filterSignature&&this.#o(this.#r(),this.#t,new Map(e.filterContributions))}get filtered(){return this.#s===null?null:[...this.#s]}isFiltered(){return this.#s!==null}value(e,r){return this.#i.value(e,r)}subscribe(e){return this.#a.add(e),()=>this.#a.delete(e)}connect(){this.#u||(this.synchronize(),this.#u=this.#i.subscribe(e=>this.synchronize(e)))}disconnect(){this.#u?.(),this.#u=null}bindStore(e){if(this.#i===e)return;let r=this.#u!==null;this.disconnect(),this.#i=e,this.#n.clear(),r?this.connect():this.synchronize()}getRows(e=!0){let r=this.#r();return e&&this.#s!==null?this.#s.map(n=>r[n]):r}#r(){return this.#i.getRows().toSorted((e,r)=>(this.#n.get(e)??1/0)-(this.#n.get(r)??1/0))}synchronize(e={full:!0,rows:[]}){if(!e.full&&!this.#t&&!this.#e.size){Ci(this.#a,e);return}this.#o(this.#f(this.#r(),this.criteria),this.#t,this.#e,e)}sort(e){let r=this.#f(this.#r(),Ko(e));this.#o(r,e,this.#e)}moveRow(e,r,n=!1){if(e===r||e.parentBag!==this.bag||r.parentBag!==this.bag)return;let i=this.getRows(!1);i.splice(i.indexOf(e),1),i.splice(i.indexOf(r)+Number(n),0,e),this.#o(i,"",this.#e)}applyFilter(e,r="search"){if(!["base","search"].includes(r))throw new TypeError("Unknown collection filter contribution");let n=e===null?null:Object.freeze({...e,columns:Object.freeze([...e.columns])});this.#c(r,n,jo(n))}applySetFilter(e){let r=e===null?null:Object.freeze(e.map(({field:i,value:s})=>{if(typeof i!="string"||!i)throw new TypeError("Set filter requires an identity field");return Ho(s),Object.freeze({field:i,value:s})})),n=r===null?null:i=>r.every(({field:s,value:o})=>zo(o,Xo(i(s))));this.#c("sets",r,n)}columnFilter(e){return this.#e.get(`column:${e}`)?.definition.values??null}columnRange(e){let r=this.#e.get(`column:${e}`)?.definition.range;return r?{...r,from:r.from&&new Date(r.from+"T00:00:00Z"),to:r.to&&new Date(r.to+"T00:00:00Z")}:null}applyColumnFilter(e,r,n=this.columnRange(e)){if(n=Mo(n),typeof e!="string"||!e)throw new TypeError("Column filter requires a field");let i=r===null?null:Bo(r),s=i?.map(at),o=i===null&&n===null?null:Object.freeze({field:e,values:i,keys:s&&Object.freeze(s),range:n}),u=o===null?null:l=>cn(l(e),n)&&(s===void 0||s.includes(at(l(e))));this.#c(`column:${e}`,o,u)}columnFacets(e){let r=new Map,n=this.#e.get(`column:${e}`)?.definition.range??null,i=this.columnFilter(e),s=i?.map(at),o=[...this.#e].filter(([u])=>u!==`column:${e}`).map(([,u])=>u.predicate).filter(u=>u!==null);for(let u of this.#r()){let l=Di(this.value(u,e)),a=at(l);r.has(a)||r.set(a,{key:a,value:l,count:0,selected:cn(l,n)&&(s===void 0||s.includes(a))}),o.every(c=>c(f=>this.value(u,f)))&&r.get(a).count++}for(let u of i??[]){let l=at(u);r.has(l)||r.set(l,{key:l,value:u,count:0,selected:!0})}return[...r.values()].filter(u=>cn(u.value,n))}#c(e,r,n){if(JSON.stringify(this.#e.get(e)?.definition??null)===JSON.stringify(r))return;let i=new Map(this.#e);r===null?i.delete(e):i.set(e,{definition:r,predicate:n}),this.#o(this.#r(),this.#t,i)}#o(e,r,n,i={full:!1,rows:[]}){let s=[...n.values()].map(c=>c.predicate).filter(c=>c!==null),o=s.length?e.flatMap((c,f)=>s.every(h=>h(d=>this.value(c,d)))?[f]:[]):null,u=i.full||r!==this.#t||n!==this.#e||e.length!==this.#n.size||e.some((c,f)=>this.#n.get(c)!==f)||JSON.stringify(o)!==JSON.stringify(this.#s);this.#n=new Map(e.map((c,f)=>[c,f])),this.#t=r,this.#e=n,this.#s=o;let l=o===null?null:new Set(o),a=u?[]:i.rows.filter(c=>this.#n.has(c)&&(l===null||l.has(this.#n.get(c))));(u||a.length||i.rows.length)&&Ci(this.#a,{full:u,rows:a})}#f(e,r){if(!r.length)return e;let n=e.map(i=>({node:i,keys:r.map(({field:s})=>this.value(i,s))}));for(let i=0;i<r.length;i++)if(new Set(n.map(o=>Sf(o.keys[i])).filter(o=>o!==null)).size>1)throw new TypeError(`collection view cannot compare mixed types in ${r[i].field}`);return n.sort((i,s)=>{for(let[o,{direction:u}]of r.entries()){let l=If(i.keys[o],s.keys[o]);if(l)return u==="a"?l:-l}return 0}).map(i=>i.node)}};function Ko(t){if(typeof t!="string")throw new TypeError("collection view sortedBy must be a string");if(t==="")return[];let e=new Set;return t.split(",").map(r=>{let n=/^([^,:]+):([ad])$/.exec(r);if(!n||e.has(n[1]))throw new TypeError(`Invalid collection view sort criterion: ${r}`);return e.add(n[1]),{field:n[1],direction:n[2]}})}function Sf(t){if(t==null)return null;if(typeof t=="number"&&Number.isFinite(t)||ee(t)&&t.isFinite())return"number";if(t instanceof Date&&Number.isFinite(t.getTime()))return"date";if(typeof t=="string"||typeof t=="boolean")return typeof t;throw new TypeError("collection view sort requires loaded finite scalar values")}function If(t,e){return t==null||e==null?t==null?e==null?0:-1:1:ee(t)?t.comparedTo(e):ee(e)?-e.comparedTo(t):t<e?-1:t>e?1:0}function wn(){return Array.from(globalThis.crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("")}var yn=class{constructor(e,r,n,i){this.library=e,this.configuration=i,this.element=r;let{Vizabi:s,BubbleChart:o,mobx:u}=e;if(!Number.isInteger(i.getItem("year"))||typeof i.getItem("playing")!="boolean"||!Number.isFinite(i.getItem("speed"))||i.getItem("speed")<=0)throw new TypeError("Vizabi requires an integer year, Boolean playing and positive speed in milliseconds");let a=Object.fromEntries(["entityField","timeField","xField","yField","sizeField","colorField"].map(p=>[p,i.getItem(p)]));for(let[p,g]of Object.entries(a))if(typeof g!="string"||!g)throw new TypeError(`${p} requires a field name`);if(Object.entries(a).some(([p,g])=>g==="name"&&p!=="entityField"))throw new TypeError("The Vizabi entity catalogue reserves name for the entity display name");let c=n.getRows().map(p=>Object.fromEntries([...new Set(Object.values(a))].map(g=>[g,n.value(p,g)]))),f=new Set;for(let p of c){if(typeof p[a.entityField]!="string"||!Number.isInteger(p[a.timeField]))throw new TypeError("Vizabi trial requires text entities and integer years");let g=JSON.stringify([p[a.entityField],p[a.timeField]]);if(f.has(g))throw new TypeError("Vizabi requires one prepared row per entity and year");f.add(g);for(let w of[a.xField,a.yField,a.sizeField])if(typeof p[w]!="number"||!Number.isFinite(p[w]))throw new TypeError(`${w} requires finite numbers`);if(p[a.sizeField]<0)throw new TypeError("Bubble size cannot be negative");if(typeof p[a.colorField]!="string")throw new TypeError("Bubble color requires a text category")}for(let p of c)p.name=p[a.entityField];if(!c.length)throw new TypeError("No data to display");this.id=`bubble_${wn()}`,this.legendId=`legend_${wn()}`,this.sourceId=`data_${wn()}`;let h=JSON.parse(JSON.stringify(o.DEFAULT_MODEL).replaceAll("markers.bubble",`markers.${this.id}`).replaceAll("markers.legend",`markers.${this.legendId}`)),d=h.bubble;d.data={source:this.sourceId,space:[a.entityField,a.timeField]};for(let[p,g]of Object.entries({x:a.xField,y:a.yField,size:a.sizeField,color:a.colorField,label:a.entityField}))d.encoding[p].data={concept:g,constant:null};d.encoding.label.data={modelType:"entityPropertyDataConfig",concept:"name"},d.requiredEncodings=["x","y","size","color","label"],d.encoding.y.modelType="baseType",d.encoding.y.scale.type="linear",d.encoding.frame={modelType:"frame",data:{concept:a.timeField},value:String(i.getItem("year")),speed:i.getItem("speed"),splash:!1,loop:!0};let m=s({dataSources:{[this.sourceId]:{values:c,keyConcepts:[a.entityField,a.timeField],dtypes:{[a.timeField]:"year"}}},markers:{[this.id]:d,[this.legendId]:h.legend}});this.models=m,this.frame=m.markers[this.id].encoding.frame,this.tool=new o({Vizabi:s,placeholder:r,model:{config:m.config,dataSources:m.dataSources,markers:{bubble:m.markers[this.id],legend:m.markers[this.legendId]}},locale:{id:"en",resolve:{en:e.locale},placeholder:r},layout:{placeholder:r},ui:{buttons:{buttons:[]},dialogs:{dialogs:{sidebar:[],popup:[]}}}}),this.release=u.reaction(()=>{let p=m.markers[this.id];return[p.state==="fulfilled"?this.frame.value.getUTCFullYear():null,this.frame.playing,...["x","y","size","color"].map(g=>p.encoding[g].data.concept)]},([p,g,w,T,D,x])=>{if(Number.isFinite(p)){this.writing=!0;try{for(let[O,R]of Object.entries({xField:w,yField:T,sizeField:D,colorField:x}))i.getItem(O)!==R&&i.setItem(O,R);i.getItem("year")!==p&&i.setItem("year",p),i.getItem("playing")!==g&&i.setItem("playing",g)}finally{this.writing=!1}}}),this.ready=u.when(()=>m.markers[this.id].state==="fulfilled",()=>this.update())}update(){if(this.writing||this.models.markers[this.id].state!=="fulfilled")return;let e=this.configuration,r=this.frame;this.library.mobx.runInAction(()=>{r.setSpeed(e.getItem("speed")),r.value?.getUTCFullYear()!==e.getItem("year")&&r.setValue(String(e.getItem("year"))),r.playing!==e.getItem("playing")&&r.setPlaying(e.getItem("playing"))})}resize(){this.tool.services.layout._resizeHandler()}dispose(){this.release(),this.ready(),this.frame.stopPlaying(),this.tool.deconstruct();let e=this.library.Vizabi.stores;e.markers.dispose(this.legendId),e.markers.dispose(this.id),e.dataSources.dispose(this.sourceId),this.element.replaceChildren()}};var Bf=(0,Re.defineComponent)({name:"vizabiBubble",tag:"gramlot-vizabi-bubble",base:vn,sourceContext:!0,bagStore:!0,parameters:{storepath:{dtype:"T"},rowMode:{dtype:"T",default:"attributes"},configuration:{dtype:"X",binding:"read"},libraryUrl:{dtype:"T"}},implementation:t=>class extends t{#i;#u;#a;#n;#t;#e;#s;#r;#c;#o=0;#f=!1;#d=Symbol("vizabi-config");#p;#l;#h;constructor(){super(),this.control.replaceChildren(),this.#p=this.ownerDocument.createElement("style"),this.shadowRoot.append(this.#p),this.#l=this.ownerDocument.createElement("div"),this.#l.setAttribute("role","status"),this.#h=this.ownerDocument.createElement("div"),this.#h.style.cssText="width:100%;height:100%;position:relative;background:white;color:#222",this.control.append(this.#l,this.#h),this.control.style.height="100%",this.#c=new this.ownerDocument.defaultView.ResizeObserver(()=>this.#r?.resize())}setSourceContext(e){this.#i=e}setStoreBag(e){this.#u=e}projectAttributes(e,r){let n=super.projectAttributes(e,r);return this.#f&&this.#m(),n}connectedCallback(){this.#f=!0,this.#m(),this.#c.observe(this.#h)}#m(){let e=this.#n!==this.parameters.libraryUrl;this.#n=this.parameters.libraryUrl;let r=this.parameters.configuration;if(!(r instanceof Of))throw new TypeError("vizabiBubble requires a configuration Bag");this.#t!==r&&(e=!0,this.#t?.unsubscribe(this.#d,{any:!0}),this.#t=r,r.subscribe(this.#d,{any:()=>{this.#r?.writing||this.#g()}}));let n=this.#i.sourceNode.rootBuilder.binding.collectionStore(this.#u,this.parameters.rowMode);if(!this.#e)e=!0,this.#e=new En(n),this.#e.connect(),this.#s=this.#e.subscribe(()=>this.#E());else if(this.#e.bag!==this.#u){this.#e.bindStore(n);return}e&&(this.#a=null),this.#g()}#g(){let e=JSON.stringify(["entityField","timeField","xField","yField","sizeField","colorField"].map(r=>this.#t.getItem(r)));if(this.#r?.writing){this.#a=e;return}e!==this.#a?(this.#a=e,this.#E()):this.#r?.update()}async#E(){let e=++this.#o;this.#r?.dispose(),this.#r=null,this.#l.hidden=!1,this.#l.textContent="Loading optional Vizabi library\u2026";try{if(!this.parameters.libraryUrl)throw new Error("Provide libraryUrl to load the optional Vizabi module");let r=await import(this.parameters.libraryUrl);if(!this.#f||e!==this.#o)return;this.#p.textContent=r.style+`
22
+ :host{display:block;height:100%;min-height:0}.control-box{height:100%}`,this.#r=new yn(r,this.#h,this.#e,this.#t),this.#l.hidden=!0}catch(r){if(e!==this.#o)return;this.#l.setAttribute("role","alert"),this.#l.textContent=r.message}}disconnectedCallback(){this.#f=!1,this.#o++,this.#c.disconnect(),this.#t?.unsubscribe(this.#d,{any:!0}),this.#s?.(),this.#e?.disconnect(),this.#r?.dispose(),this.#r=null,this.#e=null,this.#t=null}}}),t0=bn({name:"vizabi",components:[Bf]});export{t0 as default};