@nsis/dent 0.4.1 → 0.5.0
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.
- package/LICENSE +1 -1
- package/README.md +4 -1
- package/dist/dent.d.mts +17 -0
- package/dist/dent.mjs +20 -0
- package/package.json +57 -59
- package/dist/dent.d.ts +0 -10
- package/dist/dent.js +0 -10
- package/types/index.d.ts +0 -13
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
[](https://www.npmjs.org/package/@nsis/dent)
|
|
7
7
|
[](https://github.com/idleberg/node-dent/actions)
|
|
8
8
|
|
|
9
|
+
> [!NOTE]
|
|
10
|
+
> This is the repository for the formatting library. Chances are you are looking for the [CLI tool](https://www.npmjs.com/package/@nsis/dent-cli) instead.
|
|
11
|
+
|
|
9
12
|
## Installation
|
|
10
13
|
|
|
11
14
|
`npm install @nsis/dent`
|
|
@@ -52,7 +55,7 @@ Default: `true`
|
|
|
52
55
|
|
|
53
56
|
## Related
|
|
54
57
|
|
|
55
|
-
- [
|
|
58
|
+
- [dent-cli](https://www.npmjs.com/package/@nsis/dent-cli)
|
|
56
59
|
|
|
57
60
|
## License
|
|
58
61
|
|
package/dist/dent.d.mts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/dent.d.ts
|
|
2
|
+
type Options = {
|
|
3
|
+
endOfLines?: 'crlf' | 'lf';
|
|
4
|
+
indentSize?: number;
|
|
5
|
+
trimEmptyLines?: boolean;
|
|
6
|
+
useTabs?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Formats the given file contents using the Dent formatting style.
|
|
10
|
+
*
|
|
11
|
+
* @param {Options} options - The options for the Dent formatter.
|
|
12
|
+
* @returns {function(string): string} The formatting function.
|
|
13
|
+
* @throws {Error} Throws an error if the options are invalid.
|
|
14
|
+
*/
|
|
15
|
+
declare function createFormatter(options?: Options): (fileContents: string) => string;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { createFormatter };
|
package/dist/dent.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{platform as e}from"node:os";import{detectNewline as t}from"detect-newline";const n=new Set(`!addincludedir.!addplugindir.!appendfile.!appendmemfile.!assert.!cd.!define.!delfile.!echo.!else.!endif.!error.!execute.!finalize.!getdllversion.!gettlbversion.!if.!ifdef.!ifmacrodef.!ifmacrondef.!ifndef.!include.!insertmacro.!macro.!macroend.!macroundef.!makensis.!packhdr.!pragma.!searchparse.!searchreplace.!system.!tempfile.!undef.!uninstfinalize.!verbose.!warning`.split(`.`)),r=new Set(`Abort.AddBrandingImage.AddSize.AllowRootDirInstall.AllowSkipFiles.AutoCloseWindow.BGFont.BGGradient.BrandingText.BringToFront.Call.CallInstDLL.Caption.ChangeUI.CheckBitmap.ClearErrors.CompletedText.ComponentText.CopyFiles.CPU.CRCCheck.CreateDirectory.CreateFont.CreateShortcut.Delete.DeleteINISec.DeleteINIStr.DeleteRegKey.DeleteRegValue.DetailPrint.DetailsButtonText.DirShow.DirText.DirVar.DirVerify.EnableWindow.EnumRegKey.EnumRegValue.Exch.Exec.ExecShell.ExecShellWait.ExecWait.ExpandEnvStrings.File.FileBufSize.FileClose.FileErrorText.FileOpen.FileRead.FileReadByte.FileReadUTF16LE.FileReadWord.FileSeek.FileWrite.FileWriteByte.FileWriteUTF16LE.FileWriteWord.FindClose.FindFirst.FindNext.FindWindow.FlushINI.Function.FunctionEnd.GetCurInstType.GetCurrentAddress.GetDlgItem.GetDLLVersion.GetDLLVersionLocal.GetErrorLevel.GetFileTime.GetFileTimeLocal.GetFullPathName.GetFunctionAddress.GetInstDirError.GetKnownFolderPath.GetLabelAddress.GetRegView.GetShellVarContext.GetTempFileName.GetWinVer.Goto.HideWindow.Icon.IfAbort.IfAltRegView.IfErrors.IfFileExists.IfRebootFlag.IfRtlLanguage.IfShellVarContextAll.IfSilent.InitPluginsDir.InstallButtonText.InstallColors.InstallDir.InstallDirRegKey.InstProgressFlags.InstType.InstTypeGetText.InstTypeSetText.Int64Cmp.Int64CmpU.Int64Fmt.IntCmp.IntCmpU.IntFmt.IntOp.IntPtrCmp.IntPtrCmpU.IntPtrOp.IsWindow.LangString.LangStringUP.LicenseBkColor.LicenseData.LicenseForceSelection.LicenseLangString.LicenseText.LoadAndSetImage.LoadLanguageFile.LockWindow.LogSet.LogText.ManifestAppendCustomString.ManifestDisableWindowFiltering.ManifestDPIAware.ManifestDPIAwareness.ManifestGdiScaling.ManifestLongPathAware.ManifestMaxVersionTested.ManifestSupportedOS.MessageBox.MiscButtonText.Name.Nop.OutFile.Page.PageCallbacks.PageEx.PageExEnd.PEAddResource.PEDllCharacteristics.PERemoveResource.PESubsysVer.Pop.Push.Quit.ReadEnvStr.ReadINIStr.ReadMemory.ReadRegDWORD.ReadRegStr.Reboot.RegDLL.Rename.RequestExecutionLevel.ReserveFile.Return.RMDir.SearchPath.Section.SectionEnd.SectionGetFlags.SectionGetInstTypes.SectionGetSize.SectionGetText.SectionGroup.SectionGroupEnd.SectionIn.SectionInstType.SectionSetFlags.SectionSetInstTypes.SectionSetSize.SectionSetText.SendMessage.SetAutoClose.SetBrandingImage.SetCompress.SetCompressionLevel.SetCompressor.SetCompressorDictSize.SetCtlColors.SetCurInstType.SetDatablockOptimize.SetDateSave.SetDetailsPrint.SetDetailsView.SetErrorLevel.SetErrors.SetFileAttributes.SetFont.SetOutPath.SetOverwrite.SetPluginUnload.SetRebootFlag.SetRegView.SetShellVarContext.SetSilent.ShowInstDetails.ShowUninstDetails.ShowWindow.SilentInstall.SilentUnInstall.Sleep.SpaceTexts.StrCmp.StrCmpS.StrCpy.StrLen.SubCaption.SubSection.SubSectionEnd.Target.Unicode.UninstallButtonText.UninstallCaption.UninstallExeName.UninstallIcon.UninstallSubCaption.UninstallText.UninstPage.UnRegDLL.UnsafeStrCpy.Var.VIAddVersionKey.VIFileVersion.VIProductVersion.WindowIcon.WriteINIStr.WriteRegBin.WriteRegDWORD.WriteRegExpandStr.WriteRegMultiStr.WriteRegNone.WriteRegStr.WriteUninstaller.XPStyle`.split(`.`).map(e=>e.toLowerCase()));var i=class extends SyntaxError{constructor(e,t,n,r){super(e),this.expected=t,this.found=n,this.location=r,this.name=`SyntaxError`}format(e){let t=`Error: `+this.message;if(this.location){let n=null,r=e.find(e=>e.source===this.location.source);r&&(n=r.text.split(/\r\n|\n|\r/g));let i=this.location.start,a=this.location.source&&typeof this.location.source.offset==`function`?this.location.source.offset(i):i,o=this.location.source+`:`+a.line+`:`+a.column;if(n){let e=this.location.end,r=``.padEnd(a.line.toString().length,` `),s=n[i.line-1],c=(i.line===e.line?e.column:s.length+1)-i.column||1;t+=`
|
|
2
|
+
--> `+o+`
|
|
3
|
+
`+r+` |
|
|
4
|
+
`+a.line+` | `+s+`
|
|
5
|
+
`+r+` | `+``.padEnd(i.column-1,` `)+``.padEnd(c,`^`)}else t+=`
|
|
6
|
+
at `+o}return t}static buildMessage(e,t){function n(e){return e.codePointAt(0).toString(16).toUpperCase()}let r=Object.prototype.hasOwnProperty.call(RegExp.prototype,`unicode`)?RegExp(`[\\p{C}\\p{Mn}\\p{Mc}]`,`gu`):null;function i(e){return r?e.replace(r,e=>`\\u{`+n(e)+`}`):e}function a(e){return i(e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\0/g,`\\0`).replace(/\t/g,`\\t`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/[\x00-\x0F]/g,e=>`\\x0`+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>`\\x`+n(e)))}function o(e){return i(e.replace(/\\/g,`\\\\`).replace(/\]/g,`\\]`).replace(/\^/g,`\\^`).replace(/-/g,`\\-`).replace(/\0/g,`\\0`).replace(/\t/g,`\\t`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/[\x00-\x0F]/g,e=>`\\x0`+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>`\\x`+n(e)))}let s={literal(e){return`"`+a(e.text)+`"`},class(e){let t=e.parts.map(e=>Array.isArray(e)?o(e[0])+`-`+o(e[1]):o(e));return`[`+(e.inverted?`^`:``)+t.join(``)+`]`+(e.unicode?`u`:``)},any(){return`any character`},end(){return`end of input`},other(e){return e.description}};function c(e){return s[e.type](e)}function l(e){let t=e.map(c);if(t.sort(),t.length>0){let e=1;for(let n=1;n<t.length;n++)t[n-1]!==t[n]&&(t[e]=t[n],e++);t.length=e}switch(t.length){case 1:return t[0];case 2:return t[0]+` or `+t[1];default:return t.slice(0,-1).join(`, `)+`, or `+t[t.length-1]}}function u(e){return e?`"`+a(e)+`"`:`end of input`}return`Expected `+l(e)+` but `+u(t)+` found.`}};function a(e,t){t=t===void 0?{}:t;let a={},o=t.grammarSource,s={Script:Me},c=Me,l=/^[#;]/,u=/^[^\r\n]/,d=/^[\r\n]/,ee=/^[a-zA-Z_.]/,f=/^[a-zA-Z0-9_.]/,p=/^[a-zA-Z]/,m=/^[a-zA-Z0-9]/,h=/^[a-zA-Z0-9_]/,g=/^[^"\r\n]/,_=/^[^'\r\n]/,v=/^[^`\r\n]/,y=/^[^ \t\r\n;#]/,b=/^[ \t]/,te=/^[\n\r]/,x=q([`#`,`;`],!1,!1,!1),S=q([`\r`,`
|
|
7
|
+
`],!0,!1,!1),ne=K(`/*`,!1),C=K(`*/`,!1),w=De(),T=q([`\r`,`
|
|
8
|
+
`],!1,!1,!1),re=q([[`a`,`z`],[`A`,`Z`],`_`,`.`],!1,!1,!1),E=q([[`a`,`z`],[`A`,`Z`],[`0`,`9`],`_`,`.`],!1,!1,!1),D=K(`:`,!1),ie=J(`keyword`),ae=K(`!`,!1),O=q([[`a`,`z`],[`A`,`Z`]],!1,!1,!1),oe=K("${",!1),k=q([[`a`,`z`],[`A`,`Z`],[`0`,`9`]],!1,!1,!1),se=K(`}`,!1),A=q([[`a`,`z`],[`A`,`Z`],[`0`,`9`],`_`],!1,!1,!1),ce=K(`::`,!1),le=J(`argument`),ue=K(`"`,!1),j=K(`""`,!1),M=K(`$\\"`,!1),N=q([`"`,`\r`,`
|
|
9
|
+
`],!0,!1,!1),P=K(`'`,!1),F=q([`'`,`\r`,`
|
|
10
|
+
`],!0,!1,!1),I=K("`",!1),L=q(["`",`\r`,`
|
|
11
|
+
`],!0,!1,!1),R=q([` `,` `,`\r`,`
|
|
12
|
+
`,`;`,`#`],!0,!1,!1),z=q([` `,` `],!1,!1,!1),de=J(`end of line`),fe=K(`\r
|
|
13
|
+
`,!1),pe=q([`
|
|
14
|
+
`,`\r`],!1,!1,!1);function me(e){return e}function he(){return{type:`blank`}}function ge(e,t){return{type:`comment`,style:e===`#`?`hash`:`semicolon`,value:t.trimStart()}}function _e(e){return{type:`comment`,style:`block`,value:e}}function ve(e,t){return{type:`label`,name:e,comment:t??void 0}}function ye(e,t,n){let r={type:`instruction`,keyword:e,args:t};return n&&(r.comment=n),r}function be(e){return n.has(e.toLowerCase())}function xe(e){return e}function Se(e){return r.has(e.toLowerCase())}function Ce(e){return e}function we(e){return e}function Te(e,t){return{style:e===`#`?`hash`:`semicolon`,value:t.trimStart()}}let B=t.peg$currPos|0,V=[{line:1,column:1}],H=B,U=t.peg$maxFailExpected||[],W=t.peg$silentFails|0,G;if(t.startRule){if(!(t.startRule in s))throw Error(`Can't start parsing from rule "`+t.startRule+`".`);c=s[t.startRule]}function Ee(t=B){let n=e.codePointAt(t);return n===void 0?``:String.fromCodePoint(n)}function K(e,t){return{type:`literal`,text:e,ignoreCase:t}}function q(e,t,n,r){return{type:`class`,parts:e,inverted:t,ignoreCase:n,unicode:r}}function De(){return{type:`any`}}function Oe(){return{type:`end`}}function J(e){return{type:`other`,description:e}}function ke(t){let n=V[t],r;if(n)return n;if(t>=V.length)r=V.length-1;else for(r=t;!V[--r];);for(n=V[r],n={line:n.line,column:n.column};r<t;)e.charCodeAt(r)===10?(n.line++,n.column=1):n.column++,r++;return V[t]=n,n}function Ae(e,t,n){let r=ke(e),i=ke(t),a={source:o,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:i.line,column:i.column}};return n&&o&&typeof o.offset==`function`&&(a.start=o.offset(a.start),a.end=o.offset(a.end)),a}function Y(e){B<H||(B>H&&(H=B,U=[]),U.push(e))}function je(e,t,n){return new i(i.buildMessage(e,t),e,t,n)}function Me(){let e,t,n;for(e=B,t=[],n=Ne();n!==a;)t.push(n),n=Ne();return t=me(t),e=t,e}function Ne(){let e;return e=Ie(),e===a&&(e=Pe(),e===a&&(e=Fe(),e===a&&(e=Le(),e===a&&(e=Re())))),e}function Pe(){let e,t;return e=B,Z(),t=Je(),t===a?(B=e,e=a):e=he(),e}function Fe(){let t,n,r,i,o;if(t=B,Z(),n=e.charAt(B),l.test(n)?B++:(n=a,W===0&&Y(x)),n!==a){for(r=B,i=[],o=e.charAt(B),u.test(o)?B++:(o=a,W===0&&Y(S));o!==a;)i.push(o),o=e.charAt(B),u.test(o)?B++:(o=a,W===0&&Y(S));r=e.substring(r,B),i=Q(),i===a?(B=t,t=a):t=ge(n,r)}else B=t,t=a;return t}function Ie(){let t,n,r,i,o,s,c;if(t=B,Z(),e.substr(B,2)===`/*`?(n=`/*`,B+=2):(n=a,W===0&&Y(ne)),n!==a){for(r=B,i=[],o=B,s=B,W++,e.substr(B,2)===`*/`?(c=`*/`,B+=2):(c=a,W===0&&Y(C)),W--,c===a?s=void 0:(B=s,s=a),s===a?(B=o,o=a):(e.length>B?(c=e.charAt(B),B++):(c=a,W===0&&Y(w)),c===a&&(c=e.charAt(B),d.test(c)?B++:(c=a,W===0&&Y(T))),c===a?(B=o,o=a):(s=[s,c],o=s));o!==a;)i.push(o),o=B,s=B,W++,e.substr(B,2)===`*/`?(c=`*/`,B+=2):(c=a,W===0&&Y(C)),W--,c===a?s=void 0:(B=s,s=a),s===a?(B=o,o=a):(e.length>B?(c=e.charAt(B),B++):(c=a,W===0&&Y(w)),c===a&&(c=e.charAt(B),d.test(c)?B++:(c=a,W===0&&Y(T))),c===a?(B=o,o=a):(s=[s,c],o=s));r=e.substring(r,B),e.substr(B,2)===`*/`?(i=`*/`,B+=2):(i=a,W===0&&Y(C)),i===a?(B=t,t=a):(o=Z(),s=Q(),s===a&&(s=null),t=_e(r))}else B=t,t=a;return t}function Le(){let t,n,r,i,o,s,c;if(t=B,Z(),n=B,r=B,i=e.charAt(B),ee.test(i)?B++:(i=a,W===0&&Y(re)),i!==a){for(o=[],s=e.charAt(B),f.test(s)?B++:(s=a,W===0&&Y(E));s!==a;)o.push(s),s=e.charAt(B),f.test(s)?B++:(s=a,W===0&&Y(E));i=[i,o],r=i}else B=r,r=a;return n=r===a?r:e.substring(n,B),n===a?(B=t,t=a):(e.charCodeAt(B)===58?(r=`:`,B++):(r=a,W===0&&Y(D)),r===a?(B=t,t=a):(i=B,W++,e.charCodeAt(B)===58?(o=`:`,B++):(o=a,W===0&&Y(D)),W--,o===a?i=void 0:(B=i,i=a),i===a?(B=t,t=a):(o=qe(),o===a&&(o=null),s=Z(),c=Q(),c===a?(B=t,t=a):t=ve(n,o)))),t}function Re(){let e,t,n,r,i;return e=B,Z(),t=ze(),t===a?(B=e,e=a):(n=We(),r=qe(),r===a&&(r=null),Z(),i=Q(),i===a?(B=e,e=a):e=ye(t,n,r)),e}function ze(){let e;return W++,e=Be(),e===a&&(e=Ve(),e===a&&(e=He(),e===a&&(e=Ue()))),W--,e===a&&W===0&&Y(ie),e}function Be(){let t,n,r,i,o,s;if(t=B,n=B,r=B,e.charCodeAt(B)===33?(i=`!`,B++):(i=a,W===0&&Y(ae)),i!==a){if(o=[],s=e.charAt(B),p.test(s)?B++:(s=a,W===0&&Y(O)),s!==a)for(;s!==a;)o.push(s),s=e.charAt(B),p.test(s)?B++:(s=a,W===0&&Y(O));else o=a;o===a?(B=r,r=a):(i=[i,o],r=i)}else B=r,r=a;return n=r===a?r:e.substring(n,B),n===a?(B=t,t=a):(r=be(n),r=r?void 0:a,r===a?(B=t,t=a):t=xe(n)),t}function Ve(){let t,n,r,i,o,s;if(t=B,n=B,e.substr(B,2)==="${"?(r="${",B+=2):(r=a,W===0&&Y(oe)),r!==a)if(i=e.charAt(B),p.test(i)?B++:(i=a,W===0&&Y(O)),i!==a){for(o=[],s=e.charAt(B),m.test(s)?B++:(s=a,W===0&&Y(k));s!==a;)o.push(s),s=e.charAt(B),m.test(s)?B++:(s=a,W===0&&Y(k));e.charCodeAt(B)===125?(s=`}`,B++):(s=a,W===0&&Y(se)),s===a?(B=n,n=a):(r=[r,i,o,s],n=r)}else B=n,n=a;else B=n,n=a;return t=n===a?n:e.substring(t,B),t}function He(){let t,n,r,i,o,s,c,l;if(t=B,n=B,r=e.charAt(B),p.test(r)?B++:(r=a,W===0&&Y(O)),r!==a){for(i=[],o=e.charAt(B),h.test(o)?B++:(o=a,W===0&&Y(A));o!==a;)i.push(o),o=e.charAt(B),h.test(o)?B++:(o=a,W===0&&Y(A));if(e.substr(B,2)===`::`?(o=`::`,B+=2):(o=a,W===0&&Y(ce)),o!==a)if(s=e.charAt(B),p.test(s)?B++:(s=a,W===0&&Y(O)),s!==a){for(c=[],l=e.charAt(B),h.test(l)?B++:(l=a,W===0&&Y(A));l!==a;)c.push(l),l=e.charAt(B),h.test(l)?B++:(l=a,W===0&&Y(A));r=[r,i,o,s,c],n=r}else B=n,n=a;else B=n,n=a}else B=n,n=a;return t=n===a?n:e.substring(t,B),t}function Ue(){let t,n,r,i,o,s;if(t=B,n=B,r=B,i=e.charAt(B),p.test(i)?B++:(i=a,W===0&&Y(O)),i!==a){for(o=[],s=e.charAt(B),m.test(s)?B++:(s=a,W===0&&Y(k));s!==a;)o.push(s),s=e.charAt(B),m.test(s)?B++:(s=a,W===0&&Y(k));i=[i,o],r=i}else B=r,r=a;return n=r===a?r:e.substring(n,B),n===a?(B=t,t=a):(r=Se(n),r=r?void 0:a,r===a?(B=t,t=a):t=Ce(n)),t}function We(){let e,t,n,r;for(e=B,t=[],n=B,Z(),r=X(),r===a?(B=n,n=a):n=r;n!==a;)t.push(n),n=B,Z(),r=X(),r===a?(B=n,n=a):n=r;return t=we(t),e=t,e}function X(){let e;return W++,e=Ge(),e===a&&(e=Ke()),W--,e===a&&W===0&&Y(le),e}function Ge(){let t,n,r,i,o;if(t=B,n=B,e.charCodeAt(B)===34?(r=`"`,B++):(r=a,W===0&&Y(ue)),r!==a){for(i=[],e.substr(B,2)===`""`?(o=`""`,B+=2):(o=a,W===0&&Y(j)),o===a&&(e.substr(B,3)===`$\\"`?(o=`$\\"`,B+=3):(o=a,W===0&&Y(M)),o===a&&(o=e.charAt(B),g.test(o)?B++:(o=a,W===0&&Y(N))));o!==a;)i.push(o),e.substr(B,2)===`""`?(o=`""`,B+=2):(o=a,W===0&&Y(j)),o===a&&(e.substr(B,3)===`$\\"`?(o=`$\\"`,B+=3):(o=a,W===0&&Y(M)),o===a&&(o=e.charAt(B),g.test(o)?B++:(o=a,W===0&&Y(N))));e.charCodeAt(B)===34?(o=`"`,B++):(o=a,W===0&&Y(ue)),o===a?(B=n,n=a):(r=[r,i,o],n=r)}else B=n,n=a;if(t=n===a?n:e.substring(t,B),t===a){if(t=B,n=B,e.charCodeAt(B)===39?(r=`'`,B++):(r=a,W===0&&Y(P)),r!==a){for(i=[],o=e.charAt(B),_.test(o)?B++:(o=a,W===0&&Y(F));o!==a;)i.push(o),o=e.charAt(B),_.test(o)?B++:(o=a,W===0&&Y(F));e.charCodeAt(B)===39?(o=`'`,B++):(o=a,W===0&&Y(P)),o===a?(B=n,n=a):(r=[r,i,o],n=r)}else B=n,n=a;if(t=n===a?n:e.substring(t,B),t===a){if(t=B,n=B,e.charCodeAt(B)===96?(r="`",B++):(r=a,W===0&&Y(I)),r!==a){for(i=[],o=e.charAt(B),v.test(o)?B++:(o=a,W===0&&Y(L));o!==a;)i.push(o),o=e.charAt(B),v.test(o)?B++:(o=a,W===0&&Y(L));e.charCodeAt(B)===96?(o="`",B++):(o=a,W===0&&Y(I)),o===a?(B=n,n=a):(r=[r,i,o],n=r)}else B=n,n=a;t=n===a?n:e.substring(t,B)}}return t}function Ke(){let t,n,r;if(t=B,n=[],r=e.charAt(B),y.test(r)?B++:(r=a,W===0&&Y(R)),r!==a)for(;r!==a;)n.push(r),r=e.charAt(B),y.test(r)?B++:(r=a,W===0&&Y(R));else n=a;return t=n===a?n:e.substring(t,B),t}function qe(){let t,n,r,i,o;if(t=B,Z(),n=e.charAt(B),l.test(n)?B++:(n=a,W===0&&Y(x)),n!==a){for(r=B,i=[],o=e.charAt(B),u.test(o)?B++:(o=a,W===0&&Y(S));o!==a;)i.push(o),o=e.charAt(B),u.test(o)?B++:(o=a,W===0&&Y(S));r=e.substring(r,B),t=Te(n,r)}else B=t,t=a;return t}function Z(){let t,n;for(W++,t=[],n=e.charAt(B),b.test(n)?B++:(n=a,W===0&&Y(z));n!==a;)t.push(n),n=e.charAt(B),b.test(n)?B++:(n=a,W===0&&Y(z));return W--,t}function Je(){let t;return W++,e.substr(B,2)===`\r
|
|
15
|
+
`?(t=`\r
|
|
16
|
+
`,B+=2):(t=a,W===0&&Y(fe)),t===a&&(t=e.charAt(B),te.test(t)?B++:(t=a,W===0&&Y(pe))),W--,t===a&&W===0&&Y(de),t}function Q(){let e;return e=Je(),e===a&&(e=Ye()),e}function Ye(){let t,n;return t=B,W++,e.length>B?(n=e.charAt(B),B++):(n=a,W===0&&Y(w)),W--,n===a?t=void 0:(B=t,t=a),t}G=c();let $=G!==a&&B===e.length;function Xe(){throw G!==a&&B<e.length&&Y(Oe()),je(U,H<e.length?Ee(H):null,H<e.length?Ae(H,H+1):Ae(H,H))}if(t.peg$library)return{peg$result:G,peg$currPos:B,peg$FAILED:a,peg$maxFailExpected:U,peg$maxFailPos:H,peg$success:$,peg$throw:$?void 0:Xe};if($)return G;Xe()}function o(e){return a(e.replace(/^\uFEFF/,``).replace(/\\\r?\n[ \t]*/g,` `))}const s=new Map([[`!addincludedir`,`!addincludedir`],[`!addplugindir`,`!addplugindir`],[`!appendfile`,`!appendfile`],[`!appendmemfile`,`!appendmemfile`],[`!assert`,`!assert`],[`!cd`,`!cd`],[`!define`,`!define`],[`!delfile`,`!delfile`],[`!echo`,`!echo`],[`!else`,`!else`],[`!endif`,`!endif`],[`!error`,`!error`],[`!execute`,`!execute`],[`!finalize`,`!finalize`],[`!getdllversion`,`!getdllversion`],[`!gettlbversion`,`!gettlbversion`],[`!if`,`!if`],[`!ifdef`,`!ifdef`],[`!ifmacrodef`,`!ifmacrodef`],[`!ifmacrondef`,`!ifmacrondef`],[`!ifndef`,`!ifndef`],[`!include`,`!include`],[`!insertmacro`,`!insertmacro`],[`!macro`,`!macro`],[`!macroend`,`!macroend`],[`!macroundef`,`!macroundef`],[`!makensis`,`!makensis`],[`!packhdr`,`!packhdr`],[`!pragma`,`!pragma`],[`!searchparse`,`!searchparse`],[`!searchreplace`,`!searchreplace`],[`!system`,`!system`],[`!tempfile`,`!tempfile`],[`!undef`,`!undef`],[`!uninstfinalize`,`!uninstfinalize`],[`!verbose`,`!verbose`],[`!warning`,`!warning`],[`abort`,`Abort`],[`addbrandingimage`,`AddBrandingImage`],[`addsize`,`AddSize`],[`allowrootdirinstall`,`AllowRootDirInstall`],[`allowskipfiles`,`AllowSkipFiles`],[`autoclosewindow`,`AutoCloseWindow`],[`bgfont`,`BGFont`],[`bggradient`,`BGGradient`],[`brandingtext`,`BrandingText`],[`bringtofront`,`BringToFront`],[`call`,`Call`],[`callinstdll`,`CallInstDLL`],[`caption`,`Caption`],[`changeui`,`ChangeUI`],[`checkbitmap`,`CheckBitmap`],[`clearerrors`,`ClearErrors`],[`completedtext`,`CompletedText`],[`componenttext`,`ComponentText`],[`copyfiles`,`CopyFiles`],[`cpu`,`CPU`],[`crccheck`,`CRCCheck`],[`createdirectory`,`CreateDirectory`],[`createfont`,`CreateFont`],[`createshortcut`,`CreateShortcut`],[`delete`,`Delete`],[`deleteinisec`,`DeleteINISec`],[`deleteinistr`,`DeleteINIStr`],[`deleteregkey`,`DeleteRegKey`],[`deleteregvalue`,`DeleteRegValue`],[`detailprint`,`DetailPrint`],[`detailsbuttontext`,`DetailsButtonText`],[`dirshow`,`DirShow`],[`dirtext`,`DirText`],[`dirvar`,`DirVar`],[`dirverify`,`DirVerify`],[`enablewindow`,`EnableWindow`],[`enumregkey`,`EnumRegKey`],[`enumregvalue`,`EnumRegValue`],[`exch`,`Exch`],[`exec`,`Exec`],[`execshell`,`ExecShell`],[`execshellwait`,`ExecShellWait`],[`execwait`,`ExecWait`],[`expandenvstrings`,`ExpandEnvStrings`],[`file`,`File`],[`filebufsize`,`FileBufSize`],[`fileclose`,`FileClose`],[`fileerrortext`,`FileErrorText`],[`fileopen`,`FileOpen`],[`fileread`,`FileRead`],[`filereadbyte`,`FileReadByte`],[`filereadutf16le`,`FileReadUTF16LE`],[`filereadword`,`FileReadWord`],[`fileseek`,`FileSeek`],[`filewrite`,`FileWrite`],[`filewritebyte`,`FileWriteByte`],[`filewriteutf16le`,`FileWriteUTF16LE`],[`filewriteword`,`FileWriteWord`],[`findclose`,`FindClose`],[`findfirst`,`FindFirst`],[`findnext`,`FindNext`],[`findwindow`,`FindWindow`],[`flushini`,`FlushINI`],[`function`,`Function`],[`functionend`,`FunctionEnd`],[`getcurinsttype`,`GetCurInstType`],[`getcurrentaddress`,`GetCurrentAddress`],[`getdlgitem`,`GetDlgItem`],[`getdllversion`,`GetDLLVersion`],[`getdllversionlocal`,`GetDLLVersionLocal`],[`geterrorlevel`,`GetErrorLevel`],[`getfiletime`,`GetFileTime`],[`getfiletimelocal`,`GetFileTimeLocal`],[`getfullpathname`,`GetFullPathName`],[`getfunctionaddress`,`GetFunctionAddress`],[`getinstdirerror`,`GetInstDirError`],[`getknownfolderpath`,`GetKnownFolderPath`],[`getlabeladdress`,`GetLabelAddress`],[`getregview`,`GetRegView`],[`getshellvarcontext`,`GetShellVarContext`],[`gettempfilename`,`GetTempFileName`],[`getwinver`,`GetWinVer`],[`goto`,`Goto`],[`hidewindow`,`HideWindow`],[`icon`,`Icon`],[`ifabort`,`IfAbort`],[`ifaltregview`,`IfAltRegView`],[`iferrors`,`IfErrors`],[`iffileexists`,`IfFileExists`],[`ifrebootflag`,`IfRebootFlag`],[`ifrtllanguage`,`IfRtlLanguage`],[`ifshellvarcontextall`,`IfShellVarContextAll`],[`ifsilent`,`IfSilent`],[`initpluginsdir`,`InitPluginsDir`],[`installbuttontext`,`InstallButtonText`],[`installcolors`,`InstallColors`],[`installdir`,`InstallDir`],[`installdirregkey`,`InstallDirRegKey`],[`instprogressflags`,`InstProgressFlags`],[`insttype`,`InstType`],[`insttypegettext`,`InstTypeGetText`],[`insttypesettext`,`InstTypeSetText`],[`int64cmp`,`Int64Cmp`],[`int64cmpu`,`Int64CmpU`],[`int64fmt`,`Int64Fmt`],[`intcmp`,`IntCmp`],[`intcmpu`,`IntCmpU`],[`intfmt`,`IntFmt`],[`intop`,`IntOp`],[`intptrcmp`,`IntPtrCmp`],[`intptrcmpu`,`IntPtrCmpU`],[`intptrop`,`IntPtrOp`],[`iswindow`,`IsWindow`],[`langstring`,`LangString`],[`langstringup`,`LangStringUP`],[`licensebkcolor`,`LicenseBkColor`],[`licensedata`,`LicenseData`],[`licenseforceselection`,`LicenseForceSelection`],[`licenselangstring`,`LicenseLangString`],[`licensetext`,`LicenseText`],[`loadandsetimage`,`LoadAndSetImage`],[`loadlanguagefile`,`LoadLanguageFile`],[`lockwindow`,`LockWindow`],[`logset`,`LogSet`],[`logtext`,`LogText`],[`manifestappendcustomstring`,`ManifestAppendCustomString`],[`manifestdisablewindowfiltering`,`ManifestDisableWindowFiltering`],[`manifestdpiaware`,`ManifestDPIAware`],[`manifestdpiawareness`,`ManifestDPIAwareness`],[`manifestgdiscaling`,`ManifestGdiScaling`],[`manifestlongpathaware`,`ManifestLongPathAware`],[`manifestmaxversiontested`,`ManifestMaxVersionTested`],[`manifestsupportedos`,`ManifestSupportedOS`],[`messagebox`,`MessageBox`],[`miscbuttontext`,`MiscButtonText`],[`name`,`Name`],[`nop`,`Nop`],[`outfile`,`OutFile`],[`page`,`Page`],[`pagecallbacks`,`PageCallbacks`],[`pageex`,`PageEx`],[`pageexend`,`PageExEnd`],[`peaddresource`,`PEAddResource`],[`pedllcharacteristics`,`PEDllCharacteristics`],[`peremoveresource`,`PERemoveResource`],[`pesubsysver`,`PESubsysVer`],[`pop`,`Pop`],[`push`,`Push`],[`quit`,`Quit`],[`readenvstr`,`ReadEnvStr`],[`readinistr`,`ReadINIStr`],[`readmemory`,`ReadMemory`],[`readregdword`,`ReadRegDWORD`],[`readregstr`,`ReadRegStr`],[`reboot`,`Reboot`],[`regdll`,`RegDLL`],[`rename`,`Rename`],[`requestexecutionlevel`,`RequestExecutionLevel`],[`reservefile`,`ReserveFile`],[`return`,`Return`],[`rmdir`,`RMDir`],[`searchpath`,`SearchPath`],[`section`,`Section`],[`sectionend`,`SectionEnd`],[`sectiongetflags`,`SectionGetFlags`],[`sectiongetinsttypes`,`SectionGetInstTypes`],[`sectiongetsize`,`SectionGetSize`],[`sectiongettext`,`SectionGetText`],[`sectiongroup`,`SectionGroup`],[`sectiongroupend`,`SectionGroupEnd`],[`sectionin`,`SectionIn`],[`sectioninsttype`,`SectionInstType`],[`sectionsetflags`,`SectionSetFlags`],[`sectionsetinsttypes`,`SectionSetInstTypes`],[`sectionsetsize`,`SectionSetSize`],[`sectionsettext`,`SectionSetText`],[`sendmessage`,`SendMessage`],[`setautoclose`,`SetAutoClose`],[`setbrandingimage`,`SetBrandingImage`],[`setcompress`,`SetCompress`],[`setcompressionlevel`,`SetCompressionLevel`],[`setcompressor`,`SetCompressor`],[`setcompressordictsize`,`SetCompressorDictSize`],[`setctlcolors`,`SetCtlColors`],[`setcurinsttype`,`SetCurInstType`],[`setdatablockoptimize`,`SetDatablockOptimize`],[`setdatesave`,`SetDateSave`],[`setdetailsprint`,`SetDetailsPrint`],[`setdetailsview`,`SetDetailsView`],[`seterrorlevel`,`SetErrorLevel`],[`seterrors`,`SetErrors`],[`setfileattributes`,`SetFileAttributes`],[`setfont`,`SetFont`],[`setoutpath`,`SetOutPath`],[`setoverwrite`,`SetOverwrite`],[`setpluginunload`,`SetPluginUnload`],[`setrebootflag`,`SetRebootFlag`],[`setregview`,`SetRegView`],[`setshellvarcontext`,`SetShellVarContext`],[`setsilent`,`SetSilent`],[`showinstdetails`,`ShowInstDetails`],[`showuninstdetails`,`ShowUninstDetails`],[`showwindow`,`ShowWindow`],[`silentinstall`,`SilentInstall`],[`silentuninstall`,`SilentUnInstall`],[`sleep`,`Sleep`],[`spacetexts`,`SpaceTexts`],[`strcmp`,`StrCmp`],[`strcmps`,`StrCmpS`],[`strcpy`,`StrCpy`],[`strlen`,`StrLen`],[`subcaption`,`SubCaption`],[`subsection`,`SubSection`],[`subsectionend`,`SubSectionEnd`],[`target`,`Target`],[`unicode`,`Unicode`],[`uninstallbuttontext`,`UninstallButtonText`],[`uninstallcaption`,`UninstallCaption`],[`uninstallexename`,`UninstallExeName`],[`uninstallicon`,`UninstallIcon`],[`uninstallsubcaption`,`UninstallSubCaption`],[`uninstalltext`,`UninstallText`],[`uninstpage`,`UninstPage`],[`unregdll`,`UnRegDLL`],[`unsafestrcpy`,`UnsafeStrCpy`],[`var`,`Var`],[`viaddversionkey`,`VIAddVersionKey`],[`vifileversion`,`VIFileVersion`],[`viproductversion`,`VIProductVersion`],[`windowicon`,`WindowIcon`],[`writeinistr`,`WriteINIStr`],[`writeregbin`,`WriteRegBin`],[`writeregdword`,`WriteRegDWORD`],[`writeregexpandstr`,`WriteRegExpandStr`],[`writeregmultistr`,`WriteRegMultiStr`],[`writeregnone`,`WriteRegNone`],[`writeregstr`,`WriteRegStr`],[`writeuninstaller`,`WriteUninstaller`],[`xpstyle`,`XPStyle`]]),c=new Map([[`/silent`,`/SILENT`],[`/filesonly`,`/FILESONLY`],[`/rebootok`,`/REBOOTOK`],[`/short`,`/SHORT`],[`/sd`,`/SD`],[`/branding`,`/BRANDING`],[`/final`,`/FINAL`],[`/solid`,`/SOLID`],[`/global`,`/GLOBAL`],[`/bom`,`/BOM`],[`/italic`,`/ITALIC`],[`/underline`,`/UNDERLINE`],[`/strike`,`/STRIKE`],[`/enablecancel`,`/ENABLECANCEL`],[`/overwrite`,`/OVERWRITE`],[`/replace`,`/REPLACE`],[`/noerrors`,`/NOERRORS`],[`/regedit5`,`/REGEDIT5`],[`/exeresource`,`/EXERESOURCE`],[`/stringid`,`/STRINGID`],[`/resizetofit`,`/RESIZETOFIT`],[`/resizetofitwidth`,`/RESIZETOFITWIDTH`],[`/resizetofitheight`,`/RESIZETOFITHEIGHT`],[`/trimleft`,`/TRIMLEFT`],[`/trimright`,`/TRIMRIGHT`],[`/trimcenter`,`/TRIMCENTER`],[`/windows`,`/windows`],[`/nonfatal`,`/NONFATAL`],[`/nocustom`,`/NOCUSTOM`],[`/uninstnocustom`,`/UNINSTNOCUSTOM`],[`/componentsonlyoncustom`,`/COMPONENTSONLYONCUSTOM`],[`/uninstcomponentsonlyoncustom`,`/UNINSTCOMPONENTSONLYONCUSTOM`],[`/fileexists`,`/FILEEXISTS`],[`/rawnl`,`/RAWNL`],[`/productversion`,`/ProductVersion`],[`/noworkingdir`,`/NoWorkingDir`],[`/r`,`/r`],[`/a`,`/a`],[`/e`,`/e`],[`/o`,`/o`],[`/x`,`/x`],[`/ifempty`,`/ifempty`],[`/ifnosubkeys`,`/ifnosubkeys`],[`/ifnovalues`,`/ifnovalues`],[`/nounload`,`/nounload`],[`/plugin`,`/plugin`],[`/ifndef`,`/ifndef`],[`/redef`,`/redef`],[`/date`,`/date`],[`/utcdate`,`/utcdate`],[`/file`,`/file`],[`/intfmt`,`/intfmt`],[`/math`,`/math`],[`/ignorecase`,`/ignorecase`],[`/packed`,`/packed`],[`/target`,`/target`],[`true`,`true`],[`false`,`false`],[`on`,`on`],[`off`,`off`],[`auto`,`auto`],[`force`,`force`],[`try`,`try`],[`leave`,`leave`],[`none`,`none`],[`all`,`all`],[`current`,`current`],[`default`,`default`],[`lastused`,`lastused`],[`normal`,`normal`],[`silent`,`silent`],[`silentlog`,`silentlog`],[`hide`,`hide`],[`show`,`show`],[`nevershow`,`nevershow`],[`listonly`,`listonly`],[`textonly`,`textonly`],[`both`,`both`],[`ifnewer`,`ifnewer`],[`ifdiff`,`ifdiff`],[`user`,`user`],[`highest`,`highest`],[`admin`,`admin`],[`notset`,`notset`],[`top`,`top`],[`left`,`left`],[`bottom`,`bottom`],[`right`,`right`],[`smooth`,`smooth`],[`colored`,`colored`],[`checkbox`,`checkbox`],[`radiobuttons`,`radiobuttons`],[`transparent`,`transparent`],[`push`,`push`],[`pop`,`pop`],[`enable`,`enable`],[`disable`,`disable`],[`warning`,`warning`],[`error`,`error`],[`open`,`open`],[`print`,`print`],[`custom`,`custom`],[`license`,`license`],[`components`,`components`],[`directory`,`directory`],[`instfiles`,`instfiles`],[`uninstconfirm`,`uninstConfirm`],[`zlib`,`zlib`],[`bzip2`,`bzip2`],[`lzma`,`lzma`],[`r`,`r`],[`w`,`w`],[`a`,`a`],[`x86`,`x86`],[`amd64`,`amd64`],[`hkcr`,`HKCR`],[`hkcr32`,`HKCR32`],[`hkcr64`,`HKCR64`],[`hklm`,`HKLM`],[`hklm32`,`HKLM32`],[`hklm64`,`HKLM64`],[`hkcu`,`HKCU`],[`hkcu32`,`HKCU32`],[`hkcu64`,`HKCU64`],[`hku`,`HKU`],[`hkcc`,`HKCC`],[`hkdd`,`HKDD`],[`hkpd`,`HKPD`],[`shctx`,`SHCTX`],[`mb_ok`,`MB_OK`],[`mb_okcancel`,`MB_OKCANCEL`],[`mb_abortretryignore`,`MB_ABORTRETRYIGNORE`],[`mb_retrycancel`,`MB_RETRYCANCEL`],[`mb_yesno`,`MB_YESNO`],[`mb_yesnocancel`,`MB_YESNOCANCEL`],[`mb_iconexclamation`,`MB_ICONEXCLAMATION`],[`mb_iconinformation`,`MB_ICONINFORMATION`],[`mb_iconquestion`,`MB_ICONQUESTION`],[`mb_iconstop`,`MB_ICONSTOP`],[`mb_usericon`,`MB_USERICON`],[`mb_topmost`,`MB_TOPMOST`],[`mb_setforeground`,`MB_SETFOREGROUND`],[`mb_right`,`MB_RIGHT`],[`mb_defbutton1`,`MB_DEFBUTTON1`],[`mb_defbutton2`,`MB_DEFBUTTON2`],[`mb_defbutton3`,`MB_DEFBUTTON3`],[`mb_defbutton4`,`MB_DEFBUTTON4`],[`idok`,`IDOK`],[`idcancel`,`IDCANCEL`],[`idyes`,`IDYES`],[`idno`,`IDNO`],[`idabort`,`IDABORT`],[`idretry`,`IDRETRY`],[`idignore`,`IDIGNORE`],[`sw_shownormal`,`SW_SHOWNORMAL`],[`sw_showmaximized`,`SW_SHOWMAXIMIZED`],[`sw_showminimized`,`SW_SHOWMINIMIZED`],[`sw_hide`,`SW_HIDE`],[`sw_show`,`SW_SHOW`],[`alt`,`ALT`],[`control`,`CONTROL`],[`ext`,`EXT`],[`shift`,`SHIFT`],[`archive`,`ARCHIVE`],[`hidden`,`HIDDEN`],[`offline`,`OFFLINE`],[`readonly`,`READONLY`],[`system`,`SYSTEM`],[`temporary`,`TEMPORARY`],[`set`,`SET`],[`cur`,`CUR`],[`end`,`END`],[`major`,`MAJOR`],[`minor`,`MINOR`],[`build`,`BUILD`],[`servicepack`,`SERVICEPACK`],[`winvista`,`WinVista`],[`win7`,`Win7`],[`win8`,`Win8`],[`win8.1`,`Win8.1`],[`win10`,`Win10`],[`dlg_id`,`dlg_id`]]),l=new Map([[`/lang=`,`/LANG=`],[`/timeout=`,`/TIMEOUT=`],[`/charset=`,`/CHARSET=`],[`/imgid=`,`/IMGID=`],[`/customstring=`,`/CUSTOMSTRING=`],[`/uninstcustomstring=`,`/UNINSTCUSTOMSTRING=`],[`/oname=`,`/oname=`]]);function u(e){return new Set(e.map(e=>e.toLowerCase()))}const d={open:u("!if.!ifdef.!ifmacrodef.!ifmacrondef.!ifndef.!macro.${Case}.${Case2}.${Case3}.${Case4}.${Case5}.${CaseElse}.${Default}.${Do}.${DoUntil}.${DoWhile}.${For}.${ForEach}.${If}.${IfNot}.${MementoSection}.${MementoUnselectedSection}.${Select}.${Switch}.${Unless}.Function.PageEx.Section.SectionGroup".split(`.`)),close:u([`!endif`,`!macroend`,"${EndIf}","${EndSelect}","${EndSwitch}","${EndWhile}","${Loop}","${LoopUntil}","${LoopWhile}","${MementoSectionEnd}","${Next}","${While}",`FunctionEnd`,`PageExEnd`,`SectionEnd`,`SectionGroupEnd`]),mid:u([`!else`,`!elseif`,"${Else}","${ElseIf}","${ElseIfNot}","${ElseUnless}","${AndIf}","${AndIfNot}","${AndUnless}","${OrIf}","${OrIfNot}","${OrUnless}"]),closeAfter:u(["${Break}"])};function ee(e,t){let n=0,r=[],i=[],a=t.trimEmptyLines?y(e):e;for(let e of a)switch(e.type){case`blank`:i.push(``);break;case`comment`:i.push(p(e,n,t));break;case`label`:i.push(m(e,n,t));break;case`instruction`:{let a=e.keyword.toLowerCase();if(d.open.has(a))i.push(_(e,n,t)),r.push(n),n++;else if(d.close.has(a))n=r.length>0?r.pop():0,i.push(_(e,n,t));else if(d.mid.has(a)){let n=r.length>0?r[r.length-1]:0;i.push(_(e,n,t))}else d.closeAfter.has(a)?(i.push(_(e,n,t)),n=r.length>0?r.pop():0):i.push(_(e,n,t));break}}return i.join(t.eol)+t.eol}function f(e,t){return(t.useTabs?` `:` `.repeat(t.indentSize)).repeat(e)}function p(e,t,n){let r=f(t,n);if(e.style===`block`){let t=e.value.split(/\r?\n/);return t.length===1?`${r}/*${e.value}*/`:t.map((e,n)=>{if(n===0)return`${r}/*${e}`;let i=e.trimStart();return n===t.length-1?`${r} ${i}*/`:`${r} ${i}`}).join(n.eol)}return`${r}${e.style===`hash`?`#`:`;`} ${e.value}`}function m(e,t,n){let r=`${f(t,n)}${e.name}:`;return e.comment&&(r+=` ${v(e.comment)}`),r}function h(e){if(e.startsWith(`"`)||e.startsWith(`'`)||e.startsWith("`")||e.startsWith(`$`))return e;let t=e.toLowerCase(),n=c.get(t);if(n!==void 0)return n;if(e.includes(`|`))return e.split(`|`).map(e=>h(e)).join(`|`);let r=e.indexOf(`=`);if(r>0){let n=`${t.slice(0,r+1)}`,i=l.get(n);if(i!==void 0)return`${i}${e.slice(r+1)}`}return e}function g(e){return e.reduce((e,t)=>{let n=e[e.length-1];return t===`|`&&e.length>0?e[e.length-1]=`${n}|`:n?.endsWith(`|`)?e[e.length-1]=`${n}${t}`:e.push(t),e},[])}function _(e,t,n){let r=s.get(e.keyword.toLowerCase())??e.keyword,i=g(e.args.map(h)),a=i.length>0?`${r} ${i.join(` `)}`:r,o=`${f(t,n)}${a}`;return e.comment&&(o+=` ${v(e.comment)}`),o}function v(e){return`${e.style===`hash`?`#`:`;`} ${e.value}`}function y(e){let t=0;for(;t<e.length&&e[t].type===`blank`;)t++;let n=e.length-1;for(;n>=t&&e[n].type===`blank`;)n--;let r=[],i=!1;for(let a=t;a<=n;a++){let t=e[a];t.type===`blank`?i||=(r.push(t),!0):(r.push(t),i=!1)}return r}function b(n={}){let r={indentSize:2,trimEmptyLines:!0,useTabs:!0,...n};if(r.useTabs===!1&&(!r.indentSize||Number.isNaN(r.indentSize)||r.indentSize<=0))throw Error(`The indentSize option expects a positive integer`);function i(e){let t=o(e),n=a(e);return ee(t,{useTabs:r.useTabs??!0,indentSize:r.indentSize??2,trimEmptyLines:r.trimEmptyLines??!0,eol:n})}function a(n){return r.endOfLines?r.endOfLines===`crlf`?`\r
|
|
17
|
+
`:`
|
|
18
|
+
`:t(n)??(e()===`win32`?`\r
|
|
19
|
+
`:`
|
|
20
|
+
`)}return i}export{b as createFormatter};
|
package/package.json
CHANGED
|
@@ -1,60 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
}
|
|
2
|
+
"name": "@nsis/dent",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "An opinionated code formatter for NSIS scripts",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/",
|
|
8
|
+
"types/",
|
|
9
|
+
"LICENSE",
|
|
10
|
+
"package.json",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"type": "module",
|
|
14
|
+
"typings": "dist/dent.d.mts",
|
|
15
|
+
"exports": "./dist/dent.mjs",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=20.0.0"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/idleberg/node-dent.git"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"nsis",
|
|
25
|
+
"formatter"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"detect-newline": "^4.0.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@commitlint/cli": "^20.4.1",
|
|
32
|
+
"@commitlint/config-conventional": "^20.4.1",
|
|
33
|
+
"@idleberg/configs": "^0.4.2",
|
|
34
|
+
"@types/node": "^24.11.0",
|
|
35
|
+
"concurrently": "^9.2.1",
|
|
36
|
+
"np": "^11.0.2",
|
|
37
|
+
"peggy": "^5.1.0",
|
|
38
|
+
"tsdown": "^0.21.0",
|
|
39
|
+
"tsm": "^2.3.0",
|
|
40
|
+
"typescript": "^5.3.3",
|
|
41
|
+
"uvu": "^0.5.6"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "npm run build:peggy && npm run build:lib",
|
|
45
|
+
"build:lib": "tsdown",
|
|
46
|
+
"build:peggy": "peggy --format es --dts --output src/grammar.js src/grammar.pegjs",
|
|
47
|
+
"dev": "concurrently --prefix-colors blue,green,magenta npm:dev:*",
|
|
48
|
+
"dev:lib": "npm run build:lib -- --watch",
|
|
49
|
+
"dev:peggy": "npm run build:peggy -- --watch",
|
|
50
|
+
"lint": "concurrently --prefix-colors blue,green,magenta npm:lint:*",
|
|
51
|
+
"lint:biome": "biome check",
|
|
52
|
+
"lint:e18e": "e18e-cli analyze",
|
|
53
|
+
"pretest": "npm run build:peggy",
|
|
54
|
+
"publish:jsr": "deno publish",
|
|
55
|
+
"publish:npm": "np",
|
|
56
|
+
"test": "uvu -r tsm tests"
|
|
57
|
+
}
|
|
58
|
+
}
|
package/dist/dent.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formats the given file contents using the Dent formatting style.
|
|
3
|
-
*
|
|
4
|
-
* @param {NsisDent.Options} options - The options for the Dent formatter.
|
|
5
|
-
* @returns {function(string): string} The formatting function.
|
|
6
|
-
* @throws {Error} Throws an error if the options are invalid.
|
|
7
|
-
*/
|
|
8
|
-
declare function createFormatter(options?: NsisDent.Options): (fileContents: string) => string;
|
|
9
|
-
|
|
10
|
-
export { createFormatter };
|
package/dist/dent.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { detectNewline } from 'detect-newline';
|
|
2
|
-
import { platform } from 'node:os';
|
|
3
|
-
|
|
4
|
-
var d={indenters:["!if","!ifdef","!ifmacrodef","!ifmacrondef","!ifndef","!macro","${Case}","${Case2}","${Case3}","${Case4}","${Case5}","${CaseElse}","${Default}","${Do}","${DoUntil}","${DoWhile}","${For}","${ForEach}","${If}","${IfNot}","${MementoSection}","${MementoUnselectedSection}","${Select}","${Switch}","${Unless}","Function","PageEx","Section","SectionGroup"].map(s=>s.toLowerCase()),dedenters:["!endif","!macroend","${EndIf}","${EndSelect}","${EndSwitch}","${EndWhile}","${Loop}","${LoopUntil}","${LoopWhile}","${MementoSectionEnd}","${Next}","${While}","FunctionEnd","PageExEnd","SectionEnd","SectionGroupEnd"].map(s=>s.toLowerCase()),specialIndenters:["!else","!elseif","${Else}","${ElseIf}","${ElseIfNot}","${ElseUnless}","${AndIf}","${AndIfNot}","${AndUnless}","${OrIf}","${OrIfNot}","${OrUnless}"].map(s=>s.toLowerCase()),specialDedenters:["${Break}"].map(s=>s.toLowerCase())};var f=2;function C(s={}){let n={endOfLines:platform()==="win32"?"crlf":"lf",indentSize:f,trimEmptyLines:!0,useTabs:!0,...s};if(n.useTabs===!1&&n.indentSize&&(isNaN(n.indentSize)||n.indentSize<=0))throw Error("The indentSize option expects a positive integer");function p(t){let e=0,l=0,c=u(t),i=[];return (n.trimEmptyLines===!0?t.trim().replaceAll(/^(\s*\r?\n){2,}/gm,c).split(c):t.split(c)).forEach(r=>{let a=r.trim().split(" ").at(0)??"";switch(a.toLowerCase()==="${Switch}"&&(l=e),!0){case a.toLowerCase()==="${EndSwitch}":e=l,i.push(o(r,e)),e=e===0?0:e-1;break;case d.specialIndenters.includes(a.toLowerCase()):i.push(o(r,e-1));break;case d.specialDedenters.includes(a.toLowerCase()):i.push(o(r,e)),e--;break;case d.indenters.includes(a.toLowerCase()):i.push(o(r,e)),e++;break;case d.dedenters.includes(a.toLowerCase()):e=e===0?0:e-1,i.push(o(r,e));break;default:i.push(o(r,e));break}}),i.join(c)}function o(t,e){return t.length?`${m(e)}${t.trim()}`:""}function u(t){if(n.endOfLines)return n.endOfLines==="crlf"?`\r
|
|
5
|
-
`:`
|
|
6
|
-
`;let e=detectNewline(t);return e!==void 0?e:platform()==="win32"?`\r
|
|
7
|
-
`:`
|
|
8
|
-
`}function m(t){return (n.useTabs?" ".repeat(n.indentSize||f):" ".repeat(n.indentSize||f)).repeat(t)}return p}
|
|
9
|
-
|
|
10
|
-
export { C as createFormatter };
|
package/types/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare namespace NsisDent {
|
|
2
|
-
function createFormatter(options?: Options): (fileContents: string) => string;
|
|
3
|
-
|
|
4
|
-
type Options = {
|
|
5
|
-
endOfLines?: 'crlf' | 'lf';
|
|
6
|
-
indentSize?: number;
|
|
7
|
-
trimEmptyLines?: boolean;
|
|
8
|
-
useTabs?: boolean;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export = NsisDent;
|
|
13
|
-
export as namespace NsisDent;
|