PageSourceSearch

https://uxboost.ai/assets/idea-details-CWAVP4GP.js

js uxboost.ai collected 2026-10-05 13:11:45 UTC 456,617 bytes, 196 lines download raw bytes

vendor: 24,708 bytes, lines 1-7
1import{n as Pi,r as D,j as e,aZ as $t,aA as st,aP as Te,a$ as Ai,bg as le,bB as Mi,T as V,Z as xe,ai as _e,a6 as fs,C as Br,be as $i,aL as J,D as Ke,bC as Ua,$ as tt,aO as Tt,aX as bs,bD as _s,bf as se,Y as re,bE as Ti,H as ls,bx as Ei,aT as me,a9 as ne,aF as De,aN as X,al as qr,ba as Qs,af as Et,ac as Js,bF as ya,bG as nt,a5 as he,by as Ws,bH as Ri,aH as js,bI as wa,bJ as Sa,X as gs,bo as Fi,z as Pa,aU as at,a7 as Hs,S as ie,bK as Ii,bL as zi,V as Ce,bM as _a,bN as Qa,bO as Rt,aG as Di,bv as ee,bz as W,bb as ae,A as Ja,L as Wa,bP as Bi,aR as rt,bQ as Ya,bR as Lr,a1 as Aa,bS as qi,E as Li,bT as Oi,bU as Or,bV as Gi,ah as ds,bW as Ki,bX as Xa,bY as Vi,bZ as Hi,b_ as Ui,ap as Bt,b$ as Kt,aV as Ma,c0 as _i,c1 as Qi,c2 as ka,y as Gr,c3 as Ji,ag as Wi,c4 as Yi,w as Xi,aj as Zi,c5 as Kr,aQ as Vr,c6 as en,c7 as Za,c8 as sn,c9 as Ft,O as tn,ca as an}from"./vendor-react-DKwuZ2v1.js";import{o as Ys,c as Hr,C as m,m as u,n as p,s as O,l as I,h as x,B as R,p as Q,D as L,T as ye,i as we,j as K,k as U,w as $e,x as rn,r as nn,q as ln,F as dn,A as cn,L as Vt,S as on}from"./index-D46ghSAh.js";import{c as mn,d as xn}from"./posthog-events-dSGhUJmY.js";import{P as de}from"./progress-BiWWVaLt.js";import{P as Ht,a as Ut}from"./PageFooter-CRYV934h.js";import{D as ys,f as $a,a as ws,b as ks,c as Cs,d as lt,e as Ta}from"./dialog-CA9fuI2E.js";import{S as Be}from"./separator-9Ylp6Z0Z.js";import{I as ke}from"./input--cYI6Yb-.js";import{L as Ea}from"./label-BQL8ElDN.js";import{m as Y,A as Ur}from"./vendor-motion-PbuSa1Se.js";import{a4 as hn,a5 as un,a6 as pn,n as gn,r as jn,o as fn,p as _r,s as bn,t as Qr,v as Jr,O as Wr}from"./vendor-radix-DqtksRc0.js";import{A as Ns,a as vs}from"./alert-CR0Wv5Qe.js";import{h as Nn,Z as vn,a as Ra,F as Fa,b as pe,c as ge,d as ce,e as je,f as ve,o as Ia,_ as Yr,s as ze,r as yn,i as er}from"./form-D0l3lw_v.js";import{T as it}from"./textarea-D6aOO0k-.js";import{S as Xr,a as Zr,b as ei,c as si,d as Us}from"./select-DJwQ6s4F.js";import{C as It}from"./checkbox-CTNGv6ck.js";import{S as zt}from"./scroll-area-_YTzu34L.js";import"./vendor-export-CHQMlXGh.js";import"./Logo-CsPjZna1.js";import"./constants-DDe6MYDK.js";function wn(s){return Nn(vn,s)}var Ks={},_t,sr;function kn(){return sr||(sr=1,_t=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),_t}var Qt={},is={},tr;function Ss(){if(tr)return is;tr=1;let s;const i=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return is.getSymbolSize=function(a){if(!a)throw new Error('"version" cannot be null or undefined');if(a<1||a>40)throw new Error('"version" should be in range from 1 to 40');return a*4+17},is.getSymbolTotalCodewords=function(a){return i[a]},is.getBCHDigit=function(l){let a=0;for(;l!==0;)a++,l>>>=1;return a},is.setToSJISFunction=function(a){if(typeof a!="function")throw new Error('"toSJISFunc" is not a valid function.');s=a},is.isKanjiModeEnabled=function(){return typeof s<"u"},is.toSJIS=function(a){return s(a)},is}var Jt={},ar;function za(){return ar||(ar=1,(function(s){s.L={bit:1},s.M={bit:0},s.Q={bit:3},s.H={bit:2};function i(l){if(typeof l!="string")throw new Error("Param is not a string");switch(l.toLowerCase()){case"l":case"low":return s.L;case"m":case"medium":return s.M;case"q":case"quartile":return s.Q;case"h":case"high":return s.H;default:throw new Error("Unknown EC Level: "+l)}}s.isValid=function(a){return a&&typeof a.bit<"u"&&a.bit>=0&&a.bit<4},s.from=function(a,t){if(s.isValid(a))return a;try{return i(a)}catch{return t}}})(Jt)),Jt}var Wt,rr;function Cn(){if(rr)return Wt;rr=1;function s(){this.buffer=[],this.length=0}return s.prototype={get:function(i){const l=Math.floor(i/8);return(this.buffer[l]>>>7-i%8&1)===1},put:function(i,l){for(let a=0;a<l;a++)this.putBit((i>>>l-a-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(i){const l=Math.floor(this.length/8);this.buffer.length<=l&&this.buffer.push(0),i&&(this.buffer[l]|=128>>>this.length%8),this.length++}},Wt=s,Wt}var Yt,ir;function Sn(){if(ir)return Yt;ir=1;function s(i){if(!i||i<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=i,this.data=new Uint8Array(i*i),this.reservedBit=new Uint8Array(i*i)}return s.prototype.set=function(i,l,a,t){const r=i*this.size+l;this.data[r]=a,t&&(this.reservedBit[r]=!0)},s.prototype.get=function(i,l){return this.data[i*this.size+l]},s.prototype.xor=function(i,l,a){this.data[i*this.size+l]^=a},s.prototype.isReserved=function(i,l){return this.reservedBit[i*this.size+l]},Yt=s,Yt}var Xt={},nr;function Pn(){return nr||(nr=1,(function(s){const i=Ss().getSymbolSize;s.getRowColCoords=function(a){if(a===1)return[];const t=Math.floor(a/7)+2,r=i(a),c=r===145?26:Math.ceil((r-13)/(2*t-2))*2,n=[r-7];for(let d=1;d<t-1;d++)n[d]=n[d-1]-c;return n.push(6),n.reverse()},s.getPositions=function(a){const t=[],r=s.getRowColCoords(a),c=r.length;for(let n=0;n<c;n++)for(let d=0;d<c;d++)n===0&&d===0||n===0&&d===c-1||n===c-1&&d===0||t.push([r[n],r[d]]);return t}})(Xt)),Xt}var Zt={},lr;function An(){if(lr)return Zt;lr=1;const s=Ss().getSymbolSize,i=7;return Zt.getPositions=function(a){const t=s(a);return[[0,0],[t-i,0],[0,t-i]]},Zt}var ea={},dr;function Mn(){return dr||(dr=1,(function(s){s.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const i={N1:3,N2:3,N3:40,N4:10};s.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7},s.from=function(t){return s.isValid(t)?parseInt(t,10):void 0},s.getPenaltyN1=function(t){const r=t.size;let c=0,n=0,d=0,o=null,g=null;for(let h=0;h<r;h++){n=d=0,o=g=null;for(let f=0;f<r;f++){let b=t.get(h,f);b===o?n++:(n>=5&&(c+=i.N1+(n-5)),o=b,n=1),b=t.get(f,h),b===g?d++:(d>=5&&(c+=i.N1+(d-5)),g=b,d=1)}n>=5&&(c+=i.N1+(n-5)),d>=5&&(c+=i.N1+(d-5))}return c},s.getPenaltyN2=function(t){const r=t.size;let c=0;for(let n=0;n<r-1;n++)for(let d=0;d<r-1;d++){const o=t.get(n,d)+t.get(n,d+1)+t.get(n+1,d)+t.get(n+1,d+1);(o===4||o===0)&&c++}return c*i.N2},s.getPenaltyN3=function(t){const r=t.size;let c=0,n=0,d=0;for(let o=0;o<r;o++){n=d=0;for(let g=0;g<r;g++)n=n<<1&2047|t.get(o,g),g>=10&&(n===1488||n===93)&&c++,d=d<<1&2047|t.get(g,o),g>=10&&(d===1488||d===93)&&c++}return c*i.N3},s.getPenaltyN4=function(t){let r=0;const c=t.data.length;for(let d=0;d<c;d++)r+=t.data[d];return Math.abs(Math.ceil(r*100/c/5)-10)*i.N4};function l(a,t,r){switch(a){case s.Patterns.PATTERN000:return(t+r)%2===0;case s.Patterns.PATTERN001:return t%2===0;case s.Patterns.PATTERN010:return r%3===0;case s.Patterns.PATTERN011:return(t+r)%3===0;case s.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2===0;case s.Patterns.PATTERN101:return t*r%2+t*r%3===0;case s.Patterns.PATTERN110:return(t*r%2+t*r%3)%2===0;case s.Patterns.PATTERN111:return(t*r%3+(t+r)%2)%2===0;default:throw new Error("bad maskPattern:"+a)}}s.applyMask=function(t,r){const c=r.size;for(let n=0;n<c;n++)for(let d=0;d<c;d++)r.isReserved(d,n)||r.xor(d,n,l(t,d,n))},s.getBestMask=function(t,r){const c=Object.keys(s.Patterns).length;let n=0,d=1/0;for(let o=0;o<c;o++){r(o),s.applyMask(o,t);const g=s.getPenaltyN1(t)+s.getPenaltyN2(t)+s.getPenaltyN3(t)+s.getPenaltyN4(t);s.applyMask(o,t),g<d&&(d=g,n=o)}return n}})(ea)),ea}var vt={},cr;function ti(){if(cr)return vt;cr=1;const s=za(),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],l=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return vt.getBlocksCount=function(t,r){switch(r){case s.L:return i[(t-1)*4+0];case s.M:return i[(t-1)*4+1];case s.Q:return i[(t-1)*4+2];case s.H:return i[(t-1)*4+3];default:return}},vt.getTotalCodewordsCount=function(t,r){switch(r){case s.L:return l[(t-1)*4+0];case s.M:return l[(t-1)*4+1];case s.Q:return l[(t-1)*4+2];case s.H:return l[(t-1)*4+3];default:return}},vt}var sa={},et={},or;function $n(){if(or)return et;or=1;const s=new Uint8Array(512),i=new Uint8Array(256);return(function(){let a=1;for(let t=0;t<255;t++)s[t]=a,i[a]=t,a<<=1,a&256&&(a^=285);for(let t=255;t<512;t++)s[t]=s[t-255]})(),et.log=function(a){if(a<1)throw new Error("log("+a+")");return i[a]},et.exp=function(a){return s[a]},et.mul=function(a,t){return a===0||t===0?0:s[i[a]+i[t]]},et}var mr;function Tn(){return mr||(mr=1,(function(s){const i=$n();s.mul=function(a,t){const r=new Uint8Array(a.length+t.length-1);for(let c=0;c<a.length;c++)for(let n=0;n<t.length;n++)r[c+n]^=i.mul(a[c],t[n]);return r},s.mod=function(a,t){let r=new Uint8Array(a);for(;r.length-t.length>=0;){const c=r[0];for(let d=0;d<t.length;d++)r[d]^=i.mul(t[d],c);let n=0;for(;n<r.length&&r[n]===0;)n++;r=r.slice(n)}return r},s.generateECPolynomial=function(a){let t=new Uint8Array([1]);for(let r=0;r<a;r++)t=s.mul(t,new Uint8Array([1,i.exp(r)]));return t}})(sa)),sa}var ta,xr;function En(){if(xr)return ta;xr=1;const s=Tn();function i(l){this.genPoly=void 0,this.degree=l,this.degree&&this.initialize(this.degree)}return i.prototype.initialize=function(a){this.degree=a,this.genPoly=s.generateECPolynomial(this.degree)},i.prototype.encode=function(a){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(a.length+this.degree);t.set(a);const r=s.mod(t,this.genPoly),c=this.degree-r.length;if(c>0){const n=new Uint8Array(this.degree);return n.set(r,c),n}return r},ta=i,ta}var aa={},ra={},ia={},hr;function ai(){return hr||(hr=1,ia.isValid=function(i){return!isNaN(i)&&i>=1&&i<=40}),ia}var Oe={},ur;function ri(){if(ur)return Oe;ur=1;const s="[0-9]+",i="[A-Z $%*+\\-./:]+";let l="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";l=l.replace(/u/g,"\\u");const a="(?:(?![A-Z0-9 $%*+\\-./:]|"+l+`)(?:.|[\r
2]))+`;Oe.KANJI=new RegExp(l,"g"),Oe.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Oe.BYTE=new RegExp(a,"g"),Oe.NUMERIC=new RegExp(s,"g"),Oe.ALPHANUMERIC=new RegExp(i,"g");const t=new RegExp("^"+l+"$"),r=new RegExp("^"+s+"$"),c=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Oe.testKanji=function(d){return t.test(d)},Oe.testNumeric=function(d){return r.test(d)},Oe.testAlphanumeric=function(d){return c.test(d)},Oe}var pr;function Ps(){return pr||(pr=1,(function(s){const i=ai(),l=ri();s.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},s.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},s.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},s.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},s.MIXED={bit:-1},s.getCharCountIndicator=function(r,c){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!i.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?r.ccBits[0]:c<27?r.ccBits[1]:r.ccBits[2]},s.getBestModeForData=function(r){return l.testNumeric(r)?s.NUMERIC:l.testAlphanumeric(r)?s.ALPHANUMERIC:l.testKanji(r)?s.KANJI:s.BYTE},s.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},s.isValid=function(r){return r&&r.bit&&r.ccBits};function a(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return s.NUMERIC;case"alphanumeric":return s.ALPHANUMERIC;case"kanji":return s.KANJI;case"byte":return s.BYTE;default:throw new Error("Unknown mode: "+t)}}s.from=function(r,c){if(s.isValid(r))return r;try{return a(r)}catch{return c}}})(ra)),ra}var gr;function Rn(){return gr||(gr=1,(function(s){const i=Ss(),l=ti(),a=za(),t=Ps(),r=ai(),c=7973,n=i.getBCHDigit(c);function d(f,b,y){for(let S=1;S<=40;S++)if(b<=s.getCapacity(S,y,f))return S}function o(f,b){return t.getCharCountIndicator(f,b)+4}function g(f,b){let y=0;return f.forEach(function(S){const N=o(S.mode,b);y+=N+S.getBitsLength()}),y}function h(f,b){for(let y=1;y<=40;y++)if(g(f,y)<=s.getCapacity(y,b,t.MIXED))return y}s.from=function(b,y){return r.isValid(b)?parseInt(b,10):y},s.getCapacity=function(b,y,S){if(!r.isValid(b))throw new Error("Invalid QR Code version");typeof S>"u"&&(S=t.BYTE);const N=i.getSymbolTotalCodewords(b),w=l.getTotalCodewordsCount(b,y),P=(N-w)*8;if(S===t.MIXED)return P;const C=P-o(S,b);switch(S){case t.NUMERIC:return Math.floor(C/10*3);case t.ALPHANUMERIC:return Math.floor(C/11*2);case t.KANJI:return Math.floor(C/13);case t.BYTE:default:return Math.floor(C/8)}},s.getBestVersionForData=function(b,y){let S;const N=a.from(y,a.M);if(Array.isArray(b)){if(b.length>1)return h(b,N);if(b.length===0)return 1;S=b[0]}else S=b;return d(S.mode,S.getLength(),N)},s.getEncodedBits=function(b){if(!r.isValid(b)||b<7)throw new Error("Invalid QR Code version");let y=b<<12;for(;i.getBCHDigit(y)-n>=0;)y^=c<<i.getBCHDigit(y)-n;return b<<12|y}})(aa)),aa}var na={},jr;function Fn(){if(jr)return na;jr=1;const s=Ss(),i=1335,l=21522,a=s.getBCHDigit(i);return na.getEncodedBits=function(r,c){const n=r.bit<<3|c;let d=n<<10;for(;s.getBCHDigit(d)-a>=0;)d^=i<<s.getBCHDigit(d)-a;return(n<<10|d)^l},na}var la={},da,fr;function In(){if(fr)return da;fr=1;const s=Ps();function i(l){this.mode=s.NUMERIC,this.data=l.toString()}return i.getBitsLength=function(a){return 10*Math.floor(a/3)+(a%3?a%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(a){let t,r,c;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),c=parseInt(r,10),a.put(c,10);const n=this.data.length-t;n>0&&(r=this.data.substr(t),c=parseInt(r,10),a.put(c,n*3+1))},da=i,da}var ca,br;function zn(){if(br)return ca;br=1;const s=Ps(),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function l(a){this.mode=s.ALPHANUMERIC,this.data=a}return l.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},l.prototype.getLength=function(){return this.data.length},l.prototype.getBitsLength=function(){return l.getBitsLength(this.data.length)},l.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let c=i.indexOf(this.data[r])*45;c+=i.indexOf(this.data[r+1]),t.put(c,11)}this.data.length%2&&t.put(i.indexOf(this.data[r]),6)},ca=l,ca}var oa,Nr;function Dn(){if(Nr)return oa;Nr=1;const s=Ps();function i(l){this.mode=s.BYTE,typeof l=="string"?this.data=new TextEncoder().encode(l):this.data=new Uint8Array(l)}return i.getBitsLength=function(a){return a*8},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(l){for(let a=0,t=this.data.length;a<t;a++)l.put(this.data[a],8)},oa=i,oa}var ma,vr;function Bn(){if(vr)return ma;vr=1;const s=Ps(),i=Ss();function l(a){this.mode=s.KANJI,this.data=a}return l.getBitsLength=function(t){return t*13},l.prototype.getLength=function(){return this.data.length},l.prototype.getBitsLength=function(){return l.getBitsLength(this.data.length)},l.prototype.write=function(a){let t;for(t=0;t<this.data.length;t++){let r=i.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
3Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),a.put(r,13)}},ma=l,ma}var xa={exports:{}},yr;function qn(){return yr||(yr=1,(function(s){var i={single_source_shortest_paths:function(l,a,t){var r={},c={};c[a]=0;var n=i.PriorityQueue.make();n.push(a,0);for(var d,o,g,h,f,b,y,S,N;!n.empty();){d=n.pop(),o=d.value,h=d.cost,f=l[o]||{};for(g in f)f.hasOwnProperty(g)&&(b=f[g],y=h+b,S=c[g],N=typeof c[g]>"u",(N||S>y)&&(c[g]=y,n.push(g,y),r[g]=o))}if(typeof t<"u"&&typeof c[t]>"u"){var w=["Could not find a path from ",a," to ",t,"."].join("");throw new Error(w)}return r},extract_shortest_path_from_predecessor_list:function(l,a){for(var t=[],r=a;r;)t.push(r),l[r],r=l[r];return t.reverse(),t},find_path:function(l,a,t){var r=i.single_source_shortest_paths(l,a,t);return i.extract_shortest_path_from_predecessor_list(r,t)},PriorityQueue:{make:function(l){var a=i.PriorityQueue,t={},r;l=l||{};for(r in a)a.hasOwnProperty(r)&&(t[r]=a[r]);return t.queue=[],t.sorter=l.sorter||a.default_sorter,t},default_sorter:function(l,a){return l.cost-a.cost},push:function(l,a){var t={value:l,cost:a};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};s.exports=i})(xa)),xa.exports}var wr;function Ln(){return wr||(wr=1,(function(s){const i=Ps(),l=In(),a=zn(),t=Dn(),r=Bn(),c=ri(),n=Ss(),d=qn();function o(w){return unescape(encodeURIComponent(w)).length}function g(w,P,C){const v=[];let T;for(;(T=w.exec(C))!==null;)v.push({data:T[0],index:T.index,mode:P,length:T[0].length});return v}function h(w){const P=g(c.NUMERIC,i.NUMERIC,w),C=g(c.ALPHANUMERIC,i.ALPHANUMERIC,w);let v,T;return n.isKanjiModeEnabled()?(v=g(c.BYTE,i.BYTE,w),T=g(c.KANJI,i.KANJI,w)):(v=g(c.BYTE_KANJI,i.BYTE,w),T=[]),P.concat(C,v,T).sort(function(A,z){return A.index-z.index}).map(function(A){return{data:A.data,mode:A.mode,length:A.length}})}function f(w,P){switch(P){case i.NUMERIC:return l.getBitsLength(w);case i.ALPHANUMERIC:return a.getBitsLength(w);case i.KANJI:return r.getBitsLength(w);case i.BYTE:return t.getBitsLength(w)}}function b(w){return w.reduce(function(P,C){const v=P.length-1>=0?P[P.length-1]:null;return v&&v.mode===C.mode?(P[P.length-1].data+=C.data,P):(P.push(C),P)},[])}function y(w){const P=[];for(let C=0;C<w.length;C++){const v=w[C];switch(v.mode){case i.NUMERIC:P.push([v,{data:v.data,mode:i.ALPHANUMERIC,length:v.length},{data:v.data,mode:i.BYTE,length:v.length}]);break;case i.ALPHANUMERIC:P.push([v,{data:v.data,mode:i.BYTE,length:v.length}]);break;case i.KANJI:P.push([v,{data:v.data,mode:i.BYTE,length:o(v.data)}]);break;case i.BYTE:P.push([{data:v.data,mode:i.BYTE,length:o(v.data)}])}}return P}function S(w,P){const C={},v={start:{}};let T=["start"];for(let $=0;$<w.length;$++){const A=w[$],z=[];for(let F=0;F<A.length;F++){const k=A[F],E=""+$+F;z.push(E),C[E]={node:k,lastCount:0},v[E]={};for(let B=0;B<T.length;B++){const q=T[B];C[q]&&C[q].node.mode===k.mode?(v[q][E]=f(C[q].lastCount+k.length,k.mode)-f(C[q].lastCount,k.mode),C[q].lastCount+=k.length):(C[q]&&(C[q].lastCount=k.length),v[q][E]=f(k.length,k.mode)+4+i.getCharCountIndicator(k.mode,P))}}T=z}for(let $=0;$<T.length;$++)v[T[$]].end=0;return{map:v,table:C}}function N(w,P){let C;const v=i.getBestModeForData(w);if(C=i.from(P,v),C!==i.BYTE&&C.bit<v.bit)throw new Error('"'+w+'" cannot be encoded with mode '+i.toString(C)+`.
4 Suggested mode is: `+i.toString(v));switch(C===i.KANJI&&!n.isKanjiModeEnabled()&&(C=i.BYTE),C){case i.NUMERIC:return new l(w);case i.ALPHANUMERIC:return new a(w);case i.KANJI:return new r(w);case i.BYTE:return new t(w)}}s.fromArray=function(P){return P.reduce(function(C,v){return typeof v=="string"?C.push(N(v,null)):v.data&&C.push(N(v.data,v.mode)),C},[])},s.fromString=function(P,C){const v=h(P,n.isKanjiModeEnabled()),T=y(v),$=S(T,C),A=d.find_path($.map,"start","end"),z=[];for(let F=1;F<A.length-1;F++)z.push($.table[A[F]].node);return s.fromArray(b(z))},s.rawSplit=function(P){return s.fromArray(h(P,n.isKanjiModeEnabled()))}})(la)),la}var kr;function On(){if(kr)return Qt;kr=1;const s=Ss(),i=za(),l=Cn(),a=Sn(),t=Pn(),r=An(),c=Mn(),n=ti(),d=En(),o=Rn(),g=Fn(),h=Ps(),f=Ln();function b($,A){const z=$.size,F=r.getPositions(A);for(let k=0;k<F.length;k++){const E=F[k][0],B=F[k][1];for(let q=-1;q<=7;q++)if(!(E+q<=-1||z<=E+q))for(let H=-1;H<=7;H++)B+H<=-1||z<=B+H||(q>=0&&q<=6&&(H===0||H===6)||H>=0&&H<=6&&(q===0||q===6)||q>=2&&q<=4&&H>=2&&H<=4?$.set(E+q,B+H,!0,!0):$.set(E+q,B+H,!1,!0))}}function y($){const A=$.size;for(let z=8;z<A-8;z++){const F=z%2===0;$.set(z,6,F,!0),$.set(6,z,F,!0)}}function S($,A){const z=t.getPositions(A);for(let F=0;F<z.length;F++){const k=z[F][0],E=z[F][1];for(let B=-2;B<=2;B++)for(let q=-2;q<=2;q++)B===-2||B===2||q===-2||q===2||B===0&&q===0?$.set(k+B,E+q,!0,!0):$.set(k+B,E+q,!1,!0)}}function N($,A){const z=$.size,F=o.getEncodedBits(A);let k,E,B;for(let q=0;q<18;q++)k=Math.floor(q/3),E=q%3+z-8-3,B=(F>>q&1)===1,$.set(k,E,B,!0),$.set(E,k,B,!0)}function w($,A,z){const F=$.size,k=g.getEncodedBits(A,z);let E,B;for(E=0;E<15;E++)B=(k>>E&1)===1,E<6?$.set(E,8,B,!0):E<8?$.set(E+1,8,B,!0):$.set(F-15+E,8,B,!0),E<8?$.set(8,F-E-1,B,!0):E<9?$.set(8,15-E-1+1,B,!0):$.set(8,15-E-1,B,!0);$.set(F-8,8,1,!0)}function P($,A){const z=$.size;let F=-1,k=z-1,E=7,B=0;for(let q=z-1;q>0;q-=2)for(q===6&&q--;;){for(let H=0;H<2;H++)if(!$.isReserved(k,q-H)){let Ee=!1;B<A.length&&(Ee=(A[B]>>>E&1)===1),$.set(k,q-H,Ee),E--,E===-1&&(B++,E=7)}if(k+=F,k<0||z<=k){k-=F,F=-F;break}}}function C($,A,z){const F=new l;z.forEach(function(H){F.put(H.mode.bit,4),F.put(H.getLength(),h.getCharCountIndicator(H.mode,$)),H.write(F)});const k=s.getSymbolTotalCodewords($),E=n.getTotalCodewordsCount($,A),B=(k-E)*8;for(F.getLengthInBits()+4<=B&&F.put(0,4);F.getLengthInBits()%8!==0;)F.putBit(0);const q=(B-F.getLengthInBits())/8;for(let H=0;H<q;H++)F.put(H%2?17:236,8);return v(F,$,A)}function v($,A,z){const F=s.getSymbolTotalCodewords(A),k=n.getTotalCodewordsCount(A,z),E=F-k,B=n.getBlocksCount(A,z),q=F%B,H=B-q,Ee=Math.floor(F/B),cs=Math.floor(E/B),As=cs+1,ct=Ee-cs,G=new d(ct);let _=0;const Ve=new Array(B),os=new Array(B);let Qe=0;const qe=new Uint8Array($.buffer);for(let Se=0;Se<B;Se++){const He=Se<H?cs:As;Ve[Se]=qe.slice(_,_+He),os[Se]=G.encode(Ve[Se]),_+=He,Qe=Math.max(Qe,He)}const fe=new Uint8Array(F);let Je=0,ue,be;for(ue=0;ue<Qe;ue++)for(be=0;be<B;be++)ue<Ve[be].length&&(fe[Je++]=Ve[be][ue]);for(ue=0;ue<ct;ue++)for(be=0;be<B;be++)fe[Je++]=os[be][ue];return fe}function T($,A,z,F){let k;if(Array.isArray($))k=f.fromArray($);else if(typeof $=="string"){let Ee=A;if(!Ee){const cs=f.rawSplit($);Ee=o.getBestVersionForData(cs,z)}k=f.fromString($,Ee||40)}else throw new Error("Invalid data");const E=o.getBestVersionForData(k,z);if(!E)throw new Error("The amount of data is too big to be stored in a QR Code");if(!A)A=E;else if(A<E)throw new Error(`
5The chosen QR Code version cannot contain this amount of data.
6Minimum version required to store current data is: `+E+`.
7`);const B=C(A,z,k),q=s.getSymbolSize(A),H=new a(q);return b(H,A),y(H),S(H,A),w(H,z,0),A>=7&&N(H,A),P(H,B),isNaN(F)&&(F=c.getBestMask(H,w.bind(null,H,z))),c.applyMask(F,H),w(H,z,F),{modules:H,version:A,errorCorrectionLevel:z,maskPattern:F,segments:k}}return Qt.create=function(A,z){if(typeof A>"u"||A==="")throw new Error("No input text");let F=i.M,k,E;return typeof z<"u"&&(F=i.from(z.errorCorrectionLevel,i.M),k=o.from(z.version),E=c.from(z.maskPattern),z.toSJISFunc&&s.setToSJISFunction(z.toSJISFunc)),T(A,k,F,E)},Qt}var ha={},ua={},Cr;function ii(){return Cr||(Cr=1,(function(s){function i(l){if(typeof l=="number"&&(l=l.toString()),typeof l!="string")throw new Error("Color should be defined as hex string");let a=l.slice().replace("#","").split("");if(a.length<3||a.length===5||a.length>8)throw new Error("Invalid hex color: "+l);(a.length===3||a.length===4)&&(a=Array.prototype.concat.apply([],a.map(function(r){return[r,r]}))),a.length===6&&a.push("F","F");const t=parseInt(a.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+a.slice(0,6).join("")}}s.getOptions=function(a){a||(a={}),a.color||(a.color={});const t=typeof a.margin>"u"||a.margin===null||a.margin<0?4:a.margin,r=a.width&&a.width>=21?a.width:void 0,c=a.scale||4;return{width:r,scale:r?4:c,margin:t,color:{dark:i(a.color.dark||"#000000ff"),light:i(a.color.light||"#ffffffff")},type:a.type,rendererOpts:a.rendererOpts||{}}},s.getScale=function(a,t){return t.width&&t.width>=a+t.margin*2?t.width/(a+t.margin*2):t.scale},s.getImageWidth=function(a,t){const r=s.getScale(a,t);return Math.floor((a+t.margin*2)*r)},s.qrToImageData=function(a,t,r){const c=t.modules.size,n=t.modules.data,d=s.get
7Scale(c,r),o=Math.floor((c+r.margin*2)*d),g=r.margin*d,h=[r.color.light,r.color.dark];for(let f=0;f<o;f++)for(let b=0;b<o;b++){let y=(f*o+b)*4,S=r.color.light;if(f>=g&&b>=g&&f<o-g&&b<o-g){const N=Math.floor((f-g)/d),w=Math.floor((b-g)/d);S=h[n[N*c+w]?1:0]}a[y++]=S.r,a[y++]=S.g,a[y++]=S.b,a[y]=S.a}}})(ua)),ua}var Sr;function Gn(){return Sr||(Sr=1,(function(s){const i=ii();function l(t,r,c){t.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=c,r.width=c,r.style.height=c+"px",r.style.width=c+"px"}function a(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}s.render=function(r,c,n){let d=n,o=c;typeof d>"u"&&(!c||!c.getContext)&&(d=c,c=void 0),c||(o=a()),d=i.getOptions(d);const g=i.getImageWidth(r.modules.size,d),h=o.getContext("2d"),f=h.createImageData(g,g);return i.qrToImageData(f.data,r,d),l(h,o,g),h.putImageData(f,0,0),o},s.renderToDataURL=function(r,c,n){let d=n;typeof d>"u"&&(!c||!c.getContext)&&(d=c,c=void 0),d||(d={});const o=s.render(r,c,d),g=d.type||"image/png",h=d.rendererOpts||{};return o.toDataURL(g,h.quality)}})(ha)),ha}var pa={},Pr;function Kn(){if(Pr)return pa;Pr=1;const s=ii();function i(t,r){const c=t.a/255,n=r+'="'+t.hex+'"';return c<1?n+" "+r+'-opacity="'+c.toFixed(2).slice(1)+'"':n}function l(t,r,c){let n=t+r;return typeof c<"u"&&(n+=" "+c),n}function a(t,r,c){let n="",d=0,o=!1,g=0;for(let h=0;h<t.length;h++){const f=Math.floor(h%r),b=Math.floor(h/r);!f&&!o&&(o=!0),t[h]?(g++,h>0&&f>0&&t[h-1]||(n+=o?l("M",f+c,.5+b+c):l("m",d,0),d=0,o=!1),f+1<r&&t[h+1]||(n+=l("h",g),g=0)):d++}return n}return pa.render=function(r,c,n){const d=s.getOptions(c),o=r.modules.size,g=r.modules.data,h=o+d.margin*2,f=d.color.light.a?"<path "+i(d.color.light,"fill")+' d="M0 0h'+h+"v"+h+'H0z"/>':"",b="<path "+i(d.color.dark,"stroke")+' d="'+a(g,o,d.margin)+'"/>',y='viewBox="0 0 '+h+" "+h+'"',N='<svg xmlns="http://www.w3.org/2000/svg" '+(d.width?'width="'+d.width+'" height="'+d.width+'" ':"")+y+' shape-rendering="crispEdges">'+f+b+`</svg>
8`;return typeof n=="function"&&n(null,N),N},pa}var Ar;function Vn(){if(Ar)return Ks;Ar=1;const s=kn(),i=On(),l=Gn(),a=Kn();function t(r,c,n,d,o){const g=[].slice.call(arguments,1),h=g.length,f=typeof g[h-1]=="function";if(!f&&!s())throw new Error("Callback required as last argument");if(f){if(h<2)throw new Error("Too few arguments provided");h===2?(o=n,n=c,c=d=void 0):h===3&&(c.getContext&&typeof o>"u"?(o=d,d=void 0):(o=d,d=n,n=c,c=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(n=c,c=d=void 0):h===2&&!c.getContext&&(d=n,n=c,c=void 0),new Promise(function(b,y){try{const S=i.create(n,d);b(r(S,c,d))}catch(S){y(S)}})}try{const b=i.create(n,d);o(null,r(b,c,d))}catch(b){o(b)}}return Ks.create=i.create,Ks.toCanvas=t.bind(null,l.render),Ks.toDataURL=t.bind(null,l.renderToDataURL),Ks.toString=t.bind(null,function(r,c,n){return a.render(r,n)}),Ks}var Hn=Vn();const Un=Pi(Hn);function _n({personas:s,personaFilter:i,ideaSyntheticId:l}){const{toast:a}=Ys(),[,t]=Hr(),[r,c]=D.useState(null),[n,d]=D.useState({}),[o,g]=D.useState(null),h=i?s.filter(N=>N.id===i):s;D.useEffect(()=>{h.forEach(N=>{if(N.survey&&!n[N.survey.syntheticId]){const w=`${window.location.origin}/survey/${N.survey.syntheticId}`;Un.toDataURL(w,{width:200,margin:2,color:{dark:"#000000",light:"#FFFFFF"}}).then(P=>{d(C=>({...C,[N.survey.syntheticId]:P}))}).catch(console.error)}})},[h]);const f=async N=>{if(l)try{c(N),await Q({method:"POST",url:`/api/idea-prioritization/${l}/personas/${N}/survey/regenerate`}),L.invalidateQueries({queryKey:[`/api/idea-prioritization/${l}/personas`]}),a({title:"Survey Regenerated",description:"New survey questions have been generated successfully"})}catch(w){a({title:"Error",description:w.message||"Failed to regenerate survey",variant:"destructive"})}finally{c(null)}},b=async(N,w)=>{try{const P=N.questions.map((T,$)=>{let A=`${$+1}. ${T.question}`;return T.options&&Array.isArray(T.options)&&(A+=`
9   Options: `+T.options.join(", ")),A}).join(`
10
11`),C={title:`Survey Questions: ${w}`,content:P,contentType:"survey",context:`Persona Survey for ${w}. Survey Title: ${N.title}`},v=await Q({method:"POST",url:"/api/bias-submissions",data:C});a({title:"Bias Check Started",description:"Analyzing survey questions for c
11ognitive biases..."}),t(`/bias-detection/${v.data.syntheticId}`)}catch(P){a({title:"Error",description:P.message||"Failed to start bias check",variant:"destructive"})}},y=async(N,w)=>{try{await navigator.clipboard.writeText(N),g(w),setTimeout(()=>g(null),2e3),a({title:"Link Copied",description:"Survey link copied to clipboard"})}catch{a({title:"Error",description:"Failed to copy link",variant:"destructive"})}};if(h.length===0)return e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No target personas generated yet."});const S={primary:"bg-green-100 text-green-800",secondary:"bg-blue-100 text-blue-800",tertiary:"bg-purple-100 text-purple-800"};return e.jsx("div",{className:"space-y-8",children:h.map(N=>{const w=N.survey?`${window.location.origin}/survey/${N.survey.syntheticId}`:"";return e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(m,{className:"border-2 hover:border-primary/50 transition-colors","data-testid":`card-persona-${N.id}`,children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs(p,{className:"text-xl flex items-center gap-2",children:[e.jsx($t,{className:"w-5 h-5 text-primary"}),N.name]}),e.jsxs(O,{className:"mt-1 flex items-center gap-2",children:[e.jsx(st,{className:"w-4 h-4"}),N.title]})]}),e.jsx(I,{className:S[N.priority],children:N.priority})]})}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-foreground",children:[e.jsx(Te,{className:"w-4 h-4"}),e.jsx("span",{children:N.ageRange})]}),e.jsxs("div",{className:"flex items-center gap-2 text-foreground",children:[e.jsx(Ai,{className:"w-4 h-4"}),e.jsx("span",{children:N.location})]}),e.jsxs("div",{className:"flex items-center gap-2 text-foreground",children:[e.jsx(le,{className:"w-4 h-4"}),e.jsx("span",{children:N.buyingPower})]}),e.jsxs("div",{className:"flex items-center gap-2 text-foreground",children:[e.jsx(Mi,{className:"w-4 h-4"}),e.jsx("span",{children:N.decisionMakingRole})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[e.jsx(V,{className:"w-4 h-4 text-blue-600"}),"Goals"]}),e.jsx("ul",{className:"text-sm space-y-1 text-foreground",children:N.goals.map((P,C)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-1",children:"•"}),e.jsx("span",{children:P})]},C))})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[e.jsx(xe,{className:"w-4 h-4 text-red-600"}),"Pain Points"]}),e.jsx("ul",{className:"text-sm space-y-1 text-foreground",children:N.painPoints.map((P,C)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-red-600 mt-1",children:"•"}),e.jsx("span",{children:P})]},C))})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[e.jsx(_e,{className:"w-4 h-4 text-purple-600"}),"Motivations"]}),e.jsx("ul",{className:"text-sm space-y-1 text-foreground",children:N.motivations.map((P,C)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-purple-600 mt-1",children:"•"}),e.jsx("span",{children:P})]},C))})]})]}),N.quote&&e.jsx("div",{className:"bg-muted/50 p-4 rounded-lg border-l-4 border-primary",children:e.jsxs("p",{className:"text-sm italic text-foreground",children:['"',N.quote,'"']})})]})]}),N.survey&&e.jsxs(m,{className:"border-2 border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsxs(u,{children:[e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs(p,{className:"text-lg flex items-center gap-2",children:[e.jsx(fs,{className:"w-5 h-5 text-blue-600"}),N.survey.title]}),N.survey.description&&e.jsx(O,{className:"mt-1",children:N.survey.description})]})}),e.jsxs("div",{className:"flex items-center gap-2 mt-3 text-sm text-foreground",children:[e.jsx(Te,{className:"w-4 h-4"}),e.jsxs("span",{children:[N.survey.estimatedTime||5," min"]}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:[N.survey.questions.length," questions"]})]})]}),e.jsxs(x,{className:"space-y-4",children:[n[N.survey.syntheticId]&&e.jsx("div",{className:"flex justify-center bg-white p-4 rounded-lg border border-border",children:e.jsxs("div",{className:"text-center",children:[e.jsx("img",{src:n[N.survey.syntheticId],alt:"Survey QR Code",className:"w-48 h-48 mx-auto"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Scan to access survey"})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-foreground",children:"Survey Link"}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsx("input",{type:"text",readOnly:!0,value:w,className:"flex-1 px-3 py-2 border border-border rounded-full text-xs bg-muted/50","data-testid":`input-survey-url-${N.id}`}),e.jsx(R,{size:"sm",onClick:()=>y(w,N.survey.syntheticId),className:"rounded-full","data-testid":`button-copy-url-${N.id}`,children:o===N.survey.syntheticId?e.jsx(Br,{className:"w-4 h-4"}):e.jsx($i,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Questions Preview"}),e.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[N.survey.questions.slice(0,5).map((P,C)=>e.jsxs("div",{className:"text-xs p-2 bg-white rounded border border-border",children:[e.jsxs("p",{className:"font-medium text-foreground",children:[C+1,". ",P.question]}),P.type&&e.jsxs("p",{className:"text-muted-foreground mt-1",children:["Type: ",P.type]})]},C)),N.survey.questions.length>5&&e.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["+",N.survey.questions.length-5," more questions"]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 pt-2 border-t border-border",children:[e.jsx(R,{onClick:()=>f(N.id.toString()),disabled:r===N.id.toString(),variant:"outline",className:"w-full rounded-full","data-testid":`button-regenerate-survey-${N.id}`,children:r===N.id.toString()?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"w-4 h-4 mr-2 animate-spin"}),"Regenerating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),"Regenerate Survey"]})}),e.jsxs(R,{onClick:()=>b(N.survey,N.name),variant:"outline",className:"w-full rounded-full border-purple-300 text-purple-700 hover:bg-purple-50","data-testid":`button-bias-check-${N.id}`,children:[e.jsx(Ke,{className:"w-4 h-4 mr-2"}),"Check for Biases"]})]})]})]})]},N.id)})})}function Mt({canvasName:s,children:i,trigger:l}){const a=()=>{window.print()};return e.jsxs(ys,{children:[e.jsx($a,{asChild:!0,children:l||e.jsxs(R,{variant:"outline",size:"sm",className:"rounded-full","data-testid":`button-print-${s.toLowerCase().replace(/\s+/g,"-")}`,children:[e.jsx(Ua,{className:"h-4 w-4 mr-2"}),"Print"]})}),e.jsxs(ws,{className:"max-w-[95vw] max-h-[95vh] overflow-auto print-dialog",children:[e.jsx(ks,{className:"no-print",children:e.jsxs(Cs,{className:"flex items-center justify-between",children:[e.jsxs("span",{children:["Print Preview: ",s]}),e.jsxs(R,{onClick:a,className:"rounded-full","data-testid":"button-execute-print",children:[e.jsx(Ua,{className:"h-4 w-4 mr-2"}),"Print Canvas"]})]})}),e.jsx("div",{className:"canvas-print-content mt-4",children:i})]}),e.jsx("style",{children:`
12        /* Page setup for landscape printing - MUST be outside @media print */
13        @page {
14          size: landscape;
15          margin: 0.3cm;
16        }
17        
18        /* Hide dialog overlay and non-canvas content when printing */
19        @media print {
20          body * {
21            visibility: hidden;
22          }
23          
24          .print-dialog,
25          .print-dialog * {
26            visibility: visible;
27          }
28          
29          .print-dialog {
30            position: absolute;
31            left: 0;
32            top: 0;
33            width: 100vw;
34            max-width: 100vw;
35            height: auto;
36            overflow: visible;
37          }
38          
39          /* Hide dialog close button and header during print */
40          .no-print,
41          button[aria-label="Close"],
42          [role="dialog"] > button {
43            display: none !important;
44          }
45          
46          .canvas-print-content {
47            width: 100%;
48            max-width: 100vw;
49            page-break-inside: avoid;
50            overflow: hidden;
51          }
52          
53          /* Optimize layout for one-page printing */
54          .canvas-print-content > div {
55            width: 100%;
56            max-width: 100%;
57            transform: scale(0.85);
58            transform-origin: top left;
59          }
60          
61          /* Compact spacing for print - target Tailwind's margin-based spacing */
62          .canvas-print-content .space-y-6 > :not([hidden]) ~ :not([hidden]) {
63            margin-top: 0.5rem !important;
64          }
65          
66          .canvas-print-content .space-y-4 > :not([hidden]) ~ :not([hidden]) {
67            margin-top: 0.3rem !important;
68          }
69          
70          .canvas-print-content .space-y-3 > :not([hidden]) ~ :not([hidden]) {
71            margin-top: 0.2rem !important;
72          }
73          
74          .canvas-print-content .space-y-2 > :not([hidden]) ~ :not([hidden]) {
75            margin-top: 0.15rem !important;
76          }
77          
78          /* Reduce grid gaps */
79          .canvas-print-content .gap-8 {
80            gap: 0.5rem !important;
81          }
82          
83          .canvas-print-content .gap-6 {
84            gap: 0.4rem !important;
85          }
86          
87          .canvas-print-content .gap-4 {
88            gap: 0.3rem !important;
89          }
90          
91          .canvas-print-content .gap-3 {
92            gap: 0.25rem !important;
93          }
94          
95          /* Compact card padding - target actual shadcn classes */
96          .canvas-print-content [class*="card"] {
97            break-inside: avoid;
98            page-break-inside: avoid;
99          }
100          
101          .canvas-print-content .card-header,
102          .canvas-print-content [data-card-header] {
103            padding: 0.4rem !important;
104          }
105          
106          .canvas-print-content .card-content,
107          .canvas-print-content [data-card-content] {
108            padding: 0.5rem !important;
109          }
110          
111          /* Optimize font sizes for print */
112          .canvas-print-content h1,
113          .canvas-print-content .text-3xl {
114            font-size: 1.2rem !important;
115            line-height: 1.3 !important;
116          }
117          
118          .canvas-print-content h2,
119          .canvas-print-content .text-2xl {
120            font-size: 1rem !important;
121            line-height: 1.2 !important;
122          }
123          
124          .canvas-print-content h3,
125          .canvas-print-content .text-xl {
126            font-size: 0.9rem !important;
127            line-height: 1.2 !important;
128          }
129          
130          .canvas-print-content .text-lg {
131            font-size: 0.85rem !important;
132            line-height: 1.2 !important;
133          }
134          
135          .canvas-print-content .text-base,
136          .canvas-print-content .text-sm {
137            font-size: 0.7rem !important;
138            line-height: 1.2 !important;
139          }
140          
141          .canvas-print-content .text-xs {
142            font-size: 0.6rem !important;
143            line-height: 1.1 !important;
144          }
145          
146          /* Compact margins and padding */
147          .canvas-print-content .p-6 {
148            padding: 0.4rem !important;
149          }
150          
151          .canvas-print-content .p-4 {
152            padding: 0.3rem !important;
153          }
154          
155          .canvas-print-content .py-12 {
156            padding-top: 0.5rem !important;
157            padding-bottom: 0.5rem !important;
158          }
159          
160          .canvas-print-content .pt-6,
161          .canvas-print-content .pb-6 {
162            padding-top: 0.3rem !important;
163            padding-bottom: 0.3rem !important;
164          }
165          
166          .canvas-print-content .mb-4,
167          .canvas-print-content .mt-4 {
168            margin-top: 0.3rem !important;
169            margin-bottom: 0.3rem !important;
170          }
171          
172          .canvas-print-content .mb-2,
173          .canvas-print-content .mt-2 {
174            margin-top: 0.15rem !important;
175            margin-bottom: 0.15rem !important;
176          }
177          
178          /* Ensure grids display properly */
179          .canvas-print-content [class*="grid"] {
180            break-inside: avoid;
181          }
182          
183          /* Remove shadows and unnecessary decorations for print */
184          .canvas-print-content * {
185            box-shadow: none !important;
186            text-shadow: none !important;
187          }
188          
189          /* Ensure background colors and gradients print */
190          .canvas-print-content * {
191            -webkit-print-color-adjust: exact;
192            print-color-adjust: exact;
193            color-adjust: exact;
194          }
195        }
196      `})]})}const Mr={research:{bg:"bg-blue-100",text:"text-blue-800",label:"Research"},industry_report:{bg:"bg-purple-100",text:"text-purple-800",label:"Industry Report"},news:{bg:"bg-green-100",text:"text-green-800",label:"News"},company_data:{bg:"bg-amber-100",text:"text-amber-800",label:"Company Data"},academic:{bg:"bg-indigo-100",text:"text-indigo-800",label:"Academic"},government:{bg:"bg-cyan-100",text:"text-cyan-800",label:"Government"},social_media:{bg:"bg-pink-100",text:"text-pink-800",label:"Social Media"},expert_opinion:{bg:"bg-orange-100",text:"text-orange-800",label:"Expert Opinion"},other:{bg:"bg-muted/50",text:"text-foreground",label:"Other"}};function dt({citations:s,title:i="Data Sources & Citations",compact:l=!1}){return!s||s.length===0?null:l?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"text-xs font-semibold text-foreground flex items-center gap-1",children:[e.jsx(tt,{className:"h-3 w-3"}),"Sources (",s.length,"):"]}),e.jsx("div",{className:"space-y-1.5",children:s.map((a,t)=>{const r=Mr[a.type];return e.jsxs("div",{className:"text-xs text-foreground flex items-start gap-2",children:[e.jsxs("span",{className:"text-blue-600 font-semibold",children:["[",t+1,"]"]}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-start gap-2 flex-wrap",children:[a.url?e.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline flex items-center gap-1",children:[a.title||a.source,e.jsx(Tt,{className:"h-3 w-3"})]}):e.jsx("span",{className:"font-medium",children:a.title||a.source}),e.jsx(I,{className:`${r.bg} ${r.text} text-xs px-1.5 py-0`,children:r.label})]}),a.source&&a.title&&e.jsx("p",{className:"text-muted-foreground mt-0.5",children:a.source}),a.date&&e.jsxs("p",{className:"text-muted-foreground mt-0.5 flex items-center gap-1",children:[e.jsx(bs,{className:"h-3 w-3"}),a.date]})]})]},a.id||t)})})]}):e.jsxs(m,{className:"border-slate-200",children:[e.jsxs(u,{className:"pb-4",children:[e.jsxs(p,{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(tt,{className:"h-5 w-5 text-slate-600"}),i]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"All data sources and references used in this analysis"})]}),e.jsx(x,{className:"space-y-4",children:s.map((a,t)=>{const r=Mr[a.type];return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs(I,{variant:"outline",className:"font-mono text-sm min-w-[2.5rem] justify-center",children:["[",t+1,"]"]}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex-1",children:[a.url?e.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-base font-semibold text-blue-600 hover:underline flex items-center gap-2 group","data-testid":`link-citation-${t}`,children:[a.title||a.source,e.jsx(Tt,{className:"h-4 w-4 opacity-0 group-hover:opacity-100 transition-opacity"})]}):e.jsx("h4",{className:"text-base font-semibold text-foreground",children:a.title||a.source}),a.source&&a
196.title&&e.jsxs("p",{className:"text-sm text-foreground mt-1 flex items-center gap-1",children:[e.jsx(_s,{className:"h-3.5 w-3.5"}),a.source]}),a.author&&e.jsxs("p",{className:"text-sm text-foreground mt-0.5",children:["By ",a.author,a.publisher&&` • ${a.publisher}`]}),a.date&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-1 flex items-center gap-1",children:[e.jsx(bs,{className:"h-3.5 w-3.5"}),a.date]})]}),e.jsx(I,{className:`${r.bg} ${r.text} shrink-0`,children:r.label})]}),a.excerpt&&e.jsx("div",{className:"pl-4 border-l-2 border-border",children:e.jsxs("p",{className:"text-sm text-foreground italic",children:['"',a.excerpt,'"']})})]})]}),t<s.length-1&&e.jsx(Be,{className:"mt-4"})]},a.id||t)})})]})}function Qn(s){return typeof s=="string"?s:typeof s=="object"&&s!==null?s.risk||s.title||s.description||s.text||JSON.stringify(s):String(s)}function ga(s){if(!s&&s!==0)return"N/A";if(typeof s=="string"){if(/^\$?[\d,.]+\s*(B|Billion|M|Million|K|Thousand)/i.test(s))return s.startsWith("$")?s:`$${s}`;const i=parseFloat(s.replace(/[$,]/g,""));if(isNaN(i))return s;s=i}return s>=1e12?`$${(s/1e12).toFixed(1)}T`:s>=1e9?`$${(s/1e9).toFixed(1)}B`:s>=1e6?`$${(s/1e6).toFixed(1)}M`:s>=1e3?`$${(s/1e3).toFixed(0)}K`:`$${s.toFixed(0)}`}function Jn({marketViability:s,onRegenerate:i,isRegenerating:l}){const a=[];let t=1;return s.tamSources&&Array.isArray(s.tamSources)&&s.tamSources.forEach(r=>{a.push({id:`tam-${t++}`,title:r,source:r,type:r.toLowerCase().includes("gartner")||r.toLowerCase().includes("statista")||r.toLowerCase().includes("idc")||r.toLowerCase().includes("forrester")?"research":"industry_report"})}),s.samSources&&Array.isArray(s.samSources)&&s.samSources.forEach(r=>{a.find(c=>c.source===r)||a.push({id:`sam-${t++}`,title:r,source:r,type:r.toLowerCase().includes("report")?"industry_report":"other"})}),e.jsxs("div",{className:"w-full space-y-6",children:[i&&e.jsx("div",{className:"flex justify-end",children:e.jsx(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-market-viability",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2 animate-spin"}),"Regenerating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Regenerate"]})})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-blue-700 mb-3",children:"Market Size Opportunity"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-blue-600"}),"TAM - Total Addressable Market"]})}),e.jsxs(x,{children:[e.jsx("div",{className:"text-2xl font-bold text-blue-700 mb-2",children:ga(s.tamTotal)}),e.jsx("p",{className:"text-sm text-foreground mb-3",children:s.tamDescription}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground",children:"Sources:"}),s.tamSources.map((r,c)=>e.jsxs("p",{className:"text-xs text-foreground flex items-start gap-1",children:[e.jsx("span",{className:"text-blue-600",children:"•"}),e.jsx("span",{children:r})]},c))]})]})]}),e.jsxs(m,{className:"border-indigo-200 bg-gradient-to-br from-indigo-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-indigo-600"}),"SAM - Serviceable Addressable Market"]})}),e.jsxs(x,{children:[e.jsx("div",{className:"text-2xl font-bold text-indigo-700 mb-2",children:ga(s.samTotal)}),e.jsx("p",{className:"text-sm text-foreground mb-3",children:s.samDescription}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground",children:"Sources:"}),s.samSources.map((r,c)=>e.jsxs("p",{className:"text-xs text-foreground flex items-start gap-1",children:[e.jsx("span",{className:"text-indigo-600",children:"•"}),e.jsx("span",{children:r})]},c))]})]})]}),e.jsxs(m,{className:"border-purple-200 bg-gradient-to-br from-purple-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(xe,{className:"w-4 h-4 text-purple-600"}),"SOM - Serviceable Obtainable Market"]})}),e.jsxs(x,{children:[e.jsx("div",{className:"text-2xl font-bold text-purple-700 mb-2",children:ga(s.somTotal)}),e.jsx("p",{className:"text-sm text-foreground mb-3",children:s.somDescription}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground",children:"Assumptions:"}),s.somAssumptions.map((r,c)=>e.jsxs("p",{className:"text-xs text-foreground flex items-start gap-1",children:[e.jsx("span",{className:"text-purple-600",children:"•"}),e.jsx("span",{children:r})]}
196,c))]})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-green-200 bg-gradient-to-br from-green-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(se,{className:"w-4 h-4 text-green-600"}),"Market Growth & Trends"]})}),e.jsxs(x,{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground mb-1",children:"Growth Rate"}),e.jsx("p",{className:"text-lg font-bold text-green-700",children:s.marketGrowthRate})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground mb-1",children:"Adoption Velocity"}),e.jsx("p",{className:"text-sm text-foreground",children:s.adoptionVelocity})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-2",children:"Growth Drivers"}),e.jsx("ul",{className:"space-y-1",children:s.growthDrivers.map((r,c)=>e.jsxs("li",{className:"text-xs text-foreground flex items-start gap-1",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"•"}),e.jsx("span",{children:r})]},c))})]})]})]}),e.jsxs(m,{className:"border-cyan-200 bg-gradient-to-br from-cyan-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(se,{className:"w-4 h-4 text-cyan-600"}),"Market Trends"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:s.marketTrends.map((r,c)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(re,{className:"w-4 h-4 text-cyan-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:r})]},c))})})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-emerald-700 mb-3",children:"Unit Economics"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsxs(m,{className:"border-emerald-200 bg-gradient-to-br from-emerald-50 to-white",children:[e.jsxs(u,{className:"pb-3",children:[e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(le,{className:"w-4 h-4 text-emerald-600"}),"CAC"]}),e.jsx("p",{className:"text-xs text-foreground",children:"Customer Acquisition Cost"})]}),e.jsx(x,{children:e.jsx("div",{className:"text-2xl font-bold text-emerald-700",children:s.estimatedCac})})]}),e.jsxs(m,{className:"border-teal-200 bg-gradient-to-br from-teal-50 to-white",children:[e.jsxs(u,{className:"pb-3",children:[e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(se,{className:"w-4 h-4 text-teal-600"}),"LTV"]}),e.jsx("p",{className:"text-xs text-foreground",children:"Lifetime Value"})]}),e.jsx(x,{children:e.jsx("div",{className:"text-2xl font-bold text-teal-700",children:s.estimatedLtv})})]}),e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsxs(u,{className:"pb-3",children:[e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ti,{className:"w-4 h-4 text-blue-600"}),"LTV:CAC Ratio"]}),e.jsx("p",{className:"text-xs text-foreground",children:"Target: >3:1"})]}),e.jsx(x,{children:e.jsx("div",{className:"text-2xl font-bold text-blue-700",children:s.ltvCacRatio})})]}),e.jsxs(m,{className:"border-indigo-200 bg-gradient-to-br from-indigo-50 to-white",children:[e.jsxs(u,{className:"pb-3",children:[e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ls,{className:"w-4 h-4 text-indigo-600"}),"Gross Margin"]}),e.jsx("p",{className:"text-xs text-foreground",children:"Revenue - COGS"})]}),e.jsx(x,{children:e.jsx("div",{className:"text-2xl font-bold text-indigo-700",children:s.grossMargin})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-3",children:[e.jsxs(m,{className:"border-slate-200 bg-gradient-to-br from-slate-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ei,{className:"w-4 h-4 text-slate-600"}),"Break-Even Timeline"]})}),e.jsxs(x,{children:[e.jsxs("div",{className:"text-xl font-bold text-slate-700 mb-2",children:[s.breakEvenMonths," months"]}),e.jsx(de,{value:12/(s.breakEvenMonths||12)*100,className:"h-2"})]})]}),e.jsxs(m,{className:"border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Unit Economics Notes"})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground",children:s.unitEconomicsNotes})})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-violet-700 mb-3",children:"Revenue Projections"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs(m,{className:"border-violet-200 bg-gradient-to-br from-violet-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(le,{className:"w-4 h-4 text-violet-600"}),"Year 1 Revenue"]})}),e.jsx(x,{children:e.jsx("div",{className:"text-xl font-bold text-violet-700",children:s.year1Revenue})})]}),e.jsxs(m,{className:"border-purple-200 bg-gradient-to-br from-purple-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(le,{className:"w-4 h-4 text-purple-600"}),"Year 2 Revenue"]})}),e.jsx(x,{children:e.jsx("div",{className:"text-xl font-bold text-purple-700",children:s.year2Revenue})})]}),e.jsxs(m,{className:"border-fuchsia-200 bg-gradient-to-br from-fuchsia-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(le,{className:"w-4 h-4 text-fuchsia-600"}),"Year 3 Revenue"]})}),e.jsx(x,{children:e.jsx("div",{className:"text-xl font-bold text-fuchsia-700",children:s.year3Revenue})})]})]}),e.jsxs(m,{className:"mt-3 border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Revenue Assumptions"})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-1",children:s.revenueAssumptions.map((r,c)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx("span",{className:"text-violet-600 mt-1",children:"•"}),e.jsx("span",{children:r})]}
196,c))})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs(m,{className:"border-amber-200 bg-gradient-to-br from-amber-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(re,{className:"w-4 h-4 text-amber-600"}),"Viability Score"]})}),e.jsxs(x,{children:[e.jsxs("div",{className:"text-3xl font-bold text-amber-700 mb-2",children:[s.viabilityScore,e.jsx("span",{className:"text-lg text-muted-foreground",children:"/100"})]}),e.jsx(de,{value:s.viabilityScore,className:"h-2"})]})]}),e.jsxs(m,{className:"md:col-span-2 border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(me,{className:"w-4 h-4 text-foreground"}),"Key Insights"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-line",children:s.keyInsights})})]})]}),e.jsxs(m,{className:"border-red-200 bg-gradient-to-br from-red-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(me,{className:"w-4 h-4 text-red-600"}),"Market Risks"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:s.risks.map((r,c)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(me,{className:"w-4 h-4 text-red-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:Qn(r)})]},c))})})]}),a.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"my-6"}),e.jsx(dt,{citations:a,title:"Market Data Sources",compact:!1})]})]})}function yt(s){return typeof s=="string"?s:typeof s=="object"&&s!==null?s.strength||s.weakness||s.title||s.description||s.rationale||s.text||s.content||JSON.stringify(s):String(s)}function Wn({competitiveLandscape:s,onRegenerate:i,isRegenerating:l}){const a={low:{bg:"from-green-50",border:"border-green-200",text:"text-green-700"},medium:{bg:"from-yellow-50",border:"border-yellow-200",text:"text-yellow-700"},high:{bg:"from-orange-50",border:"border-orange-200",text:"text-orange-700"},very_high:{bg:"from-red-50",border:"border-red-200",text:"text-red-700"}},t=a[s.saturationLevel]||a.medium,r=[];let c=1;return s.directCompetitors&&Array.isArray(s.directCompetitors)&&s.directCompetitors.forEach(n=>{n.name&&n.name!=="Competitive analysis pending"&&r.push({id:`comp-${c++}`,title:`${n.name} - Competitive Analysis`,source:n.name,type:"company_data",excerpt:n.description})}),e.jsxs("div",{className:"w-full space-y-6",children:[i&&e.jsx("div",{className:"flex justify-end",children:e.jsx(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-competitive-landscape",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2 animate-spin"}),"Regenerating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Regenerate"]})})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs(m,{className:`${t.border} bg-gradient-to-br ${t.bg} to-white`,children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ne,{className:"w-4 h-4"}),"Competitor Count"]})}),e.jsxs(x,{children:[e.jsx("div",{className:`text-3xl font-bold ${t.text}`,children:s.competitorCount}),e.jsxs("p",{className:"text-xs text-foreground mt-1 capitalize",children:["Saturation: ",s.saturationLevel.replace("_"," ")]})]})]}),e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-blue-600"}),"Market Position"]})}),e.jsxs(x,{children:[e.jsx("div",{className:"text-xl font-bold text-blue-700 capitalize",children:s.marketPosition.replace("_"," ")}),e.jsx("p",{className:"text-xs text-foreground mt-1 capitalize",children:s.marketConcentration})]})]}),e.jsxs(m,{className:"border-purple-200 bg-gradient-to-br from-purple-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(De,{className:"w-4 h-4 text-purple-600"}),"Differentiation Score"]})}),e.jsxs(x,{children:[e.jsxs("div",{className:"text-3xl font-bold text-purple-700",children:[s.differentiationScore,"/100"]}),e.jsx(de,{value:s.differentiationScore,className:"h-2 mt-2"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-red-200 bg-gradient-to-br from-red-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4 text-red-600"}),"Direct Competitors"]})}),e.jsx(x,{className:"space-y-3",children:s.directCompetitors.map((n,d)=>e.jsxs("div",{className:"p-3 bg-white rounded-lg border border-border",children:[e.jsx("p",{className:"font-semibold text-sm text-foreground mb-1",children:n.name}),e.jsx("p",{className:"text-xs text-foreground mb-2",children:n.description}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Strengths:"}),n.strengths.map((o,g)=>e.jsxs("p",{className:"text-foreground flex items-start gap-1",children:[e.jsx("span",{className:"text-green-600",children:"+"})," ",yt(o)]},g))]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Weaknesses:"}),n.weaknesses.map((o,g)=>e.jsxs("p",{className:"text-foreground flex items-start gap-1",children:[e.jsx("span",{className:"text-red-600",children:"−"})," ",yt(o)]},g))]})]})]},d))})]}),e.jsxs(m,{className:"border-orange-200 bg-gradient-to-br from-orange-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(X,{className:"w-4 h-4 text-orange-600"}),"Indirect Competitors"]})}),e.jsx(x,{className:"space-y-3",children:s.indirectCompetitors.map((n,d)=>e.jsxs("div",{className:"p-3 bg-white rounded-lg border border-border",children:[e.jsx("p",{className:"font-semibold text-sm text-foreground mb-1",children:n.name}),e.jsx("p",{className:"text-xs text-foreground mb-2",children:n.description}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Strengths:"}),(n.strengths||[]).map((o,g)=>e.jsxs("p",{className:"text-foreground",children:["+ ",yt(o)]},g))]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:"Weaknesses:"}),(n.weaknesses||[]).map((o,g)=>e.jsxs("p",{className:"text-foreground",children:["− ",yt(o)]},g))]})]})]},d))})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-cyan-200 bg-gradient-to-br from-cyan-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(xe,{className:"w-4 h-4 text-cyan-600"}),"Unique Value Propositions"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:(s.uniqueValueProps||[]).map((n,d)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(xe,{className:"w-4 h-4 text-cyan-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:n})]},d))})})]}),e.jsxs(m,{className:"border-green-200 bg-gradient-to-br from-green-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-green-600"}),"Competitive Gaps"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:(s.competitiveGaps||[]).map((n,d)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-1",children:"•"}),e.jsx("span",{children:n})]},d))})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs(m,{className:"border-indigo-200 bg-gradient-to-br from-indigo-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(qr,{className:"w-4 h-4 text-indigo-600"}),"Switching Cost Level"]})}),e.jsx(x,{children:e.jsx("div",{className:"text-xl font-bold text-indigo-700 capitalize",children:s.switchingCostLevel})})]}),e.jsxs(m,{className:"border-violet-200 bg-gradient-to-br from-violet-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Switching Barriers"})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-1",children:(s.switchingBarriers||[]).map((n,d)=>e.jsxs("li",{className:"text-xs text-foreground flex items-start gap-1",children:[e.jsx("span",{className:"text-violet-600",children:"•"}),e.jsx("span",{children:n})]},d))})})]}),e.jsxs(m,{className:"border-purple-200 bg-gradient-to-br from-purple-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Lock-In Factors"})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-1",children:(s.lockInFactors||[]).map((n,d)=>e.jsxs("li",{className:"text-xs text-foreground flex items-start gap-1",children:[e.jsx("span",{className:"text-purple-600",children:"•"}),e.jsx("span",{children:n})]},d))})})]})]}),e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-blue-600"}),"Positioning Strategy"]}
196)}),e.jsxs(x,{children:[e.jsx("p",{className:"text-sm text-foreground mb-3",children:s.positioningStrategy}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-2",children:"Competitive Advantages"}),e.jsx("ul",{className:"space-y-1",children:(s.competitiveAdvantages||[]).map((n,d)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(De,{className:"w-4 h-4 text-blue-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:n})]},d))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs(m,{className:"border-amber-200 bg-gradient-to-br from-amber-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Competitive Score"})}),e.jsxs(x,{children:[e.jsxs("div",{className:"text-3xl font-bold text-amber-700",children:[s.competitiveScore,e.jsx("span",{className:"text-lg text-muted-foreground",children:"/100"})]}),e.jsx(de,{value:s.competitiveScore,className:"h-2 mt-2"})]})]}),e.jsxs(m,{className:"md:col-span-2 border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Strategic Recommendations"})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-line",children:s.strategicRecommendations})})]})]}),e.jsxs(m,{className:"border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Threats & Opportunities"})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-line",children:s.threatsAndOpportunities})})]}),r.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"my-6"}),e.jsx(dt,{citations:r,title:"Competitive Analysis Sources",compact:!1})]})]})}function Yn({executionReadiness:s,onRegenerate:i,isRegenerating:l}){const a={low:{bg:"bg-green-100",text:"text-green-700"},medium:{bg:"bg-yellow-100",text:"text-yellow-700"},high:{bg:"bg-orange-100",text:"text-orange-700"},very_high:{bg:"bg-red-100",text:"text-red-700"}};return e.jsxs("div",{className:"w-full space-y-6",children:[i&&e.jsx("div",{className:"flex justify-end",children:e.jsx(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-execution-readiness",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2 animate-spin"}),"Regenerating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Regenerate"]})})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Qs,{className:"w-4 h-4 text-blue-600"}),"Technical Feasibility"]})}),e.jsxs(x,{children:[e.jsxs("div",{className:"text-3xl font-bold text-blue-700 mb-2",children:[s.technicalFeasibilityScore,e.jsx("span",{className:"text-lg text-muted-foreground",children:"/100"})]}),e.jsx(de,{value:s.technicalFeasibilityScore,className:"h-2"})]})]}),e.jsxs(m,{className:"border-green-200 bg-gradient-to-br from-green-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-green-600"}),"Readiness Score"]})}),e.jsxs(x,{children:[e.jsxs("div",{className:"text-3xl font-bold text-green-700 mb-2",children:[s.readinessScore,e.jsx("span",{className:"text-lg text-muted-foreground",children:"/100"})]}),e.jsx(de,{value:s.readinessScore,className:"h-2"})]})]}),e.jsxs(m,{className:"border-purple-200 bg-gradient-to-br from-purple-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(se,{className:"w-4 h-4 text-purple-600"}),"Execution Confidence"]})}),e.jsx(x,{children:e.jsx("div",{className:"text-xl font-bold text-purple-700 capitalize",children:s.executionConfidence})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-cyan-200 bg-gradient-to-br from-cyan-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Qs,{className:"w-4 h-4 text-cyan-600"}),"Required Technologies"]})}),e.jsxs(x,{children:[e.jsx("ul",{className:"space-y-1",children:s.requiredTechnologies.map((t,r)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(re,{className:"w-4 h-4 text-cyan-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:t})]},r))}),e.jsx("div",{className:"mt-3 pt-3 border-t border-cyan-200",children:e.jsxs("p",{className:"text-xs font-semibold text-foreground mb-1 capitalize",children:["Integration Complexity: ",s.integrationComplexity]})})]})]}),e.jsxs(m,{className:"border-indigo-200 bg-gradient-to-br from-indigo-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4 text-indigo-600"}
196),"Infrastructure & Tech Risks"]})}),e.jsxs(x,{children:[e.jsxs("div",{className:"space-y-2 mb-3",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground",children:"Infrastructure Needs:"}),s.infrastructureNeeds.map((t,r)=>e.jsxs("p",{className:"text-xs text-foreground flex items-start gap-1",children:[e.jsx("span",{className:"text-indigo-600",children:"•"}),e.jsx("span",{children:t})]},r))]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Technical Risks:"}),s.technicalRisks.map((t,r)=>e.jsxs("p",{className:"text-xs text-foreground flex items-start gap-1",children:[e.jsx(X,{className:"w-3 h-3 text-orange-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:t})]},r))]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-violet-200 bg-gradient-to-br from-violet-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ne,{className:"w-4 h-4 text-violet-600"}),"Team Requirements"]})}),e.jsxs(x,{children:[e.jsxs("p",{className:"text-sm font-semibold text-foreground mb-3",children:["Team Size: ",s.teamSize]}),e.jsx("div",{className:"space-y-2",children:s.keyRoles.map((t,r)=>e.jsxs("div",{className:"p-2 bg-white rounded border border-border",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:t.role}),e.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${t.priority==="high"?"bg-red-100 text-red-700":t.priority==="medium"?"bg-yellow-100 text-yellow-700":"bg-green-100 text-green-700"}`,children:t.priority})]}),e.jsx("p",{className:"text-xs text-foreground",children:t.skillset})]},r))}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-violet-200",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Skill Gaps:"}),s.skillGaps.map((t,r)=>e.jsxs("p",{className:"text-xs text-foreground",children:["• ",t]},r))]})]})]}),e.jsxs(m,{className:"border-emerald-200 bg-gradient-to-br from-emerald-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(le,{className:"w-4 h-4 text-emerald-600"}),"Budget & Timeline"]})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground mb-1",children:"Estimated Budget"}),e.jsx("p",{className:"text-xl font-bold text-emerald-700",children:s.estimatedBudget})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground mb-1",children:"Time to Market"}),e.jsx("p",{className:"text-xl font-bold text-emerald-700",children:s.timeToMarket})]})]})})]})]}),e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(xe,{className:"w-4 h-4 text-blue-600"}),"MVP Features & Roadmap"]})}),e.jsx(x,{children:e.jsx("div",{className:"space-y-2",children:s.mvpFeatures.map((t,r)=>e.jsx("div",{className:"p-3 bg-white rounded border border-border",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:t.feature}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${t.priority==="high"?"bg-red-100 text-red-700":t.priority==="medium"?"bg-yellow-100 text-yellow-700":"bg-green-100 text-green-700"}`,children:t.priority}),e.jsxs("span",{className:"text-xs text-foreground flex items-center gap-1",children:[e.jsx(Te,{className:"w-3 h-3"}),t.effort]})]})]})},r))})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-amber-200 bg-gradient-to-br from-amber-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Development Milestones"})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-1",children:s.developmentMilestones.map((t,r)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(re,{className:"w-4 h-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:t})]},r))})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(m,{className:"border-teal-200 bg-gradient-to-br from-teal-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Phase 1 Deliverables"})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-1",children:s.phaseOneDeliverables.map((t,r)=>e.jsxs("li",{className:"text-xs text-foreground",children:["• ",t]},r))})})]}),e.jsxs(m,{className:"border-sky-200 bg-gradient-to-br from-sky-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Phase 2 Deliverables"})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-1",children:s.phaseTwoDeliverables.map((t,r)=>e.jsxs("li",{className:"text-xs text-foreground",children:["• ",t]},r))})})]})]})]}),e.jsxs(m,{className:"border-red-200 bg-gradient-to-br from-red-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(X,{className:"w-4 h-4 text-red-600"}),"Risk Heatmap"]})}),e.jsx(x,{children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:Object.entries(s.riskHeatmap).map(([t,r])=>{const c={bg:"bg-muted/50",text:"text-foreground"},n=a[r]||c;return e.jsxs("div",{className:`p-3 rounded-lg ${n.bg}`,children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-1 capitalize",children:t}),e.jsx("p",{className:`text-lg font-bold ${n.text} capitalize`,children:r})]},t)})})})]}),e.jsxs(m,{className:"border-orange-200 bg-gradient-to-br from-orange-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4 text-orange-600"}),"Implementation Risks & Mitigation"]})}),e.jsxs(x,{children:[e.jsx("div",{className:"space-y-3",children:s.implementationRisks.map((t,r)=>e.jsxs("div",{className:"p-3 bg-white rounded border border-border",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:t.risk}),e.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${t.severity==="high"?"bg-red-100 text-red-700":t.severity==="medium"?"bg-yellow-100 text-yellow-700":"bg-green-100 text-green-700"}`,children:t.severity})]}),e.jsxs("p",{className:"text-xs text-foreground",children:[e.jsx("span",{className:"font-semibold",children:"Mitigation:"})," ",t.mitigation]})]},r))}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-orange-200",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Critical Dependencies:"}),s.criticalDependencies.map((t,r)=>e.jsxs("p",{className:"text-xs text-foreground",children:["• ",t]},r))]})]})]}),e.jsxs(m,{className:"border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Key Recommendations"})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-line",children:s.keyRecommendations})})]})]})}function Xn({socialValidation:s,onRegenerate:i,isRegenerating:l}){const a={very_positive:{bg:"from-green-50",border:"border-green-200",text:"text-green-700"},positive:{bg:"from-emerald-50",border:"border-emerald-200",text:"text-emerald-700"},neutral:{bg:"from-gray-50",border:"border-border",text:"text-foreground"},negative:{bg:"from-orange-50",border:"border-orange-200",text:"text-orange-700"},very_negative:{bg:"from-red-50",border:"border-red-200",text:"text-red-700"}}
196,t=a[s.overallSentiment]||a.neutral,r=[];let c=1;if(s.socialMentions&&Array.isArray(s.socialMentions)){const n=new Set;s.socialMentions.forEach(d=>{d.platform&&!n.has(d.platform)&&(n.add(d.platform),r.push({id:`social-${c++}`,title:`${d.platform} - Social Sentiment Analysis`,source:d.platform,type:"social_media",excerpt:`${d.count} mentions with ${d.sentiment} sentiment`}))})}return e.jsxs("div",{className:"w-full space-y-6",children:[i&&e.jsx("div",{className:"flex justify-end",children:e.jsx(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-social-validation",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2 animate-spin"}),"Regenerating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Regenerate"]})})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs(m,{className:`${t.border} bg-gradient-to-br ${t.bg} to-white`,children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(_e,{className:"w-4 h-4"}),"Overall Sentiment"]})}),e.jsxs(x,{children:[e.jsx("div",{className:`text-2xl font-bold ${t.text} capitalize mb-2`,children:s.overallSentiment.replace("_"," ")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-foreground",children:"Score:"}),e.jsxs("span",{className:`text-lg font-bold ${t.text}`,children:[s.sentimentScore>0?"+":"",s.sentimentScore]})]})]})]}),e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ne,{className:"w-4 h-4 text-blue-600"}),"Community Size"]})}),e.jsxs(x,{children:[e.jsx("div",{className:"text-2xl font-bold text-blue-700",children:s.targetCommunitySize}),e.jsxs("p",{className:"text-xs text-foreground mt-1 capitalize",children:["Engagement: ",s.engagementLevel]})]})]}),e.jsxs(m,{className:"border-purple-200 bg-gradient-to-br from-purple-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Et,{className:"w-4 h-4 text-purple-600"}),"Validation Score"]})}),e.jsxs(x,{children:[e.jsxs("div",{className:"text-3xl font-bold text-purple-700 mb-2",children:[s.validationScore,e.jsx("span",{className:"text-lg text-muted-foreground",children:"/100"})]}),e.jsx(de,{value:s.validationScore,className:"h-2"})]})]})]}),e.jsxs(m,{className:"border-cyan-200 bg-gradient-to-br from-cyan-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Js,{className:"w-4 h-4 text-cyan-600"}),"Social Platform Mentions"]})}),e.jsx(x,{children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:s.socialMentions.map((n,d)=>e.jsxs("div",{className:"p-3 bg-white rounded-lg border border-border",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:n.platform}),e.jsx("p",{className:"text-2xl font-bold text-cyan-700",children:n.count}),e.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded inline-block mt-1 ${n.sentiment==="positive"?"bg-green-100 text-green-700":n.sentiment==="negative"?"bg-red-100 text-red-700":"bg-muted/50 text-foreground"}`,children:n.sentiment})]},d))})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-orange-200 bg-gradient-to-br from-orange-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Reddit Sentiment"})}),e.jsxs(x,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center mb-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground",children:"Threads"}),e.jsx("p",{className:"text-xl font-bold text-orange-700",children:s.redditSentiment.threads})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground",children:"Upvotes"}),e.jsx("p",{className:"text-xl font-bold text-orange-700",children:s.redditSentiment.upvotes})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground capitalize",children:"Sentiment"}),e.jsx("p",{className:"text-sm font-bold text-orange-700 capitalize",children:s.redditSentiment.
196sentiment})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Key Topics:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.redditSentiment.keyTopics.map((n,d)=>e.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-orange-100 text-orange-700",children:n},d))})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Twitter & LinkedIn"})}),e.jsxs(x,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-foreground",children:"Twitter Mentions"}),e.jsx("span",{className:"text-sm font-bold text-blue-700",children:s.twitterSentiment.mentions})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-foreground",children:"Twitter Engagement"}),e.jsx("span",{className:"text-sm font-bold text-blue-700",children:s.twitterSentiment.engagement})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-foreground",children:"LinkedIn Posts"}),e.jsx("span",{className:"text-sm font-bold text-blue-700",children:s.linkedinSentiment.posts})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-foreground",children:"LinkedIn Professionals"}),e.jsx("span",{className:"text-sm font-bold text-blue-700",children:s.linkedinSentiment.professionals})]})]})]}),e.jsxs(m,{className:"border-indigo-200 bg-gradient-to-br from-indigo-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Facebook Groups"})}),e.jsxs(x,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-foreground",children:"Active Groups"}),e.jsx("span",{className:"text-lg font-bold text-indigo-700",children:s.facebookSentiment.groups})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-foreground",children:"Total Members"}),e.jsx("span",{className:"text-lg font-bold text-indigo-700",children:s.facebookSentiment.members})]})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-violet-200 bg-gradient-to-br from-violet-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ne,{className:"w-4 h-4 text-violet-600"}),"Active Communities"]})}),e.jsx(x,{children:s.activeCommunities&&s.activeCommunities.length>0?e.jsx("div",{className:"space-y-2",children:s.activeCommunities.map((n,d)=>e.jsxs("div",{className:"p-2 bg-white rounded border border-border",children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:n.name}),e.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${n.engagement==="high"?"bg-green-100 text-green-700":n.engagement==="medium"?"bg-yellow-100 text-yellow-700":"bg-muted/50 text-foreground"}`,children:n.engagement})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-foreground",children:[e.jsx("span",{children:n.platform}),e.jsx("span",{children:n.size})]})]},d))}):e.jsx("div",{className:"text-center py-6",children:e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Data source not available"})})})]}),e.jsxs(m,{className:"border-fuchsia-200 bg-gradient-to-br from-fuchsia-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Et,{className:"w-4 h-4 text-fuchsia-600"}),"Influencers & Advocates"]})}),e.jsx(x,{children:s.influencers&&s.influencers.length>0?e.jsx("div",{className:"space-y-2",children:s.influencers.map((n,d)=>e.jsxs("div",{className:"p-2 bg-white rounded border border-border",children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:n.name}),e.jsxs("span",{className:"text-xs text-foreground",children:[n.followers," followers"]})]}),e.jsx("p",{className:"text-xs text-foreground mb-1",children:n.platform}),e.jsx("p",{className:"text-xs text-foreground",children:n.relevance})]},d))}):e.jsx("div",{className:"text-center py-6",children:e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Data source not available"})})})]})]}),e.jsxs(m,{className:"border-emerald-200 bg-gradient-to-br from-emerald-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ya,{className:"w-4 h-4 text-emerald-600"}),"Community Testimonials"]})}),e.jsx(x,{children:s.testimonials&&s.testimonials.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:s.testimonials.map((n,d)=>e.jsxs("div",{className:"p-3 bg-white rounded-lg border border-border",children:[e.jsx(ya,{className:"w-6 h-6 text-emerald-600 mb-2"}),e.jsxs("p",{className:"text-sm text-foreground italic mb-3",children:['"',n.quote,'"']}),e.jsxs("div",{className:"text-xs text-foreground",children:[e.jsx("p",{className:"font-semibold text-foreground",children:n.author}),e.jsxs("p",{children:[n.role," • ",n.platform]})]})]},d))}):e.jsx("div",{className:"text-center py-6",children:e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Data source not available"})})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-red-200 bg-gradient-to-br from-red-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Common Pain Points"})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:(s.commonPainPoints||[]).map((n,d)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(nt,{className:"w-4 h-4 text-red-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:n})]},d))})})]}),e.jsxs(m,{className:"border-green-200 bg-gradient-to-br from-green-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Requested Features"})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:(s.requestedFeatures||[]).map((n,d)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(re,{className:"w-4 h-4 text-green-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:n})]},d))})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-amber-200 bg-gradient-to-br from-amber-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(De,{className:"w-4 h-4 text-amber-600"}),"Credibility Badges"]})}),e.jsx(x,{children:s.credibilityBadges&&s.credibilityBadges.length>0?e.jsx("div",{className:"space-y-2",children:s.credibilityBadges.map((n,d)=>e.jsxs("div",{className:"flex items-center justify-between p-2 bg-white rounded border border-border",children:[e.jsx("span",{className:"text-sm text-foreground",children:n.badge}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-bold text-amber-700",children:n.count}),e.jsx("span",{className:"text-xs text-foreground",children:n.platform})]})]},d))}):e.jsx("div",{className:"text-center py-6",children:e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Data source not available"})})})]}),e.jsxs(m,{className:"border-teal-200 bg-gradient-to-br from-teal-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(se,{className:"w-4 h-4 text-teal-600"}),"Social Proof"]})}),e.jsx(x,{children:s.socialProof&&s.socialProof.length>0?e.jsx("ul",{className:"space-y-2",children:(s.socialProof||[]).map((n,d)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(re,{className:"w-4 h-4 text-teal-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:n})]},d))}):e.jsx("div",{className:"text-center py-6",children:e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Data source not available"})})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Community Insights"})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-line",children:s.communityInsights})})]}),e.jsxs(m,{className:"border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Social Recommendations"})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-line",children:s.socialRecommendations})})]})]}),r.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"my-6"}),e.jsx(dt,{citations:r,title:"Social Validation Sources",compact:!1})]})]})}function Zn({expertValidation:s,onRegenerate:i,isRegenerating:l}){const a={strongly_recommended:{bg:"from-green-50",border:"border-green-200",text:"text-green-700"},recommended:{bg:"from-emerald-50",border:"border-emerald-200",text:"text-emerald-700"},cautious:{bg:"from-yellow-50",border:"border-yellow-200",text:"text-yellow-700"},not_recommended:{bg:"from-red-50",border:"border-red-200",text:"text-red-700"}},t={bg:"from-gray-50",border:"border-border",text:"text-foreground"},r=a[s.recommendation]||t,c=[];let n=1;return s.expertOpinions&&Array.isArray(s.expertOpinions)&&s.expertOpinions.forEach(d=>{d.expert&&c.push({id:`expert-${n++}`,title:`${d.expert} - Industry Expert Opinion`,source:d.expert,type:"expert_opinion",excerpt:d.opinion})}),e.jsxs("div",{className:"w-full space-y-6",children:[i&&e.jsx("div",{className:"flex justify-end",children:e.jsx(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-expert-validation",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2 animate-spin"}),"Regenerating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Regenerate"]})})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-3",children:[e.jsxs(m,{className:`${r.border} bg-gradient-to-br ${r.bg} to-white`,children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(nt,{className:"w-4 h-4"}),"Recommendation"]})}),e.jsx(x,{children:e.jsx("div",{className:`text-lg font-bold ${r.text} capitalize`,children:s.recommendation.replace("_"," ")})})]}),e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(De,{className:"w-4 h-4 text-blue-600"}),"Expert Score"]})}),e.jsxs(x,{children:[e.jsxs("div",{className:"text-3xl font-bold text-blue-700",children:[s.expertScore,e.jsx("span",{className:"text-lg text-muted-foreground",children:"/100"})]}),e.jsx(de,{value:s.expertScore,className:"h-2 mt-2"})]})]}),e.jsxs(m,{className:"border-purple-200 bg-gradient-to-br from-purple-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(se,{className:"w-4 h-4 text-purple-600"}),"Success Probability"]})}),e.jsx(x,{children:e.jsxs("div",{className:"text-3xl font-bold text-purple-700",children:[s.successProbability,"%"]})})]}),e.jsxs(m,{className:"border-orange-200 bg-gradient-to-br from-orange-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(X,{className:"w-4 h-4 text-orange-600"}),"Risk Index"]})}),e.jsxs(x,{children:[e.jsxs("div",{className:"text-3xl font-bold text-orange-700",children:[s.riskIndex,e.jsx("span",{className:"text-lg text-muted-foreground",children:"/100"})]}),e.jsx("p",{className:"text-xs text-foreground mt-1",children:"Higher = More Risk"})]})]})]}),e.jsxs(m,{className:"border-indigo-200 bg-gradient-to-br from-indigo-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(_s,{className:"w-4 h-4 text-indigo-600"}),"Comparable Companies"]})}),e.jsx(x,{children:s.comparableCompanies&&s.comparableCompanies.length>0?e.jsx("div",{className:"space-y-3",children:s.comparableCompanies.map((d,o)=>e.jsxs("div",{className:"p-3 bg-white rounded-lg border border-border",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:d.name}),e.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${d.outcome.toLowerCase().includes("success")||d.outcome.toLowerCase().includes("acquired")?"bg-green-100 text-green-700":"bg-red-100 text-red-700"}`,children:d.outcome})]}),e.jsx("p",{className:"text-xs text-foreground mb-2",children:d.description}),e.jsxs("p",{className:"text-xs text-foreground",children:[e.jsx("span",{className:"font-semibold",children:"Metrics:"})," ",d.metrics]})]},o))}):e.jsx("div",{className:"text-center py-6",children:e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Data source not available"})})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-green-200 bg-gradient-to-br from-green-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(re,{className:"w-4 h-4 text-green-600"}),"Similar Successes"]})}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:(s.similarSuccesses||[]).map((d,o)=>e.jsxs("div",{className:"p-3 bg-white rounded border border-border",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground mb-2",children:d.name}),e.jsxs("div",{className:"mb-2",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Success Factors:"}),(d.keyFactors||[]).map((g,h)=>e.jsxs("p",{className:"text-xs text-foreground flex items-start gap-1",children:[e.jsx("span",{className:"text-green-600",children:"✓"})," ",g]},h))]}),e.jsxs("p",{className:"text-xs text-foreground",children:[e.jsx("span",{className:"font-semibold",children:"Timeline:"})," ",d.timeline]}),e.jsxs("p",{className:"text-xs text-foreground",children:[e.jsx("span",{className:"font-semibold",children:"Outcome:"})," ",d.outcome]})]},o))})})]}),e.jsxs(m,{className:"border-red-200 bg-gradient-to-br from-red-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(X,{className:"w-4 h-4 text-red-600"}),"Similar Failures"]})}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:(s.similarFailures||[]).map((d,o)=>e.jsxs("div",{className:"p-3 bg-white rounded border border-border",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground mb-2",children:d.name}),e.jsxs("div",{className:"mb-2",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-1",children:"Failure Reasons:"}),(d.reasonsForFailure||[]).map((g,h)=>e.jsxs("p",{className:"text-xs text-foreground flex items-start gap-1",children:[e.jsx("span",{className:"text-red-600",children:"✗"})," ",g]},h))]}),e.jsxs("p",{className:"text-xs text-foreground",children:[e.jsx("span",{className:"font-semibold",children:"Lessons:"})," ",d.lessonsLearned]})]},o))})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-cyan-200 bg-gradient-to-br from-cyan-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(se,{className:"w-4 h-4 text-cyan-600"}),"Success Factors"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:(s.successFactors||[]).map((d,o)=>e.js
196xs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(re,{className:"w-4 h-4 text-cyan-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:d})]},o))})})]}),e.jsxs(m,{className:"border-amber-200 bg-gradient-to-br from-amber-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(X,{className:"w-4 h-4 text-amber-600"}),"Failure Risks"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:(s.failureRisks||[]).map((d,o)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(X,{className:"w-4 h-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:d})]},o))})})]})]}),e.jsxs(m,{className:"border-violet-200 bg-gradient-to-br from-violet-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(De,{className:"w-4 h-4 text-violet-600"}),"Expert Endorsements"]})}),e.jsx(x,{children:s.expertEndorsements&&s.expertEndorsements.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:s.expertEndorsements.map((d,o)=>e.jsxs("div",{className:"p-3 bg-white rounded-lg border border-border",children:[e.jsxs("p",{className:"text-sm italic text-foreground mb-3",children:['"',d.quote,'"']}),e.jsxs("div",{className:"text-xs text-foreground",children:[e.jsx("p",{className:"font-semibold text-foreground",children:d.expert}),e.jsx("p",{children:d.credentials})]})]},o))}):e.jsx("div",{className:"text-center py-6",children:e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Data source not available"})})})]}),e.jsxs(m,{className:"border-red-200 bg-gradient-to-br from-red-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4 text-red-600"}),"Risk Breakdown & Analysis"]})}),e.jsxs(x,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3 mb-4",children:[{label:"Market",value:s.marketRisk},{label:"Product",value:s.productRisk},{label:"Team",value:s.teamRisk},{label:"Regulatory",value:s.regulatoryRisk},{label:"Financial",value:s.financialRisk}].map((d,o)=>e.jsxs("div",{className:"p-2 bg-white rounded border border-border text-center",children:[e.jsx("p",{className:"text-xs text-foreground mb-1",children:d.label}),e.jsx("p",{className:"text-2xl font-bold text-red-700",children:d.value})]},o))}),e.jsx("div",{className:"space-y-2",children:Object.entries(s.riskBreakdown).map(([d,o])=>e.jsxs("div",{className:"p-2 bg-white rounded border border-border",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground mb-1 capitalize",children:d.replace("Risk"," Risk")}),e.jsx("p",{className:"text-xs text-foreground",children:o})]},d))})]})]}),e.jsxs(m,{className:"border-emerald-200 bg-gradient-to-br from-emerald-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-emerald-600"}),"Risk Mitigation Strategies"]})}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.mitigationStrategies.map((d,o)=>e.jsxs("div",{className:"p-3 bg-white rounded border border-border",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:d.risk}),e.jsxs("span",{className:`text-xs px-2 py-0.5 rounded ${d.effectiveness==="high"?"bg-green-100 text-green-700":d.effectiveness==="medium"?"bg-yellow-100 text-yellow-700":"bg-red-100 text-red-700"}`,children:[d.effectiveness," effectiveness"]})]}),e.jsx("p",{className:"text-xs text-foreground",children:d.strategy})]},o))})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ls,{className:"w-4 h-4 text-foreground"}),"Pattern Insights"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-line",children:s.patternInsights})})]}),e.jsxs(m,{className:"border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Historical Precedent"})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-line",children:s.historicalPre
196cedent})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsx(p,{className:"text-sm font-semibold",children:"Industry Analysis"})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-line",children:s.industryAnalysis})})]}),e.jsxs(m,{className:"border-border",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(he,{className:"w-4 h-4 text-foreground"}),"Strategic Guidance"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-line",children:s.strategicGuidance})})]})]}),e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-blue-600"}),"Recommended Next Steps"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:(s.nextSteps||[]).map((d,o)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsxs("span",{className:"text-blue-600 font-bold mt-0.5",children:[o+1,"."]}
196),e.jsx("span",{children:d})]},o))})})]}),c.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"my-6"}),e.jsx(dt,{citations:c,title:"Expert Opinion Sources",compact:!1})]})]})}const el={Team:"blue",Market:"green",Timing:"orange",Competition:"red","Business Model":"indigo",Risk:"cyan"},sl={Team:ne,Market:js,Timing:Te,Competition:Ke,"Business Model":Ri,Risk:V};function tl({factorKey:s,name:i,category:l,emoji:a,aiScore:t,humanOverride:r,reasoning:c,citations:n,missingData:d,syntheticId:o,onUpdate:g}){const[h,f]=D.useState(!1),[b,y]=D.useState(r?.toString()||t?.toString()||"50"),[S,N]=D.useState(!1),{toast:w}=Ys(),P=r!==null?r:t,v=el[l]||"gray",T=async()=>{try{const A=parseInt(b);if(isNaN(A)||A<0||A>100){w({title:"Invalid Score",description:"Score must be between 0 and 100",variant:"destructive"});return}await Q({method:"PATCH",url:`/api/idea-prioritization/${o}/opportunity-assessment/override`,data:{factorKey:s,overrideScore:A}}),w({title:"Override Saved",description:"Human expert score has been applied"}),L.invalidateQueries({queryKey:[`/api/idea-prioritization/${o}/opportunity-assessment`]}),f(!1),g()}catch{w({title:"Error",description:"Failed to save override",variant:"destructive"})}},$=()=>{y(r?.toString()||t?.toString()||"50"),f(!1)};return e.jsxs(m,{className:`border-${v}-200 bg-gradient-to-br from-${v}-50 to-white`,children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-lg",children:a}),e.jsx("span",{children:i})]}),h?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(R,{variant:"ghost",size:"sm",onClick:T,className:"h-7 w-7 p-0","data-testid":`button-save-${s}`,children:e.jsx(Sa,{className:"h-3 w-3"})}),e.jsx(R,{variant:"ghost",size:"sm",onClick:$,className:"h-7 w-7 p-0","data-testid":`button-cancel-${s}`,children:e.jsx(gs,{className:"h-3 w-3"})})]}):e.jsx(R,{variant:"ghost",size:"sm",onClick:()=>f(!0),className:"h-7 w-7 p-0","data-testid":`button-edit-${s}`,children:e.jsx(wa,{className:"h-3 w-3"})})]})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-foreground",children:"Score"}),e.jsxs("span",{className:`text-2xl font-bold text-${v}-700`,"data-testid":`score-${s}`,children:[P,e.jsx("span",{className:"text-sm text-muted-foreground",children:"/100"})]})]}),e.jsx(de,{value:P||0,className:"h-2"})]}),h?e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ea,{htmlFor:`override-${s}`,className:"text-xs",children:"Human Expert Override (0-100)"}),e.jsx(ke,{id:`override-${s}`,type:"number",min:"0",max:"100",value:b,onChange:A=>y(A.target.value),className:"h-8 text-sm","data-testid":`input-override-${s}`})]}):e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-xs text-foreground",children:[e.jsx("span",{className:"font-semibold",children:"AI Score:"})," ",t,e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"/100"})]}),r!==null&&e.jsxs("div",{className:"text-xs text-blue-600 font-semibold",children:["✓ Human Override: ",r,e.jsx("span",{className:"text-[10px] text-blue-400/60",children:"/100"})]})]}),c&&e.jsx("div",{className:"pt-2 border-t border-border",children:e.jsx("p",{className:"text-xs text-foreground","data-testid":`reasoning-${s}`,children:c})}),d&&d.length>0&&e.jsx("div",{className:"pt-2 border-t border-border",children:e.jsxs("div",{className:"flex items-start gap-2 p-2 bg-yellow-50 rounded border border-yellow-200",children:[e.jsx(me,{className:"h-4 w-4 text-yellow-600 shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs text-yellow-800",children:[e.jsx("strong",{children:"Incomplete Data:"})," ",d.join(", ")," not yet available"]})]})}),n&&n.length>0&&e.jsxs("div",{className:"pt-2 border-t border-border",children:[e.jsxs(R,{variant:"ghost",size:"sm",onClick:()=>N(!S),className:"w-full h-auto py-1 px-2 justify-between text-xs hover:bg-muted/50","data-testid":`button-toggle-citations-${s}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(fs,{className:"h-3 w-3"}),e.jsxs("span",{children:[n.length," Data Source",n.length!==1?"s":""]})]}),S?e.jsx(Fi,{className:"h-3 w-3"}):e.jsx(Pa,{className:"h-3 w-3"})]}),S&&e.jsx("div",{className:"mt-2 space-y-2","data-testid":`citations-${s}`,children:n.map((A,z)=>e.jsxs("div",{className:"p-2 bg-blue-50 rounded border border-blue-200",children:[e.jsx("div",{className:"text-xs font-semibold text-blue-900 mb-1",children:A.source}),e.jsxs("div",{className:"text-xs text-blue-800 italic",children:['"',A.excerpt,'"']})]},z))})]})]})})]})}
196function $r({assessment:s,syntheticId:i,onRegenerate:l,isRegenerating:a,categoryFilter:t}){const[r,c]=D.useState(0),n=()=>{c(b=>b+1)},d={Team:15,Market:30,Timing:10,Competition:15,"Business Model":20,Risk:10},o=[{key:"teamDomainExpertise",name:"Domain Expertise Required",category:"Team",emoji:"🎓"},{key:"scaleVentureScale",name:"Venture Scale",category:"Market",emoji:"📊"},{key:"scaleQuickMvp",name:"Quick MVP",category:"Market",emoji:"🚀"},{key:"marketGlobalPotential",name:"Global Potential",category:"Market",emoji:"🌍"},{key:"marketRegulatedIndustry",name:"Regulated Industry",category:"Market",emoji:"📜"},{key:"highlightMassiveMarket",name:"Massive Market",category:"Market",emoji:"🌍"},{key:"potentialBreakoutPotential",name:"Breakout Potential",category:"Market",emoji:"⚡"},{key:"potentialProvenMarket",name:"Proven Market",category:"Market",emoji:"✅"},{key:"timingEmergingTrend",name:"Emerging Trend",category:"Timing",emoji:"📈"},{key:"timingRegulatoryTailwind",name:"Regulatory Tailwind",category:"Timing",emoji:"📜"},{key:"highlightPerfectTiming",name:"Perfect Timing",category:"Timing",emoji:"⏰"},{key:"competitionHighBarriers",name:"High Barriers",category:"Competition",emoji:"🛡️"},{key:"highlight10xBetter",name:"10x Better",category:"Competition",emoji:"🚀"},{key:"monetizationClearRevenue",name:"Clear Revenue Model",category:"Business Model",emoji:"💵"},{key:"monetizationHighLtv",name:"High LTV Potential",category:"Business Model",emoji:"💎"},{key:"businessModelRecurringRevenue",name:"Recurring Revenue",category:"Business Model",emoji:"🔄"},{key:"businessModelNetworkEffects",name:"Network Effects",category:"Business Model",emoji:"🕸️"},{key:"riskLowTechRisk",name:"Low Tech Risk",category:"Risk",emoji:"🔒"},{key:"riskLowMarketRisk",name:"Low Market Risk",category:"Risk",emoji:"📉"}],g=t?o.filter(b=>b.category===t):o,h=g.reduce((b,y)=>(b[y.category]||(b[y.category]=[]),b[y.category].push(y),b),{}),f=b=>b?b>=80?"text-green-600":b>=60?"text-blue-600":b>=40?"text-yellow-600":"text-red-600":"text-muted-foreground";return e.jsxs("div",{className:"w-full space-y-6",children:[e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(p,{className:"text-xl font-bold flex items-center gap-3",children:[e.jsx(Ws,{className:"w-6 h-6 text-blue-600"}),"Overall Opportunity Score"]}),l&&e.jsx(R,{onClick:l,disabled:a,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-opportunity-assessment",children:a?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2 animate-spin"}),"Regenerating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Regenerate"]})})]})}),e.jsx(x,{children:e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:`text-6xl font-bold ${f(s.overallScore)}`,"data-testid":"overall-score",children:[s.overallScore,e.jsx("span",{className:"text-3xl text-muted-foreground",children:"/100"})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(de,{value:s.overallScore||0,className:"h-4 mb-2"}),e.jsxs("p",{className:"text-sm text-foreground",children:["Weighted average across ",g.length," opportunity factors"]})]})]})})]}),Object.entries(h).map(([b,y])=>{const S=sl[b]||Ws,N=d[b]||0;return e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-bold text-blue-700 mb-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{className:"w-5 h-5"}),b]}),e.jsxs("span",{className:"text-sm font-normal text-foreground",children:["Weight: ",N,"%"]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:y.map(w=>{const P=`${w.key}Score`,C=`${w.key}Override`,v=`${w.key}Reasoning`,T=s.citations?.[w.key]||[],$=Array.isArray(T)?T:[],A=s.missingData||[];return e.jsx(tl,{factorKey:w.key,name:w.name,category:w.category,emoji:w.emoji,aiScore:s[P],humanOverride:s[C],reasoning:s[v],citations:$,missingData:A,syntheticId:i,onUpdate:n},w.key)})})]},b)}
196),s.citations&&Object.keys(s.citations).length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"my-6"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"text-lg font-bold text-blue-700 mb-3 flex items-center gap-2",children:[e.jsx(tt,{className:"w-5 h-5"}),"References & Data Sources"]}),o.filter(b=>{const y=s.citations?.[b.key];return Array.isArray(y)&&y.length>0}).map(b=>{const y=s.citations?.[b.key];return!y||y.length===0?null:e.jsxs("div",{className:"mb-4",children:[e.jsxs("h4",{className:"text-sm font-semibold text-foreground mb-2",children:[b.emoji," ",b.name]}),e.jsx(dt,{citations:y.map((S,N)=>({id:`${b.key}-${N}`,title:S.source,source:S.source,type:"research",excerpt:S.excerpt,confidence:S.relevance>=.8?"high":S.relevance>=.5?"medium":"low"})),title:"",compact:!0})]},b.key)})]})]})]},r)}function al({executionPlan:s,onRegenerate:i,isRegenerating:l}){const a=s.gtmStrategy,t=s.resourcesPlan,r=s.productionRoadmap,c=s.keyMilestones,n=s.riskMitigation,d=s.successMetrics,o=s.dataSourcesUsed,g=h=>h?h>=70?"green":h>=40?"yellow":"red":"gray";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-l-4 border-l-blue-500",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-gradient-to-br from-blue-500 to-purple-600 rounded-lg",children:e.jsx(at,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{children:[e.jsx(p,{className:"text-xl",children:"Execution Plan"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Comprehensive roadmap for bringing your idea to market"})]})]})}),e.jsx(x,{children:e.jsxs("div",{className:"flex items-center gap-6 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Hs,{className:"h-4 w-4 text-green-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Data Completeness:"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{value:s.confidenceScore||0,className:"w-24 h-2"}),e.jsxs("span",{className:`text-sm font-semibold text-${g(s.confidenceScore)}-600`,children:[s.confidenceScore||0,"%"]})]})]}),o&&o.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(re,{className:"h-4 w-4 text-purple-500"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[o.length," analyses used"]})]})]})})]}),e.jsxs(ye,{defaultValue:"overview",className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-2",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsxs(we,{className:"w-full md:w-auto inline-flex min-w-full md:min-w-0 gap-2","data-testid":"tabs-execution-plan",children:[e.jsxs(K,{value:"overview",className:"flex-1 md:flex-none","data-testid":"tab-overview",children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),"Overview"]}),e.jsxs(K,{value:"gtm",className:"flex-1 md:flex-none","data-testid":"tab-gtm",children:[e.jsx(se,{className:"h-4 w-4 mr-2"}),"Go-to-Market"]}),e.jsxs(K,{value:"resources",className:"flex-1 md:flex-none","data-testid":"tab-resources",children:[e.jsx(ne,{className:"h-4 w-4 mr-2"}),"Resources"]}),e.jsxs(K,{value:"production",className:"flex-1 md:flex-none","data-testid":"tab-production",children:[e.jsx(Qs,{className:"h-4 w-4 mr-2"}),"Production"]}),e.jsxs(K,{value:"metrics",className:"flex-1 md:flex-none","data-testid":"tab-metrics",children:[e.jsx(Hs,{className:"h-4 w-4 mr-2"}),"Risk & Metrics"]})]})}),i&&e.jsx("div",{className:"flex-shrink-0",children:e.jsxs(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-execution-plan",children:[e.jsx(J,{className:`h-4 w-4 mr-2 ${l?"animate-spin":""}`}),"Regenerate"]})})]}),e.jsx(U,{value:"overview",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[s.executiveSummary&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-5 w-5 text-yellow-500"}),"Executive Summary"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-line",children:s.executiveSummary})})]}),c&&c.length>0&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5 text-blue-500"}),"Key Milestones"]})}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:c.map((h,f)=>e.jsxs("div",{className:"flex gap-3 p-3 bg-card rounded-lg border border-border",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center text-xs font-bold text-blue-600",children:f+1}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"font-semibold text-sm text-foreground",children:h.milestone}),e.jsx("span",{className:"text-xs text-foreground",children:h.target})]}),e.jsx("p",{className:"text-xs text-foreground",children:h.significance})]})]},f))})})]})]})}),e.jsx(U,{value:"gtm",className:"mt-0",children:a&&e.jsxs("div",{className:"space-y-6",children:[a.salesStrategy&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-2 flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4 text-green-600"}),"Sales Strategy"]}
196),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:a.salesStrategy})]}),a.channelDetails&&a.channelDetails.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-3 flex items-center gap-2",children:[e.jsx(se,{className:"h-4 w-4 text-blue-600"}),"Marketing Channels"]}),e.jsx("div",{className:"grid gap-3",children:a.channelDetails.map((h,f)=>e.jsxs("div",{className:"p-3 bg-card rounded-lg border border-border",children:[e.jsx("div",{className:"font-semibold text-sm mb-1 text-foreground",children:h.channel}),e.jsx("p",{className:"text-xs text-foreground mb-1",children:h.approach}),e.jsx("div",{className:"text-xs text-green-600 font-medium",children:h.budget})]},f))})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[a.revenueModel&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-2 flex items-center gap-2",children:[e.jsx(le,{className:"h-4 w-4 text-emerald-600"}),"Revenue Model"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.revenueModel})]}),a.pricingStrategy&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-2 flex items-center gap-2",children:[e.jsx(le,{className:"h-4 w-4 text-emerald-600"}),"Pricing Strategy"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.pricingStrategy})]})]}),a.projectedRevenue&&a.projectedRevenue.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-3 flex items-center gap-2",children:[e.jsx(Hs,{className:"h-4 w-4 text-purple-600"}),"Revenue Projections"]}),e.jsx("div",{className:"space-y-2",children:a.projectedRevenue.map((h,f)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-card rounded-lg border border-border",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-sm text-foreground",children:h.timeframe}),e.jsx("div",{className:"text-xs text-foreground",children:h.assumptions})]}),e.jsx("div",{className:"text-lg font-bold text-green-600",children:h.target})]},f))})]})]})}),e.jsx(U,{value:"resources",className:"mt-0",children:t&&e.jsxs("div",{className:"space-y-6",children:[t.teamComposition&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-2 flex items-center gap-2",children:[e.jsx(ne,{className:"h-4 w-4 text-purple-600"}),"Team Composition"]}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t.teamComposition})]}),t.keyRoles&&t.keyRoles.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-3 flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4 text-blue-600"}),"Key Roles to Hire"]}),e.jsx("div",{className:"grid gap-3",children:t.keyRoles.map((h,f)=>e.jsxs("div",{className:"p-3 bg-card rounded-lg border border-border",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"font-semibold text-sm text-foreground",children:h.role}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-xs px-2 py-1 bg-blue-100 text-blue-700 rounded",children:h.when}),e.jsx("span",{className:`text-xs px-2 py-1 rounded ${h.priority==="Critical"?"bg-red-100 text-red-700":h.priority==="High"?"bg-orange-100 text-orange-700":"bg-green-100 text-green-700"}`,children:h.priority})]})]}),e.jsxs("div",{className:"text-xs text-foreground",children:["Skills: ",Array.isArray(h.skills)?h.skills.join(", "):h.skills]})]},f))})]}),t.budgetEstimate&&t.budgetEstimate.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-3 flex items-center gap-2",children:[e.jsx(le,{className:"h-4 w-4 text-emerald-600"}),"Budget Estimate"]}),e.jsx("div",{className:"space-y-2",children:t.budgetEstimate.map((h,f)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-card rounded-lg border border-border",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-sm text-foreground",children:h.category}),e.jsx("div",{className:"text-xs text-foreground",children:h.rationale})]}),e.jsx("div",{className:"text-sm font-bold text-emerald-600",children:h.amount})]},f))}),t.totalBudget&&e.jsx("div",{className:"mt-3 p-3 bg-emerald-50 rounded-lg border border-emerald-200",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-semibold text-sm",children:"Total Budget"}),e.jsx("span",{className:"text-lg font-bold text-emerald-600",children:t.totalBudget})]})})]})]})}),e.jsx(U,{value:"production",className:"mt-0",children:r&&e.jsxs("div",{className:"space-y-6",children:[r.developmentApproach&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-2 flex items-center gap-2",children:[e.jsx(Qs,{className:"h-4 w-4 text-orange-600"}),"Development Approach"]}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:r.developmentApproach})]}),r.mvpScope&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-2 flex items-center gap-2",children:[e.jsx(at,{className:"h-4 w-4 text-blue-600"}),"MVP Scope (",r.mvpTimeline||"TBD",")"]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:r.mvpScope}),r.mvpFeatures&&r.mvpFeatures.length>0&&e.jsx("div",{className:"grid gap-2",children:r.mvpFeatures.map((h,f)=>e.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[e.jsx(re,{className:"h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-muted-foreground",children:h})]},f))})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.phase1&&r.phase1.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-3 flex items-center gap-2",children:[e.jsx(bs,{className:"h-4 w-4 text-purple-600"}),"Phase 1 Milestones"]}),e.jsx("div",{className:"space-y-2",children:r.phase1.map((h,f)=>e.jsxs("div",{className:"p-3 bg-card rounded-lg border border-border text-sm",children:[e.jsx("div",{className:"font-semibold mb-1 text-foreground",children:h.name}),e.jsx("div",{className:"text-xs text-foreground mb-1",children:h.timeline}),e.jsx("div",{className:"text-xs text-foreground",children:h.goals})]},f))})]}),r.phase2&&r.phase2.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-3 flex items-center gap-2",children:[e.jsx(bs,{className:"h-4 w-4 text-indigo-600"}),"Phase 2 Milestones"]}),e.jsx("div",{className:"space-y-2",children:r.phase2.map((h,f)=>e.jsxs("div",{className:"p-3 bg-card rounded-lg border border-border text-sm",children:[e.jsx("div",{className:"font-semibold mb-1 text-foreground",children:h.name}),e.jsx("div",{className:"text-xs text-foreground mb-1",children:h.timeline}),e.jsx("div",{className:"text-xs text-foreground",children:h.goals})]},f))})]})]}),r.technicalMilestones&&r.technicalMilestones.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-sm mb-3 flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4 text-cyan-600"}),"Technical Milestones"]}),e.jsx("div",{className:"space-y-2",children:r.technicalMilestones.map((h,f)=>e.jsxs("div",{className:"flex items-start justify-between p-3 bg-card rounded-lg border border-border",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-semibold text-sm text-foreground",children:h.milestone}),e.jsx("div",{className:"text-xs text-foreground mt-1",children:h.description})]}),e.jsx("div",{className:"text-xs text-foreground ml-4",children:h.deadline})]},f))})]})]})}),e.jsx(U,{value:"metrics",className:"mt-0",children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[n&&n.length>0&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(X,{className:"h-5 w-5 text-yellow-500"}),"Risk Mitigation"]})}),e.jsx(x,{className:"space-y-3",children:n.map((h,f)=>e.jsxs("div",{className:"p-3 bg-card rounded-lg border border-border",children:[e.jsx("div",{className:"font-semibold text-sm mb-1 text-foreground",children:h.risk}),e.jsxs("div",{className:"text-xs text-foreground mb-1",children:["Impact: ",e.jsx("span",{className:`font-medium ${h.impact==="High"?"text-red-600":h.impact==="Medium"?"text-orange-600":"text-green-600"}`,children:h.impact})]}),e.jsx("div",{className:"text-xs text-foreground",children:h.mitigation})]},f))})]}),d&&d.length>0&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(Hs,{className:"h-5 w-5 text-green-500"}
196),"Success Metrics"]})}),e.jsx(x,{className:"space-y-3",children:d.map((h,f)=>e.jsxs("div",{className:"p-3 bg-card rounded-lg border border-border",children:[e.jsx("div",{className:"font-semibold text-sm mb-2 text-foreground",children:h.category}),e.jsx("div",{className:"text-xs text-foreground mb-1",children:Array.isArray(h.metrics)?h.metrics.join(", "):h.metrics}),e.jsxs("div",{className:"text-xs text-green-600 font-medium",children:["Targets: ",h.targets]})]},f))})]})]})})]})]})}function Tr(s){return typeof s=="string"?s:typeof s=="object"&&s!==null?s.strength||s.weakness||s.title||s.description||s.rationale||s.text||s.content||JSON.stringify(s):String(s)}function rl({investorOutlook:s,onRegenerate:i,isRegenerating:l}){const a=s.marketOpportunity,t=s.unitEconomics,r=s.growthMetrics,c=s.financialHealth,n=s.traction,d=s.teamExecution,o=s.riskAssessment,g=s.investmentFit,h=s.keyStrengths,f=s.keyWeaknesses,b=s.recommendations,y=s.comparables,S=s.dataSourcesUsed,N=v=>v?v>=70?"text-green-600":v>=40?"text-yellow-600":"text-red-600":"text-foreground",w=v=>v?v>=70?{text:"text-emerald-600",icon:"text-emerald-400/30"}:v>=50?{text:"text-blue-600",icon:"text-blue-400/30"}:v>=30?{text:"text-orange-600",icon:"text-orange-400/30"}:{text:"text-red-600",icon:"text-red-400/30"}:{text:"text-foreground",icon:"text-muted-foreground/30"},P=v=>{if(!v)return"bg-muted/50 text-foreground";const T=v.toLowerCase();return T.includes("investment-ready")?"bg-emerald-100 text-emerald-700":T.includes("nearly ready")?"bg-blue-100 text-blue-700":T.includes("pre-seed")?"bg-yellow-100 text-yellow-700":T.includes("early")?"bg-orange-100 text-orange-700":"bg-muted/50 text-foreground"},C=w(s.investabilityScore);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-l-4 border-l-emerald-500",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-gradient-to-br from-emerald-500 to-green-600 rounded-lg",children:e.jsx(se,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{children:[e.jsx(p,{className:"text-xl",children:"Investor Outlook"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Investment analysis from a VC perspective"})]})]})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 bg-gradient-to-br from-emerald-50 to-green-50 rounded-lg border border-emerald-200",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Investability Score"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:`text-4xl font-bold ${C.text}`,children:[s.investabilityScore||0,"/100"]}),s.investmentReadiness&&e.jsx("div",{className:`px-3 py-1 rounded-full text-xs font-medium ${P(s.investmentReadiness)}`,children:s.investmentReadiness})]})]}),e.jsx(De,{className:`h-16 w-16 ${C.icon}`})]}),e.jsxs("div",{className:"flex items-center gap-6 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Hs,{className:"h-4 w-4 text-green-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Confidence:"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{value:s.confidenceScore||0,className:"w-24 h-2"}),e.jsxs("span",{className:`text-sm font-semibold ${N(s.confidenceScore)}`,children:[s.confidenceScore||0,"%"]})]})]}),S&&S.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(re,{className:"h-4 w-4 text-purple-500"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[S.length," analyses used"]})]})]})]})})]}),e.jsxs(ye,{defaultValue:"overview",className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-2",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsxs(we,{className:"w-full md:w-auto inline-flex min-w-full md:min-w-0 gap-2","data-testid":"tabs-investor-outlook",children:[e.jsxs(K,{value:"overview",className:"flex-1 md:flex-none","data-testid":"tab-overview",children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),"Overview"]}),e.jsxs(K,{value:"market",className:"flex-1 md:flex-none","data-testid":"tab-market",children:[e.jsx(V,{className:"h-4 w-4 mr-2"}),"Market & Growth"]}),e.jsxs(K,{value:"financial",className:"flex-1 md:flex-none","data-testid":"tab-financial",children:[e.jsx(le,{className:"h-4 w-4 mr-2"}),"Financial Health"]}),e.jsxs(K,{value:"team-risk",className:"flex-1 md:flex-none","data-testid":"tab-team-risk",children:[e.jsx(ne,{className:"h-4 w-4 mr-2"}),"Team & Risk"]})]})}),i&&e.jsx("div",{className:"flex-shrink-0",children:e.jsxs(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-investor-outlook",children:[e.jsx(J,{className:`h-4 w-4 mr-2 ${l?"animate-spin":""}`}),"Regenerate"]})})]}),e.jsx(U,{value:"overview",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[s.executiveSummary&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-5 w-5 text-yellow-500"}),"Executive Summary"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-line",children:s.executiveSummary})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[h&&h.length>0&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(re,{className:"h-5 w-5 text-green-500"}),"Key Strengths"]})}),e.jsx(x,{className:"space-y-2",children:h.map((v,T)=>e.jsxs("div",{className:"flex items-start gap-2 p-2 bg-green-50 rounded-lg border border-green-200",children:[e.jsx(re,{className:"h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-foreground",children:Tr(v)})]},T))})]}),f&&f.length>0&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(X,{className:"h-5 w-5 text-orange-500"}),"Key Weaknesses"]})}),e.jsx(x,{className:"space-y-2",children:f.map((v,T)=>e.jsxs("div",{className:"flex items-start gap-2 p-2 bg-orange-50 rounded-lg border border-orange-200",children:[e.jsx(X,{className:"h-4 w-4 text-orange-500 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-foreground",children:Tr(v)})]},T))})]})]}),b&&b.length>0&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"h-5 w-5 text-blue-500"}),"Recommendations"]})}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:b.map((v,T)=>e.jsxs("div",{className:"p-3 bg-white rounded-lg border border-border",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"font-semibold text-sm text-foreground",children:v.area}),e.jsx("span",{className:`text-xs px-2 py-1 rounded ${v.priority==="High"?"bg-red-100 text-red-700":v.priority==="Medium"?"bg-orange-100 text-orange-700":"bg-blue-100 text-blue-700"}`,children:v.priority})]}),e.jsx("p",{className:"text-xs text-foreground",children:v.recommendation})]},T))})})]})]})}),e.jsx(U,{value:"market",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[a&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5 text-purple-500"}),"Market Opportunity"]})}),e.jsxs(x,{className:"space-y-4",children:[a.tam&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"TAM (Total Addressable Market)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.tam})]}),a.sam&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"SAM (Serviceable Addressable Market)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.sam})]}),a.som&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"SOM (Serviceable Obtainable Market)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.som})]}),a.marketTrends&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Market Trends"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.marketTrends})]})]})]}),r&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(se,{className:"h-5 w-5 text-green-500"}),"Growth Metrics"]})}),e.jsxs(x,{className:"space-y-4",children:[r.userGrowth&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"User Growth"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r.userGrowth})]}),r.revenueGrowth&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Revenue Growth"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r.revenueGrowth})]}),r.scalability&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Scalability Assessment"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r.scalability})]})]})]}),n&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"h-5 w-5 text-yellow-500"}),"Traction & Validation"]})}),e.jsxs(x,{className:"space-y-4",children:[n.earlyAdopters&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Early Adopters"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n.earlyAdopters})]}),n.customerValidation&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Customer Validation"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n.customerValidation})]}),n.partnerships&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Partnerships"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n.partnerships})]})]})]}),y&&y.length>0&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(Hs,{className:"h-5 w-5 text-blue-500"}),"Market Comparables"]})}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:y.map((v,T)=>e.jsxs("div",{className:"p-3 bg-white rounded-lg border border-border",children:[e.jsx("div",{className:"font-semibold text-sm mb-1 text-foreground",children:v.company}),e.jsx("p",{className:"text-xs text-foreground mb-2",children:v.similarity}),v.metrics&&e.jsx("div",{className:"text-xs text-muted-foreground",children:v.metrics})]},T))})})]})]})}),e.jsx(U,{value:"financial",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[t&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(le,{className:"h-5 w-5 text-emerald-500"}),"Unit Economics"]})}),e.jsxs(x,{className:"space-y-4",children:[t.ltv&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"LTV (Lifetime Value)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.ltv})]}),t.cac&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"CAC (Customer Acquisition Cost)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.cac})]}),t.ltvCacRatio&&e.jsxs("div",{className:"p-3 bg-gradient-to-br from-emerald-50 to-green-50 rounded-lg border border-emerald-200",children:[e.jsx("div",{className:"text-sm font-semibold text-emerald-700 mb-1",children:"LTV:CAC Ratio"}),e.jsx("p",{className:"text-sm text-foreground",children:t.ltvCacRatio})]}),t.grossMargin&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Gross Margin"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.grossMargin})]})]})]}),c&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(se,{className:"h-5 w-5 text-blue-500"}),"Financial Health"]})}),e.jsxs(x,{className:"space-y-4",children:[c.burnRate&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Burn Rate"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c.burnRate})]}),c.runway&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Runway"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c.runway})]}),c.cashPosition&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Cash Position"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c.cashPosition})]}),c.capitalEfficiency&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Capital Efficiency"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c.capitalEfficiency})]})]})]})]})}),e.jsx(U,{value:"team-risk",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[d&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(ne,{className:"h-5 w-5 text-purple-500"}),"Team & Execution"]})}),e.jsxs(x,{className:"space-y-4",children:[d.founderStrength&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Founder Strength"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.founderStrength})]}),d.teamCompleteness&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Team Completeness"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.teamCompleteness})]}),d.executionCapability&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Execution Capability"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.executionCapability})]})]})]}),o&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(X,{className:"h-5 w-5 text-yellow-500"}),"Risk Assessment"]})}),e.jsxs(x,{className:"space-y-4",children:[o.marketRisk&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Market Risk"}),typeof o.marketRisk=="object"&&o.marketRisk.level&&e.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${o.marketRisk.level==="high"?"bg-red-100 text-red-700":o.marketRisk.level==="medium"?"bg-orange-100 text-orange-700":"bg-green-100 text-green-700"}`,children:o.marketRisk.level})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:typeof o.marketRisk=="object"?o.marketRisk.description:o.marketRisk}
196)]}),o.competitiveRisk&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Competitive Risk"}),typeof o.competitiveRisk=="object"&&o.competitiveRisk.level&&e.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${o.competitiveRisk.level==="high"?"bg-red-100 text-red-700":o.competitiveRisk.level==="medium"?"bg-orange-100 text-orange-700":"bg-green-100 text-green-700"}`,children:o.competitiveRisk.level})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:typeof o.competitiveRisk=="object"?o.competitiveRisk.description:o.competitiveRisk})]}),o.executionRisk&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Execution Risk"}),typeof o.executionRisk=="object"&&o.executionRisk.level&&e.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${o.executionRisk.level==="high"?"bg-red-100 text-red-700":o.executionRisk.level==="medium"?"bg-orange-100 text-orange-700":"bg-green-100 text-green-700"}`,children:o.executionRisk.level})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:typeof o.executionRisk=="object"?o.executionRisk.description:o.executionRisk})]}),o.technicalRisk&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Technical Risk"}),typeof o.technicalRisk=="object"&&o.technicalRisk.level&&e.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${o.technicalRisk.level==="high"?"bg-red-100 text-red-700":o.technicalRisk.level==="medium"?"bg-orange-100 text-orange-700":"bg-green-100 text-green-700"}`,children:o.technicalRisk.level})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:typeof o.technicalRisk=="object"?o.technicalRisk.description:o.technicalRisk})]})]})]}),g&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5 text-blue-500"}),"Investment Fit"]})}),e.jsxs(x,{className:"space-y-4",children:[g.stageAppropriate&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Stage Appropriateness"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:g.stageAppropriate})]}),g.fundingNeeds&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Funding Needs"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:g.fundingNeeds})]}),g.exitPotential&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-1",children:"Exit Potential"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:g.exitPotential})]})]})]})]})})]})]})}function il({financialProjections:s,onRegenerate:i,isRegenerating:l}){const a=s.yearlyProjections,t=s.unitEconomics,r=s.keyAssumptions,c=s.breakEvenAnalysis,n=o=>!o&&o!==0?"N/A":o>=1e6?`$${(o/1e6).toFixed(1)}M`:o>=1e3?`$${(o/1e3).toFixed(0)}K`:`$${o.toFixed(0)}`,d=o=>!o&&o!==0?"N/A":o>=1e6?`${(o/1e6).toFixed(1)}M`:o>=1e3?`${(o/1e3).toFixed(1)}K`:o.toLocaleString();return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-l-4 border-l-blue-500",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-lg",children:e.jsx(le,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{children:[e.jsx(p,{className:"text-xl",children:"Financial Projections"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"5-year revenue forecast and unit economics"})]})]})}),e.jsx(x,{children:e.jsx("div",{className:"grid md:grid-cols-3 gap-4",children:a&&a.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-4 bg-gradient-to-br from-blue-50 to-indigo-50 rounded-lg border border-blue-200","data-testid":"metric-year1-revenue",children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Year 1 Revenue"}),e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:n(a[0]?.revenue)})]}),e.jsxs("div",{className:"p-4 bg-gradient-to-br from-purple-50 to-pink-50 rounded-lg border border-purple-200","data-testid":"metric-year5-revenue",children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Year 5 Revenue"}),e.jsx("div",{className:"text-2xl font-bold text-purple-600",children:n(a[4]?.revenue)})]}),e.jsxs("div",{className:"p-4 bg-gradient-to-br from-green-50 to-emerald-50 rounded-lg border border-green-200","data-testid":"metric-total-growth",children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Total Growth"}),e.jsx("div",{className:"text-2xl font-bold text-green-600",children:a[0]?.revenue&&a[4]?.revenue?`${((a[4].revenue-a[0].revenue)/a[0].revenue*100).toFixed(0)}%`:"N/A"})]})]})})})]}),e.jsxs(ye,{defaultValue:"projections",className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-2",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsxs(we,{className:"w-full md:w-auto inline-flex min-w-full md:min-w-0 gap-2","data-testid":"tabs-financial-projections",children:[e.jsxs(K,{value:"projections",className:"flex-1 md:flex-none","data-testid":"tab-projections",children:[e.jsx(ls,{className:"h-4 w-4 mr-2"}),"Yearly Projections"]}),e.jsxs(K,{value:"unit-economics",className:"flex-1 md:flex-none","data-testid":"tab-unit-economics",children:[e.jsx(xe,{className:"h-4 w-4 mr-2"}),"Unit Economics"]}),e.jsxs(K,{value:"assumptions",className:"flex-1 md:flex-none","data-testid":"tab-assumptions",children:[e.jsx(V,{className:"h-4 w-4 mr-2"}),"Assumptions"]})]})}),i&&e.jsx("div",{className:"flex-shrink-0",children:e.jsxs(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-financial-projections",children:[e.jsx(J,{className:`h-4 w-4 mr-2 ${l?"animate-spin":""}`}),"Regenerate"]})})]}),e.jsx(U,{value:"projections",className:"mt-0",children:e.jsx("div",{className:"space-y-4",children:a&&a.length>0?a.map((o,g)=>e.jsxs(m,{"data-testid":`card-year-projection-${g}`,children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(bs,{className:"h-5 w-5 text-blue-500"}),"Year ",o.year||g+1]})}),e.jsxs(x,{children:[e.jsxs("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"space-y-1","data-testid":`metric-year${g+1}-revenue-value`,children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Revenue"}),e.jsx("div",{className:"text-lg font-bold text-blue-600",children:n(o.revenue)})]}),e.jsxs("div",{className:"space-y-1","data-testid":`metric-year${g+1}
196-users`,children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Users/Customers"}),e.jsx("div",{className:"text-lg font-bold text-purple-600",children:d(o.users)})]}),e.jsxs("div",{className:"space-y-1","data-testid":`metric-year${g+1}-costs`,children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Costs"}),e.jsx("div",{className:"text-lg font-bold text-orange-600",children:n(o.costs)})]}),e.jsxs("div",{className:"space-y-1","data-testid":`metric-year${g+1}-profit`,children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Profit/Loss"}),e.jsx("div",{className:`text-lg font-bold ${(o.revenue||0)-(o.costs||0)>=0?"text-green-600":"text-red-600"}`,children:n((o.revenue||0)-(o.costs||0))})]})]}),o.keyMilestones&&o.keyMilestones.length>0&&e.jsxs("div",{className:"mt-4 pt-4 border-t",children:[e.jsx("div",{className:"text-sm font-medium mb-2",children:"Key Milestones"}),e.jsx("ul",{className:"space-y-1",children:o.keyMilestones.map((h,f)=>e.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[e.jsx(se,{className:"h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"}),h]},f))})]})]})]},g)):e.jsx(m,{children:e.jsx(x,{className:"py-8 text-center text-muted-foreground",children:"No yearly projections available"})})})}),e.jsx(U,{value:"unit-economics",className:"mt-0",children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[t&&e.jsxs(e.Fragment,{children:[e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(le,{className:"h-5 w-5 text-green-500"}),"Customer Acquisition"]})}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 rounded-lg","data-testid":"metric-cac",children:[e.jsx("span",{className:"text-sm font-medium",children:"Customer Acquisition Cost (CAC)"}),e.jsx("span",{className:"text-lg font-bold text-green-600",children:n(t.cac)})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-blue-50 rounded-lg","data-testid":"metric-ltv",children:[e.jsx("span",{className:"text-sm font-medium",children:"Customer Lifetime Value (LTV)"}),e.jsx("span",{className:"text-lg font-bold text-blue-600",children:n(t.ltv)})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-purple-50 rounded-lg","data-testid":"metric-ltv-cac-ratio",children:[e.jsx("span",{className:"text-sm font-medium",children:"LTV:CAC Ratio"}),e.jsx("span",{className:"text-lg font-bold text-purple-600",children:t.ltvCacRatio?`${t.ltvCacRatio.toFixed(1)}:1`:"N/A"})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-orange-50 rounded-lg","data-testid":"metric-payback-period",children:[e.jsx("span",{className:"text-sm font-medium",children:"Payback Period"}),e.jsx("span",{className:"text-lg font-bold text-orange-600",children:t.paybackPeriod?`${t.paybackPeriod} months`:"N/A"})]})]})]}),e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(Ii,{className:"h-5 w-5 text-indigo-500"}),"Revenue Metrics"]})}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 bg-indigo-50 rounded-lg","data-testid":"metric-arpu",children:[e.jsx("span",{className:"text-sm font-medium",children:"Average Revenue Per User (ARPU)"}),e.jsx("span",{className:"text-lg font-bold text-indigo-600",children:n(t.arpu)})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-pink-50 rounded-lg","data-testid":"metric-gross-margin",children:[e.jsx("span",{className:"text-sm font-medium",children:"Gross Margin"}),e.jsx("span",{className:"text-lg font-bold text-pink-600",children:t.grossMargin?`${(t.grossMargin*100).toFixed(0)}%`:"N/A"})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-cyan-50 rounded-lg","data-testid":"metric-churn-rate",children:[e.jsx("span",{className:"text-sm font-medium",children:"Churn Rate (Monthly)"}),e.jsx("span",{className:"text-lg font-bold text-cyan-600",children:t.churnRate?`${(t.churnRate*100).toFixed(1)}%`:"N/A"})]})]})]})]}),c&&e.jsxs(m,{className:"md:col-span-2",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(V,{className:"h-5 w-5 text-yellow-500"}),"Break-Even Analysis"]})}),e.jsx(x,{children:e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 bg-yellow-50 rounded-lg border border-yellow-200","data-testid":"metric-breakeven-timeline",children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Break-Even Timeline"}),e.jsx("div",{className:"text-xl font-bold text-yellow-600",children:c.breakEvenMonth?`Month ${c.breakEvenMonth}`:"N/A"})]}),e.jsxs("div",{className:"p-4 bg-emerald-50 rounded-lg border border-emerald-200","data-testid":"metric-breakeven-users",children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Users Needed"}),e.jsx("div",{className:"text-xl font-bold text-emerald-600",children:d(c.usersNeeded)})]}),e.jsxs("div",{className:"p-4 bg-rose-50 rounded-lg border border-rose-200","data-testid":"metric-breakeven-capital",children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Capital Required"}),e.jsx("div",{className:"text-xl font-bold text-rose-600",children:n(c.capitalRequired)})]})]})})]})]})}),e.jsx(U,{value:"assumptions",className:"mt-0",children:e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5 text-orange-500"}),"Key Assumptions & Methodology"]})}),e.jsx(x,{children:r&&r.length>0?e.jsx("ul",{className:"space-y-3",children:r.map((o,g)=>e.jsxs("li",{className:"flex items-start gap-3 p-3 bg-muted/50 rounded-lg",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-orange-100 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx("span",{className:"text-xs font-bold text-orange-600",children:g+1})}),e.jsx("span",{className:"text-sm text-foreground",children:o})]},g))}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No assumptions documented"})})]})})]})]})}function nl({marketSizing:s,onRegenerate:i,isRegenerating:l}){const a=s.tam,t=s.sam,r=s.som;s.methodology;const c=s.marketTrends,n=s.competitiveLandscape,d=o=>!o&&o!==0?"N/A":o>=1e9?`$${(o/1e9).toFixed(1)}B`:o>
196=1e6?`$${(o/1e6).toFixed(1)}M`:o>=1e3?`$${(o/1e3).toFixed(0)}K`:`$${o.toFixed(0)}`;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-l-4 border-l-purple-500",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-gradient-to-br from-purple-500 to-pink-600 rounded-lg",children:e.jsx(js,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{children:[e.jsx(p,{className:"text-xl",children:"Market Sizing"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"TAM/SAM/SOM analysis with defensible calculations"})]})]})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"space-y-3",children:[a&&e.jsx("div",{className:"p-4 bg-gradient-to-br from-purple-50 to-pink-50 rounded-lg border-2 border-purple-300","data-testid":"metric-tam-value",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Total Addressable Market (TAM)"}),e.jsx("div",{className:"text-3xl font-bold text-purple-600",children:d(a.value)}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:a.description||"Entire global market opportunity"})]}),e.jsx(js,{className:"h-12 w-12 text-purple-400/30"})]})}),t&&e.jsx("div",{className:"ml-8 p-4 bg-gradient-to-br from-blue-50 to-cyan-50 rounded-lg border-2 border-blue-300","data-testid":"metric-sam-value",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Serviceable Addressable Market (SAM)"}),e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:d(t.value)}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:t.description||"Market segment you can reach"})]}),e.jsx(V,{className:"h-10 w-10 text-blue-400/30"})]})}),r&&e.jsx("div",{className:"ml-16 p-4 bg-gradient-to-br from-green-50 to-emerald-50 rounded-lg border-2 border-green-300","data-testid":"metric-som-value",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Serviceable Obtainable Market (SOM)"}),e.jsx("div",{className:"text-xl font-bold text-green-600",children:d(r.value)}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:r.description||"Market share you can realistically capture"})]}),e.jsx(se,{className:"h-8 w-8 text-green-400/30"})]})})]}),e.jsx("div",{className:"absolute left-4 top-20 bottom-20 w-0.5 bg-gradient-to-b from-purple-300 via-blue-300 to-green-300"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[t&&a&&a.value&&e.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg","data-testid":"metric-sam-percentage-of-tam",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"SAM as % of TAM"}),e.jsxs("div",{className:"text-lg font-bold text-foreground",children:[(t.value/a.value*100).toFixed(1),"%"]})]}),r&&t&&t.value&&e.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg","data-testid":"metric-som-percentage-of-sam",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"SOM as % of SAM"}),e.jsxs("div",{className:"text-lg font-bold text-foreground",children:[(r.value/t.value*100).toFixed(1),"%"]})]})]})]})})]}),e.jsxs(ye,{defaultValue:"methodology",className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-2",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsxs(we,{className:"w-full md:w-auto inline-flex min-w-full md:min-w-0 gap-2","data-testid":"tabs-market-sizing",children:[e.jsxs(K,{value:"methodology",className:"flex-1 md:flex-none","data-testid":"tab-methodology",children:[e.jsx(zi,{className:"h-4 w-4 mr-2"}),"Methodology"]}),e.jsxs(K,{value:"trends",className:"flex-1 md:flex-none","data-testid":"tab-trends",children:[e.jsx(se,{className:"h-4 w-4 mr-2"}),"Market Trends"]}),e.jsxs(K,{value:"competitive",className:"flex-1 md:flex-none","data-testid":"tab-competitive",children:[e.jsx(_s,{className:"h-4 w-4 mr-2"}),"Competitive Landscape"]})]})}),i&&e.jsx("div",{className:"flex-shrink-0",children:e.jsxs(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-market-sizing",children:[e.jsx(J,{className:`h-4 w-4 mr-2 ${l?"animate-spin":""}`}),"Regenerate"]})})]}),e.jsx(U,{value:"methodology",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[a&&a.calculation&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(js,{className:"h-5 w-5 text-purple-500"}),"TAM Calculation"]})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-foreground",children:a.calculation}),a.sources&&a.sources.length>0&&e.jsxs("div",{className:"pt-3 border-t",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Data Sources"}),e.jsx("ul",{className:"space-y-1",children:a.sources.map((o,g)=>e.jsxs("li",{className:"text-xs text-muted-foreground flex items-start gap-2",children:[e.jsx(Ce,{className:"h-3 w-3 mt-0.5 flex-shrink-0"}),o]},g))})]})]})})]}),t&&t.calculation&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(V,{className:"h-5 w-5 text-blue-500"}
196),"SAM Calculation"]})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-foreground",children:t.calculation}),t.sources&&t.sources.length>0&&e.jsxs("div",{className:"pt-3 border-t",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Data Sources"}),e.jsx("ul",{className:"space-y-1",children:t.sources.map((o,g)=>e.jsxs("li",{className:"text-xs text-muted-foreground flex items-start gap-2",children:[e.jsx(Ce,{className:"h-3 w-3 mt-0.5 flex-shrink-0"}),o]},g))})]})]})})]}),r&&r.calculation&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(se,{className:"h-5 w-5 text-green-500"}),"SOM Calculation"]})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-foreground",children:r.calculation}),r.assumptions&&r.assumptions.length>0&&e.jsxs("div",{className:"pt-3 border-t",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Key Assumptions"}),e.jsx("ul",{className:"space-y-1",children:r.assumptions.map((o,g)=>e.jsxs("li",{className:"text-xs text-muted-foreground flex items-start gap-2",children:[e.jsx(Ce,{className:"h-3 w-3 mt-0.5 flex-shrink-0"}),o]},g))})]})]})})]})]})}),e.jsx(U,{value:"trends",className:"mt-0",children:e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(se,{className:"h-5 w-5 text-green-500"}),"Market Trends & Drivers"]})}),e.jsx(x,{children:c&&c.length>0?e.jsx("ul",{className:"space-y-3",children:c.map((o,g)=>e.jsxs("li",{className:"flex items-start gap-3 p-3 bg-muted/50 rounded-lg",children:[e.jsx(se,{className:"h-5 w-5 text-green-500 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-foreground",children:o})]},g))}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No market trends documented"})})]})}),e.jsx(U,{value:"competitive",className:"mt-0",children:e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(_s,{className:"h-5 w-5 text-orange-500"}),"Competitive Landscape"]})}),e.jsx(x,{children:n?e.jsxs("div",{className:"space-y-4",children:[n.overview&&e.jsxs("div",{className:"p-4 bg-orange-50 rounded-lg border border-orange-200",children:[e.jsx("div",{className:"text-sm font-medium mb-2",children:"Overview"}),e.jsx("p",{className:"text-sm text-foreground",children:n.overview})]}),n.majorPlayers&&n.majorPlayers.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium mb-2",children:"Major Players"}),e.jsx("div",{className:"grid md:grid-cols-2 gap-3",children:n.majorPlayers.map((o,g)=>e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted/50 rounded-lg","data-testid":`card-major-player-${g}`,children:[e.jsx(_s,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-foreground",children:o})]},g))})]}),n.marketConcentration&&e.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg border border-blue-200",children:[e.jsx("div",{className:"text-sm font-medium mb-2",children:"Market Concentration"}),e.jsx("p",{className:"text-sm text-foreground",children:n.marketConcentration})]})]}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No competitive landscape analysis available"})})]})})]})]})}function ll({positioningStatements:s,onRegenerate:i,isRegenerating:l}){const a=s.valueProposition,t=s.elevatorPitch,r=s.taglines,c=s.messagingFramework;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-l-4 border-l-indigo-500",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-lg",children:e.jsx(Js,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{children:[e.jsx(p,{className:"text-xl",children:"Positioning Statements"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Value propositions and messaging frameworks"})]})]})}),e.jsx(x,{children:a&&a.statement&&e.jsx("div",{className:"p-6 bg-gradient-to-br from-indigo-50 to-purple-50 rounded-lg border-2 border-indigo-300","data-testid":"card-value-proposition-highlight",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ie,{className:"h-6 w-6 text-indigo-500 mt-1 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-2",children:"Core Value Proposition"}),e.jsx("p",{className:"text-lg font-semibold text-indigo-900 leading-relaxed",children:a.statement})]})]})})})]}),e.jsxs(ye,{defaultValue:"value-prop",className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-2",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsxs(we,{className:"w-full md:w-auto inline-flex min-w-full md:min-w-0 gap-2","data-testid":"tabs-positioning-statements",children:[e.jsxs(K,{value:"value-prop",className:"flex-1 md:flex-none","data-testid":"tab-value-prop",children:[e.jsx(V,{className:"h-4 w-4 mr-2"}),"Value Proposition"]}),e.jsxs(K,{value:"elevator-pitch",className:"flex-1 md:flex-none","data-testid":"tab-elevator-pitch",children:[e.jsx(he,{className:"h-4 w-4 mr-2"}),"Elevator Pitch"]}),e.jsxs(K,{value:"taglines",className:"flex-1 md:flex-none","data-testid":"tab-taglines",children:[e.jsx(_a,{className:"h-4 w-4 mr-2"}),"Taglines"]}),e.jsxs(K,{value:"messaging",className:"flex-1 md:flex-none","data-testid":"tab-messaging",children:[e.jsx(Qa,{className:"h-4 w-4 mr-2"}),"Messaging"]})]})}),i&&e.jsx("div",{className:"flex-shrink-0",children:e.jsxs(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-positioning-statements",children:[e.jsx(J,{className:`h-4 w-4 mr-2 ${l?"animate-spin":""}`}),"Regenerate"]})})]}),e.jsx(U,{value:"value-prop",className:"mt-0",children:e.jsx("div",{className:"space-y-6",children:a&&e.jsxs(e.Fragment,{children:[e.jsxs(m,{"data-testid":"card-value-proposition-statement",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(V,{className:"h-5 w-5 text-indigo-500"}),"Value Proposition Statement"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-base text-foreground leading-relaxed",children:a.statement})})]}),a.targetCustomer&&e.jsxs(m,{"data-testid":"section-target-customer",children:[e.jsx(u,{children:e.jsx(p,{className:"text-base",children:"Target Customer"})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground",children:a.targetCustomer})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[a.problemSolved&&e.jsxs(m,{className:"border-l-4 border-l-red-500","data-testid":"section-problem-solved",children:[e.jsx(u,{children:e.jsx(p,{className:"text-base",children:"Problem Solved"})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground",children:a.problemSolved})})]}),a.uniqueDifferentiator&&e.jsxs(m,{className:"border-l-4 border-l-green-500","data-testid":"section-unique-differentiator",children:[e.jsx(u,{children:e.jsx(p,{className:"text-base",children:"Unique Differentiator"})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground",children:a.uniqueDifferentiator})})]}),a.benefitsDelivered&&a.benefitsDelivered.length>0&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsx(p,{className:"text-base",children:"Benefits Delivered"})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:a.benef
196itsDelivered.map((n,d)=>e.jsxs("li",{className:"flex items-start gap-2 p-3 bg-green-50 rounded-lg",children:[e.jsx(ie,{className:"h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-foreground",children:n})]},d))})})]})]})]})})}),e.jsx(U,{value:"elevator-pitch",className:"mt-0",children:e.jsx("div",{className:"space-y-6",children:t&&e.jsxs(e.Fragment,{children:[t.thirtySeconds&&e.jsxs(m,{className:"border-l-4 border-l-blue-500","data-testid":"section-elevator-pitch-30sec",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(he,{className:"h-5 w-5 text-blue-500"}),"30-Second Pitch"]})}),e.jsx(x,{children:e.jsx("div",{className:"p-4 bg-blue-50 rounded-lg",children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-line",children:t.thirtySeconds})})})]}),t.oneMinute&&e.jsxs(m,{className:"border-l-4 border-l-purple-500","data-testid":"section-elevator-pitch-1min",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(he,{className:"h-5 w-5 text-purple-500"}),"1-Minute Pitch"]})}),e.jsx(x,{children:e.jsx("div",{className:"p-4 bg-purple-50 rounded-lg",children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-line",children:t.oneMinute})})})]}),t.keyHook&&e.jsxs(m,{className:"border-l-4 border-l-orange-500","data-testid":"section-elevator-pitch-hook",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(ya,{className:"h-5 w-5 text-orange-500"}),"Key Hook"]})}),e.jsx(x,{children:e.jsx("div",{className:"p-4 bg-orange-50 rounded-lg",children:e.jsxs("p",{className:"text-base font-semibold text-orange-900",children:['"',t.keyHook,'"']})})})]})]})})}),e.jsx(U,{value:"taglines",className:"mt-0",children:e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(_a,{className:"h-5 w-5 text-pink-500"}),"Proposed Taglines"]})}),e.jsx(x,{children:r&&r.length>0?e.jsx("div",{className:"grid gap-4",children:r.map((n,d)=>e.jsx("div",{className:"p-4 bg-gradient-to-r from-pink-50 to-purple-50 rounded-lg border border-pink-200","data-testid":`card-tagline-${d}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-pink-100 flex items-center justify-center flex-shrink-0",children:e.jsx("span",{className:"text-sm font-bold text-pink-600",children:d+1})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("p",{className:"text-lg font-semibold text-pink-900 mb-2",children:['"',typeof n=="string"?n:n.tagline,'"']}),typeof n=="object"&&n.rationale&&e.jsx("p",{className:"text-sm text-foreground",children:n.rationale})]})]})},d))}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No taglines generated"})})]})}),e.jsx(U,{value:"messaging",className:"mt-0",children:e.jsx("div",{className:"space-y-6",children:c&&e.jsxs(e.Fragment,{children:[c.coreMessage&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(Qa,{className:"h-5 w-5 text-blue-500"}),"Core Message"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-base text-foreground leading-relaxed",children:c.coreMessage})})]}),c.pillars&&c.pillars.length>0&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsx(p,{children:"Messaging Pillars"})}),e.jsx(x,{children:e.jsx("div",{className:"grid md:grid-cols-3 gap-4",children:c.pillars.map((n,d)=>e.jsxs("div",{className:"p-4 bg-gradient-to-br from-indigo-50 to-blue-50 rounded-lg border border-indigo-200","data-testid":`card-messaging-pillar-${d}`,children:[e.jsx("div",{className:"text-sm font-semibold text-indigo-900 mb-2",children:typeof n=="string"?n:n.title}),typeof n=="object"&&n.description&&e.jsx("p",{className:"text-xs text-foreground",children:n.description})]},d))})})]}),c.audienceSegments&&c.audienceSegments.length>0&&e.jsxs(m,{children:[e.jsx(u,{children:e.jsx(p,{children:"Audience-Specific Messaging"})}),e.jsx(x,{children:e.jsx("div",{className:"space-y-4",children:c.audienceSegments.map((n,d)=>e.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg",children:[e.jsx("div",{className:"text-sm font-semibold text-foreground mb-2",children:n.audience}),e.jsx("p",{className:"text-sm text-foreground",children:n.message})]},d))})})]})]})})})]})]})}function dl({teamProfiles:s,onRegenerate:i,isRegenerating:l}){const a=s.currentTeam,t=s.hiringRoadmap,r=s.advisors,c=s.teamGaps,n=d=>d?d>=1e6?`$${(d/1e6).toFixed(1)}M`:d>=1e3?`$${(d/1e3).toFixed(0)}K`:`$${d.toFixed(0)}`:"Competitive";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-l-4 border-l-cyan-500",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-gradient-to-br from-cyan-500 to-blue-600 rounded-lg",children:e.jsx(ne,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{children:[e.jsx(p,{className:"text-xl",children:"Team Profiles"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Current team, advisors, and hiring roadmap"})]})]})}),e.jsx(x,{children:e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 bg-gradient-to-br from-cyan-50 to-blue-50 rounded-lg border border-cyan-200","data-testid":"metric-current-team-count",children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Current Team"}),e.jsx("div",{className:"text-2xl font-bold text-cyan-600",children:a?.length||0})]}),e.jsxs("div",{className:"p-4 bg-gradient-to-br from-purple-50 to-pink-50 rounded-lg border border-purple-200","data-testid":"metric-planned-hires-count",children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Planned Hires"}),e.jsx("div",{className:"text-2xl font-bold text-purple-600",children:t?.length||0})]}),e.jsxs("div",{className:"p-4 bg-gradient-to-br from-orange-50 to-amber-50 rounded-lg border border-orange-200","data-testid":"metric-advisors-count",children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-1",children:"Adv
196isors"}),e.jsx("div",{className:"text-2xl font-bold text-orange-600",children:r?.length||0})]})]})})]}),e.jsxs(ye,{defaultValue:"current",className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-2",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsxs(we,{className:"w-full md:w-auto inline-flex min-w-full md:min-w-0 gap-2","data-testid":"tabs-team-profiles",children:[e.jsxs(K,{value:"current",className:"flex-1 md:flex-none","data-testid":"tab-current",children:[e.jsx(ne,{className:"h-4 w-4 mr-2"}),"Current Team"]}),e.jsxs(K,{value:"hiring",className:"flex-1 md:flex-none","data-testid":"tab-hiring",children:[e.jsx(Rt,{className:"h-4 w-4 mr-2"}),"Hiring Roadmap"]}),e.jsxs(K,{value:"advisors",className:"flex-1 md:flex-none","data-testid":"tab-advisors",children:[e.jsx(De,{className:"h-4 w-4 mr-2"}),"Advisors"]}),e.jsxs(K,{value:"gaps",className:"flex-1 md:flex-none","data-testid":"tab-gaps",children:[e.jsx(V,{className:"h-4 w-4 mr-2"}),"Gaps"]})]})}),i&&e.jsx("div",{className:"flex-shrink-0",children:e.jsxs(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-team-profiles",children:[e.jsx(J,{className:`h-4 w-4 mr-2 ${l?"animate-spin":""}`}),"Regenerate"]})})]}),e.jsx(U,{value:"current",className:"mt-0",children:e.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:a&&a.length>0?a.map((d,o)=>e.jsxs(m,{className:"border-l-4 border-l-cyan-500","data-testid":`card-team-member-${o}`,children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(ne,{className:"h-5 w-5 text-cyan-500"}),d.name||"Team Member"]}),d.role&&e.jsx("p",{className:"text-sm text-muted-foreground",children:d.role})]}),e.jsxs(x,{className:"space-y-3",children:[d.bio&&e.jsx("p",{className:"text-sm text-foreground",children:d.bio}),d.expertise&&d.expertise.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Expertise"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:d.expertise.map((g,h)=>e.jsx("span",{className:"px-2 py-1 bg-cyan-100 text-cyan-700 text-xs rounded-full",children:g},h))})]}),d.keyAchievements&&d.keyAchievements.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Key Achievements"}),e.jsx("ul",{className:"space-y-1",children:d.keyAchievements.map((g,h)=>e.jsxs("li",{className:"text-xs text-foreground flex items-start gap-2",children:[e.jsx(De,{className:"h-3 w-3 text-cyan-500 mt-0.5 flex-shrink-0"}),g]},h))})]})]})]},o)):e.jsx(m,{className:"md:col-span-2",children:e.jsx(x,{className:"py-8 text-center text-muted-foreground",children:"No current team members documented"})})})}),e.jsx(U,{value:"hiring",className:"mt-0",children:e.jsx("div",{className:"space-y-4",children:t&&t.length>0?t.map((d,o)=>e.jsxs(m,{"data-testid":`card-hiring-roadmap-${o}`,children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(Rt,{className:"h-5 w-5 text-purple-500"}),d.role||"Position"]}),d.timeline&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(bs,{className:"h-4 w-4"}),d.timeline]})]})}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[d.responsibilities&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium mb-2",children:"Responsibilities"}),e.jsx("ul",{className:"space-y-1",children:d.responsibilities.map((g,h)=>e.jsxs("li",{className:"text-sm text-foreground flex items-start gap-2",children:[e.jsx(st,{className:"h-3 w-3 text-purple-500 mt-1 flex-shrink-0"}),g]},h))})]}),d.requiredSkills&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium mb-2",children:"Required Skills"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:d.requiredSkills.map((g,h)=>e.jsx("span",{className:"px-2 py-1 bg-purple-100 text-purple-700 text-xs rounded-full",children:g},h))})]})]}),e.jsxs("div",{className:"flex items-center gap-6 flex-wrap pt-3 border-t",children:[d.estimatedSalary&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Estimated Salary:"}),e.jsx("span",{className:"text-sm font-semibold text-green-600",children:n(d.estimatedSalary)})]}),d.priority&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Priority:"}),e.jsx("span",{className:`text-sm font-semibold ${d.priority.toLowerCase()==="high"?"text-red-600":d.priority.toLowerCase()==="medium"?"text-yellow-600":"text-blue-600"}`,children:d.priority})]})]})]})]},o)):e.jsx(m,{children:e.jsx(x,{className:"py-8 text-center text-muted-foreground",children:"No hiring roadmap defined"})})})}),e.jsx(U,{value:"advisors",className:"mt-0",children:e.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:r&&r.length>0?r.map((d,o)=>e.jsxs(m,{className:"border-l-4 border-l-orange-500","data-testid":`card-advisor-${o}`,children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2 text-lg",children:[e.jsx(De,{className:"h-5 w-5 text-orange-500"}),d.name||"Advisor"]}),d.expertise&&e.jsx("p",{className:"text-sm text-muted-foreground",children:d.expertise})]}),e.jsxs(x,{className:"space-y-3",children:[d.bio&&e.jsx("p",{className:"text-sm text-foreground",children:d.bio}),d.valueAdded&&e.jsxs("div",{className:"p-3 bg-orange-50 rounded-lg border border-orange-200",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Value Added"}),e.jsx("p",{className:"text-sm text-foreground",children:d.valueAdded})]})]})]},o)):e.jsx(m,{className:"md:col-span-2",children:e.jsx(x,{className:"py-8 text-center text-muted-foreground",children:"No advisors documented"})})})}),e.jsx(U,{value:"gaps",className:"mt-0",children:e.jsxs(m,{children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5 text-red-500"}),"Identified Team Gaps & Needs"]})}),e.jsx(x,{children:c&&c.length>0?e.jsx("ul",{className:"space-y-3",children:c.map((d,o)=>e.jsxs("li",{className:"flex items-start gap-3 p-4 bg-red-50 rounded-lg border border-red-200",children:[e.jsx(V,{className:"h-5 w-5 text-red-500 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-sm font-semibold text-red-900 mb-1",children:typeof d=="str
196ing"?d:d.gap}),typeof d=="object"&&d.impact&&e.jsxs("p",{className:"text-xs text-foreground",children:["Impact: ",d.impact]})]})]},o))}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No team gaps identified"})})]})})]})]})}function cl({pitchNarrative:s,onRegenerate:i,isRegenerating:l}){const a=s.story,t=s.slideBySlide;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-l-4 border-l-emerald-500",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-gradient-to-br from-emerald-500 to-green-600 rounded-lg",children:e.jsx(fs,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{children:[e.jsx(p,{className:"text-xl",children:"Pitch Deck Narrative"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Complete investor storyline and slide-by-slide guidance"})]})]})}),e.jsx(x,{children:a&&a.hook&&e.jsx("div",{className:"p-6 bg-gradient-to-br from-emerald-50 to-green-50 rounded-lg border-2 border-emerald-300","data-testid":"card-story-hook",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ie,{className:"h-6 w-6 text-emerald-500 mt-1 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-2",children:"Opening Hook"}),e.jsx("p",{className:"text-lg font-semibold text-emerald-900 leading-relaxed",children:a.hook})]})]})})})]}),e.jsxs(ye,{defaultValue:"story",className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-2",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsxs(we,{className:"w-full md:w-auto inline-flex min-w-full md:min-w-0 gap-2","data-testid":"tabs-pitch-narrative",children:[e.jsxs(K,{value:"story",className:"flex-1 md:flex-none","data-testid":"tab-story",children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),"Story Arc"]}),e.jsxs(K,{value:"slides",className:"flex-1 md:flex-none","data-testid":"tab-slides",children:[e.jsx(fs,{className:"h-4 w-4 mr-2"}),"Slide-by-Slide"]})]})}),i&&e.jsx("div",{className:"flex-shrink-0",children:e.jsxs(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-pitch-narrative",children:[e.jsx(J,{className:`h-4 w-4 mr-2 ${l?"animate-spin":""}`}),"Regenerate"]})})]}),e.jsx(U,{value:"story",className:"mt-0",children:e.jsx("div",{className:"space-y-4",children:a&&e.jsxs(e.Fragment,{children:[a.problem&&e.jsxs(m,{className:"border-l-4 border-l-red-500","data-testid":"section-problem-story",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(me,{className:"h-5 w-5 text-red-500"}),"The Problem"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-line",children:a.problem})})]}),a.solution&&e.jsxs(m,{className:"border-l-4 border-l-blue-500","data-testid":"section-solution-story",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(he,{className:"h-5 w-5 text-blue-500"}),"The Solution"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-line",children:a.solution})})]}),a.marketOpportunity&&e.jsxs(m,{className:"border-l-4 border-l-purple-500","data-testid":"section-market-story",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5 text-purple-500"}),"Market Opportunity"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-line",children:a.marketOpportunity})})]}),a.traction&&e.jsxs(m,{className:"border-l-4 border-l-green-500","data-testid":"section-traction-story",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(se,{className:"h-5 w-5 text-green-500"}),"Traction & Validation"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-line",children:a.traction})})]}),a.businessModel&&e.jsxs(m,{className:"border-l-4 border-l-yellow-500","data-testid":"section-business-model-story",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(le,{className:"h-5 w-5 text-yellow-500"}),"Business Model"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-line",children:a.businessModel})})]}),a.team&&e.jsxs(m,{className:"border-l-4 border-l-cyan-500","data-testid":"section-team-story",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(ne,{className:"h-5 w-5 text-cyan-500"}),"The Team"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-line",children:a.team})})]}),a.theAsk&&e.jsxs(m,{className:"border-l-4 border-l-orange-500","data-testid":"section-ask-story",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(le,{className:"h-5 w-5 text-orange-500"}),"The Ask"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed whitespace-pre-line",children:a.theAsk})})]})]})})}),e.jsx(U,{value:"slides",className:"mt-0",children:e.jsx("div",{className:"space-y-4",children:t&&t.length>0?t.map((r,c)=>e.jsxs(m,{"data-testid":`card-slide-${c}`,children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-emerald-100 flex items-center justify-center flex-shrink-0",children:e.jsx("span",{className:"text-sm font-bold text-emerald-600",children:r.slideNumber||c+1})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(p,{className:"text-lg",children:r.title||`Slide ${c+1}`}),r.purpose&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r.purpose})]})]})}),e.jsxs(x,{className:"space-y-4",children:[r.content&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium mb-2",children:"Content"}),e.jsx("p",{className:"text-sm text-foreground whitespace-pre-line",children:r.content})]}
196),r.keyMessages&&r.keyMessages.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium mb-2",children:"Key Messages"}),e.jsx("ul",{className:"space-y-2",children:r.keyMessages.map((n,d)=>e.jsxs("li",{className:"flex items-start gap-2 p-2 bg-emerald-50 rounded",children:[e.jsx(re,{className:"h-4 w-4 text-emerald-500 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-foreground",children:n})]},d))})]}),r.visualSuggestions&&e.jsxs("div",{className:"p-3 bg-blue-50 rounded-lg border border-blue-200",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Visual Suggestions"}),e.jsx("p",{className:"text-sm text-foreground",children:r.visualSuggestions})]}),r.talkingPoints&&r.talkingPoints.length>0&&e.jsxs("div",{className:"p-3 bg-purple-50 rounded-lg border border-purple-200",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Talking Points"}),e.jsx("ul",{className:"space-y-1",children:r.talkingPoints.map((n,d)=>e.jsxs("li",{className:"text-xs text-foreground",children:["• ",n]},d))})]})]})]},c)):e.jsx(m,{children:e.jsx(x,{className:"py-8 text-center text-muted-foreground",children:"No slide-by-slide guidance available"})})})})]})]})}function ol({executionPlanData:s,investorOutlookData:i,financialProjectionsData:l,marketSizingData:a,positioningStatementsData:t,teamProfilesData:r,pitchNarrativeData:c,opportunityAssessmentData:n,marketViabilityData:d,competitiveLandscapeData:o,thinkingHatsData:g,socialValidationData:h,expertValidationData:f,executionReadinessData:b}){const y=[],S=new Map,N=(v,T)=>{if(!v)return;(Array.isArray(v)?v:[v]).forEach(A=>{typeof A=="string"?y.push({source:A,category:T}):typeof A=="object"&&A!==null&&y.push({source:A.source||A.name||"Unknown",link:A.link||A.url,url:A.url||A.link,date:A.date,credibility:A.credibility,category:T})})};if(s?.dataSourcesUsed&&N(s.dataSourcesUsed,"Execution Planning"),i?.dataSourcesUsed&&N(i.dataSourcesUsed,"Investor Analysis"),l?.dataSourcesUsed&&N(l.dataSourcesUsed,"Financial Modeling"),a&&(a.tamSources&&N(a.tamSources,"Market Sizing (TAM)"),a.samSources&&N(a.samSources,"Market Sizing (SAM)"),a.dataSources&&N(a.dataSources,"Market Sizing")),n?.citations&&typeof n.citations=="object"){const v=Object.values(n.citations).filter(Array.isArray).flat();v.length>0&&N(v,"Opportunity Assessment")}d?.dataSources&&N(d.dataSources,"Market Viability"),o?.sources&&N(o.sources,"Competitive Analysis"),h?.dataSources&&N(h.dataSources,"Social Validation"),f?.dataSources&&N(f.dataSources,"Expert Opinion"),b?.dataSources&&N(b.dataSources,"Execution Readiness");const w=[];if([...y,...w].forEach(v=>{const T=v.category||"Other";S.has(T)||S.set(T,[]),S.get(T).push(v)}),S.forEach((v,T)=>{const $=v.filter((A,z,F)=>z===F.findIndex(k=>k.source===A.source&&k.link===A.link));S.set(T,$)}),y.length===0&&w.length===0)return null;const P=v=>v.includes("Market")?e.jsx(se,{className:"h-4 w-4"}):v.includes("Financial")?e.jsx(le,{className:"h-4 w-4"}):v.includes("Competitive")?e.jsx(V,{className:"h-4 w-4"}):v.includes("Team")||v.includes("Execution")?e.jsx(ne,{className:"h-4 w-4"}):v.includes("AI")?e.jsx(Di,{className:"h-4 w-4"}):v.includes("Investor")||v.includes("Opportunity")?e.jsx(fs,{className:"h-4 w-4"}):e.jsx(tt,{className:"h-4 w-4"}),C=v=>{if(!v)return"default";const T=v.toLowerCase();return T==="high"||T==="primary"?"default":T==="medium"?"secondary":"outline"};return e.jsxs(m,{className:"w-full","data-testid":"card-references-sources",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-references-sources",children:[e.jsx(tt,{className:"h-5 w-5"}),"References & Data Sources"]}),e.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"text-references-description",children:"All data sources and references used in generating this idea validation analysis"})]}),e.jsxs(x,{className:"space-y-6",children:[Array.from(S.entries()).map(([v,T])=>e.jsxs("div",{className:"space-y-3","data-testid":`section-category-${v.toLowerCase().replace(/\s+/g,"-")}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[P(v),e.jsx("h3",{className:"font-semibold text-sm","data-testid":`heading-category-${v.toLowerCase().replace(/\s+/g,"-")}`,children:v}),e.jsxs(I,{variant:"outline",className:"ml-auto","data-testid":`badge-count-${v.toLowerCase().replace(/\s+/g,"-")}`,children:[T.length," ",T.length===1?"source":"sources"]})]}),e.jsx("div",{className:"space-y-2 pl-6",children:T.map(($,A)=>e.jsx("div",{className:"flex items-start justify-between gap-3 p-3 rounded-lg border bg-card hover:bg-accent/50 transition-colors","data-testid":`item-source-${v.toLowerCase().replace(/\s+/g,"-")}-${A}`,children:e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("p",{className:"text-sm font-medium","data-testid":`text-source-name-${A}`,children:$.source}),$.credibility&&e.jsx(I,{variant:C($.credibility),className:"text-xs","data-testid":`badge-credibility-${A}`,children:$.credibility})]}),$.date&&e.jsxs("p",{className:"text-xs text-muted-foreground","data-testid":`text-source-date-${A}`,children:["Date: ",$.date]}),($.link||$.url)&&e.jsxs("a",{href:$.link||$.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline flex items-center gap-1","data-testid":`link-source-url-${A}`,children:[e.jsx(Tt,{className:"h-3 w-3"}),"View Source"]})]})},A))})]},v)),e.jsx("div",{className:"pt-4 border-t",children:e.jsxs("p",{className:"text-xs text-muted-foreground","data-testid":"text-methodology-note",children:[e.jsx("strong",{children:"Methodology Note:"}),' All insights are AI-generated using real-time market intelligence. Where real data is unavailable, analyses explicitly indicate "Research needed" or "Data unavailable" rather than providing hypothetical estimates.']})})]})]})}
196const Er={jtbd:{name:"Jobs-to-be-Done Discovery",description:"Understand what job customers are hiring your product to do",icon:he,color:"bg-blue-100 text-blue-800",borderColor:"border-blue-200"},assumption_mapping:{name:"Assumption Mapping",description:"Identify and test the riskiest assumptions about your idea",icon:me,color:"bg-orange-100 text-orange-800",borderColor:"border-orange-200"},kano:{name:"Kano Model Analysis",description:"Categorize features to maximize customer satisfaction",icon:ie,color:"bg-purple-100 text-purple-800",borderColor:"border-purple-200"}};function ml({ideaId:s,onGenerateMethod:i,hasJtbd:l=!1,hasAssumptionMapping:a=!1,hasKano:t=!1,isGeneratingJtbd:r=!1,isGeneratingAssumptionMapping:c=!1,isGeneratingKano:n=!1}){const{toast:d}=Ys(),{data:o,isLoading:g}=ee({queryKey:[`/api/idea-prioritization/${s}/research-method-recommendation`],enabled:!!s}),h=o?.data,f=h?.alternativeMethods?(()=>{try{const P=JSON.parse(h.alternativeMethods);return Array.isArray(P)?P:[]}catch{return[]}})():[],b=W({mutationFn:async()=>await Q({url:`/api/idea-prioritization/${s}/research-method-recommendation/generate`,method:"POST",data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${s}/research-method-recommendation`]}),d({title:"Recommendation generated",description:"AI has analyzed your idea and recommended the best research method."})},onError:P=>{d({title:"Generation failed",description:P.message||"Failed to generate recommendation. Please try again.",variant:"destructive"})}});if(g)return e.jsx(m,{"data-testid":"card-method-recommendation-loading",children:e.jsx(x,{className:"flex items-center justify-center py-8",children:e.jsx(ae,{className:"w-6 h-6 animate-spin text-primary","data-testid":"loader-recommendation"})})});if(!h)return e.jsxs(m,{className:"border-2 border-dashed","data-testid":"card-method-recommendation-empty",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-recommendation-empty",children:[e.jsx(he,{className:"w-5 h-5 text-primary","data-testid":"icon-recommendation-empty"}),"Research Method Recommendation"]}),e.jsx(O,{"data-testid":"desc-recommendation-empty",children:"Let AI suggest the best research methodology for validating your idea"})]}),e.jsx(x,{children:e.jsx(R,{onClick:()=>b.mutate(),disabled:b.isPending,className:"w-full","data-testid":"button-generate-recommendation",children:b.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-2 animate-spin","data-testid":"icon-generating"}),"Analyzing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2","data-testid":"icon-generate"}),"Get AI Recommendation"]})})})]});const y=Er[h.recommendedMethod],S=y.icon,N=h.recommendedMethod==="jtbd"&&l||h.recommendedMethod==="assumption_mapping"&&a||h.recommendedMethod==="kano"&&t,w=h.recommendedMethod==="jtbd"&&r||h.recommendedMethod==="assumption_mapping"&&c||h.recommendedMethod==="kano"&&n;return e.jsxs(m,{className:`border-2 ${y.borderColor}`,"data-testid":"card-method-recommendation",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs(p,{className:"flex items-center gap-2 mb-2","data-testid":"title-recommended-method",children:[e.jsx(S,{className:"w-5 h-5","data-testid":"icon-recommended-method"}),"Recommended: ",y.name]}),e.jsx(O,{"data-testid":"desc-recommended-method",children:y.description})]}),e.jsxs(I,{className:y.color,"data-testid":"badge-confidence",children:[h.confidence,"% confident"]})]})}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg","data-testid":"container-reasoning",children:[e.jsx("p",{className:"font-semibold text-sm mb-2","data-testid":"label-reasoning",children:"Why this method?"}),e.jsx("p",{className:"text-sm text-foreground","data-testid":"text-reasoning",children:h.reasoning})]}),!N&&i&&e.jsxs("div",{className:"p-4 bg-gradient-to-r from-primary/10 to-primary/5 border-2 border-primary/20 rounded-lg","data-testid":"container-primary-action",children:[e.jsx("p",{className:"text-sm font-medium mb-3","data-testid":"text-next-step",children:"Next Step: Start with the recommended method"}),e.jsx(R,{onClick:()=>i(h.recommendedMethod),disabled:w,className:"w-full",size:"lg","data-testid":"button-generate-recommended-method",children:w?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-2 animate-spin","data-testid":"icon-generating-method"}),"Generating ",y.name,"..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2","data-testid":"icon-generate-method"}),"Generate ",y.name]})})]}),N&&e.jsxs("div",{className:"p-4 bg-green-50 border-2 border-green-200 rounded-lg","data-testid":"container-method-generated",children:[e.jsxs("div",{className:"flex items-center gap-2 text-green-700",children:[e.jsx(re,{className:"w-5 h-5","data-testid":"icon-method-complete"}),e.jsxs("p",{className:"font-medium","data-testid":"text-method-complete",children:[y.name," analysis complete!"]})]}),e.jsx("p",{className:"text-sm text-green-600 mt-1","data-testid":"text-explore-tabs",children:"Explore the results in the tabs below, or try other research methods."})]}),f.length>0&&e.jsxs("div",{"data-testid":"container-alternatives",children:[e.jsx("p",{className:"font-semibold text-sm mb-3","data-testid":"label-alternatives",children:"Alternative Methods:"}),e.jsx("div",{className:"space-y-2",children:f.map((P,C)=>{const v=Er[P.method];if(!v)return null;const T=v.icon;return e.jsxs("div",{className:"flex items-start gap-3 p-3 border rounded-lg hover:bg-muted/30 transition-colors","data-testid":`alternative-${C}`,children:[e.jsx(T,{className:"w-4 h-4 mt-0.5 text-muted-foreground","data-testid":`icon-alternative-${C}`}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[e.jsx("p",{className:"font-medium text-sm","data-testid":`text-alternative-name-${C}`,children:v.name}),e.jsxs(I,{variant:"outline",className:"text-xs","data-testid":`badge-alternative-score-${C}`,children:[P.score,"%"]})]}),e.jsx("p",{className:"text-xs text-foreground","data-testid":`text-alternative-reason-${C}`,children:P.reason})]})]},C)})})]}),e.jsx("div",{className:"pt-2 border-t",children:e.jsx(R,{variant:"outline",size:"sm",onClick:()=>b.mutate(),disabled:b.isPending,className:"w-full","data-testid":"button-regenerate-recommendation",children:b.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-3 h-3 mr-2 animate-spin","data-testid":"icon-regenerating"}),"Re-analyzing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(re,{className:"w-3 h-3 mr-2","data-testid":"icon-regenerate"}),"Re-generate Recommendation"]})})})]})]})}function xl({analysis:s}){if(!s)return e.jsxs("div",{className:"text-center py-12 text-muted-foreground","data-testid":"jtbd-empty-state",children:[e.jsx(V,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),e.jsx("p",{"data-testid":"text-no-analysis",children:"No Jobs-to-be-
196Done analysis generated yet."})]});const i={low:"bg-blue-100 text-blue-800",medium:"bg-yellow-100 text-yellow-800",high:"bg-orange-100 text-orange-800",critical:"bg-red-100 text-red-800"},l={rarely:"bg-muted/50 text-foreground",occasionally:"bg-blue-100 text-blue-800",often:"bg-orange-100 text-orange-800",always:"bg-red-100 text-red-800"},a=(t,r)=>t-r;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-2 border-primary/20 bg-gradient-to-br from-primary/5 to-transparent","data-testid":"card-job-statement",children:[e.jsx(u,{children:e.jsxs(p,{className:"text-2xl flex items-center gap-2","data-testid":"title-job-statement",children:[e.jsx(V,{className:"w-6 h-6 text-primary"}),"Core Job Statement"]})}),e.jsxs(x,{children:[e.jsx("p",{className:"text-lg font-medium leading-relaxed","data-testid":"text-job-statement",children:s.jobStatement}),e.jsx("div",{className:"mt-4 p-4 bg-white rounded-lg",children:e.jsxs("p",{className:"text-sm text-foreground","data-testid":"text-job-context",children:[e.jsx("strong",{children:"Context:"})," ",s.jobContext]})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs(m,{"data-testid":"card-functional-job",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"text-lg flex items-center gap-2","data-testid":"title-functional-job",children:[e.jsx(st,{className:"w-5 h-5 text-blue-500"}),"Functional Job"]}),e.jsx(O,{"data-testid":"desc-functional-job",children:"Practical task to accomplish"})]}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-functional-job",children:s.functionalJob})})]}),e.jsxs(m,{"data-testid":"card-emotional-job",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"text-lg flex items-center gap-2","data-testid":"title-emotional-job",children:[e.jsx(_e,{className:"w-5 h-5 text-pink-500"}),"Emotional Job"]}),e.jsx(O,{"data-testid":"desc-emotional-job",children:"Desired feeling"})]}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-emotional-job",children:s.emotionalJob})})]}),e.jsxs(m,{"data-testid":"card-social-job",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"text-lg flex items-center gap-2","data-testid":"title-social-job",children:[e.jsx(ne,{className:"w-5 h-5 text-purple-500"}),"Social Job"]}),e.jsx(O,{"data-testid":"desc-social-job",children:"How users want to be perceived"})]}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-social-job",children:s.socialJob})})]})]}),e.jsxs(m,{"data-testid":"card-desired-outcomes",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-desired-outcomes",children:[e.jsx(se,{className:"w-5 h-5 text-green-500"}),"Desired Outcomes"]}),e.jsx(O,{"data-testid":"desc-desired-outcomes",children:"Ordered by opportunity score (importance minus current satisfaction)"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-4",children:s.desiredOutcomes.sort((t,r)=>a(r.importance,r.satisfaction)-a(t.importance,t.satisfaction)).map((t,r)=>{const c=a(t.importance,t.satisfaction);return e.jsxs("div",{className:"p-4 border rounded-lg space-y-2","data-testid":`outcome-${r}`,children:[e.jsx("p",{className:"font-medium","data-testid":`text-outcome-${r}`,children:t.outcome}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 text-sm",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:"text-foreground",children:"Importance"}),e.jsxs("span",{className:"font-semibold",children:[t.importance,"/10"]})]}),e.jsx(de,{value:t.importance*10,className:"h-2","data-testid":`progress-importance-${r}`})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:"text-foreground",children:"Satisfaction"}),e.jsxs("span",{className:"font-semibold",children:[t.satisfaction,"/10"]})]}),e.jsx(de,{value:t.satisfaction*10,className:"h-2","data-testid":`progress-satisfaction-${r}`})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:"text-foreground",children:"Opportunity"}),e.jsxs(I,{variant:c>=5?"destructive":c>=3?"default":"secondary","data-testid":`badge-opportunity-${r}`,children:[c>0?"+":"",c]})]}),e.jsx(de,{value:Math.abs(c)*10,className:`h-2 ${c>=5?"bg-red-200":c>=3?"bg-yellow-200":"bg-green-200"}`,"data-testid":`progress-opportunity-${r}`})]})]})]},r)})})})]}),e.jsxs(m,{"data-testid":"card-struggles",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-struggles",children:[e.jsx(X,{className:"w-5 h-5 text-orange-500"}
196),"Struggle Moments"]}),e.jsx(O,{"data-testid":"desc-struggles",children:"Pain points and friction in current solutions"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.struggles.map((t,r)=>e.jsxs("div",{className:"p-4 border rounded-lg","data-testid":`struggle-${r}`,children:[e.jsx("p",{className:"mb-2","data-testid":`text-struggle-${r}`,children:t.moment}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(I,{className:i[t.intensity],"data-testid":`badge-intensity-${r}`,children:[t.intensity," intensity"]}),e.jsx(I,{className:l[t.frequency],"data-testid":`badge-frequency-${r}`,children:t.frequency})]})]},r))})})]}),e.jsxs(m,{"data-testid":"card-switching-triggers",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-switching-triggers",children:[e.jsx(xe,{className:"w-5 h-5 text-yellow-500"}),"Switching Triggers"]}),e.jsx(O,{"data-testid":"desc-switching-triggers",children:"What causes users to switch solutions"})]}),e.jsx(x,{children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold mb-2 text-red-600 flex items-center gap-2","data-testid":"heading-push-factors",children:[e.jsx(Ja,{className:"w-4 h-4"}),"Push Factors (Problems with current)"]}),e.jsx("div",{className:"space-y-2",children:s.switchingTriggers.filter(t=>t.type==="push").map((t,r)=>e.jsx("div",{className:"p-3 bg-red-50 rounded border border-red-200","data-testid":`trigger-push-${r}`,children:e.jsx("p",{className:"text-sm","data-testid":`text-trigger-push-${r}`,children:t.trigger})},r))})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold mb-2 text-green-600 flex items-center gap-2","data-testid":"heading-pull-factors",children:[e.jsx(Ja,{className:"w-4 h-4"}),"Pull Factors (Attraction to new)"]}),e.jsx("div",{className:"space-y-2",children:s.switchingTriggers.filter(t=>t.type==="pull").map((t,r)=>e.jsx("div",{className:"p-3 bg-green-50 rounded border border-green-200","data-testid":`trigger-pull-${r}`,children:e.jsx("p",{className:"text-sm","data-testid":`text-trigger-pull-${r}`,children:t.trigger})},r))})]})]})})]}),e.jsxs(m,{"data-testid":"card-current-alternatives",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-current-alternatives",children:[e.jsx(st,{className:"w-5 h-5 text-blue-500"}),"Current Alternatives"]}),e.jsx(O,{"data-testid":"desc-current-alternatives",children:"What users are using today"})]}),e.jsx(x,{children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:s.currentAlternatives.map((t,r)=>e.jsxs("div",{className:"p-4 border rounded-lg space-y-3","data-testid":`alternative-${r}`,children:[e.jsx("h4",{className:"font-semibold text-lg","data-testid":`text-alternative-name-${r}`,children:t.solution}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-green-600 mb-1","data-testid":`heading-pros-${r}`,children:"✓ What works:"}),e.jsx("ul",{className:"text-sm space-y-1 ml-4",children:t.pros.map((c,n)=>e.jsx("li",{className:"list-disc","data-testid":`pro-${r}-${n}`,children:e.jsx("span",{"data-testid":`text-pro-${r}-${n}`,children:c})},n))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-600 mb-1","data-testid":`heading-cons-${r}`,children:"✗ Pain points:"}),e.jsx("ul",{className:"text-sm space-y-1 ml-4",children:t.cons.map((c,n)=>e.jsx("li",{className:"list-disc","data-testid":`con-${r}-${n}`,children:e.jsx("span",{"data-testid":`text-con-${r}-${n}`,children:c})},n))})]})]},r))})})]})]})}function hl({mapping:s}){if(!s)return e.jsxs("div",{className:"text-center py-12 text-muted-foreground","data-testid":"assumption-mapping-empty-state",children:[e.jsx(X,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),e.jsx("p",{"data-testid":"text-no-mapping",children:"No Assumption Mapping generated yet."})]});const i={low:"bg-green-100 text-green-800 border-green-300",medium:"bg-yellow-100 text-yellow-800 border-yellow-300",high:"bg-orange-100 text-orange-800 border-orange-300",critical:"bg-red-100 text-red-800 border-red-300"},l={desirability:{icon:_e,color:"text-pink-500",label:"Desirability",description:"Do customers want this?"},feasibility:{icon:Qs,color:"text-blue-500",label:"Feasibility",description:"Can we build this?"},viability:{icon:le,color:"text-green-500",label:"Viability",description:"Will this be profitable?"}},a=(t,r,c)=>e.jsxs("div",{className:`p-4 border-2 rounded-lg ${i[t.risk]}`,"data-testid":c,children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[e.jsx("p",{className:"font-medium flex-1","data-testid":`${c}-text`,children:t.assumption}),e.jsx(I,{className:i[t.risk],"data-testid":`${c}-risk-badge`,children:t.risk})]}),e.jsxs("div",{className:"space-y-2 text-sm mt-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground","data-testid":`${c}-evidence-label`,children:"Evidence:"}),e.jsx("p",{className:"text-foreground","data-testid":`${c}-evidence`,children:t.evidence})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground","data-testid":`${c}-testing-label`,children:"Testing Method:"}),e.jsx("p",{className:"text-foreground","data-testid":`${c}-testing`,children:t.testingMethod})]})]})]},r);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:`border-2 ${i[s.overallRiskLevel]}`,"data-testid":"card-risk-score",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(p,{className:"text-2xl flex items-center gap-2","data-testid":"title-risk-assessment",children:[e.jsx(X,{className:"w-6 h-6"}),"Overall Risk Assessment"]}),e.jsx(I,{className:`${i[s.overallRiskLevel]} text-lg px-4 py-2`,"data-testid":"badge-overall-risk",children:s.overallRiskLevel.toUpperCase()})]})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"font-semibold",children:"Risk Score"}),e.jsxs("span",{className:"font-bold text-lg",children:[s.riskScore,"/100"]})]}),e.jsx(de,{value:s.riskScore,className:"h-3","data-testid":"progress-risk-score"}),e.jsxs("p",{className:"text-sm text-foreground mt-2","data-testid":"text-risk-guidance",children:[s.riskScore>=71&&"Critical risk level - validate key assumptions before investing heavily",s.riskScore>=41&&s.riskScore<71&&"High risk - prioritize testing assumptions early",s.riskScore>=21&&s.riskScore<41&&"Medium risk - some validation needed",s.riskScore<21&&"Low risk - assumptions are relatively validated"]})]})})]}),e.jsxs(m,{className:"border-2 border-red-200","data-testid":"card-highest-risks",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2 text-red-600","data-testid":"title-highest-risks",children:[e.jsx(V,{className:"w-5 h-5"}),"Highest Risk Assumptions (Test These First)"]}),e.jsx(O,{"data-testid":"desc-highest-risks",children:"Top assumptions that could invali
196date your idea if wrong"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.highestRiskAssumptions.sort((t,r)=>r.priority-t.priority).map((t,r)=>{const n=l[t.category].icon;return e.jsx("div",{className:"p-4 border-2 border-red-300 rounded-lg bg-red-50","data-testid":`high-risk-${r}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-1",children:e.jsxs(I,{variant:"destructive",className:"font-bold","data-testid":`high-risk-${r}-priority-badge`,children:["#",t.priority]})}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(n,{className:`w-5 h-5 ${l[t.category].color} flex-shrink-0 mt-0.5`}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-semibold text-sm text-foreground mb-1","data-testid":`high-risk-${r}-category`,children:l[t.category].label}),e.jsx("p",{className:"font-medium","data-testid":`high-risk-${r}-text`,children:t.assumption})]}),e.jsx(I,{className:i[t.risk],"data-testid":`high-risk-${r}-risk-badge`,children:t.risk})]}),e.jsxs("div",{className:"text-sm space-y-1",children:[e.jsxs("p",{"data-testid":`high-risk-${r}-evidence`,children:[e.jsx("strong",{children:"Evidence:"})," ",t.evidence]}),e.jsxs("p",{"data-testid":`high-risk-${r}-testing`,children:[e.jsx("strong",{children:"Test:"})," ",t.testingMethod]})]})]})]})},r)})})})]}),e.jsxs(m,{"data-testid":"card-testing-priority",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-testing-priority",children:[e.jsx(xe,{className:"w-5 h-5 text-yellow-500"}),"Testing Priority Roadmap"]}),e.jsx(O,{"data-testid":"desc-testing-priority",children:"Quick tests to run now vs. rigorous validation later"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-4",children:s.testingPriority.sort((t,r)=>r.priority-t.priority).map((t,r)=>e.jsxs("div",{className:"border rounded-lg overflow-hidden","data-testid":`test-priority-${r}`,children:[e.jsxs("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(I,{variant:"outline",className:"font-bold","data-testid":`test-priority-${r}-badge`,children:["Priority ",t.priority]}),e.jsx("span",{className:"font-medium","data-testid":`test-priority-${r}-assumption`,children:t.assumption})]}),e.jsx(I,{variant:"secondary","data-testid":`test-priority-${r}-category`,children:t.category})]}),e.jsxs("div",{className:"p-3 grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[e.jsx(xe,{className:"w-4 h-4"}),e.jsx("span",{className:"font-semibold text-sm","data-testid":`test-priority-${r}-quick-label`,children:"Quick Test (Days)"})]}),e.jsx("p",{className:"text-sm text-foreground","data-testid":`test-priority-${r}-quick`,children:t.quickTest})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-blue-600",children:[e.jsx(Te,{className:"w-4 h-4"}),e.jsx("span",{className:"font-semibold text-sm","data-testid":`test-priority-${r}-rigorous-label`,children:"Rigorous Test (Weeks)"})]}),e.jsx("p",{className:"text-sm text-foreground","data-testid":`test-priority-${r}-rigorous`,children:t.rigorousTest})]})]})]},r))})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs(m,{"data-testid":"card-desirability-assumptions",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-desirability",children:[e.jsx(_e,{className:"w-5 h-5 text-pink-500"}),"Desirability"]}),e.jsx(O,{"data-testid":"desc-desirability",children:"Will customers want this?"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.desirabilityAssumptions.map((t,r)=>a(t,r,`assumption-desirability-${r}`))})})]}),e.jsxs(m,{"data-testid":"card-feasibility-assumptions",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-feasibility",children:[e.jsx(Qs,{className:"w-5 h-5 text-blue-500"}),"Feasibility"]}),e.jsx(O,{"data-testid":"desc-feasibility",children:"Can we build this?"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.feasibilityAssumptions.map((t,r)=>a(t,r,`assumption-feasibility-${r}`))})})]}),e.jsxs(m,{"data-testid":"card-viability-assumptions",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-viability",children:[e.jsx(le,{className:"w-5 h-5 text-green-500"}),"Viability"]}),e.jsx(O,{"data-testid":"desc-viability",children:"Will this be profitable?"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.viabilityAssumptions.map((t,r)=>a(t,r,`assumption-viability-${r}`))})})]})]})]})}function ul({analysis:s}){if(!s)return e.jsxs("div",{className:"text-center py-12 text-muted-foreground","data-testid":"kano-model-empty-state",children:[e.jsx(Wa,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),e.jsx("p",{"data-testid":"text-no-analysis",children:"No Kano Model analysis generated yet."})]});const i={high:"bg-green-100 text-green-800",medium:"bg-yellow-100 text-yellow-800",low:"bg-muted/50 text-foreground"},l={MVP:"bg-red-100 text-red-800",V1:"bg-blue-100 text-blue-800",V2:"bg-purple-100 text-purple-800",Future:"bg-muted/50 text-foreground"},a=(t,r,c,n,d)=>e.jsxs("div",{className:"p-3 border rounded-lg hover:bg-muted/50 transition-colors","data-testid":c,children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[e.jsx("p",{className:"font-medium flex-1","data-testid":`${c}-text`,children:t.feature}),n&&d&&e.jsx("span",{"data-testid":d,children:n}),n&&!d&&n]}),e.jsx("p",{className:"text-sm text-foreground","data-testid":`${c}-reasoning`,children:t.reasoning})]},r);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-2 border-primary/20 bg-gradient-to-br from-primary/5 to-transparent","data-testid":"card-mvp-features",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"text-2xl flex items-center gap-2","data-testid":"title-mvp-features",children:[e.jsx(at,{className:"w-6 h-6 text-primary"}),"MVP Feature Set"]}),e.jsx(O,{"data-testid":"desc-mvp-features",children:"Core features to launch with"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-2",children:s.mvpFeatureSet.map((t,r)=>e.jsxs("div",{className:"flex items-start gap-2","data-testid":`mvp-feature-${r}`,children:[e.jsx(re,{className:"w-5 h-5 text-green-500 flex-shrink-0 mt-0.5"}),e.jsx("p",{"data-testid":`text-mvp-feature-${r}`,children:t})]},r))})})]}),e.jsxs(m,{className:"border-2 border-purple-200","data-testid":"card-differentiation",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2 text-purple-600","data-testid":"title-differentiation",children:[e.jsx(ie,{className:"w-5 h-5"}),"Differentiation Opportunities"]}),e.jsx(O,{"data-testid":"desc-differentiation",children:"How to stand out from competitors"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-2",children:s.differentiationOpportunities.map((t,r)=>e.jsxs("div",{className:"flex items-start gap-2 p-3 bg-purple-50 rounded-lg","data-testid":`differentiation-${r}`,children:[e.jsx(V,{className:"w-5 h-5 text-purple-500 flex-shrink-0 mt-0.5"}),e.jsx("p",{"data-testid":`text-differentiation-${r}`,children:t})]},r))})})]}),e.jsxs(m,{"data-testid":"card-priority-recommendations",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-development-roadmap",children:[e.jsx(Wa,{className:"w-5 h-5 text-blue-500"}),"Development Roadmap"]}),e.jsx(O,{"data-testid":"desc-development-roadmap",children:"Phased feature rollout strategy"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-4",children:s.priorityRecommendations.map((t,r)=>e.jsxs("div",{className:"border-2 rounded-lg overflow-hidden","data-testid":`phase-${t.phase}`,children:[e.jsxs("div",{className:"bg-muted/50 p-3 flex items-center gap-2",children:[e.jsx(I,{className:l[t.phase],"data-testid":`phase-${t.phase}-badge`,children:t.phase}),e.jsx("span",{className:"font-medium","data-testid":`phase-${t.phase}-rationale`,children:t.rationale})]}),e.jsx("div",{className:"p-3",children:e.jsx("ul",{className:"space-y-1",children:t.features.map((c,n)=>e.jsxs("li",{className:"flex items-start gap-2","data-testid":`phase-${t.phase}-feature-${n}`,children:[e.jsx(re,{className:"w-4 h-4 text-primary flex-shrink-0 mt-0.5"}),e.jsx("span",{className:"text-sm","data-testid":`text-phase-${t.phase}-feature-${n}`,children:c})]},n))})})]},r))})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(m,{className:"border-2 border-red-200","data-testid":"card-basic-features",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2 text-red-600","data-testid":"title-basic-features",children:[e.jsx(re,{className:"w-5 h-5"}),"Basic Features (Must-Haves)"]}),e.jsx(O,{"data-testid":"desc-basic-features",children:"Expected by users - absence causes dissatisfaction"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.basicFeatures.map((t,r)=>a(t,r,`basic-feature-${r}`,e.jsx(I,{className:"bg-red-100 text-red-800",children:"REQUIRED"}),`basic-feature-${r}-badge`))})})]}),e.jsxs(m,{className:"border-2 border-blue-200","data-testid":"card-performance-features",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2 text-blue-600","data-testid":"title-performance-features",children:[e.jsx(se,{className:"w-5 h-5"}),"Performance Features (More is Better)"]}),e.jsx(O,{"data-testid":"desc-performance-features",children:"Satisfaction increases with quality"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.performanceFeatures.map((t,r)=>a(t,r,`performance-feature-${r}`,e.jsxs(I,{className:i[t.impact],children:[t.impact," impact"]}),`performance-feature-${r}-badge`))})})]}),e.jsxs(m,{className:"border-2 border-purple-200","data-testid":"card-delighter-features",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2 text-purple-600","data-testid":"title-delighter-features",children:[e.jsx(ie,{className:"w-5 h-5"}),"Delighter Features (Unexpected Wow)"]}),e.jsx(O,{"data-testid":"desc-delighter-features",children:"Create excitement when present"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.delighterFeatures.map((t,r)=>a(t,r,`delighter-feature-${r}`,e.jsxs(I,{className:i[t.uniqueness],children:[t.uniqueness," uniqueness"]}),`delighter-feature-${r}-badge`))})})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-2 border-border","data-testid":"card-indifferent-features",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2 text-foreground","data-testid":"title-indifferent-features",children:[e.jsx(Bi,{className:"w-5 h-5"}),"Indifferent Features"]}),e.jsx(O,{"data-testid":"desc-indifferent-features",children:"Users don't care either way"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.indifferentFeatures.length>0?s.indifferentFeatures.map((t,r)=>a(t,r,`indifferent-feature-${r}`)):e.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"text-no-indifferent",children:"No indifferent features identified"})})})]}),s.reverseFeatures.length>0&&e.jsxs(m,{className:"border-2 border-orange-200","data-testid":"card-reverse-features",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2 text-orange-600","data-testid":"title-reverse-features",children:[e.jsx(rt,{className:"w-5 h-5"}),"Reverse Features (Don't Build)"]}),e.jsx(O,{"data-testid":"desc-reverse-features",children:"Decrease satisfaction when present"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.reverseFeatures.map((t,r)=>a(t,r,`reverse-feature-${r}`,e.jsx(I,{className:"bg-orange-100 text-orange-800",children:"AVOID"}),`reverse-feature-${r}-badge`))})})]})]})]})]})}function pl(s){return typeof s=="string"?s:typeof s=="object"&&s!==null?s.painPoint||s.improvement||s.moment||s.opportunity||s.title||s.description||s.text||JSON.stringify(s):String(s)}function Ge(s){return Array.isArray(s)?s.map(pl):[]}function gl({map:s}){if(!s)return e.jsxs("div",{className:"text-center py-12 text-muted-foreground","data-testid":"customer-journey-empty-state",children:[e.jsx(Ya,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),e.jsx("p",{"data-testid":"text-no-map",children:"No customer journey map generated yet."})]});const i=s.overallSatisfaction??0,l=o=>{const g=o>10?o/10:o;return g>=8?"text-green-600":g>=6?"text-yellow-600":"text-red-600"},a=i>10?`${i}/100`:`${i}/10`,t=Ge(s.emotionalHighPoints),r=Ge(s.emotionalLowPoints),c=Ge(s.criticalPainPoints),n=Ge(s.quickWins),d=Array.isArray(s.stages)?s.stages:[];return e.jsxs("div",{className:"space-y-6",children:[e.jsx(m,{className:"border-2 border-primary/20 bg-gradient-to-br from-primary/5 to-transparent","data-testid":"card-overview",children:e.jsxs(u,{children:[e.jsxs(p,{className:"text-2xl flex items-center gap-2","data-testid":"title-overview",children:[e.jsx(Ya,{className:"w-6 h-6 text-primary"}),"Customer Journey Map",s.personaName?`: ${s.personaName}`:""]}),e.jsxs(O,{"data-testid":"desc-overview",children:["Overall Satisfaction Score: ",e.jsx("span",{className:`font-bold text-lg ${l(i)}`,children:a})]})]})}),(t.length>0||r.length>0)&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.length>0&&e.jsxs(m,{"data-testid":"card-emotional-highs",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-emotional-highs",children:[e.jsx(nt,{className:"w-5 h-5 text-green-500"}),"Emotional High Points"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:t.map((o,g)=>e.jsxs("li",{className:"flex items-start gap-2","data-testid":`emotional-high-${g}`,children:[e.jsx(_e,{className:"w-4 h-4 text-green-500 mt-1 flex-shrink-0"}),e.jsx("span",{className:"text-sm",children:o})]},g))})})]}),r.length>0&&e.jsxs(m,{"data-testid":"card-emotional-lows",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-emotional-lows",children:[e.jsx(Lr,{className:"w-5 h-5 text-red-500"}),"Emotional Low Points"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:r.map((o,g)=>e.jsxs("li",{className:"flex items-start gap-2","data-testid":`emotional-low-${g}`,children:[e.jsx(me,{className:"w-4 h-4 text-red-500 mt-1 flex-shrink-0"}),e.jsx("span",{className:"text-sm",children:o})]},g))})})]})]}),(c.length>0||n.length>0)&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.length>0&&e.jsxs(m,{"data-testid":"card-critical-pain-points",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-critical-pain-points",children:[e.jsx(me,{className:"w-5 h-5 text-orange-500"}),"Critical Pain Points"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:c.map((o,g)=>e.jsx("li",{className:"p-2 bg-orange-50 rounded border-l-4 border-orange-500 text-sm","data-testid":`pain-point-${g}`,children:o},g))})})]}),n.length>0&&e.jsxs(m,{"data-testid":"card-quick-wins",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-quick-wins",children:[e.jsx(xe,{className:"w-5 h-5 text-yellow-500"}),"Quick Wins"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:n.map((o,g)=>e.jsx("li",{className:"p-2 bg-yellow-50 rounded border-l-4 border-yellow-500 text-sm","data-testid":`quick-win-${g}`,children:o},g))})})]})]}),d.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"text-xl font-semibold flex items-center gap-2",children:[e.jsx(se,{className:"w-5 h-5 text-primary"}),"Journey Stages"]}),d.map((o,g)=>{const h=o.stage||o.name||`Stage ${g+1}`,f=Ge(o.actions),b=Ge(o.thoughts),y=Ge(o.emotions),S=Ge(o.touchpoints),N=Ge(o.painPoints),w=Ge(o.opportunities);return e.jsxs(m,{"data-testid":`stage-${g}`,children:[e.jsx(u,{children:e.jsxs(p,{className:"text-lg","data-testid":`stage-title-${g}`,children:[g+1,". ",h]})}),e.jsxs(x,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(f.length>0||S.length>0)&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold
196 mb-2 text-sm text-blue-600",children:f.length>0?"Actions":"Touchpoints"}),e.jsx("ul",{className:"space-y-1",children:(f.length>0?f:S).map((P,C)=>e.jsxs("li",{className:"text-sm","data-testid":`stage-${g}-action-${C}`,children:["• ",P]},C))})]}),b.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm text-purple-600",children:"Thoughts"}),e.jsx("ul",{className:"space-y-1",children:b.map((P,C)=>e.jsxs("li",{className:"text-sm italic","data-testid":`stage-${g}-thought-${C}`,children:['"',P,'"']},C))})]}),y.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm text-pink-600",children:"Emotions"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:y.map((P,C)=>e.jsx(I,{variant:"outline",className:"text-xs","data-testid":`stage-${g}-emotion-${C}`,children:P},C))})]})]}),(S.length>0&&f.length>0||N.length>0||w.length>0)&&e.jsxs("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-3 gap-4",children:[S.length>0&&f.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm text-green-600",children:"Touchpoints"}),e.jsx("ul",{className:"space-y-1",children:S.map((P,C)=>e.jsxs("li",{className:"text-sm","data-testid":`stage-${g}-touchpoint-${C}`,children:["• ",P]},C))})]}),N.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm text-red-600",children:"Pain Points"}),e.jsx("ul",{className:"space-y-1",children:N.map((P,C)=>e.jsxs("li",{className:"text-sm","data-testid":`stage-${g}-pain-${C}`,children:["• ",P]},C))})]}),w.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2 text-sm text-yellow-600",children:"Opportunities"}),e.jsx("ul",{className:"space-y-1",children:w.map((P,C)=>e.jsxs("li",{className:"text-sm flex items-start gap-1","data-testid":`stage-${g}-opportunity-${C}`,children:[e.jsx(he,{className:"w-3 h-3 mt-1 flex-shrink-0"}),P]},C))})]})]})]})]},g)})]})]})}function jl(s){return typeof s=="string"?s:typeof s=="object"&&s!==null?s.thought&&s.feeling?`${s.thought} — ${s.feeling}`:s.source&&s.message?`${s.source}: ${s.message}`:s.context&&s.observation?`${s.context}: ${s.observation}`:s.saying&&s.doing?`Says: "${s.saying}" — Does: ${s.doing}`:s.pain?typeof s.severity=="string"?`${s.pain} (${s.severity})`:s.pain:s.gain?typeof s.importance=="string"?`${s.gain} (${s.importance})`:s.gain:s.title||s.description||s.text||s.name||JSON.stringify(s):String(s)}function ns(s){return Array.isArray(s)?s.map(jl):[]}function fl({map:s}){if(!s)return e.jsxs("div",{className:"text-center py-12 text-muted-foreground","data-testid":"empathy-map-empty-state",children:[e.jsx($t,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),e.jsx("p",{"data-testid":"text-no-map",children:"No empathy map generated yet."})]});const i=ns(s.thinkAndFeel),l=ns(s.hear),a=ns(s.see),t=ns(s.sayAndDo),r=ns(s.pains),c=ns(s.gains),n=ns(s.keyInsights),d=ns(s.opportunityAreas);return e.jsxs("div",{className:"space-y-6",children:[e.jsx(m,{className:"border-2 border-primary/20 bg-gradient-to-br from-primary/5 to-transparent","data-testid":"card-overview",children:e.jsxs(u,{children:[e.jsxs(p,{className:"text-2xl flex items-center gap-2","data-testid":"title-overview",children:[e.jsx($t,{className:"w-6 h-6 text-primary"}),"Empathy Map",s.personaName?`: ${s.personaName}`:""]}),s.scenario&&e.jsxs(O,{"data-testid":"desc-scenario",children:[e.jsx("strong",{children:"Scenario:"})," ",s.scenario]})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.length>0&&e.jsxs(m,{"data-testid":"card-think-feel",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-think-feel",children:[e.jsx(Aa,{className:"w-5 h-5 text-purple-500"}),"Think & Feel"]}),e.jsx(O,{"data-testid":"desc-think-feel",children:"Internal thoughts and emotions"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:i.map((o,g)=>e.jsx("li",{className:"p-3 bg-purple-50 rounded border-l-4 border-purple-500 text-sm","data-testid":`think-feel-${g}`,children:o},g))})})]}),l.length>0&&e.jsxs(m,{"data-testid":"card-hear",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-hear",children:[e.jsx(qi,{className:"w-5 h-5 text-blue-500"}),"Hear"]}),e.jsx(O,{"data-testid":"desc-hear",children:"What others say and influence"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:l.map((o,g)=>e.jsx("li",{className:"p-3 bg-blue-50 rounded border-l-4 border-blue-500 text-sm","data-testid":`hear-${g}`,children:o},g))})})]}),a.length>0&&e.jsxs(m,{"data-testid":"card-see",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-see",children:[e.jsx(Li,{className:"w-5 h-5 text-green-500"}
196),"See"]}),e.jsx(O,{"data-testid":"desc-see",children:"Environment and surroundings"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:a.map((o,g)=>e.jsx("li",{className:"p-3 bg-green-50 rounded border-l-4 border-green-500 text-sm","data-testid":`see-${g}`,children:o},g))})})]}),t.length>0&&e.jsxs(m,{"data-testid":"card-say-do",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-say-do",children:[e.jsx(Js,{className:"w-5 h-5 text-orange-500"}),"Say & Do"]}),e.jsx(O,{"data-testid":"desc-say-do",children:"Observable actions and words"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:t.map((o,g)=>e.jsx("li",{className:"p-3 bg-orange-50 rounded border-l-4 border-orange-500 text-sm","data-testid":`say-do-${g}`,children:o},g))})})]})]}),(r.length>0||c.length>0)&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.length>0&&e.jsxs(m,{"data-testid":"card-pains",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-pains",children:[e.jsx(Oi,{className:"w-5 h-5 text-red-500"}),"Pains"]}),e.jsx(O,{"data-testid":"desc-pains",children:"Frustrations and obstacles"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:r.map((o,g)=>e.jsxs("li",{className:"flex items-start gap-2","data-testid":`pain-${g}`,children:[e.jsx("span",{className:"text-red-500 font-bold",children:"•"}),e.jsx("span",{className:"text-sm",children:o})]},g))})})]}),c.length>0&&e.jsxs(m,{"data-testid":"card-gains",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-gains",children:[e.jsx(Or,{className:"w-5 h-5 text-green-500"}),"Gains"]}),e.jsx(O,{"data-testid":"desc-gains",children:"Aspirations and desires"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:c.map((o,g)=>e.jsxs("li",{className:"flex items-start gap-2","data-testid":`gain-${g}`,children:[e.jsx("span",{className:"text-green-500 font-bold",children:"•"}),e.jsx("span",{className:"text-sm",children:o})]},g))})})]})]}),(n.length>0||d.length>0)&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.length>0&&e.jsxs(m,{"data-testid":"card-key-insights",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-key-insights",children:[e.jsx(he,{className:"w-5 h-5 text-yellow-500"}),"Key Insights"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:n.map((o,g)=>e.jsx("li",{className:"p-3 bg-yellow-50 rounded text-sm","data-testid":`insight-${g}`,children:o},g))})})]}),d.length>0&&e.jsxs(m,{"data-testid":"card-opportunities",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-opportunities",children:[e.jsx(V,{className:"w-5 h-5 text-primary"}),"Opportunity Areas"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:d.map((o,g)=>e.jsx("li",{className:"p-3 bg-primary/10 rounded text-sm","data-testid":`opportunity-${g}`,children:o},g))})})]})]})]})}function bl({analysis:s}){if(!s)return e.jsxs("div",{className:"text-center py-12 text-muted-foreground","data-testid":"five-whys-empty-state",children:[e.jsx(me,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),e.jsx("p",{"data-testid":"text-no-analysis",children:"No 5 Whys analysis generated yet."})]});const i=[{label:"Why 1",value:s.why1},{label:"Why 2",value:s.why2},{label:"Why 3",value:s.why3},{label:"Why 4",value:s.why4},{label:"Why 5",value:s.why5}],l={people:"bg-blue-100 text-blue-800",process:"bg-purple-100 text-purple-800",technology:"bg-green-100 text-green-800",environment:"bg-orange-100 text-orange-800",other:"bg-muted/50 text-foreground"},a={low:"bg-green-100 text-green-800",medium:"bg-yellow-100 text-yellow-800",high:"bg-red-100 text-red-800"},t={low:"bg-muted/50 text-foreground",medium:"bg-blue-100 text-blue-800",high:"bg-purple-100 text-purple-800"};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-2 border-red-200 bg-gradient-to-br from-red-50 to-transparent","data-testid":"card-problem",children:[e.jsx(u,{children:e.jsxs(p,{className:"text-2xl flex items-center gap-2","data-testid":"title-problem",children:[e.jsx(me,{className:"w-6 h-6 text-red-500"}),"Problem Statement"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-lg font-medium","data-testid":"text-problem-statement",children:s.problemStatement})})]}),e.jsxs(m,{"data-testid":"card-whys",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-whys",children:[e.jsx(Gi,{className:"w-5 h-5 text-primary"}),"The 5 Whys Analysis"]}),e.jsx(O,{"data-testid":"desc-whys",children:"Drilling down to the root cause"})]}),e.jsx(x,{className:"pt-6",children:e.jsx("div",{className:"space-y-4",children:i.map((r,c)=>e.jsxs("div",{className:"flex gap-3 items-start","data-testid":`why-${c+1}`,children:[e.jsxs("div",{className:"relative flex flex-col items-center pt-4",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary text-white flex items-center justify-center text-sm font-bold flex-shrink-0",children:c+1}),c<i.length-1&&e.jsx("div",{className:"w-0.5 flex-1 bg-primary/30 mt-1 min-h-[16px]"})]}),e.jsxs("div",{className:"flex-1 p-4 bg-muted/50 rounded-lg",children:[e.jsx("p",{className:"font-semibold text-sm text-foreground mb-1",children:r.label}),e.jsx("p",{className:"text-sm","data-testid":`text-why-${c+1}`,children:r.value})]})]},c))})})]}),e.jsxs(m,{className:"border-2 border-orange-200","data-testid":"card-root-cause",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-root-cause",children:[e.jsx(V,{className:"w-5 h-5 text-orange-500"}),"Root Cause"]})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-lg font-medium","data-testid":"text-root-cause",children:s.rootCause}),e.jsx("div",{children:e.jsxs(I,{className:l[s.rootCauseCategory.toLowerCase()]||l.other,"data-testid":"badge-category",children:["Category: ",s.rootCauseCategory]})})]})})]}),e.jsxs(m,{"data-testid":"card-solutions",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-solutions",children:[e.jsx(xe,{className:"w-5 h-5 text-yellow-500"}),"Proposed Solutions"]})}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:s.proposedSolutions.map((r,c)=>e.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg space-y-2","data-testid":`solution-${c}`,children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ds,{className:"w-5 h-5 text-green-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm flex-1",children:r.solution})]}),e.jsxs("div",{className:"flex gap-2 ml-7",children:[e.jsxs(I,{className:a[r.effort],"data-testid":`solution-${c}-effort`,children:["Effort: ",r.effort]}),e.jsxs(I,{className:t[r.impact],"data-testid":`solution-${c}-impact`,children:["Impact: ",r.impact]})]})]},c))})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(m,{"data-testid":"card-recommended-action",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-recommended-action",children:[e.jsx(V,{className:"w-5 h-5 text-primary"}),"Recommended Action"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-recommended-action",children:s.recommendedAction})})]}),e.jsxs(m,{"data-testid":"card-verification",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-verification",children:[e.jsx(ds,{className:"w-5 h-5 text-green-500"}),"Verification Method"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-verification",children:s.verificationMethod})})]})]}),e.jsxs(m,{"data-testid":"card-success-metrics",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-success-metrics",children:[e.jsx(se,{className:"w-5 h-5 text-green-500"}
196),"Success Metrics"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:s.successMetrics.map((r,c)=>e.jsx("li",{className:"p-3 bg-green-50 rounded border-l-4 border-green-500 text-sm","data-testid":`metric-${c}`,children:r},c))})})]})]})}function Nl(s){if(typeof s=="string")return s;if(typeof s=="object"&&s!==null){if(s.alternative){const i=Array.isArray(s.limitations)?s.limitations.join(", "):"";return i?`${s.alternative} (${i})`:s.alternative}if(s.experiment){const i=[s.experiment];return s.hypothesis&&i.push(`Hypothesis: ${s.hypothesis}`),s.successCriteria&&i.push(`Success: ${s.successCriteria}`),i.join(" — ")}return s.title||s.description||s.text||s.name||JSON.stringify(s)}return String(s)}function Rr(s){return Array.isArray(s)?s.map(Nl):[]}function ja(s){if(typeof s=="number")return s;const i=String(s).toLowerCase();return i==="critical"?9:i==="major"||i==="high"?7:i==="moderate"||i==="medium"?5:i==="minor"||i==="low"?3:5}function vl({fit:s}){if(!s)return e.jsxs("div",{className:"text-center py-12 text-muted-foreground","data-testid":"problem-solution-fit-empty-state",children:[e.jsx(V,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),e.jsx("p",{"data-testid":"text-no-fit",children:"No problem-solution fit analysis generated yet."})]});const i=h=>h>=8?"bg-red-500":h>=6?"bg-orange-500":h>=4?"bg-yellow-500":"bg-blue-500",l=s.problemSolutionFitScore??s.overallFitScore??0,a=h=>{const f=h>10?60:6,b=h>10?80:8;return h>=b?"text-green-600":h>=f?"text-yellow-600":"text-red-600"},t=l>10?`${l}/100`:`${l}/10`,r={extreme:"bg-red-100 text-red-800",critical:"bg-red-100 text-red-800",high:"bg-orange-100 text-orange-800",moderate:"bg-yellow-100 text-yellow-800",medium:"bg-yellow-100 text-yellow-800",low:"bg-blue-100 text-blue-800"},c=[{problem:s.problem1,severity:s.problem1Severity},{problem:s.problem2,severity:s.problem2Severity},{problem:s.problem3,severity:s.problem3Severity}].filter(h=>h.problem).sort((h,f)=>ja(f.severity)-ja(h.severity)),n=[s.solution1,s.solution2,s.solution3].filter(Boolean),d=Rr(s.existingAlternatives),o=Rr(s.validationExperiments),g=s.marketPainLevel?String(s.marketPainLevel).toLowerCase():"moderate";return e.jsxs("div",{className:"space-y-6",children:[e.jsx(m,{className:"border-2 border-primary/20 bg-gradient-to-br from-primary/5 to-transparent","data-testid":"card-overview",children:e.jsxs(u,{children:[e.jsxs(p,{className:"text-2xl flex items-center gap-2","data-testid":"title-overview",children:[e.jsx(V,{className:"w-6 h-6 text-primary"}),"Problem-Solution Fit Analysis"]}),e.jsxs(O,{"data-testid":"desc-overview",children:["Fit Score: ",e.jsx("span",{className:`font-bold text-lg ${a(l)}`,children:t}),s.marketPainLevel&&e.jsxs(I,{className:`ml-3 ${r[g]||r.moderate}`,"data-testid":"badge-pain-level",children:[s.marketPainLevel," Market Pain"]})]})]})}),s.customerSegment&&e.jsxs(m,{"data-testid":"card-customer-segment",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-customer-segment",children:[e.jsx(ne,{className:"w-5 h-5 text-blue-500"}),"Customer Segment"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-customer-segment",children:s.customerSegment})})]}),c.length>0&&e.jsxs(m,{"data-testid":"card-problems",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-problems",children:[e.jsx(X,{className:"w-5 h-5 text-orange-500"}),"Top ",c.length," Problems"]}),e.jsx(O,{"data-testid":"desc-problems",children:"Ranked by severity"})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-4",children:c.map((h,f)=>{const b=ja(h.severity);return e.jsxs("div",{className:"space-y-2","data-testid":`problem-${f}`,children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsx("p",{className:"text-sm font-medium flex-1","data-testid":`text-problem-${f}`,children:h.problem}),e.jsx(I,{variant:"outline",className:"ml-2","data-testid":`badge-severity-${f}`,children:typeof h.severity=="string"?h.severity:`${h.severity}/10`})]}),e.jsx(de,{value:b*10,className:`h-2 ${i(b)}`,"data-testid":`progress-severity-${f}`})]},f)})})})]}),d.length>0&&e.jsxs(m,{"data-testid":"card-existing-alternatives",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-existing-alternatives",children:[e.jsx(se,{className:"w-5 h-5 text-purple-500"}),"Existing Alternatives"]}),e.jsx(O,{"data-testid":"desc-existing-alternatives",children:"Current solutions in the market"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:d.map((h,f)=>e.jsx("li",{className:"p-3 bg-purple-50 rounded text-sm","data-testid":`alternative-${f}`,children:h},f))})})]}),n.length>0&&e.jsxs(m,{"data-testid":"card-solutions",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-solutions",children:[e.jsx(he,{className:"w-5 h-5 text-yellow-500"}),"Proposed Solutions"]})}),e.jsx(x,{children:e.jsx("ol",{className:"space-y-3",children:n.map((h,f)=>e.jsxs("li",{className:"flex items-start gap-3","data-testid":`solution-${f}`,children:[e.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary text-white flex items-center justify-center text-xs font-bold",children:f+1}),e.jsx("p",{className:"text-sm flex-1 pt-1",children:h})]},f))})})]}),s.uniqueValueProposition&&e.jsxs(m,{className:"border-2 border-green-200","data-testid":"card-uvp",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-uvp",children:[e.jsx(V,{className:"w-5 h-5 text-green-500"}),"Unique Value Proposition"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm font-medium","data-testid":"text-uvp",children:s.uniqueValueProposition})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.unfairAdvantage&&e.jsxs(m,{"data-testid":"card-unfair-advantage",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-unfair-advantage",children:[e.jsx(Ke,{className:"w-5 h-5 text-blue-500"}),"Unfair Advantage"]}),e.jsx(O,{"data-testid":"desc-unfair-advantage",children:"What makes this defensible"})]}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-unfair-advantage",children:s.unfairAdvantage})})]}),o.length>0&&e.jsxs(m,{"data-testid":"card-validation-experiments",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-validation-experiments",children:[e.jsx(Ki,{className:"w-5 h-5 text-purple-500"}),"Validation Experiments"]}),e.jsx(O,{"data-testid":"desc-validation-experiments",children:"Recommended tests"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:o.map((h,f)=>e.jsxs("li",{className:"text-sm flex items-start gap-2","data-testid":`experiment-${f}`,children:[e.jsx("span",{className:"text-purple-500",children:"•"}),h]},f))})})]})]})]})}function yl({matrix:s}){if(!s)return e.jsxs("div",{className:"text-center py-12 text-muted-foreground","data-testid":"feature-impact-matrix-empty-state",children:[e.jsx(Xa,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),e.jsx("p",{"data-testid":"text-no-matrix",children:"No feature impact matrix generated yet."})]});const i=(l,a,t,r,c,n)=>{const d=a;return e.jsxs(m,{className:`border-2 ${r}`,"data-testid":n,children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":`${n}-title`,children:[e.jsx(d,{className:"w-5 h-5"}),t]}),e.jsx(O,{"data-testid":`${n}-desc`,children:c})]}),e.jsx(x,{children:e.jsx("div",{className:"space-y-3",children:l.map((o,g)=>e.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg space-y-2","data-testid":`${n}-${g}`,children:[e.jsx("p",{className:"font-medium text-sm","data-testid":`${n}-feature-${g}`,children:o.feature}),e.jsxs("div",{className:"flex gap-2 text-xs",children:[e.jsxs(I,{variant:"outline","data-testid":`${n}-impact-${g}`,children:["Impact: ",o.impact,"/10"]}),e.jsxs(I,{variant:"outline","data-testid":`${n}-effort-${g}`,children:["Effort: ",o.effort,"/10"]})]}),e.jsx("p",{className:"text-xs text-foreground","data-testid":`${n}-rationale-${g}`,children:o.rationale})]},g))})})]})};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(m,{className:"border-2 border-primary/20 bg-gradient-to-br from-primary/5 to-transparent","data-testid":"card-overview",children:e.jsxs(u,{children:[e.jsxs(p,{className:"text-2xl flex items-center gap-2","data-testid":"title-overview",children:[e.jsx(Xa,{className:"w-6 h-6 text-primary"}),"Feature Impact Matrix"]}),e.jsx(O,{"data-testid":"desc-overview",children:"Prioritize features based on impact and effort"})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i(s.quickWins,xe,"Quick Wins","border-green-200","High impact, low effort - prioritize these first","quick-wins"),i(s.majorProjects,at,"Major Projects","border-blue-200","High impact, high effort - strategic investments","major-projects"),i(s.fillIns,Hi,"Fill-Ins","border-yellow-200","Low impact, low effort - nice to have","fill-ins"),i(s.timeSinks,Te,"Time Sinks","border-red-200","Low impact, high effort - avoid or defer","time-sinks")]}),e.jsxs(m,{"data-testid":"card-priority-order",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-priority-order",children:[e.jsx(Vi,{className:"w-5 h-5 text-primary"}),"Recommended Priority Order"]})}),e.jsx(x,{children:e.jsx("ol",{className:"space-y-2",children:s.priorityOrder.map((l,a)=>e.jsxs("li",{className:"flex items-start gap-3","data-testid":`priority-${a}`,children:[e.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary text-white flex items-center justify-center text-xs font-bold",children:a+1}),e.jsx("p",{className:"text-sm flex-1 pt-1",children:l})]},a))})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(m,{"data-testid":"card-mvp-features",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-mvp-features",children:[e.jsx(Et,{className:"w-5 h-5 text-yellow-500"}),"MVP Features"]}),e.jsx(O,{"data-testid":"desc-mvp-features",children:"Must-have for initial launch"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:s.mvpFeatures.map((l,a)=>e.jsxs("li",{className:"flex items-start gap-2 text-sm","data-testid":`mvp-${a}`,children:[e.jsx(Et,{className:"w-4 h-4 text-yellow-500 mt-0.5 flex-shrink-0"}),l]},a))})})]}),e.jsxs(m,{"data-testid":"card-deferred-features",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-deferred-features",children:[e.jsx(rt,{className:"w-5 h-5 text-muted-foreground"}),"Deferred Features"]}),e.jsx(O,{"data-testid":"desc-deferred-features",children:"For future iterations"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:s.deferredFeatures.map((l,a)=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground","data-testid":`deferred-${a}`,children:[e.jsx(rt,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),l]},a))})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(m,{"data-testid":"card-portfolio-balance",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-portfolio-balance",children:[e.jsx(ls,{className:"w-5 h-5 text-blue-500"}),"Portfolio Balance"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-portfolio-balance",children:s.portfolioBalance})})]}),e.jsxs(m,{"data-testid":"card-risk-assessment",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-risk-assessment",children:[e.jsx(X,{className:"w-5 h-5 text-orange-500"}),"Risk Assessment"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-risk-assessment",children:s.riskAssessment})})]})]})]})}function wl({framework:s}){if(!s)return e.jsxs("div",{className:"text-center py-12 text-muted-foreground","data-testid":"heart-framework-empty-state",children:[e.jsx(_e,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),e.jsx("p",{"data-testid":"text-no-framework",children:"No HEART framework generated yet."})]});const i=[{letter:"H",name:"Happiness",icon:Or,color:"text-pink-500",bgColor:"bg-pink-50",borderColor:"border-pink-200",metrics:s.happinessMetrics,goal:s.happinessGoal,testId:"happiness"},{letter:"E",name:"Engagement",icon:xe,color:"text-yellow-500",bgColor:"bg-yellow-50",borderColor:"border-yellow-200",metrics:s.engagementMetrics,goal:s.engagementGoal,testId:"engagement"},{letter:"A",name:"Adoption",icon:Rt,color:"text-blue-500",bgColor:"bg-blue-50",borderColor:"border-blue-200",metrics:s.adoptionMetrics,goal:s.adoptionGoal,testId:"adoption"},{letter:"R",name:"Retention",icon:Ui,color:"text-purple-500",bgColor:"bg-purple-50",borderColor:"border-purple-200",metrics:s.retentionMetrics,goal:s.retentionGoal,testId:"retention"}
196,{letter:"T",name:"Task Success",icon:ds,color:"text-green-500",bgColor:"bg-green-50",borderColor:"border-green-200",metrics:s.taskSuccessMetrics,goal:s.taskSuccessGoal,testId:"task-success"}];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(m,{className:"border-2 border-primary/20 bg-gradient-to-br from-primary/5 to-transparent","data-testid":"card-overview",children:[e.jsxs(u,{children:[e.jsxs(p,{className:"text-2xl flex items-center gap-2","data-testid":"title-overview",children:[e.jsx(_e,{className:"w-6 h-6 text-primary"}),"HEART Framework - UX Metrics"]}),e.jsx(O,{"data-testid":"desc-overview",children:"Happiness, Engagement, Adoption, Retention, Task Success"})]}),e.jsx(x,{children:e.jsxs("div",{className:"p-4 bg-primary/10 rounded-lg",children:[e.jsx("p",{className:"font-semibold text-sm mb-2",children:"Primary Focus:"}),e.jsx("p",{className:"text-sm","data-testid":"text-primary-focus",children:s.primaryFocus})]})})]}),e.jsx("div",{className:"space-y-4",children:i.map((l,a)=>{const t=l.icon;return e.jsxs(m,{className:`border-2 ${l.borderColor}`,"data-testid":`card-${l.testId}`,children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":`title-${l.testId}`,children:[e.jsx(t,{className:`w-5 h-5 ${l.color}`}),e.jsx("span",{className:`font-bold ${l.color} text-lg mr-2`,children:l.letter}),l.name]})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-sm mb-2",children:"Metrics to Track:"}),e.jsx("ul",{className:"space-y-1",children:l.metrics.map((r,c)=>e.jsxs("li",{className:"text-sm flex items-start gap-2","data-testid":`${l.testId}-metric-${c}`,children:[e.jsx("span",{className:l.color,children:"•"}),r]},c))})]}),e.jsxs("div",{className:`p-3 ${l.bgColor} rounded-lg`,children:[e.jsx("h4",{className:"font-semibold text-sm mb-1",children:"Goal:"}),e.jsx("p",{className:"text-sm","data-testid":`${l.testId}-goal`,children:l.goal})]})]})})]},a)})}),e.jsxs(m,{"data-testid":"card-metrics-strategy",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-metrics-strategy",children:[e.jsx(V,{className:"w-5 h-5 text-primary"}),"Metrics Strategy"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-metrics-strategy",children:s.metricsStrategy})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(m,{"data-testid":"card-measurement-plan",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-measurement-plan",children:[e.jsx(ls,{className:"w-5 h-5 text-blue-500"}),"Measurement Plan"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-measurement-plan",children:s.measurementPlan})})]}),e.jsxs(m,{"data-testid":"card-baseline-data",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-baseline-data",children:[e.jsx(fs,{className:"w-5 h-5 text-purple-500"}),"Baseline Data Needs"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm","data-testid":"text-baseline-data",children:s.baselineData})})]})]}),e.jsxs(m,{"data-testid":"card-success-criteria",children:[e.jsx(u,{children:e.jsxs(p,{className:"flex items-center gap-2","data-testid":"title-success-criteria",children:[e.jsx(se,{className:"w-5 h-5 text-green-500"}),"Success Criteria"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:s.successCriteria.map((l,a)=>e.jsxs("li",{className:"flex items-start gap-2","data-testid":`success-criteria-${a}`,children:[e.jsx(ds,{className:"w-4 h-4 text-green-500 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-sm",children:l})]},a))})})]})]})}const kl=[{id:1,title:"Define & Hypothesize",description:"Map assumptions and validate with AI",icon:V,color:"text-blue-600",bgColor:"bg-blue-50",borderColor:"border-blue-500",completed:0,total:3,status:"not-started"},{id:2,title:"Market Research",description:"Analyze market and competition",icon:se,color:"text-purple-600",bgColor:"bg-purple-50",borderColor:"border-purple-500",completed:0,total:6,status:"not-started"},{id:3,title:"User Research",description:"Understand customer needs",icon:ne,color:"text-pink-600",bgColor:"bg-pink-50",borderColor:"border-pink-500",completed:0,total:4,status:"not-started"},{id:4,title:"Business Model",description:"Design your business canvas",icon:Bt,color:"text-orange-600",bgColor:"bg-orange-50",borderColor:"border-orange-500",completed:0,total:3,status:"not-started"},{id:5,title:"Product / Solution Design",description:"Prioritize features and validate fit",icon:xe,color:"text-green-600",bgColor:"bg-green-50",borderColor:"border-green-500",completed:0,total:7,status:"not-started"},{id:6,title:"Execute & Iterate",description:"Build your execution roadmap",
196icon:Ws,color:"text-indigo-600",bgColor:"bg-indigo-50",borderColor:"border-indigo-500",completed:0,total:2,status:"not-started"}];function Cl({phases:s,currentPhase:i,onPhaseClick:l,className:a}){return e.jsx("div",{className:$e("space-y-3",a),children:s.map((t,r)=>{const c=t.icon,n=i===t.id,d=t.total>0?Math.round(t.completed/t.total*100):0;return e.jsx(Y.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3,delay:r*.05},children:e.jsx(m,{className:$e("cursor-pointer transition-all duration-200 hover:shadow-md",n?`border-2 ${t.borderColor} shadow-md`:"border hover:border-border",t.locked&&"opacity-50 cursor-not-allowed"),onClick:()=>!t.locked&&l(t.id),"data-testid":`phase-nav-${t.id}`,children:e.jsx("div",{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:$e("flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center",n?t.bgColor:"bg-muted/50"),children:t.locked?e.jsx(qr,{className:$e("h-5 w-5",t.color)}):t.status==="completed"?e.jsx(Br,{className:"h-5 w-5 text-green-600"}):e.jsx(c,{className:$e("h-5 w-5",n?t.color:"text-muted-foreground")})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[e.jsx("h3",{className:$e("text-sm font-semibold truncate","text-foreground"),children:t.title}),e.jsxs(I,{variant:t.status==="completed"?"default":"outline",className:"text-xs flex-shrink-0",children:[t.completed,"/",t.total]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2 line-clamp-1",children:t.description}),t.total>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{value:d,className:"h-1.5 flex-1"}),e.jsxs("span",{className:"text-xs text-muted-foreground font-medium flex-shrink-0",children:[d,"%"]})]})]}),n&&e.jsx(Ce,{className:$e("h-4 w-4 flex-shrink-0",t.color)})]})})})},t.id)})})}function Sl(s){const i=[...kl];if(!s)return i;let l=0;s.assumptionMapping&&l++,s.fiveWhys&&l++,s.thinkingHatsAnalysis&&l++,i[0].completed=l,i[0].status=l===0?"not-started":l===3?"completed":"in-progress";let a=0;
196s.marketViability&&a++,s.competitiveLandscape&&a++,s.executionReadiness&&a++,s.socialValidation&&a++,s.expertValidation&&a++,s.opportunityAssessment&&a++,i[1].completed=a,i[1].status=a===0?"not-started":a===6?"completed":"in-progress";let t=0;s.jtbdDiscovery&&t++,s.targetPersonas&&t++,s.empathyMap&&t++,s.customerJourneyMap&&t++,i[2].completed=t,i[2].status=t===0?"not-started":t===4?"completed":"in-progress";let r=0;s.businessModelCanvas&&r++,s.leanCanvas&&r++,s.valuePropositionCanvas&&r++,i[3].completed=r,i[3].status=r===0?"not-started":r===3?"completed":"in-progress";let c=0;s.kanoModel&&c++,s.featureImpactMatrix&&c++,s.problemSolutionFit&&c++,s.heartFramework&&c++,s.riceScore&&c++,s.moscowPrioritization&&c++,s.iceScore&&c++,i[4].completed=c,i[4].status=c===0?"not-started":c===7?"completed":"in-progress";let n=0;const d=[],o=i[0].total+i[1].total+i[2].total+i[3].total+i[4].total,g=i[0].completed+i[1].completed+i[2].completed+i[3].completed+i[4].completed;return o>0&&d.push(g/o*40),s.executionPlan&&d.push(15),s.investorOutlook&&d.push(15),s.problemSolutionFit?.overallFitScore&&d.push(s.problemSolutionFit.overallFitScore/100*20),s.researchMethodRecommendations&&d.push(10),(s.riceScore||s.moscowPrioritization||s.iceScore||s.wsjfScore)&&d.push(10),n=d.reduce((f,b)=>f+b,0),n=Math.min(n,90),i[5].total=100,i[5].completed=Math.round(n),i[5].status=n===0?"not-started":"in-progress",i}const Pl=hn,Al=un,Ml=pn;function fa(s){return typeof s=="string"?s:typeof s=="object"&&s!==null?s.title||s.description||s.text||JSON.stringify(s):String(s)}const $l=["Phase 1: Problem Discovery","Phase 2: Market Understanding","Phase 3: Solution Validation","Phase 4: Business Model","Phase 5: Go-to-Market","Phase 6: Execution Planning"];function Tl({currentPhase:s,completedPhases:i,availableData:l,guidance:a,onGenerateGuidance:t,isGenerating:r,isLoading:c}){const n=$l[s-1]||`Phase ${s}`,d=i.includes(s);return e.jsxs(m,{className:"shadow-md border-cyan-200 bg-gradient-to-br from-cyan-50 to-white",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-cyan-100 rounded-lg",children:e.jsx(Kt,{className:"h-5 w-5 text-cyan-600"})}),e.jsxs("div",{children:[e.jsx(p,{className:"text-lg",children:"Phase Guidance"}),e.jsx("p",{className:"text-sm text-foreground",children:n})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[d&&e.jsxs(I,{variant:"outline",className:"bg-green-50 text-green-700 border-green-300",children:[e.jsx(re,{className:"h-3 w-3 mr-1"}),"Complete"]}),e.jsxs(I,{variant:"outline",className:"bg-cyan-50 text-cyan-700 border-cyan-300",children:[i.length,"/6 Phases Done"]})]})]})}),e.jsx(x,{className:"space-y-4",children:a?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-semibold text-foreground",children:"Your Guidance"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{variant:"outline",className:"bg-white text-xs",children:new Date(a.generatedAt).toLocaleDateString()}),e.jsx(R,{onClick:t,disabled:r||c,size:"sm",variant:"outline","data-testid":"button-refresh-contextual-guidance",children:r?e.jsx(ae,{className:"h-4 w-4 animate-spin"}):"Refresh"})]})]}),a.warnings.length>0&&e.jsxs(Ns,{className:"bg-orange-50 border-orange-200",children:[e.jsx(X,{className:"h-4 w-4 text-orange-600"}),e.jsxs(vs,{children:[e.jsx("h5",{className:"font-semibold text-orange-900 mb-2",children:"Important Warnings:"}),e.jsx("ul",{className:"space-y-1",children:a.warnings.map((o,g)=>e.jsxs("li",{className:"text-sm text-orange-800 flex items-start gap-2",children:[e.jsx(Ce,{className:"h-4 w-4 flex-shrink-0 mt-0.5"}),e.jsx("span",{children:fa(o)})]},g))})]})]}),a.suggestions.length>0&&e.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg border border-blue-200",children:[e.jsx("h5",{className:"font-semibold text-blue-900 mb-2",children:"Suggestions for This Phase:"}),e.jsx("ul",{className:"space-y-2",children:a.suggestions.map((o,g)=>e.jsxs("li",{className:"text-sm text-blue-800 flex items-start gap-2",children:[e.jsx(Ce,{className:"h-4 w-4 text-blue-600 flex-shrink-0 mt-0.5"}),e.jsx("span",{children:fa(o)})]},g))})]}),a.nextSteps.length>0&&e.jsxs("div",{className:"p-4 bg-green-50 rounded-lg border border-green-200",children:[e.jsx("h5",{className:"font-semibold text-green-900 mb-2",children:"Recommended Next Steps:"}),e.jsx("ul",{className:"space-y-2",children:a.nextSteps.map((o,g)=>e.jsxs("li",{className:"text-sm text-green-800 flex items-start gap-2",children:[e.jsx(re,{className:"h-4 w-4 text-green-600 flex-shrink-0 mt-0.5"}),e.jsx("span",{children:fa(o)})]},g))})]}),l&&e.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t",children:[e.jsx("strong",{children:"Data Sources:"})," ",Object.entries(l).filter(([,o])=>o).map(([o])=>o.replace("has","").replace(/([A-Z])/g," $1").trim()).join(", ")||"None yet"]})]}):e.jsxs("div",{className:"text-center py-6",children:[e.jsx(Kt,{className:"h-12 w-12 text-cyan-300 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-foreground mb-4",children:"Get AI-powered guidance tailored to your current phase and progress"}),e.jsx(R,{onClick:t,disabled:r||c,"data-testid":"button-generate-contextual-guidance",children:r?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"mr-2 h-4 w-4 animate-spin"}),"Generating Guidance..."]}
196):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{className:"mr-2 h-4 w-4"}),"Get Phase Guidance"]})})]})})]})}const El={1:"bg-blue-500",2:"bg-purple-500",3:"bg-pink-500",4:"bg-orange-500",5:"bg-green-500",6:"bg-indigo-500"};function Vs({phaseNumber:s,title:i,description:l,isOpen:a,onToggle:t,children:r,advisorMode:c=!1,guidance:n,completedPhases:d=[],availableData:o,onGenerateGuidance:g,isGeneratingGuidance:h=!1,isLoadingAdvisor:f=!1}){const b=El[s]||"bg-blue-500";return e.jsx(Pl,{open:a,onOpenChange:t,children:e.jsxs("div",{id:`phase-${s}`,className:"scroll-mt-20",children:[e.jsx(Al,{asChild:!0,children:e.jsx("div",{className:"mb-6 cursor-pointer hover:bg-muted/50 p-4 rounded-lg transition-colors","data-testid":`phase-trigger-${s}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 ${b} text-white rounded-full flex items-center justify-center font-bold shrink-0`,children:s}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold text-foreground",children:i}),e.jsx("p",{className:"text-foreground text-sm hidden sm:block",children:l})]})]}),a?e.jsx(Pa,{className:"h-5 w-5 text-muted-foreground shrink-0"}):e.jsx(Ce,{className:"h-5 w-5 text-muted-foreground shrink-0"})]})})}),e.jsxs(Ml,{className:"space-y-8",children:[c&&g&&e.jsx(Tl,{currentPhase:s,completedPhases:d,availableData:o,guidance:n,onGenerateGuidance:g,isGenerating:h,isLoading:f}),r]})]})})}function Ne({onClick:s,isLoading:i,variant:l="outline",size:a="sm",showLabel:t=!0,testId:r,className:c=""}){return e.jsx(R,{onClick:s,disabled:i,variant:l,size:a,className:`rounded-full ${c}`,"data-testid":r,children:i?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 animate-spin"}),t&&e.jsx("span",{className:"ml-2 hidden sm:inline",children:"Regenerating..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4"}),t&&e.jsx("span",{className:"ml-2 hidden sm:inline",children:"Regenerate"})]})})}function te({onClick:s,isLoading:i,label:l,variant:a="outline",size:t="default",testId:r,className:c=""}){return e.jsx(R,{onClick:s,disabled:i,variant:a,size:t,className:`rounded-full ${c}`,"data-testid":r,children:i?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"h-4 w-4 mr-2 animate-spin"}),"Generating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),l]})})}const Rl=gn,Fl=jn,Il=fn,ni=D.forwardRef(({className:s,...i},l)=>e.jsx(Wr,{className:$e("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...i,ref:l}));ni.displayName=Wr.displayName;const zl=rn("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),li=D.forwardRef(({side:s="right",className:i,children:l,...a},t)=>e.jsxs(Il,{children:[e.jsx(ni,{}),e.jsxs(_r,{ref:t,className:$e(zl({side:s}),i),...a,children:[l,e.jsxs(bn,{className:"absolute right-4 top-4 roun
196ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[e.jsx(gs,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));li.displayName=_r.displayName;const di=({className:s,...i})=>e.jsx("div",{className:$e("flex flex-col space-y-2 text-center sm:text-left",s),...i});di.displayName="SheetHeader";const ci=D.forwardRef(({className:s,...i},l)=>e.jsx(Qr,{ref:l,className:$e("text-lg font-semibold text-foreground",s),...i}));ci.displayName=Qr.displayName;const oi=D.forwardRef(({className:s,...i},l)=>e.jsx(Jr,{ref:l,className:$e("text-sm text-muted-foreground",s),...i}));oi.displayName=Jr.displayName;const Fr={1:"bg-blue-500",2:"bg-purple-500",3:"bg-pink-500",4:"bg-green-500",5:"bg-orange-500",6:"bg-indigo-500"};function Dl({phases:s,currentPhase:i,onPhaseClick:l}){const[a,t]=D.useState(!1),r=s.find(n=>n.id===i),c=n=>{l(n),t(!1)};return e.jsx("div",{className:"lg:hidden sticky top-16 z-10 bg-white border-b shadow-sm mb-6",children:e.jsxs(Rl,{open:a,onOpenChange:t,children:[e.jsx(Fl,{asChild:!0,children:e.jsxs(R,{variant:"ghost",className:"w-full justify-between h-14 px-4 rounded-none hover:bg-muted/50","data-testid":"mobile-phase-navigation-trigger",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-8 h-8 ${Fr[i]} text-white rounded-full flex items-center justify-center font-bold text-sm`,children:i}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-semibold text-sm",children:r?.title||`Phase ${i}`}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[r?.completion||0,"% complete"]})]})]}),e.jsx(Ce,{className:"h-5 w-5 text-muted-foreground"})]})}),e.jsxs(li,{side:"left",className:"w-80",children:[e.jsxs(di,{children:[e.jsx(ci,{children:"Customer Discovery Phases"}),e.jsx(oi,{children:"Track your progress through the 6 discovery phases"})]}),e.jsx("div",{className:"mt-6 space-y-3",children:s.map(n=>{const d=n.id===i,o=Fr[n.id]||"bg-blue-500";return e.jsxs("button",{onClick:()=>c(n.id),className:`w-full p-4 rounded-lg border-2 transition-all text-left ${d?"border-blue-500 bg-blue-50":"border-border hover:border-border hover:bg-muted/50"}`,"data-testid":`mobile-phase-${n.id}-button`,children:[e.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[e.jsx("div",{className:`w-10 h-10 ${o} text-white rounded-full flex items-center justify-center font-bold shrink-0`,children:n.id}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-semibold text-foreground mb-1",children:n.title}),e.jsx("p",{className:"text-xs text-foreground line-clamp-2",children:n.description})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-foreground",children:"Progress"}),e.jsxs(I,{variant:n.completion===100?"default":"secondary",className:"text-xs",children:[n.completion,"%"]})]}),e.jsx(de,{value:n.completion,className:"h-2"})]})]},n.id)})})]})]})})}function oe({title:s,children:i,defaultOpen:l=!0,badge:a}){const[t,r]=D.useState(l),n=(o=>{if(typeof o=="string")return o;if(typeof o=="object"&&o!==null&&"props"in o){const g=o.props;if(g?.children){const h=f=>typeof f=="string"?f:Array.isArray(f)?f.map(h).filter(Boolean).join(" "):f?.props?.children?h(f.props.children):"";return h(g.children)}}return"section"})(s),d=`collapsible-${n.toLowerCase().replace(/\s+/g,"-")}`;return e.jsxs("div",{className:"mb-6",children:[e.jsxs("button",{onClick:()=>r(!t),className:"w-full flex items-center justify-between p-4 bg-muted/50 hover:bg-muted/50 rounded-lg transition-colors border border-border","data-testid":`button-toggle-${n.toLowerCase().replace(/\s+/g,"-")}`,"aria-expanded":t,"aria-controls":d,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:s}),a]}),e.jsx(Pa,{className:`w-5 h-5 text-foreground transition-transform duration-200 ${t?"rotate-180":""}`,"aria-hidden":"true"})]}),e.jsx(Ur,{children:t&&e.jsx(Y.div,{id:d,initial:{height:0,opacity:0}
196,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",role:"region","aria-labelledby":`${d}-label`,children:e.jsx("div",{className:"pt-4",children:i})})})]})}const Bl=Ia({title:ze().min(5,"Title must be at least 5 characters"),description:ze().min(20,"Description must be at least 20 characters"),context:ze().optional(),category:ze().optional(),ideaType:Yr(["product","feature"]).optional()});function ql({open:s,onOpenChange:i,currentData:l,onSave:a,isPending:t}){const r=Ma({resolver:Ra(Bl),defaultValues:{title:l.title||"",description:l.description||"",context:l.context||"",category:l.category||"",ideaType:l.ideaType||void 0}});D.useEffect(()=>{s&&r.reset({title:l.title||"",description:l.description||"",context:l.context||"",category:l.category||"",ideaType:l.ideaType||void 0})},[s,l,r]);const c=async n=>{try{await a(n),i(!1)}catch{}};return e.jsx(ys,{open:s,onOpenChange:i,children:e.jsxs(ws,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col",children:[e.jsxs(ks,{className:"pb-4",children:[e.jsx(Cs,{className:"text-2xl font-bold",children:"Edit Idea"}),e.jsx(lt,{className:"text-base",children:"Update your idea details. Changes will be saved and you'll be asked if you want to regenerate dependent analyses."})]}),e.jsx(Fa,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(c),className:"flex flex-col flex-1 overflow-hidden",children:[e.jsxs("div",{className:"overflow-y-auto pr-2 space-y-6",children:[e.jsx(pe,{control:r.control,name:"title",render:({field:n})=>e.jsxs(ge,{children:[e.jsx(ce,{className:"text-base font-semibold",children:"Title *"}),e.jsx(je,{children:e.jsx(ke,{placeholder:"Enter idea title",className:"rounded-xl h-11 text-base",...n,"data-testid":"input-edit-idea-title"})}),e.jsx(ve,{})]})}),e.jsx(pe,{control:r.control,name:"description",render:({field:n})=>e.jsxs(ge,{children:[e.jsx(ce,{className:"text-base font-semibold",children:"Description *"}),e.jsx(je,{children:e.jsx(it,{placeholder:"Describe your idea in detail",rows:6,className:"rounded-xl resize-none text-base",...n,"data-testid":"textarea-edit-idea-description"})}),e.jsx(ve,{})]})}),e.jsx(pe,{control:r.control,name:"context",render:({field:n})=>e.jsxs(ge,{children:[e.jsx(ce,{className:"text-base font-semibold",children:"Additional Context (Optional)"}),e.jsx(je,{children:e.jsx(it,{placeholder:"Any additional background or context",rows:4,className:"rounded-xl resize-none text-base",...n,"data-testid":"textarea-edit-idea-context"})}),e.jsx(ve,{})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx(pe,{control:r.control,name:"category",render:({field:n})=>e.jsxs(ge,{children:[e.jsx(ce,{className:"text-base font-semibold",children:"Category (Optional)"}),e.jsx(je,{children:e.jsx(ke,{placeholder:"e.g., SaaS, E-commerce",className:"rounded-xl h-11 text-base",...n,"data-testid":"input-edit-idea-category"})}),e.jsx(ve,{})]})}),e.jsx(pe,{control:r.control,name:"ideaType",render:({field:n})=>e.jsxs(ge,{children:[e.jsx(ce,{className:"text-base font-semibold",children:"Idea Type (Optional)"}),e.jsxs(Xr,{onValueChange:n.onChange,defaultValue:n.value,"data-testid":"select-edit-idea-type",children:[e.jsx(je,{children:e.jsx(Zr,{className:"rounded-xl h-11 text-base",children:e.jsx(ei,{placeholder:"Select type"})})}),e.jsxs(si,{children:[e.jsx(Us,{value:"product",children:"Product"}),e.jsx(Us,{value:"feature",children:"Feature"})]})]}),e.jsx(ve,{})]})})]})]}),e.jsxs(Ta,{className:"pt-6 gap-3",children:[e.jsx(R,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:t,className:"rounded-full px-6","data-testid":"button-cancel-edit-idea",children:"Cancel"}),e.jsx(R,{type:"submit",disabled:t,className:"bg-blue-600 hover:bg-blue-700 rounded-full px-6","data-testid":"button-save-edit-idea",children:t?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"h-4 w-4 mr-2 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Sa,{className:"h-4 w-4 mr-2"}),"Save Changes"]})})]})]})})]})})}const Ll=Ia({questionAnswers:yn(ze().min(1,"Answer cannot be empty"))});function Ol({open:s,onOpenChange:i,currentData:l,onSave:a,isPending:t}){const r=Ma({resolver:Ra(Ll),defaultValues:{questionAnswers:l.clarifyingQuestions||{}}});D.useEffect(()=>{s&&r.reset({questionAnswers:l.clarifyingQuestions||{}})},[s]);const c=async n=>{try{await a({clarifyingQuestions:n.questionAnswers}),i(!1)}catch{}};return!l.generatedQuestions||!l.clarifyingQuestions?null:e.jsx(ys,{open:s,onOpenChange:i,children:e.jsxs(ws,{className:"max-w-[90vw] h-[90vh] flex flex-col p-0",children:[e.jsx("div",{className:"p-6 border-b",children:e.jsxs(ks,{children:[e.jsx(Cs,{className:"text-2xl",children:"Edit Context Q&A"}),e.jsx(lt,{className:"text-base",children:"Update the answers to context questions. These answers enhance the AI's understanding of your idea."})]})}),e.jsx(Fa,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(c),className:"flex-1 flex flex-col min-h-0",children:[e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:e.jsx("div",{className:"space-y-8 pb-4",children:l.generatedQuestions.map((n,d)=>e.jsx(pe,{control:r.control,name:`questionAnswers.${n.id}`,render:({field:o})=>e.jsxs(ge,{children:[e.jsxs(ce,{className:"text-base font-semibold flex items-start gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-7 h-7 bg-indigo-100 text-indigo-600 rounded-full flex items-center justify-center text-sm font-bold",children:d+1}),e.jsx("span",{className:"flex-1 leading-relaxed",children:n.question})]}),e.jsx(je,{children:e.jsx(it,{...o,placeholder:"Enter your answer...",className:"min-h-[120px] resize-y rounded-xl border-2 focus:border-indigo-500 transition-colors","data-testid":`input-context-answer-${n.id}`})}),e.jsx(ve,{})]})},n.id))})}),e.jsx("div",{className:"p-6 border-t bg-background",children:e.jsxs(Ta,{className:"gap-3",children:[e.jsx(R,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:t,className:"rounded-xl","data-testid":"button-cancel-edit-context",children:"Cancel"}),e.jsx(R,{type:"submit",disabled:t,className:"bg-blue-600 hover:bg-blue-700 rounded-xl","data-testid":"button-save-context",children:t?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Save Changes"]})})]})})]})})]})})}const Gl={"core-idea":["thinking-hats","business-model-canvas","lean-canvas","value-proposition-canvas","personas","market-viability","competitive-landscape","execution-readiness","social-validation","expert-validation","opportunity-assessment","jtbd-analysis","assumption-mapping","kano-analysis","customer-journey-map","empathy-map","five-whys-analysis","problem-solution-fit","feature-impact-matrix","heart-framework","execution-plan"],"context-questions":["thinking-hats"],personas:["empathy-map","customer-journey-map"],"market-viability":["opportunity-assessment"],"competitive-landscape":["opportunity-assessment"],"execution-readiness":["opportunity-assessment"],"social-validation":["opportunity-assessment"],"expert-validation":["opportunity-assessment"],"business-model-canvas":[],"lean-canvas":[],"value-proposition-canvas":[]},mi={"thinking-hats":{name:"Thinking Hats Analysis",estimatedTimeSeconds:180,phase:1,icon:"🎩"},"business-model-canvas":{name:"Business Model Canvas",estimatedTimeSeconds:15,phase:2,icon:"📊"},"lean-canvas":{name:"Lean Canvas",estimatedTimeSeconds:15,phase:2,icon:"📋"},"value-proposition-canvas":{name:"Value Proposition Canvas",estimatedTimeSeconds:15,phase:2,icon:"💎"},personas:{name:"Target Personas",estimatedTimeSeconds:20,phase:3,icon:"👥"},"market-viability":{name:"Market Viability",estimatedTimeSeconds:15,phase:2,icon:"📈"},"competitive-landscape":{name:"Competitive Landscape",estimatedTimeSeconds:15,phase:2,icon:"🏆"},"execution-readiness":{name:"Execution Readiness",estimatedTimeSeconds:15,phase:2,icon:"⚡"},"social-validation":{name:"Social Validation",estimatedTimeSeconds:15,phase:2,icon:"👍"},"expert-validation":{name:"Expert Validation",estimatedTimeSeconds:15,phase:2,icon:"🎓"},"opportunity-assessment":{name:"Opportunity Assessment",estimatedTimeSeconds:30,phase:2,icon:"🎯"},"jtbd-analysis":{name:"JTBD Discovery",estimatedTimeSeconds:20,phase:3,icon:"💼"},"assumption-mapping":{name:"Assumption Mapping",estimatedTimeSeconds:20,phase:3,icon:"🗺️"},"kano-analysis":{name:"Kano Model",estimatedTimeSeconds:20,phase:3,icon:"⭐"},"customer-journey-map":{name:"Customer Journey Map",estimatedTimeSeconds:25,phase:3,icon:"🛣️"},"empathy-map":{name:"Empathy Map",estimatedTimeSeconds:20,phase:3,icon:"❤️"},"five-whys-analysis":{name:"5 Whys Analysis",estimatedTimeSeconds:15,phase:3,icon:"❓"},"problem-solution-fit":{name:"Problem-Solution Fit",estimatedTimeSeconds:20,phase:4,icon:"🔗"},"feature-impact-matrix":{name:"Feature Impact Matrix",estimatedTimeSeconds:20,phase:5,icon:"📊"},"heart-framework":{name:"HEART Framework",estimatedTimeSeconds:20,phase:5,icon:"💚"},"execution-plan":{name:"Execution Plan",estimatedTimeSeconds:30,phase:6,icon:"🚀"}};function Kl(s){return Gl[s]||[]}function Dt(s){return mi[s]}function Vl(s){return s.reduce((i,l)=>i+mi[l].estimatedTimeSeconds,0)}function Hl(s){return s<60?`~${s}s`:`~${Math.ceil(s/60)}min`}function Ul({open:s,onOpenChange:i,plan:l,onConfirm:a,onSkip:t,isPending:r}){const[c,n]=D.useState(new Set(l?.affectedAnalyses||[]));if(D.useEffect(()=>{l&&n(new Set(l.affectedAnalyses))},[l]),!l)return null;const d=w=>{const P=new Set(c);P.has(w)?P.delete(w):P.add(w),n(P)},o=()=>{c.size===l.affectedAnalyses.length?n(new Set):n(new Set(l.affectedAnalyses))},g=()=>{a(Array.from(c))},h=c.size,f=l.affectedAnalyses.length,b=h===f,y=h===0,S=Array.from(c).reduce((w,P)=>w+Dt(P).estimatedTimeSeconds,0),N=w=>w<60?`~${w}s`:`~${Math.ceil(w/60)}min`;return e.jsx(ys,{open:s,onOpenChange:i,children:e.jsxs(ws,{className:"max-w-2xl max-h-[90vh]",children:[e.jsxs(ks,{children:[e.jsxs(Cs,{className:"flex items-center gap-2",children:[e.jsx(me,{className:"h-5 w-5 text-amber-500"}),"Regenerate Dependent Analyses?"]}),e.jsxs(lt,{children:["Your changes affect ",f," ",f===1?"analysis":"analyses",". Select which ones to regenerate or skip for now."]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium",children:"Selected Analyses"}),e.jsxs(I,{variant:"secondary",children:[h," of ",f]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx(Te,{className:"h-4 w-4"}),"Estimated Time"]}),e.jsx("span",{className:"text-sm font-medium",children:N(S)})]})]}),e.jsxs("div",{className:"flex items-center gap-2 px-1",children:[e.jsx(It,{id:"select-all",checked:b,onCheckedChange:o,"data-testid":"checkbox-select-all-regeneration"}),e.jsx("label",{htmlFor:"select-all",className:"text-sm font-medium cursor-pointer",children:"Select All"})]}),e.jsx(Be,{}),e.jsx(zt,{className:"h-[300px] pr-4",children:e.jsx("div",{className:"space-y-4",children:Object.entries(l.analysesByPhase).sort(([w],[P])=>Number(w)-Number(P)).map(([w,P])=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h4",{className:"text-sm font-semibold text-muted-foreground",children:["Phase ",w]}),e.jsx("div",{className:"space-y-2",children:P.map(C=>{const v=Dt(C),T=c.has(C);return e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border hover:bg-muted/30 transition-colors cursor-pointer",onClick:()=>d(C),"data-testid":`regeneration-item-${C}`,children:[e.jsx(It,{checked:T,onCheckedChange:()=>d(C),onClick:$=>$.stopPropagation()}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-lg",children:v.icon}),e.jsx("span",{className:"font-medium",children:v.name})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:N(v.estimatedTimeSeconds)})]}),T&&e.jsx(re,{className:"h-4 w-4 text-green-600"})]},C)})})]},w))})})]}),e.jsxs(Ta,{children:[e.jsxs(R,{type:"button",variant:"outline",onClick:()=>{t(),i(!1)},disabled:r,"data-testid":"button-skip-regeneration",children:[e.jsx(gs,{className:"h-4 w-4 mr-2"}),"Skip for Now"]}),e.jsx(R,{type:"button",onClick:g,disabled:r||y,"data-testid":"button-confirm-regeneration",children:r?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"h-4 w-4 mr-2 animate-spin"}),"Regenerating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_i,{className:"h-4 w-4 mr-2"}),"Regenerate ",h>0&&`(${h})`]})})]})]})})}function _l({open:s,items:i,onOpenChange:l}){const a=i.filter(g=>g.status==="completed").length,t=i.filter(g=>g.status==="failed").length,r=i.length,c=r>0?(a+t)/r*100:0,n=a+t===r,d=g=>
196{switch(g){case"pending":return e.jsx(Te,{className:"h-4 w-4 text-muted-foreground"});case"running":return e.jsx(ae,{className:"h-4 w-4 text-blue-600 animate-spin"});case"completed":return e.jsx(re,{className:"h-4 w-4 text-green-600"});case"failed":return e.jsx(rt,{className:"h-4 w-4 text-red-600"})}},o=g=>{switch(g){case"pending":return e.jsx(I,{variant:"secondary",children:"Pending"});case"running":return e.jsx(I,{className:"bg-blue-600",children:"Running"});case"completed":return e.jsx(I,{className:"bg-green-600",children:"Completed"});case"failed":return e.jsx(I,{variant:"destructive",children:"Failed"})}};return e.jsx(ys,{open:s,onOpenChange:l,children:e.jsxs(ws,{className:"max-w-2xl max-h-[90vh]",closeButton:n,children:[e.jsxs(ks,{children:[e.jsx(Cs,{className:"flex items-center gap-2",children:n?e.jsxs(e.Fragment,{children:[e.jsx(re,{className:"h-5 w-5 text-green-600"}),"Regeneration Complete"]}):e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"h-5 w-5 animate-spin text-blue-600"}),"Regenerating Analyses"]})}),e.jsx(lt,{children:n?t>0?`Completed with ${t} ${t===1?"error":"errors"}`:"All analyses have been regenerated successfully":`Regenerating ${r} ${r===1?"analysis":"analyses"}. Please wait...`})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"font-medium",children:"Overall Progress"}),e.jsxs("span",{className:"text-muted-foreground",children:[a+t," / ",r]})]}),e.jsx(de,{value:c,className:"h-2"})]}),e.jsx(zt,{className:"h-[400px] pr-4",children:e.jsx("div",{className:"space-y-2",children:i.map(g=>{const h=Dt(g.analysisType);return e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-card","data-testid":`regeneration-progress-${g.analysisType}`,children:[e.jsx("div",{className:"mt-1",children:d(g.status)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-lg",children:h.icon}),e.jsx("span",{className:"font-medium",children:h.name})]}),o(g.status)]}),g.error&&e.jsx("p",{className:"text-sm text-red-600 mt-1",children:g.error})]})]},g.analysisType)})})}),n&&e.jsx("div",{className:"bg-muted/50 p-4 rounded-lg",children:e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Summary"}),e.jsxs("div",{className:"flex items-center gap-4",children:[a>0&&e.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[e.jsx(re,{className:"h-4 w-4"}),e.jsxs("span",{children:[a," completed"]})]}),t>0&&e.jsxs("div",{className:"flex items-center gap-1 text-red-600",children:[e.jsx(rt,{className:"h-4 w-4"}),e.jsxs("span",{children:[t," failed"]})]})]})]})})]})]})})}function Ir(s){const i=Kl(s),l=Vl(i),a=i.reduce((t,r)=>{const c=Dt(r).phase;return t[c]||(t[c]=[]),t[c].push(r),t},{});return{section:s,affectedAnalyses:i,totalEstimatedSeconds:l,formattedTime:Hl(l),analysesByPhase:a}}function Ql(s,i){return{"thinking-hats":`/api/idea-prioritization/${i}/thinking-hats`,"business-model-canvas":`/api/idea-prioritization/${i}/business-model-canvas`,"lean-canvas":`/api/idea-prioritization/${i}/lean-canvas`,"value-proposition-canvas":`/api/idea-prioritization/${i}/value-proposition-canvas`,personas:`/api/idea-prioritization/${i}/personas`,"market-viability":`/api/idea-prioritization/${i}/market-viability`,"competitive-landscape":`/api/idea-prioritization/${i}/competitive-landscape`,"execution-readiness":`/api/idea-prioritization/${i}/execution-readiness`,"social-validation":`/api/idea-prioritization/${i}/social-validation`,"expert-validation":`/api/idea-prioritization/${i}/expert-validation`,"opportunity-assessment":`/api/idea-prioritization/${i}/opportunity-assessment/generate`,"jtbd-analysis":`/api/idea-prioritization/${i}/jtbd-analysis/generate`,"assumption-mapping":`/api/idea-prioritization/${i}/assumption-mapping/generate`,"kano-analysis":`/api/idea-prioritization/${i}/kano-analysis/generate`,"customer-journey-map":`/api/idea-prioritization/${i}/customer-journey-map/generate`,"empathy-map":`/api/idea-prioritization/${i}/empathy-map/generate`,"five-whys-analysis":`/api/idea-prioritization/${i}/five-whys-analysis/generate`,"problem-solution-fit":`/api/idea-prioritization/${i}/problem-solution-fit/generate`,"feature-impact-matrix":`/api/idea-prioritization/${i}/feature-impact-matrix/generate`,"heart-framework":`/api/idea-prioritization/${i}/heart-framework/generate`,"execution-plan":`/api/idea-prioritization/${i}/execution-plan/generate`}[s]}function Jl(s,i){return{"thinking-hats":[`/api/idea-prioritization/${i}`],"business-model-canvas":[`/api/idea-prioritization/${i}/business-model-canvas`],"lean-canvas":[`/api/idea-prioritization/${i}/lean-canvas`],"value-proposition-canvas":[`/api/idea-prioritization/${i}/value-proposition-canvas`],personas:[`/api/idea-prioritization/${i}/personas`],"market-viability":[`/api/idea-prioritization/${i}/market-viability`],"competitive-landscape":[`/api/idea-prioritization/${i}
196/competitive-landscape`],"execution-readiness":[`/api/idea-prioritization/${i}/execution-readiness`],"social-validation":[`/api/idea-prioritization/${i}/social-validation`],"expert-validation":[`/api/idea-prioritization/${i}/expert-validation`],"opportunity-assessment":[`/api/idea-prioritization/${i}/opportunity-assessment`],"jtbd-analysis":[`/api/idea-prioritization/${i}/jtbd-analysis`],"assumption-mapping":[`/api/idea-prioritization/${i}/assumption-mapping`],"kano-analysis":[`/api/idea-prioritization/${i}/kano-analysis`],"customer-journey-map":[`/api/idea-prioritization/${i}/customer-journey-map`],"empathy-map":[`/api/idea-prioritization/${i}/empathy-map`],"five-whys-analysis":[`/api/idea-prioritization/${i}/five-whys-analysis`],"problem-solution-fit":[`/api/idea-prioritization/${i}/problem-solution-fit`],"feature-impact-matrix":[`/api/idea-prioritization/${i}/feature-impact-matrix`],"heart-framework":[`/api/idea-prioritization/${i}/heart-framework`],"execution-plan":[`/api/idea-prioritization/${i}/execution-plan`]}[s]}function Wl({ideaId:s,onComplete:i,onError:l}){const[a,t]=D.useState([]),[r,c]=D.useState(!1),n=D.useCallback((h,f,b)=>{t(y=>y.map(S=>S.analysisType===h?{...S,status:f,error:b}:S))},[]),d=async h=>{const f=Ql(h,s),b=Jl(h,s);try{n(h,"running"),await Q({method:"POST",url:f,data:{}}),await L.invalidateQueries({queryKey:b}),n(h,"completed")}catch(y){const S=y?.message||"Failed to regenerate";throw n(h,"failed",S),y}},o=D.useCallback(async h=>{if(r){console.warn("Regeneration already in progress");return}const f=h.map(b=>({analysisType:b,status:"pending"}));t(f),c(!0);try{const b=["market-viability","competitive-landscape","execution-readiness","social-validation","expert-validation"].filter(w=>h.includes(w)),y=h.includes("opportunity-assessment"),S=h.filter(w=>!b.includes(w)&&w!=="opportunity-assessment");b.length>0&&await Promise.allSettled(b.map(w=>d(w))),y&&await d("opportunity-assessment"),S.length>0&&await Promise.allSettled(S.map(w=>d(w)));const N=f.map(w=>a.find(C=>C.analysisType===w.analysisType)||w);i?.(N)}catch(b){l?.(b)}finally{c(!1)}},[s,r,a,i,l,n]),g=D.useCallback(()=>{t([]),c(!1)},[]);return{items:a,isRunning:r,regenerateBatch:o,reset:g}}const Yl=Ia({interviewDate:ze(),intervieweeRole:ze().optional(),intervieweeName:ze().optional(),intervieweeCompany:ze().optional(),interviewMethod:Yr(["in-person","video-call","phone","email"]).optional(),durationMinutes:wn().optional(),summary:ze().optional(),problemValidated:er().optional(),willingToPay:er().optional(),estimatedValue:ze().optional()});function Xl({ideaSyntheticId:s,onSuccess:i}){const{toast:l}=Ys(),[a,t]=D.useState(!1),[r,c]=D.useState([]),[n,d]=D.useState([]),[o,g]=D.useState([]),[h,f]=D.useState([]),[b,y]=D.useState(""),[S,N]=D.useState(""),[w,P]=D.useState(""),[C,v]=D.useState(""),T=Ma({resolver:Ra(Yl),defaultValues:{interviewDate:new Date().toISOString().split("T")[0],problemValidated:!1,willingToPay:!1}}),$=W({mutationFn:async k=>await Q({url:`/api/idea-prioritization/${s}/customer-interviews`,method:"POST",data:k}),onSuccess:()=>{L.invalidateQueries({queryKey:["/api/idea-prioritization",s,"customer-interviews"]}),l({title:"Interview Recorded",description:"Customer interview has been successfully saved."}),t(!1),T.reset(),c([]),d([]),g([]),f([]),i?.()},onError:k=>{l({title:"Error",description:k.message||"Failed to save customer interview",variant:"destructive"})}}),A=k=>{const E={...k,keyInsights:r,quotes:n,painPoints:o,jobs:h};$.mutate(E)},z=(k,E,B,q)=>{k.trim()&&(E([...B,k.trim()]),q())},F=(k,E,B)=>{E(B.filter((q,H)=>H!==k))};return e.jsxs(ys,{open:a,onOpenChange:t,children:[e.jsx($a,{asChild:!0,children:e.jsxs(R,{className:"rounded-full","data-testid":"button-add-interview",children:[e.jsx(Qi,{className:"h-4 w-4 mr-2"}),"Log Customer Interview"]})}),e.jsxs(ws,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(ks,{children:[e.jsx(Cs,{children:"Log Customer Interview"}),e.jsx(lt,{children:"Record insights from your customer conversation to track problem validation."})]}),e.jsx(Fa,{...T,children:e.jsxs("form",{onSubmit:T.handleSubmit(A),className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(pe,{control:T.control,name:"interviewDate",render:({field:k})=>e.jsxs(ge,{children:[e.jsx(ce,{children:"Interview Date"}),e.jsx(je,{children:e.jsx(ke,{type:"date",...k,"data-testid":"input-interview-date",className:"rounded-xl"})}),e.jsx(ve,{})]})}),e.jsx(pe,{control:T.control,name:"interviewMethod",render:({field:k})=>e.jsxs(ge,{children:[e.jsx(ce,{children:"Interview Method"}),e.jsxs(Xr,{onValueChange:k.onChange,value:k.value,children:[e.jsx(je,{children:e.jsx(Zr,{className:"rounded-xl","data-testid":"select-interview-method",children:e.jsx(ei,{placeholder:"Select method"})})}),e.jsxs(si,{children:[e.jsx(Us,{value:"in-person",children:"In-Person"}),e.jsx(Us,{value:"video-call",children:"Video Call"}),e.jsx(Us,{value:"phone",children:"Phone"}),e.jsx(Us,{value:"email",children:"Email"})]})]}),e.jsx(ve,{})]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(pe,{control:T.control,name:"intervieweeName",render:({field:k})=>e.jsxs(ge,{children:[e.jsx(ce,{children:"Interviewee Name (Optional)"}),e.jsx(je,{children:e.jsx(ke,{...k,placeholder:"John Doe",className:"rounded-xl","data-testid":"input-interviewee-name"})}),e.jsx(ve,{})]})}),e.jsx(pe,{control:T.control,name:"intervieweeRole",render:({field:k})=>e.jsxs(ge,{children:[e.jsx(ce,{children:"Role/Title"}),e.jsx(je,{children:e.jsx(ke,{...k,placeholder:"e.g., Product Manager",className:"rounded-xl","data-testid":"input-interviewee-role"})}),e.jsx(ve,{})]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(pe,{control:T.control,name:"intervieweeCompany",render:({field:k})=>e.jsxs(ge,{children:[e.jsx(ce,{children:"Company (Optional)"}),e.jsx(je,{children:e.jsx(ke,{...k,placeholder:"Acme Corp",className:"rounded-xl","data-testid":"input-interviewee-company"})}),e.jsx(ve,{})]})}),e.jsx(pe,{control:T.control,name:"durationMinutes",render:({field:k})=>e.jsxs(ge,{children:[e.jsx(ce,{children:"Duration (minutes)"}),e.jsx(je,{children:e.jsx(ke,{type:"number",...k,placeholder:"30",className:"rounded-xl","data-testid":"input-duration"})}),e.jsx(ve,{})]})})]}),e.jsx(pe,{control:T.control,name:"summary",render:({field:k})=>e.jsxs(ge,{children:[e.jsx(ce,{children:"Interview Summary"}),e.jsx(je,{children:e.jsx(it,{...k,placeholder:"Overall summary of the conversation...",rows:3,className:"rounded-xl","data-testid":"textarea-summary"})}),e.jsx(ve,{})]})}),e.jsxs("div",{children:[e.jsx(ce,{children:"Key Insights"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(ke,{value:b,onChange:k=>y(k.target.value),placeholder:"Add a key insight...",onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),z(b,c,r,()=>y("")))},className:"rounded-xl","data-testid":"input-key-insight"}),e.jsx(R,{type:"button",size:"sm",onClick:()=>z(b,c,r,()=>y("")),className:"rounded-full","data-testid":"button-add-insight",children:"Add"})]}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:r.map((k,E)=>e.jsxs(I,{variant:"secondary",className:"pr-1",children:[k,e.jsx("button",{type:"button",onClick:()=>F(E,c,r),className:"ml-1 hover:text-destructive","data-testid":`button-remove-insight-${E}`,children:e.jsx(gs,{className:"h-3 w-3"})})]},E))})]}),e.jsxs("div",{children:[e.jsx(ce,{children:"Direct Quotes"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(ke,{value:S,onChange:k=>N(k.target.value),placeholder:"Add a memorable quote...",onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),z(S,d,n,()=>N("")))},className:"rounded-xl","data-testid":"input-quote"}),e.jsx(R,{type:"button",size:"sm",onClick:()=>z(S,d,n,()=>N("")),className:"rounded-full","data-testid":"button-add-quote",children:"Add"})]}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:n.map((k,E)=>e.jsxs(I,{variant:"secondary",className:"pr-1",children:['"',k,'"',e.jsx("button",{type:"button",onClick:()=>F(E,d,n),className:"ml-1 hover:text-destructive","data-testid":`button-remove-quote-${E}`,children:e.jsx(gs,{className:"h-3 w-3"})})]},E))})]}),e.jsxs("div",{children:[e.jsx(ce,{children:"Pain Points Discovered"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(ke,{value:w,onChange:k=>P(k.target.value),placeholder:"Add a pain point...",onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),z(w,g,o,()=>P("")))},className:"rounded-xl","data-testid":"input-pain-point"}),e.jsx(R,{type:"button",size:"sm",onClick:()=>z(w,g,o,()=>P("")),className:"rounded-full","data-testid":"button-add-pain-point",children:"Add"})]}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:o.map((k,E)=>e.jsxs(I,{variant:"secondary",className:"pr-1",children:[k,e.jsx("button",{type:"button",onClick:()=>F(E,g,o),className:"ml-1 hover:text-destructive","data-testid":`button-remove-pain-point-${E}`,children:e.jsx(gs,{className:"h-3 w-3"})})]},E))})]}
196),e.jsxs("div",{children:[e.jsx(ce,{children:"Jobs-to-be-Done"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(ke,{value:C,onChange:k=>v(k.target.value),placeholder:"Add a job they're trying to accomplish...",onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),z(C,f,h,()=>v("")))},className:"rounded-xl","data-testid":"input-job"}),e.jsx(R,{type:"button",size:"sm",onClick:()=>z(C,f,h,()=>v("")),className:"rounded-full","data-testid":"button-add-job",children:"Add"})]}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:h.map((k,E)=>e.jsxs(I,{variant:"secondary",className:"pr-1",children:[k,e.jsx("button",{type:"button",onClick:()=>F(E,f,h),className:"ml-1 hover:text-destructive","data-testid":`button-remove-job-${E}`,children:e.jsx(gs,{className:"h-3 w-3"})})]},E))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(pe,{control:T.control,name:"problemValidated",render:({field:k})=>e.jsxs(ge,{className:"flex flex-row items-start space-x-3 space-y-0",children:[e.jsx(je,{children:e.jsx(It,{checked:k.value,onCheckedChange:k.onChange,"data-testid":"checkbox-problem-validated"})}),e.jsxs("div",{className:"space-y-1 leading-none",children:[e.jsx(ce,{children:"Problem Validated"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This interview validated the problem exists"})]})]})}),e.jsx(pe,{control:T.control,name:"willingToPay",render:({field:k})=>e.jsxs(ge,{className:"flex flex-row items-start space-x-3 space-y-0",children:[e.jsx(je,{children:e.jsx(It,{checked:k.value,onCheckedChange:k.onChange,"data-testid":"checkbox-willing-to-pay"})}),e.jsxs("div",{className:"space-y-1 leading-none",children:[e.jsx(ce,{children:"Willing to Pay"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Customer indicated willingness to pay for a solution"})]})]})}),e.jsx(pe,{control:T.control,name:"estimatedValue",render:({field:k})=>e.jsxs(ge,{children:[e.jsx(ce,{children:"Estimated Value (Optional)"}),e.jsx(je,{children:e.jsx(ke,{...k,placeholder:"e.g., $50/month, $1000/year",className:"rounded-xl","data-testid":"input-estimated-value"})}),e.jsx(ve,{})]})})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[e.jsx(R,{type:"button",variant:"outline",onClick:()=>t(!1),className:"rounded-full","data-testid":"button-cancel",children:"Cancel"}),e.jsx(R,{type:"submit",disabled:$.isPending,className:"rounded-full","data-testid":"button-submit-interview",children:$.isPending?"Saving...":"Save Interview"})]})]})})]})]})}function Zl({ideaSyntheticId:s}){const{data:i,isLoading:l}=ee({queryKey:["/api/idea-prioritization",s,"customer-interviews"],queryFn:async()=>{const t=await fetch(nn(`/api/idea-prioritization/${s}/customer-interviews`));if(!t.ok)throw new Error("Failed to fetch interviews");return t.json()}}),a=i?.data||[];return l?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(t=>e.jsxs(m,{className:"animate-pulse",children:[e.jsx(u,{children:e.jsx("div",{className:"h-6 bg-muted rounded w-1/3"})}),e.jsxs(x,{children:[e.jsx("div",{className:"h-4 bg-muted rounded w-full mb-2"}),e.jsx("div",{className:"h-4 bg-muted rounded w-2/3"})]})]},t))}):a.length===0?e.jsx(m,{className:"border-2 border-dashed",children:e.jsx(x,{className:"py-12",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Js,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"No Interviews Yet"}),e.jsx("p",{className:"text-sm text-foreground max-w-md mx-auto",children:"Start logging customer conversations to validate your problem hypothesis. Talk to at least 30-50 potential customers to identify patterns."})]})})}):e.jsx("div",{className:"space-y-4","data-testid":"interview-list",children:a.map(t=>e.jsxs(m,{className:"hover:shadow-lg transition-shadow","data-testid":`interview-card-${t.id}`,children:[e.jsxs(u,{children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(p,{className:"text-lg",children:t.intervieweeName||"Anonymous Interview"}),e.jsxs("div",{className:"flex gap-2",children:[t.problemValidated&&e.jsxs(I,{variant:"default",className:"bg-green-500",children:[e.jsx(ds,{className:"h-3 w-3 mr-1"}),"Validated"]}),t.willingToPay&&e.jsxs(I,{variant:"default",className:"bg-blue-500",children:[e.jsx(le,{className:"h-3 w-3 mr-1"}),"WTP"]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-foreground mt-2",children:[t.interviewDate&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(bs,{className:"h-4 w-4"}),ka(new Date(t.interviewDate),"MMM dd, yyyy")]}),t.intervieweeRole&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx($t,{className:"h-4 w-4"}),t.intervieweeRole]}),t.intervieweeCompany&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(_s,{className:"h-4 w-4"}),t.intervieweeCompany]}),t.durationMinutes&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-4 w-4"}),t.durationMinutes," min"]})]})]}),e.jsxs(x,{className:"space-y-4",children:[t.summary&&e.jsx("div",{children:e.jsx("p",{className:"text-sm text-foreground",children:t.summary})}),t.keyInsights&&t.keyInsights.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-2 text-foreground",children:"Key Insights"}),e.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm text-foreground",children:t.keyInsights.map((r,c)=>e.jsx("li",{children:r},c))})]}),t.quotes&&t.quotes.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-2 text-foreground",children:"Quotes"}),e.jsx("div",{className:"space-y-2",children:t.quotes.map((r,c)=>e.jsxs("blockquote",{className:"border-l-4 border-blue-500 pl-4 italic text-sm text-foreground",children:['"',r,'"']},c))})]}),t.painPoints&&t.painPoints.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-2 text-foreground",children:"Pain Points"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.painPoints.map((r,c)=>e.jsx(I,{variant:"destructive",className:"text-xs",children:r},c))})]}),t.jobs&&t.jobs.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold mb-2 text-foreground",children:"Jobs-to-be-
196Done"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.jobs.map((r,c)=>e.jsx(I,{variant:"secondary",className:"text-xs",children:r},c))})]}),t.estimatedValue&&e.jsx("div",{className:"bg-green-50 p-3 rounded-lg",children:e.jsxs("p",{className:"text-sm text-green-900",children:[e.jsx("strong",{children:"Estimated Value:"})," ",t.estimatedValue]})})]})]},t.id))})}const Ca={analytical:{name:"Analytical",color:"bg-blue-500",lightBg:"bg-blue-50",textColor:"text-blue-600",borderColor:"border-blue-500",badgeClass:"bg-blue-100 text-blue-800 border-blue-300",icon:Aa},positive:{name:"Positive",color:"bg-green-500",lightBg:"bg-green-50",textColor:"text-green-600",borderColor:"border-green-500",badgeClass:"bg-green-100 text-green-800 border-green-300",icon:ds},creative:{name:"Creative",color:"bg-purple-500",lightBg:"bg-purple-50",textColor:"text-purple-600",borderColor:"border-purple-500",badgeClass:"bg-purple-100 text-purple-800 border-purple-300",icon:he},critical:{name:"Critical",color:"bg-red-500",lightBg:"bg-red-50",textColor:"text-red-600",borderColor:"border-red-500",badgeClass:"bg-red-100 text-red-800 border-red-300",icon:X},process:{name:"Process",color:"bg-orange-500",lightBg:"bg-orange-50",textColor:"text-orange-600",borderColor:"border-orange-500",badgeClass:"bg-orange-100 text-orange-800 border-orange-300",icon:se}};function ed(s){return{"information-gatherer":"analytical",business:"analytical",feasibility:"analytical",user:"analytical",optimist:"positive","yes-and":"positive",empathy:"positive","big-picture":"positive",creativity:"creative","emotional-explorer":"creative",brainstormer:"creative",why:"creative","opposing-thought":"creative","cautious-critic":"critical",skeptic:"critical",dystopian:"critical",crook:"critical",judgment:"critical",process:"process",convergence:"process",optimizer:"process"}[s]||"analytical"}function xi(s){return s>=80?"text-green-600":s>=60?"text-blue-600":s>=40?"text-yellow-600":"text-red-600"}function sd(s){return s>=80?"bg-green-100":s>=60?"bg-blue-100":s>=40?"bg-yellow-100":"bg-red-100"}function ba(s){return s>=60?"positive":s>=40?"neutral":"negative"}function td(s){return s>=90?{text:"Implement Immediately",color:"text-green-700",bgColor:"bg-green-100 border-green-300",icon:"🚀"}:s>=80?{text:"Prioritize",color:"text-green-600",bgColor:"bg-green-50 border-green-200",icon:"⭐"}:s>=70?{text:"Recommended",color:"text-blue-600",bgColor:"bg-blue-50 border-blue-200",icon:"👍"}:s>=60?{text:"Re-evaluate",color:"text-yellow-600",bgColor:"bg-yellow-50 border-yellow-200",icon:"🔄"}:s>=50?{text:"Cautious",color:"text-orange-600",bgColor:"bg-orange-50 border-orange-200",icon:"⚠️"}:s>=40?{text:"Defer",color:"text-red-600",bgColor:"bg-red-50 border-red-200",icon:"⏸️"}:{text:"Not Recommended",color:"text-red-700",bgColor:"bg-red-100 border-red-300",icon:"❌"}}const wt=s=>typeof s=="string"?s:typeof s=="object"&&s!==null?s.title||s.description||s.text||s.content||s.strength||s.rationale||JSON.stringify(s):String(s);function ad({analysis:s,category:i}){return e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4},whileHover:{scale:1.01,y:-2},children:e.jsxs(m,{className:`border ${i?.borderColor||"border-border"} ${i?.lightBg||"bg-muted/50"} transition-shadow hover:shadow-lg`,children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:"flex-1",children:e.jsxs(p,{className:"text-xl flex items-center gap-2 mb-2",children:[e.jsx("div",{className:`p-2 rounded-lg ${i?.color||"bg-gray-500"} text-white`,children:e.jsx(Aa,{className:"h-5 w-5"})}),s.hatName]})}),e.jsxs("div",{className:"flex flex-col items-end gap-2",children:[e.jsx(I,{variant:ba(s.score)==="positive"?"default":ba(s.score)==="negative"?"destructive":"secondary",className:"uppercase",children:ba(s.score)}),e.jsxs("div",{className:`text-2xl font-bold ${xi(s.score)} ${sd(s.score)} px-3 py-1 rounded-lg`,children:[s.score,e.jsx("span",{className:"text-sm text-muted-foreground",children:"/100"})]})]})]})}),e.jsxs(x,{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white p-4 rounded-lg border",children:[e.jsx("h5",{className:"font-semibold mb-2 text-foreground",children:"Analysis"}),e.jsx("p",{className:"text-foreground leading-relaxed whitespace-pre-line",children:s.analysis})]}),s.keyPoints&&s.keyPoints.length>0&&e.jsxs("div",{className:"bg-white p-4 rounded-lg border",children:[e.jsxs("h5",{className:"font-semibold mb-3 flex items-center gap-2 text-foreground",children:[e.jsx(V,{className:"h-4 w-4"}),"Key Points"]}),e.jsx("ul",{className:"space-y-2",children:s.keyPoints.map((l,a)=>e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{className:`font-bold ${i?.textColor||"text-foreground"}`,children:"•"}),e.jsx("span",{className:"text-foreground",children:wt(l)})]},a))})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[s.recommendations&&s.recommendations.length>0&&e.jsxs("div",{className:"bg-green-50 p-4 rounded-lg border border-green-200",children:[e.jsxs("h5",{className:"font-semibold text-green-700 mb-3 flex items-center gap-2",children:[e.jsx(nt,{className:"h-4 w-4"}),"Recommendations"]}),e.jsx("ul",{className:"space-y-2",children:s.recommendations.map((l,a)=>e.jsxs("li",{className:"flex gap-2 text-sm",children:[e.jsx(ds,{className:"h-4 w-4 text-green-600 shrink-0 mt-0.5"}),e.jsx("span",{className:"text-foreground",children:wt(l)})]},a))})]}),s.concerns&&s.concerns.length>0&&e.jsxs("div",{className:"bg-red-50 p-4 rounded-lg border border-red-200",children:[e.jsxs("h5",{className:"font-semibold text-red-700 mb-3 flex items-center gap-2",children:[e.jsx(X,{className:"h-4 w-4"}),"Concerns"]}),e.jsx("ul",{className:"space-y-2",children:s.concerns.map((l,a)=>e.jsxs("li",{className:"flex gap-2 text-sm",children:[e.jsx(me,{className:"h-4 w-4 text-red-600 shrink-0 mt-0.5"}),e.jsx("span",{className:"text-foreground",children:wt(l)})]},a))})]})]}),s.questions&&s.questions.length>0&&e.jsxs("div",{className:"bg-blue-50 p-4 rounded-lg border border-blue-200",children:[e.jsxs("h5",{className:"font-semibold text-blue-700 mb-3 flex items-center gap-2",children:[e.jsx(Gr,{className:"h-4 w-4"}),"Questions to Consider"]}),e.jsx("ul",{className:"space-y-2",children:s.questions.map((l,a)=>e.jsxs("li",{className:"flex gap-2 text-sm",children:[e.jsx("span",{className:"text-blue-600 font-bold shrink-0",children:"?"}),e.jsx("span",{className:"text-foreground",children:wt(l)})]},a))})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-3 w-3"}),Math.round(s.processingTime/1e3),"s"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ie,{className:"h-3 w-3"}),"AI Analysis"]})]})]})]})})}
196function rd({analyses:s,category:i,showNavInTop:l=!1}){const[a,t]=Ji({loop:!1,align:"start",skipSnaps:!1}),[r,c]=D.useState(!1),[n,d]=D.useState(!1),[o,g]=D.useState(0),h=D.useCallback(()=>t&&t.scrollPrev(),[t]),f=D.useCallback(()=>t&&t.scrollNext(),[t]),b=D.useCallback(()=>{t&&(g(t.selectedScrollSnap()),c(t.canScrollPrev()),d(t.canScrollNext()))},[t]);D.useEffect(()=>{t&&(b(),t.on("select",b),t.on("reInit",b))},[t,b]);const y=s.length>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(R,{variant:"outline",size:"sm",onClick:h,disabled:!r,className:"rounded-full h-8 w-8 p-0","data-testid":"button-carousel-prev",children:e.jsx(Wi,{className:"h-3 w-3"})}),e.jsx("div",{className:"flex items-center gap-1.5",children:s.map((S,N)=>e.jsx("button",{className:`h-1.5 rounded-full transition-all ${N===o?`w-6 ${i.color}`:"w-1.5 bg-muted"}`,onClick:()=>t&&t.scrollTo(N),"aria-label":`Go to slide ${N+1}`},N))}),e.jsx(R,{variant:"outline",size:"sm",onClick:f,disabled:!n,className:"rounded-full h-8 w-8 p-0","data-testid":"button-carousel-next",children:e.jsx(Ce,{className:"h-3 w-3"})}),e.jsxs("span",{className:"text-xs text-muted-foreground ml-1",children:[o+1,"/",s.length]})]});return e.jsxs("div",{className:"relative",children:[l&&e.jsx("div",{className:"flex justify-end mb-3",children:y}),e.jsx("div",{className:"overflow-hidden",ref:a,children:e.jsx("div",{className:"flex gap-4",children:s.map(S=>e.jsx("div",{className:"flex-[0_0_100%] min-w-0",children:e.jsx(ad,{analysis:S,category:i})},S.id))})})]})}function id({analysesByCategory:s}){const[i,l]=D.useState(Object.keys(s)[0]);return e.jsxs(ye,{value:i,onValueChange:l,className:"w-full",children:[e.jsx("div",{className:"flex items-center gap-3 mb-4 flex-wrap",children:e.jsx(we,{className:"flex-1 grid grid-cols-2 md:grid-cols-5 gap-2",children:Object.entries(Ca).map(([a,t])=>{const r=s[a]?.length||0;return e.jsxs(K,{value:a,className:"relative",children:[e.jsx("span",{children:t.name}),r>0&&e.jsx(I,{className:"ml-2 h-5 w-5 p-0 flex items-center justify-center uppercase",variant:"secondary",children:r})]},a)})})}),Object.entries(Ca).map(([a,t])=>e.jsx(U,{value:a,className:"mt-4",children:s[a]?.length>0?e.jsx(rd,{analyses:s[a],category:t,showNavInTop:!0}):e.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No analyses in this category yet."})},a))]})}function nd({ranking:s}){const i=td(s.overallScore);return e.jsxs("div",{className:"text-center py-4 bg-gradient-to-br from-blue-50 to-indigo-50 rounded-xl",children:[e.jsx("div",{className:"text-sm font-medium text-foreground mb-2",children:"OVERALL SCORE"}),e.jsxs("div",{className:`text-6xl md:text-7xl font-bold mb-4 ${xi(s.overallScore)}`,children:[s.overallScore,e.jsx("span",{className:"text-3xl text-muted-foreground",children:"/100"})]}),e.jsxs("div",{className:`inline-flex items-center gap-3 px-8 py-4 rounded-2xl border ${i.bgColor} mt-4 mb-6`,children:[e.jsx("span",{className:"text-3xl",children:i.icon}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"text-xs font-medium text-foreground uppercase tracking-wide",children:"Recommendation"}),e.jsx("div",{className:`text-xl font-bold ${i.color}`,children:i.text})]})]}),e.jsxs("div",{className:"border-t pt-4 mt-4",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-3",children:"Calculated from:"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:`text-2xl font-bold ${s.desirabilityScore>0?"text-pink-600":"text-muted-foreground"}`,children:s.desirabilityScore>0?e.jsxs(e.Fragment,{children:[s.desirabilityScore,e.jsx("span",{className:"text-sm text-muted-foreground",children:"/100"})]}):e.jsx("span",{className:"text-sm",children:"—"})}),e.jsx("div",{className:"text-xs text-foreground",children:"Desirability"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:`text-2xl font-bold ${s.usabilityScore>0?"text-blue-600":"text-muted-foreground"}`,children:s.usabilityScore>0?e.jsxs(e.Fragment,{children:[s.usabilityScore,e.jsx("span",{className:"text-sm text-muted-foreground",children:"/100"})]}):e.jsx("span",{className:"text-sm",children:"—"})}),e.jsx("div",{className:"text-xs text-foreground",children:"Usability"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:`text-2xl font-bold ${s.feasibilityScore>0?"text-green-600":"text-muted-foreground"}`,children:s.feasibilityScore>0?e.jsxs(e.Fragment,{children:[s.feasibilityScore,e.jsx("span",{className:"text-sm text-muted-foreground",children:"/100"})]}):e.jsx("span",{className:"text-sm",children:"—"})}),e.jsx("div",{className:"text-xs text-foreground",children:"Feasibility"})]})]})]}),e.jsxs("div",{className:"border-t pt-4 mt-4",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-3",children:"Recommendation Scale"}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-green-100",children:[e.jsx("span",{className:"text-sm",children:"🚀"}),e.jsx("span",{className:"text-xs font-medium text-green-700",children:"90+"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-green-50",children:[e.jsx("span",{className:"text-sm",children:"⭐"}),e.jsx("span",{className:"text-xs font-medium text-green-600",children:"80-89"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-blue-50",children:[e.jsx("span",{className:"text-sm",children:"👍"}),e.jsx("span",{className:"text-xs font-medium text-blue-600",children:"70-79"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-yellow-50",children:[e.jsx("span",{className:"text-sm",children:"🔄"}),e.jsx("span",{className:"text-xs font-medium text-yellow-600",children:"60-69"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-orange-50",children:[e.jsx("span",{className:"text-sm",children:"⚠️"}),e.jsx("span",{className:"text-xs font-medium text-orange-600",children:"50-59"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-red-50",children:[e.jsx("span",{className:"text-sm",children:"⏸️"}),e.jsx("span",{className:"text-xs font-medium text-red-600",children:"40-49"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-red-100",children:[e.jsx("span",{className:"text-sm",children:"❌"}),e.jsx("span",{className:"text-xs font-medium text-red-700",children:"<40"})]})]})]})]})}function ld({ranking:s,analysesByCategory:i}){return e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-bold mb-3 flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4"}),"Thinking Hats Category Scores"]}),e.jsx("div",{className:"grid grid-cols-1 gap-3",children:Object.entries(Ca).map(([l,a],t)=>{if(!a||!a.borderColor)return null;const r=s[`${l}Score`]||0,c=a.icon,n=i[l]?.length||0,d=r>0;return e.jsx(Y.div,{className:`${a.lightBg||"bg-muted/50"} p-3 rounded-lg border ${a.borderColor||"border-border"} cursor-pointer transition-all ${d?"":"opacity-60"}`,initial:{opacity:0,scale:.8},whileInView:{opacity:1,scale:1},viewport:{once:!0},transition:{duration:.4,delay:t*.1},whileHover:{scale:1.02,y:-2},children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`inline-flex p-2 rounded ${a.color||"bg-gray-500"} text-white`,children:c&&e.jsx(c,{className:"h-5 w-5"})}),e.jsx(Y.div,{className:`text-2xl font-bold ${d?a.textColor||"text-foreground":"text-muted-foreground"}`,initial:{opacity:0}
196,whileInView:{opacity:1},viewport:{once:!0},transition:{duration:.6,delay:t*.1+.2},children:d?e.jsxs(e.Fragment,{children:[r,e.jsx("span",{className:"text-sm text-muted-foreground",children:"/100"})]}):e.jsx("span",{className:"text-sm",children:"No data"})}),e.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[e.jsx("div",{className:"text-base font-semibold text-foreground",children:a.name||l}),e.jsxs(I,{variant:"secondary",className:"text-xs uppercase",children:[n," Hat",n!==1?"s":""]})]})]})},l)})})]})}function kt(s){return typeof s=="string"?s:typeof s=="object"&&s!==null?s.strength||s.weakness||s.opportunity||s.risk||s.title||s.description||s.rationale||s.text||s.content||JSON.stringify(s):String(s)}function dd({ranking:s}){return e.jsxs("div",{children:[e.jsxs("h3",{className:"text-2xl font-bold mb-2 flex items-center gap-2",children:[e.jsx(Ke,{className:"h-6 w-6"}),"SWOT Analysis"]}),e.jsx("p",{className:"text-foreground mb-4",children:"Comprehensive strengths, weaknesses, opportunities, and risks"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsx(Y.div,{initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.5},whileHover:{scale:1.02},children:e.jsxs(m,{className:"border border-green-200 bg-green-50 h-full",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-lg flex items-center gap-2 text-green-700",children:[e.jsx(nt,{className:"h-5 w-5"}),"Strengths"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:s.strengths?.slice(0,5).map((i,l)=>e.jsxs(Y.li,{className:"flex gap-2 text-sm",initial:{opacity:0,x:-10},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.3,delay:l*.1},children:[e.jsx(ds,{className:"h-4 w-4 text-green-600 shrink-0 mt-0.5"}),e.jsx("span",{children:kt(i)})]},l))})})]})}),e.jsx(Y.div,{initial:{opacity:0,x:20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.5},whileHover:{scale:1.02},children:e.jsxs(m,{className:"border border-red-200 bg-red-50 h-full",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-lg flex items-center gap-2 text-red-700",children:[e.jsx(Lr,{className:"h-5 w-5"}),"Weaknesses"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:s.weaknesses?.slice(0,5).map((i,l)=>e.jsxs(Y.li,{className:"flex gap-2 text-sm",initial:{opacity:0,x:-10},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.3,delay:l*.1},children:[e.jsx(X,{className:"h-4 w-4 text-red-600 shrink-0 mt-0.5"}),e.jsx("span",{children:kt(i)})]},l))})})]})}),e.jsx(Y.div,{initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.5,delay:.1},whileHover:{scale:1.02},children:e.jsxs(m,{className:"border border-blue-200 bg-blue-50 h-full",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-lg flex items-center gap-2 text-blue-700",children:[e.jsx(ie,{className:"h-5 w-5"}),"Opportunities"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:s.opportunities?.slice(0,5).map((i,l)=>e.jsxs(Y.li,{className:"flex gap-2 text-sm",initial:{opacity:0,x:-10},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.3,delay:l*.1},children:[e.jsx(xe,{className:"h-4 w-4 text-blue-600 shrink-0 mt-0.5"}),e.jsx("span",{children:kt(i)})]},l))})})]})}),e.jsx(Y.div,{initial:{opacity:0,x:20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.5,delay:.1},whileHover:{scale:1.02},children:e.jsxs(m,{className:"border border-orange-200 bg-orange-50 h-full",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-lg flex items-center gap-2 text-orange-700",children:[e.jsx(X,{className:"h-5 w-5"}),"Risks"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2",children:s.risks?.slice(0,5).map((i,l)=>e.jsxs(Y.li,{className:"flex gap-2 text-sm",initial:{opacity:0,x:-10},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.3,delay:l*.1},children:[e.jsx(me,{className:"h-4 w-4 text-orange-600 shrink-0 mt-0.5"}),e.jsx("span",{children:kt(i)})]},l))})})]})})]})]})}function cd(s){return typeof s=="string"?s:typeof s=="object"&&s!==null?s.title||s.description||s.text||JSON.stringify(s):String(s)}function od({ranking:s}){return!s.nextSteps||s.nextSteps.length===0?null:e.jsxs(e.Fragment,{children:[e.jsx(Be,{}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-2xl font-bold mb-2 flex items-center gap-2",children:[e.jsx(se,{className:"h-6 w-6"}),"Actionable Steps"]}),e.jsx("p",{className:"text-foreground mb-4",children:"Prioritized recommendations and next steps"}),e.jsx(m,{className:"bg-gradient-to-br from-blue-50 to-indigo-50 border border-blue-200",children:e.jsx(x,{className:"pt-6",children:e.jsx("ol",{className:"space-y-3",children:s.nextSteps.map((i,l)=>e.jsxs(Y.li,{className:"flex gap-3",initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.4,delay:l*.1},whileHover:{x:4},children:[e.jsx("span",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-blue-600 text-white font-bold text-sm shrink-0",children:l+1}),e.jsx("span",{className:"flex-1 pt-1",children:cd(i)})]},l))})})})]})]})}function md({ranking:s,analysesByCategory:i}){return e.jsx(Y.div,{initial:{opacity:0,y:20}
196,animate:{opacity:1,y:0},children:e.jsx(m,{className:"shadow-lg border",children:e.jsxs(x,{className:"p-4 md:p-6 space-y-4",children:[e.jsxs("div",{className:"grid lg:grid-cols-[70fr_30fr] gap-4",children:[e.jsx(nd,{ranking:s}),e.jsx(ld,{ranking:s,analysesByCategory:i})]}),e.jsx(Be,{}),e.jsx(dd,{ranking:s}),e.jsx(od,{ranking:s})]})})})}function Ct({bmc:s,onRegenerate:i,isRegenerating:l}){return e.jsxs("div",{className:"w-full space-y-6",children:[i&&e.jsx("div",{className:"flex justify-end",children:e.jsx(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-business-model-canvas",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2 animate-spin"}),"Regenerating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Regenerate"]})})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-10 gap-3 auto-rows-fr",children:[e.jsxs(m,{className:"md:col-span-2 md:row-span-2 border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Yi,{className:"w-4 h-4 text-blue-600"}),"Key Partners"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.keyPartnerships.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 border-purple-200 bg-gradient-to-br from-purple-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Xi,{className:"w-4 h-4 text-purple-600"}),"Key Activities"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.keyActivities.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-purple-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 md:row-span-2 border-green-200 bg-gradient-to-br from-green-50 to-white ring-2 ring-green-300",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Zi,{className:"w-4 h-4 text-green-600"}),"Value Propositions"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.valuePropositions.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 border-orange-200 bg-gradient-to-br from-orange-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(_e,{className:"w-4 h-4 text-orange-600"}),"Customer Relationships"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.customerRelationships.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-orange-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 md:row-span-2 border-pink-200 bg-gradient-to-br from-pink-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ne,{className:"w-4 h-4 text-pink-600"}),"Customer Segments"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.customerSegments.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-pink-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 border-indigo-200 bg-gradient-to-br from-indigo-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Bt,{className:"w-4 h-4 text-indigo-600"}),"Key Resources"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.keyResources.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-indigo-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 border-yellow-200 bg-gradient-to-br from-yellow-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Kr,{className:"w-4 h-4 text-yellow-600"}),"Channels"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.channels.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-yellow-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs(m,{className:"border-red-200 bg-gradient-to-br from-red-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Vr,{className:"w-4 h-4 text-red-600"}),"Cost Structure"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.costStructure.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-red-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"border-emerald-200 bg-gradient-to-br from-emerald-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(le,{className:"w-4 h-4 text-emerald-600"}),"Revenue Streams"]}
196)}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.revenueStreams.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-emerald-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 pt-6 border-t border-border",children:[e.jsxs(m,{className:"border-cyan-200 bg-gradient-to-br from-cyan-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-cyan-600"}),"Strategic Insights"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:s.strategicInsights})})]}),e.jsxs(m,{className:"border-amber-200 bg-gradient-to-br from-amber-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4 text-amber-600"}),"Risk Assessment"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:s.riskAssessment})})]}),e.jsxs(m,{className:"border-violet-200 bg-gradient-to-br from-violet-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ws,{className:"w-4 h-4 text-violet-600"}),"Competitive Advantage"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:s.competitiveAdvantage})})]})]})]})}function St({canvas:s,onRegenerate:i,isRegenerating:l}){return e.jsxs("div",{className:"w-full space-y-6",children:[i&&e.jsx("div",{className:"flex justify-end",children:e.jsx(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-lean-canvas",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2 animate-spin"}),"Regenerating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Regenerate"]})})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-10 gap-3 auto-rows-fr",children:[e.jsxs(m,{className:"md:col-span-2 border-red-200 bg-gradient-to-br from-red-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(me,{className:"w-4 h-4 text-red-600"}),"Problem"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.problem.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-red-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 border-green-200 bg-gradient-to-br from-green-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(he,{className:"w-4 h-4 text-green-600"}),"Solution"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.solution.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 border-purple-200 bg-gradient-to-br from-purple-50 to-white ring-2 ring-purple-300",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-purple-600"}),"Unique Value Proposition"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:s.uniqueValueProposition})})]}),e.jsxs(m,{className:"md:col-span-2 border-amber-200 bg-gradient-to-br from-amber-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ws,{className:"w-4 h-4 text-amber-600"}),"Unfair Advantage"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.unfairAdvantage.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-amber-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ne,{className:"w-4 h-4 text-blue-600"}),"Customer Segments"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.customerSegments.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 border-cyan-200 bg-gradient-to-br from-cyan-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ls,{className:"w-4 h-4 text-cyan-600"}),"Key Metrics"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.keyMetrics.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-cyan-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 border-orange-200 bg-gradient-to-br from-orange-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Kr,{className:"w-4 h-4 text-orange-600"}),"Channels"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.channels.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-orange-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-3 border-rose-200 bg-gradient-to-br from-rose-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Vr,{className:"w-4 h-4 text-rose-600"}),"Cost Structure"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.costStructure.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-rose-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-3 border-emerald-200 bg-gradient-to-br from-emerald-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(le,{className:"w-4 h-4 text-emerald-600"}),"Revenue Streams"]}
196)}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.revenueStreams.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-emerald-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"md:col-span-2 border-indigo-200 bg-gradient-to-br from-indigo-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Rt,{className:"w-4 h-4 text-indigo-600"}),"Early Adopters"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.earlyAdopters.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-indigo-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 pt-6 border-t border-border",children:[e.jsxs(m,{className:"border-violet-200 bg-gradient-to-br from-violet-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ie,{className:"w-4 h-4 text-violet-600"}),"Strategic Insights"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:s.strategicInsights})})]}),e.jsxs(m,{className:"border-red-200 bg-gradient-to-br from-red-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4 text-red-600"}),"Risk Assessment"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:s.riskAssessment})})]})]})]})}function Pt({canvas:s,onRegenerate:i,isRegenerating:l}){return e.jsxs("div",{className:"w-full space-y-6",children:[i&&e.jsx("div",{className:"flex justify-end",children:e.jsx(R,{onClick:i,disabled:l,variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-regenerate-value-proposition-canvas",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2 animate-spin"}),"Regenerating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Regenerate"]})})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"text-center mb-3",children:[e.jsx("h3",{className:"text-lg font-bold text-indigo-700",children:"Value Map"}),e.jsx("p",{className:"text-xs text-foreground",children:"What you offer"})]}),e.jsxs(m,{className:"border-indigo-200 bg-gradient-to-br from-indigo-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Bt,{className:"w-4 h-4 text-indigo-600"}),"Products & Services"]})}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.productsServices.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-indigo-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"border-green-200 bg-gradient-to-br from-green-50 to-white",children:[e.jsxs(u,{className:"pb-3",children:[e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(en,{className:"w-4 h-4 text-green-600"}),"Pain Relievers"]}),e.jsx("p",{className:"text-xs text-foreground mt-1",children:"How your products alleviate customer pains"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.painRelievers.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"border-blue-200 bg-gradient-to-br from-blue-50 to-white",children:[e.jsxs(u,{className:"pb-3",children:[e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(se,{className:"w-4 h-4 text-blue-600"}),"Gain Creators"]}),e.jsx("p",{className:"text-xs text-foreground mt-1",children:"How your products create customer gains"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.gainCreators.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"text-center mb-3",children:[e.jsx("h3",{className:"text-lg font-bold text-purple-700",children:"Customer Profile"}),e.jsx("p",{className:"text-xs text-foreground",children:"What customers want"})]}),e.jsxs(m,{className:"border-purple-200 bg-gradient-to-br from-purple-50 to-white",children:[e.jsxs(u,{className:"pb-3",children:[e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(st,{className:"w-4 h-4 text-purple-600"}),"Customer Jobs"]}),e.jsx("p",{className:"text-xs text-foreground mt-1",children:"Tasks customers are trying to accomplish"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.customerJobs.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-purple-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"border-red-200 bg-gradient-to-br from-red-50 to-white",children:[e.jsxs(u,{className:"pb-3",children:[e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(X,{className:"w-4 h-4 text-red-600"}),"Pains"]}),e.jsx("p",{className:"text-xs text-foreground mt-1",children:"Negative outcomes, risks & obstacles"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.pains.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-red-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]}),e.jsxs(m,{className:"border-emerald-200 bg-gradient-to-br from-emerald-50 to-white",children:[e.jsxs(u,{className:"pb-3",children:[e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(se,{className:"w-4 h-4 text-emerald-600"}),"Gains"]}),e.jsx("p",{className:"text-xs text-foreground mt-1",children:"Outcomes & benef
196its customers expect"})]}),e.jsx(x,{children:e.jsx("ul",{className:"space-y-2 text-sm text-foreground",children:s.gains.map((a,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-emerald-600 mt-1",children:"•"}),e.jsx("span",{children:a})]},t))})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 pt-6 border-t border-border",children:[e.jsxs(m,{className:"border-cyan-200 bg-gradient-to-br from-cyan-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-cyan-600"}),"Fit Analysis"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:s.fitAnalysis})})]}),e.jsxs(m,{className:"border-violet-200 bg-gradient-to-br from-violet-50 to-white",children:[e.jsx(u,{className:"pb-3",children:e.jsxs(p,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(ie,{className:"w-4 h-4 text-violet-600"}),"Strategic Insights"]})}),e.jsx(x,{children:e.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:s.strategicInsights})})]})]})]})}function Na({ideaId:s,entityType:i,entityTitle:l,renderVersion:a,currentVersionId:t}){const[r,c]=D.useState(0),[n,d]=D.useState(!1),{toast:o}=Ys(),{data:g,isLoading:h}=ee({queryKey:[`/api/idea-prioritization/${s}/${i}/history`],enabled:n}),f=W({mutationFn:async S=>await Q(`/api/idea-prioritization/${s}/${i}/restore`,{body:JSON.stringify({versionId:S})}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${s}/${i}`]}),L.invalidateQueries({queryKey:[`/api/idea-prioritization/${s}/${i}/history`]}),o({title:"Version Restored",description:`Successfully restored ${l} to selected version`}),d(!1)},onError:S=>{o({title:"Restore Failed",description:S?.message||"Failed to restore version",variant:"destructive"})}}),b=g?.data||[],y=b[r];return e.jsxs(ys,{open:n,onOpenChange:d,children:[e.jsx($a,{asChild:!0,children:e.jsxs(R,{variant:"outline",size:"sm",className:"gap-2","data-testid":"button-view-history",children:[e.jsx(Za,{className:"h-4 w-4"}),"Versions",b.length>0&&e.jsx(I,{variant:"secondary",className:"ml-1",children:b.length})]})}),e.jsxs(ws,{className:"max-w-6xl max-h-[90vh] flex flex-col p-0",children:[e.jsx(ks,{className:"px-6 pt-6 pb-4",children:e.jsxs(Cs,{className:"flex items-center gap-2",children:[e.jsx(Za,{className:"h-5 w-5"}),l," - Versions"]})}),h?e.jsx("div",{className:"flex items-center justify-center p-12",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):b.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center p-12 text-muted-foreground",children:[e.jsx(Te,{className:"h-12 w-12 mb-4 opacity-50"}),e.jsx("p",{children:"No version history available"})]}):e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r bg-muted/30",children:[e.jsx("div",{className:"p-4 border-b bg-background/50",children:e.jsxs("p",{className:"text-sm font-medium",children:[b.length," version",b.length!==1?"s":""," available"]})}),e.jsx(zt,{className:"h-[calc(90vh-200px)]",children:e.jsx("div",{className:"p-2 space-y-1",children:b.map((S,N)=>e.jsx(Y.button,{onClick:()=>c(N),className:`w-full text-left p-3 rounded-lg transition-colors ${r===N?"bg-primary text-primary-foreground shadow-sm":"hover:bg-muted"}`,whileHover:{scale:1.02},whileTap:{scale:.98},"data-testid":`version-item-${N}`,children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[N===0&&e.jsx(I,{variant:r===N?"secondary":"default",className:"text-xs",children:"Current"}),S.id===t&&N!==0&&e.jsx(I,{variant:"outline",className:"text-xs",children:"Viewing"})]}),e.jsxs("div",{className:`text-sm ${r===N?"text-primary-foreground":"text-muted-foreground"}`,children:[e.jsx(Te,{className:"inline h-3 w-3 mr-1"}),ka(new Date(S.createdAt),"PPp")]}),e.jsxs("div",{className:`text-xs mt-1 ${r===N?"text-primary-foreground
196/80":"text-muted-foreground"}`,children:["Version #",b.length-N]})]}),r===N&&e.jsx(Ce,{className:"h-4 w-4 flex-shrink-0 mt-1"})]})},S.id))})})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsx(zt,{className:"h-[calc(90vh-200px)]",children:e.jsx("div",{className:"p-6",children:e.jsx(Ur,{mode:"wait",children:e.jsx(Y.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:y&&a(y,r)},r)})})})})]}),e.jsx(Be,{}),e.jsxs("div",{className:"p-4 flex justify-between items-center bg-muted/30",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:y&&e.jsxs(e.Fragment,{children:["Viewing version from ",ka(new Date(y.createdAt),"PPP"),r===0&&" (Current)"]})}),e.jsxs("div",{className:"flex gap-2",children:[r!==0&&y&&e.jsx(R,{onClick:()=>f.mutate(y.id),disabled:f.isPending,variant:"default","data-testid":"button-restore-version",children:f.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"h-4 w-4 mr-2 animate-spin"}),"Restoring..."]}):e.jsxs(e.Fragment,{children:[e.jsx(sn,{className:"h-4 w-4 mr-2"}),"Restore This Version"]})}),e.jsx(R,{onClick:()=>d(!1),variant:"outline","data-testid":"button-close-history",children:"Close"})]})]})]})]})}function va({data:s,syntheticId:i,entityType:l,entityTitle:a,canvasName:t,emptyStateTitle:r,emptyStateDescription:c,generateMutation:n,renderCanvas:d,renderVersion:o,testId:g}){return s?e.jsx("div",{className:"overflow-x-auto",children:e.jsx("div",{className:"min-w-[1000px]",children:d(s)})}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Bt,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:r}),e.jsx("p",{className:"text-foreground mb-6",children:c}),e.jsx(R,{onClick:()=>n.mutate(),disabled:n.isPending,className:"rounded-full","data-testid":g,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"h-4 w-4 mr-2 animate-spin"}),"Generating ",t,"..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),"Generate ",t]})})]})}function xd({syntheticId:s,bmcData:i,leanCanvasData:l,valuePropositionCanvasData:a,generateBMCMutation:t,generateLeanCanvasMutation:r,generateValuePropositionCanvasMutation:c}){const[n,d]=D.useState("business-model"),g=(()=>{switch(n){case"business-model":return i?.data;case"lean":return l?.data;case"value-proposition":return a?.data;default:return null}})();return e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsx(x,{className:"p-6",children:e.jsxs(ye,{value:n,onValueChange:d,className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-4",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsxs(we,{className:"w-full md:w-auto inline-flex min-w-full md:min-w-0 gap-2",children:[e.jsx(K,{value:"business-model",className:"flex-1 md:flex-none","data-testid":"tab-business-model",children:"Business Model Canvas"}),e.jsx(K,{value:"lean",className:"flex-1 md:flex-none","data-testid":"tab-lean",children:"Lean Canvas"}),e.jsx(K,{value:"value-proposition",className:"flex-1 md:flex-none","data-testid":"tab-value-proposition",children:"Value Proposition Canvas"})]})}),g&&e.jsxs("div",{className:"flex-shrink-0 flex gap-2",children:[n==="business-model"&&i?.data&&e.jsxs(e.Fragment,{children:[e.jsx(Na,{ideaId:s,entityType:"business-model-canvas",entityTitle:"Business Model Canvas",renderVersion:h=>e.jsx(Ct,{bmc:h}),currentVersionId:i.data.id}),e.jsx(Ne,{onClick:()=>t.mutate(),isLoading:t.isPending,testId:"button-regenerate-business-model-canvas"}),e.jsx(Mt,{canvasName:"Business Model Canvas",children:e.jsx(Ct,{bmc:i.data})})]}),n==="lean"&&l?.data&&e.jsxs(e.Fragment,{children:[e.jsx(Na,{ideaId:s,entityType:"lean-canvas",entityTitle:"Lean Canvas",renderVersion:h=>e.jsx(St,{canvas:h}),currentVersionId:l.data.id}),e.jsx(Ne,{onClick:()=>r.mutate(),isLoading:r.isPending,testId:"button-regenerate-lean-canvas"}),e.jsx(Mt,{canvasName:"Lean Canvas",children:e.jsx(St,{canvas:l.data})})]}),n==="value-proposition"&&a?.data&&e.jsxs(e.Fragment,{children:[e.jsx(Na,{ideaId:s,entityType:"value-proposition-canvas",entityTitle:"Value Proposition Canvas",renderVersion:h=>e.jsx(Pt,{canvas:h}),currentVersionId:a.data.id}),e.jsx(Ne,{onClick:()=>c.mutate(),isLoading:c.isPending,testId:"button-regenerate-value-proposition-canvas"}),e.jsx(Mt,{canvasName:"Value Proposition Canvas",children:e.jsx(Pt,{canvas:a.data})})]})]})]}),e.jsx(U,{value:"business-model",className:"mt-6",children:e.jsx(va,{data:i?.data,syntheticId:s,entityType:"business-model-canvas",entityTitle:"Business Model Canvas",canvasName:"Business Model Canvas",emptyStateTitle:"No Business Model Canvas Yet",emptyStateDescription:"Generate a comprehensive business model canvas to understand the strategic elements of your idea.",generateMutation:t,renderCanvas:h=>e.jsx(Ct,{bmc:h}),renderVersion:h=>e.jsx(Ct,{bmc:h}),testId:"button-generate-bmc"})}),e.jsx(U,{value:"lean",className:"mt-6",children:e.jsx(va,{data:l?.data,syntheticId:s,entityType:"lean-canvas",entityTitle:"Lean Canvas",canvasName:"Lean Canvas",emptyStateTitle:"No Lean Canvas Yet",emptyStateDescription:"Generate a Lean Canvas to focus on the problem-solution fit and key startup metrics.",generateMutation:r,renderCanvas:h=>e.jsx(St,{canvas:h}),renderVersion:h=>e.jsx(St,{canvas:h}),testId:"button-generate-lean-canvas"})}),e.jsx(U,{value:"value-proposition",className:"mt-6",children:e.jsx(va,{data:a?.data,syntheticId:s,entityType:"value-proposition-canvas",entityTitle:"Value Proposition Canvas",canvasName:"Value Proposition Canvas",emptyStateTitle:"No Value Proposition Canvas Yet",emptyStateDescription:"Generate a Value Proposition Canvas to align your products and services with customer needs.",generateMutation:c,renderCanvas:h=>e.jsx(Pt,{canvas:h}),renderVersion:h=>e.jsx(Pt,{canvas:h}),testId:"button-generate-value-proposition-canvas"})})]})})})})}function hd({analysis:s,onGenerate:i,isGenerating:l,isLoading:a}){const t=r=>{switch(r?.toLowerCase()){case"high":return"bg-red-100 text-red-800 border-red-200";case"medium":return"bg-yellow-100 text-yellow-800 border-yellow-200";case"low":return"bg-green-100 text-green-800 border-green-200";default:return"bg-muted/50 text-foreground border-border"}};return s?e.jsxs(m,{className:"border-l-4 border-l-orange-500",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(X,{className:"h-5 w-5 text-orange-600"}),e.jsxs("div",{children:[e.jsx(p,{className:"text-lg",children:"Tar Pit Detector"}),e.jsx(O,{children:s.warningCount>0?`Found ${s.warningCount} potential pitfall${s.warningCount>1?"s":""}`:"No major pitfalls detected"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(I,{className:t(s.severity),children:[s.severity||"Unknown"," Risk"]}),e.jsx(R,{onClick:i,disabled:l,variant:"outline",size:"sm","data-testid":"button-regenerate-tar-pit",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"mr-2 h-4 w-4 animate-spin"}),"Researching..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"mr-2 h-4 w-4"}),"Refresh"]})})]})]})}),e.jsxs(x,{className:"space-y-4",children:[s.summary&&e.jsx(Ns,{className:"bg-amber-50 border-amber-200",children:e.jsxs(vs,{className:"text-amber-900",children:[e.jsx("strong",{children:"Summary:"})," ",s.summary]})}),s.failedExamples&&s.failedExamples.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-foreground mb-3",children:"Past Failed Attempts:"}),e.jsx("div",{className:"space-y-3",children:s.failedExamples.map((r,c)=>e.jsxs("div",{className:"p-4 bg-white rounded-lg border border-border","data-testid":`tar-pit-example-${c}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("h5",{className:"font-medium text-foreground",children:r.name||`Example ${c+1}`}),r.year&&e.jsx("span",{className:"text-sm text-muted-foreground",children:r.year})]}),r.description&&e.jsx("p",{className:"text-sm text-foreground mb-2",children:r.description}),r.reasonForFailure&&e.jsxs("div",{className:"mt-2 p-2 bg-red-50 rounded text-sm text-red-900",children:[e.jsx("strong",{children:"Why it failed:"})," ",r.reasonForFailure]})]},c))})]}),s.reasoning&&e.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"AI Reasoning:"}),e.jsx("p",{className:"text-sm text-foreground",children:s.reasoning})]}),s.confidenceScore!==null&&s.confidenceScore!==void 0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-foreground",children:"Confidence in this analysis:"}),e.jsxs("span",{className:"font-medium text-foreground",children:[s.confidenceScore,"%"]})]})]})]}):e.jsxs(m,{className:"border-2 border-dashed border-border",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(X,{className:"h-5 w-5 text-orange-600"}),e.jsxs("div",{children:[e.jsx(p,{className:"text-lg",children:"Tar Pit Detector"}),e.jsx(O,{children:"Research past failed attempts in this idea space"})]})]}),e.jsx(R,{onClick:i,disabled:l||a,size:"sm","data-testid":"button-generate-tar-pit",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"mr-2 h-4 w-4 animate-spin"}),"Researching..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"mr-2 h-4 w-4"}),"Research Past Attempts"]})})]})}),e.jsx(x,{children:e.jsxs(Ns,{className:"bg-orange-50 border-orange-200",children:[e.jsx(me,{className:"h-4 w-4 text-orange-600"}),e.jsx(vs,{className:"text-orange-900",children:'Click "Research Past Attempts" to have AI search for similar ideas that failed, helping you avoid known pitfalls.'})]})})]})}function zr(s){if(!s&&s!==0)return"N/A";if(typeof s=="string"){if(/^\$?[\d,.]+\s*(B|Billion|M|Million|K|Thousand)/i.test(s))return s.startsWith("$")?s:`$${s}`;const i=parseFloat(s.replace(/[$,]/g,""));if(isNaN(i))return s;s=i}return s>=1e12?`$${(s/1e12).toFixed(1)}T`:s>=1e9?`$${(s/1e9).toFixed(1)}B`:s>=1e6?`$${(s/1e6).toFixed(1)}M`:s>=1e3?`$${(s/1e3).toFixed(0)}K`:`$${s.toFixed(0)}`}function ud({proxies:s,onGenerate:i,isGenerating:l,isLoading:a}){const t=r=>r>=80?"bg-green-100 text-green-800 border-green-200":r>=60?"bg-blue-100 text-blue-800 border-blue-200":r>=40?"bg-yellow-100 text-yellow-800 border-yellow-200":"bg-muted/50 text-foreground border-border";return!s||s.length===0?e.jsxs(m,{className:"border-2 border-dashed border-border",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(js,{className:"h-5 w-5 text-blue-600"}),e.jsxs("div",{children:[e.jsx(p,{className:"text-lg",children:"Proxy Search"}),e.jsx(O,{children:"Find similar successful companies in other markets"})]})]}),e.jsx(R,{onClick:i,disabled:l||a,size:"sm","data-testid":"button-generate-proxies",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"mr-2 h-4 w-4 animate-spin"}),"Searching..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"mr-2 h-4 w-4"}),"Find Proxies"]})})]})}),e.jsx(x,{children:e.jsxs(Ns,{className:"bg-blue-50 border-blue-200",children:[e.jsx(Ft,{className:"h-4 w-4 text-blue-600"}),e.jsx(vs,{className:"text-blue-900",children:'Click "Find Proxies" to discover similar companies that succeeded in different regions or verticals. Learn from their growth patterns and validate market demand.'})]})})]}):e.jsxs(m,{className:"border-l-4 border-l-blue-500",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(js,{className:"h-5 w-5 text-blue-600"}),e.jsxs("div",{children:[e.jsx(p,{className:"text-lg",children:"Proxy Search"}),e.jsxs(O,{children:["Found ",s.length," similar successful compan",s.length===1?"y":"ies"]})]})]}),e.jsx(R,{onClick:i,disabled:l,variant:"outline",size:"sm","data-testid":"button-regenerate-proxies",children:l?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"mr-2 h-4 w-4 animate-spin"}),"Searching..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"mr-2 h-4 w-4"}),"Refresh"]})})]})}),e.jsx(x,{children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:s.map((r,c)=>e.jsxs("div",{className:"p-4 bg-white rounded-lg border border-border hover:border-blue-300 transition-colors","data-testid":`proxy-company-${c}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-semibold text-foreground text-lg mb-1",children:r.companyName}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-2",children:[e.jsx(I,{variant:"outline",className:"text-xs",children:r.region}),e.jsx(I,{variant:"outline",className:"text-xs",children:r.vertical})]})]}),e.jsxs(I,{className:t(r.similarity||0),children:[r.similarity||0,"% match"]})]}),r.description&&e.jsx("p",{className:"text-sm text-foreground mb-3 line-clamp-3",children:r.description}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[r.fundingAmount&&e.jsxs("div",{className:"p-2 bg-green-50 rounded",children:[e.jsx("p",{className:"text-xs text-foreground",children:"Funding"}),e.jsx("p",{className:"text-sm font-semibold text-green-700",children:zr(r.fundingAmount)})]}),r.valuation&&e.jsxs("div",{className:"p-2 bg-blue-50 rounded",children:[e.jsx("p",{className:"text-xs text-foreground",children:"Valuation"}),e.jsx("p",{className:"text-sm font-semibold text-blue-700",children:zr(r.valuation)})]})]}),r.growthMetrics&&e.jsxs("div",{className:"p-2 bg-purple-50 rounded mb-3",children:[e.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[e.jsx(se,{className:"h-3 w-3 text-purple-600"}),e.jsx("p",{className:"text-xs text-purple-600 font-medium",children:"Growth Metrics"})]}),e.jsx("p",{className:"text-sm text-purple-900",children:r.growthMetrics})]}),r.notes&&e.jsx("div",{className:"p-2 bg-muted/50 rounded mb-3",children:e.jsx("p",{className:"text-xs text-foreground",children:r.notes})}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[e.jsxs("span",{children:["Confidence: ",r.confidence||0,"%"]}),r.sourceUrl&&e.jsxs("a",{href:r.sourceUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-blue-600 hover:text-blue-800","data-testid":`proxy-source-link-${c}`,children:["Source ",e.jsx(Tt,{className:"h-3 w-3"})]})]})]},r.id||c))})})]})}function pd({advisorMode:s,onToggle:i,tarPitAnalysis:l,proxies:a,onGenerateTarPit:t,onGenerateProxies:r,isTogglingAdvisorMode:c,isGeneratingTarPit:n,isGeneratingProxies:d,isLoading:o}){return e.jsxs(m,{className:"shadow-lg border-2 border-indigo-200 bg-gradient-to-br from-indigo-50 to-white",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-100 rounded-lg",children:e.jsx(he,{className:"h-5 w-5 text-indigo-600"})}),e.jsxs("div",{children:[e.jsx(p,{className:"text-xl",children:"Adv
196isor Mode"}),e.jsx(O,{children:"Get AI-powered guidance to validate your idea and avoid common pitfalls"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ea,{htmlFor:"advisor-mode-toggle",className:"text-sm font-medium",children:s?"Enabled":"Disabled"}),e.jsx(ln,{id:"advisor-mode-toggle",checked:s,onCheckedChange:i,disabled:c,"data-testid":"switch-advisor-mode"})]})]})}),e.jsx(x,{className:"space-y-4",children:s?e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ns,{className:"bg-green-50 border-green-200",children:[e.jsx(Ft,{className:"h-4 w-4 text-green-600"}),e.jsx(vs,{className:"text-green-900",children:"Advisor Mode is active. Generate analyses below to get started."})]}),e.jsx(hd,{analysis:l,onGenerate:t,isGenerating:n,isLoading:o}),e.jsx(ud,{proxies:a,onGenerate:r,isGenerating:d,isLoading:o})]}):e.jsxs(Ns,{className:"bg-blue-50 border-blue-200",children:[e.jsx(Ft,{className:"h-4 w-4 text-blue-600"}),e.jsxs(vs,{className:"text-blue-900",children:[e.jsx("strong",{children:"Enable Advisor Mode to unlock:"}),e.jsxs("ul",{className:"mt-2 ml-4 space-y-1 list-disc",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Tar Pit Detector:"})," Research past failed attempts in your idea space"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Proxy Search:"})," Find similar successful companies in other markets"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Expert Guidance:"})," Contextual recommendations throughout your validation journey"]})]}),e.jsx("p",{className:"mt-3 text-sm text-blue-700",children:"All advisor features are optional - you stay in full control of your validation process."})]})]})})]})}function Dr(s){return typeof s=="string"?s:typeof s=="object"&&s!==null?s.title&&s.description?`${s.title}: ${s.description}`:s.title||s.description||s.text||s.step||s.rationale||JSON.stringify(s):String(s)}const At=[{type:"team_strengths",title:"Team Strengths",description:"Build around your unique expertise and proven capabilities",icon:"🎯",prompt:"What unique skills, experience, or expertise does your team bring?",examples:["Domain expertise in healthcare from 10+ years of clinical practice","Technical skills in ML/AI and large-scale distributed systems","Network in enterprise sales with Fortune 500 relationships"],pitfalls:["Don't confuse passion with expertise - customers pay for proven value",'Avoid building "solutions looking for problems" just because you can']},{type:"past_problems",title:"Past Problems",description:"Solve problems you've personally experienced and understand deeply",icon:"🔍",prompt:"What frustrating problems have you encountered in your work or life?",examples:["Spent 20 hours/week manually consolidating data from 5 different tools","Lost 3 clients due to slow invoice processing and payment delays","Struggled to find qualified contractors for home renovations"],pitfalls:["Just because you had a problem doesn't mean it's widespread","Your workaround might not scale to a real business model"]},{type:"personal_wishes",title:"Personal Wishes",description:"Create products or services you wish existed",icon:"⭐",prompt:"What do you wish someone would build or improve?",examples:["A scheduling tool that actually understands context and priorities","Meal planning that adapts to my dietary restrictions and local availability","Project management for solo founders without enterprise bloat"],pitfalls:["Your personal preferences might be too niche for a viable market","Be honest: would you actually pay for this, or just use the free version?"]},{type:"recent_changes",title:"Recent Changes",description:"Spot opportunities created by technology shifts or market disruptions",icon:"🚀",prompt:"What recent changes have created new problems or opportunities?",examples:["Remote work explosion created need for async collaboration tools","AI capabilities made personalization at scale suddenly feasible","Privacy regulations created compliance challenges for small businesses"],pitfalls:["Don't chase hype - the change must create real, lasting needs","Early adoption doesn't guarantee long-term market viability"]},{type:"success_variants",title:"Success Variants",description:"Adapt proven business models to new markets or use cases",
196icon:"🔄",prompt:"What successful business could work in a different context?",examples:["Uber for X: on-demand marketplace for specialized services","Airbnb model applied to underutilized commercial spaces","Stripe-like developer experience for a complex industry"],pitfalls:['"X for Y" only works if both market dynamics and unit economics translate',"Don't assume regulatory/cultural barriers are the same"]},{type:"customer_talks",title:"Customer Talks",description:"Extract insights from real conversations with potential customers",icon:"💬",prompt:"What patterns emerged from your customer discovery interviews?",examples:["8 of 10 marketing managers mentioned difficulty proving ROI","Every small manufacturer struggled with inventory forecasting","All interviewees mentioned hiring as their #1 bottleneck"],pitfalls:["People often say they want features they'd never actually use","Complaints don't equal willingness to pay - always ask about budget"]},{type:"broken_industries",title:"Broken Industries",description:"Find sectors with outdated processes ripe for innovation",icon:"🏗️",prompt:"Which industries still rely on manual, outdated, or inefficient processes?",examples:["Construction: still using paper blueprints and spreadsheet schedules","Legal: manual document review consuming 60% of billable hours","Healthcare: fax machines still primary method for record transfer"],pitfalls:["Industries resist change for reasons (regulation, culture, buying cycles)","Long sales cycles and high CAC can kill your startup before traction"]}];function gd({ideaSyntheticId:s,recipeProgress:i,onGenerateInsights:l,isGenerating:a,isLoading:t}){const[r,c]=D.useState(At[0].type),[n,d]=D.useState({}),o=h=>i.find(f=>f.recipeType===h),g=h=>{const f=n[h]?.trim();l(h,f||void 0)};return e.jsxs(m,{className:"shadow-md border-purple-200 bg-white",children:[e.jsx(u,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-purple-100 rounded-lg",children:e.jsx(he,{className:"h-5 w-5 text-purple-600"})}),e.jsxs("div",{children:[e.jsx(p,{className:"text-xl",children:"Idea Generation Recipes"}),e.jsx(O,{children:"7 proven frameworks to develop and refine your ideas"})]})]})}),e.jsx(x,{children:e.jsxs(ye,{value:r,onValueChange:c,children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-6",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsx(we,{className:"inline-flex gap-2","data-testid":"tabs-idea-recipes",children:At.map(h=>{const f=o(h.type);return e.jsxs(K,{value:h.type,className:"whitespace-nowrap","data-testid":`tab-recipe-${h.type}`,children:[h.title,f&&e.jsx(re,{className:"ml-2 h-3 w-3 text-green-600 inline"})]},h.type)})})}),e.jsx("div",{className:"flex-shrink-0",children:At.map(h=>{if(r!==h.type)return null;const f=o(h.type),b=a[h.type];return e.jsx(R,{onClick:()=>g(h.type),disabled:b||t,size:"sm","data-testid":`button-generate-recipe-${h.type}`,children:b?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"mr-2 h-4 w-4 animate-spin"}),"Generating..."]}):f?e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"mr-2 h-4 w-4"}),"Regenerate"]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"mr-2 h-4 w-4"}),"Generate"]})},h.type)})})]}),At.map(h=>{const f=o(h.type),b=a[h.type];return e.jsx(U,{value:h.type,className:"space-y-6",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[e.jsx("span",{className:"text-4xl",children:h.icon}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-bold text-foreground",children:h.title}),e.jsx("p",{className:"text-foreground mt-1",children:h.description})]})]}),e.jsxs(Ns,{className:"bg-blue-50 border-blue-200 mb-4",children:[e.jsx(me,{className:"h-4 w-4 text-blue-600"}),e.jsxs(vs,{className:"text-blue-900",children:[e.jsx("strong",{children:"Core Question:"})," ",h.prompt]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4 mb-6",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-sm text-foreground mb-2",children:"Examples:"}),e.jsx("ul",{className:"space-y-2",children:h.examples.map((y,S)=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[e.jsx(Ce,{className:"h-4 w-4 text-green-600 flex-shrink-0 mt-0.5"}),e.jsx("span",{children:y})]},S))})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-sm text-foreground mb-2",children:"Common Pitfalls:"}),e.jsx("ul",{className:"space-y-2",children:h.pitfalls.map((y,S)=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[e.jsx(me,{className:"h-4 w-4 text-orange-600 flex-shrink-0 mt-0.5"}),e.jsx("span",{children:y})]},S))})]})]}),e.jsx(Be,{className:"my-6"}),e.jsxs("div",{children:[e.jsx(Ea,{htmlFor:`notes-${h.type}`,className:"text-sm font-medium",children:"Your Notes (Optional)"}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Share relevant context, experiences, or specific examples"}),e.jsx(it,{id:`notes-${h.type}`,value:n[h.type]||"",onChange:y=>
196d({...n,[h.type]:y.target.value}),placeholder:`Example: ${h.examples[0]}`,className:"min-h-[100px] rounded-xl",disabled:b||t,"data-testid":`textarea-recipe-notes-${h.type}`})]}),f&&e.jsxs("div",{className:"mt-6 space-y-4 p-4 bg-green-50 rounded-lg border border-green-200",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-semibold text-green-900",children:"Generated Insights"}),e.jsx(I,{variant:"outline",className:"bg-white",children:new Date(f.generatedAt).toLocaleDateString()})]}),e.jsx("div",{children:e.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:f.insights})}),f.candidateIdeas&&f.candidateIdeas.length>0&&e.jsxs("div",{children:[e.jsx("h5",{className:"font-semibold text-sm text-foreground mb-2",children:"Candidate Ideas:"}),e.jsx("ul",{className:"space-y-2",children:f.candidateIdeas.map((y,S)=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[e.jsx(Ce,{className:"h-4 w-4 text-purple-600 flex-shrink-0 mt-0.5"}),e.jsx("span",{children:Dr(y)})]},S))})]}),f.nextSteps&&f.nextSteps.length>0&&e.jsxs("div",{children:[e.jsx("h5",{className:"font-semibold text-sm text-foreground mb-2",children:"Next Steps:"}),e.jsx("ul",{className:"space-y-2",children:f.nextSteps.map((y,S)=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[e.jsx(Ce,{className:"h-4 w-4 text-blue-600 flex-shrink-0 mt-0.5"}),e.jsx("span",{children:Dr(y)})]},S))})]})]})]})},h.type)})]})})]})}function Dd(){const i=dn().id||null,[,l]=Hr(),{toast:a}=Ys(),{stage:t,isEarlyStage:r}=cn(),[c,n]=D.useState("team"),[d,o]=D.useState(""),[g,h]=D.useState("market-viability"),[f,b]=D.useState("jtbd-discovery"),y=D.useRef(!1),S=D.useRef(!1),[N,w]=D.useState(1),[P,C]=D.useState({1:!0,2:!1,3:!1,4:!1,5:!1,6:!1}),[v,T]=D.useState(!1),[$,A]=D.useState(!1),[z,F]=D.useState(!1),[k,E]=D.useState(null),[B,q]=D.useState({}),{items:H,isRunning:Ee,regenerateBatch:cs}=Wl({ideaId:i||"",onComplete:j=>{a({title:"Regeneration Complete",description:`Successfully regenerated ${j.filter(M=>M.status==="completed").length} analyses`})},onError:j=>{a({title:"Regeneration Error",description:j.message,variant:"destructive"})}}),{data:As,isLoading:ct}=ee({queryKey:[`/api/idea-prioritization/${i}`],enabled:!!i,refetchInterval:j=>j.state.data?.data?.idea?.status==="analyzing"?3e3:!1}),G=As?.data?.ranking,_=As?.data?.idea;D.useEffect(()=>{_&&i&&!y.current&&(mn(i),y.current=!0)},[_,i]),D.useEffect(()=>{_?.status==="completed"&&G?.overallScore&&!S.current&&(xn(i||"",G.overallScore),S.current=!0)},[_,G,i]);const{data:Ve}=ee({queryKey:[`/api/idea-prioritization/${i}/business-model-canvas`],enabled:!!i&&!!G}),{data:os}=ee({queryKey:[`/api/idea-prioritization/${i}/lean-canvas`],enabled:!!i&&!!G}),{data:Qe}=ee({queryKey:[`/api/idea-prioritization/${i}/value-proposition-canvas`],enabled:!!i&&!!G}),{data:qe}=ee({queryKey:[`/api/idea-prioritization/${i}/personas`],enabled:!!i&&!!G}),{data:fe}=ee({queryKey:[`/api/idea-prioritization/${i}/customer-interviews/count`],enabled:!!i}),{data:Je}=ee({queryKey:[`/api/idea-prioritization/${i}/market-viability`],enabled:!!i&&!!G}),{data:ue}=ee({queryKey:[`/api/idea-prioritization/${i}/competitive-landscape`],enabled:!!i&&!!G}),{data:be}=ee({queryKey:[`/api/idea-prioritization/${i}/execution-readiness`],enabled:!!i&&!!G}),{data:Se}=ee({queryKey:[`/api/idea-prioritization/${i}/social-validation`],enabled:!!i&&!!G}),{data:He}=ee({queryKey:[`/api/idea-prioritization/${i}/expert-validation`],enabled:!!i&&!!G}),{data:Pe}=ee({queryKey:[`/api/idea-prioritization/${i}/opportunity-assessment`],enabled:!!i&&!!G&&_?.ideaType==="product",refetchInterval:j=>j?.data?.status==="analyzing"?5e3:!1}),{data:We}=ee({queryKey:[`/api/idea-prioritization/${i}/execution-plan`],enabled:!!i&&!!G,refetchInterval:j=>j?.data?.status==="generating"?5e3:!1}),{data:ms}=ee({queryKey:[`/api/idea-prioritization/${i}/investor-outlook`],enabled:!!i&&!!G,refetchInterval:j=>j?.data?.status==="generating"?5e3:!1}),{data:xs}=ee({queryKey:[`/api/idea-prioritization/${i}/financial-projections`],enabled:!!i&&!!G,refetchInterval:j=>j?.data?.status==="generating"?5e3:!1}),{data:hs}=ee({queryKey:[`/api/idea-prioritization/${i}/market-sizing`],enabled:!!i&&!!G,refetchInterval:j=>j?.data?.status==="generating"?5e3:!1}),{data:Ms}=ee({queryKey:[`/api/idea-prioritization/${i}/positioning-statements`],enabled:!!i&&!!G,refetchInterval:j=>j?.data?.status==="generating"?5e3:!1}),{data:$s}=ee({queryKey:[`/api/idea-prioritization/${i}/team-profiles`],enabled:!!i&&!!G,refetchInterval:j=>j?.data?.status==="generating"?5e3:!1}),{data:Ts}=ee({queryKey:[`/api/idea-prioritization/${i}/pitch-narrative`],enabled:!!i&&!!G,refetchInterval:j=>j?.data?.status==="generating"?5e3:!1}),{data:us}=ee({queryKey:[`/api/idea-prioritization/${i}/jtbd-analysis`],enabled:!!i&&!!G}),{data:Es}=ee({queryKey:[`/api/idea-prioritization/${i}/assumption-mapping`],enabled:!!i&&!!G}),{data:ps}=ee({queryKey:[`/api/idea-prioritization/${i}/kano-analysis`],enabled:!!i&&!!G}),{data:Rs}=ee({queryKey:[`/api/idea-prioritization/${i}/customer-journey-map`],enabled:!!i&&!!G}),{data:Fs}=ee({queryKey:[`/api/idea-prioritization/${i}/empathy-map`],enabled:!!i&&!!G}),{data:Xs}=ee({queryKey:[`/api/idea-prioritization/${i}/five-whys-analysis`],enabled:!!i&&!!G}),{data:Re}=ee({queryKey:[`/api/idea-prioritization/${i}/problem-solution-fit`],enabled:!!i&&!!G}),{data:Is}=ee({queryKey:[`/api/idea-prioritization/${i}/feature-impact-matrix`],enabled:!!i&&!!G}),{data:zs}=ee({queryKey:[`/api/idea-prioritization/${i}/heart-framework`],enabled:!!i&&!!G}),{data:hi}=ee({queryKey:[`/api/idea-prioritization/${i}/research-method-recommendation`],enabled:!!i&&!!G}),{data:Fe,isLoading:Ye}=ee({queryKey:[`/api/idea-prioritization/${i}/advisor`],enabled:!!i}
196),qt=hi?.data,ui=!!us?.data||!!Es?.data||!!ps?.data||!!Rs?.data||!!Fs?.data||!!Xs?.data||!!Re?.data||!!Is?.data||!!zs?.data;W({mutationFn:async()=>{const j=As?.data?.idea;if(!j)throw new Error("Idea not found");return Q("/api/collaborative/sessions","POST",{ideaId:j.id,sessionName:`${j.title} - Collaborative Review`,sessionDescription:`Collaborative analysis session for: ${j.title}`})},onSuccess:j=>{const M=j.data.syntheticId;a({title:"Session created",description:"Collaborative session has been created successfully"}),l(`/collaborative-session/${M}`)},onError:j=>{a({title:"Error",description:j?.message||"Failed to create session",variant:"destructive"})}});const pi=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/business-model-canvas`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/business-model-canvas`]}),a({title:"Business Model Canvas generated",description:"Your Business Model Canvas has been created successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate Business Model Canvas",variant:"destructive"})}}),gi=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/lean-canvas`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/lean-canvas`]}),a({title:"Lean Canvas generated",description:"Your Lean Canvas has been created successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate Lean Canvas",variant:"destructive"})}}),ji=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/value-proposition-canvas`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/value-proposition-canvas`]}),a({title:"Value Proposition Canvas generated",description:"Your Value Proposition Canvas has been created successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate Value Proposition Canvas",variant:"destructive"})}}),Da=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/personas`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/personas`]}),a({title:"Target Personas generated",description:"Your Target Personas have been created successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate Target Personas",variant:"destructive"})}}),Le=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/opportunity-assessment/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/opportunity-assessment`]}),a({title:"Opportunity Assessment started",description:"AI is analyzing 19 opportunity factors. This will take ~3 minutes."})},onError:j=>{a({title:"Error",description:j?.message||"Failed to start opportunity assessment",variant:"destructive"})}}),Xe=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/execution-plan/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/execution-plan`]}),a({title:"Execution Plan started",description:"AI is creating your comprehensive execution roadmap. This will take ~2 minutes."})},onError:j=>{a({title:"Generation failed",description:j?.message||"Failed to start execution plan generation. Please try again.",variant:"destructive"})}}),Ze=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/investor-outlook/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/investor-outlook`]}),a({title:"Investor Outlook started",description:"AI is analyzing your idea from an investor perspective. This will take ~2 minutes."})},onError:j=>{a({title:"Error",description:j?.message||"Failed to start execution plan generation",variant:"destructive"})}}),es=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/financial-projections/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/financial-projections`]}),a({title:"Financial Projections started",description:"AI is creating your 5-year financial forecast. This will take ~2 minutes."})},onError:j=>{a({title:"Error",description:j?.message||"Failed to start financial projections generation",variant:"destructive"})}}),ss=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/market-sizing/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/market-sizing`]}),a({title:"Market Sizing started",description:"AI is calculating TAM/SAM/SOM with defensible methodology. This will take ~2 minutes."})},onError:j=>{a({title:"Error",description:j?.message||"Failed to start market sizing generation",variant:"destructive"})}}),ts=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/positioning-statements/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/positioning-statements`]}),a({title:"Positioning Statements started",description:"AI is crafting your value propositions and messaging frameworks. This will take ~2 minutes."})},onError:j=>{a({title:"Error",description:j?.message||"Failed to start positioning statements generation",variant:"destructive"})}}),as=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/team-profiles/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/team-profiles`]}),a({title:"Team Profiles started",description:"AI is creating team profiles and hiring roadmap. This will take ~2 minutes."})},onError:j=>{a({title:"Error",description:j?.message||"Failed to start team profiles generation",variant:"destructive"})}}),Ue=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/pitch-narrative/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/pitch-narrative`]}),a({title:"Pitch Narrative started",description:"AI is writing your complete investor storyline. This will take ~2 minutes."})},onError:j=>{a({title:"Error",description:j?.message||"Failed to start pitch narrative generation",variant:"destructive"})}}),Ba=W({mutationFn:async j=>Q({method:"PATCH",url:`/api/idea-prioritization/${i}/advisor/toggle`,data:{advisorMode:j}}),onMutate:async j=>{await L.cancelQueries({queryKey:[`/api/idea-prioritization/${i}/advisor`]});const M=L.getQueryData([`/api/idea-prioritization/${i}/advisor`]);return L.setQueryData([`/api/idea-prioritization/${i}/advisor`],Z=>{const Ie=Z??{success:!0,data:{}};return{...Ie,data:{...Ie.data||{},advisorMode:j}}}),{previousAdvisorData:M}},onSuccess:async()=>{await Promise.all([L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}`]}),L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/advisor`]})]),a({title:"Advisor Mode updated",description:"Your advisor mode preference has been saved"})},onError:(j,M,Z)=>{Z?.previousAdvisorData&&L.setQueryData([`/api/idea-prioritization/${i}/advisor`],Z.previousAdvisorData),a({title:"Error",description:j?.message||"Failed to update advisor mode",variant:"destructive"})}}),qa=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/advisor/tar-pit-analysis`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/advisor`]}),a({title:"Tar Pit Analysis complete",description:"AI has researched past failed attempts in this space"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate tar pit analysis",variant:"destructive"})}}),La=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/advisor/proxies`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/advisor`]}),a({title:"Proxy Search complete",description:"AI has found similar successful companies in other markets"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to find proxy companies",variant:"destructive"})}}
196),[fi,Lt]=D.useState({}),bi=W({mutationFn:async({recipeType:j,notes:M})=>Q({method:"POST",url:`/api/idea-prioritization/${i}/advisor/recipe/${j}/generate`,data:{notes:M}}),onMutate:({recipeType:j})=>{Lt(M=>({...M,[j]:!0}))},onSuccess:(j,M)=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/advisor`]}),L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/advisor/recipe/${M.recipeType}/guidance`]}),Lt(Z=>({...Z,[M.recipeType]:!1})),a({title:"Recipe Insights Generated",description:"AI has developed insights and candidate ideas for this recipe"})},onError:(j,M)=>{Lt(Z=>({...Z,[M.recipeType]:!1})),a({title:"Error",description:j?.message||"Failed to generate recipe insights",variant:"destructive"})}}),[Ds,Ot]=D.useState({}),Bs=W({mutationFn:async({phase:j,completedPhases:M,availableData:Z})=>Q({method:"POST",url:`/api/idea-prioritization/${i}/advisor/contextual-guidance`,data:{phase:j,completedPhases:M,availableData:Z}}),onMutate:({phase:j})=>{Ot(M=>({...M,[j]:!0}))},onSuccess:(j,M)=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/advisor`]}),L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/advisor/contextual-guidance`]}),Ot(Z=>({...Z,[M.phase]:!1})),j?.data&&q(Z=>({...Z,[M.phase]:j.data})),a({title:"Phase Guidance Generated",description:"AI has provided contextual guidance for this phase"})},onError:(j,M)=>{Ot(Z=>({...Z,[M.phase]:!1})),a({title:"Error",description:j?.message||"Failed to generate contextual guidance",variant:"destructive"})}}),ot=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/market-viability`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/market-viability`]}),a({title:"Market Viability generated",description:"Market viability analysis completed successfully"})},onError:j=>{const M=j?.message?.includes("Authentication required")||j?.message?.includes("401");a({title:M?"Sign in required":"Error",description:M?"Please sign in to regenerate analyses":j?.message||"Failed to generate Market Viability",variant:"destructive"})}}),mt=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/competitive-landscape`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/competitive-landscape`],refetchType:"all"}),L.refetchQueries({queryKey:[`/api/idea-prioritization/${i}/competitive-landscape`]}),a({title:"Competitive Landscape generated",description:"Competitive analysis completed successfully"})},onError:j=>{const M=j?.message?.includes("Authentication required")||j?.message?.includes("401");a({title:M?"Sign in required":"Error",description:M?"Please sign in to regenerate analyses":j?.message||"Failed to generate Competitive Landscape",variant:"destructive"})}}),xt=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/execution-readiness`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/execution-readiness`],refetchType:"all"}),L.refetchQueries({queryKey:[`/api/idea-prioritization/${i}/execution-readiness`]}),a({title:"Execution Readiness generated",description:"Execution readiness analysis completed successfully"})},onError:j=>{const M=j?.message?.includes("Authentication required")||j?.message?.includes("401");a({title:M?"Sign in required":"Error",description:M?"Please sign in to regenerate analyses":j?.message||"Failed to generate Execution Readiness",variant:"destructive"})}}),ht=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/social-validation`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/social-validation`],refetchType:"all"}),L.refetchQueries({queryKey:[`/api/idea-prioritization/${i}/social-validation`]}),a({title:"Social Validation generated",description:"Social validation analysis completed successfully"})},onError:j=>{const M=j?.message?.includes("Authentication required")||j?.message?.includes("401");a({title:M?"Sign in required":"Error",description:M?"Please sign in to regenerate analyses":j?.message||"Failed to generate Social Validation",variant:"destructive"})}}),ut=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/expert-validation`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/expert-validation`],refetchType:"all"}),L.refetchQueries({queryKey:[`/api/idea-prioritization/${i}/expert-validation`]}),a({title:"Expert Validation generated",description:"Expert validation analysis completed successfully"})},onError:j=>{const M=j?.message?.includes("Authentication required")||j?.message?.includes("401");a({title:M?"Sign in required":"Error",description:M?"Please sign in to regenerate analyses":j?.message||"Failed to generate Expert Validation",variant:"destructive"})}}),Oa=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/thinking-hats`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}`]}
196),a({title:"Thinking Hats Analysis started",description:"AI is regenerating multi-perspective analysis. This will take a few minutes."})},onError:j=>{const M=j?.message?.includes("Authentication required")||j?.message?.includes("401");a({title:M?"Sign in required":"Error",description:M?"Please sign in to regenerate analyses":j?.message||"Failed to regenerate Thinking Hats Analysis",variant:"destructive"})}}),qs=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/jtbd-analysis/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/jtbd-analysis`]}),b("jtbd-discovery"),a({title:"JTBD Discovery generated",description:"Jobs-to-be-Done analysis completed successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate JTBD Discovery",variant:"destructive"})}}),Ls=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/assumption-mapping/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/assumption-mapping`]}),b("assumption-mapping"),a({title:"Assumption Mapping generated",description:"Assumption analysis completed successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate Assumption Mapping",variant:"destructive"})}}),Os=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/kano-analysis/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/kano-analysis`]}),b("kano-model"),a({title:"Kano Model generated",description:"Kano feature analysis completed successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate Kano Model",variant:"destructive"})}}),pt=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/customer-journey-map/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/customer-journey-map`]}),b("customer-journey-map"),a({title:"Customer Journey Map generated",description:"Customer journey analysis completed successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate Customer Journey Map",variant:"destructive"})}}),gt=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/empathy-map/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/empathy-map`]}),b("empathy-map"),a({title:"Empathy Map generated",description:"Empathy mapping completed successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate Empathy Map",variant:"destructive"})}}),jt=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/five-whys-analysis/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/five-whys-analysis`]}),b("five-whys-analysis"),a({title:"5 Whys Analysis generated",description:"Root cause analysis completed successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate 5 Whys Analysis",variant:"destructive"})}}),ft=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/problem-solution-fit/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/problem-solution-fit`]}),b("problem-solution-fit"),a({title:"Problem-Solution Fit generated",description:"Problem-solution analysis completed successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate Problem-Solution Fit",variant:"destructive"})}}),bt=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/feature-impact-matrix/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/feature-impact-matrix`]}),b("feature-impact-matrix"),a({title:"Feature Impact Matrix generated",description:"Feature prioritization completed successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate Feature Impact Matrix",variant:"destructive"})}}),Nt=W({mutationFn:async()=>Q({method:"POST",url:`/api/idea-prioritization/${i}/heart-framework/generate`,data:{}}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/heart-framework`]}),b("heart-framework"),a({title:"HEART Framework generated",description:"UX metrics analysis completed successfully"})},onError:j=>{a({title:"Error",description:j?.message||"Failed to generate HEART Framework",variant:"destructive"})}}),Ni=j=>{switch(j){case"jtbd":qs.mutate();break;case"assumption_mapping":Ls.mutate();break;case"kano":Os.mutate();break}},Ga=W({mutationFn:async j=>Q({method:"PATCH",url:`/api/idea-prioritization/${i}`,data:j}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}`]}),a({title:"Idea Updated",description:"Your idea has been successfully updated"});const j=Ir("core-idea"),M=j.affectedAnalyses.filter(Z=>!!{"thinking-hats":Gs.length>0,"business-model-canvas":Ve?.data,"lean-canvas":os?.data,"value-proposition-canvas":Qe?.data,personas:qe?.data?.length>0,"market-viability":Je?.data,"competitive-landscape":ue?.data,"execution-readiness":be?.data,"social-validation":Se?.data,"expert-validation":He?.data,"opportunity-assessment":Pe?.data,"jtbd-analysis":us?.data,"assumption-mapping":Es?.data,"kano-analysis":ps?.data,"customer-journey-map":Rs?.data,"empathy-map":Fs?.data,"five-whys-analysis":Xs?.data,"problem-solution-fit":Re?.data,"feature-impact-matrix":Is?.data,"heart-framework":zs?.data,"execution-plan":We?.data}[Z]);if(M.length>0){const Z={...j,affectedAnalyses:M,analysesByPhase:M.reduce((Ie,rs)=>{const Zs=j.analysesByPhase[1]?.includes(rs)?1:j.analysesByPhase[2]?.includes(rs)?2:j.analysesByPhase[3]?.includes(rs)?3:j.analysesByPhase[4]?.includes(rs)?4:j.analysesByPhase[5]?.includes(rs)?5:6;return Ie[Zs]||(Ie[Zs]=[]),Ie[Zs].push(rs),Ie},{})};E(Z),F(!0)}},onError:j=>{a({title:"Error",description:j?.message||"Failed to update idea",variant:"destructive"})}}),Ka=W({mutationFn:async j=>Q({method:"PATCH",url:`/api/idea-prioritization/${i}/context-questions`,data:j}),onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}`]}),a({title:"Context Updated",description:"Context questions have been successfully updated"});const j=Ir("context-questions"),M=j.affectedAnalyses.filter(Z=>!!{"thinking-hats":Gs.length>0}[Z]);if(M.length>0){const Z={};Object.entries(j.analysesByPhase).forEach(([rs,Zs])=>{const Ci=parseInt(rs,10),Ha=Zs.filter(Si=>M.includes(Si));Ha.length>0&&(Z[Ci]=Ha)});const Ie={...j,affectedAnalyses:M,analysesByPhase:Z};E(Ie),F(!0)}},onError:j=>{a({title:"Error",description:j?.message||"Failed to update context questions",variant:"destructive"})}}),vi=async j=>{await Ga.mutateAsync(j)},yi=async j=>{await Ka.mutateAsync(j)},wi=j=>{F(!1),j.length>0&&cs(j)},ki=()=>{F(!1),E(null)};if(!i)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("p",{children:"Invalid idea ID"})});if(ct)return e.jsxs(e.Fragment,{children:[e.jsx(Ht,{}),e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx(ae,{className:"h-12 w-12 animate-spin text-blue-600"})}),e.jsx(Ut,{})]});const{hatAnalyses:Gs=[]}=As?.data||{};if(!_)return e.jsxs(e.Fragment,{children:[e.jsx(Ht,{}),e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx(m,{className:"max-w-md",children:e.jsxs(x,{className:"pt-6 text-center",children:[e.jsx(X,{className:"h-12 w-12 text-red-500 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Idea Not Found"}),e.jsx("p",{className:"text-foreground mb-4",children:"The idea you're looking for doesn't exist."}),e.jsx(Vt,{href:"/idea-validation",children:e.jsx(R,{children:"Back to Ideas"})})]})})}),e.jsx(Ut,{})]});const Va=Gs.reduce((j,M)=>{const Z=ed(M.hatType);return j[Z]||(j[Z]=[]),j[Z].push(M),j},{}),Gt=Sl({assumptionMapping:Es?.data,fiveWhys:Xs?.data,thinkingHatsAnalysis:Gs.length>0,marketViability:Je?.data,competitiveLandscape:ue?.data,executionReadiness:be?.data,socialValidation:Se?.data,expertValidation:
196He?.data,opportunityAssessment:Pe?.data,jtbdDiscovery:us?.data,targetPersonas:qe?.data?.length>0,empathyMap:Fs?.data,customerJourneyMap:Rs?.data,businessModelCanvas:Ve?.data,leanCanvas:os?.data,valuePropositionCanvas:Qe?.data,kanoModel:ps?.data,featureImpactMatrix:Is?.data,problemSolutionFit:Re?.data,heartFramework:zs?.data,riceScore:G?.riceScore,moscowPrioritization:G?.moscowPriority,iceScore:G?.iceScore,executionPlan:We?.data,investorOutlook:ms?.data}),Ae=Gt.filter(j=>j.status==="complete").map(j=>j.id),Me={hasCustomerInterviews:!!(fe?.data?.count&&fe.data.count>0),hasMarketSizing:!!hs?.data,hasCompetitiveAnalysis:!!ue?.data,hasBusinessModel:!!(Ve?.data||os?.data||Qe?.data),hasFinancialProjections:!!xs?.data};return e.jsxs(e.Fragment,{children:[e.jsx(on,{title:`${_.title} - Idea Analysis`,description:_.description}),e.jsx(Ht,{}),e.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-blue-50 via-white to-indigo-50",children:[e.jsx("section",{className:"bg-gradient-to-br from-blue-50 via-indigo-50 to-blue-100 py-8 md:py-12",children:e.jsxs("div",{className:"w-full px-4 md:px-6 lg:px-8",children:[e.jsx("div",{className:"mb-4",children:e.jsx(Vt,{href:"/idea-validation",children:e.jsxs(R,{variant:"ghost",className:"text-foreground hover:bg-blue-100",children:[e.jsx(tn,{className:"mr-2 h-4 w-4"}),"Back to Ideas"]})})}),e.jsxs(Y.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4 flex-wrap",children:[_.syntheticId&&e.jsxs(I,{className:"bg-blue-100 text-blue-800 border-blue-300 font-mono text-sm uppercase",children:["ID: ",_.syntheticId]}),_.category&&e.jsx(I,{className:"bg-indigo-100 text-indigo-800 border-indigo-300 uppercase",children:_.category}),e.jsx(I,{className:`uppercase ${_.status==="completed"?"bg-green-100 text-green-800 border-green-300":_.status==="analyzing"?"bg-blue-100 text-blue-800 border-blue-300":_.status==="failed"?"bg-red-100 text-red-800 border-red-300":"bg-muted/50 text-foreground border-border"}`,children:_.status})]}),e.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[e.jsx("h1",{className:"text-3xl md:text-5xl font-bold text-foreground flex-1",children:_.title}),e.jsxs(R,{variant:"outline",size:"sm",onClick:()=>T(!0),className:"rounded-full flex-shrink-0","data-testid":"button-edit-idea",children:[e.jsx(wa,{className:"h-4 w-4 mr-2"}),"Edit Idea"]})]}),e.jsx("p",{className:"text-lg md:text-xl text-foreground",children:_.description}),_.context&&e.jsxs("div",{className:"mt-4 p-4 bg-blue-100 rounded-lg border border-blue-200",children:[e.jsx("p",{className:"text-sm text-blue-900 font-medium mb-2",children:"Additional Context:"}),e.jsx("p",{className:"text-blue-800",children:_.context})]})]})]})}),e.jsx(Dl,{phases:Gt,currentPhase:N,onPhaseClick:j=>{w(j),C(M=>({...M,[j]:!M[j]})),setTimeout(()=>{const M=document.getElementById(`phase-${j}`);M&&M.scrollIntoView({behavior:"smooth",block:"start"})},100)}}),e.jsx("div",{className:"w-full px-4 md:px-6 lg:px-8 py-8",children:e.jsxs("div",{className:"flex gap-6",children:[e.jsx("aside",{className:"hidden lg:block w-80 flex-shrink-0 sticky top-20 self-start",children:e.jsx(Cl,{phases:Gt,currentPhase:N,onPhaseClick:j=>{w(j),C(M=>({...M,[j]:!M[j]})),setTimeout(()=>{const M=document.getElementById(`phase-${j}`);M&&M.scrollIntoView({behavior:"smooth",block:"start"})},100)}})}),e.jsxs("main",{className:"flex-1 min-w-0 space-y-8",children:[e.jsxs(Vs,{phaseNumber:1,title:"Define & Hypothesize",description:"Map assumptions, identify root causes, and validate with AI reasoning",isOpen:P[1],onToggle:j=>C(M=>({...M,1:j})),advisorMode:Fe?.data?.advisorMode??!1,guidance:B[1],completedPhases:Ae,availableData:Me,onGenerateGuidance:()=>Bs.mutate({phase:1,completedPhases:Ae,availableData:Me}),isGeneratingGuidance:Ds[1]??!1,isLoadingAdvisor:Ye,children:[e.jsxs(oe,{title:"Advisor Mode",defaultOpen:!0,children:[e.jsx(pd,{advisorMode:Fe?.data?.advisorMode??!1,onToggle:j=>Ba.mutate(j),tarPitAnalysis:Fe?.data?.tarPitAnalysis??null,proxies:Fe?.data?.proxies??[],onGenerateTarPit:()=>qa.mutate(),onGenerateProxies:()=>La.mutate(),isTogglingAdvisorMode:Ba.isPending,isGeneratingTarPit:qa.isPending,isGeneratingProxies:La.isPending,isLoading:Ye}),Fe?.data?.advisorMode&&i&&e.jsx("div",{className:"mt-6",children:e.jsx(gd,{ideaSyntheticId:i,recipeProgress:Fe?.data?.recipeProgress??[],onGenerateInsights:(j,M)=>bi.mutate({recipeType:j,notes:M}),isGenerating:fi,isLoading:Ye})})]}),_.generatedQuestions&&_.clarifyingQuestions&&e.jsx(oe,{title:"Follow-up Questions & Answers",defaultOpen:!0,children:e.jsx(m,{className:"shadow-lg border",children:e.jsxs(x,{className:"pt-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Context Questions"}),e.jsxs(R,{variant:"outline",size:"sm",onClick:()=>A(!0),className:"rounded-full","data-testid":"button-edit-context-questions",children:[e.jsx(wa,{className:"h-4 w-4 mr-2"}),"Edit Q&A"]})]}),e.jsx("div",{className:"space-y-6",children:_.generatedQuestions.map((j,M)=>{const Z=_.clarifyingQuestions[j.id];return Z?e.jsxs(Y.div,{initial:{opacity:0,y:10}
196,animate:{opacity:1,y:0},transition:{delay:M*.1},className:"p-4 bg-card rounded-lg border border-border hover:border-indigo-300 transition-colors",children:[e.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[e.jsxs("div",{className:"flex-shrink-0 w-8 h-8 bg-indigo-100 text-indigo-600 rounded-full flex items-center justify-center font-semibold text-sm",children:["Q",M+1]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium text-foreground text-lg",children:j.question}),j.category&&e.jsx(I,{className:"mt-2 bg-muted/50 text-foreground border-border text-xs uppercase",children:j.category.replace("_"," ")})]})]}),e.jsx("div",{className:"ml-11 pl-4 border-l-2 border-indigo-200",children:e.jsx("p",{className:"text-foreground text-base leading-relaxed whitespace-pre-wrap",children:Z})})]},j.id):null})}),e.jsx("div",{className:"mt-6 p-4 bg-indigo-50 rounded-lg border border-indigo-200",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ft,{className:"h-5 w-5 text-indigo-600 flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-sm text-indigo-800",children:"These questions and answers were used to provide enhanced context to all Thinking Hat Agents during analysis."})]})})]})})}),_.status==="analyzing"&&e.jsx("section",{className:"mb-8",children:e.jsx(m,{className:"max-w-2xl mx-auto",children:e.jsxs(x,{className:"pt-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx(ae,{className:"h-6 w-6 animate-spin text-blue-600"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg",children:"Analysis in Progress"}),e.jsx("p",{className:"text-sm text-foreground",children:"Our Thinking Hat Agents are evaluating your idea..."})]})]}),e.jsx(de,{value:_.progress||0,className:"h-3"}),e.jsxs("p",{className:"text-sm text-foreground mt-2 text-center",children:[_.progress||0,"% complete"]})]})})}),G&&_.status==="completed"&&e.jsx(oe,{title:"Overall Assessment",defaultOpen:!0,children:e.jsx(md,{ranking:G,analysesByCategory:Va})}),e.jsx(oe,{title:"5 Whys Analysis",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsx(x,{className:"p-6",children:Xs?.data?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(Ne,{onClick:()=>jt.mutate(),isLoading:jt.isPending,testId:"button-regenerate-five-whys"})}),e.jsx(bl,{analysis:Xs.data})]}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Gr,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4","data-testid":"icon-five-whys-empty"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2","data-testid":"heading-five-whys-empty",children:"No 5 Whys Analysis Yet"}),e.jsx("p",{className:"text-foreground mb-6","data-testid":"text-five-whys-empty",children:'Dig deep into the root causes of problems by asking "why" five times.'}),e.jsx(te,{onClick:()=>jt.mutate(),isLoading:jt.isPending,label:"Generate 5 Whys Analysis",testId:"button-generate-five-whys"})]})})})})}),e.jsx(oe,{title:"Assumption Mapping",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsx(x,{className:"p-6",children:Es?.data?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(Ne,{onClick:()=>Ls.mutate(),isLoading:Ls.isPending,testId:"button-regenerate-assumption-mapping"})}),e.jsx(hl,{mapping:Es.data})]}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(me,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4","data-testid":"icon-assumption-empty"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2","data-testid":"heading-assumption-empty",children:"No Assumption Mapping Yet"}),e.jsx("p",{className:"text-foreground mb-6","data-testid":"text-assumption-empty",children:"Identify and prioritize the riskiest assumptions about your idea's desirability, feasibility, and viability."}),e.jsx(te,{onClick:()=>Ls.mutate(),isLoading:Ls.isPending,label:"Generate Assumption Mapping",testId:"button-generate-assumption"})]})})})})}),Gs.length>0&&e.jsx(oe,{title:"AI Reasoning - Thinking Hats",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsx(x,{className:"p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(Ne,{onClick:()=>Oa.mutate(),isLoading:Oa.isPending||_?.status==="analyzing",testId:"button-regenerate-thinking-hats"})}),e.jsx(id,{analysesByCategory:Va})]})})})})})]}),e.jsx(Vs,{phaseNumber:2,title:"Market Research",description:"Analyze market viability, competitive landscape, and opportunity factors",isOpen:P[2],onToggle:j=>C(M=>({...M,2:j})),advisorMode:Fe?.data?.advisorMode??!1,guidance:B[2],completedPhases:Ae,availableData:Me,onGenerateGuidance:()=>Bs.mutate({phase:2,completedPhases:Ae,availableData:Me}),isGeneratingGuidance:Ds[2]??!1,isLoadingAdvisor:Ye,children:G&&_.ideaType==="product"&&e.jsx(oe,{title:"Market Research & Trust Signals",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsx(x,{className:"p-6",children:e.jsxs(ye,{value:g,onValueChange:h,className:"w-full",children:[e.jsx("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-2",children:e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsxs(we,{className:"w-full md:w-auto inline-flex min-w-full md:min-w-0 gap-2",children:[e.jsx(K,{value:"market-viability",className:"flex-1 md:flex-none","data-testid":"tab-market-viability",children:"Market Viability"}),e.jsx(K,{value:"competitive-landscape",className:"flex-1 md:flex-none","data-testid":"tab-competitive-landscape",children:"Competitive Landscape"}),e.jsx(K,{value:"execution-readiness",className:"flex-1 md:flex-none","data-testid":"tab-execution-readiness",children:"Execution Readiness"}),e.jsx(K,{value:"social-validation",className:"flex-1 md:flex-none","data-testid":"tab-social-validation",children:"Social Validation"}),e.jsx(K,{value:"expert-validation",className:"flex-1 md:flex-none","data-testid":"tab-expert-validation",children:"Expert Validation"})]})})}),e.jsx(U,{value:"market-viability",children:Je?.data?e.jsx(Jn,{marketViability:Je.data,onRegenerate:()=>ot.mutate(),isRegenerating:ot.isPending}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(V,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No Market Viability Analysis Yet"}),e.jsx("p",{className:"text-foreground mb-6",children:"Generate a comprehensive market size, unit economics, and revenue projection analysis."}),e.jsx(te,{onClick:()=>ot.mutate(),isLoading:ot.isPending,label:"Generate Market Viability",testId:"button-generate-market-viability"})]})}),e.jsx(U,{value:"competitive-landscape",children:ue?.data?e.jsx(Wn,{competitiveLandscape:ue.data,onRegenerate:()=>mt.mutate(),isRegenerating:mt.isPending}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(ne,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No Competitive Landscape Analysis Yet"}),e.jsx("p",{className:"text-foreground mb-6",children:"Analyze your competitive position, market saturation, and differentiation strategies."}),e.jsx(te,{onClick:()=>mt.mutate(),isLoading:mt.isPending,label:"Generate Competitive Landscape",testId:"button-generate-competitive-landscape"})]})}),e.jsx(U,{value:"execution-readiness",children:be?.data?e.jsx(Yn,{executionReadiness:be.data,onRegenerate:()=>xt.mutate(),isRegenerating:xt.isPending}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(xe,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No Execution Readiness Analysis Yet"}),e.jsx("p",{className:"text-foreground mb-6",children:"Assess technical feasibility, team requirements, and implementation roadmap."}),e.jsx(te,{onClick:()=>xt.mutate(),isLoading:xt.isPending,label:"Generate Execution Readiness",testId:"button-generate-execution-readiness"})]})}),e.jsx(U,{value:"social-validation",children:Se?.data?e.jsx(Xn,{socialValidation:Se.data,onRegenerate:()=>ht.mutate(),isRegenerating:ht.isPending}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(ne,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No Social Validation Analysis Yet"}),e.jsx("p",{className:"text-foreground mb-6",children:"Evaluate social proof, community sentiment, and influencer end
196orsements."}),e.jsx(te,{onClick:()=>ht.mutate(),isLoading:ht.isPending,label:"Generate Social Validation",testId:"button-generate-social-validation"})]})}),e.jsx(U,{value:"expert-validation",children:He?.data?e.jsx(Zn,{expertValidation:He.data,onRegenerate:()=>ut.mutate(),isRegenerating:ut.isPending}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(De,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No Expert Validation Analysis Yet"}),e.jsx("p",{className:"text-foreground mb-6",children:"Review success probability, historical precedents, and expert recommendations."}),e.jsx(te,{onClick:()=>ut.mutate(),isLoading:ut.isPending,label:"Generate Expert Validation",testId:"button-generate-expert-validation"})]})})]})})})})})}),e.jsxs(Vs,{phaseNumber:3,title:"User Research",description:"Understand customer needs through personas and user research",isOpen:P[3],onToggle:j=>C(M=>({...M,3:j})),advisorMode:Fe?.data?.advisorMode??!1,guidance:B[3],completedPhases:Ae,availableData:Me,onGenerateGuidance:()=>Bs.mutate({phase:3,completedPhases:Ae,availableData:Me}),isGeneratingGuidance:Ds[3]??!1,isLoadingAdvisor:Ye,children:[G&&e.jsx(oe,{title:"Target Personas",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsx(x,{className:"p-6",children:qe?.data&&qe.data.length>0?e.jsxs(ye,{value:d||qe.data[0]?.id,onValueChange:o,className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-2",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsx(we,{className:"w-full md:w-auto inline-flex min-w-full md:min-w-0 gap-2",children:qe.data.map(j=>e.jsx(K,{value:j.id,className:"flex-1 md:flex-none","data-testid":`tab-persona-${j.id}`,children:j.name},j.id))})}),e.jsx("div",{className:"flex-shrink-0 flex gap-2",children:e.jsx(Vt,{href:`/idea-validation/${i}/survey-results`,children:e.jsxs(R,{variant:"outline",size:"sm",className:"rounded-full","data-testid":"button-view-survey-results-tabs",children:[e.jsx(ls,{className:"h-4 w-4 mr-2"}),"View Survey Results"]})})})]}),qe.data.map(j=>e.jsx(U,{value:j.id,className:"mt-0",children:e.jsx(_n,{personas:qe.data,personaFilter:j.id,ideaSyntheticId:i})},j.id))]}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(an,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No Target Personas Yet"}),e.jsx("p",{className:"text-foreground mb-6",children:"Generate detailed target personas with survey questions to validate your assumptions about potential users."}),e.jsx(te,{onClick:()=>Da.mutate(),isLoading:Da.isPending,label:"Generate Target Personas",testId:"button-generate-personas-empty"})]})})})})}),e.jsx(oe,{title:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{children:"Customer Interviews"}),fe&&e.jsxs(I,{variant:fe.data.count>=30?"default":"secondary",className:"ml-2 uppercase",children:[fe.data.count," ",r()?"/ 50":"conversations"]})]}),defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsxs(m,{className:"shadow-lg",children:[e.jsxs(u,{children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(Js,{className:"h-5 w-5"}),"Customer Conversations"]}),e.jsx(O,{className:"mt-2",children:r()?"Track your customer discovery interviews to validate the problem. Talk to 30-50 potential customers to identify patterns.":"Document customer conversations to gather insights and validate your assumptions with real user feedback."})]}),i&&e.jsx(Xl,{ideaSyntheticId:i,onSuccess:()=>{L.invalidateQueries({queryKey:[`/api/idea-prioritization/${i}/customer-interviews/count`]})}})]}),r()&&fe&&fe.data.count<30&&e.jsx("div",{className:"mt-4 p-4 bg-amber-50 border border-amber-200 rounded-xl",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(me,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-amber-900 text-sm",children:"Early Stage Recommendation"}),e.jsxs("p",{className:"text-sm text-amber-800 mt-1",children:["You've logged ",fe.data.count," interviews. Aim for 30-50 customer conversations before building your solution to ensure you're solving a real problem."]})]})]})})]}),e.jsx(x,{children:i&&e.jsx(Zl,{ideaSyntheticId:i})})]})})})]}),e.jsxs(Vs,{phaseNumber:4,title:"Business Model",description:"Design your business canvas and opportunity assessment",isOpen:P[4],onToggle:j=>C(M=>({...M,4:j})),advisorMode:Fe?.data?.advisorMode??!1,guidance:B[4],completedPhases:Ae,availableData:Me,onGenerateGuidance:()=>Bs.mutate({phase:4,completedPhases:Ae,availableData:Me}
196),isGeneratingGuidance:Ds[4]??!1,isLoadingAdvisor:Ye,children:[r()&&fe&&fe.data.count<30&&e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"mb-6",children:e.jsx("div",{className:"p-6 bg-amber-50 border-2 border-amber-300 rounded-xl",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"p-2 bg-amber-100 rounded-lg",children:e.jsx(X,{className:"h-6 w-6 text-amber-600"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold text-amber-900 text-lg mb-2",children:"⚠️ Readiness Gate: Customer Validation Recommended"}),e.jsxs("p",{className:"text-amber-800 mb-3",children:["You've logged only ",fe.data.count," customer interviews. Business models work best after validating the problem with 30+ customer conversations."]}),e.jsxs("p",{className:"text-sm text-amber-700",children:[e.jsx("strong",{children:"Why this matters:"})," Building a business model before understanding customer problems often leads to solutions looking for problems. Talk to more customers first."]})]})]})})}),G&&_.ideaType==="product"&&e.jsx(oe,{title:"Strategic Canvases",defaultOpen:!0,children:e.jsx(xd,{syntheticId:i,bmcData:Ve,leanCanvasData:os,valuePropositionCanvasData:Qe,generateBMCMutation:pi,generateLeanCanvasMutation:gi,generateValuePropositionCanvasMutation:ji})}),G&&_.ideaType==="product"&&e.jsx(oe,{title:"Opportunity Assessment",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsx(x,{className:"p-6",children:e.jsxs(ye,{value:c,onValueChange:n,className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-2",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsxs(we,{className:"w-full md:w-auto inline-flex min-w-full md:min-w-0 gap-2",children:[e.jsx(K,{value:"team",className:"flex-1 md:flex-none","data-testid":"tab-opportunity-team",children:"Team"}),e.jsx(K,{value:"market",className:"flex-1 md:flex-none","data-testid":"tab-opportunity-market",children:"Market"}),e.jsx(K,{value:"timing",className:"flex-1 md:flex-none","data-testid":"tab-opportunity-timing",children:"Timing"}),e.jsx(K,{value:"competition",className:"flex-1 md:flex-none","data-testid":"tab-opportunity-competition",children:"Competition"}),e.jsx(K,{value:"business-model",className:"flex-1 md:flex-none","data-testid":"tab-opportunity-business-model",children:"Business Model"}),e.jsx(K,{value:"risk",className:"flex-1 md:flex-none","data-testid":"tab-opportunity-risk",children:"Risk"})]})}),!Pe?.data&&e.jsx("div",{className:"flex-shrink-0",children:e.jsx(te,{onClick:()=>Le.mutate(),isLoading:Le.isPending,label:"Generate Assessment",testId:"button-generate-opportunity-assessment"})}),Pe?.data?.status==="completed"&&e.jsxs("div",{className:"flex-shrink-0 flex gap-2",children:[e.jsx(Mt,{canvasName:"Opportunity Assessment",children:e.jsx($r,{assessment:Pe.data,syntheticId:i})}),e.jsx(Ne,{onClick:()=>Le.mutate(),isLoading:Le.isPending,testId:"button-regenerate-opportunity-assessment"})]})]}),["team","market","timing","competition","business-model","risk"].map(j=>{const Z={team:"Team",market:"Market",timing:"Timing",competition:"Competition","business-model":"Business Model",risk:"Risk"}[j]||j;return e.jsx(U,{value:j,className:"mt-0",children:Pe?.data?.status==="analyzing"?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(ae,{className:"h-16 w-16 mx-auto text-amber-600 mb-4 animate-spin"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Analyzing Opportunity Factors..."}),e.jsxs("p",{className:"text-foreground mb-4",children:["AI is evaluating ",Pe.data.progress,"% complete"]}),e.jsx(de,{value:Pe.data.progress||0,className:"w-64 mx-auto"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:"This process takes approximately 3 minutes to analyze all 19 factors"})]}):Pe?.data?.status==="completed"?e.jsx($r,{assessment:Pe.data,syntheticId:i,categoryFilter:Z}):Pe?.data?.status==="failed"?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(X,{className:"h-16 w-16 mx-auto text-red-400 mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Analysis Failed"}),e.jsx("p",{className:"text-foreground mb-6",children:"Something went wrong while analyzing opportunity factors. Please try again."}),e.jsx(R,{onClick:()=>Le.mutate(),disabled:Le.isPending,className:"rounded-full","data-testid":"button-retry-opportunity-assessment",children:Le.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"h-4 w-4 mr-2 animate-spin"}),"Retrying..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),"Retry Assessment"]})})]}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Ws,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No Opp
196ortunity Assessment Yet"}),e.jsx("p",{className:"text-foreground mb-6",children:"Generate a comprehensive assessment of 19 opportunity factors including market potential, timing, competition, monetization, and risk profile."}),e.jsx(R,{onClick:()=>Le.mutate(),disabled:Le.isPending,className:"rounded-full","data-testid":"button-generate-opportunity-assessment-empty",children:Le.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"h-4 w-4 mr-2 animate-spin"}),"Starting Assessment..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),"Generate Opportunity Assessment"]})})]})},j)})]})})})})})]}),e.jsx(Vs,{phaseNumber:5,title:"Product / Solution Design",description:"Prioritize features and validate solution fit",isOpen:P[5],onToggle:j=>C(M=>({...M,5:j})),advisorMode:Fe?.data?.advisorMode??!1,guidance:B[5],completedPhases:Ae,availableData:Me,onGenerateGuidance:()=>Bs.mutate({phase:5,completedPhases:Ae,availableData:Me}),isGeneratingGuidance:Ds[5]??!1,isLoadingAdvisor:Ye,children:G&&e.jsxs(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:[e.jsx("div",{className:"mb-6",children:e.jsx(ml,{ideaId:i,onGenerateMethod:Ni,hasJtbd:!!us?.data,hasAssumptionMapping:!!Es?.data,hasKano:!!ps?.data,isGeneratingJtbd:qs.isPending,isGeneratingAssumptionMapping:Ls.isPending,isGeneratingKano:Os.isPending})}),qt&&ui&&e.jsx(oe,{title:"Research Methods",defaultOpen:!0,children:e.jsx(m,{className:"shadow-lg",children:e.jsx(x,{className:"p-6",children:e.jsxs(ye,{value:f,onValueChange:b,className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-6",children:[e.jsx("div",{className:"overflow-x-auto flex-1",children:e.jsxs(we,{className:"inline-flex min-w-full md:min-w-0 gap-2","data-testid":"tabs-research-methods",children:[e.jsx(K,{value:"jtbd-discovery",className:"flex-1 md:flex-none","data-testid":"tab-jtbd-discovery",children:e.jsxs("div",{className:"flex items-center gap-2 whitespace-nowrap",children:["JTBD Discovery",qt?.recommendedMethod==="jtbd"&&e.jsx(I,{variant:"secondary",className:"text-xs uppercase","data-testid":"badge-recommended-jtbd",children:"Recommended"})]})}),e.jsx(K,{value:"kano-model",className:"flex-1 md:flex-none","data-testid":"tab-kano-model",children:e.jsxs("div",{className:"flex items-center gap-2 whitespace-nowrap",children:["Kano Model",qt?.recommendedMethod==="kano"&&e.jsx(I,{variant:"secondary",className:"text-xs uppercase","data-testid":"badge-recommended-kano",children:"Recommended"})]})}),e.jsx(K,{value:"customer-journey-map",className:"flex-1 md:flex-none","data-testid":"tab-customer-journey-map",children:e.jsx("span",{className:"whitespace-nowrap",children:"Customer Journey Map"})}),e.jsx(K,{value:"empathy-map",className:"flex-1 md:flex-none","data-testid":"tab-empathy-map",children:e.jsx("span",{className:"whitespace-nowrap",children:"Empathy Map"})}),e.jsx(K,{value:"problem-solution-fit",className:"flex-1 md:flex-none","data-testid":"tab-problem-solution-fit",children:e.jsx("span",{className:"whitespace-nowrap",children:"Problem-Solution Fit"})}),e.jsx(K,{value:"feature-impact-matrix",className:"flex-1 md:flex-none","data-testid":"tab-feature-impact-matrix",children:e.jsx("span",{className:"whitespace-nowrap",children:"Feature Impact Matrix"})}),e.jsx(K,{value:"heart-framework",className:"flex-1 md:flex-none","data-testid":"tab-heart-framework",children:e.jsx("span",{className:"whitespace-nowrap",children:"HEART Framework"})})]})}),e.jsxs("div",{className:"flex-shrink-0",children:[f==="jtbd-discovery"&&us?.data&&e.jsx(Ne,{onClick:()=>qs.mutate(),isLoading:qs.isPending,testId:"button-regenerate-jtbd"}),f==="kano-model"&&ps?.data&&e.jsx(Ne,{onClick:()=>Os.mutate(),isLoading:Os.isPending,testId:"button-regenerate-kano"}),f==="customer-journey-map"&&Rs?.data&&e.jsx(Ne,{onClick:()=>pt.mutate(),isLoading:pt.isPending,testId:"button-regenerate-journey-map"}),f==="empathy-map"&&Fs?.data&&e.jsx(Ne,{onClick:()=>gt.mutate(),isLoading:gt.isPending,testId:"button-regenerate-empathy-map"}),f==="problem-solution-fit"&&Re?.data&&e.jsx(Ne,{onClick:()=>ft.mutate(),isLoading:ft.isPending,testId:"button-regenerate-ps-fit"}),f==="feature-impact-matrix"&&Is?.data&&e.jsx(Ne,{onClick:()=>bt.mutate(),isLoading:bt.isPending,testId:"button-regenerate-feature-matrix"}),f==="heart-framework"&&zs?.data&&e.jsx(Ne,{onClick:()=>Nt.mutate(),isLoading:Nt.isPending,testId:"button-regenerate-heart"})]})]}),e.jsx(U,{value:"jtbd-discovery","data-testid":"content-jtbd-discovery",children:us?.data?e.jsx(xl,{analysis:us.data}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(he,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4","data-testid":"icon-jtbd-empty"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2","data-testid":"heading-jtbd-empty",children:"No JTBD Discovery Yet"}),e.jsx("p",{className:"text-foreground mb-6","data-testid":"text-jtbd-empty",children:"Discover the core job your customers are trying to accomplish and what outcomes they desire."}),e.jsx(te,{onClick:()=>qs.mutate(),isLoading:qs.isPending,label:"Generate JTBD Discovery",testId:"button-generate-jtbd"})]})}),e.jsx(U,{value:"kano-model","data-testid":"content-kano-model",children:ps?.data?e.jsx(ul,{analysis:ps.data}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(ie,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4","data-testid":"icon-kano-empty"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2","data-testid":"heading-kano-empty",children:"No Kano Model Yet"}),e.jsx("p",{className:"text-foreground mb-6","data-testid":"text-kano-empty",children:"Classify features to maximize customer satisfaction and build a strategic MVP roadmap."}),e.jsx(te,{onClick:()=>Os.mutate(),isLoading:Os.isPending,label:"Generate Kano Model",testId:"button-generate-kano"})]})}),e.jsx(U,{value:"customer-journey-map","data-testid":"content-customer-journey-map",children:Rs?.data?e.jsx(gl,{map:Rs.data}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(V,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4","data-testid":"icon-journey-empty"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2","data-testid":"heading-journey-empty",children:"No Customer Journey Map Yet"}),e.jsx("p",{className:"text-foreground mb-6","data-testid":"text-journey-empty",children:"Map your customer's experience across all touchpoints and identify opportunities for improvement."}),e.jsx(te,{onClick:()=>pt.mutate(),isLoading:pt.isPending,label:"Generate Customer Journey Map",testId:"button-generate-journey-map"})]})}),e.jsx(U,{value:"empathy-map","data-testid":"content-empathy-map",children:Fs?.data?e.jsx(fl,{map:Fs.data}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(ne,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4","data-testid":"icon-empathy-empty"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2","data-testid":"heading-empathy-empty",children:"No Empathy Map Yet"}),e.jsx("p",{className:"text-foreground mb-6","data-testid":"text-empathy-empty",children:"Understand what your users think, feel, say, and do to build solutions that resonate."}),e.jsx(te,{onClick:()=>gt.mutate(),isLoading:gt.isPending,label:"Generate Empathy Map",testId:"button-generate-empathy-map"})]})}),e.jsx(U,{value:"problem-solution-fit","data-testid":"content-problem-solution-fit",children:Re?.data?e.jsx(vl,{fit:Re.data}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(V,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4","data-testid":"icon-ps-fit-empty"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2","data-testid":"heading-ps-fit-empty",children:"No Problem-Solution Fit Yet"}),e.jsx("p",{className:"text-foreground mb-6","data-testid":"text-ps-fit-empty",children:"Validate that your solution effectively addresses the identified customer problems."}),e.jsx(te,{onClick:()=>ft.mutate(),isLoading:ft.isPending,label:"Generate Problem-Solution Fit",testId:"button-generate-ps-fit"})]})}),e.jsx(U,{value:"feature-impact-matrix","data-testid":"content-feature-impact-matrix",children:Is?.data?e.jsx(yl,{matrix:Is.data}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(ls,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4","data-testid":"icon-feature-matrix-empty"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2","data-testid":"heading-feature-matrix-empty",children:"No Feature Impact Matrix Yet"}),e.jsx("p",{className:"text-foreground mb-6","data-testid":"text-feature-matrix-empty",children:"Prioritize features based on their impact vs. effort to guide your product roadmap."}),e.jsx(te,{onClick:()=>bt.mutate(),isLoading:bt.isPending,label:"Generate Feature Impact Matrix",testId:"button-generate-feature-matrix"})]})}),e.jsx(U,{value:"heart-framework","data-testid":"content-heart-framework",children:zs?.data?e.jsx(wl,{framework:zs.data}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(De,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4","data-testid":"icon-heart-empty"}),e.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2","data-testid":"heading-heart-empty",children:"No HEART Framework Yet"}),e.jsx("p",{className:"text-foreground mb-6","data-testid":"text-heart-empty",children:"Measure user experience with Google's HEART framework: Happiness, Engagement, Adoption, Retention, and Task Success."}),e.jsx(te,{onClick:()=>Nt.mutate(),isLoading:Nt.isPending,label:"Generate HEART Framework",testId:"button-generate-heart"})]})})]})})})})]})}),e.jsxs(Vs,{phaseNumber:6,title:"Execute & Iterate",description:"Build your execution roadmap",
196isOpen:P[6],onToggle:j=>C(M=>({...M,6:j})),advisorMode:Fe?.data?.advisorMode??!1,guidance:B[6],completedPhases:Ae,availableData:Me,onGenerateGuidance:()=>Bs.mutate({phase:6,completedPhases:Ae,availableData:Me}),isGeneratingGuidance:Ds[6]??!1,isLoadingAdvisor:Ye,children:[Re?.data&&(Re.data.problemSolutionFitScore??Re.data.overallFitScore??100)<70&&e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"mb-6",children:e.jsx("div",{className:"p-6 bg-amber-50 border-2 border-amber-300 rounded-xl",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"p-2 bg-amber-100 rounded-lg",children:e.jsx(X,{className:"h-6 w-6 text-amber-600"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold text-amber-900 text-lg mb-2",children:"⚠️ Readiness Gate: Problem-Solution Fit Score Low"}),e.jsxs("p",{className:"text-amber-800 mb-3",children:["Your problem-solution fit score is ",Re.data.problemSolutionFitScore??Re.data.overallFitScore??"N/A","/100. Building an MVP before achieving strong problem-solution fit (70+) often wastes time and resources."]}),e.jsxs("p",{className:"text-sm text-amber-700",children:[e.jsx("strong",{children:"Recommendation:"})," Talk to more customers, iterate on your solution design, or run smaller experiments before committing to full MVP development."]})]})]})})}),G&&e.jsx(oe,{title:"Execution Plan",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsxs(x,{className:"p-6",children:[e.jsx("div",{className:"mb-4 flex justify-end",children:!We?.data&&e.jsx(te,{onClick:()=>Xe.mutate(),isLoading:Xe.isPending,label:"Generate Plan",testId:"button-generate-execution-plan"})}),We?.data?.status==="completed"?e.jsx(al,{executionPlan:We.data,onRegenerate:()=>Xe.mutate(),isRegenerating:Xe.isPending}):We?.data?.status==="generating"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(ae,{className:"h-12 w-12 animate-spin text-indigo-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Crafting Your Execution Plan"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"AI is synthesizing all your analyses into a comprehensive roadmap..."})]})]}):We?.data?.status==="failed"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(X,{className:"h-12 w-12 text-red-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Generation Failed"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"We encountered an issue generating your execution plan."}),e.jsxs(R,{onClick:()=>Xe.mutate(),disabled:Xe.isPending,variant:"outline","data-testid":"button-retry-execution-plan",children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Try Again"]})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx("div",{className:"p-6 bg-muted/50 rounded-full",children:e.jsx(at,{className:"h-12 w-12 text-muted-foreground"})}),e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"No Execution Plan Yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Generate a comprehensive execution plan that synthesizes all your strategic analyses into an actionable roadmap"}),e.jsx(te,{onClick:()=>Xe.mutate(),isLoading:Xe.isPending,label:"Generate Execution Plan",testId:"button-generate-execution-plan-empty"})]})]})]})})})}),G&&e.jsx(oe,{title:"Investor Outlook",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsxs(x,{className:"p-6",children:[e.jsx("div",{className:"mb-4 flex justify-end",children:!ms?.data&&e.jsx(te,{onClick:()=>Ze.mutate(),isLoading:Ze.isPending,label:"Generate Investor Analysis",testId:"button-generate-investor-outlook"})}),ms?.data?.status==="completed"?e.jsx(rl,{investorOutlook:ms.data,onRegenerate:()=>Ze.mutate(),isRegenerating:Ze.isPending}):ms?.data?.status==="generating"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(ae,{className:"h-12 w-12 animate-spin text-emerald-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Analyzing Investment Potential"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"AI is evaluating your idea from an investor perspective..."})]})]}):ms?.data?.status==="failed"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(X,{className:"h-12 w-12 text-red-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Generation Failed"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"We encountered an issue generating your investor outlook."}),e.jsxs(R,{onClick:()=>Ze.mutate(),disabled:Ze.isPending,variant:"outline","data-testid":"button-retry-investor-outlook",children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Try Again"]})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx("div",{className:"p-6 bg-muted/50 rounded-full",children:e.jsx(se,{className:"h-12 w-12 text-muted-foreground"})}),e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"No Investor Outlook Yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Get a comprehensive investment analysis evaluating your idea against VC criteria including TAM/SAM/SOM, unit economics, and growth potential"}),e.jsx(te,{onClick:()=>Ze.mutate(),isLoading:Ze.isPending,label:"Generate Investor Outlook",testId:"button-generate-investor-outlook-empty"})]})]})]})})})}),G&&e.jsx(oe,{title:"Financial Projections",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsxs(x,{className:"p-6",children:[e.jsx("div",{className:"mb-4 flex justify-end",children:!xs?.data&&e.jsx(te,{onClick:()=>es.mutate(),isLoading:es.isPending,label:"Generate Projections",testId:"button-generate-financial-projections"})}),xs?.data?.status==="completed"?e.jsx(il,{financialProjections:xs.data,onRegenerate:()=>es.mutate(),isRegenerating:es.isPending}):xs?.data?.status==="generating"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(ae,{className:"h-12 w-12 animate-spin text-green-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Building Financial Projections"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"AI is creating your 5-year financial forecast..."})]})]}):xs?.data?.status==="failed"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(X,{className:"h-12 w-12 text-red-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Generation Failed"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"We encountered an issue generating your financial projections."}),e.jsxs(R,{onClick:()=>es.mutate(),disabled:es.isPending,variant:"outline","data-testid":"button-retry-financial-projections",children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Try Again"]})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx("div",{className:"p-6 bg-muted/50 rounded-full",children:e.jsx(le,{className:"h-12 w-12 text-muted-foreground"})}),e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"No Financial Projections Yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create 5-year revenue forecasts with unit economics and break-even analysis"}),e.jsx(te,{onClick:()=>es.mutate(),isLoading:es.isPending,label:"Generate Financial Projections",testId:"button-generate-financial-projections-empty"})]})]})]})})})}),G&&e.jsx(oe,{title:"Market Sizing",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsxs(x,{className:"p-6",children:[e.jsx("div",{className:"mb-4 flex justify-end",children:!hs?.data&&e.jsx(te,{onClick:()=>ss.mutate(),isLoading:ss.isPending,label:"Generate Market Sizing",testId:"button-generate-market-sizing"})}),hs?.data?.status==="completed"?e.jsx(nl,{marketSizing:hs.data,onRegenerate:()=>ss.mutate(),isRegenerating:ss.isPending}):hs?.data?.status==="generating"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(ae,{className:"h-12 w-12 animate-spin text-blue-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Calculating Market Size"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"AI is analyzing TAM/SAM/SOM with defensible methodology..."})]})]}):hs?.data?.status==="failed"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(X,{className:"h-12 w-12 text-red-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Generation Failed"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"We encountered an issue generating your market sizing."}),e.jsxs(R,{onClick:()=>ss.mutate(),disabled:ss.isPending,variant:"outline","data-testid":"button-retry-market-sizing",children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Try Again"]})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx("div",{className:"p-6 bg-muted/50 rounded-full",children:e.jsx(js,{className:"h-12 w-12 text-muted-foreground"})}),e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"No Market Sizing Yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Calculate defensible TAM/SAM/SOM with methodology and data sources"}),e.jsx(te,{onClick:()=>ss.mutate(),isLoading:ss.isPending,label:"Generate Market Sizing",testId:"button-generate-market-sizing-empty"})]})]})]})})})}),G&&e.jsx(oe,{title:"Positioning Statements",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsxs(x,{className:"p-6",children:[e.jsx("div",{className:"mb-4 flex justify-end",children:!Ms?.data&&e.jsx(te,{onClick:()=>ts.mutate(),isLoading:ts.isPending,label:"Generate Positioning",testId:"button-generate-positioning-statements"})}),Ms?.data?.status==="completed"?e.jsx(ll,{positioningStatements:Ms.data,onRegenerate:()=>ts.mutate(),isRegenerating:ts.isPending}):Ms?.data?.status==="generating"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(ae,{className:"h-12 w-12 animate-spin text-purple-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Crafting Positioning Statements"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"AI is creating value propositions and messaging frameworks..."})]})]}):Ms?.data?.status==="failed"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(X,{className:"h-12 w-12 text-red-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Generation Failed"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"We encountered an issue generating your positioning statements."}),e.jsxs(R,{onClick:()=>ts.mutate(),disabled:ts.isPending,variant:"outline","data-testid":"button-retry-p
196ositioning-statements",children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Try Again"]})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx("div",{className:"p-6 bg-muted/50 rounded-full",children:e.jsx(Js,{className:"h-12 w-12 text-muted-foreground"})}),e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"No Positioning Statements Yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Craft compelling value propositions, elevator pitches, and messaging frameworks"}),e.jsx(te,{onClick:()=>ts.mutate(),isLoading:ts.isPending,label:"Generate Positioning Statements",testId:"button-generate-positioning-statements-empty"})]})]})]})})})}),G&&e.jsx(oe,{title:"Team Profiles",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsxs(x,{className:"p-6",children:[e.jsx("div",{className:"mb-4 flex justify-end",children:!$s?.data&&e.jsx(te,{onClick:()=>as.mutate(),isLoading:as.isPending,label:"Generate Team Profiles",testId:"button-generate-team-profiles"})}),$s?.data?.status==="completed"?e.jsx(dl,{teamProfiles:$s.data,onRegenerate:()=>as.mutate(),isRegenerating:as.isPending}):$s?.data?.status==="generating"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(ae,{className:"h-12 w-12 animate-spin text-orange-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Creating Team Profiles"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"AI is documenting team, advisors, and hiring roadmap..."})]})]}):$s?.data?.status==="failed"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(X,{className:"h-12 w-12 text-red-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Generation Failed"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"We encountered an issue generating your team profiles."}),e.jsxs(R,{onClick:()=>as.mutate(),disabled:as.isPending,variant:"outline","data-testid":"button-retry-team-profiles",children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Try Again"]})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx("div",{className:"p-6 bg-muted/50 rounded-full",children:e.jsx(ne,{className:"h-12 w-12 text-muted-foreground"})}),e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"No Team Profiles Yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Document your team, advisors, and hiring roadmap for investors"}),e.jsx(te,{onClick:()=>as.mutate(),isLoading:as.isPending,label:"Generate Team Profiles",testId:"button-generate-team-profiles-empty"})]})]})]})})})}),G&&e.jsx(oe,{title:"Pitch Narrative",defaultOpen:!0,children:e.jsx(Y.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:e.jsx(m,{className:"shadow-lg",children:e.jsxs(x,{className:"p-6",children:[e.jsx("div",{className:"mb-4 flex justify-end",children:!Ts?.data&&e.jsx(te,{onClick:()=>Ue.mutate(),isLoading:Ue.isPending,label:"Generate Pitch Narrative",testId:"button-generate-pitch-narrative"})}),Ts?.data?.status==="completed"?e.jsx(cl,{pitchNarrative:Ts.data,onRegenerate:()=>Ue.mutate(),isRegenerating:Ue.isPending}):Ts?.data?.status==="generating"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(ae,{className:"h-12 w-12 animate-spin text-pink-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Writing Pitch Narrative"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"AI is creating your complete investor storyline..."})]})]}):Ts?.data?.status==="failed"?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(X,{className:"h-12 w-12 text-red-500"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"Generation Failed"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"We encountered an issue generating your pitch narrative."}),e.jsxs(R,{onClick:()=>Ue.mutate(),disabled:Ue.isPending,variant:"outline","data-testid":"button-retry-pitch-narrative",children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),"Try Again"]})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx("div",{className:"p-6 bg-muted/50 rounded-full",children:e.jsx(fs,{className:"h-12 w-12 text-muted-foreground"})}),e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",children:"No Pitch Narrative Yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Generate a complete investor storyline with slide-by-slide guidance"}),e.jsx(R,{onClick:()=>Ue.mutate(),disabled:Ue.isPending,className:"rounded-full","data-testid":"button-generate-pitch-narrative-empty",children:Ue.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"h-4 w-4 mr-2 animate-spin"}),"Writing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),"Generate Pitch Narrative"]})})]})]})]})})})})]})]})]})})]}),e.jsx("section",{className:"w-full bg-muted/30 border-t border-border",children:e.jsx("div",{className:"container mx-auto px-4 py-12 max-w-7xl",children:e.jsx(ol,{executionPlanData:We,investorOutlookData:ms,financialProjectionsData:xs,marketSizingData:hs,positioningStatementsData:Ms,teamProfilesData:$s,pitchNarrativeData:Ts,opportunityAssessmentData:Pe,marketViabilityData:Je,competitiveLandscapeData:ue,thinkingHatsData:Gs,socialValidationData:Se,expertValidationData:He,executionReadinessData:be})})}),e.jsx(Ut,{}
196),e.jsx(ql,{open:v,onOpenChange:T,currentData:{title:_.title,description:_.description,context:_.context,category:_.category,ideaType:_.ideaType},onSave:vi,isPending:Ga.isPending}),e.jsx(Ol,{open:$,onOpenChange:A,currentData:{generatedQuestions:_.generatedQuestions,clarifyingQuestions:_.clarifyingQuestions},onSave:yi,isPending:Ka.isPending}),e.jsx(Ul,{open:z,onOpenChange:F,plan:k,onConfirm:wi,onSkip:ki,isPending:Ee}),e.jsx(_l,{open:H.length>0&&Ee,items:H})]})}export{Dd as default};

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.