@mbubela/oaa-assistant 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/bundles/web-components.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ ${t.map((n,r)=>`${r+1}) ${n.toString()}`).join(`
|
|
|
37
37
|
</clipPath>
|
|
38
38
|
</defs>`},menu:{viewBox:"0 0 16 16",path:'<path d="M2 3.5C2 3.22386 2.22386 3 2.5 3H13.5C13.7761 3 14 3.22386 14 3.5C14 3.77614 13.7761 4 13.5 4H2.5C2.22386 4 2 3.77614 2 3.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H13.5C13.7761 7 14 7.22386 14 7.5C14 7.77614 13.7761 8 13.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 11.5C2 11.2239 2.22386 11 2.5 11H13.5C13.7761 11 14 11.2239 14 11.5C14 11.7761 13.7761 12 13.5 12H2.5C2.22386 12 2 11.7761 2 11.5Z" fill="currentColor"/>'},"list-selection":{viewBox:"0 0 16 16",path:'<path d="M2 3.5C2 3.22386 2.22386 3 2.5 3H10.5C10.7761 3 11 3.22386 11 3.5C11 3.77614 10.7761 4 10.5 4H2.5C2.22386 4 2 3.77614 2 3.5ZM2 11.5C2 11.2239 2.22386 11 2.5 11H9.5C9.77614 11 10 11.2239 10 11.5C10 11.7761 9.77614 12 9.5 12H2.5C2.22386 12 2 11.7761 2 11.5ZM2.5 7C2.22386 7 2 7.22386 2 7.5C2 7.77614 2.22386 8 2.5 8H13.5C13.7761 8 14 7.77614 14 7.5C14 7.22386 13.7761 7 13.5 7H2.5Z" fill="currentColor"/>'},close:{viewBox:"0 0 16 16",path:'<path d="M8.70701 8.00001L12.353 4.35401C12.548 4.15901 12.548 3.84201 12.353 3.64701C12.158 3.45201 11.841 3.45201 11.646 3.64701L8.00001 7.29301L4.35401 3.64701C4.15901 3.45201 3.84201 3.45201 3.64701 3.64701C3.45201 3.84201 3.45201 4.15901 3.64701 4.35401L7.29301 8.00001L3.64701 11.646C3.45201 11.841 3.45201 12.158 3.64701 12.353C3.74501 12.451 3.87301 12.499 4.00101 12.499C4.12901 12.499 4.25701 12.45 4.35501 12.353L8.00101 8.70701L11.647 12.353C11.745 12.451 11.873 12.499 12.001 12.499C12.129 12.499 12.257 12.45 12.355 12.353C12.55 12.158 12.55 11.841 12.355 11.646L8.70901 8.00001H8.70701Z" fill="currentColor"/>'},add:{viewBox:"0 0 16 16",path:'<path d="M8 1.5C8 1.22386 7.77614 1 7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5C1 7.77614 1.22386 8 1.5 8H7V13.5C7 13.7761 7.22386 14 7.5 14C7.77614 14 8 13.7761 8 13.5V8H13.5C13.7761 8 14 7.77614 14 7.5C14 7.22386 13.7761 7 13.5 7H8V1.5Z" fill="currentColor"/>'},microphone:{viewBox:"0 0 16 16",path:'<g transform="scale(0.75, 1) translate(2.67, 0)"><path d="M8 10.9995C9.654 10.9995 11 9.65351 11 7.99951V3.99951C11 2.34551 9.654 0.999512 8 0.999512C6.346 0.999512 5 2.34551 5 3.99951V7.99951C5 9.65351 6.346 10.9995 8 10.9995ZM13 7.49951V7.99951C13 10.5855 11.02 12.6935 8.5 12.9485V14.4995C8.5 14.7755 8.276 14.9995 8 14.9995C7.724 14.9995 7.5 14.7755 7.5 14.4995V12.9485C4.98 12.6935 3 10.5845 3 7.99951V7.49951C3 7.22351 3.224 6.99951 3.5 6.99951C3.776 6.99951 4 7.22351 4 7.49951V7.99951C4 10.2055 5.794 11.9995 8 11.9995C10.206 11.9995 12 10.2055 12 7.99951V7.49951C12 7.22351 12.224 6.99951 12.5 6.99951C12.776 6.99951 13 7.22351 13 7.49951Z" fill="currentColor"/></g>'},"send-filled":{viewBox:"0 0 16 16",path:`<circle cx="8" cy="8" r="7" fill="currentColor"/>
|
|
39
39
|
<path d="M5.14645 7.14645L7.64645 4.64645C7.84171 4.45118 8.15829 4.45118 8.35355 4.64645L10.8536 7.14645C11.0488 7.34171 11.0488 7.65829 10.8536 7.85355C10.6583 8.04882 10.3417 8.04882 10.1464 7.85355L8.5 6.20711V11C8.5 11.2761 8.27614 11.5 8 11.5C7.72386 11.5 7.5 11.2761 7.5 11V6.20711L5.85355 7.85355C5.65829 8.04882 5.34171 8.04882 5.14645 7.85355C4.95118 7.65829 4.95118 7.34171 5.14645 7.14645Z" fill="white"/>`},send:{viewBox:"0 0 16 16",path:'<path d="M1.17683 1.11898C1.32953 0.989634 1.54464 0.963786 1.72363 1.05328L14.7236 7.55328C14.893 7.63797 15 7.8111 15 8.00049C15 8.18987 14.893 8.36301 14.7236 8.4477L1.72363 14.9477C1.54464 15.0372 1.32953 15.0113 1.17683 14.882C1.02414 14.7526 0.96328 14.5447 1.02213 14.3534L2.97688 8.00049L1.02213 1.64754C0.96328 1.45627 1.02414 1.24833 1.17683 1.11898ZM3.8693 8.50049L2.32155 13.5307L13.382 8.00049L2.32155 2.47027L3.8693 7.50049H9.50001C9.77615 7.50049 10 7.72435 10 8.00049C10 8.27663 9.77615 8.50049 9.50001 8.50049H3.8693Z" fill="currentColor"/>'},back:{viewBox:"0 0 16 16",path:'<path d="M13.5 8.5C13.7761 8.5 14 8.27614 14 8C14 7.72386 13.7761 7.5 13.5 7.5L3.80298 7.5L7.83448 3.87165C8.03974 3.68692 8.05638 3.37078 7.87165 3.16552C7.68692 2.96027 7.37077 2.94363 7.16552 3.12836L2.16552 7.62835C2.06016 7.72317 2 7.85826 2 8C2 8.14174 2.06016 8.27683 2.16552 8.37165L7.16552 12.8716C7.37077 13.0564 7.68692 13.0397 7.87165 12.8345C8.05638 12.6292 8.03974 12.3131 7.83448 12.1283L3.80298 8.5L13.5 8.5Z" fill="currentColor"/>'},settings:{viewBox:"0 0 16 16",path:'<path d="M6 9.5C6.93191 9.5 7.71496 10.1374 7.93699 11L13.5 11C13.7761 11 14 11.2239 14 11.5C14 11.7455 13.8231 11.9496 13.5899 11.9919L13.5 12L7.93673 12.001C7.71435 12.8631 6.93155 13.5 6 13.5C5.06845 13.5 4.28565 12.8631 4.06327 12.001L2.5 12C2.22386 12 2 11.7761 2 11.5C2 11.2545 2.17688 11.0504 2.41012 11.0081L2.5 11L4.06301 11C4.28504 10.1374 5.06809 9.5 6 9.5ZM6 10.5C5.44772 10.5 5 10.9477 5 11.5C5 12.0523 5.44772 12.5 6 12.5C6.55228 12.5 7 12.0523 7 11.5C7 10.9477 6.55228 10.5 6 10.5ZM10 2.5C10.9319 2.5 11.715 3.13738 11.937 3.99998L13.5 4C13.7761 4 14 4.22386 14 4.5C14 4.74546 13.8231 4.94961 13.5899 4.99194L13.5 5L11.9367 5.00102C11.7144 5.86312 10.9316 6.5 10 6.5C9.06845 6.5 8.28565 5.86312 8.06327 5.00102L2.5 5C2.22386 5 2 4.77614 2 4.5C2 4.25454 2.17688 4.05039 2.41012 4.00806L2.5 4L8.06301 3.99998C8.28504 3.13738 9.06809 2.5 10 2.5ZM10 3.5C9.44772 3.5 9 3.94772 9 4.5C9 5.05228 9.44772 5.5 10 5.5C10.5523 5.5 11 5.05228 11 4.5C11 3.94772 10.5523 3.5 10 3.5Z" fill="currentColor"/>'},"settings-gear":{viewBox:"0 0 16 16",path:'<path d="M7.99997 6C6.89497 6 5.99997 6.895 5.99997 8C5.99997 9.105 6.89497 10 7.99997 10C9.10497 10 9.99997 9.105 9.99997 8C9.99997 6.895 9.10497 6 7.99997 6ZM7.99997 9C7.44797 9 6.99997 8.552 6.99997 8C6.99997 7.448 7.44797 7 7.99997 7C8.55197 7 8.99997 7.448 8.99997 8C8.99997 8.552 8.55197 9 7.99997 9ZM14.565 9.715L13.279 8.628C13.245 8.599 13.213 8.567 13.184 8.533C12.888 8.186 12.931 7.667 13.279 7.372L14.565 6.285C14.693 6.177 14.742 6.003 14.691 5.844C14.386 4.903 13.882 4.04 13.219 3.308C13.139 3.22 13.027 3.172 12.912 3.172C12.865 3.172 12.818 3.18 12.773 3.196L11.186 3.761C11.144 3.776 11.1 3.788 11.056 3.796C11.006 3.805 10.956 3.81 10.907 3.81C10.515 3.81 10.167 3.532 10.094 3.134L9.79097 1.482C9.76097 1.318 9.63397 1.188 9.46997 1.153C8.98997 1.051 8.49897 1 8.00097 1C7.50297 1 7.01097 1.052 6.53097 1.153C6.36697 1.188 6.23997 1.318 6.20997 1.482L5.90797 3.134C5.89997 3.178 5.88797 3.221 5.87297 3.263C5.75197 3.6 5.43397 3.81 5.09397 3.81C5.00197 3.81 4.90797 3.794 4.81597 3.762L3.22897 3.197C3.18397 3.181 3.13597 3.173 3.08997 3.173C2.97497 3.173 2.86297 3.221 2.78297 3.309C2.11897 4.041 1.61597 4.904 1.30997 5.845C1.25797 6.004 1.30797 6.178 1.43597 6.286L2.72197 7.373C2.75597 7.402 2.78797 7.434 2.81697 7.468C3.11297 7.815 3.06997 8.334 2.72197 8.629L1.43597 9.716C1.30797 9.824 1.25897 9.998 1.30997 10.157C1.61497 11.098 2.11897 11.961 2.78297 12.693C2.86297 12.781 2.97497 12.829 3.08997 12.829C3.13697 12.829 3.18397 12.821 3.22897 12.805L4.81597 12.24C4.85797 12.225 4.90197 12.213 4.94597 12.205C4.99597 12.196 5.04597 12.192 5.09497 12.192C5.48697 12.192 5.83497 12.47 5.90797 12.868L6.20997 14.52C6.23997 14.684 6.36697 14.814 6.53097 14.849C7.01097 14.951 7.50297 15.002 8.00097 15.002C8.49897 15.002 8.99097 14.95 9.46997 14.849C9.63397 14.814 9.76097 14.684 9.79097 14.52L10.094 12.868C10.102 12.824 10.114 12.781 10.129 12.739C10.25 12.402 10.568 12.192 10.908 12.192C11 12.192 11.094 12.208 11.186 12.24L12.772 12.805C12.818 12.821 12.865 12.829 12.911 12.829C13.026 12.829 13.138 12.781 13.218 12.693C13.882 11.961 14.385 11.098 14.69 10.157C14.742 9.998 14.692 9.824 14.564 9.716L14.565 9.715ZM12.728 11.726L11.521 11.296C11.323 11.226 11.117 11.19 10.908 11.19C10.139 11.19 9.44697 11.676 9.18797 12.399C9.15397 12.492 9.12897 12.588 9.11097 12.686L8.88097 13.937C8.59097 13.979 8.29597 14 8.00097 14C7.70597 14 7.41097 13.979 7.11997 13.936L6.89097 12.685C6.73197 11.818 5.97697 11.189 5.09497 11.189C4.98697 11.189 4.87697 11.199 4.76597 11.219C4.66897 11.237 4.57397 11.262 4.47997 11.295L3.27297 11.725C2.90497 11.264 2.61097 10.759 2.39397 10.214L3.36797 9.391C3.74097 9.076 3.96797 8.634 4.00797 8.148C4.04797 7.662 3.89497 7.19 3.57797 6.818C3.51397 6.743 3.44297 6.672 3.36797 6.608L2.39397 5.785C2.61097 5.24 2.90497 4.734 3.27297 4.274L4.47997 4.704C4.67797 4.774 4.88397 4.81 5.09397 4.81C5.86297 4.81 6.55497 4.324 6.81397 3.601C6.84797 3.507 6.87297 3.411 6.89097 3.314L7.11997 2.063C7.41097 2.021 7.70597 1.999 8.00097 1.999C8.29597 1.999 8.59097 2.02 8.88097 2.062L9.10997 3.313C9.26897 4.18 10.024 4.809 10.906 4.809C11.014 4.809 11.124 4.799 11.234 4.779C11.331 4.761 11.427 4.736 11.521 4.703L12.728 4.273C13.096 4.733 13.39 5.239 13.607 5.784L12.634 6.607C12.261 6.922 12.033 7.364 11.994 7.85C11.954 8.336 12.107 8.809 12.424 9.18C12.489 9.256 12.559 9.326 12.635 9.39L13.609 10.213C13.392 10.758 13.098 11.264 12.73 11.724L12.728 11.726Z" fill="currentColor"/>'},"stop-circle-filled":{viewBox:"0 0 16 16",path:`<circle cx="8" cy="8" r="7" fill="currentColor"/>
|
|
40
|
-
<rect x="5.5" y="5.5" width="5" height="5" rx="0.5" fill="white"/>`},trash:{viewBox:"0 0 16 16",path:'<path d="M14 2H10C10 0.897 9.103 0 8 0C6.897 0 6 0.897 6 2H2C1.724 2 1.5 2.224 1.5 2.5C1.5 2.776 1.724 3 2 3H2.54L3.349 12.708C3.456 13.994 4.55 15 5.84 15H10.159C11.449 15 12.543 13.993 12.65 12.708L13.459 3H13.999C14.275 3 14.499 2.776 14.499 2.5C14.499 2.224 14.275 2 13.999 2H14ZM8 1C8.551 1 9 1.449 9 2H7C7 1.449 7.449 1 8 1ZM11.655 12.625C11.591 13.396 10.934 14 10.16 14H5.841C5.067 14 4.41 13.396 4.346 12.625L3.544 3H12.458L11.656 12.625H11.655ZM7 5.5V11.5C7 11.776 6.776 12 6.5 12C6.224 12 6 11.776 6 11.5V5.5C6 5.224 6.224 5 6.5 5C6.776 5 7 5.224 7 5.5ZM10 5.5V11.5C10 11.776 9.776 12 9.5 12C9.224 12 9 11.776 9 11.5V5.5C9 5.224 9.224 5 9.5 5C9.776 5 10 5.224 10 5.5Z" fill="currentColor"/>'},search:{viewBox:"0 0 16 16",path:'<path d="M10.0195 10.7266C9.06578 11.5217 7.83875 12 6.5 12C3.46243 12 1 9.53757 1 6.5C1 3.46243 3.46243 1 6.5 1C9.53757 1 12 3.46243 12 6.5C12 7.83875 11.5217 9.06578 10.7266 10.0195L13.8535 13.1464C14.0488 13.3417 14.0488 13.6583 13.8535 13.8536C13.6583 14.0488 13.3417 14.0488 13.1464 13.8536L10.0195 10.7266ZM11 6.5C11 4.01472 8.98528 2 6.5 2C4.01472 2 2 4.01472 2 6.5C2 8.98528 4.01472 11 6.5 11C8.98528 11 11 8.98528 11 6.5Z" fill="currentColor"/>'},edit:{viewBox:"0 0 16 16",path:'<path d="M14.236 1.76386C13.2123 0.740172 11.5525 0.740171 10.5289 1.76386L2.65722 9.63549C2.28304 10.0097 2.01623 10.4775 1.88467 10.99L1.01571 14.3755C0.971767 14.5467 1.02148 14.7284 1.14646 14.8534C1.27144 14.9783 1.45312 15.028 1.62432 14.9841L5.00978 14.1151C5.52234 13.9836 5.99015 13.7168 6.36433 13.3426L14.236 5.47097C15.2596 4.44728 15.2596 2.78755 14.236 1.76386ZM11.236 2.47097C11.8691 1.8378 12.8957 1.8378 13.5288 2.47097C14.162 3.10413 14.162 4.1307 13.5288 4.76386L12.75 5.54269L10.4571 3.24979L11.236 2.47097ZM9.75002 3.9569L12.0429 6.24979L5.65722 12.6355C5.40969 12.883 5.10023 13.0595 4.76117 13.1465L2.19447 13.8053L2.85327 11.2386C2.9403 10.8996 3.1168 10.5901 3.36433 10.3426L9.75002 3.9569Z" fill="currentColor"/>'},"edit-code":{viewBox:"0 0 20 20",path:'<g clip-path="url(#clip0_edit_code)"><path d="M2.5 15V5C2.5 4.33696 2.76339 3.70107 3.23223 3.23223C3.70107 2.76339 4.33696 2.5 5 2.5H15C15.663 2.5 16.2989 2.76339 16.7678 3.23223C17.2366 3.70107 17.5 4.33696 17.5 5V7.51375C17.555 7.51125 17.6075 7.4975 17.6625 7.4975C18.0388 7.4975 18.4013 7.57125 18.75 7.6825V5C18.75 4.00544 18.3549 3.05161 17.6517 2.34835C16.9484 1.64509 15.9946 1.25 15 1.25H5C4.00544 1.25 3.05161 1.64509 2.34835 2.34835C1.64509 3.05161 1.25 4.00544 1.25 5V15C1.25 15.9946 1.64509 16.9484 2.34835 17.6517C3.05161 18.3549 4.00544 18.75 5 18.75H7.51125C7.52 18.605 7.53375 18.4587 7.56875 18.3137L7.7725 17.5H5C4.33696 17.5 3.70107 17.2366 3.23223 16.7678C2.76339 16.2989 2.5 15.663 2.5 15ZM19.315 9.4325C19.0979 9.21536 18.8402 9.04312 18.5566 8.9256C18.2729 8.80808 17.9689 8.7476 17.6619 8.7476C17.3548 8.7476 17.0508 8.80808 16.7672 8.9256C16.4835 9.04312 16.2258 9.21536 16.0088 9.4325L9.9725 15.4688C9.62058 15.8209 9.37087 16.262 9.25 16.745L8.7825 18.6175C8.73601 18.8038 8.73853 18.999 8.78983 19.184C8.84113 19.3691 8.93946 19.5377 9.07525 19.6735C9.21103 19.8093 9.37965 19.9076 9.5647 19.9589C9.74975 20.0102 9.94493 20.0127 10.1313 19.9662L12.0038 19.4975C12.4867 19.3766 12.9278 19.1269 13.28 18.775L19.3163 12.7388C20.2288 11.8263 20.2288 10.3462 19.3163 9.4325H19.315Z" fill="currentColor"/></g>',defs:'<defs><clipPath id="clip0_edit_code"><rect width="20" height="20" fill="white"/></clipPath></defs>'},check:{viewBox:"0 0 16 16",path:'<path d="M13.6572 3.13573C13.8583 2.9465 14.175 2.95614 14.3643 3.15722C14.5535 3.35831 14.5438 3.675 14.3428 3.86425L5.84277 11.8642C5.64597 12.0494 5.33756 12.0446 5.14648 11.8535L1.64648 8.35351C1.45121 8.15824 1.45121 7.84174 1.64648 7.64647C1.84174 7.45121 2.15825 7.45121 2.35351 7.64647L5.50976 10.8027L13.6572 3.13573Z" fill="currentColor"/>'},"chevron-left":{viewBox:"0 0 16 16",path:'<path d="M10.3536 3.14645C10.5488 3.34171 10.5488 3.65829 10.3536 3.85355L6.20711 8L10.3536 12.1464C10.5488 12.3417 10.5488 12.6583 10.3536 12.8536C10.1583 13.0488 9.84171 13.0488 9.64645 12.8536L5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L9.64645 3.14645C9.84171 2.95118 10.1583 2.95118 10.3536 3.14645Z" fill="currentColor"/>'},"more-horizontal":{viewBox:"0 0 16 16",path:'<path d="M5 8C5 8.55229 4.55228 9 4 9C3.44772 9 3 8.55229 3 8C3 7.44772 3.44772 7 4 7C4.55228 7 5 7.44772 5 8ZM9 8C9 8.55229 8.55229 9 8 9C7.44772 9 7 8.55229 7 8C7 7.44772 7.44772 7 8 7C8.55229 7 9 7.44772 9 8ZM12 9C12.5523 9 13 8.55229 13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8C11 8.55229 11.4477 9 12 9Z" fill="currentColor"/>'},copy:{viewBox:"0 0 16 16",path:'<path d="M3 5V12.73C2.4 12.38 2 11.74 2 11V5C2 2.79 3.79 1 6 1H9C9.74 1 10.38 1.4 10.73 2H6C4.35 2 3 3.35 3 5ZM11 15H6C4.897 15 4 14.103 4 13V5C4 3.897 4.897 3 6 3H11C12.103 3 13 3.897 13 5V13C13 14.103 12.103 15 11 15ZM12 5C12 4.448 11.552 4 11 4H6C5.448 4 5 4.448 5 5V13C5 13.552 5.448 14 6 14H11C11.552 14 12 13.552 12 13V5Z" fill="currentColor"/>'},unmute:{viewBox:"0 0 16 16",path:'<path d="M8.69398 2.03934C8.8792 2.11749 8.99961 2.29898 8.99961 2.50001V13.5C8.99961 13.7014 8.87875 13.8832 8.693 13.9611C8.50725 14.039 8.29289 13.9978 8.14921 13.8567L5.22278 10.9817H3.49963C2.67121 10.9817 1.99963 10.3101 1.99963 9.48172V6.49273C1.99963 5.66431 2.67121 4.99273 3.49963 4.99273H5.22402L8.15073 2.14185C8.29474 2.00157 8.50875 1.96119 8.69398 2.03934ZM7.99961 3.68507L5.77617 5.85089C5.68281 5.94184 5.55763 5.99273 5.42729 5.99273H3.49963C3.22349 5.99273 2.99963 6.21659 2.99963 6.49273V9.48172C2.99963 9.75786 3.22349 9.98172 3.49963 9.98172H5.42729C5.55836 9.98172 5.68419 10.0332 5.77769 10.125L7.99961 12.3079V3.68507ZM10.1109 5.18874C10.2828 4.97264 10.5973 4.93682 10.8135 5.10873L10.8143 5.1094L10.8152 5.11015L10.8174 5.11188L10.8228 5.11628L10.8377 5.12882C10.8495 5.13885 10.8648 5.15224 10.8831 5.16904C10.9197 5.20261 10.9685 5.2499 11.0254 5.31119C11.1389 5.43362 11.2853 5.61296 11.4303 5.85143C11.7218 6.33096 12.0039 7.04439 12.0039 7.99855C12.0039 8.95268 11.7218 9.66687 11.4305 10.1471C11.2857 10.3859 11.1393 10.5657 11.0259 10.6884C10.9692 10.7498 10.9204 10.7973 10.8839 10.8309C10.8642 10.849 10.8441 10.8666 10.8236 10.8838L10.8152 10.8907L10.8143 10.8914C10.8143 10.8914 10.368 11.1337 10.1116 10.8129C9.94006 10.5983 9.97396 10.2858 10.1868 10.1128L10.1883 10.1115L10.1876 10.1122L10.1892 10.1108L10.1883 10.1115C10.1912 10.109 10.1975 10.1036 10.2066 10.0952C10.2248 10.0784 10.2543 10.05 10.2914 10.0098C10.3659 9.92923 10.47 9.80248 10.5755 9.62847C10.7851 9.28301 11.0039 8.74609 11.0039 7.99855C11.0039 7.25106 10.7851 6.71522 10.5758 6.3709C10.4703 6.19744 10.3663 6.07121 10.292 5.99105C10.2549 5.95104 10.2255 5.92278 10.2073 5.90613C10.1982 5.89781 10.192 5.89242 10.1891 5.88995L10.1901 5.89071C9.97439 5.71873 9.93908 5.40472 10.1109 5.18874ZM11.8127 3.10886C11.5966 2.93686 11.2821 2.97255 11.1101 3.18858C10.9382 3.40451 10.9743 3.71932 11.19 3.89138L11.2011 3.9006C11.2119 3.90975 11.2295 3.92484 11.2528 3.94582C11.2994 3.98781 11.369 4.05318 11.4538 4.14133C11.6239 4.31792 11.8537 4.58411 12.0841 4.93509C12.5446 5.63643 13.0029 6.66847 13.0029 8.00405C13.0029 9.33953 12.5446 10.3694 12.0845 11.0685C11.8541 11.4184 11.6244 11.6835 11.4545 11.8593C11.3697 11.947 11.3002 12.0121 11.2536 12.0538C11.2303 12.0747 11.2128 12.0897 11.202 12.0988L11.1904 12.1083L11.1895 12.1091C10.9742 12.2808 10.9382 12.5945 11.1093 12.8105C11.2808 13.0269 11.596 13.0628 11.8125 12.8913L11.8455 12.8642C11.864 12.8487 11.8895 12.8268 11.9209 12.7986C11.9838 12.7423 12.0707 12.6607 12.1735 12.5543C12.3789 12.3418 12.6496 12.0286 12.9197 11.6183C13.4604 10.797 14.0029 9.57884 14.0029 8.00405C14.0029 6.42934 13.4605 5.20938 12.9201 4.38627C12.6501 3.97503 12.3795 3.66089 12.1742 3.4477C12.0714 3.34097 11.9846 3.25908 11.9217 3.20255C11.8903 3.17426 11.8649 3.15228 11.8464 3.13665L11.8239 3.11798L11.8169 3.11222L11.8144 3.11024L11.8127 3.10886ZM10.1891 5.88995L10.1877 5.88874L10.1891 5.88995Z" fill="currentColor"/>'},"share-ios":{viewBox:"0 0 16 16",path:'<path d="M12.5713 8.50795V11.5556C12.5713 11.825 12.4509 12.0834 12.2366 12.2739C12.0223 12.4644 11.7316 12.5714 11.4285 12.5714H4.57132C4.26822 12.5714 3.97753 12.4644 3.7632 12.2739C3.54887 12.0834 3.42847 11.825 3.42847 11.5556V8.50795M7.9999 9.52383V3.42859M7.9999 3.42859L5.9999 5.20637M7.9999 3.42859L9.9999 5.20637" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none"/>'}},Lt=class $s{constructor(t){this.sanitizer=t}name="";width="24";height="24";fill="none";dropShadow="";get viewBox(){return Ul[this.name]?.viewBox||"0 0 24 24"}get svgContent(){let t=Ul[this.name];if(!t)return"";let n=t.path+(t.defs||"");return this.sanitizer.bypassSecurityTrustHtml(n)}static \u0275fac=function(t){return new(t||$s)(j(tp))};static \u0275cmp=Ae({type:$s,selectors:[["app-icon"]],inputs:{name:"name",width:"width",height:"height",fill:"fill",dropShadow:"dropShadow"},decls:1,vars:7,consts:[["xmlns","http://www.w3.org/2000/svg",3,"innerHTML"]],template:function(t,n){t&1&&(sg(),hh(0,"svg",0)),t&2&&(bh("filter",n.dropShadow),fh("innerHTML",n.svgContent,bd),sa("width",n.width)("height",n.height)("viewBox",n.viewBox)("fill",n.fill))},dependencies:[ke],styles:["[_nghost-%COMP%]{display:inline-block;line-height:0}"]})},me={TITLE:"App Agent",WELCOME:{GREETING:"Hi!",TEXT:"Welcome to Open as App!",DESCRIPTION:"I'm your AI assistant, and I'm here to help you get started.",PERSONALIZATION:"To personalize my guidance, could you tell me what you're hoping to do?"},INPUT:{PLACEHOLDER:"Ask me anything..."},SUGGESTIONS:["What is this app about?","Why use an AI Agent?","What will be possible?"],DATE:{LABELS:{TODAY:"Today",YESTERDAY:"Yesterday"},MONTH_NAMES:["January","February","March","April","May","June","July","August","September","October","November","December"]}},V5=class qs{title=me.TITLE;menuClick=new N;closeClick=new N;onMenuClick(){this.menuClick.emit()}onCloseClick(){this.closeClick.emit()}static \u0275fac=function(t){return new(t||qs)};static \u0275cmp=Ae({type:qs,selectors:[["app-header"]],inputs:{title:"title"},outputs:{menuClick:"menuClick",closeClick:"closeClick"},decls:9,vars:1,consts:[[1,"header"],["aria-label","Menu",1,"icon-button","menu-button",3,"click"],["name","list-selection","width","24","height","24"],[1,"header-title"],["name","header-rocket-icon","width","24","height","24",1,"title-icon"],["aria-label","Close",1,"icon-button","header-close-button",3,"click"],["name","close","width","24","height","24"]],template:function(t,n){t&1&&(f(0,"div",0)(1,"button",1),x("click",function(){return n.onMenuClick()}),H(2,"app-icon",2),m(),f(3,"div",3),H(4,"app-icon",4),f(5,"span"),z(6),m()(),f(7,"button",5),x("click",function(){return n.onCloseClick()}),H(8,"app-icon",6),m()()),t&2&&(_(6),be(n.title))},dependencies:[ke,Lt],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:#fff;border-bottom:1px solid #f0f0f0;min-height:56px;box-sizing:border-box;flex-shrink:0}@media (max-width: 768px){.header[_ngcontent-%COMP%]{min-height:52px;padding:10px 12px}}.icon-button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;border-radius:8px;transition:background-color .2s;color:#333}.icon-button[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.icon-button[_ngcontent-%COMP%]:active{background-color:#e0e0e0}.header-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:20px;font-weight:600;color:#f43e83;flex:1;justify-content:center}.title-icon[_ngcontent-%COMP%]{width:24px;height:24px}.menu-button[_ngcontent-%COMP%], .header-close-button[_ngcontent-%COMP%]{width:40px;height:40px}.header-close-button[_ngcontent-%COMP%]{background-color:#f5f5f5;border-radius:50%}.header-close-button[_ngcontent-%COMP%]:hover{background-color:#e8e8e8}"]})},R5=class Gs{text="";disabled=!1;buttonClick=new N;onClick(){this.disabled||this.buttonClick.emit(this.text)}static \u0275fac=function(t){return new(t||Gs)};static \u0275cmp=Ae({type:Gs,selectors:[["app-suggestion-button"]],inputs:{text:"text",disabled:"disabled"},outputs:{buttonClick:"buttonClick"},decls:2,vars:3,consts:[[1,"suggestion-button",3,"click"]],template:function(t,n){t&1&&(oa(0,"button",0),gh("click",function(){return n.onClick()}),z(1),aa()),t&2&&(Ie("disabled",n.disabled),_(),An(" ",n.text," "))},dependencies:[ke],styles:[".suggestion-button[_ngcontent-%COMP%]{background:#fff;border:1.5px solid #F43E83;border-radius:8px;padding:14px 24px;font-size:15px;font-weight:500;color:#f43e83;cursor:pointer;transition:all .2s ease;white-space:nowrap;box-shadow:0 2px 4px #0000000d;display:inline-block;width:auto;text-align:center}.suggestion-button[_ngcontent-%COMP%]:hover:not(.disabled){background:#fff5f5;border-color:#d42c6f;transform:translateY(-1px);box-shadow:0 4px 8px #f43e8326}.suggestion-button[_ngcontent-%COMP%]:active:not(.disabled){transform:translateY(0);box-shadow:0 2px 4px #0000000d}.suggestion-button.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed}"]})},rp=(()=>{class e{_renderer;_elementRef;onChange=n=>{};onTouched=()=>{};constructor(n,r){this._renderer=n,this._elementRef=r}setProperty(n,r){this._renderer.setProperty(this._elementRef.nativeElement,n,r)}registerOnTouched(n){this.onTouched=n}registerOnChange(n){this.onChange=n}setDisabledState(n){this.setProperty("disabled",n)}static \u0275fac=function(n){return new(n||e)(j(ea),j(Et))};static \u0275dir=_e({type:e})}return e})(),N5=(()=>{class e extends rp{static \u0275fac=(()=>{let n;return function(r){return(n||(n=Wc(e)))(r||e)}})();static \u0275dir=_e({type:e,features:[ln]})}return e})(),ip=new M(""),F5={provide:ip,useExisting:Vn(()=>$n),multi:!0};function H5(){let e=ei()?ei().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}var j5=new M(""),$n=(()=>{class e extends rp{_compositionMode;_composing=!1;constructor(n,r,i){super(n,r),this._compositionMode=i,this._compositionMode==null&&(this._compositionMode=!H5())}writeValue(n){let r=n??"";this.setProperty("value",r)}_handleInput(n){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(n)}_compositionStart(){this._composing=!0}_compositionEnd(n){this._composing=!1,this._compositionMode&&this.onChange(n)}static \u0275fac=function(n){return new(n||e)(j(ea),j(Et),j(j5,8))};static \u0275dir=_e({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(n,r){n&1&&x("input",function(i){return r._handleInput(i.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(i){return r._compositionEnd(i.target.value)})},standalone:!1,features:[ha([F5]),ln]})}return e})();function z5(e){return e==null?null:Array.isArray(e)||typeof e=="string"?e.length:e instanceof Set?e.size:null}var sp=new M(""),B5=new M("");function U5(e){return t=>{let n=t.value?.length??z5(t.value);return n!==null&&n>e?{maxlength:{requiredLength:e,actualLength:n}}:null}}function Zl(e){return null}function op(e){return e!=null}function ap(e){return ia(e)?po(e):e}function lp(e){let t={};return e.forEach(n=>{t=n!=null?T(T({},t),n):t}),Object.keys(t).length===0?null:t}function up(e,t){return t.map(n=>n(e))}function Z5(e){return!e.validate}function cp(e){return e.map(t=>Z5(t)?t:n=>t.validate(n))}function $5(e){if(!e)return null;let t=e.filter(op);return t.length==0?null:function(n){return lp(up(n,t))}}function dp(e){return e!=null?$5(cp(e)):null}function q5(e){if(!e)return null;let t=e.filter(op);return t.length==0?null:function(n){let r=up(n,t).map(ap);return Yf(r).pipe(Te(lp))}}function hp(e){return e!=null?q5(cp(e)):null}function $l(e,t){return e===null?[t]:Array.isArray(e)?[...e,t]:[e,t]}function G5(e){return e._rawValidators}function W5(e){return e._rawAsyncValidators}function Ws(e){return e?Array.isArray(e)?e:[e]:[]}function ni(e,t){return Array.isArray(e)?e.includes(t):e===t}function ql(e,t){let n=Ws(t);return Ws(e).forEach(r=>{ni(n,r)||n.push(r)}),n}function Gl(e,t){return Ws(t).filter(n=>!ni(e,n))}var pp=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=dp(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=hp(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,t){return this.control?this.control.hasError(e,t):!1}getError(e,t){return this.control?this.control.getError(e,t):null}},Q5=class extends pp{name;get formDirective(){return null}get path(){return null}},ba=class extends pp{_parent=null;name=null;valueAccessor=null},Y5=class{_cd;constructor(e){this._cd=e}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},K5={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},d3=V(T({},K5),{"[class.ng-submitted]":"isSubmitted"}),wa=(()=>{class e extends Y5{constructor(n){super(n)}static \u0275fac=function(n){return new(n||e)(j(ba,2))};static \u0275dir=_e({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(n,r){n&2&&Ie("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[ln]})}return e})(),hn="VALID",ar="INVALID",At="PENDING",pn="DISABLED",qn=class{},Wl=class extends qn{value;source;constructor(e,t){super(),this.value=e,this.source=t}},os=class extends qn{pristine;source;constructor(e,t){super(),this.pristine=e,this.source=t}},as=class extends qn{touched;source;constructor(e,t){super(),this.touched=e,this.source=t}},lr=class extends qn{status;source;constructor(e,t){super(),this.status=e,this.source=t}},J5=class extends qn{source;constructor(e){super(),this.source=e}};function X5(e){return(Oi(e)?e.validators:e)||null}function eb(e){return Array.isArray(e)?dp(e):e||null}function tb(e,t){return(Oi(t)?t.asyncValidators:e)||null}function nb(e){return Array.isArray(e)?hp(e):e||null}function Oi(e){return e!=null&&!Array.isArray(e)&&typeof e=="object"}var rb=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(e,t){this._assignValidators(e),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get status(){return Dt(this.statusReactive)}set status(e){Dt(()=>this.statusReactive.set(e))}_status=st(()=>this.statusReactive());statusReactive=le(void 0);get valid(){return this.status===hn}get invalid(){return this.status===ar}get pending(){return this.status==At}get disabled(){return this.status===pn}get enabled(){return this.status!==pn}errors;get pristine(){return Dt(this.pristineReactive)}set pristine(e){Dt(()=>this.pristineReactive.set(e))}_pristine=st(()=>this.pristineReactive());pristineReactive=le(!0);get dirty(){return!this.pristine}get touched(){return Dt(this.touchedReactive)}set touched(e){Dt(()=>this.touchedReactive.set(e))}_touched=st(()=>this.touchedReactive());touchedReactive=le(!1);get untouched(){return!this.touched}_events=new Je;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(ql(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(ql(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(Gl(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(Gl(e,this._rawAsyncValidators))}hasValidator(e){return ni(this._rawValidators,e)}hasAsyncValidator(e){return ni(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){let t=this.touched===!1;this.touched=!0;let n=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsTouched(V(T({},e),{sourceControl:n})),t&&e.emitEvent!==!1&&this._events.next(new as(!0,n))}markAllAsDirty(e={}){this.markAsDirty({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsDirty(e))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){let t=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let n=e.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:n})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,n),t&&e.emitEvent!==!1&&this._events.next(new as(!1,n))}markAsDirty(e={}){let t=this.pristine===!0;this.pristine=!1;let n=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsDirty(V(T({},e),{sourceControl:n})),t&&e.emitEvent!==!1&&this._events.next(new os(!1,n))}markAsPristine(e={}){let t=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let n=e.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e,n),t&&e.emitEvent!==!1&&this._events.next(new os(!0,n))}markAsPending(e={}){this.status=At;let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new lr(this.status,t)),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.markAsPending(V(T({},e),{sourceControl:t}))}disable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=pn,this.errors=null,this._forEachChild(r=>{r.disable(V(T({},e),{onlySelf:!0}))}),this._updateValue();let n=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new Wl(this.value,n)),this._events.next(new lr(this.status,n)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(V(T({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=hn,this._forEachChild(n=>{n.enable(V(T({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(V(T({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(n=>n(!1))}_updateAncestors(e,t){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine({},t),this._parent._updateTouched({},t))}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let n=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===hn||this.status===At)&&this._runAsyncValidator(n,e.emitEvent)}let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new Wl(this.value,t)),this._events.next(new lr(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(V(T({},e),{sourceControl:t}))}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?pn:hn}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=At,this._hasOwnPendingAsyncValidator={emitEvent:t!==!1,shouldHaveEmitted:e!==!1};let n=ap(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:t,shouldHaveEmitted:e})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let e=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(t.emitEvent!==!1,this,t.shouldHaveEmitted)}get(e){let t=e;return t==null||(Array.isArray(t)||(t=t.split(".")),t.length===0)?null:t.reduce((n,r)=>n&&n._find(r),this)}getError(e,t){let n=t?this.get(t):this;return n&&n.errors?n.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e,t,n){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),(e||n)&&this._events.next(new lr(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,n)}_initObservables(){this.valueChanges=new N,this.statusChanges=new N}_calculateStatus(){return this._allControlsDisabled()?pn:this.errors?ar:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(At)?At:this._anyControlsHaveStatus(ar)?ar:hn}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e,t){let n=!this._anyControlsDirty(),r=this.pristine!==n;this.pristine=n,this._parent&&!e.onlySelf&&this._parent._updatePristine(e,t),r&&this._events.next(new os(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new as(this.touched,t)),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,t)}_onDisabledChange=[];_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){Oi(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){let t=this._parent&&this._parent.dirty;return!e&&!!t&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=eb(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=nb(this._rawAsyncValidators)}},fp=new M("",{providedIn:"root",factory:()=>_a}),_a="always";function ib(e,t){return[...t.path,e]}function sb(e,t,n=_a){ab(e,t),t.valueAccessor.writeValue(e.value),(e.disabled||n==="always")&&t.valueAccessor.setDisabledState?.(e.disabled),lb(e,t),cb(e,t),ub(e,t),ob(e,t)}function Ql(e,t){e.forEach(n=>{n.registerOnValidatorChange&&n.registerOnValidatorChange(t)})}function ob(e,t){if(t.valueAccessor.setDisabledState){let n=r=>{t.valueAccessor.setDisabledState(r)};e.registerOnDisabledChange(n),t._registerOnDestroy(()=>{e._unregisterOnDisabledChange(n)})}}function ab(e,t){let n=G5(e);t.validator!==null?e.setValidators($l(n,t.validator)):typeof n=="function"&&e.setValidators([n]);let r=W5(e);t.asyncValidator!==null?e.setAsyncValidators($l(r,t.asyncValidator)):typeof r=="function"&&e.setAsyncValidators([r]);let i=()=>e.updateValueAndValidity();Ql(t._rawValidators,i),Ql(t._rawAsyncValidators,i)}function lb(e,t){t.valueAccessor.registerOnChange(n=>{e._pendingValue=n,e._pendingChange=!0,e._pendingDirty=!0,e.updateOn==="change"&&gp(e,t)})}function ub(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,e.updateOn==="blur"&&e._pendingChange&&gp(e,t),e.updateOn!=="submit"&&e.markAsTouched()})}function gp(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function cb(e,t){let n=(r,i)=>{t.valueAccessor.writeValue(r),i&&t.viewToModelUpdate(r)};e.registerOnChange(n),t._registerOnDestroy(()=>{e._unregisterOnChange(n)})}function db(e,t){if(!e.hasOwnProperty("model"))return!1;let n=e.model;return n.isFirstChange()?!0:!Object.is(t,n.currentValue)}function hb(e){return Object.getPrototypeOf(e.constructor)===N5}function pb(e,t){if(!t)return null;Array.isArray(t);let n,r,i;return t.forEach(s=>{s.constructor===$n?n=s:hb(s)?r=s:i=s}),i||r||n||null}function Yl(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Kl(e){return typeof e=="object"&&e!==null&&Object.keys(e).length===2&&"value"in e&&"disabled"in e}var fb=class extends rb{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(e=null,t,n){super(X5(t),tb(n,t)),this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Oi(t)&&(t.nonNullable||t.initialValueIsDefault)&&(Kl(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&t.emitModelToViewChange!==!1&&this._onChange.forEach(n=>n(this.value,t.emitViewToModelChange!==!1)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1,t?.emitEvent!==!1&&this._events.next(new J5(this))}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){Yl(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){Yl(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){Kl(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}},gb={provide:ba,useExisting:Vn(()=>Ei)},Jl=Promise.resolve(),Ei=(()=>{class e extends ba{_changeDetectorRef;callSetDisabledState;control=new fb;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new N;constructor(n,r,i,s,o,a){super(),this._changeDetectorRef=o,this.callSetDisabledState=a,this._parent=n,this._setValidators(r),this._setAsyncValidators(i),this.valueAccessor=pb(this,s)}ngOnChanges(n){if(this._checkForErrors(),!this._registered||"name"in n){if(this._registered&&(this._checkName(),this.formDirective)){let r=n.name.previousValue;this.formDirective.removeControl({name:r,path:this._getPath(r)})}this._setUpControl()}"isDisabled"in n&&this._updateDisabled(n),db(n,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(n){this.viewModel=n,this.update.emit(n)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){sb(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(n){Jl.then(()=>{this.control.setValue(n,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(n){let r=n.isDisabled.currentValue,i=r!==0&&Dy(r);Jl.then(()=>{i&&!this.control.disabled?this.control.disable():!i&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(n){return this._parent?ib(n,this._parent):[n]}static \u0275fac=function(n){return new(n||e)(j(Q5,9),j(sp,10),j(B5,10),j(ip,10),j(ky,8),j(fp,8))};static \u0275dir=_e({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[ha([gb]),ln,gi]})}return e})();function mb(e){return typeof e=="number"?e:parseInt(e,10)}var vb=(()=>{class e{_validator=Zl;_onChange;_enabled;ngOnChanges(n){if(this.inputName in n){let r=this.normalizeInput(n[this.inputName].currentValue);this._enabled=this.enabled(r),this._validator=this._enabled?this.createValidator(r):Zl,this._onChange&&this._onChange()}}validate(n){return this._validator(n)}registerOnValidatorChange(n){this._onChange=n}enabled(n){return n!=null}static \u0275fac=function(n){return new(n||e)};static \u0275dir=_e({type:e,features:[gi]})}return e})(),yb={provide:sp,useExisting:Vn(()=>mp),multi:!0},mp=(()=>{class e extends vb{maxlength;inputName="maxlength";normalizeInput=n=>mb(n);createValidator=n=>U5(n);static \u0275fac=(()=>{let n;return function(r){return(n||(n=Wc(e)))(r||e)}})();static \u0275dir=_e({type:e,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(n,r){n&2&&sa("maxlength",r._enabled?r.maxlength:null)},inputs:{maxlength:"maxlength"},standalone:!1,features:[ha([yb]),ln]})}return e})(),Cb=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=_i({type:e});static \u0275inj=oi({})}return e})(),xa=(()=>{class e{static withConfig(n){return{ngModule:e,providers:[{provide:fp,useValue:n.callSetDisabledState??_a}]}}static \u0275fac=function(n){return new(n||e)};static \u0275mod=_i({type:e});static \u0275inj=oi({imports:[Cb]})}return e})();function bb(e,t){if(e&1){let n=xe();f(0,"button",11),x("click",function(){L(n);let r=O();return D(r.onSubmit())}),H(1,"app-icon",12),m()}if(e&2){let n=O();P("disabled",n.disabled||!n.value.trim())}}function wb(e,t){if(e&1){let n=xe();f(0,"button",13),x("click",function(){L(n);let r=O();return D(r.onStopClick())}),H(1,"app-icon",14),m()}}var _b=class Qs{placeholder=me.INPUT.PLACEHOLDER;disabled=!1;value="";voiceStatus={state:"idle",transcript:"",interimTranscript:""};isLoadingResponse=!1;valueChange=new N;submitMessage=new N;voiceClick=new N;addClick=new N;settingsClick=new N;stopClick=new N;get isListening(){return this.voiceStatus.state==="listening"}get displayValue(){if(this.isLoadingResponse)return"Thinking....";if(this.isListening){let t=this.voiceStatus.transcript||"",n=this.voiceStatus.interimTranscript||"";return t+(t&&n?" ":"")+n}return this.value}get displayPlaceholder(){return this.isLoadingResponse?"":this.isListening?"Listening... Speak now":this.placeholder}onInputChange(t){!this.isListening&&t!==void 0&&(this.value=t,this.valueChange.emit(this.value))}onSubmit(){if(this.value.trim()&&!this.isListening){let t=this.value;this.value="",this.valueChange.emit(this.value),this.submitMessage.emit(t)}}onVoiceClick(){this.voiceClick.emit()}onAddClick(){this.addClick.emit()}onSettingsClick(){this.settingsClick.emit()}onStopClick(){this.stopClick.emit()}static \u0275fac=function(t){return new(t||Qs)};static \u0275cmp=Ae({type:Qs,selectors:[["app-input-field"]],inputs:{placeholder:"placeholder",disabled:"disabled",value:"value",voiceStatus:"voiceStatus",isLoadingResponse:"isLoadingResponse"},outputs:{valueChange:"valueChange",submitMessage:"submitMessage",voiceClick:"voiceClick",addClick:"addClick",settingsClick:"settingsClick",stopClick:"stopClick"},decls:11,vars:12,consts:[[1,"input-container"],[1,"input-wrapper"],["aria-label","Add",1,"icon-button","add-button",3,"click"],["name","add","width","24","height","24"],["aria-label","Settings",1,"icon-button","settings-button",3,"click"],["name","settings","width","24","height","24"],["type","text",1,"input-field",3,"ngModelChange","keyup.enter","ngModel","placeholder","disabled","readonly"],["aria-label","Voice input",1,"icon-button","voice-button",3,"click"],["name","microphone","width","24","height","24","fill","currentColor"],["class","icon-button send-button","aria-label","Send message",3,"disabled","click",4,"ngIf"],["class","icon-button stop-button","aria-label","Stop response",3,"click",4,"ngIf"],["aria-label","Send message",1,"icon-button","send-button",3,"click","disabled"],["name","send-filled","width","32","height","32"],["aria-label","Stop response",1,"icon-button","stop-button",3,"click"],["name","stop-circle-filled","width","32","height","32"]],template:function(t,n){t&1&&(f(0,"div",0)(1,"div",1)(2,"button",2),x("click",function(){return n.onAddClick()}),H(3,"app-icon",3),m(),f(4,"button",4),x("click",function(){return n.onSettingsClick()}),H(5,"app-icon",5),m(),f(6,"input",6),x("ngModelChange",function(r){return n.onInputChange(r)})("keyup.enter",function(){return n.onSubmit()}),m(),f(7,"button",7),x("click",function(){return n.onVoiceClick()}),H(8,"app-icon",8),m(),re(9,bb,2,1,"button",9)(10,wb,2,0,"button",10),m()()),t&2&&(_(6),Ie("listening",n.isListening)("thinking",n.isLoadingResponse),P("ngModel",n.displayValue)("placeholder",n.displayPlaceholder)("disabled",n.disabled||n.isListening)("readonly",n.isListening||n.isLoadingResponse),_(),Ie("active",n.isListening),_(2),P("ngIf",!n.isLoadingResponse),_(),P("ngIf",n.isLoadingResponse))},dependencies:[ke,It,xa,$n,wa,Ei,Lt],styles:[".input-container[_ngcontent-%COMP%]{padding:12px 16px;background:#fff;border-top:1px solid #f0f0f0;flex-shrink:0;box-sizing:border-box}@media (max-width: 768px){.input-container[_ngcontent-%COMP%]{padding:10px 12px}}@media (max-height: 600px){.input-container[_ngcontent-%COMP%]{padding:8px 12px}}.input-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;background:#f8f8f8;border-radius:12px;padding:8px 16px;transition:background-color .2s}.input-wrapper[_ngcontent-%COMP%]:focus-within{background:#f0f0f0}.input-field[_ngcontent-%COMP%]{flex:1;border:none;background:transparent;font-size:15px;color:#333;outline:none;padding:8px 0}.input-field[_ngcontent-%COMP%]::placeholder{color:#999;font-family:Roboto Medium,Roboto,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-weight:500}.input-field[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.input-field.listening[_ngcontent-%COMP%]{color:#f43e83;font-style:italic}.input-field.thinking[_ngcontent-%COMP%]{color:#999;font-family:Roboto Medium,Roboto,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-weight:500}.icon-button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background-color .2s;color:#666;min-width:40px;min-height:40px}.icon-button[_ngcontent-%COMP%]:hover{background-color:#0000000d;color:#333}.icon-button[_ngcontent-%COMP%]:active{background-color:#0000001a}.voice-button.active[_ngcontent-%COMP%]{color:#f43e83;animation:_ngcontent-%COMP%_pulse 1.5s ease-in-out infinite}.send-button[_ngcontent-%COMP%]{color:#333}.send-button[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.send-button[_ngcontent-%COMP%]:disabled:hover{background-color:transparent}.settings-button[_ngcontent-%COMP%]{color:#666}.stop-button[_ngcontent-%COMP%]{color:#333}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:1}50%{opacity:.6}}@media (max-width: 768px){.input-container[_ngcontent-%COMP%]{padding:8px 12px}.input-wrapper[_ngcontent-%COMP%]{gap:4px;padding:6px 12px}.input-field[_ngcontent-%COMP%]{font-size:14px;padding:6px 0}.icon-button[_ngcontent-%COMP%]{padding:6px;min-width:32px;min-height:32px}}"]})};function xb(e,t){e&1&&(f(0,"div",7),H(1,"span")(2,"span")(3,"span"),m())}function kb(e,t){if(e&1&&H(0,"div",8),e&2){let n=O();P("innerHTML",n.message.text,bd)}}function Sb(e,t){if(e&1){let n=xe();f(0,"div",9)(1,"button",10),x("click",function(){L(n);let r=O();return D(r.onCopyClick())}),H(2,"app-icon",11),m(),f(3,"button",12),x("click",function(){L(n);let r=O();return D(r.onShareClick())}),H(4,"app-icon",13),m(),f(5,"button",14),x("click",function(){L(n);let r=O();return D(r.onSpeakClick())}),H(6,"app-icon",15),m()()}}var Mb=class Ys{logger=v(Le);message;get isUser(){return this.message.sender==="user"}get isAssistant(){return this.message.sender==="assistant"}onCopyClick(){let t=document.createElement("div");t.innerHTML=this.message.text;let n=t.textContent||t.innerText||"";navigator.clipboard.writeText(n).then(()=>{this.logger.debug("Message copied to clipboard")},r=>{this.logger.error("Failed to copy message:",r)})}onShareClick(){let t=document.createElement("div");t.innerHTML=this.message.text;let n=t.textContent||t.innerText||"";navigator.share?navigator.share({title:"AI Assistant Message",text:n}).then(()=>{this.logger.debug("Message shared successfully")},r=>{this.logger.error("Failed to share message:",r)}):this.onCopyClick()}onSpeakClick(){let t=document.createElement("div");t.innerHTML=this.message.text;let n=t.textContent||t.innerText||"";if("speechSynthesis"in window){window.speechSynthesis.cancel();let r=new SpeechSynthesisUtterance(n);r.lang="en-US",r.rate=1,r.pitch=1,window.speechSynthesis.speak(r)}else this.logger.warn("Speech synthesis not supported in this browser")}static \u0275fac=function(t){return new(t||Ys)};static \u0275cmp=Ae({type:Ys,selectors:[["app-message"]],inputs:{message:"message"},decls:7,vars:9,consts:[[1,"message"],[1,"message-container"],[1,"message-content"],[1,"message-bubble"],["class","typing-indicator",4,"ngIf"],["class","message-text",3,"innerHTML",4,"ngIf"],["class","message-actions",4,"ngIf"],[1,"typing-indicator"],[1,"message-text",3,"innerHTML"],[1,"message-actions"],["aria-label","Copy message","title","Copy",1,"action-button",3,"click"],["name","copy","width","16","height","16"],["aria-label","Share message","title","Share",1,"action-button",3,"click"],["name","share-ios","width","16","height","16"],["aria-label","Read aloud","title","Read aloud",1,"action-button",3,"click"],["name","unmute","width","16","height","16"]],template:function(t,n){t&1&&(f(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),re(4,xb,4,0,"div",4)(5,kb,1,1,"div",5),m(),re(6,Sb,7,0,"div",6),m()()()),t&2&&(Ie("user",n.isUser)("assistant",n.isAssistant),_(3),Ie("typing",n.message.isTyping),_(),P("ngIf",n.message.isTyping),_(),P("ngIf",!n.message.isTyping),_(),P("ngIf",n.isAssistant&&!n.message.isTyping))},dependencies:[ke,It,Lt],styles:[".message[_ngcontent-%COMP%]{display:flex;margin-bottom:16px;animation:_ngcontent-%COMP%_fadeIn .3s ease-in}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.message-container[_ngcontent-%COMP%]{display:flex;align-items:flex-start;max-width:100%;width:100%}.message.user[_ngcontent-%COMP%] .message-container[_ngcontent-%COMP%]{justify-content:flex-end}.message-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;max-width:85%}.message.user[_ngcontent-%COMP%] .message-content[_ngcontent-%COMP%]{align-items:flex-end}.message-bubble[_ngcontent-%COMP%]{padding:12px 16px;border-radius:10px;word-wrap:break-word;width:fit-content}.message.user[_ngcontent-%COMP%] .message-bubble[_ngcontent-%COMP%]{background:#808b95;color:#fff;border-radius:10px;box-shadow:0 1px 2px #0000001a;transition:background-color .2s ease}.message.user[_ngcontent-%COMP%]:hover .message-bubble[_ngcontent-%COMP%]{background:#6d7a85}.message.assistant[_ngcontent-%COMP%] .message-bubble[_ngcontent-%COMP%]{background:transparent;color:#2c3e50;border:none;box-shadow:none;padding:0}.message-bubble.typing[_ngcontent-%COMP%]{padding:16px;min-width:60px}.message-text[_ngcontent-%COMP%]{margin:0;line-height:1.5;font-size:14px;white-space:normal}.message-text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 8px}.message-text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.message-text[_ngcontent-%COMP%] h1[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] h4[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] h5[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin:12px 0 8px;font-weight:600}.message-text[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]:first-child, .message-text[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]:first-child, .message-text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]:first-child, .message-text[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]:first-child, .message-text[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]:first-child, .message-text[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]:first-child{margin-top:0}.message-text[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] ol[_ngcontent-%COMP%]{margin:8px 0;padding-left:24px}.message-text[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:4px 0}.message-text[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600}.message-text[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:italic}.message-text[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:#0000000d;padding:2px 4px;border-radius:3px;font-family:Courier New,monospace;font-size:13px}.message-text[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{background:#0000000d;padding:12px;border-radius:6px;overflow-x:auto;margin:8px 0}.message-text[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:none;padding:0}.typing-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;height:16px}.typing-indicator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background-color:#95a5a6;animation:_ngcontent-%COMP%_typing 1.4s infinite}.typing-indicator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.typing-indicator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_typing{0%,60%,to{transform:translateY(0);opacity:.5}30%{transform:translateY(-10px);opacity:1}}.message-actions[_ngcontent-%COMP%]{display:flex;gap:4px;margin-top:4px;opacity:0;transition:opacity .2s ease}.message.assistant[_ngcontent-%COMP%]:hover .message-actions[_ngcontent-%COMP%]{opacity:1}.action-button[_ngcontent-%COMP%]{background:none;border:none;padding:6px;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:4px;color:#808b95;transition:all .2s ease}.action-button[_ngcontent-%COMP%]:hover{background-color:#808b951a;color:#6d7a85}.action-button[_ngcontent-%COMP%]:active{transform:scale(.95);background-color:#808b9533}@media (max-width: 768px){.message-bubble[_ngcontent-%COMP%]{max-width:90%}.message-actions[_ngcontent-%COMP%]{opacity:1}.action-button[_ngcontent-%COMP%]{padding:8px}}"]})},Ob=["messagesContainer"];function Eb(e,t){if(e&1&&H(0,"app-message",10),e&2){let n=t.$implicit;P("message",n)}}function Tb(e,t){if(e&1&&(la(0),f(1,"div",7)(2,"span",8),z(3),m()(),re(4,Eb,1,1,"app-message",9),ua()),e&2){let n=t.$implicit,r=O(2);_(3),be(n.date),_(),P("ngForOf",n.messages)("ngForTrackBy",r.trackByMessageId)}}function Pb(e,t){if(e&1&&(f(0,"div",5),re(1,Tb,5,3,"ng-container",6),m()),e&2){let n=O();_(),P("ngForOf",n.messageGroups)}}function Ib(e,t){e&1&&(f(0,"div",11)(1,"p",12),z(2,"Start a conversation by typing a message or selecting a suggestion below."),m()())}var Lb=class Ks{messages=[];canLoadMore=!1;isLoadingMore=!1;loadMore=new N;messagesContainer;messageGroups=[];restoreScrollAfterPrepend=!1;previousScrollHeight=0;suppressNextScroll=!1;lastScrollTop=Number.MAX_SAFE_INTEGER;scrollInitialized=!1;initialScrollPending=!0;initialScrollRequested=!1;get container(){return this.messagesContainer?.nativeElement??null}ngAfterViewChecked(){if(this.restoreScrollAfterPrepend&&this.messagesContainer){let t=this.messagesContainer.nativeElement,n=t.scrollHeight-this.previousScrollHeight;t.scrollTop=n+t.scrollTop,this.restoreScrollAfterPrepend=!1}}ngOnChanges(t){if(!t.messages)return;let n=t.messages.currentValue,r=t.messages.previousValue;this.messageGroups=this.groupMessagesByDate(this.messages),this.initialScrollPending?this.queueInitialScroll():this.hasAppendedMessage(r,n)&&this.scrollToBottomAfterRender()}onScroll(){if(!this.canLoadMore)return;let t=this.container;t&&(this.shouldSkipScroll(t)||this.isNearTop(t.scrollTop)&&this.prepareForLoadMore(t))}trackByMessageId(t,n){return n.id}queueInitialScroll(){this.initialScrollRequested||(this.initialScrollRequested=!0,Promise.resolve().then(()=>{let t=this.container;if(!t||!this.initialScrollPending){this.initialScrollRequested=!1;return}this.scrollToBottom(t),this.initialScrollPending=!1,this.initialScrollRequested=!1}))}scrollToBottomAfterRender(){Promise.resolve().then(()=>{let t=this.container;t&&this.scrollToBottom(t)})}scrollToBottom(t){this.suppressNextScroll=!0,t.scrollTop=t.scrollHeight,this.lastScrollTop=t.scrollTop,this.scrollInitialized=!0}triggerLoadMore(t){if(!this.canLoadMore||this.isLoadingMore)return;let n=t??this.container;n&&(this.previousScrollHeight=n.scrollHeight,this.restoreScrollAfterPrepend=!0),this.loadMore.emit()}hasAppendedMessage(t,n){if(!n||n.length===0)return!1;if(!t||t.length===0)return!0;if(n.length<=t.length)return!1;let r=t[t.length-1]?.id;return n[n.length-1]?.id!==r}shouldSkipScroll(t){let n=t.scrollTop,r=t.scrollHeight,i=t.clientHeight;if(this.suppressNextScroll)return this.suppressNextScroll=!1,this.lastScrollTop=n,!0;if(r<=i+200)return this.lastScrollTop=n,!0;if(!this.scrollInitialized)return this.scrollInitialized=!0,this.lastScrollTop=n,!0;let s=n<this.lastScrollTop;return this.lastScrollTop=n,!s}isNearTop(t){return t<=200}prepareForLoadMore(t){this.suppressNextScroll=!0,this.triggerLoadMore(t)}groupMessagesByDate(t){let n={};return t.forEach(r=>{let i=this.getDateKey(r.timestamp);n[i]||(n[i]=[]),n[i].push(r)}),Object.keys(n).map(r=>({date:this.formatDateLabel(r),messages:n[r]}))}getDateKey(t){let n=new Date(t);return`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}`}formatDateLabel(t){let n=new Date,r=new Date(n);r.setDate(r.getDate()-1);let i=this.getDateKey(n),s=this.getDateKey(r);if(t===i)return me.DATE.LABELS.TODAY;if(t===s)return me.DATE.LABELS.YESTERDAY;let[o,a,l]=t.split("-").map(Number),u=new Date(o,a-1,l);return`${l} ${me.DATE.MONTH_NAMES[u.getMonth()]}`}static \u0275fac=function(t){return new(t||Ks)};static \u0275cmp=Ae({type:Ks,selectors:[["app-chat-history"]],viewQuery:function(t,n){if(t&1&&vh(Ob,5),t&2){let r;yh(r=Ch())&&(n.messagesContainer=r.first)}},inputs:{messages:"messages",canLoadMore:"canLoadMore",isLoadingMore:"isLoadingMore"},outputs:{loadMore:"loadMore"},features:[gi],decls:5,vars:2,consts:[["messagesContainer",""],[1,"chat-history"],[1,"messages-container",3,"scroll"],["class","messages-list",4,"ngIf"],["class","empty-state",4,"ngIf"],[1,"messages-list"],[4,"ngFor","ngForOf"],[1,"date-separator"],[1,"date-label"],[3,"message",4,"ngFor","ngForOf","ngForTrackBy"],[3,"message"],[1,"empty-state"],[1,"empty-text"]],template:function(t,n){if(t&1){let r=xe();f(0,"div",1)(1,"div",2,0),x("scroll",function(){return L(r),D(n.onScroll())}),re(3,Pb,2,1,"div",3)(4,Ib,3,0,"div",4),m()()}t&2&&(_(3),P("ngIf",n.messages.length>0),_(),P("ngIf",n.messages.length===0))},dependencies:[ke,ki,It,Mb],styles:[".chat-history[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;width:100%;min-height:0;max-height:100%}.messages-container[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;padding:16px;scroll-behavior:smooth;min-height:0;-webkit-overflow-scrolling:touch}.messages-container[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.messages-container[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.messages-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#0003;border-radius:3px}.messages-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#0000004d}.messages-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.date-separator[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;margin:16px 0 12px}.date-label[_ngcontent-%COMP%]{color:#95a5a6;font-size:13px;font-weight:500;padding:4px 12px;background:#95a5a61a;border-radius:12px}.empty-state[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%;padding:32px}.empty-text[_ngcontent-%COMP%]{color:#95a5a6;font-size:14px;text-align:center;line-height:1.6;max-width:400px}"]})};function Db(e,t){if(e&1){let n=xe();f(0,"div",1),x("click",function(){L(n);let r=O();return D(r.onOverlayClick())}),f(1,"div",2),x("click",function(r){L(n);let i=O();return D(i.onModalClick(r))}),f(2,"div",3)(3,"button",4),x("click",function(){L(n);let r=O();return D(r.onBackClick())}),H(4,"app-icon",5),m(),f(5,"h2",6),z(6,"Rename Chat"),m(),f(7,"button",7),x("click",function(){L(n);let r=O();return D(r.onCloseClick())}),H(8,"app-icon",8),m()(),f(9,"div",9)(10,"input",10),da("ngModelChange",function(r){L(n);let i=O();return _h(i.editedTitle,r)||(i.editedTitle=r),D(r)}),x("keydown",function(r){L(n);let i=O();return D(i.onInputKeydown(r))}),m()(),f(11,"div",11)(12,"button",12),x("click",function(){L(n);let r=O();return D(r.onCancel())}),z(13," Cancel "),m(),f(14,"button",13),x("click",function(){L(n);let r=O();return D(r.onSave())}),z(15," Save "),m()()()()}if(e&2){let n=O();_(10),ca("ngModel",n.editedTitle),P("maxlength",500)}}var Ab=class Js{isOpen=!1;currentTitle="";close=new N;save=new N;editedTitle="";ngOnChanges(t){t.isOpen&&this.isOpen&&(this.editedTitle=this.currentTitle),t.currentTitle&&(this.editedTitle=this.currentTitle)}onBackClick(){this.close.emit()}onCloseClick(){this.close.emit()}onCancel(){this.close.emit()}onSave(){let t=this.editedTitle.trim();t&&t!==this.currentTitle&&this.save.emit(t),this.close.emit()}onOverlayClick(){this.close.emit()}onModalClick(t){t.stopPropagation()}onInputKeydown(t){t.key==="Enter"?(t.preventDefault(),this.onSave()):t.key==="Escape"&&(t.preventDefault(),this.onCancel())}static \u0275fac=function(t){return new(t||Js)};static \u0275cmp=Ae({type:Js,selectors:[["app-rename-modal"]],inputs:{isOpen:"isOpen",currentTitle:"currentTitle"},outputs:{close:"close",save:"save"},features:[gi],decls:1,vars:1,consts:[["class","modal-overlay",3,"click",4,"ngIf"],[1,"modal-overlay",3,"click"],[1,"modal-container",3,"click"],[1,"modal-header"],["aria-label","Back",1,"icon-button","back-button",3,"click"],["name","chevron-left","width","24","height","24"],[1,"modal-title"],["aria-label","Close",1,"icon-button","rename-modal-close-button",3,"click"],["name","close","width","24","height","24"],[1,"modal-body"],["type","text","placeholder","Enter chat name","autofocus","",1,"rename-input",3,"ngModelChange","keydown","ngModel","maxlength"],[1,"modal-footer"],[1,"btn","btn-cancel",3,"click"],[1,"btn","btn-save",3,"click"]],template:function(t,n){t&1&&re(0,Db,16,2,"div",0),t&2&&P("ngIf",n.isOpen)},dependencies:[ke,It,xa,$n,wa,mp,Ei,Lt],styles:[".modal-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#00000080;display:flex;align-items:flex-end;justify-content:center;z-index:1000;animation:_ngcontent-%COMP%_fadeIn .2s ease-out;overflow-x:hidden}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}.modal-container[_ngcontent-%COMP%]{background-color:#fff;border-radius:16px 16px 0 0;width:100%;max-width:600px;max-height:90vh;display:flex;flex-direction:column;box-shadow:0 -2px 24px #00000026;animation:_ngcontent-%COMP%_slideUp .3s ease-out;box-sizing:border-box;overflow-x:hidden}@keyframes _ngcontent-%COMP%_slideUp{0%{transform:translateY(100%)}to{transform:translateY(0)}}.modal-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e5e7eb;gap:12px}.modal-title[_ngcontent-%COMP%]{flex:1;text-align:left;font-size:18px;font-weight:600;color:#111827;margin:0}.icon-button[_ngcontent-%COMP%]{background:none;border:none;padding:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:8px;color:#6b7280;transition:all .2s ease}.icon-button[_ngcontent-%COMP%]:hover{background-color:#f3f4f6;color:#111827}.icon-button[_ngcontent-%COMP%]:active{transform:scale(.95)}.back-button[_ngcontent-%COMP%], .rename-modal-close-button[_ngcontent-%COMP%]{flex-shrink:0}.modal-body[_ngcontent-%COMP%]{padding:24px 20px;flex:1;overflow-y:auto;overflow-x:hidden;box-sizing:border-box}.rename-input[_ngcontent-%COMP%]{width:100%;padding:12px 16px;font-size:16px;border:1px solid #d1d5db;border-radius:8px;outline:none;transition:all .2s ease;font-family:inherit;color:#111827;box-sizing:border-box}.rename-input[_ngcontent-%COMP%]:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.rename-input[_ngcontent-%COMP%]::placeholder{color:#9ca3af}.modal-footer[_ngcontent-%COMP%]{display:flex;gap:12px;padding:16px 20px;border-top:1px solid #e5e7eb;box-sizing:border-box}.btn[_ngcontent-%COMP%]{flex:1;padding:12px 24px;font-size:16px;font-weight:500;border-radius:8px;border:none;cursor:pointer;transition:all .2s ease;font-family:inherit}.btn[_ngcontent-%COMP%]:active{transform:scale(.98)}.btn-cancel[_ngcontent-%COMP%]{background-color:#fff;color:#374151;border:1px solid #d1d5db}.btn-cancel[_ngcontent-%COMP%]:hover{background-color:#f9fafb;border-color:#9ca3af}.btn-save[_ngcontent-%COMP%]{background-color:#f43e83;color:#fff}.btn-save[_ngcontent-%COMP%]:hover{background-color:#d63571}.btn-save[_ngcontent-%COMP%]:disabled{background-color:#fca5a5;cursor:not-allowed}@media (min-width: 768px){.modal-overlay[_ngcontent-%COMP%]{align-items:center}.modal-container[_ngcontent-%COMP%]{border-radius:16px;max-height:400px}}"]})},Vb=["scrollContainer"],Rb=e=>({compact:e});function Nb(e,t){if(e&1){let n=xe();f(0,"div",34)(1,"button",35),x("click",function(r){L(n);let i=O().$implicit,s=O(2);return D(s.onEditClick(i.id,i.title,r))}),H(2,"app-icon",36),f(3,"span"),z(4,"Rename"),m()(),f(5,"button",37),x("click",function(r){L(n);let i=O().$implicit,s=O(2);return D(s.onDeleteClick(i.id,r))}),H(6,"app-icon",38),f(7,"span"),z(8,"Delete"),m()()()}}function Fb(e,t){if(e&1){let n=xe();f(0,"div",25),x("click",function(){let r=L(n).$implicit,i=O(2);return D(i.onConversationClick(r.id))}),f(1,"div",26)(2,"div",27)(3,"span",28),z(4),m()(),f(5,"span",29),z(6),m()(),f(7,"div",30)(8,"button",31),x("click",function(r){let i=L(n).$implicit,s=O(2);return D(s.toggleMenu(i.id,r))}),H(9,"app-icon",32),m(),re(10,Nb,9,0,"div",33),m()()}if(e&2){let n=t.$implicit,r=O(2);_(4),be(n.title),_(2),be(n.date),_(4),P("ngIf",r.isMenuOpen(n.id))}}function Hb(e,t){if(e&1&&(f(0,"div",23),re(1,Fb,11,3,"div",24),m()),e&2){let n=O();_(),P("ngForOf",n.conversations)}}function jb(e,t){if(e&1&&(f(0,"div",39)(1,"div",40),H(2,"div",41),f(3,"p",42),z(4,"Loading conversations..."),m()()()),e&2){let n=O();_(),P("ngClass",ay(1,Rb,!(n.isLoading&&n.conversations.length===0)))}}function zb(e,t){e&1&&(f(0,"div",43)(1,"p"),z(2,"No conversations yet"),m()())}var Bb=class Xs{isOpen=!1;conversations=[];canLoadMore=!1;isLoadingMore=!1;isLoading=!1;scrollContainer;backClick=new N;settingsClick=new N;closeClick=new N;conversationClick=new N;deleteClick=new N;newChatClick=new N;searchChange=new N;titleUpdate=new N;loadMore=new N;searchQuery="";isRenameModalOpen=!1;renamingConversationId=null;renamingConversationTitle="";activeMenuId=null;onBackClick(){this.backClick.emit()}onSettingsClick(){this.settingsClick.emit()}onCloseClick(){this.closeClick.emit()}onOverlayClick(){this.closeClick.emit(),this.closeMenu()}onConversationClick(t){this.conversationClick.emit(t)}onDeleteClick(t,n){n.stopPropagation(),this.deleteClick.emit(t),this.closeMenu()}onNewChatClick(){this.newChatClick.emit()}onSearchChange(){this.searchChange.emit(this.searchQuery)}onEditClick(t,n,r){r.stopPropagation(),this.renamingConversationId=t,this.renamingConversationTitle=n,this.isRenameModalOpen=!0,this.closeMenu()}onRenameModalClose(){this.isRenameModalOpen=!1,this.renamingConversationId=null,this.renamingConversationTitle=""}onRenameModalSave(t){this.renamingConversationId&&t.trim()&&this.titleUpdate.emit({id:this.renamingConversationId,title:t.trim()})}toggleMenu(t,n){n.stopPropagation(),this.activeMenuId===t?this.activeMenuId=null:this.activeMenuId=t}closeMenu(){this.activeMenuId=null}isMenuOpen(t){return this.activeMenuId===t}onSidebarClick(){this.closeMenu()}onScroll(){if(!this.canLoadMore||this.isLoadingMore||this.isLoading)return;let t=this.scrollContainer?.nativeElement;t&&t.scrollHeight-t.scrollTop-t.clientHeight<=80&&this.loadMore.emit()}static \u0275fac=function(t){return new(t||Xs)};static \u0275cmp=Ae({type:Xs,selectors:[["app-sidebar"]],viewQuery:function(t,n){if(t&1&&vh(Vb,5),t&2){let r;yh(r=Ch())&&(n.scrollContainer=r.first)}},inputs:{isOpen:"isOpen",conversations:"conversations",canLoadMore:"canLoadMore",isLoadingMore:"isLoadingMore",isLoading:"isLoading"},outputs:{backClick:"backClick",settingsClick:"settingsClick",closeClick:"closeClick",conversationClick:"conversationClick",deleteClick:"deleteClick",newChatClick:"newChatClick",searchChange:"searchChange",titleUpdate:"titleUpdate",loadMore:"loadMore"},decls:26,vars:10,consts:[["scrollContainer",""],[1,"sidebar-overlay",3,"click"],[1,"sidebar",3,"click"],[1,"sidebar-header"],[1,"back-text-button",3,"click"],["name","chevron-left","width","16","height","16"],[1,"header-actions"],["aria-label","Settings",1,"icon-button","settings-button",3,"click"],["name","settings-gear","width","20","height","20"],["aria-label","Close",1,"icon-button","sidebar-close-button",3,"click"],["name","close","width","20","height","20"],[1,"sidebar-content",3,"scroll"],[1,"conversations-title"],["class","conversations-list",4,"ngIf"],["class","load-more",4,"ngIf"],["class","empty-conversations",4,"ngIf"],[1,"sidebar-footer"],[1,"search-container"],["name","search","width","18","height","18",1,"search-icon"],["type","text","placeholder","Search",1,"search-input",3,"ngModelChange","input","ngModel"],["aria-label","New Chat",1,"icon-button","new-chat-button",3,"click"],["name","edit-code","width","20","height","20"],[3,"close","save","isOpen","currentTitle"],[1,"conversations-list"],["class","conversation-item",3,"click",4,"ngFor","ngForOf"],[1,"conversation-item",3,"click"],[1,"conversation-info"],[1,"conversation-title-container"],[1,"conversation-title"],[1,"conversation-date"],[1,"menu-container"],["aria-label","More options",1,"icon-button","menu-button",3,"click"],["name","more-horizontal","width","20","height","20"],["class","context-menu",4,"ngIf"],[1,"context-menu"],[1,"menu-item",3,"click"],["name","edit","width","16","height","16"],[1,"menu-item","delete-item",3,"click"],["name","trash","width","16","height","16"],[1,"load-more"],["aria-live","polite",1,"loading-state",3,"ngClass"],["aria-hidden","true",1,"spinner"],[1,"loading-text"],[1,"empty-conversations"]],template:function(t,n){if(t&1){let r=xe();f(0,"div",1),x("click",function(){return L(r),D(n.onOverlayClick())}),m(),f(1,"div",2),x("click",function(){return L(r),D(n.onSidebarClick())}),f(2,"div",3)(3,"button",4),x("click",function(){return L(r),D(n.onBackClick())}),H(4,"app-icon",5),f(5,"span"),z(6,"Back to Chat"),m()(),f(7,"div",6)(8,"button",7),x("click",function(){return L(r),D(n.onSettingsClick())}),H(9,"app-icon",8),m(),f(10,"button",9),x("click",function(){return L(r),D(n.onCloseClick())}),H(11,"app-icon",10),m()()(),f(12,"div",11,0),x("scroll",function(){return L(r),D(n.onScroll())}),f(14,"h3",12),z(15,"Conversations"),m(),re(16,Hb,2,1,"div",13)(17,jb,5,3,"div",14)(18,zb,3,0,"div",15),m(),f(19,"div",16)(20,"div",17),H(21,"app-icon",18),f(22,"input",19),da("ngModelChange",function(i){return L(r),_h(n.searchQuery,i)||(n.searchQuery=i),D(i)}),x("input",function(){return L(r),D(n.onSearchChange())}),m()(),f(23,"button",20),x("click",function(){return L(r),D(n.onNewChatClick())}),H(24,"app-icon",21),m()()(),f(25,"app-rename-modal",22),x("close",function(){return L(r),D(n.onRenameModalClose())})("save",function(i){return L(r),D(n.onRenameModalSave(i))}),m()}t&2&&(Ie("visible",n.isOpen),_(),Ie("open",n.isOpen),_(15),P("ngIf",n.conversations.length>0),_(),P("ngIf",n.isLoading&&n.conversations.length===0||n.isLoadingMore&&n.conversations.length>0),_(),P("ngIf",!n.isLoading&&n.conversations.length===0),_(4),ca("ngModel",n.searchQuery),_(3),P("isOpen",n.isRenameModalOpen)("currentTitle",n.renamingConversationTitle))},dependencies:[ke,gC,ki,It,xa,$n,wa,Ei,Lt,Ab],styles:[".sidebar-overlay[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%;background:#0006;z-index:998;opacity:0;visibility:hidden;transition:opacity .3s ease,visibility .3s ease}.sidebar-overlay.visible[_ngcontent-%COMP%]{opacity:1;visibility:visible}.sidebar[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:85%;max-width:400px;height:100%;background:#fff;z-index:999;transform:translate(-100%);transition:transform .3s ease;display:flex;flex-direction:column;box-shadow:2px 0 8px #0000001a}.sidebar.open[_ngcontent-%COMP%]{transform:translate(0)}.sidebar-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid #e8ecf1}.back-text-button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;background:none;border:none;cursor:pointer;font-size:16px;font-weight:500;color:#1a1a1a;padding:8px;border-radius:8px;transition:background .2s ease}.back-text-button[_ngcontent-%COMP%]:hover{background:#f5f7fa}.header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.icon-button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;border-radius:8px;transition:background .2s ease;color:#5f6368}.icon-button[_ngcontent-%COMP%]:hover{background:#f5f7fa;color:#1a1a1a}.icon-button[_ngcontent-%COMP%]:active{background:#e8ecf1}.sidebar-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:16px}.conversations-title[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:#95a5a6;text-transform:uppercase;letter-spacing:.5px;margin:0 0 16px}.conversations-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px 20px;color:#1a1a1a}.spinner[_ngcontent-%COMP%]{width:32px;height:32px;border:3px solid rgba(0,0,0,.1);border-top-color:#2c3e50;border-radius:50%;animation:_ngcontent-%COMP%_spin .9s linear infinite}.loading-text[_ngcontent-%COMP%]{font-size:14px;color:#54606c;margin:0}.loading-state.compact[_ngcontent-%COMP%]{flex-direction:row;padding:12px 16px;gap:10px}.loading-state.compact[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{font-size:13px}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.conversation-item[_ngcontent-%COMP%]{display:flex;align-items:center;padding:12px;background:#fff;border-radius:8px;cursor:pointer;transition:background .2s ease;gap:12px;position:relative}.conversation-item[_ngcontent-%COMP%]:hover{background:#f5f7fa}.conversation-info[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:4px;min-width:0}.conversation-title-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0}.conversation-title[_ngcontent-%COMP%]{flex:1;font-size:14px;font-weight:500;color:#1a1a1a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conversation-date[_ngcontent-%COMP%]{font-size:12px;color:#95a5a6}.menu-container[_ngcontent-%COMP%]{position:relative}.menu-button[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease}.conversation-item[_ngcontent-%COMP%]:hover .menu-button[_ngcontent-%COMP%], .menu-button[_ngcontent-%COMP%]:focus, .menu-container[_ngcontent-%COMP%]:focus-within .menu-button[_ngcontent-%COMP%]{opacity:1}.context-menu[_ngcontent-%COMP%]{position:absolute;top:100%;right:0;background:#fff;border-radius:8px;box-shadow:0 4px 12px #00000026;border:1px solid #e8ecf1;padding:4px;min-width:140px;z-index:1000;display:flex;flex-direction:column;gap:2px}.menu-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 12px;border:none;background:none;width:100%;text-align:left;cursor:pointer;border-radius:6px;font-size:14px;color:#1a1a1a;transition:background .2s ease}.menu-item[_ngcontent-%COMP%]:hover{background:#f5f7fa}.menu-item[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:#5f6368}.delete-item[_ngcontent-%COMP%]{color:#dc3545}.delete-item[_ngcontent-%COMP%]:hover{background:#fee}.delete-item[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:#dc3545}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;gap:16px}.spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:3px solid #f5f7fa;border-top-color:#ff5337;border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.loading-text[_ngcontent-%COMP%]{color:#95a5a6;font-size:14px;margin:0}.empty-conversations[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:40px 20px;text-align:center}.empty-conversations[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#95a5a6;font-size:14px;margin:0}.load-more[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-top:12px}.load-more-button[_ngcontent-%COMP%]{background:transparent;border:1px solid rgba(0,0,0,.1);border-radius:999px;color:#2c3e50;font-size:13px;padding:6px 16px;cursor:pointer;transition:background .2s ease,border-color .2s ease}.load-more-button[_ngcontent-%COMP%]:hover:not(:disabled){background:#0000000a;border-color:#0003}.load-more-button[_ngcontent-%COMP%]:disabled{cursor:not-allowed;opacity:.6}.sidebar-footer[_ngcontent-%COMP%]{padding:16px;border-top:1px solid #e8ecf1;display:flex;align-items:center;gap:12px}.search-container[_ngcontent-%COMP%]{flex:1;position:relative;display:flex;align-items:center;background:#f5f7fa;border-radius:8px;padding:12px 16px;gap:10px}.search-icon[_ngcontent-%COMP%]{flex-shrink:0;color:#95a5a6}.search-input[_ngcontent-%COMP%]{flex:1;border:none;background:none;font-size:15px;color:#1a1a1a;outline:none;padding:0}.search-input[_ngcontent-%COMP%]::placeholder{color:#95a5a6}.new-chat-button[_ngcontent-%COMP%]{flex-shrink:0;background:#f5f7fa;border:1px solid #e8ecf1;border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;transition:all .2s ease}.new-chat-button[_ngcontent-%COMP%]:hover{background:#e8ecf1;border-color:#d0d7de}@media (max-width: 768px){.menu-button[_ngcontent-%COMP%]{opacity:1}}@media (max-width: 480px){.sidebar[_ngcontent-%COMP%]{width:100%;max-width:none}}"]})},vp=class _r{toasts=le([]);toasts$=this.toasts.asReadonly();show(t,n="info",r=3e3){let i=Math.random().toString(36).substring(7),s={id:i,message:t,type:n,duration:r};this.toasts.update(o=>[...o,s]),r>0&&setTimeout(()=>this.remove(i),r)}success(t,n){this.show(t,"success",n)}error(t,n){this.show(t,"error",n)}warning(t,n){this.show(t,"warning",n)}info(t,n){this.show(t,"info",n)}remove(t){this.toasts.update(n=>n.filter(r=>r.id!==t))}static \u0275fac=function(t){return new(t||_r)};static \u0275prov=E({token:_r,factory:_r.\u0275fac,providedIn:"root"})};function Ub(e,t){e&1&&(f(0,"span"),z(1,"\u2713"),m())}function Zb(e,t){e&1&&(f(0,"span"),z(1,"\u2715"),m())}function $b(e,t){e&1&&(f(0,"span"),z(1,"\u26A0"),m())}function qb(e,t){e&1&&(f(0,"span"),z(1,"\u2139"),m())}function Gb(e,t){if(e&1){let n=xe();f(0,"div",2)(1,"div",3)(2,"span",4),la(3,5),re(4,Ub,2,0,"span",6)(5,Zb,2,0,"span",6)(6,$b,2,0,"span",6)(7,qb,2,0,"span",6),ua(),m(),f(8,"span",7),z(9),m()(),f(10,"button",8),x("click",function(){let r=L(n).$implicit,i=O();return D(i.onClose(r.id))}),z(11,"\u2715"),m()()}if(e&2){let n=t.$implicit;Ie("success",n.type==="success")("error",n.type==="error")("warning",n.type==="warning")("info",n.type==="info"),_(3),P("ngSwitch",n.type),_(),P("ngSwitchCase","success"),_(),P("ngSwitchCase","error"),_(),P("ngSwitchCase","warning"),_(),P("ngSwitchCase","info"),_(2),be(n.message)}}var Wb=class eo{toastService=v(vp);toasts=this.toastService.toasts$;onClose(t){this.toastService.remove(t)}static \u0275fac=function(t){return new(t||eo)};static \u0275cmp=Ae({type:eo,selectors:[["app-toast-container"]],decls:2,vars:1,consts:[[1,"toast-container"],["class","toast",3,"success","error","warning","info",4,"ngFor","ngForOf"],[1,"toast"],[1,"toast-content"],[1,"toast-icon"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"toast-message"],[1,"toast-close",3,"click"]],template:function(t,n){t&1&&(f(0,"div",0),re(1,Gb,12,14,"div",1),m()),t&2&&(_(),P("ngForOf",n.toasts()))},dependencies:[ke,ki,Ih,CC],styles:[".toast-container[_ngcontent-%COMP%]{position:fixed;top:20px;right:20px;z-index:9999;display:flex;flex-direction:column;gap:12px;max-width:400px}.toast[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-radius:8px;box-shadow:0 4px 12px #00000026;background:#fff;min-width:300px;animation:_ngcontent-%COMP%_slideIn .3s ease-out}@keyframes _ngcontent-%COMP%_slideIn{0%{transform:translate(400px);opacity:0}to{transform:translate(0);opacity:1}}.toast-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;flex:1}.toast-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;font-size:14px;font-weight:700}.toast.success[_ngcontent-%COMP%]{border-left:4px solid #10b981}.toast.success[_ngcontent-%COMP%] .toast-icon[_ngcontent-%COMP%]{background:#10b981;color:#fff}.toast.error[_ngcontent-%COMP%]{border-left:4px solid #ef4444}.toast.error[_ngcontent-%COMP%] .toast-icon[_ngcontent-%COMP%]{background:#ef4444;color:#fff}.toast.warning[_ngcontent-%COMP%]{border-left:4px solid #f59e0b}.toast.warning[_ngcontent-%COMP%] .toast-icon[_ngcontent-%COMP%]{background:#f59e0b;color:#fff}.toast.info[_ngcontent-%COMP%]{border-left:4px solid #3b82f6}.toast.info[_ngcontent-%COMP%] .toast-icon[_ngcontent-%COMP%]{background:#3b82f6;color:#fff}.toast-message[_ngcontent-%COMP%]{flex:1;font-size:14px;color:#2c3e50;line-height:1.4}.toast-close[_ngcontent-%COMP%]{background:none;border:none;color:#95a5a6;cursor:pointer;font-size:18px;padding:4px 8px;display:flex;align-items:center;justify-content:center;transition:color .2s}.toast-close[_ngcontent-%COMP%]:hover{color:#2c3e50}@media (max-width: 768px){.toast-container[_ngcontent-%COMP%]{top:10px;right:10px;left:10px;max-width:none}.toast[_ngcontent-%COMP%]{min-width:auto}}"]})},yp=class xr{isOpenSignal=le(!1);configSignal=le(null);resolveCallback=null;isOpen$=this.isOpenSignal.asReadonly();config$=this.configSignal.asReadonly();confirm(t){return this.configSignal.set(T({confirmText:"Confirm",cancelText:"Cancel",confirmColor:"primary"},t)),this.isOpenSignal.set(!0),new Promise(n=>{this.resolveCallback=n})}close(t){this.isOpenSignal.set(!1),this.resolveCallback&&(this.resolveCallback(t),this.resolveCallback=null)}static \u0275fac=function(t){return new(t||xr)};static \u0275prov=E({token:xr,factory:xr.\u0275fac,providedIn:"root"})};function Qb(e,t){if(e&1){let n=xe();f(0,"div",1),x("click",function(){L(n);let r=O();return D(r.onOverlayClick())}),f(1,"div",2),x("click",function(r){L(n);let i=O();return D(i.onModalClick(r))}),f(2,"div",3)(3,"button",4),x("click",function(){L(n);let r=O();return D(r.onBackClick())}),H(4,"app-icon",5),m(),f(5,"h2",6),z(6),m(),f(7,"button",7),x("click",function(){L(n);let r=O();return D(r.onCloseClick())}),H(8,"app-icon",8),m()(),f(9,"div",9)(10,"p",10),z(11),m()(),f(12,"div",11)(13,"button",12),x("click",function(){L(n);let r=O();return D(r.onCancel())}),z(14),m(),f(15,"button",13),x("click",function(){L(n);let r=O();return D(r.onConfirm())}),z(16),m()()()()}if(e&2){let n,r,i,s,o,a,l=O();_(6),be(((n=l.config())==null?null:n.title)||"Back"),_(5),be((r=l.config())==null?null:r.message),_(3),An(" ",((i=l.config())==null?null:i.cancelText)||"Cancel"," "),_(),Ie("btn-danger",((s=l.config())==null?null:s.confirmColor)==="danger")("btn-primary",((o=l.config())==null?null:o.confirmColor)==="primary"),_(),An(" ",((a=l.config())==null?null:a.confirmText)||"Confirm"," ")}}var Yb=class to{confirmationService=v(yp);isOpen=this.confirmationService.isOpen$;config=this.confirmationService.config$;onConfirm(){this.confirmationService.close(!0)}onCancel(){this.confirmationService.close(!1)}onBackClick(){this.confirmationService.close(!1)}onCloseClick(){this.confirmationService.close(!1)}onOverlayClick(){this.confirmationService.close(!1)}onModalClick(t){t.stopPropagation()}static \u0275fac=function(t){return new(t||to)};static \u0275cmp=Ae({type:to,selectors:[["app-confirmation-modal"]],decls:1,vars:1,consts:[["class","modal-overlay",3,"click",4,"ngIf"],[1,"modal-overlay",3,"click"],[1,"modal-container",3,"click"],[1,"modal-header"],["aria-label","Back",1,"icon-button","back-button",3,"click"],["name","chevron-left","width","24","height","24"],[1,"modal-title"],["aria-label","Close",1,"icon-button","confirmation-modal-close-button",3,"click"],["name","close","width","24","height","24"],[1,"modal-body"],[1,"modal-message"],[1,"modal-footer"],[1,"btn","btn-cancel",3,"click"],[1,"btn","btn-confirm",3,"click"]],template:function(t,n){t&1&&re(0,Qb,17,8,"div",0),t&2&&P("ngIf",n.isOpen())},dependencies:[ke,It,Lt],styles:[".modal-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#00000080;display:flex;align-items:flex-end;justify-content:center;z-index:10000;animation:_ngcontent-%COMP%_fadeIn .2s ease-out;overflow-x:hidden}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}.modal-container[_ngcontent-%COMP%]{background-color:#fff;border-radius:16px 16px 0 0;width:100%;max-width:600px;max-height:90vh;display:flex;flex-direction:column;box-shadow:0 -2px 24px #00000026;animation:_ngcontent-%COMP%_slideUp .3s ease-out;box-sizing:border-box;overflow-x:hidden}@keyframes _ngcontent-%COMP%_slideUp{0%{transform:translateY(100%)}to{transform:translateY(0)}}.modal-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e5e7eb;gap:12px}.modal-title[_ngcontent-%COMP%]{flex:1;text-align:left;font-size:18px;font-weight:600;color:#111827;margin:0}.icon-button[_ngcontent-%COMP%]{background:none;border:none;padding:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:8px;color:#6b7280;transition:all .2s ease}.icon-button[_ngcontent-%COMP%]:hover{background-color:#f3f4f6;color:#111827}.icon-button[_ngcontent-%COMP%]:active{transform:scale(.95)}.back-button[_ngcontent-%COMP%], .confirmation-modal-close-button[_ngcontent-%COMP%]{flex-shrink:0}.modal-body[_ngcontent-%COMP%]{padding:32px 20px;flex:1;overflow-y:auto;overflow-x:hidden;box-sizing:border-box}.modal-message[_ngcontent-%COMP%]{margin:0;font-size:16px;line-height:1.5;color:#111827;text-align:left}.modal-footer[_ngcontent-%COMP%]{display:flex;gap:12px;padding:16px 20px;border-top:1px solid #e5e7eb;box-sizing:border-box}.btn[_ngcontent-%COMP%]{flex:1;padding:12px 24px;font-size:16px;font-weight:500;border-radius:8px;border:none;cursor:pointer;transition:all .2s ease;font-family:inherit}.btn[_ngcontent-%COMP%]:active{transform:scale(.98)}.btn-cancel[_ngcontent-%COMP%]{background-color:#fff;color:#374151;border:1px solid #d1d5db}.btn-cancel[_ngcontent-%COMP%]:hover{background-color:#f9fafb;border-color:#9ca3af}.btn-confirm[_ngcontent-%COMP%]{color:#fff}.btn-primary[_ngcontent-%COMP%]{background-color:#3b82f6}.btn-primary[_ngcontent-%COMP%]:hover{background-color:#2563eb}.btn-danger[_ngcontent-%COMP%]{background-color:#f43e83}.btn-danger[_ngcontent-%COMP%]:hover{background-color:#d63571}.btn-danger[_ngcontent-%COMP%]:disabled, .btn-primary[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}@media (min-width: 768px){.modal-overlay[_ngcontent-%COMP%]{align-items:center}.modal-container[_ngcontent-%COMP%]{border-radius:16px;max-height:500px}}"]})},ri={production:!0,apiUrl:"https://ca-oaa-ai-dev-we-api.proudforest-87e29140.westeurope.azurecontainerapps.io",apiTimeout:6e4,environmentName:"production"},Kb=class kr{http=v(ya);logger=v(Le);get apiUrl(){return ri.apiUrl}get timeout(){return ri.apiTimeout}createConversation(t){return this.http.post(`${this.apiUrl}/conversations`,t).pipe(pt(this.timeout),Oe(this.handleError))}getConversations(t,n,r=0,i=20){let s=new Ge().set("offset",r.toString()).set("limit",i.toString());return t&&(s=s.set("status",t)),n&&(s=s.set("search",n)),this.http.get(`${this.apiUrl}/conversations`,{params:s}).pipe(pt(this.timeout),Oe(this.handleError))}getConversation(t){return this.http.get(`${this.apiUrl}/conversations/${t}`).pipe(pt(this.timeout),Oe(this.handleError))}deleteConversation(t){return this.http.delete(`${this.apiUrl}/conversations/${t}`).pipe(pt(this.timeout),Oe(this.handleError))}updateConversationTitle(t,n){return this.http.patch(`${this.apiUrl}/conversations/${t}/title`,n).pipe(pt(this.timeout),Oe(this.handleError))}sendMessage(t,n){let r=`${this.apiUrl}/conversations/${t}/messages`;return this.http.post(r,n).pipe(pt(this.timeout),Oe(this.handleError))}getMessages(t,n=0,r=20){let i=new Ge().set("offset",n.toString()).set("limit",r.toString());return this.http.get(`${this.apiUrl}/conversations/${t}/messages`,{params:i}).pipe(pt(this.timeout),Oe(this.handleError))}handleError=t=>{this.logger.error("API Error:",t);let n="An error occurred";return t.error instanceof ErrorEvent?n=`Error: ${t.error.message}`:n=`Error Code: ${t.status}
|
|
40
|
+
<rect x="5.5" y="5.5" width="5" height="5" rx="0.5" fill="white"/>`},trash:{viewBox:"0 0 16 16",path:'<path d="M14 2H10C10 0.897 9.103 0 8 0C6.897 0 6 0.897 6 2H2C1.724 2 1.5 2.224 1.5 2.5C1.5 2.776 1.724 3 2 3H2.54L3.349 12.708C3.456 13.994 4.55 15 5.84 15H10.159C11.449 15 12.543 13.993 12.65 12.708L13.459 3H13.999C14.275 3 14.499 2.776 14.499 2.5C14.499 2.224 14.275 2 13.999 2H14ZM8 1C8.551 1 9 1.449 9 2H7C7 1.449 7.449 1 8 1ZM11.655 12.625C11.591 13.396 10.934 14 10.16 14H5.841C5.067 14 4.41 13.396 4.346 12.625L3.544 3H12.458L11.656 12.625H11.655ZM7 5.5V11.5C7 11.776 6.776 12 6.5 12C6.224 12 6 11.776 6 11.5V5.5C6 5.224 6.224 5 6.5 5C6.776 5 7 5.224 7 5.5ZM10 5.5V11.5C10 11.776 9.776 12 9.5 12C9.224 12 9 11.776 9 11.5V5.5C9 5.224 9.224 5 9.5 5C9.776 5 10 5.224 10 5.5Z" fill="currentColor"/>'},search:{viewBox:"0 0 16 16",path:'<path d="M10.0195 10.7266C9.06578 11.5217 7.83875 12 6.5 12C3.46243 12 1 9.53757 1 6.5C1 3.46243 3.46243 1 6.5 1C9.53757 1 12 3.46243 12 6.5C12 7.83875 11.5217 9.06578 10.7266 10.0195L13.8535 13.1464C14.0488 13.3417 14.0488 13.6583 13.8535 13.8536C13.6583 14.0488 13.3417 14.0488 13.1464 13.8536L10.0195 10.7266ZM11 6.5C11 4.01472 8.98528 2 6.5 2C4.01472 2 2 4.01472 2 6.5C2 8.98528 4.01472 11 6.5 11C8.98528 11 11 8.98528 11 6.5Z" fill="currentColor"/>'},edit:{viewBox:"0 0 16 16",path:'<path d="M14.236 1.76386C13.2123 0.740172 11.5525 0.740171 10.5289 1.76386L2.65722 9.63549C2.28304 10.0097 2.01623 10.4775 1.88467 10.99L1.01571 14.3755C0.971767 14.5467 1.02148 14.7284 1.14646 14.8534C1.27144 14.9783 1.45312 15.028 1.62432 14.9841L5.00978 14.1151C5.52234 13.9836 5.99015 13.7168 6.36433 13.3426L14.236 5.47097C15.2596 4.44728 15.2596 2.78755 14.236 1.76386ZM11.236 2.47097C11.8691 1.8378 12.8957 1.8378 13.5288 2.47097C14.162 3.10413 14.162 4.1307 13.5288 4.76386L12.75 5.54269L10.4571 3.24979L11.236 2.47097ZM9.75002 3.9569L12.0429 6.24979L5.65722 12.6355C5.40969 12.883 5.10023 13.0595 4.76117 13.1465L2.19447 13.8053L2.85327 11.2386C2.9403 10.8996 3.1168 10.5901 3.36433 10.3426L9.75002 3.9569Z" fill="currentColor"/>'},"edit-code":{viewBox:"0 0 20 20",path:'<g clip-path="url(#clip0_edit_code)"><path d="M2.5 15V5C2.5 4.33696 2.76339 3.70107 3.23223 3.23223C3.70107 2.76339 4.33696 2.5 5 2.5H15C15.663 2.5 16.2989 2.76339 16.7678 3.23223C17.2366 3.70107 17.5 4.33696 17.5 5V7.51375C17.555 7.51125 17.6075 7.4975 17.6625 7.4975C18.0388 7.4975 18.4013 7.57125 18.75 7.6825V5C18.75 4.00544 18.3549 3.05161 17.6517 2.34835C16.9484 1.64509 15.9946 1.25 15 1.25H5C4.00544 1.25 3.05161 1.64509 2.34835 2.34835C1.64509 3.05161 1.25 4.00544 1.25 5V15C1.25 15.9946 1.64509 16.9484 2.34835 17.6517C3.05161 18.3549 4.00544 18.75 5 18.75H7.51125C7.52 18.605 7.53375 18.4587 7.56875 18.3137L7.7725 17.5H5C4.33696 17.5 3.70107 17.2366 3.23223 16.7678C2.76339 16.2989 2.5 15.663 2.5 15ZM19.315 9.4325C19.0979 9.21536 18.8402 9.04312 18.5566 8.9256C18.2729 8.80808 17.9689 8.7476 17.6619 8.7476C17.3548 8.7476 17.0508 8.80808 16.7672 8.9256C16.4835 9.04312 16.2258 9.21536 16.0088 9.4325L9.9725 15.4688C9.62058 15.8209 9.37087 16.262 9.25 16.745L8.7825 18.6175C8.73601 18.8038 8.73853 18.999 8.78983 19.184C8.84113 19.3691 8.93946 19.5377 9.07525 19.6735C9.21103 19.8093 9.37965 19.9076 9.5647 19.9589C9.74975 20.0102 9.94493 20.0127 10.1313 19.9662L12.0038 19.4975C12.4867 19.3766 12.9278 19.1269 13.28 18.775L19.3163 12.7388C20.2288 11.8263 20.2288 10.3462 19.3163 9.4325H19.315Z" fill="currentColor"/></g>',defs:'<defs><clipPath id="clip0_edit_code"><rect width="20" height="20" fill="white"/></clipPath></defs>'},check:{viewBox:"0 0 16 16",path:'<path d="M13.6572 3.13573C13.8583 2.9465 14.175 2.95614 14.3643 3.15722C14.5535 3.35831 14.5438 3.675 14.3428 3.86425L5.84277 11.8642C5.64597 12.0494 5.33756 12.0446 5.14648 11.8535L1.64648 8.35351C1.45121 8.15824 1.45121 7.84174 1.64648 7.64647C1.84174 7.45121 2.15825 7.45121 2.35351 7.64647L5.50976 10.8027L13.6572 3.13573Z" fill="currentColor"/>'},"chevron-left":{viewBox:"0 0 16 16",path:'<path d="M10.3536 3.14645C10.5488 3.34171 10.5488 3.65829 10.3536 3.85355L6.20711 8L10.3536 12.1464C10.5488 12.3417 10.5488 12.6583 10.3536 12.8536C10.1583 13.0488 9.84171 13.0488 9.64645 12.8536L5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L9.64645 3.14645C9.84171 2.95118 10.1583 2.95118 10.3536 3.14645Z" fill="currentColor"/>'},"more-horizontal":{viewBox:"0 0 16 16",path:'<path d="M5 8C5 8.55229 4.55228 9 4 9C3.44772 9 3 8.55229 3 8C3 7.44772 3.44772 7 4 7C4.55228 7 5 7.44772 5 8ZM9 8C9 8.55229 8.55229 9 8 9C7.44772 9 7 8.55229 7 8C7 7.44772 7.44772 7 8 7C8.55229 7 9 7.44772 9 8ZM12 9C12.5523 9 13 8.55229 13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8C11 8.55229 11.4477 9 12 9Z" fill="currentColor"/>'},copy:{viewBox:"0 0 16 16",path:'<path d="M3 5V12.73C2.4 12.38 2 11.74 2 11V5C2 2.79 3.79 1 6 1H9C9.74 1 10.38 1.4 10.73 2H6C4.35 2 3 3.35 3 5ZM11 15H6C4.897 15 4 14.103 4 13V5C4 3.897 4.897 3 6 3H11C12.103 3 13 3.897 13 5V13C13 14.103 12.103 15 11 15ZM12 5C12 4.448 11.552 4 11 4H6C5.448 4 5 4.448 5 5V13C5 13.552 5.448 14 6 14H11C11.552 14 12 13.552 12 13V5Z" fill="currentColor"/>'},unmute:{viewBox:"0 0 16 16",path:'<path d="M8.69398 2.03934C8.8792 2.11749 8.99961 2.29898 8.99961 2.50001V13.5C8.99961 13.7014 8.87875 13.8832 8.693 13.9611C8.50725 14.039 8.29289 13.9978 8.14921 13.8567L5.22278 10.9817H3.49963C2.67121 10.9817 1.99963 10.3101 1.99963 9.48172V6.49273C1.99963 5.66431 2.67121 4.99273 3.49963 4.99273H5.22402L8.15073 2.14185C8.29474 2.00157 8.50875 1.96119 8.69398 2.03934ZM7.99961 3.68507L5.77617 5.85089C5.68281 5.94184 5.55763 5.99273 5.42729 5.99273H3.49963C3.22349 5.99273 2.99963 6.21659 2.99963 6.49273V9.48172C2.99963 9.75786 3.22349 9.98172 3.49963 9.98172H5.42729C5.55836 9.98172 5.68419 10.0332 5.77769 10.125L7.99961 12.3079V3.68507ZM10.1109 5.18874C10.2828 4.97264 10.5973 4.93682 10.8135 5.10873L10.8143 5.1094L10.8152 5.11015L10.8174 5.11188L10.8228 5.11628L10.8377 5.12882C10.8495 5.13885 10.8648 5.15224 10.8831 5.16904C10.9197 5.20261 10.9685 5.2499 11.0254 5.31119C11.1389 5.43362 11.2853 5.61296 11.4303 5.85143C11.7218 6.33096 12.0039 7.04439 12.0039 7.99855C12.0039 8.95268 11.7218 9.66687 11.4305 10.1471C11.2857 10.3859 11.1393 10.5657 11.0259 10.6884C10.9692 10.7498 10.9204 10.7973 10.8839 10.8309C10.8642 10.849 10.8441 10.8666 10.8236 10.8838L10.8152 10.8907L10.8143 10.8914C10.8143 10.8914 10.368 11.1337 10.1116 10.8129C9.94006 10.5983 9.97396 10.2858 10.1868 10.1128L10.1883 10.1115L10.1876 10.1122L10.1892 10.1108L10.1883 10.1115C10.1912 10.109 10.1975 10.1036 10.2066 10.0952C10.2248 10.0784 10.2543 10.05 10.2914 10.0098C10.3659 9.92923 10.47 9.80248 10.5755 9.62847C10.7851 9.28301 11.0039 8.74609 11.0039 7.99855C11.0039 7.25106 10.7851 6.71522 10.5758 6.3709C10.4703 6.19744 10.3663 6.07121 10.292 5.99105C10.2549 5.95104 10.2255 5.92278 10.2073 5.90613C10.1982 5.89781 10.192 5.89242 10.1891 5.88995L10.1901 5.89071C9.97439 5.71873 9.93908 5.40472 10.1109 5.18874ZM11.8127 3.10886C11.5966 2.93686 11.2821 2.97255 11.1101 3.18858C10.9382 3.40451 10.9743 3.71932 11.19 3.89138L11.2011 3.9006C11.2119 3.90975 11.2295 3.92484 11.2528 3.94582C11.2994 3.98781 11.369 4.05318 11.4538 4.14133C11.6239 4.31792 11.8537 4.58411 12.0841 4.93509C12.5446 5.63643 13.0029 6.66847 13.0029 8.00405C13.0029 9.33953 12.5446 10.3694 12.0845 11.0685C11.8541 11.4184 11.6244 11.6835 11.4545 11.8593C11.3697 11.947 11.3002 12.0121 11.2536 12.0538C11.2303 12.0747 11.2128 12.0897 11.202 12.0988L11.1904 12.1083L11.1895 12.1091C10.9742 12.2808 10.9382 12.5945 11.1093 12.8105C11.2808 13.0269 11.596 13.0628 11.8125 12.8913L11.8455 12.8642C11.864 12.8487 11.8895 12.8268 11.9209 12.7986C11.9838 12.7423 12.0707 12.6607 12.1735 12.5543C12.3789 12.3418 12.6496 12.0286 12.9197 11.6183C13.4604 10.797 14.0029 9.57884 14.0029 8.00405C14.0029 6.42934 13.4605 5.20938 12.9201 4.38627C12.6501 3.97503 12.3795 3.66089 12.1742 3.4477C12.0714 3.34097 11.9846 3.25908 11.9217 3.20255C11.8903 3.17426 11.8649 3.15228 11.8464 3.13665L11.8239 3.11798L11.8169 3.11222L11.8144 3.11024L11.8127 3.10886ZM10.1891 5.88995L10.1877 5.88874L10.1891 5.88995Z" fill="currentColor"/>'},"share-ios":{viewBox:"0 0 16 16",path:'<path d="M12.5713 8.50795V11.5556C12.5713 11.825 12.4509 12.0834 12.2366 12.2739C12.0223 12.4644 11.7316 12.5714 11.4285 12.5714H4.57132C4.26822 12.5714 3.97753 12.4644 3.7632 12.2739C3.54887 12.0834 3.42847 11.825 3.42847 11.5556V8.50795M7.9999 9.52383V3.42859M7.9999 3.42859L5.9999 5.20637M7.9999 3.42859L9.9999 5.20637" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none"/>'}},Lt=class $s{constructor(t){this.sanitizer=t}name="";width="24";height="24";fill="none";dropShadow="";get viewBox(){return Ul[this.name]?.viewBox||"0 0 24 24"}get svgContent(){let t=Ul[this.name];if(!t)return"";let n=t.path+(t.defs||"");return this.sanitizer.bypassSecurityTrustHtml(n)}static \u0275fac=function(t){return new(t||$s)(j(tp))};static \u0275cmp=Ae({type:$s,selectors:[["app-icon"]],inputs:{name:"name",width:"width",height:"height",fill:"fill",dropShadow:"dropShadow"},decls:1,vars:7,consts:[["xmlns","http://www.w3.org/2000/svg",3,"innerHTML"]],template:function(t,n){t&1&&(sg(),hh(0,"svg",0)),t&2&&(bh("filter",n.dropShadow),fh("innerHTML",n.svgContent,bd),sa("width",n.width)("height",n.height)("viewBox",n.viewBox)("fill",n.fill))},dependencies:[ke],styles:["[_nghost-%COMP%]{display:inline-block;line-height:0}"]})},me={TITLE:"App Agent",WELCOME:{GREETING:"Hi!",TEXT:"Welcome to Open as App!",DESCRIPTION:"I'm your AI assistant, and I'm here to help you get started.",PERSONALIZATION:"To personalize my guidance, could you tell me what you're hoping to do?"},INPUT:{PLACEHOLDER:"Ask me anything..."},SUGGESTIONS:["What is this app about?","Why use an AI Agent?","What will be possible?"],DATE:{LABELS:{TODAY:"Today",YESTERDAY:"Yesterday"},MONTH_NAMES:["January","February","March","April","May","June","July","August","September","October","November","December"]}},V5=class qs{title=me.TITLE;menuClick=new N;closeClick=new N;onMenuClick(){this.menuClick.emit()}onCloseClick(){this.closeClick.emit()}static \u0275fac=function(t){return new(t||qs)};static \u0275cmp=Ae({type:qs,selectors:[["app-header"]],inputs:{title:"title"},outputs:{menuClick:"menuClick",closeClick:"closeClick"},decls:9,vars:1,consts:[[1,"header"],["aria-label","Menu",1,"icon-button","menu-button",3,"click"],["name","list-selection","width","24","height","24"],[1,"header-title"],["name","header-rocket-icon","width","24","height","24",1,"title-icon"],["aria-label","Close",1,"icon-button","header-close-button",3,"click"],["name","close","width","24","height","24"]],template:function(t,n){t&1&&(f(0,"div",0)(1,"button",1),x("click",function(){return n.onMenuClick()}),H(2,"app-icon",2),m(),f(3,"div",3),H(4,"app-icon",4),f(5,"span"),z(6),m()(),f(7,"button",5),x("click",function(){return n.onCloseClick()}),H(8,"app-icon",6),m()()),t&2&&(_(6),be(n.title))},dependencies:[ke,Lt],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:#fff;border-bottom:1px solid #f0f0f0;min-height:56px;box-sizing:border-box;flex-shrink:0}@media (max-width: 768px){.header[_ngcontent-%COMP%]{min-height:52px;padding:10px 12px}}.icon-button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;border-radius:8px;transition:background-color .2s;color:#333}.icon-button[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.icon-button[_ngcontent-%COMP%]:active{background-color:#e0e0e0}.header-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:20px;font-weight:600;color:#f43e83;flex:1;justify-content:center}.title-icon[_ngcontent-%COMP%]{width:24px;height:24px}.menu-button[_ngcontent-%COMP%], .header-close-button[_ngcontent-%COMP%]{width:40px;height:40px}.header-close-button[_ngcontent-%COMP%]{background-color:#f5f5f5;border-radius:50%}.header-close-button[_ngcontent-%COMP%]:hover{background-color:#e8e8e8}"]})},R5=class Gs{text="";disabled=!1;buttonClick=new N;onClick(){this.disabled||this.buttonClick.emit(this.text)}static \u0275fac=function(t){return new(t||Gs)};static \u0275cmp=Ae({type:Gs,selectors:[["app-suggestion-button"]],inputs:{text:"text",disabled:"disabled"},outputs:{buttonClick:"buttonClick"},decls:2,vars:3,consts:[[1,"suggestion-button",3,"click"]],template:function(t,n){t&1&&(oa(0,"button",0),gh("click",function(){return n.onClick()}),z(1),aa()),t&2&&(Ie("disabled",n.disabled),_(),An(" ",n.text," "))},dependencies:[ke],styles:[".suggestion-button[_ngcontent-%COMP%]{background:#fff;border:1.5px solid #F43E83;border-radius:8px;padding:14px 24px;font-size:15px;font-weight:500;color:#f43e83;cursor:pointer;transition:all .2s ease;white-space:nowrap;box-shadow:0 2px 4px #0000000d;display:inline-block;width:auto;text-align:center}.suggestion-button[_ngcontent-%COMP%]:hover:not(.disabled){background:#fff5f5;border-color:#d42c6f;transform:translateY(-1px);box-shadow:0 4px 8px #f43e8326}.suggestion-button[_ngcontent-%COMP%]:active:not(.disabled){transform:translateY(0);box-shadow:0 2px 4px #0000000d}.suggestion-button.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed}"]})},rp=(()=>{class e{_renderer;_elementRef;onChange=n=>{};onTouched=()=>{};constructor(n,r){this._renderer=n,this._elementRef=r}setProperty(n,r){this._renderer.setProperty(this._elementRef.nativeElement,n,r)}registerOnTouched(n){this.onTouched=n}registerOnChange(n){this.onChange=n}setDisabledState(n){this.setProperty("disabled",n)}static \u0275fac=function(n){return new(n||e)(j(ea),j(Et))};static \u0275dir=_e({type:e})}return e})(),N5=(()=>{class e extends rp{static \u0275fac=(()=>{let n;return function(r){return(n||(n=Wc(e)))(r||e)}})();static \u0275dir=_e({type:e,features:[ln]})}return e})(),ip=new M(""),F5={provide:ip,useExisting:Vn(()=>$n),multi:!0};function H5(){let e=ei()?ei().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}var j5=new M(""),$n=(()=>{class e extends rp{_compositionMode;_composing=!1;constructor(n,r,i){super(n,r),this._compositionMode=i,this._compositionMode==null&&(this._compositionMode=!H5())}writeValue(n){let r=n??"";this.setProperty("value",r)}_handleInput(n){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(n)}_compositionStart(){this._composing=!0}_compositionEnd(n){this._composing=!1,this._compositionMode&&this.onChange(n)}static \u0275fac=function(n){return new(n||e)(j(ea),j(Et),j(j5,8))};static \u0275dir=_e({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(n,r){n&1&&x("input",function(i){return r._handleInput(i.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(i){return r._compositionEnd(i.target.value)})},standalone:!1,features:[ha([F5]),ln]})}return e})();function z5(e){return e==null?null:Array.isArray(e)||typeof e=="string"?e.length:e instanceof Set?e.size:null}var sp=new M(""),B5=new M("");function U5(e){return t=>{let n=t.value?.length??z5(t.value);return n!==null&&n>e?{maxlength:{requiredLength:e,actualLength:n}}:null}}function Zl(e){return null}function op(e){return e!=null}function ap(e){return ia(e)?po(e):e}function lp(e){let t={};return e.forEach(n=>{t=n!=null?T(T({},t),n):t}),Object.keys(t).length===0?null:t}function up(e,t){return t.map(n=>n(e))}function Z5(e){return!e.validate}function cp(e){return e.map(t=>Z5(t)?t:n=>t.validate(n))}function $5(e){if(!e)return null;let t=e.filter(op);return t.length==0?null:function(n){return lp(up(n,t))}}function dp(e){return e!=null?$5(cp(e)):null}function q5(e){if(!e)return null;let t=e.filter(op);return t.length==0?null:function(n){let r=up(n,t).map(ap);return Yf(r).pipe(Te(lp))}}function hp(e){return e!=null?q5(cp(e)):null}function $l(e,t){return e===null?[t]:Array.isArray(e)?[...e,t]:[e,t]}function G5(e){return e._rawValidators}function W5(e){return e._rawAsyncValidators}function Ws(e){return e?Array.isArray(e)?e:[e]:[]}function ni(e,t){return Array.isArray(e)?e.includes(t):e===t}function ql(e,t){let n=Ws(t);return Ws(e).forEach(r=>{ni(n,r)||n.push(r)}),n}function Gl(e,t){return Ws(t).filter(n=>!ni(e,n))}var pp=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=dp(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=hp(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,t){return this.control?this.control.hasError(e,t):!1}getError(e,t){return this.control?this.control.getError(e,t):null}},Q5=class extends pp{name;get formDirective(){return null}get path(){return null}},ba=class extends pp{_parent=null;name=null;valueAccessor=null},Y5=class{_cd;constructor(e){this._cd=e}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},K5={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},d3=V(T({},K5),{"[class.ng-submitted]":"isSubmitted"}),wa=(()=>{class e extends Y5{constructor(n){super(n)}static \u0275fac=function(n){return new(n||e)(j(ba,2))};static \u0275dir=_e({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(n,r){n&2&&Ie("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[ln]})}return e})(),hn="VALID",ar="INVALID",At="PENDING",pn="DISABLED",qn=class{},Wl=class extends qn{value;source;constructor(e,t){super(),this.value=e,this.source=t}},os=class extends qn{pristine;source;constructor(e,t){super(),this.pristine=e,this.source=t}},as=class extends qn{touched;source;constructor(e,t){super(),this.touched=e,this.source=t}},lr=class extends qn{status;source;constructor(e,t){super(),this.status=e,this.source=t}},J5=class extends qn{source;constructor(e){super(),this.source=e}};function X5(e){return(Oi(e)?e.validators:e)||null}function eb(e){return Array.isArray(e)?dp(e):e||null}function tb(e,t){return(Oi(t)?t.asyncValidators:e)||null}function nb(e){return Array.isArray(e)?hp(e):e||null}function Oi(e){return e!=null&&!Array.isArray(e)&&typeof e=="object"}var rb=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(e,t){this._assignValidators(e),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get status(){return Dt(this.statusReactive)}set status(e){Dt(()=>this.statusReactive.set(e))}_status=st(()=>this.statusReactive());statusReactive=le(void 0);get valid(){return this.status===hn}get invalid(){return this.status===ar}get pending(){return this.status==At}get disabled(){return this.status===pn}get enabled(){return this.status!==pn}errors;get pristine(){return Dt(this.pristineReactive)}set pristine(e){Dt(()=>this.pristineReactive.set(e))}_pristine=st(()=>this.pristineReactive());pristineReactive=le(!0);get dirty(){return!this.pristine}get touched(){return Dt(this.touchedReactive)}set touched(e){Dt(()=>this.touchedReactive.set(e))}_touched=st(()=>this.touchedReactive());touchedReactive=le(!1);get untouched(){return!this.touched}_events=new Je;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(ql(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(ql(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(Gl(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(Gl(e,this._rawAsyncValidators))}hasValidator(e){return ni(this._rawValidators,e)}hasAsyncValidator(e){return ni(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){let t=this.touched===!1;this.touched=!0;let n=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsTouched(V(T({},e),{sourceControl:n})),t&&e.emitEvent!==!1&&this._events.next(new as(!0,n))}markAllAsDirty(e={}){this.markAsDirty({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsDirty(e))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){let t=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let n=e.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:n})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,n),t&&e.emitEvent!==!1&&this._events.next(new as(!1,n))}markAsDirty(e={}){let t=this.pristine===!0;this.pristine=!1;let n=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsDirty(V(T({},e),{sourceControl:n})),t&&e.emitEvent!==!1&&this._events.next(new os(!1,n))}markAsPristine(e={}){let t=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let n=e.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e,n),t&&e.emitEvent!==!1&&this._events.next(new os(!0,n))}markAsPending(e={}){this.status=At;let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new lr(this.status,t)),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.markAsPending(V(T({},e),{sourceControl:t}))}disable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=pn,this.errors=null,this._forEachChild(r=>{r.disable(V(T({},e),{onlySelf:!0}))}),this._updateValue();let n=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new Wl(this.value,n)),this._events.next(new lr(this.status,n)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(V(T({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=hn,this._forEachChild(n=>{n.enable(V(T({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(V(T({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(n=>n(!1))}_updateAncestors(e,t){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine({},t),this._parent._updateTouched({},t))}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let n=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===hn||this.status===At)&&this._runAsyncValidator(n,e.emitEvent)}let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new Wl(this.value,t)),this._events.next(new lr(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(V(T({},e),{sourceControl:t}))}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?pn:hn}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=At,this._hasOwnPendingAsyncValidator={emitEvent:t!==!1,shouldHaveEmitted:e!==!1};let n=ap(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:t,shouldHaveEmitted:e})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let e=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(t.emitEvent!==!1,this,t.shouldHaveEmitted)}get(e){let t=e;return t==null||(Array.isArray(t)||(t=t.split(".")),t.length===0)?null:t.reduce((n,r)=>n&&n._find(r),this)}getError(e,t){let n=t?this.get(t):this;return n&&n.errors?n.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e,t,n){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),(e||n)&&this._events.next(new lr(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,n)}_initObservables(){this.valueChanges=new N,this.statusChanges=new N}_calculateStatus(){return this._allControlsDisabled()?pn:this.errors?ar:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(At)?At:this._anyControlsHaveStatus(ar)?ar:hn}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e,t){let n=!this._anyControlsDirty(),r=this.pristine!==n;this.pristine=n,this._parent&&!e.onlySelf&&this._parent._updatePristine(e,t),r&&this._events.next(new os(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new as(this.touched,t)),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,t)}_onDisabledChange=[];_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){Oi(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){let t=this._parent&&this._parent.dirty;return!e&&!!t&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=eb(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=nb(this._rawAsyncValidators)}},fp=new M("",{providedIn:"root",factory:()=>_a}),_a="always";function ib(e,t){return[...t.path,e]}function sb(e,t,n=_a){ab(e,t),t.valueAccessor.writeValue(e.value),(e.disabled||n==="always")&&t.valueAccessor.setDisabledState?.(e.disabled),lb(e,t),cb(e,t),ub(e,t),ob(e,t)}function Ql(e,t){e.forEach(n=>{n.registerOnValidatorChange&&n.registerOnValidatorChange(t)})}function ob(e,t){if(t.valueAccessor.setDisabledState){let n=r=>{t.valueAccessor.setDisabledState(r)};e.registerOnDisabledChange(n),t._registerOnDestroy(()=>{e._unregisterOnDisabledChange(n)})}}function ab(e,t){let n=G5(e);t.validator!==null?e.setValidators($l(n,t.validator)):typeof n=="function"&&e.setValidators([n]);let r=W5(e);t.asyncValidator!==null?e.setAsyncValidators($l(r,t.asyncValidator)):typeof r=="function"&&e.setAsyncValidators([r]);let i=()=>e.updateValueAndValidity();Ql(t._rawValidators,i),Ql(t._rawAsyncValidators,i)}function lb(e,t){t.valueAccessor.registerOnChange(n=>{e._pendingValue=n,e._pendingChange=!0,e._pendingDirty=!0,e.updateOn==="change"&&gp(e,t)})}function ub(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,e.updateOn==="blur"&&e._pendingChange&&gp(e,t),e.updateOn!=="submit"&&e.markAsTouched()})}function gp(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function cb(e,t){let n=(r,i)=>{t.valueAccessor.writeValue(r),i&&t.viewToModelUpdate(r)};e.registerOnChange(n),t._registerOnDestroy(()=>{e._unregisterOnChange(n)})}function db(e,t){if(!e.hasOwnProperty("model"))return!1;let n=e.model;return n.isFirstChange()?!0:!Object.is(t,n.currentValue)}function hb(e){return Object.getPrototypeOf(e.constructor)===N5}function pb(e,t){if(!t)return null;Array.isArray(t);let n,r,i;return t.forEach(s=>{s.constructor===$n?n=s:hb(s)?r=s:i=s}),i||r||n||null}function Yl(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Kl(e){return typeof e=="object"&&e!==null&&Object.keys(e).length===2&&"value"in e&&"disabled"in e}var fb=class extends rb{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(e=null,t,n){super(X5(t),tb(n,t)),this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Oi(t)&&(t.nonNullable||t.initialValueIsDefault)&&(Kl(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&t.emitModelToViewChange!==!1&&this._onChange.forEach(n=>n(this.value,t.emitViewToModelChange!==!1)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1,t?.emitEvent!==!1&&this._events.next(new J5(this))}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){Yl(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){Yl(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){Kl(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}},gb={provide:ba,useExisting:Vn(()=>Ei)},Jl=Promise.resolve(),Ei=(()=>{class e extends ba{_changeDetectorRef;callSetDisabledState;control=new fb;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new N;constructor(n,r,i,s,o,a){super(),this._changeDetectorRef=o,this.callSetDisabledState=a,this._parent=n,this._setValidators(r),this._setAsyncValidators(i),this.valueAccessor=pb(this,s)}ngOnChanges(n){if(this._checkForErrors(),!this._registered||"name"in n){if(this._registered&&(this._checkName(),this.formDirective)){let r=n.name.previousValue;this.formDirective.removeControl({name:r,path:this._getPath(r)})}this._setUpControl()}"isDisabled"in n&&this._updateDisabled(n),db(n,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(n){this.viewModel=n,this.update.emit(n)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){sb(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(n){Jl.then(()=>{this.control.setValue(n,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(n){let r=n.isDisabled.currentValue,i=r!==0&&Dy(r);Jl.then(()=>{i&&!this.control.disabled?this.control.disable():!i&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(n){return this._parent?ib(n,this._parent):[n]}static \u0275fac=function(n){return new(n||e)(j(Q5,9),j(sp,10),j(B5,10),j(ip,10),j(ky,8),j(fp,8))};static \u0275dir=_e({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[ha([gb]),ln,gi]})}return e})();function mb(e){return typeof e=="number"?e:parseInt(e,10)}var vb=(()=>{class e{_validator=Zl;_onChange;_enabled;ngOnChanges(n){if(this.inputName in n){let r=this.normalizeInput(n[this.inputName].currentValue);this._enabled=this.enabled(r),this._validator=this._enabled?this.createValidator(r):Zl,this._onChange&&this._onChange()}}validate(n){return this._validator(n)}registerOnValidatorChange(n){this._onChange=n}enabled(n){return n!=null}static \u0275fac=function(n){return new(n||e)};static \u0275dir=_e({type:e,features:[gi]})}return e})(),yb={provide:sp,useExisting:Vn(()=>mp),multi:!0},mp=(()=>{class e extends vb{maxlength;inputName="maxlength";normalizeInput=n=>mb(n);createValidator=n=>U5(n);static \u0275fac=(()=>{let n;return function(r){return(n||(n=Wc(e)))(r||e)}})();static \u0275dir=_e({type:e,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(n,r){n&2&&sa("maxlength",r._enabled?r.maxlength:null)},inputs:{maxlength:"maxlength"},standalone:!1,features:[ha([yb]),ln]})}return e})(),Cb=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=_i({type:e});static \u0275inj=oi({})}return e})(),xa=(()=>{class e{static withConfig(n){return{ngModule:e,providers:[{provide:fp,useValue:n.callSetDisabledState??_a}]}}static \u0275fac=function(n){return new(n||e)};static \u0275mod=_i({type:e});static \u0275inj=oi({imports:[Cb]})}return e})();function bb(e,t){if(e&1){let n=xe();f(0,"button",11),x("click",function(){L(n);let r=O();return D(r.onSubmit())}),H(1,"app-icon",12),m()}if(e&2){let n=O();P("disabled",n.disabled||!n.value.trim())}}function wb(e,t){if(e&1){let n=xe();f(0,"button",13),x("click",function(){L(n);let r=O();return D(r.onStopClick())}),H(1,"app-icon",14),m()}}var _b=class Qs{placeholder=me.INPUT.PLACEHOLDER;disabled=!1;value="";voiceStatus={state:"idle",transcript:"",interimTranscript:""};isLoadingResponse=!1;valueChange=new N;submitMessage=new N;voiceClick=new N;addClick=new N;settingsClick=new N;stopClick=new N;get isListening(){return this.voiceStatus.state==="listening"}get displayValue(){if(this.isLoadingResponse)return"Thinking....";if(this.isListening){let t=this.voiceStatus.transcript||"",n=this.voiceStatus.interimTranscript||"";return t+(t&&n?" ":"")+n}return this.value}get displayPlaceholder(){return this.isLoadingResponse?"":this.isListening?"Listening... Speak now":this.placeholder}onInputChange(t){!this.isListening&&t!==void 0&&(this.value=t,this.valueChange.emit(this.value))}onSubmit(){if(this.value.trim()&&!this.isListening){let t=this.value;this.value="",this.valueChange.emit(this.value),this.submitMessage.emit(t)}}onVoiceClick(){this.voiceClick.emit()}onAddClick(){this.addClick.emit()}onSettingsClick(){this.settingsClick.emit()}onStopClick(){this.stopClick.emit()}static \u0275fac=function(t){return new(t||Qs)};static \u0275cmp=Ae({type:Qs,selectors:[["app-input-field"]],inputs:{placeholder:"placeholder",disabled:"disabled",value:"value",voiceStatus:"voiceStatus",isLoadingResponse:"isLoadingResponse"},outputs:{valueChange:"valueChange",submitMessage:"submitMessage",voiceClick:"voiceClick",addClick:"addClick",settingsClick:"settingsClick",stopClick:"stopClick"},decls:11,vars:12,consts:[[1,"input-container"],[1,"input-wrapper"],["aria-label","Add",1,"icon-button","add-button",3,"click"],["name","add","width","24","height","24"],["aria-label","Settings",1,"icon-button","settings-button",3,"click"],["name","settings","width","24","height","24"],["type","text",1,"input-field",3,"ngModelChange","keyup.enter","ngModel","placeholder","disabled","readonly"],["aria-label","Voice input",1,"icon-button","voice-button",3,"click"],["name","microphone","width","24","height","24","fill","currentColor"],["class","icon-button send-button","aria-label","Send message",3,"disabled","click",4,"ngIf"],["class","icon-button stop-button","aria-label","Stop response",3,"click",4,"ngIf"],["aria-label","Send message",1,"icon-button","send-button",3,"click","disabled"],["name","send-filled","width","24","height","24"],["aria-label","Stop response",1,"icon-button","stop-button",3,"click"],["name","stop-circle-filled","width","24","height","24"]],template:function(t,n){t&1&&(f(0,"div",0)(1,"div",1)(2,"button",2),x("click",function(){return n.onAddClick()}),H(3,"app-icon",3),m(),f(4,"button",4),x("click",function(){return n.onSettingsClick()}),H(5,"app-icon",5),m(),f(6,"input",6),x("ngModelChange",function(r){return n.onInputChange(r)})("keyup.enter",function(){return n.onSubmit()}),m(),f(7,"button",7),x("click",function(){return n.onVoiceClick()}),H(8,"app-icon",8),m(),re(9,bb,2,1,"button",9)(10,wb,2,0,"button",10),m()()),t&2&&(_(6),Ie("listening",n.isListening)("thinking",n.isLoadingResponse),P("ngModel",n.displayValue)("placeholder",n.displayPlaceholder)("disabled",n.disabled||n.isListening)("readonly",n.isListening||n.isLoadingResponse),_(),Ie("active",n.isListening),_(2),P("ngIf",!n.isLoadingResponse),_(),P("ngIf",n.isLoadingResponse))},dependencies:[ke,It,xa,$n,wa,Ei,Lt],styles:[".input-container[_ngcontent-%COMP%]{padding:12px 16px;background:#fff;border-top:1px solid #f0f0f0;flex-shrink:0;box-sizing:border-box}@media (max-width: 768px){.input-container[_ngcontent-%COMP%]{padding:10px 12px}}@media (max-height: 600px){.input-container[_ngcontent-%COMP%]{padding:8px 12px}}.input-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;background:#f8f8f8;border-radius:12px;padding:8px 16px;transition:background-color .2s;flex-wrap:nowrap}.input-wrapper[_ngcontent-%COMP%]:focus-within{background:#f0f0f0}.input-field[_ngcontent-%COMP%]{flex:1;border:none;background:transparent;font-size:15px;color:#333;outline:none;padding:8px 0}.input-field[_ngcontent-%COMP%]::placeholder{color:#999;font-family:Roboto Medium,Roboto,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-weight:500}.input-field[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.input-field.listening[_ngcontent-%COMP%]{color:#f43e83;font-style:italic}.input-field.thinking[_ngcontent-%COMP%]{color:#999;font-family:Roboto Medium,Roboto,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-weight:500}.icon-button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background-color .2s;color:#666;min-width:40px;min-height:40px}.icon-button[_ngcontent-%COMP%]:hover{background-color:#0000000d;color:#333}.icon-button[_ngcontent-%COMP%]:active{background-color:#0000001a}.voice-button.active[_ngcontent-%COMP%]{color:#f43e83;animation:_ngcontent-%COMP%_pulse 1.5s ease-in-out infinite}.send-button[_ngcontent-%COMP%]{color:#333}.send-button[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.send-button[_ngcontent-%COMP%]:disabled:hover{background-color:transparent}.settings-button[_ngcontent-%COMP%]{color:#666}.stop-button[_ngcontent-%COMP%]{color:#333}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:1}50%{opacity:.6}}@media (max-width: 768px){.input-container[_ngcontent-%COMP%]{padding:8px 12px;overflow:hidden}.input-wrapper[_ngcontent-%COMP%]{gap:4px;padding:6px 10px;overflow:hidden}.input-field[_ngcontent-%COMP%]{font-size:14px;padding:6px 0;min-width:0}.icon-button[_ngcontent-%COMP%]{padding:4px;width:28px;height:28px;min-width:28px;min-height:28px;max-width:28px;max-height:28px;flex-shrink:0;display:flex;align-items:center;justify-content:center}.icon-button[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{width:20px!important;height:20px!important;display:block!important;vertical-align:middle!important;line-height:0!important}.icon-button[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:20px!important;height:20px!important;display:block!important}}@media (max-width: 400px){.input-wrapper[_ngcontent-%COMP%]{gap:2px;padding:4px 6px}.icon-button[_ngcontent-%COMP%]{padding:2px;width:24px;height:24px;min-width:24px;min-height:24px;max-width:24px;max-height:24px}.icon-button[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{width:16px!important;height:16px!important;display:block!important;vertical-align:middle!important;line-height:0!important}.icon-button[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:16px!important;height:16px!important;display:block!important}.send-button[_ngcontent-%COMP%], .stop-button[_ngcontent-%COMP%]{padding:2px;width:24px;height:24px;min-width:24px;min-height:24px;max-width:24px;max-height:24px}.send-button[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%], .stop-button[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{width:16px!important;height:16px!important;display:block!important;vertical-align:middle!important;line-height:0!important}.send-button[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .stop-button[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:16px!important;height:16px!important;display:block!important}.input-field[_ngcontent-%COMP%]{font-size:13px;padding:4px 0}}"]})};function xb(e,t){e&1&&(f(0,"div",7),H(1,"span")(2,"span")(3,"span"),m())}function kb(e,t){if(e&1&&H(0,"div",8),e&2){let n=O();P("innerHTML",n.message.text,bd)}}function Sb(e,t){if(e&1){let n=xe();f(0,"div",9)(1,"button",10),x("click",function(){L(n);let r=O();return D(r.onCopyClick())}),H(2,"app-icon",11),m(),f(3,"button",12),x("click",function(){L(n);let r=O();return D(r.onShareClick())}),H(4,"app-icon",13),m(),f(5,"button",14),x("click",function(){L(n);let r=O();return D(r.onSpeakClick())}),H(6,"app-icon",15),m()()}}var Mb=class Ys{logger=v(Le);message;get isUser(){return this.message.sender==="user"}get isAssistant(){return this.message.sender==="assistant"}onCopyClick(){let t=document.createElement("div");t.innerHTML=this.message.text;let n=t.textContent||t.innerText||"";navigator.clipboard.writeText(n).then(()=>{this.logger.debug("Message copied to clipboard")},r=>{this.logger.error("Failed to copy message:",r)})}onShareClick(){let t=document.createElement("div");t.innerHTML=this.message.text;let n=t.textContent||t.innerText||"";navigator.share?navigator.share({title:"AI Assistant Message",text:n}).then(()=>{this.logger.debug("Message shared successfully")},r=>{this.logger.error("Failed to share message:",r)}):this.onCopyClick()}onSpeakClick(){let t=document.createElement("div");t.innerHTML=this.message.text;let n=t.textContent||t.innerText||"";if("speechSynthesis"in window){window.speechSynthesis.cancel();let r=new SpeechSynthesisUtterance(n);r.lang="en-US",r.rate=1,r.pitch=1,window.speechSynthesis.speak(r)}else this.logger.warn("Speech synthesis not supported in this browser")}static \u0275fac=function(t){return new(t||Ys)};static \u0275cmp=Ae({type:Ys,selectors:[["app-message"]],inputs:{message:"message"},decls:7,vars:9,consts:[[1,"message"],[1,"message-container"],[1,"message-content"],[1,"message-bubble"],["class","typing-indicator",4,"ngIf"],["class","message-text",3,"innerHTML",4,"ngIf"],["class","message-actions",4,"ngIf"],[1,"typing-indicator"],[1,"message-text",3,"innerHTML"],[1,"message-actions"],["aria-label","Copy message","title","Copy",1,"action-button",3,"click"],["name","copy","width","16","height","16"],["aria-label","Share message","title","Share",1,"action-button",3,"click"],["name","share-ios","width","16","height","16"],["aria-label","Read aloud","title","Read aloud",1,"action-button",3,"click"],["name","unmute","width","16","height","16"]],template:function(t,n){t&1&&(f(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),re(4,xb,4,0,"div",4)(5,kb,1,1,"div",5),m(),re(6,Sb,7,0,"div",6),m()()()),t&2&&(Ie("user",n.isUser)("assistant",n.isAssistant),_(3),Ie("typing",n.message.isTyping),_(),P("ngIf",n.message.isTyping),_(),P("ngIf",!n.message.isTyping),_(),P("ngIf",n.isAssistant&&!n.message.isTyping))},dependencies:[ke,It,Lt],styles:[".message[_ngcontent-%COMP%]{display:flex;margin-bottom:16px;animation:_ngcontent-%COMP%_fadeIn .3s ease-in}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.message-container[_ngcontent-%COMP%]{display:flex;align-items:flex-start;max-width:100%;width:100%}.message.user[_ngcontent-%COMP%] .message-container[_ngcontent-%COMP%]{justify-content:flex-end}.message-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;max-width:85%}.message.user[_ngcontent-%COMP%] .message-content[_ngcontent-%COMP%]{align-items:flex-end}.message-bubble[_ngcontent-%COMP%]{padding:12px 16px;border-radius:10px;word-wrap:break-word;width:fit-content}.message.user[_ngcontent-%COMP%] .message-bubble[_ngcontent-%COMP%]{background:#808b95;color:#fff;border-radius:10px;box-shadow:0 1px 2px #0000001a;transition:background-color .2s ease}.message.user[_ngcontent-%COMP%]:hover .message-bubble[_ngcontent-%COMP%]{background:#6d7a85}.message.assistant[_ngcontent-%COMP%] .message-bubble[_ngcontent-%COMP%]{background:transparent;color:#2c3e50;border:none;box-shadow:none;padding:0}.message-bubble.typing[_ngcontent-%COMP%]{padding:16px;min-width:60px}.message-text[_ngcontent-%COMP%]{margin:0;line-height:1.5;font-size:14px;white-space:normal}.message-text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 8px}.message-text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.message-text[_ngcontent-%COMP%] h1[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] h4[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] h5[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin:12px 0 8px;font-weight:600}.message-text[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]:first-child, .message-text[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]:first-child, .message-text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]:first-child, .message-text[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]:first-child, .message-text[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]:first-child, .message-text[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]:first-child{margin-top:0}.message-text[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .message-text[_ngcontent-%COMP%] ol[_ngcontent-%COMP%]{margin:8px 0;padding-left:24px}.message-text[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:4px 0}.message-text[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600}.message-text[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:italic}.message-text[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:#0000000d;padding:2px 4px;border-radius:3px;font-family:Courier New,monospace;font-size:13px}.message-text[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{background:#0000000d;padding:12px;border-radius:6px;overflow-x:auto;margin:8px 0}.message-text[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:none;padding:0}.typing-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;height:16px}.typing-indicator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background-color:#95a5a6;animation:_ngcontent-%COMP%_typing 1.4s infinite}.typing-indicator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.typing-indicator[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_typing{0%,60%,to{transform:translateY(0);opacity:.5}30%{transform:translateY(-10px);opacity:1}}.message-actions[_ngcontent-%COMP%]{display:flex;gap:4px;margin-top:4px;opacity:0;transition:opacity .2s ease}.message.assistant[_ngcontent-%COMP%]:hover .message-actions[_ngcontent-%COMP%]{opacity:1}.action-button[_ngcontent-%COMP%]{background:none;border:none;padding:6px;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:4px;color:#808b95;transition:all .2s ease}.action-button[_ngcontent-%COMP%]:hover{background-color:#808b951a;color:#6d7a85}.action-button[_ngcontent-%COMP%]:active{transform:scale(.95);background-color:#808b9533}@media (max-width: 768px){.message-bubble[_ngcontent-%COMP%]{max-width:90%}.message-actions[_ngcontent-%COMP%]{opacity:1}.action-button[_ngcontent-%COMP%]{padding:8px}}"]})},Ob=["messagesContainer"];function Eb(e,t){if(e&1&&H(0,"app-message",10),e&2){let n=t.$implicit;P("message",n)}}function Tb(e,t){if(e&1&&(la(0),f(1,"div",7)(2,"span",8),z(3),m()(),re(4,Eb,1,1,"app-message",9),ua()),e&2){let n=t.$implicit,r=O(2);_(3),be(n.date),_(),P("ngForOf",n.messages)("ngForTrackBy",r.trackByMessageId)}}function Pb(e,t){if(e&1&&(f(0,"div",5),re(1,Tb,5,3,"ng-container",6),m()),e&2){let n=O();_(),P("ngForOf",n.messageGroups)}}function Ib(e,t){e&1&&(f(0,"div",11)(1,"p",12),z(2,"Start a conversation by typing a message or selecting a suggestion below."),m()())}var Lb=class Ks{messages=[];canLoadMore=!1;isLoadingMore=!1;loadMore=new N;messagesContainer;messageGroups=[];restoreScrollAfterPrepend=!1;previousScrollHeight=0;suppressNextScroll=!1;lastScrollTop=Number.MAX_SAFE_INTEGER;scrollInitialized=!1;initialScrollPending=!0;initialScrollRequested=!1;get container(){return this.messagesContainer?.nativeElement??null}ngAfterViewChecked(){if(this.restoreScrollAfterPrepend&&this.messagesContainer){let t=this.messagesContainer.nativeElement,n=t.scrollHeight-this.previousScrollHeight;t.scrollTop=n+t.scrollTop,this.restoreScrollAfterPrepend=!1}}ngOnChanges(t){if(!t.messages)return;let n=t.messages.currentValue,r=t.messages.previousValue;this.messageGroups=this.groupMessagesByDate(this.messages),this.initialScrollPending?this.queueInitialScroll():this.hasAppendedMessage(r,n)&&this.scrollToBottomAfterRender()}onScroll(){if(!this.canLoadMore)return;let t=this.container;t&&(this.shouldSkipScroll(t)||this.isNearTop(t.scrollTop)&&this.prepareForLoadMore(t))}trackByMessageId(t,n){return n.id}queueInitialScroll(){this.initialScrollRequested||(this.initialScrollRequested=!0,Promise.resolve().then(()=>{let t=this.container;if(!t||!this.initialScrollPending){this.initialScrollRequested=!1;return}this.scrollToBottom(t),this.initialScrollPending=!1,this.initialScrollRequested=!1}))}scrollToBottomAfterRender(){Promise.resolve().then(()=>{let t=this.container;t&&this.scrollToBottom(t)})}scrollToBottom(t){this.suppressNextScroll=!0,t.scrollTop=t.scrollHeight,this.lastScrollTop=t.scrollTop,this.scrollInitialized=!0}triggerLoadMore(t){if(!this.canLoadMore||this.isLoadingMore)return;let n=t??this.container;n&&(this.previousScrollHeight=n.scrollHeight,this.restoreScrollAfterPrepend=!0),this.loadMore.emit()}hasAppendedMessage(t,n){if(!n||n.length===0)return!1;if(!t||t.length===0)return!0;if(n.length<=t.length)return!1;let r=t[t.length-1]?.id;return n[n.length-1]?.id!==r}shouldSkipScroll(t){let n=t.scrollTop,r=t.scrollHeight,i=t.clientHeight;if(this.suppressNextScroll)return this.suppressNextScroll=!1,this.lastScrollTop=n,!0;if(r<=i+200)return this.lastScrollTop=n,!0;if(!this.scrollInitialized)return this.scrollInitialized=!0,this.lastScrollTop=n,!0;let s=n<this.lastScrollTop;return this.lastScrollTop=n,!s}isNearTop(t){return t<=200}prepareForLoadMore(t){this.suppressNextScroll=!0,this.triggerLoadMore(t)}groupMessagesByDate(t){let n={};return t.forEach(r=>{let i=this.getDateKey(r.timestamp);n[i]||(n[i]=[]),n[i].push(r)}),Object.keys(n).map(r=>({date:this.formatDateLabel(r),messages:n[r]}))}getDateKey(t){let n=new Date(t);return`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}`}formatDateLabel(t){let n=new Date,r=new Date(n);r.setDate(r.getDate()-1);let i=this.getDateKey(n),s=this.getDateKey(r);if(t===i)return me.DATE.LABELS.TODAY;if(t===s)return me.DATE.LABELS.YESTERDAY;let[o,a,l]=t.split("-").map(Number),u=new Date(o,a-1,l);return`${l} ${me.DATE.MONTH_NAMES[u.getMonth()]}`}static \u0275fac=function(t){return new(t||Ks)};static \u0275cmp=Ae({type:Ks,selectors:[["app-chat-history"]],viewQuery:function(t,n){if(t&1&&vh(Ob,5),t&2){let r;yh(r=Ch())&&(n.messagesContainer=r.first)}},inputs:{messages:"messages",canLoadMore:"canLoadMore",isLoadingMore:"isLoadingMore"},outputs:{loadMore:"loadMore"},features:[gi],decls:5,vars:2,consts:[["messagesContainer",""],[1,"chat-history"],[1,"messages-container",3,"scroll"],["class","messages-list",4,"ngIf"],["class","empty-state",4,"ngIf"],[1,"messages-list"],[4,"ngFor","ngForOf"],[1,"date-separator"],[1,"date-label"],[3,"message",4,"ngFor","ngForOf","ngForTrackBy"],[3,"message"],[1,"empty-state"],[1,"empty-text"]],template:function(t,n){if(t&1){let r=xe();f(0,"div",1)(1,"div",2,0),x("scroll",function(){return L(r),D(n.onScroll())}),re(3,Pb,2,1,"div",3)(4,Ib,3,0,"div",4),m()()}t&2&&(_(3),P("ngIf",n.messages.length>0),_(),P("ngIf",n.messages.length===0))},dependencies:[ke,ki,It,Mb],styles:[".chat-history[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;width:100%;min-height:0;max-height:100%}.messages-container[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;padding:16px;scroll-behavior:smooth;min-height:0;-webkit-overflow-scrolling:touch}.messages-container[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.messages-container[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.messages-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#0003;border-radius:3px}.messages-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#0000004d}.messages-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.date-separator[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;margin:16px 0 12px}.date-label[_ngcontent-%COMP%]{color:#95a5a6;font-size:13px;font-weight:500;padding:4px 12px;background:#95a5a61a;border-radius:12px}.empty-state[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%;padding:32px}.empty-text[_ngcontent-%COMP%]{color:#95a5a6;font-size:14px;text-align:center;line-height:1.6;max-width:400px}"]})};function Db(e,t){if(e&1){let n=xe();f(0,"div",1),x("click",function(){L(n);let r=O();return D(r.onOverlayClick())}),f(1,"div",2),x("click",function(r){L(n);let i=O();return D(i.onModalClick(r))}),f(2,"div",3)(3,"button",4),x("click",function(){L(n);let r=O();return D(r.onBackClick())}),H(4,"app-icon",5),m(),f(5,"h2",6),z(6,"Rename Chat"),m(),f(7,"button",7),x("click",function(){L(n);let r=O();return D(r.onCloseClick())}),H(8,"app-icon",8),m()(),f(9,"div",9)(10,"input",10),da("ngModelChange",function(r){L(n);let i=O();return _h(i.editedTitle,r)||(i.editedTitle=r),D(r)}),x("keydown",function(r){L(n);let i=O();return D(i.onInputKeydown(r))}),m()(),f(11,"div",11)(12,"button",12),x("click",function(){L(n);let r=O();return D(r.onCancel())}),z(13," Cancel "),m(),f(14,"button",13),x("click",function(){L(n);let r=O();return D(r.onSave())}),z(15," Save "),m()()()()}if(e&2){let n=O();_(10),ca("ngModel",n.editedTitle),P("maxlength",500)}}var Ab=class Js{isOpen=!1;currentTitle="";close=new N;save=new N;editedTitle="";ngOnChanges(t){t.isOpen&&this.isOpen&&(this.editedTitle=this.currentTitle),t.currentTitle&&(this.editedTitle=this.currentTitle)}onBackClick(){this.close.emit()}onCloseClick(){this.close.emit()}onCancel(){this.close.emit()}onSave(){let t=this.editedTitle.trim();t&&t!==this.currentTitle&&this.save.emit(t),this.close.emit()}onOverlayClick(){this.close.emit()}onModalClick(t){t.stopPropagation()}onInputKeydown(t){t.key==="Enter"?(t.preventDefault(),this.onSave()):t.key==="Escape"&&(t.preventDefault(),this.onCancel())}static \u0275fac=function(t){return new(t||Js)};static \u0275cmp=Ae({type:Js,selectors:[["app-rename-modal"]],inputs:{isOpen:"isOpen",currentTitle:"currentTitle"},outputs:{close:"close",save:"save"},features:[gi],decls:1,vars:1,consts:[["class","modal-overlay",3,"click",4,"ngIf"],[1,"modal-overlay",3,"click"],[1,"modal-container",3,"click"],[1,"modal-header"],["aria-label","Back",1,"icon-button","back-button",3,"click"],["name","chevron-left","width","24","height","24"],[1,"modal-title"],["aria-label","Close",1,"icon-button","rename-modal-close-button",3,"click"],["name","close","width","24","height","24"],[1,"modal-body"],["type","text","placeholder","Enter chat name","autofocus","",1,"rename-input",3,"ngModelChange","keydown","ngModel","maxlength"],[1,"modal-footer"],[1,"btn","btn-cancel",3,"click"],[1,"btn","btn-save",3,"click"]],template:function(t,n){t&1&&re(0,Db,16,2,"div",0),t&2&&P("ngIf",n.isOpen)},dependencies:[ke,It,xa,$n,wa,mp,Ei,Lt],styles:[".modal-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#00000080;display:flex;align-items:flex-end;justify-content:center;z-index:1000;animation:_ngcontent-%COMP%_fadeIn .2s ease-out;overflow-x:hidden}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}.modal-container[_ngcontent-%COMP%]{background-color:#fff;border-radius:16px 16px 0 0;width:100%;max-width:600px;max-height:90vh;display:flex;flex-direction:column;box-shadow:0 -2px 24px #00000026;animation:_ngcontent-%COMP%_slideUp .3s ease-out;box-sizing:border-box;overflow-x:hidden}@keyframes _ngcontent-%COMP%_slideUp{0%{transform:translateY(100%)}to{transform:translateY(0)}}.modal-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e5e7eb;gap:12px}.modal-title[_ngcontent-%COMP%]{flex:1;text-align:left;font-size:18px;font-weight:600;color:#111827;margin:0}.icon-button[_ngcontent-%COMP%]{background:none;border:none;padding:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:8px;color:#6b7280;transition:all .2s ease}.icon-button[_ngcontent-%COMP%]:hover{background-color:#f3f4f6;color:#111827}.icon-button[_ngcontent-%COMP%]:active{transform:scale(.95)}.back-button[_ngcontent-%COMP%], .rename-modal-close-button[_ngcontent-%COMP%]{flex-shrink:0}.modal-body[_ngcontent-%COMP%]{padding:24px 20px;flex:1;overflow-y:auto;overflow-x:hidden;box-sizing:border-box}.rename-input[_ngcontent-%COMP%]{width:100%;padding:12px 16px;font-size:16px;border:1px solid #d1d5db;border-radius:8px;outline:none;transition:all .2s ease;font-family:inherit;color:#111827;box-sizing:border-box}.rename-input[_ngcontent-%COMP%]:focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.rename-input[_ngcontent-%COMP%]::placeholder{color:#9ca3af}.modal-footer[_ngcontent-%COMP%]{display:flex;gap:12px;padding:16px 20px;border-top:1px solid #e5e7eb;box-sizing:border-box}.btn[_ngcontent-%COMP%]{flex:1;padding:12px 24px;font-size:16px;font-weight:500;border-radius:8px;border:none;cursor:pointer;transition:all .2s ease;font-family:inherit}.btn[_ngcontent-%COMP%]:active{transform:scale(.98)}.btn-cancel[_ngcontent-%COMP%]{background-color:#fff;color:#374151;border:1px solid #d1d5db}.btn-cancel[_ngcontent-%COMP%]:hover{background-color:#f9fafb;border-color:#9ca3af}.btn-save[_ngcontent-%COMP%]{background-color:#f43e83;color:#fff}.btn-save[_ngcontent-%COMP%]:hover{background-color:#d63571}.btn-save[_ngcontent-%COMP%]:disabled{background-color:#fca5a5;cursor:not-allowed}@media (min-width: 768px){.modal-overlay[_ngcontent-%COMP%]{align-items:center}.modal-container[_ngcontent-%COMP%]{border-radius:16px;max-height:400px}}"]})},Vb=["scrollContainer"],Rb=e=>({compact:e});function Nb(e,t){if(e&1){let n=xe();f(0,"div",34)(1,"button",35),x("click",function(r){L(n);let i=O().$implicit,s=O(2);return D(s.onEditClick(i.id,i.title,r))}),H(2,"app-icon",36),f(3,"span"),z(4,"Rename"),m()(),f(5,"button",37),x("click",function(r){L(n);let i=O().$implicit,s=O(2);return D(s.onDeleteClick(i.id,r))}),H(6,"app-icon",38),f(7,"span"),z(8,"Delete"),m()()()}}function Fb(e,t){if(e&1){let n=xe();f(0,"div",25),x("click",function(){let r=L(n).$implicit,i=O(2);return D(i.onConversationClick(r.id))}),f(1,"div",26)(2,"div",27)(3,"span",28),z(4),m()(),f(5,"span",29),z(6),m()(),f(7,"div",30)(8,"button",31),x("click",function(r){let i=L(n).$implicit,s=O(2);return D(s.toggleMenu(i.id,r))}),H(9,"app-icon",32),m(),re(10,Nb,9,0,"div",33),m()()}if(e&2){let n=t.$implicit,r=O(2);_(4),be(n.title),_(2),be(n.date),_(4),P("ngIf",r.isMenuOpen(n.id))}}function Hb(e,t){if(e&1&&(f(0,"div",23),re(1,Fb,11,3,"div",24),m()),e&2){let n=O();_(),P("ngForOf",n.conversations)}}function jb(e,t){if(e&1&&(f(0,"div",39)(1,"div",40),H(2,"div",41),f(3,"p",42),z(4,"Loading conversations..."),m()()()),e&2){let n=O();_(),P("ngClass",ay(1,Rb,!(n.isLoading&&n.conversations.length===0)))}}function zb(e,t){e&1&&(f(0,"div",43)(1,"p"),z(2,"No conversations yet"),m()())}var Bb=class Xs{isOpen=!1;conversations=[];canLoadMore=!1;isLoadingMore=!1;isLoading=!1;scrollContainer;backClick=new N;settingsClick=new N;closeClick=new N;conversationClick=new N;deleteClick=new N;newChatClick=new N;searchChange=new N;titleUpdate=new N;loadMore=new N;searchQuery="";isRenameModalOpen=!1;renamingConversationId=null;renamingConversationTitle="";activeMenuId=null;onBackClick(){this.backClick.emit()}onSettingsClick(){this.settingsClick.emit()}onCloseClick(){this.closeClick.emit()}onOverlayClick(){this.closeClick.emit(),this.closeMenu()}onConversationClick(t){this.conversationClick.emit(t)}onDeleteClick(t,n){n.stopPropagation(),this.deleteClick.emit(t),this.closeMenu()}onNewChatClick(){this.newChatClick.emit()}onSearchChange(){this.searchChange.emit(this.searchQuery)}onEditClick(t,n,r){r.stopPropagation(),this.renamingConversationId=t,this.renamingConversationTitle=n,this.isRenameModalOpen=!0,this.closeMenu()}onRenameModalClose(){this.isRenameModalOpen=!1,this.renamingConversationId=null,this.renamingConversationTitle=""}onRenameModalSave(t){this.renamingConversationId&&t.trim()&&this.titleUpdate.emit({id:this.renamingConversationId,title:t.trim()})}toggleMenu(t,n){n.stopPropagation(),this.activeMenuId===t?this.activeMenuId=null:this.activeMenuId=t}closeMenu(){this.activeMenuId=null}isMenuOpen(t){return this.activeMenuId===t}onSidebarClick(){this.closeMenu()}onScroll(){if(!this.canLoadMore||this.isLoadingMore||this.isLoading)return;let t=this.scrollContainer?.nativeElement;t&&t.scrollHeight-t.scrollTop-t.clientHeight<=80&&this.loadMore.emit()}static \u0275fac=function(t){return new(t||Xs)};static \u0275cmp=Ae({type:Xs,selectors:[["app-sidebar"]],viewQuery:function(t,n){if(t&1&&vh(Vb,5),t&2){let r;yh(r=Ch())&&(n.scrollContainer=r.first)}},inputs:{isOpen:"isOpen",conversations:"conversations",canLoadMore:"canLoadMore",isLoadingMore:"isLoadingMore",isLoading:"isLoading"},outputs:{backClick:"backClick",settingsClick:"settingsClick",closeClick:"closeClick",conversationClick:"conversationClick",deleteClick:"deleteClick",newChatClick:"newChatClick",searchChange:"searchChange",titleUpdate:"titleUpdate",loadMore:"loadMore"},decls:26,vars:10,consts:[["scrollContainer",""],[1,"sidebar-overlay",3,"click"],[1,"sidebar",3,"click"],[1,"sidebar-header"],[1,"back-text-button",3,"click"],["name","chevron-left","width","16","height","16"],[1,"header-actions"],["aria-label","Settings",1,"icon-button","settings-button",3,"click"],["name","settings-gear","width","20","height","20"],["aria-label","Close",1,"icon-button","sidebar-close-button",3,"click"],["name","close","width","20","height","20"],[1,"sidebar-content",3,"scroll"],[1,"conversations-title"],["class","conversations-list",4,"ngIf"],["class","load-more",4,"ngIf"],["class","empty-conversations",4,"ngIf"],[1,"sidebar-footer"],[1,"search-container"],["name","search","width","18","height","18",1,"search-icon"],["type","text","placeholder","Search",1,"search-input",3,"ngModelChange","input","ngModel"],["aria-label","New Chat",1,"icon-button","new-chat-button",3,"click"],["name","edit-code","width","20","height","20"],[3,"close","save","isOpen","currentTitle"],[1,"conversations-list"],["class","conversation-item",3,"click",4,"ngFor","ngForOf"],[1,"conversation-item",3,"click"],[1,"conversation-info"],[1,"conversation-title-container"],[1,"conversation-title"],[1,"conversation-date"],[1,"menu-container"],["aria-label","More options",1,"icon-button","menu-button",3,"click"],["name","more-horizontal","width","20","height","20"],["class","context-menu",4,"ngIf"],[1,"context-menu"],[1,"menu-item",3,"click"],["name","edit","width","16","height","16"],[1,"menu-item","delete-item",3,"click"],["name","trash","width","16","height","16"],[1,"load-more"],["aria-live","polite",1,"loading-state",3,"ngClass"],["aria-hidden","true",1,"spinner"],[1,"loading-text"],[1,"empty-conversations"]],template:function(t,n){if(t&1){let r=xe();f(0,"div",1),x("click",function(){return L(r),D(n.onOverlayClick())}),m(),f(1,"div",2),x("click",function(){return L(r),D(n.onSidebarClick())}),f(2,"div",3)(3,"button",4),x("click",function(){return L(r),D(n.onBackClick())}),H(4,"app-icon",5),f(5,"span"),z(6,"Back to Chat"),m()(),f(7,"div",6)(8,"button",7),x("click",function(){return L(r),D(n.onSettingsClick())}),H(9,"app-icon",8),m(),f(10,"button",9),x("click",function(){return L(r),D(n.onCloseClick())}),H(11,"app-icon",10),m()()(),f(12,"div",11,0),x("scroll",function(){return L(r),D(n.onScroll())}),f(14,"h3",12),z(15,"Conversations"),m(),re(16,Hb,2,1,"div",13)(17,jb,5,3,"div",14)(18,zb,3,0,"div",15),m(),f(19,"div",16)(20,"div",17),H(21,"app-icon",18),f(22,"input",19),da("ngModelChange",function(i){return L(r),_h(n.searchQuery,i)||(n.searchQuery=i),D(i)}),x("input",function(){return L(r),D(n.onSearchChange())}),m()(),f(23,"button",20),x("click",function(){return L(r),D(n.onNewChatClick())}),H(24,"app-icon",21),m()()(),f(25,"app-rename-modal",22),x("close",function(){return L(r),D(n.onRenameModalClose())})("save",function(i){return L(r),D(n.onRenameModalSave(i))}),m()}t&2&&(Ie("visible",n.isOpen),_(),Ie("open",n.isOpen),_(15),P("ngIf",n.conversations.length>0),_(),P("ngIf",n.isLoading&&n.conversations.length===0||n.isLoadingMore&&n.conversations.length>0),_(),P("ngIf",!n.isLoading&&n.conversations.length===0),_(4),ca("ngModel",n.searchQuery),_(3),P("isOpen",n.isRenameModalOpen)("currentTitle",n.renamingConversationTitle))},dependencies:[ke,gC,ki,It,xa,$n,wa,Ei,Lt,Ab],styles:[".sidebar-overlay[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%;background:#0006;z-index:998;opacity:0;visibility:hidden;transition:opacity .3s ease,visibility .3s ease}.sidebar-overlay.visible[_ngcontent-%COMP%]{opacity:1;visibility:visible}.sidebar[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:85%;max-width:400px;height:100%;background:#fff;z-index:999;transform:translate(-100%);transition:transform .3s ease;display:flex;flex-direction:column;box-shadow:2px 0 8px #0000001a}.sidebar.open[_ngcontent-%COMP%]{transform:translate(0)}.sidebar-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid #e8ecf1}.back-text-button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;background:none;border:none;cursor:pointer;font-size:16px;font-weight:500;color:#1a1a1a;padding:8px;border-radius:8px;transition:background .2s ease}.back-text-button[_ngcontent-%COMP%]:hover{background:#f5f7fa}.header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.icon-button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;border-radius:8px;transition:background .2s ease;color:#5f6368}.icon-button[_ngcontent-%COMP%]:hover{background:#f5f7fa;color:#1a1a1a}.icon-button[_ngcontent-%COMP%]:active{background:#e8ecf1}.sidebar-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:16px}.conversations-title[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:#95a5a6;text-transform:uppercase;letter-spacing:.5px;margin:0 0 16px}.conversations-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px 20px;color:#1a1a1a}.spinner[_ngcontent-%COMP%]{width:32px;height:32px;border:3px solid rgba(0,0,0,.1);border-top-color:#2c3e50;border-radius:50%;animation:_ngcontent-%COMP%_spin .9s linear infinite}.loading-text[_ngcontent-%COMP%]{font-size:14px;color:#54606c;margin:0}.loading-state.compact[_ngcontent-%COMP%]{flex-direction:row;padding:12px 16px;gap:10px}.loading-state.compact[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{font-size:13px}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.conversation-item[_ngcontent-%COMP%]{display:flex;align-items:center;padding:12px;background:#fff;border-radius:8px;cursor:pointer;transition:background .2s ease;gap:12px;position:relative}.conversation-item[_ngcontent-%COMP%]:hover{background:#f5f7fa}.conversation-info[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:4px;min-width:0}.conversation-title-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0}.conversation-title[_ngcontent-%COMP%]{flex:1;font-size:14px;font-weight:500;color:#1a1a1a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conversation-date[_ngcontent-%COMP%]{font-size:12px;color:#95a5a6}.menu-container[_ngcontent-%COMP%]{position:relative}.menu-button[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease}.conversation-item[_ngcontent-%COMP%]:hover .menu-button[_ngcontent-%COMP%], .menu-button[_ngcontent-%COMP%]:focus, .menu-container[_ngcontent-%COMP%]:focus-within .menu-button[_ngcontent-%COMP%]{opacity:1}.context-menu[_ngcontent-%COMP%]{position:absolute;top:100%;right:0;background:#fff;border-radius:8px;box-shadow:0 4px 12px #00000026;border:1px solid #e8ecf1;padding:4px;min-width:140px;z-index:1000;display:flex;flex-direction:column;gap:2px}.menu-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 12px;border:none;background:none;width:100%;text-align:left;cursor:pointer;border-radius:6px;font-size:14px;color:#1a1a1a;transition:background .2s ease}.menu-item[_ngcontent-%COMP%]:hover{background:#f5f7fa}.menu-item[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:#5f6368}.delete-item[_ngcontent-%COMP%]{color:#dc3545}.delete-item[_ngcontent-%COMP%]:hover{background:#fee}.delete-item[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:#dc3545}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;gap:16px}.spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:3px solid #f5f7fa;border-top-color:#ff5337;border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.loading-text[_ngcontent-%COMP%]{color:#95a5a6;font-size:14px;margin:0}.empty-conversations[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:40px 20px;text-align:center}.empty-conversations[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#95a5a6;font-size:14px;margin:0}.load-more[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-top:12px}.load-more-button[_ngcontent-%COMP%]{background:transparent;border:1px solid rgba(0,0,0,.1);border-radius:999px;color:#2c3e50;font-size:13px;padding:6px 16px;cursor:pointer;transition:background .2s ease,border-color .2s ease}.load-more-button[_ngcontent-%COMP%]:hover:not(:disabled){background:#0000000a;border-color:#0003}.load-more-button[_ngcontent-%COMP%]:disabled{cursor:not-allowed;opacity:.6}.sidebar-footer[_ngcontent-%COMP%]{padding:16px;border-top:1px solid #e8ecf1;display:flex;align-items:center;gap:12px}.search-container[_ngcontent-%COMP%]{flex:1;position:relative;display:flex;align-items:center;background:#f5f7fa;border-radius:8px;padding:12px 16px;gap:10px}.search-icon[_ngcontent-%COMP%]{flex-shrink:0;color:#95a5a6}.search-input[_ngcontent-%COMP%]{flex:1;border:none;background:none;font-size:15px;color:#1a1a1a;outline:none;padding:0}.search-input[_ngcontent-%COMP%]::placeholder{color:#95a5a6}.new-chat-button[_ngcontent-%COMP%]{flex-shrink:0;background:#f5f7fa;border:1px solid #e8ecf1;border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;transition:all .2s ease}.new-chat-button[_ngcontent-%COMP%]:hover{background:#e8ecf1;border-color:#d0d7de}@media (max-width: 768px){.menu-button[_ngcontent-%COMP%]{opacity:1}}@media (max-width: 480px){.sidebar[_ngcontent-%COMP%]{width:100%;max-width:none}}"]})},vp=class _r{toasts=le([]);toasts$=this.toasts.asReadonly();show(t,n="info",r=3e3){let i=Math.random().toString(36).substring(7),s={id:i,message:t,type:n,duration:r};this.toasts.update(o=>[...o,s]),r>0&&setTimeout(()=>this.remove(i),r)}success(t,n){this.show(t,"success",n)}error(t,n){this.show(t,"error",n)}warning(t,n){this.show(t,"warning",n)}info(t,n){this.show(t,"info",n)}remove(t){this.toasts.update(n=>n.filter(r=>r.id!==t))}static \u0275fac=function(t){return new(t||_r)};static \u0275prov=E({token:_r,factory:_r.\u0275fac,providedIn:"root"})};function Ub(e,t){e&1&&(f(0,"span"),z(1,"\u2713"),m())}function Zb(e,t){e&1&&(f(0,"span"),z(1,"\u2715"),m())}function $b(e,t){e&1&&(f(0,"span"),z(1,"\u26A0"),m())}function qb(e,t){e&1&&(f(0,"span"),z(1,"\u2139"),m())}function Gb(e,t){if(e&1){let n=xe();f(0,"div",2)(1,"div",3)(2,"span",4),la(3,5),re(4,Ub,2,0,"span",6)(5,Zb,2,0,"span",6)(6,$b,2,0,"span",6)(7,qb,2,0,"span",6),ua(),m(),f(8,"span",7),z(9),m()(),f(10,"button",8),x("click",function(){let r=L(n).$implicit,i=O();return D(i.onClose(r.id))}),z(11,"\u2715"),m()()}if(e&2){let n=t.$implicit;Ie("success",n.type==="success")("error",n.type==="error")("warning",n.type==="warning")("info",n.type==="info"),_(3),P("ngSwitch",n.type),_(),P("ngSwitchCase","success"),_(),P("ngSwitchCase","error"),_(),P("ngSwitchCase","warning"),_(),P("ngSwitchCase","info"),_(2),be(n.message)}}var Wb=class eo{toastService=v(vp);toasts=this.toastService.toasts$;onClose(t){this.toastService.remove(t)}static \u0275fac=function(t){return new(t||eo)};static \u0275cmp=Ae({type:eo,selectors:[["app-toast-container"]],decls:2,vars:1,consts:[[1,"toast-container"],["class","toast",3,"success","error","warning","info",4,"ngFor","ngForOf"],[1,"toast"],[1,"toast-content"],[1,"toast-icon"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"toast-message"],[1,"toast-close",3,"click"]],template:function(t,n){t&1&&(f(0,"div",0),re(1,Gb,12,14,"div",1),m()),t&2&&(_(),P("ngForOf",n.toasts()))},dependencies:[ke,ki,Ih,CC],styles:[".toast-container[_ngcontent-%COMP%]{position:fixed;top:20px;right:20px;z-index:9999;display:flex;flex-direction:column;gap:12px;max-width:400px}.toast[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-radius:8px;box-shadow:0 4px 12px #00000026;background:#fff;min-width:300px;animation:_ngcontent-%COMP%_slideIn .3s ease-out}@keyframes _ngcontent-%COMP%_slideIn{0%{transform:translate(400px);opacity:0}to{transform:translate(0);opacity:1}}.toast-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;flex:1}.toast-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;font-size:14px;font-weight:700}.toast.success[_ngcontent-%COMP%]{border-left:4px solid #10b981}.toast.success[_ngcontent-%COMP%] .toast-icon[_ngcontent-%COMP%]{background:#10b981;color:#fff}.toast.error[_ngcontent-%COMP%]{border-left:4px solid #ef4444}.toast.error[_ngcontent-%COMP%] .toast-icon[_ngcontent-%COMP%]{background:#ef4444;color:#fff}.toast.warning[_ngcontent-%COMP%]{border-left:4px solid #f59e0b}.toast.warning[_ngcontent-%COMP%] .toast-icon[_ngcontent-%COMP%]{background:#f59e0b;color:#fff}.toast.info[_ngcontent-%COMP%]{border-left:4px solid #3b82f6}.toast.info[_ngcontent-%COMP%] .toast-icon[_ngcontent-%COMP%]{background:#3b82f6;color:#fff}.toast-message[_ngcontent-%COMP%]{flex:1;font-size:14px;color:#2c3e50;line-height:1.4}.toast-close[_ngcontent-%COMP%]{background:none;border:none;color:#95a5a6;cursor:pointer;font-size:18px;padding:4px 8px;display:flex;align-items:center;justify-content:center;transition:color .2s}.toast-close[_ngcontent-%COMP%]:hover{color:#2c3e50}@media (max-width: 768px){.toast-container[_ngcontent-%COMP%]{top:10px;right:10px;left:10px;max-width:none}.toast[_ngcontent-%COMP%]{min-width:auto}}"]})},yp=class xr{isOpenSignal=le(!1);configSignal=le(null);resolveCallback=null;isOpen$=this.isOpenSignal.asReadonly();config$=this.configSignal.asReadonly();confirm(t){return this.configSignal.set(T({confirmText:"Confirm",cancelText:"Cancel",confirmColor:"primary"},t)),this.isOpenSignal.set(!0),new Promise(n=>{this.resolveCallback=n})}close(t){this.isOpenSignal.set(!1),this.resolveCallback&&(this.resolveCallback(t),this.resolveCallback=null)}static \u0275fac=function(t){return new(t||xr)};static \u0275prov=E({token:xr,factory:xr.\u0275fac,providedIn:"root"})};function Qb(e,t){if(e&1){let n=xe();f(0,"div",1),x("click",function(){L(n);let r=O();return D(r.onOverlayClick())}),f(1,"div",2),x("click",function(r){L(n);let i=O();return D(i.onModalClick(r))}),f(2,"div",3)(3,"button",4),x("click",function(){L(n);let r=O();return D(r.onBackClick())}),H(4,"app-icon",5),m(),f(5,"h2",6),z(6),m(),f(7,"button",7),x("click",function(){L(n);let r=O();return D(r.onCloseClick())}),H(8,"app-icon",8),m()(),f(9,"div",9)(10,"p",10),z(11),m()(),f(12,"div",11)(13,"button",12),x("click",function(){L(n);let r=O();return D(r.onCancel())}),z(14),m(),f(15,"button",13),x("click",function(){L(n);let r=O();return D(r.onConfirm())}),z(16),m()()()()}if(e&2){let n,r,i,s,o,a,l=O();_(6),be(((n=l.config())==null?null:n.title)||"Back"),_(5),be((r=l.config())==null?null:r.message),_(3),An(" ",((i=l.config())==null?null:i.cancelText)||"Cancel"," "),_(),Ie("btn-danger",((s=l.config())==null?null:s.confirmColor)==="danger")("btn-primary",((o=l.config())==null?null:o.confirmColor)==="primary"),_(),An(" ",((a=l.config())==null?null:a.confirmText)||"Confirm"," ")}}var Yb=class to{confirmationService=v(yp);isOpen=this.confirmationService.isOpen$;config=this.confirmationService.config$;onConfirm(){this.confirmationService.close(!0)}onCancel(){this.confirmationService.close(!1)}onBackClick(){this.confirmationService.close(!1)}onCloseClick(){this.confirmationService.close(!1)}onOverlayClick(){this.confirmationService.close(!1)}onModalClick(t){t.stopPropagation()}static \u0275fac=function(t){return new(t||to)};static \u0275cmp=Ae({type:to,selectors:[["app-confirmation-modal"]],decls:1,vars:1,consts:[["class","modal-overlay",3,"click",4,"ngIf"],[1,"modal-overlay",3,"click"],[1,"modal-container",3,"click"],[1,"modal-header"],["aria-label","Back",1,"icon-button","back-button",3,"click"],["name","chevron-left","width","24","height","24"],[1,"modal-title"],["aria-label","Close",1,"icon-button","confirmation-modal-close-button",3,"click"],["name","close","width","24","height","24"],[1,"modal-body"],[1,"modal-message"],[1,"modal-footer"],[1,"btn","btn-cancel",3,"click"],[1,"btn","btn-confirm",3,"click"]],template:function(t,n){t&1&&re(0,Qb,17,8,"div",0),t&2&&P("ngIf",n.isOpen())},dependencies:[ke,It,Lt],styles:[".modal-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#00000080;display:flex;align-items:flex-end;justify-content:center;z-index:10000;animation:_ngcontent-%COMP%_fadeIn .2s ease-out;overflow-x:hidden}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}.modal-container[_ngcontent-%COMP%]{background-color:#fff;border-radius:16px 16px 0 0;width:100%;max-width:600px;max-height:90vh;display:flex;flex-direction:column;box-shadow:0 -2px 24px #00000026;animation:_ngcontent-%COMP%_slideUp .3s ease-out;box-sizing:border-box;overflow-x:hidden}@keyframes _ngcontent-%COMP%_slideUp{0%{transform:translateY(100%)}to{transform:translateY(0)}}.modal-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e5e7eb;gap:12px}.modal-title[_ngcontent-%COMP%]{flex:1;text-align:left;font-size:18px;font-weight:600;color:#111827;margin:0}.icon-button[_ngcontent-%COMP%]{background:none;border:none;padding:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:8px;color:#6b7280;transition:all .2s ease}.icon-button[_ngcontent-%COMP%]:hover{background-color:#f3f4f6;color:#111827}.icon-button[_ngcontent-%COMP%]:active{transform:scale(.95)}.back-button[_ngcontent-%COMP%], .confirmation-modal-close-button[_ngcontent-%COMP%]{flex-shrink:0}.modal-body[_ngcontent-%COMP%]{padding:32px 20px;flex:1;overflow-y:auto;overflow-x:hidden;box-sizing:border-box}.modal-message[_ngcontent-%COMP%]{margin:0;font-size:16px;line-height:1.5;color:#111827;text-align:left}.modal-footer[_ngcontent-%COMP%]{display:flex;gap:12px;padding:16px 20px;border-top:1px solid #e5e7eb;box-sizing:border-box}.btn[_ngcontent-%COMP%]{flex:1;padding:12px 24px;font-size:16px;font-weight:500;border-radius:8px;border:none;cursor:pointer;transition:all .2s ease;font-family:inherit}.btn[_ngcontent-%COMP%]:active{transform:scale(.98)}.btn-cancel[_ngcontent-%COMP%]{background-color:#fff;color:#374151;border:1px solid #d1d5db}.btn-cancel[_ngcontent-%COMP%]:hover{background-color:#f9fafb;border-color:#9ca3af}.btn-confirm[_ngcontent-%COMP%]{color:#fff}.btn-primary[_ngcontent-%COMP%]{background-color:#3b82f6}.btn-primary[_ngcontent-%COMP%]:hover{background-color:#2563eb}.btn-danger[_ngcontent-%COMP%]{background-color:#f43e83}.btn-danger[_ngcontent-%COMP%]:hover{background-color:#d63571}.btn-danger[_ngcontent-%COMP%]:disabled, .btn-primary[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}@media (min-width: 768px){.modal-overlay[_ngcontent-%COMP%]{align-items:center}.modal-container[_ngcontent-%COMP%]{border-radius:16px;max-height:500px}}"]})},ri={production:!0,apiUrl:"https://ca-oaa-ai-dev-we-api.proudforest-87e29140.westeurope.azurecontainerapps.io",apiTimeout:6e4,environmentName:"production"},Kb=class kr{http=v(ya);logger=v(Le);get apiUrl(){return ri.apiUrl}get timeout(){return ri.apiTimeout}createConversation(t){return this.http.post(`${this.apiUrl}/conversations`,t).pipe(pt(this.timeout),Oe(this.handleError))}getConversations(t,n,r=0,i=20){let s=new Ge().set("offset",r.toString()).set("limit",i.toString());return t&&(s=s.set("status",t)),n&&(s=s.set("search",n)),this.http.get(`${this.apiUrl}/conversations`,{params:s}).pipe(pt(this.timeout),Oe(this.handleError))}getConversation(t){return this.http.get(`${this.apiUrl}/conversations/${t}`).pipe(pt(this.timeout),Oe(this.handleError))}deleteConversation(t){return this.http.delete(`${this.apiUrl}/conversations/${t}`).pipe(pt(this.timeout),Oe(this.handleError))}updateConversationTitle(t,n){return this.http.patch(`${this.apiUrl}/conversations/${t}/title`,n).pipe(pt(this.timeout),Oe(this.handleError))}sendMessage(t,n){let r=`${this.apiUrl}/conversations/${t}/messages`;return this.http.post(r,n).pipe(pt(this.timeout),Oe(this.handleError))}getMessages(t,n=0,r=20){let i=new Ge().set("offset",n.toString()).set("limit",r.toString());return this.http.get(`${this.apiUrl}/conversations/${t}/messages`,{params:i}).pipe(pt(this.timeout),Oe(this.handleError))}handleError=t=>{this.logger.error("API Error:",t);let n="An error occurred";return t.error instanceof ErrorEvent?n=`Error: ${t.error.message}`:n=`Error Code: ${t.status}
|
|
41
41
|
Message: ${t.message}`,fo(()=>new Error(n))};static \u0275fac=function(t){return new(t||kr)};static \u0275prov=E({token:kr,factory:kr.\u0275fac,providedIn:"root"})},Jb=class Sr{apiService=v(Kb);logger=v(Le);pageSize=10;chatState=le({messages:[],isLoading:!1,currentInput:"",isLoadingMore:!1,hasMoreHistory:!1,pageSize:this.pageSize,currentOffset:0,totalMessages:0});currentConversationId=null;cancelRequest$=new Je;isCancelling=!1;mockAppId="00000000-0000-0000-0000-000000000001";typingSimulationDelay=500;getState(){return this.chatState.asReadonly()}addMessage(t,n){let r={id:this.generateId(),text:t,sender:n,timestamp:new Date,isTyping:!1};this.chatState.update(i=>V(T({},i),{messages:[...i.messages,r],totalMessages:i.totalMessages+1}))}sendMessage(t){return Y(this,null,function*(){try{this.isCancelling=!1,this.addMessage(t,"user"),this.chatState.update(i=>V(T({},i),{isLoading:!0})),this.currentConversationId||(yield this.createConversation());let n={id:"typing-"+Date.now(),text:"",sender:"assistant",timestamp:new Date,isTyping:!0};this.chatState.update(i=>V(T({},i),{messages:[...i.messages,n]})),yield this.delay(this.typingSimulationDelay);let r=yield nt(this.apiService.sendMessage(this.currentConversationId,{message:t}).pipe(e1(this.cancelRequest$)));this.isCancelling||(this.chatState.update(i=>V(T({},i),{messages:i.messages.filter(s=>s.id!==n.id),isLoading:!1})),this.addMessage(r.assistantMessage,"assistant"))}catch(n){if(this.isCancelling){this.logger.info("Request was cancelled by user");return}this.logger.error("Error sending message:",n),this.chatState.update(r=>V(T({},r),{messages:r.messages.filter(i=>!i.isTyping),isLoading:!1})),this.addMessage("Sorry, I encountered an error. Please try again.","assistant")}})}createConversation(){return Y(this,null,function*(){try{let t=yield nt(this.apiService.createConversation({appId:this.mockAppId,title:"New chat"}));this.currentConversationId=t.id}catch(t){throw this.logger.error("Error creating conversation:",t),t}})}loadConversation(t){return Y(this,null,function*(){try{this.chatState.update(o=>V(T({},o),{isLoading:!0}));let n=this.pageSize,r=yield nt(this.apiService.getMessages(t,0,n)),i=r.total,s=(r.messages??[]).slice().reverse().map(o=>({id:o.id,text:o.content,sender:o.role==="user"?"user":"assistant",timestamp:new Date(o.createdAt),isTyping:!1}));this.currentConversationId=t,this.chatState.update(o=>V(T({},o),{messages:s,isLoading:!1,hasMoreHistory:r.hasMore,currentOffset:r.offset+s.length,totalMessages:i,pageSize:n,isLoadingMore:!1}))}catch(n){this.logger.error("Error loading conversation:",n),this.chatState.update(r=>V(T({},r),{isLoading:!1}))}})}clearChat(){this.chatState.update(t=>V(T({},t),{messages:[],hasMoreHistory:!1,currentOffset:0,totalMessages:0,isLoadingMore:!1})),this.currentConversationId=null}stopResponse(){this.isCancelling=!0,this.cancelRequest$.next(),this.chatState.update(t=>V(T({},t),{messages:t.messages.filter(n=>!n.isTyping),isLoading:!1}))}getCurrentConversationId(){return this.currentConversationId}getConversations(t,n,r=0,i=20){return Y(this,null,function*(){try{return yield nt(this.apiService.getConversations(t,n,r,i))}catch(s){throw this.logger.error("Error loading conversations:",s),s}})}deleteConversation(t){return Y(this,null,function*(){try{yield nt(this.apiService.deleteConversation(t)),this.currentConversationId===t&&this.clearChat()}catch(n){throw this.logger.error("Error deleting conversation:",n),n}})}updateConversationTitle(t,n){return Y(this,null,function*(){try{yield nt(this.apiService.updateConversationTitle(t,{title:n}))}catch(r){throw this.logger.error("Error updating conversation title:",r),r}})}loadMoreHistory(){return Y(this,null,function*(){let t=this.chatState();if(!this.currentConversationId||t.isLoadingMore||!t.hasMoreHistory)return;let n=t.currentOffset;this.chatState.update(r=>V(T({},r),{isLoadingMore:!0}));try{let r=yield nt(this.apiService.getMessages(this.currentConversationId,n,t.pageSize)),i=(r.messages??[]).slice().reverse().map(o=>({id:o.id,text:o.content,sender:o.role==="user"?"user":"assistant",timestamp:new Date(o.createdAt),isTyping:!1})),s=n+(r.messages?.length??0);this.chatState.update(o=>V(T({},o),{messages:[...i,...o.messages],currentOffset:s,hasMoreHistory:r.hasMore,totalMessages:r.total,isLoadingMore:!1}))}catch(r){this.logger.error("Error loading more messages:",r),this.chatState.update(i=>V(T({},i),{isLoadingMore:!1}))}})}generateId(){return`msg-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}delay(t){return new Promise(n=>setTimeout(n,t))}static \u0275fac=function(t){return new(t||Sr)};static \u0275prov=E({token:Sr,factory:Sr.\u0275fac,providedIn:"root"})},Xb=class Mr{constructor(t){this.logger=t,this.initializeRecognition()}recognition=null;isSupported=!1;resolveStop=null;statusSignal=le({state:"idle",transcript:"",interimTranscript:""});getStatus(){return this.statusSignal.asReadonly()}isVoiceRecognitionSupported(){return this.isSupported}getCurrentTranscript(){return this.statusSignal().transcript}initializeRecognition(){let t=window.SpeechRecognition||window.webkitSpeechRecognition;if(!t){this.logger.warn("Speech Recognition API is not supported in this browser"),this.isSupported=!1;return}this.isSupported=!0,this.recognition=new t,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.lang="en-US",this.recognition.maxAlternatives=1,this.recognition.onstart=()=>{this.logger.debug("Voice recognition started"),this.statusSignal.update(n=>V(T({},n),{state:"listening",errorMessage:void 0}))},this.recognition.onresult=n=>{let r="",i=this.statusSignal().transcript;this.logger.debug("Voice recognition onresult event",{resultIndex:n.resultIndex,resultsLength:n.results.length});for(let s=n.resultIndex;s<n.results.length;s++){let o=n.results[s][0].transcript,a=n.results[s].isFinal;this.logger.debug(`Result ${s}:`,{transcript:o,isFinal:a}),a?i+=o+" ":r+=o}this.statusSignal.update(s=>V(T({},s),{transcript:i.trim(),interimTranscript:r.trim()})),this.logger.debug("Updated status:",{transcript:i.trim(),interimTranscript:r.trim()})},this.recognition.onerror=n=>{this.logger.error("Voice recognition error:",n.error);let r="Voice recognition error";switch(n.error){case"no-speech":r="No speech detected. Please try again.";break;case"audio-capture":r="No microphone found. Please check your microphone.";break;case"not-allowed":r="Microphone access denied. Please allow microphone access.";break;case"network":r="Network error occurred. Please check your connection.";break;default:r=`Voice recognition error: ${n.error}`}this.statusSignal.update(i=>V(T({},i),{state:"error",errorMessage:r}))},this.recognition.onend=()=>{this.logger.debug("Voice recognition ended");let n=this.statusSignal().transcript;this.logger.debug("Final transcript:",n),this.resolveStop&&(this.resolveStop({transcript:n.trim(),success:n.trim().length>0}),this.resolveStop=null),this.statusSignal.set({state:"idle",transcript:"",interimTranscript:"",errorMessage:void 0})}}startListening(t="en-US"){if(!this.isSupported){this.statusSignal.set({state:"error",transcript:"",interimTranscript:"",errorMessage:"Voice recognition is not supported in this browser"});return}if(this.statusSignal().state==="listening"){this.logger.warn("Voice recognition is already active");return}this.statusSignal.set({state:"listening",transcript:"",interimTranscript:"",errorMessage:void 0});try{this.recognition.lang=t,this.recognition.start()}catch(n){this.logger.error("Failed to start voice recognition:",n),this.statusSignal.update(r=>V(T({},r),{state:"error",errorMessage:"Failed to start voice recognition"}))}}stopListening(){return Y(this,null,function*(){return this.isSupported?this.statusSignal().state!=="listening"?{transcript:"",success:!1}:new Promise(t=>{this.resolveStop=t,this.statusSignal.update(n=>V(T({},n),{state:"processing"}));try{this.recognition.stop()}catch(n){this.logger.error("Failed to stop voice recognition:",n),this.resolveStop=null,this.statusSignal.set({state:"idle",transcript:"",interimTranscript:"",errorMessage:void 0}),t({transcript:"",success:!1})}}):{transcript:"",success:!1}})}cancelListening(){if(this.isSupported){if(this.statusSignal().state==="listening")try{this.recognition.abort()}catch(t){this.logger.error("Failed to cancel voice recognition:",t)}this.resolveStop&&(this.resolveStop({transcript:"",success:!1}),this.resolveStop=null),this.statusSignal.set({state:"idle",transcript:"",interimTranscript:"",errorMessage:void 0})}}static \u0275fac=function(t){return new(t||Mr)(b(Le))};static \u0275prov=E({token:Mr,factory:Mr.\u0275fac,providedIn:"root"})},Cp=class Or{constructor(t){this.http=t}logger=v(Le);config=null;loadConfig(){return Y(this,null,function*(){try{this.config=yield nt(this.http.get("/config.json")),this.logger.info("Configuration loaded:",this.config?.environmentName)}catch(t){this.logger.error("Failed to load configuration, using defaults",t),this.config={apiUrl:"https://ca-oaa-ai-dev-we-api.proudforest-87e29140.westeurope.azurecontainerapps.io",apiTimeout:3e4,environmentName:"dev"}}})}get apiUrl(){return this.config?.apiUrl||"https://ca-oaa-ai-dev-we-api.proudforest-87e29140.westeurope.azurecontainerapps.io"}get apiTimeout(){return this.config?.apiTimeout||3e4}get environmentName(){return this.config?.environmentName||"dev"}getConfig(){return this.config||{apiUrl:"https://ca-oaa-ai-dev-we-api.proudforest-87e29140.westeurope.azurecontainerapps.io",apiTimeout:3e4,environmentName:"dev"}}setConfig(t){this.config=t,this.logger.info("Configuration updated:",this.config.environmentName)}static \u0275fac=function(t){return new(t||Or)(b(ya))};static \u0275prov=E({token:Or,factory:Or.\u0275fac,providedIn:"root"})},bp=class Er{logger=v(Le);TOKEN_KEY="jwt_token";CLOCK_SKEW_BUFFER=60;authState=le({isAuthenticated:!1,token:null,user:null});state=this.authState.asReadonly();constructor(){this.initializeAuthState()}initializeAuthState(){let t=this.getToken();if(t){let n=this.getUserFromToken(t);this.authState.set({isAuthenticated:!0,token:t,user:n}),this.logger.debug("Auth state initialized from localStorage",{user:n})}else this.logger.debug("No valid token found in localStorage")}getToken(){try{let t=localStorage.getItem(this.TOKEN_KEY);return t?this.isTokenExpired()?(this.logger.warn("Token found but expired, clearing"),this.clearToken(),null):t:null}catch(t){return this.logger.error("Error reading token from localStorage",t),null}}setToken(t){try{let n=this.decodeToken(t);if(!n){this.logger.error("Cannot store invalid token");return}localStorage.setItem(this.TOKEN_KEY,t);let r=this.getUserFromToken(t);this.authState.set({isAuthenticated:!0,token:t,user:r}),this.logger.debug("Token stored successfully",{exp:n.exp,user:r})}catch(n){throw n instanceof DOMException&&(n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")?this.logger.error("localStorage quota exceeded",n):this.logger.error("Error storing token",n),n}}isTokenExpired(){try{let t=localStorage.getItem(this.TOKEN_KEY);if(!t)return!0;let n=this.decodeToken(t);if(!n)return!0;let r=n.exp,i=Math.floor(Date.now()/1e3),s=i>r-this.CLOCK_SKEW_BUFFER;return s&&this.logger.debug("Token expired",{exp:r,now:i,diff:r-i}),s}catch(t){return this.logger.error("Error checking token expiration",t),!0}}isAuthenticated(){return this.getToken()!==null}clearToken(){try{localStorage.removeItem(this.TOKEN_KEY),this.authState.set({isAuthenticated:!1,token:null,user:null}),this.logger.debug("Token cleared, user logged out")}catch(t){this.logger.error("Error clearing token",t)}}logout(){this.logger.info("User logged out"),this.clearToken()}getUserFromToken(t){let n=t||this.getToken();if(!n)return null;let r=this.decodeToken(n);return r?{id:r.sub,name:r.name,email:r.email}:null}createValidToken(){let t={alg:"HS256",typ:"JWT"},n=Math.floor(Date.now()/1e3),r={sub:"00000000-0000-0000-0000-000000000000",name:"Development User",email:"dev@localhost",iss:"http://oaa-api.azurewebsites.net/",iat:n,exp:n+1440*60},i=u=>{let c=JSON.stringify(u);return btoa(c).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},s=i(t),o=i(r),a=i({dev:!0}),l=`${s}.${o}.${a}`;return this.logger.debug("Created development token",{exp:r.exp,expiresIn:"24 hours"}),l}validateToken(t){try{let n=this.decodeToken(t);if(!n)return{isValid:!1,isExpired:!1,error:"Invalid token format"};let r=Math.floor(Date.now()/1e3)>n.exp;return{isValid:!r,isExpired:r,payload:n}}catch(n){return{isValid:!1,isExpired:!1,error:n instanceof Error?n.message:"Unknown error"}}}decodeToken(t){try{let n=t.split(".");if(n.length!==3)return this.logger.error("Invalid token format - must have 3 parts"),null;let r=n[1];if(!r)return this.logger.error("Invalid token - missing payload"),null;let i=r.replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(atob(i).split("").map(a=>"%"+("00"+a.charCodeAt(0).toString(16)).slice(-2)).join("")),o=JSON.parse(s);return!o.sub||!o.exp||!o.iat?(this.logger.error("Invalid token payload - missing required fields"),null):o}catch(n){return this.logger.error("Token decode failed",n),null}}static \u0275fac=function(t){return new(t||Er)};static \u0275prov=E({token:Er,factory:Er.\u0275fac,providedIn:"root"})};function e3(e,t){if(e&1&&(f(0,"div",8)(1,"div",9),H(2,"app-icon",10),m(),f(3,"h1",11),z(4),m(),f(5,"p",12),z(6),m(),f(7,"p",13),z(8),m()()),e&2){let n=O();_(4),be(n.greeting),_(2),be(n.welcomeText),_(2),be(n.description)}}function t3(e,t){if(e&1){let n=xe();f(0,"app-chat-history",14),x("loadMore",function(){L(n);let r=O();return D(r.onLoadMoreHistory())}),m()}if(e&2){let n=O();P("messages",n.messages())("canLoadMore",n.canLoadMoreHistory())("isLoadingMore",n.isLoadingMoreHistory())}}function n3(e,t){if(e&1){let n=xe();f(0,"app-suggestion-button",19),x("buttonClick",function(r){L(n);let i=O(2);return D(i.onSuggestionClick(r))}),m()}if(e&2){let n=t.$implicit,r=O(2);P("text",n)("disabled",r.isLoading())}}function r3(e,t){if(e&1&&(f(0,"div",15)(1,"p",16),z(2),m(),f(3,"div",17),re(4,n3,1,2,"app-suggestion-button",18),m()()),e&2){let n=O();_(2),be(n.personalizationText),_(2),P("ngForOf",n.suggestions)}}var i3=class no{chatService=v(Jb);toastService=v(vp);confirmationService=v(yp);voiceRecognition=v(Xb);configService=v(Cp);authService=v(bp);logger=v(Le);_apiUrl;_apiTimeout;set apiUrl(t){this._apiUrl=t,t&&this.updateConfig()}get apiUrl(){return this._apiUrl}set apiTimeout(t){this._apiTimeout=t,t&&this.updateConfig()}get apiTimeout(){return this._apiTimeout}set config(t){t&&(this.configService.setConfig(t),this.logger.debug("Config updated via Input:",t))}set jwtToken(t){t&&t.trim()&&(this.authService.setToken(t),this.logger.debug("JWT token set from parent application"))}title=me.TITLE;greeting=me.WELCOME.GREETING;welcomeText=me.WELCOME.TEXT;description=me.WELCOME.DESCRIPTION;personalizationText=me.WELCOME.PERSONALIZATION;inputPlaceholder=me.INPUT.PLACEHOLDER;suggestions=[...me.SUGGESTIONS];chatState=this.chatService.getState();messages=st(()=>this.chatState().messages);isLoading=st(()=>this.chatState().isLoading);hasMessages=st(()=>this.messages().length>0);canLoadMoreHistory=st(()=>this.chatState().hasMoreHistory);isLoadingMoreHistory=st(()=>this.chatState().isLoadingMore);voiceStatus=this.voiceRecognition.getStatus();sidebarOpenSignal=le(!1);isSidebarOpen=this.sidebarOpenSignal.asReadonly();conversationsSignal=le([]);conversations=this.conversationsSignal.asReadonly();isLoadingConversationsSignal=le(!1);isLoadingConversations=this.isLoadingConversationsSignal.asReadonly();searchQuerySignal=le("");inputValueSignal=le("");inputValue=this.inputValueSignal.asReadonly();ngOnInit(){this.logger.debug("AssistantPage initialized with config:",this.configService.getConfig())}updateConfig(){let t=this.configService.getConfig();this.configService.setConfig({apiUrl:this._apiUrl||t.apiUrl,apiTimeout:this._apiTimeout||t.apiTimeout,environmentName:t.environmentName}),this.logger.debug("Config updated:",this.configService.getConfig())}onMenuClick(){return Y(this,null,function*(){this.sidebarOpenSignal.set(!0),this.searchQuerySignal.set(""),yield this.loadConversations()})}onCloseClick(){this.chatService.clearChat()}onSuggestionClick(t){return Y(this,null,function*(){yield this.chatService.sendMessage(t)})}onMessageSubmit(t){return Y(this,null,function*(){t.trim()&&(this.inputValueSignal.set(""),yield this.chatService.sendMessage(t))})}onInputValueChange(t){this.inputValueSignal.set(t)}onVoiceClick(){return Y(this,null,function*(){let t=this.voiceStatus();if(!this.voiceRecognition.isVoiceRecognitionSupported()){this.toastService.error("Voice recognition is not supported in your browser. Please try Chrome, Edge, or Safari.");return}if(t.state==="listening"){let n=yield this.voiceRecognition.stopListening();this.logger.debug("Voice recognition result:",n),n.success&&n.transcript?(this.inputValueSignal.set(n.transcript),this.toastService.success("Voice input captured. Click send when ready.")):this.toastService.warning("No speech detected. Please try again.")}else t.state==="idle"?(this.voiceRecognition.startListening(),this.toastService.info("Listening... Click the microphone button again when done.")):t.state==="error"&&this.toastService.error(t.errorMessage||"Voice recognition error")})}onAddClick(){this.toastService.info("Attachment feature coming soon!")}onSettingsClick(){this.toastService.info("Settings feature coming soon!")}onStopClick(){this.chatService.stopResponse(),this.toastService.info("Response stopped")}onLoadMoreHistory(){return Y(this,null,function*(){yield this.chatService.loadMoreHistory()})}onSidebarBackClick(){this.sidebarOpenSignal.set(!1)}onSidebarSettingsClick(){this.toastService.info("Settings feature coming soon!")}onSidebarCloseClick(){this.sidebarOpenSignal.set(!1)}onConversationClick(t){return Y(this,null,function*(){this.sidebarOpenSignal.set(!1);try{yield this.chatService.loadConversation(t)}catch(n){this.logger.error("Failed to load conversation:",n),this.toastService.error("Failed to load conversation. Please try again.")}})}onConversationDeleteClick(t){return Y(this,null,function*(){if(this.logger.debug("Delete conversation:",t),!!(yield this.confirmationService.confirm({title:"Back",message:"Are you sure you want to delete this conversation? This action cannot be undone.",confirmText:"Delete",cancelText:"Cancel",confirmColor:"danger"})))try{yield this.chatService.deleteConversation(t);let n=this.conversationsSignal();this.conversationsSignal.set(n.filter(r=>r.id!==t)),this.toastService.success("Conversation deleted successfully")}catch(n){this.logger.error("Failed to delete conversation:",n),this.toastService.error("Failed to delete conversation. Please try again.")}})}onNewChatClick(){this.chatService.clearChat(),this.sidebarOpenSignal.set(!1)}onSearchChange(t){return Y(this,null,function*(){this.searchQuerySignal.set(t),yield this.loadConversations()})}onConversationTitleUpdate(t){return Y(this,null,function*(){try{yield this.chatService.updateConversationTitle(t.id,t.title);let n=this.conversationsSignal();this.conversationsSignal.set(n.map(r=>r.id===t.id?V(T({},r),{title:t.title}):r)),this.toastService.success("Conversation title updated")}catch(n){this.logger.error("Failed to update conversation title:",n),this.toastService.error("Failed to update conversation title. Please try again.")}})}loadConversations(){return Y(this,null,function*(){if(!this.isLoadingConversationsSignal()){this.isLoadingConversationsSignal.set(!0);try{let t=this.searchQuerySignal(),n=(yield this.chatService.getConversations(void 0,t||void 0)).conversations.map(r=>({id:r.id,title:r.title||"Untitled Conversation",date:new Date(r.createdAt).toLocaleDateString("ru-RU",{day:"2-digit",month:"2-digit",year:"numeric"})}));this.conversationsSignal.set(n)}catch(t){this.logger.error("Failed to load conversations:",t)}finally{this.isLoadingConversationsSignal.set(!1)}}})}static \u0275fac=function(t){return new(t||no)};static \u0275cmp=Ae({type:no,selectors:[["app-assistant"]],inputs:{apiUrl:"apiUrl",apiTimeout:"apiTimeout",config:"config",jwtToken:"jwtToken",title:"title",greeting:"greeting",welcomeText:"welcomeText",description:"description",personalizationText:"personalizationText",inputPlaceholder:"inputPlaceholder",suggestions:"suggestions"},decls:10,vars:12,consts:[[3,"backClick","settingsClick","closeClick","conversationClick","deleteClick","newChatClick","searchChange","titleUpdate","isOpen","conversations","isLoading"],[1,"assistant-page"],[3,"menuClick","closeClick","title"],[1,"content"],["class","welcome-container",4,"ngIf"],[3,"messages","canLoadMore","isLoadingMore","loadMore",4,"ngIf"],["class","personalization-section",4,"ngIf"],[3,"valueChange","submitMessage","voiceClick","addClick","settingsClick","stopClick","placeholder","disabled","voiceStatus","value","isLoadingResponse"],[1,"welcome-container"],[1,"icon-wrapper"],["name","welcome-rocket-icon","width","64","height","64","dropShadow","drop-shadow(0 4px 8px rgba(244, 62, 131, 0.2))",1,"sparkle-icon"],[1,"greeting"],[1,"welcome-text"],[1,"description"],[3,"loadMore","messages","canLoadMore","isLoadingMore"],[1,"personalization-section"],[1,"personalization-text"],[1,"suggestions"],[3,"text","disabled","buttonClick",4,"ngFor","ngForOf"],[3,"buttonClick","text","disabled"]],template:function(t,n){t&1&&(f(0,"app-sidebar",0),x("backClick",function(){return n.onSidebarBackClick()})("settingsClick",function(){return n.onSidebarSettingsClick()})("closeClick",function(){return n.onSidebarCloseClick()})("conversationClick",function(r){return n.onConversationClick(r)})("deleteClick",function(r){return n.onConversationDeleteClick(r)})("newChatClick",function(){return n.onNewChatClick()})("searchChange",function(r){return n.onSearchChange(r)})("titleUpdate",function(r){return n.onConversationTitleUpdate(r)}),m(),f(1,"div",1)(2,"app-header",2),x("menuClick",function(){return n.onMenuClick()})("closeClick",function(){return n.onCloseClick()}),m(),f(3,"div",3),re(4,e3,9,3,"div",4)(5,t3,1,3,"app-chat-history",5)(6,r3,5,2,"div",6),m(),f(7,"app-input-field",7),x("valueChange",function(r){return n.onInputValueChange(r)})("submitMessage",function(r){return n.onMessageSubmit(r)})("voiceClick",function(){return n.onVoiceClick()})("addClick",function(){return n.onAddClick()})("settingsClick",function(){return n.onSettingsClick()})("stopClick",function(){return n.onStopClick()}),m()(),H(8,"app-toast-container")(9,"app-confirmation-modal")),t&2&&(P("isOpen",n.isSidebarOpen())("conversations",n.conversations())("isLoading",n.isLoadingConversations()),_(2),P("title",n.title),_(2),P("ngIf",!n.hasMessages()),_(),P("ngIf",n.hasMessages()),_(),P("ngIf",!n.hasMessages()),_(),P("placeholder",n.inputPlaceholder)("disabled",n.isLoading())("voiceStatus",n.voiceStatus())("value",n.inputValue())("isLoadingResponse",n.isLoading()))},dependencies:[ke,ki,It,V5,R5,_b,Lt,Lb,Bb,Wb,Yb],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;overflow:hidden}.assistant-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-height:100%;width:100%;background:#fff;font-family:Roboto,-apple-system,BlinkMacSystemFont,Segoe UI,Arial,sans-serif;overflow:hidden;position:relative}.content[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;min-height:0;position:relative;-webkit-overflow-scrolling:touch}app-chat-history[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}.welcome-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px 20px;text-align:center;flex-shrink:0}.icon-wrapper[_ngcontent-%COMP%]{margin-bottom:12px;flex-shrink:0}.greeting[_ngcontent-%COMP%]{font-size:24px;font-weight:700;margin:0 0 8px;color:#1a1a1a;flex-shrink:0}.welcome-text[_ngcontent-%COMP%]{font-size:16px;font-weight:500;margin:0 0 8px;color:#333;flex-shrink:0}.description[_ngcontent-%COMP%]{font-size:14px;font-weight:400;margin:0 0 12px;color:#666;max-width:400px;line-height:1.4;flex-shrink:0}.personalization-section[_ngcontent-%COMP%]{padding:0 20px 16px;display:flex;flex-direction:column;align-items:center;gap:12px;flex-shrink:0;max-width:100%;box-sizing:border-box}.personalization-text[_ngcontent-%COMP%]{font-size:14px;color:#666;margin:0;text-align:center;max-width:400px;line-height:1.4;flex-shrink:0}.suggestions[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:8px;width:100%;max-width:400px;flex-shrink:0}@media (max-width: 768px){.greeting[_ngcontent-%COMP%]{font-size:20px}.welcome-text[_ngcontent-%COMP%]{font-size:15px}.description[_ngcontent-%COMP%]{font-size:13px;margin-bottom:8px}.welcome-container[_ngcontent-%COMP%]{padding:12px 16px}.personalization-section[_ngcontent-%COMP%]{padding:0 16px 12px;gap:10px}.personalization-text[_ngcontent-%COMP%]{font-size:13px}.suggestions[_ngcontent-%COMP%]{max-width:100%;gap:8px}.icon-wrapper[_ngcontent-%COMP%]{margin-bottom:8px}}@media (max-height: 600px){.greeting[_ngcontent-%COMP%]{font-size:18px;margin-bottom:6px}.welcome-text[_ngcontent-%COMP%]{font-size:14px;margin-bottom:6px}.description[_ngcontent-%COMP%]{font-size:12px;margin-bottom:8px}.welcome-container[_ngcontent-%COMP%]{padding:8px 16px}.personalization-section[_ngcontent-%COMP%]{padding:0 16px 8px;gap:8px}.icon-wrapper[_ngcontent-%COMP%]{margin-bottom:6px}.icon-wrapper[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{transform:scale(.8)}}"]})},s3=class Tr{authService=v(bp);logger=v(Le);isLoggingOut=!1;PUBLIC_ENDPOINTS=["/config.json","/assets/"];intercept(t,n){if(this.isPublicEndpoint(t.url))return this.logger.debug("Public endpoint, skipping auth",{url:t.url}),n.handle(t);let r=this.authService.getToken();if(!r&&!ri.production&&(this.logger.debug("No token found in localStorage, creating development token"),r=this.authService.createValidToken(),this.authService.setToken(r)),!r)return this.logger.debug("No token available, proceeding without auth header"),n.handle(t);let i=t.clone({setHeaders:{Authorization:`Bearer ${r}`}});return this.logger.debug("Added Authorization header to request",{url:t.url}),n.handle(i).pipe(Oe(s=>(s.status===401?this.handle401Error(s):s.status===403?this.handle403Error(s):s.status===0&&this.handleNetworkError(s),fo(()=>s))))}isPublicEndpoint(t){return this.PUBLIC_ENDPOINTS.some(n=>t.includes(n))}handle401Error(t){if(this.isLoggingOut){this.logger.debug("Logout already in progress, skipping");return}this.isLoggingOut=!0,this.logger.warn("401 Unauthorized - authentication failed, logging out",{url:t.url,message:t.message}),this.authService.logout(),setTimeout(()=>{this.isLoggingOut=!1},1e3)}handle403Error(t){this.logger.warn("403 Forbidden - insufficient permissions",{url:t.url,message:t.message})}handleNetworkError(t){this.logger.error("Network error - server unreachable or timeout",{url:t.url,message:t.message})}static \u0275fac=function(t){return new(t||Tr)};static \u0275prov=E({token:Tr,factory:Tr.\u0275fac})};function wp(e){return()=>e.loadConfig()}Y(null,null,function*(){if(customElements.get("app-assistant"))return;let e=yield jC({providers:[hg(),hy({eventCoalescing:!0}),b5(w5()),{provide:Yh,useClass:s3,multi:!0},{provide:ch,useFactory:wp,deps:[Cp],multi:!0},Lh,A5.forRoot({level:ri.production?W.WARN:W.DEBUG,serverLogLevel:W.ERROR,disableConsoleLogging:!1,enableSourceMaps:!0,timestampFormat:"short"}).providers||[]]}),t=qy(i3,{injector:e.injector});customElements.define("app-assistant",t)});return Op(o3);})();
|
|
42
42
|
/*! Bundled license information:
|
|
43
43
|
|