sqlmesh 0.217.1.dev1__py3-none-any.whl → 0.227.2.dev4__py3-none-any.whl

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 (183) hide show
  1. sqlmesh/__init__.py +12 -2
  2. sqlmesh/_version.py +2 -2
  3. sqlmesh/cli/project_init.py +10 -2
  4. sqlmesh/core/_typing.py +1 -0
  5. sqlmesh/core/audit/definition.py +8 -2
  6. sqlmesh/core/config/__init__.py +1 -1
  7. sqlmesh/core/config/connection.py +17 -5
  8. sqlmesh/core/config/dbt.py +13 -0
  9. sqlmesh/core/config/janitor.py +12 -0
  10. sqlmesh/core/config/loader.py +7 -0
  11. sqlmesh/core/config/model.py +2 -0
  12. sqlmesh/core/config/root.py +3 -0
  13. sqlmesh/core/console.py +80 -2
  14. sqlmesh/core/constants.py +1 -1
  15. sqlmesh/core/context.py +61 -25
  16. sqlmesh/core/dialect.py +3 -0
  17. sqlmesh/core/engine_adapter/_typing.py +2 -0
  18. sqlmesh/core/engine_adapter/base.py +322 -22
  19. sqlmesh/core/engine_adapter/base_postgres.py +17 -1
  20. sqlmesh/core/engine_adapter/bigquery.py +146 -7
  21. sqlmesh/core/engine_adapter/clickhouse.py +17 -13
  22. sqlmesh/core/engine_adapter/databricks.py +33 -2
  23. sqlmesh/core/engine_adapter/fabric.py +1 -29
  24. sqlmesh/core/engine_adapter/mixins.py +142 -48
  25. sqlmesh/core/engine_adapter/mssql.py +15 -4
  26. sqlmesh/core/engine_adapter/mysql.py +2 -2
  27. sqlmesh/core/engine_adapter/postgres.py +9 -3
  28. sqlmesh/core/engine_adapter/redshift.py +4 -0
  29. sqlmesh/core/engine_adapter/risingwave.py +1 -0
  30. sqlmesh/core/engine_adapter/shared.py +6 -0
  31. sqlmesh/core/engine_adapter/snowflake.py +82 -11
  32. sqlmesh/core/engine_adapter/spark.py +14 -10
  33. sqlmesh/core/engine_adapter/trino.py +4 -2
  34. sqlmesh/core/janitor.py +181 -0
  35. sqlmesh/core/lineage.py +1 -0
  36. sqlmesh/core/macros.py +35 -13
  37. sqlmesh/core/model/common.py +2 -0
  38. sqlmesh/core/model/definition.py +65 -4
  39. sqlmesh/core/model/kind.py +66 -2
  40. sqlmesh/core/model/meta.py +107 -2
  41. sqlmesh/core/node.py +101 -2
  42. sqlmesh/core/plan/builder.py +15 -10
  43. sqlmesh/core/plan/common.py +196 -2
  44. sqlmesh/core/plan/definition.py +21 -6
  45. sqlmesh/core/plan/evaluator.py +72 -113
  46. sqlmesh/core/plan/explainer.py +90 -8
  47. sqlmesh/core/plan/stages.py +42 -21
  48. sqlmesh/core/renderer.py +26 -18
  49. sqlmesh/core/scheduler.py +60 -19
  50. sqlmesh/core/selector.py +137 -9
  51. sqlmesh/core/signal.py +64 -1
  52. sqlmesh/core/snapshot/__init__.py +1 -0
  53. sqlmesh/core/snapshot/definition.py +109 -25
  54. sqlmesh/core/snapshot/evaluator.py +610 -50
  55. sqlmesh/core/state_sync/__init__.py +0 -1
  56. sqlmesh/core/state_sync/base.py +31 -27
  57. sqlmesh/core/state_sync/cache.py +12 -4
  58. sqlmesh/core/state_sync/common.py +216 -111
  59. sqlmesh/core/state_sync/db/facade.py +30 -15
  60. sqlmesh/core/state_sync/db/interval.py +27 -7
  61. sqlmesh/core/state_sync/db/migrator.py +14 -8
  62. sqlmesh/core/state_sync/db/snapshot.py +119 -87
  63. sqlmesh/core/table_diff.py +2 -2
  64. sqlmesh/core/test/definition.py +14 -9
  65. sqlmesh/dbt/adapter.py +20 -11
  66. sqlmesh/dbt/basemodel.py +52 -41
  67. sqlmesh/dbt/builtin.py +27 -11
  68. sqlmesh/dbt/column.py +17 -5
  69. sqlmesh/dbt/common.py +4 -2
  70. sqlmesh/dbt/context.py +14 -1
  71. sqlmesh/dbt/loader.py +60 -8
  72. sqlmesh/dbt/manifest.py +136 -8
  73. sqlmesh/dbt/model.py +105 -25
  74. sqlmesh/dbt/package.py +16 -1
  75. sqlmesh/dbt/profile.py +3 -3
  76. sqlmesh/dbt/project.py +12 -7
  77. sqlmesh/dbt/seed.py +1 -1
  78. sqlmesh/dbt/source.py +6 -1
  79. sqlmesh/dbt/target.py +25 -6
  80. sqlmesh/dbt/test.py +31 -1
  81. sqlmesh/migrations/v0000_baseline.py +3 -6
  82. sqlmesh/migrations/v0061_mysql_fix_blob_text_type.py +2 -5
  83. sqlmesh/migrations/v0062_add_model_gateway.py +2 -2
  84. sqlmesh/migrations/v0063_change_signals.py +2 -4
  85. sqlmesh/migrations/v0064_join_when_matched_strings.py +2 -4
  86. sqlmesh/migrations/v0065_add_model_optimize.py +2 -2
  87. sqlmesh/migrations/v0066_add_auto_restatements.py +2 -6
  88. sqlmesh/migrations/v0067_add_tsql_date_full_precision.py +2 -2
  89. sqlmesh/migrations/v0068_include_unrendered_query_in_metadata_hash.py +2 -2
  90. sqlmesh/migrations/v0069_update_dev_table_suffix.py +2 -4
  91. sqlmesh/migrations/v0070_include_grains_in_metadata_hash.py +2 -2
  92. sqlmesh/migrations/v0071_add_dev_version_to_intervals.py +2 -6
  93. sqlmesh/migrations/v0072_add_environment_statements.py +2 -4
  94. sqlmesh/migrations/v0073_remove_symbolic_disable_restatement.py +2 -4
  95. sqlmesh/migrations/v0074_add_partition_by_time_column_property.py +2 -2
  96. sqlmesh/migrations/v0075_remove_validate_query.py +2 -4
  97. sqlmesh/migrations/v0076_add_cron_tz.py +2 -2
  98. sqlmesh/migrations/v0077_fix_column_type_hash_calculation.py +2 -2
  99. sqlmesh/migrations/v0078_warn_if_non_migratable_python_env.py +2 -4
  100. sqlmesh/migrations/v0079_add_gateway_managed_property.py +7 -9
  101. sqlmesh/migrations/v0080_add_batch_size_to_scd_type_2_models.py +2 -2
  102. sqlmesh/migrations/v0081_update_partitioned_by.py +2 -4
  103. sqlmesh/migrations/v0082_warn_if_incorrectly_duplicated_statements.py +2 -4
  104. sqlmesh/migrations/v0083_use_sql_for_scd_time_data_type_data_hash.py +2 -2
  105. sqlmesh/migrations/v0084_normalize_quote_when_matched_and_merge_filter.py +2 -2
  106. sqlmesh/migrations/v0085_deterministic_repr.py +2 -4
  107. sqlmesh/migrations/v0086_check_deterministic_bug.py +2 -4
  108. sqlmesh/migrations/v0087_normalize_blueprint_variables.py +2 -4
  109. sqlmesh/migrations/v0088_warn_about_variable_python_env_diffs.py +2 -4
  110. sqlmesh/migrations/v0089_add_virtual_environment_mode.py +2 -2
  111. sqlmesh/migrations/v0090_add_forward_only_column.py +2 -6
  112. sqlmesh/migrations/v0091_on_additive_change.py +2 -2
  113. sqlmesh/migrations/v0092_warn_about_dbt_data_type_diff.py +2 -4
  114. sqlmesh/migrations/v0093_use_raw_sql_in_fingerprint.py +2 -2
  115. sqlmesh/migrations/v0094_add_dev_version_and_fingerprint_columns.py +2 -6
  116. sqlmesh/migrations/v0095_warn_about_dbt_raw_sql_diff.py +2 -4
  117. sqlmesh/migrations/v0096_remove_plan_dags_table.py +2 -4
  118. sqlmesh/migrations/v0097_add_dbt_name_in_node.py +2 -2
  119. sqlmesh/migrations/v0098_add_dbt_node_info_in_node.py +103 -0
  120. sqlmesh/migrations/v0099_add_last_altered_to_intervals.py +25 -0
  121. sqlmesh/migrations/v0100_add_grants_and_grants_target_layer.py +9 -0
  122. sqlmesh/utils/__init__.py +8 -1
  123. sqlmesh/utils/cache.py +5 -1
  124. sqlmesh/utils/date.py +1 -1
  125. sqlmesh/utils/errors.py +4 -0
  126. sqlmesh/utils/jinja.py +25 -2
  127. sqlmesh/utils/pydantic.py +6 -6
  128. sqlmesh/utils/windows.py +13 -3
  129. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev4.dist-info}/METADATA +5 -5
  130. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev4.dist-info}/RECORD +181 -176
  131. sqlmesh_dbt/cli.py +70 -7
  132. sqlmesh_dbt/console.py +14 -6
  133. sqlmesh_dbt/operations.py +103 -24
  134. sqlmesh_dbt/selectors.py +39 -1
  135. web/client/dist/assets/{Audits-Ucsx1GzF.js → Audits-CBiYyyx-.js} +1 -1
  136. web/client/dist/assets/{Banner-BWDzvavM.js → Banner-DSRbUlO5.js} +1 -1
  137. web/client/dist/assets/{ChevronDownIcon-D2VL13Ah.js → ChevronDownIcon-MK_nrjD_.js} +1 -1
  138. web/client/dist/assets/{ChevronRightIcon-DWGYbf1l.js → ChevronRightIcon-CLWtT22Q.js} +1 -1
  139. web/client/dist/assets/{Content-DdHDZM3I.js → Content-BNuGZN5l.js} +1 -1
  140. web/client/dist/assets/{Content-Bikfy8fh.js → Content-CSHJyW0n.js} +1 -1
  141. web/client/dist/assets/{Data-CzAJH7rW.js → Data-C1oRDbLx.js} +1 -1
  142. web/client/dist/assets/{DataCatalog-BJF11g8f.js → DataCatalog-HXyX2-_j.js} +1 -1
  143. web/client/dist/assets/{Editor-s0SBpV2y.js → Editor-BDyfpUuw.js} +1 -1
  144. web/client/dist/assets/{Editor-DgLhgKnm.js → Editor-D0jNItwC.js} +1 -1
  145. web/client/dist/assets/{Errors-D0m0O1d3.js → Errors-BfuFLcPi.js} +1 -1
  146. web/client/dist/assets/{FileExplorer-CEv0vXkt.js → FileExplorer-BR9IE3he.js} +1 -1
  147. web/client/dist/assets/{Footer-BwzXn8Ew.js → Footer-CgBEtiAh.js} +1 -1
  148. web/client/dist/assets/{Header-6heDkEqG.js → Header-DSqR6nSO.js} +1 -1
  149. web/client/dist/assets/{Input-obuJsD6k.js → Input-B-oZ6fGO.js} +1 -1
  150. web/client/dist/assets/Lineage-DYQVwDbD.js +1 -0
  151. web/client/dist/assets/{ListboxShow-HM9_qyrt.js → ListboxShow-BE5-xevs.js} +1 -1
  152. web/client/dist/assets/{ModelLineage-zWdKo0U2.js → ModelLineage-DkIFAYo4.js} +1 -1
  153. web/client/dist/assets/{Models-Bcu66SRz.js → Models-D5dWr8RB.js} +1 -1
  154. web/client/dist/assets/{Page-BWEEQfIt.js → Page-C-XfU5BR.js} +1 -1
  155. web/client/dist/assets/{Plan-C4gXCqlf.js → Plan-ZEuTINBq.js} +1 -1
  156. web/client/dist/assets/{PlusCircleIcon-CVDO651q.js → PlusCircleIcon-DVXAHG8_.js} +1 -1
  157. web/client/dist/assets/{ReportErrors-BT6xFwAr.js → ReportErrors-B7FEPzMB.js} +1 -1
  158. web/client/dist/assets/{Root-ryJoBK4h.js → Root-8aZyhPxF.js} +1 -1
  159. web/client/dist/assets/{SearchList-DB04sPb9.js → SearchList-W_iT2G82.js} +1 -1
  160. web/client/dist/assets/{SelectEnvironment-CUYcXUu6.js → SelectEnvironment-C65jALmO.js} +1 -1
  161. web/client/dist/assets/{SourceList-Doo_9ZGp.js → SourceList-DSLO6nVJ.js} +1 -1
  162. web/client/dist/assets/{SourceListItem-D5Mj7Dly.js → SourceListItem-BHt8d9-I.js} +1 -1
  163. web/client/dist/assets/{SplitPane-qHmkD1qy.js → SplitPane-CViaZmw6.js} +1 -1
  164. web/client/dist/assets/{Tests-DH1Z74ML.js → Tests-DhaVt5t1.js} +1 -1
  165. web/client/dist/assets/{Welcome-DqUJUNMF.js → Welcome-DvpjH-_4.js} +1 -1
  166. web/client/dist/assets/context-BctCsyGb.js +71 -0
  167. web/client/dist/assets/{context-Dr54UHLi.js → context-DFNeGsFF.js} +1 -1
  168. web/client/dist/assets/{editor-DYIP1yQ4.js → editor-CcO28cqd.js} +1 -1
  169. web/client/dist/assets/{file-DarlIDVi.js → file-CvJN3aZO.js} +1 -1
  170. web/client/dist/assets/{floating-ui.react-dom-BH3TFvkM.js → floating-ui.react-dom-CjE-JNW1.js} +1 -1
  171. web/client/dist/assets/{help-Bl8wqaQc.js → help-DuPhjipa.js} +1 -1
  172. web/client/dist/assets/{index-D1sR7wpN.js → index-C-dJH7yZ.js} +1 -1
  173. web/client/dist/assets/{index-O3mjYpnE.js → index-Dj0i1-CA.js} +2 -2
  174. web/client/dist/assets/{plan-CehRrJUG.js → plan-BTRSbjKn.js} +1 -1
  175. web/client/dist/assets/{popover-CqgMRE0G.js → popover-_Sf0yvOI.js} +1 -1
  176. web/client/dist/assets/{project-6gxepOhm.js → project-BvSOI8MY.js} +1 -1
  177. web/client/dist/index.html +1 -1
  178. web/client/dist/assets/Lineage-D0Hgdz2v.js +0 -1
  179. web/client/dist/assets/context-DgX0fp2E.js +0 -68
  180. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev4.dist-info}/WHEEL +0 -0
  181. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev4.dist-info}/entry_points.txt +0 -0
  182. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev4.dist-info}/licenses/LICENSE +0 -0
  183. {sqlmesh-0.217.1.dev1.dist-info → sqlmesh-0.227.2.dev4.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- import{a1 as jt,j as C,i as Ae,b as bn,g as Ht,C as Nr,D as Dr,a2 as Fr,f as _r,P as Or,Q as Mr,s as Rr,a as tn,a3 as Br,v as we,r as jr,U as Hr,e as Xn,L as Ur,S as Vr}from"./index-O3mjYpnE.js";import{M as qr,u as $r,L as Yr,C as Kr,a as rn}from"./context-DgX0fp2E.js";import{T as Qr,a as ln,b as Wr,c as Xr,d as Gn,e as ge,f as Gr,g as Jr,h as Jn,i as Zn,j as Zr,k as et,l as nt}from"./SearchList-DB04sPb9.js";import ei from"./ModelLineage-zWdKo0U2.js";import{E as on}from"./file-DarlIDVi.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./floating-ui.react-dom-BH3TFvkM.js";import"./editor-DYIP1yQ4.js";import"./project-6gxepOhm.js";import"./help-B59vE3aE.js";import"./SourceList-Doo_9ZGp.js";import"./Input-obuJsD6k.js";import"./index-D1sR7wpN.js";import"./popover-CqgMRE0G.js";import"./ListboxShow-HM9_qyrt.js";function ni(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const ti=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ri=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ii={};function tt(e,n){return(ii.jsx?ri:ti).test(e)}const li=/[ \t\n\f\r]/g;function oi(e){return typeof e=="object"?e.type==="text"?rt(e.value):!1:rt(e)}function rt(e){return e.replace(li,"")===""}class qe{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}qe.prototype.normal={};qe.prototype.property={};qe.prototype.space=void 0;function Ut(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new qe(t,r,n)}function wn(e){return e.toLowerCase()}class Z{constructor(n,t){this.attribute=t,this.property=n}}Z.prototype.attribute="";Z.prototype.booleanish=!1;Z.prototype.boolean=!1;Z.prototype.commaOrSpaceSeparated=!1;Z.prototype.commaSeparated=!1;Z.prototype.defined=!1;Z.prototype.mustUseProperty=!1;Z.prototype.number=!1;Z.prototype.overloadedBoolean=!1;Z.prototype.property="";Z.prototype.spaceSeparated=!1;Z.prototype.space=void 0;let ai=0;const F=Se(),Y=Se(),Sn=Se(),x=Se(),V=Se(),ve=Se(),ne=Se();function Se(){return 2**++ai}const Cn=Object.freeze(Object.defineProperty({__proto__:null,boolean:F,booleanish:Y,commaOrSpaceSeparated:ne,commaSeparated:ve,number:x,overloadedBoolean:Sn,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),an=Object.keys(Cn);class Ln extends Z{constructor(n,t,r,i){let l=-1;if(super(n,t),it(this,"space",i),typeof r=="number")for(;++l<an.length;){const o=an[l];it(this,an[l],(r&Cn[o])===Cn[o])}}}Ln.prototype.defined=!0;function it(e,n,t){t&&(e[n]=t)}function Le(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const l=new Ln(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),n[r]=l,t[wn(r)]=r,t[wn(l.attribute)]=r}return new qe(n,t,e.space)}const Vt=Le({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:x,ariaColIndex:x,ariaColSpan:x,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:V,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:x,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:x,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:V,ariaRowCount:x,ariaRowIndex:x,ariaRowSpan:x,ariaSelected:Y,ariaSetSize:x,ariaSort:null,ariaValueMax:x,ariaValueMin:x,ariaValueNow:x,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function qt(e,n){return n in e?e[n]:n}function $t(e,n){return qt(e,n.toLowerCase())}const ui=Le({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ve,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:F,allowPaymentRequest:F,allowUserMedia:F,alt:null,as:null,async:F,autoCapitalize:null,autoComplete:V,autoFocus:F,autoPlay:F,blocking:V,capture:null,charSet:null,checked:F,cite:null,className:V,cols:x,colSpan:null,content:null,contentEditable:Y,controls:F,controlsList:V,coords:x|ve,crossOrigin:null,data:null,dateTime:null,decoding:null,default:F,defer:F,dir:null,dirName:null,disabled:F,download:Sn,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:F,formTarget:null,headers:V,height:x,hidden:Sn,high:x,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:F,inputMode:null,integrity:null,is:null,isMap:F,itemId:null,itemProp:V,itemRef:V,itemScope:F,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:F,low:x,manifest:null,max:null,maxLength:x,media:null,method:null,min:null,minLength:x,multiple:F,muted:F,name:null,nonce:null,noModule:F,noValidate:F,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:F,optimum:x,pattern:null,ping:V,placeholder:null,playsInline:F,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:F,referrerPolicy:null,rel:V,required:F,reversed:F,rows:x,rowSpan:x,sandbox:V,scope:null,scoped:F,seamless:F,selected:F,shadowRootClonable:F,shadowRootDelegatesFocus:F,shadowRootMode:null,shape:null,size:x,sizes:null,slot:null,span:x,spellCheck:Y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:x,step:null,style:null,tabIndex:x,target:null,title:null,translate:null,type:null,typeMustMatch:F,useMap:null,value:Y,width:x,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:x,borderColor:null,bottomMargin:x,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:F,declare:F,event:null,face:null,frame:null,frameBorder:null,hSpace:x,leftMargin:x,link:null,longDesc:null,lowSrc:null,marginHeight:x,marginWidth:x,noResize:F,noHref:F,noShade:F,noWrap:F,object:null,profile:null,prompt:null,rev:null,rightMargin:x,rules:null,scheme:null,scrolling:Y,standby:null,summary:null,text:null,topMargin:x,valueType:null,version:null,vAlign:null,vLink:null,vSpace:x,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:F,disableRemotePlayback:F,prefix:null,property:null,results:x,security:null,unselectable:null},space:"html",transform:$t}),si=Le({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ne,accentHeight:x,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:x,amplitude:x,arabicForm:null,ascent:x,attributeName:null,attributeType:null,azimuth:x,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:x,by:null,calcMode:null,capHeight:x,className:V,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:x,diffuseConstant:x,direction:null,display:null,dur:null,divisor:x,dominantBaseline:null,download:F,dx:null,dy:null,edgeMode:null,editable:null,elevation:x,enableBackground:null,end:null,event:null,exponent:x,externalResourcesRequired:null,fill:null,fillOpacity:x,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ve,g2:ve,glyphName:ve,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:x,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:x,horizOriginX:x,horizOriginY:x,id:null,ideographic:x,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:x,k:x,k1:x,k2:x,k3:x,k4:x,kernelMatrix:ne,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:x,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:x,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:x,overlineThickness:x,paintOrder:null,panose1:null,path:null,pathLength:x,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:x,pointsAtY:x,pointsAtZ:x,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ne,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ne,rev:ne,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ne,requiredFeatures:ne,requiredFonts:ne,requiredFormats:ne,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:x,specularExponent:x,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:x,strikethroughThickness:x,string:null,stroke:null,strokeDashArray:ne,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:x,strokeOpacity:x,strokeWidth:null,style:null,surfaceScale:x,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ne,tabIndex:x,tableValues:null,target:null,targetX:x,targetY:x,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ne,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:x,underlineThickness:x,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:x,values:null,vAlphabetic:x,vMathematical:x,vectorEffect:null,vHanging:x,vIdeographic:x,version:null,vertAdvY:x,vertOriginX:x,vertOriginY:x,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:x,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qt}),Yt=Le({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Kt=Le({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$t}),Qt=Le({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),ci={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},pi=/[A-Z]/g,lt=/-[a-z]/g,fi=/^data[-\w.:]+$/i;function hi(e,n){const t=wn(n);let r=n,i=Z;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&fi.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(lt,di);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!lt.test(l)){let o=l.replace(pi,mi);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=Ln}return new i(r,n)}function mi(e){return"-"+e.toLowerCase()}function di(e){return e.charAt(1).toUpperCase()}const gi=Ut([Vt,ui,Yt,Kt,Qt],"html"),Nn=Ut([Vt,si,Yt,Kt,Qt],"svg");function yi(e){return e.join(" ").trim()}var Te={},un,ot;function xi(){if(ot)return un;ot=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,s=`
1
+ import{a1 as jt,j as C,i as Ae,b as bn,g as Ht,C as Nr,D as Dr,a2 as Fr,f as _r,P as Or,Q as Mr,s as Rr,a as tn,a3 as Br,v as we,r as jr,U as Hr,e as Xn,L as Ur,S as Vr}from"./index-Dj0i1-CA.js";import{M as qr,u as $r,L as Yr,C as Kr,a as rn}from"./context-BctCsyGb.js";import{T as Qr,a as ln,b as Wr,c as Xr,d as Gn,e as ge,f as Gr,g as Jr,h as Jn,i as Zn,j as Zr,k as et,l as nt}from"./SearchList-W_iT2G82.js";import ei from"./ModelLineage-DkIFAYo4.js";import{E as on}from"./file-CvJN3aZO.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./floating-ui.react-dom-CjE-JNW1.js";import"./editor-CcO28cqd.js";import"./project-BvSOI8MY.js";import"./help-B59vE3aE.js";import"./SourceList-DSLO6nVJ.js";import"./Input-B-oZ6fGO.js";import"./index-C-dJH7yZ.js";import"./popover-_Sf0yvOI.js";import"./ListboxShow-BE5-xevs.js";function ni(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const ti=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ri=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ii={};function tt(e,n){return(ii.jsx?ri:ti).test(e)}const li=/[ \t\n\f\r]/g;function oi(e){return typeof e=="object"?e.type==="text"?rt(e.value):!1:rt(e)}function rt(e){return e.replace(li,"")===""}class qe{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}qe.prototype.normal={};qe.prototype.property={};qe.prototype.space=void 0;function Ut(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new qe(t,r,n)}function wn(e){return e.toLowerCase()}class Z{constructor(n,t){this.attribute=t,this.property=n}}Z.prototype.attribute="";Z.prototype.booleanish=!1;Z.prototype.boolean=!1;Z.prototype.commaOrSpaceSeparated=!1;Z.prototype.commaSeparated=!1;Z.prototype.defined=!1;Z.prototype.mustUseProperty=!1;Z.prototype.number=!1;Z.prototype.overloadedBoolean=!1;Z.prototype.property="";Z.prototype.spaceSeparated=!1;Z.prototype.space=void 0;let ai=0;const F=Se(),Y=Se(),Sn=Se(),x=Se(),V=Se(),ve=Se(),ne=Se();function Se(){return 2**++ai}const Cn=Object.freeze(Object.defineProperty({__proto__:null,boolean:F,booleanish:Y,commaOrSpaceSeparated:ne,commaSeparated:ve,number:x,overloadedBoolean:Sn,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),an=Object.keys(Cn);class Ln extends Z{constructor(n,t,r,i){let l=-1;if(super(n,t),it(this,"space",i),typeof r=="number")for(;++l<an.length;){const o=an[l];it(this,an[l],(r&Cn[o])===Cn[o])}}}Ln.prototype.defined=!0;function it(e,n,t){t&&(e[n]=t)}function Le(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const l=new Ln(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),n[r]=l,t[wn(r)]=r,t[wn(l.attribute)]=r}return new qe(n,t,e.space)}const Vt=Le({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:x,ariaColIndex:x,ariaColSpan:x,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:V,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:x,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:x,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:V,ariaRowCount:x,ariaRowIndex:x,ariaRowSpan:x,ariaSelected:Y,ariaSetSize:x,ariaSort:null,ariaValueMax:x,ariaValueMin:x,ariaValueNow:x,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function qt(e,n){return n in e?e[n]:n}function $t(e,n){return qt(e,n.toLowerCase())}const ui=Le({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ve,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:F,allowPaymentRequest:F,allowUserMedia:F,alt:null,as:null,async:F,autoCapitalize:null,autoComplete:V,autoFocus:F,autoPlay:F,blocking:V,capture:null,charSet:null,checked:F,cite:null,className:V,cols:x,colSpan:null,content:null,contentEditable:Y,controls:F,controlsList:V,coords:x|ve,crossOrigin:null,data:null,dateTime:null,decoding:null,default:F,defer:F,dir:null,dirName:null,disabled:F,download:Sn,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:F,formTarget:null,headers:V,height:x,hidden:Sn,high:x,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:F,inputMode:null,integrity:null,is:null,isMap:F,itemId:null,itemProp:V,itemRef:V,itemScope:F,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:F,low:x,manifest:null,max:null,maxLength:x,media:null,method:null,min:null,minLength:x,multiple:F,muted:F,name:null,nonce:null,noModule:F,noValidate:F,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:F,optimum:x,pattern:null,ping:V,placeholder:null,playsInline:F,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:F,referrerPolicy:null,rel:V,required:F,reversed:F,rows:x,rowSpan:x,sandbox:V,scope:null,scoped:F,seamless:F,selected:F,shadowRootClonable:F,shadowRootDelegatesFocus:F,shadowRootMode:null,shape:null,size:x,sizes:null,slot:null,span:x,spellCheck:Y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:x,step:null,style:null,tabIndex:x,target:null,title:null,translate:null,type:null,typeMustMatch:F,useMap:null,value:Y,width:x,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:x,borderColor:null,bottomMargin:x,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:F,declare:F,event:null,face:null,frame:null,frameBorder:null,hSpace:x,leftMargin:x,link:null,longDesc:null,lowSrc:null,marginHeight:x,marginWidth:x,noResize:F,noHref:F,noShade:F,noWrap:F,object:null,profile:null,prompt:null,rev:null,rightMargin:x,rules:null,scheme:null,scrolling:Y,standby:null,summary:null,text:null,topMargin:x,valueType:null,version:null,vAlign:null,vLink:null,vSpace:x,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:F,disableRemotePlayback:F,prefix:null,property:null,results:x,security:null,unselectable:null},space:"html",transform:$t}),si=Le({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ne,accentHeight:x,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:x,amplitude:x,arabicForm:null,ascent:x,attributeName:null,attributeType:null,azimuth:x,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:x,by:null,calcMode:null,capHeight:x,className:V,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:x,diffuseConstant:x,direction:null,display:null,dur:null,divisor:x,dominantBaseline:null,download:F,dx:null,dy:null,edgeMode:null,editable:null,elevation:x,enableBackground:null,end:null,event:null,exponent:x,externalResourcesRequired:null,fill:null,fillOpacity:x,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ve,g2:ve,glyphName:ve,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:x,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:x,horizOriginX:x,horizOriginY:x,id:null,ideographic:x,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:x,k:x,k1:x,k2:x,k3:x,k4:x,kernelMatrix:ne,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:x,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:x,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:x,overlineThickness:x,paintOrder:null,panose1:null,path:null,pathLength:x,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:x,pointsAtY:x,pointsAtZ:x,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ne,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ne,rev:ne,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ne,requiredFeatures:ne,requiredFonts:ne,requiredFormats:ne,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:x,specularExponent:x,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:x,strikethroughThickness:x,string:null,stroke:null,strokeDashArray:ne,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:x,strokeOpacity:x,strokeWidth:null,style:null,surfaceScale:x,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ne,tabIndex:x,tableValues:null,target:null,targetX:x,targetY:x,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ne,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:x,underlineThickness:x,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:x,values:null,vAlphabetic:x,vMathematical:x,vectorEffect:null,vHanging:x,vIdeographic:x,version:null,vertAdvY:x,vertOriginX:x,vertOriginY:x,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:x,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qt}),Yt=Le({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Kt=Le({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$t}),Qt=Le({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),ci={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},pi=/[A-Z]/g,lt=/-[a-z]/g,fi=/^data[-\w.:]+$/i;function hi(e,n){const t=wn(n);let r=n,i=Z;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&fi.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(lt,di);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!lt.test(l)){let o=l.replace(pi,mi);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=Ln}return new i(r,n)}function mi(e){return"-"+e.toLowerCase()}function di(e){return e.charAt(1).toUpperCase()}const gi=Ut([Vt,ui,Yt,Kt,Qt],"html"),Nn=Ut([Vt,si,Yt,Kt,Qt],"svg");function yi(e){return e.join(" ").trim()}var Te={},un,ot;function xi(){if(ot)return un;ot=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,s=`
2
2
  `,u="/",c="*",f="",h="comment",p="declaration";un=function(b,z){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];z=z||{};var k=1,v=1;function E(P){var I=P.match(n);I&&(k+=I.length);var N=P.lastIndexOf(s);v=~N?P.length-N:v+P.length}function j(){var P={line:k,column:v};return function(I){return I.position=new U(P),$(),I}}function U(P){this.start=P,this.end={line:k,column:v},this.source=z.source}U.prototype.content=b;function y(P){var I=new Error(z.source+":"+k+":"+v+": "+P);if(I.reason=P,I.filename=z.source,I.line=k,I.column=v,I.source=b,!z.silent)throw I}function O(P){var I=P.exec(b);if(I){var N=I[0];return E(N),b=b.slice(N.length),I}}function $(){O(t)}function R(P){var I;for(P=P||[];I=B();)I!==!1&&P.push(I);return P}function B(){var P=j();if(!(u!=b.charAt(0)||c!=b.charAt(1))){for(var I=2;f!=b.charAt(I)&&(c!=b.charAt(I)||u!=b.charAt(I+1));)++I;if(I+=2,f===b.charAt(I-1))return y("End of comment missing");var N=b.slice(2,I-2);return v+=2,E(N),b=b.slice(I),v+=2,P({type:h,comment:N})}}function A(){var P=j(),I=O(r);if(I){if(B(),!O(i))return y("property missing ':'");var N=O(l),K=P({type:p,property:S(I[0].replace(e,f)),value:N?S(N[0].replace(e,f)):f});return O(o),K}}function T(){var P=[];R(P);for(var I;I=A();)I!==!1&&(P.push(I),R(P));return P}return $(),T()};function S(b){return b?b.replace(a,f):f}return un}var at;function ki(){if(at)return Te;at=1;var e=Te&&Te.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Te,"__esModule",{value:!0}),Te.default=t;var n=e(xi());function t(r,i){var l=null;if(!r||typeof r!="string")return l;var o=(0,n.default)(r),a=typeof i=="function";return o.forEach(function(s){if(s.type==="declaration"){var u=s.property,c=s.value;a?i(u,c,s):c&&(l=l||{},l[u]=c)}}),l}return Te}var Oe={},ut;function bi(){if(ut)return Oe;ut=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(u){return!u||t.test(u)||e.test(u)},o=function(u,c){return c.toUpperCase()},a=function(u,c){return"".concat(c,"-")},s=function(u,c){return c===void 0&&(c={}),l(u)?u:(u=u.toLowerCase(),c.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(n,o))};return Oe.camelCase=s,Oe}var Me,st;function wi(){if(st)return Me;st=1;var e=Me&&Me.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(ki()),t=bi();function r(i,l){var o={};return!i||typeof i!="string"||(0,n.default)(i,function(a,s){a&&s&&(o[(0,t.camelCase)(a,l)]=s)}),o}return r.default=r,Me=r,Me}var Si=wi();const Ci=jt(Si),Wt=Xt("end"),Dn=Xt("start");function Xt(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ei(e){const n=Dn(e),t=Wt(e);if(n&&t)return{start:n,end:t}}function je(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ct(e.position):"start"in e||"end"in e?ct(e):"line"in e||"column"in e?En(e):""}function En(e){return pt(e&&e.line)+":"+pt(e&&e.column)}function ct(e){return En(e&&e.start)+"-"+En(e&&e.end)}function pt(e){return e&&typeof e=="number"?e:1}class X extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},o=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof n=="string"?i=n:!l.cause&&n&&(o=!0,i=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?l.ruleId=r:(l.source=r.slice(0,s),l.ruleId=r.slice(s+1))}if(!l.place&&l.ancestors&&l.ancestors){const s=l.ancestors[l.ancestors.length-1];s&&(l.place=s.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=je(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual,this.expected,this.note,this.url}}X.prototype.file="";X.prototype.name="";X.prototype.reason="";X.prototype.message="";X.prototype.stack="";X.prototype.column=void 0;X.prototype.line=void 0;X.prototype.ancestors=void 0;X.prototype.cause=void 0;X.prototype.fatal=void 0;X.prototype.place=void 0;X.prototype.ruleId=void 0;X.prototype.source=void 0;const Fn={}.hasOwnProperty,Ii=new Map,Ti=/[A-Z]/g,Pi=new Set(["table","tbody","thead","tfoot","tr"]),Ai=new Set(["td","th"]),Gt="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vi(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Mi(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Oi(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Nn:gi,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=Jt(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Jt(e,n,t){if(n.type==="element")return zi(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Li(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Di(e,n,t);if(n.type==="mdxjsEsm")return Ni(e,n);if(n.type==="root")return Fi(e,n,t);if(n.type==="text")return _i(e,n)}function zi(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Nn,e.schema=i),e.ancestors.push(n);const l=er(e,n.tagName,!1),o=Ri(e,n);let a=On(e,n);return Pi.has(n.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!oi(s):!0})),Zt(e,o,l,n),_n(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Li(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ve(e,n.position)}function Ni(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Ve(e,n.position)}function Di(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Nn,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:er(e,n.name,!0),o=Bi(e,n),a=On(e,n);return Zt(e,o,l,n),_n(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Fi(e,n,t){const r={};return _n(r,On(e,n)),e.create(n,e.Fragment,r,t)}function _i(e,n){return n.value}function Zt(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function _n(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Oi(e,n,t){return r;function r(i,l,o,a){const u=Array.isArray(o.children)?t:n;return a?u(l,o,a):u(l,o)}}function Mi(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),s=Dn(r);return n(i,l,o,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Ri(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Fn.call(n.properties,i)){const l=ji(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Ai.has(n.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Bi(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Ve(e,n.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else Ve(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function On(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Ii;for(;++r<n.children.length;){const l=n.children[r];let o;if(e.passKeys){const s=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(s){const u=i.get(s)||0;o=s+"-"+u,i.set(s,u+1)}}const a=Jt(e,l,o);a!==void 0&&t.push(a)}return t}function ji(e,n,t){const r=hi(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?ni(t):yi(t)),r.property==="style"){let i=typeof t=="object"?t:Hi(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Ui(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?ci[r.property]||r.property:r.attribute,t]}}function Hi(e,n){try{return Ci(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new X("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Gt+"#cannot-parse-style-attribute",i}}function er(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let l=-1,o;for(;++l<i.length;){const a=tt(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=o}else r=tt(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Fn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ve(e)}function Ve(e,n){const t=new X("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=Gt+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Ui(e){const n={};let t;for(t in e)Fn.call(e,t)&&(n[Vi(t)]=e[t]);return n}function Vi(e){let n=e.replace(Ti,qi);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function qi(e){return"-"+e.toLowerCase()}const sn={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},$i={};function Yi(e,n){const t=$i,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return nr(e,r,i)}function nr(e,n,t){if(Ki(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ft(e.children,n,t)}return Array.isArray(e)?ft(e,n,t):""}function ft(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=nr(e[i],n,t);return r.join("")}function Ki(e){return!!(e&&typeof e=="object")}const ht=document.createElement("i");function Mn(e){const n="&"+e+";";ht.innerHTML=n;const t=ht.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function ce(e,n,t,r){const i=e.length;let l=0,o;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l<r.length;)o=r.slice(l,l+1e4),o.unshift(n,0),e.splice(...o),l+=1e4,n+=1e4}function re(e,n){return e.length>0?(ce(e,e.length,0,n),e):n}const mt={}.hasOwnProperty;function Qi(e){const n={};let t=-1;for(;++t<e.length;)Wi(n,e[t]);return n}function Wi(e,n){let t;for(t in n){const i=(mt.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let o;if(l)for(o in l){mt.call(i,o)||(i[o]=[]);const a=l[o];Xi(i[o],Array.isArray(a)?a:a?[a]:[])}}}function Xi(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);ce(e,0,0,r)}function tr(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function ze(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const se=xe(/[A-Za-z]/),te=xe(/[\dA-Za-z]/),Gi=xe(/[#-'*+\--9=?A-Z^-~]/);function In(e){return e!==null&&(e<32||e===127)}const Tn=xe(/\d/),Ji=xe(/[\dA-Fa-f]/),Zi=xe(/[!-/:-@[-`{-~]/);function L(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function M(e){return e===-2||e===-1||e===32}const el=xe(new RegExp("\\p{P}|\\p{S}","u")),nl=xe(/\s/);function xe(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ne(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let o="";if(l===37&&te(e.charCodeAt(t+1))&&te(e.charCodeAt(t+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function q(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(s){return M(s)?(e.enter(t),a(s)):n(s)}function a(s){return M(s)&&l++<i?(e.consume(s),a):(e.exit(t),n(s))}}const tl={tokenize:rl};function rl(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),q(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const s=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=s),t=s,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return L(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}const il={tokenize:ll},dt={tokenize:ol};function ll(e){const n=this,t=[];let r=0,i,l,o;return a;function a(E){if(r<t.length){const j=t[r];return n.containerState=j[1],e.attempt(j[0].continuation,s,u)(E)}return u(E)}function s(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&v();const j=n.events.length;let U=j,y;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){y=n.events[U][1].end;break}k(r);let O=j;for(;O<n.events.length;)n.events[O][1].end={...y},O++;return ce(n.events,U+1,0,n.events.slice(j)),n.events.length=O,u(E)}return a(E)}function u(E){if(r===t.length){if(!i)return h(E);if(i.currentConstruct&&i.currentConstruct.concrete)return S(E);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(dt,c,f)(E)}function c(E){return i&&v(),k(r),h(E)}function f(E){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,S(E)}function h(E){return n.containerState={},e.attempt(dt,p,S)(E)}function p(E){return r++,t.push([n.currentConstruct,n.containerState]),h(E)}function S(E){if(E===null){i&&v(),k(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),b(E)}function b(E){if(E===null){z(e.exit("chunkFlow"),!0),k(0),e.consume(E);return}return L(E)?(e.consume(E),z(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(E),b)}function z(E,j){const U=n.sliceStream(E);if(j&&U.push(null),E.previous=l,l&&(l.next=E),l=E,i.defineSkip(E.start),i.write(U),n.parser.lazy[E.start.line]){let y=i.events.length;for(;y--;)if(i.events[y][1].start.offset<o&&(!i.events[y][1].end||i.events[y][1].end.offset>o))return;const O=n.events.length;let $=O,R,B;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){if(R){B=n.events[$][1].end;break}R=!0}for(k(r),y=O;y<n.events.length;)n.events[y][1].end={...B},y++;ce(n.events,$+1,0,n.events.slice(O)),n.events.length=y}}function k(E){let j=t.length;for(;j-- >E;){const U=t[j];n.containerState=U[1],U[0].exit.call(n,e)}t.length=E}function v(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function ol(e,n,t){return q(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function gt(e){if(e===null||J(e)||nl(e))return 1;if(el(e))return 2}function Rn(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(n=l(n,t),r.push(l))}return n}const Pn={name:"attention",resolveAll:al,tokenize:ul};function al(e,n){let t=-1,r,i,l,o,a,s,u,c;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;s=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[t][1].start};yt(f,-s),yt(h,s),o={type:s>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:h},l={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:s>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=re(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=re(u,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),u=re(u,Rn(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=re(u,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(c=2,u=re(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):c=0,ce(e,r-1,t-r+3,u),t=r+u.length-c-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function ul(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=gt(r);let l;return o;function o(s){return l=s,e.enter("attentionSequence"),a(s)}function a(s){if(s===l)return e.consume(s),a;const u=e.exit("attentionSequence"),c=gt(s),f=!c||c===2&&i||t.includes(s),h=!i||i===2&&c||t.includes(r);return u._open=!!(l===42?f:f&&(i||!h)),u._close=!!(l===42?h:h&&(c||!f)),n(s)}}function yt(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const sl={name:"autolink",tokenize:cl};function cl(e,n,t){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(p){return se(p)?(e.consume(p),o):p===64?t(p):u(p)}function o(p){return p===43||p===45||p===46||te(p)?(r=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,s):(p===43||p===45||p===46||te(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function s(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):p===null||p===32||p===60||In(p)?t(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),c):Gi(p)?(e.consume(p),u):t(p)}function c(p){return te(p)?f(p):t(p)}function f(p){return p===46?(e.consume(p),r=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):h(p)}function h(p){if((p===45||te(p))&&r++<63){const S=p===45?h:f;return e.consume(p),S}return t(p)}}const Ze={partial:!0,tokenize:pl};function pl(e,n,t){return r;function r(l){return M(l)?q(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||L(l)?n(l):t(l)}}const rr={continuation:{tokenize:hl},exit:ml,name:"blockQuote",tokenize:fl};function fl(e,n,t){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return t(o)}function l(o){return M(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function hl(e,n,t){const r=this;return i;function i(o){return M(o)?q(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(rr,n,t)(o)}}function ml(e){e.exit("blockQuote")}const ir={name:"characterEscape",tokenize:dl};function dl(e,n,t){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return Zi(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const lr={name:"characterReference",tokenize:gl};function gl(e,n,t){const r=this;let i=0,l,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),s}function s(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),l=31,o=te,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=Ji,c):(e.enter("characterReferenceValue"),l=7,o=Tn,c(f))}function c(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return o===te&&!Mn(r.sliceSerialize(h))?t(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return o(f)&&i++<l?(e.consume(f),c):t(f)}}const xt={partial:!0,tokenize:xl},kt={concrete:!0,name:"codeFenced",tokenize:yl};function yl(e,n,t){const r=this,i={partial:!0,tokenize:U};let l=0,o=0,a;return s;function s(y){return u(y)}function u(y){const O=r.events[r.events.length-1];return l=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,a=y,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(y)}function c(y){return y===a?(o++,e.consume(y),c):o<3?t(y):(e.exit("codeFencedFenceSequence"),M(y)?q(e,f,"whitespace")(y):f(y))}function f(y){return y===null||L(y)?(e.exit("codeFencedFence"),r.interrupt?n(y):e.check(xt,b,j)(y)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||L(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(y)):M(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),q(e,p,"whitespace")(y)):y===96&&y===a?t(y):(e.consume(y),h)}function p(y){return y===null||L(y)?f(y):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(y))}function S(y){return y===null||L(y)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(y)):y===96&&y===a?t(y):(e.consume(y),S)}function b(y){return e.attempt(i,j,z)(y)}function z(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),k}function k(y){return l>0&&M(y)?q(e,v,"linePrefix",l+1)(y):v(y)}function v(y){return y===null||L(y)?e.check(xt,b,j)(y):(e.enter("codeFlowValue"),E(y))}function E(y){return y===null||L(y)?(e.exit("codeFlowValue"),v(y)):(e.consume(y),E)}function j(y){return e.exit("codeFenced"),n(y)}function U(y,O,$){let R=0;return B;function B(N){return y.enter("lineEnding"),y.consume(N),y.exit("lineEnding"),A}function A(N){return y.enter("codeFencedFence"),M(N)?q(y,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):T(N)}function T(N){return N===a?(y.enter("codeFencedFenceSequence"),P(N)):$(N)}function P(N){return N===a?(R++,y.consume(N),P):R>=o?(y.exit("codeFencedFenceSequence"),M(N)?q(y,I,"whitespace")(N):I(N)):$(N)}function I(N){return N===null||L(N)?(y.exit("codeFencedFence"),O(N)):$(N)}}}function xl(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const cn={name:"codeIndented",tokenize:bl},kl={partial:!0,tokenize:wl};function bl(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),q(e,l,"linePrefix",5)(u)}function l(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):t(u)}function o(u){return u===null?s(u):L(u)?e.attempt(kl,o,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||L(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),n(u)}}function wl(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):L(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):q(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):L(o)?i(o):t(o)}}const Sl={name:"codeText",previous:El,resolve:Cl,tokenize:Il};function Cl(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function El(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Il(e,n,t){let r=0,i,l;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),s(f))}function s(f){return f===null?t(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),s):f===96?(l=e.enter("codeTextSequence"),i=0,c(f)):L(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),s):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||L(f)?(e.exit("codeTextData"),s(f)):(e.consume(f),u)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(f)):(l.type="codeTextData",u(f))}}class Tl{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Re(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Re(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Re(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);Re(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Re(this.left,t.reverse())}}}function Re(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function or(e){const n={};let t=-1,r,i,l,o,a,s,u;const c=new Tl(e);for(;++t<c.length;){for(;t in n;)t=n[t];if(r=c.get(t),t&&r[1].type==="chunkFlow"&&c.get(t-1)[1].type==="listItemPrefix"&&(s=r[1]._tokenizer.events,l=0,l<s.length&&s[l][1].type==="lineEndingBlank"&&(l+=2),l<s.length&&s[l][1].type==="content"))for(;++l<s.length&&s[l][1].type!=="content";)s[l][1].type==="chunkText"&&(s[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Pl(c,t)),t=n[t],u=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(o=c.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,t),a.unshift(r),c.splice(i,t-i+1,a))}}return ce(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function Pl(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const l=[];let o=t._tokenizer;o||(o=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,s=[],u={};let c,f,h=-1,p=t,S=0,b=0;const z=[b];for(;p;){for(;e.get(++i)[1]!==p;);l.push(i),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=t;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(b=h+1,z.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):z.pop(),h=z.length;h--;){const k=a.slice(z[h],z[h+1]),v=l.pop();s.push([v,v+k.length-1]),e.splice(v,2,k)}for(s.reverse(),h=-1;++h<s.length;)u[S+s[h][0]]=S+s[h][1],S+=s[h][1]-s[h][0]-1;return u}const Al={resolve:zl,tokenize:Ll},vl={partial:!0,tokenize:Nl};function zl(e){return or(e),e}function Ll(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):L(a)?e.check(vl,o,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function o(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Nl(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),q(e,l,"linePrefix")}function l(o){if(o===null||L(o))return t(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function ar(e,n,t,r,i,l,o,a,s){const u=s||Number.POSITIVE_INFINITY;let c=0;return f;function f(k){return k===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(k),e.exit(l),h):k===null||k===32||k===41||In(k)?t(k):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(k))}function h(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===62?(e.exit("chunkString"),e.exit(a),h(k)):k===null||k===60||L(k)?t(k):(e.consume(k),k===92?S:p)}function S(k){return k===60||k===62||k===92?(e.consume(k),p):p(k)}function b(k){return!c&&(k===null||k===41||J(k))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(k)):c<u&&k===40?(e.consume(k),c++,b):k===41?(e.consume(k),c--,b):k===null||k===32||k===40||In(k)?t(k):(e.consume(k),k===92?z:b)}function z(k){return k===40||k===41||k===92?(e.consume(k),b):b(k)}}function ur(e,n,t,r,i,l){const o=this;let a=0,s;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(l),c}function c(p){return a>999||p===null||p===91||p===93&&!s||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(p):p===93?(e.exit(l),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):L(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||L(p)||a++>999?(e.exit("chunkString"),c(p)):(e.consume(p),s||(s=!M(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function sr(e,n,t,r,i,l){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,s):t(h)}function s(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):(e.enter(l),u(h))}function u(h){return h===o?(e.exit(l),s(o)):h===null?t(h):L(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),q(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===o||h===null||L(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:c)}function f(h){return h===o||h===92?(e.consume(h),c):c(h)}}function He(e,n){let t;return r;function r(i){return L(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):M(i)?q(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Dl={name:"definition",tokenize:_l},Fl={partial:!0,tokenize:Ol};function _l(e,n,t){const r=this;let i;return l;function l(p){return e.enter("definition"),o(p)}function o(p){return ur.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=ze(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),s):t(p)}function s(p){return J(p)?He(e,u)(p):u(p)}function u(p){return ar(e,c,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(Fl,f,f)(p)}function f(p){return M(p)?q(e,h,"whitespace")(p):h(p)}function h(p){return p===null||L(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function Ol(e,n,t){return r;function r(a){return J(a)?He(e,i)(a):t(a)}function i(a){return sr(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return M(a)?q(e,o,"whitespace")(a):o(a)}function o(a){return a===null||L(a)?n(a):t(a)}}const Ml={name:"hardBreakEscape",tokenize:Rl};function Rl(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return L(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const Bl={name:"headingAtx",resolve:jl,tokenize:Hl};function jl(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ce(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function Hl(e,n,t){let r=0;return i;function i(c){return e.enter("atxHeading"),l(c)}function l(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||J(c)?(e.exit("atxHeadingSequence"),a(c)):t(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||L(c)?(e.exit("atxHeading"),n(c)):M(c)?q(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function s(c){return c===35?(e.consume(c),s):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||J(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}const Ul=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],bt=["pre","script","style","textarea"],Vl={concrete:!0,name:"htmlFlow",resolveTo:Yl,tokenize:Kl},ql={partial:!0,tokenize:Wl},$l={partial:!0,tokenize:Ql};function Yl(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Kl(e,n,t){const r=this;let i,l,o,a,s;return u;function u(d){return c(d)}function c(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),f}function f(d){return d===33?(e.consume(d),h):d===47?(e.consume(d),l=!0,b):d===63?(e.consume(d),i=3,r.interrupt?n:m):se(d)?(e.consume(d),o=String.fromCharCode(d),z):t(d)}function h(d){return d===45?(e.consume(d),i=2,p):d===91?(e.consume(d),i=5,a=0,S):se(d)?(e.consume(d),i=4,r.interrupt?n:m):t(d)}function p(d){return d===45?(e.consume(d),r.interrupt?n:m):t(d)}function S(d){const oe="CDATA[";return d===oe.charCodeAt(a++)?(e.consume(d),a===oe.length?r.interrupt?n:T:S):t(d)}function b(d){return se(d)?(e.consume(d),o=String.fromCharCode(d),z):t(d)}function z(d){if(d===null||d===47||d===62||J(d)){const oe=d===47,ke=o.toLowerCase();return!oe&&!l&&bt.includes(ke)?(i=1,r.interrupt?n(d):T(d)):Ul.includes(o.toLowerCase())?(i=6,oe?(e.consume(d),k):r.interrupt?n(d):T(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):l?v(d):E(d))}return d===45||te(d)?(e.consume(d),o+=String.fromCharCode(d),z):t(d)}function k(d){return d===62?(e.consume(d),r.interrupt?n:T):t(d)}function v(d){return M(d)?(e.consume(d),v):B(d)}function E(d){return d===47?(e.consume(d),B):d===58||d===95||se(d)?(e.consume(d),j):M(d)?(e.consume(d),E):B(d)}function j(d){return d===45||d===46||d===58||d===95||te(d)?(e.consume(d),j):U(d)}function U(d){return d===61?(e.consume(d),y):M(d)?(e.consume(d),U):E(d)}function y(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),s=d,O):M(d)?(e.consume(d),y):$(d)}function O(d){return d===s?(e.consume(d),s=null,R):d===null||L(d)?t(d):(e.consume(d),O)}function $(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||J(d)?U(d):(e.consume(d),$)}function R(d){return d===47||d===62||M(d)?E(d):t(d)}function B(d){return d===62?(e.consume(d),A):t(d)}function A(d){return d===null||L(d)?T(d):M(d)?(e.consume(d),A):t(d)}function T(d){return d===45&&i===2?(e.consume(d),K):d===60&&i===1?(e.consume(d),Q):d===62&&i===4?(e.consume(d),le):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),pe):L(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ql,fe,P)(d)):d===null||L(d)?(e.exit("htmlFlowData"),P(d)):(e.consume(d),T)}function P(d){return e.check($l,I,fe)(d)}function I(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),N}function N(d){return d===null||L(d)?P(d):(e.enter("htmlFlowData"),T(d))}function K(d){return d===45?(e.consume(d),m):T(d)}function Q(d){return d===47?(e.consume(d),o="",ie):T(d)}function ie(d){if(d===62){const oe=o.toLowerCase();return bt.includes(oe)?(e.consume(d),le):T(d)}return se(d)&&o.length<8?(e.consume(d),o+=String.fromCharCode(d),ie):T(d)}function pe(d){return d===93?(e.consume(d),m):T(d)}function m(d){return d===62?(e.consume(d),le):d===45&&i===2?(e.consume(d),m):T(d)}function le(d){return d===null||L(d)?(e.exit("htmlFlowData"),fe(d)):(e.consume(d),le)}function fe(d){return e.exit("htmlFlow"),n(d)}}function Ql(e,n,t){const r=this;return i;function i(o){return L(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function Wl(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ze,n,t)}}const Xl={name:"htmlText",tokenize:Gl};function Gl(e,n,t){const r=this;let i,l,o;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),U):m===63?(e.consume(m),E):se(m)?(e.consume(m),$):t(m)}function u(m){return m===45?(e.consume(m),c):m===91?(e.consume(m),l=0,S):se(m)?(e.consume(m),v):t(m)}function c(m){return m===45?(e.consume(m),p):t(m)}function f(m){return m===null?t(m):m===45?(e.consume(m),h):L(m)?(o=f,Q(m)):(e.consume(m),f)}function h(m){return m===45?(e.consume(m),p):f(m)}function p(m){return m===62?K(m):m===45?h(m):f(m)}function S(m){const le="CDATA[";return m===le.charCodeAt(l++)?(e.consume(m),l===le.length?b:S):t(m)}function b(m){return m===null?t(m):m===93?(e.consume(m),z):L(m)?(o=b,Q(m)):(e.consume(m),b)}function z(m){return m===93?(e.consume(m),k):b(m)}function k(m){return m===62?K(m):m===93?(e.consume(m),k):b(m)}function v(m){return m===null||m===62?K(m):L(m)?(o=v,Q(m)):(e.consume(m),v)}function E(m){return m===null?t(m):m===63?(e.consume(m),j):L(m)?(o=E,Q(m)):(e.consume(m),E)}function j(m){return m===62?K(m):E(m)}function U(m){return se(m)?(e.consume(m),y):t(m)}function y(m){return m===45||te(m)?(e.consume(m),y):O(m)}function O(m){return L(m)?(o=O,Q(m)):M(m)?(e.consume(m),O):K(m)}function $(m){return m===45||te(m)?(e.consume(m),$):m===47||m===62||J(m)?R(m):t(m)}function R(m){return m===47?(e.consume(m),K):m===58||m===95||se(m)?(e.consume(m),B):L(m)?(o=R,Q(m)):M(m)?(e.consume(m),R):K(m)}function B(m){return m===45||m===46||m===58||m===95||te(m)?(e.consume(m),B):A(m)}function A(m){return m===61?(e.consume(m),T):L(m)?(o=A,Q(m)):M(m)?(e.consume(m),A):R(m)}function T(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,P):L(m)?(o=T,Q(m)):M(m)?(e.consume(m),T):(e.consume(m),I)}function P(m){return m===i?(e.consume(m),i=void 0,N):m===null?t(m):L(m)?(o=P,Q(m)):(e.consume(m),P)}function I(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||J(m)?R(m):(e.consume(m),I)}function N(m){return m===47||m===62||J(m)?R(m):t(m)}function K(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function Q(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ie}function ie(m){return M(m)?q(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),o(m)}}const Bn={name:"labelEnd",resolveAll:no,resolveTo:to,tokenize:ro},Jl={tokenize:io},Zl={tokenize:lo},eo={tokenize:oo};function no(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&ce(e,0,e.length,t),e}function to(e,n){let t=e.length,r=0,i,l,o,a;for(;t--;)if(i=e[t][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=t);const s={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",s,n],["enter",u,n]],a=re(a,e.slice(l+1,l+r+3)),a=re(a,[["enter",c,n]]),a=re(a,Rn(n.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),n)),a=re(a,[["exit",c,n],e[o-2],e[o-1],["exit",u,n]]),a=re(a,e.slice(o+1)),a=re(a,[["exit",s,n]]),ce(e,l,e.length,a),e}function ro(e,n,t){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(h){return l?l._inactive?f(h):(o=r.parser.defined.includes(ze(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),s):t(h)}function s(h){return h===40?e.attempt(Jl,c,o?c:f)(h):h===91?e.attempt(Zl,c,o?u:f)(h):o?c(h):f(h)}function u(h){return e.attempt(eo,c,f)(h)}function c(h){return n(h)}function f(h){return l._balanced=!0,t(h)}}function io(e,n,t){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return J(f)?He(e,l)(f):l(f)}function l(f){return f===41?c(f):ar(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return J(f)?He(e,s)(f):c(f)}function a(f){return t(f)}function s(f){return f===34||f===39||f===40?sr(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return J(f)?He(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),n):t(f)}}function lo(e,n,t){const r=this;return i;function i(a){return ur.call(r,e,l,o,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(ze(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function o(a){return t(a)}}function oo(e,n,t){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),n):t(l)}}const ao={name:"labelStartImage",resolveAll:Bn.resolveAll,tokenize:uo};function uo(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):t(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const so={name:"labelStartLink",resolveAll:Bn.resolveAll,tokenize:co};function co(e,n,t){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):n(o)}}const pn={name:"lineEnding",tokenize:po};function po(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),q(e,n,"linePrefix")}}const Xe={name:"thematicBreak",tokenize:fo};function fo(e,n,t){let r=0,i;return l;function l(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),s(u)):r>=3&&(u===null||L(u))?(e.exit("thematicBreak"),n(u)):t(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),M(u)?q(e,a,"whitespace")(u):a(u))}}const G={continuation:{tokenize:yo},exit:ko,name:"list",tokenize:go},ho={partial:!0,tokenize:bo},mo={partial:!0,tokenize:xo};function go(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const S=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Tn(p)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Xe,t,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(p)}return t(p)}function s(p){return Tn(p)&&++o<10?(e.consume(p),s):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):t(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ze,r.interrupt?t:c,e.attempt(ho,h,f))}function c(p){return r.containerState.initialBlankLine=!0,l++,h(p)}function f(p){return M(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):t(p)}function h(p){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function yo(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ze,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,q(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!M(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(mo,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,q(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function xo(e,n,t){const r=this;return q(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function ko(e){e.exit(this.containerState.type)}function bo(e,n,t){const r=this;return q(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!M(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const wt={name:"setextUnderline",resolveTo:wo,tokenize:So};function wo(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function So(e,n,t){const r=this;let i;return l;function l(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,o(u)):t(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),M(u)?q(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||L(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const Co={tokenize:Eo};function Eo(e){const n=this,t=e.attempt(Ze,r,e.attempt(this.parser.constructs.flowInitial,i,q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Al,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Io={resolveAll:pr()},To=cr("string"),Po=cr("text");function cr(e){return{resolveAll:pr(e==="text"?Ao:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(c){return u(c)?l(c):a(c)}function a(c){if(c===null){t.consume(c);return}return t.enter("data"),t.consume(c),s}function s(c){return u(c)?(t.exit("data"),l(c)):(t.consume(c),s)}function u(c){if(c===null)return!0;const f=i[c];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function pr(e){return n;function n(t,r){let i=-1,l;for(;++i<=t.length;)l===void 0?t[i]&&t[i][1].type==="data"&&(l=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==l+2&&(t[l][1].end=t[i-1][1].end,t.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(t,r):t}}function Ao(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let l=i.length,o=-1,a=0,s;for(;l--;){const u=i[l];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)s=!0,a++;else if(u!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const u={type:t===e.length||s||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(t,0,["enter",u,n],["exit",u,n]),t+=2)}t++}return e}const vo={42:G,43:G,45:G,48:G,49:G,50:G,51:G,52:G,53:G,54:G,55:G,56:G,57:G,62:rr},zo={91:Dl},Lo={[-2]:cn,[-1]:cn,32:cn},No={35:Bl,42:Xe,45:[wt,Xe],60:Vl,61:wt,95:Xe,96:kt,126:kt},Do={38:lr,92:ir},Fo={[-5]:pn,[-4]:pn,[-3]:pn,33:ao,38:lr,42:Pn,60:[sl,Xl],91:so,92:[Ml,ir],93:Bn,95:Pn,96:Sl},_o={null:[Pn,Io]},Oo={null:[42,95]},Mo={null:[]},Ro=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Oo,contentInitial:zo,disable:Mo,document:vo,flow:No,flowInitial:Lo,insideSpan:_o,string:Do,text:Fo},Symbol.toStringTag,{value:"Module"}));function Bo(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},l=[];let o=[],a=[];const s={attempt:O(U),check:O(y),consume:v,enter:E,exit:j,interrupt:O(y,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:S,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let c=n.tokenize.call(u,s);return n.resolveAll&&l.push(n),u;function f(A){return o=re(o,A),z(),o[o.length-1]!==null?[]:($(n,0),u.events=Rn(l,u.events,u),u.events)}function h(A,T){return Ho(p(A),T)}function p(A){return jo(o,A)}function S(){const{_bufferIndex:A,_index:T,line:P,column:I,offset:N}=r;return{_bufferIndex:A,_index:T,line:P,column:I,offset:N}}function b(A){i[A.line]=A.column,B()}function z(){let A;for(;r._index<o.length;){const T=o[r._index];if(typeof T=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<T.length;)k(T.charCodeAt(r._bufferIndex));else k(T)}}function k(A){c=c(A)}function v(A){L(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,B()):A!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=A}function E(A,T){const P=T||{};return P.type=A,P.start=S(),u.events.push(["enter",P,u]),a.push(P),P}function j(A){const T=a.pop();return T.end=S(),u.events.push(["exit",T,u]),T}function U(A,T){$(A,T.from)}function y(A,T){T.restore()}function O(A,T){return P;function P(I,N,K){let Q,ie,pe,m;return Array.isArray(I)?fe(I):"tokenize"in I?fe([I]):le(I);function le(W){return De;function De(de){const Ce=de!==null&&W[de],Ee=de!==null&&W.null,Ye=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return fe(Ye)(de)}}function fe(W){return Q=W,ie=0,W.length===0?K:d(W[ie])}function d(W){return De;function De(de){return m=R(),pe=W,W.partial||(u.currentConstruct=W),W.name&&u.parser.constructs.disable.null.includes(W.name)?ke():W.tokenize.call(T?Object.assign(Object.create(u),T):u,s,oe,ke)(de)}}function oe(W){return A(pe,m),N}function ke(W){return m.restore(),++ie<Q.length?d(Q[ie]):K}}}function $(A,T){A.resolveAll&&!l.includes(A)&&l.push(A),A.resolve&&ce(u.events,T,u.events.length-T,A.resolve(u.events.slice(T),u)),A.resolveTo&&(u.events=A.resolveTo(u.events,u))}function R(){const A=S(),T=u.previous,P=u.currentConstruct,I=u.events.length,N=Array.from(a);return{from:I,restore:K};function K(){r=A,u.previous=T,u.currentConstruct=P,u.events.length=I,a=N,B()}}function B(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function jo(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,l=n.end._bufferIndex;let o;if(t===i)o=[e[t].slice(r,l)];else{if(o=e.slice(t,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function Ho(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const l=e[t];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
3
3
  `;break}case-3:{o=`\r
4
4
  `;break}case-2:{o=n?" ":" ";break}case-1:{if(!n&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function Uo(e){const r={constructs:Qi([Ro,...(e||{}).extensions||[]]),content:i(tl),defined:[],document:i(il),flow:i(Co),lazy:{},string:i(To),text:i(Po)};return r;function i(l){return o;function o(a){return Bo(r,l,a)}}}function Vo(e){for(;!or(e););return e}const St=/[\0\t\n\r]/g;function qo(){let e=1,n="",t=!0,r;return i;function i(l,o,a){const s=[];let u,c,f,h,p;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),f=0,n="",t&&(l.charCodeAt(0)===65279&&f++,t=void 0);f<l.length;){if(St.lastIndex=f,u=St.exec(l),h=u&&u.index!==void 0?u.index:l.length,p=l.charCodeAt(h),!u){n=l.slice(f);break}if(p===10&&f===h&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),f<h&&(s.push(l.slice(f,h)),e+=h-f),p){case 0:{s.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,s.push(-2);e++<c;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&s.push(-5),n&&s.push(n),s.push(null)),s}}const $o=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Yo(e){return e.replace($o,Ko)}function Ko(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),l=i===120||i===88;return tr(t.slice(l?2:1),l?16:10)}return Mn(t)||e}const fr={}.hasOwnProperty;function Qo(e,n,t){return typeof n!="string"&&(t=n,n=void 0),Wo(t)(Vo(Uo(t).document().write(qo()(e,n,!0))))}function Wo(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Qn),autolinkProtocol:R,autolinkEmail:R,atxHeading:l($n),blockQuote:l(Ee),characterEscape:R,characterReference:R,codeFenced:l(Ye),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(Ye,o),codeText:l(Cr,o),codeTextData:R,data:R,codeFlowValue:R,definition:l(Er),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Ir),hardBreakEscape:l(Yn),hardBreakTrailing:l(Yn),htmlFlow:l(Kn,o),htmlFlowData:R,htmlText:l(Kn,o),htmlTextData:R,image:l(Tr),label:o,link:l(Qn),listItem:l(Pr),listItemValue:h,listOrdered:l(Wn,f),listUnordered:l(Wn),paragraph:l(Ar),reference:d,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l($n),strong:l(vr),thematicBreak:l(Lr)},exit:{atxHeading:s(),atxHeadingSequence:U,autolink:s(),autolinkEmail:Ce,autolinkProtocol:de,blockQuote:s(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:W,characterReference:De,codeFenced:s(z),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:S,codeFlowValue:B,codeIndented:s(k),codeText:s(N),codeTextData:B,data:B,definition:s(),definitionDestinationString:j,definitionLabelString:v,definitionTitleString:E,emphasis:s(),hardBreakEscape:s(T),hardBreakTrailing:s(T),htmlFlow:s(P),htmlFlowData:B,htmlText:s(I),htmlTextData:B,image:s(Q),label:pe,labelText:ie,lineEnding:A,link:s(K),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:oe,resourceDestinationString:m,resourceTitleString:le,resource:fe,setextHeading:s($),setextHeadingLineSequence:O,setextHeadingText:y,strong:s(),thematicBreak:s()}};hr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(g){let w={type:"root",children:[]};const D={stack:[w],tokenStack:[],config:n,enter:a,exit:u,buffer:o,resume:c,data:t},_=[];let H=-1;for(;++H<g.length;)if(g[H][1].type==="listOrdered"||g[H][1].type==="listUnordered")if(g[H][0]==="enter")_.push(H);else{const ae=_.pop();H=i(g,ae,H)}for(H=-1;++H<g.length;){const ae=n[g[H][0]];fr.call(ae,g[H][1].type)&&ae[g[H][1].type].call(Object.assign({sliceSerialize:g[H][2].sliceSerialize},D),g[H][1])}if(D.tokenStack.length>0){const ae=D.tokenStack[D.tokenStack.length-1];(ae[1]||Ct).call(D,void 0,ae[0])}for(w.position={start:ye(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:ye(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},H=-1;++H<n.transforms.length;)w=n.transforms[H](w)||w;return w}function i(g,w,D){let _=w-1,H=-1,ae=!1,be,he,Fe,_e;for(;++_<=D;){const ee=g[_];switch(ee[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ee[0]==="enter"?H++:H--,_e=void 0;break}case"lineEndingBlank":{ee[0]==="enter"&&(be&&!_e&&!H&&!Fe&&(Fe=_),_e=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_e=void 0}if(!H&&ee[0]==="enter"&&ee[1].type==="listItemPrefix"||H===-1&&ee[0]==="exit"&&(ee[1].type==="listUnordered"||ee[1].type==="listOrdered")){if(be){let Ie=_;for(he=void 0;Ie--;){const me=g[Ie];if(me[1].type==="lineEnding"||me[1].type==="lineEndingBlank"){if(me[0]==="exit")continue;he&&(g[he][1].type="lineEndingBlank",ae=!0),me[1].type="lineEnding",he=Ie}else if(!(me[1].type==="linePrefix"||me[1].type==="blockQuotePrefix"||me[1].type==="blockQuotePrefixWhitespace"||me[1].type==="blockQuoteMarker"||me[1].type==="listItemIndent"))break}Fe&&(!he||Fe<he)&&(be._spread=!0),be.end=Object.assign({},he?g[he][1].start:ee[1].end),g.splice(he||_,0,["exit",be,ee[2]]),_++,D++}if(ee[1].type==="listItemPrefix"){const Ie={type:"listItem",_spread:!1,start:Object.assign({},ee[1].start),end:void 0};be=Ie,g.splice(_,0,["enter",Ie,ee[2]]),_++,D++,Fe=void 0,_e=!0}}}return g[w][1]._spread=ae,D}function l(g,w){return D;function D(_){a.call(this,g(_),_),w&&w.call(this,_)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(g,w,D){this.stack[this.stack.length-1].children.push(g),this.stack.push(g),this.tokenStack.push([w,D||void 0]),g.position={start:ye(w.start),end:void 0}}function s(g){return w;function w(D){g&&g.call(this,D),u.call(this,D)}}function u(g,w){const D=this.stack.pop(),_=this.tokenStack.pop();if(_)_[0].type!==g.type&&(w?w.call(this,g,_[0]):(_[1]||Ct).call(this,g,_[0]));else throw new Error("Cannot close `"+g.type+"` ("+je({start:g.start,end:g.end})+"): it’s not open");D.position.end=ye(g.end)}function c(){return Yi(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(g){if(this.data.expectingFirstListItemValue){const w=this.stack[this.stack.length-2];w.start=Number.parseInt(this.sliceSerialize(g),10),this.data.expectingFirstListItemValue=void 0}}function p(){const g=this.resume(),w=this.stack[this.stack.length-1];w.lang=g}function S(){const g=this.resume(),w=this.stack[this.stack.length-1];w.meta=g}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function z(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g.replace(/(\r?\n|\r)$/g,"")}function v(g){const w=this.resume(),D=this.stack[this.stack.length-1];D.label=w,D.identifier=ze(this.sliceSerialize(g)).toLowerCase()}function E(){const g=this.resume(),w=this.stack[this.stack.length-1];w.title=g}function j(){const g=this.resume(),w=this.stack[this.stack.length-1];w.url=g}function U(g){const w=this.stack[this.stack.length-1];if(!w.depth){const D=this.sliceSerialize(g).length;w.depth=D}}function y(){this.data.setextHeadingSlurpLineEnding=!0}function O(g){const w=this.stack[this.stack.length-1];w.depth=this.sliceSerialize(g).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function R(g){const D=this.stack[this.stack.length-1].children;let _=D[D.length-1];(!_||_.type!=="text")&&(_=zr(),_.position={start:ye(g.start),end:void 0},D.push(_)),this.stack.push(_)}function B(g){const w=this.stack.pop();w.value+=this.sliceSerialize(g),w.position.end=ye(g.end)}function A(g){const w=this.stack[this.stack.length-1];if(this.data.atHardBreak){const D=w.children[w.children.length-1];D.position.end=ye(g.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(w.type)&&(R.call(this,g),B.call(this,g))}function T(){this.data.atHardBreak=!0}function P(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g}function I(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g}function N(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g}function K(){const g=this.stack[this.stack.length-1];if(this.data.inReference){const w=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=w,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function Q(){const g=this.stack[this.stack.length-1];if(this.data.inReference){const w=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=w,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function ie(g){const w=this.sliceSerialize(g),D=this.stack[this.stack.length-2];D.label=Yo(w),D.identifier=ze(w).toLowerCase()}function pe(){const g=this.stack[this.stack.length-1],w=this.resume(),D=this.stack[this.stack.length-1];if(this.data.inReference=!0,D.type==="link"){const _=g.children;D.children=_}else D.alt=w}function m(){const g=this.resume(),w=this.stack[this.stack.length-1];w.url=g}function le(){const g=this.resume(),w=this.stack[this.stack.length-1];w.title=g}function fe(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function oe(g){const w=this.resume(),D=this.stack[this.stack.length-1];D.label=w,D.identifier=ze(this.sliceSerialize(g)).toLowerCase(),this.data.referenceType="full"}function ke(g){this.data.characterReferenceType=g.type}function W(g){const w=this.sliceSerialize(g),D=this.data.characterReferenceType;let _;D?(_=tr(w,D==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):_=Mn(w);const H=this.stack[this.stack.length-1];H.value+=_}function De(g){const w=this.stack.pop();w.position.end=ye(g.end)}function de(g){B.call(this,g);const w=this.stack[this.stack.length-1];w.url=this.sliceSerialize(g)}function Ce(g){B.call(this,g);const w=this.stack[this.stack.length-1];w.url="mailto:"+this.sliceSerialize(g)}function Ee(){return{type:"blockquote",children:[]}}function Ye(){return{type:"code",lang:null,meta:null,value:""}}function Cr(){return{type:"inlineCode",value:""}}function Er(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ir(){return{type:"emphasis",children:[]}}function $n(){return{type:"heading",depth:0,children:[]}}function Yn(){return{type:"break"}}function Kn(){return{type:"html",value:""}}function Tr(){return{type:"image",title:null,url:"",alt:null}}function Qn(){return{type:"link",title:null,url:"",children:[]}}function Wn(g){return{type:"list",ordered:g.type==="listOrdered",start:null,spread:g._spread,children:[]}}function Pr(g){return{type:"listItem",spread:g._spread,checked:null,children:[]}}function Ar(){return{type:"paragraph",children:[]}}function vr(){return{type:"strong",children:[]}}function zr(){return{type:"text",value:""}}function Lr(){return{type:"thematicBreak"}}}function ye(e){return{line:e.line,column:e.column,offset:e.offset}}function hr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?hr(e,r):Xo(e,r)}}function Xo(e,n){let t;for(t in n)if(fr.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function Ct(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+je({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+je({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+je({start:n.start,end:n.end})+") is still open")}function Go(e){const n=this;n.parser=t;function t(r){return Qo(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Jo(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Zo(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
@@ -1 +1 @@
1
- import{r as u,R as oe,g as Le,j as t,i as k,c as b,v as H,f as mt,b as M,a as D,l as T,I as me,B as $,m as R,P as Ie,a4 as Ue,a5 as xt,a6 as ht,H as ce,S as Pe,af as Ke,ag as pt,d as et,s as gt,e as bt,q as vt,F as B,D as jt,a7 as wt,_ as Nt,ah as yt}from"./index-O3mjYpnE.js";import{u as le,M as Tt}from"./project-6gxepOhm.js";import{S as Ve}from"./SplitPane-qHmkD1qy.js";import{E as te,M as Et}from"./file-DarlIDVi.js";import{u as N}from"./editor-DYIP1yQ4.js";import{I as y}from"./Input-obuJsD6k.js";import{F as Pt,L as St}from"./ListboxShow-HM9_qyrt.js";import{B as Ye}from"./Banner-BWDzvavM.js";import{m as Ct,h as tt,s as kt,K as xe,ak as we,y as he,o as se,n as Te,a4 as ue,L as pe,$ as st,_ as lt,d as fe,r as Ne,a0 as Dt,a as q,g as re,T as U,q as It,W as Ft,X as Mt,Y as Rt,R as Ze}from"./popover-CqgMRE0G.js";import{g as $e,G as Lt,F as _t,T as At}from"./help-Bl8wqaQc.js";import{M as $t,u as nt,a as _e,b as zt,c as Ot,C as Qt}from"./context-DgX0fp2E.js";import{V as Fe,F as Bt,a as Wt}from"./PlusCircleIcon-CVDO651q.js";import{D as Ht}from"./ReportErrors-BT6xFwAr.js";import"./floating-ui.react-dom-BH3TFvkM.js";import"./index-D1sR7wpN.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./help-B59vE3aE.js";import"./SourceList-Doo_9ZGp.js";function Gt({onFocus:e}){let[s,l]=u.useState(!0),n=Ct();return s?oe.createElement(tt,{as:"button",type:"button",features:kt.Focusable,onFocus:i=>{i.preventDefault();let r,a=50;function d(){if(a--<=0){r&&cancelAnimationFrame(r);return}if(e()){if(cancelAnimationFrame(r),!n.current)return;l(!1);return}r=requestAnimationFrame(d)}r=requestAnimationFrame(d)}}):null}const rt=u.createContext(null);function qt(){return{groups:new Map,get(e,s){var l;let n=this.groups.get(e);n||(n=new Map,this.groups.set(e,n));let i=(l=n.get(s))!=null?l:0;n.set(s,i+1);let r=Array.from(n.keys()).indexOf(s);function a(){let d=n.get(s);d>1?n.set(s,d-1):n.delete(s)}return[r,a]}}}function Ut({children:e}){let s=u.useRef(qt());return u.createElement(rt.Provider,{value:s},e)}function at(e){let s=u.useContext(rt);if(!s)throw new Error("You must wrap your component in a <StableCollection>");let l=u.useId(),[n,i]=s.current.get(e,l);return u.useEffect(()=>i,[]),n}var Vt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Vt||{}),Yt=(e=>(e[e.Less=-1]="Less",e[e.Equal=0]="Equal",e[e.Greater=1]="Greater",e))(Yt||{}),Zt=(e=>(e[e.SetSelectedIndex=0]="SetSelectedIndex",e[e.RegisterTab=1]="RegisterTab",e[e.UnregisterTab=2]="UnregisterTab",e[e.RegisterPanel=3]="RegisterPanel",e[e.UnregisterPanel=4]="UnregisterPanel",e))(Zt||{});let Xt={0(e,s){var l;let n=ue(e.tabs,f=>f.current),i=ue(e.panels,f=>f.current),r=n.filter(f=>{var g;return!((g=f.current)!=null&&g.hasAttribute("disabled"))}),a={...e,tabs:n,panels:i};if(s.index<0||s.index>n.length-1){let f=fe(Math.sign(s.index-e.selectedIndex),{[-1]:()=>1,0:()=>fe(Math.sign(s.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(r.length===0)return a;let g=fe(f,{0:()=>n.indexOf(r[0]),1:()=>n.indexOf(r[r.length-1])});return{...a,selectedIndex:g===-1?e.selectedIndex:g}}let d=n.slice(0,s.index),p=[...n.slice(s.index),...d].find(f=>r.includes(f));if(!p)return a;let o=(l=n.indexOf(p))!=null?l:e.selectedIndex;return o===-1&&(o=e.selectedIndex),{...a,selectedIndex:o}},1(e,s){if(e.tabs.includes(s.tab))return e;let l=e.tabs[e.selectedIndex],n=ue([...e.tabs,s.tab],r=>r.current),i=e.selectedIndex;return e.info.current.isControlled||(i=n.indexOf(l),i===-1&&(i=e.selectedIndex)),{...e,tabs:n,selectedIndex:i}},2(e,s){return{...e,tabs:e.tabs.filter(l=>l!==s.tab)}},3(e,s){return e.panels.includes(s.panel)?e:{...e,panels:ue([...e.panels,s.panel],l=>l.current)}},4(e,s){return{...e,panels:e.panels.filter(l=>l!==s.panel)}}},ze=u.createContext(null);ze.displayName="TabsDataContext";function ie(e){let s=u.useContext(ze);if(s===null){let l=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,ie),l}return s}let Oe=u.createContext(null);Oe.displayName="TabsActionsContext";function Qe(e){let s=u.useContext(Oe);if(s===null){let l=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,Qe),l}return s}function Jt(e,s){return fe(s.type,Xt,e,s)}let Kt="div";function es(e,s){let{defaultIndex:l=0,vertical:n=!1,manual:i=!1,onChange:r,selectedIndex:a=null,...d}=e;const p=n?"vertical":"horizontal",o=i?"manual":"auto";let f=a!==null,g=we({isControlled:f}),E=he(s),[m,v]=u.useReducer(Jt,{info:g,selectedIndex:a??l,tabs:[],panels:[]}),I=u.useMemo(()=>({selectedIndex:m.selectedIndex}),[m.selectedIndex]),j=we(r||(()=>{})),c=we(m.tabs),w=u.useMemo(()=>({orientation:p,activation:o,...m}),[p,o,m]),h=se(P=>(v({type:1,tab:P}),()=>v({type:2,tab:P}))),C=se(P=>(v({type:3,panel:P}),()=>v({type:4,panel:P}))),L=se(P=>{_.current!==P&&j.current(P),f||v({type:0,index:P})}),_=we(f?e.selectedIndex:m.selectedIndex),z=u.useMemo(()=>({registerTab:h,registerPanel:C,change:L}),[]);Te(()=>{v({type:0,index:a??l})},[a]),Te(()=>{if(_.current===void 0||m.tabs.length<=0)return;let P=ue(m.tabs,G=>G.current);P.some((G,Y)=>m.tabs[Y]!==G)&&L(P.indexOf(m.tabs[_.current]))});let ne={ref:E},J=pe();return oe.createElement(Ut,null,oe.createElement(Oe.Provider,{value:z},oe.createElement(ze.Provider,{value:w},w.tabs.length<=0&&oe.createElement(Gt,{onFocus:()=>{var P,G;for(let Y of c.current)if(((P=Y.current)==null?void 0:P.tabIndex)===0)return(G=Y.current)==null||G.focus(),!0;return!1}}),J({ourProps:ne,theirProps:d,slot:I,defaultTag:Kt,name:"Tabs"}))))}let ts="div";function ss(e,s){let{orientation:l,selectedIndex:n}=ie("Tab.List"),i=he(s),r=u.useMemo(()=>({selectedIndex:n}),[n]),a=e,d={ref:i,role:"tablist","aria-orientation":l};return pe()({ourProps:d,theirProps:a,slot:r,defaultTag:ts,name:"Tabs.List"})}let ls="button";function ns(e,s){var l,n;let i=u.useId(),{id:r=`headlessui-tabs-tab-${i}`,disabled:a=!1,autoFocus:d=!1,...p}=e,{orientation:o,activation:f,selectedIndex:g,tabs:E,panels:m}=ie("Tab"),v=Qe("Tab"),I=ie("Tab"),[j,c]=u.useState(null),w=u.useRef(null),h=he(w,s,c);Te(()=>v.registerTab(w),[v,w]);let C=at("tabs"),L=E.indexOf(w);L===-1&&(L=C);let _=L===g,z=se(S=>{var Z;let je=S();if(je===Ne.Success&&f==="auto"){let ut=(Z=Dt(w))==null?void 0:Z.activeElement,qe=I.tabs.findIndex(ft=>ft.current===ut);qe!==-1&&v.change(qe)}return je}),ne=se(S=>{let Z=E.map(je=>je.current).filter(Boolean);if(S.key===q.Space||S.key===q.Enter){S.preventDefault(),S.stopPropagation(),v.change(L);return}switch(S.key){case q.Home:case q.PageUp:return S.preventDefault(),S.stopPropagation(),z(()=>re(Z,U.First));case q.End:case q.PageDown:return S.preventDefault(),S.stopPropagation(),z(()=>re(Z,U.Last))}if(z(()=>fe(o,{vertical(){return S.key===q.ArrowUp?re(Z,U.Previous|U.WrapAround):S.key===q.ArrowDown?re(Z,U.Next|U.WrapAround):Ne.Error},horizontal(){return S.key===q.ArrowLeft?re(Z,U.Previous|U.WrapAround):S.key===q.ArrowRight?re(Z,U.Next|U.WrapAround):Ne.Error}}))===Ne.Success)return S.preventDefault()}),J=u.useRef(!1),P=se(()=>{var S;J.current||(J.current=!0,(S=w.current)==null||S.focus({preventScroll:!0}),v.change(L),It(()=>{J.current=!1}))}),G=se(S=>{S.preventDefault()}),{isFocusVisible:Y,focusProps:ke}=st({autoFocus:d}),{isHovered:de,hoverProps:ve}=Ft({isDisabled:a}),{pressed:x,pressProps:F}=Mt({disabled:a}),O=u.useMemo(()=>({selected:_,hover:de,active:x,focus:Y,autofocus:d,disabled:a}),[_,de,Y,x,d,a]),De=lt({ref:h,onKeyDown:ne,onMouseDown:G,onClick:P,id:r,role:"tab",type:Rt(e,j),"aria-controls":(n=(l=m[L])==null?void 0:l.current)==null?void 0:n.id,"aria-selected":_,tabIndex:_?0:-1,disabled:a||void 0,autoFocus:d},ke,ve,F);return pe()({ourProps:De,theirProps:p,slot:O,defaultTag:ls,name:"Tabs.Tab"})}let rs="div";function as(e,s){let{selectedIndex:l}=ie("Tab.Panels"),n=he(s),i=u.useMemo(()=>({selectedIndex:l}),[l]),r=e,a={ref:n};return pe()({ourProps:a,theirProps:r,slot:i,defaultTag:rs,name:"Tabs.Panels"})}let os="div",is=Ze.RenderStrategy|Ze.Static;function cs(e,s){var l,n,i,r;let a=u.useId(),{id:d=`headlessui-tabs-panel-${a}`,tabIndex:p=0,...o}=e,{selectedIndex:f,tabs:g,panels:E}=ie("Tab.Panel"),m=Qe("Tab.Panel"),v=u.useRef(null),I=he(v,s);Te(()=>m.registerPanel(v),[m,v]);let j=at("panels"),c=E.indexOf(v);c===-1&&(c=j);let w=c===f,{isFocusVisible:h,focusProps:C}=st(),L=u.useMemo(()=>({selected:w,focus:h}),[w,h]),_=lt({ref:I,id:d,role:"tabpanel","aria-labelledby":(n=(l=g[c])==null?void 0:l.current)==null?void 0:n.id,tabIndex:w?p:-1},C),z=pe();return!w&&((i=o.unmount)==null||i)&&!((r=o.static)!=null&&r)?oe.createElement(tt,{"aria-hidden":"true",..._}):z({ourProps:_,theirProps:o,slot:L,defaultTag:os,features:is,visible:w,name:"Tabs.Panel"})}let ds=xe(ns),ot=xe(es),us=xe(ss),it=xe(as),ae=xe(cs),W=Object.assign(ds,{Group:ot,List:us,Panels:it,Panel:ae});function fs({title:e,titleId:s,...l},n){return u.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},l),e?u.createElement("title",{id:s},e):null,u.createElement("path",{fillRule:"evenodd",d:"M3 6.75A.75.75 0 0 1 3.75 6h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 6.75ZM3 12a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 12Zm0 5.25a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}const ct=u.forwardRef(fs);function ms({title:e,titleId:s,...l},n){return u.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},l),e?u.createElement("title",{id:s},e):null,u.createElement("path",{fillRule:"evenodd",d:"M12 3.75a.75.75 0 0 1 .75.75v6.75h6.75a.75.75 0 0 1 0 1.5h-6.75v6.75a.75.75 0 0 1-1.5 0v-6.75H4.5a.75.75 0 0 1 0-1.5h6.75V4.5a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"}))}const xs=u.forwardRef(ms);function hs({title:e,titleId:s,...l},n){return u.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},l),e?u.createElement("title",{id:s},e):null,u.createElement("path",{d:"M15 3.75H9v16.5h6V3.75ZM16.5 20.25h3.375c1.035 0 1.875-.84 1.875-1.875V5.625c0-1.036-.84-1.875-1.875-1.875H16.5v16.5ZM4.125 3.75H7.5v16.5H4.125a1.875 1.875 0 0 1-1.875-1.875V5.625c0-1.036.84-1.875 1.875-1.875Z"}))}const ps=u.forwardRef(hs);function gs(e){switch(e){case te.SQL:return"SQL";case te.PY:return"Python";case te.YAML:case te.YML:return"YAML";default:return"Plain Text"}}function bs(e,s){return e.file.extension===te.SQL&&e.file.isLocal&&Le(s)}const A=function({text:s,children:l,className:n}){return t.jsxs("small",{className:b("font-bold whitespace-nowrap text-xs",n),children:[k(s)&&t.jsxs("span",{children:[s,": "]}),l]})};function vs({text:e,className:s}){return t.jsx("span",{className:b("font-normal",s),children:e})}function js({ok:e,className:s}){return t.jsx("span",{className:b("inline-block w-2 h-2 rounded-full",H(e)&&"bg-warning-500",mt(e)&&"bg-success-500",M(e)&&"bg-danger-500",s)})}A.Text=vs;A.Light=js;const Q={Model:"model",Test:"test",Macro:"macro",Hook:"hook",Log:"log",Config:"config",Seed:"seed",Metric:"metric",Schema:"schema",Unknown:"unknown"};function ws({tab:e}){const s=D(a=>a.isModel),l=N(a=>a.engine),n=N(a=>a.dialects),i=N(a=>a.refreshTab);u.useEffect(()=>{var d;const a=(d=n[0])==null?void 0:d.dialect_name;H(e.dialect)&&k(a)&&r(a)},[n,e]);function r(a){e.dialect=a,i(e),l.postMessage({topic:"dialect",payload:e.dialect})}return t.jsxs("div",{className:"flex w-full items-center px-2 min-h-[2rem] overflow-hidden",children:[e.file.isRemote&&t.jsx(A,{className:"mr-2",text:"Saved",children:t.jsx(A.Light,{ok:M(e.file.isChanged)})}),e.file.isRemote&&e.file.isSQL&&t.jsx(A,{className:"mr-2",text:"Formatted",children:t.jsx(A.Light,{ok:e.file.isFormatted})}),t.jsx(A,{className:"mr-2",text:"Language",children:t.jsx(A.Text,{text:gs(e.file.extension)})}),bs(e,n)&&t.jsx(A,{className:"mr-2",text:"Dialect",children:t.jsx(y,{size:T.sm,children:({className:a,size:d})=>t.jsx(y.Selector,{className:a,size:d,list:n.map(p=>({text:p.dialect_title,value:me(p.dialect_name)?"sqlglot":p.dialect_name})),onChange:r,value:e.dialect})})}),s(e.file.path)&&!me(e.dialect)&&t.jsx(A,{className:"mr-2",text:"Dialect",children:t.jsx(A.Text,{text:e.dialect})}),t.jsx(A,{className:"mr-2",text:"SQLMesh Type",children:t.jsx(A.Text,{text:Ns(e.file.path)})})]})}function Ns(e){return me(e)?Q.Unknown:e.startsWith("models")?Q.Model:e.startsWith("tests")?Q.Test:e.startsWith("logs")?Q.Log:e.startsWith("macros")?Q.Macro:e.startsWith("hooks")?Q.Hook:e.startsWith("seeds")?Q.Seed:e.startsWith("metrics")?Q.Metric:["config.yaml","config.yml","config.py"].includes(e)?Q.Config:["external_models.yaml","schema.yaml"].includes(e)?Q.Schema:Q.Unknown}function Xe({tab:e,title:s}){const l=u.useRef(null),n=D(g=>g.addConfirmation),i=le(g=>g.setSelectedFile),r=N(g=>g.closeTab),a=N(g=>g.tab),d=e.file.id===(a==null?void 0:a.file.id);return u.useEffect(()=>{H(e)||(e.el=l.current??void 0)},[l,e]),u.useEffect(()=>{H(a)||setTimeout(()=>{var g;(g=a.el)==null||g.scrollIntoView({behavior:"smooth",inline:"center"})},300)},[a]),t.jsx("li",{ref:l,className:b("inline-block py-1 pr-2 last-child:pr-0 overflow-hidden text-center overflow-ellipsis cursor-pointer"),onClick:p,children:t.jsxs("span",{className:b("flex border-2 justify-between items-center pl-1 pr-1 py-[0.125rem] min-w-[8rem] rounded-md group border-transparent border-r border-r-theme-darker dark:border-r-theme-lighter",d?"bg-neutral-200 border-neutral-200 text-neutral-900 dark:bg-dark-lighter dark:border-dark-lighter dark:text-primary-500":"bg-trasparent hover:bg-theme-darker dark:hover:bg-theme-lighter"),children:[t.jsx("small",{className:"text-xs",children:s}),t.jsx("small",{className:b("group-hover:hidden text-xs inline-block ml-3 mr-1 w-2 h-2 rounded-full",e.file.isChanged?"bg-warning-500":"bg-transparent")}),t.jsx(Pt,{className:"hidden group-hover:inline-block text-neutral-600 dark:text-neutral-100 w-4 h-4 ml-2 mr-0 cursor-pointer",onClick:o})]})});function p(g){g.stopPropagation(),i(e.file)}function o(g){g.stopPropagation(),f()}function f(){e.file.isChanged?n({headline:"Closing Tab",description:"All unsaved changes will be lost. Do you want to close the tab anyway?",yesText:"Yes, Close Tab",noText:"No, Cancel",action:()=>r(e.file)}):r(e.file)}}function ys(){const e=D(c=>c.modules),s=D(c=>c.models),l=D(c=>c.lastSelectedModel),n=D(c=>c.setLastSelectedModel),i=le(c=>c.files),r=le(c=>c.selectedFile),a=le(c=>c.setSelectedFile),d=N(c=>c.tab),p=N(c=>c.tabs),o=N(c=>c.replaceTab),f=N(c=>c.createTab),g=N(c=>c.selectTab),E=N(c=>c.addTab),[m,v]=u.useMemo(()=>{const c=[],w=[];return p.forEach(h=>{h.file.isLocal&&c.push(h),h.file.isRemote&&w.push(h)}),[c,w]},[p]);return u.useEffect(()=>{if(H(r)||(d==null?void 0:d.file)===r||r instanceof Tt||M(e.hasFiles))return;n(s.get(r.path));const c=f(r);k(d)&&d.file instanceof Et&&M(d.file.isChanged)&&d.file.isRemote&&M(p.has(r))?o(d,c):E(c),g(c)},[r,e]),u.useEffect(()=>{if(H(l))return;const c=i.get(l.path);H(c)||a(c)},[l]),t.jsxs("div",{className:"flex items-center bg-neutral-5",children:[t.jsx($,{className:"h-6 m-0 ml-1 mr-2 border-none",variant:R.Alternative,size:T.sm,onClick:I,children:t.jsx(xs,{className:"inline-block w-3 h-4"})}),t.jsxs("ul",{className:"w-full whitespace-nowrap min-h-[2rem] max-h-[2rem] overflow-hidden overflow-x-auto hover:scrollbar scrollbar--horizontal",children:[m.map((c,w)=>t.jsx(Xe,{tab:c,title:`Custom SQL ${w+1}`},c.id)),v.map(c=>t.jsx(Xe,{tab:c,title:c.file.name},c.id))]})]});function I(c){c.stopPropagation(),j()}function j(){const c=f();E(c),g(c),a(c.file)}}function Be({list:e,children:s=[],className:l,disabled:n=!1}){return t.jsxs(W.List,{className:b("w-full whitespace-nowrap px-2 flex justify-center items-center",n&&"cursor-not-allowed"),children:[t.jsx("div",{className:b("flex w-full overflow-hidden overflow-x-auto py-1 hover:scrollbar scrollbar--horizontal",l,n&&"opacity-50 pointer-events-none"),children:t.jsx("div",{className:"flex p-1 items-center bg-secondary-10 dark:bg-primary-10 cursor-pointer rounded-full overflow-hidden",children:e.map(i=>t.jsx(W,{className:({selected:r})=>b("text-xs px-2 py-0.5 mr-2 last:mr-0 rounded-full relative align-middle",r?"bg-secondary-500 text-secondary-100 cursor-default font-bold":"cursor-pointer font-medium text-secondary-400 dark:text-secondary-400"),children:i},i))})}),s]})}const Je=1440*60*1e3,Ts=1e3,Ee=50;function Es({tab:e,isOpen:s=!0,toggle:l}){const n=D(a=>a.models),i=D(a=>a.isModel),r=u.useMemo(()=>n.get(e.file.path),[e,n]);return t.jsx("div",{className:b("flex flex-col w-full h-full items-center overflow-hidden"),children:i(e.file.path)?k(r)&&t.jsx(Ps,{tab:e,model:r,isOpen:s,toggle:l}):t.jsx(Ss,{tab:e,isOpen:s,toggle:l})})}function Ps({tab:e,model:s,isOpen:l=!0,toggle:n}){const i=D(d=>d.environment),r=D(d=>d.environments),a=Array.from(r).filter(({isRemote:d})=>d).map(({name:d})=>({text:d,value:d}));return t.jsxs(W.Group,{children:[t.jsxs("div",{className:"flex w-full items-center",children:[t.jsx($,{className:b("h-6 w-6 !px-0 border-none bg-neutral-10 dark:bg-neutral-20",l?"text-secondary-500 dark:text-secondary-300":"text-neutral-500 dark:text-neutral-300"),variant:R.Info,size:T.sm,onClick:d=>{d.stopPropagation(),n==null||n()},children:t.jsx(ct,{className:"w-4 h-4"})}),l&&t.jsx(Be,{className:"flex justify-center items-center",list:["Evaluate","Columns",a.length>1&&i.isRemote&&"Diff"].filter(Boolean)})]}),l&&t.jsxs(W.Panels,{className:"h-full w-full overflow-hidden",children:[t.jsx(W.Panel,{unmount:!1,className:b("flex flex-col w-full h-full relative overflow-hidden","ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(Ds,{model:s})}),t.jsx(W.Panel,{unmount:!1,className:"text-xs w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2 px-2",children:t.jsx($t,{nodeId:s.fqn,columns:s.columns,disabled:M(s.isModelSQL),withHandles:!1,withSource:!1,withDescription:!0,limit:10})}),a.length>1&&i.isRemote&&t.jsx(W.Panel,{unmount:!1,className:b("flex flex-col w-full h-full relative overflow-hidden","ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(Is,{tab:e,model:s,list:a.filter(({value:d})=>i.name!==d),target:{text:i.name,value:i.name}})})]})]})}function Ss({tab:e,isOpen:s=!0,toggle:l}){return t.jsxs(W.Group,{children:[t.jsxs("div",{className:"flex w-full items-center",children:[t.jsx($,{className:b("h-6 w-6 !px-0 border-none bg-neutral-10 dark:bg-neutral-20",s?"text-secondary-500 dark:text-secondary-300":"text-neutral-500 dark:text-neutral-300"),variant:R.Info,size:T.sm,onClick:n=>{n.stopPropagation(),l==null||l()},children:t.jsx(ct,{className:"w-4 h-4"})}),s&&t.jsx(Be,{className:"flex justify-center items-center",list:["Run Query","Diff"]})]}),s&&t.jsxs(W.Panels,{className:"h-full w-full overflow-hidden",children:[t.jsx(W.Panel,{unmount:!1,className:b("flex flex-col w-full h-full relative overflow-hidden","ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(ks,{tab:e})}),t.jsx(W.Panel,{unmount:!1,className:b("flex flex-col w-full h-full relative overflow-hidden","ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(Fs,{})})]})]})}function Cs({children:e}){return t.jsx("fieldset",{className:"flex my-3",children:e})}function Se({children:e}){return t.jsx("div",{className:"flex w-full h-full py-1 overflow-hidden overflow-y-auto hover:scrollbar scrollbar--vertical",children:e})}function Ce({children:e}){return t.jsx("div",{className:"flex w-full py-1 px-1 justify-end",children:e})}function ks({tab:e}){const s=N(p=>p.setPreviewQuery),l=N(p=>p.setPreviewTable),n=N(p=>p.engine),{refetch:i,isFetching:r,cancel:a}=pt({sql:e.file.content});u.useEffect(()=>()=>{a()},[]);function d(){l(void 0),s(e.file.content),i().then(({data:p})=>{l($e(p))})}return t.jsxs(t.Fragment,{children:[t.jsx(Se,{}),t.jsx(ce,{}),t.jsxs(Ce,{children:[t.jsx($,{size:T.sm,variant:R.Alternative,onClick:p=>{p.stopPropagation(),n.postMessage({topic:"format",payload:{sql:e.file.content,dialect:e.dialect}})},children:"Format"}),r?t.jsxs("div",{className:"flex items-center",children:[t.jsx(Pe,{className:"w-3"}),t.jsx("small",{className:"text-xs text-neutral-400 block mx-2",children:"Running Query..."}),t.jsx($,{size:T.sm,variant:R.Danger,onClick:p=>{p.stopPropagation(),a()},children:"Cancel"})]}):t.jsx($,{size:T.sm,variant:R.Alternative,disabled:r,onClick:p=>{p.stopPropagation(),d()},children:"Run Query"})]})]})}function Ds({model:e}){const s=D(m=>m.environment),l=D(m=>m.isModel),n=N(m=>m.setPreviewQuery),i=N(m=>m.setPreviewTable),[r,a]=u.useState({model:e.displayName,start:Ie(Ue(Date.now()-Je)),end:Ie(new Date),execution_time:Ie(Ue(Date.now()-Je)),limit:1e3}),{refetch:d}=xt({model:r.model,start:r.start,end:r.end,execution_time:r.execution_time,dialect:e.dialect,pretty:!0}),{refetch:p,isFetching:o,cancel:f}=ht(r),g=l(e.path)&&Object.values(r).every(Boolean);u.useEffect(()=>()=>{f()},[]);function E(){n(void 0),i(void 0),d().then(({data:m})=>{n(m==null?void 0:m.sql)}),p().then(({data:m})=>{i($e(m))})}return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsxs("form",{className:"w-full",children:[M(g)&&t.jsx(Cs,{children:t.jsx(Ye,{variant:R.Warning,children:t.jsxs(Ye.Description,{className:"w-full mr-2 text-sm",children:["Please fill out all fields to ",t.jsx("b",{children:"evaluate the model"}),"."]})})}),t.jsxs("fieldset",{className:"px-2 w-full text-neutral-500",children:[t.jsx(y,{className:"w-full mx-0",label:"Start Date",size:T.sm,children:({className:m})=>t.jsx(y.Textfield,{className:b(m,"w-full"),placeholder:"02/11/2023",value:r.start,onInput:v=>{v.stopPropagation(),a({...r,start:v.target.value??""})}})}),t.jsx(y,{className:"w-full mx-0",label:"End Date",size:T.sm,children:({className:m})=>t.jsx(y.Textfield,{className:b(m,"w-full"),placeholder:"02/13/2023",value:r.end,onInput:v=>{v.stopPropagation(),a({...r,end:v.target.value??""})}})}),t.jsx(y,{className:"w-full mx-0",label:"Execution Time",size:T.sm,children:({className:m})=>t.jsx(y.Textfield,{className:b(m,"w-full"),placeholder:"02/13/2023",value:r.execution_time,onInput:v=>{v.stopPropagation(),a({...r,execution_time:v.target.value??""})}})}),k(r.limit)&&t.jsx(y,{className:"w-full mx-0",label:"Limit",size:T.sm,children:({className:m})=>t.jsx(y.Textfield,{className:b(m,"w-full"),type:"number",placeholder:"1000",value:r.limit,onInput:v=>{v.stopPropagation(),a({...r,limit:v.target.valueAsNumber??Ts})}})})]})]})}),t.jsx(ce,{}),t.jsx(Ce,{children:t.jsx("div",{className:"flex w-full justify-end",children:l(e.path)&&o?t.jsxs("div",{className:"flex items-center",children:[t.jsx(Pe,{className:"w-3"}),t.jsx("small",{className:"text-xs text-neutral-400 block mx-2",children:"Evaluating..."}),t.jsx($,{size:T.sm,variant:R.Danger,onClick:m=>{m.stopPropagation(),f()},children:"Cancel"})]}):t.jsx($,{size:T.sm,variant:R.Alternative,disabled:M(g)||o||s.isInitialProd,onClick:m=>{m.stopPropagation(),E()},children:"Evaluate"})})})]})}function Is({tab:e,model:s,list:l,target:n}){const i=D(h=>h.isModel),r=N(h=>h.setPreviewDiff),[a,d]=u.useState(l[0].value),[p,o]=u.useState(Ee),[f,g]=u.useState(""),[E,m]=u.useState(""),{refetch:v,isFetching:I,cancel:j}=Ke({source:a,target:n.value,model_or_snapshot:s.name,limit:p,on:f,where:E}),c=u.useCallback(()=>{r(void 0),v().then(({data:h})=>{r(h)})},[s.name,s.hash]);u.useEffect(()=>()=>{j()},[]),u.useEffect(()=>{d(l[0].value)},[l]);const w=i(e.file.path)&&[a,n,p].every(Boolean);return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsx("form",{className:"w-full",children:t.jsxs("fieldset",{className:"px-2 w-full text-neutral-500",children:[t.jsx(y,{className:"w-full mx-0",label:"Source",disabled:l.length<2,size:T.sm,children:({disabled:h,className:C})=>t.jsx(y.Selector,{className:b(C,"w-full"),list:l,value:a,disabled:h,onChange:d})}),t.jsx(y,{className:"w-full mx-0",label:"Target",disabled:!0,children:({disabled:h,className:C})=>t.jsx(y.Textfield,{className:b(C,"w-full"),disabled:h,value:n.value})}),t.jsx(y,{className:"w-full mx-0",label:"Limit",size:T.sm,children:({className:h})=>t.jsx(y.Textfield,{className:b(h,"w-full"),type:"number",placeholder:"1000",value:p,onInput:C=>{C.stopPropagation(),o(C.target.valueAsNumber??Ee)}})}),t.jsx(y,{className:"w-full mx-0",label:"ON",size:T.sm,children:({className:h})=>t.jsx(y.Textfield,{className:b(h,"w-full"),placeholder:"s.id = t.id",value:f,onInput:C=>{C.stopPropagation(),g(C.target.value)}})}),t.jsx(y,{className:"w-full mx-0",label:"WHERE",size:T.sm,children:({className:h})=>t.jsx(y.Textfield,{className:b(h,"w-full"),placeholder:"id > 10",value:E,onInput:C=>{C.stopPropagation(),m(C.target.value)}})})]})})}),t.jsx(ce,{}),t.jsx(Ce,{children:t.jsx("div",{className:"flex w-full justify-end items-center px-2",children:I?t.jsxs("div",{className:"flex items-center",children:[t.jsx(Pe,{className:"w-3"}),t.jsx("small",{className:"text-xs text-neutral-400 block mx-2",children:"Getting Diff..."}),t.jsx($,{size:T.sm,variant:R.Danger,onClick:h=>{h.stopPropagation(),j()},children:"Cancel"})]}):t.jsx($,{className:"ml-2",size:T.sm,variant:R.Alternative,disabled:M(w)||I,onClick:h=>{h.stopPropagation(),c()},children:"Get Diff"})})})]})}function Fs(){const e=N(j=>j.setPreviewDiff),[s,l]=u.useState(""),[n,i]=u.useState(""),[r,a]=u.useState(Ee),[d,p]=u.useState(""),[o,f]=u.useState(""),{refetch:g,isFetching:E,cancel:m}=Ke({source:s,target:n,limit:r,on:d,where:o});u.useEffect(()=>()=>{m()},[]);function v(){e(void 0),g().then(({data:j})=>{e(j)})}const I=[s,n,r,d].every(Boolean);return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsx("form",{className:"w-full",children:t.jsxs("fieldset",{className:"px-2 w-full text-neutral-500",children:[t.jsx(y,{className:"w-full mx-0",label:"Source",size:T.sm,children:({className:j})=>t.jsx(y.Textfield,{className:b(j,"w-full"),placeholder:"exp.tst_model__dev",value:s,onInput:c=>{c.stopPropagation(),l(c.target.value)}})}),t.jsx(y,{className:"w-full mx-0",label:"Target",size:T.sm,children:({className:j})=>t.jsx(y.Textfield,{className:b(j,"w-full"),placeholder:"exp.tst_snapshot__1353336088",value:n,onInput:c=>{c.stopPropagation(),i(c.target.value)}})}),t.jsx(y,{className:"w-full mx-0",label:"Limit",size:T.sm,children:({className:j})=>t.jsx(y.Textfield,{className:b(j,"w-full"),type:"number",placeholder:"1000",value:r,onInput:c=>{c.stopPropagation(),a(c.target.valueAsNumber??Ee)}})}),t.jsx(y,{className:"w-full mx-0",label:"ON",size:T.sm,children:({className:j})=>t.jsx(y.Textfield,{className:b(j,"w-full"),placeholder:"s.id = t.id",value:d,onInput:c=>{c.stopPropagation(),p(c.target.value)}})}),t.jsx(y,{className:"w-full mx-0",label:"WHERE",size:T.sm,children:({className:j})=>t.jsx(y.Textfield,{className:b(j,"w-full"),placeholder:"id > 10",value:o,onInput:c=>{c.stopPropagation(),f(c.target.value)}})})]})})}),t.jsx(ce,{}),t.jsx(Ce,{children:E?t.jsxs("div",{className:"flex items-center",children:[t.jsx(Pe,{className:"w-3"}),t.jsx("small",{className:"text-xs text-neutral-400 block mx-2",children:"Getting Diff..."}),t.jsx($,{size:T.sm,variant:R.Danger,onClick:j=>{j.stopPropagation(),m()},children:"Cancel"})]}):t.jsx($,{className:"ml-2",size:T.sm,variant:R.Alternative,disabled:M(I)||E,onClick:j=>{j.stopPropagation(),v()},children:"Get Diff"})})]})}const ge="s__",be="t__",We="NULL";function Ms({source_schema:e,target_schema:s},l,n){const i=Array.from(new Set(n.flat())),r=Object.keys(e),a=Object.keys(s),p=Array.from(new Set(r.concat(a))).filter(g=>r.includes(g)&&a.includes(g)),o=r.filter(g=>!a.includes(g)),f=a.filter(g=>!r.includes(g));return{all:Array.from(new Set([i,l.modifiedColumns&&p,l.addedColumns&&f,l.removedColumns&&o].filter(Boolean).flat())),added:f.length,deleted:o.length,modified:p.length-i.length}}function Rs(e,s,l){const n=Object.values(e.row_diff.sample)[0]??{},i=[],r=[],a=[];return Object.keys(n).forEach(d=>{ee(e,d,l)?r.push(d):K(e,d,l)?i.push(d):a.push(d)}),{all:[s.modifiedRows&&a,s.addedRows&&r,s.removedRows&&i].filter(Boolean).flat(),added:r.length,deleted:i.length,modified:a.length}}function Ae(e,s,l){const n=V(e,ge,s,l),i=V(e,be,s,l);return n!==i}function K(e,s,l){return l.every(([n,i])=>{const r=V(e,ge,n,s),a=V(e,be,i,s);return k(r)&&H(a)})}function ee(e,s,l){return l.every(([n,i])=>{const r=V(e,ge,n,s),a=V(e,be,i,s);return H(r)&&k(a)})}function Me(e,s,l,n){return l in e.schema_diff.added||l in e.schema_diff.removed?!1:s.some(i=>M(ee(e,i,n))&&M(K(e,i,n))&&Ae(e,l,i))}function V(e,s,l,n){var i;return(i=e.row_diff.sample[`${s}${l}`])==null?void 0:i[n]}function Ls(e,s,l){return V(e,ge,s,l)??We}function _s(e,s,l){return V(e,be,s,l)??We}function As({diff:e}){const[s,l]=u.useState({modifiedRows:!0,addedRows:!0,removedRows:!0,modifiedColumns:!0,addedColumns:!0,removedColumns:!0}),n=Ms(e.schema_diff,s,e.on),i=Rs(e,s,e.on),r=s.addedRows&&!s.removedRows&&!s.modifiedRows,a=!s.addedRows&&s.removedRows&&!s.modifiedRows,d=Array.from(new Set(e.on.flat())),p=Object.values(e.row_diff.sample).some(o=>Object.keys(o).length>0);return t.jsxs("div",{className:"px-2 h-full flex flex-col rounded-lg",children:[p&&t.jsxs(t.Fragment,{children:[t.jsx(Os,{diff:e,rows:i,columns:n}),t.jsx("div",{className:"mt-2 mb-1 flex rounded-lg items-center",children:t.jsx("div",{className:"w-full flex justify-end items-center",children:t.jsx(St,{options:Object.keys(s).reduce((o,f)=>(o[f]=g=>l(E=>({...E,[f]:g})),o),{}),value:Object.keys(s).map(o=>M(s[o])?void 0:o).filter(Boolean)})})})]}),t.jsx("div",{className:"overflow-auto h-full hover:scrollbar scrollbar--horizontal scrollbar--vertical",children:t.jsxs("table",{cellPadding:0,cellSpacing:0,className:"w-full text-xs text-neutral-600 dark:text-neutral-200 font-normal border-separate",children:[t.jsx("thead",{className:"sticky bg-theme top-0 z-10",children:t.jsx("tr",{children:n.all.map(o=>t.jsx("th",{colSpan:Me(e,i.all,o,e.on)?2:1,className:b("text-left whitespace-nowrap py-1 px-2 font-bold",o in e.schema_diff.added?"border-t-2 border-l-2 border-r-2 border-success-500":o in e.schema_diff.removed?"border-t-2 border-l-2 border-r-2 border-danger-500":d.includes(o)?"border-brand-500 border-l-2 border-t-2 border-r-2":"border-r border-b border-neutral-100 dark:border-neutral-700 last:border-r-0",d.includes(o)?"bg-brand-10":"bg-neutral-5"),children:t.jsxs("div",{className:"flex justify-between",children:[t.jsxs("div",{className:"mr-2",children:[t.jsx("span",{children:o})," ",t.jsxs("small",{className:"text-neutral-500 font-medium",children:["(",e.schema_diff.source_schema[o]??e.schema_diff.target_schema[o],")"]})]}),M(d.includes(o))&&t.jsx("div",{className:"ml-2",children:t.jsxs("small",{className:"inline-block bg-neutral-10 px-2 py-0.5 rounded-full",children:[Math.round(i.all.filter(f=>Ae(e,o,f)).length/i.all.length*100),"%"]})})]})},o))})}),t.jsx("tbody",{children:Le(i.all)?i.all.map(o=>t.jsx("tr",{children:n.all.map(f=>Me(e,i.all,f,e.on)?t.jsxs(t.Fragment,{children:[t.jsx("td",{className:b("p-1 border-r border-b border-neutral-100 dark:border-neutral-700 last:border-r-0",ee(e,o,e.on)&&"bg-success-10 text-success-500",K(e,o,e.on)&&"bg-danger-5 text-danger-500"),children:t.jsx("div",{className:b("px-2 py-1 whitespace-nowrap font-bold rounded-md ",ee(e,o,e.on)&&"bg-success-10 text-success-500",K(e,o,e.on)&&"bg-danger-5 text-danger-500"),children:Ls(e,f,o)})},`${o}-${f}-source`),t.jsx("td",{className:b("p-1 border-r border-b border-neutral-100 dark:border-neutral-700 last:border-r-0",ee(e,o,e.on)&&"bg-success-10 text-success-500",K(e,o,e.on)&&"bg-danger-5 text-danger-500"),children:t.jsx("div",{className:b("px-2 py-1 whitespace-nowrap font-bold rounded-md",Ae(e,f,o)&&"bg-primary-10 text-primary-500",ee(e,o,e.on)&&"!bg-success-10 !text-success-500",K(e,o,e.on)&&"!bg-danger-5 !text-danger-500"),children:_s(e,f,o)})},`${o}-${f}-target`)]}):t.jsx("td",{className:b("p-1",f in e.schema_diff.added?"bg-success-10 border-l-2 border-r-2 border-success-500 text-success-500 font-bold":f in e.schema_diff.removed?"bg-danger-5 border-l-2 border-r-2 border-danger-500 !text-danger-500 font-bold":d.includes(f)?"border-brand-500 border-l-2 border-r-2":"border-r border-b border-neutral-100 dark:border-neutral-700 last:border-r-0",K(e,o,e.on)&&"!bg-danger-5 text-danger-500 font-bold",ee(e,o,e.on)&&"bg-success-10 text-success-500 font-bold"),children:t.jsx("div",{className:b("px-2 py-1 whitespace-nowrap rounded-md",(f in e.schema_diff.added||ee(e,o,e.on))&&"bg-success-10 text-success-500 font-bold",(f in e.schema_diff.removed||K(e,o,e.on))&&"!bg-danger-5 !text-danger-500 font-bold"),children:V(e,ge,f,o)??V(e,be,f,o)??We})},`${o}-${f}`))},o)):t.jsx(Lt,{columns:n.all.length>0?n.all.length:void 0})}),Le(i.all)&&t.jsx("tfoot",{className:"sticky bg-theme bottom-0",children:t.jsx("tr",{children:n.all.map(o=>Me(e,i.all,o,e.on)?t.jsxs(t.Fragment,{children:[t.jsx("th",{className:b("text-left whitespace-nowrap px-2 py-1 border-r border-t border-neutral-100 dark:border-neutral-700 last:border-r-0",d.includes(o)?"bg-brand-10":"bg-neutral-10"),children:"Source"},`${o}-source`),t.jsx("th",{className:b("text-left whitespace-nowrap px-2 py-1 border-r border-t border-neutral-100 dark:border-neutral-700 last:border-r-0",d.includes(o)?"bg-brand-10":"bg-primary-10"),children:"Target"},`${o}-target`)]}):t.jsxs("th",{className:b("text-left whitespace-nowrap px-2 py-1 font-bold",o in e.schema_diff.added?"border-b-2 border-l-2 border-r-2 border-success-500":o in e.schema_diff.removed?"border-b-2 border-l-2 border-r-2 border-danger-500":d.includes(o)?"border-brand-500 border-l-2 border-b-2 border-r-2":"border-r border-t border-neutral-100 dark:border-neutral-700 last:border-r-0",d.includes(o)?"bg-brand-10":"bg-neutral-10"),children:[(o in e.schema_diff.removed||a)&&t.jsx("span",{children:"Source"}),(o in e.schema_diff.added||r)&&t.jsx("span",{children:"Target"})]},o))})})]})}),t.jsxs("div",{className:"flex justify-between items-center px-2 mt-2",children:[t.jsx(_t,{count:i.all.length}),t.jsx($s,{})]})]})}function $s(){const e=[["Grain","bg-brand-500"],["Changed","bg-primary-500"],["Added","bg-success-500"],["Deleted","bg-danger-500"]];return t.jsx("div",{className:"flex text-xs",children:e.map(([s="",l])=>t.jsx(zs,{text:s,className:l},s))})}function zs({text:e,className:s}){return t.jsxs("div",{className:"flex ml-2 items-center",children:[t.jsx("span",{className:b("inline-block w-3 h-3 mr-2 rounded-full",s)}),t.jsx("small",{className:"text-neutral-600 dark:text-neutral-400",children:e})]})}function Os({diff:e,rows:s,columns:l}){return t.jsx(Fe,{defaultOpen:!1,children:({open:n})=>t.jsxs(t.Fragment,{children:[t.jsxs(Fe.Button,{className:"flex items-center w-full justify-between rounded-lg text-left text-sm px-4 pt-3 pb-2 bg-neutral-10 hover:bg-theme-darker dark:hover:bg-theme-lighter text-neutral-600 dark:text-neutral-400",children:[t.jsx("h2",{className:"whitespace-nowrap text-xl font-bold mb-1",children:"Stats"}),n?t.jsx(Bt,{className:"h-6 w-6 text-primary-500"}):t.jsx(Wt,{className:"h-6 w-6 text-primary-500"})]}),t.jsx(Fe.Panel,{className:"px-4 pb-2 text-sm text-neutral-500",children:t.jsxs("div",{className:"p-2 grid grid-cols-3 gap-4 mb-3",children:[t.jsx(Re,{text:"Row Count Change",children:t.jsxs("p",{className:"text-6xl font-light text-primary-500 mt-3",children:[Math.round(Math.abs(e.row_diff.count_pct_change)),t.jsx("small",{className:"text-sm",children:"%"})]})}),t.jsxs(Re,{text:"Column Count Change",count:s.all.length,children:[t.jsx("p",{className:"text-center text-6xl font-light text-primary-500 mt-3",children:s.modified}),t.jsx("p",{className:"text-center text-6xl font-light text-success-500 mt-3",children:s.added}),t.jsx("p",{className:"text-center text-6xl font-light text-danger-500 mt-3",children:s.deleted})]}),t.jsxs(Re,{text:"Column Changes",count:l.all.length,children:[t.jsx("p",{className:"text-center text-6xl font-light text-primary-500 mt-3",children:l.modified}),t.jsx("p",{className:"text-center text-6xl font-light text-success-500 mt-3",children:l.added}),t.jsx("p",{className:"text-center text-6xl font-light text-danger-500 mt-3",children:l.deleted})]})]})})]})})}function Re({text:e,children:s,className:l,count:n}){return t.jsxs("div",{className:b("rounded-xl overflow-hidden px-3 py-6 bg-primary-10",l),children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("h3",{className:"text-neutral-500 dark:text-neutral-300 text-sm font-bold",children:e}),k(n)&&t.jsx("div",{children:t.jsx("small",{className:"inline-block px-2 py-0.5 bg-neutral-10 rounded-full",children:n})})]}),t.jsx("div",{className:"grid grid-cols-3 gap-2",children:s})]})}const Qs=u.lazy(async()=>await Nt(()=>import("./ModelLineage-zWdKo0U2.js"),[])),X={Query:"Query",Table:"Data Preview",Lineage:"Lineage",Diff:"Diff",Errors:"Errors"};function Bs({tab:e,className:s}){const{errors:l,removeError:n}=et(),i=gt(),r=D(h=>h.models),a=D(h=>h.isModel),d=N(h=>h.direction),p=N(h=>h.previewQuery),o=N(h=>h.previewTable),f=N(h=>h.previewDiff),g=N(h=>h.setDirection),[E,m]=u.useState(-1),v=nt(e.file.path,h=>{i(`${bt.DataCatalogModels}/${h.name}`)}),I=r.get(e.file.path),j=M(e.file.isEmpty)&&k(I)&&a(e.file.path),c=l.size>0,w=u.useMemo(()=>[k(o)&&X.Table,k(p)&&e.file.isRemote&&X.Query,j&&X.Lineage,k(f)&&X.Diff,c&&X.Errors].filter(Boolean),[e.id,o,p,f,j,l,c]);return u.useEffect(()=>{k(o)?m(w.indexOf(X.Table)):m(0)},[o]),u.useEffect(()=>{k(f)?m(w.indexOf(X.Diff)):m(0)},[f]),u.useEffect(()=>{k(j)?m(w.indexOf(X.Lineage)):m(0)},[j]),u.useEffect(()=>{m(c?w.indexOf(X.Errors):0)},[c]),u.useEffect(()=>{for(const h of l)vt([B.Fetchdf,B.EvaluateModel,B.RenderQuery,B.ColumnLineage,B.ModelLineage,B.TableDiff,B.Table,B.SaveFile],h.key)&&n(h)},[o,f,p,j]),t.jsx("div",{className:b("w-full h-full flex flex-col text-prose overflow-auto hover:scrollbar scrollbar--vertical",s),children:jt(w)?t.jsx("div",{className:"flex justify-center items-center w-full h-full",children:t.jsx("h3",{className:"text-md",children:"No Data To Preview"})}):t.jsxs(ot,{as:u.Fragment,onChange:m,selectedIndex:E,children:[t.jsx(Be,{list:w,children:t.jsx("div",{className:"ml-2",children:t.jsx($,{className:"!m-0 !py-0.5 px-[0.25rem] border-none",variant:R.Alternative,size:T.sm,onClick:()=>{g(d==="horizontal"?"vertical":"horizontal")},children:t.jsx(ps,{"aria-label":d==="horizontal"?"Use vertical layout":"Use horizontal layout",className:"text-primary-500 w-5"})})})},w.join("-")),t.jsxs(it,{className:"h-full w-full overflow-hidden",children:[k(o)&&t.jsx(ae,{unmount:!1,className:b("w-full h-full pt-4 relative px-2","ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(At,{data:o})}),k(p)&&e.file.isRemote&&t.jsx(ae,{unmount:!1,className:"w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2 p-2",children:t.jsx("div",{className:"w-full h-full p-2 bg-primary-10 rounded-lg overflow-auto hover:scrollbar scrollbar--horizontal scrollbar--vertical",children:t.jsx(_e,{type:te.SQL,content:p??"",extensions:v,className:"text-xs"})})}),j&&t.jsx(ae,{as:"div",unmount:!1,className:b("w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(u.Suspense,{fallback:t.jsx(wt,{children:"Loading Model page..."}),children:t.jsx(Qs,{model:I})})}),k(f==null?void 0:f.row_diff)&&t.jsx(ae,{as:"div",unmount:!1,className:b("w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2 py-2"),children:t.jsx(As,{diff:f},e.id)}),c&&t.jsx(ae,{unmount:!1,className:"w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2 py-2",children:t.jsx("ul",{className:"w-full h-full p-2 overflow-auto hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:Array.from(l).reverse().map(h=>t.jsx("li",{className:"bg-danger-10 mb-4 last:m-0 p-2 rounded-md",children:t.jsx(Ht,{scope:h.key,error:h})},h.id))})})]})]},e.id)})}const ye=32,Ws=2;function He(){const e=N(s=>s.tab);return t.jsxs("div",{className:"w-full h-full flex flex-col overflow-hidden",children:[t.jsx(ys,{}),t.jsx(ce,{}),H(e)?t.jsx(Ge,{}):t.jsx(dt,{tab:e})]})}function Ge(){return t.jsx("div",{className:"flex justify-center items-center w-full h-full",children:t.jsx("div",{className:"p-4 text-center text-theme-darker dark:text-theme-lighter",children:t.jsx("h2",{className:"text-3xl",children:"Select File or Add New SQL Tab"})})})}function dt({tab:e}){const{errors:s,addError:l,removeError:n}=et(),i=D(x=>x.environment),r=D(x=>x.models),a=D(x=>x.isModel),d=le(x=>x.files),p=le(x=>x.selectedFile),o=le(x=>x.setSelectedFile),f=N(x=>x.direction),g=N(x=>x.engine),E=N(x=>x.previewTable),m=N(x=>x.previewDiff),v=N(x=>x.refreshTab),I=N(x=>x.updateStoredTabsIds),j=N(x=>x.setPreviewQuery),c=N(x=>x.setPreviewTable),w=N(x=>x.setPreviewDiff),h=N(x=>x.setDialects),{setManuallySelectedColumn:C}=zt(),L=u.useCallback(function(x){o(d.get(x.path))},[d]),_=u.useCallback(function(x,F){C([x,F])},[]),z=Ot(),ne=nt(e.file.path,L,_),[J,P]=u.useState(!1),G=u.useMemo(()=>[...z,{key:"Mod-Enter",win:"Ctrl-Enter",preventDefault:!0,stopPropagation:!0,run(x){const F=x.state.doc.toString();c(void 0),j(F);for(const O of s)O.key===B.Fetchdf&&n(O);return yt({sql:F}).then(O=>{c($e(O))}).catch(O=>{l(B.Fetchdf,{...O,errorKey:B.Fetchdf,trigger:"Editor -> customSQLKeymaps",message:O.message,timestamp:Date.now(),origin:"useQueryTimeout"})}),!0}}],[z,s]);u.useEffect(()=>{P(!1),H(p)&&o(e==null?void 0:e.file)},[e.id]),u.useEffect(()=>(g.addEventListener("message",ve),()=>{g.removeEventListener("message",ve)}),[e.id,e.dialect]),u.useEffect(()=>{j(void 0),c(void 0),w(void 0),I()},[e.id,e.file.fingerprint]),u.useEffect(()=>{w(void 0)},[i]);function Y(){const x=r.get(e.file.path),F=M(e.file.isEmpty)&&k(x)&&a(e.file.path);return s.size>0||[E,m].some(Boolean)||F?[70,30]:[100,0]}function ke(){const x=r.get(e==null?void 0:e.file.path);return J&&(k(x)&&a(e.file.path)||e.file.isLocal)&&M(me(e.file.content))?[70,30]:[100,0]}function de(x){e.file.content=x,v(e)}function ve(x){if(x.data.topic==="dialects"){const F=r.get(e.file.path);e.dialect=(F==null?void 0:F.dialect)??e.dialect??"",h(x.data.payload),v(e)}if(x.data.topic==="format"){if(me(x.data.payload))return;e.file.content=x.data.payload,v(e)}}return t.jsxs(Ve,{className:b("w-full h-full overflow-hidden",f==="vertical"?"flex flex-col":"flex"),sizes:Y(),direction:f,minSize:[ye,0],snapOffset:0,children:[t.jsxs("div",{className:b("flex flex-col",f==="vertical"?"w-full ":"h-full"),children:[t.jsxs(Ve,{className:"flex h-full overflow-hidden",sizes:ke(),minSize:ye,snapOffset:ye,handleDrag:(x,F)=>{const De=F.parent.getBoundingClientRect().width*(x[1]??0)/100;P(De>=ye+Ws)},children:[t.jsxs("div",{className:"flex flex-col h-full",children:[e.file.isLocal&&t.jsx(_e,{type:te.SQL,dialect:e.dialect,keymaps:G,content:e.file.content,extensions:ne,onChange:de}),e.file.isRemote&&t.jsx(Qt,{keymaps:z,path:e.file.path,children:({file:x,keymaps:F})=>t.jsx(_e,{type:x.extension,dialect:e.dialect,extensions:ne,keymaps:F,content:x.content,onChange:de})})]}),t.jsx("div",{className:"flex flex-col h-full",children:t.jsx(Es,{tab:e,toggle:()=>P(x=>!x),isOpen:J})})]},e.id),t.jsx(ce,{}),t.jsx(ws,{tab:e},e.file.fingerprint)]}),t.jsx(Bs,{tab:e,className:b(f==="vertical"?"flex flex-col":"flex")})]},f)}He.Empty=Ge;He.Loading=Ge;He.Main=dt;export{He as default};
1
+ import{r as u,R as oe,g as Le,j as t,i as k,c as b,v as H,f as mt,b as M,a as D,l as T,I as me,B as $,m as R,P as Ie,a4 as Ue,a5 as xt,a6 as ht,H as ce,S as Pe,af as Ke,ag as pt,d as et,s as gt,e as bt,q as vt,F as B,D as jt,a7 as wt,_ as Nt,ah as yt}from"./index-Dj0i1-CA.js";import{u as le,M as Tt}from"./project-BvSOI8MY.js";import{S as Ve}from"./SplitPane-CViaZmw6.js";import{E as te,M as Et}from"./file-CvJN3aZO.js";import{u as N}from"./editor-CcO28cqd.js";import{I as y}from"./Input-B-oZ6fGO.js";import{F as Pt,L as St}from"./ListboxShow-BE5-xevs.js";import{B as Ye}from"./Banner-DSRbUlO5.js";import{m as Ct,h as tt,s as kt,K as xe,ak as we,y as he,o as se,n as Te,a4 as ue,L as pe,$ as st,_ as lt,d as fe,r as Ne,a0 as Dt,a as q,g as re,T as U,q as It,W as Ft,X as Mt,Y as Rt,R as Ze}from"./popover-_Sf0yvOI.js";import{g as $e,G as Lt,F as _t,T as At}from"./help-DuPhjipa.js";import{M as $t,u as nt,a as _e,b as zt,c as Ot,C as Qt}from"./context-BctCsyGb.js";import{V as Fe,F as Bt,a as Wt}from"./PlusCircleIcon-DVXAHG8_.js";import{D as Ht}from"./ReportErrors-B7FEPzMB.js";import"./floating-ui.react-dom-CjE-JNW1.js";import"./index-C-dJH7yZ.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./help-B59vE3aE.js";import"./SourceList-DSLO6nVJ.js";function Gt({onFocus:e}){let[s,l]=u.useState(!0),n=Ct();return s?oe.createElement(tt,{as:"button",type:"button",features:kt.Focusable,onFocus:i=>{i.preventDefault();let r,a=50;function d(){if(a--<=0){r&&cancelAnimationFrame(r);return}if(e()){if(cancelAnimationFrame(r),!n.current)return;l(!1);return}r=requestAnimationFrame(d)}r=requestAnimationFrame(d)}}):null}const rt=u.createContext(null);function qt(){return{groups:new Map,get(e,s){var l;let n=this.groups.get(e);n||(n=new Map,this.groups.set(e,n));let i=(l=n.get(s))!=null?l:0;n.set(s,i+1);let r=Array.from(n.keys()).indexOf(s);function a(){let d=n.get(s);d>1?n.set(s,d-1):n.delete(s)}return[r,a]}}}function Ut({children:e}){let s=u.useRef(qt());return u.createElement(rt.Provider,{value:s},e)}function at(e){let s=u.useContext(rt);if(!s)throw new Error("You must wrap your component in a <StableCollection>");let l=u.useId(),[n,i]=s.current.get(e,l);return u.useEffect(()=>i,[]),n}var Vt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Vt||{}),Yt=(e=>(e[e.Less=-1]="Less",e[e.Equal=0]="Equal",e[e.Greater=1]="Greater",e))(Yt||{}),Zt=(e=>(e[e.SetSelectedIndex=0]="SetSelectedIndex",e[e.RegisterTab=1]="RegisterTab",e[e.UnregisterTab=2]="UnregisterTab",e[e.RegisterPanel=3]="RegisterPanel",e[e.UnregisterPanel=4]="UnregisterPanel",e))(Zt||{});let Xt={0(e,s){var l;let n=ue(e.tabs,f=>f.current),i=ue(e.panels,f=>f.current),r=n.filter(f=>{var g;return!((g=f.current)!=null&&g.hasAttribute("disabled"))}),a={...e,tabs:n,panels:i};if(s.index<0||s.index>n.length-1){let f=fe(Math.sign(s.index-e.selectedIndex),{[-1]:()=>1,0:()=>fe(Math.sign(s.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(r.length===0)return a;let g=fe(f,{0:()=>n.indexOf(r[0]),1:()=>n.indexOf(r[r.length-1])});return{...a,selectedIndex:g===-1?e.selectedIndex:g}}let d=n.slice(0,s.index),p=[...n.slice(s.index),...d].find(f=>r.includes(f));if(!p)return a;let o=(l=n.indexOf(p))!=null?l:e.selectedIndex;return o===-1&&(o=e.selectedIndex),{...a,selectedIndex:o}},1(e,s){if(e.tabs.includes(s.tab))return e;let l=e.tabs[e.selectedIndex],n=ue([...e.tabs,s.tab],r=>r.current),i=e.selectedIndex;return e.info.current.isControlled||(i=n.indexOf(l),i===-1&&(i=e.selectedIndex)),{...e,tabs:n,selectedIndex:i}},2(e,s){return{...e,tabs:e.tabs.filter(l=>l!==s.tab)}},3(e,s){return e.panels.includes(s.panel)?e:{...e,panels:ue([...e.panels,s.panel],l=>l.current)}},4(e,s){return{...e,panels:e.panels.filter(l=>l!==s.panel)}}},ze=u.createContext(null);ze.displayName="TabsDataContext";function ie(e){let s=u.useContext(ze);if(s===null){let l=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,ie),l}return s}let Oe=u.createContext(null);Oe.displayName="TabsActionsContext";function Qe(e){let s=u.useContext(Oe);if(s===null){let l=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,Qe),l}return s}function Jt(e,s){return fe(s.type,Xt,e,s)}let Kt="div";function es(e,s){let{defaultIndex:l=0,vertical:n=!1,manual:i=!1,onChange:r,selectedIndex:a=null,...d}=e;const p=n?"vertical":"horizontal",o=i?"manual":"auto";let f=a!==null,g=we({isControlled:f}),E=he(s),[m,v]=u.useReducer(Jt,{info:g,selectedIndex:a??l,tabs:[],panels:[]}),I=u.useMemo(()=>({selectedIndex:m.selectedIndex}),[m.selectedIndex]),j=we(r||(()=>{})),c=we(m.tabs),w=u.useMemo(()=>({orientation:p,activation:o,...m}),[p,o,m]),h=se(P=>(v({type:1,tab:P}),()=>v({type:2,tab:P}))),C=se(P=>(v({type:3,panel:P}),()=>v({type:4,panel:P}))),L=se(P=>{_.current!==P&&j.current(P),f||v({type:0,index:P})}),_=we(f?e.selectedIndex:m.selectedIndex),z=u.useMemo(()=>({registerTab:h,registerPanel:C,change:L}),[]);Te(()=>{v({type:0,index:a??l})},[a]),Te(()=>{if(_.current===void 0||m.tabs.length<=0)return;let P=ue(m.tabs,G=>G.current);P.some((G,Y)=>m.tabs[Y]!==G)&&L(P.indexOf(m.tabs[_.current]))});let ne={ref:E},J=pe();return oe.createElement(Ut,null,oe.createElement(Oe.Provider,{value:z},oe.createElement(ze.Provider,{value:w},w.tabs.length<=0&&oe.createElement(Gt,{onFocus:()=>{var P,G;for(let Y of c.current)if(((P=Y.current)==null?void 0:P.tabIndex)===0)return(G=Y.current)==null||G.focus(),!0;return!1}}),J({ourProps:ne,theirProps:d,slot:I,defaultTag:Kt,name:"Tabs"}))))}let ts="div";function ss(e,s){let{orientation:l,selectedIndex:n}=ie("Tab.List"),i=he(s),r=u.useMemo(()=>({selectedIndex:n}),[n]),a=e,d={ref:i,role:"tablist","aria-orientation":l};return pe()({ourProps:d,theirProps:a,slot:r,defaultTag:ts,name:"Tabs.List"})}let ls="button";function ns(e,s){var l,n;let i=u.useId(),{id:r=`headlessui-tabs-tab-${i}`,disabled:a=!1,autoFocus:d=!1,...p}=e,{orientation:o,activation:f,selectedIndex:g,tabs:E,panels:m}=ie("Tab"),v=Qe("Tab"),I=ie("Tab"),[j,c]=u.useState(null),w=u.useRef(null),h=he(w,s,c);Te(()=>v.registerTab(w),[v,w]);let C=at("tabs"),L=E.indexOf(w);L===-1&&(L=C);let _=L===g,z=se(S=>{var Z;let je=S();if(je===Ne.Success&&f==="auto"){let ut=(Z=Dt(w))==null?void 0:Z.activeElement,qe=I.tabs.findIndex(ft=>ft.current===ut);qe!==-1&&v.change(qe)}return je}),ne=se(S=>{let Z=E.map(je=>je.current).filter(Boolean);if(S.key===q.Space||S.key===q.Enter){S.preventDefault(),S.stopPropagation(),v.change(L);return}switch(S.key){case q.Home:case q.PageUp:return S.preventDefault(),S.stopPropagation(),z(()=>re(Z,U.First));case q.End:case q.PageDown:return S.preventDefault(),S.stopPropagation(),z(()=>re(Z,U.Last))}if(z(()=>fe(o,{vertical(){return S.key===q.ArrowUp?re(Z,U.Previous|U.WrapAround):S.key===q.ArrowDown?re(Z,U.Next|U.WrapAround):Ne.Error},horizontal(){return S.key===q.ArrowLeft?re(Z,U.Previous|U.WrapAround):S.key===q.ArrowRight?re(Z,U.Next|U.WrapAround):Ne.Error}}))===Ne.Success)return S.preventDefault()}),J=u.useRef(!1),P=se(()=>{var S;J.current||(J.current=!0,(S=w.current)==null||S.focus({preventScroll:!0}),v.change(L),It(()=>{J.current=!1}))}),G=se(S=>{S.preventDefault()}),{isFocusVisible:Y,focusProps:ke}=st({autoFocus:d}),{isHovered:de,hoverProps:ve}=Ft({isDisabled:a}),{pressed:x,pressProps:F}=Mt({disabled:a}),O=u.useMemo(()=>({selected:_,hover:de,active:x,focus:Y,autofocus:d,disabled:a}),[_,de,Y,x,d,a]),De=lt({ref:h,onKeyDown:ne,onMouseDown:G,onClick:P,id:r,role:"tab",type:Rt(e,j),"aria-controls":(n=(l=m[L])==null?void 0:l.current)==null?void 0:n.id,"aria-selected":_,tabIndex:_?0:-1,disabled:a||void 0,autoFocus:d},ke,ve,F);return pe()({ourProps:De,theirProps:p,slot:O,defaultTag:ls,name:"Tabs.Tab"})}let rs="div";function as(e,s){let{selectedIndex:l}=ie("Tab.Panels"),n=he(s),i=u.useMemo(()=>({selectedIndex:l}),[l]),r=e,a={ref:n};return pe()({ourProps:a,theirProps:r,slot:i,defaultTag:rs,name:"Tabs.Panels"})}let os="div",is=Ze.RenderStrategy|Ze.Static;function cs(e,s){var l,n,i,r;let a=u.useId(),{id:d=`headlessui-tabs-panel-${a}`,tabIndex:p=0,...o}=e,{selectedIndex:f,tabs:g,panels:E}=ie("Tab.Panel"),m=Qe("Tab.Panel"),v=u.useRef(null),I=he(v,s);Te(()=>m.registerPanel(v),[m,v]);let j=at("panels"),c=E.indexOf(v);c===-1&&(c=j);let w=c===f,{isFocusVisible:h,focusProps:C}=st(),L=u.useMemo(()=>({selected:w,focus:h}),[w,h]),_=lt({ref:I,id:d,role:"tabpanel","aria-labelledby":(n=(l=g[c])==null?void 0:l.current)==null?void 0:n.id,tabIndex:w?p:-1},C),z=pe();return!w&&((i=o.unmount)==null||i)&&!((r=o.static)!=null&&r)?oe.createElement(tt,{"aria-hidden":"true",..._}):z({ourProps:_,theirProps:o,slot:L,defaultTag:os,features:is,visible:w,name:"Tabs.Panel"})}let ds=xe(ns),ot=xe(es),us=xe(ss),it=xe(as),ae=xe(cs),W=Object.assign(ds,{Group:ot,List:us,Panels:it,Panel:ae});function fs({title:e,titleId:s,...l},n){return u.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},l),e?u.createElement("title",{id:s},e):null,u.createElement("path",{fillRule:"evenodd",d:"M3 6.75A.75.75 0 0 1 3.75 6h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 6.75ZM3 12a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 12Zm0 5.25a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}const ct=u.forwardRef(fs);function ms({title:e,titleId:s,...l},n){return u.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},l),e?u.createElement("title",{id:s},e):null,u.createElement("path",{fillRule:"evenodd",d:"M12 3.75a.75.75 0 0 1 .75.75v6.75h6.75a.75.75 0 0 1 0 1.5h-6.75v6.75a.75.75 0 0 1-1.5 0v-6.75H4.5a.75.75 0 0 1 0-1.5h6.75V4.5a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"}))}const xs=u.forwardRef(ms);function hs({title:e,titleId:s,...l},n){return u.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},l),e?u.createElement("title",{id:s},e):null,u.createElement("path",{d:"M15 3.75H9v16.5h6V3.75ZM16.5 20.25h3.375c1.035 0 1.875-.84 1.875-1.875V5.625c0-1.036-.84-1.875-1.875-1.875H16.5v16.5ZM4.125 3.75H7.5v16.5H4.125a1.875 1.875 0 0 1-1.875-1.875V5.625c0-1.036.84-1.875 1.875-1.875Z"}))}const ps=u.forwardRef(hs);function gs(e){switch(e){case te.SQL:return"SQL";case te.PY:return"Python";case te.YAML:case te.YML:return"YAML";default:return"Plain Text"}}function bs(e,s){return e.file.extension===te.SQL&&e.file.isLocal&&Le(s)}const A=function({text:s,children:l,className:n}){return t.jsxs("small",{className:b("font-bold whitespace-nowrap text-xs",n),children:[k(s)&&t.jsxs("span",{children:[s,": "]}),l]})};function vs({text:e,className:s}){return t.jsx("span",{className:b("font-normal",s),children:e})}function js({ok:e,className:s}){return t.jsx("span",{className:b("inline-block w-2 h-2 rounded-full",H(e)&&"bg-warning-500",mt(e)&&"bg-success-500",M(e)&&"bg-danger-500",s)})}A.Text=vs;A.Light=js;const Q={Model:"model",Test:"test",Macro:"macro",Hook:"hook",Log:"log",Config:"config",Seed:"seed",Metric:"metric",Schema:"schema",Unknown:"unknown"};function ws({tab:e}){const s=D(a=>a.isModel),l=N(a=>a.engine),n=N(a=>a.dialects),i=N(a=>a.refreshTab);u.useEffect(()=>{var d;const a=(d=n[0])==null?void 0:d.dialect_name;H(e.dialect)&&k(a)&&r(a)},[n,e]);function r(a){e.dialect=a,i(e),l.postMessage({topic:"dialect",payload:e.dialect})}return t.jsxs("div",{className:"flex w-full items-center px-2 min-h-[2rem] overflow-hidden",children:[e.file.isRemote&&t.jsx(A,{className:"mr-2",text:"Saved",children:t.jsx(A.Light,{ok:M(e.file.isChanged)})}),e.file.isRemote&&e.file.isSQL&&t.jsx(A,{className:"mr-2",text:"Formatted",children:t.jsx(A.Light,{ok:e.file.isFormatted})}),t.jsx(A,{className:"mr-2",text:"Language",children:t.jsx(A.Text,{text:gs(e.file.extension)})}),bs(e,n)&&t.jsx(A,{className:"mr-2",text:"Dialect",children:t.jsx(y,{size:T.sm,children:({className:a,size:d})=>t.jsx(y.Selector,{className:a,size:d,list:n.map(p=>({text:p.dialect_title,value:me(p.dialect_name)?"sqlglot":p.dialect_name})),onChange:r,value:e.dialect})})}),s(e.file.path)&&!me(e.dialect)&&t.jsx(A,{className:"mr-2",text:"Dialect",children:t.jsx(A.Text,{text:e.dialect})}),t.jsx(A,{className:"mr-2",text:"SQLMesh Type",children:t.jsx(A.Text,{text:Ns(e.file.path)})})]})}function Ns(e){return me(e)?Q.Unknown:e.startsWith("models")?Q.Model:e.startsWith("tests")?Q.Test:e.startsWith("logs")?Q.Log:e.startsWith("macros")?Q.Macro:e.startsWith("hooks")?Q.Hook:e.startsWith("seeds")?Q.Seed:e.startsWith("metrics")?Q.Metric:["config.yaml","config.yml","config.py"].includes(e)?Q.Config:["external_models.yaml","schema.yaml"].includes(e)?Q.Schema:Q.Unknown}function Xe({tab:e,title:s}){const l=u.useRef(null),n=D(g=>g.addConfirmation),i=le(g=>g.setSelectedFile),r=N(g=>g.closeTab),a=N(g=>g.tab),d=e.file.id===(a==null?void 0:a.file.id);return u.useEffect(()=>{H(e)||(e.el=l.current??void 0)},[l,e]),u.useEffect(()=>{H(a)||setTimeout(()=>{var g;(g=a.el)==null||g.scrollIntoView({behavior:"smooth",inline:"center"})},300)},[a]),t.jsx("li",{ref:l,className:b("inline-block py-1 pr-2 last-child:pr-0 overflow-hidden text-center overflow-ellipsis cursor-pointer"),onClick:p,children:t.jsxs("span",{className:b("flex border-2 justify-between items-center pl-1 pr-1 py-[0.125rem] min-w-[8rem] rounded-md group border-transparent border-r border-r-theme-darker dark:border-r-theme-lighter",d?"bg-neutral-200 border-neutral-200 text-neutral-900 dark:bg-dark-lighter dark:border-dark-lighter dark:text-primary-500":"bg-trasparent hover:bg-theme-darker dark:hover:bg-theme-lighter"),children:[t.jsx("small",{className:"text-xs",children:s}),t.jsx("small",{className:b("group-hover:hidden text-xs inline-block ml-3 mr-1 w-2 h-2 rounded-full",e.file.isChanged?"bg-warning-500":"bg-transparent")}),t.jsx(Pt,{className:"hidden group-hover:inline-block text-neutral-600 dark:text-neutral-100 w-4 h-4 ml-2 mr-0 cursor-pointer",onClick:o})]})});function p(g){g.stopPropagation(),i(e.file)}function o(g){g.stopPropagation(),f()}function f(){e.file.isChanged?n({headline:"Closing Tab",description:"All unsaved changes will be lost. Do you want to close the tab anyway?",yesText:"Yes, Close Tab",noText:"No, Cancel",action:()=>r(e.file)}):r(e.file)}}function ys(){const e=D(c=>c.modules),s=D(c=>c.models),l=D(c=>c.lastSelectedModel),n=D(c=>c.setLastSelectedModel),i=le(c=>c.files),r=le(c=>c.selectedFile),a=le(c=>c.setSelectedFile),d=N(c=>c.tab),p=N(c=>c.tabs),o=N(c=>c.replaceTab),f=N(c=>c.createTab),g=N(c=>c.selectTab),E=N(c=>c.addTab),[m,v]=u.useMemo(()=>{const c=[],w=[];return p.forEach(h=>{h.file.isLocal&&c.push(h),h.file.isRemote&&w.push(h)}),[c,w]},[p]);return u.useEffect(()=>{if(H(r)||(d==null?void 0:d.file)===r||r instanceof Tt||M(e.hasFiles))return;n(s.get(r.path));const c=f(r);k(d)&&d.file instanceof Et&&M(d.file.isChanged)&&d.file.isRemote&&M(p.has(r))?o(d,c):E(c),g(c)},[r,e]),u.useEffect(()=>{if(H(l))return;const c=i.get(l.path);H(c)||a(c)},[l]),t.jsxs("div",{className:"flex items-center bg-neutral-5",children:[t.jsx($,{className:"h-6 m-0 ml-1 mr-2 border-none",variant:R.Alternative,size:T.sm,onClick:I,children:t.jsx(xs,{className:"inline-block w-3 h-4"})}),t.jsxs("ul",{className:"w-full whitespace-nowrap min-h-[2rem] max-h-[2rem] overflow-hidden overflow-x-auto hover:scrollbar scrollbar--horizontal",children:[m.map((c,w)=>t.jsx(Xe,{tab:c,title:`Custom SQL ${w+1}`},c.id)),v.map(c=>t.jsx(Xe,{tab:c,title:c.file.name},c.id))]})]});function I(c){c.stopPropagation(),j()}function j(){const c=f();E(c),g(c),a(c.file)}}function Be({list:e,children:s=[],className:l,disabled:n=!1}){return t.jsxs(W.List,{className:b("w-full whitespace-nowrap px-2 flex justify-center items-center",n&&"cursor-not-allowed"),children:[t.jsx("div",{className:b("flex w-full overflow-hidden overflow-x-auto py-1 hover:scrollbar scrollbar--horizontal",l,n&&"opacity-50 pointer-events-none"),children:t.jsx("div",{className:"flex p-1 items-center bg-secondary-10 dark:bg-primary-10 cursor-pointer rounded-full overflow-hidden",children:e.map(i=>t.jsx(W,{className:({selected:r})=>b("text-xs px-2 py-0.5 mr-2 last:mr-0 rounded-full relative align-middle",r?"bg-secondary-500 text-secondary-100 cursor-default font-bold":"cursor-pointer font-medium text-secondary-400 dark:text-secondary-400"),children:i},i))})}),s]})}const Je=1440*60*1e3,Ts=1e3,Ee=50;function Es({tab:e,isOpen:s=!0,toggle:l}){const n=D(a=>a.models),i=D(a=>a.isModel),r=u.useMemo(()=>n.get(e.file.path),[e,n]);return t.jsx("div",{className:b("flex flex-col w-full h-full items-center overflow-hidden"),children:i(e.file.path)?k(r)&&t.jsx(Ps,{tab:e,model:r,isOpen:s,toggle:l}):t.jsx(Ss,{tab:e,isOpen:s,toggle:l})})}function Ps({tab:e,model:s,isOpen:l=!0,toggle:n}){const i=D(d=>d.environment),r=D(d=>d.environments),a=Array.from(r).filter(({isRemote:d})=>d).map(({name:d})=>({text:d,value:d}));return t.jsxs(W.Group,{children:[t.jsxs("div",{className:"flex w-full items-center",children:[t.jsx($,{className:b("h-6 w-6 !px-0 border-none bg-neutral-10 dark:bg-neutral-20",l?"text-secondary-500 dark:text-secondary-300":"text-neutral-500 dark:text-neutral-300"),variant:R.Info,size:T.sm,onClick:d=>{d.stopPropagation(),n==null||n()},children:t.jsx(ct,{className:"w-4 h-4"})}),l&&t.jsx(Be,{className:"flex justify-center items-center",list:["Evaluate","Columns",a.length>1&&i.isRemote&&"Diff"].filter(Boolean)})]}),l&&t.jsxs(W.Panels,{className:"h-full w-full overflow-hidden",children:[t.jsx(W.Panel,{unmount:!1,className:b("flex flex-col w-full h-full relative overflow-hidden","ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(Ds,{model:s})}),t.jsx(W.Panel,{unmount:!1,className:"text-xs w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2 px-2",children:t.jsx($t,{nodeId:s.fqn,columns:s.columns,disabled:M(s.isModelSQL),withHandles:!1,withSource:!1,withDescription:!0,limit:10})}),a.length>1&&i.isRemote&&t.jsx(W.Panel,{unmount:!1,className:b("flex flex-col w-full h-full relative overflow-hidden","ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(Is,{tab:e,model:s,list:a.filter(({value:d})=>i.name!==d),target:{text:i.name,value:i.name}})})]})]})}function Ss({tab:e,isOpen:s=!0,toggle:l}){return t.jsxs(W.Group,{children:[t.jsxs("div",{className:"flex w-full items-center",children:[t.jsx($,{className:b("h-6 w-6 !px-0 border-none bg-neutral-10 dark:bg-neutral-20",s?"text-secondary-500 dark:text-secondary-300":"text-neutral-500 dark:text-neutral-300"),variant:R.Info,size:T.sm,onClick:n=>{n.stopPropagation(),l==null||l()},children:t.jsx(ct,{className:"w-4 h-4"})}),s&&t.jsx(Be,{className:"flex justify-center items-center",list:["Run Query","Diff"]})]}),s&&t.jsxs(W.Panels,{className:"h-full w-full overflow-hidden",children:[t.jsx(W.Panel,{unmount:!1,className:b("flex flex-col w-full h-full relative overflow-hidden","ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(ks,{tab:e})}),t.jsx(W.Panel,{unmount:!1,className:b("flex flex-col w-full h-full relative overflow-hidden","ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(Fs,{})})]})]})}function Cs({children:e}){return t.jsx("fieldset",{className:"flex my-3",children:e})}function Se({children:e}){return t.jsx("div",{className:"flex w-full h-full py-1 overflow-hidden overflow-y-auto hover:scrollbar scrollbar--vertical",children:e})}function Ce({children:e}){return t.jsx("div",{className:"flex w-full py-1 px-1 justify-end",children:e})}function ks({tab:e}){const s=N(p=>p.setPreviewQuery),l=N(p=>p.setPreviewTable),n=N(p=>p.engine),{refetch:i,isFetching:r,cancel:a}=pt({sql:e.file.content});u.useEffect(()=>()=>{a()},[]);function d(){l(void 0),s(e.file.content),i().then(({data:p})=>{l($e(p))})}return t.jsxs(t.Fragment,{children:[t.jsx(Se,{}),t.jsx(ce,{}),t.jsxs(Ce,{children:[t.jsx($,{size:T.sm,variant:R.Alternative,onClick:p=>{p.stopPropagation(),n.postMessage({topic:"format",payload:{sql:e.file.content,dialect:e.dialect}})},children:"Format"}),r?t.jsxs("div",{className:"flex items-center",children:[t.jsx(Pe,{className:"w-3"}),t.jsx("small",{className:"text-xs text-neutral-400 block mx-2",children:"Running Query..."}),t.jsx($,{size:T.sm,variant:R.Danger,onClick:p=>{p.stopPropagation(),a()},children:"Cancel"})]}):t.jsx($,{size:T.sm,variant:R.Alternative,disabled:r,onClick:p=>{p.stopPropagation(),d()},children:"Run Query"})]})]})}function Ds({model:e}){const s=D(m=>m.environment),l=D(m=>m.isModel),n=N(m=>m.setPreviewQuery),i=N(m=>m.setPreviewTable),[r,a]=u.useState({model:e.displayName,start:Ie(Ue(Date.now()-Je)),end:Ie(new Date),execution_time:Ie(Ue(Date.now()-Je)),limit:1e3}),{refetch:d}=xt({model:r.model,start:r.start,end:r.end,execution_time:r.execution_time,dialect:e.dialect,pretty:!0}),{refetch:p,isFetching:o,cancel:f}=ht(r),g=l(e.path)&&Object.values(r).every(Boolean);u.useEffect(()=>()=>{f()},[]);function E(){n(void 0),i(void 0),d().then(({data:m})=>{n(m==null?void 0:m.sql)}),p().then(({data:m})=>{i($e(m))})}return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsxs("form",{className:"w-full",children:[M(g)&&t.jsx(Cs,{children:t.jsx(Ye,{variant:R.Warning,children:t.jsxs(Ye.Description,{className:"w-full mr-2 text-sm",children:["Please fill out all fields to ",t.jsx("b",{children:"evaluate the model"}),"."]})})}),t.jsxs("fieldset",{className:"px-2 w-full text-neutral-500",children:[t.jsx(y,{className:"w-full mx-0",label:"Start Date",size:T.sm,children:({className:m})=>t.jsx(y.Textfield,{className:b(m,"w-full"),placeholder:"02/11/2023",value:r.start,onInput:v=>{v.stopPropagation(),a({...r,start:v.target.value??""})}})}),t.jsx(y,{className:"w-full mx-0",label:"End Date",size:T.sm,children:({className:m})=>t.jsx(y.Textfield,{className:b(m,"w-full"),placeholder:"02/13/2023",value:r.end,onInput:v=>{v.stopPropagation(),a({...r,end:v.target.value??""})}})}),t.jsx(y,{className:"w-full mx-0",label:"Execution Time",size:T.sm,children:({className:m})=>t.jsx(y.Textfield,{className:b(m,"w-full"),placeholder:"02/13/2023",value:r.execution_time,onInput:v=>{v.stopPropagation(),a({...r,execution_time:v.target.value??""})}})}),k(r.limit)&&t.jsx(y,{className:"w-full mx-0",label:"Limit",size:T.sm,children:({className:m})=>t.jsx(y.Textfield,{className:b(m,"w-full"),type:"number",placeholder:"1000",value:r.limit,onInput:v=>{v.stopPropagation(),a({...r,limit:v.target.valueAsNumber??Ts})}})})]})]})}),t.jsx(ce,{}),t.jsx(Ce,{children:t.jsx("div",{className:"flex w-full justify-end",children:l(e.path)&&o?t.jsxs("div",{className:"flex items-center",children:[t.jsx(Pe,{className:"w-3"}),t.jsx("small",{className:"text-xs text-neutral-400 block mx-2",children:"Evaluating..."}),t.jsx($,{size:T.sm,variant:R.Danger,onClick:m=>{m.stopPropagation(),f()},children:"Cancel"})]}):t.jsx($,{size:T.sm,variant:R.Alternative,disabled:M(g)||o||s.isInitialProd,onClick:m=>{m.stopPropagation(),E()},children:"Evaluate"})})})]})}function Is({tab:e,model:s,list:l,target:n}){const i=D(h=>h.isModel),r=N(h=>h.setPreviewDiff),[a,d]=u.useState(l[0].value),[p,o]=u.useState(Ee),[f,g]=u.useState(""),[E,m]=u.useState(""),{refetch:v,isFetching:I,cancel:j}=Ke({source:a,target:n.value,model_or_snapshot:s.name,limit:p,on:f,where:E}),c=u.useCallback(()=>{r(void 0),v().then(({data:h})=>{r(h)})},[s.name,s.hash]);u.useEffect(()=>()=>{j()},[]),u.useEffect(()=>{d(l[0].value)},[l]);const w=i(e.file.path)&&[a,n,p].every(Boolean);return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsx("form",{className:"w-full",children:t.jsxs("fieldset",{className:"px-2 w-full text-neutral-500",children:[t.jsx(y,{className:"w-full mx-0",label:"Source",disabled:l.length<2,size:T.sm,children:({disabled:h,className:C})=>t.jsx(y.Selector,{className:b(C,"w-full"),list:l,value:a,disabled:h,onChange:d})}),t.jsx(y,{className:"w-full mx-0",label:"Target",disabled:!0,children:({disabled:h,className:C})=>t.jsx(y.Textfield,{className:b(C,"w-full"),disabled:h,value:n.value})}),t.jsx(y,{className:"w-full mx-0",label:"Limit",size:T.sm,children:({className:h})=>t.jsx(y.Textfield,{className:b(h,"w-full"),type:"number",placeholder:"1000",value:p,onInput:C=>{C.stopPropagation(),o(C.target.valueAsNumber??Ee)}})}),t.jsx(y,{className:"w-full mx-0",label:"ON",size:T.sm,children:({className:h})=>t.jsx(y.Textfield,{className:b(h,"w-full"),placeholder:"s.id = t.id",value:f,onInput:C=>{C.stopPropagation(),g(C.target.value)}})}),t.jsx(y,{className:"w-full mx-0",label:"WHERE",size:T.sm,children:({className:h})=>t.jsx(y.Textfield,{className:b(h,"w-full"),placeholder:"id > 10",value:E,onInput:C=>{C.stopPropagation(),m(C.target.value)}})})]})})}),t.jsx(ce,{}),t.jsx(Ce,{children:t.jsx("div",{className:"flex w-full justify-end items-center px-2",children:I?t.jsxs("div",{className:"flex items-center",children:[t.jsx(Pe,{className:"w-3"}),t.jsx("small",{className:"text-xs text-neutral-400 block mx-2",children:"Getting Diff..."}),t.jsx($,{size:T.sm,variant:R.Danger,onClick:h=>{h.stopPropagation(),j()},children:"Cancel"})]}):t.jsx($,{className:"ml-2",size:T.sm,variant:R.Alternative,disabled:M(w)||I,onClick:h=>{h.stopPropagation(),c()},children:"Get Diff"})})})]})}function Fs(){const e=N(j=>j.setPreviewDiff),[s,l]=u.useState(""),[n,i]=u.useState(""),[r,a]=u.useState(Ee),[d,p]=u.useState(""),[o,f]=u.useState(""),{refetch:g,isFetching:E,cancel:m}=Ke({source:s,target:n,limit:r,on:d,where:o});u.useEffect(()=>()=>{m()},[]);function v(){e(void 0),g().then(({data:j})=>{e(j)})}const I=[s,n,r,d].every(Boolean);return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsx("form",{className:"w-full",children:t.jsxs("fieldset",{className:"px-2 w-full text-neutral-500",children:[t.jsx(y,{className:"w-full mx-0",label:"Source",size:T.sm,children:({className:j})=>t.jsx(y.Textfield,{className:b(j,"w-full"),placeholder:"exp.tst_model__dev",value:s,onInput:c=>{c.stopPropagation(),l(c.target.value)}})}),t.jsx(y,{className:"w-full mx-0",label:"Target",size:T.sm,children:({className:j})=>t.jsx(y.Textfield,{className:b(j,"w-full"),placeholder:"exp.tst_snapshot__1353336088",value:n,onInput:c=>{c.stopPropagation(),i(c.target.value)}})}),t.jsx(y,{className:"w-full mx-0",label:"Limit",size:T.sm,children:({className:j})=>t.jsx(y.Textfield,{className:b(j,"w-full"),type:"number",placeholder:"1000",value:r,onInput:c=>{c.stopPropagation(),a(c.target.valueAsNumber??Ee)}})}),t.jsx(y,{className:"w-full mx-0",label:"ON",size:T.sm,children:({className:j})=>t.jsx(y.Textfield,{className:b(j,"w-full"),placeholder:"s.id = t.id",value:d,onInput:c=>{c.stopPropagation(),p(c.target.value)}})}),t.jsx(y,{className:"w-full mx-0",label:"WHERE",size:T.sm,children:({className:j})=>t.jsx(y.Textfield,{className:b(j,"w-full"),placeholder:"id > 10",value:o,onInput:c=>{c.stopPropagation(),f(c.target.value)}})})]})})}),t.jsx(ce,{}),t.jsx(Ce,{children:E?t.jsxs("div",{className:"flex items-center",children:[t.jsx(Pe,{className:"w-3"}),t.jsx("small",{className:"text-xs text-neutral-400 block mx-2",children:"Getting Diff..."}),t.jsx($,{size:T.sm,variant:R.Danger,onClick:j=>{j.stopPropagation(),m()},children:"Cancel"})]}):t.jsx($,{className:"ml-2",size:T.sm,variant:R.Alternative,disabled:M(I)||E,onClick:j=>{j.stopPropagation(),v()},children:"Get Diff"})})]})}const ge="s__",be="t__",We="NULL";function Ms({source_schema:e,target_schema:s},l,n){const i=Array.from(new Set(n.flat())),r=Object.keys(e),a=Object.keys(s),p=Array.from(new Set(r.concat(a))).filter(g=>r.includes(g)&&a.includes(g)),o=r.filter(g=>!a.includes(g)),f=a.filter(g=>!r.includes(g));return{all:Array.from(new Set([i,l.modifiedColumns&&p,l.addedColumns&&f,l.removedColumns&&o].filter(Boolean).flat())),added:f.length,deleted:o.length,modified:p.length-i.length}}function Rs(e,s,l){const n=Object.values(e.row_diff.sample)[0]??{},i=[],r=[],a=[];return Object.keys(n).forEach(d=>{ee(e,d,l)?r.push(d):K(e,d,l)?i.push(d):a.push(d)}),{all:[s.modifiedRows&&a,s.addedRows&&r,s.removedRows&&i].filter(Boolean).flat(),added:r.length,deleted:i.length,modified:a.length}}function Ae(e,s,l){const n=V(e,ge,s,l),i=V(e,be,s,l);return n!==i}function K(e,s,l){return l.every(([n,i])=>{const r=V(e,ge,n,s),a=V(e,be,i,s);return k(r)&&H(a)})}function ee(e,s,l){return l.every(([n,i])=>{const r=V(e,ge,n,s),a=V(e,be,i,s);return H(r)&&k(a)})}function Me(e,s,l,n){return l in e.schema_diff.added||l in e.schema_diff.removed?!1:s.some(i=>M(ee(e,i,n))&&M(K(e,i,n))&&Ae(e,l,i))}function V(e,s,l,n){var i;return(i=e.row_diff.sample[`${s}${l}`])==null?void 0:i[n]}function Ls(e,s,l){return V(e,ge,s,l)??We}function _s(e,s,l){return V(e,be,s,l)??We}function As({diff:e}){const[s,l]=u.useState({modifiedRows:!0,addedRows:!0,removedRows:!0,modifiedColumns:!0,addedColumns:!0,removedColumns:!0}),n=Ms(e.schema_diff,s,e.on),i=Rs(e,s,e.on),r=s.addedRows&&!s.removedRows&&!s.modifiedRows,a=!s.addedRows&&s.removedRows&&!s.modifiedRows,d=Array.from(new Set(e.on.flat())),p=Object.values(e.row_diff.sample).some(o=>Object.keys(o).length>0);return t.jsxs("div",{className:"px-2 h-full flex flex-col rounded-lg",children:[p&&t.jsxs(t.Fragment,{children:[t.jsx(Os,{diff:e,rows:i,columns:n}),t.jsx("div",{className:"mt-2 mb-1 flex rounded-lg items-center",children:t.jsx("div",{className:"w-full flex justify-end items-center",children:t.jsx(St,{options:Object.keys(s).reduce((o,f)=>(o[f]=g=>l(E=>({...E,[f]:g})),o),{}),value:Object.keys(s).map(o=>M(s[o])?void 0:o).filter(Boolean)})})})]}),t.jsx("div",{className:"overflow-auto h-full hover:scrollbar scrollbar--horizontal scrollbar--vertical",children:t.jsxs("table",{cellPadding:0,cellSpacing:0,className:"w-full text-xs text-neutral-600 dark:text-neutral-200 font-normal border-separate",children:[t.jsx("thead",{className:"sticky bg-theme top-0 z-10",children:t.jsx("tr",{children:n.all.map(o=>t.jsx("th",{colSpan:Me(e,i.all,o,e.on)?2:1,className:b("text-left whitespace-nowrap py-1 px-2 font-bold",o in e.schema_diff.added?"border-t-2 border-l-2 border-r-2 border-success-500":o in e.schema_diff.removed?"border-t-2 border-l-2 border-r-2 border-danger-500":d.includes(o)?"border-brand-500 border-l-2 border-t-2 border-r-2":"border-r border-b border-neutral-100 dark:border-neutral-700 last:border-r-0",d.includes(o)?"bg-brand-10":"bg-neutral-5"),children:t.jsxs("div",{className:"flex justify-between",children:[t.jsxs("div",{className:"mr-2",children:[t.jsx("span",{children:o})," ",t.jsxs("small",{className:"text-neutral-500 font-medium",children:["(",e.schema_diff.source_schema[o]??e.schema_diff.target_schema[o],")"]})]}),M(d.includes(o))&&t.jsx("div",{className:"ml-2",children:t.jsxs("small",{className:"inline-block bg-neutral-10 px-2 py-0.5 rounded-full",children:[Math.round(i.all.filter(f=>Ae(e,o,f)).length/i.all.length*100),"%"]})})]})},o))})}),t.jsx("tbody",{children:Le(i.all)?i.all.map(o=>t.jsx("tr",{children:n.all.map(f=>Me(e,i.all,f,e.on)?t.jsxs(t.Fragment,{children:[t.jsx("td",{className:b("p-1 border-r border-b border-neutral-100 dark:border-neutral-700 last:border-r-0",ee(e,o,e.on)&&"bg-success-10 text-success-500",K(e,o,e.on)&&"bg-danger-5 text-danger-500"),children:t.jsx("div",{className:b("px-2 py-1 whitespace-nowrap font-bold rounded-md ",ee(e,o,e.on)&&"bg-success-10 text-success-500",K(e,o,e.on)&&"bg-danger-5 text-danger-500"),children:Ls(e,f,o)})},`${o}-${f}-source`),t.jsx("td",{className:b("p-1 border-r border-b border-neutral-100 dark:border-neutral-700 last:border-r-0",ee(e,o,e.on)&&"bg-success-10 text-success-500",K(e,o,e.on)&&"bg-danger-5 text-danger-500"),children:t.jsx("div",{className:b("px-2 py-1 whitespace-nowrap font-bold rounded-md",Ae(e,f,o)&&"bg-primary-10 text-primary-500",ee(e,o,e.on)&&"!bg-success-10 !text-success-500",K(e,o,e.on)&&"!bg-danger-5 !text-danger-500"),children:_s(e,f,o)})},`${o}-${f}-target`)]}):t.jsx("td",{className:b("p-1",f in e.schema_diff.added?"bg-success-10 border-l-2 border-r-2 border-success-500 text-success-500 font-bold":f in e.schema_diff.removed?"bg-danger-5 border-l-2 border-r-2 border-danger-500 !text-danger-500 font-bold":d.includes(f)?"border-brand-500 border-l-2 border-r-2":"border-r border-b border-neutral-100 dark:border-neutral-700 last:border-r-0",K(e,o,e.on)&&"!bg-danger-5 text-danger-500 font-bold",ee(e,o,e.on)&&"bg-success-10 text-success-500 font-bold"),children:t.jsx("div",{className:b("px-2 py-1 whitespace-nowrap rounded-md",(f in e.schema_diff.added||ee(e,o,e.on))&&"bg-success-10 text-success-500 font-bold",(f in e.schema_diff.removed||K(e,o,e.on))&&"!bg-danger-5 !text-danger-500 font-bold"),children:V(e,ge,f,o)??V(e,be,f,o)??We})},`${o}-${f}`))},o)):t.jsx(Lt,{columns:n.all.length>0?n.all.length:void 0})}),Le(i.all)&&t.jsx("tfoot",{className:"sticky bg-theme bottom-0",children:t.jsx("tr",{children:n.all.map(o=>Me(e,i.all,o,e.on)?t.jsxs(t.Fragment,{children:[t.jsx("th",{className:b("text-left whitespace-nowrap px-2 py-1 border-r border-t border-neutral-100 dark:border-neutral-700 last:border-r-0",d.includes(o)?"bg-brand-10":"bg-neutral-10"),children:"Source"},`${o}-source`),t.jsx("th",{className:b("text-left whitespace-nowrap px-2 py-1 border-r border-t border-neutral-100 dark:border-neutral-700 last:border-r-0",d.includes(o)?"bg-brand-10":"bg-primary-10"),children:"Target"},`${o}-target`)]}):t.jsxs("th",{className:b("text-left whitespace-nowrap px-2 py-1 font-bold",o in e.schema_diff.added?"border-b-2 border-l-2 border-r-2 border-success-500":o in e.schema_diff.removed?"border-b-2 border-l-2 border-r-2 border-danger-500":d.includes(o)?"border-brand-500 border-l-2 border-b-2 border-r-2":"border-r border-t border-neutral-100 dark:border-neutral-700 last:border-r-0",d.includes(o)?"bg-brand-10":"bg-neutral-10"),children:[(o in e.schema_diff.removed||a)&&t.jsx("span",{children:"Source"}),(o in e.schema_diff.added||r)&&t.jsx("span",{children:"Target"})]},o))})})]})}),t.jsxs("div",{className:"flex justify-between items-center px-2 mt-2",children:[t.jsx(_t,{count:i.all.length}),t.jsx($s,{})]})]})}function $s(){const e=[["Grain","bg-brand-500"],["Changed","bg-primary-500"],["Added","bg-success-500"],["Deleted","bg-danger-500"]];return t.jsx("div",{className:"flex text-xs",children:e.map(([s="",l])=>t.jsx(zs,{text:s,className:l},s))})}function zs({text:e,className:s}){return t.jsxs("div",{className:"flex ml-2 items-center",children:[t.jsx("span",{className:b("inline-block w-3 h-3 mr-2 rounded-full",s)}),t.jsx("small",{className:"text-neutral-600 dark:text-neutral-400",children:e})]})}function Os({diff:e,rows:s,columns:l}){return t.jsx(Fe,{defaultOpen:!1,children:({open:n})=>t.jsxs(t.Fragment,{children:[t.jsxs(Fe.Button,{className:"flex items-center w-full justify-between rounded-lg text-left text-sm px-4 pt-3 pb-2 bg-neutral-10 hover:bg-theme-darker dark:hover:bg-theme-lighter text-neutral-600 dark:text-neutral-400",children:[t.jsx("h2",{className:"whitespace-nowrap text-xl font-bold mb-1",children:"Stats"}),n?t.jsx(Bt,{className:"h-6 w-6 text-primary-500"}):t.jsx(Wt,{className:"h-6 w-6 text-primary-500"})]}),t.jsx(Fe.Panel,{className:"px-4 pb-2 text-sm text-neutral-500",children:t.jsxs("div",{className:"p-2 grid grid-cols-3 gap-4 mb-3",children:[t.jsx(Re,{text:"Row Count Change",children:t.jsxs("p",{className:"text-6xl font-light text-primary-500 mt-3",children:[Math.round(Math.abs(e.row_diff.count_pct_change)),t.jsx("small",{className:"text-sm",children:"%"})]})}),t.jsxs(Re,{text:"Column Count Change",count:s.all.length,children:[t.jsx("p",{className:"text-center text-6xl font-light text-primary-500 mt-3",children:s.modified}),t.jsx("p",{className:"text-center text-6xl font-light text-success-500 mt-3",children:s.added}),t.jsx("p",{className:"text-center text-6xl font-light text-danger-500 mt-3",children:s.deleted})]}),t.jsxs(Re,{text:"Column Changes",count:l.all.length,children:[t.jsx("p",{className:"text-center text-6xl font-light text-primary-500 mt-3",children:l.modified}),t.jsx("p",{className:"text-center text-6xl font-light text-success-500 mt-3",children:l.added}),t.jsx("p",{className:"text-center text-6xl font-light text-danger-500 mt-3",children:l.deleted})]})]})})]})})}function Re({text:e,children:s,className:l,count:n}){return t.jsxs("div",{className:b("rounded-xl overflow-hidden px-3 py-6 bg-primary-10",l),children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("h3",{className:"text-neutral-500 dark:text-neutral-300 text-sm font-bold",children:e}),k(n)&&t.jsx("div",{children:t.jsx("small",{className:"inline-block px-2 py-0.5 bg-neutral-10 rounded-full",children:n})})]}),t.jsx("div",{className:"grid grid-cols-3 gap-2",children:s})]})}const Qs=u.lazy(async()=>await Nt(()=>import("./ModelLineage-DkIFAYo4.js"),[])),X={Query:"Query",Table:"Data Preview",Lineage:"Lineage",Diff:"Diff",Errors:"Errors"};function Bs({tab:e,className:s}){const{errors:l,removeError:n}=et(),i=gt(),r=D(h=>h.models),a=D(h=>h.isModel),d=N(h=>h.direction),p=N(h=>h.previewQuery),o=N(h=>h.previewTable),f=N(h=>h.previewDiff),g=N(h=>h.setDirection),[E,m]=u.useState(-1),v=nt(e.file.path,h=>{i(`${bt.DataCatalogModels}/${h.name}`)}),I=r.get(e.file.path),j=M(e.file.isEmpty)&&k(I)&&a(e.file.path),c=l.size>0,w=u.useMemo(()=>[k(o)&&X.Table,k(p)&&e.file.isRemote&&X.Query,j&&X.Lineage,k(f)&&X.Diff,c&&X.Errors].filter(Boolean),[e.id,o,p,f,j,l,c]);return u.useEffect(()=>{k(o)?m(w.indexOf(X.Table)):m(0)},[o]),u.useEffect(()=>{k(f)?m(w.indexOf(X.Diff)):m(0)},[f]),u.useEffect(()=>{k(j)?m(w.indexOf(X.Lineage)):m(0)},[j]),u.useEffect(()=>{m(c?w.indexOf(X.Errors):0)},[c]),u.useEffect(()=>{for(const h of l)vt([B.Fetchdf,B.EvaluateModel,B.RenderQuery,B.ColumnLineage,B.ModelLineage,B.TableDiff,B.Table,B.SaveFile],h.key)&&n(h)},[o,f,p,j]),t.jsx("div",{className:b("w-full h-full flex flex-col text-prose overflow-auto hover:scrollbar scrollbar--vertical",s),children:jt(w)?t.jsx("div",{className:"flex justify-center items-center w-full h-full",children:t.jsx("h3",{className:"text-md",children:"No Data To Preview"})}):t.jsxs(ot,{as:u.Fragment,onChange:m,selectedIndex:E,children:[t.jsx(Be,{list:w,children:t.jsx("div",{className:"ml-2",children:t.jsx($,{className:"!m-0 !py-0.5 px-[0.25rem] border-none",variant:R.Alternative,size:T.sm,onClick:()=>{g(d==="horizontal"?"vertical":"horizontal")},children:t.jsx(ps,{"aria-label":d==="horizontal"?"Use vertical layout":"Use horizontal layout",className:"text-primary-500 w-5"})})})},w.join("-")),t.jsxs(it,{className:"h-full w-full overflow-hidden",children:[k(o)&&t.jsx(ae,{unmount:!1,className:b("w-full h-full pt-4 relative px-2","ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(At,{data:o})}),k(p)&&e.file.isRemote&&t.jsx(ae,{unmount:!1,className:"w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2 p-2",children:t.jsx("div",{className:"w-full h-full p-2 bg-primary-10 rounded-lg overflow-auto hover:scrollbar scrollbar--horizontal scrollbar--vertical",children:t.jsx(_e,{type:te.SQL,content:p??"",extensions:v,className:"text-xs"})})}),j&&t.jsx(ae,{as:"div",unmount:!1,className:b("w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"),children:t.jsx(u.Suspense,{fallback:t.jsx(wt,{children:"Loading Model page..."}),children:t.jsx(Qs,{model:I})})}),k(f==null?void 0:f.row_diff)&&t.jsx(ae,{as:"div",unmount:!1,className:b("w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2 py-2"),children:t.jsx(As,{diff:f},e.id)}),c&&t.jsx(ae,{unmount:!1,className:"w-full h-full ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2 py-2",children:t.jsx("ul",{className:"w-full h-full p-2 overflow-auto hover:scrollbar scrollbar--vertical scrollbar--horizontal",children:Array.from(l).reverse().map(h=>t.jsx("li",{className:"bg-danger-10 mb-4 last:m-0 p-2 rounded-md",children:t.jsx(Ht,{scope:h.key,error:h})},h.id))})})]})]},e.id)})}const ye=32,Ws=2;function He(){const e=N(s=>s.tab);return t.jsxs("div",{className:"w-full h-full flex flex-col overflow-hidden",children:[t.jsx(ys,{}),t.jsx(ce,{}),H(e)?t.jsx(Ge,{}):t.jsx(dt,{tab:e})]})}function Ge(){return t.jsx("div",{className:"flex justify-center items-center w-full h-full",children:t.jsx("div",{className:"p-4 text-center text-theme-darker dark:text-theme-lighter",children:t.jsx("h2",{className:"text-3xl",children:"Select File or Add New SQL Tab"})})})}function dt({tab:e}){const{errors:s,addError:l,removeError:n}=et(),i=D(x=>x.environment),r=D(x=>x.models),a=D(x=>x.isModel),d=le(x=>x.files),p=le(x=>x.selectedFile),o=le(x=>x.setSelectedFile),f=N(x=>x.direction),g=N(x=>x.engine),E=N(x=>x.previewTable),m=N(x=>x.previewDiff),v=N(x=>x.refreshTab),I=N(x=>x.updateStoredTabsIds),j=N(x=>x.setPreviewQuery),c=N(x=>x.setPreviewTable),w=N(x=>x.setPreviewDiff),h=N(x=>x.setDialects),{setManuallySelectedColumn:C}=zt(),L=u.useCallback(function(x){o(d.get(x.path))},[d]),_=u.useCallback(function(x,F){C([x,F])},[]),z=Ot(),ne=nt(e.file.path,L,_),[J,P]=u.useState(!1),G=u.useMemo(()=>[...z,{key:"Mod-Enter",win:"Ctrl-Enter",preventDefault:!0,stopPropagation:!0,run(x){const F=x.state.doc.toString();c(void 0),j(F);for(const O of s)O.key===B.Fetchdf&&n(O);return yt({sql:F}).then(O=>{c($e(O))}).catch(O=>{l(B.Fetchdf,{...O,errorKey:B.Fetchdf,trigger:"Editor -> customSQLKeymaps",message:O.message,timestamp:Date.now(),origin:"useQueryTimeout"})}),!0}}],[z,s]);u.useEffect(()=>{P(!1),H(p)&&o(e==null?void 0:e.file)},[e.id]),u.useEffect(()=>(g.addEventListener("message",ve),()=>{g.removeEventListener("message",ve)}),[e.id,e.dialect]),u.useEffect(()=>{j(void 0),c(void 0),w(void 0),I()},[e.id,e.file.fingerprint]),u.useEffect(()=>{w(void 0)},[i]);function Y(){const x=r.get(e.file.path),F=M(e.file.isEmpty)&&k(x)&&a(e.file.path);return s.size>0||[E,m].some(Boolean)||F?[70,30]:[100,0]}function ke(){const x=r.get(e==null?void 0:e.file.path);return J&&(k(x)&&a(e.file.path)||e.file.isLocal)&&M(me(e.file.content))?[70,30]:[100,0]}function de(x){e.file.content=x,v(e)}function ve(x){if(x.data.topic==="dialects"){const F=r.get(e.file.path);e.dialect=(F==null?void 0:F.dialect)??e.dialect??"",h(x.data.payload),v(e)}if(x.data.topic==="format"){if(me(x.data.payload))return;e.file.content=x.data.payload,v(e)}}return t.jsxs(Ve,{className:b("w-full h-full overflow-hidden",f==="vertical"?"flex flex-col":"flex"),sizes:Y(),direction:f,minSize:[ye,0],snapOffset:0,children:[t.jsxs("div",{className:b("flex flex-col",f==="vertical"?"w-full ":"h-full"),children:[t.jsxs(Ve,{className:"flex h-full overflow-hidden",sizes:ke(),minSize:ye,snapOffset:ye,handleDrag:(x,F)=>{const De=F.parent.getBoundingClientRect().width*(x[1]??0)/100;P(De>=ye+Ws)},children:[t.jsxs("div",{className:"flex flex-col h-full",children:[e.file.isLocal&&t.jsx(_e,{type:te.SQL,dialect:e.dialect,keymaps:G,content:e.file.content,extensions:ne,onChange:de}),e.file.isRemote&&t.jsx(Qt,{keymaps:z,path:e.file.path,children:({file:x,keymaps:F})=>t.jsx(_e,{type:x.extension,dialect:e.dialect,extensions:ne,keymaps:F,content:x.content,onChange:de})})]}),t.jsx("div",{className:"flex flex-col h-full",children:t.jsx(Es,{tab:e,toggle:()=>P(x=>!x),isOpen:J})})]},e.id),t.jsx(ce,{}),t.jsx(ws,{tab:e},e.file.fingerprint)]}),t.jsx(Bs,{tab:e,className:b(f==="vertical"?"flex flex-col":"flex")})]},f)}He.Empty=Ge;He.Loading=Ge;He.Main=dt;export{He as default};
@@ -1 +1 @@
1
- import{d as f,a as i,r,v as j,F as E,j as e,L as c,S as d,_ as l}from"./index-O3mjYpnE.js";import{u as p}from"./project-6gxepOhm.js";import{P as v}from"./Page-BWEEQfIt.js";import"./file-DarlIDVi.js";import"./SplitPane-qHmkD1qy.js";const b=r.lazy(()=>l(()=>import("./FileExplorer-CEv0vXkt.js"),[])),P=r.lazy(()=>l(()=>import("./context-Dr54UHLi.js"),[])),L=r.lazy(()=>l(()=>import("./Editor-s0SBpV2y.js"),[])),N=r.lazy(()=>l(()=>import("./context-DgX0fp2E.js").then(t=>t.v),[]));function w(){const{addError:t}=f(),m=i(s=>s.modules),n=i(s=>s.models),u=i(s=>s.setLastSelectedModel),x=p(s=>s.files),h=r.useCallback(function(o){const a=n.get(o);j(a)||u(a)},[x,n]),_=r.useCallback(function(o){t(E.ColumnLineage,o)},[]);return e.jsx(v,{sidebar:m.hasFiles?e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"flex justify-center items-center w-full h-full",children:e.jsxs(c,{className:"inline-block",children:[e.jsx(d,{className:"w-3 h-3 border border-neutral-10 mr-4"}),e.jsx("h3",{className:"text-md",children:"Getting Files..."})]})}),children:e.jsx(P,{children:e.jsx(b,{})})}):void 0,content:e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"flex justify-center items-center w-full h-full",children:e.jsxs(c,{className:"inline-block",children:[e.jsx(d,{className:"w-3 h-3 border border-neutral-10 mr-4"}),e.jsx("h3",{className:"text-md",children:"Getting Editor Ready..."})]})}),children:e.jsx(N,{showColumns:!0,handleClickModel:h,handleError:_,children:e.jsx(L,{})})})})}export{w as default};
1
+ import{d as f,a as i,r,v as j,F as E,j as e,L as c,S as d,_ as l}from"./index-Dj0i1-CA.js";import{u as p}from"./project-BvSOI8MY.js";import{P as v}from"./Page-C-XfU5BR.js";import"./file-CvJN3aZO.js";import"./SplitPane-CViaZmw6.js";const b=r.lazy(()=>l(()=>import("./FileExplorer-BR9IE3he.js"),[])),P=r.lazy(()=>l(()=>import("./context-DFNeGsFF.js"),[])),L=r.lazy(()=>l(()=>import("./Editor-BDyfpUuw.js"),[])),N=r.lazy(()=>l(()=>import("./context-BctCsyGb.js").then(t=>t.v),[]));function w(){const{addError:t}=f(),m=i(s=>s.modules),n=i(s=>s.models),u=i(s=>s.setLastSelectedModel),x=p(s=>s.files),h=r.useCallback(function(o){const a=n.get(o);j(a)||u(a)},[x,n]),_=r.useCallback(function(o){t(E.ColumnLineage,o)},[]);return e.jsx(v,{sidebar:m.hasFiles?e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"flex justify-center items-center w-full h-full",children:e.jsxs(c,{className:"inline-block",children:[e.jsx(d,{className:"w-3 h-3 border border-neutral-10 mr-4"}),e.jsx("h3",{className:"text-md",children:"Getting Files..."})]})}),children:e.jsx(P,{children:e.jsx(b,{})})}):void 0,content:e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"flex justify-center items-center w-full h-full",children:e.jsxs(c,{className:"inline-block",children:[e.jsx(d,{className:"w-3 h-3 border border-neutral-10 mr-4"}),e.jsx("h3",{className:"text-md",children:"Getting Editor Ready..."})]})}),children:e.jsx(N,{showColumns:!0,handleClickModel:h,handleError:_,children:e.jsx(L,{})})})})}export{w as default};
@@ -1 +1 @@
1
- import{x as j,s as v,d as y,r as l,D as N,e as i,v as g,j as r,O as h,m,H as D,B as k,l as S,i as A}from"./index-O3mjYpnE.js";import{P as z}from"./Page-BWEEQfIt.js";import{S as C}from"./SourceList-Doo_9ZGp.js";import{S as I}from"./SourceListItem-D5Mj7Dly.js";import"./SplitPane-qHmkD1qy.js";import"./Input-obuJsD6k.js";import"./floating-ui.react-dom-BH3TFvkM.js";import"./index-D1sR7wpN.js";function w(){const{pathname:c}=j(),a=v(),{errors:o,removeError:u,clearErrors:f}=y(),t=l.useMemo(()=>Array.from(o).reverse(),[o]);l.useEffect(()=>{var e;if(N(t))setTimeout(()=>a(i.Home));else{const s=(e=t[0])==null?void 0:e.id;g(s)?a(i.Errors,{replace:!0}):a(i.Errors+"/"+s,{replace:!0})}},[t]);function d(e){const s=t.find(n=>n.id===e);A(s)&&u(s)}return r.jsx(z,{sidebar:r.jsxs("div",{className:"flex flex-col h-full w-full",children:[r.jsx(C,{keyId:"id",keyName:"key",keyDescription:"message",to:i.Errors,items:t,isActive:e=>`${i.Errors}/${e}`===c,types:t.reduce((e,s)=>Object.assign(e,{[s.id]:s.status}),{}),listItem:({id:e,to:s,name:n,description:p,text:x,disabled:E=!1})=>r.jsx(I,{to:s,name:n,text:x,description:p,variant:m.Danger,disabled:E,handleDelete:()=>d(e)})}),r.jsx(D,{}),o.size>0&&r.jsx("div",{className:"flex justify-end",children:r.jsx(k,{size:S.sm,variant:m.Neutral,onClick:()=>f(),children:"Clear All"})})]}),content:r.jsx(h,{})})}export{w as default};
1
+ import{x as j,s as v,d as y,r as l,D as N,e as i,v as g,j as r,O as h,m,H as D,B as k,l as S,i as A}from"./index-Dj0i1-CA.js";import{P as z}from"./Page-C-XfU5BR.js";import{S as C}from"./SourceList-DSLO6nVJ.js";import{S as I}from"./SourceListItem-BHt8d9-I.js";import"./SplitPane-CViaZmw6.js";import"./Input-B-oZ6fGO.js";import"./floating-ui.react-dom-CjE-JNW1.js";import"./index-C-dJH7yZ.js";function w(){const{pathname:c}=j(),a=v(),{errors:o,removeError:u,clearErrors:f}=y(),t=l.useMemo(()=>Array.from(o).reverse(),[o]);l.useEffect(()=>{var e;if(N(t))setTimeout(()=>a(i.Home));else{const s=(e=t[0])==null?void 0:e.id;g(s)?a(i.Errors,{replace:!0}):a(i.Errors+"/"+s,{replace:!0})}},[t]);function d(e){const s=t.find(n=>n.id===e);A(s)&&u(s)}return r.jsx(z,{sidebar:r.jsxs("div",{className:"flex flex-col h-full w-full",children:[r.jsx(C,{keyId:"id",keyName:"key",keyDescription:"message",to:i.Errors,items:t,isActive:e=>`${i.Errors}/${e}`===c,types:t.reduce((e,s)=>Object.assign(e,{[s.id]:s.status}),{}),listItem:({id:e,to:s,name:n,description:p,text:x,disabled:E=!1})=>r.jsx(I,{to:s,name:n,text:x,description:p,variant:m.Danger,disabled:E,handleDelete:()=>d(e)})}),r.jsx(D,{}),o.size>0&&r.jsx("div",{className:"flex justify-end",children:r.jsx(k,{size:S.sm,variant:m.Neutral,onClick:()=>f(),children:"Clear All"})})]}),content:r.jsx(h,{})})}export{w as default};