@logosphere-ui/core 0.0.0-alpha.16 → 0.0.0-alpha.19
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/dist/{chatbot-CIk-82Bz.cjs → chatbot-B_3w7h4T.cjs} +22 -22
- package/dist/{chatbot-Dl-WLXP3.js → chatbot-uGYcx6Nn.js} +137 -116
- package/dist/chatbot.cjs +1 -1
- package/dist/chatbot.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.js +77 -77
- package/dist/{modal-CnwRIdd8.js → modal-B8aQyCBg.js} +3 -4
- package/dist/{modal-DQ8VFL-P.cjs → modal-DU1sszVn.cjs} +7 -7
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/organisms/Chatbot/chatbot.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";const n=require("lit"),i=require("lit/decorators.js"),b=require("lit/directives/unsafe-html.js");require("./combobox-C6zoQopK.cjs");require("./button-CDRccsk9.cjs");require("./input-JpAWN-M1.cjs");require("./ui-icon-DWh1MhBa.cjs");const m=":host{display:block;z-index:9999}.chatbot{font-family:var(--font-family-base)}.chatbot__overlay{position:fixed;inset:0;background-color:#0003;z-index:var(--z-index-modal-backdrop)}.chatbot__launcher{position:fixed;z-index:var(--z-index-modal);display:flex;align-items:center;gap:var(--spacing-4);padding-left:var(--spacing-4);padding-right:var(--spacing-4);height:66px;color:#fff;border-radius:var(--radius-xl);cursor:pointer;box-shadow:var(--shadow-base);background-color:var(--color-body-bg);overflow:hidden;transition:box-shadow var(--transition-speed-fast) var(--transition-timing)}.chatbot__launcher:hover{box-shadow:var(--shadow-md)}.chatbot__launcher--draggable{cursor:move}.chatbot__launcher--hidden{visibility:hidden;width:72px;height:66px;justify-content:center;padding:0}.chatbot__launcher-icon{width:40px;height:34px;flex-shrink:0}.chatbot__launcher-text{display:flex;flex-direction:column}.chatbot__launcher-title{font-weight:var(--font-weight-semibold);font-size:var(--font-size-xl);margin:0;line-height:24px;white-space:nowrap;color:var(--color-body-text)}.chatbot__launcher-subtitle{font-weight:var(--font-weight-semibold);font-size:var(--font-size-sm);margin:0;line-height:20px;white-space:nowrap;color:var(--color-tertiary)}.chatbot__window{position:fixed;z-index:var(--z-index-modal);display:flex;flex-direction:column;box-shadow:var(--shadow-xl);border-radius:var(--radius-md);overflow:hidden;background-color:var(--color-body-bg)}.chatbot__window--hidden{display:none}.chatbot__window--fullscreen{inset:80px 50px;width:auto;height:auto}.chatbot__resize-top{position:absolute;top:0;left:0;right:0;height:8px;cursor:ns-resize;z-index:50;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__resize-top:hover{background-color:#0000000d}.chatbot__resize-side{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;z-index:50;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__resize-side:hover{background-color:#0000000d}.chatbot__resize-side--left{left:0}.chatbot__resize-side--right{right:0}.chatbot__resize-corner{position:absolute;top:0;width:16px;height:16px;z-index:50;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__resize-corner:hover{background-color:#0000001a}.chatbot__resize-corner--nwse{left:0;cursor:nwse-resize}.chatbot__resize-corner--nesw{right:0;cursor:nesw-resize}.chatbot__header{height:74px;display:flex;align-items:center;justify-content:space-between;padding-left:var(--spacing-5);padding-right:var(--spacing-4);gap:var(--spacing-4);flex-shrink:0;background-color:var(--color-body-bg);border-bottom:1px solid var(--color-border)}.chatbot__header-info{display:flex;align-items:center;gap:var(--spacing-4)}.chatbot__header-logo{width:50px;height:41px}.chatbot__header-title{font-weight:var(--font-weight-semibold);font-size:var(--font-size-xl);margin:0;line-height:24px;color:var(--color-body-text)}.chatbot__header-subtitle{font-weight:var(--font-weight-semibold);font-size:var(--font-size-sm);margin:0;line-height:20px;color:var(--color-tertiary)}.chatbot__header-actions{display:flex;align-items:center;gap:var(--spacing-2)}.chatbot__body{flex:1;display:flex;flex-direction:column;background-color:var(--color-body-bg);position:relative;overflow:hidden}.chatbot__product{padding:var(--spacing-3);padding-bottom:0;flex-shrink:0;margin:0 var(--spacing-3)}.chatbot__messages{flex:1;display:flex;flex-direction:column;gap:var(--spacing-3);margin-top:var(--spacing-4);padding:var(--spacing-4);overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.chatbot__messages::-webkit-scrollbar{display:none}.chatbot__message{display:flex}.chatbot__message--user{justify-content:flex-end}.chatbot__message--assistant,.chatbot__message--system{justify-content:flex-start}.chatbot__bubble{position:relative;color:var(--color-body-text);max-width:85%;border-radius:var(--radius-md);padding:var(--spacing-4);font-size:var(--font-size-sm);line-height:20px;font-weight:var(--font-weight-medium)}.chatbot__bubble--user{background-color:var(--color-primary);color:#fff;border-bottom-right-radius:0;border-top-right-radius:var(--radius-xl);border-top-left-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.chatbot__bubble--user a{color:#ffffffe6}.chatbot__bubble--assistant,.chatbot__bubble--system{background-color:var(--color-tertiary-bg);border-bottom-left-radius:0;border-top-right-radius:var(--radius-xl);border-top-left-radius:var(--radius-xl);border-bottom-right-radius:var(--radius-xl)}.chatbot__message-content p{margin:0}.chatbot__message-content ol{list-style-type:decimal;margin:0;padding-left:var(--spacing-5)}.chatbot__message-content ul{list-style-type:disc;margin:0;padding-left:var(--spacing-5)}.chatbot__message-content li{padding-left:var(--spacing-1)}.chatbot__message-content a{color:var(--color-primary);text-decoration:underline;transition:color var(--transition-speed-fast) var(--transition-timing)}.chatbot__message-content a:hover{color:var(--color-primary-hover)}.chatbot__feedback{display:flex;align-items:center;gap:var(--spacing-2);padding-top:var(--spacing-2)}.chatbot__typing-wrapper{display:flex;justify-content:flex-start}.chatbot__typing{background-color:var(--color-tertiary-bg);padding:var(--spacing-3);border-radius:var(--radius-xl);border-bottom-left-radius:0;display:inline-flex;align-items:center;gap:2px}.chatbot__typing-dot{display:inline-block;width:6px;height:6px;background-color:var(--color-gray-300);border-radius:var(--radius-full);animation:chatbot-typing 1.4s infinite ease-in-out both;margin:0 2px}.chatbot__typing-dot:nth-child(1){animation-delay:-.32s}.chatbot__typing-dot:nth-child(2){animation-delay:-.16s}@keyframes chatbot-typing{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}.chatbot__input-area{padding:var(--spacing-4);padding-top:var(--spacing-2);padding-bottom:var(--spacing-1);background-color:var(--color-body-bg)}.chatbot__input-wrapper{position:relative;display:flex;align-items:center;gap:var(--spacing-2);background-color:var(--color-tertiary-bg);border-radius:var(--radius-md);padding:var(--spacing-2);border:1px solid transparent;transition:background-color var(--transition-speed-fast) var(--transition-timing),border-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__input-wrapper:focus-within{background-color:var(--color-body-bg);border-color:var(--color-border)}.chatbot__input{flex:1;background:transparent;border:none;outline:none;font-family:var(--font-family-base);font-size:var(--font-size-sm);color:var(--color-body-text)}.chatbot__input::placeholder{color:var(--color-tertiary)}.chatbot__input:disabled{opacity:.5;cursor:not-allowed}.chatbot__footer{display:flex;align-items:center;justify-content:center;padding-bottom:var(--spacing-2)}.chatbot__footer-text{margin:0;padding:0;color:var(--color-secondary);font-size:var(--font-size-xs);font-family:var(--font-family-base)}";var f=Object.defineProperty,v=Object.getOwnPropertyDescriptor,s=(l,t,e,r)=>{for(var o=r>1?void 0:r?v(t,e):t,a=l.length-1,h;a>=0;a--)(h=l[a])&&(o=(r?h(t,e,o):h(o))||o);return r&&o&&f(t,e,o),o};exports.LogosphereChatBot=class extends n.LitElement{constructor(){super(...arguments),this.returnUri="",this.questionPrompt="",this.minimizedIconOnly=!1,this.draggable=!1,this.resizable=!1,this.products=[],this.openInitially=!1,this.showFeedbackButtons=!1,this.open=!1,this.fullscreen=!1,this.messages=[],this.isLoading=!1,this.inputText="",this.selectedProductId="",this.windowWidth=440,this.windowHeight=Math.min(700,window.innerHeight-40),this.position={right:20,bottom:20},this.isDragging=!1,this.screenWidth=window.innerWidth,this.dragStartPos={x:0,y:0},this.initialPosition={right:0,bottom:0},this.isResizing=!1,this.resizeDirection="horizontal",this.resizeStartWidth=0,this.resizeStartHeight=0,this.onWindowResize=()=>{this.screenWidth=window.innerWidth;const t=window.innerHeight-40;this.windowHeight>t&&(this.windowHeight=t)},this.onToggle=()=>{this.open=!this.open,this.scrollToBottom()},this.onClose=()=>{this.open=!1,this.fullscreen=!1},this.onToggleFullscreen=()=>{this.fullscreen=!this.fullscreen},this.onMouseMove=t=>{if(this.isDragging){const e=this.dragStartPos.x-t.clientX,r=this.dragStartPos.y-t.clientY,a=this.shadowRoot?.querySelector(".chatbot__launcher")?.getBoundingClientRect(),h=a?.width||72,c=a?.height||66;this.position={right:Math.max(0,Math.min(window.innerWidth-h,this.initialPosition.right+e)),bottom:Math.max(0,Math.min(window.innerHeight-c,this.initialPosition.bottom+r))}}else if(this.isResizing){const e=this.dragStartPos.x-t.clientX,r=this.dragStartPos.y-t.clientY;if(this.resizeDirection==="horizontal"||this.resizeDirection==="both"){const o=this.position.right<this.screenWidth/2;this.windowWidth=Math.max(300,this.resizeStartWidth+(o?e:-e))}(this.resizeDirection==="vertical"||this.resizeDirection==="both")&&(this.windowHeight=Math.max(400,this.resizeStartHeight+r))}},this.onMouseUp=t=>{this.isDragging?(this.isDragging=!1,window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),Math.hypot(t.clientX-this.dragStartPos.x,t.clientY-this.dragStartPos.y)<5&&this.onToggle()):this.isResizing&&(this.isResizing=!1,window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp))},this.handleKeyDown=t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.sendMessage())},this.onInput=t=>{const e=t.target;this.inputText=e?e.value:t.detail},this.onCopyMessage=t=>{navigator.clipboard.writeText(t)}}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.onWindowResize)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp)}async firstUpdated(){this.products.length===1&&(this.selectedProductId=this.products[0].id),this.open=this.openInitially,this.open&&await this.initConversation()}updated(t){t.has("products")&&this.handleProductUpdate(),t.has("messages")&&this.scrollToBottom(),t.has("open")&&this.open&&!this.conversationId&&this.initConversation()}handleProductUpdate(){if(!this.products.length)return;const t=this.products.some(e=>e.id===this.selectedProductId);this.products.length===1&&(this.selectedProductId=this.products[0].id),t||(this.messages=[],this.conversationId=void 0,this.open&&this.initConversation()),requestAnimationFrame(()=>this.updateComboboxItems())}updateComboboxItems(){const t=this.productEl;if(!t||this.products?.length<=1)return;const e=this.products.map(o=>({value:o.id,label:o.name}));t.items=e;const r=t.selectedItems?.()||[];if(r.length>0){const o=r[0]?.value;!this.products.some(h=>h.id===o)&&t.setSelected&&t.setSelected([])}}async onProductChange(t){const e=t.detail?.selected?.[0]?.value;e&&e!==this.selectedProductId&&(this.selectedProductId=e)}onMouseDown(t){this.draggable&&(t.preventDefault(),this.isDragging=!0,this.dragStartPos={x:t.clientX,y:t.clientY},this.initialPosition={...this.position},window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp))}startResize(t,e){this.resizable&&(t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.resizeDirection=e,this.dragStartPos={x:t.clientX,y:t.clientY},this.resizeStartWidth=this.windowWidth,this.resizeStartHeight=this.windowHeight,window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp))}async ensureToken(t=!1){const e="logosphere_chatbot_token";if(t&&(this.assertionToken=void 0,localStorage.removeItem(e)),!t){const a=localStorage.getItem(e);if(a){this.assertionToken=a;return}}const o=await(await fetch(`${this.returnUri}/api/chat/start`)).json();if(!o.Success||!o.Data?.Token)throw new Error("Token alınamadı");this.assertionToken=o.Data.Token,localStorage.setItem(e,this.assertionToken)}async postChat(t){await this.ensureToken();const e=`${this.returnUri}/api/chat/completions`,r=()=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json",client_assertion:this.assertionToken,client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"},body:JSON.stringify(t)});let o=await r();if(o.status===401&&(await this.ensureToken(!0),o=await r()),!o.ok)throw new Error(`HTTP ${o.status}`);return o.json()}async initConversation(){if(!this.isLoading){this.isLoading=!0;try{await this.ensureToken();const t=await this.postChat({ChatCompletionType:"NewConversation",Context:this.selectedProductId,QuestionPrompt:this.questionPrompt});this.conversationId=t.Data.ConversationId;const e=t.Data.Choices?.[0]?.Message?.Content;e&&this.addMessage(e,"assistant")}catch{this.addMessage("Bir hata oluştu, lütfen tekrar deneyiniz.","system")}finally{this.isLoading=!1}}}async sendMessage(){const t=this.inputText.trim();if(!(!t||!this.conversationId||this.isLoading)){if(!this.selectedProductId){this.addMessage("Lütfen önce bir ürün seçiniz.","system");return}this.addMessage(t,"user"),this.inputText="",this.isLoading=!0;try{const r=(await this.postChat({ChatCompletionType:"ConversationUpdate",Content:t,Context:this.selectedProductId,ConversationId:this.conversationId,QuestionPrompt:this.questionPrompt})).Data?.Choices?.[0]?.Message?.Content;this.addMessage(r||"Cevap alınamadı.","assistant")}catch{this.addMessage("Bağlantı hatası.","system")}finally{this.isLoading=!1}}}addMessage(t,e){this.messages=[...this.messages,{content:t,role:e,timestamp:Date.now()}]}scrollToBottom(){setTimeout(()=>{this.chatContainer&&(this.chatContainer.scrollTop=this.chatContainer.scrollHeight)},0)}formatContent(t){if(!t)return"";const r=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").split(`
|
|
2
|
-
`);let o="",
|
|
1
|
+
"use strict";const n=require("lit"),s=require("lit/decorators.js"),y=require("lit/directives/unsafe-html.js");require("./combobox-C6zoQopK.cjs");require("./button-CDRccsk9.cjs");require("./input-JpAWN-M1.cjs");require("./ui-icon-DWh1MhBa.cjs");const w=":host{display:block;z-index:9999}.chatbot{font-family:var(--font-family-base)}.chatbot__overlay{position:fixed;inset:0;background-color:#0003;z-index:var(--z-index-modal-backdrop)}.chatbot__launcher{position:fixed;z-index:var(--z-index-modal);display:flex;align-items:center;gap:var(--spacing-4);padding-left:var(--spacing-4);padding-right:var(--spacing-4);height:66px;color:#fff;border-radius:var(--radius-xl);cursor:pointer;box-shadow:var(--shadow-base);background-color:var(--color-body-bg);overflow:hidden;transition:box-shadow var(--transition-speed-fast) var(--transition-timing)}.chatbot__launcher:hover{box-shadow:var(--shadow-md)}.chatbot__launcher--draggable{cursor:move}.chatbot__launcher--hidden{visibility:hidden;width:72px;height:66px;justify-content:center;padding:0}.chatbot__launcher-icon{width:40px;height:34px;flex-shrink:0}.chatbot__launcher-text{display:flex;flex-direction:column}.chatbot__launcher-title{font-weight:var(--font-weight-semibold);font-size:var(--font-size-xl);margin:0;line-height:24px;white-space:nowrap;color:var(--color-body-text)}.chatbot__launcher-subtitle{font-weight:var(--font-weight-semibold);font-size:var(--font-size-sm);margin:0;line-height:20px;white-space:nowrap;color:var(--color-tertiary)}.chatbot__window{position:fixed;z-index:var(--z-index-modal);display:flex;flex-direction:column;box-shadow:var(--shadow-xl);border-radius:var(--radius-md);overflow:hidden;background-color:var(--color-body-bg)}.chatbot__window--hidden{display:none}.chatbot__window--fullscreen{inset:80px 50px;width:auto;height:auto}.chatbot__resize-top{position:absolute;top:0;left:0;right:0;height:8px;cursor:ns-resize;z-index:50;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__resize-top:hover{background-color:#0000000d}.chatbot__resize-side{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;z-index:50;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__resize-side:hover{background-color:#0000000d}.chatbot__resize-side--left{left:0}.chatbot__resize-side--right{right:0}.chatbot__resize-corner{position:absolute;top:0;width:16px;height:16px;z-index:50;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__resize-corner:hover{background-color:#0000001a}.chatbot__resize-corner--nwse{left:0;cursor:nwse-resize}.chatbot__resize-corner--nesw{right:0;cursor:nesw-resize}.chatbot__header{height:74px;display:flex;align-items:center;justify-content:space-between;padding-left:var(--spacing-5);padding-right:var(--spacing-4);gap:var(--spacing-4);flex-shrink:0;background-color:var(--color-body-bg);border-bottom:1px solid var(--color-border)}.chatbot__header-info{display:flex;align-items:center;gap:var(--spacing-4)}.chatbot__header-logo{width:50px;height:41px}.chatbot__header-title{font-weight:var(--font-weight-semibold);font-size:var(--font-size-xl);margin:0;line-height:24px;color:var(--color-body-text)}.chatbot__header-subtitle{font-weight:var(--font-weight-semibold);font-size:var(--font-size-sm);margin:0;line-height:20px;color:var(--color-tertiary)}.chatbot__header-actions{display:flex;align-items:center;gap:var(--spacing-2)}.chatbot__body{flex:1;display:flex;flex-direction:column;background-color:var(--color-body-bg);position:relative;overflow:hidden}.chatbot__product{padding:var(--spacing-3);padding-bottom:0;flex-shrink:0;margin:0 var(--spacing-3)}.chatbot__messages{flex:1;display:flex;flex-direction:column;gap:var(--spacing-3);margin-top:var(--spacing-4);padding:var(--spacing-4);overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.chatbot__messages::-webkit-scrollbar{display:none}.chatbot__message{display:flex}.chatbot__message--user{justify-content:flex-end}.chatbot__message--assistant,.chatbot__message--system{justify-content:flex-start}.chatbot__bubble{position:relative;color:var(--color-body-text);max-width:85%;border-radius:var(--radius-md);padding:var(--spacing-4);font-size:var(--font-size-sm);line-height:20px;font-weight:var(--font-weight-medium)}.chatbot__bubble--user{background-color:var(--color-primary);color:#fff;border-bottom-right-radius:0;border-top-right-radius:var(--radius-xl);border-top-left-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.chatbot__bubble--user a{color:#ffffffe6}.chatbot__bubble--assistant,.chatbot__bubble--system{background-color:var(--color-tertiary-bg);border-bottom-left-radius:0;border-top-right-radius:var(--radius-xl);border-top-left-radius:var(--radius-xl);border-bottom-right-radius:var(--radius-xl)}.chatbot__message-content p{margin:0}.chatbot__message-content ol{list-style-type:decimal;margin:0;padding-left:var(--spacing-5)}.chatbot__message-content ul{list-style-type:disc;margin:0;padding-left:var(--spacing-5)}.chatbot__message-content li>ol,.chatbot__message-content li>ul{margin-top:var(--spacing-1);margin-bottom:var(--spacing-1)}.chatbot__message-content ol ol{list-style-type:lower-alpha}.chatbot__message-content ol ol ol{list-style-type:lower-roman}.chatbot__message-content ul ul{list-style-type:circle}.chatbot__message-content ul ul ul{list-style-type:square}.chatbot__message-content li{padding-left:var(--spacing-1)}.chatbot__message-content a{color:var(--color-primary);text-decoration:underline;transition:color var(--transition-speed-fast) var(--transition-timing)}.chatbot__message-content a:hover{color:var(--color-primary-hover)}.chatbot__feedback{display:flex;align-items:center;gap:var(--spacing-2);padding-top:var(--spacing-2)}.chatbot__typing-wrapper{display:flex;justify-content:flex-start}.chatbot__typing{background-color:var(--color-tertiary-bg);padding:var(--spacing-3);border-radius:var(--radius-xl);border-bottom-left-radius:0;display:inline-flex;align-items:center;gap:2px}.chatbot__typing-dot{display:inline-block;width:6px;height:6px;background-color:var(--color-gray-300);border-radius:var(--radius-full);animation:chatbot-typing 1.4s infinite ease-in-out both;margin:0 2px}.chatbot__typing-dot:nth-child(1){animation-delay:-.32s}.chatbot__typing-dot:nth-child(2){animation-delay:-.16s}@keyframes chatbot-typing{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}.chatbot__input-area{padding:var(--spacing-4);padding-top:var(--spacing-2);padding-bottom:var(--spacing-1);background-color:var(--color-body-bg)}.chatbot__input-wrapper{position:relative;display:flex;align-items:center;gap:var(--spacing-2);background-color:var(--color-tertiary-bg);border-radius:var(--radius-md);padding:var(--spacing-2);border:1px solid transparent;transition:background-color var(--transition-speed-fast) var(--transition-timing),border-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__input-wrapper:focus-within{background-color:var(--color-body-bg);border-color:var(--color-border)}.chatbot__input{flex:1;background:transparent;border:none;outline:none;font-family:var(--font-family-base);font-size:var(--font-size-sm);color:var(--color-body-text)}.chatbot__input::placeholder{color:var(--color-tertiary)}.chatbot__input:disabled{opacity:.5;cursor:not-allowed}.chatbot__footer{display:flex;align-items:center;justify-content:center;padding-bottom:var(--spacing-2)}.chatbot__footer-text{margin:0;padding:0;color:var(--color-secondary);font-size:var(--font-size-xs);font-family:var(--font-family-base)}.chatbot__product-selector{padding:var(--spacing-3) var(--spacing-3) 0;flex-shrink:0}.chatbot__product-input{display:block;width:100%;height:24px;padding-left:var(--spacing-1);border:1px solid var(--color-border);border-radius:var(--radius-md);background:transparent;color:var(--color-body-color);font-size:var(--font-size-md);outline:none}";var x=Object.defineProperty,C=Object.getOwnPropertyDescriptor,a=(l,t,e,r)=>{for(var o=r>1?void 0:r?C(t,e):t,i=l.length-1,h;i>=0;i--)(h=l[i])&&(o=(r?h(t,e,o):h(o))||o);return r&&o&&x(t,e,o),o};exports.LogosphereChatBot=class extends n.LitElement{constructor(){super(...arguments),this.returnUri="",this.questionPrompt="",this.minimizedIconOnly=!1,this.draggable=!1,this.resizable=!1,this.products=[],this.openInitially=!1,this.showFeedbackButtons=!1,this.open=!1,this.fullscreen=!1,this.messages=[],this.isLoading=!1,this.inputText="",this.selectedProductId="",this.windowWidth=440,this.windowHeight=Math.min(700,window.innerHeight-40),this.position={right:20,bottom:20},this.isDragging=!1,this.screenWidth=window.innerWidth,this.dragStartPos={x:0,y:0},this.initialPosition={right:0,bottom:0},this.isResizing=!1,this.resizeDirection="horizontal",this.resizeStartWidth=0,this.resizeStartHeight=0,this.onWindowResize=()=>{this.screenWidth=window.innerWidth;const t=window.innerHeight-40;this.windowHeight>t&&(this.windowHeight=t)},this.onToggle=()=>{this.open=!this.open,this.scrollToBottom()},this.onClose=()=>{this.open=!1,this.fullscreen=!1},this.onToggleFullscreen=()=>{this.fullscreen=!this.fullscreen},this.onMouseMove=t=>{if(this.isDragging){const e=this.dragStartPos.x-t.clientX,r=this.dragStartPos.y-t.clientY,i=this.shadowRoot?.querySelector(".chatbot__launcher")?.getBoundingClientRect(),h=i?.width||72,u=i?.height||66;this.position={right:Math.max(0,Math.min(window.innerWidth-h,this.initialPosition.right+e)),bottom:Math.max(0,Math.min(window.innerHeight-u,this.initialPosition.bottom+r))}}else if(this.isResizing){const e=this.dragStartPos.x-t.clientX,r=this.dragStartPos.y-t.clientY;if(this.resizeDirection==="horizontal"||this.resizeDirection==="both"){const o=this.position.right<this.screenWidth/2;this.windowWidth=Math.max(300,this.resizeStartWidth+(o?e:-e))}(this.resizeDirection==="vertical"||this.resizeDirection==="both")&&(this.windowHeight=Math.max(400,this.resizeStartHeight+r))}},this.onMouseUp=t=>{this.isDragging?(this.isDragging=!1,window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),Math.hypot(t.clientX-this.dragStartPos.x,t.clientY-this.dragStartPos.y)<5&&this.onToggle()):this.isResizing&&(this.isResizing=!1,window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp))},this.handleKeyDown=t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.sendMessage())},this.onInput=t=>{const e=t.target;this.inputText=e?e.value:t.detail},this.onCopyMessage=t=>{navigator.clipboard.writeText(t)}}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.onWindowResize)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp)}async firstUpdated(){this.selectedProductId=this._resolveInitialProduct(),this.open=this.openInitially,this.open&&await this.initConversation()}updated(t){t.has("products")&&this.handleProductUpdate(),t.has("messages")&&this.scrollToBottom(),t.has("open")&&this.open&&!this.conversationId&&this.initConversation()}_resolveInitialProduct(){if(!this.products.length)return"";const t=this.products.find(e=>e.selected);return t?t.id:this.products.length===1?this.products[0].id:""}handleProductUpdate(){if(!this.products.length)return;const t=this._resolveInitialProduct();this.products.some(r=>r.id===this.selectedProductId)||(this.selectedProductId=t,this.messages=[],this.conversationId=void 0,this.open&&this.initConversation()),requestAnimationFrame(()=>this.updateComboboxItems())}updateComboboxItems(){const t=this.productEl;if(!t||this.products?.length<=1)return;const e=this.products.map(o=>({value:o.id,label:o.name}));t.items=e;const r=t.selectedItems?.()||[];if(r.length===0&&this.selectedProductId){const o=e.find(i=>i.value===this.selectedProductId);o&&t.setSelected&&t.setSelected([o])}else if(r.length>0){const o=r[0]?.value;!this.products.some(h=>h.id===o)&&t.setSelected&&t.setSelected([])}}async onProductChange(t){const e=t.detail?.selected?.[0]?.value;e&&e!==this.selectedProductId&&(this.selectedProductId=e)}onMouseDown(t){this.draggable&&(t.preventDefault(),this.isDragging=!0,this.dragStartPos={x:t.clientX,y:t.clientY},this.initialPosition={...this.position},window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp))}startResize(t,e){this.resizable&&(t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.resizeDirection=e,this.dragStartPos={x:t.clientX,y:t.clientY},this.resizeStartWidth=this.windowWidth,this.resizeStartHeight=this.windowHeight,window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp))}async ensureToken(t=!1){const e="logosphere_chatbot_token";if(t&&(this.assertionToken=void 0,localStorage.removeItem(e)),!t){const i=localStorage.getItem(e);if(i){this.assertionToken=i;return}}const o=await(await fetch(`${this.returnUri}/api/chat/start`)).json();if(!o.Success||!o.Data?.Token)throw new Error("Token alınamadı");this.assertionToken=o.Data.Token,localStorage.setItem(e,this.assertionToken)}async postChat(t){await this.ensureToken();const e=`${this.returnUri}/api/chat/completions`,r=()=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json",client_assertion:this.assertionToken,client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"},body:JSON.stringify(t)});let o=await r();if(o.status===401&&(await this.ensureToken(!0),o=await r()),!o.ok)throw new Error(`HTTP ${o.status}`);return o.json()}async initConversation(){if(!this.isLoading){this.isLoading=!0;try{await this.ensureToken();const t=await this.postChat({ChatCompletionType:"NewConversation",Context:this.selectedProductId,QuestionPrompt:this.questionPrompt});this.conversationId=t.Data.ConversationId;const e=t.Data.Choices?.[0]?.Message?.Content;e&&this.addMessage(e,"assistant")}catch{this.addMessage("Bir hata oluştu, lütfen tekrar deneyiniz.","system")}finally{this.isLoading=!1}}}async sendMessage(){const t=this.inputText.trim();if(!(!t||!this.conversationId||this.isLoading)){if(!this.selectedProductId){this.addMessage("Lütfen önce bir ürün seçiniz.","system");return}this.addMessage(t,"user"),this.inputText="",this.isLoading=!0;try{const r=(await this.postChat({ChatCompletionType:"ConversationUpdate",Content:t,Context:this.selectedProductId,ConversationId:this.conversationId,QuestionPrompt:this.questionPrompt})).Data?.Choices?.[0]?.Message?.Content;this.addMessage(r||"Cevap alınamadı.","assistant")}catch{this.addMessage("Bağlantı hatası.","system")}finally{this.isLoading=!1}}}addMessage(t,e){this.messages=[...this.messages,{content:t,role:e,timestamp:Date.now()}]}scrollToBottom(){setTimeout(()=>{this.chatContainer&&(this.chatContainer.scrollTop=this.chatContainer.scrollHeight)},0)}formatContent(t){if(!t)return"";const r=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").split(`
|
|
2
|
+
`);let o="";const i=[];let h=!1;const u=()=>{h&&(o+="</li>",h=!1)},f=d=>{for(;i.length>0&&i[i.length-1].indent>=d;)u(),o+=`</${i.pop().type}>`,i.length>0&&(h=!0)},b=()=>f(-1);for(const d of r){const p=d.match(/^(\s*)\d+\.\s+(.*)/),m=d.match(/^(\s*)[-*]\s+(.*)/);if(p||m){const c=(p?p[1]:m[1]).length,g=p?"ol":"ul",_=p?p[2]:m[2];if(i.length===0)o+=`<${g}>`,i.push({type:g,indent:c});else{const v=i[i.length-1];c>v.indent?(o+=`<${g}>`,i.push({type:g,indent:c})):c===v.indent?u():(f(c+1),i.length>0&&i[i.length-1].indent===c?u():(b(),o+=`<${g}>`,i.push({type:g,indent:c})))}o+=`<li>${_}`,h=!0}else d.trim()===""?i.length===0&&(o+="<br>"):(b(),o+=`<p>${d}</p>`)}return b(),o.replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>')}render(){const t=this.position.right<this.screenWidth/2;return n.html`
|
|
3
3
|
<div class="chatbot">
|
|
4
4
|
${this.renderOverlay()}
|
|
5
5
|
${this.renderLauncher()}
|
|
@@ -71,25 +71,25 @@
|
|
|
71
71
|
</div>
|
|
72
72
|
</div>
|
|
73
73
|
`}renderProductSelector(){return n.html`
|
|
74
|
-
<div class="
|
|
74
|
+
<div class="chatbot__product-selector">
|
|
75
75
|
${this.products.length>1?n.html`
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
76
|
+
<logosphere-combobox
|
|
77
|
+
id="product"
|
|
78
|
+
.items=${this.products.map(t=>({value:t.id,label:t.name}))}
|
|
79
|
+
optionValue="value"
|
|
80
|
+
optionLabel="label"
|
|
81
|
+
placeholder="Ürün seçiniz"
|
|
82
|
+
@selected=${this.onProductChange}
|
|
83
|
+
></logosphere-combobox>
|
|
84
|
+
`:n.html`
|
|
85
|
+
<input
|
|
86
|
+
id="product"
|
|
87
|
+
class="chatbot__product-input"
|
|
88
|
+
placeholder="Ürün seçiniz"
|
|
89
|
+
.value=${this.products.length===1?this.products[0].name:""}
|
|
90
|
+
readOnly="true"
|
|
91
|
+
>
|
|
92
|
+
`}
|
|
93
93
|
</div>
|
|
94
94
|
`}renderChatArea(){return n.html`
|
|
95
95
|
<div id="chat-container" class="chatbot__messages">
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
<div class="chatbot__message chatbot__message--${t.role}">
|
|
101
101
|
<div class="${e}">
|
|
102
102
|
<div class="chatbot__message-content">
|
|
103
|
-
${
|
|
103
|
+
${y.unsafeHTML(this.formatContent(t.content))}
|
|
104
104
|
</div>
|
|
105
105
|
${this.showFeedbackButtons&&t.role==="assistant"?this.renderFeedbackButtons(t):""}
|
|
106
106
|
</div>
|
|
@@ -158,4 +158,4 @@
|
|
|
158
158
|
<div class="chatbot__footer">
|
|
159
159
|
<p class="chatbot__footer-text">İçerik Yapay Zeka ile Üretilmiştir</p>
|
|
160
160
|
</div>
|
|
161
|
-
`}};exports.LogosphereChatBot.styles=[n.css`${n.unsafeCSS(
|
|
161
|
+
`}};exports.LogosphereChatBot.styles=[n.css`${n.unsafeCSS(w)}`];exports.LogosphereChatBot.ICONS={launcher:"data:image/svg+xml,%3Csvg%20width%3D%2251%22%20height%3D%2242%22%20viewBox%3D%220%200%2051%2042%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M38.457%200C40.0338%200%2041.542%200.293293%2042.9302%200.8283L49.15%206.07675C50.2611%207.93912%2050.8994%2010.1162%2050.8994%2012.4424V23.084C50.8994%2024.4858%2050.6676%2025.8334%2050.2402%2027.0907L43.1534%2034.6096C41.7043%2035.2006%2040.1187%2035.5264%2038.457%2035.5264H30.7605L38.5805%2027.2296C40.814%2027.1643%2042.6045%2025.3332%2042.6045%2023.084V12.4424C42.6045%2010.1518%2040.7476%208.29492%2038.457%208.29492H12.4424C10.1518%208.29492%208.29492%2010.1518%208.29492%2012.4424V23.084C8.29492%2025.3746%2010.1518%2027.2314%2012.4424%2027.2314H33.5078L20.4487%2041.0866C17.7992%2042.5379%2014.3381%2040.2741%2014.7842%2036.7803C14.8402%2036.3421%2014.9629%2035.9194%2015.1416%2035.5264H12.4424C10.9217%2035.5264%209.46472%2035.2536%208.11774%2034.7542L0.610679%2026.945C0.214298%2025.7295%200%2024.4318%200%2023.084V12.4424C0%2010.8011%200.317794%209.23402%200.895207%207.79935L7.12424%201.19058C8.73679%200.427072%2010.5397%200%2012.4424%200H38.457ZM23.1357%2017.7881C23.1357%2015.4815%2021.2656%2013.6113%2018.959%2013.6113C16.6525%2013.6114%2014.7822%2015.4815%2014.7822%2017.7881C14.7824%2020.0945%2016.6526%2021.9638%2018.959%2021.9639C21.2655%2021.9639%2023.1356%2020.0945%2023.1357%2017.7881ZM36.2344%2017.7881C36.2344%2015.4815%2034.3642%2013.6113%2032.0576%2013.6113C29.7511%2013.6114%2027.8809%2015.4815%2027.8809%2017.7881C27.881%2020.0945%2029.7512%2021.9638%2032.0576%2021.9639C34.3641%2021.9639%2036.2342%2020.0945%2036.2344%2017.7881Z%22%20fill%3D%22url(%23paint0_linear_97_4585)%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_97_4585%22%20x1%3D%2231.662%22%20y1%3D%224.88016%22%20x2%3D%2214.4119%22%20y2%3D%2237.9167%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23F22727%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23CA0D0D%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E"};a([s.property({type:String,attribute:"return-uri"})],exports.LogosphereChatBot.prototype,"returnUri",2);a([s.property({type:String,attribute:"question-prompt"})],exports.LogosphereChatBot.prototype,"questionPrompt",2);a([s.property({type:Boolean,attribute:"minimized-icon-only"})],exports.LogosphereChatBot.prototype,"minimizedIconOnly",2);a([s.property({type:Boolean,attribute:"draggable"})],exports.LogosphereChatBot.prototype,"draggable",2);a([s.property({type:Boolean,attribute:"resizable"})],exports.LogosphereChatBot.prototype,"resizable",2);a([s.property({type:Array,hasChanged:(l,t)=>l===t?!1:!t||!l||l.length!==t.length?!0:JSON.stringify(l)!==JSON.stringify(t)}),s.property({type:Array})],exports.LogosphereChatBot.prototype,"products",2);a([s.property({type:Boolean,attribute:"open-initially"})],exports.LogosphereChatBot.prototype,"openInitially",2);a([s.property({type:Boolean,attribute:"show-feedback-buttons"})],exports.LogosphereChatBot.prototype,"showFeedbackButtons",2);a([s.state()],exports.LogosphereChatBot.prototype,"open",2);a([s.state()],exports.LogosphereChatBot.prototype,"fullscreen",2);a([s.state()],exports.LogosphereChatBot.prototype,"messages",2);a([s.state()],exports.LogosphereChatBot.prototype,"conversationId",2);a([s.state()],exports.LogosphereChatBot.prototype,"assertionToken",2);a([s.state()],exports.LogosphereChatBot.prototype,"isLoading",2);a([s.state()],exports.LogosphereChatBot.prototype,"inputText",2);a([s.state()],exports.LogosphereChatBot.prototype,"selectedProductId",2);a([s.state()],exports.LogosphereChatBot.prototype,"windowWidth",2);a([s.state()],exports.LogosphereChatBot.prototype,"windowHeight",2);a([s.state()],exports.LogosphereChatBot.prototype,"position",2);a([s.state()],exports.LogosphereChatBot.prototype,"isDragging",2);a([s.state()],exports.LogosphereChatBot.prototype,"screenWidth",2);a([s.query("#chat-container")],exports.LogosphereChatBot.prototype,"chatContainer",2);a([s.query("#product")],exports.LogosphereChatBot.prototype,"productEl",2);exports.LogosphereChatBot=a([s.customElement("logosphere-chatbot")],exports.LogosphereChatBot);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { unsafeCSS as
|
|
2
|
-
import { property as d, state as
|
|
3
|
-
import { unsafeHTML as
|
|
1
|
+
import { unsafeCSS as x, css as z, LitElement as C, html as a } from "lit";
|
|
2
|
+
import { property as d, state as l, query as y, customElement as k } from "lit/decorators.js";
|
|
3
|
+
import { unsafeHTML as $ } from "lit/directives/unsafe-html.js";
|
|
4
4
|
import "./combobox-LBU6VHLi.js";
|
|
5
5
|
import "./button-BqOMevro.js";
|
|
6
6
|
import "./input-jmbvgWEq.js";
|
|
7
7
|
import "./ui-icon-Bys4HYSQ.js";
|
|
8
|
-
const
|
|
9
|
-
var
|
|
10
|
-
for (var
|
|
11
|
-
(h = t[
|
|
12
|
-
return i &&
|
|
8
|
+
const D = ":host{display:block;z-index:9999}.chatbot{font-family:var(--font-family-base)}.chatbot__overlay{position:fixed;inset:0;background-color:#0003;z-index:var(--z-index-modal-backdrop)}.chatbot__launcher{position:fixed;z-index:var(--z-index-modal);display:flex;align-items:center;gap:var(--spacing-4);padding-left:var(--spacing-4);padding-right:var(--spacing-4);height:66px;color:#fff;border-radius:var(--radius-xl);cursor:pointer;box-shadow:var(--shadow-base);background-color:var(--color-body-bg);overflow:hidden;transition:box-shadow var(--transition-speed-fast) var(--transition-timing)}.chatbot__launcher:hover{box-shadow:var(--shadow-md)}.chatbot__launcher--draggable{cursor:move}.chatbot__launcher--hidden{visibility:hidden;width:72px;height:66px;justify-content:center;padding:0}.chatbot__launcher-icon{width:40px;height:34px;flex-shrink:0}.chatbot__launcher-text{display:flex;flex-direction:column}.chatbot__launcher-title{font-weight:var(--font-weight-semibold);font-size:var(--font-size-xl);margin:0;line-height:24px;white-space:nowrap;color:var(--color-body-text)}.chatbot__launcher-subtitle{font-weight:var(--font-weight-semibold);font-size:var(--font-size-sm);margin:0;line-height:20px;white-space:nowrap;color:var(--color-tertiary)}.chatbot__window{position:fixed;z-index:var(--z-index-modal);display:flex;flex-direction:column;box-shadow:var(--shadow-xl);border-radius:var(--radius-md);overflow:hidden;background-color:var(--color-body-bg)}.chatbot__window--hidden{display:none}.chatbot__window--fullscreen{inset:80px 50px;width:auto;height:auto}.chatbot__resize-top{position:absolute;top:0;left:0;right:0;height:8px;cursor:ns-resize;z-index:50;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__resize-top:hover{background-color:#0000000d}.chatbot__resize-side{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;z-index:50;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__resize-side:hover{background-color:#0000000d}.chatbot__resize-side--left{left:0}.chatbot__resize-side--right{right:0}.chatbot__resize-corner{position:absolute;top:0;width:16px;height:16px;z-index:50;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__resize-corner:hover{background-color:#0000001a}.chatbot__resize-corner--nwse{left:0;cursor:nwse-resize}.chatbot__resize-corner--nesw{right:0;cursor:nesw-resize}.chatbot__header{height:74px;display:flex;align-items:center;justify-content:space-between;padding-left:var(--spacing-5);padding-right:var(--spacing-4);gap:var(--spacing-4);flex-shrink:0;background-color:var(--color-body-bg);border-bottom:1px solid var(--color-border)}.chatbot__header-info{display:flex;align-items:center;gap:var(--spacing-4)}.chatbot__header-logo{width:50px;height:41px}.chatbot__header-title{font-weight:var(--font-weight-semibold);font-size:var(--font-size-xl);margin:0;line-height:24px;color:var(--color-body-text)}.chatbot__header-subtitle{font-weight:var(--font-weight-semibold);font-size:var(--font-size-sm);margin:0;line-height:20px;color:var(--color-tertiary)}.chatbot__header-actions{display:flex;align-items:center;gap:var(--spacing-2)}.chatbot__body{flex:1;display:flex;flex-direction:column;background-color:var(--color-body-bg);position:relative;overflow:hidden}.chatbot__product{padding:var(--spacing-3);padding-bottom:0;flex-shrink:0;margin:0 var(--spacing-3)}.chatbot__messages{flex:1;display:flex;flex-direction:column;gap:var(--spacing-3);margin-top:var(--spacing-4);padding:var(--spacing-4);overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.chatbot__messages::-webkit-scrollbar{display:none}.chatbot__message{display:flex}.chatbot__message--user{justify-content:flex-end}.chatbot__message--assistant,.chatbot__message--system{justify-content:flex-start}.chatbot__bubble{position:relative;color:var(--color-body-text);max-width:85%;border-radius:var(--radius-md);padding:var(--spacing-4);font-size:var(--font-size-sm);line-height:20px;font-weight:var(--font-weight-medium)}.chatbot__bubble--user{background-color:var(--color-primary);color:#fff;border-bottom-right-radius:0;border-top-right-radius:var(--radius-xl);border-top-left-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.chatbot__bubble--user a{color:#ffffffe6}.chatbot__bubble--assistant,.chatbot__bubble--system{background-color:var(--color-tertiary-bg);border-bottom-left-radius:0;border-top-right-radius:var(--radius-xl);border-top-left-radius:var(--radius-xl);border-bottom-right-radius:var(--radius-xl)}.chatbot__message-content p{margin:0}.chatbot__message-content ol{list-style-type:decimal;margin:0;padding-left:var(--spacing-5)}.chatbot__message-content ul{list-style-type:disc;margin:0;padding-left:var(--spacing-5)}.chatbot__message-content li>ol,.chatbot__message-content li>ul{margin-top:var(--spacing-1);margin-bottom:var(--spacing-1)}.chatbot__message-content ol ol{list-style-type:lower-alpha}.chatbot__message-content ol ol ol{list-style-type:lower-roman}.chatbot__message-content ul ul{list-style-type:circle}.chatbot__message-content ul ul ul{list-style-type:square}.chatbot__message-content li{padding-left:var(--spacing-1)}.chatbot__message-content a{color:var(--color-primary);text-decoration:underline;transition:color var(--transition-speed-fast) var(--transition-timing)}.chatbot__message-content a:hover{color:var(--color-primary-hover)}.chatbot__feedback{display:flex;align-items:center;gap:var(--spacing-2);padding-top:var(--spacing-2)}.chatbot__typing-wrapper{display:flex;justify-content:flex-start}.chatbot__typing{background-color:var(--color-tertiary-bg);padding:var(--spacing-3);border-radius:var(--radius-xl);border-bottom-left-radius:0;display:inline-flex;align-items:center;gap:2px}.chatbot__typing-dot{display:inline-block;width:6px;height:6px;background-color:var(--color-gray-300);border-radius:var(--radius-full);animation:chatbot-typing 1.4s infinite ease-in-out both;margin:0 2px}.chatbot__typing-dot:nth-child(1){animation-delay:-.32s}.chatbot__typing-dot:nth-child(2){animation-delay:-.16s}@keyframes chatbot-typing{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}.chatbot__input-area{padding:var(--spacing-4);padding-top:var(--spacing-2);padding-bottom:var(--spacing-1);background-color:var(--color-body-bg)}.chatbot__input-wrapper{position:relative;display:flex;align-items:center;gap:var(--spacing-2);background-color:var(--color-tertiary-bg);border-radius:var(--radius-md);padding:var(--spacing-2);border:1px solid transparent;transition:background-color var(--transition-speed-fast) var(--transition-timing),border-color var(--transition-speed-fast) var(--transition-timing)}.chatbot__input-wrapper:focus-within{background-color:var(--color-body-bg);border-color:var(--color-border)}.chatbot__input{flex:1;background:transparent;border:none;outline:none;font-family:var(--font-family-base);font-size:var(--font-size-sm);color:var(--color-body-text)}.chatbot__input::placeholder{color:var(--color-tertiary)}.chatbot__input:disabled{opacity:.5;cursor:not-allowed}.chatbot__footer{display:flex;align-items:center;justify-content:center;padding-bottom:var(--spacing-2)}.chatbot__footer-text{margin:0;padding:0;color:var(--color-secondary);font-size:var(--font-size-xs);font-family:var(--font-family-base)}.chatbot__product-selector{padding:var(--spacing-3) var(--spacing-3) 0;flex-shrink:0}.chatbot__product-input{display:block;width:100%;height:24px;padding-left:var(--spacing-1);border:1px solid var(--color-border);border-radius:var(--radius-md);background:transparent;color:var(--color-body-color);font-size:var(--font-size-md);outline:none}";
|
|
9
|
+
var M = Object.defineProperty, I = Object.getOwnPropertyDescriptor, r = (t, e, n, i) => {
|
|
10
|
+
for (var o = i > 1 ? void 0 : i ? I(e, n) : e, c = t.length - 1, h; c >= 0; c--)
|
|
11
|
+
(h = t[c]) && (o = (i ? h(e, n, o) : h(o)) || o);
|
|
12
|
+
return i && o && M(e, n, o), o;
|
|
13
13
|
};
|
|
14
|
-
let
|
|
14
|
+
let s = class extends C {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments), this.returnUri = "", this.questionPrompt = "", this.minimizedIconOnly = !1, this.draggable = !1, this.resizable = !1, this.products = [], this.openInitially = !1, this.showFeedbackButtons = !1, this.open = !1, this.fullscreen = !1, this.messages = [], this.isLoading = !1, this.inputText = "", this.selectedProductId = "", this.windowWidth = 440, this.windowHeight = Math.min(700, window.innerHeight - 40), this.position = { right: 20, bottom: 20 }, this.isDragging = !1, this.screenWidth = window.innerWidth, this.dragStartPos = { x: 0, y: 0 }, this.initialPosition = { right: 0, bottom: 0 }, this.isResizing = !1, this.resizeDirection = "horizontal", this.resizeStartWidth = 0, this.resizeStartHeight = 0, this.onWindowResize = () => {
|
|
17
17
|
this.screenWidth = window.innerWidth;
|
|
@@ -25,9 +25,9 @@ let o = class extends _ {
|
|
|
25
25
|
this.fullscreen = !this.fullscreen;
|
|
26
26
|
}, this.onMouseMove = (t) => {
|
|
27
27
|
if (this.isDragging) {
|
|
28
|
-
const e = this.dragStartPos.x - t.clientX, n = this.dragStartPos.y - t.clientY,
|
|
28
|
+
const e = this.dragStartPos.x - t.clientX, n = this.dragStartPos.y - t.clientY, o = this.shadowRoot?.querySelector(".chatbot__launcher")?.getBoundingClientRect(), c = o?.width || 72, h = o?.height || 66;
|
|
29
29
|
this.position = {
|
|
30
|
-
right: Math.max(0, Math.min(window.innerWidth -
|
|
30
|
+
right: Math.max(0, Math.min(window.innerWidth - c, this.initialPosition.right + e)),
|
|
31
31
|
bottom: Math.max(0, Math.min(window.innerHeight - h, this.initialPosition.bottom + n))
|
|
32
32
|
};
|
|
33
33
|
} else if (this.isResizing) {
|
|
@@ -56,16 +56,21 @@ let o = class extends _ {
|
|
|
56
56
|
super.disconnectedCallback(), window.removeEventListener("resize", this.onWindowResize), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onMouseUp);
|
|
57
57
|
}
|
|
58
58
|
async firstUpdated() {
|
|
59
|
-
this.
|
|
59
|
+
this.selectedProductId = this._resolveInitialProduct(), this.open = this.openInitially, this.open && await this.initConversation();
|
|
60
60
|
}
|
|
61
61
|
updated(t) {
|
|
62
62
|
t.has("products") && this.handleProductUpdate(), t.has("messages") && this.scrollToBottom(), t.has("open") && this.open && !this.conversationId && this.initConversation();
|
|
63
63
|
}
|
|
64
64
|
// ==================== PRODUCT ====================
|
|
65
|
+
_resolveInitialProduct() {
|
|
66
|
+
if (!this.products.length) return "";
|
|
67
|
+
const t = this.products.find((e) => e.selected);
|
|
68
|
+
return t ? t.id : this.products.length === 1 ? this.products[0].id : "";
|
|
69
|
+
}
|
|
65
70
|
handleProductUpdate() {
|
|
66
71
|
if (!this.products.length) return;
|
|
67
|
-
const t = this.
|
|
68
|
-
this.products.
|
|
72
|
+
const t = this._resolveInitialProduct();
|
|
73
|
+
this.products.some((n) => n.id === this.selectedProductId) || (this.selectedProductId = t, this.messages = [], this.conversationId = void 0, this.open && this.initConversation()), requestAnimationFrame(() => this.updateComboboxItems());
|
|
69
74
|
}
|
|
70
75
|
updateComboboxItems() {
|
|
71
76
|
const t = this.productEl;
|
|
@@ -73,9 +78,12 @@ let o = class extends _ {
|
|
|
73
78
|
const e = this.products.map((i) => ({ value: i.id, label: i.name }));
|
|
74
79
|
t.items = e;
|
|
75
80
|
const n = t.selectedItems?.() || [];
|
|
76
|
-
if (n.length
|
|
81
|
+
if (n.length === 0 && this.selectedProductId) {
|
|
82
|
+
const i = e.find((o) => o.value === this.selectedProductId);
|
|
83
|
+
i && t.setSelected && t.setSelected([i]);
|
|
84
|
+
} else if (n.length > 0) {
|
|
77
85
|
const i = n[0]?.value;
|
|
78
|
-
!this.products.some((
|
|
86
|
+
!this.products.some((c) => c.id === i) && t.setSelected && t.setSelected([]);
|
|
79
87
|
}
|
|
80
88
|
}
|
|
81
89
|
async onProductChange(t) {
|
|
@@ -93,9 +101,9 @@ let o = class extends _ {
|
|
|
93
101
|
async ensureToken(t = !1) {
|
|
94
102
|
const e = "logosphere_chatbot_token";
|
|
95
103
|
if (t && (this.assertionToken = void 0, localStorage.removeItem(e)), !t) {
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
98
|
-
this.assertionToken =
|
|
104
|
+
const o = localStorage.getItem(e);
|
|
105
|
+
if (o) {
|
|
106
|
+
this.assertionToken = o;
|
|
99
107
|
return;
|
|
100
108
|
}
|
|
101
109
|
}
|
|
@@ -175,16 +183,29 @@ let o = class extends _ {
|
|
|
175
183
|
if (!t) return "";
|
|
176
184
|
const n = t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").split(`
|
|
177
185
|
`);
|
|
178
|
-
let i = ""
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
let i = "";
|
|
187
|
+
const o = [];
|
|
188
|
+
let c = !1;
|
|
189
|
+
const h = () => {
|
|
190
|
+
c && (i += "</li>", c = !1);
|
|
191
|
+
}, v = (u) => {
|
|
192
|
+
for (; o.length > 0 && o[o.length - 1].indent >= u; )
|
|
193
|
+
h(), i += `</${o.pop().type}>`, o.length > 0 && (c = !0);
|
|
194
|
+
}, m = () => v(-1);
|
|
195
|
+
for (const u of n) {
|
|
196
|
+
const g = u.match(/^(\s*)\d+\.\s+(.*)/), f = u.match(/^(\s*)[-*]\s+(.*)/);
|
|
197
|
+
if (g || f) {
|
|
198
|
+
const p = (g ? g[1] : f[1]).length, b = g ? "ol" : "ul", w = g ? g[2] : f[2];
|
|
199
|
+
if (o.length === 0)
|
|
200
|
+
i += `<${b}>`, o.push({ type: b, indent: p });
|
|
201
|
+
else {
|
|
202
|
+
const _ = o[o.length - 1];
|
|
203
|
+
p > _.indent ? (i += `<${b}>`, o.push({ type: b, indent: p })) : p === _.indent ? h() : (v(p + 1), o.length > 0 && o[o.length - 1].indent === p ? h() : (m(), i += `<${b}>`, o.push({ type: b, indent: p })));
|
|
204
|
+
}
|
|
205
|
+
i += `<li>${w}`, c = !0;
|
|
206
|
+
} else u.trim() === "" ? o.length === 0 && (i += "<br>") : (m(), i += `<p>${u}</p>`);
|
|
186
207
|
}
|
|
187
|
-
return
|
|
208
|
+
return m(), i.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(
|
|
188
209
|
/\[([^\]]+)\]\(([^)]+)\)/g,
|
|
189
210
|
'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'
|
|
190
211
|
);
|
|
@@ -217,7 +238,7 @@ let o = class extends _ {
|
|
|
217
238
|
@click=${this.draggable ? null : this.onToggle}
|
|
218
239
|
aria-expanded=${this.open ? "true" : "false"}
|
|
219
240
|
>
|
|
220
|
-
<img class="chatbot__launcher-icon" src="${
|
|
241
|
+
<img class="chatbot__launcher-icon" src="${s.ICONS.launcher}" alt="chatbot" />
|
|
221
242
|
${!this.open && !this.minimizedIconOnly ? a`
|
|
222
243
|
<div class="chatbot__launcher-text">
|
|
223
244
|
<p class="chatbot__launcher-title">Logo</p>
|
|
@@ -259,7 +280,7 @@ let o = class extends _ {
|
|
|
259
280
|
return a`
|
|
260
281
|
<div class="chatbot__header">
|
|
261
282
|
<div class="chatbot__header-info">
|
|
262
|
-
<img class="chatbot__header-logo" alt="logo" src="${
|
|
283
|
+
<img class="chatbot__header-logo" alt="logo" src="${s.ICONS.launcher}" />
|
|
263
284
|
<div>
|
|
264
285
|
<p class="chatbot__header-title">Logo</p>
|
|
265
286
|
<p class="chatbot__header-subtitle">Dijital Danışman</p>
|
|
@@ -292,25 +313,25 @@ let o = class extends _ {
|
|
|
292
313
|
}
|
|
293
314
|
renderProductSelector() {
|
|
294
315
|
return a`
|
|
295
|
-
<div class="
|
|
316
|
+
<div class="chatbot__product-selector">
|
|
296
317
|
${this.products.length > 1 ? a`
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
318
|
+
<logosphere-combobox
|
|
319
|
+
id="product"
|
|
320
|
+
.items=${this.products.map((t) => ({ value: t.id, label: t.name }))}
|
|
321
|
+
optionValue="value"
|
|
322
|
+
optionLabel="label"
|
|
323
|
+
placeholder="Ürün seçiniz"
|
|
324
|
+
@selected=${this.onProductChange}
|
|
325
|
+
></logosphere-combobox>
|
|
326
|
+
` : a`
|
|
327
|
+
<input
|
|
328
|
+
id="product"
|
|
329
|
+
class="chatbot__product-input"
|
|
330
|
+
placeholder="Ürün seçiniz"
|
|
331
|
+
.value=${this.products.length === 1 ? this.products[0].name : ""}
|
|
332
|
+
readOnly="true"
|
|
333
|
+
>
|
|
334
|
+
`}
|
|
314
335
|
</div>
|
|
315
336
|
`;
|
|
316
337
|
}
|
|
@@ -331,7 +352,7 @@ let o = class extends _ {
|
|
|
331
352
|
<div class="chatbot__message chatbot__message--${t.role}">
|
|
332
353
|
<div class="${e}">
|
|
333
354
|
<div class="chatbot__message-content">
|
|
334
|
-
${
|
|
355
|
+
${$(this.formatContent(t.content))}
|
|
335
356
|
</div>
|
|
336
357
|
${this.showFeedbackButtons && t.role === "assistant" ? this.renderFeedbackButtons(t) : ""}
|
|
337
358
|
</div>
|
|
@@ -401,86 +422,86 @@ let o = class extends _ {
|
|
|
401
422
|
`;
|
|
402
423
|
}
|
|
403
424
|
};
|
|
404
|
-
|
|
405
|
-
|
|
425
|
+
s.styles = [z`${x(D)}`];
|
|
426
|
+
s.ICONS = {
|
|
406
427
|
launcher: "data:image/svg+xml,%3Csvg%20width%3D%2251%22%20height%3D%2242%22%20viewBox%3D%220%200%2051%2042%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M38.457%200C40.0338%200%2041.542%200.293293%2042.9302%200.8283L49.15%206.07675C50.2611%207.93912%2050.8994%2010.1162%2050.8994%2012.4424V23.084C50.8994%2024.4858%2050.6676%2025.8334%2050.2402%2027.0907L43.1534%2034.6096C41.7043%2035.2006%2040.1187%2035.5264%2038.457%2035.5264H30.7605L38.5805%2027.2296C40.814%2027.1643%2042.6045%2025.3332%2042.6045%2023.084V12.4424C42.6045%2010.1518%2040.7476%208.29492%2038.457%208.29492H12.4424C10.1518%208.29492%208.29492%2010.1518%208.29492%2012.4424V23.084C8.29492%2025.3746%2010.1518%2027.2314%2012.4424%2027.2314H33.5078L20.4487%2041.0866C17.7992%2042.5379%2014.3381%2040.2741%2014.7842%2036.7803C14.8402%2036.3421%2014.9629%2035.9194%2015.1416%2035.5264H12.4424C10.9217%2035.5264%209.46472%2035.2536%208.11774%2034.7542L0.610679%2026.945C0.214298%2025.7295%200%2024.4318%200%2023.084V12.4424C0%2010.8011%200.317794%209.23402%200.895207%207.79935L7.12424%201.19058C8.73679%200.427072%2010.5397%200%2012.4424%200H38.457ZM23.1357%2017.7881C23.1357%2015.4815%2021.2656%2013.6113%2018.959%2013.6113C16.6525%2013.6114%2014.7822%2015.4815%2014.7822%2017.7881C14.7824%2020.0945%2016.6526%2021.9638%2018.959%2021.9639C21.2655%2021.9639%2023.1356%2020.0945%2023.1357%2017.7881ZM36.2344%2017.7881C36.2344%2015.4815%2034.3642%2013.6113%2032.0576%2013.6113C29.7511%2013.6114%2027.8809%2015.4815%2027.8809%2017.7881C27.881%2020.0945%2029.7512%2021.9638%2032.0576%2021.9639C34.3641%2021.9639%2036.2342%2020.0945%2036.2344%2017.7881Z%22%20fill%3D%22url(%23paint0_linear_97_4585)%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_97_4585%22%20x1%3D%2231.662%22%20y1%3D%224.88016%22%20x2%3D%2214.4119%22%20y2%3D%2237.9167%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23F22727%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23CA0D0D%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E"
|
|
407
428
|
};
|
|
408
|
-
|
|
429
|
+
r([
|
|
409
430
|
d({ type: String, attribute: "return-uri" })
|
|
410
|
-
],
|
|
411
|
-
|
|
431
|
+
], s.prototype, "returnUri", 2);
|
|
432
|
+
r([
|
|
412
433
|
d({ type: String, attribute: "question-prompt" })
|
|
413
|
-
],
|
|
414
|
-
|
|
434
|
+
], s.prototype, "questionPrompt", 2);
|
|
435
|
+
r([
|
|
415
436
|
d({ type: Boolean, attribute: "minimized-icon-only" })
|
|
416
|
-
],
|
|
417
|
-
|
|
437
|
+
], s.prototype, "minimizedIconOnly", 2);
|
|
438
|
+
r([
|
|
418
439
|
d({ type: Boolean, attribute: "draggable" })
|
|
419
|
-
],
|
|
420
|
-
|
|
440
|
+
], s.prototype, "draggable", 2);
|
|
441
|
+
r([
|
|
421
442
|
d({ type: Boolean, attribute: "resizable" })
|
|
422
|
-
],
|
|
423
|
-
|
|
443
|
+
], s.prototype, "resizable", 2);
|
|
444
|
+
r([
|
|
424
445
|
d({
|
|
425
446
|
type: Array,
|
|
426
447
|
hasChanged: (t, e) => t === e ? !1 : !e || !t || t.length !== e.length ? !0 : JSON.stringify(t) !== JSON.stringify(e)
|
|
427
448
|
}),
|
|
428
449
|
d({ type: Array })
|
|
429
|
-
],
|
|
430
|
-
|
|
450
|
+
], s.prototype, "products", 2);
|
|
451
|
+
r([
|
|
431
452
|
d({ type: Boolean, attribute: "open-initially" })
|
|
432
|
-
],
|
|
433
|
-
|
|
453
|
+
], s.prototype, "openInitially", 2);
|
|
454
|
+
r([
|
|
434
455
|
d({ type: Boolean, attribute: "show-feedback-buttons" })
|
|
435
|
-
],
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
],
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
],
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
],
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
],
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
],
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
],
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
],
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
],
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
],
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
],
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
],
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
],
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
],
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
],
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
],
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
],
|
|
456
|
+
], s.prototype, "showFeedbackButtons", 2);
|
|
457
|
+
r([
|
|
458
|
+
l()
|
|
459
|
+
], s.prototype, "open", 2);
|
|
460
|
+
r([
|
|
461
|
+
l()
|
|
462
|
+
], s.prototype, "fullscreen", 2);
|
|
463
|
+
r([
|
|
464
|
+
l()
|
|
465
|
+
], s.prototype, "messages", 2);
|
|
466
|
+
r([
|
|
467
|
+
l()
|
|
468
|
+
], s.prototype, "conversationId", 2);
|
|
469
|
+
r([
|
|
470
|
+
l()
|
|
471
|
+
], s.prototype, "assertionToken", 2);
|
|
472
|
+
r([
|
|
473
|
+
l()
|
|
474
|
+
], s.prototype, "isLoading", 2);
|
|
475
|
+
r([
|
|
476
|
+
l()
|
|
477
|
+
], s.prototype, "inputText", 2);
|
|
478
|
+
r([
|
|
479
|
+
l()
|
|
480
|
+
], s.prototype, "selectedProductId", 2);
|
|
481
|
+
r([
|
|
482
|
+
l()
|
|
483
|
+
], s.prototype, "windowWidth", 2);
|
|
484
|
+
r([
|
|
485
|
+
l()
|
|
486
|
+
], s.prototype, "windowHeight", 2);
|
|
487
|
+
r([
|
|
488
|
+
l()
|
|
489
|
+
], s.prototype, "position", 2);
|
|
490
|
+
r([
|
|
491
|
+
l()
|
|
492
|
+
], s.prototype, "isDragging", 2);
|
|
493
|
+
r([
|
|
494
|
+
l()
|
|
495
|
+
], s.prototype, "screenWidth", 2);
|
|
496
|
+
r([
|
|
497
|
+
y("#chat-container")
|
|
498
|
+
], s.prototype, "chatContainer", 2);
|
|
499
|
+
r([
|
|
500
|
+
y("#product")
|
|
501
|
+
], s.prototype, "productEl", 2);
|
|
502
|
+
s = r([
|
|
503
|
+
k("logosphere-chatbot")
|
|
504
|
+
], s);
|
|
484
505
|
export {
|
|
485
|
-
|
|
506
|
+
s as L
|
|
486
507
|
};
|
package/dist/chatbot.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chatbot-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chatbot-B_3w7h4T.cjs");Object.defineProperty(exports,"LogosphereChatBot",{enumerable:!0,get:()=>e.LogosphereChatBot});
|
package/dist/chatbot.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./button-CDRccsk9.cjs"),t=require("./badge-7IIatiRv.cjs"),o=require("./checkbox-CdDTRdKV.cjs"),n=require("./formfield-BFOIEicR.cjs"),u=require("./switch-Rnnn10bn.cjs"),a=require("./breadcrumb-Cop-B1J7.cjs"),b=require("./card-KiNHfEi2.cjs"),c=require("./input-JpAWN-M1.cjs"),i=require("./popover-C2p5Pmts.cjs"),d=require("./text-area-CZDdxbrN.cjs"),p=require("./chatbot-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./button-CDRccsk9.cjs"),t=require("./badge-7IIatiRv.cjs"),o=require("./checkbox-CdDTRdKV.cjs"),n=require("./formfield-BFOIEicR.cjs"),u=require("./switch-Rnnn10bn.cjs"),a=require("./breadcrumb-Cop-B1J7.cjs"),b=require("./card-KiNHfEi2.cjs"),c=require("./input-JpAWN-M1.cjs"),i=require("./popover-C2p5Pmts.cjs"),d=require("./text-area-CZDdxbrN.cjs"),p=require("./chatbot-B_3w7h4T.cjs"),g=require("./calendar-LMn1ZF3N.cjs"),l=require("./combobox-C6zoQopK.cjs"),m=require("./datepicker-CwDDA6np.cjs"),s=require("./drawer-BvcPd5nz.cjs"),f=require("./download-manager-BSIMTGaK.cjs"),e=require("./leftmenu-DBcncBN8.cjs"),P=require("./modal-DU1sszVn.cjs"),y=require("./tab-DcjAlXzU.cjs"),j=require("./tree-menu-B1iwfHyd.cjs");Object.defineProperty(exports,"Button",{enumerable:!0,get:()=>r.Button});Object.defineProperty(exports,"LogosphereBadge",{enumerable:!0,get:()=>t.LogosphereBadge});Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:()=>o.Checkbox});Object.defineProperty(exports,"FormField",{enumerable:!0,get:()=>n.FormField});Object.defineProperty(exports,"Switch",{enumerable:!0,get:()=>u.Switch});Object.defineProperty(exports,"Breadcrumb",{enumerable:!0,get:()=>a.Breadcrumb});Object.defineProperty(exports,"Card",{enumerable:!0,get:()=>b.Card});Object.defineProperty(exports,"LogosphereInput",{enumerable:!0,get:()=>c.LogosphereInput});Object.defineProperty(exports,"Popover",{enumerable:!0,get:()=>i.Popover});Object.defineProperty(exports,"TextArea",{enumerable:!0,get:()=>d.TextArea});Object.defineProperty(exports,"LogosphereChatBot",{enumerable:!0,get:()=>p.LogosphereChatBot});Object.defineProperty(exports,"LogosphereCalendar",{enumerable:!0,get:()=>g.LogosphereCalendar});Object.defineProperty(exports,"Combobox",{enumerable:!0,get:()=>l.Combobox});Object.defineProperty(exports,"LogosphereDatePicker",{enumerable:!0,get:()=>m.LogosphereDatePicker});Object.defineProperty(exports,"Drawer",{enumerable:!0,get:()=>s.Drawer});Object.defineProperty(exports,"DownloadManager",{enumerable:!0,get:()=>f.DownloadManager});Object.defineProperty(exports,"LeftMenu",{enumerable:!0,get:()=>e.LeftMenu});Object.defineProperty(exports,"LeftMenuItemElement",{enumerable:!0,get:()=>e.LeftMenuItemElement});Object.defineProperty(exports,"Modal",{enumerable:!0,get:()=>P.Modal});Object.defineProperty(exports,"LogosphereTab",{enumerable:!0,get:()=>y.LogosphereTab});Object.defineProperty(exports,"TreeMenu",{enumerable:!0,get:()=>j.TreeMenu});
|
package/dist/index.js
CHANGED
|
@@ -8,14 +8,14 @@ import { C } from "./card-CNoTUaJC.js";
|
|
|
8
8
|
import { L as u } from "./input-jmbvgWEq.js";
|
|
9
9
|
import { P as M } from "./popover-CaVOXo_k.js";
|
|
10
10
|
import { T as l } from "./text-area-Dec_k4rs.js";
|
|
11
|
-
import { L as T } from "./chatbot-
|
|
11
|
+
import { L as T } from "./chatbot-uGYcx6Nn.js";
|
|
12
12
|
import { L as i } from "./calendar-WZ_GQvnn.js";
|
|
13
13
|
import { C as F } from "./combobox-LBU6VHLi.js";
|
|
14
14
|
import { L as k } from "./datepicker-SwKsdw3S.js";
|
|
15
15
|
import { D as S } from "./drawer-DVINJB4a.js";
|
|
16
16
|
import { D as A } from "./download-manager-a541AYhr.js";
|
|
17
17
|
import { L as j, a as q } from "./leftmenu-C-q1h_2U.js";
|
|
18
|
-
import { M as z } from "./modal-
|
|
18
|
+
import { M as z } from "./modal-B8aQyCBg.js";
|
|
19
19
|
import { L as H } from "./tab-BYU_XEhp.js";
|
|
20
20
|
import { T as K } from "./tree-menu-BbX8GK_z.js";
|
|
21
21
|
export {
|