yanki 1.2.7 → 1.2.8

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.
@@ -0,0 +1 @@
1
+ const e=Object.freeze(JSON.parse(`{"displayName":"Apex","fileTypes":["apex","cls","trigger"],"name":"apex","patterns":[{"include":"#javadoc-comment"},{"include":"#comment"},{"include":"#directives"},{"include":"#declarations"},{"include":"#script-top-level"}],"repository":{"annotation-declaration":{"begin":"(@[_[:alpha:]]+)\\\\b","beginCaptures":{"1":{"name":"storage.type.annotation.apex"}},"end":"(?=\\\\s(?!\\\\())|(?=\\\\s*$)|(?<=\\\\s*\\\\))","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#expression"}]},{"include":"#statement"}]},"argument-list":{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#named-argument"},{"include":"#expression"},{"include":"#punctuation-comma"}]},"array-creation-expression":{"begin":"\\\\b(new)\\\\b\\\\s*(?<type_name>(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*)?\\\\s*(?=\\\\[)","beginCaptures":{"1":{"name":"keyword.control.new.apex"},"2":{"patterns":[{"include":"#support-type"},{"include":"#type"}]}},"end":"(?<=])","patterns":[{"include":"#bracketed-argument-list"}]},"block":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.curlybrace.open.apex"}},"end":"}","endCaptures":{"0":{"name":"punctuation.curlybrace.close.apex"}},"patterns":[{"include":"#statement"}]},"boolean-literal":{"patterns":[{"match":"(?<!\\\\.)\\\\btrue\\\\b","name":"constant.language.boolean.true.apex"},{"match":"(?<!\\\\.)\\\\bfalse\\\\b","name":"constant.language.boolean.false.apex"}]},"bracketed-argument-list":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.squarebracket.open.apex"}},"end":"]","endCaptures":{"0":{"name":"punctuation.squarebracket.close.apex"}},"patterns":[{"include":"#soql-query-expression"},{"include":"#named-argument"},{"include":"#expression"},{"include":"#punctuation-comma"}]},"break-or-continue-statement":{"captures":{"1":{"name":"keyword.control.flow.break.apex"},"2":{"name":"keyword.control.flow.continue.apex"}},"match":"(?<!\\\\.)\\\\b(?:(break)|(continue))\\\\b"},"cast-expression":{"captures":{"1":{"name":"punctuation.parenthesis.open.apex"},"2":{"patterns":[{"include":"#support-type"},{"include":"#type"}]},"6":{"name":"punctuation.parenthesis.close.apex"}},"match":"(\\\\()\\\\s*(?<type_name>(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*)\\\\s*(\\\\))(?=\\\\s*@?[(_[:alnum:]])"},"catch-clause":{"begin":"(?<!\\\\.)\\\\b(catch)\\\\b","beginCaptures":{"1":{"name":"keyword.control.try.catch.apex"}},"end":"(?<=})","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"captures":{"1":{"patterns":[{"include":"#support-type"},{"include":"#type"}]},"5":{"name":"entity.name.variable.local.apex"}},"match":"(?<type_name>(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*)\\\\s*(?:(\\\\g<identifier>)\\\\b)?"}]},{"include":"#comment"},{"include":"#block"}]},"class-declaration":{"begin":"(?=\\\\bclass\\\\b)","end":"(?<=})","patterns":[{"begin":"\\\\b(class)\\\\b\\\\s+(@?[_[:alpha:]][_[:alnum:]]*)\\\\s*","beginCaptures":{"1":{"name":"keyword.other.class.apex"},"2":{"name":"entity.name.type.class.apex"}},"end":"(?=\\\\{)","patterns":[{"include":"#javadoc-comment"},{"include":"#comment"},{"include":"#type-parameter-list"},{"include":"#extends-class"},{"include":"#implements-class"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.curlybrace.open.apex"}},"end":"}","endCaptures":{"0":{"name":"punctuation.curlybrace.close.apex"}},"patterns":[{"include":"#class-or-trigger-members"}]},{"include":"#javadoc-comment"},{"include":"#comment"}]},"class-or-trigger-members":{"patterns":[{"include":"#javadoc-comment"},{"include":"#comment"},{"include":"#storage-modifier"},{"include":"#sharing-modifier"},{"include":"#type-declarations"},{"include":"#field-declaration"},{"include":"#property-declaration"},{"include":"#indexer-declaration"},{"include":"#variable-initializer"},{"include":"#constructor-declaration"},{"include":"#method-declaration"},{"include":"#punctuation-semicolon"}]},"colon-expression":{"match":":","name":"keyword.operator.conditional.colon.apex"},"comment":{"patterns":[{"begin":"/\\\\*(\\\\*)?","beginCaptures":{"0":{"name":"punctuation.definition.comment.apex"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.apex"}},"name":"comment.block.apex"},{"begin":"(^\\\\s+)?(?=//)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.apex"}},"end":"(?=$)","patterns":[{"begin":"(?<!/)///(?!/)","beginCaptures":{"0":{"name":"punctuation.definition.comment.apex"}},"end":"(?=$)","name":"comment.block.documentation.apex","patterns":[{"include":"#xml-doc-comment"}]},{"begin":"(?<!/)//(?:(?!/)|(?=//))","beginCaptures":{"0":{"name":"punctuation.definition.comment.apex"}},"end":"(?=$)","name":"comment.line.double-slash.apex"}]}]},"conditional-operator":{"begin":"(?<!\\\\?)\\\\?(?![.?\\\\[])","beginCaptures":{"0":{"name":"keyword.operator.conditional.question-mark.apex"}},"end":":","endCaptures":{"0":{"name":"keyword.operator.conditional.colon.apex"}},"patterns":[{"include":"#expression"}]},"constructor-declaration":{"begin":"(?=@?[_[:alpha:]][_[:alnum:]]*\\\\s*\\\\()","end":"(?<=})|(?=;)","patterns":[{"captures":{"1":{"name":"entity.name.function.apex"}},"match":"(@?[_[:alpha:]][_[:alnum:]]*)\\\\b"},{"begin":"(:)","beginCaptures":{"1":{"name":"punctuation.separator.colon.apex"}},"end":"(?=\\\\{|=>)","patterns":[{"include":"#constructor-initializer"}]},{"include":"#parenthesized-parameter-list"},{"include":"#comment"},{"include":"#expression-body"},{"include":"#block"}]},"constructor-initializer":{"begin":"\\\\b(this)\\\\b\\\\s*(?=\\\\()","beginCaptures":{"1":{"name":"keyword.other.this.apex"}},"end":"(?<=\\\\))","patterns":[{"include":"#argument-list"}]},"date-literal-with-params":{"captures":{"1":{"name":"keyword.operator.query.date.apex"}},"match":"\\\\b(((?:LAST_N_DAY|NEXT_N_DAY|NEXT_N_WEEK|LAST_N_WEEK|NEXT_N_MONTH|LAST_N_MONTH|NEXT_N_QUARTER|LAST_N_QUARTER|NEXT_N_YEAR|LAST_N_YEAR|NEXT_N_FISCAL_QUARTER|LAST_N_FISCAL_QUARTER|NEXT_N_FISCAL_YEAR|LAST_N_FISCAL_YEAR)S)\\\\s*:\\\\d+)\\\\b"},"date-literals":{"captures":{"1":{"name":"keyword.operator.query.date.apex"}},"match":"\\\\b(YESTERDAY|TODAY|TOMORROW|LAST_WEEK|THIS_WEEK|NEXT_WEEK|LAST_MONTH|THIS_MONTH|NEXT_MONTH|LAST_90_DAYS|NEXT_90_DAYS|THIS_QUARTER|LAST_QUARTER|NEXT_QUARTER|THIS_YEAR|LAST_YEAR|NEXT_YEAR|THIS_FISCAL_QUARTER|LAST_FISCAL_QUARTER|NEXT_FISCAL_QUARTER|THIS_FISCAL_YEAR|LAST_FISCAL_YEAR|NEXT_FISCAL_YEAR)\\\\b\\\\s*"},"declarations":{"patterns":[{"include":"#type-declarations"},{"include":"#punctuation-semicolon"}]},"directives":{"patterns":[{"include":"#punctuation-semicolon"}]},"do-statement":{"begin":"(?<!\\\\.)\\\\b(do)\\\\b","beginCaptures":{"1":{"name":"keyword.control.loop.do.apex"}},"end":"(?=[;}])","patterns":[{"include":"#statement"}]},"element-access-expression":{"begin":"(?:(\\\\??\\\\.)\\\\s*)?(?:(@?[_[:alpha:]][_[:alnum:]]*)\\\\s*)?(?:(\\\\?)\\\\s*)?(?=\\\\[)","beginCaptures":{"1":{"patterns":[{"include":"#punctuation-accessor"},{"include":"#operator-safe-navigation"}]},"2":{"name":"variable.other.object.property.apex"},"3":{"name":"keyword.operator.null-conditional.apex"}},"end":"(?<=])(?!\\\\s*\\\\[)","patterns":[{"include":"#bracketed-argument-list"}]},"else-part":{"begin":"(?<!\\\\.)\\\\b(else)\\\\b","beginCaptures":{"1":{"name":"keyword.control.conditional.else.apex"}},"end":"(?<=})|(?=;)","patterns":[{"include":"#statement"}]},"enum-declaration":{"begin":"(?=\\\\benum\\\\b)","end":"(?<=})","patterns":[{"begin":"(?=enum)","end":"(?=\\\\{)","patterns":[{"include":"#javadoc-comment"},{"include":"#comment"},{"captures":{"1":{"name":"keyword.other.enum.apex"},"2":{"name":"entity.name.type.enum.apex"}},"match":"(enum)\\\\s+(@?[_[:alpha:]][_[:alnum:]]*)"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.curlybrace.open.apex"}},"end":"}","endCaptures":{"0":{"name":"punctuation.curlybrace.close.apex"}},"patterns":[{"include":"#javadoc-comment"},{"include":"#comment"},{"include":"#punctuation-comma"},{"begin":"@?[_[:alpha:]][_[:alnum:]]*","beginCaptures":{"0":{"name":"entity.name.variable.enum-member.apex"}},"end":"(?=([,}]))","patterns":[{"include":"#javadoc-comment"},{"include":"#comment"},{"include":"#variable-initializer"}]}]},{"include":"#javadoc-comment"},{"include":"#comment"}]},"expression":{"patterns":[{"include":"#comment"},{"include":"#merge-expression"},{"include":"#support-expression"},{"include":"#throw-expression"},{"include":"#this-expression"},{"include":"#trigger-context-declaration"},{"include":"#conditional-operator"},{"include":"#expression-operators"},{"include":"#soql-query-expression"},{"include":"#object-creation-expression"},{"include":"#array-creation-expression"},{"include":"#invocation-expression"},{"include":"#member-access-expression"},{"include":"#element-access-expression"},{"include":"#cast-expression"},{"include":"#literal"},{"include":"#parenthesized-expression"},{"include":"#initializer-expression"},{"include":"#identifier"}]},"expression-body":{"begin":"=>","beginCaptures":{"0":{"name":"keyword.operator.arrow.apex"}},"end":"(?=[),;}])","patterns":[{"include":"#expression"}]},"expression-operators":{"patterns":[{"match":"[-%*+/]=","name":"keyword.operator.assignment.compound.apex"},{"match":"(?:[\\\\&^]|<<|>>|\\\\|)=","name":"keyword.operator.assignment.compound.bitwise.apex"},{"match":"<<|>>","name":"keyword.operator.bitwise.shift.apex"},{"match":"[!=]=","name":"keyword.operator.comparison.apex"},{"match":"<=|>=|[<>]","name":"keyword.operator.relational.apex"},{"match":"!|&&|\\\\|\\\\|","name":"keyword.operator.logical.apex"},{"match":"[\\\\&^|~]","name":"keyword.operator.bitwise.apex"},{"match":"=","name":"keyword.operator.assignment.apex"},{"match":"--","name":"keyword.operator.decrement.apex"},{"match":"\\\\+\\\\+","name":"keyword.operator.increment.apex"},{"match":"[-%*+/]","name":"keyword.operator.arithmetic.apex"}]},"extends-class":{"begin":"(extends)\\\\b\\\\s+([_[:alpha:]][_[:alnum:]]*)","beginCaptures":{"1":{"name":"keyword.other.extends.apex"},"2":{"name":"entity.name.type.extends.apex"}},"end":"(?=\\\\{|implements)"},"field-declaration":{"begin":"(?<type_name>(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*)\\\\s+(\\\\g<identifier>)\\\\s*(?!=[=>])(?=[,;=]|$)","beginCaptures":{"1":{"patterns":[{"include":"#support-type"},{"include":"#type"}]},"5":{"name":"entity.name.variable.field.apex"}},"end":"(?=;)","patterns":[{"match":"@?[_[:alpha:]][_[:alnum:]]*","name":"entity.name.variable.field.apex"},{"include":"#punctuation-comma"},{"include":"#comment"},{"include":"#variable-initializer"},{"include":"#class-or-trigger-members"}]},"finally-clause":{"begin":"(?<!\\\\.)\\\\b(finally)\\\\b","beginCaptures":{"1":{"name":"keyword.control.try.finally.apex"}},"end":"(?<=})","patterns":[{"include":"#comment"},{"include":"#block"}]},"for-apex-syntax":{"captures":{"1":{"patterns":[{"include":"#support-type"},{"include":"#type"}]},"2":{"name":"entity.name.variable.local.apex"},"3":{"name":"keyword.operator.iterator.colon.apex"}},"match":"([._[:alpha:]][._[:alnum:]]+)\\\\s+([._[:alpha:]][._[:alnum:]]*)\\\\s*(:)"},"for-statement":{"begin":"(?<!\\\\.)\\\\b(for)\\\\b\\\\s*(?=\\\\()","beginCaptures":{"1":{"name":"keyword.control.loop.for.apex"}},"end":"(?<=})|(?=;)","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#for-apex-syntax"},{"include":"#local-variable-declaration"},{"include":"#expression"},{"include":"#punctuation-comma"},{"include":"#punctuation-semicolon"},{"include":"#colon-expression"}]},{"include":"#statement"}]},"from-clause":{"captures":{"1":{"name":"keyword.operator.query.from.apex"},"2":{"name":"storage.type.apex"}},"match":"(FROM)\\\\b\\\\s*([._[:alnum:]]+\\\\b)?"},"goto-statement":{"begin":"(?<!\\\\.)\\\\b(goto)\\\\b","beginCaptures":{"1":{"name":"keyword.control.goto.apex"}},"end":"(?=;)","patterns":[{"begin":"\\\\b(case)\\\\b","beginCaptures":{"1":{"name":"keyword.control.case.apex"}},"end":"(?=;)","patterns":[{"include":"#expression"}]},{"captures":{"1":{"name":"keyword.control.default.apex"}},"match":"\\\\b(default)\\\\b"},{"match":"@?[_[:alpha:]][_[:alnum:]]*","name":"entity.name.label.apex"}]},"identifier":{"match":"@?[_[:alpha:]][_[:alnum:]]*","name":"variable.other.readwrite.apex"},"if-statement":{"begin":"(?<!\\\\.)\\\\b(if)\\\\b\\\\s*(?=\\\\()","beginCaptures":{"1":{"name":"keyword.control.conditional.if.apex"}},"end":"(?<=})|(?=;)","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#expression"}]},{"include":"#statement"}]},"implements-class":{"begin":"(implements)\\\\b","beginCaptures":{"1":{"name":"keyword.other.implements.apex"}},"end":"(?=\\\\{|extends)","patterns":[{"captures":{"1":{"name":"entity.name.type.implements.apex"},"2":{"name":"punctuation.separator.comma.apex"}},"match":"([_[:alpha:]][_[:alnum:]]*)\\\\b\\\\s*(,)?"}]},"indexer-declaration":{"begin":"(?<return_type>(?<type_name>(?:ref\\\\s+)?(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*)\\\\s+)(?<interface_name>\\\\g<type_name>\\\\s*\\\\.\\\\s*)?(?<indexer_name>this)\\\\s*(?=\\\\[)","beginCaptures":{"1":{"patterns":[{"include":"#type"}]},"6":{"patterns":[{"include":"#type"},{"include":"#punctuation-accessor"}]},"7":{"name":"keyword.other.this.apex"}},"end":"(?<=})|(?=;)","patterns":[{"include":"#comment"},{"include":"#property-accessors"},{"include":"#expression-body"},{"include":"#variable-initializer"}]},"initializer-expression":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.curlybrace.open.apex"}},"end":"}","endCaptures":{"0":{"name":"punctuation.curlybrace.close.apex"}},"patterns":[{"include":"#expression"},{"include":"#punctuation-comma"}]},"interface-declaration":{"begin":"(?=\\\\binterface\\\\b)","end":"(?<=})","patterns":[{"begin":"(interface)\\\\b\\\\s+(@?[_[:alpha:]][_[:alnum:]]*)","beginCaptures":{"1":{"name":"keyword.other.interface.apex"},"2":{"name":"entity.name.type.interface.apex"}},"end":"(?=\\\\{)","patterns":[{"include":"#javadoc-comment"},{"include":"#comment"},{"include":"#type-parameter-list"},{"include":"#extends-class"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.curlybrace.open.apex"}},"end":"}","endCaptures":{"0":{"name":"punctuation.curlybrace.close.apex"}},"patterns":[{"include":"#interface-members"}]},{"include":"#javadoc-comment"},{"include":"#comment"}]},"interface-members":{"patterns":[{"include":"#javadoc-comment"},{"include":"#comment"},{"include":"#property-declaration"},{"include":"#indexer-declaration"},{"include":"#method-declaration"},{"include":"#punctuation-semicolon"}]},"invocation-expression":{"begin":"(?:(\\\\??\\\\.)\\\\s*)?(@?[_[:alpha:]][_[:alnum:]]*)\\\\s*(?<type_args>\\\\s*<([^<>]|\\\\g<type_args>)+>\\\\s*)?\\\\s*(?=\\\\()","beginCaptures":{"1":{"patterns":[{"include":"#punctuation-accessor"},{"include":"#operator-safe-navigation"}]},"2":{"name":"entity.name.function.apex"},"3":{"patterns":[{"include":"#type-arguments"}]}},"end":"(?<=\\\\))","patterns":[{"include":"#argument-list"}]},"javadoc-comment":{"patterns":[{"begin":"^\\\\s*(/\\\\*\\\\*)(?!/)","beginCaptures":{"1":{"name":"punctuation.definition.comment.apex"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.apex"}},"name":"comment.block.javadoc.apex","patterns":[{"match":"@(deprecated|author|return|see|serial|since|version|usage|name|link)\\\\b","name":"keyword.other.documentation.javadoc.apex"},{"captures":{"1":{"name":"keyword.other.documentation.javadoc.apex"},"2":{"name":"entity.name.variable.parameter.apex"}},"match":"(@param)\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"keyword.other.documentation.javadoc.apex"},"2":{"name":"entity.name.type.class.apex"}},"match":"(@(?:exception|throws))\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"string.quoted.single.apex"}},"match":"(\`([^\`]+?)\`)"}]}]},"literal":{"patterns":[{"include":"#boolean-literal"},{"include":"#null-literal"},{"include":"#numeric-literal"},{"include":"#string-literal"}]},"local-constant-declaration":{"begin":"\\\\b(?<const_keyword>const)\\\\b\\\\s*(?<type_name>(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*)\\\\s+(\\\\g<identifier>)\\\\s*(?=[,;=])","beginCaptures":{"1":{"name":"storage.modifier.apex"},"2":{"patterns":[{"include":"#type"}]},"6":{"name":"entity.name.variable.local.apex"}},"end":"(?=;)","patterns":[{"match":"@?[_[:alpha:]][_[:alnum:]]*","name":"entity.name.variable.local.apex"},{"include":"#punctuation-comma"},{"include":"#comment"},{"include":"#variable-initializer"}]},"local-declaration":{"patterns":[{"include":"#local-constant-declaration"},{"include":"#local-variable-declaration"}]},"local-variable-declaration":{"begin":"(?:(?:\\\\b(ref)\\\\s+)?\\\\b(var)\\\\b|(?<type_name>(?:ref\\\\s+)?(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*))\\\\s+(\\\\g<identifier>)\\\\s*(?=[),;=])","beginCaptures":{"1":{"name":"storage.modifier.apex"},"2":{"name":"keyword.other.var.apex"},"3":{"patterns":[{"include":"#support-type"},{"include":"#type"}]},"7":{"name":"entity.name.variable.local.apex"}},"end":"(?=[);])","patterns":[{"match":"@?[_[:alpha:]][_[:alnum:]]*","name":"entity.name.variable.local.apex"},{"include":"#punctuation-comma"},{"include":"#comment"},{"include":"#variable-initializer"}]},"member-access-expression":{"patterns":[{"captures":{"1":{"patterns":[{"include":"#punctuation-accessor"},{"include":"#operator-safe-navigation"}]},"2":{"name":"variable.other.object.property.apex"}},"match":"(\\\\??\\\\.)\\\\s*(@?[_[:alpha:]][_[:alnum:]]*)\\\\s*(?![(_[:alnum:]]|(\\\\?)?\\\\[|<)"},{"captures":{"1":{"patterns":[{"include":"#punctuation-accessor"},{"include":"#operator-safe-navigation"}]},"2":{"name":"variable.other.object.apex"},"3":{"patterns":[{"include":"#type-arguments"}]}},"match":"(\\\\??\\\\.)?\\\\s*(@?[_[:alpha:]][_[:alnum:]]*)(?<type_params>\\\\s*<([^<>]|\\\\g<type_params>)+>\\\\s*)(?=(\\\\s*\\\\?)?\\\\s*\\\\.\\\\s*@?[_[:alpha:]][_[:alnum:]]*)"},{"captures":{"1":{"name":"variable.other.object.apex"}},"match":"(@?[_[:alpha:]][_[:alnum:]]*)(?=(\\\\s*\\\\?)?\\\\s*\\\\.\\\\s*@?[_[:alpha:]][_[:alnum:]]*)"}]},"merge-expression":{"begin":"(merge)\\\\b\\\\s+","beginCaptures":{"1":{"name":"support.function.apex"}},"end":"(?<=;)","patterns":[{"include":"#object-creation-expression"},{"include":"#merge-type-statement"},{"include":"#expression"},{"include":"#punctuation-semicolon"}]},"merge-type-statement":{"captures":{"1":{"name":"variable.other.readwrite.apex"},"2":{"name":"variable.other.readwrite.apex"},"3":{"name":"punctuation.terminator.statement.apex"}},"match":"([_[:alpha:]]*)\\\\b\\\\s+([_[:alpha:]]*)\\\\b\\\\s*(;)"},"method-declaration":{"begin":"(?<return_type>(?<type_name>(?:ref\\\\s+)?(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*)\\\\s+)(?<interface_name>\\\\g<type_name>\\\\s*\\\\.\\\\s*)?(\\\\g<identifier>)\\\\s*(<([^<>]+)>)?\\\\s*(?=\\\\()","beginCaptures":{"1":{"patterns":[{"include":"#support-type"},{"include":"#type"}]},"6":{"patterns":[{"include":"#type"},{"include":"#punctuation-accessor"}]},"7":{"patterns":[{"include":"#support-type"},{"include":"#method-name-custom"}]},"8":{"patterns":[{"include":"#type-parameter-list"}]}},"end":"(?<=})|(?=;)","patterns":[{"include":"#comment"},{"include":"#parenthesized-parameter-list"},{"include":"#expression-body"},{"include":"#block"}]},"method-name-custom":{"match":"@?[_[:alpha:]][_[:alnum:]]*","name":"entity.name.function.apex"},"named-argument":{"begin":"(@?[_[:alpha:]][_[:alnum:]]*)\\\\s*(:)","beginCaptures":{"1":{"name":"entity.name.variable.parameter.apex"},"2":{"name":"punctuation.separator.colon.apex"}},"end":"(?=([]),]))","patterns":[{"include":"#expression"}]},"null-literal":{"match":"(?<!\\\\.)\\\\bnull\\\\b","name":"constant.language.null.apex"},"numeric-literal":{"patterns":[{"match":"\\\\b(\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d{1,3})?([-+])\\\\d{2}:\\\\d{2})\\\\b","name":"constant.numeric.datetime.apex"},{"match":"\\\\b(\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d{1,3})?(Z)?)\\\\b","name":"constant.numeric.datetime.apex"},{"match":"\\\\b(\\\\d{4}-\\\\d{2}-\\\\d{2})\\\\b","name":"constant.numeric.date.apex"},{"match":"\\\\b0([Xx])[_\\\\h]+([LUlu]|UL|Ul|uL|ul|LU|Lu|lU|lu)?\\\\b","name":"constant.numeric.hex.apex"},{"match":"\\\\b0([Bb])[01_]+([LUlu]|UL|Ul|uL|ul|LU|Lu|lU|lu)?\\\\b","name":"constant.numeric.binary.apex"},{"match":"\\\\b([0-9_]+)?\\\\.[0-9_]+(([Ee])[0-9]+)?([DFMdfm])?\\\\b","name":"constant.numeric.decimal.apex"},{"match":"\\\\b[0-9_]+([Ee])[0-9_]+([DFMdfm])?\\\\b","name":"constant.numeric.decimal.apex"},{"match":"\\\\b[0-9_]+([DFMdfm])\\\\b","name":"constant.numeric.decimal.apex"},{"match":"\\\\b[0-9_]+([LUlu]|UL|Ul|uL|ul|LU|Lu|lU|lu)?\\\\b","name":"constant.numeric.decimal.apex"}]},"object-creation-expression":{"patterns":[{"include":"#object-creation-expression-with-parameters"},{"include":"#object-creation-expression-with-no-parameters"},{"include":"#punctuation-comma"}]},"object-creation-expression-with-no-parameters":{"captures":{"1":{"name":"support.function.apex"},"2":{"name":"keyword.control.new.apex"},"3":{"patterns":[{"include":"#support-type"},{"include":"#type"}]}},"match":"(delete|insert|undelete|update|upsert)?\\\\s*(new)\\\\s+(?<type_name>(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*)\\\\s*(?=\\\\{|$)"},"object-creation-expression-with-parameters":{"begin":"(delete|insert|undelete|update|upsert)?\\\\s*(new)\\\\s+(?<type_name>(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*)\\\\s*(?=\\\\()","beginCaptures":{"1":{"name":"support.function.apex"},"2":{"name":"keyword.control.new.apex"},"3":{"patterns":[{"include":"#support-type"},{"include":"#type"}]}},"end":"(?<=\\\\))","patterns":[{"include":"#argument-list"}]},"operator-assignment":{"match":"(?<![!=])(=)(?!=)","name":"keyword.operator.assignment.apex"},"operator-safe-navigation":{"match":"\\\\?\\\\.","name":"keyword.operator.safe-navigation.apex"},"orderby-clause":{"captures":{"1":{"name":"keyword.operator.query.orderby.apex"}},"match":"\\\\b(ORDER BY)\\\\b\\\\s*","patterns":[{"include":"#ordering-direction"},{"include":"#ordering-nulls"}]},"ordering-direction":{"captures":{"1":{"name":"keyword.operator.query.ascending.apex"},"2":{"name":"keyword.operator.query.descending.apex"}},"match":"\\\\b(?:(ASC)|(DESC))\\\\b"},"ordering-nulls":{"captures":{"1":{"name":"keyword.operator.query.nullsfirst.apex"},"2":{"name":"keyword.operator.query.nullslast.apex"}},"match":"\\\\b(?:(NULLS FIRST)|(NULLS LAST))\\\\b"},"parameter":{"captures":{"1":{"name":"storage.modifier.apex"},"2":{"patterns":[{"include":"#support-type"},{"include":"#type"}]},"6":{"name":"entity.name.variable.parameter.apex"}},"match":"(?:\\\\b(this)\\\\b\\\\s+)?(?<type_name>(?:ref\\\\s+)?(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*)\\\\s+(\\\\g<identifier>)"},"parenthesized-expression":{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#expression"}]},"parenthesized-parameter-list":{"begin":"(\\\\()","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"(\\\\))","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#comment"},{"include":"#parameter"},{"include":"#punctuation-comma"},{"include":"#variable-initializer"}]},"property-accessors":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.curlybrace.open.apex"}},"end":"}","endCaptures":{"0":{"name":"punctuation.curlybrace.close.apex"}},"patterns":[{"match":"\\\\b(pr(?:ivate|otected))\\\\b","name":"storage.modifier.apex"},{"match":"\\\\b(get)\\\\b","name":"keyword.other.get.apex"},{"match":"\\\\b(set)\\\\b","name":"keyword.other.set.apex"},{"include":"#comment"},{"include":"#expression-body"},{"include":"#block"},{"include":"#punctuation-semicolon"}]},"property-declaration":{"begin":"(?!.*\\\\b(?:class|interface|enum)\\\\b)\\\\s*(?<return_type>(?<type_name>(?:ref\\\\s+)?(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\\\s*::\\\\s*)?(?<name_and_type_args>\\\\g<identifier>\\\\s*(?<type_args>\\\\s*<(?:[^<>]|\\\\g<type_args>)+>\\\\s*)?)(?:\\\\s*\\\\.\\\\s*\\\\g<name_and_type_args>)*(?:\\\\s*\\\\?\\\\s*)?(?:\\\\s*\\\\[(?:\\\\s*,\\\\s*)*]\\\\s*)*)\\\\s+)(?<interface_name>\\\\g<type_name>\\\\s*\\\\.\\\\s*)?(?<property_name>\\\\g<identifier>)\\\\s*(?=\\\\{|=>|$)","beginCaptures":{"1":{"patterns":[{"include":"#type"}]},"6":{"patterns":[{"include":"#type"},{"include":"#punctuation-accessor"}]},"7":{"name":"entity.name.variable.property.apex"}},"end":"(?<=})|(?=;)","patterns":[{"include":"#comment"},{"include":"#property-accessors"},{"include":"#expression-body"},{"include":"#variable-initializer"},{"include":"#class-or-trigger-members"}]},"punctuation-accessor":{"match":"\\\\.","name":"punctuation.accessor.apex"},"punctuation-comma":{"match":",","name":"punctuation.separator.comma.apex"},"punctuation-semicolon":{"match":";","name":"punctuation.terminator.statement.apex"},"query-operators":{"captures":{"1":{"name":"keyword.operator.query.apex"}},"match":"\\\\b(ABOVE|AND|AT|FOR REFERENCE|FOR UPDATE|FOR VIEW|GROUP BY|HAVING|IN|LIKE|LIMIT|NOT IN|NOT|OFFSET|OR|TYPEOF|UPDATE TRACKING|UPDATE VIEWSTAT|WITH DATA CATEGORY|WITH)\\\\b\\\\s*"},"return-statement":{"begin":"(?<!\\\\.)\\\\b(return)\\\\b","beginCaptures":{"1":{"name":"keyword.control.flow.return.apex"}},"end":"(?=;)","patterns":[{"include":"#expression"}]},"script-top-level":{"patterns":[{"include":"#method-declaration"},{"include":"#statement"},{"include":"#punctuation-semicolon"}]},"sharing-modifier":{"match":"(?<!\\\\.)\\\\b((?:with|without|inherited) sharing)\\\\b","name":"sharing.modifier.apex"},"soql-colon-method-statement":{"begin":"(:?\\\\.)?([_[:alpha:]][_[:alnum:]]*)(?=\\\\()","beginCaptures":{"1":{"name":"punctuation.accessor.apex"},"2":{"name":"entity.name.function.apex"}},"end":"(?<=\\\\))","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#expression"}]},{"include":"#statement"}]},"soql-colon-vars":{"begin":"(:)\\\\s*","beginCaptures":{"0":{"name":"keyword.operator.conditional.colon.apex"}},"end":"(?![(_[:alnum:]]|(\\\\?)?\\\\[|<)","patterns":[{"include":"#trigger-context-declaration"},{"captures":{"1":{"name":"variable.other.object.apex"},"2":{"patterns":[{"include":"#punctuation-accessor"},{"include":"#operator-safe-navigation"}]}},"match":"([_[:alpha:]][_[:alnum:]]*)(\\\\??\\\\.)"},{"include":"#soql-colon-method-statement"},{"match":"[_[:alpha:]][_[:alnum:]]*","name":"entity.name.variable.local.apex"}]},"soql-functions":{"begin":"\\\\b(AVG|CALENDAR_MONTH|CALENDAR_QUARTER|CALENDAR_YEAR|convertCurrency|convertTimezone|COUNT|COUNT_DISTINCT|DAY_IN_MONTH|DAY_IN_WEEK|DAY_IN_YEAR|DAY_ONLY|toLabel|INCLUDES|EXCLUDES|FISCAL_MONTH|FISCAL_QUARTER|FISCAL_YEAR|FORMAT|GROUPING|GROUP BY CUBE|GROUP BY ROLLUP|HOUR_IN_DAY|MAX|MIN|SUM|WEEK_IN_MONTH|WEEK_IN_YEAR)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"support.function.query.apex"},"2":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#literal"},{"include":"#punctuation-comma"},{"include":"#soql-functions"},{"match":"[._[:alpha:]][._[:alnum:]]*","name":"keyword.query.field.apex"}]},"soql-group-clauses":{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#soql-query-expression"},{"include":"#soql-colon-vars"},{"include":"#soql-group-clauses"},{"include":"#punctuation-comma"},{"include":"#operator-assignment"},{"include":"#literal"},{"include":"#query-operators"},{"include":"#date-literals"},{"include":"#date-literal-with-params"},{"include":"#using-scope"},{"match":"[._[:alpha:]][._[:alnum:]]*","name":"keyword.query.field.apex"}]},"soql-query-body":{"patterns":[{"include":"#trigger-context-declaration"},{"include":"#soql-colon-vars"},{"include":"#soql-functions"},{"include":"#from-clause"},{"include":"#where-clause"},{"include":"#query-operators"},{"include":"#date-literals"},{"include":"#date-literal-with-params"},{"include":"#using-scope"},{"include":"#soql-group-clauses"},{"include":"#orderby-clause"},{"include":"#ordering-direction"},{"include":"#ordering-nulls"}]},"soql-query-expression":{"begin":"\\\\b(SELECT)\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.operator.query.select.apex"}},"end":"(?=;)|(?=])|(?=\\\\))","patterns":[{"include":"#soql-query-body"},{"include":"#comment"},{"include":"#punctuation-comma"},{"include":"#operator-assignment"},{"include":"#parenthesized-expression"},{"include":"#expression-operators"},{"include":"#literal"},{"captures":{"1":{"name":"keyword.query.field.apex"},"2":{"name":"punctuation.separator.comma.apex"}},"match":"([._[:alpha:]][._[:alnum:]]*)\\\\s*(,)?"}]},"statement":{"patterns":[{"include":"#comment"},{"include":"#while-statement"},{"include":"#do-statement"},{"include":"#for-statement"},{"include":"#switch-statement"},{"include":"#when-else-statement"},{"include":"#when-sobject-statement"},{"include":"#when-statement"},{"include":"#when-multiple-statement"},{"include":"#if-statement"},{"include":"#else-part"},{"include":"#goto-statement"},{"include":"#return-statement"},{"include":"#break-or-continue-statement"},{"include":"#throw-statement"},{"include":"#try-statement"},{"include":"#soql-query-expression"},{"include":"#local-declaration"},{"include":"#block"},{"include":"#expression"},{"include":"#punctuation-semicolon"}]},"storage-modifier":{"match":"(?<!\\\\.)\\\\b(new|public|protected|private|abstract|virtual|override|global|static|final|transient)\\\\b","name":"storage.modifier.apex"},"string-character-escape":{"match":"\\\\\\\\.","name":"constant.character.escape.apex"},"string-literal":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.apex"}},"end":"(')|([^\\\\n\\\\\\\\])$","endCaptures":{"1":{"name":"punctuation.definition.string.end.apex"},"2":{"name":"invalid.illegal.newline.apex"}},"name":"string.quoted.single.apex","patterns":[{"include":"#string-character-escape"}]},"support-arguments":{"begin":"<","beginCaptures":{"0":{"name":"punctuation.definition.typeparameters.begin.apex"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.typeparameters.end.apex"}},"patterns":[{"include":"#comment"},{"include":"#support-type"},{"include":"#punctuation-comma"}]},"support-class":{"captures":{"1":{"name":"support.class.apex"}},"match":"\\\\b(ApexPages|Database|DMLException|Exception|PageReference|Savepoint|SchedulableContext|Schema|SObject|System|Test)\\\\b"},"support-expression":{"begin":"(ApexPages|Database|DMLException|Exception|PageReference|Savepoint|SchedulableContext|Schema|SObject|System|Test)(?=[.\\\\s])","beginCaptures":{"1":{"name":"support.class.apex"}},"end":"(?<=\\\\)|$)|(?=})|(?=;)|(?=\\\\)|(?=]))|(?=,)","patterns":[{"include":"#support-type"},{"captures":{"1":{"name":"punctuation.accessor.apex"},"2":{"name":"support.function.apex"}},"match":"(\\\\.)(\\\\p{alpha}*)(?=\\\\()"},{"captures":{"1":{"name":"punctuation.accessor.apex"},"2":{"name":"support.type.apex"}},"match":"(\\\\.)(\\\\p{alpha}+)"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#expression"},{"include":"#punctuation-comma"}]},{"include":"#comment"},{"include":"#statement"}]},"support-functions":{"captures":{"1":{"name":"support.function.apex"}},"match":"\\\\b(delete|execute|finish|insert|start|undelete|update|upsert)\\\\b"},"support-name":{"patterns":[{"captures":{"1":{"name":"punctuation.accessor.apex"},"2":{"name":"support.function.apex"}},"match":"(\\\\.)\\\\s*(\\\\p{alpha}*)(?=\\\\()"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#expression"},{"include":"#punctuation-comma"}]},{"captures":{"1":{"name":"punctuation.accessor.apex"},"2":{"name":"support.type.apex"}},"match":"(\\\\.)\\\\s*([_[:alpha:]]*)"}]},"support-type":{"name":"support.apex","patterns":[{"include":"#comment"},{"include":"#support-class"},{"include":"#support-functions"},{"include":"#support-name"}]},"switch-statement":{"begin":"(switch)\\\\b\\\\s+(on)\\\\b\\\\s+(.*)(\\\\{)","beginCaptures":{"1":{"name":"keyword.control.switch.apex"},"2":{"name":"keyword.control.switch.on.apex"},"3":{"patterns":[{"include":"#statement"},{"include":"#parenthesized-expression"}]},"4":{"name":"punctuation.curlybrace.open.apex"}},"end":"(})","endCaptures":{"0":{"name":"punctuation.curlybrace.close.apex"}},"patterns":[{"include":"#when-string"},{"include":"#when-else-statement"},{"include":"#when-sobject-statement"},{"include":"#when-statement"},{"include":"#when-multiple-statement"},{"include":"#expression"},{"include":"#punctuation-comma"},{"include":"#punctuation-semicolon"}]},"this-expression":{"captures":{"1":{"name":"keyword.other.this.apex"}},"match":"\\\\b(this)\\\\b"},"throw-expression":{"captures":{"1":{"name":"keyword.control.flow.throw.apex"}},"match":"(?<!\\\\.)\\\\b(throw)\\\\b"},"throw-statement":{"begin":"(?<!\\\\.)\\\\b(throw)\\\\b","beginCaptures":{"1":{"name":"keyword.control.flow.throw.apex"}},"end":"(?=;)","patterns":[{"include":"#expression"}]},"trigger-context-declaration":{"begin":"\\\\b(Trigger)\\\\b(\\\\.)\\\\b","beginCaptures":{"1":{"name":"support.class.trigger.apex"},"2":{"name":"punctuation.accessor.apex"}},"end":"(?=})|(?=;)|(?=\\\\)|(?=]))","patterns":[{"match":"\\\\b(isExecuting|isInsert|isUpdate|isDelete|isBefore|isAfter|isUndelete|new|newMap|old|oldMap|size)\\\\b","name":"support.type.trigger.apex"},{"captures":{"1":{"patterns":[{"include":"#punctuation-accessor"},{"include":"#operator-safe-navigation"}]},"2":{"name":"support.function.trigger.apex"}},"match":"(\\\\??\\\\.)(\\\\p{alpha}+)(?=\\\\()"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#trigger-type-statement"},{"include":"#javadoc-comment"},{"include":"#comment"},{"include":"#expression"}]},{"include":"#expression"}]},"trigger-declaration":{"begin":"(?=\\\\btrigger\\\\b)","end":"(?<=})","patterns":[{"begin":"\\\\b(trigger)\\\\b\\\\s+(@?[_[:alpha:]][_[:alnum:]]*)\\\\s*\\\\b(on)\\\\b\\\\s+([_[:alpha:]][_[:alnum:]]*)\\\\s*","beginCaptures":{"1":{"name":"keyword.other.trigger.apex"},"2":{"name":"entity.name.type.trigger.apex"},"3":{"name":"keyword.operator.trigger.on.apex"},"4":{"name":"storage.type.apex"}},"end":"(?=\\\\{)","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#trigger-type-statement"},{"include":"#trigger-operator-statement"},{"include":"#punctuation-comma"},{"include":"#expression"}]},{"include":"#javadoc-comment"},{"include":"#comment"},{"include":"#type-parameter-list"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.curlybrace.open.apex"}},"end":"}","endCaptures":{"0":{"name":"punctuation.curlybrace.close.apex"}},"patterns":[{"include":"#statement"},{"include":"#class-or-trigger-members"}]},{"include":"#javadoc-comment"},{"include":"#comment"}]},"trigger-operator-statement":{"match":"\\\\b(insert|update|delete|merge|upsert|undelete)\\\\b","name":"keyword.operator.trigger.apex"},"trigger-type-statement":{"captures":{"1":{"name":"keyword.control.trigger.before.apex"},"2":{"name":"keyword.control.trigger.after.apex"}},"match":"\\\\b(?:(before)|(after))\\\\b"},"try-block":{"begin":"(?<!\\\\.)\\\\b(try)\\\\b","beginCaptures":{"1":{"name":"keyword.control.try.apex"}},"end":"(?<=})","patterns":[{"include":"#comment"},{"include":"#block"}]},"try-statement":{"patterns":[{"include":"#try-block"},{"include":"#catch-clause"},{"include":"#finally-clause"}]},"type":{"name":"meta.type.apex","patterns":[{"include":"#comment"},{"include":"#type-builtin"},{"include":"#type-name"},{"include":"#type-arguments"},{"include":"#type-array-suffix"},{"include":"#type-nullable-suffix"}]},"type-arguments":{"begin":"<","beginCaptures":{"0":{"name":"punctuation.definition.typeparameters.begin.apex"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.typeparameters.end.apex"}},"patterns":[{"include":"#comment"},{"include":"#support-type"},{"include":"#type"},{"include":"#punctuation-comma"}]},"type-array-suffix":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.squarebracket.open.apex"}},"end":"]","endCaptures":{"0":{"name":"punctuation.squarebracket.close.apex"}},"patterns":[{"include":"#punctuation-comma"}]},"type-builtin":{"captures":{"1":{"name":"keyword.type.apex"}},"match":"\\\\b(Blob|Boolean|byte|Date|Datetime|Decimal|Double|ID|Integer|Long|Object|String|Time|void)\\\\b"},"type-declarations":{"patterns":[{"include":"#javadoc-comment"},{"include":"#comment"},{"include":"#annotation-declaration"},{"include":"#storage-modifier"},{"include":"#sharing-modifier"},{"include":"#class-declaration"},{"include":"#enum-declaration"},{"include":"#interface-declaration"},{"include":"#trigger-declaration"},{"include":"#punctuation-semicolon"}]},"type-name":{"patterns":[{"captures":{"1":{"name":"storage.type.apex"},"2":{"name":"punctuation.accessor.apex"}},"match":"(@?[_[:alpha:]][_[:alnum:]]*)\\\\s*(\\\\.)"},{"captures":{"1":{"name":"punctuation.accessor.apex"},"2":{"name":"storage.type.apex"}},"match":"(\\\\.)\\\\s*(@?[_[:alpha:]][_[:alnum:]]*)"},{"match":"@?[_[:alpha:]][_[:alnum:]]*","name":"storage.type.apex"}]},"type-nullable-suffix":{"captures":{"0":{"name":"punctuation.separator.question-mark.apex"}},"match":"\\\\?"},"type-parameter-list":{"begin":"<","beginCaptures":{"0":{"name":"punctuation.definition.typeparameters.begin.apex"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.typeparameters.end.apex"}},"patterns":[{"captures":{"1":{"name":"entity.name.type.type-parameter.apex"}},"match":"(@?[_[:alpha:]][_[:alnum:]]*)\\\\b"},{"include":"#comment"},{"include":"#punctuation-comma"}]},"using-scope":{"captures":{"1":{"name":"keyword.operator.query.using.apex"}},"match":"((USING SCOPE)\\\\b\\\\s*(Delegated|Everything|Mine|My_Territory|My_Team_Territory|Team))\\\\b\\\\s*"},"variable-initializer":{"begin":"(?<![!=])(=)(?![=>])","beginCaptures":{"1":{"name":"keyword.operator.assignment.apex"}},"end":"(?=[]),;}])","patterns":[{"include":"#expression"}]},"when-else-statement":{"begin":"(when)\\\\b\\\\s+(else)\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.control.switch.when.apex"},"2":{"name":"keyword.control.switch.else.apex"}},"end":"(?<=})","patterns":[{"include":"#block"},{"include":"#expression"}]},"when-multiple-statement":{"begin":"(when)\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.control.switch.when.apex"}},"end":"(?<=})","patterns":[{"include":"#block"},{"include":"#expression"}]},"when-sobject-statement":{"begin":"(when)\\\\b\\\\s+([_[:alnum:]]+)\\\\s+([_[:alnum:]]+)\\\\s*","beginCaptures":{"1":{"name":"keyword.control.switch.when.apex"},"2":{"name":"storage.type.apex"},"3":{"name":"entity.name.variable.local.apex"}},"end":"(?<=})","patterns":[{"include":"#block"},{"include":"#expression"}]},"when-statement":{"begin":"(when)\\\\b\\\\s+([-'_[:alnum:]]+)\\\\s*","beginCaptures":{"1":{"name":"keyword.control.switch.when.apex"},"2":{"patterns":[{"include":"#expression"}]}},"end":"(?<=})","patterns":[{"include":"#block"},{"include":"#expression"}]},"when-string":{"begin":"(when)\\\\b\\\\s*('[^\\\\n']*')(,)?","beginCaptures":{"1":{"name":"keyword.control.switch.when.apex"},"2":{"patterns":[{"include":"#string-literal"}]},"3":{"patterns":[{"include":"#punctuation-comma"}]}},"end":"(?<=})","patterns":[{"include":"#block"},{"include":"#expression"}]},"where-clause":{"captures":{"1":{"name":"keyword.operator.query.where.apex"}},"match":"\\\\b(WHERE)\\\\b\\\\s*"},"while-statement":{"begin":"(?<!\\\\.)\\\\b(while)\\\\b\\\\s*(?=\\\\()","beginCaptures":{"1":{"name":"keyword.control.loop.while.apex"}},"end":"(?<=})|(?=;)","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.parenthesis.open.apex"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.parenthesis.close.apex"}},"patterns":[{"include":"#expression"}]},{"include":"#statement"}]},"xml-attribute":{"patterns":[{"captures":{"1":{"name":"entity.other.attribute-name.apex"},"2":{"name":"entity.other.attribute-name.namespace.apex"},"3":{"name":"punctuation.separator.colon.apex"},"4":{"name":"entity.other.attribute-name.localname.apex"},"5":{"name":"punctuation.separator.equals.apex"}},"match":"(?:^|\\\\s+)((?:([-_[:alnum:]]+)(:))?([-_[:alnum:]]+))(=)"},{"include":"#xml-string"}]},"xml-cdata":{"begin":"<!\\\\[CDATA\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.apex"}},"end":"]]>","endCaptures":{"0":{"name":"punctuation.definition.string.end.apex"}},"name":"string.unquoted.cdata.apex"},"xml-character-entity":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.constant.apex"},"3":{"name":"punctuation.definition.constant.apex"}},"match":"(&)([:_[:alpha:]][-.:_[:alnum:]]*|#\\\\d+|#x\\\\h+)(;)","name":"constant.character.entity.apex"},{"match":"&","name":"invalid.illegal.bad-ampersand.apex"}]},"xml-comment":{"begin":"<!--","beginCaptures":{"0":{"name":"punctuation.definition.comment.apex"}},"end":"-->","endCaptures":{"0":{"name":"punctuation.definition.comment.apex"}},"name":"comment.block.apex"},"xml-doc-comment":{"patterns":[{"include":"#xml-comment"},{"include":"#xml-character-entity"},{"include":"#xml-cdata"},{"include":"#xml-tag"}]},"xml-string":{"patterns":[{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.apex"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.apex"}},"name":"string.quoted.single.apex","patterns":[{"include":"#xml-character-entity"}]},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.stringdoublequote.begin.apex"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.stringdoublequote.end.apex"}},"name":"string.quoted.double.apex","patterns":[{"include":"#xml-character-entity"}]}]},"xml-tag":{"begin":"(</?)((?:([-_[:alnum:]]+)(:))?([-_[:alnum:]]+))","beginCaptures":{"1":{"name":"punctuation.definition.tag.apex"},"2":{"name":"entity.name.tag.apex"},"3":{"name":"entity.name.tag.namespace.apex"},"4":{"name":"punctuation.separator.colon.apex"},"5":{"name":"entity.name.tag.localname.apex"}},"end":"(/?>)","endCaptures":{"1":{"name":"punctuation.definition.tag.apex"}},"name":"meta.tag.apex","patterns":[{"include":"#xml-attribute"}]}},"scopeName":"source.apex"}`));var n=[e];export{n as default};
@@ -0,0 +1 @@
1
+ const e=Object.freeze(JSON.parse(`{"displayName":"Bicep","fileTypes":[".bicep",".bicepparam"],"name":"bicep","patterns":[{"include":"#expression"},{"include":"#comments"}],"repository":{"array-literal":{"begin":"\\\\[(?!(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*\\\\bfor\\\\b)","end":"]","name":"meta.array-literal.bicep","patterns":[{"include":"#expression"},{"include":"#comments"}]},"block-comment":{"begin":"/\\\\*","end":"\\\\*/","name":"comment.block.bicep"},"comments":{"patterns":[{"include":"#line-comment"},{"include":"#block-comment"}]},"decorator":{"begin":"@(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*(?=\\\\b[$_[:alpha:]][$_[:alnum:]]*\\\\b)","end":"","name":"meta.decorator.bicep","patterns":[{"include":"#expression"},{"include":"#comments"}]},"directive":{"begin":"#\\\\b[-0-9A-Z_a-z]+\\\\b","end":"$","name":"meta.directive.bicep","patterns":[{"include":"#directive-variable"},{"include":"#comments"}]},"directive-variable":{"match":"\\\\b[-0-9A-Z_a-z]+\\\\b","name":"keyword.control.declaration.bicep"},"escape-character":{"match":"\\\\\\\\(u\\\\{\\\\h+}|['\\\\\\\\nrt]|\\\\$\\\\{)","name":"constant.character.escape.bicep"},"expression":{"patterns":[{"include":"#string-literal"},{"include":"#multiline-string"},{"include":"#multiline-string-1-interp"},{"include":"#multiline-string-2-interp"},{"include":"#numeric-literal"},{"include":"#named-literal"},{"include":"#object-literal"},{"include":"#array-literal"},{"include":"#keyword"},{"include":"#identifier"},{"include":"#function-call"},{"include":"#decorator"},{"include":"#lambda-start"},{"include":"#directive"}]},"function-call":{"begin":"\\\\b([$_[:alpha:]][$_[:alnum:]]*)\\\\b(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*\\\\(","beginCaptures":{"1":{"name":"entity.name.function.bicep"}},"end":"\\\\)","name":"meta.function-call.bicep","patterns":[{"include":"#expression"},{"include":"#comments"}]},"identifier":{"match":"\\\\b[$_[:alpha:]][$_[:alnum:]]*\\\\b(?!(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*\\\\()","name":"variable.other.readwrite.bicep"},"keyword":{"match":"\\\\b(metadata|targetScope|resource|module|param|var|output|for|in|if|existing|import|as|type|with|using|extends|func|assert|extension)\\\\b","name":"keyword.control.declaration.bicep"},"lambda-start":{"begin":"(\\\\((?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*\\\\b[$_[:alpha:]][$_[:alnum:]]*\\\\b(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*(,(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*\\\\b[$_[:alpha:]][$_[:alnum:]]*\\\\b(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*)*\\\\)|\\\\((?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*\\\\)|(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*\\\\b[$_[:alpha:]][$_[:alnum:]]*\\\\b(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*)(?=(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*=>)","beginCaptures":{"1":{"name":"meta.undefined.bicep","patterns":[{"include":"#identifier"},{"include":"#comments"}]}},"end":"(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*=>","name":"meta.lambda-start.bicep"},"line-comment":{"match":"//.*(?=$)","name":"comment.line.double-slash.bicep"},"multiline-1-string-subst":{"begin":"(\\\\$\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.template-expression.begin.bicep"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.definition.template-expression.end.bicep"}},"name":"meta.multiline-1-string-subst.bicep","patterns":[{"include":"#expression"},{"include":"#comments"}]},"multiline-2-string-subst":{"begin":"(\\\\$\\\\$\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.template-expression.begin.bicep"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.definition.template-expression.end.bicep"}},"name":"meta.multiline-2-string-subst.bicep","patterns":[{"include":"#expression"},{"include":"#comments"}]},"multiline-string":{"begin":"'''","end":"'''(?!')","name":"string.quoted.multi.bicep","patterns":[]},"multiline-string-1-interp":{"begin":"(?<!\\\\$)\\\\$'''","end":"'''(?!')","name":"string.quoted.multi.bicep","patterns":[{"include":"#multiline-1-string-subst"}]},"multiline-string-2-interp":{"begin":"\\\\$\\\\$'''","end":"'''(?!')","name":"string.quoted.multi.bicep","patterns":[{"include":"#multiline-2-string-subst"}]},"named-literal":{"match":"\\\\b(true|false|null)\\\\b","name":"constant.language.bicep"},"numeric-literal":{"match":"[0-9]+","name":"constant.numeric.bicep"},"object-literal":{"begin":"\\\\{","end":"}","name":"meta.object-literal.bicep","patterns":[{"include":"#object-property-key"},{"include":"#expression"},{"include":"#comments"}]},"object-property-key":{"match":"\\\\b[$_[:alpha:]][$_[:alnum:]]*\\\\b(?=(?:[\\\\t\\\\n\\\\r ]|/\\\\*(?:\\\\*(?!/)|[^*])*\\\\*/)*:)","name":"variable.other.property.bicep"},"string-literal":{"begin":"'(?!'')","end":"'","name":"string.quoted.single.bicep","patterns":[{"include":"#escape-character"},{"include":"#string-subst"}]},"string-subst":{"begin":"(?<!\\\\\\\\)(\\\\$\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.template-expression.begin.bicep"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.definition.template-expression.end.bicep"}},"name":"meta.string-subst.bicep","patterns":[{"include":"#expression"},{"include":"#comments"}]}},"scopeName":"source.bicep"}`));var n=[e];export{n as default};
package/dist/bin/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var q=Object.defineProperty;var m=(e,o)=>q(e,"name",{value:o,configurable:!0});import{globby as $}from"globby";import G from"node:fs/promises";import W from"node:path";import L from"node:os";import _ from"yargs";import{hideBin as V}from"yargs/helpers";import{w as K,x as h,v as Q,y as O,n as X,m as Z,l as ee,b as te,c as oe,f as ne,s as se,i as ae}from"../sync-files-DJLnBCjf.js";import"process";import"rehype-parse";import"node:crypto";let y,x;function ie(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);if(y===void 0&&(y=L.homedir()),y&&/^~(?=$|\/|\\)/.test(e))return e.replace(/^~/,y);const o=e.match(/^~([^/\\]+)(.*)/);if(o&&(x===void 0&&(x=L.userInfo().username),x)){const s=o[1],a=o[2];if(s===x)return y+a}return e}m(ie,"untildify");var re="1.2.7",B={exports:{}},F;function le(){if(F)return B.exports;F=1;let e=process||{},o=e.argv||[],s=e.env||{},a=!(s.NO_COLOR||o.includes("--no-color"))&&(!!s.FORCE_COLOR||o.includes("--color")||e.platform==="win32"||(e.stdout||{}).isTTY&&s.TERM!=="dumb"||!!s.CI),d=m((n,t,l=n)=>c=>{let i=""+c,u=i.indexOf(t,n.length);return~u?n+p(i,t,l,u)+t:n+i+t},"formatter"),p=m((n,t,l,c)=>{let i="",u=0;do i+=n.substring(u,c)+l,u=c+t.length,c=n.indexOf(t,u);while(~c);return i+n.substring(u)},"replaceClose"),r=m((n=a)=>{let t=n?d:()=>String;return{isColorSupported:n,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}},"createColors");return B.exports=r(),B.exports.createColors=r,B.exports}m(le,"requirePicocolors");var ce=le(),f=K(ce);const T=process?.versions?.node!==void 0,g={verbose:!1,log(...e){if(!this.verbose)return;const o=f.gray("[Log]");T?console.warn(o,...e):console.log(o,...e)},logPrefixed(e,...o){this.info(f.blue(`[${e}]`),...o)},info(...e){if(!this.verbose)return;const o=f.green("[Info]");T?console.warn(o,...e):console.info(o,...e)},infoPrefixed(e,...o){this.info(f.blue(`[${e}]`),...o)},warn(...e){console.warn(f.yellow("[Warning]"),...e)},warnPrefixed(e,...o){this.warn(f.blue(`[${e}]`),...o)},error(...e){console.error(f.red("[Error]"),...e)},errorPrefixed(e,...o){this.error(f.blue(`[${e}]`),...o)}},b={"anki-auto-launch":{alias:"l",default:!1,describe:"Attempt to open the Anki desktop app if it's not already running. (Experimental, macOS only.)",type:"boolean"}},R={"anki-web":{alias:"w",default:!0,describe:'Automatically sync any changes to AnkiWeb after Yanki has finished syncing locally. If false, only local Anki data is updated and you must manually invoke a sync to AnkiWeb. This is the equivalent of pushing the "sync" button in the Anki app.',type:"boolean"}},w={"anki-connect":{default:"http://127.0.0.1:8765",describe:"Host and port of the Anki-Connect server. The default is usually fine. See the Anki-Connect documentation for more information.",type:"string"}},P={verbose:{default:!1,describe:"Enable verbose logging.",type:"boolean"}};function k(e){return{json:{default:!1,describe:e,type:"boolean"}}}m(k,"jsonOption");const N={"dry-run":{alias:"d",default:!1,describe:"Run without making any changes to the Anki database. See a report of what would have been done.",type:"boolean"}};function E(e){return{namespace:{alias:"n",default:h.namespace,describe:e,type:"string"}}}m(E,"namespaceOption");const de={"strict-line-breaks":{alias:"b",default:h.strictLineBreaks,describe:"Set to false to treat single newlines in Markdown as line breaks.",type:"boolean"}};function v(e){const o=Q(e);if(o===void 0)throw new Error(`Invalid AnkiConnect URL: "${e}"`);return o}m(v,"urlToHostAndPortValidated");const C=m(e=>{throw e instanceof Error?(e.cause?.code==="ECONNREFUSED"&&(g.error("Failed to connect to Anki. Make sure Anki is running and AnkiConnect is installed."),process.exitCode=1,process.exit()),e):new Error("Unknown error")},"ankiNotRunningErrorHandler"),U=_(V(process.argv));await U.scriptName("yanki").usage("$0 [command]","Run a Yanki command. Defaults to `sync` if a command is not provided.").command(["$0 <directory> [options]","sync <directory> [options]"],"Perform a one-way synchronization from a local directory of Markdown files to the Anki database. Any Markdown files in subdirectories are included as well.",e=>e.positional("directory",{demandOption:!0,describe:"The path to the local directory of Markdown files to sync.",type:"string"}).option(N).option(E("Advanced option for managing multiple Yanki synchronization groups. Case insensitive. See the readme for more information.")).option(w).option(b).option(R).option("manage-filenames",{alias:"m",choices:["off","prompt","response"],default:h.manageFilenames,describe:'Rename local note files to match their content. Useful if you want to feel have semantically reasonable note file names without managing them by hand. The `"prompt"` option will attempt to create the filename based on the "front" of the card, while `"response"` will prioritize the "back", "Cloze", or "type in the answer" portions of the card. Truncation, sanitization, and deduplication are taken care of.',type:"string"}).option("max-filename-length",{default:void 0,defaultDescription:String(h.maxFilenameLength),describe:"If `manage-filenames` is enabled, this option specifies the maximum length of the filename in characters.",type:"number"}).option("sync-media",{alias:"s",choices:["off","all","local","remote"],default:h.syncMediaAssets,describe:"Sync image, video, and audio assets to Anki's media storage system. Clean up is managed automatically. The `all` argument will save both local and remote assets to Anki, while `local` will only save local assets, `remote` will only save remote assets, and `off` will not save any assets.",type:"string"}).option("strict-matching",{default:h.strictMatching,describe:'Consider notes to be a "match" only if the local Markdown frontmatter `noteId` matches the remote Anki database `noteId` exactly. When disabled, Yanki will attempt to reuse existing Anki notes whose content matches a local Markdown note, even if the local and remote `noteId` differs. This helps preserve study progress in Anki if the local Markdown frontmatter is lost or corrupted. In Yanki 0.17.0 and earlier, `--strict-matching` was the default behavior. Starting with version 0.18.0, it is disabled by default.',type:"boolean"}).option("check-database",{default:h.checkDatabase,describe:'Automatically run Anki\'s "Check Database" command after note model updates that might produce database corruption. In Yanki 1.0.2 and earlier, `--check-database false` was the default behavior. Starting with version 1.1.0, it is enabled by default.',type:"boolean"}).option(de).option(k("Output the sync report as JSON.")).option(P),async({ankiAutoLaunch:e,ankiConnect:o,ankiWeb:s,checkDatabase:a,directory:d,dryRun:p,json:r,manageFilenames:n,maxFilenameLength:t,namespace:l,recursive:c=!0,strictLineBreaks:i,strictMatching:u,syncMedia:D,verbose:M})=>{g.verbose=M;const A=O(ie(d)),J=c?`${A}/**/*.md`:`${A}/*.md`,Y=(await $(J,{absolute:!0})).map(S=>O(S)),z=(await $(`${A}/**/*`,{absolute:!0})).map(S=>O(S));if(Y.length===0){g.error(`No Markdown files found in "${d}".`),process.exitCode=1;return}n==="off"&&t!==void 0&&g.warn("Ignoring `max-filename-length` option because `manage-filenames` is not enabled.");const{host:H,port:j}=v(o),I=await X(Y,{allFilePaths:z,ankiConnectOptions:{autoLaunch:e,host:H,port:j},ankiWeb:s,checkDatabase:a,dryRun:p,manageFilenames:n,maxFilenameLength:t,namespace:l,strictLineBreaks:i,strictMatching:u,syncMediaAssets:D}).catch(C);r?(process.stdout.write(JSON.stringify(I,void 0,2)),process.stdout.write(`
2
+ var q=Object.defineProperty;var m=(e,o)=>q(e,"name",{value:o,configurable:!0});import{globby as $}from"globby";import G from"node:fs/promises";import W from"node:path";import L from"node:os";import _ from"yargs";import{hideBin as V}from"yargs/helpers";import{w as K,x as h,v as Q,y as O,n as X,m as Z,l as ee,b as te,c as oe,f as ne,s as se,i as ae}from"../sync-files-c_f2UU5e.js";import"process";import"rehype-parse";import"node:crypto";let y,x;function ie(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);if(y===void 0&&(y=L.homedir()),y&&/^~(?=$|\/|\\)/.test(e))return e.replace(/^~/,y);const o=e.match(/^~([^/\\]+)(.*)/);if(o&&(x===void 0&&(x=L.userInfo().username),x)){const s=o[1],a=o[2];if(s===x)return y+a}return e}m(ie,"untildify");var re="1.2.8",B={exports:{}},F;function le(){if(F)return B.exports;F=1;let e=process||{},o=e.argv||[],s=e.env||{},a=!(s.NO_COLOR||o.includes("--no-color"))&&(!!s.FORCE_COLOR||o.includes("--color")||e.platform==="win32"||(e.stdout||{}).isTTY&&s.TERM!=="dumb"||!!s.CI),d=m((n,t,l=n)=>c=>{let i=""+c,u=i.indexOf(t,n.length);return~u?n+p(i,t,l,u)+t:n+i+t},"formatter"),p=m((n,t,l,c)=>{let i="",u=0;do i+=n.substring(u,c)+l,u=c+t.length,c=n.indexOf(t,u);while(~c);return i+n.substring(u)},"replaceClose"),r=m((n=a)=>{let t=n?d:()=>String;return{isColorSupported:n,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}},"createColors");return B.exports=r(),B.exports.createColors=r,B.exports}m(le,"requirePicocolors");var ce=le(),f=K(ce);const T=process?.versions?.node!==void 0,g={verbose:!1,log(...e){if(!this.verbose)return;const o=f.gray("[Log]");T?console.warn(o,...e):console.log(o,...e)},logPrefixed(e,...o){this.info(f.blue(`[${e}]`),...o)},info(...e){if(!this.verbose)return;const o=f.green("[Info]");T?console.warn(o,...e):console.info(o,...e)},infoPrefixed(e,...o){this.info(f.blue(`[${e}]`),...o)},warn(...e){console.warn(f.yellow("[Warning]"),...e)},warnPrefixed(e,...o){this.warn(f.blue(`[${e}]`),...o)},error(...e){console.error(f.red("[Error]"),...e)},errorPrefixed(e,...o){this.error(f.blue(`[${e}]`),...o)}},b={"anki-auto-launch":{alias:"l",default:!1,describe:"Attempt to open the Anki desktop app if it's not already running. (Experimental, macOS only.)",type:"boolean"}},R={"anki-web":{alias:"w",default:!0,describe:'Automatically sync any changes to AnkiWeb after Yanki has finished syncing locally. If false, only local Anki data is updated and you must manually invoke a sync to AnkiWeb. This is the equivalent of pushing the "sync" button in the Anki app.',type:"boolean"}},w={"anki-connect":{default:"http://127.0.0.1:8765",describe:"Host and port of the Anki-Connect server. The default is usually fine. See the Anki-Connect documentation for more information.",type:"string"}},P={verbose:{default:!1,describe:"Enable verbose logging.",type:"boolean"}};function k(e){return{json:{default:!1,describe:e,type:"boolean"}}}m(k,"jsonOption");const N={"dry-run":{alias:"d",default:!1,describe:"Run without making any changes to the Anki database. See a report of what would have been done.",type:"boolean"}};function E(e){return{namespace:{alias:"n",default:h.namespace,describe:e,type:"string"}}}m(E,"namespaceOption");const de={"strict-line-breaks":{alias:"b",default:h.strictLineBreaks,describe:"Set to false to treat single newlines in Markdown as line breaks.",type:"boolean"}};function v(e){const o=Q(e);if(o===void 0)throw new Error(`Invalid AnkiConnect URL: "${e}"`);return o}m(v,"urlToHostAndPortValidated");const C=m(e=>{throw e instanceof Error?(e.cause?.code==="ECONNREFUSED"&&(g.error("Failed to connect to Anki. Make sure Anki is running and AnkiConnect is installed."),process.exitCode=1,process.exit()),e):new Error("Unknown error")},"ankiNotRunningErrorHandler"),U=_(V(process.argv));await U.scriptName("yanki").usage("$0 [command]","Run a Yanki command. Defaults to `sync` if a command is not provided.").command(["$0 <directory> [options]","sync <directory> [options]"],"Perform a one-way synchronization from a local directory of Markdown files to the Anki database. Any Markdown files in subdirectories are included as well.",e=>e.positional("directory",{demandOption:!0,describe:"The path to the local directory of Markdown files to sync.",type:"string"}).option(N).option(E("Advanced option for managing multiple Yanki synchronization groups. Case insensitive. See the readme for more information.")).option(w).option(b).option(R).option("manage-filenames",{alias:"m",choices:["off","prompt","response"],default:h.manageFilenames,describe:'Rename local note files to match their content. Useful if you want to feel have semantically reasonable note file names without managing them by hand. The `"prompt"` option will attempt to create the filename based on the "front" of the card, while `"response"` will prioritize the "back", "Cloze", or "type in the answer" portions of the card. Truncation, sanitization, and deduplication are taken care of.',type:"string"}).option("max-filename-length",{default:void 0,defaultDescription:String(h.maxFilenameLength),describe:"If `manage-filenames` is enabled, this option specifies the maximum length of the filename in characters.",type:"number"}).option("sync-media",{alias:"s",choices:["off","all","local","remote"],default:h.syncMediaAssets,describe:"Sync image, video, and audio assets to Anki's media storage system. Clean up is managed automatically. The `all` argument will save both local and remote assets to Anki, while `local` will only save local assets, `remote` will only save remote assets, and `off` will not save any assets.",type:"string"}).option("strict-matching",{default:h.strictMatching,describe:'Consider notes to be a "match" only if the local Markdown frontmatter `noteId` matches the remote Anki database `noteId` exactly. When disabled, Yanki will attempt to reuse existing Anki notes whose content matches a local Markdown note, even if the local and remote `noteId` differs. This helps preserve study progress in Anki if the local Markdown frontmatter is lost or corrupted. In Yanki 0.17.0 and earlier, `--strict-matching` was the default behavior. Starting with version 0.18.0, it is disabled by default.',type:"boolean"}).option("check-database",{default:h.checkDatabase,describe:'Automatically run Anki\'s "Check Database" command after note model updates that might produce database corruption. In Yanki 1.0.2 and earlier, `--check-database false` was the default behavior. Starting with version 1.1.0, it is enabled by default.',type:"boolean"}).option(de).option(k("Output the sync report as JSON.")).option(P),async({ankiAutoLaunch:e,ankiConnect:o,ankiWeb:s,checkDatabase:a,directory:d,dryRun:p,json:r,manageFilenames:n,maxFilenameLength:t,namespace:l,recursive:c=!0,strictLineBreaks:i,strictMatching:u,syncMedia:D,verbose:M})=>{g.verbose=M;const A=O(ie(d)),J=c?`${A}/**/*.md`:`${A}/*.md`,Y=(await $(J,{absolute:!0})).map(S=>O(S)),z=(await $(`${A}/**/*`,{absolute:!0})).map(S=>O(S));if(Y.length===0){g.error(`No Markdown files found in "${d}".`),process.exitCode=1;return}n==="off"&&t!==void 0&&g.warn("Ignoring `max-filename-length` option because `manage-filenames` is not enabled.");const{host:H,port:j}=v(o),I=await X(Y,{allFilePaths:z,ankiConnectOptions:{autoLaunch:e,host:H,port:j},ankiWeb:s,checkDatabase:a,dryRun:p,manageFilenames:n,maxFilenameLength:t,namespace:l,strictLineBreaks:i,strictMatching:u,syncMediaAssets:D}).catch(C);r?(process.stdout.write(JSON.stringify(I,void 0,2)),process.stdout.write(`
3
3
  `)):(process.stderr.write(Z(I,M)),process.stderr.write(`
4
4
  `))}).command("list [options]","Utility command to list Yanki-created notes in the Anki database.",e=>e.option(E("Advanced option to list notes in a specific namespace. Case insensitive. Notes from the default internal namespace are listed by default. Pass `'*'` to list all Yanki-created notes in the Anki database.")).options(w).options(b).option(k("Output the list of notes as JSON to stdout.")),async({ankiAutoLaunch:e,ankiConnect:o,json:s,namespace:a})=>{const{host:d,port:p}=v(o),r=await ee({ankiConnectOptions:{autoLaunch:e,host:d,port:p},namespace:a}).catch(C);s?(process.stdout.write(JSON.stringify(r,void 0,2)),process.stdout.write(`
5
5
  `)):(process.stdout.write(te(r)),process.stdout.write(`
@@ -0,0 +1,2 @@
1
+ var _=Object.defineProperty;var n=(e,r)=>_(e,"name",{value:r,configurable:!0});import c from"node:process";import{Buffer as C}from"node:buffer";import F from"node:path";import{fileURLToPath as D}from"node:url";import{promisify as w}from"node:util";import M,{execFile as h}from"node:child_process";import S,{constants as L}from"node:fs/promises";import R from"node:os";import v from"node:fs";let b;function N(){try{return v.statSync("/.dockerenv"),!0}catch{return!1}}n(N,"hasDockerEnv");function z(){try{return v.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}n(z,"hasDockerCGroup");function G(){return b===void 0&&(b=N()||z()),b}n(G,"isDocker");let P;const X=n(()=>{try{return v.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");function E(){return P===void 0&&(P=X()||G()),P}n(E,"isInsideContainer");const T=n(()=>{if(c.platform!=="linux")return!1;if(R.release().toLowerCase().includes("microsoft"))return!E();try{return v.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!E():!1}catch{return!1}},"isWsl");var g=c.env.__IS_WSL_TEST__?T:T();const K=(()=>{const e="/mnt/";let r;return async function(){if(r)return r;const o="/etc/wsl.conf";let i=!1;try{await S.access(o,L.F_OK),i=!0}catch{}if(!i)return e;const t=await S.readFile(o,{encoding:"utf8"}),s=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(t);return s?(r=s.groups.mountPoint.trim(),r=r.endsWith("/")?r:`${r}/`,r):e}})(),V=n(async()=>`${await K()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),O=n(async()=>g?V():`${c.env.SYSTEMROOT||c.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath");function d(e,r,o){const i=n(t=>Object.defineProperty(e,r,{value:t,enumerable:!0,writable:!0}),"define");return Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){const t=o();return i(t),t},set(t){i(t)}}),e}n(d,"defineLazyProperty");const j=w(h);async function q(){if(c.platform!=="darwin")throw new Error("macOS only");const{stdout:e}=await j("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),o=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??"com.apple.Safari";return o==="com.apple.safari"?"com.apple.Safari":o}n(q,"defaultBrowserId");const Y=w(h);async function J(e,{humanReadableOutput:r=!0,signal:o}={}){if(c.platform!=="darwin")throw new Error("macOS only");const i=r?[]:["-ss"],t={};o&&(t.signal=o);const{stdout:s}=await Y("osascript",["-e",e,i],t);return s.trim()}n(J,"runAppleScript");async function Q(e){return J(`tell application "Finder" to set app_path to application file id "${e}" as string
2
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}n(Q,"bundleName");const Z=w(h),$={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}};new Map(Object.entries($));class H extends Error{static{n(this,"UnknownBrowserError")}}async function ee(e=Z){const{stdout:r}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),o=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(r);if(!o)throw new H(`Cannot find Windows browser in stdout: ${JSON.stringify(r)}`);const{id:i}=o.groups,t=$[i];if(!t)throw new H(`Unknown browser ID: ${i}`);return t}n(ee,"defaultBrowser$1");const re=w(h),oe=n(e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,r=>r.toUpperCase()),"titleize");async function te(){if(c.platform==="darwin"){const e=await q();return{name:await Q(e),id:e}}if(c.platform==="linux"){const{stdout:e}=await re("xdg-mime",["query","default","x-scheme-handler/http"]),r=e.trim();return{name:oe(r.replace(/.desktop$/,"").replace("-"," ")),id:r}}if(c.platform==="win32")return ee();throw new Error("Only macOS, Linux, and Windows are supported")}n(te,"defaultBrowser");const ne=w(M.execFile),B=F.dirname(D(import.meta.url)),I=F.join(B,"xdg-open"),{platform:u,arch:k}=c;async function ie(){const e=await O(),r=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,o=C.from(r,"utf16le").toString("base64"),{stdout:i}=await ne(e,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",o],{encoding:"utf8"}),t=i.trim(),s={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return s[t]?{id:s[t]}:{}}n(ie,"getWindowsDefaultBrowserFromWsl");const W=n(async(e,r)=>{let o;for(const i of e)try{return await r(i)}catch(t){o=t}throw o},"pTryEach"),x=n(async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return W(e.app,a=>x({...e,app:a}));let{name:r,arguments:o=[]}=e.app??{};if(o=[...o],Array.isArray(r))return W(r,a=>x({...e,app:{name:a,arguments:o}}));if(r==="browser"||r==="browserPrivate"){const a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},m={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},f=g?await ie():await te();if(f.id in a){const A=a[f.id];return r==="browserPrivate"&&o.push(m[A]),x({...e,app:{name:l[A],arguments:o}})}throw new Error(`${f.name} is not supported as a default browser`)}let i;const t=[],s={};if(u==="darwin")i="open",e.wait&&t.push("--wait-apps"),e.background&&t.push("--background"),e.newInstance&&t.push("--new"),r&&t.push("-a",r);else if(u==="win32"||g&&!E()&&!r){i=await O(),t.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),g||(s.windowsVerbatimArguments=!0);const a=["Start"];e.wait&&a.push("-Wait"),r?(a.push(`"\`"${r}\`""`),e.target&&o.push(e.target)):e.target&&a.push(`"${e.target}"`),o.length>0&&(o=o.map(m=>`"\`"${m}\`""`),a.push("-ArgumentList",o.join(","))),e.target=C.from(a.join(" "),"utf16le").toString("base64")}else{if(r)i=r;else{const a=!B||B==="/";let m=!1;try{await S.access(I,L.X_OK),m=!0}catch{}i=c.versions.electron??(u==="android"||a||!m)?"xdg-open":I}o.length>0&&t.push(...o),e.wait||(s.stdio="ignore",s.detached=!0)}u==="darwin"&&o.length>0&&t.push("--args",...o),e.target&&t.push(e.target);const p=M.spawn(i,t,s);return e.wait?new Promise((a,m)=>{p.once("error",m),p.once("close",f=>{if(!e.allowNonzeroExitCode&&f>0){m(new Error(`Exited with code ${f}`));return}a(p)})}):(p.unref(),p)},"baseOpen"),ae=n((e,r)=>{if(typeof e!="string"&&!Array.isArray(e))throw new TypeError("Expected a valid `name`");const{arguments:o=[]}=r??{};if(o!=null&&!Array.isArray(o))throw new TypeError("Expected `appArguments` as Array type");return x({...r,app:{name:e,arguments:o}})},"openApp");function U(e){if(typeof e=="string"||Array.isArray(e))return e;const{[k]:r}=e;if(!r)throw new Error(`${k} is not supported`);return r}n(U,"detectArchBinary");function y({[u]:e},{wsl:r}){if(r&&g)return U(r);if(!e)throw new Error(`${u} is not supported`);return U(e)}n(y,"detectPlatformBinary");const l={};d(l,"chrome",()=>y({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}})),d(l,"brave",()=>y({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}})),d(l,"firefox",()=>y({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"})),d(l,"edge",()=>y({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"})),d(l,"browser",()=>"browser"),d(l,"browserPrivate",()=>"browserPrivate");export{l as apps,ae as openApp};
@@ -994,7 +994,7 @@ type GraphicalRequests = Request<'guiAddCards', 6, {
994
994
  note: number;
995
995
  }> | Request<'guiExitAnki', 6> | Request<'guiImportFile', 6, {
996
996
  path: string;
997
- }> | Request<'guiSelectCard', 6, {
997
+ }> | Request<'guiPlayAudio', 6, never, true> | Request<'guiSelectCard', 6, {
998
998
  card: number;
999
999
  }, boolean> | Request<'guiSelectedNotes', 6, never, number[]> | Request<'guiSelectNote', 6, {
1000
1000
  note: number;
package/dist/lib/index.js CHANGED
@@ -1 +1 @@
1
- import{c as n,d as i,q as r,g as f,a as m,e as p,h as u,k as d,o as y,f as S,b as O,i as c,m as F,t as N,j as R,u as g,l as k,r as h,s as w,n as A,p as C,v as G}from"../sync-files-DJLnBCjf.js";import"process";import"rehype-parse";import"node:path";import"node:crypto";export{n as cleanNotes,i as defaultCleanOptions,r as defaultGetNoteFromMarkdownOptions,f as defaultGetStyleOptions,m as defaultListOptions,p as defaultRenameFilesOptions,u as defaultSetStyleOptions,d as defaultSyncFilesOptions,y as defaultSyncNotesOptions,S as formatCleanResult,O as formatListResult,c as formatSetStyleResult,F as formatSyncFilesResult,N as getNoteFromMarkdown,R as getStyle,g as hostAndPortToUrl,k as listNotes,h as renameFiles,w as setStyle,A as syncFiles,C as syncNotes,G as urlToHostAndPort};
1
+ import{c as n,d as i,q as r,g as f,a as m,e as p,h as u,k as d,o as y,f as S,b as O,i as c,m as F,t as N,j as R,u as g,l as k,r as h,s as w,n as A,p as C,v as G}from"../sync-files-c_f2UU5e.js";import"process";import"rehype-parse";import"node:path";import"node:crypto";export{n as cleanNotes,i as defaultCleanOptions,r as defaultGetNoteFromMarkdownOptions,f as defaultGetStyleOptions,m as defaultListOptions,p as defaultRenameFilesOptions,u as defaultSetStyleOptions,d as defaultSyncFilesOptions,y as defaultSyncNotesOptions,S as formatCleanResult,O as formatListResult,c as formatSetStyleResult,F as formatSyncFilesResult,N as getNoteFromMarkdown,R as getStyle,g as hostAndPortToUrl,k as listNotes,h as renameFiles,w as setStyle,A as syncFiles,C as syncNotes,G as urlToHostAndPort};