@orca-pt/orca-components 1.0.1 β†’ 1.0.2

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.
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("vuetify/components"),require("markdown-it"),require("highlight.js"),require("markdown-it-link-attributes"),require("markdown-it-katex"),require("@videojs-player/vue"),require("mapbox-gl"),require("vuetify/dist/vuetify-labs.esm.js")):"function"==typeof define&&define.amd?define(["exports","vue","vuetify/components","markdown-it","highlight.js","markdown-it-link-attributes","markdown-it-katex","@videojs-player/vue","mapbox-gl","vuetify/dist/vuetify-labs.esm.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).OrcaComponents={},e.Vue,e.components,e.MarkdownIt,e.hljs,e.markdownItLinkAttributes,e.markdownItKatex,e.VideoPlayer,e.mapboxgl,e.VuetifyLabs)}(this,function(e,t,n,a,o,r,i,l,c,d){"use strict";function s(e){const t=[".jpg",".jpeg",".png",".gif",".webp",".bmp",".svg"];try{const n=new URL(e).pathname.toLowerCase();return t.some(e=>n.endsWith(e))}catch(n){return!1}}function u(e){try{const t=new URL(e).pathname,n=t.split("/").pop()||"";return decodeURIComponent(n)}catch(t){return null}}function g(e){const t=e.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/);return t&&11===t[7].length?t[7]:""}function m(e){if(!e)return"#1976D2";const t={primary:"#1976D2",secondary:"#424242",success:"#4CAF50",info:"#2196F3",warning:"#FB8C00",error:"#FF5252",accent:"#82B1FF"};return t[e.toLowerCase()]?t[e.toLowerCase()]:e}function p(e){const t={};return e.forEach(e=>{const n=e.row||1;t[n]||(t[n]=[]),t[n].push(e)}),Object.keys(t).sort((e,t)=>parseInt(e)-parseInt(t)).map(e=>t[parseInt(e)])}function f(e){if(!e)return{};const t=m(e);return{border:`1px solid ${t}`,color:t,"background-color":"transparent"}}function y(e){if(!e)return{};return{color:m(e),"background-color":"transparent"}}function k(e){if(!e)return{};const t=m(e);return{color:t,fill:t}}const v=[{type:"general-loading",start:"[orca.loading.start]",end:"[orca.loading.end]"},{type:"thinking-loading",start:"[orca.loading.thinking.start]",end:"[orca.loading.thinking.end]"},{type:"searching-loading",start:"[orca.loading.searching.start]",end:"[orca.loading.searching.end]"},{type:"coding-loading",start:"[orca.loading.coding.start]",end:"[orca.loading.coding.end]"},{type:"analyzing-loading",start:"[orca.loading.analyzing.start]",end:"[orca.loading.analyzing.end]"},{type:"generating-loading",start:"[orca.loading.generating.start]",end:"[orca.loading.generating.end]"},{type:"custom-loading",start:"[orca.loading.custom.start]",end:"[orca.loading.custom.end]"},{type:"image-loading",start:"[orca.loading.image.start]",end:"[orca.loading.image.end]"},{type:"video-loading",start:"[orca.loading.video.start]",end:"[orca.loading.video.end]"},{type:"youtube-loading",start:"[orca.loading.youtube.start]",end:"[orca.loading.youtube.end]"},{type:"card-loading",start:"[orca.loading.card.list.start]",end:"[orca.loading.card.list.end]"},{type:"map-loading",start:"[orca.loading.map.start]",end:"[orca.loading.map.end]"},{type:"image",start:"[orca.image.start]",end:"[orca.image.end]"},{type:"video",start:"[orca.video.start]",end:"[orca.video.end]"},{type:"youtube",start:"[orca.youtube.start]",end:"[orca.youtube.end]"},{type:"card",start:"[orca.list.card.start]",end:"[orca.list.card.end]"},{type:"location",start:"[orca.location.start]",end:"[orca.location.end]"},{type:"buttons",start:"[orca.buttons.start]",end:"[orca.buttons.end]"},{type:"tracing",start:"[orca.tracing.start]",end:"[orca.tracing.end]"},{type:"audio",start:"[orca.audio.start]",end:"[orca.audio.end]"}],h=["general-loading","thinking-loading","searching-loading","coding-loading","analyzing-loading","generating-loading","custom-loading"];function b(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w(e){const t=b(e.start),n=b(e.end);return new RegExp(`${t}(.*?)${n}`,"s")}const B=v.map(e=>({type:e.type,regex:w(e)}));function V(e,t){return e.filter(t)}function x(e,t,n){return e.replace(t,n?"$1":"")}function C(e,t,n=!1){let a=e;for(const o of t){a=x(a,w(o),n)}return a}function L(e,t){return C(e,t,!0)}function N(e,t,n){let a=L(e,t);return a=function(e,t){return C(e,t,!1)}(a,n),a}const E=function(e){return V(e,e=>{return t=e.type,h.includes(t);var t})}(v),_=function(e){return V(e,e=>!e.type.includes("-loading"))}(v);function I(e){return N(e,E,_)}function T(e){return B.map(({type:t,regex:n})=>{const a=e.match(n);return{type:t,match:a,index:a?e.indexOf(a[0]):1/0}}).filter(e=>null!==e.match&&e.index!==1/0)}function M(e,t,n){const a=function(e,t){const n=t.filter(t=>t!==e).map(e=>`${e}:`).join("|");return new RegExp(`${e}:\\s*([\\s\\S]*?)(?=\\s*(?:${n})|$)`,"m")}(t,n),o=e.match(a);if(!o||!o[1])return"";let r=o[1];r=r.replace(/\u200b/g,"");return r.split("\n")[0].trim()}function z(e,t,n){const a=t.map(e=>e.name);return e.split("- ").map(e=>e.trim()).filter(e=>e).map(e=>{const o={};for(const n of t){const t=M(e,n.name,a);if("number"===n.type){const e=parseInt(t,10);o[n.name]=Number.isFinite(e)?e:void 0!==n.defaultValue?n.defaultValue:void 0}else o[n.name]=t||(void 0!==n.defaultValue?n.defaultValue:n.required?"":void 0)}return n(o)})}const S=[{name:"photo",required:!0,defaultValue:"https://via.placeholder.com/300x200"},{name:"header",required:!0,defaultValue:"Card Title"},{name:"subheader",defaultValue:""}];const j=[{name:"type",required:!0,defaultValue:"action"},{name:"label",required:!0,defaultValue:"Button"},{name:"url",defaultValue:void 0},{name:"id",type:"number",defaultValue:void 0},{name:"color",defaultValue:"primary"},{name:"row",type:"number",defaultValue:1}];const F=[{name:"label",required:!0,defaultValue:"Audio Track"},{name:"url",required:!0,defaultValue:""},{name:"type",required:!0,defaultValue:"audio/mpeg"}];const D=["image","video","youtube"],O={card:function(e){return z(e,S,e=>({photo:e.photo||"",header:e.header||"",subheader:e.subheader||""}))},location:function(e){const[t,n]=e.split(",").map(e=>e.trim()),a=parseFloat(t),o=parseFloat(n);return{latitude:Number.isFinite(a)?a:0,longitude:Number.isFinite(o)?o:0}},buttons:function(e){return z(e,j,e=>({type:"link"===e.type?"link":"action",label:e.label||"",url:e.url,id:e.id,color:e.color,row:e.row}))},tracing:function(e){var t;const n=e.match(/visibility:\s*(\w+)/),a=(null==n?void 0:n[1])||"all",o=e.match(/content:\s*([\s\S]*)/);return{visibility:a,content:(null==(t=null==o?void 0:o[1])?void 0:t.trim())||e,rawContent:e}},audio:function(e){return z(e,F,e=>({label:e.label||"",url:e.url||"",type:e.type||""}))}};function A(e,t){if(function(e){return e.includes("-loading")}(e))return null;if(D.includes(e))return{type:e,content:t};const n=O[e];if(n){return{type:e,content:n(t)}}return null}function $(e){return h.includes(e)}function q(e){return t.computed(()=>function(e){const t=[];let n=e,a=0;const o=100;for(;n.length>0&&a<o;){a++;const e=T(n);if(0===e.length){H(t,n);break}const o=e.reduce((e,t)=>e.index<t.index?e:t);H(t,n.substring(0,o.index)),R(t,o);const r=o.index+o.match[0].length;n=n.substring(r)}return t}(t.unref(e)||""))}function H(e,t){const n=I(t).trim();n&&e.push({type:"text",content:n})}function R(e,t){const n=(t.match[1]??"").trim(),a=t.type.includes("-loading");if(a&&!n)return;if(a&&n){const t=L(n,E);if(t.trim()){const n=function(e){const t=[];let n=e,a=0;for(;n.length>0&&a<100;){a++;const e=T(n);if(0===e.length){const e=I(n).trim();e&&t.push({type:"text",content:e});break}const o=e.reduce((e,t)=>e.index<t.index?e:t),r=$(o.type),i=I(n.substring(0,o.index)).trim();if(i&&t.push({type:"text",content:i}),!r){const e=(o.match[1]??"").trim(),n=A(o.type,e);n&&t.push(n)}const l=o.index+o.match[0].length;n=n.substring(l)}return t}(t);e.push(...n)}return}const o=A(t.type,n);o&&e.push(o)}const P={start:"[orca.loading.start]",end:"[orca.loading.end]"},Y={start:"[orca.loading.thinking.start]",end:"[orca.loading.thinking.end]"},U={start:"[orca.loading.searching.start]",end:"[orca.loading.searching.end]"},G={start:"[orca.loading.coding.start]",end:"[orca.loading.coding.end]"},W={start:"[orca.loading.analyzing.start]",end:"[orca.loading.analyzing.end]"},X={start:"[orca.loading.generating.start]",end:"[orca.loading.generating.end]"},K={start:"[orca.loading.custom.start]",end:"[orca.loading.custom.end]"},Q={start:"[orca.loading.image.start]",end:"[orca.loading.image.end]",actual:/\[orca\.image\.start\](.*?)\[orca\.image\.end\]/s},Z={start:"[orca.loading.video.start]",end:"[orca.loading.video.end]",actual:/\[orca\.video\.start\](.*?)\[orca\.video\.end\]/s},J={start:"[orca.loading.youtube.start]",end:"[orca.loading.youtube.end]",actual:/\[orca\.youtube\.start\](.*?)\[orca\.youtube\.end\]/s},ee={start:"[orca.loading.card.start]",end:"[orca.loading.card.end]",actual:/\[orca\.list\.card\.start\](.*?)\[orca\.list\.card\.end\]/s},te={start:"[orca.loading.map.start]",end:"[orca.loading.map.end]",actual:/\[orca\.location\.start\](.*?)\[orca\.location\.end\]/s},ne={"general-loading":"⏳ Loading...","thinking-loading":"πŸ€” Thinking...","searching-loading":"πŸ” Searching...","coding-loading":"πŸ’» Coding...","analyzing-loading":"πŸ“Š Analyzing...","generating-loading":"✨ Generating...","custom-loading":"⏳ Processing...","image-loading":"πŸ–ΌοΈ Loading image...","video-loading":"πŸŽ₯ Loading video...","youtube-loading":"πŸ“Ί Loading YouTube video...","card-loading":"πŸƒ Loading cards...","map-loading":"πŸ—ΊοΈ Loading map..."};function ae(e,t,n){const a=e.includes(t),o=e.includes(n);return a&&!o}function oe(e,t,n,a){const o=e.includes(t),r=e.includes(n),i=!!a&&a.test(e);return o&&!r&&!i}const re='\n <div class="d-flex align-center">\n <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <rect x="6.66675" y="6.66675" width="10" height="10" rx="2" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M13.3333 6.66659V4.99992C13.3333 4.07944 12.5871 3.33325 11.6666 3.33325H4.99992C4.07944 3.33325 3.33325 4.07944 3.33325 4.99992V11.6666C3.33325 12.5871 4.07944 13.3333 4.99992 13.3333H6.66659" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n <span style="color:rgb(var(--v-theme-on-surface)); font-feature-settings: \'liga\' off, \'clig\' off; font-family: Inter; font-size: 12px; font-style: normal; font-weight: 400; line-height: 24px;">Copy</span>\n </div>\n',ie='\n <div class="d-flex align-center">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">\n <path d="M7.5 14.1667L10 11.6667L12.5 14.1667" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M7.5 5.83325L10 8.33325L12.5 5.83325" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n <span style="color: rgb(var(--v-theme-on-surface)); font-feature-settings: \'liga\' off, \'clig\' off; font-family: Inter; font-size: 12px; font-style: normal; font-weight: 400; line-height: 24px;"> Collapse</span>\n </div>\n';function le(e){if(e.closest(".code-container"))return;const t=document.createElement("div");t.className="code-container";const n=document.createElement("div");n.className="code-wrapper",n.style.transition="max-height 0.3s ease, opacity 0.3s ease",n.style.overflow="hidden",n.appendChild(e.cloneNode(!0));const a=document.createElement("div");a.className="buttons-container";const o=document.createElement("button");o.innerHTML=re,o.className="copy-btn",o.onclick=()=>{var t;!async function(e,t){try{await navigator.clipboard.writeText(e),t.innerHTML='\n <div class="d-flex align-center">\n <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M4.16663 9.99992L8.33329 14.1666L16.6666 5.83325" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n <span style="color: rgb(var(--v-theme-on-surface)); font-feature-settings: \'liga\' off, \'clig\' off; font-family: Inter; font-size: 12px; font-style: normal; font-weight: 400; line-height: 24px;"> Copied</span>\n </div>\n',setTimeout(()=>{t.innerHTML=re},2e3)}catch(n){}}((null==(t=e.querySelector("code"))?void 0:t.innerText)||"",o)};const r=document.createElement("button");r.innerHTML=ie,r.className="collapse-btn",r.onclick=()=>{!function(e,t){if(e.classList.contains("collapsed"))e.classList.remove("collapsed"),e.style.maxHeight="",e.style.overflow="",t.innerHTML=ie;else{e.classList.add("collapsed");const n=e.scrollHeight;e.style.maxHeight=`${n}px`,e.offsetHeight,e.style.maxHeight="0px",e.style.overflow="hidden",t.innerHTML='\n <div class="d-flex align-center">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">\n <path d="M7.5 14.1667L10 11.6667L12.5 14.1667" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M7.5 5.83325L10 8.33325L12.5 5.83325" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n <span style="color: rgb(var(--v-theme-on-surface)); font-feature-settings: \'liga\' off, \'clig\' off; font-family: Inter; font-size: 12px; font-style: normal; font-weight: 400; line-height: 24px;"> Expand</span>\n </div>\n'}}(n,r)},a.appendChild(r),a.appendChild(o),t.appendChild(a),t.appendChild(n),e.replaceWith(t)}const ce=["general-loading","thinking-loading","searching-loading","coding-loading","analyzing-loading","generating-loading","custom-loading","image-loading","video-loading","youtube-loading","card-loading","map-loading"];function de(e){return ce.includes(e)}const se=new a({html:!1,linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&o.getLanguage(t))try{return`<pre><code class="hljs">${o.highlight(e,{language:t}).value}</code></pre>`}catch{}return`<pre><code class="hljs">${(e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return e.replace(/[&<>"']/g,e=>t[e])})(e)}</code></pre>`}}).use(i).use(r,{pattern:/^https?:\/\//,attrs:{target:"_blank",rel:"noopener noreferrer"}});const ue={class:"image-container tw-my-4"},ge={class:"image-wrapper"},me=["src"],pe=(e,t)=>{const n=e.__vccOpts||e;for(const[a,o]of t)n[a]=o;return n},fe=pe(t.defineComponent({__name:"OrcaImage",props:{url:{}},emits:["open-modal"],setup(e,{emit:n}){const a=e,o=n,r=()=>{o("open-modal",a.url)};return(n,a)=>(t.openBlock(),t.createElementBlock("div",ue,[t.createElementVNode("div",ge,[t.createElementVNode("img",{src:e.url,alt:"Generated image",class:"orca-image",loading:"lazy",onClick:r},null,8,me),a[0]||(a[0]=t.createStaticVNode('<div class="image-overlay" data-v-e4f9d4c4><div class="zoom-icon" data-v-e4f9d4c4><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-e4f9d4c4><circle cx="11" cy="11" r="8" data-v-e4f9d4c4></circle><path d="m21 21-4.35-4.35" data-v-e4f9d4c4></path><line x1="11" y1="8" x2="11" y2="14" data-v-e4f9d4c4></line><line x1="8" y1="11" x2="14" y2="11" data-v-e4f9d4c4></line></svg></div></div>',1))])]))}}),[["__scopeId","data-v-e4f9d4c4"]]),ye={class:"orca-video-container"},ke={class:"video-wrapper"},ve=pe(t.defineComponent({__name:"OrcaVideo",props:{url:{}},setup(e){const n=t.ref({autoplay:!1,controls:!0,responsive:!0,fluid:!0,sources:[{type:"video/mp4",src:""}]});return(a,o)=>(t.openBlock(),t.createElementBlock("div",ye,[t.createElementVNode("div",ke,[t.createVNode(t.unref(l.VideoPlayer),{options:{...n.value,sources:[{type:"video/mp4",src:e.url}]},class:"video-player-custom"},null,8,["options"])])]))}}),[["__scopeId","data-v-7a20a30c"]]),he={class:"orca-youtube-container"},be={class:"youtube-wrapper"},we=["src"],Be=pe(t.defineComponent({__name:"OrcaYouTube",props:{url:{}},setup(e){const n=e,a=t.computed(()=>`https://www.youtube.com/embed/${g(n.url)}`);return(e,n)=>(t.openBlock(),t.createElementBlock("div",he,[t.createElementVNode("div",be,[t.createElementVNode("iframe",{width:"100%",height:"100%",src:a.value,frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"",class:"youtube-iframe"},null,8,we)])]))}}),[["__scopeId","data-v-9cd52c38"]]),Ve={class:"orca-audio-container"},xe={class:"audio-list"},Ce={class:"audio-content"},Le={class:"audio-label"},Ne=["type"],Ee=["src","type"],_e=pe(t.defineComponent({__name:"OrcaAudio",props:{audioItems:{}},setup:e=>(n,a)=>(t.openBlock(),t.createElementBlock("div",Ve,[t.createElementVNode("div",xe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.audioItems,(e,n)=>(t.openBlock(),t.createElementBlock("div",{key:n,class:"audio-item"},[a[1]||(a[1]=t.createElementVNode("div",{class:"audio-icon-wrapper"},[t.createElementVNode("svg",{class:"audio-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})])],-1)),t.createElementVNode("div",Ce,[t.createElementVNode("p",Le,t.toDisplayString(e.label),1),t.createElementVNode("audio",{controls:"",class:"audio-player",type:e.type},[t.createElementVNode("source",{src:e.url,type:e.type},null,8,Ee),a[0]||(a[0]=t.createTextVNode(" Your browser does not support the audio element. ",-1))],8,Ne)])]))),128))])]))}),[["__scopeId","data-v-ade9342b"]]),Ie={class:"orca-location-container"},Te={class:"map-wrapper"},Me={class:"location-info"},ze={class:"location-text"},Se=pe(t.defineComponent({__name:"OrcaLocation",props:{latitude:{},longitude:{},mapboxToken:{}},setup(e){const n=e,a=t.ref(null),o=t.ref(!1);return t.onUnmounted(()=>{a.value&&(a.value.remove(),a.value=null)}),(r,i)=>(t.openBlock(),t.createElementBlock("div",Ie,[t.createElementVNode("div",Te,[(t.openBlock(),t.createElementBlock("div",{ref:e=>(e=>{const r=e&&"tagName"in e?e:null;r&&e&&(o.value=!0,t.nextTick(()=>{try{c.accessToken=n.mapboxToken||"pk.eyJ1IjoicG91cnlhYnpwIiwiYSI6ImNsZ3Vuanl4YzF2NXkzZW1tcnR0MTlxNXEifQ.I3RdtfiL0ObnXbWVKxW1gQ",a.value&&(a.value.remove(),a.value=null);const e=`map-${n.latitude}-${n.longitude}`;r.id=e;const t=new c.Map({container:r,style:"mapbox://styles/mapbox/streets-v11",center:[n.longitude,n.latitude],zoom:12,attributionControl:!1});a.value=t,t.on("load",()=>{new c.Marker({color:"#0D5FD6"}).setLngLat([n.longitude,n.latitude]).addTo(t),t.addControl(new c.NavigationControl),setTimeout(()=>{t.resize()},100),o.value=!1}),t.on("error",e=>{o.value=!1}),t.on("render",()=>{t.resize()})}catch(e){o.value=!1}}))})(e),class:"map-container",key:`map-${e.latitude}-${e.longitude}`}))]),t.createElementVNode("div",Me,[i[0]||(i[0]=t.createElementVNode("div",{class:"location-icon"},[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),t.createElementVNode("circle",{cx:"12",cy:"10",r:"3"})])],-1)),t.createElementVNode("span",ze,t.toDisplayString(e.latitude.toFixed(6))+", "+t.toDisplayString(e.longitude.toFixed(6)),1)])]))}}),[["__scopeId","data-v-99a42606"]]),je={class:"orca-card-container"},Fe={key:0,class:"card-image-wrapper"},De={key:1,class:"card-subheader"},Oe={key:2,class:"card-text"},Ae=pe(t.defineComponent({__name:"OrcaCardList",props:{cards:{}},setup:e=>(a,o)=>(t.openBlock(),t.createElementBlock("div",je,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.cards,(e,a)=>(t.openBlock(),t.createBlock(t.unref(n.VCard),{key:a,class:"orca-card",elevation:"2"},{default:t.withCtx(()=>[e.photo?(t.openBlock(),t.createElementBlock("div",Fe,[t.createVNode(t.unref(n.VImg),{src:e.photo,height:"223",cover:"",class:"card-image"},null,8,["src"])])):t.createCommentVNode("",!0),t.createVNode(t.unref(n.VCardItem),{class:"card-content"},{default:t.withCtx(()=>[e.header?(t.openBlock(),t.createBlock(t.unref(n.VCardTitle),{key:0,class:"card-header"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.header),1)]),_:2},1024)):t.createCommentVNode("",!0),e.subheader?(t.openBlock(),t.createElementBlock("span",De,t.toDisplayString(e.subheader),1)):t.createCommentVNode("",!0),e.text?(t.openBlock(),t.createElementBlock("p",Oe,t.toDisplayString(e.text),1)):t.createCommentVNode("",!0)]),_:2},1024)]),_:2},1024))),128))]))}),[["__scopeId","data-v-d9e3b93c"]]),$e={class:"orca-buttons-container tw-my-4"},qe=pe(t.defineComponent({__name:"OrcaButtons",props:{buttons:{},disabled:{type:Boolean}},emits:["button-click"],setup(e,{emit:a}){const o=e,r=a,i=t.computed(()=>p(o.buttons));return(a,l)=>(t.openBlock(),t.createElementBlock("div",$e,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,(a,i)=>(t.openBlock(),t.createElementBlock("div",{key:i,class:"button-row"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a,(a,i)=>(t.openBlock(),t.createBlock(t.unref(n.VBtn),{disabled:e.disabled,key:i,class:t.normalizeClass(["orca-button","custom-outlined-button"]),style:t.normalizeStyle(t.unref(f)(a.color)),variant:"text",rounded:"xl",target:"link"===a.type?"_blank":void 0,href:"link"===a.type?a.url:void 0,onClick:e=>(e=>{"action"!==e.type||o.disabled||r("button-click",e)})(a)},t.createSlots({default:t.withCtx(()=>[t.createElementVNode("span",{style:t.normalizeStyle(t.unref(y)(a.color))},t.toDisplayString(a.label),5)]),_:2},["link"===a.type?{name:"append",fn:t.withCtx(()=>[t.createVNode(t.unref(n.VIcon),{icon:"tabler-external-link",style:t.normalizeStyle(t.unref(k)(a.color)),size:"small"},null,8,["style"])]),key:"0"}:void 0]),1032,["disabled","style","target","href","onClick"]))),128))]))),128))]))}}),[["__scopeId","data-v-480c6090"]]),He={key:0,class:"orca-trace-container"},Re={class:"trace-header"},Pe={key:0,class:"trace-content"},Ye={class:"trace-pre"},Ue=pe(t.defineComponent({__name:"OrcaTracing",props:{tracingData:{},visibility:{},isAdmin:{type:Boolean}},setup(e){const a=e,o=t.ref(!1),r=t.computed(()=>o.value),i=t.computed(()=>Array.isArray(a.tracingData)?a.tracingData.some(e=>"all"===e.visibility||"admin"===e.visibility&&a.isAdmin):"all"===a.tracingData.visibility||"admin"===a.tracingData.visibility&&a.isAdmin),l=t.computed(()=>Array.isArray(a.tracingData)?a.tracingData.map(e=>e.content||e.rawContent).join("\n\n"):a.tracingData.content||a.tracingData.rawContent||""),c=()=>{o.value=!o.value};return(e,a)=>i.value?(t.openBlock(),t.createElementBlock("div",He,[t.createVNode(t.unref(n.VCard),{class:"trace-card",elevation:"2"},{default:t.withCtx(()=>[t.createElementVNode("div",Re,[a[0]||(a[0]=t.createElementVNode("div",{class:"trace-header-content"},[t.createElementVNode("div",{class:"trace-icon"},[t.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})])]),t.createElementVNode("strong",{class:"trace-title"},"Trace Log")],-1)),t.createVNode(t.unref(n.VBtn),{size:"small",variant:"tonal",color:"primary",class:"trace-toggle-btn",onClick:c},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.value?"Hide":"Show"),1)]),_:1})]),t.createVNode(t.unref(n.VExpandTransition),null,{default:t.withCtx(()=>[r.value?(t.openBlock(),t.createElementBlock("div",Pe,[t.createElementVNode("pre",Ye,t.toDisplayString(l.value),1)])):t.createCommentVNode("",!0)]),_:1})]),_:1})])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-69e262d5"]]),Ge=["innerHTML"],We=t.defineComponent({__name:"ContentElement",props:{element:{},disabledButton:{type:Boolean},visibility:{},isAdmin:{type:Boolean},mapboxToken:{}},emits:["image-modal","button-click"],setup(e,{emit:n}){const a=n,{render:o}={render:e=>{const t=e.replace(/\[orca\..*?\]/g,"").trim();return t?se.render(t):""}},r=e=>{a("image-modal",e)},i=e=>{a("button-click",e)};return(n,a)=>(t.openBlock(),t.createElementBlock("div",null,["text"===e.element.type?(t.openBlock(),t.createElementBlock("div",{key:0,class:"text-content",innerHTML:t.unref(o)(e.element.content)},null,8,Ge)):"image"===e.element.type?(t.openBlock(),t.createBlock(fe,{key:1,url:e.element.content,onOpenModal:r},null,8,["url"])):"video"===e.element.type?(t.openBlock(),t.createBlock(ve,{key:2,url:e.element.content},null,8,["url"])):"youtube"===e.element.type?(t.openBlock(),t.createBlock(Be,{key:3,url:e.element.content},null,8,["url"])):"audio"===e.element.type?(t.openBlock(),t.createBlock(_e,{key:4,"audio-items":e.element.content},null,8,["audio-items"])):"location"===e.element.type?(t.openBlock(),t.createBlock(Se,{key:5,latitude:e.element.content.latitude,longitude:e.element.content.longitude,"mapbox-token":e.mapboxToken},null,8,["latitude","longitude","mapbox-token"])):"card"===e.element.type?(t.openBlock(),t.createBlock(Ae,{key:6,cards:e.element.content},null,8,["cards"])):"buttons"===e.element.type?(t.openBlock(),t.createBlock(qe,{key:7,buttons:e.element.content,disabled:e.disabledButton,onButtonClick:i},null,8,["buttons","disabled"])):"tracing"===e.element.type?(t.openBlock(),t.createBlock(Ue,{key:8,"tracing-data":e.element.content,visibility:e.visibility,"is-admin":e.isAdmin},null,8,["tracing-data","visibility","is-admin"])):t.createCommentVNode("",!0)]))}}),Xe={key:0,class:"general-loading-container"},Ke={class:"loading-content"},Qe={class:"loading-text"},Ze=pe(t.defineComponent({__name:"GeneralLoading",props:{isLoading:{type:Boolean},message:{}},setup:e=>(a,o)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>[e.isLoading?(t.openBlock(),t.createElementBlock("div",Xe,[t.createElementVNode("div",Ke,[t.createVNode(t.unref(n.VProgressCircular),{indeterminate:"",size:24,width:3,color:"primary",class:"loading-spinner"}),t.createElementVNode("span",Qe,t.toDisplayString(e.message),1)])])):t.createCommentVNode("",!0)]),_:1}))}),[["__scopeId","data-v-ba70521a"]]),Je={key:0,class:"image-loading-placeholder"},et={class:"loading-skeleton-image"},tt=pe(t.defineComponent({__name:"ImageLoading",props:{isLoading:{type:Boolean}},setup:e=>(a,o)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>[e.isLoading?(t.openBlock(),t.createElementBlock("div",Je,[t.createElementVNode("div",et,[t.createVNode(t.unref(n.VProgressCircular),{indeterminate:"",size:48,width:4,color:"primary",class:"loading-spinner-large"}),o[0]||(o[0]=t.createElementVNode("span",{class:"loading-skeleton-text"},"πŸ–ΌοΈ Loading image...",-1))])])):t.createCommentVNode("",!0)]),_:1}))}),[["__scopeId","data-v-39a596d3"]]),nt={key:0,class:"video-loading-placeholder"},at={class:"loading-skeleton-video"},ot=pe(t.defineComponent({__name:"VideoLoading",props:{isLoading:{type:Boolean}},setup:e=>(a,o)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>[e.isLoading?(t.openBlock(),t.createElementBlock("div",nt,[t.createElementVNode("div",at,[t.createVNode(t.unref(n.VProgressCircular),{indeterminate:"",size:48,width:4,color:"primary",class:"loading-spinner-large"}),o[0]||(o[0]=t.createElementVNode("div",{class:"loading-skeleton-text"},"πŸŽ₯ Loading video...",-1))])])):t.createCommentVNode("",!0)]),_:1}))}),[["__scopeId","data-v-0889a265"]]),rt={key:0,class:"card-loading-placeholder"},it=pe(t.defineComponent({__name:"CardLoading",props:{isLoading:{type:Boolean}},setup(e){const n=d.components.VSkeletonLoader;return(a,o)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>[e.isLoading?(t.openBlock(),t.createElementBlock("div",rt,[t.createVNode(t.unref(n),{class:"card-skeleton",width:"311",type:"image, article"}),o[0]||(o[0]=t.createElementVNode("span",{class:"loading-skeleton-text"},"πŸƒ Loading cards...",-1))])):t.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-2d326b15"]]),lt={key:0,class:"map-loading-placeholder"},ct=pe(t.defineComponent({__name:"MapLoading",props:{isLoading:{type:Boolean}},setup(e){const n=d.components.VSkeletonLoader;return(a,o)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>[e.isLoading?(t.openBlock(),t.createElementBlock("div",lt,[t.createVNode(t.unref(n),{class:"map-skeleton",width:"500",height:"300",type:"image"}),o[0]||(o[0]=t.createElementVNode("span",{class:"loading-skeleton-text"},"πŸ—ΊοΈ Loading map...",-1))])):t.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-4bb3095a"]]),dt={class:"message-content"},st={key:0,class:"tw-flex tw-flex-wrap tw-gap-4 tw-mt-4 tw-mb-4"},ut=["src","onClick"],gt={class:"modal-content"},mt=pe(t.defineComponent({__name:"OrcaMarkdown",props:{description:{},role:{},images:{},fileAttachments:{default:()=>[]},isLastMessage:{type:Boolean,default:!1},storeIdentifier:{},visibility:{default:"all"}},emits:["send-message"],setup(e,{emit:a}){const o=e,r=a,i=t.ref(null),{modalVisible:l,currentImage:c,openModal:d,closeModal:g}=function(){const e=t.ref(!1),n=t.ref("");return{modalVisible:e,currentImage:n,openModal:t=>{n.value=t,e.value=!0},closeModal:()=>{e.value=!1,setTimeout(()=>{n.value=""},300)}}}(),m=q(t.computed(()=>o.description)),{isLoading:p,isImageLoading:f,isVideoLoading:y,isCardLoading:k,isLocationLoading:v,getLoadingMessage:h}=function(e){const n=t.ref(!1),a=t.ref(!1),o=t.ref(!1),r=t.ref(!1),i=t.ref(!1),l=t.computed(()=>t.unref(e));return t.watch(l,e=>{if(!e)return void(n.value=!1);const t=ae(e,P.start,P.end)||ae(e,Y.start,Y.end)||ae(e,U.start,U.end)||ae(e,G.start,G.end)||ae(e,W.start,W.end)||ae(e,X.start,X.end)||ae(e,K.start,K.end);n.value=t},{immediate:!0}),t.watch(l,e=>{a.value=oe(e,Q.start,Q.end,Q.actual)},{immediate:!0}),t.watch(l,e=>{const t=oe(e,Z.start,Z.end,Z.actual),n=oe(e,J.start,J.end,J.actual);o.value=t||n},{immediate:!0}),t.watch(l,e=>{r.value=oe(e,ee.start,ee.end,ee.actual)},{immediate:!0}),t.watch(l,e=>{i.value=oe(e,te.start,te.end,te.actual)},{immediate:!0}),{isLoading:n,isImageLoading:a,isVideoLoading:o,isCardLoading:r,isLocationLoading:i,getLoadingMessage:e=>ne[e]||ne["general-loading"]}}(t.computed(()=>o.description)),b=t.computed(()=>o.fileAttachments.filter(e=>e&&s(e))),w=t.computed(()=>o.fileAttachments.filter(e=>e&&!s(e))),B=t.computed(()=>"assistant"!==o.role||!o.isLastMessage||V()),V=()=>"admin"===o.visibility,x=t.computed(()=>{const e=o.description||"";return e.includes("[orca.loading.thinking.start]")&&!e.includes("[orca.loading.thinking.end]")?"thinking-loading":e.includes("[orca.loading.searching.start]")&&!e.includes("[orca.loading.searching.end]")?"searching-loading":e.includes("[orca.loading.coding.start]")&&!e.includes("[orca.loading.coding.end]")?"coding-loading":e.includes("[orca.loading.analyzing.start]")&&!e.includes("[orca.loading.analyzing.end]")?"analyzing-loading":e.includes("[orca.loading.generating.start]")&&!e.includes("[orca.loading.generating.end]")?"generating-loading":e.includes("[orca.loading.custom.start]")&&!e.includes("[orca.loading.custom.end]")?"custom-loading":e.includes("[orca.loading.start]")&&!e.includes("[orca.loading.end]")?"general-loading":null}),C=t.computed(()=>{if(p.value){const e=x.value;return e?h(e):"⏳ Loading..."}return"⏳ Loading..."}),{addCodeButtons:L}=function(e,n){const a=()=>{t.nextTick(()=>{e.value&&n()&&e.value.querySelectorAll("pre").forEach(e=>{le(e)})})};return t.onMounted(()=>{a()}),{addCodeButtons:a}}(i,()=>"user"!==o.role);t.watch(m,()=>{L()});const N=async e=>{if("action"===e.type&&!B.value)try{r("send-message",{message:e.label,buttonData:e,type:"button-action"})}catch(t){}},E=e=>{d(e)};return(e,a)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",dt,[t.createElementVNode("div",{ref_key:"messageContentRef",ref:i,class:"content-wrapper"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(m),(e,n)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:n},[t.unref(de)(e.type)?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(We,{key:0,element:e,"disabled-button":B.value,visibility:o.visibility,"is-admin":V(),onImageModal:E,onButtonClick:N},null,8,["element","disabled-button","visibility","is-admin"]))],64))),128)),t.createVNode(Ze,{isLoading:t.unref(p),message:C.value},null,8,["isLoading","message"]),t.createVNode(tt,{isLoading:t.unref(f)},null,8,["isLoading"]),t.createVNode(ot,{isLoading:t.unref(y)},null,8,["isLoading"]),t.createVNode(it,{isLoading:t.unref(k)},null,8,["isLoading"]),t.createVNode(ct,{isLoading:t.unref(v)},null,8,["isLoading"]),o.fileAttachments&&o.fileAttachments.length>0&&"user"===o.role?(t.openBlock(),t.createElementBlock("div",st,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,e=>(t.openBlock(),t.createElementBlock("img",{key:e,src:e,class:"tw-w-[300px] lg:tw-w-[303px] tw-h-[300px] lg:tw-h-[303px] tw-object-cover tw-rounded-lg tw-cursor-pointer",onClick:n=>t.unref(d)(e)},null,8,ut))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.value,e=>(t.openBlock(),t.createBlock(t.unref(n.VBtn),{key:e,class:"text-center text-sm",variant:"tonal",color:"grey-500",href:e,target:"_blank",rel:"noopener noreferrer"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(u)(e)),1)]),_:2},1032,["href"]))),128))])):t.createCommentVNode("",!0)],512)]),t.createVNode(t.unref(n.VDialog),{modelValue:t.unref(l),"onUpdate:modelValue":a[1]||(a[1]=e=>t.isRef(l)?l.value=e:null),fullscreen:"",class:"image-modal",scrim:"rgba(0, 0, 0, 0.85)",onClick:t.unref(g),transition:"fade-transition"},{default:t.withCtx(()=>[t.createElementVNode("div",{class:"modal-close-btn",onClick:a[0]||(a[0]=t.withModifiers((...e)=>t.unref(g)&&t.unref(g)(...e),["stop"]))},[...a[2]||(a[2]=[t.createElementVNode("button",{class:"close-button","aria-label":"Close image"},[t.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[t.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})])],-1)])]),t.createElementVNode("div",gt,[t.createVNode(t.unref(n.VImg),{src:t.unref(c),class:"modal-image",contain:""},null,8,["src"])])]),_:1},8,["modelValue","onClick"])],64))}}),[["__scopeId","data-v-619a1855"]]);e.OrcaMarkdown=mt,e.cleanOrcaMarkers=function(e){return e.replace(/\[orca\..*?\]/g,"").trim()},e.generateMapId=function(e){return`map-container-${e}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`},e.getAppendIconStyle=k,e.getFileNameFromUrl=u,e.getGroupedButtons=p,e.getOutlinedButtonStyle=f,e.getOutlinedButtonTextStyle=y,e.getVuetifyColor=m,e.getYouTubeId=g,e.hasLoadingMarkers=function(e){return/\[orca\.(?:loading|image\.loading|loading\.image)\.start\]/.test(e)},e.isImageFile=s,e.packageInfo={name:"@orca-pt/orca-components",version:"1.0.1",description:"Orca native components for rendering special content markers",author:"Orca Team"},e.version="1.0.1",Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("vuetify/components"),require("markdown-it"),require("highlight.js"),require("markdown-it-link-attributes"),require("markdown-it-katex"),require("@videojs-player/vue"),require("mapbox-gl"),require("vuetify/dist/vuetify-labs.esm.js")):"function"==typeof define&&define.amd?define(["exports","vue","vuetify/components","markdown-it","highlight.js","markdown-it-link-attributes","markdown-it-katex","@videojs-player/vue","mapbox-gl","vuetify/dist/vuetify-labs.esm.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).OrcaComponents={},e.Vue,e.components,e.MarkdownIt,e.hljs,e.markdownItLinkAttributes,e.markdownItKatex,e.VideoPlayer,e.mapboxgl,e.VuetifyLabs)}(this,function(e,t,n,a,o,r,i,l,c,d){"use strict";function s(e){const t=[".jpg",".jpeg",".png",".gif",".webp",".bmp",".svg"];try{const n=new URL(e).pathname.toLowerCase();return t.some(e=>n.endsWith(e))}catch(n){return!1}}function u(e){try{const t=new URL(e).pathname,n=t.split("/").pop()||"";return decodeURIComponent(n)}catch(t){return null}}function g(e){const t=e.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/);return t&&11===t[7].length?t[7]:""}function m(e){if(!e)return"#1976D2";const t={primary:"#1976D2",secondary:"#424242",success:"#4CAF50",info:"#2196F3",warning:"#FB8C00",error:"#FF5252",accent:"#82B1FF"};return t[e.toLowerCase()]?t[e.toLowerCase()]:e}function p(e){const t={};return e.forEach(e=>{const n=e.row||1;t[n]||(t[n]=[]),t[n].push(e)}),Object.keys(t).sort((e,t)=>parseInt(e)-parseInt(t)).map(e=>t[parseInt(e)])}function f(e){if(!e)return{};const t=m(e);return{border:`1px solid ${t}`,color:t,"background-color":"transparent"}}function y(e){if(!e)return{};return{color:m(e),"background-color":"transparent"}}function k(e){if(!e)return{};const t=m(e);return{color:t,fill:t}}const v=[{type:"general-loading",start:"[orca.loading.start]",end:"[orca.loading.end]"},{type:"thinking-loading",start:"[orca.loading.thinking.start]",end:"[orca.loading.thinking.end]"},{type:"searching-loading",start:"[orca.loading.searching.start]",end:"[orca.loading.searching.end]"},{type:"coding-loading",start:"[orca.loading.coding.start]",end:"[orca.loading.coding.end]"},{type:"analyzing-loading",start:"[orca.loading.analyzing.start]",end:"[orca.loading.analyzing.end]"},{type:"generating-loading",start:"[orca.loading.generating.start]",end:"[orca.loading.generating.end]"},{type:"custom-loading",start:"[orca.loading.custom.start]",end:"[orca.loading.custom.end]"},{type:"image-loading",start:"[orca.loading.image.start]",end:"[orca.loading.image.end]"},{type:"video-loading",start:"[orca.loading.video.start]",end:"[orca.loading.video.end]"},{type:"youtube-loading",start:"[orca.loading.youtube.start]",end:"[orca.loading.youtube.end]"},{type:"card-loading",start:"[orca.loading.card.list.start]",end:"[orca.loading.card.list.end]"},{type:"map-loading",start:"[orca.loading.map.start]",end:"[orca.loading.map.end]"},{type:"image",start:"[orca.image.start]",end:"[orca.image.end]"},{type:"video",start:"[orca.video.start]",end:"[orca.video.end]"},{type:"youtube",start:"[orca.youtube.start]",end:"[orca.youtube.end]"},{type:"card",start:"[orca.list.card.start]",end:"[orca.list.card.end]"},{type:"location",start:"[orca.location.start]",end:"[orca.location.end]"},{type:"buttons",start:"[orca.buttons.start]",end:"[orca.buttons.end]"},{type:"tracing",start:"[orca.tracing.start]",end:"[orca.tracing.end]"},{type:"audio",start:"[orca.audio.start]",end:"[orca.audio.end]"}],h=["general-loading","thinking-loading","searching-loading","coding-loading","analyzing-loading","generating-loading","custom-loading"];function b(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w(e){const t=b(e.start),n=b(e.end);return new RegExp(`${t}(.*?)${n}`,"s")}const B=v.map(e=>({type:e.type,regex:w(e)}));function V(e,t){return e.filter(t)}function x(e,t,n){return e.replace(t,n?"$1":"")}function C(e,t,n=!1){let a=e;for(const o of t){a=x(a,w(o),n)}return a}function L(e,t){return C(e,t,!0)}function N(e,t,n){let a=L(e,t);return a=function(e,t){return C(e,t,!1)}(a,n),a}const E=function(e){return V(e,e=>{return t=e.type,h.includes(t);var t})}(v),_=function(e){return V(e,e=>!e.type.includes("-loading"))}(v);function I(e){return N(e,E,_)}function T(e){return B.map(({type:t,regex:n})=>{const a=e.match(n);return{type:t,match:a,index:a?e.indexOf(a[0]):1/0}}).filter(e=>null!==e.match&&e.index!==1/0)}function M(e,t,n){const a=function(e,t){const n=t.filter(t=>t!==e).map(e=>`${e}:`).join("|");return new RegExp(`${e}:\\s*([\\s\\S]*?)(?=\\s*(?:${n})|$)`,"m")}(t,n),o=e.match(a);if(!o||!o[1])return"";let r=o[1];r=r.replace(/\u200b/g,"");return r.split("\n")[0].trim()}function z(e,t,n){const a=t.map(e=>e.name);return e.split("- ").map(e=>e.trim()).filter(e=>e).map(e=>{const o={};for(const n of t){const t=M(e,n.name,a);if("number"===n.type){const e=parseInt(t,10);o[n.name]=Number.isFinite(e)?e:void 0!==n.defaultValue?n.defaultValue:void 0}else o[n.name]=t||(void 0!==n.defaultValue?n.defaultValue:n.required?"":void 0)}return n(o)})}const S=[{name:"photo",required:!0,defaultValue:"https://via.placeholder.com/300x200"},{name:"header",required:!0,defaultValue:"Card Title"},{name:"subheader",defaultValue:""}];const j=[{name:"type",required:!0,defaultValue:"action"},{name:"label",required:!0,defaultValue:"Button"},{name:"url",defaultValue:void 0},{name:"id",type:"number",defaultValue:void 0},{name:"color",defaultValue:"primary"},{name:"row",type:"number",defaultValue:1}];const F=[{name:"label",required:!0,defaultValue:"Audio Track"},{name:"url",required:!0,defaultValue:""},{name:"type",required:!0,defaultValue:"audio/mpeg"}];const D=["image","video","youtube"],O={card:function(e){return z(e,S,e=>({photo:e.photo||"",header:e.header||"",subheader:e.subheader||""}))},location:function(e){const[t,n]=e.split(",").map(e=>e.trim()),a=parseFloat(t),o=parseFloat(n);return{latitude:Number.isFinite(a)?a:0,longitude:Number.isFinite(o)?o:0}},buttons:function(e){return z(e,j,e=>({type:"link"===e.type?"link":"action",label:e.label||"",url:e.url,id:e.id,color:e.color,row:e.row}))},tracing:function(e){var t;const n=e.match(/visibility:\s*(\w+)/),a=(null==n?void 0:n[1])||"all",o=e.match(/content:\s*([\s\S]*)/);return{visibility:a,content:(null==(t=null==o?void 0:o[1])?void 0:t.trim())||e,rawContent:e}},audio:function(e){return z(e,F,e=>({label:e.label||"",url:e.url||"",type:e.type||""}))}};function A(e,t){if(function(e){return e.includes("-loading")}(e))return null;if(D.includes(e))return{type:e,content:t};const n=O[e];if(n){return{type:e,content:n(t)}}return null}function $(e){return h.includes(e)}function q(e){return t.computed(()=>function(e){const t=[];let n=e,a=0;const o=100;for(;n.length>0&&a<o;){a++;const e=T(n);if(0===e.length){H(t,n);break}const o=e.reduce((e,t)=>e.index<t.index?e:t);H(t,n.substring(0,o.index)),R(t,o);const r=o.index+o.match[0].length;n=n.substring(r)}return t}(t.unref(e)||""))}function H(e,t){const n=I(t).trim();n&&e.push({type:"text",content:n})}function R(e,t){const n=(t.match[1]??"").trim(),a=t.type.includes("-loading");if(a&&!n)return;if(a&&n){const t=L(n,E);if(t.trim()){const n=function(e){const t=[];let n=e,a=0;for(;n.length>0&&a<100;){a++;const e=T(n);if(0===e.length){const e=I(n).trim();e&&t.push({type:"text",content:e});break}const o=e.reduce((e,t)=>e.index<t.index?e:t),r=$(o.type),i=I(n.substring(0,o.index)).trim();if(i&&t.push({type:"text",content:i}),!r){const e=(o.match[1]??"").trim(),n=A(o.type,e);n&&t.push(n)}const l=o.index+o.match[0].length;n=n.substring(l)}return t}(t);e.push(...n)}return}const o=A(t.type,n);o&&e.push(o)}const P={start:"[orca.loading.start]",end:"[orca.loading.end]"},Y={start:"[orca.loading.thinking.start]",end:"[orca.loading.thinking.end]"},U={start:"[orca.loading.searching.start]",end:"[orca.loading.searching.end]"},G={start:"[orca.loading.coding.start]",end:"[orca.loading.coding.end]"},W={start:"[orca.loading.analyzing.start]",end:"[orca.loading.analyzing.end]"},X={start:"[orca.loading.generating.start]",end:"[orca.loading.generating.end]"},K={start:"[orca.loading.custom.start]",end:"[orca.loading.custom.end]"},Q={start:"[orca.loading.image.start]",end:"[orca.loading.image.end]",actual:/\[orca\.image\.start\](.*?)\[orca\.image\.end\]/s},Z={start:"[orca.loading.video.start]",end:"[orca.loading.video.end]",actual:/\[orca\.video\.start\](.*?)\[orca\.video\.end\]/s},J={start:"[orca.loading.youtube.start]",end:"[orca.loading.youtube.end]",actual:/\[orca\.youtube\.start\](.*?)\[orca\.youtube\.end\]/s},ee={start:"[orca.loading.card.start]",end:"[orca.loading.card.end]",actual:/\[orca\.list\.card\.start\](.*?)\[orca\.list\.card\.end\]/s},te={start:"[orca.loading.map.start]",end:"[orca.loading.map.end]",actual:/\[orca\.location\.start\](.*?)\[orca\.location\.end\]/s},ne={"general-loading":"⏳ Loading...","thinking-loading":"πŸ€” Thinking...","searching-loading":"πŸ” Searching...","coding-loading":"πŸ’» Coding...","analyzing-loading":"πŸ“Š Analyzing...","generating-loading":"✨ Generating...","custom-loading":"⏳ Processing...","image-loading":"πŸ–ΌοΈ Loading image...","video-loading":"πŸŽ₯ Loading video...","youtube-loading":"πŸ“Ί Loading YouTube video...","card-loading":"πŸƒ Loading cards...","map-loading":"πŸ—ΊοΈ Loading map..."};function ae(e,t,n){const a=e.includes(t),o=e.includes(n);return a&&!o}function oe(e,t,n,a){const o=e.includes(t),r=e.includes(n),i=!!a&&a.test(e);return o&&!r&&!i}const re='\n <div class="d-flex align-center">\n <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <rect x="6.66675" y="6.66675" width="10" height="10" rx="2" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M13.3333 6.66659V4.99992C13.3333 4.07944 12.5871 3.33325 11.6666 3.33325H4.99992C4.07944 3.33325 3.33325 4.07944 3.33325 4.99992V11.6666C3.33325 12.5871 4.07944 13.3333 4.99992 13.3333H6.66659" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n <span style="color:rgb(var(--v-theme-on-surface)); font-feature-settings: \'liga\' off, \'clig\' off; font-family: Inter; font-size: 12px; font-style: normal; font-weight: 400; line-height: 24px;">Copy</span>\n </div>\n',ie='\n <div class="d-flex align-center">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">\n <path d="M7.5 14.1667L10 11.6667L12.5 14.1667" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M7.5 5.83325L10 8.33325L12.5 5.83325" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n <span style="color: rgb(var(--v-theme-on-surface)); font-feature-settings: \'liga\' off, \'clig\' off; font-family: Inter; font-size: 12px; font-style: normal; font-weight: 400; line-height: 24px;"> Collapse</span>\n </div>\n';function le(e){if(e.closest(".code-container"))return;const t=document.createElement("div");t.className="code-container";const n=document.createElement("div");n.className="code-wrapper",n.style.transition="max-height 0.3s ease, opacity 0.3s ease",n.style.overflow="hidden",n.appendChild(e.cloneNode(!0));const a=document.createElement("div");a.className="buttons-container";const o=document.createElement("button");o.innerHTML=re,o.className="copy-btn",o.onclick=()=>{var t;!async function(e,t){try{await navigator.clipboard.writeText(e),t.innerHTML='\n <div class="d-flex align-center">\n <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M4.16663 9.99992L8.33329 14.1666L16.6666 5.83325" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n <span style="color: rgb(var(--v-theme-on-surface)); font-feature-settings: \'liga\' off, \'clig\' off; font-family: Inter; font-size: 12px; font-style: normal; font-weight: 400; line-height: 24px;"> Copied</span>\n </div>\n',setTimeout(()=>{t.innerHTML=re},2e3)}catch(n){}}((null==(t=e.querySelector("code"))?void 0:t.innerText)||"",o)};const r=document.createElement("button");r.innerHTML=ie,r.className="collapse-btn",r.onclick=()=>{!function(e,t){if(e.classList.contains("collapsed"))e.classList.remove("collapsed"),e.style.maxHeight="",e.style.overflow="",t.innerHTML=ie;else{e.classList.add("collapsed");const n=e.scrollHeight;e.style.maxHeight=`${n}px`,e.offsetHeight,e.style.maxHeight="0px",e.style.overflow="hidden",t.innerHTML='\n <div class="d-flex align-center">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">\n <path d="M7.5 14.1667L10 11.6667L12.5 14.1667" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M7.5 5.83325L10 8.33325L12.5 5.83325" stroke="rgb(var(--v-theme-on-surface))" stroke-opacity="0.9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n <span style="color: rgb(var(--v-theme-on-surface)); font-feature-settings: \'liga\' off, \'clig\' off; font-family: Inter; font-size: 12px; font-style: normal; font-weight: 400; line-height: 24px;"> Expand</span>\n </div>\n'}}(n,r)},a.appendChild(r),a.appendChild(o),t.appendChild(a),t.appendChild(n),e.replaceWith(t)}const ce=["general-loading","thinking-loading","searching-loading","coding-loading","analyzing-loading","generating-loading","custom-loading","image-loading","video-loading","youtube-loading","card-loading","map-loading"];function de(e){return ce.includes(e)}const se=new a({html:!1,linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&o.getLanguage(t))try{return`<pre><code class="hljs">${o.highlight(e,{language:t}).value}</code></pre>`}catch{}return`<pre><code class="hljs">${(e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return e.replace(/[&<>"']/g,e=>t[e])})(e)}</code></pre>`}}).use(i).use(r,{pattern:/^https?:\/\//,attrs:{target:"_blank",rel:"noopener noreferrer"}});const ue={class:"image-container tw-my-4"},ge={class:"image-wrapper"},me=["src"],pe=(e,t)=>{const n=e.__vccOpts||e;for(const[a,o]of t)n[a]=o;return n},fe=pe(t.defineComponent({__name:"OrcaImage",props:{url:{}},emits:["open-modal"],setup(e,{emit:n}){const a=e,o=n,r=()=>{o("open-modal",a.url)};return(n,a)=>(t.openBlock(),t.createElementBlock("div",ue,[t.createElementVNode("div",ge,[t.createElementVNode("img",{src:e.url,alt:"Generated image",class:"orca-image",loading:"lazy",onClick:r},null,8,me),a[0]||(a[0]=t.createStaticVNode('<div class="image-overlay" data-v-e4f9d4c4><div class="zoom-icon" data-v-e4f9d4c4><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-e4f9d4c4><circle cx="11" cy="11" r="8" data-v-e4f9d4c4></circle><path d="m21 21-4.35-4.35" data-v-e4f9d4c4></path><line x1="11" y1="8" x2="11" y2="14" data-v-e4f9d4c4></line><line x1="8" y1="11" x2="14" y2="11" data-v-e4f9d4c4></line></svg></div></div>',1))])]))}}),[["__scopeId","data-v-e4f9d4c4"]]),ye={class:"orca-video-container"},ke={class:"video-wrapper"},ve=pe(t.defineComponent({__name:"OrcaVideo",props:{url:{}},setup(e){const n=t.ref({autoplay:!1,controls:!0,responsive:!0,fluid:!0,sources:[{type:"video/mp4",src:""}]});return(a,o)=>(t.openBlock(),t.createElementBlock("div",ye,[t.createElementVNode("div",ke,[t.createVNode(t.unref(l.VideoPlayer),{options:{...n.value,sources:[{type:"video/mp4",src:e.url}]},class:"video-player-custom"},null,8,["options"])])]))}}),[["__scopeId","data-v-7a20a30c"]]),he={class:"orca-youtube-container"},be={class:"youtube-wrapper"},we=["src"],Be=pe(t.defineComponent({__name:"OrcaYouTube",props:{url:{}},setup(e){const n=e,a=t.computed(()=>`https://www.youtube.com/embed/${g(n.url)}`);return(e,n)=>(t.openBlock(),t.createElementBlock("div",he,[t.createElementVNode("div",be,[t.createElementVNode("iframe",{width:"100%",height:"100%",src:a.value,frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"",class:"youtube-iframe"},null,8,we)])]))}}),[["__scopeId","data-v-9cd52c38"]]),Ve={class:"orca-audio-container"},xe={class:"audio-list"},Ce={class:"audio-content"},Le={class:"audio-label"},Ne=["type"],Ee=["src","type"],_e=pe(t.defineComponent({__name:"OrcaAudio",props:{audioItems:{}},setup:e=>(n,a)=>(t.openBlock(),t.createElementBlock("div",Ve,[t.createElementVNode("div",xe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.audioItems,(e,n)=>(t.openBlock(),t.createElementBlock("div",{key:n,class:"audio-item"},[a[1]||(a[1]=t.createElementVNode("div",{class:"audio-icon-wrapper"},[t.createElementVNode("svg",{class:"audio-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})])],-1)),t.createElementVNode("div",Ce,[t.createElementVNode("p",Le,t.toDisplayString(e.label),1),t.createElementVNode("audio",{controls:"",class:"audio-player",type:e.type},[t.createElementVNode("source",{src:e.url,type:e.type},null,8,Ee),a[0]||(a[0]=t.createTextVNode(" Your browser does not support the audio element. ",-1))],8,Ne)])]))),128))])]))}),[["__scopeId","data-v-ade9342b"]]),Ie={class:"orca-location-container"},Te={class:"map-wrapper"},Me={class:"location-info"},ze={class:"location-text"},Se=pe(t.defineComponent({__name:"OrcaLocation",props:{latitude:{},longitude:{},mapboxToken:{}},setup(e){const n=e,a=t.ref(null),o=t.ref(!1);return t.onUnmounted(()=>{a.value&&(a.value.remove(),a.value=null)}),(r,i)=>(t.openBlock(),t.createElementBlock("div",Ie,[t.createElementVNode("div",Te,[(t.openBlock(),t.createElementBlock("div",{ref:e=>(e=>{const r=e&&"tagName"in e?e:null;r&&e&&(o.value=!0,t.nextTick(()=>{try{c.accessToken=n.mapboxToken||"pk.eyJ1IjoicG91cnlhYnpwIiwiYSI6ImNsZ3Vuanl4YzF2NXkzZW1tcnR0MTlxNXEifQ.I3RdtfiL0ObnXbWVKxW1gQ",a.value&&(a.value.remove(),a.value=null);const e=`map-${n.latitude}-${n.longitude}`;r.id=e;const t=new c.Map({container:r,style:"mapbox://styles/mapbox/streets-v11",center:[n.longitude,n.latitude],zoom:12,attributionControl:!1});a.value=t,t.on("load",()=>{new c.Marker({color:"#0D5FD6"}).setLngLat([n.longitude,n.latitude]).addTo(t),t.addControl(new c.NavigationControl),setTimeout(()=>{t.resize()},100),o.value=!1}),t.on("error",e=>{o.value=!1}),t.on("render",()=>{t.resize()})}catch(e){o.value=!1}}))})(e),class:"map-container",key:`map-${e.latitude}-${e.longitude}`}))]),t.createElementVNode("div",Me,[i[0]||(i[0]=t.createElementVNode("div",{class:"location-icon"},[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),t.createElementVNode("circle",{cx:"12",cy:"10",r:"3"})])],-1)),t.createElementVNode("span",ze,t.toDisplayString(e.latitude.toFixed(6))+", "+t.toDisplayString(e.longitude.toFixed(6)),1)])]))}}),[["__scopeId","data-v-99a42606"]]),je={class:"orca-card-container"},Fe={key:0,class:"card-image-wrapper"},De={key:1,class:"card-subheader"},Oe={key:2,class:"card-text"},Ae=pe(t.defineComponent({__name:"OrcaCardList",props:{cards:{}},setup:e=>(a,o)=>(t.openBlock(),t.createElementBlock("div",je,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.cards,(e,a)=>(t.openBlock(),t.createBlock(t.unref(n.VCard),{key:a,class:"orca-card",elevation:"2"},{default:t.withCtx(()=>[e.photo?(t.openBlock(),t.createElementBlock("div",Fe,[t.createVNode(t.unref(n.VImg),{src:e.photo,height:"223",cover:"",class:"card-image"},null,8,["src"])])):t.createCommentVNode("",!0),t.createVNode(t.unref(n.VCardItem),{class:"card-content"},{default:t.withCtx(()=>[e.header?(t.openBlock(),t.createBlock(t.unref(n.VCardTitle),{key:0,class:"card-header"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.header),1)]),_:2},1024)):t.createCommentVNode("",!0),e.subheader?(t.openBlock(),t.createElementBlock("span",De,t.toDisplayString(e.subheader),1)):t.createCommentVNode("",!0),e.text?(t.openBlock(),t.createElementBlock("p",Oe,t.toDisplayString(e.text),1)):t.createCommentVNode("",!0)]),_:2},1024)]),_:2},1024))),128))]))}),[["__scopeId","data-v-d9e3b93c"]]),$e={class:"orca-buttons-container tw-my-4"},qe=pe(t.defineComponent({__name:"OrcaButtons",props:{buttons:{},disabled:{type:Boolean}},emits:["button-click"],setup(e,{emit:a}){const o=e,r=a,i=t.computed(()=>p(o.buttons));return(a,l)=>(t.openBlock(),t.createElementBlock("div",$e,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,(a,i)=>(t.openBlock(),t.createElementBlock("div",{key:i,class:"button-row"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a,(a,i)=>(t.openBlock(),t.createBlock(t.unref(n.VBtn),{disabled:e.disabled,key:i,class:t.normalizeClass(["orca-button","custom-outlined-button"]),style:t.normalizeStyle(t.unref(f)(a.color)),variant:"text",rounded:"xl",target:"link"===a.type?"_blank":void 0,href:"link"===a.type?a.url:void 0,onClick:e=>(e=>{"action"!==e.type||o.disabled||r("button-click",e)})(a)},t.createSlots({default:t.withCtx(()=>[t.createElementVNode("span",{style:t.normalizeStyle(t.unref(y)(a.color))},t.toDisplayString(a.label),5)]),_:2},["link"===a.type?{name:"append",fn:t.withCtx(()=>[t.createVNode(t.unref(n.VIcon),{icon:"tabler-external-link",style:t.normalizeStyle(t.unref(k)(a.color)),size:"small"},null,8,["style"])]),key:"0"}:void 0]),1032,["disabled","style","target","href","onClick"]))),128))]))),128))]))}}),[["__scopeId","data-v-480c6090"]]),He={key:0,class:"orca-trace-container"},Re={class:"trace-header"},Pe={key:0,class:"trace-content"},Ye={class:"trace-pre"},Ue=pe(t.defineComponent({__name:"OrcaTracing",props:{tracingData:{},visibility:{},isAdmin:{type:Boolean}},setup(e){const a=e,o=t.ref(!1),r=t.computed(()=>o.value),i=t.computed(()=>Array.isArray(a.tracingData)?a.tracingData.some(e=>"all"===e.visibility||"admin"===e.visibility&&a.isAdmin):"all"===a.tracingData.visibility||"admin"===a.tracingData.visibility&&a.isAdmin),l=t.computed(()=>Array.isArray(a.tracingData)?a.tracingData.map(e=>e.content||e.rawContent).join("\n\n"):a.tracingData.content||a.tracingData.rawContent||""),c=()=>{o.value=!o.value};return(e,a)=>i.value?(t.openBlock(),t.createElementBlock("div",He,[t.createVNode(t.unref(n.VCard),{class:"trace-card",elevation:"2"},{default:t.withCtx(()=>[t.createElementVNode("div",Re,[a[0]||(a[0]=t.createElementVNode("div",{class:"trace-header-content"},[t.createElementVNode("div",{class:"trace-icon"},[t.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})])]),t.createElementVNode("strong",{class:"trace-title"},"Trace Log")],-1)),t.createVNode(t.unref(n.VBtn),{size:"small",variant:"tonal",color:"primary",class:"trace-toggle-btn",onClick:c},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.value?"Hide":"Show"),1)]),_:1})]),t.createVNode(t.unref(n.VExpandTransition),null,{default:t.withCtx(()=>[r.value?(t.openBlock(),t.createElementBlock("div",Pe,[t.createElementVNode("pre",Ye,t.toDisplayString(l.value),1)])):t.createCommentVNode("",!0)]),_:1})]),_:1})])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-69e262d5"]]),Ge=["innerHTML"],We=t.defineComponent({__name:"ContentElement",props:{element:{},disabledButton:{type:Boolean},visibility:{},isAdmin:{type:Boolean},mapboxToken:{}},emits:["image-modal","button-click"],setup(e,{emit:n}){const a=n,{render:o}={render:e=>{const t=e.replace(/\[orca\..*?\]/g,"").trim();return t?se.render(t):""}},r=e=>{a("image-modal",e)},i=e=>{a("button-click",e)};return(n,a)=>(t.openBlock(),t.createElementBlock("div",null,["text"===e.element.type?(t.openBlock(),t.createElementBlock("div",{key:0,class:"text-content",innerHTML:t.unref(o)(e.element.content)},null,8,Ge)):"image"===e.element.type?(t.openBlock(),t.createBlock(fe,{key:1,url:e.element.content,onOpenModal:r},null,8,["url"])):"video"===e.element.type?(t.openBlock(),t.createBlock(ve,{key:2,url:e.element.content},null,8,["url"])):"youtube"===e.element.type?(t.openBlock(),t.createBlock(Be,{key:3,url:e.element.content},null,8,["url"])):"audio"===e.element.type?(t.openBlock(),t.createBlock(_e,{key:4,"audio-items":e.element.content},null,8,["audio-items"])):"location"===e.element.type?(t.openBlock(),t.createBlock(Se,{key:5,latitude:e.element.content.latitude,longitude:e.element.content.longitude,"mapbox-token":e.mapboxToken},null,8,["latitude","longitude","mapbox-token"])):"card"===e.element.type?(t.openBlock(),t.createBlock(Ae,{key:6,cards:e.element.content},null,8,["cards"])):"buttons"===e.element.type?(t.openBlock(),t.createBlock(qe,{key:7,buttons:e.element.content,disabled:e.disabledButton,onButtonClick:i},null,8,["buttons","disabled"])):"tracing"===e.element.type?(t.openBlock(),t.createBlock(Ue,{key:8,"tracing-data":e.element.content,visibility:e.visibility,"is-admin":e.isAdmin},null,8,["tracing-data","visibility","is-admin"])):t.createCommentVNode("",!0)]))}}),Xe={key:0,class:"general-loading-container"},Ke={class:"loading-content"},Qe={class:"loading-text"},Ze=pe(t.defineComponent({__name:"GeneralLoading",props:{isLoading:{type:Boolean},message:{}},setup:e=>(a,o)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>[e.isLoading?(t.openBlock(),t.createElementBlock("div",Xe,[t.createElementVNode("div",Ke,[t.createVNode(t.unref(n.VProgressCircular),{indeterminate:"",size:24,width:3,color:"primary",class:"loading-spinner"}),t.createElementVNode("span",Qe,t.toDisplayString(e.message),1)])])):t.createCommentVNode("",!0)]),_:1}))}),[["__scopeId","data-v-ba70521a"]]),Je={key:0,class:"image-loading-placeholder"},et={class:"loading-skeleton-image"},tt=pe(t.defineComponent({__name:"ImageLoading",props:{isLoading:{type:Boolean}},setup:e=>(a,o)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>[e.isLoading?(t.openBlock(),t.createElementBlock("div",Je,[t.createElementVNode("div",et,[t.createVNode(t.unref(n.VProgressCircular),{indeterminate:"",size:48,width:4,color:"primary",class:"loading-spinner-large"}),o[0]||(o[0]=t.createElementVNode("span",{class:"loading-skeleton-text"},"πŸ–ΌοΈ Loading image...",-1))])])):t.createCommentVNode("",!0)]),_:1}))}),[["__scopeId","data-v-39a596d3"]]),nt={key:0,class:"video-loading-placeholder"},at={class:"loading-skeleton-video"},ot=pe(t.defineComponent({__name:"VideoLoading",props:{isLoading:{type:Boolean}},setup:e=>(a,o)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>[e.isLoading?(t.openBlock(),t.createElementBlock("div",nt,[t.createElementVNode("div",at,[t.createVNode(t.unref(n.VProgressCircular),{indeterminate:"",size:48,width:4,color:"primary",class:"loading-spinner-large"}),o[0]||(o[0]=t.createElementVNode("div",{class:"loading-skeleton-text"},"πŸŽ₯ Loading video...",-1))])])):t.createCommentVNode("",!0)]),_:1}))}),[["__scopeId","data-v-0889a265"]]),rt={key:0,class:"card-loading-placeholder"},it=pe(t.defineComponent({__name:"CardLoading",props:{isLoading:{type:Boolean}},setup(e){const n=d.components.VSkeletonLoader;return(a,o)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>[e.isLoading?(t.openBlock(),t.createElementBlock("div",rt,[t.createVNode(t.unref(n),{class:"card-skeleton",width:"311",type:"image, article"}),o[0]||(o[0]=t.createElementVNode("span",{class:"loading-skeleton-text"},"πŸƒ Loading cards...",-1))])):t.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-2d326b15"]]),lt={key:0,class:"map-loading-placeholder"},ct=pe(t.defineComponent({__name:"MapLoading",props:{isLoading:{type:Boolean}},setup(e){const n=d.components.VSkeletonLoader;return(a,o)=>(t.openBlock(),t.createBlock(t.Transition,{name:"fade",mode:"out-in"},{default:t.withCtx(()=>[e.isLoading?(t.openBlock(),t.createElementBlock("div",lt,[t.createVNode(t.unref(n),{class:"map-skeleton",width:"500",height:"300",type:"image"}),o[0]||(o[0]=t.createElementVNode("span",{class:"loading-skeleton-text"},"πŸ—ΊοΈ Loading map...",-1))])):t.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-4bb3095a"]]),dt={class:"message-content"},st={key:0,class:"tw-flex tw-flex-wrap tw-gap-4 tw-mt-4 tw-mb-4"},ut=["src","onClick"],gt={class:"modal-content"},mt=pe(t.defineComponent({__name:"OrcaMarkdown",props:{description:{},role:{},images:{},fileAttachments:{default:()=>[]},isLastMessage:{type:Boolean,default:!1},storeIdentifier:{},visibility:{default:"all"}},emits:["send-message"],setup(e,{emit:a}){const o=e,r=a,i=t.ref(null),{modalVisible:l,currentImage:c,openModal:d,closeModal:g}=function(){const e=t.ref(!1),n=t.ref("");return{modalVisible:e,currentImage:n,openModal:t=>{n.value=t,e.value=!0},closeModal:()=>{e.value=!1,setTimeout(()=>{n.value=""},300)}}}(),m=q(t.computed(()=>o.description)),{isLoading:p,isImageLoading:f,isVideoLoading:y,isCardLoading:k,isLocationLoading:v,getLoadingMessage:h}=function(e){const n=t.ref(!1),a=t.ref(!1),o=t.ref(!1),r=t.ref(!1),i=t.ref(!1),l=t.computed(()=>t.unref(e));return t.watch(l,e=>{if(!e)return void(n.value=!1);const t=ae(e,P.start,P.end)||ae(e,Y.start,Y.end)||ae(e,U.start,U.end)||ae(e,G.start,G.end)||ae(e,W.start,W.end)||ae(e,X.start,X.end)||ae(e,K.start,K.end);n.value=t},{immediate:!0}),t.watch(l,e=>{a.value=oe(e,Q.start,Q.end,Q.actual)},{immediate:!0}),t.watch(l,e=>{const t=oe(e,Z.start,Z.end,Z.actual),n=oe(e,J.start,J.end,J.actual);o.value=t||n},{immediate:!0}),t.watch(l,e=>{r.value=oe(e,ee.start,ee.end,ee.actual)},{immediate:!0}),t.watch(l,e=>{i.value=oe(e,te.start,te.end,te.actual)},{immediate:!0}),{isLoading:n,isImageLoading:a,isVideoLoading:o,isCardLoading:r,isLocationLoading:i,getLoadingMessage:e=>ne[e]||ne["general-loading"]}}(t.computed(()=>o.description)),b=t.computed(()=>o.fileAttachments.filter(e=>e&&s(e))),w=t.computed(()=>o.fileAttachments.filter(e=>e&&!s(e))),B=t.computed(()=>"assistant"!==o.role||!o.isLastMessage||V()),V=()=>"admin"===o.visibility,x=t.computed(()=>{const e=o.description||"";return e.includes("[orca.loading.thinking.start]")&&!e.includes("[orca.loading.thinking.end]")?"thinking-loading":e.includes("[orca.loading.searching.start]")&&!e.includes("[orca.loading.searching.end]")?"searching-loading":e.includes("[orca.loading.coding.start]")&&!e.includes("[orca.loading.coding.end]")?"coding-loading":e.includes("[orca.loading.analyzing.start]")&&!e.includes("[orca.loading.analyzing.end]")?"analyzing-loading":e.includes("[orca.loading.generating.start]")&&!e.includes("[orca.loading.generating.end]")?"generating-loading":e.includes("[orca.loading.custom.start]")&&!e.includes("[orca.loading.custom.end]")?"custom-loading":e.includes("[orca.loading.start]")&&!e.includes("[orca.loading.end]")?"general-loading":null}),C=t.computed(()=>{if(p.value){const e=x.value;return e?h(e):"⏳ Loading..."}return"⏳ Loading..."}),{addCodeButtons:L}=function(e,n){const a=()=>{t.nextTick(()=>{e.value&&n()&&e.value.querySelectorAll("pre").forEach(e=>{le(e)})})};return t.onMounted(()=>{a()}),{addCodeButtons:a}}(i,()=>"user"!==o.role);t.watch(m,()=>{L()});const N=async e=>{if("action"===e.type&&!B.value)try{r("send-message",{message:e.label,buttonData:e,type:"button-action"})}catch(t){}},E=e=>{d(e)};return(e,a)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",dt,[t.createElementVNode("div",{ref_key:"messageContentRef",ref:i,class:"content-wrapper"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(m),(e,n)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:n},[t.unref(de)(e.type)?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(We,{key:0,element:e,"disabled-button":B.value,visibility:o.visibility,"is-admin":V(),onImageModal:E,onButtonClick:N},null,8,["element","disabled-button","visibility","is-admin"]))],64))),128)),t.createVNode(Ze,{isLoading:t.unref(p),message:C.value},null,8,["isLoading","message"]),t.createVNode(tt,{isLoading:t.unref(f)},null,8,["isLoading"]),t.createVNode(ot,{isLoading:t.unref(y)},null,8,["isLoading"]),t.createVNode(it,{isLoading:t.unref(k)},null,8,["isLoading"]),t.createVNode(ct,{isLoading:t.unref(v)},null,8,["isLoading"]),o.fileAttachments&&o.fileAttachments.length>0&&"user"===o.role?(t.openBlock(),t.createElementBlock("div",st,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,e=>(t.openBlock(),t.createElementBlock("img",{key:e,src:e,class:"tw-w-[300px] lg:tw-w-[303px] tw-h-[300px] lg:tw-h-[303px] tw-object-cover tw-rounded-lg tw-cursor-pointer",onClick:n=>t.unref(d)(e)},null,8,ut))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.value,e=>(t.openBlock(),t.createBlock(t.unref(n.VBtn),{key:e,class:"text-center text-sm",variant:"tonal",color:"grey-500",href:e,target:"_blank",rel:"noopener noreferrer"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(u)(e)),1)]),_:2},1032,["href"]))),128))])):t.createCommentVNode("",!0)],512)]),t.createVNode(t.unref(n.VDialog),{modelValue:t.unref(l),"onUpdate:modelValue":a[1]||(a[1]=e=>t.isRef(l)?l.value=e:null),fullscreen:"",class:"image-modal",scrim:"rgba(0, 0, 0, 0.85)",onClick:t.unref(g),transition:"fade-transition"},{default:t.withCtx(()=>[t.createElementVNode("div",{class:"modal-close-btn",onClick:a[0]||(a[0]=t.withModifiers((...e)=>t.unref(g)&&t.unref(g)(...e),["stop"]))},[...a[2]||(a[2]=[t.createElementVNode("button",{class:"close-button","aria-label":"Close image"},[t.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[t.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})])],-1)])]),t.createElementVNode("div",gt,[t.createVNode(t.unref(n.VImg),{src:t.unref(c),class:"modal-image",contain:""},null,8,["src"])])]),_:1},8,["modelValue","onClick"])],64))}}),[["__scopeId","data-v-619a1855"]]);e.OrcaMarkdown=mt,e.cleanOrcaMarkers=function(e){return e.replace(/\[orca\..*?\]/g,"").trim()},e.generateMapId=function(e){return`map-container-${e}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`},e.getAppendIconStyle=k,e.getFileNameFromUrl=u,e.getGroupedButtons=p,e.getOutlinedButtonStyle=f,e.getOutlinedButtonTextStyle=y,e.getVuetifyColor=m,e.getYouTubeId=g,e.hasLoadingMarkers=function(e){return/\[orca\.(?:loading|image\.loading|loading\.image)\.start\]/.test(e)},e.isImageFile=s,e.packageInfo={name:"@orca-pt/orca-components",version:"1.0.2",description:"Orca native components for rendering special content markers",author:"Orca Team"},e.version="1.0.2",Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=orca-components.umd.js.map