Oviya commited on
Commit ·
99b2002
1
Parent(s): 8f13b2c
update statichat
Browse files
dist/gramm-ai/browser/index.html
CHANGED
|
@@ -16,5 +16,5 @@
|
|
| 16 |
</style><link rel="stylesheet" href="styles-TX4PRGSR.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-TX4PRGSR.css"></noscript></head>
|
| 17 |
<body>
|
| 18 |
<app-root></app-root>
|
| 19 |
-
<script src="polyfills-FFHMD2TL.js" type="module"></script><script src="main-
|
| 20 |
</html>
|
|
|
|
| 16 |
</style><link rel="stylesheet" href="styles-TX4PRGSR.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-TX4PRGSR.css"></noscript></head>
|
| 17 |
<body>
|
| 18 |
<app-root></app-root>
|
| 19 |
+
<script src="polyfills-FFHMD2TL.js" type="module"></script><script src="main-53XHVZC2.js" type="module"></script></body>
|
| 20 |
</html>
|
dist/gramm-ai/browser/{main-NU7YKSTF.js → main-53XHVZC2.js}
RENAMED
|
@@ -17,4 +17,4 @@ ${t.map((i,r)=>`${r+1}) ${i.toString()}`).join(`
|
|
| 17 |
<span class="media-icon"
|
| 18 |
onclick="window.dispatchEvent(new CustomEvent('playVideo', { detail: '${t.video_url}' }))">
|
| 19 |
\u{1F4FA}
|
| 20 |
-
</span>`),i+="</div>"),i}formatErrorMessage(t){let i=t.message||"I couldn't find an exact match.";return t.sample_questions?.length&&(i+="<br><br><strong>Try asking:</strong><ul>",t.sample_questions.forEach(r=>i+=`<li>${r}</li>`),i+="</ul>"),i}get pairedMessages(){let t=[],i=this.messages||[],r=0;for(;r<i.length;){let o=i[r];if(o.sender==="user"){let s={user:o},a=i[r+1];a&&a.sender==="bot"?(s.bot=a,r+=2):r+=1,t.push(s)}else o.sender==="bot"?(t.push({bot:o}),r+=1):(t.push({bot:o}),r+=1)}return t}showNextPair(){let t=this.pairedMessages.length;if(t===0)return;let i=Math.min(this.currentPairIndex+1,t-1);this.scrollToPair(i)}showPreviousPair(){if(this.pairedMessages.length===0)return;let i=Math.max(this.currentPairIndex-1,0);this.scrollToPair(i)}scrollToPair(t){setTimeout(()=>{try{let i=this.chatContainer.nativeElement,r=i.querySelectorAll(".pair");if(!r||r.length===0)return;t<0&&(t=0),t>=r.length&&(t=r.length-1);let o=r[t];if(!o)return;i.scrollTo({top:o.offsetTop,behavior:"smooth"}),this.currentPairIndex=t}catch{try{let r=this.chatContainer.nativeElement;t===0?r.scrollTop=0:r.scrollTop=r.scrollHeight}catch{}}},50)}scrollToLastPair(){setTimeout(()=>{try{let t=this.pairedMessages.length;if(t===0)return;this.scrollToPair(t-1)}catch{}},50)}scrollToTop(){setTimeout(()=>{try{let t=this.chatContainer.nativeElement;typeof t.scrollTo=="function"?t.scrollTo({top:0,behavior:"smooth"}):t.scrollTop=0}catch{}},100)}clearChat(){this.messages=[],this.selectedQuestions.clear(),this.hasChatStarted=!1,this.lastResponseVideoUrl=null,this.ngOnInit(),this.playBlinkVideo()}pickMimeType(){let t=window,i=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/m4a"];if(!t.MediaRecorder?.isTypeSupported)return"";for(let r of i)if(t.MediaRecorder.isTypeSupported(r))return r;return""}toggleMic(){return tt(this,null,function*(){if(!(!this.supported||this.isListening||this.uploadInProgress))try{this.mediaStream=yield navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}});let t=this.pickMimeType();this.chunks=[],this.recorder=t?new MediaRecorder(this.mediaStream,{mimeType:t}):new MediaRecorder(this.mediaStream),this.recorder.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},this.recorder.onerror=()=>{this.zone.run(()=>{this.handleTranscriptionError("Audio recording error."),this.cleanupRecorder()})},this.zone.run(()=>{this.isListening=!0,this.showActions=!0}),this.recorder.start()}catch{this.zone.run(()=>{this.handleTranscriptionError("Microphone permission denied or not available."),this.cleanupRecorder()})}})}accept(){if(!(!this.recorder||this.uploadInProgress)){this.uploadInProgress=!0,this.recorder.onstop=()=>tt(this,null,function*(){try{let t=this.recorder?.mimeType||"audio/webm",i=new Blob(this.chunks,{type:t});this.zone.run(()=>{this.isSpeechProcessing=!0,this.showActions=!1,this.isListening=!1,this.chatForm.get("message")?.setValue("\u23F3 Converting speech to text...")});let r=yield this.sendToBackendForTranscription(i);this.zone.run(()=>{this.isSpeechProcessing=!1,r&&r.trim()?this.handleTranscriptionAccepted(r.trim()):this.chatForm.get("message")?.setValue("")})}catch(t){this.zone.run(()=>{this.handleTranscriptionError(typeof t?.message=="string"?t.message:"Transcription failed."),this.showActions=!1,this.isListening=!1})}finally{this.uploadInProgress=!1,this.cleanupRecorder()}});try{this.recorder.stop()}catch{this.uploadInProgress=!1,this.cleanupRecorder()}}}reject(){if(!this.uploadInProgress){try{this.recorder?.stop()}catch{}this.zone.run(()=>{this.handleTranscriptionRejected(),this.showActions=!1,this.isListening=!1}),this.cleanupRecorder()}}sendToBackendForTranscription(t){return tt(this,null,function*(){let i="http://localhost:5000/api/transcribe",r=new FormData;r.append("file",t,"speech.webm");let o=yield fetch(i,{method:"POST",body:r});if(!o.ok){let a=yield o.text().catch(()=>"");throw new Error(a||`Transcribe API failed (${o.status}).`)}return((yield o.json())?.text||"").toString()})}cleanupRecorder(){try{this.recorder?.removeEventListener?.("dataavailable",()=>{})}catch{}if(this.recorder=null,this.chunks=[],this.mediaStream){try{this.mediaStream.getTracks().forEach(t=>t.stop())}catch{}this.mediaStream=null}}handleClickOutside(t){this.showSuggestions&&this.messageInput&&(this.messageInput.nativeElement.contains(t.target)||(this.showSuggestions=!1))}handleTranscriptionAccepted(t){try{this.chatForm.get("message")?.setValue(t),setTimeout(()=>{this.messageInput?.nativeElement.focus()},0)}catch(i){console.error("handleTranscriptionAccepted error",i)}}handleTranscriptionRejected(){try{this.chatForm.get("message")?.setValue("")}catch(t){console.error("handleTranscriptionRejected error",t)}}handleTranscriptionError(t){try{this.isSpeechProcessing=!1,this.chatForm.get("message")?.setValue(""),this.messages.push({id:this.messages.length+1,text:`Transcription error: ${t}`,sender:"bot",timestamp:new Date}),setTimeout(()=>this.scrollToLastPair(),50)}catch(i){console.error("handleTranscriptionError error",i)}}static{this.\u0275fac=function(i){return new(i||e)(w(Kc),w(ib),w(Je),w(F))}}static{this.\u0275cmp=pe({type:e,selectors:[["app-staticchat"]],viewQuery:function(i,r){if(i&1&&(lt(Bk,5),lt(Uk,5),lt($k,5)),i&2){let o;We(o=qe())&&(r.chatContainer=o.first),We(o=qe())&&(r.messageInput=o.first),We(o=qe())&&(r.videoRef=o.first)}},hostBindings:function(i,r){i&1&&I("click",function(s){return r.handleClickOutside(s)},!1,Xa)},decls:23,vars:10,consts:[["chatContainer",""],["messageInput",""],["videoPlayer",""],[1,"chat-container"],[1,"chat-window"],["title","Prev message",1,"arrow-btn","up",3,"click"],[1,"chat-messages"],["class","pair",4,"ngFor","ngForOf"],["class","typing-indicator",4,"ngIf"],["title","Next message",1,"arrow-btn","down",3,"click"],["class","suggestions-box",4,"ngIf"],[1,"chat-input",3,"ngSubmit","formGroup"],["type","text","formControlName","message",3,"focus","input","placeholder","readonly"],["type","button",1,"micBtn",3,"click","disabled"],["class","actions",4,"ngIf"],["type","submit",3,"disabled"],[1,"video-window"],["autoplay","","muted","","playsinline",""],[1,"play-pause-btn",3,"click","src"],[1,"pair"],["class","message-row user-row",4,"ngIf"],["class","message-row bot-row",4,"ngIf"],[1,"message-row","user-row"],[1,"message-bubble","user-message"],[2,"font-size","1.5vw"],[1,"message-time"],["src","assets/staticchat/student.png",1,"avatar"],[1,"message-row","bot-row"],["src","assets/staticchat/teacher.png",1,"avatar"],[1,"message-bubble","bot-message"],["class","mediaRow",4,"ngIf"],[1,"mediaRow"],["class","chip",3,"click",4,"ngIf"],[1,"chip",3,"click"],[1,"typing-indicator"],[1,"dot"],[1,"suggestions-box"],["class","suggestion-item",3,"click",4,"ngFor","ngForOf"],[1,"suggestion-item",3,"click"],[1,"actions"],[1,"reject",3,"click"],[1,"accept",3,"click"]],template:function(i,r){if(i&1){let o=H();d(0,"div",3)(1,"div",4)(2,"button",5),I("click",function(){return T(o),A(r.showPreviousPair())}),u(3,"\u2191"),l(),d(4,"div",6,0),R(6,Kk,3,3,"div",7)(7,Xk,4,0,"div",8),l(),d(8,"button",9),I("click",function(){return T(o),A(r.showNextPair())}),u(9,"\u2193"),l(),R(10,eP,2,1,"div",10),d(11,"form",11),I("ngSubmit",function(){return T(o),A(r.sendMessage())}),d(12,"input",12,1),I("focus",function(){return T(o),A(r.onInputFocus())})("input",function(){return T(o),A(r.onInputChange())}),l(),d(14,"button",13),I("click",function(){return T(o),A(r.toggleMic())}),u(15," \u{1F3A4} "),l(),R(16,tP,5,0,"div",14),d(17,"button",15),u(18," \u27A4 "),l()()(),d(19,"div",16),g(20,"video",17,2),d(22,"img",18),I("click",function(){return T(o),A(r.togglePlayPause())}),l()()()}i&2&&(m(6),y("ngForOf",r.pairedMessages),m(),y("ngIf",r.isTyping),m(3),y("ngIf",r.showSuggestions&&r.suggestedQuestions.length>0),m(),y("formGroup",r.chatForm),m(),y("placeholder",r.isListening?"\u23FA Listening...":"Type your message...")("readonly",r.isSpeechProcessing||r.isListening),m(2),y("disabled",!r.supported||r.isListening),m(2),y("ngIf",r.showActions),m(),y("disabled",!r.chatForm.valid),m(5),y("src",r.currentVideoType!=="blink"&&r.isVideoPlaying?"assets/staticchat/pause.png":"assets/staticchat/play.png",ee))},dependencies:[br,vt,Zc,Jn,Er,Wc,Bo,Uo,Ev],styles:[".chat-container[_ngcontent-%COMP%], .chat-container[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,sans-serif!important}.chat-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:91vh;padding:2vw;gap:2vw}.chat-window[_ngcontent-%COMP%]{width:100%;max-width:1000px;height:80vh;display:flex;flex-direction:column;border-radius:20px;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);background:#ffffff14;box-shadow:0 10px 40px #0006;overflow:hidden}.chat-messages[_ngcontent-%COMP%]{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:7vw}.message-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:10px}.avatar[_ngcontent-%COMP%]{width:38px;height:38px;border-radius:50%;object-fit:cover;box-shadow:0 2px 6px #0000004d}.message-bubble[_ngcontent-%COMP%]{max-width:60%;padding:14px 18px 8px;border-radius:18px;font-size:clamp(14px,1vw,18px);line-height:1.6;display:flex;flex-direction:column}.user-message[_ngcontent-%COMP%]{background:linear-gradient(135deg,#09f,#06f);color:#fff;border-bottom-right-radius:6px}.bot-message[_ngcontent-%COMP%]{background:#fffffff2;color:#333;border-bottom-left-radius:6px}.message-time[_ngcontent-%COMP%]{font-size:clamp(10px,.7vw,12px);opacity:.6;margin-top:6px;align-self:flex-end}.typing-indicator[_ngcontent-%COMP%]{display:flex;gap:5px;align-items:center;color:#fff;padding-left:50px}.dot[_ngcontent-%COMP%]{width:6px;height:6px;background:#ccc;border-radius:50%;animation:_ngcontent-%COMP%_blink 1.4s infinite both}.dot[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.dot[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_blink{0%{opacity:.2}20%{opacity:1}to{opacity:.2}}.suggestions-box[_ngcontent-%COMP%]{background:linear-gradient(135deg,#0072ff,#00c6ff);max-height:250px;overflow-y:auto;border-radius:12px;margin:0 20px 10px;width:47vw}.suggestion-item[_ngcontent-%COMP%]{padding:10px 14px;cursor:pointer;color:#fff;font-size:1vw;font-weight:700;border-bottom:1px solid rgba(255,255,255,.1);transition:background .2s ease}.suggestion-item[_ngcontent-%COMP%]:hover{background:#ffffff26}.chat-input[_ngcontent-%COMP%]{display:flex;padding:16px;background:#ffffff26;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-top:1px solid rgba(255,255,255,.2)}.chat-input[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;padding:12px 16px;border-radius:25px;border:none;outline:none;font-size:14px}.chat-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:10px;width:48px;height:48px;border-radius:50%;border:none;background:linear-gradient(135deg,#00c6ff,#0072ff);color:#fff;font-size:30px;cursor:pointer;transition:transform .2s ease}.chat-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{transform:scale(1.08)}.chat-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.chat-messages[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.chat-messages[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#ffffff4d;border-radius:10px}.video-window[_ngcontent-%COMP%]{width:100%;max-width:640px;height:80vh;margin-left:20px;border-radius:20px;overflow:hidden;background:#ffffff0d;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);box-shadow:0 10px 30px #0006;display:flex;flex-direction:column;align-items:center;gap:2vw}.video-window[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{width:100%;height:100%;flex:1;object-fit:cover;background:#000}.play-pause-btn[_ngcontent-%COMP%]{position:relative;top:-1vw;width:4vw;min-width:40px;height:4vw;min-height:40px;cursor:pointer;border:2px solid #3f61ad;border-radius:50px;box-shadow:0 8px 20px #3f61ad2e,0 2px 6px #00000040;transition:transform .16s ease,box-shadow .16s ease;background:linear-gradient(180deg,#ffffff05,#00000008)}.play-pause-btn[_ngcontent-%COMP%]:hover{transform:translateY(-3px);box-shadow:0 16px 36px #3f61ad38,0 6px 12px #00000047}.play-pause-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 6px 12px #00000038}.bot-answer[_ngcontent-%COMP%]{font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,sans-serif!important;font-size:clamp(14px,1vw,18px);line-height:1.6}.micBtn[_ngcontent-%COMP%]{width:44px;height:44px;border:0;border-radius:999px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;background:#f3f4f6;font-size:30px!important}.micBtn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.micBtn.active[_ngcontent-%COMP%]{background:#111827}.micIcon[_ngcontent-%COMP%]{width:22px;height:22px;fill:#111827}.micBtn.active[_ngcontent-%COMP%] .micIcon[_ngcontent-%COMP%]{fill:#fff}.actions[_ngcontent-%COMP%]{display:inline-flex;gap:8px;margin-left:8px;align-items:center}.okBtn[_ngcontent-%COMP%], .noBtn[_ngcontent-%COMP%]{font-size:18px;width:38px;height:38px;border-radius:999px;border:0;cursor:pointer;background:#f3f4f6}.okBtn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.okBtn[_ngcontent-%COMP%]:hover, .noBtn[_ngcontent-%COMP%]:hover{background:#e5e7eb}.mediaRow[_ngcontent-%COMP%]{display:flex;gap:1vw;font-size:1vw;padding-top:2vw}.chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;min-width:48px;height:clamp(30px,2vw,36px);padding:0 12px;background:linear-gradient(135deg,#00c6ff,#0072ff);color:#fff;font-weight:600;font-size:.9rem;border:none;border-radius:999px;box-shadow:0 6px 20px #0072ff2e,0 2px 6px #00000040;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease,opacity .15s ease;-webkit-user-select:none;user-select:none}.chip[_ngcontent-%COMP%]:hover{transform:translateY(-3px);box-shadow:0 14px 30px #0072ff33,0 4px 10px #00000047}.chip[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 6px 14px #00000038;opacity:.98}.chip[_ngcontent-%COMP%]:focus{outline:3px solid rgba(0,114,255,.18);outline-offset:3px}.arrow-btn[_ngcontent-%COMP%]{position:fixed;right:16px;width:51px;height:51px;border-radius:50%;border:none;background:linear-gradient(135deg,#00c6ff,#0072ff);color:#fff;font-size:31px;box-shadow:0 6px 16px #00000040;cursor:pointer;transition:transform .15s ease,box-shadow .2s ease,background .2s ease;z-index:20}.up[_ngcontent-%COMP%]{top:1vw}.down[_ngcontent-%COMP%]{bottom:5vw}.chat-messages[_ngcontent-%COMP%]{overflow-y:auto;scroll-snap-type:y mandatory;-webkit-overflow-scrolling:touch}.pair[_ngcontent-%COMP%]{scroll-snap-align:start;min-height:100%;display:flex;flex-direction:column;justify-content:flex-start;padding:4.5rem 1rem;box-sizing:border-box;gap:2vw}.pair[_ngcontent-%COMP%] + .pair[_ngcontent-%COMP%]{margin-top:8px}.message-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.6rem}.bot-row[_ngcontent-%COMP%]{justify-content:flex-start}.user-row[_ngcontent-%COMP%]{justify-content:flex-end}.avatar[_ngcontent-%COMP%]{width:3.2rem;height:3.2rem;border-radius:50%;object-fit:cover}.message-bubble[_ngcontent-%COMP%]{max-width:70%;padding:.6rem .8rem;border-radius:.6rem;position:relative}.bot-message[_ngcontent-%COMP%]{background:#f1f1f1;color:#111}.user-message[_ngcontent-%COMP%]{color:#fff;background:linear-gradient(135deg,#00c6ff,#0072ff)}.message-time[_ngcontent-%COMP%]{font-size:.7rem;color:#000;margin-top:6px;text-align:right}.typing-indicator[_ngcontent-%COMP%]{display:flex;gap:.4rem;padding:.5rem;align-items:center}.typing-indicator[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background:#bbb;animation:_ngcontent-%COMP%_blink 1.2s infinite}@keyframes _ngcontent-%COMP%_blink{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}"]})}}return e})();var nP=[{path:"",component:op,pathMatch:"full",data:{title:"Home"}},{path:"home",component:op,data:{title:"Home"}},{path:"login",component:tb,data:{title:"Sign In"}},{path:"chat",component:Mf,data:{title:"Chat"}},{path:"chat/:id",component:Mf,data:{title:"Chat"}},{path:"mj-chat",component:rb,data:{title:"MJ-CHAT"}},{path:"**",redirectTo:"",data:{title:"Page Not Found"}}],ob=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=G({type:e})}static{this.\u0275inj=z({imports:[ls.forRoot(nP,{enableTracing:!1,scrollPositionRestoration:"top",anchorScrolling:"enabled"}),ls]})}}return e})();var iP=["switch"],rP=["*"];function oP(e,n){e&1&&(d(0,"div",10),Wa(),d(1,"svg",12),g(2,"path",13),l(),d(3,"svg",14),g(4,"path",15),l()())}var sP=new O("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1})}),aP={provide:Dr,useExisting:cn(()=>sb),multi:!0},Ol=class{constructor(n,t){this.source=n,this.checked=t}},cP=0,sb=(()=>{class e{_createChangeEvent(t){return new Ol(this,t)}get buttonId(){return`${this.id||this._uniqueId}-button`}focus(){this._switchElement.nativeElement.focus()}get checked(){return this._checked}set checked(t){this._checked=t,this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}constructor(t,i,r,o,s,a){this._elementRef=t,this._focusMonitor=i,this._changeDetectorRef=r,this.defaults=s,this._onChange=c=>{},this._onTouched=()=>{},this._validatorOnChange=()=>{},this._checked=!1,this.name=null,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.disabled=!1,this.disableRipple=!1,this.tabIndex=0,this.change=new ne,this.toggleChange=new ne,this.tabIndex=parseInt(o)||0,this.color=s.color||"accent",this._noopAnimations=a==="NoopAnimations",this.id=this._uniqueId=`mat-mdc-slide-toggle-${++cP}`,this.hideIcon=s.hideIcon??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t==="keyboard"||t==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):t||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(t){t.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}validate(t){return this.required&&t.value!==!0?{required:!0}:null}registerOnValidatorChange(t){this._validatorOnChange=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new Ol(this,this.checked)))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static{this.\u0275fac=function(i){return new(i||e)(w(re),w(zr),w(Ve),pr("tabindex"),w(sP),w(wn,8))}}static{this.\u0275cmp=pe({type:e,selectors:[["mat-slide-toggle"]],viewQuery:function(i,r){if(i&1&<(iP,5),i&2){let o;We(o=qe())&&(r._switchElement=o.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,r){i&2&&(vr("id",r.id),le("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),Xu(r.color?"mat-"+r.color:""),he("mat-mdc-slide-toggle-focused",r._focused)("mat-mdc-slide-toggle-checked",r.checked)("_mat-animation-noopable",r._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[$.None,"aria-label","ariaLabel"],ariaLabelledby:[$.None,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[$.None,"aria-describedby","ariaDescribedby"],required:[$.HasDecoratorInputTransform,"required","required",et],color:"color",disabled:[$.HasDecoratorInputTransform,"disabled","disabled",et],disableRipple:[$.HasDecoratorInputTransform,"disableRipple","disableRipple",et],tabIndex:[$.HasDecoratorInputTransform,"tabIndex","tabIndex",t=>t==null?0:ih(t)],checked:[$.HasDecoratorInputTransform,"checked","checked",et],hideIcon:[$.HasDecoratorInputTransform,"hideIcon","hideIcon",et]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],standalone:!0,features:[At([aP,{provide:Vo,useExisting:e,multi:!0}]),zt,Ke,Fe],ngContentSelectors:rP,decls:13,vars:24,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-mdc-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,r){if(i&1){let o=H();Dn(),d(0,"div",1)(1,"button",2,0),I("click",function(){return T(o),A(r._handleClick())}),g(3,"div",3),d(4,"div",4)(5,"div",5)(6,"div",6),g(7,"div",7),l(),d(8,"div",8),g(9,"div",9),l(),R(10,oP,5,0,"div",10),l()()(),d(11,"label",11),I("click",function(a){return T(o),A(a.stopPropagation())}),En(12),l()()}if(i&2){let o=Gt(2);y("labelPosition",r.labelPosition),m(),he("mdc-switch--selected",r.checked)("mdc-switch--unselected",!r.checked)("mdc-switch--checked",r.checked)("mdc-switch--disabled",r.disabled),y("tabIndex",r.disabled?-1:r.tabIndex)("disabled",r.disabled),le("id",r.buttonId)("name",r.name)("aria-label",r.ariaLabel)("aria-labelledby",r._getAriaLabelledBy())("aria-describedby",r.ariaDescribedby)("aria-required",r.required||null)("aria-checked",r.checked),m(8),y("matRippleTrigger",o)("matRippleDisabled",r.disableRipple||r.disabled)("matRippleCentered",!0),m(),Ju(10,r.hideIcon?-1:10),m(),y("for",r.buttonId),le("id",r._labelId)}},dependencies:[Hy,zy],styles:['.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:var(--mdc-elevation-overlay-color)}.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative}.mdc-switch[hidden]{display:none}.mdc-switch:disabled{cursor:default;pointer-events:none}.mdc-switch__track{overflow:hidden;position:relative;width:100%}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%}@media screen and (forced-colors: active){.mdc-switch__track::before,.mdc-switch__track::after{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0)}.mdc-switch__track::after{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(-100%)}[dir=rtl] .mdc-switch__track::after,.mdc-switch__track[dir=rtl]::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track[dir=rtl]::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::after{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0)}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0)}[dir=rtl] .mdc-switch__handle-track,.mdc-switch__handle-track[dir=rtl]{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track,.mdc-switch--selected .mdc-switch__handle-track[dir=rtl]{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto}[dir=rtl] .mdc-switch__handle,.mdc-switch__handle[dir=rtl]{left:auto;right:0}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media screen and (forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-elevation-overlay{bottom:0;left:0;right:0;top:0}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1}.mdc-switch:disabled .mdc-switch__ripple{display:none}.mdc-switch__icons{height:100%;position:relative;width:100%;z-index:1}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mdc-switch-disabled-label-text-color)}.mdc-switch{width:var(--mdc-switch-track-width)}.mdc-switch.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color)}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color)}.mdc-switch.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color)}.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color)}.mdc-switch.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color)}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color)}.mdc-switch.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color)}.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color)}.mdc-switch .mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation)}.mdc-switch:disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation)}.mdc-switch .mdc-switch__focus-ring-wrapper,.mdc-switch .mdc-switch__handle{height:var(--mdc-switch-handle-height)}.mdc-switch .mdc-switch__handle{border-radius:var(--mdc-switch-handle-shape)}.mdc-switch .mdc-switch__handle{width:var(--mdc-switch-handle-width)}.mdc-switch .mdc-switch__handle-track{width:calc(100% - var(--mdc-switch-handle-width))}.mdc-switch.mdc-switch--selected:enabled .mdc-switch__icon{fill:var(--mdc-switch-selected-icon-color)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color)}.mdc-switch.mdc-switch--unselected:enabled .mdc-switch__icon{fill:var(--mdc-switch-unselected-icon-color)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity)}.mdc-switch.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size);height:var(--mdc-switch-selected-icon-size)}.mdc-switch.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size);height:var(--mdc-switch-unselected-icon-size)}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background-color:var(--mdc-switch-selected-hover-state-layer-color)}.mdc-switch.mdc-switch--selected:enabled:focus .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background-color:var(--mdc-switch-selected-focus-state-layer-color)}.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background-color:var(--mdc-switch-selected-pressed-state-layer-color)}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background-color:var(--mdc-switch-unselected-hover-state-layer-color)}.mdc-switch.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background-color:var(--mdc-switch-unselected-focus-state-layer-color)}.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background-color:var(--mdc-switch-unselected-pressed-state-layer-color)}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus):hover .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus).mdc-ripple-surface--hover .mdc-switch__ripple::before{opacity:var(--mdc-switch-selected-hover-state-layer-opacity)}.mdc-switch.mdc-switch--selected:enabled:focus.mdc-ripple-upgraded--background-focused .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:focus:not(.mdc-ripple-upgraded):focus .mdc-switch__ripple::before{transition-duration:75ms;opacity:var(--mdc-switch-selected-focus-state-layer-opacity)}.mdc-switch.mdc-switch--selected:enabled:active:not(.mdc-ripple-upgraded) .mdc-switch__ripple::after{transition:opacity 150ms linear}.mdc-switch.mdc-switch--selected:enabled:active:not(.mdc-ripple-upgraded):active .mdc-switch__ripple::after{transition-duration:75ms;opacity:var(--mdc-switch-selected-pressed-state-layer-opacity)}.mdc-switch.mdc-switch--selected:enabled:active.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-switch-selected-pressed-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus):hover .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus).mdc-ripple-surface--hover .mdc-switch__ripple::before{opacity:var(--mdc-switch-unselected-hover-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:focus.mdc-ripple-upgraded--background-focused .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:focus:not(.mdc-ripple-upgraded):focus .mdc-switch__ripple::before{transition-duration:75ms;opacity:var(--mdc-switch-unselected-focus-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:active:not(.mdc-ripple-upgraded) .mdc-switch__ripple::after{transition:opacity 150ms linear}.mdc-switch.mdc-switch--unselected:enabled:active:not(.mdc-ripple-upgraded):active .mdc-switch__ripple::after{transition-duration:75ms;opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:active.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity)}.mdc-switch .mdc-switch__ripple{height:var(--mdc-switch-state-layer-size);width:var(--mdc-switch-state-layer-size)}.mdc-switch .mdc-switch__track{height:var(--mdc-switch-track-height)}.mdc-switch:disabled .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity)}.mdc-switch:enabled .mdc-switch__track::after{background:var(--mdc-switch-selected-track-color)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color)}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color)}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color)}.mdc-switch:disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color)}.mdc-switch:enabled .mdc-switch__track::before{background:var(--mdc-switch-unselected-track-color)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color)}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color)}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color)}.mdc-switch:disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color)}.mdc-switch .mdc-switch__track{border-radius:var(--mdc-switch-track-shape)}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mdc-switch:disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mat-mdc-slide-toggle{display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle .mdc-switch__ripple::after{content:"";opacity:0}.mat-mdc-slide-toggle .mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:opacity 75ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-mdc-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-mdc-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-elevation-overlay,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mdc-switch__handle{transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-switch-hidden-track-opacity);transition:var(--mat-switch-hidden-track-transition)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-switch-visible-track-opacity);transition:var(--mat-switch-visible-track-transition)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-switch-visible-track-opacity);transition:var(--mat-switch-visible-track-transition)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-switch-hidden-track-opacity);transition:var(--mat-switch-hidden-track-transition)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-switch-unselected-handle-size);height:var(--mat-switch-unselected-handle-size)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-switch-selected-handle-size);height:var(--mat-switch-selected-handle-size)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-switch-with-icon-handle-size);height:var(--mat-switch-with-icon-handle-size)}.mat-mdc-slide-toggle:active .mdc-switch:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-switch-pressed-handle-size);height:var(--mat-switch-pressed-handle-size)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{margin:var(--mat-switch-selected-handle-horizontal-margin)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-selected-with-icon-handle-horizontal-margin)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{margin:var(--mat-switch-unselected-handle-horizontal-margin)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-unselected-with-icon-handle-horizontal-margin)}.mat-mdc-slide-toggle:active .mdc-switch--selected:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-selected-pressed-handle-horizontal-margin)}.mat-mdc-slide-toggle:active .mdc-switch--unselected:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-unselected-pressed-handle-horizontal-margin)}.mdc-switch__track::after,.mdc-switch__track::before{border-width:var(--mat-switch-track-outline-width);border-color:var(--mat-switch-track-outline-color)}.mdc-switch--selected .mdc-switch__track::after,.mdc-switch--selected .mdc-switch__track::before{border-width:var(--mat-switch-selected-track-outline-width)}.mdc-switch--disabled .mdc-switch__track::after,.mdc-switch--disabled .mdc-switch__track::before{border-width:var(--mat-switch-disabled-unselected-track-outline-width);border-color:var(--mat-switch-disabled-unselected-track-outline-color)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-selected-handle-opacity)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-unselected-handle-opacity)}'],encapsulation:2,changeDetection:0})}}return e})();var ab=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=G({type:e})}static{this.\u0275inj=z({imports:[sb,Rt,Rt]})}}return e})();var cb=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=G({type:e})}static{this.\u0275inj=z({imports:[Rt,Rt]})}}return e})();var lb=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=G({type:e})}static{this.\u0275inj=z({imports:[Rt,_t,Rt]})}}return e})();var db=(()=>{class e{constructor(t,i,r,o){this.authService=t,this.brandService=i,this.titleService=r,this.document=o,this.title="Py-Learn"}ngOnInit(){this.titleService.setTitle(this.brandService.name);let t=this.document.querySelector("link[rel*='icon']");t&&(t.href=this.brandService.name==="Py-Learn"?"assets/favicon.png":"assets/majema-favicon.png"),this.authService.checkSession().subscribe(i=>{i&&this.authService.startAutoRefresh()})}static{this.\u0275fac=function(i){return new(i||e)(w(Gr),w(pn),w(Vc),w(W))}}static{this.\u0275cmp=pe({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(i,r){i&1&&g(0,"router-outlet")},dependencies:[wf],styles:["nav[_ngcontent-%COMP%]{margin:20px}button[_ngcontent-%COMP%]{margin-right:10px;padding:10px 20px;font-size:16px;cursor:pointer}"]})}}return e})();var ub=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=G({type:e,bootstrap:[db]})}static{this.\u0275inj=z({imports:[qv,ob,Ir,Xc,Vv,_t,Zy,ab,cb,lb,Tl,_l]})}}return e})();Wv().bootstrapModule(ub).catch(e=>console.error(e));
|
|
|
|
| 17 |
<span class="media-icon"
|
| 18 |
onclick="window.dispatchEvent(new CustomEvent('playVideo', { detail: '${t.video_url}' }))">
|
| 19 |
\u{1F4FA}
|
| 20 |
+
</span>`),i+="</div>"),i}formatErrorMessage(t){let i=t.message||"I couldn't find an exact match.";return t.sample_questions?.length&&(i+="<br><br><strong>Try asking:</strong><ul>",t.sample_questions.forEach(r=>i+=`<li>${r}</li>`),i+="</ul>"),i}get pairedMessages(){let t=[],i=this.messages||[],r=0;for(;r<i.length;){let o=i[r];if(o.sender==="user"){let s={user:o},a=i[r+1];a&&a.sender==="bot"?(s.bot=a,r+=2):r+=1,t.push(s)}else o.sender==="bot"?(t.push({bot:o}),r+=1):(t.push({bot:o}),r+=1)}return t}showNextPair(){let t=this.pairedMessages.length;if(t===0)return;let i=Math.min(this.currentPairIndex+1,t-1);this.scrollToPair(i)}showPreviousPair(){if(this.pairedMessages.length===0)return;let i=Math.max(this.currentPairIndex-1,0);this.scrollToPair(i)}scrollToPair(t){setTimeout(()=>{try{let i=this.chatContainer.nativeElement,r=i.querySelectorAll(".pair");if(!r||r.length===0)return;t<0&&(t=0),t>=r.length&&(t=r.length-1);let o=r[t];if(!o)return;i.scrollTo({top:o.offsetTop,behavior:"smooth"}),this.currentPairIndex=t}catch{try{let r=this.chatContainer.nativeElement;t===0?r.scrollTop=0:r.scrollTop=r.scrollHeight}catch{}}},50)}scrollToLastPair(){setTimeout(()=>{try{let t=this.pairedMessages.length;if(t===0)return;this.scrollToPair(t-1)}catch{}},50)}scrollToTop(){setTimeout(()=>{try{let t=this.chatContainer.nativeElement;typeof t.scrollTo=="function"?t.scrollTo({top:0,behavior:"smooth"}):t.scrollTop=0}catch{}},100)}clearChat(){this.messages=[],this.selectedQuestions.clear(),this.hasChatStarted=!1,this.lastResponseVideoUrl=null,this.ngOnInit(),this.playBlinkVideo()}pickMimeType(){let t=window,i=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/m4a"];if(!t.MediaRecorder?.isTypeSupported)return"";for(let r of i)if(t.MediaRecorder.isTypeSupported(r))return r;return""}toggleMic(){return tt(this,null,function*(){if(!(!this.supported||this.isListening||this.uploadInProgress))try{this.mediaStream=yield navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}});let t=this.pickMimeType();this.chunks=[],this.recorder=t?new MediaRecorder(this.mediaStream,{mimeType:t}):new MediaRecorder(this.mediaStream),this.recorder.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},this.recorder.onerror=()=>{this.zone.run(()=>{this.handleTranscriptionError("Audio recording error."),this.cleanupRecorder()})},this.zone.run(()=>{this.isListening=!0,this.showActions=!0}),this.recorder.start()}catch{this.zone.run(()=>{this.handleTranscriptionError("Microphone permission denied or not available."),this.cleanupRecorder()})}})}accept(){if(!(!this.recorder||this.uploadInProgress)){this.uploadInProgress=!0,this.recorder.onstop=()=>tt(this,null,function*(){try{let t=this.recorder?.mimeType||"audio/webm",i=new Blob(this.chunks,{type:t});this.zone.run(()=>{this.isSpeechProcessing=!0,this.showActions=!1,this.isListening=!1,this.chatForm.get("message")?.setValue("\u23F3 Converting speech to text...")});let r=yield this.sendToBackendForTranscription(i);this.zone.run(()=>{this.isSpeechProcessing=!1,r&&r.trim()?this.handleTranscriptionAccepted(r.trim()):this.chatForm.get("message")?.setValue("")})}catch(t){this.zone.run(()=>{this.handleTranscriptionError(typeof t?.message=="string"?t.message:"Transcription failed."),this.showActions=!1,this.isListening=!1})}finally{this.uploadInProgress=!1,this.cleanupRecorder()}});try{this.recorder.stop()}catch{this.uploadInProgress=!1,this.cleanupRecorder()}}}reject(){if(!this.uploadInProgress){try{this.recorder?.stop()}catch{}this.zone.run(()=>{this.handleTranscriptionRejected(),this.showActions=!1,this.isListening=!1}),this.cleanupRecorder()}}sendToBackendForTranscription(t){return tt(this,null,function*(){let i=location.hostname.endsWith("hf.space")?"https://pykara-py-learn-backend.hf.space/staticchat/transcribe":"http://localhost:5000/staticchat/transcribe",r=new FormData;r.append("file",t,"speech.webm");let o=yield fetch(i,{method:"POST",body:r});if(!o.ok){let a=yield o.text().catch(()=>"");throw new Error(a||`Transcribe API failed (${o.status}).`)}return((yield o.json())?.text||"").toString()})}cleanupRecorder(){try{this.recorder?.removeEventListener?.("dataavailable",()=>{})}catch{}if(this.recorder=null,this.chunks=[],this.mediaStream){try{this.mediaStream.getTracks().forEach(t=>t.stop())}catch{}this.mediaStream=null}}handleClickOutside(t){this.showSuggestions&&this.messageInput&&(this.messageInput.nativeElement.contains(t.target)||(this.showSuggestions=!1))}handleTranscriptionAccepted(t){try{this.chatForm.get("message")?.setValue(t),setTimeout(()=>{this.messageInput?.nativeElement.focus()},0)}catch(i){console.error("handleTranscriptionAccepted error",i)}}handleTranscriptionRejected(){try{this.chatForm.get("message")?.setValue("")}catch(t){console.error("handleTranscriptionRejected error",t)}}handleTranscriptionError(t){try{this.isSpeechProcessing=!1,this.chatForm.get("message")?.setValue(""),this.messages.push({id:this.messages.length+1,text:`Transcription error: ${t}`,sender:"bot",timestamp:new Date}),setTimeout(()=>this.scrollToLastPair(),50)}catch(i){console.error("handleTranscriptionError error",i)}}static{this.\u0275fac=function(i){return new(i||e)(w(Kc),w(ib),w(Je),w(F))}}static{this.\u0275cmp=pe({type:e,selectors:[["app-staticchat"]],viewQuery:function(i,r){if(i&1&&(lt(Bk,5),lt(Uk,5),lt($k,5)),i&2){let o;We(o=qe())&&(r.chatContainer=o.first),We(o=qe())&&(r.messageInput=o.first),We(o=qe())&&(r.videoRef=o.first)}},hostBindings:function(i,r){i&1&&I("click",function(s){return r.handleClickOutside(s)},!1,Xa)},decls:23,vars:10,consts:[["chatContainer",""],["messageInput",""],["videoPlayer",""],[1,"chat-container"],[1,"chat-window"],["title","Prev message",1,"arrow-btn","up",3,"click"],[1,"chat-messages"],["class","pair",4,"ngFor","ngForOf"],["class","typing-indicator",4,"ngIf"],["title","Next message",1,"arrow-btn","down",3,"click"],["class","suggestions-box",4,"ngIf"],[1,"chat-input",3,"ngSubmit","formGroup"],["type","text","formControlName","message",3,"focus","input","placeholder","readonly"],["type","button",1,"micBtn",3,"click","disabled"],["class","actions",4,"ngIf"],["type","submit",3,"disabled"],[1,"video-window"],["autoplay","","muted","","playsinline",""],[1,"play-pause-btn",3,"click","src"],[1,"pair"],["class","message-row user-row",4,"ngIf"],["class","message-row bot-row",4,"ngIf"],[1,"message-row","user-row"],[1,"message-bubble","user-message"],[2,"font-size","1.5vw"],[1,"message-time"],["src","assets/staticchat/student.png",1,"avatar"],[1,"message-row","bot-row"],["src","assets/staticchat/teacher.png",1,"avatar"],[1,"message-bubble","bot-message"],["class","mediaRow",4,"ngIf"],[1,"mediaRow"],["class","chip",3,"click",4,"ngIf"],[1,"chip",3,"click"],[1,"typing-indicator"],[1,"dot"],[1,"suggestions-box"],["class","suggestion-item",3,"click",4,"ngFor","ngForOf"],[1,"suggestion-item",3,"click"],[1,"actions"],[1,"reject",3,"click"],[1,"accept",3,"click"]],template:function(i,r){if(i&1){let o=H();d(0,"div",3)(1,"div",4)(2,"button",5),I("click",function(){return T(o),A(r.showPreviousPair())}),u(3,"\u2191"),l(),d(4,"div",6,0),R(6,Kk,3,3,"div",7)(7,Xk,4,0,"div",8),l(),d(8,"button",9),I("click",function(){return T(o),A(r.showNextPair())}),u(9,"\u2193"),l(),R(10,eP,2,1,"div",10),d(11,"form",11),I("ngSubmit",function(){return T(o),A(r.sendMessage())}),d(12,"input",12,1),I("focus",function(){return T(o),A(r.onInputFocus())})("input",function(){return T(o),A(r.onInputChange())}),l(),d(14,"button",13),I("click",function(){return T(o),A(r.toggleMic())}),u(15," \u{1F3A4} "),l(),R(16,tP,5,0,"div",14),d(17,"button",15),u(18," \u27A4 "),l()()(),d(19,"div",16),g(20,"video",17,2),d(22,"img",18),I("click",function(){return T(o),A(r.togglePlayPause())}),l()()()}i&2&&(m(6),y("ngForOf",r.pairedMessages),m(),y("ngIf",r.isTyping),m(3),y("ngIf",r.showSuggestions&&r.suggestedQuestions.length>0),m(),y("formGroup",r.chatForm),m(),y("placeholder",r.isListening?"\u23FA Listening...":"Type your message...")("readonly",r.isSpeechProcessing||r.isListening),m(2),y("disabled",!r.supported||r.isListening),m(2),y("ngIf",r.showActions),m(),y("disabled",!r.chatForm.valid),m(5),y("src",r.currentVideoType!=="blink"&&r.isVideoPlaying?"assets/staticchat/pause.png":"assets/staticchat/play.png",ee))},dependencies:[br,vt,Zc,Jn,Er,Wc,Bo,Uo,Ev],styles:[".chat-container[_ngcontent-%COMP%], .chat-container[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,sans-serif!important}.chat-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:91vh;padding:2vw;gap:2vw}.chat-window[_ngcontent-%COMP%]{width:100%;max-width:1000px;height:80vh;display:flex;flex-direction:column;border-radius:20px;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);background:#ffffff14;box-shadow:0 10px 40px #0006;overflow:hidden}.chat-messages[_ngcontent-%COMP%]{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:7vw}.message-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:10px}.avatar[_ngcontent-%COMP%]{width:38px;height:38px;border-radius:50%;object-fit:cover;box-shadow:0 2px 6px #0000004d}.message-bubble[_ngcontent-%COMP%]{max-width:60%;padding:14px 18px 8px;border-radius:18px;font-size:clamp(14px,1vw,18px);line-height:1.6;display:flex;flex-direction:column}.user-message[_ngcontent-%COMP%]{background:linear-gradient(135deg,#09f,#06f);color:#fff;border-bottom-right-radius:6px}.bot-message[_ngcontent-%COMP%]{background:#fffffff2;color:#333;border-bottom-left-radius:6px}.message-time[_ngcontent-%COMP%]{font-size:clamp(10px,.7vw,12px);opacity:.6;margin-top:6px;align-self:flex-end}.typing-indicator[_ngcontent-%COMP%]{display:flex;gap:5px;align-items:center;color:#fff;padding-left:50px}.dot[_ngcontent-%COMP%]{width:6px;height:6px;background:#ccc;border-radius:50%;animation:_ngcontent-%COMP%_blink 1.4s infinite both}.dot[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.dot[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_blink{0%{opacity:.2}20%{opacity:1}to{opacity:.2}}.suggestions-box[_ngcontent-%COMP%]{background:linear-gradient(135deg,#0072ff,#00c6ff);max-height:250px;overflow-y:auto;border-radius:12px;margin:0 20px 10px;width:47vw}.suggestion-item[_ngcontent-%COMP%]{padding:10px 14px;cursor:pointer;color:#fff;font-size:1vw;font-weight:700;border-bottom:1px solid rgba(255,255,255,.1);transition:background .2s ease}.suggestion-item[_ngcontent-%COMP%]:hover{background:#ffffff26}.chat-input[_ngcontent-%COMP%]{display:flex;padding:16px;background:#ffffff26;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-top:1px solid rgba(255,255,255,.2)}.chat-input[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;padding:12px 16px;border-radius:25px;border:none;outline:none;font-size:14px}.chat-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:10px;width:48px;height:48px;border-radius:50%;border:none;background:linear-gradient(135deg,#00c6ff,#0072ff);color:#fff;font-size:30px;cursor:pointer;transition:transform .2s ease}.chat-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{transform:scale(1.08)}.chat-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.chat-messages[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.chat-messages[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#ffffff4d;border-radius:10px}.video-window[_ngcontent-%COMP%]{width:100%;max-width:640px;height:80vh;margin-left:20px;border-radius:20px;overflow:hidden;background:#ffffff0d;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);box-shadow:0 10px 30px #0006;display:flex;flex-direction:column;align-items:center;gap:2vw}.video-window[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{width:100%;height:100%;flex:1;object-fit:cover;background:#000}.play-pause-btn[_ngcontent-%COMP%]{position:relative;top:-1vw;width:4vw;min-width:40px;height:4vw;min-height:40px;cursor:pointer;border:2px solid #3f61ad;border-radius:50px;box-shadow:0 8px 20px #3f61ad2e,0 2px 6px #00000040;transition:transform .16s ease,box-shadow .16s ease;background:linear-gradient(180deg,#ffffff05,#00000008)}.play-pause-btn[_ngcontent-%COMP%]:hover{transform:translateY(-3px);box-shadow:0 16px 36px #3f61ad38,0 6px 12px #00000047}.play-pause-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 6px 12px #00000038}.bot-answer[_ngcontent-%COMP%]{font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,sans-serif!important;font-size:clamp(14px,1vw,18px);line-height:1.6}.micBtn[_ngcontent-%COMP%]{width:44px;height:44px;border:0;border-radius:999px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;background:#f3f4f6;font-size:30px!important}.micBtn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.micBtn.active[_ngcontent-%COMP%]{background:#111827}.micIcon[_ngcontent-%COMP%]{width:22px;height:22px;fill:#111827}.micBtn.active[_ngcontent-%COMP%] .micIcon[_ngcontent-%COMP%]{fill:#fff}.actions[_ngcontent-%COMP%]{display:inline-flex;gap:8px;margin-left:8px;align-items:center}.okBtn[_ngcontent-%COMP%], .noBtn[_ngcontent-%COMP%]{font-size:18px;width:38px;height:38px;border-radius:999px;border:0;cursor:pointer;background:#f3f4f6}.okBtn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.okBtn[_ngcontent-%COMP%]:hover, .noBtn[_ngcontent-%COMP%]:hover{background:#e5e7eb}.mediaRow[_ngcontent-%COMP%]{display:flex;gap:1vw;font-size:1vw;padding-top:2vw}.chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;min-width:48px;height:clamp(30px,2vw,36px);padding:0 12px;background:linear-gradient(135deg,#00c6ff,#0072ff);color:#fff;font-weight:600;font-size:.9rem;border:none;border-radius:999px;box-shadow:0 6px 20px #0072ff2e,0 2px 6px #00000040;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease,opacity .15s ease;-webkit-user-select:none;user-select:none}.chip[_ngcontent-%COMP%]:hover{transform:translateY(-3px);box-shadow:0 14px 30px #0072ff33,0 4px 10px #00000047}.chip[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 6px 14px #00000038;opacity:.98}.chip[_ngcontent-%COMP%]:focus{outline:3px solid rgba(0,114,255,.18);outline-offset:3px}.arrow-btn[_ngcontent-%COMP%]{position:fixed;right:16px;width:51px;height:51px;border-radius:50%;border:none;background:linear-gradient(135deg,#00c6ff,#0072ff);color:#fff;font-size:31px;box-shadow:0 6px 16px #00000040;cursor:pointer;transition:transform .15s ease,box-shadow .2s ease,background .2s ease;z-index:20}.up[_ngcontent-%COMP%]{top:1vw}.down[_ngcontent-%COMP%]{bottom:5vw}.chat-messages[_ngcontent-%COMP%]{overflow-y:auto;scroll-snap-type:y mandatory;-webkit-overflow-scrolling:touch}.pair[_ngcontent-%COMP%]{scroll-snap-align:start;min-height:100%;display:flex;flex-direction:column;justify-content:flex-start;padding:4.5rem 1rem;box-sizing:border-box;gap:2vw}.pair[_ngcontent-%COMP%] + .pair[_ngcontent-%COMP%]{margin-top:8px}.message-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.6rem}.bot-row[_ngcontent-%COMP%]{justify-content:flex-start}.user-row[_ngcontent-%COMP%]{justify-content:flex-end}.avatar[_ngcontent-%COMP%]{width:3.2rem;height:3.2rem;border-radius:50%;object-fit:cover}.message-bubble[_ngcontent-%COMP%]{max-width:70%;padding:.6rem .8rem;border-radius:.6rem;position:relative}.bot-message[_ngcontent-%COMP%]{background:#f1f1f1;color:#111}.user-message[_ngcontent-%COMP%]{color:#fff;background:linear-gradient(135deg,#00c6ff,#0072ff)}.message-time[_ngcontent-%COMP%]{font-size:.7rem;color:#000;margin-top:6px;text-align:right}.typing-indicator[_ngcontent-%COMP%]{display:flex;gap:.4rem;padding:.5rem;align-items:center}.typing-indicator[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background:#bbb;animation:_ngcontent-%COMP%_blink 1.2s infinite}@keyframes _ngcontent-%COMP%_blink{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}"]})}}return e})();var nP=[{path:"",component:op,pathMatch:"full",data:{title:"Home"}},{path:"home",component:op,data:{title:"Home"}},{path:"login",component:tb,data:{title:"Sign In"}},{path:"chat",component:Mf,data:{title:"Chat"}},{path:"chat/:id",component:Mf,data:{title:"Chat"}},{path:"mj-chat",component:rb,data:{title:"MJ-CHAT"}},{path:"**",redirectTo:"",data:{title:"Page Not Found"}}],ob=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=G({type:e})}static{this.\u0275inj=z({imports:[ls.forRoot(nP,{enableTracing:!1,scrollPositionRestoration:"top",anchorScrolling:"enabled"}),ls]})}}return e})();var iP=["switch"],rP=["*"];function oP(e,n){e&1&&(d(0,"div",10),Wa(),d(1,"svg",12),g(2,"path",13),l(),d(3,"svg",14),g(4,"path",15),l()())}var sP=new O("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1})}),aP={provide:Dr,useExisting:cn(()=>sb),multi:!0},Ol=class{constructor(n,t){this.source=n,this.checked=t}},cP=0,sb=(()=>{class e{_createChangeEvent(t){return new Ol(this,t)}get buttonId(){return`${this.id||this._uniqueId}-button`}focus(){this._switchElement.nativeElement.focus()}get checked(){return this._checked}set checked(t){this._checked=t,this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}constructor(t,i,r,o,s,a){this._elementRef=t,this._focusMonitor=i,this._changeDetectorRef=r,this.defaults=s,this._onChange=c=>{},this._onTouched=()=>{},this._validatorOnChange=()=>{},this._checked=!1,this.name=null,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.disabled=!1,this.disableRipple=!1,this.tabIndex=0,this.change=new ne,this.toggleChange=new ne,this.tabIndex=parseInt(o)||0,this.color=s.color||"accent",this._noopAnimations=a==="NoopAnimations",this.id=this._uniqueId=`mat-mdc-slide-toggle-${++cP}`,this.hideIcon=s.hideIcon??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t==="keyboard"||t==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):t||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(t){t.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}validate(t){return this.required&&t.value!==!0?{required:!0}:null}registerOnValidatorChange(t){this._validatorOnChange=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new Ol(this,this.checked)))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static{this.\u0275fac=function(i){return new(i||e)(w(re),w(zr),w(Ve),pr("tabindex"),w(sP),w(wn,8))}}static{this.\u0275cmp=pe({type:e,selectors:[["mat-slide-toggle"]],viewQuery:function(i,r){if(i&1&<(iP,5),i&2){let o;We(o=qe())&&(r._switchElement=o.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,r){i&2&&(vr("id",r.id),le("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),Xu(r.color?"mat-"+r.color:""),he("mat-mdc-slide-toggle-focused",r._focused)("mat-mdc-slide-toggle-checked",r.checked)("_mat-animation-noopable",r._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[$.None,"aria-label","ariaLabel"],ariaLabelledby:[$.None,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[$.None,"aria-describedby","ariaDescribedby"],required:[$.HasDecoratorInputTransform,"required","required",et],color:"color",disabled:[$.HasDecoratorInputTransform,"disabled","disabled",et],disableRipple:[$.HasDecoratorInputTransform,"disableRipple","disableRipple",et],tabIndex:[$.HasDecoratorInputTransform,"tabIndex","tabIndex",t=>t==null?0:ih(t)],checked:[$.HasDecoratorInputTransform,"checked","checked",et],hideIcon:[$.HasDecoratorInputTransform,"hideIcon","hideIcon",et]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],standalone:!0,features:[At([aP,{provide:Vo,useExisting:e,multi:!0}]),zt,Ke,Fe],ngContentSelectors:rP,decls:13,vars:24,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-mdc-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,r){if(i&1){let o=H();Dn(),d(0,"div",1)(1,"button",2,0),I("click",function(){return T(o),A(r._handleClick())}),g(3,"div",3),d(4,"div",4)(5,"div",5)(6,"div",6),g(7,"div",7),l(),d(8,"div",8),g(9,"div",9),l(),R(10,oP,5,0,"div",10),l()()(),d(11,"label",11),I("click",function(a){return T(o),A(a.stopPropagation())}),En(12),l()()}if(i&2){let o=Gt(2);y("labelPosition",r.labelPosition),m(),he("mdc-switch--selected",r.checked)("mdc-switch--unselected",!r.checked)("mdc-switch--checked",r.checked)("mdc-switch--disabled",r.disabled),y("tabIndex",r.disabled?-1:r.tabIndex)("disabled",r.disabled),le("id",r.buttonId)("name",r.name)("aria-label",r.ariaLabel)("aria-labelledby",r._getAriaLabelledBy())("aria-describedby",r.ariaDescribedby)("aria-required",r.required||null)("aria-checked",r.checked),m(8),y("matRippleTrigger",o)("matRippleDisabled",r.disableRipple||r.disabled)("matRippleCentered",!0),m(),Ju(10,r.hideIcon?-1:10),m(),y("for",r.buttonId),le("id",r._labelId)}},dependencies:[Hy,zy],styles:['.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:var(--mdc-elevation-overlay-color)}.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative}.mdc-switch[hidden]{display:none}.mdc-switch:disabled{cursor:default;pointer-events:none}.mdc-switch__track{overflow:hidden;position:relative;width:100%}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%}@media screen and (forced-colors: active){.mdc-switch__track::before,.mdc-switch__track::after{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0)}.mdc-switch__track::after{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(-100%)}[dir=rtl] .mdc-switch__track::after,.mdc-switch__track[dir=rtl]::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track[dir=rtl]::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::after{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0)}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0)}[dir=rtl] .mdc-switch__handle-track,.mdc-switch__handle-track[dir=rtl]{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track,.mdc-switch--selected .mdc-switch__handle-track[dir=rtl]{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto}[dir=rtl] .mdc-switch__handle,.mdc-switch__handle[dir=rtl]{left:auto;right:0}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media screen and (forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-elevation-overlay{bottom:0;left:0;right:0;top:0}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1}.mdc-switch:disabled .mdc-switch__ripple{display:none}.mdc-switch__icons{height:100%;position:relative;width:100%;z-index:1}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mdc-switch-disabled-label-text-color)}.mdc-switch{width:var(--mdc-switch-track-width)}.mdc-switch.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color)}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color)}.mdc-switch.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color)}.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color)}.mdc-switch.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color)}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color)}.mdc-switch.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color)}.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color)}.mdc-switch .mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation)}.mdc-switch:disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation)}.mdc-switch .mdc-switch__focus-ring-wrapper,.mdc-switch .mdc-switch__handle{height:var(--mdc-switch-handle-height)}.mdc-switch .mdc-switch__handle{border-radius:var(--mdc-switch-handle-shape)}.mdc-switch .mdc-switch__handle{width:var(--mdc-switch-handle-width)}.mdc-switch .mdc-switch__handle-track{width:calc(100% - var(--mdc-switch-handle-width))}.mdc-switch.mdc-switch--selected:enabled .mdc-switch__icon{fill:var(--mdc-switch-selected-icon-color)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color)}.mdc-switch.mdc-switch--unselected:enabled .mdc-switch__icon{fill:var(--mdc-switch-unselected-icon-color)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity)}.mdc-switch.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size);height:var(--mdc-switch-selected-icon-size)}.mdc-switch.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size);height:var(--mdc-switch-unselected-icon-size)}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background-color:var(--mdc-switch-selected-hover-state-layer-color)}.mdc-switch.mdc-switch--selected:enabled:focus .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background-color:var(--mdc-switch-selected-focus-state-layer-color)}.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background-color:var(--mdc-switch-selected-pressed-state-layer-color)}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background-color:var(--mdc-switch-unselected-hover-state-layer-color)}.mdc-switch.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background-color:var(--mdc-switch-unselected-focus-state-layer-color)}.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background-color:var(--mdc-switch-unselected-pressed-state-layer-color)}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus):hover .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus).mdc-ripple-surface--hover .mdc-switch__ripple::before{opacity:var(--mdc-switch-selected-hover-state-layer-opacity)}.mdc-switch.mdc-switch--selected:enabled:focus.mdc-ripple-upgraded--background-focused .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:focus:not(.mdc-ripple-upgraded):focus .mdc-switch__ripple::before{transition-duration:75ms;opacity:var(--mdc-switch-selected-focus-state-layer-opacity)}.mdc-switch.mdc-switch--selected:enabled:active:not(.mdc-ripple-upgraded) .mdc-switch__ripple::after{transition:opacity 150ms linear}.mdc-switch.mdc-switch--selected:enabled:active:not(.mdc-ripple-upgraded):active .mdc-switch__ripple::after{transition-duration:75ms;opacity:var(--mdc-switch-selected-pressed-state-layer-opacity)}.mdc-switch.mdc-switch--selected:enabled:active.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-switch-selected-pressed-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus):hover .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus).mdc-ripple-surface--hover .mdc-switch__ripple::before{opacity:var(--mdc-switch-unselected-hover-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:focus.mdc-ripple-upgraded--background-focused .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:focus:not(.mdc-ripple-upgraded):focus .mdc-switch__ripple::before{transition-duration:75ms;opacity:var(--mdc-switch-unselected-focus-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:active:not(.mdc-ripple-upgraded) .mdc-switch__ripple::after{transition:opacity 150ms linear}.mdc-switch.mdc-switch--unselected:enabled:active:not(.mdc-ripple-upgraded):active .mdc-switch__ripple::after{transition-duration:75ms;opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:active.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity)}.mdc-switch .mdc-switch__ripple{height:var(--mdc-switch-state-layer-size);width:var(--mdc-switch-state-layer-size)}.mdc-switch .mdc-switch__track{height:var(--mdc-switch-track-height)}.mdc-switch:disabled .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity)}.mdc-switch:enabled .mdc-switch__track::after{background:var(--mdc-switch-selected-track-color)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color)}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color)}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color)}.mdc-switch:disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color)}.mdc-switch:enabled .mdc-switch__track::before{background:var(--mdc-switch-unselected-track-color)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color)}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color)}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color)}.mdc-switch:disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color)}.mdc-switch .mdc-switch__track{border-radius:var(--mdc-switch-track-shape)}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mdc-switch:disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mat-mdc-slide-toggle{display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle .mdc-switch__ripple::after{content:"";opacity:0}.mat-mdc-slide-toggle .mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:opacity 75ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-mdc-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-mdc-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-elevation-overlay,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mdc-switch__handle{transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-switch-hidden-track-opacity);transition:var(--mat-switch-hidden-track-transition)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-switch-visible-track-opacity);transition:var(--mat-switch-visible-track-transition)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-switch-visible-track-opacity);transition:var(--mat-switch-visible-track-transition)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-switch-hidden-track-opacity);transition:var(--mat-switch-hidden-track-transition)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-switch-unselected-handle-size);height:var(--mat-switch-unselected-handle-size)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-switch-selected-handle-size);height:var(--mat-switch-selected-handle-size)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-switch-with-icon-handle-size);height:var(--mat-switch-with-icon-handle-size)}.mat-mdc-slide-toggle:active .mdc-switch:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-switch-pressed-handle-size);height:var(--mat-switch-pressed-handle-size)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{margin:var(--mat-switch-selected-handle-horizontal-margin)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-selected-with-icon-handle-horizontal-margin)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{margin:var(--mat-switch-unselected-handle-horizontal-margin)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-unselected-with-icon-handle-horizontal-margin)}.mat-mdc-slide-toggle:active .mdc-switch--selected:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-selected-pressed-handle-horizontal-margin)}.mat-mdc-slide-toggle:active .mdc-switch--unselected:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-unselected-pressed-handle-horizontal-margin)}.mdc-switch__track::after,.mdc-switch__track::before{border-width:var(--mat-switch-track-outline-width);border-color:var(--mat-switch-track-outline-color)}.mdc-switch--selected .mdc-switch__track::after,.mdc-switch--selected .mdc-switch__track::before{border-width:var(--mat-switch-selected-track-outline-width)}.mdc-switch--disabled .mdc-switch__track::after,.mdc-switch--disabled .mdc-switch__track::before{border-width:var(--mat-switch-disabled-unselected-track-outline-width);border-color:var(--mat-switch-disabled-unselected-track-outline-color)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-selected-handle-opacity)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-unselected-handle-opacity)}'],encapsulation:2,changeDetection:0})}}return e})();var ab=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=G({type:e})}static{this.\u0275inj=z({imports:[sb,Rt,Rt]})}}return e})();var cb=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=G({type:e})}static{this.\u0275inj=z({imports:[Rt,Rt]})}}return e})();var lb=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=G({type:e})}static{this.\u0275inj=z({imports:[Rt,_t,Rt]})}}return e})();var db=(()=>{class e{constructor(t,i,r,o){this.authService=t,this.brandService=i,this.titleService=r,this.document=o,this.title="Py-Learn"}ngOnInit(){this.titleService.setTitle(this.brandService.name);let t=this.document.querySelector("link[rel*='icon']");t&&(t.href=this.brandService.name==="Py-Learn"?"assets/favicon.png":"assets/majema-favicon.png"),this.authService.checkSession().subscribe(i=>{i&&this.authService.startAutoRefresh()})}static{this.\u0275fac=function(i){return new(i||e)(w(Gr),w(pn),w(Vc),w(W))}}static{this.\u0275cmp=pe({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(i,r){i&1&&g(0,"router-outlet")},dependencies:[wf],styles:["nav[_ngcontent-%COMP%]{margin:20px}button[_ngcontent-%COMP%]{margin-right:10px;padding:10px 20px;font-size:16px;cursor:pointer}"]})}}return e})();var ub=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=G({type:e,bootstrap:[db]})}static{this.\u0275inj=z({imports:[qv,ob,Ir,Xc,Vv,_t,Zy,ab,cb,lb,Tl,_l]})}}return e})();Wv().bootstrapModule(ub).catch(e=>console.error(e));
|
src/app/staticchat/staticchat.component.ts
CHANGED
|
@@ -662,7 +662,11 @@ export class StaticChatComponent implements OnInit, AfterViewInit {
|
|
| 662 |
|
| 663 |
private async sendToBackendForTranscription(blob: Blob): Promise<string> {
|
| 664 |
// Change this URL if your backend route is different
|
| 665 |
-
const url = 'http://localhost:5000/api/transcribe';
|
|
|
|
|
|
|
|
|
|
|
|
|
| 666 |
|
| 667 |
const form = new FormData();
|
| 668 |
// Keep extension generic; backend can read mimetype
|
|
|
|
| 662 |
|
| 663 |
private async sendToBackendForTranscription(blob: Blob): Promise<string> {
|
| 664 |
// Change this URL if your backend route is different
|
| 665 |
+
//const url = 'http://localhost:5000/api/transcribe';
|
| 666 |
+
const url =
|
| 667 |
+
location.hostname.endsWith('hf.space')
|
| 668 |
+
? 'https://pykara-py-learn-backend.hf.space/staticchat/transcribe'
|
| 669 |
+
: 'http://localhost:5000/staticchat/transcribe';
|
| 670 |
|
| 671 |
const form = new FormData();
|
| 672 |
// Keep extension generic; backend can read mimetype
|