const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/reportGenerator-Cy0VNaOh.js","assets/report-BDZM_cAE.js","assets/react-vendor-HAtWSuih.js","assets/Contact-BoAWtp_f.js","assets/arrow-left-Bz2pC6T-.js","assets/clock-CRHF6-rp.js","assets/router-mXriJO-V.js","assets/Privacy-DvZG0rd9.js","assets/Terms-ul8VUbcy.js","assets/SpecifiedCommercialTransactionAct-Bj9cnpP5.js","assets/building-Cdj-gILC.js","assets/CompanyInfo-kS5UDhpM.js","assets/AdminLogin-hjg_mHXi.js","assets/alert-circle-Cg4eNB7y.js","assets/AdminDashboard-i3bVv6l4.js"])))=>i.map(i=>d[i]); import{r as l,a as ye}from"./react-vendor-HAtWSuih.js";import{L as M,N as ve,R as je,a as _,B as ke}from"./router-mXriJO-V.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const d of i.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var ae={exports:{}},q={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ne=l,Ee=Symbol.for("react.element"),Se=Symbol.for("react.fragment"),_e=Object.prototype.hasOwnProperty,Ae=Ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,De={key:!0,ref:!0,__self:!0,__source:!0};function ne(t,s,n){var r,a={},i=null,d=null;n!==void 0&&(i=""+n),s.key!==void 0&&(i=""+s.key),s.ref!==void 0&&(d=s.ref);for(r in s)_e.call(s,r)&&!De.hasOwnProperty(r)&&(a[r]=s[r]);if(t&&t.defaultProps)for(r in s=t.defaultProps,s)a[r]===void 0&&(a[r]=s[r]);return{$$typeof:Ee,type:t,key:i,ref:d,props:a,_owner:Ae.current}}q.Fragment=Se;q.jsx=ne;q.jsxs=ne;ae.exports=q;var e=ae.exports,oe,te=ye;oe=te.createRoot,te.hydrateRoot;const Le="modulepreload",Te=function(t){return"/"+t},se={},A=function(s,n,r){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),o=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=Promise.allSettled(n.map(c=>{if(c=Te(c),c in se)return;se[c]=!0;const p=c.endsWith(".css"),w=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${w}`))return;const h=document.createElement("link");if(h.rel=p?"stylesheet":Le,p||(h.as="script"),h.crossOrigin="",h.href=c,o&&h.setAttribute("nonce",o),document.head.appendChild(h),p)return new Promise((b,j)=>{h.addEventListener("load",b),h.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(d){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=d,window.dispatchEvent(o),!o.defaultPrevented)throw d}return a.then(d=>{for(const o of d||[])o.status==="rejected"&&i(o.reason);return s().catch(i)})};/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Ce={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ie=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),T=(t,s)=>{const n=l.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:d,className:o="",children:c,...p},w)=>l.createElement("svg",{ref:w,...Ce,width:a,height:a,stroke:r,strokeWidth:d?Number(i)*24/Number(a):i,className:["lucide",`lucide-${Ie(t)}`,o].join(" "),...p},[...s.map(([h,b])=>l.createElement(h,b)),...Array.isArray(c)?c:[c]]));return n.displayName=`${t}`,n};/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Fe=T("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Re=T("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pe=T("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Me=T("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Oe=T("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Be=T("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ze=T("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ge(){const t=new Date().getFullYear();return e.jsxs("footer",{className:"relative z-10 mt-20 bg-gradient-to-b from-white to-gray-50",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-emerald-300 to-transparent"}),e.jsxs("div",{className:"max-w-[1400px] mx-auto px-6 sm:px-8 lg:px-12 py-12",children:[e.jsx("div",{className:"hidden md:block bg-gradient-to-br from-rose-50 to-pink-50 border border-rose-200 rounded-3xl p-8 mb-12 shadow-lg",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"bg-white p-3 rounded-2xl flex-shrink-0 shadow-sm",children:e.jsx(Oe,{className:"w-6 h-6 text-rose-500"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("h3",{className:"text-xl font-semibold text-gray-800 mb-4 flex items-center gap-2",children:[e.jsx(Pe,{className:"w-5 h-5 text-rose-500"}),"金融商品取引法に基づく重要事項"]}),e.jsxs("div",{className:"space-y-3 text-sm leading-relaxed text-gray-700",children:[e.jsxs("div",{className:"bg-white rounded-2xl p-4 border-l-4 border-sky-400 shadow-sm",children:[e.jsx("p",{className:"font-semibold text-gray-800 mb-2",children:"【サービスの性質】"}),e.jsxs("p",{children:["本サービスは、AI技術を活用した株式情報の提供および分析ツールです。",e.jsx("strong",{className:"text-rose-600",children:"投資助言業務、投資一任業務、金融商品仲介業務には該当せず、特定の金融商品の売買を推奨・勧誘するものではありません。"})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-4 border-l-4 border-amber-400 shadow-sm",children:[e.jsx("p",{className:"font-semibold text-gray-800 mb-2",children:"【投資リスクに関する警告】"}),e.jsxs("p",{children:["株式投資には価格変動リスク、信用リスク、流動性リスク等が伴い、",e.jsx("strong",{className:"text-rose-600",children:"投資元本を割り込む可能性があります。"}),"過去の運用実績は将来の運用成果を保証するものではありません。 市場環境の変化により、予想外の損失が発生する可能性があります。"]})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-4 border-l-4 border-emerald-400 shadow-sm",children:[e.jsx("p",{className:"font-semibold text-gray-800 mb-2",children:"【情報の正確性について】"}),e.jsx("p",{children:"提供される情報は、信頼できると判断した情報源から取得していますが、 その正確性、完全性、適時性を保証するものではありません。 AI分析結果は参考情報として提供されるものであり、絶対的な投資判断基準ではありません。"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-4 border-l-4 border-purple-400 shadow-sm",children:[e.jsx("p",{className:"font-semibold text-gray-800 mb-2",children:"【投資判断の責任】"}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-rose-600",children:"最終的な投資判断は、利用者ご自身の責任において行ってください。"}),"本サービスの利用により生じたいかなる損害についても、当社は一切の責任を負いません。 投資を行う際は、証券会社等の金融商品取引業者にご相談ください。"]})]}),e.jsxs("div",{className:"bg-gray-50 rounded-2xl p-4 mt-4",children:[e.jsx("p",{className:"font-semibold text-gray-800 mb-1",children:"【登録情報】"}),e.jsx("p",{className:"text-xs text-gray-600",children:"当サービス提供者は金融商品取引業者(投資助言・代理業、投資運用業等)ではありません。 金融商品取引法第29条の登録を受けた事業者ではないため、個別の投資助言を行うことはできません。"})]})]})]})]})}),e.jsxs("div",{className:"md:hidden bg-gradient-to-r from-rose-50 to-pink-50 border border-rose-200 rounded-2xl p-4 text-center mb-8",children:[e.jsx("p",{className:"text-sm text-rose-600 font-semibold mb-1",children:"⚠️ 重要なお知らせ"}),e.jsx("p",{className:"text-xs text-gray-700 leading-relaxed",children:"当サービスは情報提供のみを目的としており、投資助言や投資勧誘を行うものではありません。投資判断は必ずご自身の責任で行ってください。"})]}),e.jsxs("div",{className:"border-t border-gray-200 pt-8",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-8 mb-8",children:[e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-gray-800 mb-4 flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4 text-emerald-500"}),"法的文書"]}),e.jsxs("ul",{className:"space-y-3 text-sm",children:[e.jsx("li",{children:e.jsxs(M,{to:"/company",className:"text-gray-600 hover:text-emerald-600 transition-colors flex items-center gap-2 group",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-300 group-hover:bg-emerald-500 transition-colors"}),"会社概要"]})}),e.jsx("li",{children:e.jsxs(M,{to:"/terms",className:"text-gray-600 hover:text-emerald-600 transition-colors flex items-center gap-2 group",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-300 group-hover:bg-emerald-500 transition-colors"}),"利用規約"]})}),e.jsx("li",{children:e.jsxs(M,{to:"/privacy",className:"text-gray-600 hover:text-emerald-600 transition-colors flex items-center gap-2 group",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-300 group-hover:bg-emerald-500 transition-colors"}),"プライバシーポリシー"]})}),e.jsx("li",{children:e.jsxs(M,{to:"/specified-commercial-transaction-act",className:"text-gray-600 hover:text-emerald-600 transition-colors flex items-center gap-2 group",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-300 group-hover:bg-emerald-500 transition-colors"}),"特定商取引法表記"]})})]})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-gray-800 mb-4 flex items-center gap-2",children:[e.jsx(Re,{className:"w-4 h-4 text-rose-400"}),"お問い合わせ"]}),e.jsx("ul",{className:"space-y-3 text-sm",children:e.jsx("li",{children:e.jsxs(M,{to:"/contact",className:"text-gray-600 hover:text-rose-500 transition-colors flex items-center gap-2 group",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-rose-300 group-hover:bg-rose-500 transition-colors"}),"お問い合わせフォーム"]})})})]})]}),e.jsxs("div",{className:"border-t border-gray-200 pt-6 text-center",children:[e.jsxs("p",{className:"text-sm text-gray-800 mb-2 font-medium",children:["© ",t," 株式会社イービット (Ebit Co., Ltd.). All rights reserved."]}),e.jsx("p",{className:"text-xs text-gray-600 leading-relaxed max-w-3xl mx-auto",children:"当サイトで提供される情報は投資勧誘を目的としたものではありません。 投資に関する最終決定は、利用者ご自身の判断でなさるようお願いいたします。 掲載されている情報の正確性については万全を期しておりますが、その内容の正確性、安全性、有用性を保証するものではありません。"})]})]})]})]})}const $e=()=>"",U=t=>{const s=$e();return t.startsWith("/")||(t=`/${t}`),s===""?t:`${s}${t}`},Ve=()=>localStorage.getItem("admin_token"),W=t=>{const s={"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"};t&&Object.entries(t).forEach(([r,a])=>{typeof a=="string"&&(s[r]=a)});const n=Ve();return n&&(s.Authorization=`Bearer ${n}`),s},k={async get(t,s){const n=U(t);return await fetch(n,{...s,method:"GET",headers:W(s==null?void 0:s.headers),cache:"no-store"})},async post(t,s,n){const r=U(t);return await fetch(r,{...n,method:"POST",headers:W({"Content-Type":"application/json",...n==null?void 0:n.headers}),body:s?JSON.stringify(s):void 0,cache:"no-store"})},async put(t,s,n){const r=U(t);return await fetch(r,{...n,method:"PUT",headers:W({"Content-Type":"application/json",...n==null?void 0:n.headers}),body:s?JSON.stringify(s):void 0,cache:"no-store"})},async delete(t,s){const n=U(t);return await fetch(n,{...s,method:"DELETE",headers:W(s==null?void 0:s.headers),cache:"no-store"})}};function Ue(t){localStorage.setItem("admin_token",t)}function We(){localStorage.removeItem("admin_token")}async function H(t){if(!t.ok){const s=await t.json().catch(()=>({error:t.statusText}));throw new Error(s.error||"Request failed")}return t.json()}const He={async login(t,s){try{const n=await k.post("/api/admin/login",{username:t,password:s}),r=await H(n);return r.success&&r.token?(Ue(r.token),{success:!0}):{success:!1,error:r.error||"登录失败"}}catch(n){return console.error("Login error:",n),{success:!1,error:n instanceof Error?n.message:"登录失败,请重试"}}},async logout(){try{await k.post("/api/admin/logout",{})}catch(t){console.error("Logout error:",t)}finally{We()}},async isAuthenticated(){try{const t=await k.get("/api/admin/verify");return(await H(t)).success}catch{return!1}},async getSession(){try{const t=await k.get("/api/admin/verify"),s=await H(t);return s.success&&s.user?{user:s.user,isAdmin:!0}:null}catch{return null}},async getCurrentUser(){try{const t=await k.get("/api/admin/verify"),s=await H(t);return s.success?s.user:null}catch{return null}}};function Je({children:t}){const[s,n]=l.useState(null);return l.useEffect(()=>{(async()=>{const a=await He.isAuthenticated();n(a)})()},[]),s===null?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-50",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-12 w-12 border-4 border-slate-300 border-t-slate-900"}),e.jsx("p",{className:"mt-4 text-slate-600",children:"验证身份中..."})]})}):s?e.jsx(e.Fragment,{children:t}):e.jsx(ve,{to:"/adsadmin",replace:!0})}function qe(){return e.jsxs("div",{className:"fixed inset-0 -z-10 overflow-hidden bg-gradient-to-br from-amber-50/30 via-rose-50/20 to-emerald-50/30",children:[e.jsx("div",{className:"absolute top-20 left-10 w-96 h-96 bg-gradient-to-br from-emerald-200/20 to-teal-200/20 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute top-40 right-20 w-80 h-80 bg-gradient-to-br from-pink-200/20 to-rose-200/20 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-20 left-1/3 w-72 h-72 bg-gradient-to-br from-purple-200/15 to-indigo-200/15 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute top-1/2 right-1/4 w-64 h-64 bg-gradient-to-br from-yellow-200/10 to-amber-200/10 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 2px 2px, rgba(167, 243, 208, 0.08) 1px, transparent 1px)",backgroundSize:"48px 48px"}}),e.jsxs("svg",{className:"absolute bottom-0 left-0 w-full h-32 text-white/50",preserveAspectRatio:"none",viewBox:"0 0 1200 120",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M0,64 C240,96 480,32 720,64 C960,96 1200,32 1200,32 L1200,120 L0,120 Z",fill:"currentColor",opacity:"0.3"}),e.jsx("path",{d:"M0,80 C240,48 480,112 720,80 C960,48 1200,112 1200,112 L1200,120 L0,120 Z",fill:"currentColor",opacity:"0.2"})]})]})}function Ze(){return e.jsx("header",{className:"sticky top-0 z-50 bg-white/85 backdrop-blur-md border-b border-gray-100 shadow-sm",children:e.jsx("div",{className:"max-w-6xl mx-auto px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, #A7F3D0 0%, #6EE7B7 100%)",boxShadow:"0 4px 16px rgba(167, 243, 208, 0.3)"},children:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z",fill:"white",opacity:"0.95"})})}),e.jsx("div",{className:"absolute -bottom-1 -right-1 w-5 h-5 bg-gradient-to-br from-pink-300 to-rose-300 rounded-full flex items-center justify-center",children:e.jsx("div",{className:"w-2 h-2 bg-white rounded-full"})})]}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-gray-800",children:"AI株式診断"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"やさしい人工知能による株式分析"})]})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsxs("div",{className:"hidden md:flex items-center space-x-2 px-4 py-2 bg-gradient-to-r from-sky-50 to-sky-100/50 rounded-full border border-sky-200/50",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-sky-400"}),e.jsx("span",{className:"text-xs font-medium text-sky-700",children:"信頼"})]}),e.jsxs("div",{className:"hidden md:flex items-center space-x-2 px-4 py-2 bg-gradient-to-r from-emerald-50 to-emerald-100/50 rounded-full border border-emerald-200/50",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400"}),e.jsx("span",{className:"text-xs font-medium text-emerald-700",children:"安全"})]})]})]})})})}function Ke({records:t}){const s=[...t,...t];return e.jsxs("div",{className:"w-full bg-gradient-to-r from-emerald-50 via-teal-50 to-emerald-50 border-y border-emerald-100 py-3 overflow-hidden",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-4",children:[e.jsx("div",{className:"flex items-center gap-4 mb-3",children:e.jsxs("div",{className:"flex items-center gap-2 px-4 py-1.5 bg-white rounded-full shadow-sm border border-emerald-200",children:[e.jsx("div",{className:"w-2 h-2 bg-emerald-500 rounded-full animate-pulse"}),e.jsx("span",{className:"text-sm font-semibold text-emerald-700",children:"最近の分析事例"})]})}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-20 bg-gradient-to-r from-emerald-50 to-transparent z-10 pointer-events-none"}),e.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-20 bg-gradient-to-l from-emerald-50 to-transparent z-10 pointer-events-none"}),e.jsx("div",{className:"flex gap-3 animate-scroll",children:s.map((n,r)=>e.jsxs("div",{className:"flex items-center gap-3 bg-white rounded-2xl px-4 py-3 border border-gray-100 shadow-sm whitespace-nowrap flex-shrink-0",style:{minWidth:"280px"},children:[e.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center text-lg shadow-sm flex-shrink-0",style:{background:r%3===0?"linear-gradient(135deg, #A7F3D0 0%, #6EE7B7 100%)":r%3===1?"linear-gradient(135deg, #FDE68A 0%, #FCD34D 100%)":"linear-gradient(135deg, #DDD6FE 0%, #C4B5FD 100%)"},children:n.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"px-2 py-0.5 bg-gradient-to-r from-sky-100 to-sky-200 text-sky-700 text-xs font-semibold rounded-full",children:n.time}),e.jsx("span",{className:"px-2 py-0.5 bg-emerald-50 text-emerald-600 text-xs font-semibold rounded-full",children:"分析完了"})]}),e.jsx("p",{className:"text-sm font-semibold text-gray-800 truncate",children:n.stock})]})]},r))})]})]}),e.jsx("style",{children:` @keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } } .animate-scroll { animation: scroll 30s linear infinite; } .animate-scroll:hover { animation-play-state: paused; } `})]})}function Xe(){return e.jsx("div",{className:"w-full py-4",children:e.jsx("div",{className:"max-w-6xl mx-auto px-4",children:e.jsxs("div",{className:"relative h-px",children:[e.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(90deg, transparent 0%, #A7F3D0 20%, #FDA4AF 50%, #DDD6FE 80%, transparent 100%)",opacity:.3}}),e.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-gradient-to-r from-emerald-300 to-teal-300"}),e.jsx("div",{className:"w-2 h-2 rounded-full bg-gradient-to-r from-pink-300 to-rose-300"}),e.jsx("div",{className:"w-2 h-2 rounded-full bg-gradient-to-r from-purple-300 to-indigo-300"})]})})]})})})}function Ye({children:t}){return e.jsx("div",{className:"w-full max-w-2xl mx-auto px-2",children:e.jsxs("div",{className:"bg-white rounded-3xl shadow-lg overflow-hidden border border-gray-100",style:{boxShadow:"0 8px 32px rgba(0, 0, 0, 0.08)"},children:[e.jsx("div",{className:"px-8 py-5 border-b border-gray-100",style:{background:"linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 50%, #6EE7B7 100%)"},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:"銘柄診断フォーム"}),e.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"銘柄コードまたは銘柄名を入力してください"})]}),e.jsxs("div",{className:"flex items-center space-x-2 px-3 py-1.5 bg-white/60 backdrop-blur-sm rounded-full",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400 animate-pulse"}),e.jsx("span",{className:"text-xs text-gray-700 font-medium",children:"入力可能"})]})]})}),e.jsx("div",{className:"p-2",children:t}),e.jsx("div",{className:"px-8 py-4 text-center border-t border-gray-100",style:{background:"linear-gradient(to right, #F9FAFB, #FFFFFF, #F9FAFB)"},children:e.jsxs("div",{className:"flex items-center justify-center space-x-6 text-xs text-gray-500",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M8 14A6 6 0 108 2a6 6 0 000 12z",stroke:"#6EE7B7",strokeWidth:"1.5",fill:"none"}),e.jsx("path",{d:"M6 8l1.5 1.5L10.5 6.5",stroke:"#6EE7B7",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsx("span",{children:"安全な接続"})]}),e.jsx("div",{className:"w-px h-4 bg-gray-200"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"3",y:"5",width:"10",height:"8",rx:"1",stroke:"#FDA4AF",strokeWidth:"1.5",fill:"none"}),e.jsx("path",{d:"M5 5V4a3 3 0 016 0v1",stroke:"#FDA4AF",strokeWidth:"1.5",strokeLinecap:"round"})]}),e.jsx("span",{children:"入力情報は保護されます"})]})]})})]})})}function Qe({value:t,onChange:s,onSelect:n,suggestions:r,placeholder:a="例: 7203 トヨタ自動車",disabled:i=!1,autoFillMessage:d=""}){const[o,c]=l.useState(!1),[p,w]=l.useState(-1),h=l.useRef(null),b=l.useRef(null);l.useEffect(()=>{const m=f=>{b.current&&!b.current.contains(f.target)&&h.current&&!h.current.contains(f.target)&&c(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const j=m=>{if(!(!o||r.length===0))if(m.key==="ArrowDown")m.preventDefault(),w(f=>ff>0?f-1:-1);else if(m.key==="Enter"&&p>=0){m.preventDefault();const f=r[p];n(f.code,f.name),c(!1),w(-1)}else m.key==="Escape"&&(c(!1),w(-1))};return e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-emerald-400",children:e.jsx(Me,{size:20,strokeWidth:2})}),e.jsx("input",{ref:h,type:"text",value:t,onChange:m=>{s(m.target.value),c(!0),w(-1)},onFocus:()=>{t&&r.length>0&&c(!0)},onKeyDown:j,disabled:i,placeholder:a,className:"w-full h-14 pl-12 pr-4 text-base border-2 border-gray-200 rounded-2xl focus:outline-none focus:border-emerald-300 focus:ring-4 focus:ring-emerald-100 transition-all duration-300 disabled:bg-gray-50 disabled:cursor-not-allowed bg-white",style:{boxShadow:"0 2px 8px rgba(0, 0, 0, 0.04)"}})]}),d&&e.jsx("div",{className:"absolute -top-10 left-0 right-0 flex justify-center",children:e.jsx("div",{className:"px-4 py-2 bg-gradient-to-r from-emerald-400 to-teal-400 text-white text-sm rounded-full shadow-lg animate-fade-in",children:d})}),o&&r.length>0&&e.jsx("div",{ref:b,className:"absolute z-50 w-full mt-2 bg-white rounded-2xl shadow-lg border border-gray-100 overflow-hidden max-h-64 overflow-y-auto",style:{boxShadow:"0 8px 24px rgba(0, 0, 0, 0.1)"},children:r.map((m,f)=>e.jsx("button",{className:`w-full px-5 py-3.5 text-left hover:bg-gradient-to-r hover:from-emerald-50 hover:to-teal-50 transition-all duration-200 flex items-center justify-between border-b border-gray-50 last:border-b-0 ${f===p?"bg-gradient-to-r from-emerald-50 to-teal-50":""}`,onClick:()=>{n(m.code,m.name),c(!1),w(-1)},onMouseEnter:()=>w(f),children:e.jsxs("div",{className:"flex items-center space-x-3 flex-1",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-800 px-2.5 py-1 bg-gradient-to-r from-emerald-100 to-teal-100 rounded-lg",children:m.code}),e.jsx("span",{className:"text-sm text-gray-700",children:m.name})]})},`${m.code}-${f}`))}),e.jsx("p",{className:"mt-2 text-xs text-gray-500 px-1",children:"銘柄コード(4桁)または銘柄名を入力すると候補が表示されます"})]})}function et({onClick:t,disabled:s=!1,loading:n=!1,children:r,icon:a}){return e.jsxs("button",{onClick:t,disabled:s||n,className:"w-full h-14 px-8 rounded-full font-semibold text-white text-base disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-300 hover:scale-[1.02] active:scale-[0.98] flex items-center justify-center space-x-2 relative overflow-hidden group",style:{background:s||n?"linear-gradient(135deg, #E5E7EB 0%, #D1D5DB 100%)":"linear-gradient(135deg, #FDA4AF 0%, #FB7185 100%)",boxShadow:s||n?"none":"0 4px 16px rgba(253, 164, 175, 0.4)"},children:[n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),e.jsx("span",{children:"診断中..."})]}):e.jsxs(e.Fragment,{children:[a&&e.jsx("span",{className:"transition-transform group-hover:scale-110",children:a}),e.jsx("span",{children:r})]}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700"})]})}function tt({progress:t}){return e.jsx("div",{className:"w-full max-w-md mx-auto px-4 py-12",children:e.jsxs("div",{className:"text-center space-y-8",children:[e.jsxs("div",{className:"relative w-32 h-32 mx-auto",children:[e.jsx("div",{className:"absolute inset-0 rounded-full",style:{background:"linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%)",animation:"pulse 2s ease-in-out infinite"}}),e.jsx("div",{className:"absolute inset-2 bg-white rounded-full flex items-center justify-center",children:e.jsxs("svg",{className:"w-16 h-16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"#6EE7B7",strokeWidth:"2",strokeDasharray:"60",strokeDashoffset:"15",strokeLinecap:"round",children:e.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"360 12 12",dur:"2s",repeatCount:"indefinite"})}),e.jsx("path",{d:"M8 12l2 2 4-4",stroke:"#6EE7B7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.5"})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-800",children:"AI診断中..."}),e.jsx("p",{className:"text-sm text-gray-500",children:"株式情報を分析しています"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"w-full bg-gray-100 rounded-full h-3 overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(t,100)}%`,background:"linear-gradient(90deg, #A7F3D0 0%, #6EE7B7 50%, #FDA4AF 100%)",boxShadow:"0 2px 8px rgba(167, 243, 208, 0.4)"}})}),e.jsxs("p",{className:"text-xs text-gray-500",children:[Math.round(t),"%"]})]}),e.jsxs("div",{className:"flex justify-center space-x-2",children:[e.jsx("div",{className:"w-2 h-2 bg-gradient-to-r from-emerald-300 to-teal-300 rounded-full animate-bounce",style:{animationDelay:"0s"}}),e.jsx("div",{className:"w-2 h-2 bg-gradient-to-r from-pink-300 to-rose-300 rounded-full animate-bounce",style:{animationDelay:"0.2s"}}),e.jsx("div",{className:"w-2 h-2 bg-gradient-to-r from-purple-300 to-indigo-300 rounded-full animate-bounce",style:{animationDelay:"0.4s"}})]})]})})}function st({isOpen:t,onClose:s,children:n,title:r}){return t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 animate-fadeIn",children:[e.jsx("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:s}),e.jsxs("div",{className:"relative bg-white rounded-3xl shadow-2xl max-w-3xl w-full max-h-[90vh] overflow-hidden animate-scaleIn",style:{boxShadow:"0 20px 60px rgba(0, 0, 0, 0.15)"},children:[r&&e.jsx("div",{className:"px-4 py-2 border-b border-gray-100",style:{background:"linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%)"},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-2xl font-semibold text-gray-800",children:r}),e.jsx("button",{onClick:s,className:"w-10 h-10 rounded-full bg-white/60 backdrop-blur-sm hover:bg-white transition-all duration-200 flex items-center justify-center group",children:e.jsx(ze,{className:"w-5 h-5 text-gray-600 group-hover:text-gray-800"})})]})}),e.jsx("div",{className:"overflow-y-auto max-h-[calc(90vh-120px)]",children:n})]})]}):null}const rt=t=>{const s=[],n=/(\d+\.?\d*%?|\d+円|[+-]\d+\.?\d*)/g;let r=0,a;for(;(a=n.exec(t))!==null;)a.index>r&&s.push(t.substring(r,a.index)),s.push(e.jsx("span",{className:"text-blue-600 font-semibold text-lg",children:a[0]},a.index)),r=a.index+a[0].length;return r0?s:[t]},at=t=>{const s=t.includes("###")||t.includes("**")||/^[\d]+\./.test(t),n=t.replace(/###|\*\*/g,"");return{type:s?"bold":"normal",content:rt(n)}};function nt({text:t}){const n=t.split(` `).map(at);return e.jsx("div",{className:"leading-relaxed space-y-2 text-sm",children:n.map((r,a)=>r.type==="bold"?e.jsx("div",{className:"font-bold text-blue-900 mt-4 mb-2",children:r.content},a):e.jsx("div",{className:"text-gray-700",children:r.content},a))})}function ot(){const t=()=>{const r=new URLSearchParams(window.location.search),a=r.get("code")||"",i=r.get("src")||"",d=r.get("rac_text")||"",o=r.get("gclid")||"";return{code:(a?/^\d{4}$/.test(a):!1)?a:"",src:i,racText:d,gclid:o}},[s,n]=l.useState(t);return l.useEffect(()=>{const r=()=>{n(t())};return window.addEventListener("popstate",r),r(),()=>{window.removeEventListener("popstate",r)}},[]),s}function it(){const[t,s]=l.useState([]),[n,r]=l.useState(!0),[a,i]=l.useState(null);return l.useEffect(()=>{(async()=>{try{r(!0);const c=await fetch("/assets/stock.json");if(!c.ok)throw new Error("Failed to load stock data");const p=await c.json();s(p),i(null)}catch(c){console.error("Error loading stock data:",c),i(c instanceof Error?c.message:"Failed to load stock data")}finally{r(!1)}})()},[]),{search:l.useMemo(()=>o=>{if(!o||o.trim().length===0)return[];const c=o.trim().toLowerCase(),p=[];for(const w of t){const h=w.name,b=w.description||"",j=w.exchange||"",m=h.toLowerCase().includes(c),f=b.toLowerCase().includes(c);if((m||f)&&p.push({code:h,name:b,market:j}),p.length>=100)break}return p},[t]),isLoading:n,error:a,totalStocks:t.length}}const re="user_session_id";function lt(){return`sess_${Date.now()}_${Math.random().toString(36).substring(2,15)}`}function J(){let t=localStorage.getItem(re);return t||(t=lt(),localStorage.setItem(re,t)),t}const O={async trackPageLoad(t){try{const s=J();await k.post("/api/tracking/session",{sessionId:s,stockCode:t.stockCode,stockName:t.stockName,urlParams:t.urlParams,userAgent:navigator.userAgent}),await k.post("/api/tracking/event",{sessionId:s,eventType:"page_load",eventData:{url:window.location.href,referrer:document.referrer,...t.urlParams},stockCode:t.stockCode,stockName:t.stockName,gclid:t.urlParams.gclid})}catch(s){console.error("Tracking error:",s)}},async trackDiagnosisClick(t){try{const s=J();await k.post("/api/tracking/event",{sessionId:s,eventType:"diagnosis_click",eventData:{stock_code:t.stockCode,stock_name:t.stockName,duration_ms:t.durationMs},stockCode:t.stockCode,stockName:t.stockName,durationMs:t.durationMs})}catch(s){console.error("Tracking error:",s)}},async trackConversion(t){try{const s=J();await k.post("/api/tracking/event",{sessionId:s,eventType:"conversion",eventData:{gclid:t.gclid,conversion_time:new Date().toISOString()},gclid:t.gclid})}catch(s){console.error("Tracking error:",s)}},async trackEvent(t){try{await k.post("/api/tracking/event",{sessionId:t.sessionId,eventType:t.eventType,stockCode:t.stockCode,stockName:t.stockName,eventData:t.eventData})}catch(s){console.error("Tracking error:",s)}},getSessionId(){return J()}};let B=!1,N=null;async function ct(){if(!B)try{const s=await(await fetch("/api/google-tracking")).json();if(!s.success||!s.config||!s.config.is_enabled){console.log("[Google Tracking] Tracking is disabled or not configured");return}N=s.config,N.ga4_measurement_id&&(await dt(N.ga4_measurement_id),console.log("[Google Tracking] GA4 initialized:",N.ga4_measurement_id)),N.google_ads_conversion_id&&(await mt(N.google_ads_conversion_id),console.log("[Google Tracking] Google Ads initialized:",N.google_ads_conversion_id)),B=!0}catch(t){console.error("[Google Tracking] Failed to initialize:",t)}}function dt(t){return new Promise((s,n)=>{const r=document.createElement("script");r.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,r.async=!0,r.crossOrigin="anonymous",r.onload=()=>{window.dataLayer=window.dataLayer||[],window.gtag=function(){var i;(i=window.dataLayer)==null||i.push(arguments)},window.gtag("js",new Date),window.gtag("config",t),console.log("[Google Tracking] GA4 script loaded successfully"),s()},r.onerror=a=>{console.error("[Google Tracking] Failed to load GA4 script:",a),n(a)},document.head.appendChild(r)})}function mt(t){return new Promise((s,n)=>{if(window.gtag)window.gtag("config",t),console.log("[Google Tracking] Google Ads configured using existing gtag"),s();else{const r=document.createElement("script");r.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,r.async=!0,r.crossOrigin="anonymous",r.onload=()=>{window.dataLayer=window.dataLayer||[],window.gtag=function(){var i;(i=window.dataLayer)==null||i.push(arguments)},window.gtag("js",new Date),window.gtag("config",t),console.log("[Google Tracking] Google Ads script loaded successfully"),s()},r.onerror=a=>{console.error("[Google Tracking] Failed to load Google Ads script:",a),n(a)},document.head.appendChild(r)}})}function ut(){if(!B||!N){console.warn("[Google Tracking] Tracking not initialized");return}try{N.conversion_action_id&&window.gtag&&(window.gtag("event","conversion",{send_to:N.conversion_action_id}),console.log("[Google Tracking] Conversion tracked:",N.conversion_action_id)),N.ga4_measurement_id&&window.gtag&&(window.gtag("event","line_conversion",{event_category:"engagement",event_label:"LINE CTA Click"}),console.log("[Google Tracking] GA4 event tracked: line_conversion"))}catch(t){console.error("[Google Tracking] Failed to track conversion:",t)}}function xt(){if(!B||!window.gtag){console.warn("[Google Tracking] Tracking not initialized");return}try{window.gtag("event","Bdd"),console.log("[Google Tracking] Diagnosis button click tracked: Bdd")}catch(t){console.error("[Google Tracking] Failed to track diagnosis button click:",t)}}function gt(){if(!B||!window.gtag){console.warn("[Google Tracking] Tracking not initialized");return}try{window.gtag("event","Add"),console.log("[Google Tracking] Conversion button click tracked: Add")}catch(t){console.error("[Google Tracking] Failed to track conversion button click:",t)}}const ht=[{time:"1分前",stock:"トヨタ自動車 (7203)",icon:"👨"},{time:"3分前",stock:"ソニーグループ (6758)",icon:"👩"},{time:"5分前",stock:"任天堂 (7974)",icon:"👨"},{time:"7分前",stock:"ソフトバンクグループ (9984)",icon:"👩"},{time:"10分前",stock:"キーエンス (6861)",icon:"👨"},{time:"12分前",stock:"三菱UFJフィナンシャル (8306)",icon:"👩"},{time:"15分前",stock:"ファーストリテイリング (9983)",icon:"👨"},{time:"18分前",stock:"東京エレクトロン (8035)",icon:"👩"},{time:"20分前",stock:"リクルートホールディングス (6098)",icon:"👨"},{time:"23分前",stock:"KDDI (9433)",icon:"👩"},{time:"25分前",stock:"信越化学工業 (4063)",icon:"👨"},{time:"28分前",stock:"第一三共 (4568)",icon:"👩"},{time:"30分前",stock:"三菱商事 (8058)",icon:"👨"},{time:"33分前",stock:"ダイキン工業 (6367)",icon:"👩"},{time:"35分前",stock:"村田製作所 (6981)",icon:"👨"},{time:"38分前",stock:"オリエンタルランド (4661)",icon:"👩"},{time:"40分前",stock:"日本電信電話 (9432)",icon:"👨"},{time:"43分前",stock:"エムスリー (2413)",icon:"👩"},{time:"45分前",stock:"ダイキン工業 (6367)",icon:"👨"},{time:"48分前",stock:"日立製作所 (6501)",icon:"👩"}];function ft(){const t=ot(),{search:s,isLoading:n}=it(),[r,a]=l.useState(""),[i,d]=l.useState(""),[o,c]=l.useState(null),[p,w]=l.useState(!1),[h,b]=l.useState(null),[j,m]=l.useState("initial"),[f,z]=l.useState(""),[Y,Q]=l.useState(0),[ie,I]=l.useState(0),[le,F]=l.useState(!1),y=l.useRef(null),Z=l.useRef(!1),[ce,ee]=l.useState("");l.useEffect(()=>{if(t.code&&!n){Z.current=!0;const g=s(t.code);if(g.length>0){const u=g[0],v=`${u.code} ${u.name}`;a(u.code),d(v),G(u.code),ee("株式情報を自動入力しました"),setTimeout(()=>ee(""),2e3)}else a(t.code),d(t.code),G(t.code)}else t.code||(a(""),d(""))},[t.code,s,n]),l.useEffect(()=>{(async()=>{o&&await O.trackPageLoad({stockCode:r,stockName:o.info.name,urlParams:{src:t.src||"",gclid:t.gclid||"",racText:t.racText||"",code:t.code||""}})})()},[o,r,t]);const G=async g=>{const u=g.replace(/[^\d]/g,"");if(!u||!/^\d{4}$/.test(u)){c(null),a(u),b(null);return}w(!0),b(null);try{const v=await k.get(`/api/stock/data?code=${u}`);if(!v.ok){c(null),a(u),b(null);return}const x=await v.json();c(x),a(u),b(null)}catch{c(null),a(u),b(null)}finally{w(!1)}},de=(g,u)=>{d(g+" "+u),a(g),G(g)};l.useEffect(()=>{if(Z.current){Z.current=!1;return}const g=setTimeout(()=>{i&&G(i)},500);return()=>clearTimeout(g)},[i]),l.useEffect(()=>()=>{y.current&&clearInterval(y.current)},[]);const me=async()=>{var v;if(j!=="initial"||!r||!o)return;xt(),m("connecting"),Q(Date.now()),z(""),I(0),F(!0);const g=2e3,u=Date.now();y.current&&clearInterval(y.current),y.current=setInterval(()=>{I(x=>x<85?x+Math.random()*15:x<95?x+Math.random()*2:x)},100);try{const x="/api/gemini/diagnosis",S=new AbortController,D=setTimeout(()=>S.abort(),5e4),C=await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:r,stockData:o?{name:o.info.name,price:o.info.price,change:o.info.change,changePercent:o.info.changePercent,per:o.info.per,pbr:o.info.pbr,dividend:o.info.dividend,industry:o.info.industry,marketCap:o.info.marketCap}:null}),signal:S.signal});if(clearTimeout(D),y.current&&(clearInterval(y.current),y.current=null),!C.ok)throw new Error("AI分析に失敗しました");m("processing");const R=C.headers.get("content-type");if(R!=null&&R.includes("text/event-stream")){const E=(v=C.body)==null?void 0:v.getReader(),K=new TextDecoder;let P="",$=!0;if(!E)throw new Error("ストリーム読み取りに失敗しました");for(;;){const{done:he,value:fe}=await E.read();if(he)break;const pe=K.decode(fe,{stream:!0}).split(` `).filter(V=>V.trim()!=="");for(const V of pe)if(V.startsWith("data: ")){const be=V.slice(6);try{const L=JSON.parse(be);if(L.error)throw new Error(L.error);if(L.content){if(P+=L.content,$&&P.trim().length>0){I(100);const X=Date.now()-u,we=Math.max(0,g-X);setTimeout(()=>{F(!1),m("streaming")},we+300),$=!1}z(P)}if(L.done){m("results");const X=Date.now()-Y;await O.trackDiagnosisClick({stockCode:i,stockName:(o==null?void 0:o.info.name)||i,durationMs:X})}}catch(L){console.error("Error parsing SSE data:",L)}}}}else{const E=await C.json();if(!E.analysis||E.analysis.trim()==="")throw new Error("分析結果が生成されませんでした");z(E.analysis);const K=Date.now()-u,P=Math.max(0,g-K);setTimeout(()=>{F(!1),m("results")},P+300);const $=Date.now()-Y;await O.trackDiagnosisClick({stockCode:i,stockName:(o==null?void 0:o.info.name)||i,durationMs:$})}}catch(x){console.error("Diagnosis error:",x);let S="分析中にエラーが発生しました",D="";if(x instanceof Error)if(x.name==="AbortError")S="リクエストがタイムアウトしました",D="接続に時間がかかりすぎています。もう一度お試しください。";else{S=x.message;try{const E=JSON.parse(x.message);E.details&&(D=E.details)}catch{D=x.message}}b(`${S}${D?` 詳細: ${D}`:""}`);const C=Date.now()-u,R=Math.max(0,2e3-C);setTimeout(()=>{m("error"),F(!1),I(0),y.current&&(clearInterval(y.current),y.current=null)},R)}},ue=async()=>{try{if(!window.confirm(`【外部サイトへの移動】 これからLINE公式アプリまたはLINE公式サイト(第三者サービス)に移動します。 LINEは当サービスとは独立した別のサービスです。 LINE公式アカウントを友だち追加すると、毎日最新の株式分析レポートを受け取ることができます。 ※ 当サービスは完全無料です。LINEへの移動後も追加料金は一切かかりません。 LINEアプリに移動しますか?`)){console.log("User cancelled LINE redirect");return}gt();const u=await k.get("/api/line-redirects/select");if(!u.ok){console.error("Failed to get LINE redirect link"),alert("LINEリンクの取得に失敗しました。しばらくしてからもう一度お試しください。");return}const v=await u.json();if(!v.success||!v.link){console.error("No active LINE redirect links available"),alert("現在利用可能なLINEリンクがありません。");return}const x=v.link.redirect_url;if(ut(),navigator.sendBeacon){const S=JSON.stringify({sessionId:sessionStorage.getItem("sessionId")||"",eventType:"conversion",gclid:t.gclid,eventData:{conversion_time:new Date().toISOString()}});navigator.sendBeacon("/api/tracking/event",S)}else await O.trackConversion({gclid:t.gclid});console.log("LINE conversion tracked successfully"),window.location.href=x}catch(g){console.error("LINE conversion error:",g),alert("操作に失敗しました。しばらくしてからもう一度お試しください。")}},xe=async()=>{try{const g=await k.get("/api/line-redirects/select");let u="";if(g.ok){const x=await g.json();x.success&&x.link&&(u=x.link.redirect_url)}const{generateDiagnosisReport:v}=await A(async()=>{const{generateDiagnosisReport:x}=await import("./reportGenerator-Cy0VNaOh.js");return{generateDiagnosisReport:x}},__vite__mapDeps([0,1,2]));await v({stockCode:r,stockName:(o==null?void 0:o.info.name)||"",analysis:f,lineRedirectUrl:u}),await O.trackEvent({sessionId:sessionStorage.getItem("sessionId")||"",eventType:"report_download",stockCode:r,stockName:(o==null?void 0:o.info.name)||"",eventData:{reportFormat:"docx",timestamp:new Date().toISOString()}}),console.log("Report download tracked successfully")}catch(g){console.error("Report download error:",g),alert("レポートのダウンロードに失敗しました。もう一度お試しください。")}},ge=()=>{m("initial"),z(""),I(0),F(!1),Q(0),b(null),a(""),d(""),c(null),y.current&&(clearInterval(y.current),y.current=null)};return e.jsxs("div",{className:"relative flex flex-col",children:[e.jsx(qe,{}),e.jsxs("div",{className:"relative z-10 flex flex-col",children:[e.jsx(Ze,{}),le?e.jsx("div",{className:"flex-1 flex items-center justify-center py-4",children:e.jsx(tt,{progress:ie})}):e.jsx("div",{className:"flex-1 flex flex-col py-2",children:e.jsxs("div",{className:"container mx-auto space-y-2",children:[e.jsx(Ke,{records:ht}),e.jsx(Xe,{}),e.jsxs(Ye,{children:[e.jsx(Qe,{value:i,onChange:d,onSelect:de,suggestions:s(i),autoFillMessage:ce}),p&&e.jsxs("div",{className:"text-center py-2 animate-fadeIn",children:[e.jsx("div",{className:"inline-block animate-spin rounded-full h-10 w-10 border-4 border-emerald-200 border-t-emerald-500"}),e.jsx("p",{className:"mt-1 text-gray-600 text-sm",children:"株式情報を読み込み中..."})]}),h&&j!=="error"&&e.jsx("div",{className:"bg-gradient-to-r from-rose-50 to-pink-50 border border-rose-200 rounded-2xl p-4 text-center animate-fadeIn mt-2",children:e.jsx("p",{className:"text-rose-600 text-sm font-medium",children:h})}),!p&&j==="initial"&&e.jsx("div",{className:"mt-2",children:e.jsx(et,{onClick:me,disabled:!i||!r,icon:e.jsx(Be,{size:20}),children:"無料で情報を取得"})}),j==="error"&&e.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-pink-50 border-2 border-rose-300 rounded-2xl p-4 text-center animate-fadeIn mt-2",children:[e.jsx("h3",{className:"text-xl font-semibold text-rose-700 mb-2",children:"分析エラー"}),e.jsx("p",{className:"text-rose-600 text-sm mb-4 whitespace-pre-line",children:h}),e.jsx("button",{onClick:()=>{m("initial"),b(null)},className:"px-8 py-3 bg-gradient-to-r from-gray-600 to-gray-700 text-white font-semibold rounded-full transition-all shadow-lg hover:scale-105 active:scale-95",children:"もう一度試す"})]})]})]})})]}),e.jsx(st,{isOpen:j==="streaming"||j==="results",onClose:ge,title:"AI分析結果",children:e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-center gap-3 mb-3 pb-3 border-b border-gray-100",children:[e.jsx("h3",{className:"text-2xl font-bold text-gray-800 mb-1",children:o==null?void 0:o.info.name}),e.jsxs("p",{className:"text-sm text-gray-500",children:["銘柄コード: ",r]})]}),e.jsx("div",{className:"prose max-w-none",children:e.jsx(nt,{text:f})}),j==="results"&&e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100 space-y-2",children:[e.jsx("button",{onClick:ue,className:"w-full h-14 px-8 rounded-full font-semibold text-white text-base transition-all duration-300 hover:scale-[1.02] active:scale-[0.98]",style:{background:"linear-gradient(135deg, #06C755 0%, #00B900 100%)",boxShadow:"0 4px 16px rgba(6, 199, 85, 0.4)"},children:"LINE公式アカウントで最新情報を受け取る"}),e.jsx("button",{onClick:xe,className:"w-full h-14 px-8 rounded-full font-semibold text-gray-700 text-base border-2 border-gray-200 transition-all duration-300 hover:border-emerald-300 hover:bg-emerald-50",children:"分析レポートをダウンロード"})]})]})})]})}const pt=l.lazy(()=>A(()=>import("./Contact-BoAWtp_f.js"),__vite__mapDeps([3,4,5,6,2]))),bt=l.lazy(()=>A(()=>import("./Privacy-DvZG0rd9.js"),__vite__mapDeps([7,4,6,2]))),wt=l.lazy(()=>A(()=>import("./Terms-ul8VUbcy.js"),__vite__mapDeps([8,4,6,2]))),yt=l.lazy(()=>A(()=>import("./SpecifiedCommercialTransactionAct-Bj9cnpP5.js"),__vite__mapDeps([9,4,10,6,2]))),vt=l.lazy(()=>A(()=>import("./CompanyInfo-kS5UDhpM.js"),__vite__mapDeps([11,4,10,6,2]))),jt=l.lazy(()=>A(()=>import("./AdminLogin-hjg_mHXi.js"),__vite__mapDeps([12,2,6,13]))),kt=l.lazy(()=>A(()=>import("./AdminDashboard-i3bVv6l4.js"),__vite__mapDeps([14,2,5,13,6])));function Nt(){return l.useEffect(()=>{ct()},[]),e.jsxs(e.Fragment,{children:[e.jsx(l.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-4 border-gray-200 border-t-gray-900"})}),children:e.jsxs(je,{children:[e.jsx(_,{path:"/",element:e.jsx(ft,{})}),e.jsx(_,{path:"/contact",element:e.jsx(pt,{})}),e.jsx(_,{path:"/privacy",element:e.jsx(bt,{})}),e.jsx(_,{path:"/terms",element:e.jsx(wt,{})}),e.jsx(_,{path:"/specified-commercial-transaction-act",element:e.jsx(yt,{})}),e.jsx(_,{path:"/company",element:e.jsx(vt,{})}),e.jsx(_,{path:"/adsadmin",element:e.jsx(jt,{})}),e.jsx(_,{path:"/adsadmin/dashboard",element:e.jsx(Je,{children:e.jsx(kt,{})})})]})}),e.jsx(Ge,{})]})}oe(document.getElementById("root")).render(e.jsx(l.StrictMode,{children:e.jsx(ke,{children:e.jsx(Nt,{})})}));export{Fe as F,Re as M,Oe as S,ze as X,He as a,k as b,T as c,Me as d,e as j};