@hart365/pp-md-pptb-edition 1.1.5 → 1.1.6

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/README.md CHANGED
@@ -63,7 +63,7 @@ This README is aligned to metadata in package.json used by Power Platform ToolBo
63
63
  | --- | --- |
64
64
  | name | @hart365/pp-md-pptb-edition |
65
65
  | displayName | PP-MD Power Platform Markdown Document Generator |
66
- | version | 1.1.4 |
66
+ | version | 1.1.6 |
67
67
  | description | Generate structured Markdown documentation from Solution ZIP files or a direct Dataverse connection |
68
68
  | icon | icons/pp-md.svg |
69
69
  | configurations.repository | https://github.com/Hart365/pp-md-pptb-edition |
@@ -4232,4 +4232,4 @@ CMapName currentdict /CMap defineresource pop
4232
4232
  end
4233
4233
  end`};t.events.push([`putFont`,function(t){(function(t){var n=t.font,i=t.out,a=t.newObject,o=t.putStream;if(n.metadata instanceof e.API.TTFFont&&n.encoding===`Identity-H`){for(var s=n.metadata.Unicode.widths,l=n.metadata.subset.encode(n.metadata.glyIdsUsed,1),u=``,d=0;d<l.length;d++)u+=String.fromCharCode(l[d]);var f=a();o({data:u,addLength1:!0,objectId:f}),i(`endobj`);var p=a();o({data:r(n.metadata.toUnicode),addLength1:!0,objectId:p}),i(`endobj`);var m=a();i(`<<`),i(`/Type /FontDescriptor`),i(`/FontName /`+i9(n.fontName)),i(`/FontFile2 `+f+` 0 R`),i(`/FontBBox `+e.API.PDFObject.convert(n.metadata.bbox)),i(`/Flags `+n.metadata.flags),i(`/StemV `+n.metadata.stemV),i(`/ItalicAngle `+n.metadata.italicAngle),i(`/Ascent `+n.metadata.ascender),i(`/Descent `+n.metadata.decender),i(`/CapHeight `+n.metadata.capHeight),i(`>>`),i(`endobj`);var h=a();i(`<<`),i(`/Type /Font`),i(`/BaseFont /`+i9(n.fontName)),i(`/FontDescriptor `+m+` 0 R`),i(`/W `+e.API.PDFObject.convert(s)),i(`/CIDToGIDMap /Identity`),i(`/DW 1000`),i(`/Subtype /CIDFontType2`),i(`/CIDSystemInfo`),i(`<<`),i(`/Supplement 0`),i(`/Registry (Adobe)`),i(`/Ordering (`+n.encoding+`)`),i(`>>`),i(`>>`),i(`endobj`),n.objectNumber=a(),i(`<<`),i(`/Type /Font`),i(`/Subtype /Type0`),i(`/ToUnicode `+p+` 0 R`),i(`/BaseFont /`+i9(n.fontName)),i(`/Encoding /`+n.encoding),i(`/DescendantFonts [`+h+` 0 R]`),i(`>>`),i(`endobj`),n.isAlreadyPutted=!0}})(t)}]),t.events.push([`putFont`,function(t){(function(t){var n=t.font,i=t.out,a=t.newObject,o=t.putStream;if(n.metadata instanceof e.API.TTFFont&&n.encoding===`WinAnsiEncoding`){for(var s=n.metadata.rawData,l=``,u=0;u<s.length;u++)l+=String.fromCharCode(s[u]);var d=a();o({data:l,addLength1:!0,objectId:d}),i(`endobj`);var f=a();o({data:r(n.metadata.toUnicode),addLength1:!0,objectId:f}),i(`endobj`);var p=a();i(`<<`),i(`/Descent `+n.metadata.decender),i(`/CapHeight `+n.metadata.capHeight),i(`/StemV `+n.metadata.stemV),i(`/Type /FontDescriptor`),i(`/FontFile2 `+d+` 0 R`),i(`/Flags 96`),i(`/FontBBox `+e.API.PDFObject.convert(n.metadata.bbox)),i(`/FontName /`+i9(n.fontName)),i(`/ItalicAngle `+n.metadata.italicAngle),i(`/Ascent `+n.metadata.ascender),i(`>>`),i(`endobj`),n.objectNumber=a();for(var m=0;m<n.metadata.hmtx.widths.length;m++)n.metadata.hmtx.widths[m]=parseInt(n.metadata.hmtx.widths[m]*(1e3/n.metadata.head.unitsPerEm));i(`<</Subtype/TrueType/Type/Font/ToUnicode `+f+` 0 R/BaseFont/`+i9(n.fontName)+`/FontDescriptor `+p+` 0 R/Encoding/`+n.encoding+` /FirstChar 29 /LastChar 255 /Widths `+e.API.PDFObject.convert(n.metadata.hmtx.widths)+`>>`),i(`endobj`),n.isAlreadyPutted=!0}})(t)}]);var i=function(e){var t,r=e.text||``,i=e.x,a=e.y,o=e.options||{},s=e.mutex||{},l=s.pdfEscape,u=s.activeFontKey,d=s.fonts,f=u,p=``,m=0,h=``,g=d[f].encoding;if(d[f].encoding!==`Identity-H`)return{text:r,x:i,y:a,options:o,mutex:s};for(h=r,f=u,Array.isArray(r)&&(h=r[0]),m=0;m<h.length;m+=1)d[f].metadata.hasOwnProperty(`cmap`)&&(t=d[f].metadata.cmap.unicode.codeMap[h[m].charCodeAt(0)]),t||h[m].charCodeAt(0)<256&&d[f].metadata.hasOwnProperty(`Unicode`)?p+=h[m]:p+=``;var _=``;return parseInt(f.slice(1))<14||g===`WinAnsiEncoding`?_=l(p,f).split(``).map(function(e){return e.charCodeAt(0).toString(16)}).join(``):g===`Identity-H`&&(_=n(p,d[f])),s.isHex=!0,{text:_,x:i,y:a,options:o,mutex:s}};t.events.push([`postProcessText`,function(e){var t=e.text||``,n=[],r={text:t,x:e.x,y:e.y,options:e.options,mutex:e.mutex};if(Array.isArray(t)){var a=0;for(a=0;a<t.length;a+=1)Array.isArray(t[a])&&t[a].length===3?n.push([i(Object.assign({},r,{text:t[a][0]})).text,t[a][1],t[a][2]]):n.push(i(Object.assign({},r,{text:t[a]})).text);e.text=n}else e.text=i(Object.assign({},r,{text:t})).text}])}(c9),function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(e){return t.call(this),this.internal.vFS[e]!==void 0},e.addFileToVFS=function(e,n){return t.call(this),this.internal.vFS[e]=n,this},e.getFileFromVFS=function(e){return t.call(this),this.internal.vFS[e]===void 0?null:this.internal.vFS[e]}}(c9.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(e){var n,r,i,a,o,s,l,u=t,d=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],f=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],p={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},m={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},h=`(.).(.<.>.<.[.].[.{.}.{.«.».«.‹.›.‹.⁅.⁆.⁅.⁽.⁾.⁽.₍.₎.₍.≤.≥.≤.〈.〉.〈.﹙.﹚.﹙.﹛.﹜.﹛.﹝.﹞.﹝.﹤.﹥.﹤`.split(`.`),g=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),_=!1,v=0;this.__bidiEngine__={};var y=function(e){var t=e.charCodeAt(),n=t>>8,r=m[n];return r===void 0?n===252||n===253?`AL`:g.test(n)?`L`:n===8?`R`:`N`:u[256*r+(255&t)]},b=function(e){for(var t,n=0;n<e.length;n++){if((t=y(e.charAt(n)))===`L`)return!1;if(t===`R`)return!0}return!1},x=function(e,t,o,s){var l,u,d,f,p=t[s];switch(p){case`L`:case`R`:case`LRE`:case`RLE`:case`LRO`:case`RLO`:case`PDF`:_=!1;break;case`N`:case`AN`:break;case`EN`:_&&(p=`AN`);break;case`AL`:_=!0,p=`R`;break;case`WS`:case`BN`:p=`N`;break;case`CS`:s<1||s+1>=t.length||(l=o[s-1])!==`EN`&&l!==`AN`||(u=t[s+1])!==`EN`&&u!==`AN`?p=`N`:_&&(u=`AN`),p=u===l?u:`N`;break;case`ES`:p=(l=s>0?o[s-1]:`B`)===`EN`&&s+1<t.length&&t[s+1]===`EN`?`EN`:`N`;break;case`ET`:if(s>0&&o[s-1]===`EN`){p=`EN`;break}if(_){p=`N`;break}for(d=s+1,f=t.length;d<f&&t[d]===`ET`;)d++;p=d<f&&t[d]===`EN`?`EN`:`N`;break;case`NSM`:if(i&&!a){for(f=t.length,d=s+1;d<f&&t[d]===`NSM`;)d++;if(d<f){var m=e[s],h=m>=1425&&m<=2303||m===64286;if(l=t[d],h&&(l===`R`||l===`AL`)){p=`R`;break}}}p=s<1||(l=t[s-1])===`B`?`N`:o[s-1];break;case`B`:_=!1,n=!0,p=v;break;case`S`:r=!0,p=`N`}return p},S=function(e,t,n){var r=e.split(``);return n&&C(r,n,{hiLevel:v}),r.reverse(),t&&t.reverse(),r.join(``)},C=function(e,t,i){var a,o,s,l,u,m=-1,h=e.length,g=0,b=[],S=v?f:d,C=[];for(_=!1,n=!1,r=!1,o=0;o<h;o++)C[o]=y(e[o]);for(s=0;s<h;s++){if(u=g,b[s]=x(e,C,b,s),a=240&(g=S[u][p[b[s]]]),g&=15,t[s]=l=S[g][5],a>0){if(a===16){for(o=m;o<s;o++)t[o]=1;m=-1}else m=-1}if(S[g][6])m===-1&&(m=s);else if(m>-1){for(o=m;o<s;o++)t[o]=l;m=-1}C[s]===`B`&&(t[s]=0),i.hiLevel|=l}r&&function(e,t,n){for(var r=0;r<n;r++)if(e[r]===`S`){t[r]=v;for(var i=r-1;i>=0&&e[i]===`WS`;i--)t[i]=v}}(C,t,h)},w=function(e,t,r,i,a){if(!(a.hiLevel<e)){if(e===1&&v===1&&!n)return t.reverse(),void(r&&r.reverse());for(var o,s,l,u,d=t.length,f=0;f<d;){if(i[f]>=e){for(l=f+1;l<d&&i[l]>=e;)l++;for(u=f,s=l-1;u<s;u++,s--)o=t[u],t[u]=t[s],t[s]=o,r&&(o=r[u],r[u]=r[s],r[s]=o);f=l}f++}}},T=function(e,t,n){var r=e.split(``),i={hiLevel:v};return n||=[],C(r,n,i),function(e,t,n){if(n.hiLevel!==0&&l)for(var r,i=0;i<e.length;i++)t[i]===1&&(r=h.indexOf(e[i]))>=0&&(e[i]=h[r+1])}(r,n,i),w(2,r,t,n,i),w(1,r,t,n,i),r.join(``)};return this.__bidiEngine__.doBidiReorder=function(e,t,n){if(function(e,t){if(t)for(var n=0;n<e.length;n++)t[n]=n;a===void 0&&(a=b(e)),s===void 0&&(s=b(e))}(e,t),i||!o||s){if(i&&o&&a^s)v=+!!a,e=S(e,t,n);else if(!i&&o&&s)v=+!!a,e=T(e,t,n),e=S(e,t);else if(!i||a||o||s){if(i&&!o&&a^s)e=S(e,t),a?(v=0,e=T(e,t,n)):(v=1,e=T(e,t,n),e=S(e,t));else if(i&&a&&!o&&s)v=1,e=T(e,t,n),e=S(e,t);else if(!i&&!o&&a^s){var r=l;a?(v=1,e=T(e,t,n),v=0,l=!1,e=T(e,t,n),l=r):(v=0,e=T(e,t,n),e=S(e,t),v=1,l=!1,e=T(e,t,n),l=r,e=S(e,t))}}else v=0,e=T(e,t,n)}else v=+!!a,e=T(e,t,n);return e},this.__bidiEngine__.setOptions=function(e){e&&(i=e.isInputVisual,o=e.isOutputVisual,a=e.isInputRtl,s=e.isOutputRtl,l=e.isSymmetricSwapping)},this.__bidiEngine__.setOptions(e),this.__bidiEngine__};var t=`BN.BN.BN.BN.BN.BN.BN.BN.BN.S.B.S.WS.B.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.B.B.B.S.WS.N.N.ET.ET.ET.N.N.N.N.N.ES.CS.ES.CS.CS.EN.EN.EN.EN.EN.EN.EN.EN.EN.EN.CS.N.N.N.N.N.N.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.N.N.N.N.N.N.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.N.N.N.N.BN.BN.BN.BN.BN.BN.B.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.CS.N.ET.ET.ET.ET.N.N.N.N.L.N.N.BN.N.N.ET.ET.EN.EN.N.L.N.N.N.EN.L.N.N.N.N.N.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.N.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.N.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.N.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.N.N.L.L.L.L.L.L.L.N.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.N.L.N.N.N.N.N.ET.N.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.R.NSM.R.NSM.NSM.R.NSM.NSM.R.NSM.N.N.N.N.N.N.N.N.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.N.N.N.N.N.R.R.R.R.R.N.N.N.N.N.N.N.N.N.N.N.AN.AN.AN.AN.AN.AN.N.N.AL.ET.ET.AL.CS.AL.N.N.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.AL.AL.N.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.AN.AN.AN.AN.AN.AN.AN.AN.AN.AN.ET.AN.AN.AL.AL.AL.NSM.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.NSM.NSM.NSM.NSM.NSM.NSM.NSM.AN.N.NSM.NSM.NSM.NSM.NSM.NSM.AL.AL.NSM.NSM.N.NSM.NSM.NSM.NSM.AL.AL.EN.EN.EN.EN.EN.EN.EN.EN.EN.EN.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.N.AL.AL.NSM.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.N.N.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.AL.N.N.N.N.N.N.N.N.N.N.N.N.N.N.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.R.R.N.N.N.N.R.N.N.N.N.N.WS.WS.WS.WS.WS.WS.WS.WS.WS.WS.WS.BN.BN.BN.L.R.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.WS.B.LRE.RLE.PDF.LRO.RLO.CS.ET.ET.ET.ET.ET.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.CS.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.WS.BN.BN.BN.BN.BN.N.LRI.RLI.FSI.PDI.BN.BN.BN.BN.BN.BN.EN.L.N.N.EN.EN.EN.EN.EN.EN.ES.ES.N.N.N.L.EN.EN.EN.EN.EN.EN.EN.EN.EN.EN.ES.ES.N.N.N.N.L.L.L.L.L.L.L.L.L.L.L.L.L.N.N.N.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.ET.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.L.L.L.L.L.L.L.N.N.N.N.N.N.N.N.N.N.N.N.L.L.L.L.L.N.N.N.N.N.R.NSM.R.R.R.R.R.R.R.R.R.R.ES.R.R.R.R.R.R.R.R.R.R.R.R.R.N.R.R.R.R.R.N.R.N.R.R.N.R.R.N.R.R.R.R.R.R.R.R.R.R.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.NSM.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.CS.N.CS.N.N.CS.N.N.N.N.N.N.N.N.N.ET.N.N.ES.ES.N.N.N.N.N.ET.ET.N.N.N.N.N.AL.AL.AL.AL.AL.N.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.AL.N.N.BN.N.N.N.ET.ET.ET.N.N.N.N.N.ES.CS.ES.CS.CS.EN.EN.EN.EN.EN.EN.EN.EN.EN.EN.CS.N.N.N.N.N.N.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.N.N.N.N.N.N.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.N.N.N.N.N.N.N.N.N.N.N.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.N.N.N.L.L.L.L.L.L.N.N.L.L.L.L.L.L.N.N.L.L.L.L.L.L.N.N.L.L.L.N.N.N.ET.ET.N.N.N.ET.ET.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N`.split(`.`),n=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push([`postProcessText`,function(e){var t=e.text;e.x,e.y;var r=e.options||{};e.mutex,r.lang;var i=[];if(r.isInputVisual=typeof r.isInputVisual!=`boolean`||r.isInputVisual,n.setOptions(r),Object.prototype.toString.call(t)===`[object Array]`){var a=0;for(i=[],a=0;a<t.length;a+=1)Object.prototype.toString.call(t[a])===`[object Array]`?i.push([n.doBidiReorder(t[a][0]),t[a][1],t[a][2]]):i.push([n.doBidiReorder(t[a])]);e.text=i}else e.text=n.doBidiReorder(t);n.setOptions({isInputVisual:!0})}])}(c9),c9.API.TTFFont=function(){function e(e){var t;if(this.rawData=e,t=this.contents=new z9(e),this.contents.pos=4,t.readString(4)===`ttcf`)throw Error(`TTCF not supported.`);t.pos=0,this.parse(),this.subset=new p4t(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new X2t(this.contents),this.head=new Q2t(this),this.name=new a4t(this),this.cmap=new e4t(this),this.toUnicode={},this.hhea=new t4t(this),this.maxp=new o4t(this),this.hmtx=new s4t(this),this.post=new r4t(this),this.os2=new n4t(this),this.loca=new f4t(this),this.glyf=new l4t(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var e,t,n,r,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,n,r,i=[];for(t=0,n=(r=this.bbox).length;t<n;t++)e=r[t],i.push(Math.round(e*this.scaleFactor));return i}.call(this),this.stemV=0,this.post.exists?(n=255&(r=this.post.italic_angle),32768&(t=r>>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+`.`+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(i=this.familyClass)===1||i===2||i===3||i===4||i===5||i===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw Error(`No unicode cmap for font`)},e.prototype.characterToGlyph=function(e){return this.cmap.unicode?.codeMap[e]||0},e.prototype.widthOfGlyph=function(e){var t=1e3/this.head.unitsPerEm;return this.hmtx.forGlyph(e).advance*t},e.prototype.widthOfString=function(e,t,n){var r,i,a=0,o;for(i=0,o=(e=``+e).length;0<=o?i<o:i>o;i=0<=o?++i:--i)r=e.charCodeAt(i),a+=this.widthOfGlyph(this.characterToGlyph(r))+1e3/t*n||0;return t/1e3*a},e.prototype.lineHeight=function(e,t){var n;return t??=!1,n=t?this.lineGap:0,(this.ascender+n-this.decender)/1e3*e},e}();var R9,z9=function(){function e(e){this.data=e??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(e){return this.data[this.pos++]=e},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},e.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},e.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},e.prototype.readString=function(e){var t,n=[];for(t=0;0<=e?t<e:t>e;t=0<=e?++t:--t)n[t]=String.fromCharCode(this.readByte());return n.join(``)},e.prototype.writeString=function(e){var t,n,r=[];for(t=0,n=e.length;0<=n?t<n:t>n;t=0<=n?++t:--t)r.push(this.writeByte(e.charCodeAt(t)));return r},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(e){return this.writeInt16(e)},e.prototype.readLongLong=function(){var e=this.readByte(),t=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),a=this.readByte(),o=this.readByte(),s=this.readByte();return 128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^n)+4294967296*(255^r)+16777216*(255^i)+65536*(255^a)+256*(255^o)+(255^s)+1):72057594037927940*e+281474976710656*t+1099511627776*n+4294967296*r+16777216*i+65536*a+256*o+s},e.prototype.writeLongLong=function(e){var t=Math.floor(e/4294967296),n=4294967295&e;return this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(e){return this.writeInt32(e)},e.prototype.read=function(e){for(var t=[],n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)t.push(this.readByte());return t},e.prototype.write=function(e){var t,n,r,i=[];for(n=0,r=e.length;n<r;n++)t=e[n],i.push(this.writeByte(t));return i},e}(),X2t=function(){var e;function t(e){var t,n,r;for(this.scalarType=e.readInt(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),this.tables={},n=0,r=this.tableCount;0<=r?n<r:n>r;n=0<=r?++n:--n)t={tag:e.readString(4),checksum:e.readInt(),offset:e.readInt(),length:e.readInt()},this.tables[t.tag]=t}return t.prototype.encode=function(t){var n,r,i,a,o,s,l,u,d,f,p=Object.keys(t).length,m,h;for(h in s=Math.log(2),d=16*Math.floor(Math.log(p)/s),a=Math.floor(d/s),u=16*p-d,(r=new z9).writeInt(this.scalarType),r.writeShort(p),r.writeShort(d),r.writeShort(a),r.writeShort(u),i=16*p,l=r.pos+i,o=null,m=[],t)for(f=t[h],r.writeString(h),r.writeInt(e(f)),r.writeInt(l),r.writeInt(f.length),m=m.concat(f),h===`head`&&(o=l),l+=f.length;l%4;)m.push(0),l++;return r.write(m),n=2981146554-e(r.data),r.pos=o+8,r.writeUInt32(n),r.data},e=function(e){var t,n,r,i;for(e=c4t.call(e);e.length%4;)e.push(0);for(r=new z9(e),n=0,t=0,i=e.length;t<i;t=t+=4)n+=r.readUInt32();return 4294967295&n},t}(),Z2t={}.hasOwnProperty,B9=function(e,t){for(var n in t)Z2t.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};R9=function(){function e(e){var t;this.file=e,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var Q2t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return B9(e,R9),e.prototype.tag=`head`,e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},e.prototype.encode=function(e){var t;return(t=new z9).writeInt(this.version),t.writeInt(this.revision),t.writeInt(this.checkSumAdjustment),t.writeInt(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.writeLongLong(this.created),t.writeLongLong(this.modified),t.writeShort(this.xMin),t.writeShort(this.yMin),t.writeShort(this.xMax),t.writeShort(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort(this.fontDirectionHint),t.writeShort(e),t.writeShort(this.glyphDataFormat),t.data},e}(),$2t=function(){function e(e,t){var n,r,i,a,o,s,l,u,d,f,p,m,h,g,_,v,y;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=t+e.readInt(),d=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(s=0;s<256;++s)this.codeMap[s]=e.readByte();break;case 4:for(p=e.readUInt16(),f=p/2,e.pos+=6,i=function(){var t,n=[];for(s=t=0;0<=f?t<f:t>f;s=0<=f?++t:--t)n.push(e.readUInt16());return n}(),e.pos+=2,h=function(){var t,n=[];for(s=t=0;0<=f?t<f:t>f;s=0<=f?++t:--t)n.push(e.readUInt16());return n}(),l=function(){var t,n=[];for(s=t=0;0<=f?t<f:t>f;s=0<=f?++t:--t)n.push(e.readUInt16());return n}(),u=function(){var t,n=[];for(s=t=0;0<=f?t<f:t>f;s=0<=f?++t:--t)n.push(e.readUInt16());return n}(),r=(this.length-e.pos+this.offset)/2,o=function(){var t,n=[];for(s=t=0;0<=r?t<r:t>r;s=0<=r?++t:--t)n.push(e.readUInt16());return n}(),s=_=0,y=i.length;_<y;s=++_)for(g=i[s],n=v=m=h[s];m<=g?v<=g:v>=g;n=m<=g?++v:--v)u[s]===0?a=n+l[s]:(a=o[u[s]/2+(n-m)-(f-s)]||0)!==0&&(a+=l[s]),this.codeMap[n]=65535&a}e.pos=d}return e.encode=function(e,t){var n,r,i,a,o,s,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A=new z9,j,M,N,P,F,I,L,R,ee,z,B,V,te,ne,re,ie,ae,oe;switch(a=Object.keys(e).sort(function(e,t){return e-t}),t){case`macroman`:for(h=0,g=function(){var e=[];for(m=0;m<256;++m)e.push(0);return e}(),v={0:0},i={},j=0,F=a.length;j<F;j++)v[re=e[r=a[j]]]??(v[re]=++h),i[r]={old:e[r],new:v[e[r]]},g[r]=v[e[r]];return A.writeUInt16(1),A.writeUInt16(0),A.writeUInt32(12),A.writeUInt16(0),A.writeUInt16(262),A.writeUInt16(0),A.write(g),{charMap:i,subtable:A.data,maxGlyphID:h+1};case`unicode`:for(O=[],d=[],y=0,v={},n={},_=l=null,M=0,I=a.length;M<I;M++)v[x=e[r=a[M]]]??(v[x]=++y),n[r]={old:x,new:v[x]},o=v[x]-r,_!=null&&o===l||(_&&d.push(_),O.push(r),l=o),_=r;for(_&&d.push(_),d.push(65535),O.push(65535),E=2*(T=O.length),w=2*(Math.log(T)/Math.LN2)**2,f=Math.log(w/2)/Math.LN2,C=2*T-w,s=[],S=[],p=[],m=N=0,L=O.length;N<L;m=++N){if(D=O[m],u=d[m],D===65535){s.push(0),S.push(0);break}if(D-(k=n[D].new)>=32768)for(s.push(0),S.push(2*(p.length+T-m)),r=P=D;D<=u?P<=u:P>=u;r=D<=u?++P:--P)p.push(n[r].new);else s.push(k-D),S.push(0)}for(A.writeUInt16(3),A.writeUInt16(1),A.writeUInt32(12),A.writeUInt16(4),A.writeUInt16(16+8*T+2*p.length),A.writeUInt16(0),A.writeUInt16(E),A.writeUInt16(w),A.writeUInt16(f),A.writeUInt16(C),te=0,R=d.length;te<R;te++)r=d[te],A.writeUInt16(r);for(A.writeUInt16(0),ne=0,ee=O.length;ne<ee;ne++)r=O[ne],A.writeUInt16(r);for(ie=0,z=s.length;ie<z;ie++)o=s[ie],A.writeUInt16(o);for(ae=0,B=S.length;ae<B;ae++)b=S[ae],A.writeUInt16(b);for(oe=0,V=p.length;oe<V;oe++)h=p[oe],A.writeUInt16(h);return{charMap:n,subtable:A.data,maxGlyphID:y+1}}},e}(),e4t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return B9(e,R9),e.prototype.tag=`cmap`,e.prototype.parse=function(e){var t,n,r;for(e.pos=this.offset,this.version=e.readUInt16(),r=e.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=r?n<r:n>r;n=0<=r?++n:--n)t=new $2t(e,this.offset),this.tables.push(t),t.isUnicode&&this.unicode==null&&(this.unicode=t);return!0},e.encode=function(e,t){var n,r;return t??=`macroman`,n=$2t.encode(e,t),(r=new z9).writeUInt16(0),r.writeUInt16(1),n.table=r.data.concat(n.subtable),n},e}(),t4t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return B9(e,R9),e.prototype.tag=`hhea`,e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},e}(),n4t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return B9(e,R9),e.prototype.tag=`OS/2`,e.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var t,n=[];for(t=0;t<10;++t)n.push(e.readByte());return n}(),this.charRange=function(){var t,n=[];for(t=0;t<4;++t)n.push(e.readInt());return n}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var t,n=[];for(t=0;t<2;t=++t)n.push(e.readInt());return n}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},e}(),r4t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return B9(e,R9),e.prototype.tag=`post`,e.prototype.parse=function(e){var t,n,r;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var i;for(n=e.readUInt16(),this.glyphNameIndex=[],i=0;0<=n?i<n:i>n;i=0<=n?++i:--i)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],r=[];e.pos<this.offset+this.length;)t=e.readByte(),r.push(this.names.push(e.readString(t)));return r;case 151552:return n=e.readUInt16(),this.offsets=e.read(n);case 262144:return this.map=function(){var t,n,r=[];for(i=t=0,n=this.file.maxp.numGlyphs;0<=n?t<n:t>n;i=0<=n?++t:--t)r.push(e.readUInt32());return r}.call(this)}},e}(),i4t=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},a4t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return B9(e,R9),e.prototype.tag=`name`,e.prototype.parse=function(e){var t,n,r,i,a,o,s,l,u,d,f;for(e.pos=this.offset,e.readShort(),t=e.readShort(),o=e.readShort(),n=[],i=0;0<=t?i<t:i>t;i=0<=t?++i:--i)n.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+o+e.readShort()});for(s={},i=u=0,d=n.length;u<d;i=++u)r=n[i],e.pos=r.offset,l=e.readString(r.length),a=new i4t(l,r),s[f=r.nameID]??(s[f]=[]),s[r.nameID].push(a);this.strings=s,this.copyright=s[0],this.fontFamily=s[1],this.fontSubfamily=s[2],this.uniqueSubfamily=s[3],this.fontName=s[4],this.version=s[5];try{this.postscriptName=s[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,``)}catch{this.postscriptName=s[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,``)}return this.trademark=s[7],this.manufacturer=s[8],this.designer=s[9],this.description=s[10],this.vendorUrl=s[11],this.designerUrl=s[12],this.license=s[13],this.licenseUrl=s[14],this.preferredFamily=s[15],this.preferredSubfamily=s[17],this.compatibleFull=s[18],this.sampleText=s[19]},e}(),o4t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return B9(e,R9),e.prototype.tag=`maxp`,e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},e}(),s4t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return B9(e,R9),e.prototype.tag=`hmtx`,e.prototype.parse=function(e){var t,n,r,i,a,o,s;for(e.pos=this.offset,this.metrics=[],t=0,o=this.file.hhea.numberOfMetrics;0<=o?t<o:t>o;t=0<=o?++t:--t)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var n,i=[];for(t=n=0;0<=r?n<r:n>r;t=0<=r?++n:--n)i.push(e.readInt16());return i}(),this.widths=function(){var e,t,n,r=[];for(e=0,t=(n=this.metrics).length;e<t;e++)i=n[e],r.push(i.advance);return r}.call(this),n=this.widths[this.widths.length-1],s=[],t=a=0;0<=r?a<r:a>r;t=0<=r?++a:--a)s.push(this.widths.push(n));return s},e.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},e}(),c4t=[].slice,l4t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return B9(e,R9),e.prototype.tag=`glyf`,e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(e){var t,n,r,i,a,o,s,l,u,d;return e in this.cache?this.cache[e]:(i=this.file.loca,t=this.file.contents,n=i.indexOf(e),(r=i.lengthOf(e))===0?this.cache[e]=null:(t.pos=this.offset+n,a=(o=new z9(t.read(r))).readShort(),l=o.readShort(),d=o.readShort(),s=o.readShort(),u=o.readShort(),this.cache[e]=a===-1?new d4t(o,l,d,s,u):new u4t(o,a,l,d,s,u),this.cache[e]))},e.prototype.encode=function(e,t,n){var r,i,a=[],o,s;for(i=[],o=0,s=t.length;o<s;o++)r=e[t[o]],i.push(a.length),r&&(a=a.concat(r.encode(n)));return i.push(a.length),{table:a,offsets:i}},e}(),u4t=function(){function e(e,t,n,r,i,a){this.raw=e,this.numberOfContours=t,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=a,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),d4t=function(){function e(e,t,n,r,i){var a,o;for(this.raw=e,this.xMin=t,this.yMin=n,this.xMax=r,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],a=this.raw;o=a.readShort(),this.glyphOffsets.push(a.pos),this.glyphIDs.push(a.readUInt16()),32&o;)a.pos+=1&o?4:2,128&o?a.pos+=8:64&o?a.pos+=4:8&o&&(a.pos+=2)}return e.prototype.encode=function(){var e,t=new z9(c4t.call(this.raw.data)),n;for(e=0,n=this.glyphIDs.length;e<n;++e)t.pos=this.glyphOffsets[e];return t.data},e}(),f4t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return B9(e,R9),e.prototype.tag=`loca`,e.prototype.parse=function(e){var t,n;return e.pos=this.offset,t=this.file.head.indexToLocFormat,this.offsets=t===0?function(){var t,r=[];for(n=0,t=this.length;n<t;n+=2)r.push(2*e.readUInt16());return r}.call(this):function(){var t,r=[];for(n=0,t=this.length;n<t;n+=4)r.push(e.readUInt32());return r}.call(this)},e.prototype.indexOf=function(e){return this.offsets[e]},e.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},e.prototype.encode=function(e,t){for(var n=new Uint32Array(this.offsets.length),r=0,i=0,a=0;a<n.length;++a)if(n[a]=r,i<t.length&&t[i]==a){++i,n[a]=r;var o=this.offsets[a],s=this.offsets[a+1]-o;s>0&&(r+=s)}for(var l=Array(4*n.length),u=0;u<n.length;++u)l[4*u+3]=255&n[u],l[4*u+2]=(65280&n[u])>>8,l[4*u+1]=(16711680&n[u])>>16,l[4*u]=(4278190080&n[u])>>24;return l},e}(),p4t=function(){function e(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var e,t,n,r=this.font.cmap.tables[0].codeMap,i;for(t in e={},i=this.subset)n=i[t],e[t]=r[n];return e},e.prototype.glyphsFor=function(e){for(var t,n,r={},i,a=0,o=e.length,s;a<o;a++)r[i=e[a]]=this.font.glyf.glyphFor(i);for(i in t=[],r)(n=r[i])!=null&&n.compound&&t.push.apply(t,n.glyphIDs);if(t.length>0)for(i in s=this.glyphsFor(t))n=s[i],r[i]=n;return r},e.prototype.encode=function(e,t){var n=e4t.encode(this.generateCmap(),`unicode`),r,i,a=this.glyphsFor(e),o,s,l,u,d,f,p={0:0},m,h,g,_;for(r in _=n.charMap)p[(s=_[r]).old]=s.new;for(m in f=n.maxGlyphID,a)m in p||(p[m]=f++);return u=function(e){var t,n={};for(t in e)n[e[t]]=t;return n}(p),d=Object.keys(u).sort(function(e,t){return e-t}),h=function(){var e,t,n=[];for(e=0,t=d.length;e<t;e++)o=d[e],n.push(u[o]);return n}(),i=this.font.glyf.encode(a,h,p),l=this.font.loca.encode(i.offsets,h),g={cmap:this.font.cmap.raw(),glyf:i.table,loca:l,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(t)},this.font.os2.exists&&(g[`OS/2`]=this.font.os2.raw()),this.font.directory.encode(g)},e}();c9.API.PDFObject=function(){var e;function t(){}return e=function(e,t){return(Array(t+1).join(`0`)+e).slice(-t)},t.convert=function(n){var r,i,a,o;if(Array.isArray(n))return`[`+function(){var e,i,a=[];for(e=0,i=n.length;e<i;e++)r=n[e],a.push(t.convert(r));return a}().join(` `)+`]`;if(typeof n==`string`)return`/`+n;if(n?.isString)return`(`+n+`)`;if(n instanceof Date)return`(D:`+e(n.getUTCFullYear(),4)+e(n.getUTCMonth(),2)+e(n.getUTCDate(),2)+e(n.getUTCHours(),2)+e(n.getUTCMinutes(),2)+e(n.getUTCSeconds(),2)+`Z)`;if({}.toString.call(n)===`[object Object]`){for(i in a=[`<<`],n)o=n[i],a.push(`/`+i+` `+t.convert(o));return a.push(`>>`),a.join(`
4234
4234
  `)}return``+n},t}();var m4t=[[`✅`,`[Yes]`],[`⛔`,`[No]`],[`⚠️`,`[Warning]`],[`⚠`,`[Warning]`],[`🔑`,`[Key]`],[`🔒`,`[Locked]`],[`🔍`,`[Audited]`],[`🔎`,`[Advanced Find]`],[`✳️`,`[Custom]`],[`🔀`,`[Sync]`],[`☁️`,`[Cloud]`],[`→`,`->`],[`–`,`-`],[`—`,`-`],[`•`,`-`]];function V9(e){let t=e;for(let[e,n]of m4t)t=t.split(e).join(n);return t.replace(/[^\t\n\r\x20-\x7E\u00A0-\u00FF]/gu,``)}function h4t(e){let t=``,n=-1,r=``;for(let i=0;i<e.length;i+=1){let a=e[i];if(n<0){a===`<`?n=i:t+=a;continue}r?a===r&&(r=``):a===`"`||a===`'`?r=a:a===`>`&&(n=-1)}return n<0?t:t+e.slice(n)}function g4t(e){return!!e&&/^(https?:|mailto:)/i.test(e)}function H9(e,t={}){if(!e)return[];let n=[];for(let r of e)switch(r.type){case`text`:n.push({text:V9(r.value),style:t});break;case`strong`:n.push(...H9(r.children,{...t,bold:!0}));break;case`emphasis`:n.push(...H9(r.children,{...t,italic:!0}));break;case`delete`:n.push(...H9(r.children,t));break;case`inlineCode`:n.push({text:V9(r.value),style:{...t,code:!0}});break;case`link`:n.push(...H9(r.children,{...t,link:r.url}));break;case`image`:n.push({text:V9(`[Image: ${r.alt||`image`}]`),style:{...t,italic:!0}});break;case`break`:n.push({text:``,style:t,break:!0});break;case`html`:n.push({text:V9(h4t(r.value??``)),style:t});break;default:{let e=r;Array.isArray(e.children)?n.push(...H9(e.children,t)):typeof e.value==`string`&&n.push({text:V9(e.value),style:t});break}}return n}function U9(e){let t=[];for(let n of e){if(n.break){t.push({text:``,style:n.style,isSpace:!1,hardBreak:!0});continue}if(!n.text)continue;let e=n.text.split(/(\s+)/).filter(e=>e.length>0);for(let r of e)t.push({text:r,style:n.style,isSpace:/^\s+$/.test(r)})}return t}function W9(e,t){if(t.code){e.setFont(`courier`,t.bold?`bold`:`normal`);return}let n=t.bold&&t.italic?`bolditalic`:t.bold?`bold`:t.italic?`italic`:`normal`;e.setFont(`helvetica`,n)}function G9(e,t,n,r){let i=[],a=[],o=0,s=()=>{for(;a.length&&a[0].isSpace;)a.shift();for(;a.length&&a[a.length-1].isSpace;)a.pop();i.push(a),a=[],o=0};for(let i of t){if(i.hardBreak){s();continue}W9(e,i.style),e.setFontSize(r);let t=e.getTextWidth(i.text);i.isSpace&&a.length===0||o+t>n&&a.length>0&&(s(),i.isSpace)||(a.push(i),o+=t)}return a.length&&s(),i.length===0&&i.push([]),i}function K9(e,t){e.y+t>e.pageHeight-e.marginBottom&&(e.pdf.addPage(),e.y=e.marginTop)}function _4t(){return new Promise(e=>{typeof requestAnimationFrame==`function`?requestAnimationFrame(()=>e()):setTimeout(e,0)})}function v4t(e,t,n,r,i,a){let o=G9(e.pdf,t,r,i);for(let t of o){K9(e,a);let r=n;for(let n of t){W9(e.pdf,n.style),e.pdf.setFontSize(i);let t=e.pdf.getTextWidth(n.text);n.style.code&&(e.pdf.setFillColor(244,244,248),e.pdf.rect(r-1,e.y-i*.78,t+2,i*1.05,`F`),W9(e.pdf,n.style),e.pdf.setFontSize(i)),n.style.link?(e.pdf.setTextColor(37,99,235),g4t(n.style.link)?e.pdf.textWithLink(n.text,r,e.y,{url:n.style.link}):e.pdf.text(n.text,r,e.y),e.pdf.setDrawColor(37,99,235),e.pdf.line(r,e.y+1.5,r+t,e.y+1.5)):(e.pdf.setTextColor(26,26,46),e.pdf.text(n.text,r,e.y)),r+=t}e.y+=a}}function y4t(e,t){let n=[19,15.5,13.5,12,11,10.5],r=Math.min(Math.max(t.depth,1),6),i=n[r-1];e.y+=r===1?16:12,v4t(e,U9(H9(t.children,{bold:!0})),e.x0,e.xw,i,i*1.3),r<=2&&(e.pdf.setDrawColor(200,203,214),e.pdf.line(e.x0,e.y-2,e.x0+e.xw,e.y-2),e.y+=4),e.y+=6}function b4t(e,t,n){let r=n?.x??e.x0,i=n?.width??e.xw,a=n?.fontSize??10.25;v4t(e,U9(H9(t.children,n?.italic?{italic:!0}:{})),r,i,a,a*1.42),e.y+=a*.6}function x4t(e){K9(e,20),e.y+=8,e.pdf.setDrawColor(200,203,214),e.pdf.line(e.x0,e.y,e.x0+e.xw,e.y),e.y+=14}async function S4t(e,t,n=0){let r=t.start??1,i=0;for(let a of t.children){let o=e.x0+16+n*16,s=t.ordered?`${r}.`:`-`;r+=1,a.checked===!0?s=`[x]`:a.checked===!1&&(s=`[ ]`);let l=!0;for(let t of a.children){if(t.type===`list`){await S4t(e,t,n+1);continue}let r=e.xw-(o-e.x0);if(t.type===`paragraph`){let n=U9(H9(t.children));if(l){let t=G9(e.pdf,n,r,10.25);for(let n of t){K9(e,14.555),e.pdf.setFont(`helvetica`,`normal`),e.pdf.setFontSize(10.25),e.pdf.setTextColor(26,26,46),n===t[0]&&e.pdf.text(s,o-14,e.y);let r=o;for(let t of n)W9(e.pdf,t.style),e.pdf.setFontSize(10.25),e.pdf.setTextColor(26,26,46),e.pdf.text(t.text,r,e.y),r+=e.pdf.getTextWidth(t.text);e.y+=14.555}}else v4t(e,n,o,r,10.25,14.555);l=!1}else await O4t(e,t,{x:o,width:r})}e.y+=3,i+=1,i%25==0&&await _4t()}}async function C4t(e,t){let n=e.y,r=e.x0+14,i=e.xw-14;for(let n of t.children)await O4t(e,n,{x:r,width:i,italic:!0});e.pdf.setDrawColor(180,184,196),e.pdf.setLineWidth(2),e.pdf.line(e.x0+4,n-2,e.x0+4,Math.max(e.y-4,n-2)),e.pdf.setLineWidth(.2)}function w4t(e,t){if(t.lang===`mermaid`){T4t(e,t.value??``);return}let n=8.5,r=n*1.35,i=e.xw-12,a=V9(t.value??``);e.pdf.setFont(`courier`,`normal`),e.pdf.setFontSize(n);let o=[];for(let t of a.split(`
4235
- `)){if(t===``){o.push(``);continue}let n=t;for(;e.pdf.getTextWidth(n)>i;){let t=n.length;for(;t>1&&e.pdf.getTextWidth(n.slice(0,t))>i;)--t;let r=n.lastIndexOf(` `,t),a=r>10?r:t;o.push(n.slice(0,a)),n=n.slice(a).replace(/^ /,``)}o.push(n)}let s=0;for(;s<o.length;){K9(e,23.475);let t=Math.max(1,Math.floor((e.pageHeight-e.marginBottom-e.y-12)/r)),i=o.slice(s,s+t),a=i.length*r+12;e.pdf.setFillColor(244,244,248),e.pdf.setDrawColor(208,211,219),e.pdf.rect(e.x0,e.y,e.xw,a,`FD`),e.pdf.setFont(`courier`,`normal`),e.pdf.setFontSize(n),e.pdf.setTextColor(26,26,46);let l=e.y+6+n*.8;for(let t of i)e.pdf.text(t||` `,e.x0+6,l),l+=r;e.y+=a+2,s+=i.length}e.y+=6}function T4t(e,t){let n=t.match(/%%\s*(.+?)\s*%%/)?.[1]??`Diagram`,r=e.diagramImages[e.diagramIndex]??null;if(e.diagramIndex+=1,K9(e,20),e.pdf.setFont(`helvetica`,`italic`),e.pdf.setFontSize(9.5),e.pdf.setTextColor(90,94,108),e.pdf.text(V9(`Diagram: ${n}`),e.x0,e.y),e.y+=14,!r){w4t(e,{lang:`text`,value:`[Diagram could not be rendered for export]\n\n${t}`});return}try{let t=e.pdf.getImageProperties(r),n=e.xw,i=t.height/t.width*n,a=e.pageHeight-e.marginTop-e.marginBottom;i>a&&(i=a,n=t.width/t.height*i),K9(e,i);let o=e.x0+(e.xw-n)/2;e.pdf.addImage(r,`PNG`,o,e.y,n,i,void 0,`FAST`),e.y+=i+10}catch{w4t(e,{lang:`text`,value:t})}}function q9(e,t,n,r,i,a,o,s,l){l&&(e.pdf.setFillColor(240,242,245),e.pdf.rect(e.x0,e.y,e.xw,i,`F`));let u=e.x0;for(let l=0;l<n;l+=1){e.pdf.setDrawColor(193,196,206),e.pdf.rect(u,e.y,r,i,`S`);let n=e.y+s+a*.72;for(let r of t[l]??[]){let t=u+s;for(let i of r)W9(e.pdf,i.style),e.pdf.setFontSize(a),e.pdf.setTextColor(26,26,46),e.pdf.text(i.text,t,n),t+=e.pdf.getTextWidth(i.text);n+=o}u+=r}e.y+=i}async function E4t(e,t){let n=t.children;if(!n.length)return;let r=n[0].children.length;if(r===0)return;let i=9.5,a=i*1.3,o=e.xw/r,s=(t,n)=>t.map(t=>{let r=U9(H9(t.children,n?{bold:!0}:{}));return G9(e.pdf,r,o-10,i)}),l=s(n[0].children,!0),u=Math.max(...l.map(e=>e.length),1)*a+10;K9(e,u+a+10),q9(e,l,r,o,u,i,a,5,!0);for(let t=1;t<n.length;t+=1){let d=s(n[t].children,!1),f=Math.max(...d.map(e=>e.length),1)*a+10;e.y+f>e.pageHeight-e.marginBottom&&(e.pdf.addPage(),e.y=e.marginTop,q9(e,l,r,o,u,i,a,5,!0)),q9(e,d,r,o,f,i,a,5,!1),t%40==0&&await _4t()}e.y+=8}function D4t(e,t){let n=[...t.matchAll(/<tr>([\s\S]*?)<\/tr>/gi)].map(e=>[...e[1].matchAll(/<td>([\s\S]*?)<\/td>/gi)].map(e=>V9(h4t(e[1]).trim()))).filter(e=>e.some(e=>e.length>0));if(!n.length)return;let r=Math.max(...n.map(e=>e.length)),i=e.xw/r;for(let t of n){let n=Array.from({length:r},(n,r)=>{let a=U9([{text:t[r]??``,style:{bold:r===0}}]);return G9(e.pdf,a,i-10,10)}),a=Math.max(...n.map(e=>e.length),1)*13+10;K9(e,a),q9(e,n,r,i,a,10,13,5,!1)}e.y+=8}async function O4t(e,t,n){switch(t.type){case`heading`:y4t(e,t);break;case`paragraph`:b4t(e,t,n);break;case`list`:await S4t(e,t);break;case`table`:await E4t(e,t);break;case`code`:w4t(e,t);break;case`blockquote`:await C4t(e,t);break;case`thematicBreak`:x4t(e);break;case`html`:{let n=t.value??``;/<table/i.test(n)&&D4t(e,n);break}}}function k4t(e){return Ao().use(Vi).use(Xl).parse(e)}function A4t(e,t){let n=e.x0+e.xw/2;e.pdf.setFont(`helvetica`,`bold`),e.pdf.setFontSize(26),e.pdf.setTextColor(26,26,46);let r=e.pdf.splitTextToSize(V9(t),e.xw),i=e.pageHeight/2-r.length*32/2;for(let t of r)e.pdf.text(t,n,i,{align:`center`}),i+=32;e.pdf.setFont(`helvetica`,`normal`),e.pdf.setFontSize(11),e.pdf.setTextColor(90,94,108),e.pdf.text(`Power Platform solution documentation`,n,i+12,{align:`center`}),e.pdf.text(`Generated ${new Date().toLocaleString()}`,n,i+30,{align:`center`})}function j4t(e,t){let n=e.getNumberOfPages(),r=e.internal.pageSize.getWidth(),i=e.internal.pageSize.getHeight();for(let a=2;a<=n;a+=1)e.setPage(a),e.setFont(`helvetica`,`normal`),e.setFontSize(8.5),e.setTextColor(140,143,156),e.text(V9(t),46,i-24),e.text(`Page ${a-1} of ${n-1}`,r-46,i-24,{align:`right`})}async function M4t(e,t,n=[]){let r=k4t(e),i=new c9({orientation:`portrait`,unit:`pt`,format:`a4`,compress:!0});i.setProperties({title:t,subject:`Power Platform solution documentation`});let a=i.internal.pageSize.getWidth(),o=i.internal.pageSize.getHeight(),s={pdf:i,x0:46,xw:a-92,y:54,pageHeight:o,marginTop:54,marginBottom:50,diagramImages:n,diagramIndex:0};A4t(s,t||`PP-MD Documentation`),i.addPage(),s.y=54;let l=0;for(let e of r.children)await O4t(s,e),l+=1,l%15==0&&await _4t();return j4t(i,t||`PP-MD Documentation`),i.output(`blob`)}async function N4t(e,t){await A(e,t.endsWith(`.md`)?t:`${t}.md`,`text/markdown`)}async function P4t(e,t){await A(e,t.endsWith(`.zip`)?t:`${t}.zip`,`application/zip`)}async function F4t(e,t){await A(e,t.endsWith(`.html`)?t:`${t}.html`,`text/html`)}async function I4t(e,t){let n=t.endsWith(`.xlsx`)?t:`${t}.xlsx`;await A(ZGt(e),n,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`)}async function L4t(e,t,n,r=[]){let i=n.endsWith(`.pdf`)?n:`${n}.pdf`;await A(await M4t(e,t,r),i,`application/pdf`)}var R4t=``+new URL(`pp-md-icon-Dgg8-GAC.svg`,import.meta.url).href,z4t=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%20aria-hidden='true'%3e%3cpath%20d='M12%20.5C5.65.5.5%205.65.5%2012c0%205.1%203.3%209.42%207.88%2010.95.58.1.8-.25.8-.56%200-.28-.01-1.2-.02-2.17-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7%201.16.08%201.77%201.19%201.77%201.19%201.02%201.76%202.68%201.25%203.33.96.1-.74.4-1.25.72-1.53-2.55-.29-5.22-1.27-5.22-5.66%200-1.25.45-2.28%201.18-3.08-.12-.3-.51-1.5.11-3.13%200%200%20.96-.3%203.15%201.17a10.9%2010.9%200%200%201%205.74%200c2.18-1.48%203.14-1.17%203.14-1.17.62%201.63.24%202.83.12%203.13.74.8%201.18%201.83%201.18%203.08%200%204.4-2.68%205.37-5.24%205.66.41.35.78%201.03.78%202.08%200%201.5-.01%202.72-.01%203.09%200%20.31.21.67.8.56A11.52%2011.52%200%200%200%2023.5%2012C23.5%205.65%2018.35.5%2012%20.5Z'/%3e%3c/svg%3e`,J9={name:`@hart365/pp-md-pptb-edition`,version:`1.1.5`,displayName:`PP-MD Power Platform Markdown Document Generator`,description:`Generate Power Platform documentation from either Solution ZIP files or direct Dataverse connection`,author:`Mike Hartley`,contributors:[{name:`Mike Hartley`,url:`https://HartOfTheMidlands.co.uk`}],type:`module`,main:`index.html`,icon:`icons/pp-md.svg`,configurations:{repository:`https://github.com/Hart365/pp-md-pptb-edition`,readmeUrl:`https://raw.githubusercontent.com/Hart365/pp-md-pptb-edition/refs/heads/main/README.md`,website:`https://github.com/Hart365/pp-md-pptb-edition`},cspExceptions:{"connect-src":[{domain:`api.github.com`,exceptionReason:`Optionally checks GitHub Releases when the user requests an update check.`,optional:!0}]},features:{multiConnection:`none`,connectionRequirement:`optional`,minAPI:`1.2.2`},files:[`dist`,`LICENSE`,`README.md`],scripts:{dev:`vite`,build:`tsc && vite build && node scripts/normalize-dist-assets.mjs`,"build:with-maps":`tsc && vite build --mode debug && node scripts/normalize-dist-assets.mjs`,preview:`vite preview`,validate:`node node_modules/@pptb/validate/dist/cli.js`,"validate:offline":`node scripts/validate-offline.cjs`,"validate:dist":`node scripts/validate-dist.cjs`,"validate:publish":`npm run validate:offline && npm run build && npm run validate:dist && npm pack --dry-run`,"test:contrast":`node scripts/check-contrast.mjs`,lint:`eslint src --report-unused-disable-directives --max-warnings 0`,format:`eslint src --fix`,"type-check":`tsc --noEmit`,"test:unit":`vitest run`,test:`npm run validate:offline && npm run lint && npm run type-check && npm run test:unit && npm run test:contrast && npm run build && npm run validate:dist`,"finalize-package":`npm run validate:publish`},dependencies:{dompurify:`^3.4.15`,"fast-xml-parser":`^5.11.1`,jspdf:`4.2.1`,jszip:`^3.10.1`,mermaid:`^11.17.2`,react:`^19.2.8`,"react-dom":`^19.2.8`,"react-markdown":`^10.1.0`,"rehype-raw":`^7.0.0`,"rehype-sanitize":`^6.0.0`,"remark-gfm":`^4.0.1`,"remark-parse":`^11.0.0`,unified:`^11.0.5`,"xlsx-js-style":`1.2.0`},devDependencies:{"@eslint/js":`^10.0.1`,"@pptb/types":`^1.2.5`,"@pptb/validate":`1.0.2`,"@types/mdast":`^4.0.4`,"@types/react":`^19.2.18`,"@types/react-dom":`^19.2.7`,"@vitejs/plugin-react":`^6.1.1`,eslint:`^10.10.0`,"eslint-plugin-react-hooks":`^7.1.1`,globals:`^17.12.0`,typescript:`^6.0.3`,"typescript-eslint":`^8.69.0`,vite:`^8.2.2`,vitest:`^5.0.0`},overrides:{katex:`0.18.2`},repository:{type:`git`,url:`https://github.com/Hart365/pp-md-pptb-edition.git`},homepage:`https://github.com/Hart365/pp-md-pptb-edition#readme`,bugs:{url:`https://github.com/Hart365/pp-md-pptb-edition/issues`},keywords:[`powerplatform`,`documentation`,`dataverse`,`solution`,`markdown`],license:`MIT`},Y9={appRoot:`_appRoot_ap0ia_17`,skipLink:`_skipLink_ap0ia_43`,header:`_header_ap0ia_87`,headerInner:`_headerInner_ap0ia_107`,headerLeft:`_headerLeft_ap0ia_127`,headerCenter:`_headerCenter_ap0ia_143`,headerRight:`_headerRight_ap0ia_151`,brand:`_brand_ap0ia_161`,brandCopy:`_brandCopy_ap0ia_177`,brandIcon:`_brandIcon_ap0ia_189`,brandName:`_brandName_ap0ia_203`,brandTagline:`_brandTagline_ap0ia_221`,connectionText:`_connectionText_ap0ia_235`,headerActions:`_headerActions_ap0ia_251`,menuToggle:`_menuToggle_ap0ia_267`,headerGroup:`_headerGroup_ap0ia_295`,headerExportGroup:`_headerExportGroup_ap0ia_317`,headerBtn:`_headerBtn_ap0ia_325`,headerBtnActive:`_headerBtnActive_ap0ia_371`,headerExportMenu:`_headerExportMenu_ap0ia_381`,headerExportLabel:`_headerExportLabel_ap0ia_419`,headerDropdownArrow:`_headerDropdownArrow_ap0ia_421`,headerExportPanel:`_headerExportPanel_ap0ia_433`,menuBtn:`_menuBtn_ap0ia_473`,statusRegion:`_statusRegion_ap0ia_511`,body:`_body_ap0ia_535`,main:`_main_ap0ia_555`,mainWithViewer:`_mainWithViewer_ap0ia_577`,welcomeSection:`_welcomeSection_ap0ia_601`,welcomeHeading:`_welcomeHeading_ap0ia_619`,welcomeSubtitle:`_welcomeSubtitle_ap0ia_633`,modeVersion:`_modeVersion_ap0ia_647`,dropZoneWrapper:`_dropZoneWrapper_ap0ia_659`,modeGrid:`_modeGrid_ap0ia_667`,modeCard:`_modeCard_ap0ia_679`,modeCardTitle:`_modeCardTitle_ap0ia_719`,modeCardBody:`_modeCardBody_ap0ia_729`,modeBranding:`_modeBranding_ap0ia_739`,modeBrandIcon:`_modeBrandIcon_ap0ia_759`,modeBrandTitle:`_modeBrandTitle_ap0ia_769`,modeBrandByline:`_modeBrandByline_ap0ia_783`,modeBrandLinks:`_modeBrandLinks_ap0ia_793`,modeCallout:`_modeCallout_ap0ia_827`,modeActions:`_modeActions_ap0ia_847`,contextPanel:`_contextPanel_ap0ia_859`,contextHeading:`_contextHeading_ap0ia_879`,contextRow:`_contextRow_ap0ia_889`,contextSelectRow:`_contextSelectRow_ap0ia_901`,contextLabel:`_contextLabel_ap0ia_913`,contextSelect:`_contextSelect_ap0ia_901`,contextDeleteBtn:`_contextDeleteBtn_ap0ia_945`,contextWarning:`_contextWarning_ap0ia_989`,contextSaveRow:`_contextSaveRow_ap0ia_1005`,contextNameInput:`_contextNameInput_ap0ia_1017`,contextSaveBtn:`_contextSaveBtn_ap0ia_1039`,contextGrid:`_contextGrid_ap0ia_1063`,contextField:`_contextField_ap0ia_1075`,generatePanel:`_generatePanel_ap0ia_1109`,generatePanelHeader:`_generatePanelHeader_ap0ia_1129`,generatePanelHeading:`_generatePanelHeading_ap0ia_1141`,generatePanelSubtitle:`_generatePanelSubtitle_ap0ia_1151`,generatePanelActions:`_generatePanelActions_ap0ia_1163`,generatePrimaryBtn:`_generatePrimaryBtn_ap0ia_1177`,generateToggle:`_generateToggle_ap0ia_1221`,documentScope:`_documentScope_ap0ia_1249`,optionDetails:`_optionDetails_ap0ia_1271`,generateFooter:`_generateFooter_ap0ia_1315`,optionField:`_optionField_ap0ia_1351`,logoGrid:`_logoGrid_ap0ia_1399`,logoCard:`_logoCard_ap0ia_1411`,logoTitle:`_logoTitle_ap0ia_1429`,logoPreview:`_logoPreview_ap0ia_1441`,logoActions:`_logoActions_ap0ia_1459`,logoUploadBtn:`_logoUploadBtn_ap0ia_1469`,logoClearBtn:`_logoClearBtn_ap0ia_1471`,hiddenInput:`_hiddenInput_ap0ia_1509`,featureGrid:`_featureGrid_ap0ia_1519`,featureCard:`_featureCard_ap0ia_1531`,featureIcon:`_featureIcon_ap0ia_1555`,featureLabel:`_featureLabel_ap0ia_1567`,processingSection:`_processingSection_ap0ia_1581`,processingHeading:`_processingHeading_ap0ia_1599`,progressList:`_progressList_ap0ia_1611`,progressItem:`_progressItem_ap0ia_1623`,progressError:`_progressError_ap0ia_1631`,errorSummary:`_errorSummary_ap0ia_1653`,errorLine:`_errorLine_ap0ia_1675`,viewerWrapper:`_viewerWrapper_ap0ia_1691`,viewerLoadingState:`_viewerLoadingState_ap0ia_1711`,viewerLoadingCard:`_viewerLoadingCard_ap0ia_1733`,viewerLoadingSpinner:`_viewerLoadingSpinner_ap0ia_1755`,viewerSpin:`_viewerSpin_ap0ia_1`,viewerLoadingText:`_viewerLoadingText_ap0ia_1773`,addMoreDetails:`_addMoreDetails_ap0ia_1805`,addMoreSummary:`_addMoreSummary_ap0ia_1817`,addMoreBody:`_addMoreBody_ap0ia_1847`,addMoreSubsection:`_addMoreSubsection_ap0ia_1863`,addMoreSubheading:`_addMoreSubheading_ap0ia_1879`,modalBackdrop:`_modalBackdrop_ap0ia_1891`,modalDialog:`_modalDialog_ap0ia_1911`,modalTitle:`_modalTitle_ap0ia_1935`,modalBody:`_modalBody_ap0ia_1947`,modalOkBtn:`_modalOkBtn_ap0ia_1959`,footer:`_footer_ap0ia_2007`,footerLeft:`_footerLeft_ap0ia_2033`,footerRight:`_footerRight_ap0ia_2049`,footerVersion:`_footerVersion_ap0ia_2061`,iconLink:`_iconLink_ap0ia_2069`,linkIcon:`_linkIcon_ap0ia_2093`,headerMenuOpen:`_headerMenuOpen_ap0ia_2195`},X9=`pp-md-pptb-edition-doc-configurations`,Z9=`pp-md-pptb-edition-hidden-doc-configuration-ids`,B4t=`pp-md-pptb-edition-dataverse-collection-policy`,V4t=`solutionOnly`,H4t={client:``,project:``,contract:``,sow:``,sprint:``,releaseDate:``},U4t=J9.version,W4t=J9.configurations?.repository||(typeof J9.repository==`string`?J9.repository:J9.repository?.url?.replace(/^git\+/,``).replace(/\.git$/,``))||`https://github.com`,G4t=`https://HartOfTheMidlands.co.uk`;function Q9(e,t){return(e||t).trim().replace(/[^\w\s.-]/g,``).replace(/\s+/g,`_`)}function K4t(e){return(e.metadata.displayName||e.metadata.uniqueName||``).trim()}function q4t(e){return[...e].sort((e,t)=>K4t(e.solution).localeCompare(K4t(t.solution),void 0,{numeric:!0,sensitivity:`base`}))}function J4t(e){return[...e].sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`}))}function Y4t(e){return{peerGapFillApplied:e.peerGapFillApplied,dataverseMetadataEnriched:e.dataverseMetadataEnriched}}function X4t(e){return/invalid|zip|archive|solution\.xml|central directory/i.test(e)}async function Z4t(){if(C()){let e=await E(X9);return Array.isArray(e)?e.filter(e=>!!e?.id&&!!e?.name):[]}try{let e=localStorage.getItem(X9);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`object`&&!!e).map(e=>e).filter(e=>!!e.id&&!!e.name):[]}catch{return[]}}async function Q4t(e){if(C()){await D(X9,e);return}try{localStorage.setItem(X9,JSON.stringify(e))}catch{}}async function $4t(){if(C()){let e=await E(Z9);return Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.trim().length>0):[]}try{let e=localStorage.getItem(Z9);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0):[]}catch{return[]}}async function e3t(e){if(C()){await D(Z9,e);return}try{localStorage.setItem(Z9,JSON.stringify(e))}catch{}}function t3t(e,t,n){let r=EWt(e.map(e=>e.solution)),i={peerGapFillApplied:e.some(e=>e.peerGapFillApplied),dataverseMetadataEnriched:e.some(e=>e.dataverseMetadataEnriched)},a=x6(r,{erdMode:t.erdMode,documentContext:n,enrichmentIndicators:i,includeDiagrams:t.includeDiagrams,includeDefaultColumns:t.includeDefaultColumns,scope:t.scope,documentationSettings:t.documentationSettings}),o=t.includeDiagrams?tGt(a,`All Selected Solutions: Diagrams`):void 0;return{solution:r,markdown:t.includeDiagrams?x6(r,{erdMode:t.erdMode,documentContext:n,enrichmentIndicators:i,includeDiagrams:!1,includeDefaultColumns:t.includeDefaultColumns,scope:t.scope,documentationSettings:t.documentationSettings}):a,fileName:`all-selected-solutions.md`,isConsolidated:!0,diagramsMarkdown:o,peerGapFillApplied:i.peerGapFillApplied,dataverseMetadataEnriched:i.dataverseMetadataEnriched}}function n3t(e,t,n,r){let i=x6(e,{erdMode:t.erdMode,documentContext:n,enrichmentIndicators:r,includeDiagrams:t.includeDiagrams,includeDefaultColumns:t.includeDefaultColumns,scope:t.scope,documentationSettings:t.documentationSettings}),a=t.includeDiagrams&&(t.documentationSettings.separateDiagramsDocument||a3t(i)),o=a?tGt(i,`${e.metadata.displayName||e.metadata.uniqueName}: Diagrams`):void 0;return{markdown:a?x6(e,{erdMode:t.erdMode,documentContext:n,enrichmentIndicators:r,includeDiagrams:!1,includeDefaultColumns:t.includeDefaultColumns,scope:t.scope,documentationSettings:t.documentationSettings}):i,diagramsMarkdown:o||void 0}}function r3t(e,t,n){let r=q4t(e.filter(e=>!e.isConsolidated)).map((e,r,i)=>{let a=i.filter((e,t)=>t!==r).map(e=>e.solution),o=OWt(e.solution,a),s=n3t(o,t,n,Y4t({peerGapFillApplied:a.length>0,dataverseMetadataEnriched:e.dataverseMetadataEnriched}));return{...e,solution:o,peerGapFillApplied:a.length>0,markdown:s.markdown,diagramsMarkdown:s.diagramsMarkdown}});return r.length>1?[...r,t3t(r,t,n)]:r}function i3t(e){for(let t=e.length-1;t>=0;--t)if(!e[t].isConsolidated)return t;return 0}function $9(e,t,n){return r3t(e.filter(e=>!e.isConsolidated),t,n)}function a3t(e){let t=(e.match(/^#{2,6}\s+/gm)??[]).length,n=(e.match(/^\|.*\|\s*$/gm)??[]).length,r=(e.match(/```mermaid/g)??[]).length;return e.length>=45e3||t>=80||n>=250||r>=6}function o3t(){let[e,t]=(0,x.useState)([]),[n,r]=(0,x.useState)(0),[i,a]=(0,x.useState)([]),[o,s]=(0,x.useState)(!1),[l,u]=(0,x.useState)(``),[d,f]=(0,x.useState)(`detailed-relationships`),[p,m]=(0,x.useState)(!0),[h,g]=(0,x.useState)(!0),[_,v]=(0,x.useState)(oWt),[y,b]=(0,x.useState)(e6),[S,T]=(0,x.useState)(H4t),[O,A]=(0,x.useState)([]),[j,N]=(0,x.useState)(`custom`),[P,F]=(0,x.useState)(``),[I,R]=(0,x.useState)(``),[ee,z]=(0,x.useState)(!1),[B,te]=(0,x.useState)(!1),[re,ae]=(0,x.useState)(null),[oe,se]=(0,x.useState)([]),[ce,le]=(0,x.useState)(!1),[H,ue]=(0,x.useState)(``),[de,fe]=(0,x.useState)(``),[pe,me]=(0,x.useState)(`name-asc`),[he,ge]=(0,x.useState)(`all`),[_e,ve]=(0,x.useState)([]),[ye,be]=(0,x.useState)([]),[xe,Se]=(0,x.useState)(V4t),[Ce,we]=(0,x.useState)([]),[Te,Ee]=(0,x.useState)([]),[De,Oe]=(0,x.useState)(0),[ke,Ae]=(0,x.useState)(null),[je,Me]=(0,x.useState)(!1),[Ne,Pe]=(0,x.useState)(!1),Fe=(0,x.useRef)(null),Ie=(0,x.useRef)(null),Le=(0,x.useRef)(null),Re=(0,x.useMemo)(()=>({erdMode:d,includeDiagrams:p,includeDefaultColumns:h,scope:_,documentationSettings:y}),[d,p,h,_,y]),ze=(0,x.useCallback)(e=>{e.currentTarget.dataset.ppmdArmed=`true`},[]),Be=(0,x.useCallback)(e=>{let t=e.currentTarget,n=t.dataset.ppmdArmed===`true`,r=t.href;if(delete t.dataset.ppmdArmed,e.detail!==0&&!n){e.preventDefault(),e.stopPropagation();return}C()&&(e.preventDefault(),k(r))},[]),{connection:Ve,isLoading:He,isInPPTB:Ue,initializeConnection:We}=WGt({autoInitConnection:!1}),Ge=window.__PPMD_VERSION__||U4t;(0,x.useEffect)(()=>{if(!Ue)return;let e=window.setTimeout(()=>{We()},0);return()=>{window.clearTimeout(e)}},[Ue,We]),(0,x.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await E(B4t);if(!e)return;(t===`solutionOnly`||t===`solutionAndDirectReferences`||t===`environmentAppendix`)&&Se(t)}catch{}})(),()=>{e=!1}},[]),(0,x.useEffect)(()=>{D(B4t,xe)},[xe]),(0,x.useEffect)(()=>{let e=!0;return(async()=>{let t=await Z4t(),n=new Set(await $4t());try{let r=await fetch(`./doc-configurations.json`,{cache:`no-store`});if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.json();if(!Array.isArray(i.configurations))throw Error(`Invalid configuration shape`);if(!e)return;A([...i.configurations,...t].filter(e=>!n.has(e.id))),F(``)}catch(r){if(!e)return;A(t.filter(e=>!n.has(e.id))),F(`Could not load doc-configurations.json: ${r.message}`)}})(),()=>{e=!1}},[]),(0,x.useEffect)(()=>{ke&&Ie.current?.focus()},[ke]);let Ke=(0,x.useCallback)(e=>{let n={client:e.client??``,project:e.project??``,contract:e.contract??``,sow:e.sow??``,sprint:e.sprint??``,releaseDate:e.releaseDate??``};T({client:n.client,project:n.project,contract:n.contract,sow:n.sow,sprint:n.sprint,releaseDate:n.releaseDate}),t(e=>$9(e,Re,n))},[Re]),qe=(0,x.useCallback)(e=>{let t=e.target.value;if(N(t),t===`custom`)return;let n=O.find(e=>e.id===t);n&&(Ke(n),R(n.name))},[O,Ke]),Je=(0,x.useCallback)((e,n)=>{let r={...S,[e]:n};N(`custom`),T(r),t(e=>$9(e,Re,r))},[S,Re]),Ye=(0,x.useCallback)(async()=>{let e=I.trim();if(!e){u(`Please enter a configuration name before saving.`);return}let t=`local-${Date.now()}`,n={id:t,name:e,client:S.client,project:S.project,contract:S.contract,sow:S.sow,sprint:S.sprint,releaseDate:S.releaseDate};await Q4t([...(await Z4t()).filter(t=>t.name.toLowerCase()!==e.toLowerCase()),n]),A(t=>[...t.filter(t=>t.name.toLowerCase()!==e.toLowerCase()),n]),N(t),u(`Configuration "${e}" saved.`)},[I,S]),Xe=(0,x.useCallback)(async e=>{if(e===`custom`)return;let t=O.find(t=>t.id===e);t&&(await e3t(Array.from(new Set([...await $4t(),e]))),e.startsWith(`local-`)&&await Q4t((await Z4t()).filter(t=>t.id!==e)),A(t=>t.filter(t=>t.id!==e)),j===e&&(N(`custom`),R(``)),u(`Configuration "${t.name}" deleted.`))},[O,j]),Ze=(0,x.useCallback)(async()=>{let e=Ve??await We();if(!e){se([]),ue(`No active Dataverse connection is available. Open or activate a connection in Power Platform ToolBox, then refresh this list.`);return}le(!0),ue(``);try{let t=await BGt();se(t),u(`Loaded ${t.length} solution${t.length===1?``:`s`} from ${e.name}.`);let n=Array.from(new Set(t.map(e=>e.publisherName?.trim()).filter(e=>!!e))).sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}));ve(n),be([])}catch(e){let t=e instanceof Error?e.message:`Unable to read solutions from Dataverse.`;se([]),ve([]),be([]),ue(t),u(`Failed to load Dataverse solutions: ${t}`)}finally{le(!1)}},[Ve,We]),Qe=(0,x.useCallback)(e=>{ae(e),t([]),r(0),a([]),s(!1),ue(``),be([]),Ee([]),Oe(e=>e+1),u(e===`local`?`Local Solutions mode selected. Upload one or more solution ZIP files to continue.`:`Dataverse Connected mode selected. Choose a solution from the active environment to continue.`),e===`dataverse`&&Ze()},[Ze]),$e=(0,x.useCallback)(()=>{ae(null),t([]),r(0),a([]),s(!1),we([]),ve([]),be([]),Ee([]),Oe(e=>e+1),Ae(null),u(`Choose how you want to generate solution documentation.`)},[]),et=(0,x.useCallback)(async n=>{let i=n.target.files?.[0];if(n.target.value=``,i)try{let n=await i.text(),a=i.name.replace(/\.md$/i,``)||`Imported Markdown`,o={metadata:{uniqueName:a,displayName:a,version:``,publisherName:``,isManaged:!1},entities:[],optionSets:[],forms:[],views:[],processes:[],apps:[],webResources:[],securityRoles:[],fieldSecurityProfiles:[],connectionReferences:[],environmentVariables:[],emailTemplates:[],reports:[],dashboards:[],pluginAssemblies:[],warnings:[],agents:[],aiModels:[],desktopFlows:[],dataflows:[],customApis:[],offlineProfiles:[]};t(e=>[...e.filter(e=>!e.isConsolidated),{solution:o,markdown:n,fileName:i.name}]),r(e.filter(e=>!e.isConsolidated).length),u(`Opened ${i.name}.`)}catch{u(`Could not open ${i.name}.`)}},[e]),tt=(0,x.useCallback)((e,t)=>{a(n=>{if(!n[e])return n;let r=[...n];return r[e]=t(r[e]),r})},[]),nt=(0,x.useCallback)(async n=>{let i=J4t(n);s(!0),u(`Processing ${i.length} file${i.length>1?`s`:``}…`);let o=i.map(e=>({fileName:e.name,progress:0}));a(o);let l=[],f=[];for(let e=0;e<i.length;e++){let t=i[e];try{u(`Parsing ${t.name}…`);let n=await aWt(t,t=>{tt(e,e=>({...e,progress:t}))});u(`Generating documentation for ${t.name}…`);let r=x6(n,{erdMode:d,documentContext:S,includeDiagrams:p,includeDefaultColumns:h,scope:_,documentationSettings:y});l.push({solution:n,markdown:r,fileName:t.name}),tt(e,e=>({...e,progress:100}))}catch(n){let r=n.message??`Unknown error`;tt(e,e=>({...e,progress:0,error:r})),X4t(r)&&f.push(t.name)}}if(l.length>0){let n=r3t([...e.filter(e=>!e.isConsolidated),...l],Re,S);t(n),r(i3t(n));let a=l.length,o=i.length-a;u(o>0?`Done: ${a} document${a>1?`s`:``} generated, ${o} file${o>1?`s`:``} failed.`:`Done: ${a} document${a>1?`s`:``} generated successfully.`)}else u(`No documents generated. Check that the files are valid Power Platform solution ZIPs.`);s(!1),f.length>0&&Ae(f.length===1?`${f[0]} is not a valid Power Platform solution ZIP archive and was removed from the selection list.`:`${f.length} invalid ZIP archives were removed from the selection list.`),setTimeout(()=>a([]),1500)},[e,d,S,p,h,_,y,Re,tt]),rt=(0,x.useCallback)(async()=>{if(ye.length===0){ue(`Select at least one solution to generate documentation.`);return}let n=Ve??await We();if(!n){ue(`No active Dataverse connection is available. Open or activate a connection in Power Platform ToolBox and try again.`);return}let i=oe.filter(e=>ye.includes(e.solutionId));if(i.length===0){ue(`The selected solutions are no longer available. Refresh the list and try again.`);return}we(i.map(e=>e.solutionId)),s(!0),a(i.map(e=>({fileName:e.displayName,progress:0}))),u(`Reading ${i.length} solution${i.length===1?``:`s`} from ${n.name}...`);try{let n=[];for(let e=0;e<i.length;e+=1){let t=i[e],r=await HGt(t.solutionId,({message:t,percent:n})=>{u(t),tt(e,e=>({...e,progress:n}))},xe),a=x6(r,{erdMode:d,documentContext:S,includeDiagrams:p,includeDefaultColumns:h,scope:_,documentationSettings:y});n.push({solution:r,markdown:a,fileName:`${t.uniqueName}.dataverse`,dataverseMetadataEnriched:!1}),tt(e,e=>({...e,progress:100}))}let a=r3t(q4t([...e.filter(e=>!e.isConsolidated),...n]),Re,S);t(a),r(i3t(a)),u(`Documentation generated for ${n.length} Dataverse solution${n.length===1?``:`s`}.`),await w(`Documentation Ready`,`${n.length} Dataverse solution${n.length===1?``:`s`} documented.`,`success`,3e3)}catch(e){let t=e instanceof Error?e.message:`Unable to read the selected solution.`;a(e=>e.map(e=>({...e,error:t}))),u(`Failed to generate Dataverse documentation: ${t}`),await w(`Dataverse Read Failed`,t,`error`,4e3)}finally{we([]),s(!1),setTimeout(()=>a([]),1500)}},[Ve,oe,S,d,p,h,_,y,Re,We,e,ye,xe,tt]),it=(0,x.useCallback)(e=>{Se(e),u(`Dataverse collection policy set to ${e}.`)},[]),at=(0,x.useCallback)(e=>{ve(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),ot=(0,x.useCallback)(()=>{let e=Array.from(new Set(oe.map(e=>e.publisherName?.trim()).filter(e=>!!e))).sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}));ve(e)},[oe]),st=(0,x.useCallback)(()=>{ve([])},[]),ct=(0,x.useCallback)(e=>{be(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),lt=(0,x.useCallback)(()=>{be([])},[]),ut=(0,x.useCallback)(()=>{let e=d===`detailed-relationships`?`compact`:`detailed-relationships`,n={...Re,erdMode:e};t(e=>$9(e,n,S)),f(e),u(`ERD mode switched to ${e===`compact`?`Compact`:`Detailed-Relationships`}.`)},[d,S,Re]),dt=(0,x.useCallback)(()=>{let e=!p,n={...Re,includeDiagrams:e};m(e),t(e=>$9(e,n,S)),u(e?`Generate Diagrams enabled.`:`Generate Diagrams disabled. Diagram sections will be excluded.`)},[p,Re,S]),ft=(0,x.useCallback)(()=>{let e=!h,n={...Re,includeDefaultColumns:e};g(e),t(e=>$9(e,n,S)),u(e?`Include Default Columns enabled.`:`Include Default Columns disabled. Default/system columns will be excluded.`)},[h,Re,S]),pt=(0,x.useCallback)(e=>{v(n=>{let r={...n,[e]:!n[e]};return t(e=>$9(e,{...Re,scope:r},S)),r})},[S,Re]),mt=(0,x.useCallback)(e=>{b(n=>{let r={...n,...e,metadata:{...n.metadata,...e.metadata},securityRoleFilters:{...n.securityRoleFilters,...e.securityRoleFilters}};return t(e=>$9(e,{...Re,documentationSettings:r},S)),r})},[S,Re]),ht=(0,x.useCallback)(()=>{if(o||Te.length===0)return;let e=J4t(Te);Ee([]),Oe(e=>e+1),nt(e)},[o,Te,nt]),gt=(0,x.useCallback)(t=>{let n=e[t];if(n){if(te(!1),!a3t(n.markdown)){r(t),z(!1);return}z(!0),window.setTimeout(()=>{r(t),window.setTimeout(()=>{z(!1)},300)},50)}},[e]),_t=(0,x.useCallback)((t=n)=>{let i=e[t];i?.diagramsMarkdown&&(r(t),te(!0),z(a3t(i.diagramsMarkdown)),window.setTimeout(()=>z(!1),350))},[n,e]),vt=(0,x.useCallback)(async()=>{let t=e[n];if(!t)return;let r=B?t.diagramsMarkdown:t.markdown;if(!r)return;let i=Q9(t.solution.metadata.displayName||t.solution.metadata.uniqueName,`solution`);try{await N4t(r,B?`${i}-diagrams`:`${i}-documentation`),await w(`Export Successful`,`Markdown document exported successfully.`,`success`,3e3)}catch(e){console.error(`Export failed:`,e),await w(`Export Failed`,`Failed to export markdown document.`,`error`,3e3)}},[e,n,B]),yt=(0,x.useCallback)(async t=>{let r=e[n];if(!r)return;let i=Q9(r.solution.metadata.displayName||r.solution.metadata.uniqueName,`solution`);try{await F4t(t,B?`${i}-diagrams`:`${i}-documentation`),await w(`Export Successful`,`HTML document exported successfully.`,`success`,3e3)}catch(e){console.error(`HTML export failed:`,e),await w(`Export Failed`,`Failed to export HTML document.`,`error`,3e3)}},[e,n,B]),bt=(0,x.useCallback)(async()=>{let t=e[n];if(!t)return;let r=Q9(t.solution.metadata.displayName||t.solution.metadata.uniqueName,`solution`);try{await I4t(t.solution,B?`${r}-diagrams`:`${r}-documentation`),await w(`Export Successful`,`Excel workbook exported successfully.`,`success`,3e3)}catch(e){console.error(`Excel export failed:`,e),await w(`Export Failed`,`Failed to export Excel workbook.`,`error`,3e3)}},[e,n,B]),xt=(0,x.useCallback)(async(t,r,i)=>{if(!e[n])return;let a=Q9(r,`solution`);try{await L4t(t,r,`${a}-documentation`,i),await w(`Export Successful`,`PDF document exported successfully.`,`success`,3e3)}catch(e){console.error(`PDF export failed:`,e),await w(`Export Failed`,`Failed to export PDF document.`,`error`,3e3)}},[e,n]),St=(0,x.useCallback)(async()=>{let t=e[n];if(!t)return;let r=nGt(t.solution,{documentContext:S}),i=Q9(t.solution.metadata.displayName||t.solution.metadata.uniqueName,`solution`);try{await N4t(r,`${i}-dependency-report`),await w(`Export Successful`,`Dependency report exported successfully.`,`success`,3e3)}catch(e){console.error(`Dependency export failed:`,e),await w(`Export Failed`,`Failed to export dependency report.`,`error`,3e3)}},[e,n,S]),Ct=(0,x.useCallback)(async()=>{if(e.length!==0)try{let t=new L.default;e.forEach((e,n)=>{let r=e.isConsolidated?`consolidated`:`solution_${n+1}`,i=Q9(e.solution.metadata.displayName||e.solution.metadata.uniqueName,r),a=e.isConsolidated?`-summary.md`:`-documentation.md`;if(t.file(`${i}${a}`,e.markdown),e.diagramsMarkdown&&t.file(`${i}-diagrams.md`,e.diagramsMarkdown),je&&!e.isConsolidated){let n=nGt(e.solution,{documentContext:S});t.file(`${i}-dependency-report.md`,n)}}),await P4t(await t.generateAsync({type:`blob`}),`pp-md-pptb-edition-markdown-documents`),await w(`Export Successful`,je?`All markdown documents and dependency reports exported as ZIP.`:`All markdown documents exported as ZIP.`,`success`,3e3)}catch(e){console.error(`Export all failed:`,e),await w(`Export Failed`,`Failed to export markdown documents as ZIP.`,`error`,3e3)}},[e,je,S]),wt=(0,x.useCallback)(async()=>{if(e.length!==0)try{let t=new L.default;e.forEach((e,n)=>{let r=Q9(e.solution.metadata.displayName||e.solution.metadata.uniqueName,e.isConsolidated?`all-selected-solutions`:`solution_${n+1}`),i=t.folder(r),a=eGt(e.markdown);a.length===0?i?.file(`${r}-documentation.md`,e.markdown):a.forEach(e=>{i?.file(`${r}-${e.key}.md`,e.markdown)}),e.diagramsMarkdown&&i?.file(`${r}-diagrams.md`,e.diagramsMarkdown)}),await P4t(await t.generateAsync({type:`blob`}),`pp-md-pptb-edition-markdown-by-category`),await w(`Export Successful`,`Documentation exported as category-grouped ZIP.`,`success`,3e3)}catch(e){console.error(`Export by category failed:`,e),await w(`Export Failed`,`Failed to export category-grouped documentation.`,`error`,3e3)}},[e]),Tt=(0,x.useCallback)(()=>{t([]),r(0),a([]),Ee([]),Oe(e=>e+1),u(``)},[]),Et=e.length>0,Dt=re===`local`&&Te.length>0&&!o,Ot=re===`dataverse`&&ye.length>0&&Ce.length===0&&!o,kt=e.findIndex(e=>e.isConsolidated),At=e[n],jt=re===`local`&&!Et&&!o,Mt=re===null&&!Et&&!o,Nt=re===`dataverse`&&!Et&&!o,Pt=Array.from(new Set(oe.map(e=>e.publisherName?.trim()).filter(e=>!!e))).sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`})),Ft=oe.filter(e=>{if(he===`managed`&&!e.isManaged||he===`unmanaged`&&e.isManaged)return!1;if(_e.length>0){let t=e.publisherName?.trim()||``;if(!_e.includes(t))return!1}let t=de.trim().toLowerCase();return!t||e.displayName.toLowerCase().includes(t)||e.uniqueName.toLowerCase().includes(t)||e.version.toLowerCase().includes(t)||(e.publisherName?.toLowerCase().includes(t)??!1)}).sort((e,t)=>{switch(pe){case`name-desc`:return t.displayName.localeCompare(e.displayName,void 0,{sensitivity:`base`});case`version-asc`:return e.version.localeCompare(t.version,void 0,{sensitivity:`base`,numeric:!0});case`version-desc`:return t.version.localeCompare(e.version,void 0,{sensitivity:`base`,numeric:!0});default:return e.displayName.localeCompare(t.displayName,void 0,{sensitivity:`base`})}}),It=(0,x.useCallback)(()=>{be(Ft.map(e=>e.solutionId))},[Ft]);return(0,M.jsxs)(`div`,{className:Y9.appRoot,children:[(0,M.jsx)(`a`,{href:`#main-content`,className:Y9.skipLink,children:`Skip to main content`}),(0,M.jsx)(`input`,{ref:Le,type:`file`,accept:`text/markdown,.md`,className:`sr-only`,onChange:et}),(0,M.jsx)(`header`,{className:Y9.header,role:`banner`,children:(0,M.jsxs)(`div`,{className:Y9.headerInner,children:[(0,M.jsxs)(`div`,{className:Y9.headerLeft,children:[(0,M.jsxs)(`div`,{className:Y9.brand,children:[(0,M.jsx)(`img`,{src:R4t,className:Y9.brandIcon,alt:``,"aria-hidden":`true`}),(0,M.jsxs)(`div`,{className:Y9.brandCopy,children:[(0,M.jsx)(`h1`,{className:Y9.brandName,children:`PP-MD - PPTB Edition`}),(0,M.jsx)(`span`,{className:Y9.brandTagline,children:`Power Platform Documentation Generator`})]})]}),(0,M.jsx)(`span`,{className:Y9.connectionText,children:He?`Connecting to ToolBox...`:Ue?`Connected to: ${Ve?.name??`No active connection`}`:`Running outside ToolBox (local dev mode)`})]}),(0,M.jsxs)(`div`,{className:Y9.headerRight,children:[(0,M.jsx)(`button`,{type:`button`,className:Y9.menuToggle,onClick:()=>Pe(e=>!e),"aria-expanded":Ne,"aria-controls":`header-actions`,"aria-label":`Open toolbar menu`,children:(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`☰`})}),(0,M.jsxs)(`div`,{id:`header-actions`,className:`${Y9.headerActions} ${Ne?Y9.headerMenuOpen:``}`,children:[(0,M.jsxs)(`div`,{className:Y9.headerGroup,role:`group`,"aria-label":`Document tools`,children:[!o&&(0,M.jsx)(`button`,{type:`button`,className:Y9.headerBtn,onClick:()=>Le.current?.click(),children:`Open .MD`}),Et&&!o&&(0,M.jsx)(`button`,{type:`button`,className:Y9.headerBtn,onClick:ut,"aria-label":`Toggle ERD detail level`,children:d===`compact`?`ERD: Compact`:`ERD: Detailed`}),Et&&!o&&At?.diagramsMarkdown&&(0,M.jsx)(`button`,{type:`button`,className:`${Y9.headerBtn} ${B?Y9.headerBtnActive:``}`,onClick:()=>{B?te(!1):_t(n)},"aria-label":B?`View main documentation`:`View companion diagrams`,children:B?`Main Document`:`Companion Diagrams`})]}),(0,M.jsx)(`div`,{className:`${Y9.headerGroup} ${Y9.headerExportGroup}`,role:`group`,"aria-label":`Documentation exports`,children:Et&&!o&&(0,M.jsxs)(`details`,{ref:Fe,className:Y9.headerExportMenu,children:[(0,M.jsxs)(`summary`,{className:`${Y9.headerBtn} ${Y9.headerExportTrigger}`,children:[(0,M.jsx)(`span`,{className:Y9.headerExportLabel,children:`Export`}),(0,M.jsx)(`span`,{className:Y9.headerDropdownArrow,"aria-hidden":`true`,children:`▼`})]}),(0,M.jsxs)(`div`,{className:Y9.headerExportPanel,children:[(0,M.jsxs)(`button`,{type:`button`,className:Y9.menuBtn,onClick:()=>{Fe.current?.removeAttribute(`open`),Ct()},children:[`All Markdown`,je?` + Dependencies`:``]}),(0,M.jsx)(`button`,{type:`button`,className:Y9.menuBtn,onClick:()=>{Fe.current?.removeAttribute(`open`),wt()},children:`By Category`}),(0,M.jsx)(`button`,{type:`button`,className:Y9.menuBtn,onClick:()=>{Fe.current?.removeAttribute(`open`),Me(e=>!e)},children:je?`Disable Dependency Reports`:`Include Dependency Reports`}),je&&(0,M.jsx)(`button`,{type:`button`,className:Y9.menuBtn,onClick:()=>{Fe.current?.removeAttribute(`open`),St()},children:`Dependency Report`})]})]})}),(0,M.jsxs)(`div`,{className:Y9.headerGroup,role:`group`,"aria-label":`Session actions`,children:[Et&&!o&&(0,M.jsx)(`button`,{type:`button`,className:Y9.headerBtn,onClick:Tt,"aria-label":`Clear all results and add new files`,children:`+ New`}),re&&(0,M.jsx)(`button`,{type:`button`,className:Y9.headerBtn,onClick:$e,"aria-label":`Return to mode selection`,children:`Change Mode`})]})]})]})]})}),(0,M.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,className:Y9.statusRegion,role:`status`,children:l}),(0,M.jsxs)(`div`,{className:Y9.body,children:[Et&&(0,M.jsx)(jVt,{solutions:e.map(e=>e.solution),activeIndex:n,combinedIndex:kt,diagramsAvailable:!!e[kt]?.diagramsMarkdown,diagramsActive:B,onSelectDiagrams:()=>_t(kt),onSelect:gt,onReset:Tt}),(0,M.jsxs)(`main`,{id:`main-content`,className:`${Y9.main} ${Et?Y9.mainWithViewer:``}`,tabIndex:-1,children:[(Mt||jt||Nt)&&(0,M.jsx)(`section`,{className:Y9.welcomeSection,"aria-labelledby":`welcome-heading`,children:Mt?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`h2`,{id:`welcome-heading`,className:Y9.welcomeHeading,children:`Choose how you want to document your solution`}),(0,M.jsx)(`p`,{className:Y9.welcomeSubtitle,children:`Start with local ZIP files or connect to Dataverse and read solution metadata directly from the active environment.`}),(0,M.jsxs)(`p`,{className:Y9.modeVersion,children:[`PP-MD - PPTB Edition version `,Ge]}),(0,M.jsxs)(`div`,{className:Y9.modeGrid,children:[(0,M.jsxs)(`button`,{type:`button`,className:Y9.modeCard,onClick:()=>Qe(`local`),children:[(0,M.jsx)(`span`,{className:Y9.modeCardTitle,children:`Local Solutions`}),(0,M.jsx)(`span`,{className:Y9.modeCardBody,children:`Upload one or more exported solution ZIP files for local documentation generation.`})]}),(0,M.jsxs)(`button`,{type:`button`,className:Y9.modeCard,onClick:()=>Qe(`dataverse`),children:[(0,M.jsx)(`span`,{className:Y9.modeCardTitle,children:`Dataverse Connected`}),(0,M.jsx)(`span`,{className:Y9.modeCardBody,children:`Browse solutions from the currently active Power Platform ToolBox environment and generate documentation directly from Dataverse metadata.`})]})]}),(0,M.jsxs)(`section`,{className:Y9.modeBranding,"aria-label":`Product details and links`,children:[(0,M.jsx)(`img`,{src:``+new URL(`pp-md-icon-Dgg8-GAC.svg`,import.meta.url).href,className:Y9.modeBrandIcon,alt:`PP-MD logo`}),(0,M.jsx)(`p`,{className:Y9.modeBrandTitle,children:`Power Platform Markdown Document Generator`}),(0,M.jsx)(`p`,{className:Y9.modeBrandByline,children:`by Mike Hartley / Hart of the Midlands`}),(0,M.jsxs)(`div`,{className:Y9.modeBrandLinks,children:[(0,M.jsx)(`a`,{href:G4t,target:`_blank`,rel:`noreferrer`,onMouseDown:ze,onClick:Be,children:`HartOfTheMidlands.co.uk`}),(0,M.jsxs)(`a`,{href:W4t,target:`_blank`,rel:`noreferrer`,className:Y9.iconLink,onMouseDown:ze,onClick:Be,children:[(0,M.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%20aria-hidden='true'%3e%3cpath%20d='M12%20.5C5.65.5.5%205.65.5%2012c0%205.1%203.3%209.42%207.88%2010.95.58.1.8-.25.8-.56%200-.28-.01-1.2-.02-2.17-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7%201.16.08%201.77%201.19%201.77%201.19%201.02%201.76%202.68%201.25%203.33.96.1-.74.4-1.25.72-1.53-2.55-.29-5.22-1.27-5.22-5.66%200-1.25.45-2.28%201.18-3.08-.12-.3-.51-1.5.11-3.13%200%200%20.96-.3%203.15%201.17a10.9%2010.9%200%200%201%205.74%200c2.18-1.48%203.14-1.17%203.14-1.17.62%201.63.24%202.83.12%203.13.74.8%201.18%201.83%201.18%203.08%200%204.4-2.68%205.37-5.24%205.66.41.35.78%201.03.78%202.08%200%201.5-.01%202.72-.01%203.09%200%20.31.21.67.8.56A11.52%2011.52%200%200%200%2023.5%2012C23.5%205.65%2018.35.5%2012%20.5Z'/%3e%3c/svg%3e`,className:Y9.linkIcon,alt:``,"aria-hidden":`true`}),(0,M.jsx)(`span`,{children:`GitHub Repo`})]})]})]})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`h2`,{id:`welcome-heading`,className:Y9.welcomeHeading,children:re===`local`?`Generate documentation from your solution files`:`Generate documentation from the active Dataverse environment`}),(0,M.jsx)(`p`,{className:Y9.welcomeSubtitle,children:re===`local`?`Drop one or more Power Platform solution ZIP archives below. PP-MD - PPTB Edition will parse every component and produce comprehensive Markdown documentation — including architecture and ERD Mermaid diagrams.`:`Choose a solution from the active environment. PP-MD - PPTB Edition reads metadata through Power Platform ToolBox and generates Markdown documentation without exporting or uploading the solution.`}),(0,M.jsxs)(`section`,{className:Y9.contextPanel,"aria-labelledby":`context-heading`,children:[(0,M.jsx)(`h3`,{id:`context-heading`,className:Y9.contextHeading,children:`Document Header Details`}),re===`dataverse`&&(0,M.jsxs)(`div`,{className:Y9.contextRow,children:[(0,M.jsx)(`label`,{htmlFor:`dataverse-policy-select`,className:Y9.contextLabel,children:`Collection Policy`}),(0,M.jsx)(`div`,{className:Y9.contextSelectRow,children:(0,M.jsxs)(`select`,{id:`dataverse-policy-select`,className:Y9.contextSelect,value:xe,onChange:e=>it(e.target.value),"aria-label":`Select the Dataverse collection policy`,children:[(0,M.jsx)(`option`,{value:`solutionOnly`,children:`Solution only`}),(0,M.jsx)(`option`,{value:`solutionAndDirectReferences`,children:`Solution + direct references`}),(0,M.jsx)(`option`,{value:`environmentAppendix`,children:`Environment appendix`})]})})]}),(0,M.jsxs)(`div`,{className:Y9.contextRow,children:[(0,M.jsx)(`label`,{htmlFor:`config-select`,className:Y9.contextLabel,children:`Configuration`}),(0,M.jsxs)(`div`,{className:Y9.contextSelectRow,children:[(0,M.jsxs)(`select`,{id:`config-select`,className:Y9.contextSelect,value:j,onChange:qe,"aria-label":`Select document configuration`,children:[(0,M.jsx)(`option`,{value:`custom`,children:`Custom (manual entry)`}),O.map(e=>(0,M.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,M.jsx)(`button`,{type:`button`,className:Y9.contextDeleteBtn,onClick:()=>Xe(j),disabled:j===`custom`,"aria-label":`Delete selected configuration`,title:`Delete selected configuration`,children:`🗑`})]})]}),(0,M.jsxs)(`div`,{className:Y9.contextSaveRow,children:[(0,M.jsx)(`input`,{type:`text`,className:Y9.contextNameInput,placeholder:`Configuration name`,value:I,onChange:e=>R(e.target.value),"aria-label":`Configuration name`}),(0,M.jsx)(`button`,{type:`button`,className:Y9.contextSaveBtn,onClick:Ye,children:`Save Configuration`})]}),P&&(0,M.jsxs)(`p`,{className:Y9.contextWarning,role:`alert`,children:[`⚠ `,P]}),(0,M.jsxs)(`div`,{className:Y9.contextGrid,children:[(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Client`}),(0,M.jsx)(`input`,{type:`text`,value:S.client,onChange:e=>Je(`client`,e.target.value)})]}),(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Contract`}),(0,M.jsx)(`input`,{type:`text`,value:S.contract,onChange:e=>Je(`contract`,e.target.value)})]}),(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Contract ID/SoW`}),(0,M.jsx)(`input`,{type:`text`,value:S.sow,onChange:e=>Je(`sow`,e.target.value)})]}),(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Project`}),(0,M.jsx)(`input`,{type:`text`,value:S.project,onChange:e=>Je(`project`,e.target.value)})]}),(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Sprint`}),(0,M.jsx)(`input`,{type:`text`,value:S.sprint,onChange:e=>Je(`sprint`,e.target.value)})]}),(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Release Date`}),(0,M.jsx)(`input`,{type:`date`,value:S.releaseDate,onChange:e=>Je(`releaseDate`,e.target.value)})]})]})]}),(0,M.jsxs)(`section`,{className:Y9.generatePanel,"aria-labelledby":`generate-doc-heading`,children:[(0,M.jsxs)(`div`,{className:Y9.generatePanelHeader,children:[(0,M.jsx)(`h3`,{id:`generate-doc-heading`,className:Y9.generatePanelHeading,children:`Generate Documentation`}),(0,M.jsx)(`p`,{className:Y9.generatePanelSubtitle,children:`Use one shared generation action for the selected mode and choose what to include in output.`})]}),(0,M.jsxs)(`div`,{className:Y9.generatePanelActions,children:[re===`local`?(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:ht,disabled:!Dt,"aria-label":`Generate documentation for ${Te.length} queued file${Te.length===1?``:`s`}`,children:[`Generate Documentation (`,Te.length,`)`]}):(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:rt,disabled:!Ot,"aria-label":`Generate documentation for ${ye.length} selected Dataverse solution${ye.length===1?``:`s`}`,children:[`Generate Selected (`,ye.length,`)`]}),(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:p,onChange:dt}),(0,M.jsx)(`span`,{children:`Generate Diagrams`})]}),(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:h,onChange:ft}),(0,M.jsx)(`span`,{children:`Include Default Columns`})]})]}),(0,M.jsxs)(`details`,{className:Y9.optionDetails,open:!0,children:[(0,M.jsx)(`summary`,{children:`Documentation Options`}),(0,M.jsxs)(`fieldset`,{className:Y9.documentScope,children:[(0,M.jsx)(`legend`,{className:`sr-only`,children:`Documentation Options`}),[[`flows`,`Flows and automation`],[`apps`,`Power Apps`],[`security`,`Security roles and profiles`],[`integration`,`Integration and SharePoint`],[`plugins`,`Plug-ins and steps`],[`reports`,`Reports and dashboards`],[`webResources`,`Web resources`],[`modernArtifacts`,`Agents, AI, desktop flows, dataflows, APIs and offline profiles`]].map(([e,t])=>(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:_[e],onChange:()=>pt(e)}),(0,M.jsx)(`span`,{children:t})]},e))]})]}),(0,M.jsxs)(`details`,{className:Y9.optionDetails,children:[(0,M.jsx)(`summary`,{children:`Table Options`}),(0,M.jsxs)(`fieldset`,{className:Y9.documentScope,children:[(0,M.jsx)(`legend`,{className:`sr-only`,children:`Table Options`}),(0,M.jsxs)(`label`,{className:Y9.optionField,children:[`Attribute selection`,(0,M.jsxs)(`select`,{value:y.metadata.attributeSelectionMode,onChange:e=>mt({metadata:{attributeSelectionMode:e.target.value}}),children:[(0,M.jsx)(`option`,{value:`all`,children:`All attributes`}),(0,M.jsx)(`option`,{value:`custom-only`,children:`Custom only`}),(0,M.jsx)(`option`,{value:`attributes-on-form`,children:`Attributes on forms`}),(0,M.jsx)(`option`,{value:`attributes-not-on-form`,children:`Attributes not on forms`}),(0,M.jsx)(`option`,{value:`option-set-focused`,children:`Choice columns`}),(0,M.jsx)(`option`,{value:`unmanaged-only`,children:`Unmanaged only`})]})]}),(0,M.jsxs)(`label`,{className:Y9.optionField,children:[`Manual attributes`,(0,M.jsx)(`input`,{value:y.metadata.manualAttributes.join(`, `),onChange:e=>mt({metadata:{manualAttributes:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)}}),placeholder:`schema_name, schema_name`})]}),[`includeDefaultColumns`,`excludeVirtualAttributes`,`includeTypeColumn`,`includeRequiredLevelInfo`,`includeCustomColumn`,`includeAuditInfo`,`includeNotesColumn`,`includeDescriptionColumn`,`includeAdvancedFind`,`includeFieldSecurity`,`includeMetadataSource`].map(e=>(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:y.metadata[e],onChange:()=>mt({metadata:{[e]:!y.metadata[e]}})}),(0,M.jsx)(`span`,{children:e.replace(`include`,``).replace(/([A-Z])/g,` $1`).trim()})]},e))]})]}),(0,M.jsxs)(`details`,{className:Y9.optionDetails,children:[(0,M.jsx)(`summary`,{children:`Security Role Options`}),(0,M.jsxs)(`fieldset`,{className:Y9.documentScope,children:[(0,M.jsx)(`legend`,{className:`sr-only`,children:`Security Role Options`}),[`onlyTablesInCurrentSolution`,`onlyCustomTables`].map(e=>(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:y.securityRoleFilters[e],onChange:()=>mt({securityRoleFilters:{[e]:!y.securityRoleFilters[e]}})}),(0,M.jsx)(`span`,{children:e===`onlyTablesInCurrentSolution`?`Only tables in current solution`:`Only custom tables`})]},e))]})]}),(0,M.jsxs)(`details`,{className:Y9.optionDetails,children:[(0,M.jsx)(`summary`,{children:`Diagram Options`}),(0,M.jsxs)(`fieldset`,{className:Y9.documentScope,children:[(0,M.jsx)(`legend`,{className:`sr-only`,children:`Diagram Options`}),(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:y.separateDiagramsDocument,onChange:()=>mt({separateDiagramsDocument:!y.separateDiagramsDocument})}),(0,M.jsx)(`span`,{children:`Generate companion diagrams document`})]}),(0,M.jsxs)(`label`,{className:Y9.optionField,children:[`Mermaid diagram colours`,(0,M.jsxs)(`select`,{value:y.diagramColourTheme,onChange:e=>mt({diagramColourTheme:e.target.value}),children:[(0,M.jsx)(`option`,{value:`neutral`,children:`Neutral`}),(0,M.jsx)(`option`,{value:`default`,children:`Default`}),(0,M.jsx)(`option`,{value:`dark`,children:`Dark`}),(0,M.jsx)(`option`,{value:`forest`,children:`Forest`}),(0,M.jsx)(`option`,{value:`base`,children:`Base`})]})]})]})]}),(0,M.jsx)(`div`,{className:Y9.generateFooter,role:`region`,"aria-label":`Generate documentation`,children:re===`local`?(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:ht,disabled:!Dt,children:[`Generate Documentation (`,Te.length,`)`]}):(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:rt,disabled:!Ot,children:[`Generate Selected (`,ye.length,`)`]})})]}),re===`local`?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:Y9.dropZoneWrapper,children:(0,M.jsx)(V,{onFilesSelected:nt,disabled:o,onQueueChange:Ee,showGenerateButton:!1},De)}),(0,M.jsxs)(`section`,{className:Y9.featureGrid,"aria-labelledby":`features-heading`,children:[(0,M.jsx)(`h3`,{id:`features-heading`,className:`sr-only`,children:`Supported components`}),[{icon:`🗃️`,label:`Tables & Columns`},{icon:`📋`,label:`Forms & Views`},{icon:`⚙️`,label:`Power Automate Flows`},{icon:`🔄`,label:`Classic Workflows & BPFs`},{icon:`🎨`,label:`Canvas & Model Apps`},{icon:`🌐`,label:`Web Resources (JS/TS/HTML)`},{icon:`🔒`,label:`Security Roles & CLS`},{icon:`🔌`,label:`Plugins & Plugin Steps`},{icon:`🔗`,label:`Connection References`},{icon:`⚙️`,label:`Environment Variables`},{icon:`📊`,label:`Reports & Dashboards`},{icon:`📈`,label:`Mermaid Diagrams`}].map(({icon:e,label:t})=>(0,M.jsxs)(`div`,{className:Y9.featureCard,children:[(0,M.jsx)(`span`,{className:Y9.featureIcon,"aria-hidden":`true`,children:e}),(0,M.jsx)(`span`,{className:Y9.featureLabel,children:t})]},t))]})]}):(0,M.jsx)(ne,{solutions:Ft,publisherOptions:Pt,selectedPublishers:_e,selectedSolutionIds:ye,search:de,sort:pe,managedFilter:he,isLoading:ce,error:H,busySolutionIds:Ce,onSearchChange:fe,onSortChange:me,onManagedFilterChange:ge,onTogglePublisher:at,onSelectAllPublishers:ot,onClearPublishers:st,onToggleSolution:ct,onSelectAllVisibleSolutions:It,onClearSelectedSolutions:lt,onRefresh:()=>{Ze()}})]})}),o&&(0,M.jsxs)(`section`,{className:Y9.processingSection,"aria-labelledby":`processing-heading`,"aria-busy":`true`,children:[(0,M.jsx)(`h2`,{id:`processing-heading`,className:Y9.processingHeading,children:`Processing solutions…`}),(0,M.jsx)(`div`,{className:Y9.progressList,children:i.map(e=>(0,M.jsx)(`div`,{className:Y9.progressItem,children:e.error?(0,M.jsxs)(`div`,{role:`alert`,className:Y9.progressError,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`❌`}),` `,e.fileName,`: `,e.error]}):(0,M.jsx)(ie,{value:e.progress,label:e.fileName,showLabel:!0})},e.fileName))})]}),!o&&i.some(e=>e.error)&&(0,M.jsx)(`div`,{role:`alert`,className:Y9.errorSummary,children:i.filter(e=>e.error).map(e=>(0,M.jsxs)(`p`,{className:Y9.errorLine,children:[`❌ `,(0,M.jsx)(`strong`,{children:e.fileName}),`: `,e.error]},e.fileName))}),Et&&At&&!o&&(0,M.jsx)(`div`,{className:Y9.viewerWrapper,children:ee?(0,M.jsx)(`div`,{className:Y9.viewerLoadingState,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:(0,M.jsxs)(`div`,{className:Y9.viewerLoadingCard,children:[(0,M.jsx)(`span`,{className:Y9.viewerLoadingSpinner,"aria-hidden":`true`}),(0,M.jsx)(`p`,{className:Y9.viewerLoadingText,children:`Please Wait - rendering markdown document...`})]})}):(0,M.jsx)(AVt,{markdown:B&&At.diagramsMarkdown?At.diagramsMarkdown:At.markdown,title:B?`${At.solution.metadata.displayName||At.solution.metadata.uniqueName}: Diagrams`:At.solution.metadata.displayName||At.solution.metadata.uniqueName,onExport:vt,onExportHtml:yt,onExportExcel:bt,onExportPdf:xt,diagramColourTheme:y.diagramColourTheme})}),Et&&!o&&re&&(0,M.jsxs)(`details`,{className:Y9.addMoreDetails,children:[(0,M.jsx)(`summary`,{className:Y9.addMoreSummary,children:`+ Generate More Documentation`}),(0,M.jsxs)(`div`,{className:Y9.addMoreBody,children:[(0,M.jsxs)(`section`,{className:Y9.generatePanel,"aria-labelledby":`generate-more-heading`,children:[(0,M.jsxs)(`div`,{className:Y9.generatePanelHeader,children:[(0,M.jsx)(`h3`,{id:`generate-more-heading`,className:Y9.generatePanelHeading,children:`Generate More Documentation`}),(0,M.jsx)(`p`,{className:Y9.generatePanelSubtitle,children:`Apply generation settings and create additional documents from your current mode.`})]}),(0,M.jsxs)(`div`,{className:Y9.generatePanelActions,children:[re===`local`?(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:ht,disabled:!Dt,children:[`Generate Documentation (`,Te.length,`)`]}):(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:rt,disabled:!Ot,children:[`Generate Selected (`,ye.length,`)`]}),(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:p,onChange:dt}),(0,M.jsx)(`span`,{children:`Generate Diagrams`})]}),(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:h,onChange:ft}),(0,M.jsx)(`span`,{children:`Include Default Columns`})]})]})]}),re===`local`&&(0,M.jsxs)(`div`,{className:Y9.addMoreSubsection,children:[(0,M.jsx)(`h4`,{className:Y9.addMoreSubheading,children:`Add More Solution Files`}),(0,M.jsx)(V,{onFilesSelected:nt,disabled:o,onQueueChange:Ee,showGenerateButton:!1},`add-more-${De}`)]}),re===`dataverse`&&(0,M.jsxs)(`div`,{className:Y9.addMoreSubsection,children:[(0,M.jsx)(`h4`,{className:Y9.addMoreSubheading,children:`Add More Solutions from Dataverse`}),(0,M.jsx)(ne,{solutions:Ft,publisherOptions:Pt,selectedPublishers:_e,selectedSolutionIds:ye,search:de,sort:pe,managedFilter:he,isLoading:ce,error:H,busySolutionIds:Ce,onSearchChange:fe,onSortChange:me,onManagedFilterChange:ge,onTogglePublisher:at,onSelectAllPublishers:ot,onClearPublishers:st,onToggleSolution:ct,onSelectAllVisibleSolutions:It,onClearSelectedSolutions:lt,onRefresh:()=>{Ze()}})]})]})]})]})]}),ke&&(0,M.jsx)(`div`,{className:Y9.modalBackdrop,role:`presentation`,children:(0,M.jsxs)(`div`,{className:Y9.modalDialog,role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`invalid-archive-title`,"aria-describedby":`invalid-archive-body`,children:[(0,M.jsx)(`h2`,{id:`invalid-archive-title`,className:Y9.modalTitle,children:`Invalid ZIP Archive`}),(0,M.jsx)(`p`,{id:`invalid-archive-body`,className:Y9.modalBody,children:ke}),(0,M.jsx)(`button`,{ref:Ie,type:`button`,className:Y9.modalOkBtn,onClick:()=>Ae(null),children:`OK`})]})}),(0,M.jsxs)(`footer`,{className:Y9.footer,role:`contentinfo`,children:[(0,M.jsxs)(`div`,{className:Y9.footerLeft,children:[(0,M.jsx)(`span`,{children:`PP-MD - PPTB Edition: Power Platform Documentation Generator.`}),(0,M.jsxs)(`span`,{className:Y9.footerVersion,children:[`Version `,Ge]}),(0,M.jsxs)(`a`,{href:W4t,target:`_blank`,rel:`noreferrer`,className:Y9.iconLink,onMouseDown:ze,onClick:Be,children:[(0,M.jsx)(`img`,{src:z4t,className:Y9.linkIcon,alt:``,"aria-hidden":`true`}),(0,M.jsx)(`span`,{children:`GitHub Repo`})]})]}),(0,M.jsx)(`div`,{className:Y9.footerRight,children:(0,M.jsx)(`span`,{children:re===`dataverse`?`PP-MD - PPTB Edition reads solution metadata from the active Dataverse environment through Power Platform ToolBox. No information is uploaded to the environment and only solution data is retrieved in read-only mode.`:`All local ZIP processing happens on your PC; your solution data never leaves your machine.`})})]})]})}var s3t=document.getElementById(`root`);if(!s3t)throw Error(`PP-MD - PPTB Edition: Could not find #root element. Ensure index.html contains <div id="root"></div>.`);(0,S.createRoot)(s3t).render((0,M.jsx)(x.StrictMode,{children:(0,M.jsx)(I,{children:(0,M.jsx)(o3t,{})})}));
4235
+ `)){if(t===``){o.push(``);continue}let n=t;for(;e.pdf.getTextWidth(n)>i;){let t=n.length;for(;t>1&&e.pdf.getTextWidth(n.slice(0,t))>i;)--t;let r=n.lastIndexOf(` `,t),a=r>10?r:t;o.push(n.slice(0,a)),n=n.slice(a).replace(/^ /,``)}o.push(n)}let s=0;for(;s<o.length;){K9(e,23.475);let t=Math.max(1,Math.floor((e.pageHeight-e.marginBottom-e.y-12)/r)),i=o.slice(s,s+t),a=i.length*r+12;e.pdf.setFillColor(244,244,248),e.pdf.setDrawColor(208,211,219),e.pdf.rect(e.x0,e.y,e.xw,a,`FD`),e.pdf.setFont(`courier`,`normal`),e.pdf.setFontSize(n),e.pdf.setTextColor(26,26,46);let l=e.y+6+n*.8;for(let t of i)e.pdf.text(t||` `,e.x0+6,l),l+=r;e.y+=a+2,s+=i.length}e.y+=6}function T4t(e,t){let n=t.match(/%%\s*(.+?)\s*%%/)?.[1]??`Diagram`,r=e.diagramImages[e.diagramIndex]??null;if(e.diagramIndex+=1,K9(e,20),e.pdf.setFont(`helvetica`,`italic`),e.pdf.setFontSize(9.5),e.pdf.setTextColor(90,94,108),e.pdf.text(V9(`Diagram: ${n}`),e.x0,e.y),e.y+=14,!r){w4t(e,{lang:`text`,value:`[Diagram could not be rendered for export]\n\n${t}`});return}try{let t=e.pdf.getImageProperties(r),n=e.xw,i=t.height/t.width*n,a=e.pageHeight-e.marginTop-e.marginBottom;i>a&&(i=a,n=t.width/t.height*i),K9(e,i);let o=e.x0+(e.xw-n)/2;e.pdf.addImage(r,`PNG`,o,e.y,n,i,void 0,`FAST`),e.y+=i+10}catch{w4t(e,{lang:`text`,value:t})}}function q9(e,t,n,r,i,a,o,s,l){l&&(e.pdf.setFillColor(240,242,245),e.pdf.rect(e.x0,e.y,e.xw,i,`F`));let u=e.x0;for(let l=0;l<n;l+=1){e.pdf.setDrawColor(193,196,206),e.pdf.rect(u,e.y,r,i,`S`);let n=e.y+s+a*.72;for(let r of t[l]??[]){let t=u+s;for(let i of r)W9(e.pdf,i.style),e.pdf.setFontSize(a),e.pdf.setTextColor(26,26,46),e.pdf.text(i.text,t,n),t+=e.pdf.getTextWidth(i.text);n+=o}u+=r}e.y+=i}async function E4t(e,t){let n=t.children;if(!n.length)return;let r=n[0].children.length;if(r===0)return;let i=9.5,a=i*1.3,o=e.xw/r,s=(t,n)=>t.map(t=>{let r=U9(H9(t.children,n?{bold:!0}:{}));return G9(e.pdf,r,o-10,i)}),l=s(n[0].children,!0),u=Math.max(...l.map(e=>e.length),1)*a+10;K9(e,u+a+10),q9(e,l,r,o,u,i,a,5,!0);for(let t=1;t<n.length;t+=1){let d=s(n[t].children,!1),f=Math.max(...d.map(e=>e.length),1)*a+10;e.y+f>e.pageHeight-e.marginBottom&&(e.pdf.addPage(),e.y=e.marginTop,q9(e,l,r,o,u,i,a,5,!0)),q9(e,d,r,o,f,i,a,5,!1),t%40==0&&await _4t()}e.y+=8}function D4t(e,t){let n=[...t.matchAll(/<tr>([\s\S]*?)<\/tr>/gi)].map(e=>[...e[1].matchAll(/<td>([\s\S]*?)<\/td>/gi)].map(e=>V9(h4t(e[1]).trim()))).filter(e=>e.some(e=>e.length>0));if(!n.length)return;let r=Math.max(...n.map(e=>e.length)),i=e.xw/r;for(let t of n){let n=Array.from({length:r},(n,r)=>{let a=U9([{text:t[r]??``,style:{bold:r===0}}]);return G9(e.pdf,a,i-10,10)}),a=Math.max(...n.map(e=>e.length),1)*13+10;K9(e,a),q9(e,n,r,i,a,10,13,5,!1)}e.y+=8}async function O4t(e,t,n){switch(t.type){case`heading`:y4t(e,t);break;case`paragraph`:b4t(e,t,n);break;case`list`:await S4t(e,t);break;case`table`:await E4t(e,t);break;case`code`:w4t(e,t);break;case`blockquote`:await C4t(e,t);break;case`thematicBreak`:x4t(e);break;case`html`:{let n=t.value??``;/<table/i.test(n)&&D4t(e,n);break}}}function k4t(e){return Ao().use(Vi).use(Xl).parse(e)}function A4t(e,t){let n=e.x0+e.xw/2;e.pdf.setFont(`helvetica`,`bold`),e.pdf.setFontSize(26),e.pdf.setTextColor(26,26,46);let r=e.pdf.splitTextToSize(V9(t),e.xw),i=e.pageHeight/2-r.length*32/2;for(let t of r)e.pdf.text(t,n,i,{align:`center`}),i+=32;e.pdf.setFont(`helvetica`,`normal`),e.pdf.setFontSize(11),e.pdf.setTextColor(90,94,108),e.pdf.text(`Power Platform solution documentation`,n,i+12,{align:`center`}),e.pdf.text(`Generated ${new Date().toLocaleString()}`,n,i+30,{align:`center`})}function j4t(e,t){let n=e.getNumberOfPages(),r=e.internal.pageSize.getWidth(),i=e.internal.pageSize.getHeight();for(let a=2;a<=n;a+=1)e.setPage(a),e.setFont(`helvetica`,`normal`),e.setFontSize(8.5),e.setTextColor(140,143,156),e.text(V9(t),46,i-24),e.text(`Page ${a-1} of ${n-1}`,r-46,i-24,{align:`right`})}async function M4t(e,t,n=[]){let r=k4t(e),i=new c9({orientation:`portrait`,unit:`pt`,format:`a4`,compress:!0});i.setProperties({title:t,subject:`Power Platform solution documentation`});let a=i.internal.pageSize.getWidth(),o=i.internal.pageSize.getHeight(),s={pdf:i,x0:46,xw:a-92,y:54,pageHeight:o,marginTop:54,marginBottom:50,diagramImages:n,diagramIndex:0};A4t(s,t||`PP-MD Documentation`),i.addPage(),s.y=54;let l=0;for(let e of r.children)await O4t(s,e),l+=1,l%15==0&&await _4t();return j4t(i,t||`PP-MD Documentation`),i.output(`blob`)}async function N4t(e,t){await A(e,t.endsWith(`.md`)?t:`${t}.md`,`text/markdown`)}async function P4t(e,t){await A(e,t.endsWith(`.zip`)?t:`${t}.zip`,`application/zip`)}async function F4t(e,t){await A(e,t.endsWith(`.html`)?t:`${t}.html`,`text/html`)}async function I4t(e,t){let n=t.endsWith(`.xlsx`)?t:`${t}.xlsx`;await A(ZGt(e),n,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`)}async function L4t(e,t,n,r=[]){let i=n.endsWith(`.pdf`)?n:`${n}.pdf`;await A(await M4t(e,t,r),i,`application/pdf`)}var R4t=``+new URL(`pp-md-icon-Dgg8-GAC.svg`,import.meta.url).href,z4t=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%20aria-hidden='true'%3e%3cpath%20d='M12%20.5C5.65.5.5%205.65.5%2012c0%205.1%203.3%209.42%207.88%2010.95.58.1.8-.25.8-.56%200-.28-.01-1.2-.02-2.17-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7%201.16.08%201.77%201.19%201.77%201.19%201.02%201.76%202.68%201.25%203.33.96.1-.74.4-1.25.72-1.53-2.55-.29-5.22-1.27-5.22-5.66%200-1.25.45-2.28%201.18-3.08-.12-.3-.51-1.5.11-3.13%200%200%20.96-.3%203.15%201.17a10.9%2010.9%200%200%201%205.74%200c2.18-1.48%203.14-1.17%203.14-1.17.62%201.63.24%202.83.12%203.13.74.8%201.18%201.83%201.18%203.08%200%204.4-2.68%205.37-5.24%205.66.41.35.78%201.03.78%202.08%200%201.5-.01%202.72-.01%203.09%200%20.31.21.67.8.56A11.52%2011.52%200%200%200%2023.5%2012C23.5%205.65%2018.35.5%2012%20.5Z'/%3e%3c/svg%3e`,J9={name:`@hart365/pp-md-pptb-edition`,version:`1.1.6`,displayName:`PP-MD Power Platform Markdown Document Generator`,description:`Generate Power Platform documentation from either Solution ZIP files or direct Dataverse connection`,author:`Mike Hartley`,contributors:[{name:`Mike Hartley`,url:`https://HartOfTheMidlands.co.uk`}],type:`module`,main:`index.html`,icon:`icons/pp-md.svg`,configurations:{repository:`https://github.com/Hart365/pp-md-pptb-edition`,readmeUrl:`https://raw.githubusercontent.com/Hart365/pp-md-pptb-edition/refs/heads/main/README.md`,website:`https://github.com/Hart365/pp-md-pptb-edition`},cspExceptions:{"connect-src":[{domain:`api.github.com`,exceptionReason:`Optionally checks GitHub Releases when the user requests an update check.`,optional:!0}]},features:{multiConnection:`none`,connectionRequirement:`optional`,minAPI:`1.2.2`},files:[`dist`,`LICENSE`,`README.md`],scripts:{dev:`vite`,build:`tsc && vite build && node scripts/normalize-dist-assets.mjs`,"build:with-maps":`tsc && vite build --mode debug && node scripts/normalize-dist-assets.mjs`,preview:`vite preview`,validate:`node node_modules/@pptb/validate/dist/cli.js`,"validate:offline":`node scripts/validate-offline.cjs`,"validate:dist":`node scripts/validate-dist.cjs`,"validate:publish":`npm run validate:offline && npm run build && npm run validate:dist && npm pack --dry-run`,"test:contrast":`node scripts/check-contrast.mjs`,lint:`eslint src --report-unused-disable-directives --max-warnings 0`,format:`eslint src --fix`,"type-check":`tsc --noEmit`,"test:unit":`vitest run`,test:`npm run validate:offline && npm run lint && npm run type-check && npm run test:unit && npm run test:contrast && npm run build && npm run validate:dist`,"finalize-package":`npm run validate:publish`},dependencies:{dompurify:`^3.4.15`,"fast-xml-parser":`^5.11.1`,jspdf:`4.2.1`,jszip:`^3.10.1`,mermaid:`^11.17.2`,react:`^19.2.8`,"react-dom":`^19.2.8`,"react-markdown":`^10.1.0`,"rehype-raw":`^7.0.0`,"rehype-sanitize":`^6.0.0`,"remark-gfm":`^4.0.1`,"remark-parse":`^11.0.0`,unified:`^11.0.5`,"xlsx-js-style":`1.2.0`},devDependencies:{"@eslint/js":`^10.0.1`,"@pptb/types":`^1.2.5`,"@pptb/validate":`1.0.2`,"@types/mdast":`^4.0.4`,"@types/react":`^19.2.18`,"@types/react-dom":`^19.2.7`,"@vitejs/plugin-react":`^6.1.1`,eslint:`^10.10.0`,"eslint-plugin-react-hooks":`^7.1.1`,globals:`^17.12.0`,typescript:`^6.0.3`,"typescript-eslint":`^8.69.0`,vite:`^8.2.2`,vitest:`^5.0.0`},overrides:{katex:`0.18.2`},repository:{type:`git`,url:`https://github.com/Hart365/pp-md-pptb-edition.git`},homepage:`https://github.com/Hart365/pp-md-pptb-edition#readme`,bugs:{url:`https://github.com/Hart365/pp-md-pptb-edition/issues`},keywords:[`powerplatform`,`documentation`,`dataverse`,`solution`,`markdown`],license:`MIT`},Y9={appRoot:`_appRoot_ap0ia_17`,skipLink:`_skipLink_ap0ia_43`,header:`_header_ap0ia_87`,headerInner:`_headerInner_ap0ia_107`,headerLeft:`_headerLeft_ap0ia_127`,headerCenter:`_headerCenter_ap0ia_143`,headerRight:`_headerRight_ap0ia_151`,brand:`_brand_ap0ia_161`,brandCopy:`_brandCopy_ap0ia_177`,brandIcon:`_brandIcon_ap0ia_189`,brandName:`_brandName_ap0ia_203`,brandTagline:`_brandTagline_ap0ia_221`,connectionText:`_connectionText_ap0ia_235`,headerActions:`_headerActions_ap0ia_251`,menuToggle:`_menuToggle_ap0ia_267`,headerGroup:`_headerGroup_ap0ia_295`,headerExportGroup:`_headerExportGroup_ap0ia_317`,headerBtn:`_headerBtn_ap0ia_325`,headerBtnActive:`_headerBtnActive_ap0ia_371`,headerExportMenu:`_headerExportMenu_ap0ia_381`,headerExportLabel:`_headerExportLabel_ap0ia_419`,headerDropdownArrow:`_headerDropdownArrow_ap0ia_421`,headerExportPanel:`_headerExportPanel_ap0ia_433`,menuBtn:`_menuBtn_ap0ia_473`,statusRegion:`_statusRegion_ap0ia_511`,body:`_body_ap0ia_535`,main:`_main_ap0ia_555`,mainWithViewer:`_mainWithViewer_ap0ia_577`,welcomeSection:`_welcomeSection_ap0ia_601`,welcomeHeading:`_welcomeHeading_ap0ia_619`,welcomeSubtitle:`_welcomeSubtitle_ap0ia_633`,modeVersion:`_modeVersion_ap0ia_647`,dropZoneWrapper:`_dropZoneWrapper_ap0ia_659`,modeGrid:`_modeGrid_ap0ia_667`,modeCard:`_modeCard_ap0ia_679`,modeCardTitle:`_modeCardTitle_ap0ia_719`,modeCardBody:`_modeCardBody_ap0ia_729`,modeBranding:`_modeBranding_ap0ia_739`,modeBrandIcon:`_modeBrandIcon_ap0ia_759`,modeBrandTitle:`_modeBrandTitle_ap0ia_769`,modeBrandByline:`_modeBrandByline_ap0ia_783`,modeBrandLinks:`_modeBrandLinks_ap0ia_793`,modeCallout:`_modeCallout_ap0ia_827`,modeActions:`_modeActions_ap0ia_847`,contextPanel:`_contextPanel_ap0ia_859`,contextHeading:`_contextHeading_ap0ia_879`,contextRow:`_contextRow_ap0ia_889`,contextSelectRow:`_contextSelectRow_ap0ia_901`,contextLabel:`_contextLabel_ap0ia_913`,contextSelect:`_contextSelect_ap0ia_901`,contextDeleteBtn:`_contextDeleteBtn_ap0ia_945`,contextWarning:`_contextWarning_ap0ia_989`,contextSaveRow:`_contextSaveRow_ap0ia_1005`,contextNameInput:`_contextNameInput_ap0ia_1017`,contextSaveBtn:`_contextSaveBtn_ap0ia_1039`,contextGrid:`_contextGrid_ap0ia_1063`,contextField:`_contextField_ap0ia_1075`,generatePanel:`_generatePanel_ap0ia_1109`,generatePanelHeader:`_generatePanelHeader_ap0ia_1129`,generatePanelHeading:`_generatePanelHeading_ap0ia_1141`,generatePanelSubtitle:`_generatePanelSubtitle_ap0ia_1151`,generatePanelActions:`_generatePanelActions_ap0ia_1163`,generatePrimaryBtn:`_generatePrimaryBtn_ap0ia_1177`,generateToggle:`_generateToggle_ap0ia_1221`,documentScope:`_documentScope_ap0ia_1249`,optionDetails:`_optionDetails_ap0ia_1271`,generateFooter:`_generateFooter_ap0ia_1315`,optionField:`_optionField_ap0ia_1351`,logoGrid:`_logoGrid_ap0ia_1399`,logoCard:`_logoCard_ap0ia_1411`,logoTitle:`_logoTitle_ap0ia_1429`,logoPreview:`_logoPreview_ap0ia_1441`,logoActions:`_logoActions_ap0ia_1459`,logoUploadBtn:`_logoUploadBtn_ap0ia_1469`,logoClearBtn:`_logoClearBtn_ap0ia_1471`,hiddenInput:`_hiddenInput_ap0ia_1509`,featureGrid:`_featureGrid_ap0ia_1519`,featureCard:`_featureCard_ap0ia_1531`,featureIcon:`_featureIcon_ap0ia_1555`,featureLabel:`_featureLabel_ap0ia_1567`,processingSection:`_processingSection_ap0ia_1581`,processingHeading:`_processingHeading_ap0ia_1599`,progressList:`_progressList_ap0ia_1611`,progressItem:`_progressItem_ap0ia_1623`,progressError:`_progressError_ap0ia_1631`,errorSummary:`_errorSummary_ap0ia_1653`,errorLine:`_errorLine_ap0ia_1675`,viewerWrapper:`_viewerWrapper_ap0ia_1691`,viewerLoadingState:`_viewerLoadingState_ap0ia_1711`,viewerLoadingCard:`_viewerLoadingCard_ap0ia_1733`,viewerLoadingSpinner:`_viewerLoadingSpinner_ap0ia_1755`,viewerSpin:`_viewerSpin_ap0ia_1`,viewerLoadingText:`_viewerLoadingText_ap0ia_1773`,addMoreDetails:`_addMoreDetails_ap0ia_1805`,addMoreSummary:`_addMoreSummary_ap0ia_1817`,addMoreBody:`_addMoreBody_ap0ia_1847`,addMoreSubsection:`_addMoreSubsection_ap0ia_1863`,addMoreSubheading:`_addMoreSubheading_ap0ia_1879`,modalBackdrop:`_modalBackdrop_ap0ia_1891`,modalDialog:`_modalDialog_ap0ia_1911`,modalTitle:`_modalTitle_ap0ia_1935`,modalBody:`_modalBody_ap0ia_1947`,modalOkBtn:`_modalOkBtn_ap0ia_1959`,footer:`_footer_ap0ia_2007`,footerLeft:`_footerLeft_ap0ia_2033`,footerRight:`_footerRight_ap0ia_2049`,footerVersion:`_footerVersion_ap0ia_2061`,iconLink:`_iconLink_ap0ia_2069`,linkIcon:`_linkIcon_ap0ia_2093`,headerMenuOpen:`_headerMenuOpen_ap0ia_2195`},X9=`pp-md-pptb-edition-doc-configurations`,Z9=`pp-md-pptb-edition-hidden-doc-configuration-ids`,B4t=`pp-md-pptb-edition-dataverse-collection-policy`,V4t=`solutionOnly`,H4t={client:``,project:``,contract:``,sow:``,sprint:``,releaseDate:``},U4t=J9.version,W4t=J9.configurations?.repository||(typeof J9.repository==`string`?J9.repository:J9.repository?.url?.replace(/^git\+/,``).replace(/\.git$/,``))||`https://github.com`,G4t=`https://HartOfTheMidlands.co.uk`;function Q9(e,t){return(e||t).trim().replace(/[^\w\s.-]/g,``).replace(/\s+/g,`_`)}function K4t(e){return(e.metadata.displayName||e.metadata.uniqueName||``).trim()}function q4t(e){return[...e].sort((e,t)=>K4t(e.solution).localeCompare(K4t(t.solution),void 0,{numeric:!0,sensitivity:`base`}))}function J4t(e){return[...e].sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`}))}function Y4t(e){return{peerGapFillApplied:e.peerGapFillApplied,dataverseMetadataEnriched:e.dataverseMetadataEnriched}}function X4t(e){return/invalid|zip|archive|solution\.xml|central directory/i.test(e)}async function Z4t(){if(C()){let e=await E(X9);return Array.isArray(e)?e.filter(e=>!!e?.id&&!!e?.name):[]}try{let e=localStorage.getItem(X9);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`object`&&!!e).map(e=>e).filter(e=>!!e.id&&!!e.name):[]}catch{return[]}}async function Q4t(e){if(C()){await D(X9,e);return}try{localStorage.setItem(X9,JSON.stringify(e))}catch{}}async function $4t(){if(C()){let e=await E(Z9);return Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.trim().length>0):[]}try{let e=localStorage.getItem(Z9);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0):[]}catch{return[]}}async function e3t(e){if(C()){await D(Z9,e);return}try{localStorage.setItem(Z9,JSON.stringify(e))}catch{}}function t3t(e,t,n){let r=EWt(e.map(e=>e.solution)),i={peerGapFillApplied:e.some(e=>e.peerGapFillApplied),dataverseMetadataEnriched:e.some(e=>e.dataverseMetadataEnriched)},a=x6(r,{erdMode:t.erdMode,documentContext:n,enrichmentIndicators:i,includeDiagrams:t.includeDiagrams,includeDefaultColumns:t.includeDefaultColumns,scope:t.scope,documentationSettings:t.documentationSettings}),o=t.includeDiagrams?tGt(a,`All Selected Solutions: Diagrams`):void 0;return{solution:r,markdown:t.includeDiagrams?x6(r,{erdMode:t.erdMode,documentContext:n,enrichmentIndicators:i,includeDiagrams:!1,includeDefaultColumns:t.includeDefaultColumns,scope:t.scope,documentationSettings:t.documentationSettings}):a,fileName:`all-selected-solutions.md`,isConsolidated:!0,diagramsMarkdown:o,peerGapFillApplied:i.peerGapFillApplied,dataverseMetadataEnriched:i.dataverseMetadataEnriched}}function n3t(e,t,n,r){let i=x6(e,{erdMode:t.erdMode,documentContext:n,enrichmentIndicators:r,includeDiagrams:t.includeDiagrams,includeDefaultColumns:t.includeDefaultColumns,scope:t.scope,documentationSettings:t.documentationSettings}),a=t.includeDiagrams&&(t.documentationSettings.separateDiagramsDocument||a3t(i)),o=a?tGt(i,`${e.metadata.displayName||e.metadata.uniqueName}: Diagrams`):void 0;return{markdown:a?x6(e,{erdMode:t.erdMode,documentContext:n,enrichmentIndicators:r,includeDiagrams:!1,includeDefaultColumns:t.includeDefaultColumns,scope:t.scope,documentationSettings:t.documentationSettings}):i,diagramsMarkdown:o||void 0}}function r3t(e,t,n){let r=q4t(e.filter(e=>!e.isConsolidated)).map((e,r,i)=>{let a=i.filter((e,t)=>t!==r).map(e=>e.solution),o=OWt(e.solution,a),s=n3t(o,t,n,Y4t({peerGapFillApplied:a.length>0,dataverseMetadataEnriched:e.dataverseMetadataEnriched}));return{...e,solution:o,peerGapFillApplied:a.length>0,markdown:s.markdown,diagramsMarkdown:s.diagramsMarkdown}});return r.length>1?[...r,t3t(r,t,n)]:r}function i3t(e){for(let t=e.length-1;t>=0;--t)if(!e[t].isConsolidated)return t;return 0}function $9(e,t,n){return r3t(e.filter(e=>!e.isConsolidated),t,n)}function a3t(e){let t=(e.match(/^#{2,6}\s+/gm)??[]).length,n=(e.match(/^\|.*\|\s*$/gm)??[]).length,r=(e.match(/```mermaid/g)??[]).length;return e.length>=45e3||t>=80||n>=250||r>=6}function o3t(){let[e,t]=(0,x.useState)([]),[n,r]=(0,x.useState)(0),[i,a]=(0,x.useState)([]),[o,s]=(0,x.useState)(!1),[l,u]=(0,x.useState)(``),[d,f]=(0,x.useState)(`detailed-relationships`),[p,m]=(0,x.useState)(!0),[h,g]=(0,x.useState)(!0),[_,v]=(0,x.useState)(oWt),[y,b]=(0,x.useState)(e6),[S,T]=(0,x.useState)(H4t),[O,A]=(0,x.useState)([]),[j,N]=(0,x.useState)(`custom`),[P,F]=(0,x.useState)(``),[I,R]=(0,x.useState)(``),[ee,z]=(0,x.useState)(!1),[B,te]=(0,x.useState)(!1),[re,ae]=(0,x.useState)(null),[oe,se]=(0,x.useState)([]),[ce,le]=(0,x.useState)(!1),[H,ue]=(0,x.useState)(``),[de,fe]=(0,x.useState)(``),[pe,me]=(0,x.useState)(`name-asc`),[he,ge]=(0,x.useState)(`all`),[_e,ve]=(0,x.useState)([]),[ye,be]=(0,x.useState)([]),[xe,Se]=(0,x.useState)(V4t),[Ce,we]=(0,x.useState)([]),[Te,Ee]=(0,x.useState)([]),[De,Oe]=(0,x.useState)(0),[ke,Ae]=(0,x.useState)(null),[je,Me]=(0,x.useState)(!1),[Ne,Pe]=(0,x.useState)(!1),Fe=(0,x.useRef)(null),Ie=(0,x.useRef)(null),Le=(0,x.useRef)(null),Re=(0,x.useMemo)(()=>({erdMode:d,includeDiagrams:p,includeDefaultColumns:h,scope:_,documentationSettings:y}),[d,p,h,_,y]),ze=(0,x.useCallback)(e=>{e.currentTarget.dataset.ppmdArmed=`true`},[]),Be=(0,x.useCallback)(e=>{let t=e.currentTarget,n=t.dataset.ppmdArmed===`true`,r=t.href;if(delete t.dataset.ppmdArmed,e.detail!==0&&!n){e.preventDefault(),e.stopPropagation();return}C()&&(e.preventDefault(),k(r))},[]),{connection:Ve,isLoading:He,isInPPTB:Ue,initializeConnection:We}=WGt({autoInitConnection:!1}),Ge=window.__PPMD_VERSION__||U4t;(0,x.useEffect)(()=>{if(!Ue)return;let e=window.setTimeout(()=>{We()},0);return()=>{window.clearTimeout(e)}},[Ue,We]),(0,x.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await E(B4t);if(!e)return;(t===`solutionOnly`||t===`solutionAndDirectReferences`||t===`environmentAppendix`)&&Se(t)}catch{}})(),()=>{e=!1}},[]),(0,x.useEffect)(()=>{D(B4t,xe)},[xe]),(0,x.useEffect)(()=>{let e=!0;return(async()=>{let t=await Z4t(),n=new Set(await $4t());try{let r=await fetch(`./doc-configurations.json`,{cache:`no-store`});if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.json();if(!Array.isArray(i.configurations))throw Error(`Invalid configuration shape`);if(!e)return;A([...i.configurations,...t].filter(e=>!n.has(e.id))),F(``)}catch(r){if(!e)return;A(t.filter(e=>!n.has(e.id))),F(`Could not load doc-configurations.json: ${r.message}`)}})(),()=>{e=!1}},[]),(0,x.useEffect)(()=>{ke&&Ie.current?.focus()},[ke]);let Ke=(0,x.useCallback)(e=>{let n={client:e.client??``,project:e.project??``,contract:e.contract??``,sow:e.sow??``,sprint:e.sprint??``,releaseDate:e.releaseDate??``};T({client:n.client,project:n.project,contract:n.contract,sow:n.sow,sprint:n.sprint,releaseDate:n.releaseDate}),t(e=>$9(e,Re,n))},[Re]),qe=(0,x.useCallback)(e=>{let t=e.target.value;if(N(t),t===`custom`)return;let n=O.find(e=>e.id===t);n&&(Ke(n),R(n.name))},[O,Ke]),Je=(0,x.useCallback)((e,n)=>{let r={...S,[e]:n};N(`custom`),T(r),t(e=>$9(e,Re,r))},[S,Re]),Ye=(0,x.useCallback)(async()=>{let e=I.trim();if(!e){u(`Please enter a configuration name before saving.`);return}let t=`local-${Date.now()}`,n={id:t,name:e,client:S.client,project:S.project,contract:S.contract,sow:S.sow,sprint:S.sprint,releaseDate:S.releaseDate};await Q4t([...(await Z4t()).filter(t=>t.name.toLowerCase()!==e.toLowerCase()),n]),A(t=>[...t.filter(t=>t.name.toLowerCase()!==e.toLowerCase()),n]),N(t),u(`Configuration "${e}" saved.`)},[I,S]),Xe=(0,x.useCallback)(async e=>{if(e===`custom`)return;let t=O.find(t=>t.id===e);t&&(await e3t(Array.from(new Set([...await $4t(),e]))),e.startsWith(`local-`)&&await Q4t((await Z4t()).filter(t=>t.id!==e)),A(t=>t.filter(t=>t.id!==e)),j===e&&(N(`custom`),R(``)),u(`Configuration "${t.name}" deleted.`))},[O,j]),Ze=(0,x.useCallback)(async()=>{let e=Ve??await We();if(!e){se([]),ue(`No active Dataverse connection is available. Open or activate a connection in Power Platform ToolBox, then refresh this list.`);return}le(!0),ue(``);try{let t=await BGt();se(t),u(`Loaded ${t.length} solution${t.length===1?``:`s`} from ${e.name}.`);let n=Array.from(new Set(t.map(e=>e.publisherName?.trim()).filter(e=>!!e))).sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}));ve(n),be([])}catch(e){let t=e instanceof Error?e.message:`Unable to read solutions from Dataverse.`;se([]),ve([]),be([]),ue(t),u(`Failed to load Dataverse solutions: ${t}`)}finally{le(!1)}},[Ve,We]),Qe=(0,x.useCallback)(e=>{ae(e),t([]),r(0),a([]),s(!1),ue(``),be([]),Ee([]),Oe(e=>e+1),u(e===`local`?`Local Solutions mode selected. Upload one or more solution ZIP files to continue.`:`Dataverse Connected mode selected. Choose a solution from the active environment to continue.`),e===`dataverse`&&Ze()},[Ze]),$e=(0,x.useCallback)(()=>{ae(null),t([]),r(0),a([]),s(!1),we([]),ve([]),be([]),Ee([]),Oe(e=>e+1),Ae(null),u(`Choose how you want to generate solution documentation.`)},[]),et=(0,x.useCallback)(async n=>{let i=n.target.files?.[0];if(n.target.value=``,i)try{let n=await i.text(),a=i.name.replace(/\.md$/i,``)||`Imported Markdown`,o={metadata:{uniqueName:a,displayName:a,version:``,publisherName:``,isManaged:!1},entities:[],optionSets:[],forms:[],views:[],processes:[],apps:[],webResources:[],securityRoles:[],fieldSecurityProfiles:[],connectionReferences:[],environmentVariables:[],emailTemplates:[],reports:[],dashboards:[],pluginAssemblies:[],warnings:[],agents:[],aiModels:[],desktopFlows:[],dataflows:[],customApis:[],offlineProfiles:[]};t(e=>[...e.filter(e=>!e.isConsolidated),{solution:o,markdown:n,fileName:i.name}]),r(e.filter(e=>!e.isConsolidated).length),u(`Opened ${i.name}.`)}catch{u(`Could not open ${i.name}.`)}},[e]),tt=(0,x.useCallback)((e,t)=>{a(n=>{if(!n[e])return n;let r=[...n];return r[e]=t(r[e]),r})},[]),nt=(0,x.useCallback)(async n=>{let i=J4t(n);s(!0),u(`Processing ${i.length} file${i.length>1?`s`:``}…`);let o=i.map(e=>({fileName:e.name,progress:0}));a(o);let l=[],f=[];for(let e=0;e<i.length;e++){let t=i[e];try{u(`Parsing ${t.name}…`);let n=await aWt(t,t=>{tt(e,e=>({...e,progress:t}))});u(`Generating documentation for ${t.name}…`);let r=x6(n,{erdMode:d,documentContext:S,includeDiagrams:p,includeDefaultColumns:h,scope:_,documentationSettings:y});l.push({solution:n,markdown:r,fileName:t.name}),tt(e,e=>({...e,progress:100}))}catch(n){let r=n.message??`Unknown error`;tt(e,e=>({...e,progress:0,error:r})),X4t(r)&&f.push(t.name)}}if(l.length>0){let n=r3t([...e.filter(e=>!e.isConsolidated),...l],Re,S);t(n),r(i3t(n));let a=l.length,o=i.length-a;u(o>0?`Done: ${a} document${a>1?`s`:``} generated, ${o} file${o>1?`s`:``} failed.`:`Done: ${a} document${a>1?`s`:``} generated successfully.`)}else u(`No documents generated. Check that the files are valid Power Platform solution ZIPs.`);s(!1),f.length>0&&Ae(f.length===1?`${f[0]} is not a valid Power Platform solution ZIP archive and was removed from the selection list.`:`${f.length} invalid ZIP archives were removed from the selection list.`),setTimeout(()=>a([]),1500)},[e,d,S,p,h,_,y,Re,tt]),rt=(0,x.useCallback)(async()=>{if(ye.length===0){ue(`Select at least one solution to generate documentation.`);return}let n=Ve??await We();if(!n){ue(`No active Dataverse connection is available. Open or activate a connection in Power Platform ToolBox and try again.`);return}let i=oe.filter(e=>ye.includes(e.solutionId));if(i.length===0){ue(`The selected solutions are no longer available. Refresh the list and try again.`);return}we(i.map(e=>e.solutionId)),s(!0),a(i.map(e=>({fileName:e.displayName,progress:0}))),u(`Reading ${i.length} solution${i.length===1?``:`s`} from ${n.name}...`);try{let n=[];for(let e=0;e<i.length;e+=1){let t=i[e],r=await HGt(t.solutionId,({message:t,percent:n})=>{u(t),tt(e,e=>({...e,progress:n}))},xe),a=x6(r,{erdMode:d,documentContext:S,includeDiagrams:p,includeDefaultColumns:h,scope:_,documentationSettings:y});n.push({solution:r,markdown:a,fileName:`${t.uniqueName}.dataverse`,dataverseMetadataEnriched:!1}),tt(e,e=>({...e,progress:100}))}let a=r3t(q4t([...e.filter(e=>!e.isConsolidated),...n]),Re,S);t(a),r(i3t(a)),u(`Documentation generated for ${n.length} Dataverse solution${n.length===1?``:`s`}.`),await w(`Documentation Ready`,`${n.length} Dataverse solution${n.length===1?``:`s`} documented.`,`success`,3e3)}catch(e){let t=e instanceof Error?e.message:`Unable to read the selected solution.`;a(e=>e.map(e=>({...e,error:t}))),u(`Failed to generate Dataverse documentation: ${t}`),await w(`Dataverse Read Failed`,t,`error`,4e3)}finally{we([]),s(!1),setTimeout(()=>a([]),1500)}},[Ve,oe,S,d,p,h,_,y,Re,We,e,ye,xe,tt]),it=(0,x.useCallback)(e=>{Se(e),u(`Dataverse collection policy set to ${e}.`)},[]),at=(0,x.useCallback)(e=>{ve(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),ot=(0,x.useCallback)(()=>{let e=Array.from(new Set(oe.map(e=>e.publisherName?.trim()).filter(e=>!!e))).sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}));ve(e)},[oe]),st=(0,x.useCallback)(()=>{ve([])},[]),ct=(0,x.useCallback)(e=>{be(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),lt=(0,x.useCallback)(()=>{be([])},[]),ut=(0,x.useCallback)(()=>{let e=d===`detailed-relationships`?`compact`:`detailed-relationships`,n={...Re,erdMode:e};t(e=>$9(e,n,S)),f(e),u(`ERD mode switched to ${e===`compact`?`Compact`:`Detailed-Relationships`}.`)},[d,S,Re]),dt=(0,x.useCallback)(()=>{let e=!p,n={...Re,includeDiagrams:e};m(e),t(e=>$9(e,n,S)),u(e?`Generate Diagrams enabled.`:`Generate Diagrams disabled. Diagram sections will be excluded.`)},[p,Re,S]),ft=(0,x.useCallback)(()=>{let e=!h,n={...Re,includeDefaultColumns:e};g(e),t(e=>$9(e,n,S)),u(e?`Include Default Columns enabled.`:`Include Default Columns disabled. Default/system columns will be excluded.`)},[h,Re,S]),pt=(0,x.useCallback)(e=>{v(n=>{let r={...n,[e]:!n[e]};return t(e=>$9(e,{...Re,scope:r},S)),r})},[S,Re]),mt=(0,x.useCallback)(e=>{b(n=>{let r={...n,...e,metadata:{...n.metadata,...e.metadata},securityRoleFilters:{...n.securityRoleFilters,...e.securityRoleFilters}};return t(e=>$9(e,{...Re,documentationSettings:r},S)),r})},[S,Re]),ht=(0,x.useCallback)(()=>{if(o||Te.length===0)return;let e=J4t(Te);Ee([]),Oe(e=>e+1),nt(e)},[o,Te,nt]),gt=(0,x.useCallback)(t=>{let n=e[t];if(n){if(te(!1),!a3t(n.markdown)){r(t),z(!1);return}z(!0),window.setTimeout(()=>{r(t),window.setTimeout(()=>{z(!1)},300)},50)}},[e]),_t=(0,x.useCallback)((t=n)=>{let i=e[t];i?.diagramsMarkdown&&(r(t),te(!0),z(a3t(i.diagramsMarkdown)),window.setTimeout(()=>z(!1),350))},[n,e]),vt=(0,x.useCallback)(async()=>{let t=e[n];if(!t)return;let r=B?t.diagramsMarkdown:t.markdown;if(!r)return;let i=Q9(t.solution.metadata.displayName||t.solution.metadata.uniqueName,`solution`);try{await N4t(r,B?`${i}-diagrams`:`${i}-documentation`),await w(`Export Successful`,`Markdown document exported successfully.`,`success`,3e3)}catch(e){console.error(`Export failed:`,e),await w(`Export Failed`,`Failed to export markdown document.`,`error`,3e3)}},[e,n,B]),yt=(0,x.useCallback)(async t=>{let r=e[n];if(!r)return;let i=Q9(r.solution.metadata.displayName||r.solution.metadata.uniqueName,`solution`);try{await F4t(t,B?`${i}-diagrams`:`${i}-documentation`),await w(`Export Successful`,`HTML document exported successfully.`,`success`,3e3)}catch(e){console.error(`HTML export failed:`,e),await w(`Export Failed`,`Failed to export HTML document.`,`error`,3e3)}},[e,n,B]),bt=(0,x.useCallback)(async()=>{let t=e[n];if(!t)return;let r=Q9(t.solution.metadata.displayName||t.solution.metadata.uniqueName,`solution`);try{await I4t(t.solution,B?`${r}-diagrams`:`${r}-documentation`),await w(`Export Successful`,`Excel workbook exported successfully.`,`success`,3e3)}catch(e){console.error(`Excel export failed:`,e),await w(`Export Failed`,`Failed to export Excel workbook.`,`error`,3e3)}},[e,n,B]),xt=(0,x.useCallback)(async(t,r,i)=>{if(!e[n])return;let a=Q9(r,`solution`);try{await L4t(t,r,`${a}-documentation`,i),await w(`Export Successful`,`PDF document exported successfully.`,`success`,3e3)}catch(e){console.error(`PDF export failed:`,e),await w(`Export Failed`,`Failed to export PDF document.`,`error`,3e3)}},[e,n]),St=(0,x.useCallback)(async()=>{let t=e[n];if(!t)return;let r=nGt(t.solution,{documentContext:S}),i=Q9(t.solution.metadata.displayName||t.solution.metadata.uniqueName,`solution`);try{await N4t(r,`${i}-dependency-report`),await w(`Export Successful`,`Dependency report exported successfully.`,`success`,3e3)}catch(e){console.error(`Dependency export failed:`,e),await w(`Export Failed`,`Failed to export dependency report.`,`error`,3e3)}},[e,n,S]),Ct=(0,x.useCallback)(async()=>{if(e.length!==0)try{let t=new L.default;e.forEach((e,n)=>{let r=e.isConsolidated?`consolidated`:`solution_${n+1}`,i=Q9(e.solution.metadata.displayName||e.solution.metadata.uniqueName,r),a=e.isConsolidated?`-summary.md`:`-documentation.md`;if(t.file(`${i}${a}`,e.markdown),e.diagramsMarkdown&&t.file(`${i}-diagrams.md`,e.diagramsMarkdown),je&&!e.isConsolidated){let n=nGt(e.solution,{documentContext:S});t.file(`${i}-dependency-report.md`,n)}}),await P4t(await t.generateAsync({type:`blob`}),`pp-md-pptb-edition-markdown-documents`),await w(`Export Successful`,je?`All markdown documents and dependency reports exported as ZIP.`:`All markdown documents exported as ZIP.`,`success`,3e3)}catch(e){console.error(`Export all failed:`,e),await w(`Export Failed`,`Failed to export markdown documents as ZIP.`,`error`,3e3)}},[e,je,S]),wt=(0,x.useCallback)(async()=>{if(e.length!==0)try{let t=new L.default;e.forEach((e,n)=>{let r=Q9(e.solution.metadata.displayName||e.solution.metadata.uniqueName,e.isConsolidated?`all-selected-solutions`:`solution_${n+1}`),i=t.folder(r),a=eGt(e.markdown);a.length===0?i?.file(`${r}-documentation.md`,e.markdown):a.forEach(e=>{i?.file(`${r}-${e.key}.md`,e.markdown)}),e.diagramsMarkdown&&i?.file(`${r}-diagrams.md`,e.diagramsMarkdown)}),await P4t(await t.generateAsync({type:`blob`}),`pp-md-pptb-edition-markdown-by-category`),await w(`Export Successful`,`Documentation exported as category-grouped ZIP.`,`success`,3e3)}catch(e){console.error(`Export by category failed:`,e),await w(`Export Failed`,`Failed to export category-grouped documentation.`,`error`,3e3)}},[e]),Tt=(0,x.useCallback)(()=>{t([]),r(0),a([]),Ee([]),Oe(e=>e+1),u(``)},[]),Et=e.length>0,Dt=re===`local`&&Te.length>0&&!o,Ot=re===`dataverse`&&ye.length>0&&Ce.length===0&&!o,kt=e.findIndex(e=>e.isConsolidated),At=e[n],jt=re===`local`&&!Et&&!o,Mt=re===null&&!Et&&!o,Nt=re===`dataverse`&&!Et&&!o,Pt=Array.from(new Set(oe.map(e=>e.publisherName?.trim()).filter(e=>!!e))).sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`})),Ft=oe.filter(e=>{if(he===`managed`&&!e.isManaged||he===`unmanaged`&&e.isManaged)return!1;if(_e.length>0){let t=e.publisherName?.trim()||``;if(!_e.includes(t))return!1}let t=de.trim().toLowerCase();return!t||e.displayName.toLowerCase().includes(t)||e.uniqueName.toLowerCase().includes(t)||e.version.toLowerCase().includes(t)||(e.publisherName?.toLowerCase().includes(t)??!1)}).sort((e,t)=>{switch(pe){case`name-desc`:return t.displayName.localeCompare(e.displayName,void 0,{sensitivity:`base`});case`version-asc`:return e.version.localeCompare(t.version,void 0,{sensitivity:`base`,numeric:!0});case`version-desc`:return t.version.localeCompare(e.version,void 0,{sensitivity:`base`,numeric:!0});default:return e.displayName.localeCompare(t.displayName,void 0,{sensitivity:`base`})}}),It=(0,x.useCallback)(()=>{be(Ft.map(e=>e.solutionId))},[Ft]);return(0,M.jsxs)(`div`,{className:Y9.appRoot,children:[(0,M.jsx)(`a`,{href:`#main-content`,className:Y9.skipLink,children:`Skip to main content`}),(0,M.jsx)(`input`,{ref:Le,type:`file`,accept:`text/markdown,.md`,className:`sr-only`,onChange:et}),(0,M.jsx)(`header`,{className:Y9.header,role:`banner`,children:(0,M.jsxs)(`div`,{className:Y9.headerInner,children:[(0,M.jsxs)(`div`,{className:Y9.headerLeft,children:[(0,M.jsxs)(`div`,{className:Y9.brand,children:[(0,M.jsx)(`img`,{src:R4t,className:Y9.brandIcon,alt:``,"aria-hidden":`true`}),(0,M.jsxs)(`div`,{className:Y9.brandCopy,children:[(0,M.jsx)(`h1`,{className:Y9.brandName,children:`PP-MD - PPTB Edition`}),(0,M.jsx)(`span`,{className:Y9.brandTagline,children:`Power Platform Documentation Generator`})]})]}),(0,M.jsx)(`span`,{className:Y9.connectionText,children:He?`Connecting to ToolBox...`:Ue?`Connected to: ${Ve?.name??`No active connection`}`:`Running outside ToolBox (local dev mode)`})]}),(0,M.jsxs)(`div`,{className:Y9.headerRight,children:[(0,M.jsx)(`button`,{type:`button`,className:Y9.menuToggle,onClick:()=>Pe(e=>!e),"aria-expanded":Ne,"aria-controls":`header-actions`,"aria-label":`Open toolbar menu`,children:(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`☰`})}),(0,M.jsxs)(`div`,{id:`header-actions`,className:`${Y9.headerActions} ${Ne?Y9.headerMenuOpen:``}`,children:[(0,M.jsxs)(`div`,{className:Y9.headerGroup,role:`group`,"aria-label":`Document tools`,children:[!o&&(0,M.jsx)(`button`,{type:`button`,className:Y9.headerBtn,onClick:()=>Le.current?.click(),children:`Open .MD`}),Et&&!o&&(0,M.jsx)(`button`,{type:`button`,className:Y9.headerBtn,onClick:ut,"aria-label":`Toggle ERD detail level`,children:d===`compact`?`ERD: Compact`:`ERD: Detailed`}),Et&&!o&&At?.diagramsMarkdown&&(0,M.jsx)(`button`,{type:`button`,className:`${Y9.headerBtn} ${B?Y9.headerBtnActive:``}`,onClick:()=>{B?te(!1):_t(n)},"aria-label":B?`View main documentation`:`View companion diagrams`,children:B?`Main Document`:`Companion Diagrams`})]}),(0,M.jsx)(`div`,{className:`${Y9.headerGroup} ${Y9.headerExportGroup}`,role:`group`,"aria-label":`Documentation exports`,children:Et&&!o&&(0,M.jsxs)(`details`,{ref:Fe,className:Y9.headerExportMenu,children:[(0,M.jsxs)(`summary`,{className:`${Y9.headerBtn} ${Y9.headerExportTrigger}`,children:[(0,M.jsx)(`span`,{className:Y9.headerExportLabel,children:`Export`}),(0,M.jsx)(`span`,{className:Y9.headerDropdownArrow,"aria-hidden":`true`,children:`▼`})]}),(0,M.jsxs)(`div`,{className:Y9.headerExportPanel,children:[(0,M.jsxs)(`button`,{type:`button`,className:Y9.menuBtn,onClick:()=>{Fe.current?.removeAttribute(`open`),Ct()},children:[`All Markdown`,je?` + Dependencies`:``]}),(0,M.jsx)(`button`,{type:`button`,className:Y9.menuBtn,onClick:()=>{Fe.current?.removeAttribute(`open`),wt()},children:`By Category`}),(0,M.jsx)(`button`,{type:`button`,className:Y9.menuBtn,onClick:()=>{Fe.current?.removeAttribute(`open`),Me(e=>!e)},children:je?`Disable Dependency Reports`:`Include Dependency Reports`}),je&&(0,M.jsx)(`button`,{type:`button`,className:Y9.menuBtn,onClick:()=>{Fe.current?.removeAttribute(`open`),St()},children:`Dependency Report`})]})]})}),(0,M.jsxs)(`div`,{className:Y9.headerGroup,role:`group`,"aria-label":`Session actions`,children:[Et&&!o&&(0,M.jsx)(`button`,{type:`button`,className:Y9.headerBtn,onClick:Tt,"aria-label":`Clear all results and add new files`,children:`+ New`}),re&&(0,M.jsx)(`button`,{type:`button`,className:Y9.headerBtn,onClick:$e,"aria-label":`Return to mode selection`,children:`Change Mode`})]})]})]})]})}),(0,M.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,className:Y9.statusRegion,role:`status`,children:l}),(0,M.jsxs)(`div`,{className:Y9.body,children:[Et&&(0,M.jsx)(jVt,{solutions:e.map(e=>e.solution),activeIndex:n,combinedIndex:kt,diagramsAvailable:!!e[kt]?.diagramsMarkdown,diagramsActive:B,onSelectDiagrams:()=>_t(kt),onSelect:gt,onReset:Tt}),(0,M.jsxs)(`main`,{id:`main-content`,className:`${Y9.main} ${Et?Y9.mainWithViewer:``}`,tabIndex:-1,children:[(Mt||jt||Nt)&&(0,M.jsx)(`section`,{className:Y9.welcomeSection,"aria-labelledby":`welcome-heading`,children:Mt?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`h2`,{id:`welcome-heading`,className:Y9.welcomeHeading,children:`Choose how you want to document your solution`}),(0,M.jsx)(`p`,{className:Y9.welcomeSubtitle,children:`Start with local ZIP files or connect to Dataverse and read solution metadata directly from the active environment.`}),(0,M.jsxs)(`p`,{className:Y9.modeVersion,children:[`PP-MD - PPTB Edition version `,Ge]}),(0,M.jsxs)(`div`,{className:Y9.modeGrid,children:[(0,M.jsxs)(`button`,{type:`button`,className:Y9.modeCard,onClick:()=>Qe(`local`),children:[(0,M.jsx)(`span`,{className:Y9.modeCardTitle,children:`Local Solutions`}),(0,M.jsx)(`span`,{className:Y9.modeCardBody,children:`Upload one or more exported solution ZIP files for local documentation generation.`})]}),(0,M.jsxs)(`button`,{type:`button`,className:Y9.modeCard,onClick:()=>Qe(`dataverse`),children:[(0,M.jsx)(`span`,{className:Y9.modeCardTitle,children:`Dataverse Connected`}),(0,M.jsx)(`span`,{className:Y9.modeCardBody,children:`Browse solutions from the currently active Power Platform ToolBox environment and generate documentation directly from Dataverse metadata.`})]})]}),(0,M.jsxs)(`section`,{className:Y9.modeBranding,"aria-label":`Product details and links`,children:[(0,M.jsx)(`img`,{src:``+new URL(`pp-md-icon-Dgg8-GAC.svg`,import.meta.url).href,className:Y9.modeBrandIcon,alt:`PP-MD logo`}),(0,M.jsx)(`p`,{className:Y9.modeBrandTitle,children:`Power Platform Markdown Document Generator`}),(0,M.jsx)(`p`,{className:Y9.modeBrandByline,children:`by Mike Hartley / Hart of the Midlands`}),(0,M.jsxs)(`div`,{className:Y9.modeBrandLinks,children:[(0,M.jsx)(`a`,{href:G4t,target:`_blank`,rel:`noreferrer`,onMouseDown:ze,onClick:Be,children:`HartOfTheMidlands.co.uk`}),(0,M.jsxs)(`a`,{href:W4t,target:`_blank`,rel:`noreferrer`,className:Y9.iconLink,onMouseDown:ze,onClick:Be,children:[(0,M.jsx)(`img`,{src:`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%20aria-hidden='true'%3e%3cpath%20d='M12%20.5C5.65.5.5%205.65.5%2012c0%205.1%203.3%209.42%207.88%2010.95.58.1.8-.25.8-.56%200-.28-.01-1.2-.02-2.17-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7%201.16.08%201.77%201.19%201.77%201.19%201.02%201.76%202.68%201.25%203.33.96.1-.74.4-1.25.72-1.53-2.55-.29-5.22-1.27-5.22-5.66%200-1.25.45-2.28%201.18-3.08-.12-.3-.51-1.5.11-3.13%200%200%20.96-.3%203.15%201.17a10.9%2010.9%200%200%201%205.74%200c2.18-1.48%203.14-1.17%203.14-1.17.62%201.63.24%202.83.12%203.13.74.8%201.18%201.83%201.18%203.08%200%204.4-2.68%205.37-5.24%205.66.41.35.78%201.03.78%202.08%200%201.5-.01%202.72-.01%203.09%200%20.31.21.67.8.56A11.52%2011.52%200%200%200%2023.5%2012C23.5%205.65%2018.35.5%2012%20.5Z'/%3e%3c/svg%3e`,className:Y9.linkIcon,alt:``,"aria-hidden":`true`}),(0,M.jsx)(`span`,{children:`GitHub Repo`})]})]})]})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`h2`,{id:`welcome-heading`,className:Y9.welcomeHeading,children:re===`local`?`Generate documentation from your solution files`:`Generate documentation from the active Dataverse environment`}),(0,M.jsx)(`p`,{className:Y9.welcomeSubtitle,children:re===`local`?`Drop one or more Power Platform solution ZIP archives below. PP-MD - PPTB Edition will parse every component and produce comprehensive Markdown documentation — including architecture and ERD Mermaid diagrams.`:`Choose a solution from the active environment. PP-MD - PPTB Edition reads metadata through Power Platform ToolBox and generates Markdown documentation without exporting or uploading the solution.`}),(0,M.jsxs)(`section`,{className:Y9.contextPanel,"aria-labelledby":`context-heading`,children:[(0,M.jsx)(`h3`,{id:`context-heading`,className:Y9.contextHeading,children:`Document Header Details`}),re===`dataverse`&&(0,M.jsxs)(`div`,{className:Y9.contextRow,children:[(0,M.jsx)(`label`,{htmlFor:`dataverse-policy-select`,className:Y9.contextLabel,children:`Collection Policy`}),(0,M.jsx)(`div`,{className:Y9.contextSelectRow,children:(0,M.jsxs)(`select`,{id:`dataverse-policy-select`,className:Y9.contextSelect,value:xe,onChange:e=>it(e.target.value),"aria-label":`Select the Dataverse collection policy`,children:[(0,M.jsx)(`option`,{value:`solutionOnly`,children:`Solution only`}),(0,M.jsx)(`option`,{value:`solutionAndDirectReferences`,children:`Solution + direct references`}),(0,M.jsx)(`option`,{value:`environmentAppendix`,children:`Environment appendix`})]})})]}),(0,M.jsxs)(`div`,{className:Y9.contextRow,children:[(0,M.jsx)(`label`,{htmlFor:`config-select`,className:Y9.contextLabel,children:`Configuration`}),(0,M.jsxs)(`div`,{className:Y9.contextSelectRow,children:[(0,M.jsxs)(`select`,{id:`config-select`,className:Y9.contextSelect,value:j,onChange:qe,"aria-label":`Select document configuration`,children:[(0,M.jsx)(`option`,{value:`custom`,children:`Custom (manual entry)`}),O.map(e=>(0,M.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,M.jsx)(`button`,{type:`button`,className:Y9.contextDeleteBtn,onClick:()=>Xe(j),disabled:j===`custom`,"aria-label":`Delete selected configuration`,title:`Delete selected configuration`,children:`🗑`})]})]}),(0,M.jsxs)(`div`,{className:Y9.contextSaveRow,children:[(0,M.jsx)(`input`,{type:`text`,className:Y9.contextNameInput,placeholder:`Configuration name`,value:I,onChange:e=>R(e.target.value),"aria-label":`Configuration name`}),(0,M.jsx)(`button`,{type:`button`,className:Y9.contextSaveBtn,onClick:Ye,children:`Save Configuration`})]}),P&&(0,M.jsxs)(`p`,{className:Y9.contextWarning,role:`alert`,children:[`⚠ `,P]}),(0,M.jsxs)(`div`,{className:Y9.contextGrid,children:[(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Client`}),(0,M.jsx)(`input`,{type:`text`,value:S.client,onChange:e=>Je(`client`,e.target.value)})]}),(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Contract`}),(0,M.jsx)(`input`,{type:`text`,value:S.contract,onChange:e=>Je(`contract`,e.target.value)})]}),(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Contract ID/SoW`}),(0,M.jsx)(`input`,{type:`text`,value:S.sow,onChange:e=>Je(`sow`,e.target.value)})]}),(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Project`}),(0,M.jsx)(`input`,{type:`text`,value:S.project,onChange:e=>Je(`project`,e.target.value)})]}),(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Sprint`}),(0,M.jsx)(`input`,{type:`text`,value:S.sprint,onChange:e=>Je(`sprint`,e.target.value)})]}),(0,M.jsxs)(`label`,{className:Y9.contextField,children:[(0,M.jsx)(`span`,{children:`Release Date`}),(0,M.jsx)(`input`,{type:`date`,value:S.releaseDate,onChange:e=>Je(`releaseDate`,e.target.value)})]})]})]}),(0,M.jsxs)(`section`,{className:Y9.generatePanel,"aria-labelledby":`generate-doc-heading`,children:[(0,M.jsxs)(`div`,{className:Y9.generatePanelHeader,children:[(0,M.jsx)(`h3`,{id:`generate-doc-heading`,className:Y9.generatePanelHeading,children:`Generate Documentation`}),(0,M.jsx)(`p`,{className:Y9.generatePanelSubtitle,children:`Use one shared generation action for the selected mode and choose what to include in output.`})]}),(0,M.jsxs)(`div`,{className:Y9.generatePanelActions,children:[re===`local`?(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:ht,disabled:!Dt,"aria-label":`Generate documentation for ${Te.length} queued file${Te.length===1?``:`s`}`,children:[`Generate Documentation (`,Te.length,`)`]}):(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:rt,disabled:!Ot,"aria-label":`Generate documentation for ${ye.length} selected Dataverse solution${ye.length===1?``:`s`}`,children:[`Generate Selected (`,ye.length,`)`]}),(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:p,onChange:dt}),(0,M.jsx)(`span`,{children:`Generate Diagrams`})]}),(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:h,onChange:ft}),(0,M.jsx)(`span`,{children:`Include Default Columns`})]})]}),(0,M.jsxs)(`details`,{className:Y9.optionDetails,open:!0,children:[(0,M.jsx)(`summary`,{children:`Documentation Options`}),(0,M.jsxs)(`fieldset`,{className:Y9.documentScope,children:[(0,M.jsx)(`legend`,{className:`sr-only`,children:`Documentation Options`}),[[`flows`,`Flows and automation`],[`apps`,`Power Apps`],[`security`,`Security roles and profiles`],[`integration`,`Integration and SharePoint`],[`plugins`,`Plug-ins and steps`],[`reports`,`Reports and dashboards`],[`webResources`,`Web resources`],[`modernArtifacts`,`Agents, AI, desktop flows, dataflows, APIs and offline profiles`]].map(([e,t])=>(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:_[e],onChange:()=>pt(e)}),(0,M.jsx)(`span`,{children:t})]},e))]})]}),(0,M.jsxs)(`details`,{className:Y9.optionDetails,children:[(0,M.jsx)(`summary`,{children:`Table Options`}),(0,M.jsxs)(`fieldset`,{className:Y9.documentScope,children:[(0,M.jsx)(`legend`,{className:`sr-only`,children:`Table Options`}),(0,M.jsxs)(`label`,{className:Y9.optionField,children:[`Attribute selection`,(0,M.jsxs)(`select`,{value:y.metadata.attributeSelectionMode,onChange:e=>mt({metadata:{attributeSelectionMode:e.target.value}}),children:[(0,M.jsx)(`option`,{value:`all`,children:`All attributes`}),(0,M.jsx)(`option`,{value:`custom-only`,children:`Custom only`}),(0,M.jsx)(`option`,{value:`attributes-on-form`,children:`Attributes on forms`}),(0,M.jsx)(`option`,{value:`attributes-not-on-form`,children:`Attributes not on forms`}),(0,M.jsx)(`option`,{value:`option-set-focused`,children:`Choice columns`}),(0,M.jsx)(`option`,{value:`unmanaged-only`,children:`Unmanaged only`})]})]}),(0,M.jsxs)(`label`,{className:Y9.optionField,children:[`Manual attributes`,(0,M.jsx)(`input`,{value:y.metadata.manualAttributes.join(`, `),onChange:e=>mt({metadata:{manualAttributes:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)}}),placeholder:`schema_name, schema_name`})]}),[`includeDefaultColumns`,`excludeVirtualAttributes`,`includeTypeColumn`,`includeRequiredLevelInfo`,`includeCustomColumn`,`includeAuditInfo`,`includeNotesColumn`,`includeDescriptionColumn`,`includeAdvancedFind`,`includeFieldSecurity`,`includeMetadataSource`].map(e=>(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:y.metadata[e],onChange:()=>mt({metadata:{[e]:!y.metadata[e]}})}),(0,M.jsx)(`span`,{children:e.replace(`include`,``).replace(/([A-Z])/g,` $1`).trim()})]},e))]})]}),(0,M.jsxs)(`details`,{className:Y9.optionDetails,children:[(0,M.jsx)(`summary`,{children:`Security Role Options`}),(0,M.jsxs)(`fieldset`,{className:Y9.documentScope,children:[(0,M.jsx)(`legend`,{className:`sr-only`,children:`Security Role Options`}),[`onlyTablesInCurrentSolution`,`onlyCustomTables`].map(e=>(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:y.securityRoleFilters[e],onChange:()=>mt({securityRoleFilters:{[e]:!y.securityRoleFilters[e]}})}),(0,M.jsx)(`span`,{children:e===`onlyTablesInCurrentSolution`?`Only tables in current solution`:`Only custom tables`})]},e))]})]}),(0,M.jsxs)(`details`,{className:Y9.optionDetails,children:[(0,M.jsx)(`summary`,{children:`Diagram Options`}),(0,M.jsxs)(`fieldset`,{className:Y9.documentScope,children:[(0,M.jsx)(`legend`,{className:`sr-only`,children:`Diagram Options`}),(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:y.separateDiagramsDocument,onChange:()=>mt({separateDiagramsDocument:!y.separateDiagramsDocument})}),(0,M.jsx)(`span`,{children:`Generate companion diagrams document`})]}),(0,M.jsxs)(`label`,{className:Y9.optionField,children:[`Mermaid diagram colours`,(0,M.jsxs)(`select`,{value:y.diagramColourTheme,onChange:e=>mt({diagramColourTheme:e.target.value}),children:[(0,M.jsx)(`option`,{value:`neutral`,children:`Neutral`}),(0,M.jsx)(`option`,{value:`default`,children:`Default`}),(0,M.jsx)(`option`,{value:`dark`,children:`Dark`}),(0,M.jsx)(`option`,{value:`forest`,children:`Forest`}),(0,M.jsx)(`option`,{value:`base`,children:`Base`})]})]})]})]}),(0,M.jsx)(`div`,{className:Y9.generateFooter,role:`region`,"aria-label":`Generate documentation`,children:re===`local`?(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:ht,disabled:!Dt,children:[`Generate Documentation (`,Te.length,`)`]}):(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:rt,disabled:!Ot,children:[`Generate Selected (`,ye.length,`)`]})})]}),re===`local`?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:Y9.dropZoneWrapper,children:(0,M.jsx)(V,{onFilesSelected:nt,disabled:o,onQueueChange:Ee,showGenerateButton:!1},De)}),(0,M.jsxs)(`section`,{className:Y9.featureGrid,"aria-labelledby":`features-heading`,children:[(0,M.jsx)(`h3`,{id:`features-heading`,className:`sr-only`,children:`Supported components`}),[{icon:`🗃️`,label:`Tables & Columns`},{icon:`📋`,label:`Forms & Views`},{icon:`⚙️`,label:`Power Automate Flows`},{icon:`🔄`,label:`Classic Workflows & BPFs`},{icon:`🎨`,label:`Canvas & Model Apps`},{icon:`🌐`,label:`Web Resources (JS/TS/HTML)`},{icon:`🔒`,label:`Security Roles & CLS`},{icon:`🔌`,label:`Plugins & Plugin Steps`},{icon:`🔗`,label:`Connection References`},{icon:`⚙️`,label:`Environment Variables`},{icon:`📊`,label:`Reports & Dashboards`},{icon:`📈`,label:`Mermaid Diagrams`}].map(({icon:e,label:t})=>(0,M.jsxs)(`div`,{className:Y9.featureCard,children:[(0,M.jsx)(`span`,{className:Y9.featureIcon,"aria-hidden":`true`,children:e}),(0,M.jsx)(`span`,{className:Y9.featureLabel,children:t})]},t))]})]}):(0,M.jsx)(ne,{solutions:Ft,publisherOptions:Pt,selectedPublishers:_e,selectedSolutionIds:ye,search:de,sort:pe,managedFilter:he,isLoading:ce,error:H,busySolutionIds:Ce,onSearchChange:fe,onSortChange:me,onManagedFilterChange:ge,onTogglePublisher:at,onSelectAllPublishers:ot,onClearPublishers:st,onToggleSolution:ct,onSelectAllVisibleSolutions:It,onClearSelectedSolutions:lt,onRefresh:()=>{Ze()}})]})}),o&&(0,M.jsxs)(`section`,{className:Y9.processingSection,"aria-labelledby":`processing-heading`,"aria-busy":`true`,children:[(0,M.jsx)(`h2`,{id:`processing-heading`,className:Y9.processingHeading,children:`Processing solutions…`}),(0,M.jsx)(`div`,{className:Y9.progressList,children:i.map(e=>(0,M.jsx)(`div`,{className:Y9.progressItem,children:e.error?(0,M.jsxs)(`div`,{role:`alert`,className:Y9.progressError,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`❌`}),` `,e.fileName,`: `,e.error]}):(0,M.jsx)(ie,{value:e.progress,label:e.fileName,showLabel:!0})},e.fileName))})]}),!o&&i.some(e=>e.error)&&(0,M.jsx)(`div`,{role:`alert`,className:Y9.errorSummary,children:i.filter(e=>e.error).map(e=>(0,M.jsxs)(`p`,{className:Y9.errorLine,children:[`❌ `,(0,M.jsx)(`strong`,{children:e.fileName}),`: `,e.error]},e.fileName))}),Et&&At&&!o&&(0,M.jsx)(`div`,{className:Y9.viewerWrapper,children:ee?(0,M.jsx)(`div`,{className:Y9.viewerLoadingState,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:(0,M.jsxs)(`div`,{className:Y9.viewerLoadingCard,children:[(0,M.jsx)(`span`,{className:Y9.viewerLoadingSpinner,"aria-hidden":`true`}),(0,M.jsx)(`p`,{className:Y9.viewerLoadingText,children:`Please Wait - rendering markdown document...`})]})}):(0,M.jsx)(AVt,{markdown:B&&At.diagramsMarkdown?At.diagramsMarkdown:At.markdown,title:B?`${At.solution.metadata.displayName||At.solution.metadata.uniqueName}: Diagrams`:At.solution.metadata.displayName||At.solution.metadata.uniqueName,onExport:vt,onExportHtml:yt,onExportExcel:bt,onExportPdf:xt,diagramColourTheme:y.diagramColourTheme})}),Et&&!o&&re&&(0,M.jsxs)(`details`,{className:Y9.addMoreDetails,children:[(0,M.jsx)(`summary`,{className:Y9.addMoreSummary,children:`+ Generate More Documentation`}),(0,M.jsxs)(`div`,{className:Y9.addMoreBody,children:[(0,M.jsxs)(`section`,{className:Y9.generatePanel,"aria-labelledby":`generate-more-heading`,children:[(0,M.jsxs)(`div`,{className:Y9.generatePanelHeader,children:[(0,M.jsx)(`h3`,{id:`generate-more-heading`,className:Y9.generatePanelHeading,children:`Generate More Documentation`}),(0,M.jsx)(`p`,{className:Y9.generatePanelSubtitle,children:`Apply generation settings and create additional documents from your current mode.`})]}),(0,M.jsxs)(`div`,{className:Y9.generatePanelActions,children:[re===`local`?(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:ht,disabled:!Dt,children:[`Generate Documentation (`,Te.length,`)`]}):(0,M.jsxs)(`button`,{type:`button`,className:Y9.generatePrimaryBtn,onClick:rt,disabled:!Ot,children:[`Generate Selected (`,ye.length,`)`]}),(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:p,onChange:dt}),(0,M.jsx)(`span`,{children:`Generate Diagrams`})]}),(0,M.jsxs)(`label`,{className:Y9.generateToggle,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:h,onChange:ft}),(0,M.jsx)(`span`,{children:`Include Default Columns`})]})]})]}),re===`local`&&(0,M.jsxs)(`div`,{className:Y9.addMoreSubsection,children:[(0,M.jsx)(`h4`,{className:Y9.addMoreSubheading,children:`Add More Solution Files`}),(0,M.jsx)(V,{onFilesSelected:nt,disabled:o,onQueueChange:Ee,showGenerateButton:!1},`add-more-${De}`)]}),re===`dataverse`&&(0,M.jsxs)(`div`,{className:Y9.addMoreSubsection,children:[(0,M.jsx)(`h4`,{className:Y9.addMoreSubheading,children:`Add More Solutions from Dataverse`}),(0,M.jsx)(ne,{solutions:Ft,publisherOptions:Pt,selectedPublishers:_e,selectedSolutionIds:ye,search:de,sort:pe,managedFilter:he,isLoading:ce,error:H,busySolutionIds:Ce,onSearchChange:fe,onSortChange:me,onManagedFilterChange:ge,onTogglePublisher:at,onSelectAllPublishers:ot,onClearPublishers:st,onToggleSolution:ct,onSelectAllVisibleSolutions:It,onClearSelectedSolutions:lt,onRefresh:()=>{Ze()}})]})]})]})]})]}),ke&&(0,M.jsx)(`div`,{className:Y9.modalBackdrop,role:`presentation`,children:(0,M.jsxs)(`div`,{className:Y9.modalDialog,role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`invalid-archive-title`,"aria-describedby":`invalid-archive-body`,children:[(0,M.jsx)(`h2`,{id:`invalid-archive-title`,className:Y9.modalTitle,children:`Invalid ZIP Archive`}),(0,M.jsx)(`p`,{id:`invalid-archive-body`,className:Y9.modalBody,children:ke}),(0,M.jsx)(`button`,{ref:Ie,type:`button`,className:Y9.modalOkBtn,onClick:()=>Ae(null),children:`OK`})]})}),(0,M.jsxs)(`footer`,{className:Y9.footer,role:`contentinfo`,children:[(0,M.jsxs)(`div`,{className:Y9.footerLeft,children:[(0,M.jsx)(`span`,{children:`PP-MD - PPTB Edition: Power Platform Documentation Generator.`}),(0,M.jsxs)(`span`,{className:Y9.footerVersion,children:[`Version `,Ge]}),(0,M.jsxs)(`a`,{href:W4t,target:`_blank`,rel:`noreferrer`,className:Y9.iconLink,onMouseDown:ze,onClick:Be,children:[(0,M.jsx)(`img`,{src:z4t,className:Y9.linkIcon,alt:``,"aria-hidden":`true`}),(0,M.jsx)(`span`,{children:`GitHub Repo`})]})]}),(0,M.jsx)(`div`,{className:Y9.footerRight,children:(0,M.jsx)(`span`,{children:re===`dataverse`?`PP-MD - PPTB Edition reads solution metadata from the active Dataverse environment through Power Platform ToolBox. No information is uploaded to the environment and only solution data is retrieved in read-only mode.`:`All local ZIP processing happens on your PC; your solution data never leaves your machine.`})})]})]})}var s3t=document.getElementById(`root`);if(!s3t)throw Error(`PP-MD - PPTB Edition: Could not find #root element. Ensure index.html contains <div id="root"></div>.`);(0,S.createRoot)(s3t).render((0,M.jsx)(x.StrictMode,{children:(0,M.jsx)(I,{children:(0,M.jsx)(o3t,{})})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hart365/pp-md-pptb-edition",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "displayName": "PP-MD Power Platform Markdown Document Generator",
5
5
  "description": "Generate Power Platform documentation from either Solution ZIP files or direct Dataverse connection",
6
6
  "author": "Mike Hartley",