@yassirbenmoussa/aicommerce-sdk 1.8.0 → 1.9.1
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/ai-commerce.min.js +409 -77
- package/dist/index.cjs +483 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +483 -56
- package/dist/index.mjs.map +1 -1
- package/dist/widget.min.js +402 -70
- package/dist/widget.min.js.map +1 -1
- package/package.json +1 -1
package/dist/widget.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var AICommerceWidget=(function(exports){'use strict';/*! AI Commerce Widget v1.0.0 | MIT License | https://aicommerce.dev */
|
|
2
|
-
var
|
|
2
|
+
var R=class i{constructor(r){this.sessionToken=null;this.products={create:async r=>this.request("/api/v1/products",{method:"POST",body:JSON.stringify(r)}),batchUpsert:async r=>this.request("/api/v1/products",{method:"POST",body:JSON.stringify({products:r})}),list:async r=>{let e=new URLSearchParams;r?.page&&e.set("page",String(r.page)),r?.perPage&&e.set("perPage",String(r.perPage)),r?.search&&e.set("search",r.search),r?.categoryId&&e.set("categoryId",r.categoryId),r?.isActive!==void 0&&e.set("isActive",String(r.isActive));let d=e.toString();return this.request(`/api/v1/products${d?`?${d}`:""}`)},get:async r=>this.request(`/api/v1/products/${r}`),update:async(r,e)=>this.request(`/api/v1/products/${r}`,{method:"PUT",body:JSON.stringify(e)}),delete:async r=>this.request(`/api/v1/products/${r}`,{method:"DELETE"})};if(!r.apiKey)throw new Error("AICommerce: apiKey is required");this.apiKey=r.apiKey,this.storeId=r.storeId,this.baseUrl=this.normalizeUrl(r.baseUrl||this.detectBaseUrl()),this.timeout=r.timeout||3e4;}detectBaseUrl(){if(typeof window<"u"){let r=document.querySelector("script[data-aicommerce-url]");if(r)return r.getAttribute("data-aicommerce-url")||"https://api.aicommerce.dev"}return "https://api.aicommerce.dev"}normalizeUrl(r){return r.replace(/\/$/,"")}async request(r,e={}){let d=`${this.baseUrl}${r}`,y=new AbortController,s=setTimeout(()=>y.abort(),this.timeout);try{let g=await fetch(d,{...e,signal:y.signal,headers:{"Content-Type":"application/json","x-api-key":this.apiKey,...this.storeId&&{"x-store-id":this.storeId},...this.sessionToken&&{"X-Session-Token":this.sessionToken},...e.headers}});if(clearTimeout(s),!g.ok){let A=await g.json().catch(()=>({})),w={code:A.code||"UNKNOWN_ERROR",message:A.message||A.error||`HTTP ${g.status}`,status:g.status};throw new S(w.message,w.code,w.status)}return g.json()}catch(g){throw clearTimeout(s),g instanceof S?g:g instanceof Error&&g.name==="AbortError"?new S("Request timeout","TIMEOUT",408):new S(g instanceof Error?g.message:"Unknown error","NETWORK_ERROR",0)}}async chat(r,e){let d=typeof r=="string"?{message:r,context:e,sessionToken:this.sessionToken||void 0}:{...r,sessionToken:r.sessionToken||this.sessionToken||void 0},y=await this.request("/api/v1/chat",{method:"POST",body:JSON.stringify(d)});return y.sessionToken&&(this.sessionToken=y.sessionToken),y}async chatWithAudio(r,e){let d=await r.arrayBuffer(),s={audioBase64:btoa(new Uint8Array(d).reduce((A,w)=>A+String.fromCharCode(w),"")),audioMimeType:r.type||"audio/webm",context:e,sessionToken:this.sessionToken||void 0},g=await this.request("/api/v1/chat",{method:"POST",body:JSON.stringify(s)});return g.sessionToken&&(this.sessionToken=g.sessionToken),g}async createSession(){let r=await this.request("/api/v1/chat/session",{method:"POST"});return this.sessionToken=r.session.token,r.session}clearSession(){this.sessionToken=null;}getSessionToken(){return this.sessionToken}setSessionToken(r){this.sessionToken=r;}async upload(r,e){let d=new FormData;d.append("file",r),e?.folder&&d.append("folder",e.folder),e?.productId&&d.append("productId",e.productId),e?.isPrimary&&d.append("isPrimary","true");let y=`${this.baseUrl}/api/v1/upload`,s=await fetch(y,{method:"POST",headers:{"X-API-Key":this.apiKey},body:d});if(!s.ok){let g=await s.json().catch(()=>({}));throw new S(g.message||g.error||`HTTP ${s.status}`,g.code||"UPLOAD_ERROR",s.status)}return s.json()}static async quickChat(r){return new i({apiKey:r.apiKey,baseUrl:r.baseUrl}).chat(r.message,r.context)}},S=class i extends Error{constructor(r,e,d){super(r),this.name="AICommerceError",this.code=e,this.status=d,Object.setPrototypeOf(this,i.prototype);}};function Z(i){let r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:{r:99,g:102,b:241}}function O(i){let r=i.primaryColor,e=Z(r),d=i.position==="bottom-left";return `
|
|
3
3
|
/* AI Commerce Widget Styles */
|
|
4
4
|
#aicommerce-widget {
|
|
5
5
|
--aic-primary: ${r};
|
|
@@ -20,7 +20,7 @@ var L=class i{constructor(r){this.sessionToken=null;this.products={create:async
|
|
|
20
20
|
line-height: 1.5;
|
|
21
21
|
position: fixed;
|
|
22
22
|
bottom: 20px;
|
|
23
|
-
${
|
|
23
|
+
${d?"left: 20px;":"right: 20px;"}
|
|
24
24
|
z-index: var(--aic-z-index);
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -74,7 +74,7 @@ var L=class i{constructor(r){this.sessionToken=null;this.products={create:async
|
|
|
74
74
|
.aicommerce-chat {
|
|
75
75
|
position: absolute;
|
|
76
76
|
bottom: 0;
|
|
77
|
-
${
|
|
77
|
+
${d?"left: 0;":"right: 0;"}
|
|
78
78
|
width: 380px;
|
|
79
79
|
max-width: calc(100vw - 40px);
|
|
80
80
|
height: 600px;
|
|
@@ -86,7 +86,7 @@ var L=class i{constructor(r){this.sessionToken=null;this.products={create:async
|
|
|
86
86
|
flex-direction: column;
|
|
87
87
|
overflow: hidden;
|
|
88
88
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
89
|
-
transform-origin: bottom ${
|
|
89
|
+
transform-origin: bottom ${d?"left":"right"};
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.aicommerce-chat.aicommerce-closed {
|
|
@@ -515,7 +515,7 @@ var L=class i{constructor(r){this.sessionToken=null;this.products={create:async
|
|
|
515
515
|
@media (max-width: 420px) {
|
|
516
516
|
#aicommerce-widget {
|
|
517
517
|
bottom: 16px;
|
|
518
|
-
${
|
|
518
|
+
${d?"left: 16px;":"right: 16px;"}
|
|
519
519
|
}
|
|
520
520
|
|
|
521
521
|
.aicommerce-chat {
|
|
@@ -549,17 +549,22 @@ var L=class i{constructor(r){this.sessionToken=null;this.products={create:async
|
|
|
549
549
|
}
|
|
550
550
|
|
|
551
551
|
/* ============================================
|
|
552
|
-
Embedded Mode Styles
|
|
552
|
+
Embedded Mode Styles - ChatGPT Style
|
|
553
553
|
============================================ */
|
|
554
554
|
|
|
555
|
-
/* Embedded container -
|
|
555
|
+
/* Embedded container - starts small, grows to max-height, then scrolls */
|
|
556
556
|
#aicommerce-widget.aicommerce-embedded {
|
|
557
557
|
position: relative;
|
|
558
558
|
bottom: auto;
|
|
559
559
|
left: auto;
|
|
560
560
|
right: auto;
|
|
561
561
|
width: 100%;
|
|
562
|
-
height:
|
|
562
|
+
height: auto;
|
|
563
|
+
min-height: 80px;
|
|
564
|
+
max-height: var(--aic-max-height, 600px);
|
|
565
|
+
display: flex;
|
|
566
|
+
flex-direction: column;
|
|
567
|
+
background: transparent;
|
|
563
568
|
}
|
|
564
569
|
|
|
565
570
|
/* Embedded mode: hide launcher button */
|
|
@@ -567,17 +572,31 @@ var L=class i{constructor(r){this.sessionToken=null;this.products={create:async
|
|
|
567
572
|
display: none !important;
|
|
568
573
|
}
|
|
569
574
|
|
|
570
|
-
/* Embedded mode:
|
|
575
|
+
/* Embedded mode: hide the header completely */
|
|
576
|
+
.aicommerce-embedded .aicommerce-header {
|
|
577
|
+
display: none !important;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/* Embedded mode: hide close button */
|
|
581
|
+
.aicommerce-embedded .aicommerce-close {
|
|
582
|
+
display: none !important;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/* Embedded mode: chat container grows with content */
|
|
571
586
|
.aicommerce-embedded .aicommerce-chat {
|
|
572
587
|
position: relative;
|
|
573
588
|
width: 100%;
|
|
574
|
-
height:
|
|
575
|
-
max-width: 100%;
|
|
589
|
+
height: auto;
|
|
576
590
|
max-height: 100%;
|
|
577
|
-
|
|
591
|
+
max-width: 100%;
|
|
592
|
+
border-radius: 0;
|
|
593
|
+
background: transparent;
|
|
594
|
+
box-shadow: none;
|
|
578
595
|
transform: none !important;
|
|
579
596
|
opacity: 1 !important;
|
|
580
597
|
pointer-events: auto !important;
|
|
598
|
+
display: flex;
|
|
599
|
+
flex-direction: column;
|
|
581
600
|
}
|
|
582
601
|
|
|
583
602
|
/* Embedded mode: no open/close animations */
|
|
@@ -587,62 +606,342 @@ var L=class i{constructor(r){this.sessionToken=null;this.products={create:async
|
|
|
587
606
|
pointer-events: auto !important;
|
|
588
607
|
}
|
|
589
608
|
|
|
590
|
-
/* Embedded mode: messages area
|
|
609
|
+
/* Embedded mode: messages area - scrollable when content overflows */
|
|
591
610
|
.aicommerce-embedded .aicommerce-messages {
|
|
592
|
-
flex: 1;
|
|
611
|
+
flex: 1 1 auto;
|
|
593
612
|
min-height: 0;
|
|
613
|
+
max-height: calc(var(--aic-max-height, 600px) - 100px);
|
|
614
|
+
display: flex;
|
|
615
|
+
flex-direction: column;
|
|
616
|
+
justify-content: flex-start;
|
|
617
|
+
overflow-y: auto;
|
|
618
|
+
padding: 16px;
|
|
619
|
+
max-width: 700px;
|
|
620
|
+
margin: 0 auto;
|
|
621
|
+
width: 100%;
|
|
622
|
+
background: transparent;
|
|
623
|
+
gap: 12px;
|
|
624
|
+
scrollbar-width: thin;
|
|
625
|
+
scrollbar-color: var(--aic-border) transparent;
|
|
594
626
|
}
|
|
595
627
|
|
|
596
|
-
/* Embedded mode
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
628
|
+
/* Embedded mode: custom scrollbar for webkit browsers */
|
|
629
|
+
.aicommerce-embedded .aicommerce-messages::-webkit-scrollbar {
|
|
630
|
+
width: 6px;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.aicommerce-embedded .aicommerce-messages::-webkit-scrollbar-track {
|
|
634
|
+
background: transparent;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.aicommerce-embedded .aicommerce-messages::-webkit-scrollbar-thumb {
|
|
638
|
+
background-color: var(--aic-border);
|
|
639
|
+
border-radius: 3px;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.aicommerce-embedded .aicommerce-messages::-webkit-scrollbar-thumb:hover {
|
|
643
|
+
background-color: var(--aic-text-secondary);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/* Embedded mode: messages have different styling */
|
|
647
|
+
.aicommerce-embedded .aicommerce-message {
|
|
648
|
+
max-width: 100%;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.aicommerce-embedded .aicommerce-message-content {
|
|
652
|
+
background: var(--aic-bg);
|
|
653
|
+
border: 1px solid var(--aic-border);
|
|
654
|
+
border-radius: 12px;
|
|
655
|
+
padding: 12px 16px;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.aicommerce-embedded .aicommerce-user .aicommerce-message-content {
|
|
659
|
+
background: var(--aic-primary);
|
|
660
|
+
color: white;
|
|
661
|
+
border-color: var(--aic-primary);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/* Embedded mode: input container wrapper - always at bottom */
|
|
665
|
+
.aicommerce-embedded .aicommerce-input-wrapper {
|
|
666
|
+
width: 100%;
|
|
667
|
+
display: flex;
|
|
668
|
+
flex-direction: column;
|
|
669
|
+
align-items: center;
|
|
670
|
+
padding: 16px;
|
|
671
|
+
flex-shrink: 0;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/* Embedded mode: input container styled like ChatGPT */
|
|
675
|
+
.aicommerce-embedded .aicommerce-input-container {
|
|
676
|
+
width: 100%;
|
|
677
|
+
max-width: 700px;
|
|
678
|
+
background: var(--aic-bg);
|
|
679
|
+
border: 1px solid var(--aic-border);
|
|
680
|
+
border-radius: 24px;
|
|
681
|
+
padding: 8px 12px;
|
|
682
|
+
display: flex;
|
|
683
|
+
align-items: flex-end;
|
|
684
|
+
gap: 8px;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/* Embedded mode: textarea field styling - auto-grow */
|
|
688
|
+
.aicommerce-embedded .aicommerce-input {
|
|
689
|
+
flex: 1;
|
|
690
|
+
min-width: 0;
|
|
691
|
+
border: none;
|
|
692
|
+
background: transparent;
|
|
693
|
+
padding: 8px 4px;
|
|
694
|
+
font-size: 16px;
|
|
695
|
+
font-family: inherit;
|
|
696
|
+
color: var(--aic-text);
|
|
697
|
+
outline: none;
|
|
698
|
+
resize: none;
|
|
699
|
+
min-height: 24px;
|
|
700
|
+
max-height: 150px;
|
|
701
|
+
line-height: 1.5;
|
|
702
|
+
overflow-y: auto;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.aicommerce-embedded .aicommerce-input::placeholder {
|
|
706
|
+
color: var(--aic-text-secondary);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
/* Embedded mode: buttons styling - smaller, no overflow */
|
|
710
|
+
.aicommerce-embedded .aicommerce-mic,
|
|
711
|
+
.aicommerce-embedded .aicommerce-send {
|
|
712
|
+
flex-shrink: 0;
|
|
713
|
+
width: 36px;
|
|
714
|
+
height: 36px;
|
|
715
|
+
min-width: 36px;
|
|
716
|
+
border-radius: 50%;
|
|
717
|
+
background: var(--aic-primary);
|
|
718
|
+
color: white;
|
|
719
|
+
border: none;
|
|
720
|
+
display: flex;
|
|
721
|
+
align-items: center;
|
|
722
|
+
justify-content: center;
|
|
723
|
+
cursor: pointer;
|
|
724
|
+
transition: all 0.2s ease;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.aicommerce-embedded .aicommerce-mic:hover,
|
|
728
|
+
.aicommerce-embedded .aicommerce-send:hover {
|
|
729
|
+
opacity: 0.9;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.aicommerce-embedded .aicommerce-mic {
|
|
733
|
+
background: transparent;
|
|
734
|
+
color: var(--aic-text-secondary);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.aicommerce-embedded .aicommerce-mic:hover {
|
|
738
|
+
background: rgba(0, 0, 0, 0.05);
|
|
739
|
+
color: var(--aic-text);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
/* Embedded mode: product cards styling - horizontal scroll like widget mode */
|
|
743
|
+
.aicommerce-embedded .aicommerce-products {
|
|
744
|
+
display: flex;
|
|
745
|
+
flex-wrap: nowrap;
|
|
746
|
+
gap: 12px;
|
|
747
|
+
margin-top: 12px;
|
|
748
|
+
overflow-x: auto;
|
|
749
|
+
padding-bottom: 8px;
|
|
750
|
+
cursor: grab;
|
|
751
|
+
scrollbar-width: none;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.aicommerce-embedded .aicommerce-products::-webkit-scrollbar {
|
|
755
|
+
display: none;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.aicommerce-embedded .aicommerce-product-card {
|
|
759
|
+
flex-shrink: 0;
|
|
760
|
+
width: 180px;
|
|
761
|
+
background: var(--aic-bg);
|
|
762
|
+
border: 1px solid var(--aic-border);
|
|
763
|
+
border-radius: 12px;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/* Embedded mode: typing indicator */
|
|
767
|
+
.aicommerce-embedded .aicommerce-typing {
|
|
768
|
+
background: var(--aic-bg);
|
|
769
|
+
border: 1px solid var(--aic-border);
|
|
770
|
+
border-radius: 12px;
|
|
771
|
+
padding: 12px 16px;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/* Embedded mode responsive - mobile fixes */
|
|
775
|
+
@media (max-width: 640px) {
|
|
776
|
+
.aicommerce-embedded .aicommerce-input-container {
|
|
777
|
+
padding: 6px 10px;
|
|
778
|
+
gap: 6px;
|
|
779
|
+
border-radius: 20px;
|
|
600
780
|
}
|
|
601
781
|
|
|
602
|
-
.aicommerce-embedded .aicommerce-
|
|
603
|
-
|
|
782
|
+
.aicommerce-embedded .aicommerce-mic,
|
|
783
|
+
.aicommerce-embedded .aicommerce-send {
|
|
784
|
+
width: 32px;
|
|
785
|
+
height: 32px;
|
|
786
|
+
min-width: 32px;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.aicommerce-embedded .aicommerce-mic svg,
|
|
790
|
+
.aicommerce-embedded .aicommerce-send svg {
|
|
791
|
+
width: 16px;
|
|
792
|
+
height: 16px;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.aicommerce-embedded .aicommerce-input {
|
|
796
|
+
font-size: 16px;
|
|
797
|
+
padding: 6px 4px;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.aicommerce-embedded .aicommerce-messages {
|
|
801
|
+
padding: 12px;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
.aicommerce-embedded .aicommerce-input-wrapper {
|
|
805
|
+
padding: 12px;
|
|
604
806
|
}
|
|
605
807
|
}
|
|
606
|
-
|
|
607
|
-
|
|
808
|
+
|
|
809
|
+
/* ============================================
|
|
810
|
+
Add to Cart Button Styles
|
|
811
|
+
============================================ */
|
|
812
|
+
|
|
813
|
+
.aicommerce-add-to-cart {
|
|
814
|
+
width: 100%;
|
|
815
|
+
padding: 8px 12px;
|
|
816
|
+
background: var(--aic-primary);
|
|
817
|
+
color: white;
|
|
818
|
+
border: none;
|
|
819
|
+
border-radius: 6px;
|
|
820
|
+
font-size: 12px;
|
|
821
|
+
font-weight: 500;
|
|
822
|
+
cursor: pointer;
|
|
823
|
+
margin-top: 8px;
|
|
824
|
+
transition: all 0.2s;
|
|
825
|
+
display: flex;
|
|
826
|
+
align-items: center;
|
|
827
|
+
justify-content: center;
|
|
828
|
+
gap: 6px;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.aicommerce-add-to-cart:hover {
|
|
832
|
+
opacity: 0.9;
|
|
833
|
+
transform: translateY(-1px);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
.aicommerce-add-to-cart:active {
|
|
837
|
+
transform: translateY(0);
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
.aicommerce-add-to-cart:disabled {
|
|
841
|
+
opacity: 0.7;
|
|
842
|
+
cursor: not-allowed;
|
|
843
|
+
transform: none;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
.aicommerce-add-to-cart svg {
|
|
847
|
+
flex-shrink: 0;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
/* Spinner animation for loading state */
|
|
851
|
+
@keyframes aicommerce-spin {
|
|
852
|
+
to { transform: rotate(360deg); }
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.aicommerce-spinner {
|
|
856
|
+
animation: aicommerce-spin 1s linear infinite;
|
|
857
|
+
}
|
|
858
|
+
`}function W(i){let r=document.createElement("style");r.id="aicommerce-widget-styles",r.textContent=i;let e=document.getElementById("aicommerce-widget-styles");return e&&e.remove(),document.head.appendChild(r),r}function ee(i){if(!i.apiKey)throw new Error("AICommerceWidget: apiKey is required");let r=new R({apiKey:i.apiKey,storeId:i.storeId,baseUrl:i.baseUrl}),e={isOpen:false,isLoading:true,isRecording:false,messages:[],storeConfig:null},d=null,y=[],s=null,w=null,m;async function F(){try{let a=i.baseUrl||B(),o=await fetch(`${a}/api/v1/store`,{headers:{"x-api-key":i.apiKey}});return o.ok?(await o.json()).store:null}catch(a){return console.error("Failed to fetch store config:",a),null}}function B(){if(typeof window<"u"){let a=document.querySelector("script[data-aicommerce-url]");if(a)return a.getAttribute("data-aicommerce-url")||""}return "https://api.aicommerce.dev"}async function K(){e.storeConfig=await F();let a=i.displayMode||"widget",o=a==="embedded";m={apiKey:i.apiKey,storeId:i.storeId,baseUrl:i.baseUrl||B(),displayMode:a,container:i.container,maxHeight:i.maxHeight||"600px",placeholder:i.placeholder||"Ask me anything about our products...",position:i.position||"bottom-right",theme:i.theme||"auto",primaryColor:i.primaryColor||e.storeConfig?.primaryColor||"#6366f1",welcomeMessage:i.welcomeMessage||e.storeConfig?.welcomeMessage||"Hi! How can I help you find the perfect product today?",botName:i.botName||e.storeConfig?.chatBotName||"Shopping Assistant",zIndex:i.zIndex||9999,buttonText:i.buttonText||"\u{1F4AC}",hideLauncher:i.hideLauncher||false,addToCartText:i.addToCartText,onOpen:i.onOpen,onClose:i.onClose,onProductClick:i.onProductClick,onAddToCart:i.onAddToCart,onMessage:i.onMessage};let c=O(m);if(w=W(c),o){let h=null;if(typeof i.container=="string"?h=document.querySelector(i.container):i.container instanceof HTMLElement&&(h=i.container),!h){console.error("[AI Commerce] Embedded mode requires a valid container element or selector");return}s=document.createElement("div"),s.id="aicommerce-widget",s.className=`aicommerce-widget aicommerce-embedded aicommerce-theme-${m.theme}`,s.style.setProperty("--aic-max-height",m.maxHeight),h.appendChild(s),e.isOpen=true;}else s=document.createElement("div"),s.id="aicommerce-widget",s.className=`aicommerce-widget aicommerce-${m.position} aicommerce-theme-${m.theme}`,document.body.appendChild(s);k(),o||e.messages.push({role:"assistant",content:m.welcomeMessage}),e.isLoading=false,k();}async function N(a,o=1){let c=a;if(a.includes("gid://")){let u=a.match(/\/(\d+)$/);u&&(c=u[1]);}if(!(await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:c,quantity:o})})).ok)throw new Error("Failed to add to cart");document.dispatchEvent(new CustomEvent("cart:refresh"));}function k(){if(!s)return;let a=m.displayMode==="embedded",o=e.messages.some(l=>l.role==="user");a&&(s.classList.remove("aicommerce-no-messages","aicommerce-has-messages"),s.classList.add(o?"aicommerce-has-messages":"aicommerce-no-messages"));let c=m.placeholder||"Ask me anything about our products...",h=`
|
|
859
|
+
<div class="aicommerce-input-container">
|
|
860
|
+
${a?`
|
|
861
|
+
<textarea
|
|
862
|
+
class="aicommerce-input"
|
|
863
|
+
placeholder="${c}"
|
|
864
|
+
rows="1"
|
|
865
|
+
${e.isLoading||e.isRecording?"disabled":""}
|
|
866
|
+
></textarea>
|
|
867
|
+
`:`
|
|
868
|
+
<input
|
|
869
|
+
type="text"
|
|
870
|
+
class="aicommerce-input"
|
|
871
|
+
placeholder="${c}"
|
|
872
|
+
${e.isLoading||e.isRecording?"disabled":""}
|
|
873
|
+
/>
|
|
874
|
+
`}
|
|
875
|
+
<button class="aicommerce-mic ${e.isRecording?"aicommerce-recording":""}" ${e.isLoading?"disabled":""} aria-label="${e.isRecording?"Stop recording":"Voice input"}">
|
|
876
|
+
${e.isRecording?`
|
|
877
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
|
|
878
|
+
<rect x="6" y="6" width="12" height="12" rx="2"/>
|
|
879
|
+
</svg>
|
|
880
|
+
`:`
|
|
881
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
882
|
+
<path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>
|
|
883
|
+
<path d="M19 10v2a7 7 0 0 1-14 0v-2"/>
|
|
884
|
+
<line x1="12" y1="19" x2="12" y2="23"/>
|
|
885
|
+
<line x1="8" y1="23" x2="16" y2="23"/>
|
|
886
|
+
</svg>
|
|
887
|
+
`}
|
|
888
|
+
</button>
|
|
889
|
+
<button class="aicommerce-send" ${e.isLoading||e.isRecording?"disabled":""} aria-label="Send message">
|
|
890
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
891
|
+
<path d="M22 2L11 13M22 2L15 22L11 13M22 2L2 9L11 13"/>
|
|
892
|
+
</svg>
|
|
893
|
+
</button>
|
|
894
|
+
</div>
|
|
895
|
+
`,u=`
|
|
896
|
+
${!a&&!m.hideLauncher?`
|
|
608
897
|
<button class="aicommerce-launcher ${e.isOpen?"aicommerce-hidden":""}" aria-label="Open chat">
|
|
609
|
-
<span class="aicommerce-launcher-icon">${
|
|
898
|
+
<span class="aicommerce-launcher-icon">${m.buttonText}</span>
|
|
610
899
|
</button>
|
|
611
900
|
`:""}
|
|
612
901
|
|
|
613
902
|
<div class="aicommerce-chat ${e.isOpen?"aicommerce-open":"aicommerce-closed"}">
|
|
903
|
+
${a?"":`
|
|
614
904
|
<div class="aicommerce-header">
|
|
615
905
|
<div class="aicommerce-header-info">
|
|
616
906
|
<div class="aicommerce-avatar">
|
|
617
|
-
${e.storeConfig?.logo?`<img src="${e.storeConfig.logo}" alt="${
|
|
907
|
+
${e.storeConfig?.logo?`<img src="${e.storeConfig.logo}" alt="${m.botName}" />`:"<span>\u{1F916}</span>"}
|
|
618
908
|
</div>
|
|
619
909
|
<div class="aicommerce-header-text">
|
|
620
|
-
<span class="aicommerce-bot-name">${
|
|
910
|
+
<span class="aicommerce-bot-name">${m.botName}</span>
|
|
621
911
|
<span class="aicommerce-status">Online</span>
|
|
622
912
|
</div>
|
|
623
913
|
</div>
|
|
624
|
-
|
|
914
|
+
<button class="aicommerce-close" aria-label="Close chat">\u2715</button>
|
|
625
915
|
</div>
|
|
916
|
+
`}
|
|
626
917
|
|
|
918
|
+
${a&&o?`
|
|
627
919
|
<div class="aicommerce-messages">
|
|
628
|
-
${e.messages.map((
|
|
629
|
-
<div class="aicommerce-message aicommerce-${
|
|
630
|
-
<div class="aicommerce-message-content ${
|
|
631
|
-
${
|
|
920
|
+
${e.messages.map((l,L)=>{let P=j(l.content),n=l.role==="user";return `
|
|
921
|
+
<div class="aicommerce-message aicommerce-${l.role}">
|
|
922
|
+
<div class="aicommerce-message-content ${P?"aicommerce-rtl":"aicommerce-ltr"}">
|
|
923
|
+
${l.audioUrl?H(l,L,n):T(l.content)}
|
|
632
924
|
</div>
|
|
633
|
-
${
|
|
925
|
+
${l.products&&l.products.length>0?`
|
|
634
926
|
<div class="aicommerce-products">
|
|
635
|
-
${
|
|
636
|
-
<div class="aicommerce-product-card" data-product-id="${
|
|
637
|
-
${
|
|
638
|
-
<img src="${
|
|
927
|
+
${l.products.map(t=>`
|
|
928
|
+
<div class="aicommerce-product-card" data-product-id="${t.id}" data-variant-id="${t.variantId||""}">
|
|
929
|
+
${t.image||t.imageUrl?`
|
|
930
|
+
<img src="${t.image||t.imageUrl}" alt="${T(t.name)}" class="aicommerce-product-image" />
|
|
639
931
|
`:`
|
|
640
932
|
<div class="aicommerce-product-placeholder">\u{1F4E6}</div>
|
|
641
933
|
`}
|
|
642
934
|
<div class="aicommerce-product-info">
|
|
643
|
-
<span class="aicommerce-product-name" title="${
|
|
644
|
-
${
|
|
645
|
-
<span class="aicommerce-product-price">${
|
|
935
|
+
<span class="aicommerce-product-name" title="${T(t.name)}">${T(t.name)}</span>
|
|
936
|
+
${t.description?`<p class="aicommerce-product-desc">${T(t.description)}</p>`:""}
|
|
937
|
+
<span class="aicommerce-product-price">${D(t.price,t.currency)}</span>
|
|
938
|
+
<button class="aicommerce-add-to-cart" data-product-id="${t.id}">
|
|
939
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
940
|
+
<circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/>
|
|
941
|
+
<path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/>
|
|
942
|
+
</svg>
|
|
943
|
+
${m.addToCartText||"Add to Cart"}
|
|
944
|
+
</button>
|
|
646
945
|
</div>
|
|
647
946
|
</div>
|
|
648
947
|
`).join("")}
|
|
@@ -658,52 +957,85 @@ var L=class i{constructor(r){this.sessionToken=null;this.products={create:async
|
|
|
658
957
|
</div>
|
|
659
958
|
`:""}
|
|
660
959
|
</div>
|
|
960
|
+
`:""}
|
|
661
961
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
class="aicommerce-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
962
|
+
${a?"":`
|
|
963
|
+
<div class="aicommerce-messages">
|
|
964
|
+
${e.messages.map((l,L)=>{let P=j(l.content),n=l.role==="user";return `
|
|
965
|
+
<div class="aicommerce-message aicommerce-${l.role}">
|
|
966
|
+
<div class="aicommerce-message-content ${P?"aicommerce-rtl":"aicommerce-ltr"}">
|
|
967
|
+
${l.audioUrl?H(l,L,n):T(l.content)}
|
|
968
|
+
</div>
|
|
969
|
+
${l.products&&l.products.length>0?`
|
|
970
|
+
<div class="aicommerce-products">
|
|
971
|
+
${l.products.map(t=>`
|
|
972
|
+
<div class="aicommerce-product-card" data-product-id="${t.id}" data-variant-id="${t.variantId||""}">
|
|
973
|
+
${t.image||t.imageUrl?`
|
|
974
|
+
<img src="${t.image||t.imageUrl}" alt="${T(t.name)}" class="aicommerce-product-image" />
|
|
975
|
+
`:`
|
|
976
|
+
<div class="aicommerce-product-placeholder">\u{1F4E6}</div>
|
|
977
|
+
`}
|
|
978
|
+
<div class="aicommerce-product-info">
|
|
979
|
+
<span class="aicommerce-product-name" title="${T(t.name)}">${T(t.name)}</span>
|
|
980
|
+
${t.description?`<p class="aicommerce-product-desc">${T(t.description)}</p>`:""}
|
|
981
|
+
<span class="aicommerce-product-price">${D(t.price,t.currency)}</span>
|
|
982
|
+
<button class="aicommerce-add-to-cart" data-product-id="${t.id}">
|
|
983
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
984
|
+
<circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/>
|
|
985
|
+
<path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/>
|
|
986
|
+
</svg>
|
|
987
|
+
${m.addToCartText||"Add to Cart"}
|
|
988
|
+
</button>
|
|
989
|
+
</div>
|
|
990
|
+
</div>
|
|
991
|
+
`).join("")}
|
|
992
|
+
</div>
|
|
993
|
+
`:""}
|
|
994
|
+
</div>
|
|
995
|
+
`}).join("")}
|
|
996
|
+
${e.isLoading?`
|
|
997
|
+
<div class="aicommerce-message aicommerce-assistant">
|
|
998
|
+
<div class="aicommerce-typing">
|
|
999
|
+
<span></span><span></span><span></span>
|
|
1000
|
+
</div>
|
|
1001
|
+
</div>
|
|
1002
|
+
`:""}
|
|
688
1003
|
</div>
|
|
1004
|
+
`}
|
|
1005
|
+
|
|
1006
|
+
${a?`
|
|
1007
|
+
<div class="aicommerce-input-wrapper">
|
|
1008
|
+
${h}
|
|
1009
|
+
</div>
|
|
1010
|
+
`:h}
|
|
689
1011
|
</div>
|
|
690
|
-
`;
|
|
1012
|
+
`;s.innerHTML=u,Y();let $=s.querySelector(".aicommerce-messages");$&&($.scrollTop=$.scrollHeight);}function H(a,o,c){return `
|
|
691
1013
|
<div class="aicommerce-audio-player" data-message-index="${o}">
|
|
692
1014
|
<button class="aicommerce-audio-btn">
|
|
693
1015
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>
|
|
694
1016
|
</button>
|
|
695
1017
|
<div class="aicommerce-audio-waveform">
|
|
696
1018
|
<div class="aicommerce-waveform-bars">
|
|
697
|
-
${(
|
|
698
|
-
<div class="aicommerce-waveform-bar" style="height: ${
|
|
1019
|
+
${(a.waveformBars||Array(40).fill(10)).map(h=>`
|
|
1020
|
+
<div class="aicommerce-waveform-bar" style="height: ${h}%; background-color: ${c?"rgba(255,255,255,0.4)":"rgba(99,102,241,0.3)"}"></div>
|
|
699
1021
|
`).join("")}
|
|
700
1022
|
</div>
|
|
701
1023
|
<div class="aicommerce-audio-time">
|
|
702
1024
|
<span class="aicommerce-current-time">0:00</span>
|
|
703
|
-
<span>${
|
|
1025
|
+
<span>${z(a.audioDuration||0)}</span>
|
|
704
1026
|
</div>
|
|
705
1027
|
</div>
|
|
706
|
-
<audio src="${
|
|
1028
|
+
<audio src="${a.audioUrl}" preload="metadata"></audio>
|
|
707
1029
|
</div>
|
|
708
|
-
`}function
|
|
1030
|
+
`}function Y(){if(!s)return;let a=s.querySelector(".aicommerce-launcher");a&&a.addEventListener("click",()=>U());let o=s.querySelector(".aicommerce-close");o&&o.addEventListener("click",()=>q());let c=s.querySelector(".aicommerce-input"),h=s.querySelector(".aicommerce-send");c&&(c.addEventListener("keydown",n=>{let t=n;if(t.key==="Enter"){let p=c instanceof HTMLTextAreaElement;if(p&&t.shiftKey)return;n.preventDefault();let b=c.value.trim();b&&(I(b),c.value="",p&&(c.style.height="auto"));}}),c instanceof HTMLTextAreaElement&&c.addEventListener("input",()=>{c.style.height="auto",c.style.height=Math.min(c.scrollHeight,150)+"px";})),h&&c&&h.addEventListener("click",()=>{let n=c.value.trim();n&&(I(n),c.value="",c instanceof HTMLTextAreaElement&&(c.style.height="auto"));});let u=s.querySelector(".aicommerce-mic");u&&u.addEventListener("click",()=>J()),s.querySelectorAll(".aicommerce-product-card").forEach(n=>{n.addEventListener("click",t=>{if(t.target.closest(".aicommerce-add-to-cart"))return;let p=n.getAttribute("data-product-id"),b=e.messages.flatMap(f=>f.products||[]).find(f=>f.id===p);b&&(m.onProductClick?m.onProductClick(b):b.url&&window.open(b.url,"_blank","noopener,noreferrer"));});}),s.querySelectorAll(".aicommerce-add-to-cart").forEach(n=>{n.addEventListener("click",async t=>{t.stopPropagation();let p=n,b=p.closest(".aicommerce-product-card"),f=b?.getAttribute("data-product-id"),x=b?.getAttribute("data-variant-id"),C=e.messages.flatMap(E=>E.products||[]).find(E=>E.id===f);if(!C)return;let v=p.innerHTML;p.disabled=true,p.innerHTML=`
|
|
1031
|
+
<svg class="aicommerce-spinner" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1032
|
+
<circle cx="12" cy="12" r="10" stroke-dasharray="32" stroke-dashoffset="32"/>
|
|
1033
|
+
</svg>
|
|
1034
|
+
Adding...
|
|
1035
|
+
`;try{m.onAddToCart?await m.onAddToCart(C):x&&window.Shopify?await N(x):C.url&&window.open(C.url,"_blank","noopener,noreferrer"),p.innerHTML=`
|
|
1036
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1037
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
1038
|
+
</svg>
|
|
1039
|
+
Added!
|
|
1040
|
+
`,setTimeout(()=>{p.innerHTML=v,p.disabled=!1;},2e3);}catch(E){console.error("[AI Commerce] Add to cart failed:",E),p.innerHTML=v,p.disabled=false;}});}),s.querySelectorAll(".aicommerce-products").forEach(n=>{let t=false,p=0,b=0;n.addEventListener("mousedown",f=>{t=true,n.style.cursor="grabbing",p=f.pageX-n.offsetLeft,b=n.scrollLeft;}),n.addEventListener("mouseleave",()=>{t=false,n.style.cursor="grab";}),n.addEventListener("mouseup",()=>{t=false,n.style.cursor="grab";}),n.addEventListener("mousemove",f=>{if(!t)return;f.preventDefault();let C=(f.pageX-n.offsetLeft-p)*2;n.scrollLeft=b-C;});}),s.querySelectorAll(".aicommerce-audio-player").forEach(n=>{let t=n.querySelector("audio"),p=n.querySelector(".aicommerce-audio-btn"),b=n.querySelectorAll(".aicommerce-waveform-bar"),f=n.querySelector(".aicommerce-current-time");if(!t||!p)return;p.addEventListener("click",()=>{!t.paused?(t.pause(),p.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>'):(s?.querySelectorAll("audio").forEach(v=>{if(v!==t&&!v.paused){v.pause();let M=v.closest(".aicommerce-audio-player")?.querySelector(".aicommerce-audio-btn");M&&(M.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>');}}),t.play(),p.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>');}),t.addEventListener("timeupdate",()=>{if(f&&(f.textContent=z(t.currentTime)),t.duration){let C=t.currentTime/t.duration*100;b.forEach((v,E)=>{E/b.length*100<=C?v.style.backgroundColor=n.closest(".aicommerce-user")?"rgba(255,255,255,1)":"var(--aic-primary)":v.style.backgroundColor=n.closest(".aicommerce-user")?"rgba(255,255,255,0.4)":"rgba(99,102,241,0.3)";});}}),t.addEventListener("ended",()=>{p.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>';});let x=n.querySelector(".aicommerce-waveform-bars");x&&x.addEventListener("click",C=>{let v=x.getBoundingClientRect(),M=(C.clientX-v.left)/v.width;t.duration&&(t.currentTime=M*t.duration);});});}async function J(){if(e.isRecording)d&&d.state!=="inactive"&&d.stop();else try{let a=await navigator.mediaDevices.getUserMedia({audio:!0});y=[],d=new MediaRecorder(a,{mimeType:MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"audio/mp4"}),d.ondataavailable=o=>{o.data.size>0&&y.push(o.data);},d.onstop=async()=>{if(a.getTracks().forEach(o=>o.stop()),y.length>0){let o=new Blob(y,{type:d?.mimeType||"audio/webm"});await V(o);}e.isRecording=!1,k();},d.start(),e.isRecording=!0,k();}catch(a){console.error("Failed to start recording:",a),e.messages.push({role:"assistant",content:"Unable to access microphone. Please check your permissions."}),k();}}async function V(a){let o=URL.createObjectURL(a),c=Array(40).fill(10),h=0;try{c=await X(a);let u=new Audio(o);await new Promise($=>{u.onloadedmetadata=()=>{h=u.duration,$();},u.onerror=()=>$();});}catch(u){console.error("Audio analysis failed",u);}e.messages.push({role:"user",content:"Voice message",audioUrl:o,audioDuration:h,waveformBars:c}),e.isLoading=true,k();try{let u=await r.chatWithAudio(a);return e.messages.push({role:"assistant",content:u.reply,products:u.products}),m.onMessage&&m.onMessage("Voice message",u),u}catch(u){throw e.messages.push({role:"assistant",content:"Sorry, I encountered an error processing your voice message. Please try again."}),u}finally{e.isLoading=false,k();}}function j(a){return /[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(a)}function z(a){let o=Math.floor(a/60),c=Math.floor(a%60);return `${o}:${c.toString().padStart(2,"0")}`}async function X(a){try{let o=new(window.AudioContext||window.webkitAudioContext),c=await a.arrayBuffer(),u=(await o.decodeAudioData(c)).getChannelData(0),$=40,l=Math.floor(u.length/$),L=[];for(let P=0;P<$;P++){let n=P*l,t=n+l,p=0;for(let x=n;x<t;x++)u[x]&&(p+=u[x]*u[x]);let b=Math.sqrt(p/l),f=Math.min(100,Math.max(10,b*400));L.push(f);}return L}catch(o){return console.error("Analysis error",o),Array.from({length:40},()=>20+Math.random()*60)}}async function I(a){e.messages.push({role:"user",content:a}),e.isLoading=true,k();try{let o=await r.chat(a);return e.messages.push({role:"assistant",content:o.reply,products:o.products}),m.onMessage&&m.onMessage(a,o),o}catch(o){throw e.messages.push({role:"assistant",content:"Sorry, I encountered an error. Please try again."}),o}finally{e.isLoading=false,k();}}function U(){e.isOpen=true,k(),m.onOpen?.(),setTimeout(()=>{s?.querySelector(".aicommerce-input")?.focus();},100);}function q(){e.isOpen=false,k(),m.onClose?.();}function G(){e.isOpen?q():U();}function _(){s&&(s.remove(),s=null),w&&(w.remove(),w=null);}function Q(a){if(Object.assign(m,a),a.primaryColor){let o=O(m);w&&(w.textContent=o);}k();}function T(a){let o=document.createElement("div");return o.textContent=a,o.innerHTML}function D(a,o){let h={USD:"$",EUR:"\u20AC",GBP:"\xA3",MAD:"DH",SAR:"SAR",AED:"AED",JPY:"\xA5",CNY:"\xA5"}[o||"USD"]||o||"$";return `${a.toFixed(2)} ${h}`}return K(),{open:U,close:q,toggle:G,destroy:_,sendMessage:I,updateConfig:Q}}var re={init:ee,VERSION:"1.0.0"};typeof window<"u"&&(window.AICommerceWidget=re);exports.AICommerceWidget=re;exports.createWidget=ee;return exports;})({});//# sourceMappingURL=widget.min.js.map
|
|
709
1041
|
//# sourceMappingURL=widget.min.js.map
|