(()=>{ 'use strict'; const $=(s,r=document)=>r.querySelector(s), $$=(s,r=document)=>[...r.querySelectorAll(s)]; const esc=s=>String(s??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); let toastTimer;function status(text){const n=$('#site-status');n.textContent=text;n.classList.add('show');clearTimeout(toastTimer);toastTimer=setTimeout(()=>n.classList.remove('show'),3600)} function download(name,text,type='text/plain'){const url=URL.createObjectURL(new Blob([text],{type}));const a=document.createElement('a');a.href=url;a.download=name;document.body.append(a);a.click();a.remove();setTimeout(()=>URL.revokeObjectURL(url),1000)} // Test-mode instrumentation only. No raw form entries, financial values or external transport. const attribution={};for(const key of ['utm_source','utm_campaign']){const v=new URLSearchParams(location.search).get(key);if(v&&/^[a-zA-Z0-9_. -]{1,64}$/.test(v))attribution[key]=v} const eventQueue=[];const sessionId=crypto.randomUUID();function event(name,properties={}){const allowed={event_id:crypto.randomUUID(),event_time:new Date().toISOString(),session_id:sessionId,page_id:document.body.dataset.page,content_version:'exemptlink-1.0',test_mode:true,...attribution,...properties};eventQueue.push({name,...allowed});document.dispatchEvent(new CustomEvent('exemptlink:preview-event',{detail:{name,...allowed}}))} if(document.body.dataset.page==='home')event('landing_view'); $$('[data-offer]').forEach(a=>a.addEventListener('click',()=>event('offer_14_selected',{concept_id:14,selected_offer_id:Number(a.dataset.offer),placement:'workflow_navigation'}))); const menus=$$('.nav-trigger');function closeMenus(){menus.forEach(b=>{b.setAttribute('aria-expanded','false');$('#'+b.getAttribute('aria-controls')).hidden=true})} menus.forEach(b=>b.addEventListener('click',()=>{const open=b.getAttribute('aria-expanded')==='true';closeMenus();if(!open){b.setAttribute('aria-expanded','true');$('#'+b.getAttribute('aria-controls')).hidden=false}})); document.addEventListener('click',e=>{if(!e.target.closest('.nav-group'))closeMenus()});document.addEventListener('keydown',e=>{if(e.key==='Escape'){const b=menus.find(b=>b.getAttribute('aria-expanded')==='true');closeMenus();if(b)b.focus()}}); const dialog=$('#mobile-nav'),toggle=$('.mobile-toggle');toggle.addEventListener('click',()=>{dialog.showModal();toggle.setAttribute('aria-expanded','true');document.body.classList.add('nav-open')});function closeNav(){dialog.close();toggle.setAttribute('aria-expanded','false');document.body.classList.remove('nav-open');toggle.focus()}$('.close-nav').addEventListener('click',closeNav);dialog.addEventListener('cancel',e=>{e.preventDefault();closeNav()});dialog.addEventListener('click',e=>{if(e.target===dialog)closeNav()});dialog.addEventListener('close',()=>document.body.classList.remove('nav-open')); let paused=false;const media=matchMedia('(prefers-reduced-motion:reduce)');function applyMotion(){document.body.classList.toggle('motion-paused',paused);document.body.classList.toggle('reduced-motion',media.matches);$$('.motion-toggle').forEach(b=>{b.setAttribute('aria-pressed',String(paused));$('span',b).textContent=paused?'Resume motion':'Pause motion'})}$$('.motion-toggle').forEach(b=>b.addEventListener('click',()=>{paused=!paused;applyMotion();status(paused?'Motion paused.':'Motion resumed.')}));media.addEventListener('change',applyMotion);applyMotion();document.addEventListener('visibilitychange',()=>document.body.classList.toggle('page-hidden',document.hidden)); const revealObserver=new IntersectionObserver(entries=>entries.forEach(e=>{if(e.isIntersecting){e.target.classList.add('seen');revealObserver.unobserve(e.target)}}),{threshold:.08});$$('.reveal,.table-wrap').forEach(e=>revealObserver.observe(e)); const motionObserver=new IntersectionObserver(entries=>entries.forEach(e=>e.target.classList.toggle('motion-offscreen',!e.isIntersecting)),{threshold:.02});$$('[data-motion]').forEach(e=>motionObserver.observe(e)); if(document.body.dataset.page==='pricing'){const p=$('.primary-price');if(p){const po=new IntersectionObserver(entries=>{if(entries.some(e=>e.isIntersecting)){event('price_view',{price_version:'hypothesis-1',hypothesis:true,displayed_price_option:'bounded_pilot'});po.disconnect()}},{threshold:.3});po.observe(p)}} // Honest front-end intake. Submission makes a local draft; delivery events are deliberately absent. $$('.intake-form').forEach(form=>{ const offerSelect=$('[name=offer_id]',form);if(offerSelect)offerSelect.addEventListener('change',()=>{if(/^[1-5]$/.test(offerSelect.value))event('offer_14_selected',{concept_id:14,selected_offer_id:Number(offerSelect.value),placement:'intake_preview'})}); const offer=new URLSearchParams(location.search).get('offer');if(/^[1-5]$/.test(offer||'')){const select=$('[name=offer_id]',form);if(select)select.value=offer} form.addEventListener('submit',e=>{e.preventDefault();let first=null;$$('[required]',form).forEach(input=>{const okay=input.type==='checkbox'?input.checked:input.validity.valid;input.setAttribute('aria-invalid',String(!okay));if(input.type!=='checkbox'){const error=$('#error-'+input.name,form);if(error){error.textContent=okay?'':input.type==='email'?'Enter a complete email address.':'Complete this field.';input.setAttribute('aria-describedby',error.id)}}if(!okay&&!first)first=input});$('.form-error',form).textContent=first?'Complete the required fields and explicit consent. Nothing has been submitted.':'';if(first){first.focus();return} const data=Object.fromEntries(new FormData(form).entries());const dl=$('.draft-summary',form);dl.innerHTML=Object.entries(data).map(([k,v])=>'
America/New_York; scripted demo time. These timestamps do not use the actual click time.
'} function packetObject(){return {label:'DEMO — SYNTHETIC DATA / CONCEPT PREVIEW',packet_id:'sample-01',version:'v'+(state.step+1)+(state.modified?'-sandbox-'+(state.scenarioJurisdiction==='New Jersey'?'nj':'fl'):''),immutable_storage:'Not established by this local export',currency:'USD',period:'April 2026',jurisdiction:'New York',record_count:10,total_minor:1600000,modified_scenario:state.modified,scenario_jurisdiction:state.scenarioJurisdiction,transactions:records.map(r=>({...r,original_candidate:r.certificate,reviewed_evidence:r.id==='TX-091'&&state.step>=7&&!state.modified?'CE-31':r.state==='Completed'?r.certificate:null,outreach_state:r.id==='TX-091'&&state.step>=5?'approved_unsent':r.state==='Approved'?'approved_unsent':'not_approved',state:r.id==='TX-091'&&state.step>=7&&!state.modified?'Completed in simulation':r.state})),source_versions:state.step>=6?['CE-21/v1 original retained','CE-31/v1 fictional replacement']:['CE-21/v1 original retained'],review_events:reviewEvents(),unresolved_exceptions:records.filter(r=>!['Completed'].includes(r.state)&&!(r.id==='TX-091'&&state.step>=7&&!state.modified)).map(r=>({id:r.id,state:r.state,reason:r.reason,owner:r.owner})),engine_GL_bridge:{GL_minor:1600000,engine_minor:1510000,evidence_minor:1600000,difference_minor:90000,reason:'Synthetic TX-096 absent from engine export',interpretation:'Population difference requiring review; not tax liability or recovered money'}}} function exportPacket(json=false){const data=packetObject();if(json)download('ExemptLink-DEMO-sample-01.json',JSON.stringify(data,null,2),'application/json');else download('ExemptLink-DEMO-sample-01.txt','DEMO — SYNTHETIC DATA / CONCEPT PREVIEW\nEXEMPTLINK / SAMPLE-01 / '+data.version+'\n\nApril 2026 / NY / USD\n10 fictional sales / USD 16,000 recorded sale value\n\nORIGINAL SOURCES\n'+data.source_versions.join('\n')+'\n\nSCRIPTED REVIEW HISTORY\n'+reviewEvents().map(e=>e.join(' — ')).join('\n')+'\n\nUNRESOLVED APPENDIX\n'+data.unresolved_exceptions.map(r=>r.id+' / '+r.state+' / '+r.reason+' / owner '+r.owner).join('\n')+'\n\nRECONCILIATION\nGL 16,000 / engine 15,100 / evidence 16,000 / difference 900 USD\nTX-096 absent from engine export. No liability, savings or ROI claim.\n\nA local file does not establish production immutability or legal validity. No real customer data.\n');status('Local DEMO packet downloaded. No external systems touched.')} if($('#report-events')){$('#report-events').innerHTML=historyHTML();$('#report-version').textContent=packetObject().version;$('#report-status').textContent=state.modified?'Modified scenario / review reopened. Reset the demo to restore canonical fixtures.':state.step>=7?'TX-091 review completed in simulation. Original CE-21 and unresolved items remain.':'Original fixture / held review retained. Follow the demo to append scripted decisions.';$('#packet-export').addEventListener('click',()=>exportPacket());$('#packet-json').addEventListener('click',()=>exportPacket(true))} if(!$('#workbench'))return; event('demo_open',{demo_version:'synthetic-1',entry_point:document.body.dataset.page,synthetic:true});let selected='TX-091',activeTab=new URLSearchParams(location.search).get('view')==='correction'?'correction':'invoice'; const MONEY=c=>'USD '+(c/100).toLocaleString('en-US',{minimumFractionDigits:2,maximumFractionDigits:2});const correction='Do not apply the imported renewal/expiry field as a New York validity rule. CE-21 still names a different entity and jurisdiction. Keep TX-091 on hold and request appropriate evidence for Blue Mesa Supply LLC.'; function getRecord(){return records.find(r=>r.id===selected)}function disposition(r){if(r.id!=='TX-091')return r.state;return state.modified?'Held / modified scenario':state.step>=7?'Reviewed in simulation':state.step>=6?'Pending replacement review':state.step>=5?'Approved / unsent':'Held for review'} function queue(){const search=$('#queue-search').value.toLowerCase(),filter=$('#queue-filter').value;let matches=records.filter(r=>(r.id+' '+r.buyer).toLowerCase().includes(search)).filter(r=>filter==='all'||(r.id==='TX-091'&&state.step>=7&&!state.modified?'Completed':r.state)===filter);$('#queue-records').innerHTML=matches.map(r=>'').join('');$('.queue-empty').hidden=matches.length>0;$$('[data-record]').forEach(b=>b.addEventListener('click',()=>{selected=b.dataset.record;activeTab='invoice';render();}));$('#demo-held-count').textContent=state.step>=7&&!state.modified?'2':'3';$('#demo-completed-count').textContent=state.step>=7&&!state.modified?'3':'2'} function tabs(){ $$('[data-tab]').forEach(b=>{const active=b.dataset.tab===activeTab;b.setAttribute('aria-selected',String(active));b.tabIndex=active?0:-1;$('#panel-'+b.dataset.tab).hidden=!active});} $$('[data-tab]').forEach((b,i)=>{b.addEventListener('click',()=>{activeTab=b.dataset.tab;tabs();if(activeTab==='evidence')event('evidence_view',{demo_step:state.step,synthetic_scenario_id:'ny-canonical'});if(activeTab==='correction')event('override_view',{demo_step:state.step});});b.addEventListener('keydown',e=>{const all=$$('[data-tab]');if(['ArrowRight','ArrowLeft','Home','End'].includes(e.key)){e.preventDefault();const next=e.key==='Home'?0:e.key==='End'?all.length-1:(i+(e.key==='ArrowRight'?1:-1)+all.length)%all.length;all[next].click();all[next].focus()}})}); function render(){ queue();const r=getRecord(),canonical=r.id==='TX-091';$('#record-id').textContent=r.id;$('#record-buyer').textContent=r.buyer;$('#record-state').textContent=disposition(r);$('#record-state').className='badge '+(canonical&&state.step>=7&&!state.modified||r.state==='Completed'?'complete':'held');$('#review-owner').textContent=r.owner;$('.reviewer-avatar').textContent=r.owner==='Mira Ellis'?'ME':'DR';$('#source-row').textContent='sales-apr.csv#'+r.id;$('#next-action').textContent=canonical&&state.step>=7&&!state.modified?'Review completed in simulation; inspect the packet.':r.state==='Completed'?'No next action / completed fixture':r.reason;$('.review-pane-note:last-of-type>span').textContent=(canonical&&state.step>=7&&!state.modified)||r.state==='Completed'?'No next action due':'Due Apr 23 / unresolved fixture'; $('#invoice-detail').innerHTML=(canonical?''+ (canonical?'Imported expiry Mar 31, 2026 is unverified. Entity/state questions are separate.': 'This fixture describes a review state; no legal-validity determination is made.')+'
Source: sales-apr.csv#'+r.id+' · import Apr 20 / 09:00 · original row retained.
'+(canonical?'Editing reopens review and marks a modified scenario. Original source documents remain read-only. Reset restores the canonical path.
Source span: entity / jurisdiction / signature region. '+(replacement?'Original CE-21 remains in packet lineage. Replacement awaits separate review.':'Imported expiry: Mar 31, 2026 / unverified source-system value.')+'
Context: NY exemption guidance. No universal expiry inferred. Accessed Oct 14, 2026; source context needs tax-owner review.
'; $('#correction-detail').innerHTML=''+correction+'
Before: Mar 31 renewal metadata treated as universal expiry.
After: expiry inference rejected; entity/state hold retained.
Correction appended at Apr 20 / 09:15. CE-21 unchanged. Hold remains.
')+'Source reference: '+esc(r.certificate||'unknown')+'. Exact source spans are expanded only for the canonical TX-091 example.
Unknown fields are not shown as complete. No automated approval is available.
';$('#correction-detail').innerHTML=''+esc(r.reason)+'. Return to TX-091 to explore the deterministic correction path.
'} $('#history-detail').innerHTML=canonical?historyHTML():'Scripted time / America/New_York. Unresolved next action: Apr 23. Completed fixtures have no next action.
'; const steps=[['Candidate source proposed','CE-21 is linked as a candidate, not accepted support.','Inspect date warning'],['A provisional date warning','The imported Mar 31 date is unverified. Read the entity and state fields separately.','Inspect exact evidence'],['Tax-lead source review','The candidate names a different entity and state. Inspect the correction to the generic expiry assumption.','View accountant correction'],['A reason is required','Record the correction reason in the Correction tab. The entity/state hold stays in place.','Open correction'],['Draft only / approval required','A specific missing-evidence request is ready for the fictional tax owner. Sending remains unavailable.','Simulate tax-owner approval'],['Approved in simulation / unsent','Daniel Reed approves the scripted draft at Apr 20 / 09:30. Approval is not delivery.','Load fictional response'],['Updated evidence / pending review','Preseeded CE-31 is supplied Apr 22. The original CE-21 is retained and never marked valid.','Review updated evidence'],['Reviewed in simulation','The fictional tax owner records a disposition at Apr 22 / 10:30. No legal validity or compliance is guaranteed.','Preview packet'],['Versioned illustrative packet','Transaction, original/replacement sources, correspondence and review history are preserved with unresolved items.','Open report']]; let stepHTML='';if(!canonical)stepHTML=''+esc(r.reason)+'
';else if(state.modified)stepHTML='Assumptions differ from the canonical NY record. No scripted approval is available in this branch.
';else{const [title,desc,label]=steps[state.step];stepHTML=''+desc+'
'+(state.step>=4&&state.step<=5?'Please provide appropriate evidence for Blue Mesa Supply LLC, New York, and the Apr 18, 2026 sale. CE-21 names another entity and state.
'+ (state.step===5?'Approved in simulation / delivery disabled':'Awaiting Daniel Reed’s scripted approval')+'