File: /var/www/indoadvisory_new/webapp/dist/_worker.js
var ea=Object.defineProperty;var Nt=e=>{throw TypeError(e)};var ta=(e,s,a)=>s in e?ea(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a;var x=(e,s,a)=>ta(e,typeof s!="symbol"?s+"":s,a),ut=(e,s,a)=>s.has(e)||Nt("Cannot "+a);var m=(e,s,a)=>(ut(e,s,"read from private field"),a?a.call(e):s.get(e)),w=(e,s,a)=>s.has(e)?Nt("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,a),y=(e,s,a,r)=>(ut(e,s,"write to private field"),r?r.call(e,a):s.set(e,a),a),_=(e,s,a)=>(ut(e,s,"access private method"),a);var Bt=(e,s,a,r)=>({set _(i){y(e,s,i,a)},get _(){return m(e,s,r)}});var ms={Stringify:1},$=(e,s)=>{const a=new String(e);return a.isEscaped=!0,a.callbacks=s,a},sa=/[&<>'"]/,hs=async(e,s)=>{let a="";s||(s=[]);const r=await Promise.all(e);for(let i=r.length-1;a+=r[i],i--,!(i<0);i--){let n=r[i];typeof n=="object"&&s.push(...n.callbacks||[]);const o=n.isEscaped;if(n=await(typeof n=="object"?n.toString():n),typeof n=="object"&&s.push(...n.callbacks||[]),n.isEscaped??o)a+=n;else{const l=[a];te(n,l),a=l[0]}}return $(a,s)},te=(e,s)=>{const a=e.search(sa);if(a===-1){s[0]+=e;return}let r,i,n=0;for(i=a;i<e.length;i++){switch(e.charCodeAt(i)){case 34:r=""";break;case 39:r="'";break;case 38:r="&";break;case 60:r="<";break;case 62:r=">";break;default:continue}s[0]+=e.substring(n,i)+r,n=i+1}s[0]+=e.substring(n,i)},fs=e=>{const s=e.callbacks;if(!(s!=null&&s.length))return e;const a=[e],r={};return s.forEach(i=>i({phase:ms.Stringify,buffer:a,context:r})),a[0]},ps=async(e,s,a,r,i)=>{typeof e=="object"&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));const n=e.callbacks;return n!=null&&n.length?(i?i[0]+=e:i=[e],Promise.all(n.map(l=>l({phase:s,buffer:i,context:r}))).then(l=>Promise.all(l.filter(Boolean).map(c=>ps(c,s,!1,r,i))).then(()=>i[0]))):Promise.resolve(e)},aa=(e,...s)=>{const a=[""];for(let r=0,i=e.length-1;r<i;r++){a[0]+=e[r];const n=Array.isArray(s[r])?s[r].flat(1/0):[s[r]];for(let o=0,l=n.length;o<l;o++){const c=n[o];if(typeof c=="string")te(c,a);else if(typeof c=="number")a[0]+=c;else{if(typeof c=="boolean"||c===null||c===void 0)continue;if(typeof c=="object"&&c.isEscaped)if(c.callbacks)a.unshift("",c);else{const d=c.toString();d instanceof Promise?a.unshift("",d):a[0]+=d}else c instanceof Promise?a.unshift("",c):te(c.toString(),a)}}}return a[0]+=e.at(-1),a.length===1?"callbacks"in a?$(fs($(a[0],a.callbacks))):$(a[0]):hs(a,a.callbacks)},It=Symbol("RENDERER"),kt=Symbol("ERROR_HANDLER"),S=Symbol("STASH"),gs=Symbol("INTERNAL"),ra=Symbol("MEMO"),rt=Symbol("PERMALINK"),Ft=e=>(e[gs]=!0,e),xs=e=>({value:s,children:a})=>{if(!a)return;const r={children:[{tag:Ft(()=>{e.push(s)}),props:{}}]};Array.isArray(a)?r.children.push(...a.flat()):r.children.push(a),r.children.push({tag:Ft(()=>{e.pop()}),props:{}});const i={tag:"",props:r,type:""};return i[kt]=n=>{throw e.pop(),n},i},bs=e=>{const s=[e],a=xs(s);return a.values=s,a.Provider=a,Ee.push(a),a},Ee=[],Pt=e=>{const s=[e],a=r=>{s.push(r.value);let i;try{i=r.children?(Array.isArray(r.children)?new ks("",{},r.children):r.children).toString():""}finally{s.pop()}return i instanceof Promise?i.then(n=>$(n,n.callbacks)):$(i)};return a.values=s,a.Provider=a,a[It]=xs(s),Ee.push(a),a},Se=e=>e.values.at(-1),Je={title:[],script:["src"],style:["data-href"],link:["href"],meta:["name","httpEquiv","charset","itemProp"]},Et={},Ge="data-precedence",He=e=>Array.isArray(e)?e:[e],Ut=new WeakMap,qt=(e,s,a,r)=>({buffer:i,context:n})=>{if(!i)return;const o=Ut.get(n)||{};Ut.set(n,o);const l=o[e]||(o[e]=[]);let c=!1;const d=Je[e];if(d.length>0){e:for(const[,u]of l)for(const h of d)if(((u==null?void 0:u[h])??null)===(a==null?void 0:a[h])){c=!0;break e}}if(c?i[0]=i[0].replaceAll(s,""):d.length>0?l.push([s,a,r]):l.unshift([s,a,r]),i[0].indexOf("</head>")!==-1){let u;if(r===void 0)u=l.map(([h])=>h);else{const h=[];u=l.map(([f,,p])=>{let b=h.indexOf(p);return b===-1&&(h.push(p),b=h.length-1),[f,b]}).sort((f,p)=>f[1]-p[1]).map(([f])=>f)}u.forEach(h=>{i[0]=i[0].replaceAll(h,"")}),i[0]=i[0].replace(/(?=<\/head>)/,u.join(""))}},Ke=(e,s,a)=>$(new F(e,a,He(s??[])).toString()),We=(e,s,a,r)=>{if("itemProp"in a)return Ke(e,s,a);let{precedence:i,blocking:n,...o}=a;i=r?i??"":void 0,r&&(o[Ge]=i);const l=new F(e,o,He(s||[])).toString();return l instanceof Promise?l.then(c=>$(l,[...c.callbacks||[],qt(e,c,o,i)])):$(l,[qt(e,l,o,i)])},ia=({children:e,...s})=>{const a=jt();if(a){const r=Se(a);if(r==="svg"||r==="head")return new F("title",s,He(e??[]))}return We("title",e,s,!1)},na=({children:e,...s})=>{const a=jt();return["src","async"].some(r=>!s[r])||a&&Se(a)==="head"?Ke("script",e,s):We("script",e,s,!1)},la=({children:e,...s})=>["href","precedence"].every(a=>a in s)?(s["data-href"]=s.href,delete s.href,We("style",e,s,!0)):Ke("style",e,s),oa=({children:e,...s})=>["onLoad","onError"].some(a=>a in s)||s.rel==="stylesheet"&&(!("precedence"in s)||"disabled"in s)?Ke("link",e,s):We("link",e,s,"precedence"in s),ca=({children:e,...s})=>{const a=jt();return a&&Se(a)==="head"?Ke("meta",e,s):We("meta",e,s,!1)},ys=(e,{children:s,...a})=>new F(e,a,He(s??[])),da=e=>(typeof e.action=="function"&&(e.action=rt in e.action?e.action[rt]:void 0),ys("form",e)),vs=(e,s)=>(typeof s.formAction=="function"&&(s.formAction=rt in s.formAction?s.formAction[rt]:void 0),ys(e,s)),ua=e=>vs("input",e),ma=e=>vs("button",e);const mt=Object.freeze(Object.defineProperty({__proto__:null,button:ma,form:da,input:ua,link:oa,meta:ca,script:na,style:la,title:ia},Symbol.toStringTag,{value:"Module"}));var ha=new Map([["className","class"],["htmlFor","for"],["crossOrigin","crossorigin"],["httpEquiv","http-equiv"],["itemProp","itemprop"],["fetchPriority","fetchpriority"],["noModule","nomodule"],["formAction","formaction"]]),it=e=>ha.get(e)||e,ws=(e,s)=>{for(const[a,r]of Object.entries(e)){const i=a[0]==="-"||!/[A-Z]/.test(a)?a:a.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);s(i,r==null?null:typeof r=="number"?i.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/)?`${r}`:`${r}px`:r)}},Ce=void 0,jt=()=>Ce,fa=e=>/[A-Z]/.test(e)&&e.match(/^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e,pa=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ga=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],Dt=(e,s)=>{for(let a=0,r=e.length;a<r;a++){const i=e[a];if(typeof i=="string")te(i,s);else{if(typeof i=="boolean"||i===null||i===void 0)continue;i instanceof F?i.toStringToBuffer(s):typeof i=="number"||i.isEscaped?s[0]+=i:i instanceof Promise?s.unshift("",i):Dt(i,s)}}},F=class{constructor(e,s,a){x(this,"tag");x(this,"props");x(this,"key");x(this,"children");x(this,"isEscaped",!0);x(this,"localContexts");this.tag=e,this.props=s,this.children=a}get type(){return this.tag}get ref(){return this.props.ref||null}toString(){var s,a;const e=[""];(s=this.localContexts)==null||s.forEach(([r,i])=>{r.values.push(i)});try{this.toStringToBuffer(e)}finally{(a=this.localContexts)==null||a.forEach(([r])=>{r.values.pop()})}return e.length===1?"callbacks"in e?fs($(e[0],e.callbacks)).toString():e[0]:hs(e,e.callbacks)}toStringToBuffer(e){const s=this.tag,a=this.props;let{children:r}=this;e[0]+=`<${s}`;const i=Ce&&Se(Ce)==="svg"?n=>fa(it(n)):n=>it(n);for(let[n,o]of Object.entries(a))if(n=i(n),n!=="children"){if(n==="style"&&typeof o=="object"){let l="";ws(o,(c,d)=>{d!=null&&(l+=`${l?";":""}${c}:${d}`)}),e[0]+=' style="',te(l,e),e[0]+='"'}else if(typeof o=="string")e[0]+=` ${n}="`,te(o,e),e[0]+='"';else if(o!=null)if(typeof o=="number"||o.isEscaped)e[0]+=` ${n}="${o}"`;else if(typeof o=="boolean"&&ga.includes(n))o&&(e[0]+=` ${n}=""`);else if(n==="dangerouslySetInnerHTML"){if(r.length>0)throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");r=[$(o.__html)]}else if(o instanceof Promise)e[0]+=` ${n}="`,e.unshift('"',o);else if(typeof o=="function"){if(!n.startsWith("on")&&n!=="ref")throw new Error(`Invalid prop '${n}' of type 'function' supplied to '${s}'.`)}else e[0]+=` ${n}="`,te(o.toString(),e),e[0]+='"'}if(pa.includes(s)&&r.length===0){e[0]+="/>";return}e[0]+=">",Dt(r,e),e[0]+=`</${s}>`}},ht=class extends F{toStringToBuffer(e){const{children:s}=this,a=this.tag.call(null,{...this.props,children:s.length<=1?s[0]:s});if(!(typeof a=="boolean"||a==null))if(a instanceof Promise)if(Ee.length===0)e.unshift("",a);else{const r=Ee.map(i=>[i,i.values.at(-1)]);e.unshift("",a.then(i=>(i instanceof F&&(i.localContexts=r),i)))}else a instanceof F?a.toStringToBuffer(e):typeof a=="number"||a.isEscaped?(e[0]+=a,a.callbacks&&(e.callbacks||(e.callbacks=[]),e.callbacks.push(...a.callbacks))):te(a,e)}},ks=class extends F{toStringToBuffer(e){Dt(this.children,e)}},Ht=(e,s,...a)=>{s??(s={}),a.length&&(s.children=a.length===1?a[0]:a);const r=s.key;delete s.key;const i=Qe(e,s,a);return i.key=r,i},Kt=!1,Qe=(e,s,a)=>{if(!Kt){for(const r in Et)mt[r][It]=Et[r];Kt=!0}return typeof e=="function"?new ht(e,s,a):mt[e]?new ht(mt[e],s,a):e==="svg"||e==="head"?(Ce||(Ce=Pt("")),new F(e,s,[new ht(Ce,{value:e},a)])):new F(e,s,a)},Tt=({children:e})=>new ks("",{children:e},Array.isArray(e)?e:e?[e]:[]);function t(e,s,a){let r;if(!s||!("children"in s))r=Qe(e,s,[]);else{const i=s.children;r=Array.isArray(i)?Qe(e,s,i):Qe(e,s,[i])}return r.key=a,r}var Wt=(e,s,a)=>(r,i)=>{let n=-1;return o(0);async function o(l){if(l<=n)throw new Error("next() called multiple times");n=l;let c,d=!1,u;if(e[l]?(u=e[l][0][0],r.req.routeIndex=l):u=l===e.length&&i||void 0,u)try{c=await u(r,()=>o(l+1))}catch(h){if(h instanceof Error&&s)r.error=h,c=await s(h,r),d=!0;else throw h}else r.finalized===!1&&a&&(c=await a(r));return c&&(r.finalized===!1||d)&&(r.res=c),r}},xa=Symbol(),ba=async(e,s=Object.create(null))=>{const{all:a=!1,dot:r=!1}=s,n=(e instanceof Ss?e.raw.headers:e.headers).get("Content-Type");return n!=null&&n.startsWith("multipart/form-data")||n!=null&&n.startsWith("application/x-www-form-urlencoded")?ya(e,{all:a,dot:r}):{}};async function ya(e,s){const a=await e.formData();return a?va(a,s):{}}function va(e,s){const a=Object.create(null);return e.forEach((r,i)=>{s.all||i.endsWith("[]")?wa(a,i,r):a[i]=r}),s.dot&&Object.entries(a).forEach(([r,i])=>{r.includes(".")&&(ka(a,r,i),delete a[r])}),a}var wa=(e,s,a)=>{e[s]!==void 0?Array.isArray(e[s])?e[s].push(a):e[s]=[e[s],a]:s.endsWith("[]")?e[s]=[a]:e[s]=a},ka=(e,s,a)=>{let r=e;const i=s.split(".");i.forEach((n,o)=>{o===i.length-1?r[n]=a:((!r[n]||typeof r[n]!="object"||Array.isArray(r[n])||r[n]instanceof File)&&(r[n]=Object.create(null)),r=r[n])})},Es=e=>{const s=e.split("/");return s[0]===""&&s.shift(),s},Ea=e=>{const{groups:s,path:a}=Ta(e),r=Es(a);return _a(r,s)},Ta=e=>{const s=[];return e=e.replace(/\{[^}]+\}/g,(a,r)=>{const i=`@${r}`;return s.push([i,a]),i}),{groups:s,path:e}},_a=(e,s)=>{for(let a=s.length-1;a>=0;a--){const[r]=s[a];for(let i=e.length-1;i>=0;i--)if(e[i].includes(r)){e[i]=e[i].replace(r,s[a][1]);break}}return e},Ye={},Aa=(e,s)=>{if(e==="*")return"*";const a=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(a){const r=`${e}#${s}`;return Ye[r]||(a[2]?Ye[r]=s&&s[0]!==":"&&s[0]!=="*"?[r,a[1],new RegExp(`^${a[2]}(?=/${s})`)]:[e,a[1],new RegExp(`^${a[2]}$`)]:Ye[r]=[e,a[1],!0]),Ye[r]}return null},ot=(e,s)=>{try{return s(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,a=>{try{return s(a)}catch{return a}})}},Sa=e=>ot(e,decodeURI),Ts=e=>{const s=e.url,a=s.indexOf("/",s.charCodeAt(9)===58?13:8);let r=a;for(;r<s.length;r++){const i=s.charCodeAt(r);if(i===37){const n=s.indexOf("?",r),o=s.slice(a,n===-1?void 0:n);return Sa(o.includes("%25")?o.replace(/%25/g,"%2525"):o)}else if(i===63)break}return s.slice(a,r)},Ra=e=>{const s=Ts(e);return s.length>1&&s.at(-1)==="/"?s.slice(0,-1):s},pe=(e,s,...a)=>(a.length&&(s=pe(s,...a)),`${(e==null?void 0:e[0])==="/"?"":"/"}${e}${s==="/"?"":`${(e==null?void 0:e.at(-1))==="/"?"":"/"}${(s==null?void 0:s[0])==="/"?s.slice(1):s}`}`),_s=e=>{if(e.charCodeAt(e.length-1)!==63||!e.includes(":"))return null;const s=e.split("/"),a=[];let r="";return s.forEach(i=>{if(i!==""&&!/\:/.test(i))r+="/"+i;else if(/\:/.test(i))if(/\?/.test(i)){a.length===0&&r===""?a.push("/"):a.push(r);const n=i.replace("?","");r+="/"+n,a.push(r)}else r+="/"+i}),a.filter((i,n,o)=>o.indexOf(i)===n)},ft=e=>/[%+]/.test(e)?(e.indexOf("+")!==-1&&(e=e.replace(/\+/g," ")),e.indexOf("%")!==-1?ot(e,Ot):e):e,As=(e,s,a)=>{let r;if(!a&&s&&!/[%+]/.test(s)){let o=e.indexOf(`?${s}`,8);for(o===-1&&(o=e.indexOf(`&${s}`,8));o!==-1;){const l=e.charCodeAt(o+s.length+1);if(l===61){const c=o+s.length+2,d=e.indexOf("&",c);return ft(e.slice(c,d===-1?void 0:d))}else if(l==38||isNaN(l))return"";o=e.indexOf(`&${s}`,o+1)}if(r=/[%+]/.test(e),!r)return}const i={};r??(r=/[%+]/.test(e));let n=e.indexOf("?",8);for(;n!==-1;){const o=e.indexOf("&",n+1);let l=e.indexOf("=",n);l>o&&o!==-1&&(l=-1);let c=e.slice(n+1,l===-1?o===-1?void 0:o:l);if(r&&(c=ft(c)),n=o,c==="")continue;let d;l===-1?d="":(d=e.slice(l+1,o===-1?void 0:o),r&&(d=ft(d))),a?(i[c]&&Array.isArray(i[c])||(i[c]=[]),i[c].push(d)):i[c]??(i[c]=d)}return s?i[s]:i},Ia=As,Pa=(e,s)=>As(e,s,!0),Ot=decodeURIComponent,Xt=e=>ot(e,Ot),be,L,V,Rs,Is,_t,z,as,Ss=(as=class{constructor(e,s="/",a=[[]]){w(this,V);x(this,"raw");w(this,be);w(this,L);x(this,"routeIndex",0);x(this,"path");x(this,"bodyCache",{});w(this,z,e=>{const{bodyCache:s,raw:a}=this,r=s[e];if(r)return r;const i=Object.keys(s)[0];return i?s[i].then(n=>(i==="json"&&(n=JSON.stringify(n)),new Response(n)[e]())):s[e]=a[e]()});this.raw=e,this.path=s,y(this,L,a),y(this,be,{})}param(e){return e?_(this,V,Rs).call(this,e):_(this,V,Is).call(this)}query(e){return Ia(this.url,e)}queries(e){return Pa(this.url,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;const s={};return this.raw.headers.forEach((a,r)=>{s[r]=a}),s}async parseBody(e){var s;return(s=this.bodyCache).parsedBody??(s.parsedBody=await ba(this,e))}json(){return m(this,z).call(this,"text").then(e=>JSON.parse(e))}text(){return m(this,z).call(this,"text")}arrayBuffer(){return m(this,z).call(this,"arrayBuffer")}blob(){return m(this,z).call(this,"blob")}formData(){return m(this,z).call(this,"formData")}addValidatedData(e,s){m(this,be)[e]=s}valid(e){return m(this,be)[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[xa](){return m(this,L)}get matchedRoutes(){return m(this,L)[0].map(([[,e]])=>e)}get routePath(){return m(this,L)[0].map(([[,e]])=>e)[this.routeIndex].path}},be=new WeakMap,L=new WeakMap,V=new WeakSet,Rs=function(e){const s=m(this,L)[0][this.routeIndex][1][e],a=_(this,V,_t).call(this,s);return a?/\%/.test(a)?Xt(a):a:void 0},Is=function(){const e={},s=Object.keys(m(this,L)[0][this.routeIndex][1]);for(const a of s){const r=_(this,V,_t).call(this,m(this,L)[0][this.routeIndex][1][a]);r&&typeof r=="string"&&(e[a]=/\%/.test(r)?Xt(r):r)}return e},_t=function(e){return m(this,L)[1]?m(this,L)[1][e]:e},z=new WeakMap,as),ja="text/plain; charset=UTF-8",pt=(e,s)=>({"Content-Type":e,...s}),Me,Ne,H,ye,K,O,Be,ve,we,le,Fe,Ue,J,ge,rs,Da=(rs=class{constructor(e,s){w(this,J);w(this,Me);w(this,Ne);x(this,"env",{});w(this,H);x(this,"finalized",!1);x(this,"error");w(this,ye);w(this,K);w(this,O);w(this,Be);w(this,ve);w(this,we);w(this,le);w(this,Fe);w(this,Ue);x(this,"render",(...e)=>(m(this,ve)??y(this,ve,s=>this.html(s)),m(this,ve).call(this,...e)));x(this,"setLayout",e=>y(this,Be,e));x(this,"getLayout",()=>m(this,Be));x(this,"setRenderer",e=>{y(this,ve,e)});x(this,"header",(e,s,a)=>{this.finalized&&y(this,O,new Response(m(this,O).body,m(this,O)));const r=m(this,O)?m(this,O).headers:m(this,le)??y(this,le,new Headers);s===void 0?r.delete(e):a!=null&&a.append?r.append(e,s):r.set(e,s)});x(this,"status",e=>{y(this,ye,e)});x(this,"set",(e,s)=>{m(this,H)??y(this,H,new Map),m(this,H).set(e,s)});x(this,"get",e=>m(this,H)?m(this,H).get(e):void 0);x(this,"newResponse",(...e)=>_(this,J,ge).call(this,...e));x(this,"body",(e,s,a)=>_(this,J,ge).call(this,e,s,a));x(this,"text",(e,s,a)=>!m(this,le)&&!m(this,ye)&&!s&&!a&&!this.finalized?new Response(e):_(this,J,ge).call(this,e,s,pt(ja,a)));x(this,"json",(e,s,a)=>_(this,J,ge).call(this,JSON.stringify(e),s,pt("application/json",a)));x(this,"html",(e,s,a)=>{const r=i=>_(this,J,ge).call(this,i,s,pt("text/html; charset=UTF-8",a));return typeof e=="object"?ps(e,ms.Stringify,!1,{}).then(r):r(e)});x(this,"redirect",(e,s)=>{const a=String(e);return this.header("Location",/[^\x00-\xFF]/.test(a)?encodeURI(a):a),this.newResponse(null,s??302)});x(this,"notFound",()=>(m(this,we)??y(this,we,()=>new Response),m(this,we).call(this,this)));y(this,Me,e),s&&(y(this,K,s.executionCtx),this.env=s.env,y(this,we,s.notFoundHandler),y(this,Ue,s.path),y(this,Fe,s.matchResult))}get req(){return m(this,Ne)??y(this,Ne,new Ss(m(this,Me),m(this,Ue),m(this,Fe))),m(this,Ne)}get event(){if(m(this,K)&&"respondWith"in m(this,K))return m(this,K);throw Error("This context has no FetchEvent")}get executionCtx(){if(m(this,K))return m(this,K);throw Error("This context has no ExecutionContext")}get res(){return m(this,O)||y(this,O,new Response(null,{headers:m(this,le)??y(this,le,new Headers)}))}set res(e){if(m(this,O)&&e){e=new Response(e.body,e);for(const[s,a]of m(this,O).headers.entries())if(s!=="content-type")if(s==="set-cookie"){const r=m(this,O).headers.getSetCookie();e.headers.delete("set-cookie");for(const i of r)e.headers.append("set-cookie",i)}else e.headers.set(s,a)}y(this,O,e),this.finalized=!0}get var(){return m(this,H)?Object.fromEntries(m(this,H)):{}}},Me=new WeakMap,Ne=new WeakMap,H=new WeakMap,ye=new WeakMap,K=new WeakMap,O=new WeakMap,Be=new WeakMap,ve=new WeakMap,we=new WeakMap,le=new WeakMap,Fe=new WeakMap,Ue=new WeakMap,J=new WeakSet,ge=function(e,s,a){const r=m(this,O)?new Headers(m(this,O).headers):m(this,le)??new Headers;if(typeof s=="object"&&"headers"in s){const n=s.headers instanceof Headers?s.headers:new Headers(s.headers);for(const[o,l]of n)o.toLowerCase()==="set-cookie"?r.append(o,l):r.set(o,l)}if(a)for(const[n,o]of Object.entries(a))if(typeof o=="string")r.set(n,o);else{r.delete(n);for(const l of o)r.append(n,l)}const i=typeof s=="number"?s:(s==null?void 0:s.status)??m(this,ye);return new Response(e,{status:i,headers:r})},rs),R="ALL",Oa="all",Ca=["get","post","put","delete","options","patch"],Ps="Can not add a route since the matcher is already built.",js=class extends Error{},La="__COMPOSED_HANDLER",$a=e=>e.text("404 Not Found",404),Vt=(e,s)=>{if("getResponse"in e){const a=e.getResponse();return s.newResponse(a.body,a)}return console.error(e),s.text("Internal Server Error",500)},M,I,Os,N,ie,Ze,et,is,Ds=(is=class{constructor(s={}){w(this,I);x(this,"get");x(this,"post");x(this,"put");x(this,"delete");x(this,"options");x(this,"patch");x(this,"all");x(this,"on");x(this,"use");x(this,"router");x(this,"getPath");x(this,"_basePath","/");w(this,M,"/");x(this,"routes",[]);w(this,N,$a);x(this,"errorHandler",Vt);x(this,"onError",s=>(this.errorHandler=s,this));x(this,"notFound",s=>(y(this,N,s),this));x(this,"fetch",(s,...a)=>_(this,I,et).call(this,s,a[1],a[0],s.method));x(this,"request",(s,a,r,i)=>s instanceof Request?this.fetch(a?new Request(s,a):s,r,i):(s=s.toString(),this.fetch(new Request(/^https?:\/\//.test(s)?s:`http://localhost${pe("/",s)}`,a),r,i)));x(this,"fire",()=>{addEventListener("fetch",s=>{s.respondWith(_(this,I,et).call(this,s.request,s,void 0,s.request.method))})});[...Ca,Oa].forEach(n=>{this[n]=(o,...l)=>(typeof o=="string"?y(this,M,o):_(this,I,ie).call(this,n,m(this,M),o),l.forEach(c=>{_(this,I,ie).call(this,n,m(this,M),c)}),this)}),this.on=(n,o,...l)=>{for(const c of[o].flat()){y(this,M,c);for(const d of[n].flat())l.map(u=>{_(this,I,ie).call(this,d.toUpperCase(),m(this,M),u)})}return this},this.use=(n,...o)=>(typeof n=="string"?y(this,M,n):(y(this,M,"*"),o.unshift(n)),o.forEach(l=>{_(this,I,ie).call(this,R,m(this,M),l)}),this);const{strict:r,...i}=s;Object.assign(this,i),this.getPath=r??!0?s.getPath??Ts:Ra}route(s,a){const r=this.basePath(s);return a.routes.map(i=>{var o;let n;a.errorHandler===Vt?n=i.handler:(n=async(l,c)=>(await Wt([],a.errorHandler)(l,()=>i.handler(l,c))).res,n[La]=i.handler),_(o=r,I,ie).call(o,i.method,i.path,n)}),this}basePath(s){const a=_(this,I,Os).call(this);return a._basePath=pe(this._basePath,s),a}mount(s,a,r){let i,n;r&&(typeof r=="function"?n=r:(n=r.optionHandler,r.replaceRequest===!1?i=c=>c:i=r.replaceRequest));const o=n?c=>{const d=n(c);return Array.isArray(d)?d:[d]}:c=>{let d;try{d=c.executionCtx}catch{}return[c.env,d]};i||(i=(()=>{const c=pe(this._basePath,s),d=c==="/"?0:c.length;return u=>{const h=new URL(u.url);return h.pathname=h.pathname.slice(d)||"/",new Request(h,u)}})());const l=async(c,d)=>{const u=await a(i(c.req.raw),...o(c));if(u)return u;await d()};return _(this,I,ie).call(this,R,pe(s,"*"),l),this}},M=new WeakMap,I=new WeakSet,Os=function(){const s=new Ds({router:this.router,getPath:this.getPath});return s.errorHandler=this.errorHandler,y(s,N,m(this,N)),s.routes=this.routes,s},N=new WeakMap,ie=function(s,a,r){s=s.toUpperCase(),a=pe(this._basePath,a);const i={basePath:this._basePath,path:a,method:s,handler:r};this.router.add(s,a,[r,i]),this.routes.push(i)},Ze=function(s,a){if(s instanceof Error)return this.errorHandler(s,a);throw s},et=function(s,a,r,i){if(i==="HEAD")return(async()=>new Response(null,await _(this,I,et).call(this,s,a,r,"GET")))();const n=this.getPath(s,{env:r}),o=this.router.match(i,n),l=new Da(s,{path:n,matchResult:o,env:r,executionCtx:a,notFoundHandler:m(this,N)});if(o[0].length===1){let d;try{d=o[0][0][0][0](l,async()=>{l.res=await m(this,N).call(this,l)})}catch(u){return _(this,I,Ze).call(this,u,l)}return d instanceof Promise?d.then(u=>u||(l.finalized?l.res:m(this,N).call(this,l))).catch(u=>_(this,I,Ze).call(this,u,l)):d??m(this,N).call(this,l)}const c=Wt(o[0],this.errorHandler,m(this,N));return(async()=>{try{const d=await c(l);if(!d.finalized)throw new Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return d.res}catch(d){return _(this,I,Ze).call(this,d,l)}})()},is),nt="[^/]+",De=".*",Oe="(?:|/.*)",xe=Symbol(),Ma=new Set(".\\+*[^]$()");function Na(e,s){return e.length===1?s.length===1?e<s?-1:1:-1:s.length===1||e===De||e===Oe?1:s===De||s===Oe?-1:e===nt?1:s===nt?-1:e.length===s.length?e<s?-1:1:s.length-e.length}var oe,ce,B,ns,At=(ns=class{constructor(){w(this,oe);w(this,ce);w(this,B,Object.create(null))}insert(s,a,r,i,n){if(s.length===0){if(m(this,oe)!==void 0)throw xe;if(n)return;y(this,oe,a);return}const[o,...l]=s,c=o==="*"?l.length===0?["","",De]:["","",nt]:o==="/*"?["","",Oe]:o.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);let d;if(c){const u=c[1];let h=c[2]||nt;if(u&&c[2]&&(h===".*"||(h=h.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(h))))throw xe;if(d=m(this,B)[h],!d){if(Object.keys(m(this,B)).some(f=>f!==De&&f!==Oe))throw xe;if(n)return;d=m(this,B)[h]=new At,u!==""&&y(d,ce,i.varIndex++)}!n&&u!==""&&r.push([u,m(d,ce)])}else if(d=m(this,B)[o],!d){if(Object.keys(m(this,B)).some(u=>u.length>1&&u!==De&&u!==Oe))throw xe;if(n)return;d=m(this,B)[o]=new At}d.insert(l,a,r,i,n)}buildRegExpStr(){const a=Object.keys(m(this,B)).sort(Na).map(r=>{const i=m(this,B)[r];return(typeof m(i,ce)=="number"?`(${r})@${m(i,ce)}`:Ma.has(r)?`\\${r}`:r)+i.buildRegExpStr()});return typeof m(this,oe)=="number"&&a.unshift(`#${m(this,oe)}`),a.length===0?"":a.length===1?a[0]:"(?:"+a.join("|")+")"}},oe=new WeakMap,ce=new WeakMap,B=new WeakMap,ns),lt,qe,ls,Ba=(ls=class{constructor(){w(this,lt,{varIndex:0});w(this,qe,new At)}insert(e,s,a){const r=[],i=[];for(let o=0;;){let l=!1;if(e=e.replace(/\{[^}]+\}/g,c=>{const d=`@\\${o}`;return i[o]=[d,c],o++,l=!0,d}),!l)break}const n=e.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let o=i.length-1;o>=0;o--){const[l]=i[o];for(let c=n.length-1;c>=0;c--)if(n[c].indexOf(l)!==-1){n[c]=n[c].replace(l,i[o][1]);break}}return m(this,qe).insert(n,s,r,m(this,lt),a),r}buildRegExp(){let e=m(this,qe).buildRegExpStr();if(e==="")return[/^$/,[],[]];let s=0;const a=[],r=[];return e=e.replace(/#(\d+)|@(\d+)|\.\*\$/g,(i,n,o)=>n!==void 0?(a[++s]=Number(n),"$()"):(o!==void 0&&(r[Number(o)]=++s),"")),[new RegExp(`^${e}`),a,r]}},lt=new WeakMap,qe=new WeakMap,ls),Cs=[],Fa=[/^$/,[],Object.create(null)],tt=Object.create(null);function Ls(e){return tt[e]??(tt[e]=new RegExp(e==="*"?"":`^${e.replace(/\/\*$|([.\\+*[^\]$()])/g,(s,a)=>a?`\\${a}`:"(?:|/.*)")}$`))}function Ua(){tt=Object.create(null)}function qa(e){var d;const s=new Ba,a=[];if(e.length===0)return Fa;const r=e.map(u=>[!/\*|\/:/.test(u[0]),...u]).sort(([u,h],[f,p])=>u?1:f?-1:h.length-p.length),i=Object.create(null);for(let u=0,h=-1,f=r.length;u<f;u++){const[p,b,g]=r[u];p?i[b]=[g.map(([k])=>[k,Object.create(null)]),Cs]:h++;let v;try{v=s.insert(b,h,p)}catch(k){throw k===xe?new js(b):k}p||(a[h]=g.map(([k,E])=>{const A=Object.create(null);for(E-=1;E>=0;E--){const[T,j]=v[E];A[T]=j}return[k,A]}))}const[n,o,l]=s.buildRegExp();for(let u=0,h=a.length;u<h;u++)for(let f=0,p=a[u].length;f<p;f++){const b=(d=a[u][f])==null?void 0:d[1];if(!b)continue;const g=Object.keys(b);for(let v=0,k=g.length;v<k;v++)b[g[v]]=l[b[g[v]]]}const c=[];for(const u in o)c[u]=a[o[u]];return[n,c,i]}function he(e,s){if(e){for(const a of Object.keys(e).sort((r,i)=>i.length-r.length))if(Ls(a).test(s))return[...e[a]]}}var G,Q,Ae,$s,Ms,os,Ha=(os=class{constructor(){w(this,Ae);x(this,"name","RegExpRouter");w(this,G);w(this,Q);y(this,G,{[R]:Object.create(null)}),y(this,Q,{[R]:Object.create(null)})}add(e,s,a){var l;const r=m(this,G),i=m(this,Q);if(!r||!i)throw new Error(Ps);r[e]||[r,i].forEach(c=>{c[e]=Object.create(null),Object.keys(c[R]).forEach(d=>{c[e][d]=[...c[R][d]]})}),s==="/*"&&(s="*");const n=(s.match(/\/:/g)||[]).length;if(/\*$/.test(s)){const c=Ls(s);e===R?Object.keys(r).forEach(d=>{var u;(u=r[d])[s]||(u[s]=he(r[d],s)||he(r[R],s)||[])}):(l=r[e])[s]||(l[s]=he(r[e],s)||he(r[R],s)||[]),Object.keys(r).forEach(d=>{(e===R||e===d)&&Object.keys(r[d]).forEach(u=>{c.test(u)&&r[d][u].push([a,n])})}),Object.keys(i).forEach(d=>{(e===R||e===d)&&Object.keys(i[d]).forEach(u=>c.test(u)&&i[d][u].push([a,n]))});return}const o=_s(s)||[s];for(let c=0,d=o.length;c<d;c++){const u=o[c];Object.keys(i).forEach(h=>{var f;(e===R||e===h)&&((f=i[h])[u]||(f[u]=[...he(r[h],u)||he(r[R],u)||[]]),i[h][u].push([a,n-d+c+1]))})}}match(e,s){Ua();const a=_(this,Ae,$s).call(this);return this.match=(r,i)=>{const n=a[r]||a[R],o=n[2][i];if(o)return o;const l=i.match(n[0]);if(!l)return[[],Cs];const c=l.indexOf("",1);return[n[1][c],l]},this.match(e,s)}},G=new WeakMap,Q=new WeakMap,Ae=new WeakSet,$s=function(){const e=Object.create(null);return Object.keys(m(this,Q)).concat(Object.keys(m(this,G))).forEach(s=>{e[s]||(e[s]=_(this,Ae,Ms).call(this,s))}),y(this,G,y(this,Q,void 0)),e},Ms=function(e){const s=[];let a=e===R;return[m(this,G),m(this,Q)].forEach(r=>{const i=r[e]?Object.keys(r[e]).map(n=>[n,r[e][n]]):[];i.length!==0?(a||(a=!0),s.push(...i)):e!==R&&s.push(...Object.keys(r[R]).map(n=>[n,r[R][n]]))}),a?qa(s):null},os),Z,W,cs,Ka=(cs=class{constructor(e){x(this,"name","SmartRouter");w(this,Z,[]);w(this,W,[]);y(this,Z,e.routers)}add(e,s,a){if(!m(this,W))throw new Error(Ps);m(this,W).push([e,s,a])}match(e,s){if(!m(this,W))throw new Error("Fatal error");const a=m(this,Z),r=m(this,W),i=a.length;let n=0,o;for(;n<i;n++){const l=a[n];try{for(let c=0,d=r.length;c<d;c++)l.add(...r[c]);o=l.match(e,s)}catch(c){if(c instanceof js)continue;throw c}this.match=l.match.bind(l),y(this,Z,[l]),y(this,W,void 0);break}if(n===i)throw new Error("Fatal error");return this.name=`SmartRouter + ${this.activeRouter.name}`,o}get activeRouter(){if(m(this,W)||m(this,Z).length!==1)throw new Error("No active router has been determined yet.");return m(this,Z)[0]}},Z=new WeakMap,W=new WeakMap,cs),Pe=Object.create(null),ee,D,de,ke,P,X,ne,ds,Ns=(ds=class{constructor(e,s,a){w(this,X);w(this,ee);w(this,D);w(this,de);w(this,ke,0);w(this,P,Pe);if(y(this,D,a||Object.create(null)),y(this,ee,[]),e&&s){const r=Object.create(null);r[e]={handler:s,possibleKeys:[],score:0},y(this,ee,[r])}y(this,de,[])}insert(e,s,a){y(this,ke,++Bt(this,ke)._);let r=this;const i=Ea(s),n=[];for(let o=0,l=i.length;o<l;o++){const c=i[o],d=i[o+1],u=Aa(c,d),h=Array.isArray(u)?u[0]:c;if(h in m(r,D)){r=m(r,D)[h],u&&n.push(u[1]);continue}m(r,D)[h]=new Ns,u&&(m(r,de).push(u),n.push(u[1])),r=m(r,D)[h]}return m(r,ee).push({[e]:{handler:a,possibleKeys:n.filter((o,l,c)=>c.indexOf(o)===l),score:m(this,ke)}}),r}search(e,s){var l;const a=[];y(this,P,Pe);let i=[this];const n=Es(s),o=[];for(let c=0,d=n.length;c<d;c++){const u=n[c],h=c===d-1,f=[];for(let p=0,b=i.length;p<b;p++){const g=i[p],v=m(g,D)[u];v&&(y(v,P,m(g,P)),h?(m(v,D)["*"]&&a.push(..._(this,X,ne).call(this,m(v,D)["*"],e,m(g,P))),a.push(..._(this,X,ne).call(this,v,e,m(g,P)))):f.push(v));for(let k=0,E=m(g,de).length;k<E;k++){const A=m(g,de)[k],T=m(g,P)===Pe?{}:{...m(g,P)};if(A==="*"){const Y=m(g,D)["*"];Y&&(a.push(..._(this,X,ne).call(this,Y,e,m(g,P))),y(Y,P,T),f.push(Y));continue}const[j,me,re]=A;if(!u&&!(re instanceof RegExp))continue;const U=m(g,D)[j],Zs=n.slice(c).join("/");if(re instanceof RegExp){const Y=re.exec(Zs);if(Y){if(T[me]=Y[0],a.push(..._(this,X,ne).call(this,U,e,m(g,P),T)),Object.keys(m(U,D)).length){y(U,P,T);const dt=((l=Y[0].match(/\//))==null?void 0:l.length)??0;(o[dt]||(o[dt]=[])).push(U)}continue}}(re===!0||re.test(u))&&(T[me]=u,h?(a.push(..._(this,X,ne).call(this,U,e,T,m(g,P))),m(U,D)["*"]&&a.push(..._(this,X,ne).call(this,m(U,D)["*"],e,T,m(g,P)))):(y(U,P,T),f.push(U)))}}i=f.concat(o.shift()??[])}return a.length>1&&a.sort((c,d)=>c.score-d.score),[a.map(({handler:c,params:d})=>[c,d])]}},ee=new WeakMap,D=new WeakMap,de=new WeakMap,ke=new WeakMap,P=new WeakMap,X=new WeakSet,ne=function(e,s,a,r){const i=[];for(let n=0,o=m(e,ee).length;n<o;n++){const l=m(e,ee)[n],c=l[s]||l[R],d={};if(c!==void 0&&(c.params=Object.create(null),i.push(c),a!==Pe||r&&r!==Pe))for(let u=0,h=c.possibleKeys.length;u<h;u++){const f=c.possibleKeys[u],p=d[c.score];c.params[f]=r!=null&&r[f]&&!p?r[f]:a[f]??(r==null?void 0:r[f]),d[c.score]=!0}}return i},ds),ue,us,Wa=(us=class{constructor(){x(this,"name","TrieRouter");w(this,ue);y(this,ue,new Ns)}add(e,s,a){const r=_s(s);if(r){for(let i=0,n=r.length;i<n;i++)m(this,ue).insert(e,r[i],a);return}m(this,ue).insert(e,s,a)}match(e,s){return m(this,ue).search(e,s)}},ue=new WeakMap,us),se=class extends Ds{constructor(e={}){super(e),this.router=e.router??new Ka({routers:[new Ha,new Wa]})}},Xa=e=>{const a={...{origin:"*",allowMethods:["GET","HEAD","PUT","POST","DELETE","PATCH"],allowHeaders:[],exposeHeaders:[]},...e},r=(n=>typeof n=="string"?n==="*"?()=>n:o=>n===o?o:null:typeof n=="function"?n:o=>n.includes(o)?o:null)(a.origin),i=(n=>typeof n=="function"?n:Array.isArray(n)?()=>n:()=>[])(a.allowMethods);return async function(o,l){var u;function c(h,f){o.res.headers.set(h,f)}const d=await r(o.req.header("origin")||"",o);if(d&&c("Access-Control-Allow-Origin",d),a.origin!=="*"){const h=o.req.header("Vary");h?c("Vary",h):c("Vary","Origin")}if(a.credentials&&c("Access-Control-Allow-Credentials","true"),(u=a.exposeHeaders)!=null&&u.length&&c("Access-Control-Expose-Headers",a.exposeHeaders.join(",")),o.req.method==="OPTIONS"){a.maxAge!=null&&c("Access-Control-Max-Age",a.maxAge.toString());const h=await i(o.req.header("origin")||"",o);h.length&&c("Access-Control-Allow-Methods",h.join(","));let f=a.allowHeaders;if(!(f!=null&&f.length)){const p=o.req.header("Access-Control-Request-Headers");p&&(f=p.split(/\s*,\s*/))}return f!=null&&f.length&&(c("Access-Control-Allow-Headers",f.join(",")),o.res.headers.append("Vary","Access-Control-Request-Headers")),o.res.headers.delete("Content-Length"),o.res.headers.delete("Content-Type"),new Response(null,{headers:o.res.headers,status:204,statusText:"No Content"})}await l()}},Le="_hp",Va={Change:"Input",DoubleClick:"DblClick"},Ya={svg:"2000/svg",math:"1998/Math/MathML"},$e=[],St=new WeakMap,Te=void 0,za=()=>Te,q=e=>"t"in e,gt={onClick:["click",!1]},Yt=e=>{if(!e.startsWith("on"))return;if(gt[e])return gt[e];const s=e.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/);if(s){const[,a,r]=s;return gt[e]=[(Va[a]||a).toLowerCase(),!!r]}},zt=(e,s)=>Te&&e instanceof SVGElement&&/[A-Z]/.test(s)&&(s in e.style||s.match(/^(?:o|pai|str|u|ve)/))?s.replace(/([A-Z])/g,"-$1").toLowerCase():s,Ja=(e,s,a)=>{var r;s||(s={});for(let i in s){const n=s[i];if(i!=="children"&&(!a||a[i]!==n)){i=it(i);const o=Yt(i);if(o){if((a==null?void 0:a[i])!==n&&(a&&e.removeEventListener(o[0],a[i],o[1]),n!=null)){if(typeof n!="function")throw new Error(`Event handler for "${i}" is not a function`);e.addEventListener(o[0],n,o[1])}}else if(i==="dangerouslySetInnerHTML"&&n)e.innerHTML=n.__html;else if(i==="ref"){let l;typeof n=="function"?l=n(e)||(()=>n(null)):n&&"current"in n&&(n.current=e,l=()=>n.current=null),St.set(e,l)}else if(i==="style"){const l=e.style;typeof n=="string"?l.cssText=n:(l.cssText="",n!=null&&ws(n,l.setProperty.bind(l)))}else{if(i==="value"){const c=e.nodeName;if(c==="INPUT"||c==="TEXTAREA"||c==="SELECT"){if(e.value=n==null||n===!1?null:n,c==="TEXTAREA"){e.textContent=n;continue}else if(c==="SELECT"){e.selectedIndex===-1&&(e.selectedIndex=0);continue}}}else(i==="checked"&&e.nodeName==="INPUT"||i==="selected"&&e.nodeName==="OPTION")&&(e[i]=n);const l=zt(e,i);n==null||n===!1?e.removeAttribute(l):n===!0?e.setAttribute(l,""):typeof n=="string"||typeof n=="number"?e.setAttribute(l,n):e.setAttribute(l,n.toString())}}}if(a)for(let i in a){const n=a[i];if(i!=="children"&&!(i in s)){i=it(i);const o=Yt(i);o?e.removeEventListener(o[0],n,o[1]):i==="ref"?(r=St.get(e))==null||r():e.removeAttribute(zt(e,i))}}},Ga=(e,s)=>{s[S][0]=0,$e.push([e,s]);const a=s.tag[It]||s.tag,r=a.defaultProps?{...a.defaultProps,...s.props}:s.props;try{return[a.call(null,r)]}finally{$e.pop()}},Bs=(e,s,a,r,i)=>{var n,o;(n=e.vR)!=null&&n.length&&(r.push(...e.vR),delete e.vR),typeof e.tag=="function"&&((o=e[S][1][Hs])==null||o.forEach(l=>i.push(l))),e.vC.forEach(l=>{var c;if(q(l))a.push(l);else if(typeof l.tag=="function"||l.tag===""){l.c=s;const d=a.length;if(Bs(l,s,a,r,i),l.s){for(let u=d;u<a.length;u++)a[u].s=!0;l.s=!1}}else a.push(l),(c=l.vR)!=null&&c.length&&(r.push(...l.vR),delete l.vR)})},Qa=e=>{for(;;e=e.tag===Le||!e.vC||!e.pP?e.nN:e.vC[0]){if(!e)return null;if(e.tag!==Le&&e.e)return e.e}},Fs=e=>{var s,a,r,i,n,o;q(e)||((a=(s=e[S])==null?void 0:s[1][Hs])==null||a.forEach(l=>{var c;return(c=l[2])==null?void 0:c.call(l)}),(r=St.get(e.e))==null||r(),e.p===2&&((i=e.vC)==null||i.forEach(l=>l.p=2)),(n=e.vC)==null||n.forEach(Fs)),e.p||((o=e.e)==null||o.remove(),delete e.e),typeof e.tag=="function"&&(je.delete(e),st.delete(e),delete e[S][3],e.a=!0)},Us=(e,s,a)=>{e.c=s,qs(e,s,a)},Jt=(e,s)=>{if(s){for(let a=0,r=e.length;a<r;a++)if(e[a]===s)return a}},Gt=Symbol(),qs=(e,s,a)=>{var d;const r=[],i=[],n=[];Bs(e,s,r,i,n),i.forEach(Fs);const o=a?void 0:s.childNodes;let l,c=null;if(a)l=-1;else if(!o.length)l=0;else{const u=Jt(o,Qa(e.nN));u!==void 0?(c=o[u],l=u):l=Jt(o,(d=r.find(h=>h.tag!==Le&&h.e))==null?void 0:d.e)??-1,l===-1&&(a=!0)}for(let u=0,h=r.length;u<h;u++,l++){const f=r[u];let p;if(f.s&&f.e)p=f.e,f.s=!1;else{const b=a||!f.e;q(f)?(f.e&&f.d&&(f.e.textContent=f.t),f.d=!1,p=f.e||(f.e=document.createTextNode(f.t))):(p=f.e||(f.e=f.n?document.createElementNS(f.n,f.tag):document.createElement(f.tag)),Ja(p,f.props,f.pP),qs(f,p,b))}f.tag===Le?l--:a?p.parentNode||s.appendChild(p):o[l]!==p&&o[l-1]!==p&&(o[l+1]===p?s.appendChild(o[l]):s.insertBefore(p,c||o[l]||null))}if(e.pP&&delete e.pP,n.length){const u=[],h=[];n.forEach(([,f,,p,b])=>{f&&u.push(f),p&&h.push(p),b==null||b()}),u.forEach(f=>f()),h.length&&requestAnimationFrame(()=>{h.forEach(f=>f())})}},Za=(e,s)=>!!(e&&e.length===s.length&&e.every((a,r)=>a[1]===s[r][1])),st=new WeakMap,Rt=(e,s,a)=>{var n,o,l,c,d,u;const r=!a&&s.pC;a&&(s.pC||(s.pC=s.vC));let i;try{a||(a=typeof s.tag=="function"?Ga(e,s):He(s.props.children)),((n=a[0])==null?void 0:n.tag)===""&&a[0][kt]&&(i=a[0][kt],e[5].push([e,i,s]));const h=r?[...s.pC]:s.vC?[...s.vC]:void 0,f=[];let p;for(let b=0;b<a.length;b++){Array.isArray(a[b])&&a.splice(b,1,...a[b].flat());let g=er(a[b]);if(g){typeof g.tag=="function"&&!g.tag[gs]&&(Ee.length>0&&(g[S][2]=Ee.map(k=>[k,k.values.at(-1)])),(o=e[5])!=null&&o.length&&(g[S][3]=e[5].at(-1)));let v;if(h&&h.length){const k=h.findIndex(q(g)?E=>q(E):g.key!==void 0?E=>E.key===g.key&&E.tag===g.tag:E=>E.tag===g.tag);k!==-1&&(v=h[k],h.splice(k,1))}if(v)if(q(g))v.t!==g.t&&(v.t=g.t,v.d=!0),g=v;else{const k=v.pP=v.props;if(v.props=g.props,v.f||(v.f=g.f||s.f),typeof g.tag=="function"){const E=v[S][2];v[S][2]=g[S][2]||[],v[S][3]=g[S][3],!v.f&&((v.o||v)===g.o||(c=(l=v.tag)[ra])!=null&&c.call(l,k,v.props))&&Za(E,v[S][2])&&(v.s=!0)}g=v}else if(!q(g)&&Te){const k=Se(Te);k&&(g.n=k)}if(!q(g)&&!g.s&&(Rt(e,g),delete g.f),f.push(g),p&&!p.s&&!g.s)for(let k=p;k&&!q(k);k=(d=k.vC)==null?void 0:d.at(-1))k.nN=g;p=g}}s.vR=r?[...s.vC,...h||[]]:h||[],s.vC=f,r&&delete s.pC}catch(h){if(s.f=!0,h===Gt){if(i)return;throw h}const[f,p,b]=((u=s[S])==null?void 0:u[3])||[];if(p){const g=()=>at([0,!1,e[2]],b),v=st.get(b)||[];v.push(g),st.set(b,v);const k=p(h,()=>{const E=st.get(b);if(E){const A=E.indexOf(g);if(A!==-1)return E.splice(A,1),g()}});if(k){if(e[0]===1)e[1]=!0;else if(Rt(e,b,[k]),(p.length===1||e!==f)&&b.c){Us(b,b.c,!1);return}throw Gt}}throw h}finally{i&&e[5].pop()}},er=e=>{if(!(e==null||typeof e=="boolean")){if(typeof e=="string"||typeof e=="number")return{t:e.toString(),d:!0};if("vR"in e&&(e={tag:e.tag,props:e.props,key:e.key,f:e.f,type:e.tag,ref:e.props.ref,o:e.o||e}),typeof e.tag=="function")e[S]=[0,[]];else{const s=Ya[e.tag];s&&(Te||(Te=bs("")),e.props.children=[{tag:Te,props:{value:e.n=`http://www.w3.org/${s}`,children:e.props.children}}])}return e}},Qt=(e,s)=>{var a,r;(a=s[S][2])==null||a.forEach(([i,n])=>{i.values.push(n)});try{Rt(e,s,void 0)}catch{return}if(s.a){delete s.a;return}(r=s[S][2])==null||r.forEach(([i])=>{i.values.pop()}),(e[0]!==1||!e[1])&&Us(s,s.c,!1)},je=new WeakMap,Zt=[],at=async(e,s)=>{e[5]||(e[5]=[]);const a=je.get(s);a&&a[0](void 0);let r;const i=new Promise(n=>r=n);if(je.set(s,[r,()=>{e[2]?e[2](e,s,n=>{Qt(n,s)}).then(()=>r(s)):(Qt(e,s),r(s))}]),Zt.length)Zt.at(-1).add(s);else{await Promise.resolve();const n=je.get(s);n&&(je.delete(s),n[1]())}return i},tr=(e,s,a)=>({tag:Le,props:{children:e},key:a,e:s,p:1}),xt=0,Hs=1,bt=2,yt=3,vt=new WeakMap,Ks=(e,s)=>!e||!s||e.length!==s.length||s.some((a,r)=>a!==e[r]),sr=void 0,es=[],ar=e=>{var o;const s=()=>typeof e=="function"?e():e,a=$e.at(-1);if(!a)return[s(),()=>{}];const[,r]=a,i=(o=r[S][1])[xt]||(o[xt]=[]),n=r[S][0]++;return i[n]||(i[n]=[s(),l=>{const c=sr,d=i[n];if(typeof l=="function"&&(l=l(d[0])),!Object.is(l,d[0]))if(d[0]=l,es.length){const[u,h]=es.at(-1);Promise.all([u===3?r:at([u,!1,c],r),h]).then(([f])=>{if(!f||!(u===2||u===3))return;const p=f.vC;requestAnimationFrame(()=>{setTimeout(()=>{p===f.vC&&at([u===3?1:0,!1,c],f)})})})}else at([0,!1,c],r)}])},Ct=(e,s)=>{var l;const a=$e.at(-1);if(!a)return e;const[,r]=a,i=(l=r[S][1])[bt]||(l[bt]=[]),n=r[S][0]++,o=i[n];return Ks(o==null?void 0:o[1],s)?i[n]=[e,s]:e=i[n][0],e},rr=e=>{const s=vt.get(e);if(s){if(s.length===2)throw s[1];return s[0]}throw e.then(a=>vt.set(e,[a]),a=>vt.set(e,[void 0,a])),e},ir=(e,s)=>{var l;const a=$e.at(-1);if(!a)return e();const[,r]=a,i=(l=r[S][1])[yt]||(l[yt]=[]),n=r[S][0]++,o=i[n];return Ks(o==null?void 0:o[1],s)&&(i[n]=[e(),s]),i[n][0]},nr=bs({pending:!1,data:null,method:null,action:null}),ts=new Set,lr=e=>{ts.add(e),e.finally(()=>ts.delete(e))},Lt=(e,s)=>ir(()=>a=>{let r;e&&(typeof e=="function"?r=e(a)||(()=>{e(null)}):e&&"current"in e&&(e.current=a,r=()=>{e.current=null}));const i=s(a);return()=>{i==null||i(),r==null||r()}},[e]),fe=Object.create(null),ze=Object.create(null),Xe=(e,s,a,r,i)=>{if(s!=null&&s.itemProp)return{tag:e,props:s,type:e,ref:s.ref};const n=document.head;let{onLoad:o,onError:l,precedence:c,blocking:d,...u}=s,h=null,f=!1;const p=Je[e];let b;if(p.length>0){const E=n.querySelectorAll(e);e:for(const A of E)for(const T of Je[e])if(A.getAttribute(T)===s[T]){h=A;break e}if(!h){const A=p.reduce((T,j)=>s[j]===void 0?T:`${T}-${j}-${s[j]}`,e);f=!ze[A],h=ze[A]||(ze[A]=(()=>{const T=document.createElement(e);for(const j of p)s[j]!==void 0&&T.setAttribute(j,s[j]),s.rel&&T.setAttribute("rel",s.rel);return T})())}}else b=n.querySelectorAll(e);c=r?c??"":void 0,r&&(u[Ge]=c);const g=Ct(E=>{if(p.length>0){let A=!1;for(const T of n.querySelectorAll(e)){if(A&&T.getAttribute(Ge)!==c){n.insertBefore(E,T);return}T.getAttribute(Ge)===c&&(A=!0)}n.appendChild(E)}else if(b){let A=!1;for(const T of b)if(T===E){A=!0;break}A||n.insertBefore(E,n.contains(b[0])?b[0]:n.querySelector(e)),b=void 0}},[c]),v=Lt(s.ref,E=>{var j;const A=p[0];if(a===2&&(E.innerHTML=""),(f||b)&&g(E),!l&&!o)return;let T=fe[j=E.getAttribute(A)]||(fe[j]=new Promise((me,re)=>{E.addEventListener("load",me),E.addEventListener("error",re)}));o&&(T=T.then(o)),l&&(T=T.catch(l)),T.catch(()=>{})});if(i&&d==="render"){const E=Je[e][0];if(s[E]){const A=s[E],T=fe[A]||(fe[A]=new Promise((j,me)=>{g(h),h.addEventListener("load",j),h.addEventListener("error",me)}));rr(T)}}const k={tag:e,type:e,props:{...u,ref:v},ref:v};return k.p=a,h&&(k.e=h),tr(k,n)},or=e=>{const s=za(),a=s&&Se(s);return a!=null&&a.endsWith("svg")?{tag:"title",props:e,type:"title",ref:e.ref}:Xe("title",e,void 0,!1,!1)},cr=e=>!e||["src","async"].some(s=>!e[s])?{tag:"script",props:e,type:"script",ref:e.ref}:Xe("script",e,1,!1,!0),dr=e=>!e||!["href","precedence"].every(s=>s in e)?{tag:"style",props:e,type:"style",ref:e.ref}:(e["data-href"]=e.href,delete e.href,Xe("style",e,2,!0,!0)),ur=e=>!e||["onLoad","onError"].some(s=>s in e)||e.rel==="stylesheet"&&(!("precedence"in e)||"disabled"in e)?{tag:"link",props:e,type:"link",ref:e.ref}:Xe("link",e,1,"precedence"in e,!0),mr=e=>Xe("meta",e,void 0,!1,!1),Ws=Symbol(),hr=e=>{const{action:s,...a}=e;typeof s!="function"&&(a.action=s);const[r,i]=ar([null,!1]),n=Ct(async d=>{const u=d.isTrusted?s:d.detail[Ws];if(typeof u!="function")return;d.preventDefault();const h=new FormData(d.target);i([h,!0]);const f=u(h);f instanceof Promise&&(lr(f),await f),i([null,!0])},[]),o=Lt(e.ref,d=>(d.addEventListener("submit",n),()=>{d.removeEventListener("submit",n)})),[l,c]=r;return r[1]=!1,{tag:nr,props:{value:{pending:l!==null,data:l,method:l?"post":null,action:l?s:null},children:{tag:"form",props:{...a,ref:o},type:"form",ref:o}},f:c}},Xs=(e,{formAction:s,...a})=>{if(typeof s=="function"){const r=Ct(i=>{i.preventDefault(),i.currentTarget.form.dispatchEvent(new CustomEvent("submit",{detail:{[Ws]:s}}))},[]);a.ref=Lt(a.ref,i=>(i.addEventListener("click",r),()=>{i.removeEventListener("click",r)}))}return{tag:e,props:a,type:e,ref:a.ref}},fr=e=>Xs("input",e),pr=e=>Xs("button",e);Object.assign(Et,{title:or,script:cr,style:dr,link:ur,meta:mr,form:hr,input:fr,button:pr});Pt(null);new TextEncoder;var gr=Pt(null),xr=(e,s,a,r)=>(i,n)=>{const o="<!DOCTYPE html>",l=a?Ht(d=>a(d,e),{Layout:s,...n},i):i,c=aa`${$(o)}${Ht(gr.Provider,{value:e},l)}`;return e.html(c)},br=(e,s)=>function(r,i){const n=r.getLayout()??Tt;return e&&r.setLayout(o=>e({...o,Layout:n},r)),r.setRenderer(xr(r,n,e)),i()};const yr=br(({children:e,title:s="IndoAdvisory - Penasihat Investasi Terpercaya"})=>t("html",{lang:"id",children:[t("head",{children:[t("meta",{charset:"UTF-8"}),t("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),t("title",{children:s}),t("meta",{name:"description",content:"Firma konsultan private equity terkemuka di Indonesia. Kami menyediakan layanan valuasi perusahaan, persiapan IPO, dan konsultasi investasi untuk pertumbuhan bisnis Anda."}),t("meta",{name:"keywords",content:"private equity, investasi, valuasi perusahaan, IPO, konsultan keuangan, Indonesia, Jakarta"}),t("script",{src:"https://cdn.tailwindcss.com"}),t("script",{dangerouslySetInnerHTML:{__html:`
          tailwind.config = {
            theme: {
              extend: {
                colors: {
                  // McKinsey-inspired professional palette
                  primary: {
                    50: '#f8fafc',
                    100: '#f1f5f9',
                    200: '#e2e8f0',
                    300: '#cbd5e1',
                    400: '#94a3b8',
                    500: '#64748b',
                    600: '#475569',
                    700: '#334155',
                    800: '#1e293b',
                    900: '#0f172a'
                  },
                  mckinsey: {
                    blue: '#0073e6',
                    darkblue: '#003d73',
                    navy: '#001f3f',
                    gray: '#4a5568',
                    lightgray: '#f7fafc',
                    accent: '#00b4d8'
                  },
                  secondary: {
                    50: '#f8fafc',
                    100: '#f1f5f9',
                    200: '#e2e8f0',
                    600: '#475569',
                    700: '#334155',
                    800: '#1e293b',
                    900: '#0f172a'
                  }
                },
                fontFamily: {
                  sans: ['Inter', 'system-ui', 'sans-serif'],
                  display: ['Inter', 'system-ui', 'sans-serif']
                }
              }
            }
          }
        `}}),t("link",{href:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css",rel:"stylesheet"}),t("link",{href:"/static/style.css",rel:"stylesheet"}),t("style",{children:`
          html { 
            scroll-behavior: smooth; 
            font-family: 'Inter', system-ui, sans-serif;
          }
          .mckinsey-gradient { 
            background: linear-gradient(135deg, #0073e6 0%, #003d73 50%, #001f3f 100%); 
          }
          .mckinsey-card { 
            background: #ffffff;
            border: 1px solid #e2e8f0;
            transition: all 0.2s ease;
            box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
          }
          .mckinsey-card:hover { 
            box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
            transform: translateY(-2px);
            border-color: #cbd5e1;
          }
          .mckinsey-section {
            background: #f8fafc;
          }
          .mckinsey-text {
            color: #334155;
            line-height: 1.6;
          }
          .mckinsey-heading {
            color: #1e293b;
            font-weight: 600;
            letter-spacing: -0.025em;
          }
          .mckinsey-accent {
            color: #0073e6;
          }
          .mckinsey-btn {
            background: #0073e6;
            color: white;
            font-weight: 500;
            letter-spacing: 0.025em;
            transition: all 0.2s ease;
          }
          .mckinsey-btn:hover {
            background: #003d73;
            box-shadow: 0 4px 8px rgba(0, 115, 230, 0.25);
          }
          .mckinsey-btn-outline {
            border: 2px solid #0073e6;
            color: #0073e6;
            background: transparent;
            font-weight: 500;
            transition: all 0.2s ease;
          }
          .mckinsey-btn-outline:hover {
            background: #0073e6;
            color: white;
          }
          
          /* McKinsey Article Content Styling */
          .mckinsey-article-content {
            font-family: 'Inter', system-ui, sans-serif;
            line-height: 1.8;
            color: #334155;
          }
          .mckinsey-article-content h2 {
            color: #1e293b;
            font-weight: 700;
            font-size: 1.75rem;
            margin: 2.5rem 0 1rem 0;
            border-bottom: 3px solid #0073e6;
            padding-bottom: 0.5rem;
          }
          .mckinsey-article-content h3 {
            color: #1e293b;
            font-weight: 600;
            font-size: 1.375rem;
            margin: 2rem 0 0.75rem 0;
          }
          .mckinsey-article-content h4 {
            color: #0073e6;
            font-weight: 600;
            font-size: 1.125rem;
            margin: 1.5rem 0 0.5rem 0;
          }
          .mckinsey-article-content p {
            margin: 1.25rem 0;
            font-size: 1.125rem;
            line-height: 1.8;
          }
          .mckinsey-article-content ul, .mckinsey-article-content ol {
            margin: 1.5rem 0;
            padding-left: 1.5rem;
          }
          .mckinsey-article-content li {
            margin: 0.75rem 0;
            font-size: 1.125rem;
            line-height: 1.7;
          }
          .mckinsey-article-content blockquote {
            border-left: 4px solid #0073e6;
            background: #f8fafc;
            padding: 1.5rem 2rem;
            margin: 2rem 0;
            font-style: italic;
            font-weight: 500;
            color: #475569;
          }
          .mckinsey-article-content strong {
            color: #1e293b;
            font-weight: 700;
          }
          .mckinsey-article-content em {
            color: #0073e6;
            font-style: normal;
            font-weight: 600;
          }
          .mckinsey-article-content code {
            background: #f1f5f9;
            padding: 0.25rem 0.5rem;
            border-radius: 0.25rem;
            font-family: 'Monaco', monospace;
            font-size: 0.875rem;
            color: #003d73;
          }
        `})]}),t("body",{class:"antialiased",children:[e,t("script",{dangerouslySetInnerHTML:{__html:`
          // Mobile menu toggle
          function toggleMenu() {
            const menu = document.getElementById('mobile-menu');
            menu.classList.toggle('hidden');
          }
          
          // Smooth scroll for anchor links
          document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
              e.preventDefault();
              const target = document.querySelector(this.getAttribute('href'));
              if (target) {
                target.scrollIntoView({ behavior: 'smooth', block: 'start' });
              }
            });
          });
          
          // Contact form submission
          function submitContact(event) {
            event.preventDefault();
            const formData = new FormData(event.target);
            const data = Object.fromEntries(formData);
            
            // Show success message
            const successDiv = document.getElementById('contact-success');
            successDiv.classList.remove('hidden');
            event.target.reset();
            
            // Hide message after 5 seconds
            setTimeout(() => {
              successDiv.classList.add('hidden');
            }, 5000);
          }
          
          // Client carousel auto-scroll functionality
          let autoScrollInterval;
          let isPaused = false;
          let currentPosition = 0;
          
          function initializeClientCarousel() {
            const carousel = document.getElementById('client-carousel');
            const showcaseSection = document.getElementById('client-showcase-section');
            if (!carousel || !showcaseSection) return;
            
            const cards = carousel.querySelectorAll('.flex-none');
            if (cards.length === 0) return;
            
            const cardCount = cards.length / 2; // We duplicate cards for seamless loop
            const cardWidth = 408; // 384px + 24px margin
            const maxPosition = cardCount * cardWidth;
            
            function autoScroll() {
              if (isPaused) return;
              
              currentPosition += cardWidth;
              
              // Reset to beginning when we've scrolled through all original cards
              if (currentPosition >= maxPosition) {
                currentPosition = 0;
              }
              
              carousel.style.transform = 'translateX(-' + currentPosition + 'px)';
            }
            
            // Start auto-scroll
            autoScrollInterval = setInterval(autoScroll, 3000);
            
            // Pause on hover over the entire client showcase section
            showcaseSection.addEventListener('mouseenter', () => {
              isPaused = true;
            });
            
            showcaseSection.addEventListener('mouseleave', () => {
              isPaused = false;
            });
          }
          
          // Initialize carousel when DOM is loaded
          document.addEventListener('DOMContentLoaded', initializeClientCarousel);
        `}})]})]}));var vr=/^[\w!#$%&'*.^`|~+-]+$/,wr=/^[ !#-:<-[\]-~]*$/,kr=(e,s)=>{if(e.indexOf(s)===-1)return{};const a=e.trim().split(";"),r={};for(let i of a){i=i.trim();const n=i.indexOf("=");if(n===-1)continue;const o=i.substring(0,n).trim();if(s!==o||!vr.test(o))continue;let l=i.substring(n+1).trim();if(l.startsWith('"')&&l.endsWith('"')&&(l=l.slice(1,-1)),wr.test(l)){r[o]=l.indexOf("%")!==-1?ot(l,Ot):l;break}}return r},Er=(e,s,a={})=>{let r=`${e}=${s}`;if(e.startsWith("__Secure-")&&!a.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(e.startsWith("__Host-")){if(!a.secure)throw new Error("__Host- Cookie must have Secure attributes");if(a.path!=="/")throw new Error('__Host- Cookie must have Path attributes with "/"');if(a.domain)throw new Error("__Host- Cookie must not have Domain attributes")}if(a&&typeof a.maxAge=="number"&&a.maxAge>=0){if(a.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+=`; Max-Age=${a.maxAge|0}`}if(a.domain&&a.prefix!=="host"&&(r+=`; Domain=${a.domain}`),a.path&&(r+=`; Path=${a.path}`),a.expires){if(a.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${a.expires.toUTCString()}`}if(a.httpOnly&&(r+="; HttpOnly"),a.secure&&(r+="; Secure"),a.sameSite&&(r+=`; SameSite=${a.sameSite.charAt(0).toUpperCase()+a.sameSite.slice(1)}`),a.priority&&(r+=`; Priority=${a.priority.charAt(0).toUpperCase()+a.priority.slice(1)}`),a.partitioned){if(!a.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r},wt=(e,s,a)=>(s=encodeURIComponent(s),Er(e,s,a)),$t=(e,s,a)=>{const r=e.req.raw.headers.get("Cookie");{if(!r)return;let i=s;return kr(r,i)[i]}},Tr=(e,s,a)=>{let r;return(a==null?void 0:a.prefix)==="secure"?r=wt("__Secure-"+e,s,{path:"/",...a,secure:!0}):(a==null?void 0:a.prefix)==="host"?r=wt("__Host-"+e,s,{...a,path:"/",secure:!0,domain:void 0}):r=wt(e,s,{path:"/",...a}),r},Vs=(e,s,a,r)=>{const i=Tr(s,a,r);e.header("Set-Cookie",i,{append:!0})},Ys=(e,s,a)=>{const r=$t(e,s);return Vs(e,s,"",{...a,maxAge:0}),r};function _r(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function Ar(e){return e?new Date(e.expires_at)>new Date:!1}function Sr(e,s){return e===s}async function zs(e){try{await e.batch([e.prepare(`CREATE TABLE IF NOT EXISTS admin_users (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        username TEXT UNIQUE NOT NULL,
        password_hash TEXT NOT NULL,
        email TEXT UNIQUE NOT NULL,
        name TEXT NOT NULL,
        role TEXT DEFAULT 'admin',
        created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
        updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
      )`),e.prepare(`CREATE TABLE IF NOT EXISTS articles (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        title TEXT NOT NULL,
        slug TEXT UNIQUE NOT NULL,
        excerpt TEXT,
        content TEXT NOT NULL,
        featured_image TEXT,
        status TEXT DEFAULT 'draft',
        category TEXT DEFAULT 'news',
        tags TEXT,
        author_id INTEGER,
        published_at DATETIME,
        created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
        updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
        FOREIGN KEY (author_id) REFERENCES admin_users(id)
      )`),e.prepare(`CREATE TABLE IF NOT EXISTS contact_inquiries (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        name TEXT NOT NULL,
        email TEXT NOT NULL,
        company TEXT,
        service TEXT,
        message TEXT NOT NULL,
        status TEXT DEFAULT 'new',
        created_at DATETIME DEFAULT CURRENT_TIMESTAMP
      )`),e.prepare(`CREATE TABLE IF NOT EXISTS admin_sessions (
        id TEXT PRIMARY KEY,
        user_id INTEGER NOT NULL,
        expires_at DATETIME NOT NULL,
        created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
        FOREIGN KEY (user_id) REFERENCES admin_users(id)
      )`),e.prepare(`CREATE TABLE IF NOT EXISTS site_settings (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        setting_key TEXT UNIQUE NOT NULL,
        setting_value TEXT,
        setting_type TEXT DEFAULT 'text',
        description TEXT,
        updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
      )`),e.prepare(`CREATE TABLE IF NOT EXISTS team_members (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        name TEXT NOT NULL,
        position_id TEXT NOT NULL,
        position_en TEXT NOT NULL,
        bio_id TEXT,
        bio_en TEXT,
        email TEXT,
        linkedin_url TEXT,
        image_url TEXT,
        sort_order INTEGER DEFAULT 0,
        is_active BOOLEAN DEFAULT 1,
        created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
        updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
      )`),e.prepare(`CREATE TABLE IF NOT EXISTS clients (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        company_name TEXT NOT NULL,
        industry TEXT NOT NULL,
        logo_url TEXT,
        description_id TEXT,
        description_en TEXT,
        project_type TEXT,
        project_value TEXT,
        completion_date DATE,
        is_featured BOOLEAN DEFAULT 0,
        is_active BOOLEAN DEFAULT 1,
        sort_order INTEGER DEFAULT 0,
        created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
        updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
      )`)]),console.log("Database initialized successfully")}catch(s){console.error("Database initialization failed:",s)}}function _e(e){return new Date(e).toLocaleDateString("id-ID",{year:"numeric",month:"long",day:"numeric"})}const Re=new se;Re.use("/*",async(e,s)=>{if(e.req.path==="/admin/login"&&(e.req.method==="GET"||e.req.method==="POST"))return s();const a=$t(e,"admin_session");if(!a)return e.redirect("/admin/login");try{const r=await e.env.DB.prepare("SELECT s.*, u.id as user_id, u.username, u.email, u.name, u.role FROM admin_sessions s JOIN admin_users u ON s.user_id = u.id WHERE s.id = ?").bind(a).first();return!r||!Ar(r)?(Ys(e,"admin_session"),e.redirect("/admin/login")):(e.set("user",r),s())}catch{return e.redirect("/admin/login")}});Re.get("/login",e=>e.html(`
    <!DOCTYPE html>
    <html lang="id">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Admin Login - IndoPrivate</title>
        <script src="https://cdn.tailwindcss.com"><\/script>
        <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    </head>
    <body class="bg-gray-100 min-h-screen flex items-center justify-center">
        <div class="bg-white p-8 rounded-xl shadow-lg w-full max-w-md">
            <div class="text-center mb-8">
                <h1 class="text-2xl font-bold text-gray-800">
                    <i class="fas fa-chart-line text-blue-600 mr-2"></i>
                    IndoPrivate Admin
                </h1>
                <p class="text-gray-600 mt-2">Masuk ke dashboard admin</p>
            </div>
            
            <form action="/admin/login" method="POST" class="space-y-6">
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">Username</label>
                    <input 
                        type="text" 
                        name="username" 
                        required 
                        class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                        placeholder="Masukkan username"
                    />
                </div>
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">Password</label>
                    <input 
                        type="password" 
                        name="password" 
                        required 
                        class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                        placeholder="Masukkan password"
                    />
                </div>
                
                <button 
                    type="submit" 
                    class="w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-semibold hover:bg-blue-700 transition-colors"
                >
                    <i class="fas fa-sign-in-alt mr-2"></i>
                    Masuk
                </button>
            </form>
            
            <div class="mt-6 text-center text-sm text-gray-500">
                <p>Demo credentials: <strong>admin / admin123</strong></p>
            </div>
        </div>
    </body>
    </html>
  `));Re.post("/login",async e=>{const{username:s,password:a}=await e.req.parseBody();try{await zs(e.env.DB),await e.env.DB.prepare("INSERT OR IGNORE INTO admin_users (username, password_hash, email, name, role) VALUES (?, ?, ?, ?, ?)").bind("admin","admin123","admin@indoprivate.co.id","Administrator","admin").run();const r=await e.env.DB.prepare("SELECT * FROM admin_users WHERE username = ?").bind(s).first();if(!r||!Sr(a,r.password_hash))return e.html(`
        <script>
          alert('Username atau password salah');
          window.location.href = '/admin/login';
        <\/script>
      `);const i=_r(),n=new Date(Date.now()+1440*60*1e3);return await e.env.DB.prepare("INSERT INTO admin_sessions (id, user_id, expires_at) VALUES (?, ?, ?)").bind(i,r.id,n.toISOString()).run(),Vs(e,"admin_session",i,{maxAge:1440*60,httpOnly:!0,secure:!1,sameSite:"Lax"}),e.redirect("/admin/dashboard")}catch{return e.html(`
      <script>
        alert('Terjadi kesalahan sistem');
        window.location.href = '/admin/login';
      <\/script>
    `)}});Re.get("/dashboard",async e=>{const s=e.get("user");try{const a=await e.env.DB.prepare("SELECT COUNT(*) as count FROM articles").first(),r=await e.env.DB.prepare('SELECT COUNT(*) as count FROM contact_inquiries WHERE status = "new"').first(),i=await e.env.DB.prepare('SELECT COUNT(*) as count FROM articles WHERE status = "published"').first(),n=await e.env.DB.prepare("SELECT COUNT(*) as count FROM clients WHERE is_active = 1").first();return e.html(`
      <!DOCTYPE html>
      <html lang="id">
      <head>
          <meta charset="UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>Dashboard Admin - IndoPrivate</title>
          <script src="https://cdn.tailwindcss.com"><\/script>
          <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
      </head>
      <body class="bg-gray-100">
          ${Rr(s)}
          
          <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
              <div class="mb-8">
                  <h1 class="text-3xl font-bold text-gray-800">Dashboard Admin</h1>
                  <p class="text-gray-600 mt-2">Selamat datang kembali, ${s.name}</p>
              </div>
              
              <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
                  <div class="bg-white p-6 rounded-xl shadow-lg">
                      <div class="flex items-center">
                          <div class="bg-blue-100 p-3 rounded-full">
                              <i class="fas fa-newspaper text-blue-600 text-xl"></i>
                          </div>
                          <div class="ml-4">
                              <h3 class="text-lg font-semibold text-gray-800">Total Artikel</h3>
                              <p class="text-2xl font-bold text-blue-600">${a.count}</p>
                          </div>
                      </div>
                  </div>
                  
                  <div class="bg-white p-6 rounded-xl shadow-lg">
                      <div class="flex items-center">
                          <div class="bg-green-100 p-3 rounded-full">
                              <i class="fas fa-check-circle text-green-600 text-xl"></i>
                          </div>
                          <div class="ml-4">
                              <h3 class="text-lg font-semibold text-gray-800">Artikel Published</h3>
                              <p class="text-2xl font-bold text-green-600">${i.count}</p>
                          </div>
                      </div>
                  </div>
                  
                  <div class="bg-white p-6 rounded-xl shadow-lg">
                      <div class="flex items-center">
                          <div class="bg-orange-100 p-3 rounded-full">
                              <i class="fas fa-envelope text-orange-600 text-xl"></i>
                          </div>
                          <div class="ml-4">
                              <h3 class="text-lg font-semibold text-gray-800">Inquiry Baru</h3>
                              <p class="text-2xl font-bold text-orange-600">${r.count}</p>
                          </div>
                      </div>
                  </div>
                  
                  <div class="bg-white p-6 rounded-xl shadow-lg">
                      <div class="flex items-center">
                          <div class="bg-purple-100 p-3 rounded-full">
                              <i class="fas fa-building text-purple-600 text-xl"></i>
                          </div>
                          <div class="ml-4">
                              <h3 class="text-lg font-semibold text-gray-800">Klien Aktif</h3>
                              <p class="text-2xl font-bold text-purple-600">${n.count}</p>
                          </div>
                      </div>
                  </div>
              </div>
              
              <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
                  <div class="bg-white p-6 rounded-xl shadow-lg">
                      <h2 class="text-xl font-bold text-gray-800 mb-4">
                          <i class="fas fa-newspaper mr-2"></i>
                          Quick Actions
                      </h2>
                      <div class="space-y-4">
                          <a href="/admin/articles/create" class="flex items-center p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors">
                              <i class="fas fa-plus text-blue-600 mr-3"></i>
                              <div>
                                  <h3 class="font-semibold text-gray-800">Buat Artikel Baru</h3>
                                  <p class="text-gray-600 text-sm">Tulis dan publikasikan artikel terbaru</p>
                              </div>
                          </a>
                          
                          <a href="/admin/articles" class="flex items-center p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors">
                              <i class="fas fa-list text-green-600 mr-3"></i>
                              <div>
                                  <h3 class="font-semibold text-gray-800">Kelola Artikel</h3>
                                  <p class="text-gray-600 text-sm">Edit atau hapus artikel yang ada</p>
                              </div>
                          </a>
                          
                          <a href="/admin/inquiries" class="flex items-center p-4 bg-orange-50 rounded-lg hover:bg-orange-100 transition-colors">
                              <i class="fas fa-envelope text-orange-600 mr-3"></i>
                              <div>
                                  <h3 class="font-semibold text-gray-800">Lihat Inquiry</h3>
                                  <p class="text-gray-600 text-sm">Respon pertanyaan dari prospek</p>
                              </div>
                          </a>
                          
                          <a href="/admin/clients" class="flex items-center p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors">
                              <i class="fas fa-building text-purple-600 mr-3"></i>
                              <div>
                                  <h3 class="font-semibold text-gray-800">Kelola Klien</h3>
                                  <p class="text-gray-600 text-sm">Manage client showcase dan portfolio</p>
                              </div>
                          </a>
                          
                          <a href="/admin/team" class="flex items-center p-4 bg-teal-50 rounded-lg hover:bg-teal-100 transition-colors">
                              <i class="fas fa-users text-teal-600 mr-3"></i>
                              <div>
                                  <h3 class="font-semibold text-gray-800">Kelola Tim</h3>
                                  <p class="text-gray-600 text-sm">Manage profil anggota tim</p>
                              </div>
                          </a>
                      </div>
                  </div>
                  
                  <div class="bg-white p-6 rounded-xl shadow-lg">
                      <h2 class="text-xl font-bold text-gray-800 mb-4">
                          <i class="fas fa-chart-bar mr-2"></i>
                          Website Statistics
                      </h2>
                      <div class="space-y-4">
                          <div class="flex justify-between items-center">
                              <span class="text-gray-600">Artikel Terbaru</span>
                              <span class="font-semibold">7 hari terakhir</span>
                          </div>
                          <div class="flex justify-between items-center">
                              <span class="text-gray-600">Total Halaman</span>
                              <span class="font-semibold">8 halaman</span>
                          </div>
                          <div class="flex justify-between items-center">
                              <span class="text-gray-600">Status Website</span>
                              <span class="text-green-600 font-semibold">
                                  <i class="fas fa-check-circle mr-1"></i>
                                  Online
                              </span>
                          </div>
                      </div>
                  </div>
              </div>
          </div>
      </body>
      </html>
    `)}catch(a){return console.error("Dashboard error:",a),e.html("<div>Error loading dashboard</div>")}});function Rr(e){return`
    <nav class="bg-white shadow-lg border-b">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between items-center h-16">
                <div class="flex items-center">
                    <h1 class="text-xl font-bold text-gray-800">
                        <i class="fas fa-chart-line text-blue-600 mr-2"></i>
                        IndoPrivate Admin
                    </h1>
                </div>
                
                <div class="hidden md:flex items-center space-x-6">
                    <a href="/admin/dashboard" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-tachometer-alt mr-1"></i>
                        Dashboard
                    </a>
                    <a href="/admin/articles" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-newspaper mr-1"></i>
                        Artikel
                    </a>
                    <a href="/admin/inquiries" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-envelope mr-1"></i>
                        Inquiry
                    </a>
                    <a href="/admin/clients" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-building mr-1"></i>
                        Klien
                    </a>
                    <a href="/admin/team" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-users mr-1"></i>
                        Tim
                    </a>
                    <a href="/admin/settings" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-cog mr-1"></i>
                        Settings
                    </a>
                    <a href="/" target="_blank" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-external-link-alt mr-1"></i>
                        Lihat Website
                    </a>
                </div>
                
                <div class="flex items-center">
                    <span class="text-gray-700 mr-4">
                        <i class="fas fa-user mr-1"></i>
                        ${e.name}
                    </span>
                    <a href="/admin/logout" class="text-red-600 hover:text-red-700 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-sign-out-alt mr-1"></i>
                        Logout
                    </a>
                </div>
            </div>
        </div>
    </nav>
  `}Re.get("/logout",e=>(Ys(e,"admin_session"),e.redirect("/admin/login")));const Ve=new se;Ve.get("/",async e=>{try{const s=await e.env.DB.prepare("SELECT * FROM articles ORDER BY created_at DESC").all(),a=e.get("user");return e.html(`
      <!DOCTYPE html>
      <html lang="id">
      <head>
          <meta charset="UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>Kelola Artikel - Admin IndoPrivate</title>
          <script src="https://cdn.tailwindcss.com"><\/script>
          <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
      </head>
      <body class="bg-gray-100">
          ${Js(a)}
          
          <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
              <div class="flex justify-between items-center mb-8">
                  <h1 class="text-3xl font-bold text-gray-800">Kelola Artikel</h1>
                  <a href="/admin/articles/create" class="bg-blue-600 text-white px-6 py-3 rounded-lg font-semibold hover:bg-blue-700 transition-colors">
                      <i class="fas fa-plus mr-2"></i>
                      Buat Artikel Baru
                  </a>
              </div>
              
              <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                  <div class="overflow-x-auto">
                      <table class="w-full">
                          <thead class="bg-gray-50">
                              <tr>
                                  <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Judul</th>
                                  <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Kategori</th>
                                  <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
                                  <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tanggal</th>
                                  <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Aksi</th>
                              </tr>
                          </thead>
                          <tbody class="bg-white divide-y divide-gray-200">
                              ${s.results.map(r=>{var i;return`
                                  <tr class="hover:bg-gray-50">
                                      <td class="px-6 py-4">
                                          <div>
                                              <div class="text-sm font-medium text-gray-900">${r.title}</div>
                                              <div class="text-sm text-gray-500">${(i=r.excerpt)==null?void 0:i.substring(0,100)}...</div>
                                          </div>
                                      </td>
                                      <td class="px-6 py-4 whitespace-nowrap">
                                          <span class="px-2 py-1 text-xs font-semibold rounded-full bg-blue-100 text-blue-800">
                                              ${r.category}
                                          </span>
                                      </td>
                                      <td class="px-6 py-4 whitespace-nowrap">
                                          <span class="px-2 py-1 text-xs font-semibold rounded-full ${r.status==="published"?"bg-green-100 text-green-800":r.status==="draft"?"bg-yellow-100 text-yellow-800":"bg-gray-100 text-gray-800"}">
                                              ${r.status}
                                          </span>
                                      </td>
                                      <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
                                          ${_e(r.created_at)}
                                      </td>
                                      <td class="px-6 py-4 whitespace-nowrap text-sm font-medium space-x-2">
                                          <a href="/admin/articles/edit/${r.id}" class="text-blue-600 hover:text-blue-900">
                                              <i class="fas fa-edit mr-1"></i>Edit
                                          </a>
                                          <a href="/artikel/${r.slug}" target="_blank" class="text-green-600 hover:text-green-900">
                                              <i class="fas fa-eye mr-1"></i>Lihat
                                          </a>
                                          <button onclick="deleteArticle(${r.id})" class="text-red-600 hover:text-red-900">
                                              <i class="fas fa-trash mr-1"></i>Hapus
                                          </button>
                                      </td>
                                  </tr>
                              `}).join("")}
                          </tbody>
                      </table>
                  </div>
              </div>
          </div>
          
          <script>
              function deleteArticle(id) {
                  if (confirm('Apakah Anda yakin ingin menghapus artikel ini?')) {
                      fetch('/admin/articles/' + id + '/delete', { method: 'POST' })
                          .then(() => window.location.reload());
                  }
              }
          <\/script>
      </body>
      </html>
    `)}catch(s){return e.html(`<div>Error: ${s.message}</div>`)}});Ve.get("/create",e=>{const s=e.get("user");return e.html(`
    <!DOCTYPE html>
    <html lang="id">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Buat Artikel Baru - Admin IndoPrivate</title>
        <script src="https://cdn.tailwindcss.com"><\/script>
        <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
        <!-- Include Quill.js for rich text editing -->
        <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
        <script src="https://cdn.quilljs.com/1.3.6/quill.min.js"><\/script>
    </head>
    <body class="bg-gray-100">
        ${Js(s)}
        
        <div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
            <div class="mb-8">
                <h1 class="text-3xl font-bold text-gray-800">Buat Artikel Baru</h1>
                <p class="text-gray-600 mt-2">Tulis dan publikasikan artikel untuk website</p>
            </div>
            
            <form id="articleForm" action="/admin/articles/create" method="POST" class="bg-white rounded-xl shadow-lg p-8 space-y-6">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">Judul Artikel</label>
                        <input 
                            type="text" 
                            name="title" 
                            id="title"
                            required 
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                            placeholder="Masukkan judul artikel"
                        />
                    </div>
                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">Slug URL</label>
                        <input 
                            type="text" 
                            name="slug" 
                            id="slug"
                            required 
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                            placeholder="url-artikel-ini"
                        />
                    </div>
                </div>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">Kategori</label>
                        <select 
                            name="category" 
                            required 
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                        >
                            <option value="news">Berita</option>
                            <option value="analysis">Analisis</option>
                            <option value="guide">Panduan</option>
                            <option value="insights">Insights</option>
                            <option value="market-update">Update Pasar</option>
                        </select>
                    </div>
                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">Status</label>
                        <select 
                            name="status" 
                            required 
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                        >
                            <option value="draft">Draft</option>
                            <option value="published">Published</option>
                        </select>
                    </div>
                </div>
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">Excerpt (Ringkasan)</label>
                    <textarea 
                        name="excerpt" 
                        rows="3" 
                        class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                        placeholder="Tuliskan ringkasan artikel untuk preview..."
                    ></textarea>
                </div>
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">Konten Artikel</label>
                    <div id="editor" style="height: 400px;"></div>
                    <input type="hidden" name="content" id="content" />
                </div>
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">Tags (pisahkan dengan koma)</label>
                    <input 
                        type="text" 
                        name="tags" 
                        class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                        placeholder="private equity, investasi, IPO, valuasi"
                    />
                </div>
                
                <div class="flex justify-between items-center pt-6">
                    <a href="/admin/articles" class="px-6 py-3 text-gray-700 bg-gray-200 rounded-lg hover:bg-gray-300 transition-colors">
                        <i class="fas fa-arrow-left mr-2"></i>
                        Kembali
                    </a>
                    <button 
                        type="submit" 
                        class="px-8 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 transition-colors"
                    >
                        <i class="fas fa-save mr-2"></i>
                        Simpan Artikel
                    </button>
                </div>
            </form>
        </div>
        
        <script>
            // Initialize Quill editor
            const quill = new Quill('#editor', {
                theme: 'snow',
                placeholder: 'Tulis konten artikel di sini...',
                modules: {
                    toolbar: [
                        [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
                        ['bold', 'italic', 'underline', 'strike'],
                        ['blockquote', 'code-block'],
                        [{ 'list': 'ordered'}, { 'list': 'bullet' }],
                        [{ 'color': [] }, { 'background': [] }],
                        ['link', 'image'],
                        ['clean']
                    ]
                }
            });
            
            // Auto-generate slug from title
            document.getElementById('title').addEventListener('input', function() {
                const title = this.value;
                const slug = title.toLowerCase()
                    .trim()
                    .replace(/[^\\w\\s-]/g, '')
                    .replace(/[\\s_-]+/g, '-')
                    .replace(/^-+|-+$/g, '');
                document.getElementById('slug').value = slug;
            });
            
            // Handle form submission
            document.getElementById('articleForm').addEventListener('submit', function() {
                const content = quill.root.innerHTML;
                document.getElementById('content').value = content;
            });
        <\/script>
    </body>
    </html>
  `)});Ve.post("/create",async e=>{try{const s=await e.req.parseBody(),a=e.get("user"),r=new Date().toISOString(),i=s.status==="published"?r:null,n=await e.env.DB.prepare(`INSERT INTO articles (title, slug, excerpt, content, category, status, tags, author_id, published_at, created_at, updated_at) 
       VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).bind(s.title,s.slug,s.excerpt||"",s.content,s.category,s.status,s.tags||"",a.id,i,r,r).run();return e.redirect("/admin/articles")}catch(s){return e.html(`<script>alert('Error: ${s.message}'); window.history.back();<\/script>`)}});Ve.post("/:id/delete",async e=>{try{const s=e.req.param("id");return await e.env.DB.prepare("DELETE FROM articles WHERE id = ?").bind(s).run(),e.json({success:!0})}catch(s){return e.json({error:s.message},500)}});function Js(e){return`
    <nav class="bg-white shadow-lg border-b">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between items-center h-16">
                <div class="flex items-center">
                    <h1 class="text-xl font-bold text-gray-800">
                        <i class="fas fa-chart-line text-blue-600 mr-2"></i>
                        IndoPrivate Admin
                    </h1>
                </div>
                
                <div class="hidden md:flex items-center space-x-6">
                    <a href="/admin/dashboard" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-tachometer-alt mr-1"></i>
                        Dashboard
                    </a>
                    <a href="/admin/articles" class="text-blue-600 font-semibold px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-newspaper mr-1"></i>
                        Artikel
                    </a>
                    <a href="/admin/inquiries" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-envelope mr-1"></i>
                        Inquiry
                    </a>
                    <a href="/admin/settings" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-cog mr-1"></i>
                        Settings
                    </a>
                    <a href="/" target="_blank" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-external-link-alt mr-1"></i>
                        Lihat Website
                    </a>
                </div>
                
                <div class="flex items-center">
                    <span class="text-gray-700 mr-4">
                        <i class="fas fa-user mr-1"></i>
                        ${e.name}
                    </span>
                    <a href="/admin/logout" class="text-red-600 hover:text-red-700 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-sign-out-alt mr-1"></i>
                        Logout
                    </a>
                </div>
            </div>
        </div>
    </nav>
  `}const ct=new se;ct.get("/",async e=>{try{const s=await e.env.DB.prepare("SELECT * FROM contact_inquiries ORDER BY created_at DESC").all(),a=e.get("user");return e.html(`
      <!DOCTYPE html>
      <html lang="id">
      <head>
          <meta charset="UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>Kelola Inquiry - Admin IndoAdvisory</title>
          <script src="https://cdn.tailwindcss.com"><\/script>
          <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
      </head>
      <body class="bg-gray-100">
          ${Ir(a)}
          
          <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
              <div class="flex justify-between items-center mb-8">
                  <h1 class="text-3xl font-bold text-gray-800">Kelola Inquiry</h1>
                  <div class="flex space-x-4">
                      <select id="statusFilter" class="px-4 py-2 border border-gray-300 rounded-lg">
                          <option value="">Semua Status</option>
                          <option value="new">Baru</option>
                          <option value="contacted">Dihubungi</option>
                          <option value="closed">Ditutup</option>
                      </select>
                  </div>
              </div>
              
              <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                  <div class="overflow-x-auto">
                      <table class="w-full">
                          <thead class="bg-gray-50">
                              <tr>
                                  <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nama & Email</th>
                                  <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Perusahaan</th>
                                  <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Layanan</th>
                                  <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
                                  <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tanggal</th>
                                  <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Aksi</th>
                              </tr>
                          </thead>
                          <tbody class="bg-white divide-y divide-gray-200">
                              ${s.results.map(r=>`
                                  <tr class="hover:bg-gray-50">
                                      <td class="px-6 py-4">
                                          <div>
                                              <div class="text-sm font-medium text-gray-900">${r.name}</div>
                                              <div class="text-sm text-gray-500">${r.email}</div>
                                          </div>
                                      </td>
                                      <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
                                          ${r.company||"-"}
                                      </td>
                                      <td class="px-6 py-4 whitespace-nowrap">
                                          <span class="px-2 py-1 text-xs font-semibold rounded-full bg-blue-100 text-blue-800">
                                              ${r.service||"Umum"}
                                          </span>
                                      </td>
                                      <td class="px-6 py-4 whitespace-nowrap">
                                          <select onchange="updateStatus(${r.id}, this.value)" class="text-xs font-semibold rounded-full border-0 ${r.status==="new"?"bg-orange-100 text-orange-800":r.status==="contacted"?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"}">
                                              <option value="new" ${r.status==="new"?"selected":""}>Baru</option>
                                              <option value="contacted" ${r.status==="contacted"?"selected":""}>Dihubungi</option>
                                              <option value="closed" ${r.status==="closed"?"selected":""}>Ditutup</option>
                                          </select>
                                      </td>
                                      <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
                                          ${_e(r.created_at)}
                                      </td>
                                      <td class="px-6 py-4 whitespace-nowrap text-sm font-medium space-x-2">
                                          <button onclick="viewMessage(${r.id}, '${r.message.replace(/'/g,"\\'")}', '${r.name}')" class="text-blue-600 hover:text-blue-900">
                                              <i class="fas fa-eye mr-1"></i>Lihat
                                          </button>
                                          <a href="mailto:${r.email}?subject=Re: Inquiry dari ${r.name}&body=Halo ${r.name},%0A%0ATerima kasih atas inquiry Anda." class="text-green-600 hover:text-green-900">
                                              <i class="fas fa-envelope mr-1"></i>Email
                                          </a>
                                          <button onclick="deleteInquiry(${r.id})" class="text-red-600 hover:text-red-900">
                                              <i class="fas fa-trash mr-1"></i>Hapus
                                          </button>
                                      </td>
                                  </tr>
                              `).join("")}
                          </tbody>
                      </table>
                  </div>
              </div>
          </div>
          
          <!-- Message Modal -->
          <div id="messageModal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50">
              <div class="relative top-20 mx-auto p-5 border w-11/12 md:w-3/4 lg:w-1/2 shadow-lg rounded-md bg-white">
                  <div class="mt-3">
                      <div class="flex justify-between items-center mb-4">
                          <h3 class="text-lg font-medium text-gray-900" id="modalTitle">Pesan Inquiry</h3>
                          <button onclick="closeModal()" class="text-gray-400 hover:text-gray-600">
                              <i class="fas fa-times"></i>
                          </button>
                      </div>
                      <div class="mt-2 px-7 py-3">
                          <p class="text-sm text-gray-500" id="modalMessage"></p>
                      </div>
                      <div class="items-center px-4 py-3">
                          <button onclick="closeModal()" class="px-4 py-2 bg-blue-500 text-white text-base font-medium rounded-md w-full shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-300">
                              Tutup
                          </button>
                      </div>
                  </div>
              </div>
          </div>
          
          <script>
              function updateStatus(id, status) {
                  fetch('/admin/inquiries/' + id + '/status', {
                      method: 'POST',
                      headers: { 'Content-Type': 'application/json' },
                      body: JSON.stringify({ status: status })
                  }).then(() => window.location.reload());
              }
              
              function deleteInquiry(id) {
                  if (confirm('Apakah Anda yakin ingin menghapus inquiry ini?')) {
                      fetch('/admin/inquiries/' + id + '/delete', { method: 'POST' })
                          .then(() => window.location.reload());
                  }
              }
              
              function viewMessage(id, message, name) {
                  document.getElementById('modalTitle').textContent = 'Pesan dari ' + name;
                  document.getElementById('modalMessage').textContent = message;
                  document.getElementById('messageModal').classList.remove('hidden');
              }
              
              function closeModal() {
                  document.getElementById('messageModal').classList.add('hidden');
              }
              
              // Filter functionality
              document.getElementById('statusFilter').addEventListener('change', function() {
                  const filterValue = this.value;
                  const rows = document.querySelectorAll('tbody tr');
                  
                  rows.forEach(row => {
                      const statusSelect = row.querySelector('select');
                      const currentStatus = statusSelect.value;
                      
                      if (filterValue === '' || currentStatus === filterValue) {
                          row.style.display = '';
                      } else {
                          row.style.display = 'none';
                      }
                  });
              });
          <\/script>
      </body>
      </html>
    `)}catch(s){return e.html(`<div>Error: ${s.message}</div>`)}});ct.post("/:id/status",async e=>{try{const s=e.req.param("id"),{status:a}=await e.req.json();return await e.env.DB.prepare("UPDATE contact_inquiries SET status = ? WHERE id = ?").bind(a,s).run(),e.json({success:!0})}catch(s){return e.json({error:s.message},500)}});ct.post("/:id/delete",async e=>{try{const s=e.req.param("id");return await e.env.DB.prepare("DELETE FROM contact_inquiries WHERE id = ?").bind(s).run(),e.json({success:!0})}catch(s){return e.json({error:s.message},500)}});function Ir(e){return`
    <nav class="bg-white shadow-lg border-b">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between items-center h-16">
                <div class="flex items-center">
                    <h1 class="text-xl font-bold text-gray-800">
                        <i class="fas fa-chart-line text-blue-600 mr-2"></i>
                        IndoAdvisory Admin
                    </h1>
                </div>
                
                <div class="hidden md:flex items-center space-x-6">
                    <a href="/admin/dashboard" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-tachometer-alt mr-1"></i>
                        Dashboard
                    </a>
                    <a href="/admin/articles" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-newspaper mr-1"></i>
                        Artikel
                    </a>
                    <a href="/admin/inquiries" class="text-blue-600 font-semibold px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-envelope mr-1"></i>
                        Inquiry
                    </a>
                    <a href="/admin/team" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-users mr-1"></i>
                        Tim
                    </a>
                    <a href="/admin/settings" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-cog mr-1"></i>
                        Settings
                    </a>
                    <a href="/" target="_blank" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-external-link-alt mr-1"></i>
                        Lihat Website
                    </a>
                </div>
                
                <div class="flex items-center">
                    <span class="text-gray-700 mr-4">
                        <i class="fas fa-user mr-1"></i>
                        ${e.name}
                    </span>
                    <a href="/admin/logout" class="text-red-600 hover:text-red-700 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-sign-out-alt mr-1"></i>
                        Logout
                    </a>
                </div>
            </div>
        </div>
    </nav>
  `}const Mt=new se;Mt.get("/",async e=>{try{const s=await e.env.DB.prepare("SELECT * FROM site_settings ORDER BY setting_key").all(),a=e.get("user"),r={};return s.results.forEach(i=>{r[i.setting_key]=i.setting_value}),e.html(`
      <!DOCTYPE html>
      <html lang="id">
      <head>
          <meta charset="UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>Pengaturan Website - Admin IndoAdvisory</title>
          <script src="https://cdn.tailwindcss.com"><\/script>
          <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
      </head>
      <body class="bg-gray-100">
          ${Pr(a)}
          
          <div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
              <div class="mb-8">
                  <h1 class="text-3xl font-bold text-gray-800">Pengaturan Website</h1>
                  <p class="text-gray-600 mt-2">Kelola informasi dasar website dan perusahaan</p>
              </div>
              
              <form id="settingsForm" action="/admin/settings" method="POST" class="space-y-8">
                  <!-- Company Information -->
                  <div class="bg-white rounded-xl shadow-lg p-8">
                      <h2 class="text-xl font-bold text-gray-800 mb-6">
                          <i class="fas fa-building mr-2 text-blue-600"></i>
                          Informasi Perusahaan
                      </h2>
                      
                      <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Nama Perusahaan</label>
                              <input 
                                  type="text" 
                                  name="company_name" 
                                  value="${r.company_name||"IndoAdvisory"}"
                                  required 
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              />
                          </div>
                          
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Email Perusahaan</label>
                              <input 
                                  type="email" 
                                  name="company_email" 
                                  value="${r.company_email||"info@indoadvisory.co.id"}"
                                  required 
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              />
                          </div>
                          
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Telepon</label>
                              <input 
                                  type="text" 
                                  name="company_phone" 
                                  value="${r.company_phone||"+62 21 5794 3210"}"
                                  required 
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              />
                          </div>
                          
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Website URL</label>
                              <input 
                                  type="url" 
                                  name="company_website" 
                                  value="${r.company_website||"https://indoadvisory.co.id"}"
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              />
                          </div>
                      </div>
                      
                      <div class="mt-6">
                          <label class="block text-sm font-medium text-gray-700 mb-2">Alamat Lengkap</label>
                          <textarea 
                              name="company_address" 
                              rows="3"
                              class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              placeholder="Alamat lengkap perusahaan"
                          >${r.company_address||"Menara Sudirman Lt. 25\\nJl. Jend. Sudirman Kav. 60\\nJakarta Selatan 12190"}</textarea>
                      </div>
                  </div>
                  
                  <!-- Website Settings -->
                  <div class="bg-white rounded-xl shadow-lg p-8">
                      <h2 class="text-xl font-bold text-gray-800 mb-6">
                          <i class="fas fa-globe mr-2 text-blue-600"></i>
                          Pengaturan Website
                      </h2>
                      
                      <div class="space-y-6">
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Judul Website</label>
                              <input 
                                  type="text" 
                                  name="site_title" 
                                  value="${r.site_title||"IndoAdvisory - Penasihat Investasi Terpercaya"}"
                                  required 
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              />
                          </div>
                          
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Deskripsi Website</label>
                              <textarea 
                                  name="site_description" 
                                  rows="3"
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                                  placeholder="Deskripsi singkat tentang perusahaan"
                              >${r.site_description||"Firma konsultan private equity terkemuka di Indonesia"}</textarea>
                          </div>
                          
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Bahasa Default</label>
                              <select 
                                  name="default_language" 
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              >
                                  <option value="id" ${(r.default_language||"id")==="id"?"selected":""}>Bahasa Indonesia</option>
                                  <option value="en" ${r.default_language==="en"?"selected":""}>English</option>
                              </select>
                          </div>
                      </div>
                  </div>
                  
                  <!-- Hero Section Settings -->
                  <div class="bg-white rounded-xl shadow-lg p-8">
                      <h2 class="text-xl font-bold text-gray-800 mb-6">
                          <i class="fas fa-star mr-2 text-blue-600"></i>
                          Hero Section
                      </h2>
                      
                      <div class="space-y-6">
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Judul Hero (Bahasa Indonesia)</label>
                              <input 
                                  type="text" 
                                  name="hero_title_id" 
                                  value="${r.hero_title_id||"Penasihat Private Equity Terpercaya di Indonesia"}"
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              />
                          </div>
                          
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Judul Hero (English)</label>
                              <input 
                                  type="text" 
                                  name="hero_title_en" 
                                  value="${r.hero_title_en||"Trusted Private Equity Advisory in Indonesia"}"
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              />
                          </div>
                          
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Subtitle Hero (Bahasa Indonesia)</label>
                              <textarea 
                                  name="hero_subtitle_id" 
                                  rows="3"
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              >${r.hero_subtitle_id||"Kami membantu perusahaan mencapai pertumbuhan berkelanjutan melalui strategi investasi yang tepat, valuasi perusahaan yang akurat, dan persiapan IPO yang komprehensif."}</textarea>
                          </div>
                          
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Subtitle Hero (English)</label>
                              <textarea 
                                  name="hero_subtitle_en" 
                                  rows="3"
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              >${r.hero_subtitle_en||"We help companies achieve sustainable growth through strategic investments, accurate company valuations, and comprehensive IPO preparation."}</textarea>
                          </div>
                      </div>
                  </div>
                  
                  <!-- Statistics Settings -->
                  <div class="bg-white rounded-xl shadow-lg p-8">
                      <h2 class="text-xl font-bold text-gray-800 mb-6">
                          <i class="fas fa-chart-bar mr-2 text-blue-600"></i>
                          Statistik Perusahaan
                      </h2>
                      
                      <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Total Klien</label>
                              <input 
                                  type="number" 
                                  name="stats_clients" 
                                  value="${r.stats_clients||"150"}"
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              />
                          </div>
                          
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Total Valuasi</label>
                              <input 
                                  type="text" 
                                  name="stats_valuation" 
                                  value="${r.stats_valuation||"Rp 2.5T"}"
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              />
                          </div>
                          
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">IPO Sukses</label>
                              <input 
                                  type="number" 
                                  name="stats_ipos" 
                                  value="${r.stats_ipos||"25"}"
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              />
                          </div>
                          
                          <div>
                              <label class="block text-sm font-medium text-gray-700 mb-2">Satisfaction Rate (%)</label>
                              <input 
                                  type="number" 
                                  name="stats_satisfaction" 
                                  value="${r.stats_satisfaction||"98"}"
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                              />
                          </div>
                      </div>
                  </div>
                  
                  <!-- Portfolio Section Settings -->
                  <div class="bg-white rounded-xl shadow-lg p-8">
                      <h2 class="text-xl font-bold text-gray-800 mb-6">
                          <i class="fas fa-eye mr-2 text-blue-600"></i>
                          Pengaturan Portfolio & Statistik
                      </h2>
                      
                      <div class="space-y-6">
                          <div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
                              <div class="flex items-center justify-between">
                                  <div>
                                      <h3 class="font-semibold text-gray-800">Tampilkan Bagian Portfolio</h3>
                                      <p class="text-sm text-gray-600 mt-1">Menampilkan atau menyembunyikan seluruh bagian Portfolio & Prestasi di halaman utama</p>
                                  </div>
                                  <label class="relative inline-flex items-center cursor-pointer">
                                      <input type="checkbox" name="portfolio_section_enabled" value="1" 
                                             ${(r.portfolio_section_enabled||"1")==="1"?"checked":""}
                                             class="sr-only peer">
                                      <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"></div>
                                  </label>
                              </div>
                          </div>
                          
                          <div class="bg-green-50 border border-green-200 rounded-lg p-4">
                              <div class="flex items-center justify-between">
                                  <div>
                                      <h3 class="font-semibold text-gray-800">Tampilkan Statistik Kinerja</h3>
                                      <p class="text-sm text-gray-600 mt-1">Menampilkan atau menyembunyikan grafik dan data statistik dalam bagian portfolio</p>
                                  </div>
                                  <label class="relative inline-flex items-center cursor-pointer">
                                      <input type="checkbox" name="portfolio_statistics_enabled" value="1" 
                                             ${(r.portfolio_statistics_enabled||"1")==="1"?"checked":""}
                                             class="sr-only peer">
                                      <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-green-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-green-600"></div>
                                  </label>
                              </div>
                          </div>
                          
                          <div class="bg-yellow-50 border border-yellow-200 rounded-lg p-4">
                              <h4 class="font-medium text-gray-800 mb-2">
                                  <i class="fas fa-info-circle text-yellow-600 mr-2"></i>
                                  Informasi Pengaturan
                              </h4>
                              <ul class="text-sm text-gray-600 space-y-1">
                                  <li>• <strong>Portfolio Section</strong>: Mengontrol visibilitas keseluruhan bagian "Portfolio & Prestasi"</li>
                                  <li>• <strong>Statistik Kinerja</strong>: Mengontrol tampilan grafik dan data statistik di dalam portfolio</li>
                                  <li>• Client showcase (Klien Terkini) akan tetap tampil meskipun statistik dimatikan</li>
                                  <li>• Perubahan akan terlihat langsung di halaman utama setelah disimpan</li>
                              </ul>
                          </div>
                      </div>
                  </div>
                  
                  <div class="flex justify-end space-x-4">
                      <button 
                          type="button" 
                          onclick="window.location.href='/admin/dashboard'" 
                          class="px-6 py-3 text-gray-700 bg-gray-200 rounded-lg hover:bg-gray-300 transition-colors"
                      >
                          <i class="fas fa-times mr-2"></i>
                          Batal
                      </button>
                      <button 
                          type="submit" 
                          class="px-8 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 transition-colors"
                      >
                          <i class="fas fa-save mr-2"></i>
                          Simpan Pengaturan
                      </button>
                  </div>
              </form>
          </div>
          
          <script>
              document.getElementById('settingsForm').addEventListener('submit', function(e) {
                  e.preventDefault();
                  
                  const formData = new FormData(this);
                  const settings = {};
                  
                  // Handle regular form fields
                  for (let [key, value] of formData.entries()) {
                      settings[key] = value;
                  }
                  
                  // Handle unchecked checkboxes (they don't appear in formData)
                  const checkboxes = this.querySelectorAll('input[type="checkbox"]');
                  checkboxes.forEach(checkbox => {
                      if (!settings.hasOwnProperty(checkbox.name)) {
                          settings[checkbox.name] = '0';
                      }
                  });
                  
                  fetch('/admin/settings', {
                      method: 'POST',
                      headers: {
                          'Content-Type': 'application/json',
                      },
                      body: JSON.stringify(settings)
                  })
                  .then(response => response.json())
                  .then(data => {
                      if (data.success) {
                          alert('Pengaturan berhasil disimpan!');
                          window.location.reload();
                      } else {
                          alert('Terjadi kesalahan: ' + data.error);
                      }
                  })
                  .catch(error => {
                      alert('Terjadi kesalahan: ' + error.message);
                  });
              });
          <\/script>
      </body>
      </html>
    `)}catch(s){return e.html(`<div>Error: ${s.message}</div>`)}});Mt.post("/",async e=>{try{const s=await e.req.json();for(const[a,r]of Object.entries(s))await e.env.DB.prepare(`
        INSERT INTO site_settings (setting_key, setting_value, updated_at) 
        VALUES (?, ?, ?) 
        ON CONFLICT(setting_key) 
        DO UPDATE SET setting_value = ?, updated_at = ?
      `).bind(a,r,new Date().toISOString(),r,new Date().toISOString()).run();return e.json({success:!0})}catch(s){return e.json({error:s.message},500)}});function Pr(e){return`
    <nav class="bg-white shadow-lg border-b">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between items-center h-16">
                <div class="flex items-center">
                    <h1 class="text-xl font-bold text-gray-800">
                        <i class="fas fa-chart-line text-blue-600 mr-2"></i>
                        IndoAdvisory Admin
                    </h1>
                </div>
                
                <div class="hidden md:flex items-center space-x-6">
                    <a href="/admin/dashboard" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-tachometer-alt mr-1"></i>
                        Dashboard
                    </a>
                    <a href="/admin/articles" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-newspaper mr-1"></i>
                        Artikel
                    </a>
                    <a href="/admin/inquiries" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-envelope mr-1"></i>
                        Inquiry
                    </a>
                    <a href="/admin/team" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-users mr-1"></i>
                        Tim
                    </a>
                    <a href="/admin/settings" class="text-blue-600 font-semibold px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-cog mr-1"></i>
                        Settings
                    </a>
                    <a href="/" target="_blank" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-external-link-alt mr-1"></i>
                        Lihat Website
                    </a>
                </div>
                
                <div class="flex items-center">
                    <span class="text-gray-700 mr-4">
                        <i class="fas fa-user mr-1"></i>
                        ${e.name}
                    </span>
                    <a href="/admin/logout" class="text-red-600 hover:text-red-700 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-sign-out-alt mr-1"></i>
                        Logout
                    </a>
                </div>
            </div>
        </div>
    </nav>
  `}const Ie=new se;Ie.get("/",async e=>{try{const s=await e.env.DB.prepare("SELECT * FROM team_members ORDER BY sort_order ASC, created_at ASC").all(),a=e.get("user");return e.html(`
      <!DOCTYPE html>
      <html lang="id">
      <head>
          <meta charset="UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>Kelola Tim - Admin IndoAdvisory</title>
          <script src="https://cdn.tailwindcss.com"><\/script>
          <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
      </head>
      <body class="bg-gray-100">
          ${Gs(a)}
          
          <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
              <div class="flex justify-between items-center mb-8">
                  <h1 class="text-3xl font-bold text-gray-800">Kelola Tim Ahli</h1>
                  <a href="/admin/team/create" class="bg-blue-600 text-white px-6 py-3 rounded-lg font-semibold hover:bg-blue-700 transition-colors">
                      <i class="fas fa-plus mr-2"></i>
                      Tambah Anggota Tim
                  </a>
              </div>
              
              <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
                  ${s.results.map(r=>`
                      <div class="bg-white rounded-xl shadow-lg overflow-hidden ${r.is_active?"":"opacity-60"}">
                          <div class="p-6">
                              <div class="flex items-center justify-between mb-4">
                                  <div class="w-16 h-16 bg-gradient-to-br from-blue-400 to-blue-600 rounded-full flex items-center justify-center">
                                      ${r.image_url?`<img src="${r.image_url}" alt="${r.name}" class="w-16 h-16 rounded-full object-cover">`:'<i class="fas fa-user text-white text-xl"></i>'}
                                  </div>
                                  <div class="text-right">
                                      <span class="text-xs font-medium px-2 py-1 rounded-full ${r.is_active?"bg-green-100 text-green-800":"bg-gray-100 text-gray-600"}">
                                          ${r.is_active?"Aktif":"Nonaktif"}
                                      </span>
                                  </div>
                              </div>
                              
                              <h3 class="text-xl font-bold text-gray-900 mb-2">${r.name}</h3>
                              <p class="text-blue-600 font-medium mb-3">${r.position_id}</p>
                              
                              ${r.bio_id?`
                                  <p class="text-gray-600 text-sm mb-4 line-clamp-3">${r.bio_id}</p>
                              `:""}
                              
                              <div class="flex items-center justify-between">
                                  <div class="flex space-x-2">
                                      ${r.email?`
                                          <a href="mailto:${r.email}" class="text-gray-500 hover:text-blue-600">
                                              <i class="fas fa-envelope"></i>
                                          </a>
                                      `:""}
                                      ${r.linkedin_url?`
                                          <a href="${r.linkedin_url}" target="_blank" class="text-gray-500 hover:text-blue-600">
                                              <i class="fab fa-linkedin"></i>
                                          </a>
                                      `:""}
                                  </div>
                                  
                                  <div class="flex space-x-2">
                                      <a href="/admin/team/edit/${r.id}" class="text-blue-600 hover:text-blue-900">
                                          <i class="fas fa-edit"></i>
                                      </a>
                                      <button onclick="toggleStatus(${r.id}, ${r.is_active})" class="text-${r.is_active?"orange":"green"}-600 hover:text-${r.is_active?"orange":"green"}-900">
                                          <i class="fas fa-${r.is_active?"pause":"play"}"></i>
                                      </button>
                                      <button onclick="deleteMember(${r.id})" class="text-red-600 hover:text-red-900">
                                          <i class="fas fa-trash"></i>
                                      </button>
                                  </div>
                              </div>
                              
                              <div class="mt-4 text-center">
                                  <span class="text-xs text-gray-500">Urutan: ${r.sort_order}</span>
                              </div>
                          </div>
                      </div>
                  `).join("")}
                  
                  ${s.results.length===0?`
                      <div class="col-span-full text-center py-16">
                          <i class="fas fa-users text-gray-400 text-6xl mb-4"></i>
                          <h3 class="text-xl font-semibold text-gray-600 mb-2">Belum Ada Anggota Tim</h3>
                          <p class="text-gray-500 mb-6">Tambahkan anggota tim pertama untuk mulai membangun profil perusahaan</p>
                          <a href="/admin/team/create" class="bg-blue-600 text-white px-6 py-3 rounded-lg font-semibold hover:bg-blue-700 transition-colors">
                              <i class="fas fa-plus mr-2"></i>
                              Tambah Anggota Tim
                          </a>
                      </div>
                  `:""}
              </div>
          </div>
          
          <script>
              function toggleStatus(id, currentStatus) {
                  const newStatus = !currentStatus;
                  fetch('/admin/team/' + id + '/toggle', { 
                      method: 'POST',
                      headers: { 'Content-Type': 'application/json' },
                      body: JSON.stringify({ is_active: newStatus })
                  }).then(() => window.location.reload());
              }
              
              function deleteMember(id) {
                  if (confirm('Apakah Anda yakin ingin menghapus anggota tim ini?')) {
                      fetch('/admin/team/' + id + '/delete', { method: 'POST' })
                          .then(() => window.location.reload());
                  }
              }
          <\/script>
      </body>
      </html>
    `)}catch(s){return e.html(`<div>Error: ${s.message}</div>`)}});Ie.get("/create",e=>{const s=e.get("user");return e.html(`
    <!DOCTYPE html>
    <html lang="id">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Tambah Anggota Tim - Admin IndoAdvisory</title>
        <script src="https://cdn.tailwindcss.com"><\/script>
        <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    </head>
    <body class="bg-gray-100">
        ${Gs(s)}
        
        <div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
            <div class="mb-8">
                <h1 class="text-3xl font-bold text-gray-800">Tambah Anggota Tim</h1>
                <p class="text-gray-600 mt-2">Tambahkan profil anggota tim baru</p>
            </div>
            
            <form action="/admin/team/create" method="POST" class="bg-white rounded-xl shadow-lg p-8 space-y-6">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">Nama Lengkap</label>
                        <input 
                            type="text" 
                            name="name" 
                            required 
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                            placeholder="Dr. Budi Santoso"
                        />
                    </div>
                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">Email</label>
                        <input 
                            type="email" 
                            name="email" 
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                            placeholder="budi.santoso@indoadvisory.co.id"
                        />
                    </div>
                </div>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">Posisi (Bahasa Indonesia)</label>
                        <input 
                            type="text" 
                            name="position_id" 
                            required 
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                            placeholder="Managing Partner"
                        />
                    </div>
                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">Posisi (English)</label>
                        <input 
                            type="text" 
                            name="position_en" 
                            required 
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                            placeholder="Managing Partner"
                        />
                    </div>
                </div>
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">Bio/Pengalaman (Bahasa Indonesia)</label>
                    <textarea 
                        name="bio_id" 
                        rows="4" 
                        class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                        placeholder="Pengalaman dan latar belakang pendidikan..."
                    ></textarea>
                </div>
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">Bio/Experience (English)</label>
                    <textarea 
                        name="bio_en" 
                        rows="4" 
                        class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                        placeholder="Experience and educational background..."
                    ></textarea>
                </div>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">LinkedIn URL</label>
                        <input 
                            type="url" 
                            name="linkedin_url" 
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                            placeholder="https://linkedin.com/in/username"
                        />
                    </div>
                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">URL Foto Profil</label>
                        <input 
                            type="url" 
                            name="image_url" 
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                            placeholder="https://example.com/foto-profil.jpg"
                        />
                    </div>
                </div>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">Urutan Tampil</label>
                        <input 
                            type="number" 
                            name="sort_order" 
                            min="0" 
                            value="0"
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                        />
                        <p class="text-sm text-gray-500 mt-1">Semakin kecil angka, semakin atas urutan tampil</p>
                    </div>
                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 mb-2">Status</label>
                        <select 
                            name="is_active" 
                            class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                        >
                            <option value="1">Aktif</option>
                            <option value="0">Nonaktif</option>
                        </select>
                    </div>
                </div>
                
                <div class="flex justify-between items-center pt-6">
                    <a href="/admin/team" class="px-6 py-3 text-gray-700 bg-gray-200 rounded-lg hover:bg-gray-300 transition-colors">
                        <i class="fas fa-arrow-left mr-2"></i>
                        Kembali
                    </a>
                    <button 
                        type="submit" 
                        class="px-8 py-3 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 transition-colors"
                    >
                        <i class="fas fa-save mr-2"></i>
                        Simpan Anggota Tim
                    </button>
                </div>
            </form>
        </div>
    </body>
    </html>
  `)});Ie.post("/create",async e=>{try{const s=await e.req.parseBody(),a=new Date().toISOString();return await e.env.DB.prepare(`INSERT INTO team_members (name, position_id, position_en, bio_id, bio_en, email, linkedin_url, image_url, sort_order, is_active, created_at, updated_at) 
       VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).bind(s.name,s.position_id,s.position_en,s.bio_id||null,s.bio_en||null,s.email||null,s.linkedin_url||null,s.image_url||null,parseInt(s.sort_order)||0,parseInt(s.is_active)===1,a,a).run(),e.redirect("/admin/team")}catch(s){return e.html(`<script>alert('Error: ${s.message}'); window.history.back();<\/script>`)}});Ie.post("/:id/toggle",async e=>{try{const s=e.req.param("id"),{is_active:a}=await e.req.json();return await e.env.DB.prepare("UPDATE team_members SET is_active = ?, updated_at = ? WHERE id = ?").bind(a,new Date().toISOString(),s).run(),e.json({success:!0})}catch(s){return e.json({error:s.message},500)}});Ie.post("/:id/delete",async e=>{try{const s=e.req.param("id");return await e.env.DB.prepare("DELETE FROM team_members WHERE id = ?").bind(s).run(),e.json({success:!0})}catch(s){return e.json({error:s.message},500)}});function Gs(e){return`
    <nav class="bg-white shadow-lg border-b">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between items-center h-16">
                <div class="flex items-center">
                    <h1 class="text-xl font-bold text-gray-800">
                        <i class="fas fa-chart-line text-blue-600 mr-2"></i>
                        IndoAdvisory Admin
                    </h1>
                </div>
                
                <div class="hidden md:flex items-center space-x-6">
                    <a href="/admin/dashboard" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-tachometer-alt mr-1"></i>
                        Dashboard
                    </a>
                    <a href="/admin/articles" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-newspaper mr-1"></i>
                        Artikel
                    </a>
                    <a href="/admin/inquiries" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-envelope mr-1"></i>
                        Inquiry
                    </a>
                    <a href="/admin/team" class="text-blue-600 font-semibold px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-users mr-1"></i>
                        Tim
                    </a>
                    <a href="/admin/settings" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-cog mr-1"></i>
                        Settings
                    </a>
                    <a href="/" target="_blank" class="text-gray-700 hover:text-blue-600 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-external-link-alt mr-1"></i>
                        Lihat Website
                    </a>
                </div>
                
                <div class="flex items-center">
                    <span class="text-gray-700 mr-4">
                        <i class="fas fa-user mr-1"></i>
                        ${e.name}
                    </span>
                    <a href="/admin/logout" class="text-red-600 hover:text-red-700 px-3 py-2 rounded-md text-sm font-medium">
                        <i class="fas fa-sign-out-alt mr-1"></i>
                        Logout
                    </a>
                </div>
            </div>
        </div>
    </nav>
  `}const ae=new se;async function jr(e,s){const a=$t(e,"admin_session");return!a||!await e.env.DB.prepare('SELECT * FROM admin_sessions WHERE id = ? AND expires_at > datetime("now")').bind(a).first()?e.redirect("/admin/login"):s()}ae.use("*",jr);ae.get("/",async e=>{try{const s=parseInt(e.req.query("page")||"1"),a=10,r=(s-1)*a,i=e.req.query("search")||"",n=e.req.query("status")||"all";let o="SELECT * FROM clients",l="SELECT COUNT(*) as total FROM clients";const c=[],d=[];if(i){d.push("(company_name LIKE ? OR industry LIKE ? OR project_type LIKE ?)");const p=`%${i}%`;c.push(p,p,p)}if(n!=="all"&&(n==="active"?d.push("is_active = 1"):n==="featured"&&d.push("is_featured = 1")),d.length>0){const p=" WHERE "+d.join(" AND ");o+=p,l+=p}o+=" ORDER BY sort_order ASC, created_at DESC LIMIT ? OFFSET ?",c.push(a,r);const[u,h]=await Promise.all([e.env.DB.prepare(o).bind(...c).all(),e.env.DB.prepare(l).bind(...c.slice(0,-2)).first()]),f=Math.ceil(h.total/a);return e.render(t("div",{class:"min-h-screen bg-gray-50",children:[t("div",{class:"bg-white shadow-sm border-b border-gray-200",children:t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t("div",{class:"flex justify-between items-center h-16",children:[t("div",{class:"flex items-center space-x-4",children:[t("a",{href:"/admin",class:"text-gray-500 hover:text-gray-700",children:[t("i",{class:"fas fa-arrow-left mr-2"}),"Kembali ke Dashboard"]}),t("div",{class:"text-gray-300",children:"•"}),t("h1",{class:"text-xl font-semibold text-gray-900",children:"Manajemen Klien"})]}),t("a",{href:"/admin/clients/create",class:"mckinsey-btn px-4 py-2 rounded-lg text-sm font-medium",children:[t("i",{class:"fas fa-plus mr-2"}),"Tambah Klien"]})]})})}),t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[t("div",{class:"bg-white rounded-lg shadow-sm p-6 mb-6",children:t("form",{method:"GET",class:"flex flex-wrap gap-4",children:[t("div",{class:"flex-1 min-w-64",children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Pencarian"}),t("input",{type:"text",name:"search",value:i,placeholder:"Cari nama perusahaan, industri, atau jenis proyek...",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent"})]}),t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Status"}),t("select",{name:"status",class:"px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",children:[t("option",{value:"all",selected:n==="all",children:"Semua"}),t("option",{value:"active",selected:n==="active",children:"Aktif"}),t("option",{value:"featured",selected:n==="featured",children:"Featured"})]})]}),t("div",{class:"flex items-end",children:t("button",{type:"submit",class:"mckinsey-btn px-4 py-2 rounded-md text-sm font-medium",children:[t("i",{class:"fas fa-search mr-2"}),"Cari"]})})]})}),t("div",{class:"bg-white rounded-lg shadow-sm overflow-hidden",children:t("table",{class:"min-w-full divide-y divide-gray-200",children:[t("thead",{class:"bg-gray-50",children:t("tr",{children:[t("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Perusahaan"}),t("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Industri"}),t("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Proyek"}),t("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Nilai"}),t("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),t("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Aksi"})]})}),t("tbody",{class:"bg-white divide-y divide-gray-200",children:u.results.length>0?u.results.map(p=>t("tr",{class:"hover:bg-gray-50",children:[t("td",{class:"px-6 py-4 whitespace-nowrap",children:t("div",{class:"flex items-center",children:[t("div",{class:"w-10 h-10 bg-mckinsey-blue rounded-lg flex items-center justify-center mr-3",children:t("i",{class:"fas fa-building text-white text-sm"})}),t("div",{children:[t("div",{class:"text-sm font-medium text-gray-900",children:p.company_name}),t("div",{class:"text-sm text-gray-500",children:["Urutan: ",p.sort_order]})]})]})}),t("td",{class:"px-6 py-4 whitespace-nowrap",children:t("span",{class:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:p.industry})}),t("td",{class:"px-6 py-4 whitespace-nowrap",children:[t("div",{class:"text-sm text-gray-900",children:p.project_type}),p.completion_date&&t("div",{class:"text-sm text-gray-500",children:new Date(p.completion_date).toLocaleDateString("id-ID")})]}),t("td",{class:"px-6 py-4 whitespace-nowrap",children:t("div",{class:"text-sm font-medium text-gray-900",children:p.project_value||"-"})}),t("td",{class:"px-6 py-4 whitespace-nowrap",children:t("div",{class:"flex flex-col space-y-1",children:[t("span",{class:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${p.is_active?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:p.is_active?"Aktif":"Nonaktif"}),p.is_featured&&t("span",{class:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800",children:"Featured"})]})}),t("td",{class:"px-6 py-4 whitespace-nowrap text-sm font-medium space-x-2",children:[t("a",{href:`/admin/clients/${p.id}/edit`,class:"text-mckinsey-blue hover:text-mckinsey-darkblue",children:[t("i",{class:"fas fa-edit mr-1"}),"Edit"]}),t("button",{onclick:`deleteClient(${p.id})`,class:"text-red-600 hover:text-red-900 ml-2",children:[t("i",{class:"fas fa-trash mr-1"}),"Hapus"]})]})]})):t("tr",{children:t("td",{colspan:"6",class:"px-6 py-12 text-center text-gray-500",children:[t("i",{class:"fas fa-building text-gray-400 text-4xl mb-4"}),t("div",{class:"text-lg font-medium text-gray-400 mb-2",children:"Belum ada klien"}),t("p",{class:"text-gray-400",children:'Klik "Tambah Klien" untuk menambah klien pertama'})]})})})]})}),f>1&&t("div",{class:"bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6 mt-6 rounded-lg",children:[t("div",{class:"flex-1 flex justify-between sm:hidden",children:[s>1&&t("a",{href:`/admin/clients?page=${s-1}&search=${i}&status=${n}`,class:"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50",children:"Previous"}),s<f&&t("a",{href:`/admin/clients?page=${s+1}&search=${i}&status=${n}`,class:"ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50",children:"Next"})]}),t("div",{class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between",children:[t("div",{children:t("p",{class:"text-sm text-gray-700",children:["Menampilkan"," ",t("span",{class:"font-medium",children:Math.min((s-1)*a+1,h.total)})," ","sampai"," ",t("span",{class:"font-medium",children:Math.min(s*a,h.total)})," ","dari"," ",t("span",{class:"font-medium",children:h.total})," ","hasil"]})}),t("div",{children:t("nav",{class:"relative z-0 inline-flex rounded-md shadow-sm -space-x-px",children:Array.from({length:f},(p,b)=>b+1).map(p=>t("a",{href:`/admin/clients?page=${p}&search=${i}&status=${n}`,class:`relative inline-flex items-center px-4 py-2 border text-sm font-medium ${p===s?"z-10 bg-mckinsey-blue border-mckinsey-blue text-white":"bg-white border-gray-300 text-gray-500 hover:bg-gray-50"}`,children:p}))})})]})]})]}),t("script",{dangerouslySetInnerHTML:{__html:`
          async function deleteClient(clientId) {
            if (!confirm('Apakah Anda yakin ingin menghapus klien ini?')) {
              return;
            }
            
            try {
              const response = await fetch('/admin/clients/' + clientId, {
                method: 'DELETE'
              });
              
              if (response.ok) {
                location.reload();
              } else {
                alert('Gagal menghapus klien. Silakan coba lagi.');
              }
            } catch (error) {
              alert('Terjadi kesalahan. Silakan coba lagi.');
            }
          }
        `}})]}),{title:"Manajemen Klien - IndoAdvisory Admin"})}catch(s){return console.error("Clients list error:",s),e.render(t("div",{children:"Error loading clients"}))}});ae.get("/create",async e=>e.render(t("div",{class:"min-h-screen bg-gray-50",children:[t("div",{class:"bg-white shadow-sm border-b border-gray-200",children:t("div",{class:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:t("div",{class:"flex items-center space-x-4 h-16",children:[t("a",{href:"/admin/clients",class:"text-gray-500 hover:text-gray-700",children:[t("i",{class:"fas fa-arrow-left mr-2"}),"Kembali ke Daftar Klien"]}),t("div",{class:"text-gray-300",children:"•"}),t("h1",{class:"text-xl font-semibold text-gray-900",children:"Tambah Klien Baru"})]})})}),t("div",{class:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:t("form",{method:"POST",action:"/admin/clients",class:"space-y-6",children:[t("div",{class:"bg-white rounded-lg shadow-sm p-6",children:[t("h3",{class:"text-lg font-medium text-gray-900 mb-6",children:"Informasi Dasar"}),t("div",{class:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Nama Perusahaan *"}),t("input",{type:"text",name:"company_name",required:!0,class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",placeholder:"Contoh: PT Teknologi Nusantara"})]}),t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Industri *"}),t("select",{name:"industry",required:!0,class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",children:[t("option",{value:"",children:"Pilih industri"}),t("option",{value:"Technology",children:"Technology"}),t("option",{value:"Finance",children:"Finance"}),t("option",{value:"Healthcare",children:"Healthcare"}),t("option",{value:"Manufacturing",children:"Manufacturing"}),t("option",{value:"Retail",children:"Retail"}),t("option",{value:"Energy",children:"Energy"}),t("option",{value:"Agriculture",children:"Agriculture"}),t("option",{value:"Real Estate",children:"Real Estate"}),t("option",{value:"E-commerce",children:"E-commerce"}),t("option",{value:"Other",children:"Other"})]})]})]}),t("div",{class:"grid grid-cols-1 md:grid-cols-2 gap-6 mt-6",children:[t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Jenis Proyek *"}),t("select",{name:"project_type",required:!0,class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",children:[t("option",{value:"",children:"Pilih jenis proyek"}),t("option",{value:"valuation",children:"Valuasi Perusahaan"}),t("option",{value:"ipo",children:"Persiapan IPO"}),t("option",{value:"ma",children:"M&A Advisory"}),t("option",{value:"fundraising",children:"Fundraising"}),t("option",{value:"restructuring",children:"Restructuring"}),t("option",{value:"dd",children:"Due Diligence"})]})]}),t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Nilai Proyek"}),t("input",{type:"text",name:"project_value",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",placeholder:"Contoh: $25M Series B, Rp 2.1T IPO"})]})]}),t("div",{class:"mt-6",children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Tanggal Penyelesaian"}),t("input",{type:"date",name:"completion_date",class:"px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent"})]})]}),t("div",{class:"bg-white rounded-lg shadow-sm p-6",children:[t("h3",{class:"text-lg font-medium text-gray-900 mb-6",children:"Deskripsi Proyek"}),t("div",{class:"space-y-4",children:[t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Deskripsi (Bahasa Indonesia) *"}),t("textarea",{name:"description_id",rows:"4",required:!0,class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",placeholder:"Jelaskan proyek dalam bahasa Indonesia..."})]}),t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Deskripsi (English) *"}),t("textarea",{name:"description_en",rows:"4",required:!0,class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",placeholder:"Describe the project in English..."})]})]})]}),t("div",{class:"bg-white rounded-lg shadow-sm p-6",children:[t("h3",{class:"text-lg font-medium text-gray-900 mb-6",children:"Pengaturan Tampilan"}),t("div",{class:"space-y-4",children:[t("div",{class:"flex items-center",children:[t("input",{type:"checkbox",name:"is_featured",id:"is_featured",class:"h-4 w-4 text-mckinsey-blue focus:ring-mckinsey-blue border-gray-300 rounded"}),t("label",{for:"is_featured",class:"ml-2 block text-sm text-gray-700",children:"Tampilkan sebagai featured client"})]}),t("div",{class:"flex items-center",children:[t("input",{type:"checkbox",name:"is_active",id:"is_active",checked:!0,class:"h-4 w-4 text-mckinsey-blue focus:ring-mckinsey-blue border-gray-300 rounded"}),t("label",{for:"is_active",class:"ml-2 block text-sm text-gray-700",children:"Aktif (tampil di website)"})]}),t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Urutan Tampil"}),t("input",{type:"number",name:"sort_order",min:"0",value:"0",class:"px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent w-32",placeholder:"0"}),t("p",{class:"text-sm text-gray-500 mt-1",children:"Semakin kecil angka, semakin awal tampil"})]})]})]}),t("div",{class:"flex justify-end space-x-4",children:[t("a",{href:"/admin/clients",class:"mckinsey-btn-outline px-6 py-2 rounded-md text-sm font-medium",children:"Batal"}),t("button",{type:"submit",class:"mckinsey-btn px-6 py-2 rounded-md text-sm font-medium",children:[t("i",{class:"fas fa-save mr-2"}),"Simpan Klien"]})]})]})})]}),{title:"Tambah Klien - IndoAdvisory Admin"}));ae.post("/",async e=>{try{const s=await e.req.parseBody(),{company_name:a,industry:r,project_type:i,project_value:n,completion_date:o,description_id:l,description_en:c,is_featured:d,is_active:u,sort_order:h}=s;return await e.env.DB.prepare(`INSERT INTO clients (
        company_name, industry, project_type, project_value, completion_date,
        description_id, description_en, is_featured, is_active, sort_order
      ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).bind(a,r,i,n||null,o||null,l,c,d?1:0,u?1:0,parseInt(h)||0).run(),e.redirect("/admin/clients")}catch(s){return console.error("Create client error:",s),e.render(t("div",{children:"Error creating client"}))}});ae.get("/:id/edit",async e=>{try{const s=e.req.param("id"),a=await e.env.DB.prepare("SELECT * FROM clients WHERE id = ?").bind(s).first();return a?e.render(t("div",{class:"min-h-screen bg-gray-50",children:[t("div",{class:"bg-white shadow-sm border-b border-gray-200",children:t("div",{class:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:t("div",{class:"flex items-center space-x-4 h-16",children:[t("a",{href:"/admin/clients",class:"text-gray-500 hover:text-gray-700",children:[t("i",{class:"fas fa-arrow-left mr-2"}),"Kembali ke Daftar Klien"]}),t("div",{class:"text-gray-300",children:"•"}),t("h1",{class:"text-xl font-semibold text-gray-900",children:["Edit Klien: ",a.company_name]})]})})}),t("div",{class:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:t("form",{method:"POST",action:`/admin/clients/${a.id}`,class:"space-y-6",children:[t("div",{class:"bg-white rounded-lg shadow-sm p-6",children:[t("h3",{class:"text-lg font-medium text-gray-900 mb-6",children:"Informasi Dasar"}),t("div",{class:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Nama Perusahaan *"}),t("input",{type:"text",name:"company_name",required:!0,value:a.company_name,class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent"})]}),t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Industri *"}),t("select",{name:"industry",required:!0,class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",children:[t("option",{value:"",children:"Pilih industri"}),["Technology","Finance","Healthcare","Manufacturing","Retail","Energy","Agriculture","Real Estate","E-commerce","Other"].map(r=>t("option",{value:r,selected:a.industry===r,children:r}))]})]})]}),t("div",{class:"grid grid-cols-1 md:grid-cols-2 gap-6 mt-6",children:[t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Jenis Proyek *"}),t("select",{name:"project_type",required:!0,class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",children:[t("option",{value:"",children:"Pilih jenis proyek"}),[{value:"valuation",label:"Valuasi Perusahaan"},{value:"ipo",label:"Persiapan IPO"},{value:"ma",label:"M&A Advisory"},{value:"fundraising",label:"Fundraising"},{value:"restructuring",label:"Restructuring"},{value:"dd",label:"Due Diligence"}].map(r=>t("option",{value:r.value,selected:a.project_type===r.value,children:r.label}))]})]}),t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Nilai Proyek"}),t("input",{type:"text",name:"project_value",value:a.project_value||"",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",placeholder:"Contoh: $25M Series B, Rp 2.1T IPO"})]})]}),t("div",{class:"mt-6",children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Tanggal Penyelesaian"}),t("input",{type:"date",name:"completion_date",value:a.completion_date||"",class:"px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent"})]})]}),t("div",{class:"bg-white rounded-lg shadow-sm p-6",children:[t("h3",{class:"text-lg font-medium text-gray-900 mb-6",children:"Deskripsi Proyek"}),t("div",{class:"space-y-4",children:[t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Deskripsi (Bahasa Indonesia) *"}),t("textarea",{name:"description_id",rows:"4",required:!0,class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",placeholder:"Jelaskan proyek dalam bahasa Indonesia...",children:a.description_id})]}),t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Deskripsi (English) *"}),t("textarea",{name:"description_en",rows:"4",required:!0,class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent",placeholder:"Describe the project in English...",children:a.description_en})]})]})]}),t("div",{class:"bg-white rounded-lg shadow-sm p-6",children:[t("h3",{class:"text-lg font-medium text-gray-900 mb-6",children:"Pengaturan Tampilan"}),t("div",{class:"space-y-4",children:[t("div",{class:"flex items-center",children:[t("input",{type:"checkbox",name:"is_featured",id:"is_featured",checked:a.is_featured,class:"h-4 w-4 text-mckinsey-blue focus:ring-mckinsey-blue border-gray-300 rounded"}),t("label",{for:"is_featured",class:"ml-2 block text-sm text-gray-700",children:"Tampilkan sebagai featured client"})]}),t("div",{class:"flex items-center",children:[t("input",{type:"checkbox",name:"is_active",id:"is_active",checked:a.is_active,class:"h-4 w-4 text-mckinsey-blue focus:ring-mckinsey-blue border-gray-300 rounded"}),t("label",{for:"is_active",class:"ml-2 block text-sm text-gray-700",children:"Aktif (tampil di website)"})]}),t("div",{children:[t("label",{class:"block text-sm font-medium text-gray-700 mb-2",children:"Urutan Tampil"}),t("input",{type:"number",name:"sort_order",min:"0",value:a.sort_order,class:"px-3 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-mckinsey-blue focus:border-transparent w-32"}),t("p",{class:"text-sm text-gray-500 mt-1",children:"Semakin kecil angka, semakin awal tampil"})]})]})]}),t("div",{class:"flex justify-end space-x-4",children:[t("a",{href:"/admin/clients",class:"mckinsey-btn-outline px-6 py-2 rounded-md text-sm font-medium",children:"Batal"}),t("button",{type:"submit",class:"mckinsey-btn px-6 py-2 rounded-md text-sm font-medium",children:[t("i",{class:"fas fa-save mr-2"}),"Simpan Perubahan"]})]})]})})]}),{title:`Edit ${a.company_name} - IndoAdvisory Admin`}):e.notFound()}catch(s){return console.error("Edit client error:",s),e.notFound()}});ae.post("/:id",async e=>{try{const s=e.req.param("id"),a=await e.req.parseBody(),{company_name:r,industry:i,project_type:n,project_value:o,completion_date:l,description_id:c,description_en:d,is_featured:u,is_active:h,sort_order:f}=a;return await e.env.DB.prepare(`UPDATE clients SET 
        company_name = ?, industry = ?, project_type = ?, project_value = ?,
        completion_date = ?, description_id = ?, description_en = ?,
        is_featured = ?, is_active = ?, sort_order = ?, updated_at = datetime('now')
      WHERE id = ?`).bind(r,i,n,o||null,l||null,c,d,u?1:0,h?1:0,parseInt(f)||0,s).run(),e.redirect("/admin/clients")}catch(s){return console.error("Update client error:",s),e.render(t("div",{children:"Error updating client"}))}});ae.delete("/:id",async e=>{try{const s=e.req.param("id");return await e.env.DB.prepare("DELETE FROM clients WHERE id = ?").bind(s).run(),e.json({success:!0})}catch(s){return console.error("Delete client error:",s),e.json({success:!1},500)}});const C=new se;C.use("/api/*",Xa());C.use("*",async(e,s)=>(e.env.DB&&await zs(e.env.DB),s()));C.route("/admin",Re);C.route("/admin/articles",Ve);C.route("/admin/inquiries",ct);C.route("/admin/settings",Mt);C.route("/admin/team",Ie);C.route("/admin/clients",ae);C.use(yr);C.get("/",async e=>{const s=e.req.query("lang")==="en"?"en":"id",r=`/?lang=${s==="en"?"id":"en"}`;let i=[],n=!0,o=!0;try{i=(await e.env.DB.prepare("SELECT * FROM clients WHERE is_active = 1 ORDER BY sort_order ASC, created_at DESC").all()).results;const c=await e.env.DB.prepare('SELECT setting_value FROM site_settings WHERE setting_key = "portfolio_section_enabled"').first(),d=await e.env.DB.prepare('SELECT setting_value FROM site_settings WHERE setting_key = "portfolio_statistics_enabled"').first();n=(c==null?void 0:c.setting_value)==="1",o=(d==null?void 0:d.setting_value)==="1"}catch(l){console.error("Error fetching data:",l)}return e.render(t("div",{class:"min-h-screen",children:[t("nav",{class:"fixed w-full z-50 bg-white/95 backdrop-blur-sm border-b border-gray-200 shadow-sm",children:[t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t("div",{class:"flex justify-between items-center h-16",children:[t("div",{class:"flex items-center",children:t("div",{class:"flex-shrink-0",children:t("h1",{class:"text-2xl font-bold text-primary-700",children:[t("i",{class:"fas fa-chart-line mr-2"}),"IndoAdvisory"]})})}),t("div",{class:"hidden md:block",children:t("div",{class:"ml-10 flex items-baseline space-x-4",children:[t("a",{href:`#beranda${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 px-3 py-2 rounded-md text-sm font-medium transition-colors",children:s==="en"?"Home":"Beranda"}),t("a",{href:`#tentang${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 px-3 py-2 rounded-md text-sm font-medium transition-colors",children:s==="en"?"About Us":"Tentang Kami"}),t("a",{href:`#layanan${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 px-3 py-2 rounded-md text-sm font-medium transition-colors",children:s==="en"?"Services":"Layanan"}),t("a",{href:`#portfolio${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 px-3 py-2 rounded-md text-sm font-medium transition-colors",children:"Portfolio"}),t("a",{href:`/artikel${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 px-3 py-2 rounded-md text-sm font-medium transition-colors",children:s==="en"?"Articles":"Artikel"}),t("a",{href:`#tim${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 px-3 py-2 rounded-md text-sm font-medium transition-colors",children:s==="en"?"Team":"Tim"}),t("a",{href:`#kontak${s==="en"?"?lang=en":""}`,class:"bg-primary-600 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-primary-700 transition-colors",children:s==="en"?"Contact":"Kontak"}),t("a",{href:r,class:"bg-gray-200 text-gray-700 px-3 py-2 rounded-md text-sm font-medium hover:bg-gray-300 transition-colors border-l border-gray-300 ml-2",children:[t("i",{class:"fas fa-globe mr-1"}),s==="en"?"ID":"EN"]})]})}),t("div",{class:"md:hidden",children:t("button",{onclick:"toggleMenu()",class:"text-secondary-700 hover:text-primary-600 p-2",children:t("i",{class:"fas fa-bars text-xl"})})})]})}),t("div",{id:"mobile-menu",class:"hidden md:hidden bg-white border-t border-gray-200",children:t("div",{class:"px-2 pt-2 pb-3 space-y-1 sm:px-3",children:[t("a",{href:`#beranda${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 block px-3 py-2 rounded-md text-base font-medium",children:s==="en"?"Home":"Beranda"}),t("a",{href:`#tentang${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 block px-3 py-2 rounded-md text-base font-medium",children:s==="en"?"About Us":"Tentang Kami"}),t("a",{href:`#layanan${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 block px-3 py-2 rounded-md text-base font-medium",children:s==="en"?"Services":"Layanan"}),t("a",{href:`#portfolio${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 block px-3 py-2 rounded-md text-base font-medium",children:"Portfolio"}),t("a",{href:`/artikel${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 block px-3 py-2 rounded-md text-base font-medium",children:s==="en"?"Articles":"Artikel"}),t("a",{href:`#tim${s==="en"?"?lang=en":""}`,class:"text-secondary-700 hover:text-primary-600 block px-3 py-2 rounded-md text-base font-medium",children:s==="en"?"Team":"Tim"}),t("a",{href:`#kontak${s==="en"?"?lang=en":""}`,class:"bg-primary-600 text-white block px-3 py-2 rounded-md text-base font-medium hover:bg-primary-700",children:s==="en"?"Contact":"Kontak"}),t("div",{class:"border-t border-gray-200 mt-2 pt-2",children:t("a",{href:r,class:"bg-gray-100 text-gray-700 block px-3 py-2 rounded-md text-base font-medium hover:bg-gray-200",children:[t("i",{class:"fas fa-globe mr-2"}),s==="en"?"Switch to Indonesian":"Switch to English"]})})]})})]}),t("section",{id:"beranda",class:"pt-16 gradient-bg text-white",children:t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-24",children:t("div",{class:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center",children:[t("div",{children:[t("h2",{class:"text-5xl font-bold mb-6 leading-tight",children:s==="en"?t(Tt,{children:["Trusted ",t("span",{class:"text-yellow-300",children:"Private Equity"})," Advisory in Indonesia"]}):t(Tt,{children:["Penasihat ",t("span",{class:"text-yellow-300",children:"Private Equity"})," Terpercaya di Indonesia"]})}),t("p",{class:"text-xl mb-8 text-gray-100 leading-relaxed",children:s==="en"?"We help companies achieve sustainable growth through strategic investments, accurate company valuations, and comprehensive IPO preparation.":"Kami membantu perusahaan mencapai pertumbuhan berkelanjutan melalui strategi investasi yang tepat, valuasi perusahaan yang akurat, dan persiapan IPO yang komprehensif."}),t("div",{class:"flex flex-col sm:flex-row gap-4",children:[t("a",{href:`#kontak${s==="en"?"?lang=en":""}`,class:"bg-yellow-400 text-gray-900 px-8 py-4 rounded-lg font-semibold hover:bg-yellow-300 transition-colors text-center",children:s==="en"?"Free Consultation":"Konsultasi Gratis"}),t("a",{href:`#layanan${s==="en"?"?lang=en":""}`,class:"border-2 border-white text-white px-8 py-4 rounded-lg font-semibold hover:bg-white hover:text-gray-900 transition-colors text-center",children:s==="en"?"View Services":"Lihat Layanan"})]})]}),t("div",{class:"hidden lg:block",children:t("div",{class:"bg-white/10 backdrop-blur-sm rounded-2xl p-8",children:t("div",{class:"grid grid-cols-2 gap-6 text-center",children:[t("div",{children:[t("div",{class:"text-3xl font-bold text-yellow-300",children:"150+"}),t("div",{class:"text-sm text-gray-200",children:"Klien Terlayani"})]}),t("div",{children:[t("div",{class:"text-3xl font-bold text-yellow-300",children:"Rp 2.5T"}),t("div",{class:"text-sm text-gray-200",children:"Total Valuasi"})]}),t("div",{children:[t("div",{class:"text-3xl font-bold text-yellow-300",children:"25"}),t("div",{class:"text-sm text-gray-200",children:"IPO Sukses"})]}),t("div",{children:[t("div",{class:"text-3xl font-bold text-yellow-300",children:"98%"}),t("div",{class:"text-sm text-gray-200",children:"Tingkat Kepuasan"})]})]})})})]})})}),t("section",{id:"tentang",class:"py-20 bg-gray-50",children:t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t("div",{class:"text-center mb-16",children:[t("h2",{class:"text-4xl font-bold text-secondary-800 mb-4",children:s==="en"?"About IndoAdvisory":"Tentang IndoAdvisory"}),t("p",{class:"text-xl text-secondary-600 max-w-3xl mx-auto",children:s==="en"?"As a leading private equity consulting firm in Indonesia, we have helped hundreds of companies in their business growth and transformation journey for over 15 years.":"Sebagai firma konsultan private equity terkemuka di Indonesia, kami telah membantu ratusan perusahaan dalam perjalanan pertumbuhan dan transformasi bisnis mereka selama lebih dari 15 tahun."})]}),t("div",{class:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center",children:[t("div",{children:[t("h3",{class:"text-2xl font-bold text-secondary-800 mb-6",children:"Misi Kami"}),t("p",{class:"text-secondary-600 mb-6 leading-relaxed",children:"Menjadi mitra strategis terpercaya dalam mengoptimalkan nilai perusahaan melalui solusi keuangan yang inovatif dan berkelanjutan. Kami berkomitmen memberikan layanan berkualitas tinggi dengan pendekatan yang personal dan solusi yang disesuaikan dengan kebutuhan spesifik setiap klien."}),t("div",{class:"space-y-4",children:[t("div",{class:"flex items-center",children:[t("div",{class:"bg-primary-100 p-2 rounded-full mr-4",children:t("i",{class:"fas fa-check text-primary-600"})}),t("span",{class:"text-secondary-700",children:"Tim ahli berpengalaman internasional"})]}),t("div",{class:"flex items-center",children:[t("div",{class:"bg-primary-100 p-2 rounded-full mr-4",children:t("i",{class:"fas fa-check text-primary-600"})}),t("span",{class:"text-secondary-700",children:"Metodologi valuasi yang terbukti akurat"})]}),t("div",{class:"flex items-center",children:[t("div",{class:"bg-primary-100 p-2 rounded-full mr-4",children:t("i",{class:"fas fa-check text-primary-600"})}),t("span",{class:"text-secondary-700",children:"Jaringan investor strategis yang luas"})]})]})]}),t("div",{class:"grid grid-cols-2 gap-6",children:[t("div",{class:"bg-white p-6 rounded-xl shadow-lg card-hover",children:[t("div",{class:"bg-primary-100 w-16 h-16 rounded-full flex items-center justify-center mb-4 mx-auto",children:t("i",{class:"fas fa-award text-primary-600 text-2xl"})}),t("h4",{class:"text-lg font-semibold text-secondary-800 text-center mb-2",children:"Berpengalaman"}),t("p",{class:"text-secondary-600 text-sm text-center",children:"15+ tahun melayani klien corporate dan UKM"})]}),t("div",{class:"bg-white p-6 rounded-xl shadow-lg card-hover",children:[t("div",{class:"bg-primary-100 w-16 h-16 rounded-full flex items-center justify-center mb-4 mx-auto",children:t("i",{class:"fas fa-shield-alt text-primary-600 text-2xl"})}),t("h4",{class:"text-lg font-semibold text-secondary-800 text-center mb-2",children:"Terpercaya"}),t("p",{class:"text-secondary-600 text-sm text-center",children:"Sertifikasi resmi dan reputasi yang terjaga"})]}),t("div",{class:"bg-white p-6 rounded-xl shadow-lg card-hover",children:[t("div",{class:"bg-primary-100 w-16 h-16 rounded-full flex items-center justify-center mb-4 mx-auto",children:t("i",{class:"fas fa-lightbulb text-primary-600 text-2xl"})}),t("h4",{class:"text-lg font-semibold text-secondary-800 text-center mb-2",children:"Inovatif"}),t("p",{class:"text-secondary-600 text-sm text-center",children:"Solusi kreatif untuk tantangan bisnis modern"})]}),t("div",{class:"bg-white p-6 rounded-xl shadow-lg card-hover",children:[t("div",{class:"bg-primary-100 w-16 h-16 rounded-full flex items-center justify-center mb-4 mx-auto",children:t("i",{class:"fas fa-handshake text-primary-600 text-2xl"})}),t("h4",{class:"text-lg font-semibold text-secondary-800 text-center mb-2",children:"Kolaboratif"}),t("p",{class:"text-secondary-600 text-sm text-center",children:"Pendekatan partnership jangka panjang"})]})]})]})]})}),t("section",{id:"layanan",class:"py-20 bg-white",children:t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t("div",{class:"text-center mb-16",children:[t("h2",{class:"text-4xl font-bold text-secondary-800 mb-4",children:"Layanan Kami"}),t("p",{class:"text-xl text-secondary-600 max-w-3xl mx-auto",children:"Layanan komprehensif untuk mendukung pertumbuhan dan transformasi bisnis Anda"})]}),t("div",{class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[t("div",{class:"bg-gradient-to-br from-blue-50 to-indigo-100 p-8 rounded-2xl card-hover",children:[t("div",{class:"bg-primary-600 w-16 h-16 rounded-full flex items-center justify-center mb-6",children:t("i",{class:"fas fa-calculator text-white text-2xl"})}),t("h3",{class:"text-xl font-bold text-secondary-800 mb-4",children:"Valuasi Perusahaan"}),t("p",{class:"text-secondary-600 mb-6",children:"Penilaian yang akurat dan komprehensif untuk mendukung keputusan investasi, akuisisi, atau divestasi."}),t("ul",{class:"space-y-2 text-sm text-secondary-600",children:[t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-primary-600 mr-2"}),"Metode DCF, Market Multiple, Asset-based"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-primary-600 mr-2"}),"Analisis industri mendalam"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-primary-600 mr-2"}),"Laporan valuasi profesional"]})]})]}),t("div",{class:"bg-gradient-to-br from-green-50 to-emerald-100 p-8 rounded-2xl card-hover",children:[t("div",{class:"bg-green-600 w-16 h-16 rounded-full flex items-center justify-center mb-6",children:t("i",{class:"fas fa-chart-line text-white text-2xl"})}),t("h3",{class:"text-xl font-bold text-secondary-800 mb-4",children:"Persiapan IPO"}),t("p",{class:"text-secondary-600 mb-6",children:"Pendampingan lengkap dari tahap persiapan hingga pelaksanaan penawaran umum perdana."}),t("ul",{class:"space-y-2 text-sm text-secondary-600",children:[t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-green-600 mr-2"}),"Corporate restructuring"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-green-600 mr-2"}),"Regulatory compliance"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-green-600 mr-2"}),"Investor relations strategy"]})]})]}),t("div",{class:"bg-gradient-to-br from-purple-50 to-violet-100 p-8 rounded-2xl card-hover",children:[t("div",{class:"bg-purple-600 w-16 h-16 rounded-full flex items-center justify-center mb-6",children:t("i",{class:"fas fa-handshake text-white text-2xl"})}),t("h3",{class:"text-xl font-bold text-secondary-800 mb-4",children:"M&A Advisory"}),t("p",{class:"text-secondary-600 mb-6",children:"Konsultasi strategis untuk merger, akuisisi, dan divestasi yang mengoptimalkan nilai transaksi."}),t("ul",{class:"space-y-2 text-sm text-secondary-600",children:[t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-purple-600 mr-2"}),"Target identification & screening"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-purple-600 mr-2"}),"Due diligence coordination"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-purple-600 mr-2"}),"Deal structuring & negotiation"]})]})]}),t("div",{class:"bg-gradient-to-br from-orange-50 to-amber-100 p-8 rounded-2xl card-hover",children:[t("div",{class:"bg-orange-600 w-16 h-16 rounded-full flex items-center justify-center mb-6",children:t("i",{class:"fas fa-rocket text-white text-2xl"})}),t("h3",{class:"text-xl font-bold text-secondary-800 mb-4",children:"Fundraising"}),t("p",{class:"text-secondary-600 mb-6",children:"Strategi penggalangan dana yang efektif untuk mendukung ekspansi dan pertumbuhan bisnis."}),t("ul",{class:"space-y-2 text-sm text-secondary-600",children:[t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-orange-600 mr-2"}),"Investor matching & outreach"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-orange-600 mr-2"}),"Pitch deck development"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-orange-600 mr-2"}),"Term sheet negotiation"]})]})]}),t("div",{class:"bg-gradient-to-br from-red-50 to-pink-100 p-8 rounded-2xl card-hover",children:[t("div",{class:"bg-red-600 w-16 h-16 rounded-full flex items-center justify-center mb-6",children:t("i",{class:"fas fa-cogs text-white text-2xl"})}),t("h3",{class:"text-xl font-bold text-secondary-800 mb-4",children:"Restructuring"}),t("p",{class:"text-secondary-600 mb-6",children:"Restrukturisasi korporat dan keuangan untuk optimalisasi struktur dan performa perusahaan."}),t("ul",{class:"space-y-2 text-sm text-secondary-600",children:[t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-red-600 mr-2"}),"Financial restructuring"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-red-600 mr-2"}),"Operational improvement"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-red-600 mr-2"}),"Strategic planning"]})]})]}),t("div",{class:"bg-gradient-to-br from-teal-50 to-cyan-100 p-8 rounded-2xl card-hover",children:[t("div",{class:"bg-teal-600 w-16 h-16 rounded-full flex items-center justify-center mb-6",children:t("i",{class:"fas fa-search-dollar text-white text-2xl"})}),t("h3",{class:"text-xl font-bold text-secondary-800 mb-4",children:"Due Diligence"}),t("p",{class:"text-secondary-600 mb-6",children:"Analisis mendalam untuk mengidentifikasi risiko dan peluang dalam transaksi investasi."}),t("ul",{class:"space-y-2 text-sm text-secondary-600",children:[t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-teal-600 mr-2"}),"Financial due diligence"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-teal-600 mr-2"}),"Commercial due diligence"]}),t("li",{class:"flex items-center",children:[t("i",{class:"fas fa-check text-teal-600 mr-2"}),"Risk assessment"]})]})]})]})]})}),n&&t("section",{id:"portfolio",class:"py-20 bg-gray-50",children:t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t("div",{class:"text-center mb-16",children:[t("h2",{class:"text-4xl font-bold text-secondary-800 mb-4",children:"Portfolio & Prestasi"}),t("p",{class:"text-xl text-secondary-600 max-w-3xl mx-auto",children:"Rekam jejak kesuksesan dalam membantu klien mencapai tujuan bisnis mereka"})]}),t("div",{class:"mb-16",children:[t("div",{class:"text-center mb-12",children:[t("h3",{class:"text-3xl font-bold mckinsey-heading mb-4",children:s==="en"?"Our Recent Clients":"Klien Terkini"}),t("p",{class:"text-lg mckinsey-text max-w-3xl mx-auto",children:s==="en"?"Trusted by leading companies across various industries for their strategic financial advisory needs":"Dipercaya oleh perusahaan-perusahaan terkemuka di berbagai industri untuk kebutuhan konsultasi keuangan strategis mereka"})]}),t("div",{class:"relative overflow-hidden",id:"client-showcase-section",children:t("div",{id:"client-carousel",class:"flex space-x-6 transition-transform duration-1000 ease-in-out",style:"transform: translateX(0px)",children:[i.map((l,c)=>{const d=s==="en"?l.description_en:l.description_id,h={valuation:s==="en"?"Valuation":"Valuasi",ipo:"IPO",ma:"M&A",fundraising:"Fundraising",restructuring:s==="en"?"Restructuring":"Restrukturisasi",dd:"Due Diligence"}[l.project_type]||l.project_type;return t("div",{class:"flex-none w-96 mckinsey-card rounded-xl p-6 bg-white",children:[t("div",{class:"flex items-start justify-between mb-4",children:[t("div",{class:"flex-1",children:t("div",{class:"flex items-center mb-2",children:[t("div",{class:"w-12 h-12 bg-mckinsey-blue rounded-lg flex items-center justify-center mr-3",children:t("i",{class:"fas fa-building text-white text-lg"})}),t("div",{children:[t("h4",{class:"font-bold mckinsey-heading text-lg",children:l.company_name}),t("span",{class:"text-sm text-gray-500",children:l.industry})]})]})}),t("span",{class:"bg-mckinsey-blue/10 text-mckinsey-blue px-3 py-1 rounded-full text-xs font-medium",children:h})]}),t("p",{class:"mckinsey-text text-sm leading-relaxed mb-4",children:d}),t("div",{class:"flex items-center justify-between",children:[l.project_value&&t("span",{class:"font-semibold text-mckinsey-darkblue text-sm",children:l.project_value}),l.completion_date&&t("span",{class:"text-xs text-gray-400",children:_e(l.completion_date)})]})]})}),i.map((l,c)=>{const d=s==="en"?l.description_en:l.description_id,h={valuation:s==="en"?"Valuation":"Valuasi",ipo:"IPO",ma:"M&A",fundraising:"Fundraising",restructuring:s==="en"?"Restructuring":"Restrukturisasi",dd:"Due Diligence"}[l.project_type]||l.project_type;return t("div",{class:"flex-none w-96 mckinsey-card rounded-xl p-6 bg-white",children:[t("div",{class:"flex items-start justify-between mb-4",children:[t("div",{class:"flex-1",children:t("div",{class:"flex items-center mb-2",children:[t("div",{class:"w-12 h-12 bg-mckinsey-blue rounded-lg flex items-center justify-center mr-3",children:t("i",{class:"fas fa-building text-white text-lg"})}),t("div",{children:[t("h4",{class:"font-bold mckinsey-heading text-lg",children:l.company_name}),t("span",{class:"text-sm text-gray-500",children:l.industry})]})]})}),t("span",{class:"bg-mckinsey-blue/10 text-mckinsey-blue px-3 py-1 rounded-full text-xs font-medium",children:h})]}),t("p",{class:"mckinsey-text text-sm leading-relaxed mb-4",children:d}),t("div",{class:"flex items-center justify-between",children:[l.project_value&&t("span",{class:"font-semibold text-mckinsey-darkblue text-sm",children:l.project_value}),l.completion_date&&t("span",{class:"text-xs text-gray-400",children:_e(l.completion_date)})]})]})})]})}),t("div",{class:"flex justify-center mt-8",children:t("div",{class:"bg-white/20 backdrop-blur-sm rounded-lg px-6 py-3",children:t("span",{class:"text-gray-600 text-sm flex items-center",children:[t("i",{class:"fas fa-mouse mr-2 text-mckinsey-blue"}),s==="en"?"Hover to pause • Auto-scrolling every 3 seconds":"Arahkan kursor untuk jeda • Auto-scroll setiap 3 detik"]})})})]}),o&&t("div",{class:"grid grid-cols-1 lg:grid-cols-1 gap-12 mb-16",children:t("div",{class:"bg-white p-8 rounded-2xl shadow-lg mckinsey-card",children:[t("h3",{class:"text-2xl font-bold text-secondary-800 mb-8 flex items-center",children:[t("i",{class:"fas fa-chart-bar text-mckinsey-blue mr-3"}),"Statistik Kinerja"]}),t("div",{class:"grid grid-cols-2 gap-6 mb-8",children:[t("div",{class:"text-center p-4 bg-gradient-to-br from-blue-50 to-blue-100 rounded-xl border border-blue-200",children:t("div",{class:"relative",children:[t("div",{class:"w-16 h-16 mx-auto mb-3 bg-mckinsey-blue rounded-full flex items-center justify-center",children:t("i",{class:"fas fa-briefcase text-white text-lg"})}),t("div",{class:"text-3xl font-bold text-mckinsey-blue mb-2 animate-counter","data-target":"150",children:"150+"}),t("div",{class:"text-sm font-medium text-gray-700",children:"Proyek Selesai"}),t("div",{class:"mt-2 bg-mckinsey-blue/20 rounded-full h-2",children:t("div",{class:"bg-mckinsey-blue h-2 rounded-full",style:"width: 95%"})})]})}),t("div",{class:"text-center p-4 bg-gradient-to-br from-green-50 to-green-100 rounded-xl border border-green-200",children:t("div",{class:"relative",children:[t("div",{class:"w-16 h-16 mx-auto mb-3 bg-green-600 rounded-full flex items-center justify-center",children:t("i",{class:"fas fa-coins text-white text-lg"})}),t("div",{class:"text-3xl font-bold text-green-600 mb-2",children:"Rp 2.5T"}),t("div",{class:"text-sm font-medium text-gray-700",children:"Total Valuasi"}),t("div",{class:"mt-2 bg-green-600/20 rounded-full h-2",children:t("div",{class:"bg-green-600 h-2 rounded-full",style:"width: 88%"})})]})}),t("div",{class:"text-center p-4 bg-gradient-to-br from-purple-50 to-purple-100 rounded-xl border border-purple-200",children:t("div",{class:"relative",children:[t("div",{class:"w-16 h-16 mx-auto mb-3 bg-purple-600 rounded-full flex items-center justify-center",children:t("i",{class:"fas fa-chart-line text-white text-lg"})}),t("div",{class:"text-3xl font-bold text-purple-600 mb-2",children:"25"}),t("div",{class:"text-sm font-medium text-gray-700",children:"IPO Sukses"}),t("div",{class:"mt-2 bg-purple-600/20 rounded-full h-2",children:t("div",{class:"bg-purple-600 h-2 rounded-full",style:"width: 92%"})})]})}),t("div",{class:"text-center p-4 bg-gradient-to-br from-orange-50 to-orange-100 rounded-xl border border-orange-200",children:t("div",{class:"relative",children:[t("div",{class:"w-16 h-16 mx-auto mb-3 bg-orange-600 rounded-full flex items-center justify-center",children:t("i",{class:"fas fa-heart text-white text-lg"})}),t("div",{class:"text-3xl font-bold text-orange-600 mb-2",children:"98%"}),t("div",{class:"text-sm font-medium text-gray-700",children:"Client Satisfaction"}),t("div",{class:"mt-2 bg-orange-600/20 rounded-full h-2",children:t("div",{class:"bg-orange-600 h-2 rounded-full",style:"width: 98%"})})]})})]}),t("div",{class:"bg-gray-50 rounded-xl p-6",children:[t("h4",{class:"font-bold text-secondary-800 mb-6 flex items-center",children:[t("i",{class:"fas fa-industry text-mckinsey-blue mr-2"}),"Distribusi Sektor Industri"]}),t("div",{class:"space-y-4",children:[t("div",{class:"flex items-center justify-between",children:[t("div",{class:"flex items-center",children:[t("span",{class:"bg-mckinsey-blue text-white px-3 py-1 rounded-full text-sm font-medium mr-3",children:[t("i",{class:"fas fa-laptop-code mr-1"}),"Teknologi"]}),t("span",{class:"text-sm text-gray-600",children:"28%"})]}),t("div",{class:"flex-1 mx-3 bg-gray-200 rounded-full h-2",children:t("div",{class:"bg-mckinsey-blue h-2 rounded-full",style:"width: 28%"})})]}),t("div",{class:"flex items-center justify-between",children:[t("div",{class:"flex items-center",children:[t("span",{class:"bg-green-600 text-white px-3 py-1 rounded-full text-sm font-medium mr-3",children:[t("i",{class:"fas fa-cogs mr-1"}),"Manufaktur"]}),t("span",{class:"text-sm text-gray-600",children:"22%"})]}),t("div",{class:"flex-1 mx-3 bg-gray-200 rounded-full h-2",children:t("div",{class:"bg-green-600 h-2 rounded-full",style:"width: 22%"})})]}),t("div",{class:"flex items-center justify-between",children:[t("div",{class:"flex items-center",children:[t("span",{class:"bg-purple-600 text-white px-3 py-1 rounded-full text-sm font-medium mr-3",children:[t("i",{class:"fas fa-utensils mr-1"}),"F&B"]}),t("span",{class:"text-sm text-gray-600",children:"18%"})]}),t("div",{class:"flex-1 mx-3 bg-gray-200 rounded-full h-2",children:t("div",{class:"bg-purple-600 h-2 rounded-full",style:"width: 18%"})})]}),t("div",{class:"flex items-center justify-between",children:[t("div",{class:"flex items-center",children:[t("span",{class:"bg-orange-600 text-white px-3 py-1 rounded-full text-sm font-medium mr-3",children:[t("i",{class:"fas fa-store mr-1"}),"Ritel"]}),t("span",{class:"text-sm text-gray-600",children:"15%"})]}),t("div",{class:"flex-1 mx-3 bg-gray-200 rounded-full h-2",children:t("div",{class:"bg-orange-600 h-2 rounded-full",style:"width: 15%"})})]}),t("div",{class:"flex items-center justify-between",children:[t("div",{class:"flex items-center",children:[t("span",{class:"bg-teal-600 text-white px-3 py-1 rounded-full text-sm font-medium mr-3",children:[t("i",{class:"fas fa-heartbeat mr-1"}),"Healthcare"]}),t("span",{class:"text-sm text-gray-600",children:"10%"})]}),t("div",{class:"flex-1 mx-3 bg-gray-200 rounded-full h-2",children:t("div",{class:"bg-teal-600 h-2 rounded-full",style:"width: 10%"})})]}),t("div",{class:"flex items-center justify-between",children:[t("div",{class:"flex items-center",children:[t("span",{class:"bg-red-600 text-white px-3 py-1 rounded-full text-sm font-medium mr-3",children:[t("i",{class:"fas fa-building mr-1"}),"Property"]}),t("span",{class:"text-sm text-gray-600",children:"7%"})]}),t("div",{class:"flex-1 mx-3 bg-gray-200 rounded-full h-2",children:t("div",{class:"bg-red-600 h-2 rounded-full",style:"width: 7%"})})]})]})]})]})})]})}),t("section",{id:"tim",class:"py-20 bg-white",children:t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t("div",{class:"text-center mb-16",children:[t("h2",{class:"text-4xl font-bold text-secondary-800 mb-4",children:"Tim Ahli Kami"}),t("p",{class:"text-xl text-secondary-600 max-w-3xl mx-auto",children:"Tim profesional berpengalaman dengan keahlian di berbagai bidang keuangan dan investasi"})]}),t("div",{class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[t("div",{class:"bg-gray-50 p-8 rounded-2xl text-center card-hover",children:[t("div",{class:"w-32 h-32 bg-gradient-to-br from-primary-400 to-primary-600 rounded-full mx-auto mb-6 flex items-center justify-center",children:t("i",{class:"fas fa-user text-white text-4xl"})}),t("h3",{class:"text-xl font-bold text-secondary-800 mb-2",children:"Dr. Budi Santoso"}),t("p",{class:"text-primary-600 font-medium mb-4",children:"Managing Partner"}),t("p",{class:"text-secondary-600 text-sm mb-4",children:"20+ tahun pengalaman di investment banking dan private equity. Alumni Wharton School dan mantan VP di Goldman Sachs."}),t("div",{class:"flex justify-center space-x-4",children:[t("a",{href:"#",class:"text-primary-600 hover:text-primary-700",children:t("i",{class:"fab fa-linkedin text-xl"})}),t("a",{href:"#",class:"text-primary-600 hover:text-primary-700",children:t("i",{class:"fas fa-envelope text-xl"})})]})]}),t("div",{class:"bg-gray-50 p-8 rounded-2xl text-center card-hover",children:[t("div",{class:"w-32 h-32 bg-gradient-to-br from-green-400 to-green-600 rounded-full mx-auto mb-6 flex items-center justify-center",children:t("i",{class:"fas fa-user text-white text-4xl"})}),t("h3",{class:"text-xl font-bold text-secondary-800 mb-2",children:"Sarah Wijaya, CFA"}),t("p",{class:"text-green-600 font-medium mb-4",children:"Senior Director"}),t("p",{class:"text-secondary-600 text-sm mb-4",children:"Spesialis valuasi dengan pengalaman 15+ tahun. Alumni UI dan bersertifikat CFA dengan track record di berbagai sektor industri."}),t("div",{class:"flex justify-center space-x-4",children:[t("a",{href:"#",class:"text-green-600 hover:text-green-700",children:t("i",{class:"fab fa-linkedin text-xl"})}),t("a",{href:"#",class:"text-green-600 hover:text-green-700",children:t("i",{class:"fas fa-envelope text-xl"})})]})]}),t("div",{class:"bg-gray-50 p-8 rounded-2xl text-center card-hover",children:[t("div",{class:"w-32 h-32 bg-gradient-to-br from-purple-400 to-purple-600 rounded-full mx-auto mb-6 flex items-center justify-center",children:t("i",{class:"fas fa-user text-white text-4xl"})}),t("h3",{class:"text-xl font-bold text-secondary-800 mb-2",children:"Ahmad Rahman, MBA"}),t("p",{class:"text-purple-600 font-medium mb-4",children:"M&A Director"}),t("p",{class:"text-secondary-600 text-sm mb-4",children:"Ahli M&A dengan pengalaman menangani transaksi senilai $2B+. Alumni INSEAD dan mantan consultant di McKinsey & Company."}),t("div",{class:"flex justify-center space-x-4",children:[t("a",{href:"#",class:"text-purple-600 hover:text-purple-700",children:t("i",{class:"fab fa-linkedin text-xl"})}),t("a",{href:"#",class:"text-purple-600 hover:text-purple-700",children:t("i",{class:"fas fa-envelope text-xl"})})]})]})]})]})}),t("section",{id:"kontak",class:"py-20 bg-gray-900 text-white",children:t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t("div",{class:"text-center mb-16",children:[t("h2",{class:"text-4xl font-bold mb-4",children:"Hubungi Kami"}),t("p",{class:"text-xl text-gray-300 max-w-3xl mx-auto",children:"Siap membantu pertumbuhan bisnis Anda. Mari diskusikan kebutuhan dan tantangan perusahaan Anda."})]}),t("div",{class:"grid grid-cols-1 lg:grid-cols-2 gap-12",children:[t("div",{children:[t("h3",{class:"text-2xl font-bold mb-6",children:"Informasi Kontak"}),t("div",{class:"space-y-6",children:[t("div",{class:"flex items-center",children:[t("div",{class:"bg-primary-600 w-12 h-12 rounded-full flex items-center justify-center mr-4",children:t("i",{class:"fas fa-map-marker-alt text-white"})}),t("div",{children:[t("h4",{class:"font-semibold",children:"Alamat"}),t("p",{class:"text-gray-300",children:["Menara Sudirman Lt. 25",t("br",{}),"Jl. Jend. Sudirman Kav. 60",t("br",{}),"Jakarta Selatan 12190"]})]})]}),t("div",{class:"flex items-center",children:[t("div",{class:"bg-primary-600 w-12 h-12 rounded-full flex items-center justify-center mr-4",children:t("i",{class:"fas fa-phone text-white"})}),t("div",{children:[t("h4",{class:"font-semibold",children:"Telepon"}),t("p",{class:"text-gray-300",children:"+62 21 5794 3210"})]})]}),t("div",{class:"flex items-center",children:[t("div",{class:"bg-primary-600 w-12 h-12 rounded-full flex items-center justify-center mr-4",children:t("i",{class:"fas fa-envelope text-white"})}),t("div",{children:[t("h4",{class:"font-semibold",children:"Email"}),t("p",{class:"text-gray-300",children:"info@indoprivate.co.id"})]})]}),t("div",{class:"flex items-center",children:[t("div",{class:"bg-primary-600 w-12 h-12 rounded-full flex items-center justify-center mr-4",children:t("i",{class:"fas fa-clock text-white"})}),t("div",{children:[t("h4",{class:"font-semibold",children:"Jam Operasional"}),t("p",{class:"text-gray-300",children:["Senin - Jumat: 09:00 - 18:00",t("br",{}),"Sabtu: 09:00 - 15:00"]})]})]})]}),t("div",{class:"mt-8",children:[t("h4",{class:"text-lg font-semibold mb-4",children:"Ikuti Kami"}),t("div",{class:"flex space-x-4",children:[t("a",{href:"#",class:"bg-primary-600 w-12 h-12 rounded-full flex items-center justify-center hover:bg-primary-700 transition-colors",children:t("i",{class:"fab fa-linkedin text-white"})}),t("a",{href:"#",class:"bg-primary-600 w-12 h-12 rounded-full flex items-center justify-center hover:bg-primary-700 transition-colors",children:t("i",{class:"fab fa-twitter text-white"})}),t("a",{href:"#",class:"bg-primary-600 w-12 h-12 rounded-full flex items-center justify-center hover:bg-primary-700 transition-colors",children:t("i",{class:"fab fa-instagram text-white"})})]})]})]}),t("div",{class:"bg-gray-800 p-8 rounded-2xl",children:[t("h3",{class:"text-2xl font-bold mb-6",children:"Kirim Pesan"}),t("div",{id:"contact-success",class:"hidden bg-green-600 text-white p-4 rounded-lg mb-6",children:[t("i",{class:"fas fa-check-circle mr-2"}),"Terima kasih! Pesan Anda telah terkirim. Kami akan segera menghubungi Anda."]}),t("form",{onsubmit:"submitContact(event)",class:"space-y-6",children:[t("div",{children:[t("label",{class:"block text-sm font-medium mb-2",children:"Nama Lengkap"}),t("input",{type:"text",name:"name",required:!0,class:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent text-white",placeholder:"Masukkan nama lengkap"})]}),t("div",{children:[t("label",{class:"block text-sm font-medium mb-2",children:"Email"}),t("input",{type:"email",name:"email",required:!0,class:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent text-white",placeholder:"nama@perusahaan.com"})]}),t("div",{children:[t("label",{class:"block text-sm font-medium mb-2",children:"Perusahaan"}),t("input",{type:"text",name:"company",class:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent text-white",placeholder:"Nama perusahaan"})]}),t("div",{children:[t("label",{class:"block text-sm font-medium mb-2",children:"Layanan yang Diminati"}),t("select",{name:"service",class:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent text-white",children:[t("option",{value:"",children:"Pilih layanan"}),t("option",{value:"valuasi",children:"Valuasi Perusahaan"}),t("option",{value:"ipo",children:"Persiapan IPO"}),t("option",{value:"ma",children:"M&A Advisory"}),t("option",{value:"fundraising",children:"Fundraising"}),t("option",{value:"restructuring",children:"Restructuring"}),t("option",{value:"dd",children:"Due Diligence"}),t("option",{value:"konsultasi",children:"Konsultasi Umum"})]})]}),t("div",{children:[t("label",{class:"block text-sm font-medium mb-2",children:"Pesan"}),t("textarea",{name:"message",rows:"4",required:!0,class:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent text-white",placeholder:"Jelaskan kebutuhan atau pertanyaan Anda..."})]}),t("button",{type:"submit",class:"w-full bg-primary-600 text-white py-3 px-6 rounded-lg font-semibold hover:bg-primary-700 transition-colors",children:"Kirim Pesan"})]})]})]})]})}),t("footer",{class:"bg-gray-900 border-t border-gray-800 py-12 text-gray-400",children:t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t("div",{class:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[t("div",{children:[t("h3",{class:"text-2xl font-bold text-white mb-4",children:[t("i",{class:"fas fa-chart-line mr-2 text-primary-600"}),"IndoAdvisory"]}),t("p",{class:"text-gray-400 mb-4",children:"Mitra terpercaya dalam perjalanan pertumbuhan dan transformasi bisnis Anda."}),t("p",{class:"text-sm text-gray-500",children:"© 2024 IndoAdvisory Equity Advisory. Hak cipta dilindungi undang-undang."})]}),t("div",{children:[t("h4",{class:"text-white font-semibold mb-4",children:"Layanan"}),t("ul",{class:"space-y-2 text-sm",children:[t("li",{children:t("a",{href:"#",class:"hover:text-white transition-colors",children:"Valuasi Perusahaan"})}),t("li",{children:t("a",{href:"#",class:"hover:text-white transition-colors",children:"Persiapan IPO"})}),t("li",{children:t("a",{href:"#",class:"hover:text-white transition-colors",children:"M&A Advisory"})}),t("li",{children:t("a",{href:"#",class:"hover:text-white transition-colors",children:"Fundraising"})})]})]}),t("div",{children:[t("h4",{class:"text-white font-semibold mb-4",children:"Perusahaan"}),t("ul",{class:"space-y-2 text-sm",children:[t("li",{children:t("a",{href:"#tentang",class:"hover:text-white transition-colors",children:"Tentang Kami"})}),t("li",{children:t("a",{href:"#tim",class:"hover:text-white transition-colors",children:"Tim"})}),t("li",{children:t("a",{href:"#portfolio",class:"hover:text-white transition-colors",children:"Portfolio"})}),t("li",{children:t("a",{href:"#kontak",class:"hover:text-white transition-colors",children:"Kontak"})})]})]})]})})})]}))});C.post("/api/contact",async e=>{const{name:s,email:a,company:r,service:i,message:n}=await e.req.json();try{return await e.env.DB.prepare("INSERT INTO contact_inquiries (name, email, company, service, message, created_at) VALUES (?, ?, ?, ?, ?, ?)").bind(s,a,r||null,i||null,n,new Date().toISOString()).run(),e.json({success:!0,message:"Pesan berhasil terkirim. Tim kami akan menghubungi Anda segera."})}catch(o){return console.error("Contact form error:",o),e.json({success:!1,message:"Terjadi kesalahan. Silakan coba lagi."},500)}});C.get("/artikel",async e=>{try{const s=await e.env.DB.prepare('SELECT * FROM articles WHERE status = "published" ORDER BY published_at DESC LIMIT 20').all();return e.render(t("div",{class:"min-h-screen mckinsey-section pt-16",children:[t("div",{class:"mckinsey-gradient text-white",children:t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:t("div",{class:"text-center",children:[t("h1",{class:"text-5xl font-bold mb-6 mckinsey-heading text-white",children:"Artikel & Insights"}),t("p",{class:"text-xl text-white/90 max-w-3xl mx-auto leading-relaxed",children:"Dapatkan insights mendalam tentang private equity, valuasi perusahaan, dan strategi investasi dari para ahli IndoAdvisory"}),t("div",{class:"mt-8 flex justify-center",children:t("div",{class:"bg-white/20 backdrop-blur-sm rounded-lg px-6 py-3",children:t("span",{class:"text-white/90 text-sm",children:[t("i",{class:"fas fa-chart-line mr-2"}),"Dipercaya oleh 150+ perusahaan terkemuka"]})})})]})})}),t("nav",{class:"bg-white border-b border-gray-200",children:t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:t("div",{class:"flex items-center space-x-8 py-4",children:[t("a",{href:"/",class:"flex items-center text-mckinsey-blue hover:text-mckinsey-darkblue font-medium",children:[t("i",{class:"fas fa-home mr-2"}),"Beranda"]}),t("span",{class:"text-gray-300",children:"•"}),t("span",{class:"mckinsey-accent font-semibold",children:"Artikel"})]})})}),t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:s.results.length>0?t("div",{class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:s.results.map(a=>t("article",{class:"mckinsey-card rounded-xl overflow-hidden",children:t("div",{class:"p-8",children:[t("div",{class:"flex items-center justify-between mb-6",children:[t("span",{class:"bg-mckinsey-blue/10 text-mckinsey-blue px-4 py-2 rounded-full text-sm font-semibold uppercase tracking-wide",children:a.category}),t("time",{class:"text-gray-500 text-sm font-medium",children:_e(a.published_at||a.created_at)})]}),t("h2",{class:"text-2xl font-bold mckinsey-heading mb-4 leading-tight",children:a.title}),t("p",{class:"mckinsey-text mb-6 leading-relaxed",children:a.excerpt}),t("div",{class:"flex items-center justify-between pt-4 border-t border-gray-100",children:[t("a",{href:`/artikel/${a.slug}`,class:"mckinsey-btn px-6 py-3 rounded-lg text-sm font-semibold inline-flex items-center",children:["Baca Artikel",t("i",{class:"fas fa-arrow-right ml-2"})]}),t("div",{class:"text-sm text-gray-400",children:[t("i",{class:"fas fa-clock mr-1"}),"5 min read"]})]})]})}))}):t("div",{class:"text-center py-20",children:[t("div",{class:"bg-mckinsey-blue/10 w-24 h-24 rounded-full flex items-center justify-center mx-auto mb-6",children:t("i",{class:"fas fa-newspaper text-mckinsey-blue text-3xl"})}),t("h3",{class:"text-2xl font-bold mckinsey-heading mb-4",children:"Artikel Segera Hadir"}),t("p",{class:"mckinsey-text text-lg",children:"Tim editorial kami sedang menyiapkan insights terbaru untuk Anda"})]})}),t("div",{class:"mckinsey-gradient text-white py-20",children:t("div",{class:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:t("div",{class:"bg-white/10 backdrop-blur-sm rounded-xl p-8",children:[t("h2",{class:"text-4xl font-bold mb-6 text-white",children:"Insights Eksklusif"}),t("p",{class:"text-xl text-white/90 mb-8 leading-relaxed",children:"Dapatkan analisis mendalam dan tren terbaru private equity langsung dari para ahli kami"}),t("div",{class:"flex flex-col sm:flex-row gap-4 justify-center max-w-lg mx-auto",children:[t("input",{type:"email",placeholder:"Masukkan alamat email Anda",class:"flex-1 px-6 py-4 rounded-lg text-gray-900 focus:ring-2 focus:ring-white/50 border-0 font-medium"}),t("button",{class:"bg-white text-mckinsey-blue px-8 py-4 rounded-lg font-bold hover:bg-gray-100 transition-colors",children:[t("i",{class:"fas fa-envelope mr-2"}),"Berlangganan"]})]}),t("p",{class:"text-white/70 text-sm mt-4",children:[t("i",{class:"fas fa-shield-alt mr-1"}),"Data Anda aman dan tidak akan dibagikan kepada pihak ketiga"]})]})})})]}),{title:"Artikel & Insights - IndoAdvisory"})}catch(s){return console.error("Articles page error:",s),e.render(t("div",{children:"Error loading articles"}))}});C.get("/artikel/:slug",async e=>{try{const s=e.req.param("slug"),a=await e.env.DB.prepare('SELECT * FROM articles WHERE slug = ? AND status = "published"').bind(s).first();if(!a)return e.notFound();const r=await e.env.DB.prepare('SELECT * FROM articles WHERE category = ? AND slug != ? AND status = "published" ORDER BY published_at DESC LIMIT 3').bind(a.category,s).all();return e.render(t("div",{class:"min-h-screen bg-white pt-16",children:[t("nav",{class:"bg-white border-b border-gray-200",children:t("div",{class:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:t("div",{class:"flex items-center space-x-4 py-6 text-sm",children:[t("a",{href:"/",class:"text-mckinsey-blue hover:text-mckinsey-darkblue font-medium",children:[t("i",{class:"fas fa-home mr-2"}),"Beranda"]}),t("span",{class:"text-gray-300",children:"•"}),t("a",{href:"/artikel",class:"text-mckinsey-blue hover:text-mckinsey-darkblue font-medium",children:"Artikel"}),t("span",{class:"text-gray-300",children:"•"}),t("span",{class:"mckinsey-text font-semibold truncate max-w-md",children:a.title})]})})}),t("article",{class:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:[t("header",{class:"mb-12",children:[t("div",{class:"flex items-center justify-between mb-8",children:[t("span",{class:"bg-mckinsey-blue/10 text-mckinsey-blue px-6 py-3 rounded-full text-sm font-bold uppercase tracking-wide",children:a.category}),t("div",{class:"text-right",children:[t("time",{class:"text-gray-500 font-medium",children:_e(a.published_at||a.created_at)}),t("div",{class:"text-sm text-gray-400 mt-1",children:[t("i",{class:"fas fa-clock mr-1"}),"5 min read"]})]})]}),t("h1",{class:"text-5xl font-bold mckinsey-heading mb-8 leading-tight",children:a.title}),a.excerpt&&t("div",{class:"bg-mckinsey-lightgray p-8 rounded-xl border-l-4 border-mckinsey-blue",children:t("p",{class:"text-xl mckinsey-text leading-relaxed font-medium",children:a.excerpt})}),t("div",{class:"flex items-center justify-between mt-8 pt-8 border-t border-gray-200",children:[t("div",{class:"flex items-center space-x-4",children:[t("div",{class:"w-12 h-12 bg-mckinsey-blue rounded-full flex items-center justify-center",children:t("i",{class:"fas fa-user text-white"})}),t("div",{children:[t("div",{class:"font-semibold mckinsey-heading",children:"IndoAdvisory Team"}),t("div",{class:"text-sm text-gray-500",children:"Investment Advisory Experts"})]})]}),t("div",{class:"flex items-center space-x-4 text-sm text-gray-500",children:[t("div",{children:[t("i",{class:"fas fa-eye mr-1"}),"Professional Insights"]}),t("div",{children:[t("i",{class:"fas fa-bookmark mr-1"}),"Expert Analysis"]})]})]})]}),t("div",{class:"prose prose-xl max-w-none mckinsey-article-content",dangerouslySetInnerHTML:{__html:a.content}}),a.tags&&t("div",{class:"mt-12 pt-8 border-t border-gray-200",children:[t("h3",{class:"font-semibold mckinsey-heading mb-4",children:"Topik Terkait:"}),t("div",{class:"flex flex-wrap gap-3",children:a.tags.split(",").map(i=>t("span",{class:"bg-mckinsey-blue/10 text-mckinsey-blue px-4 py-2 rounded-full text-sm font-medium hover:bg-mckinsey-blue hover:text-white transition-colors cursor-pointer",children:[t("i",{class:"fas fa-tag mr-1"}),i.trim()]}))})]}),t("div",{class:"mt-12 pt-8 border-t border-gray-200",children:t("div",{class:"bg-mckinsey-lightgray rounded-xl p-8",children:[t("h3",{class:"text-xl font-bold mckinsey-heading mb-6",children:"Bagikan Insights Ini"}),t("div",{class:"flex flex-wrap gap-4",children:[t("a",{href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(e.req.url)}`,target:"_blank",class:"bg-blue-600 text-white px-6 py-3 rounded-lg hover:bg-blue-700 transition-colors font-semibold flex items-center",children:[t("i",{class:"fab fa-linkedin mr-3 text-lg"}),"Share on LinkedIn"]}),t("a",{href:`https://twitter.com/intent/tweet?text=${encodeURIComponent(a.title)}&url=${encodeURIComponent(e.req.url)}`,target:"_blank",class:"bg-blue-400 text-white px-6 py-3 rounded-lg hover:bg-blue-500 transition-colors font-semibold flex items-center",children:[t("i",{class:"fab fa-twitter mr-3 text-lg"}),"Share on Twitter"]}),t("button",{onclick:`navigator.clipboard.writeText('${e.req.url}'); alert('Link copied to clipboard!')`,class:"mckinsey-btn-outline px-6 py-3 rounded-lg font-semibold flex items-center",children:[t("i",{class:"fas fa-copy mr-3"}),"Copy Link"]})]}),t("div",{class:"mt-6 pt-6 border-t border-gray-300",children:t("p",{class:"text-sm mckinsey-text",children:[t("i",{class:"fas fa-info-circle mr-2 text-mckinsey-blue"}),"Bagikan insights ini dengan kolega dan rekan bisnis Anda untuk diskusi yang lebih mendalam"]})})]})})]}),r.results.length>0&&t("section",{class:"mckinsey-section py-20",children:t("div",{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t("div",{class:"text-center mb-12",children:[t("h2",{class:"text-3xl font-bold mckinsey-heading mb-4",children:"Insights Terkait"}),t("p",{class:"text-lg mckinsey-text",children:"Pelajari lebih lanjut topik serupa dari para ahli kami"})]}),t("div",{class:"grid grid-cols-1 md:grid-cols-3 gap-8",children:r.results.map(i=>t("article",{class:"mckinsey-card rounded-xl overflow-hidden",children:t("div",{class:"p-8",children:[t("span",{class:"bg-mckinsey-blue/10 text-mckinsey-blue px-4 py-2 rounded-full text-xs font-bold uppercase tracking-wide",children:i.category}),t("h3",{class:"text-xl font-bold mckinsey-heading mt-6 mb-4 leading-tight",children:i.title}),t("p",{class:"mckinsey-text mb-6 leading-relaxed",children:i.excerpt}),t("div",{class:"flex items-center justify-between pt-4 border-t border-gray-100",children:[t("a",{href:`/artikel/${i.slug}`,class:"mckinsey-btn px-4 py-2 rounded-lg text-sm font-semibold inline-flex items-center",children:["Baca Artikel",t("i",{class:"fas fa-arrow-right ml-2"})]}),t("div",{class:"text-xs text-gray-400",children:[t("i",{class:"fas fa-clock mr-1"}),"5 min"]})]})]})}))})]})})]}),{title:`${a.title} - IndoAdvisory`})}catch(s){return console.error("Article page error:",s),e.notFound()}});const ss=new se,Dr=Object.assign({"/src/index.tsx":C});let Qs=!1;for(const[,e]of Object.entries(Dr))e&&(ss.all("*",s=>{let a;try{a=s.executionCtx}catch{}return e.fetch(s.req.raw,s.env,a)}),ss.notFound(s=>{let a;try{a=s.executionCtx}catch{}return e.fetch(s.req.raw,s.env,a)}),Qs=!0);if(!Qs)throw new Error("Can't import modules from ['/src/index.ts','/src/index.tsx','/app/server.ts']");export{ss as default};