1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5786,8417],{25786:(e,t,n)=>{n.d(t,{buildDocxReport:()=>z,downloadDocxReport:()=>v});var i=n(46181),o=n(98417),r=n(70284),a=n(18573),c=n(26971);let s="D5D9E0",l="101114",d="667085";function h(e){return`evidence_${e.replace(/[^A-Za-z0-9_]/g,"_")}`}function p(e,t){let n=[];for(let i=0;i<e.length;i+=t)n.push(e.slice(i,i+t));return n.length>0?n:[[]]}function f(e){return void 0!==e.countUnit&&"respondents"!==e.countUnit}function u(e,t,n,i=!1){let o="cases"===n?"case":"responses"===n?"response":"descriptive"===n?"case/response":"respondent",r=n?"weighted_estimated_count"===t?`Descriptive total (weighted estimated ${o} count)`:"unweighted_respondent_count"===t?`Descriptive total (unweighted ${o} count)`:`Descriptive total (${o} count; count semantics unavailable)`:"weighted_estimated_count"===t?"Descriptive total (weighted estimated count)":"frequency_count"===t?"Frequency count total":"unweighted_respondent_count"===t?"Descriptive total (unweighted respondent count)":"Descriptive total (count semantics unavailable)";return`${r}${i?" = ":" "}${e.toLocaleString()}`}function g(e,t,n,i){let o=e.tables.find(e=>e.id===t),r=i??o?.countSemantics;return o&&!f(o)&&o.inference?.kind==="ordinary"&&"weighted_estimated_count"!==r&&"unknown_descriptive_count"!==r?`${"frequency_count"===r?"frequency base":"base"} ${n.toLocaleString()}`:u(n,r,o?.countUnit,!0)}function w(e,t,n={}){return new i.nA6({width:{size:t,type:i.PsV.DXA},verticalAlign:i.G4t.CENTER,margins:{top:100,bottom:100,left:120,right:120},shading:n.header?{type:i.DB2.CLEAR,fill:"EEF2F7",color:"auto"}:void 0,children:[new i.fzL({alignment:"left"===n.align?i.Yus.LEFT:i.Yus.CENTER,spacing:{before:0,after:0,line:260},children:[new i.NTc({text:e,bold:n.header,size:n.header?20:19,color:l,font:"Aptos"})]})]})}function b(e){let t=[],n=p(e.colLabels.map((e,t)=>t),4),o=p(e.rowLabels.map((e,t)=>t),18),c=0;for(let p of n)for(let n of o){var g;let o=function(e){if(!f(e))return null;let t="weighted_estimated_count"===e.countSemantics?"Weighted":"unknown_descriptive_count"===e.countSemantics||"descriptive"===e.countUnit?"Descriptive":"",n="cases"===e.countUnit?"case bases":"responses"===e.countUnit?"response bases":"case/response bases";return{rowTotal:"Weighted"===t?"Weighted response estimate":"Descriptive"===t?"Descriptive response total":"Response total",bases:t?`${t} ${n}`:`${n[0].toUpperCase()}${n.slice(1)}`}}(e),b=[2040,...p.map(()=>Math.floor(6120/(p.length+1))),Math.floor(6120/(p.length+1))];b[b.length-1]+=9360-b.reduce((e,t)=>e+t,0);let m=0===c?e.title:`${e.title} (continued)`,z=[...0===c?[new i.Xhp({id:h(e.id),children:[new i.NTc({text:""})]})]:[],new i.Xhp({id:(0,r.docxTableAnchor)(e.id,c),children:[new i.NTc({text:m,bold:!0,size:28,color:l})]})];t.push(new i.fzL({keepNext:!0,spacing:{before:0===c?180:280,after:80},children:z})),t.push(new i.fzL({keepNext:!0,spacing:{before:0,after:80},children:[new i.Xhp({id:(0,r.docxTableMetaAnchor)(e.id,c),children:[new i.NTc({text:`Table ID ${e.id} | Wave ${e.waveId} | ${(g=e.grandTotal,!f(e)&&e.inference?.kind==="ordinary"&&"weighted_estimated_count"!==e.countSemantics&&"unknown_descriptive_count"!==e.countSemantics?`${"frequency_count"===e.countSemantics?"Frequency base":"Base"} ${g.toLocaleString()}`:u(g,e.countSemantics,e.countUnit))}`,color:d,size:18,font:"Aptos"})]})]}));let v=new i.Hjg({tableHeader:!0,children:[w(e.rowVar,b[0],{header:!0,align:"left"}),...p.map((t,n)=>w(e.colLabels[t],b[n+1],{header:!0})),w(o?.rowTotal??"Total",b.at(-1),{header:!0})]}),L=n.map(t=>new i.Hjg({children:[w(e.rowLabels[t],b[0],{align:"left"}),...p.map((n,i)=>{let o=e.cells[t][n];return w(`${o.count.toLocaleString(void 0,{maximumFractionDigits:2})} 2${o.rowPct.toFixed(1)}%`,b[i+1])}),w(e.rowTotals[t].toLocaleString(void 0,{maximumFractionDigits:2}),b.at(-1))]})),D=new i.Hjg({children:[w(o?.bases??"Total",b[0],{header:!0,align:"left"}),...p.map((t,n)=>w(e.colTotals[t].toLocaleString(void 0,{maximumFractionDigits:2}),b[n+1],{header:!0})),w(e.grandTotal.toLocaleString(void 0,{maximumFractionDigits:2}),b.at(-1),{header:!0})]}),x={style:i.kDD.SINGLE,size:4,color:s};t.push(new i.XIK({width:{size:9360,type:i.PsV.DXA},indent:{size:120,type:i.PsV.DXA},layout:i.tUz.FIXED,columnWidths:b,margins:{top:100,bottom:100,left:120,right:120},borders:{top:x,bottom:x,left:x,right:x,insideHorizontal:x,insideVertical:x},rows:[v,...L,D]})),t.push(new i.fzL({spacing:{before:100,after:160},children:[new i.Xhp({id:(0,r.docxTableStatsAnchor)(e.id,c),children:[new i.NTc({text:(()=>{let t=(0,a.L)(e);return"ordinary"===t.kind?`Pearson chi-square ${t.chiSquare.toFixed(2)} | p ${t.pValue<.001?"< .001":`= ${t.pValue.toFixed(3)}`} | Cramer's V ${t.cramersV.toFixed(3)} (${t.effect})`:"complex_sample"===t.kind?t.association?`Design-based ${t.association.method} F(${t.association.numeratorDf}, ${t.association.denominatorDf}) = ${t.association.fStatistic.toFixed(2)} | p ${t.association.pValue.toFixed(3)}`:t.itemAssociations?`Design-based inference: ${t.methodology}; ${t.itemAssociations.filter(e=>e.association).length}
2 item test(s), no overlapping-row omnibus association`:`Design-based inference: ${t.methodology}; association unavailable`:"Inference unavailable: no verified authority was provided for this table"})(),bold:!0,size:20,color:l,font:"Aptos"})]})]})),c+=1}return t}function m(e){let t=[2700,6660],n={style:i.kDD.SINGLE,size:4,color:s};return new i.XIK({width:{size:9360,type:i.PsV.DXA},indent:{size:120,type:i.PsV.DXA},layout:i.tUz.FIXED,columnWidths:t,borders:{top:n,bottom:n,left:n,right:n,insideHorizontal:n,insideVertical:n},rows:[new i.Hjg({tableHeader:!0,children:[w("Audit field",t[0],{header:!0,align:"left"}),w("Recorded value",t[1],{header:!0,align:"left"})]}),...e.audit.map(([e,n])=>new i.Hjg({children:[w(e,t[0],{header:!0,align:"left"}),w(n,t[1],{align:"left"})]}))]})}async function z(e){let t=e.branding.primaryColor.replace(/^#/,"").toUpperCase(),n=[],o=e.branding.logoDataUrl?function(e){if(!(0,c.q)(e))return null;let t=/^data:image\/(png|jpeg);base64,(.+)$/i.exec(e);if(!t)return null;let n=atob(t[2]),o=Uint8Array.from(n,e=>e.charCodeAt(0));return new i.J1n({type:"jpeg"===t[1].toLowerCase()?"jpg":"png",data:o,transformation:{width:160,height:48},altText:{title:"Report brand logo",description:"Client brand logo",name:"Brand logo"}})}(e.branding.logoDataUrl):null;o&&n.push(new i.fzL({spacing:{before:480,after:120},children:[o]})),n.push(new i.fzL({spacing:{before:o?120:1200,after:120},children:[new i.NTc({text:"CROSSTABS RESEARCH PACK",bold:!0,color:t,size:20,characterSpacing:18,font:"Aptos"})]})),n.push(new i.fzL({spacing:{before:0,after:160},children:[new i.NTc({text:e.title,bold:!0,color:l,size:54,font:"Aptos Display"})]})),n.push(new i.fzL({spacing:{before:0,after:480},children:[new i.NTc({text:e.subtitle,color:d,size:28,font:"Aptos"})]}));let a=[e.preparedFor&&`Prepared for ${e.preparedFor}`,e.analyst&&`Analyst ${e.analyst}`,`Generated ${new Date(e.generatedAt).toLocaleString()}`].filter(Boolean).join(" | ");if(n.push(new i.fzL({spacing:{before:0,after:180},children:[new i.NTc({text:a,color:d,size:20,font:"Aptos"})]})),e.notes&&n.push(new i.fzL({spacing:{before:80,after:220},border:{left:{style:i.kDD.SINGLE,size:18,color:t,space:8}},indent:{left:220},children:[new i.NTc({text:e.notes,italics:!0,color:l,size:22,font:"Aptos"})]})),e.story?.length){for(let o of e.story)if("cover"!==o.kind){if((o.pageBreakBefore||"section"===o.kind||"table"===o.kind||"chart"===o.kind||"methods"===o.kind)&&n.push(new i.fzL({children:[new i.bjD]})),"section"===o.kind){n.push(new i.fzL({heading:i.Fmo.HEADING_1,children:[new i.Xhp({id:(0,r.docxStoryAnchor)(o.id),children:[new i.NTc(o.title)]})]})),o.content&&n.push(new i.fzL(o.content));continue}if("commentary"===o.kind){n.push(new i.fzL({heading:i.Fmo.HEADING_2,children:[new i.Xhp({id:(0,r.docxStoryAnchor)(o.id),children:[new i.NTc(o.title)]})]})),n.push(new i.fzL({spacing:{before:40,after:180,line:300},children:[new i.NTc({text:o.content||"Add narrative here.",size:22,color:l,font:"Aptos"})]}));continue}if("finding"===o.kind){let a=o.source?.kind==="finding"?e.findings.find(e=>e.id===o.source.id):null;n.push(new i.fzL({heading:i.Fmo.HEADING_2,children:[new i.Xhp({id:(0,r.docxStoryAnchor)(o.id),children:[new i.NTc(o.title)]})]})),n.push(new i.fzL(o.content||a?.text||"Add finding text here.")),a&&n.push(new i.fzL({spacing:{before:0,after:160},children:[new i.ijT({anchor:h(a.evidence.tableId),children:[new i.NTc({text:`Evidence ${a.evidence.tableId} | ${a.evidence.waveId} | R${a.evidence.rowIndex+1}C${a.evidence.columnIndex+1} | ${a.evidence.statistic} | ${g(e,a.evidence.tableId,a.evidence.base,a.evidence.countSemantics)}`,color:t,underline:{},size:18,font:"Aptos"})]})]}));continue}if("table"===o.kind||"chart"===o.kind){"chart"===o.kind&&n.push(new i.fzL({heading:i.Fmo.HEADING_2,children:[new i.Xhp({id:(0,r.docxStoryAnchor)(o.id),children:[new i.NTc(`${o.title} \xb7 editable chart data`)]})]})),(function(e,t){return t.source?.kind!=="table"?[]:e.tables.filter(e=>(e.sourceTableId??e.id)===t.source.id)}
2)(e,o).forEach(e=>n.push(...b(e))),o.content&&n.push(new i.fzL(o.content));continue}"methods"===o.kind&&(n.push(new i.fzL({heading:i.Fmo.HEADING_1,children:[new i.Xhp({id:(0,r.docxStoryAnchor)(o.id),children:[new i.NTc(o.title||"Methods and audit trail")]})]})),e.methodology.forEach(e=>n.push(new i.fzL({bullet:{level:0},spacing:{before:0,after:120,line:280},children:[new i.NTc({text:e,size:22,color:l,font:"Aptos"})]}))),n.push(m(e)))}}else n.push(new i.fzL({children:[new i.bjD]})),n.push(new i.fzL({heading:i.Fmo.HEADING_1,children:[new i.NTc("Key findings")]})),0===e.findings.length?n.push(new i.fzL("No directional significance findings were selected for this pack.")):e.findings.forEach(o=>{n.push(new i.fzL({spacing:{before:60,after:40,line:280},children:[new i.NTc({text:o.text,size:22,color:l,font:"Aptos"})]})),n.push(new i.fzL({spacing:{before:0,after:140},children:[new i.ijT({anchor:h(o.evidence.tableId),children:[new i.NTc({text:`Evidence ${o.evidence.tableId} | ${o.evidence.waveId} | R${o.evidence.rowIndex+1}C${o.evidence.columnIndex+1} | ${o.evidence.statistic} | ${g(e,o.evidence.tableId,o.evidence.base,o.evidence.countSemantics)}`,color:t,underline:{},size:18,font:"Aptos"})]})]}))}),n.push(new i.fzL({children:[new i.bjD]})),n.push(new i.fzL({heading:i.Fmo.HEADING_1,children:[new i.NTc("Tables")]})),e.tables.forEach(e=>n.push(...b(e))),n.push(new i.fzL({children:[new i.bjD]})),n.push(new i.fzL({heading:i.Fmo.HEADING_1,children:[new i.NTc("Methods and audit trail")]})),e.methodology.forEach(e=>n.push(new i.fzL({bullet:{level:0},spacing:{before:0,after:120,line:280},children:[new i.NTc({text:e,size:22,color:l,font:"Aptos"})]}))),n.push(m(e));let p=new i.yoT({creator:e.analyst||"Crosstabs",title:e.title,subject:e.subtitle,description:"Editable, evidence-linked Crosstabs research pack",styles:{default:{document:{run:{font:"Aptos",size:22,color:l},paragraph:{spacing:{before:0,after:120,line:264}}}},paragraphStyles:[{id:"Heading1",name:"Heading 1",basedOn:"Normal",next:"Normal",quickFormat:!0,run:{font:"Aptos Display",size:32,bold:!0,color:t},paragraph:{spacing:{before:320,after:160},keepNext:!0}},{id:"Heading2",name:"Heading 2",basedOn:"Normal",next:"Normal",quickFormat:!0,run:{font:"Aptos Display",size:26,bold:!0,color:t},paragraph:{spacing:{before:240,after:120},keepNext:!0}}]},numbering:{config:[{reference:"report-bullets",levels:[{level:0,format:"bullet",text:"â¢",alignment:i.Yus.LEFT,style:{paragraph:{indent:{left:720,hanging:360},spacing:{after:120,line:280}}}}]}]},sections:[{properties:{page:{size:{width:12240,height:15840},margin:{top:1440,right:1440,bottom:1440,left:1440,header:708,footer:708},pageNumbers:{start:1}}},headers:{default:new i.Y9Y({children:[new i.fzL({alignment:i.Yus.RIGHT,border:{bottom:{style:i.kDD.SINGLE,size:4,color:s,space:6}},children:[new i.NTc({text:e.title,color:d,size:17,font:"Aptos"})]})]})},footers:{default:new i.wi6({children:[new i.fzL({alignment:i.Yus.RIGHT,children:[new i.NTc({text:`${e.branding.footer} \xb7 `,color:d,size:17,font:"Aptos"}),new i.NTc({children:[i.nkW.CURRENT],color:d,size:17,font:"Aptos"})]})]})},children:n}]}),f=await i.ND6.toBlob(p);return new Blob([await f.arrayBuffer()],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"})}async function v(e,t){(0,o.downloadBlob)(await z(e),t)}},98417:(e,t,n)=>{function i(e,t){let n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=t,i.click(),URL.revokeObjectURL(n)}n.r(t),n.d(t,{downloadBlob:()=>i})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.