var VMPrintPipeline=(()=>{var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var F=(e,n,t)=>n in e?a(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var v=(e,n)=>{for(var t in n)a(e,t,{get:n[t],enumerable:!0})},M=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of h(n))!P.call(e,i)&&i!==t&&a(e,i,{get:()=>n[i],enumerable:!(r=b(n,i))||r.enumerable});return e};var D=e=>M(a({},"__esModule",{value:!0}),e);var s=(e,n,t)=>F(e,typeof n!="symbol"?n+"":n,t);var R={};v(R,{BUILTIN_FIXTURES:()=>l,SAMPLE_DOCUMENT:()=>V,createDownloadUrl:()=>B,getBuiltinFixtureDocument:()=>S,getBuiltinFixturePresets:()=>E,parseDocumentJson:()=>k,renderDocumentToPdfBytes:()=>A,revokeDownloadUrl:()=>C});var c=class{constructor(){s(this,"chunks",[]);s(this,"finishPromise");s(this,"resolveFinish",null);s(this,"finished",!1);this.finishPromise=new Promise(n=>{this.resolveFinish=n})}write(n){if(typeof n=="string"){this.chunks.push(new TextEncoder().encode(n));return}this.chunks.push(n)}end(){this.finished||(this.finished=!0,this.resolveFinish&&this.resolveFinish())}waitForFinish(){return this.finishPromise}toUint8Array(){let n=this.chunks.reduce((i,o)=>i+o.byteLength,0),t=new Uint8Array(n),r=0;for(let i of this.chunks)t.set(i,r),r+=i.byteLength;return t}},l=[{id:"08-dropcap-pagination",label:"08: Dropcap + Pagination",description:"Typography-heavy fixture with drop cap and paging behavior.",scriptFile:"08-dropcap-pagination.js"},{id:"11-story-image-floats",label:"11: Story Flow + Image Floats",description:"Story wrapping around float obstacles across pages.",scriptFile:"11-story-image-floats.js"},{id:"14-flow-images-multipage",label:"14: Flow Images Multipage",description:"Multipage flow with embedded images.",scriptFile:"14-flow-images-multipage.js"},{id:"15-story-multi-column",label:"15: Story Multi-Column",description:"Multi-column story composition and flow behaviors.",scriptFile:"15-story-multi-column.js"},{id:"26-strip-layout",label:"26: Strip Composition (v1.1)",description:"Metadata bands and horizontal composition with strips.",scriptFile:"26-strip-layout.js"},{id:"21-zone-map-sidebar",label:"21: Zone Maps (v1.1)",description:"Independent layout regions and parallel zones.",scriptFile:"21-zone-map-sidebar.js"},{id:"09-tables-spans-pagination",label:"09: Tables Spans Pagination",description:"Complex table spanning and pagination stress test.",scriptFile:"09-tables-spans-pagination.js"}],V={documentVersion:"1.0",elements:[]},u=new Map,x=e=>JSON.parse(JSON.stringify(e));function L(e){return new URL(`./fixtures/${e}`,document.baseURI).toString()}function U(e){if(window.VMPrintFixtureStore?.[e.id])return Promise.resolve();let n=u.get(e.id);if(n)return n;let t=new Promise((r,i)=>{let o=document.createElement("script");o.src=L(e.scriptFile),o.async=!0,o.onload=()=>{if(window.VMPrintFixtureStore?.[e.id]){r();return}i(new Error(`Fixture script "${e.id}" loaded but no document was registered.`))},o.onerror=()=>{i(new Error(`Failed to load built-in fixture "${e.id}".`))},document.head.appendChild(o)}).finally(()=>{u.delete(e.id)});return u.set(e.id,t),t}function E(){return l.map(e=>({id:e.id,label:e.label,description:e.description}))}async function S(e){let n=l.find(r=>r.id===e);if(!n)throw new Error(`Unknown built-in fixture "${e}".`);await U(n);let t=window.VMPrintFixtureStore?.[n.id];if(!t)throw new Error(`Built-in fixture "${e}" is unavailable after loading.`);return x(t)}function k(e){let n=JSON.parse(e);if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Expected a JSON object as VMPrint document input.");return n}async function A(e){if(!window.VMPrintEngine||!window.VMPrintWebFonts||!window.VMPrintPdfLiteContext)throw new Error("VMPrint browser bundles are missing. Rebuild docs assets and reload.");let n=window.VMPrintEngine,t=window.VMPrintWebFonts,r=window.VMPrintPdfLiteContext,i=n.resolveDocumentPaths(e,"browser-input.json"),o=n.toLayoutConfig(i,!1),p=n.createEngineRuntime({fontManager:t.createDocumentWebFontManager(i,o)}),m=new n.LayoutEngine(o,p);await m.waitForFonts();let g=m.simulate(i.elements),{width:f,height:y}=n.LayoutUtils.getPageDimensions(o),w=new r.PdfLiteContext({size:[f,y],margins:{top:0,right:0,bottom:0,left:0},autoFirstPage:!1,bufferPages:!1}),d=new c;return w.pipe(d),await new n.Renderer(o,!1,p).render(g,w),await d.waitForFinish(),{pdfBytes:d.toUint8Array(),pageCount:g.length}}function B(e){let n=new Blob([e],{type:"application/pdf"});return URL.createObjectURL(n)}function C(e){URL.revokeObjectURL(e)}return D(R);})();
