-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchunk-NNEG5XLF.js
More file actions
7 lines (7 loc) · 15 KB
/
chunk-NNEG5XLF.js
File metadata and controls
7 lines (7 loc) · 15 KB
1
2
3
4
5
6
7
import{b as Re,c as He}from"./chunk-EJLLX3NW.js";import{Ab as Ie,Da as X,Fb as Ae,I as U,Ib as ze,Na as De,Qa as w,Sa as E,V as j,Za as q,_a as ye,a as xe,ab as K,bb as J,da as L,rb as Ne,tb as Te,u as ve,ub as Me,vb as we,yb as Ee}from"./chunk-GU7FRFWB.js";import{$b as me,Ab as y,Ba as A,Bb as le,Cb as N,Gb as T,La as de,Lc as _e,Nb as M,Ob as p,Pb as u,Rb as ce,Sb as pe,Tb as ue,Ub as m,Vb as a,Wb as d,Xb as g,Yc as S,_c as B,ac as ge,ad as D,bc as z,bd as l,cc as R,cd as be,f as ee,fa as te,fd as G,g as ne,ga as ie,gc as _,ha as oe,ib as r,ja as re,jc as c,kc as O,la as f,lc as H,md as h,qc as k,rc as fe,sa as x,sc as $,sd as Se,ta as v,td as P,ua as I,vd as Q,wc as he,wd as W,xa as ae,xc as F,xd as Z,ya as se,yc as V,zc as Ce}from"./chunk-GUHHCQYK.js";function $e(n,o){if(n&1&&(I(),a(0,"rect",1),g(1,"animate",2)(2,"animate",3),d()),n&2){let e=o.$implicit,t=c();M("x",e.x)("y",e.yMin)("width",t.RECT_WIDTH)("height",t.RECT_HEIGHT_MIN)("rx",t.RECT_RADIUS)("ry",t.RECT_RADIUS),r(),M("values",t.RECT_HEIGHT_MIN+"; "+t.RECT_HEIGHT_MAX+"; "+t.RECT_HEIGHT_MIN)("dur",t.DURATION+"s")("begin",e.begin+"s"),r(),M("values",e.yMin+"; "+e.yMax+"; "+e.yMin)("dur",t.DURATION+"s")("begin",e.begin+"s")}}var Fe=["input"],Ge=[[["","nx-sender-prefix",""]],[["","nx-sender-extend-action",""]]],Ue=["[nx-sender-prefix]","[nx-sender-extend-action]"];function je(n,o){n&1&&z(0)}function Le(n,o){if(n&1&&T(0,je,1,0,"ng-container",5),n&2){let e=c();m("ngTemplateOutlet",e.header())}}function Pe(n,o){n&1&&H(0)}function Qe(n,o){n&1&&H(0,1)}function We(n,o){n&1&&g(0,"nx-sender-recording-icon")}function Ze(n,o){n&1&&g(0,"nz-icon",11)}function Xe(n,o){if(n&1){let e=R();a(0,"button",10),_("click",function(){x(e);let i=c(2);return v(i.triggerSpeech(!i.speechRecording()))}),p(1,We,1,0,"nx-sender-recording-icon")(2,Ze,1,0,"nz-icon",11),d()}if(n&2){let e=c(2);m("rootDisabled",e.innerDisabled()),r(),u(e.speechRecording()?1:2)}}function qe(n,o){if(n&1&&(a(0,"button",8),g(1,"nx-sender-stop-loading-icon"),d()),n&2){let e=c(2);m("selfDisabled",!e.loading())("rootDisabled",e.innerDisabled())}}function Ke(n,o){if(n&1&&(a(0,"button",9),g(1,"nz-icon",12),d()),n&2){let e=c(2);m("selfDisabled",!e.innerValue())("rootDisabled",e.innerDisabled())}}function Je(n,o){if(n&1&&(a(0,"div",3)(1,"div",6),p(2,Qe,1,0),p(3,Xe,3,2,"button",7),p(4,qe,2,2,"button",8)(5,Ke,2,2,"button",9),d()()),n&2){let e=c();r(2),u(e.actionChildren().length>0?2:-1),r(),u(e.allowSpeech()?3:-1),r(),u(e.loading()?4:5)}}function Ye(n,o){n&1&&z(0)}function en(n,o){n&1&&T(0,Ye,1,0,"ng-container",5),n&2&&m("ngTemplateOutlet",o)}function nn(n,o){n&1&&z(0)}function tn(n,o){if(n&1&&(a(0,"div",4),T(1,nn,1,0,"ng-container",5),d()),n&2){let e=c();r(),m("ngTemplateOutlet",e.footer())}}var on=["*"];function rn(n,o){if(n&1&&(me(0),V(1),ge()),n&2){let e=c(3);r(),Ce(e.title())}}function an(n,o){if(n&1&&T(0,rn,2,1,"ng-container",5),n&2){let e=c(2);m("nzStringTemplateOutlet",e.title())}}function sn(n,o){if(n&1){let e=R();a(0,"button",6),_("click",function(){x(e);let i=c(2);return v(i.onOpenChange(!i.open()))}),g(1,"nz-icon",7),d()}}function dn(n,o){if(n&1&&(a(0,"div",1)(1,"div",3),p(2,an,1,1,"ng-container"),d(),p(3,sn,2,0,"button",4),d()),n&2){let e=c();r(2),u(e.title()?2:-1),r(),u(e.closable()?3:-1)}}var Pn=(()=>{class n{visible=A(!1);mouse=A({x:0,y:0});elementRef=f(de);containerBg=S(()=>{let{x:e,y:t}=this.mouse();return{background:`
radial-gradient(
${this.visible()?"100px":"0px"} circle at ${e}px ${t}px,
#3b82f6,
transparent 80%
)
`}});handleMouseMove({clientX:e,clientY:t}){let{left:i,top:s}=this.elementRef.nativeElement.getBoundingClientRect();this.mouse.set({x:e-i,y:t-s})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=N({type:n,selectors:[["nx-sender","nxGlowingBorder",""]],hostAttrs:[1,"ant-sender-glowing"],hostVars:2,hostBindings:function(t,i){t&1&&_("mousemove",function(b){return i.handleMouseMove(b)})("mouseenter",function(){return i.visible.set(!0)})("mouseleave",function(){return i.visible.set(!1)}),t&2&&he(i.containerBg())}})}return n})(),Y=new re("nx-sender-actions-context"),ln=(()=>{class n{_CLASSNAME="ant-sender-actions-btn";actionsContext=f(Y);selfDisabled=l(!1,{transform:h});rootDisabled=l(!1,{transform:h});actionType=l("onSend");mergedDisabled=S(()=>this.rootDisabled()||this.selfDisabled());class=S(()=>{let e=[this._CLASSNAME,"ant-btn-icon-only"];return this.mergedDisabled()&&e.push(this.generateClass("disabled")),this.actionType()==="onCancel"?e.push(this.generateClass("loading-button")):this.actionType()==="onSpeech"&&e.push(this.generateClass("speech-button")),e});dispatchAction(){this.mergedDisabled()||this.actionsContext()[this.actionType()]?.()}generateClass(e){return`${this._CLASSNAME}-${e}`}static \u0275fac=function(t){return new(t||n)};static \u0275dir=N({type:n,selectors:[["button","nxSenderBuiltInAction",""]],hostVars:2,hostBindings:function(t,i){t&1&&_("click",function(){return i.dispatchAction()}),t&2&&F(i.class())},inputs:{selfDisabled:[1,"selfDisabled"],rootDisabled:[1,"rootDisabled"],actionType:[1,"actionType"]}})}return n})(),cn=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=y({type:n,selectors:[["nx-sender-stop-loading-icon"]],decls:8,vars:0,consts:[["color","currentColor","viewBox","0 0 1000 1000","xmlns","http://www.w3.org/2000/svg",1,"ant-sender-actions-btn-loading-icon"],["fill","currentColor","height","250","rx","24","ry","24","width","250","x","375","y","375"],["cx","500","cy","500","fill","none","r","450","stroke","currentColor","stroke-width","100","opacity","0.45"],["cx","500","cy","500","fill","none","r","450","stroke","currentColor","stroke-width","100","stroke-dasharray","600 9999999"],["attributeName","transform","dur","1s","from","0 500 500","repeatCount","indefinite","to","360 500 500","type","rotate"]],template:function(t,i){t&1&&(a(0,"nz-icon"),I(),a(1,"svg",0)(2,"title"),V(3,"Stop Loading"),d(),g(4,"rect",1)(5,"circle",2),a(6,"circle",3),g(7,"animateTransform",4),d()()())},dependencies:[E,w],encapsulation:2,changeDetection:0})}return n})(),pn=(()=>{class n{SIZE=1e3;COUNT=4;RECT_WIDTH=140;RECT_RADIUS=this.RECT_WIDTH/2;RECT_HEIGHT_MIN=250;RECT_HEIGHT_MAX=500;DURATION=.8;get bars(){return Array.from({length:this.COUNT}).map((e,t)=>{let i=(this.SIZE-this.RECT_WIDTH*this.COUNT)/(this.COUNT-1),s=t*(i+this.RECT_WIDTH),b=this.SIZE/2-this.RECT_HEIGHT_MIN/2,C=this.SIZE/2-this.RECT_HEIGHT_MAX/2;return{x:s,yMin:b,yMax:C,index:t,begin:this.DURATION/this.COUNT*t}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=y({type:n,selectors:[["nx-sender-recording-icon"]],hostAttrs:[2,"display","flex"],decls:6,vars:1,consts:[["xmlns","http://www.w3.org/2000/svg","color","currentColor",1,"ant-sender-actions-btn-recording-icon"],["fill","currentColor"],["attributeName","height","keyTimes","0; 0.5; 1","repeatCount","indefinite"],["attributeName","y","keyTimes","0; 0.5; 1","repeatCount","indefinite"]],template:function(t,i){t&1&&(a(0,"nz-icon"),I(),a(1,"svg",0)(2,"title"),V(3,"Speech Recording"),d(),pe(4,$e,3,12,":svg:rect",1,ce),d()()),t&2&&(r(),M("viewBox","0 0 "+i.SIZE+" "+i.SIZE),r(3),ue(i.bars))},dependencies:[E,w],encapsulation:2,changeDetection:0})}return n})(),Ve=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=N({type:n,selectors:[["","nx-sender-prefix",""]],hostAttrs:[1,"ant-sender-prefix"],exportAs:["nxSenderPrefix"]})}return n})(),Be=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=N({type:n,selectors:[["","nx-sender-extend-action",""]],exportAs:["nxSenderExtendAction"]})}return n})(),Oe=(()=>{class n{document=f(ae);recognition;_supported=!1;recording$=new ne(!1);transcript$=new ee;recordingChange=this.recording$.asObservable();transcriptChange=this.transcript$.asObservable();get supported(){return this._supported}constructor(){this.checkSupport()}checkSupport(){let e;typeof this.document.defaultView<"u"&&(e=this.document.defaultView.SpeechRecognition||this.document.defaultView.webkitSpeechRecognition),this._supported=!!e,this._supported&&(this.recognition=new e,this.setupRecognition())}setupRecognition(){this.recognition.lang=navigator.language||"en-US",this.recognition.onstart=()=>{this.recording$.next(!0)},this.recognition.onend=()=>{this.recording$.next(!1)},this.recognition.onresult=e=>{let t=e.results?.[0]?.[0]?.transcript;t&&this.transcript$.next(t)}}onStart(){if(!this._supported){j("Speech recognition is not supported in this browser");return}navigator.permissions.query({name:"microphone"}).then(()=>{this.recognition.start()}).catch(e=>{j("Error accessing microphone:",e)})}onStop(){this.recognition&&this.recording$.value&&this.recognition.stop()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=ie({token:n,factory:n.\u0275fac})}return n})(),ke="ant-sender",un=n=>typeof n=="boolean"||typeof n=="object"?n:n!=null&&n!=="false",mn=(()=>{class n{inputElement=be.required("input");directionality=f(ve);destroyRef=f(se);speechService=f(Oe);actionsContext=f(Y);prefixChildren=G(Ve);actionChildren=G(Be);actions=l();header=l();footer=l();loading=l(!1,{transform:h});readonly=l(!1,{transform:h});disabled=l(!1,{transform:h});allowSpeech=l(!1,{transform:un});value=l("");submitType=l("enter");placeholder=l("");submitSend=D();valueChange=D();cancelled=D();pasteFile=D();dir=this.directionality.valueSignal;innerDisabled=B(this.disabled);innerValue=B(this.value);speechInControlled=S(()=>{let e=this.allowSpeech();return typeof e=="object"?typeof e.recording=="boolean":!1});speechRecording=B({source:this.allowSpeech,computation:e=>this.speechInControlled()?!!e.recording:!1});hostClass=S(()=>{let e=[ke];return this.innerDisabled()&&e.push(this.generateClass("disabled")),this.dir()==="rtl"&&e.push(this.generateClass("rtl")),e});ngOnInit(){!this.speechInControlled()&&this.speechService.supported&&(this.speechService.recordingChange.pipe(U(this.destroyRef)).subscribe(e=>{this.speechRecording.set(e)}),this.speechService.transcriptChange.pipe(U(this.destroyRef)).subscribe(e=>{this.triggerValueChange(`${this.innerValue()} ${e}`)})),this.actionsContext.set({onSend:this.triggerSend.bind(this),onCancel:this.triggerCancel.bind(this),onSpeech:()=>this.triggerSpeech(!1),onClear:()=>this.triggerValueChange("")})}triggerValueChange(e){this.innerValue.set(e),this.fnChange(e),this.valueChange.emit(e),this.speechRecording()&&this.triggerSpeech(!1)}triggerSend(e){e&&L(e),this.innerValue()&&!this.loading()&&this.submitSend.emit()}triggerCancel(e){e&&L(e),this.cancelled.emit()}triggerSpeech(e){this.speechInControlled()?this.allowSpeech().onRecordingChange?.(e):e?this.speechService.onStart():this.speechService.onStop()}onKeyPress(e){let t=e.key==="Enter"&&!e.isComposing;switch(this.submitType()){case"enter":t&&!e.shiftKey&&(e.preventDefault(),this.triggerSend());break;case"shiftEnter":t&&e.shiftKey&&(e.preventDefault(),this.triggerSend());break;default:break}}onContentMouseDown(e){e.target!==this.inputElement()?.nativeElement&&e.preventDefault(),this.inputElement()?.nativeElement.focus()}generateClass(e){return`${ke}-${e}`}fnChange=()=>{};fnTouched=()=>{};registerOnChange(e){this.fnChange=e}registerOnTouched(e){this.fnTouched=e}writeValue(e){this.innerValue.set(e)}setDisabledState(e){this.innerDisabled.set(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=y({type:n,selectors:[["nx-sender"]],contentQueries:function(t,i,s){t&1&&(k(s,i.prefixChildren,Ve,4),k(s,i.actionChildren,Be,4)),t&2&&$(2)},viewQuery:function(t,i){t&1&&fe(i.inputElement,Fe,5),t&2&&$()},hostVars:2,hostBindings:function(t,i){t&2&&F(i.hostClass())},inputs:{actions:[1,"actions"],header:[1,"header"],footer:[1,"footer"],loading:[1,"loading"],readonly:[1,"readonly"],disabled:[1,"disabled"],allowSpeech:[1,"allowSpeech"],value:[1,"value"],submitType:[1,"submitType"],placeholder:[1,"placeholder"]},outputs:{submitSend:"submitSend",valueChange:"valueChange",cancelled:"cancelled",pasteFile:"pasteFile"},exportAs:["nxSender"],features:[_e([Oe,{provide:Y,useFactory:()=>A({})},{provide:Ne,useExisting:te(()=>n),multi:!0}])],ngContentSelectors:Ue,decls:8,vars:8,consts:[["input",""],[1,"ant-sender-content",3,"mousedown"],["nz-input","","nzAutosize","","nzVariant","borderless",1,"ant-sender-input",3,"ngModelChange","keydown","disabled","readOnly","placeholder","ngModel"],[1,"ant-sender-actions-list"],[1,"ant-sender-footer"],[4,"ngTemplateOutlet"],["nz-flex","","nzAlign","center","nzJustify","center",1,"ant-sender-actions-list-presets"],["nz-button","","nzType","text","nxSenderBuiltInAction","","actionType","onSpeech",3,"rootDisabled"],["nz-button","","nzType","text","nzShape","circle","nxSenderBuiltInAction","","actionType","onCancel",3,"selfDisabled","rootDisabled"],["nz-button","","nzType","primary","nzShape","circle","nxSenderBuiltInAction","","actionType","onSend",3,"selfDisabled","rootDisabled"],["nz-button","","nzType","text","nxSenderBuiltInAction","","actionType","onSpeech",3,"click","rootDisabled"],["nzType","audio","nzTheme","outline"],["nzType","arrow-up","nzTheme","outline"]],template:function(t,i){if(t&1){let s=R();O(Ge),p(0,Le,1,1,"ng-container"),a(1,"div",1),_("mousedown",function(C){return x(s),v(i.onContentMouseDown(C))}),p(2,Pe,1,0),a(3,"textarea",2,0),_("ngModelChange",function(C){return x(s),v(i.triggerValueChange(C))})("keydown",function(C){return x(s),v(i.onKeyPress(C))}),d(),p(5,Je,6,3,"div",3)(6,en,1,1,"ng-container"),d(),p(7,tn,2,1,"div",4)}if(t&2){let s;u(i.header()?0:-1),r(2),u(i.prefixChildren().length>0?2:-1),r(),m("disabled",i.innerDisabled())("readOnly",i.readonly())("placeholder",i.placeholder())("ngModel",i.innerValue()),r(2),u(i.actions()===void 0?5:(s=i.actions())?6:-1,s),r(2),u(i.footer()?7:-1)}},dependencies:[Ee,Te,Me,we,xe,J,K,q,ye,He,Re,E,w,ze,Ae,Ie,pn,ln,cn],encapsulation:2,changeDetection:0})}return n})(),gn=Se("senderHeaderCollapseMotion",[W("expanded",Q({height:"*",overflow:"hidden"})),W("collapsed",Q({height:0,borderBottomColor:"transparent",overflow:"hidden"})),Z("expanded => collapsed",P(`300ms ${X.EASE_IN_OUT}`)),Z("collapsed => expanded",P(`300ms ${X.EASE_IN_OUT}`))]),fn=(()=>{class n{title=l(null);open=l(!1,{transform:h});closable=l(!0,{transform:h});openChange=D();onOpenChange(e){this.openChange.emit(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=y({type:n,selectors:[["nx-sender-header"]],inputs:{title:[1,"title"],open:[1,"open"],closable:[1,"closable"]},outputs:{openChange:"openChange"},ngContentSelectors:on,decls:4,vars:2,consts:[[1,"ant-sender-header"],[1,"ant-sender-header-header"],[1,"ant-sender-header-content"],[1,"ant-sender-header-title"],["nz-button","","nzType","text","nzSize","small",1,"ant-sender-header-close"],[4,"nzStringTemplateOutlet"],["nz-button","","nzType","text","nzSize","small",1,"ant-sender-header-close",3,"click"],["nzType","close","nzTheme","outline"]],template:function(t,i){t&1&&(O(),a(0,"div",0),p(1,dn,4,2,"div",1),a(2,"div",2),H(3),d()()),t&2&&(m("@senderHeaderCollapseMotion",i.open()?"expanded":"collapsed"),r(),u(i.closable()||i.title()?1:-1))},dependencies:[J,K,q,E,w,De],encapsulation:2,data:{animation:[gn]}})}return n})();var Qn=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=le({type:n});static \u0275inj=oe({imports:[mn,fn]})}return n})();export{Pn as a,Ve as b,Be as c,mn as d,fn as e,Qn as f};