-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path854.c068f95c1dd84357.js
1 lines (1 loc) · 18.1 KB
/
854.c068f95c1dd84357.js
1
"use strict";(self.webpackChunkaes_admin=self.webpackChunkaes_admin||[]).push([[854],{2451:(I,x,c)=>{c.d(x,{q:()=>q});const q=(0,c(5094).P1)(M=>M.stats,M=>M.stats)},8314:(I,x,c)=>{c.d(x,{g6:()=>L,fi:()=>te});var t=c(5e3);const E={toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["link","image","video"]]},q=new t.OlP("config",{providedIn:"root",factory:()=>({modules:E})});var C=c(9808),O=c(2313),R=c(6805),D=c(930);function F(i,d){const e="object"==typeof d;return new Promise((s,n)=>{const o=new D.Hp({next:r=>{s(r),o.unsubscribe()},error:n,complete:()=>{e?s(d.defaultValue):n(new R.K)}});i.subscribe(o)})}var H=c(9770),N=c(5191),P=c(727),S=c(4968),j=c(4782),Q=c(5577),z=c(8372),V=c(3075),w=c(655);function k(i,d){1&i&&t._UZ(0,"div",2)}function J(i,d){1&i&&t._UZ(0,"pre",2)}function G(i,d){if(1&i&&(t.ynx(0),t.YNc(1,k,1,0,"div",1),t.YNc(2,J,1,0,"pre",1),t.BQk()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",!e.preserve),t.xp6(1),t.Q6J("ngIf",e.preserve)}}function B(i,d){1&i&&t._UZ(0,"div",2)}function A(i,d){1&i&&t._UZ(0,"pre",2)}function U(i,d){if(1&i&&(t.ynx(0),t.YNc(1,B,1,0,"div",1),t.YNc(2,A,1,0,"pre",1),t.BQk()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",!e.preserve),t.xp6(1),t.Q6J("ngIf",e.preserve)}}const W=[[["","quill-editor-toolbar",""]]],_=["[quill-editor-toolbar]"];function Z(i,d){1&i&&t._UZ(0,"div",1)}function $(i,d){1&i&&t._UZ(0,"pre",1)}const y=(i,d)=>i||d||"html";let T=(()=>{class i{constructor(e,s){this.config=s,this.quill$=(0,H.P)(()=>(0,w.mG)(this,void 0,void 0,function*(){var n;if(!this.Quill){const o=this.document.addEventListener;this.document.addEventListener=this.document.__zone_symbol__addEventListener||this.document.addEventListener;const r=yield c.e(971).then(c.t.bind(c,9971,19));this.document.addEventListener=o,this.Quill=r.default?r.default:r}return null===(n=this.config.customOptions)||void 0===n||n.forEach(o=>{const r=this.Quill.import(o.import);r.whitelist=o.whitelist,this.Quill.register(r,!0,this.config.suppressGlobalRegisterWarning)}),yield this.registerCustomModules(this.Quill,this.config.customModules,this.config.suppressGlobalRegisterWarning)})).pipe((0,j.d)({bufferSize:1,refCount:!0})),this.document=e.get(C.K0),this.config||(this.config={modules:E})}getQuill(){return this.quill$}registerCustomModules(e,s,n){return(0,w.mG)(this,void 0,void 0,function*(){if(Array.isArray(s))for(let{implementation:o,path:r}of s)(0,N.b)(o)&&(o=yield F(o)),e.register(r,o,n);return e})}}return i.\u0275fac=function(e){return new(e||i)(t.LFG(t.zs3),t.LFG(q,8))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})(),K=(()=>{class i{constructor(e,s,n,o,r,f,m,g){this.elementRef=s,this.cd=n,this.domSanitizer=o,this.platformId=r,this.renderer=f,this.zone=m,this.service=g,this.required=!1,this.customToolbarPosition="top",this.styles=null,this.strict=!0,this.customOptions=[],this.customModules=[],this.preserveWhitespace=!1,this.trimOnValidation=!1,this.compareValues=!1,this.filterNull=!1,this.defaultEmptyValue=null,this.onEditorCreated=new t.vpe,this.onEditorChanged=new t.vpe,this.onContentChanged=new t.vpe,this.onSelectionChanged=new t.vpe,this.onFocus=new t.vpe,this.onBlur=new t.vpe,this.disabled=!1,this.preserve=!1,this.toolbarPosition="top",this.subscription=null,this.quillSubscription=null,this.valueGetter=(u,a)=>{let l=a.querySelector(".ql-editor").innerHTML;("<p><br></p>"===l||"<div><br></div>"===l)&&(l=this.defaultEmptyValue);let h=l;const v=y(this.format,this.service.config.format);if("text"===v)h=u.getText();else if("object"===v)h=u.getContents();else if("json"===v)try{h=JSON.stringify(u.getContents())}catch(b){h=u.getText()}return h},this.valueSetter=(u,a)=>{const l=y(this.format,this.service.config.format);if("html"===l)return([!0,!1].includes(this.sanitize)?this.sanitize:this.service.config.sanitize||!1)&&(a=this.domSanitizer.sanitize(t.q3G.HTML,a)),u.clipboard.convert(a);if("json"===l)try{return JSON.parse(a)}catch(h){return[{insert:a}]}return a},this.selectionChangeHandler=(u,a,l)=>{const h=!u&&!!this.onModelTouched;!this.onBlur.observed&&!this.onFocus.observed&&!this.onSelectionChanged.observed&&!h||this.zone.run(()=>{null===u?this.onBlur.emit({editor:this.quillEditor,source:l}):null===a&&this.onFocus.emit({editor:this.quillEditor,source:l}),this.onSelectionChanged.emit({editor:this.quillEditor,oldRange:a,range:u,source:l}),h&&this.onModelTouched(),this.cd.markForCheck()})},this.textChangeHandler=(u,a,l)=>{const h=this.quillEditor.getText(),v=this.quillEditor.getContents();let b=this.editorElem.querySelector(".ql-editor").innerHTML;("<p><br></p>"===b||"<div><br></div>"===b)&&(b=this.defaultEmptyValue);const p=this.trackChanges||this.service.config.trackChanges,Y=("user"===l||p&&"all"===p)&&!!this.onModelChange;!this.onContentChanged.observed&&!Y||this.zone.run(()=>{Y&&this.onModelChange(this.valueGetter(this.quillEditor,this.editorElem)),this.onContentChanged.emit({content:v,delta:u,editor:this.quillEditor,html:b,oldDelta:a,source:l,text:h}),this.cd.markForCheck()})},this.editorChangeHandler=(u,a,l,h)=>{if(this.onEditorChanged.observed)if("text-change"===u){const v=this.quillEditor.getText(),b=this.quillEditor.getContents();let p=this.editorElem.querySelector(".ql-editor").innerHTML;("<p><br></p>"===p||"<div><br></div>"===p)&&(p=this.defaultEmptyValue),this.zone.run(()=>{this.onEditorChanged.emit({content:b,delta:a,editor:this.quillEditor,event:u,html:p,oldDelta:l,source:h,text:v}),this.cd.markForCheck()})}else this.zone.run(()=>{this.onEditorChanged.emit({editor:this.quillEditor,event:u,oldRange:l,range:a,source:h}),this.cd.markForCheck()})},this.document=e.get(C.K0)}static normalizeClassNames(e){return e.trim().split(" ").reduce((n,o)=>{const r=o.trim();return r&&n.push(r),n},[])}ngOnInit(){this.preserve=this.preserveWhitespace,this.toolbarPosition=this.customToolbarPosition}ngAfterViewInit(){(0,C.PM)(this.platformId)||(this.quillSubscription=this.service.getQuill().pipe((0,Q.z)(e=>{var s;const n=[this.service.registerCustomModules(e,this.customModules)],o=null!==(s=this.beforeRender)&&void 0!==s?s:this.service.config.beforeRender;return o&&n.push(o()),Promise.all(n).then(()=>e)})).subscribe(e=>{this.editorElem=this.elementRef.nativeElement.querySelector("[quill-editor-element]");const s=this.elementRef.nativeElement.querySelector("[quill-editor-toolbar]"),n=Object.assign({},this.modules||this.service.config.modules);s?n.toolbar=s:void 0===n.toolbar&&(n.toolbar=E.toolbar);let o=void 0!==this.placeholder?this.placeholder:this.service.config.placeholder;void 0===o&&(o="Insert text here ..."),this.styles&&Object.keys(this.styles).forEach(l=>{this.renderer.setStyle(this.editorElem,l,this.styles[l])}),this.classes&&this.addClasses(this.classes),this.customOptions.forEach(l=>{const h=e.import(l.import);h.whitelist=l.whitelist,e.register(h,!0)});let r=this.bounds&&"self"===this.bounds?this.editorElem:this.bounds;r||(r=this.service.config.bounds?this.service.config.bounds:this.document.body);let f=this.debug;!f&&!1!==f&&this.service.config.debug&&(f=this.service.config.debug);let m=this.readOnly;!m&&!1!==this.readOnly&&(m=void 0!==this.service.config.readOnly&&this.service.config.readOnly);let g=this.defaultEmptyValue;this.service.config.hasOwnProperty("defaultEmptyValue")&&(g=this.service.config.defaultEmptyValue);let u=this.scrollingContainer;!u&&null!==this.scrollingContainer&&(u=null===this.service.config.scrollingContainer||this.service.config.scrollingContainer?this.service.config.scrollingContainer:null);let a=this.formats;if(!a&&void 0===a&&(a=this.service.config.formats?[...this.service.config.formats]:null===this.service.config.formats?null:void 0),this.zone.runOutsideAngular(()=>{var l,h,v;if(this.quillEditor=new e(this.editorElem,{bounds:r,debug:f,formats:a,modules:n,placeholder:o,readOnly:m,defaultEmptyValue:g,scrollingContainer:u,strict:this.strict,theme:this.theme||(this.service.config.theme?this.service.config.theme:"snow")}),this.linkPlaceholder){const b=null===(h=null===(l=this.quillEditor)||void 0===l?void 0:l.theme)||void 0===h?void 0:h.tooltip,p=null===(v=null==b?void 0:b.root)||void 0===v?void 0:v.querySelector("input[data-link]");null!=p&&p.dataset&&(p.dataset.link=this.linkPlaceholder)}}),this.content){if("text"===y(this.format,this.service.config.format))this.quillEditor.setText(this.content,"silent");else{const h=this.valueSetter(this.quillEditor,this.content);this.quillEditor.setContents(h,"silent")}this.quillEditor.getModule("history").clear()}this.setDisabledState(),this.addQuillEventListeners(),(this.onEditorCreated.observed||this.onValidatorChanged)&&requestAnimationFrame(()=>{this.onValidatorChanged&&this.onValidatorChanged(),this.onEditorCreated.emit(this.quillEditor)})}))}ngOnDestroy(){var e;this.dispose(),null===(e=this.quillSubscription)||void 0===e||e.unsubscribe(),this.quillSubscription=null}ngOnChanges(e){if(this.quillEditor){if(e.readOnly&&this.quillEditor.enable(!e.readOnly.currentValue),e.placeholder&&(this.quillEditor.root.dataset.placeholder=e.placeholder.currentValue),e.defaultEmptyValue&&(this.quillEditor.root.dataset.defaultEmptyValue=e.defaultEmptyValue.currentValue),e.styles){const s=e.styles.currentValue,n=e.styles.previousValue;n&&Object.keys(n).forEach(o=>{this.renderer.removeStyle(this.editorElem,o)}),s&&Object.keys(s).forEach(o=>{this.renderer.setStyle(this.editorElem,o,this.styles[o])})}if(e.classes){const s=e.classes.currentValue,n=e.classes.previousValue;n&&this.removeClasses(n),s&&this.addClasses(s)}e.debounceTime&&this.addQuillEventListeners()}}addClasses(e){i.normalizeClassNames(e).forEach(s=>{this.renderer.addClass(this.editorElem,s)})}removeClasses(e){i.normalizeClassNames(e).forEach(s=>{this.renderer.removeClass(this.editorElem,s)})}writeValue(e){if(this.filterNull&&null===e||(this.content=e,!this.quillEditor))return;const s=y(this.format,this.service.config.format),n=this.valueSetter(this.quillEditor,e);if(this.compareValues){const o=this.quillEditor.getContents();if(JSON.stringify(o)===JSON.stringify(n))return}e?"text"===s?this.quillEditor.setText(e):this.quillEditor.setContents(n):this.quillEditor.setText("")}setDisabledState(e=this.disabled){this.disabled=e,this.quillEditor&&(e?(this.quillEditor.disable(),this.renderer.setAttribute(this.elementRef.nativeElement,"disabled","disabled")):(this.readOnly||this.quillEditor.enable(),this.renderer.removeAttribute(this.elementRef.nativeElement,"disabled")))}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}registerOnValidatorChange(e){this.onValidatorChanged=e}validate(){if(!this.quillEditor)return null;const e={};let s=!0;const n=this.quillEditor.getText(),o=this.trimOnValidation?n.trim().length:1===n.length&&0===n.trim().length?0:n.length-1,r=this.quillEditor.getContents().ops,f=r&&1===r.length&&["\n",""].includes(r[0].insert);return this.minLength&&o&&o<this.minLength&&(e.minLengthError={given:o,minLength:this.minLength},s=!1),this.maxLength&&o>this.maxLength&&(e.maxLengthError={given:o,maxLength:this.maxLength},s=!1),this.required&&!o&&f&&(e.requiredError={empty:!0},s=!1),s?null:e}addQuillEventListeners(){this.dispose(),this.zone.runOutsideAngular(()=>{this.subscription=new P.w0,this.subscription.add((0,S.R)(this.quillEditor,"selection-change").subscribe(([n,o,r])=>{this.selectionChangeHandler(n,o,r)}));let e=(0,S.R)(this.quillEditor,"text-change"),s=(0,S.R)(this.quillEditor,"editor-change");"number"==typeof this.debounceTime&&(e=e.pipe((0,z.b)(this.debounceTime)),s=s.pipe((0,z.b)(this.debounceTime))),this.subscription.add(e.subscribe(([n,o,r])=>{this.textChangeHandler(n,o,r)})),this.subscription.add(s.subscribe(([n,o,r,f])=>{this.editorChangeHandler(n,o,r,f)}))})}dispose(){null!==this.subscription&&(this.subscription.unsubscribe(),this.subscription=null)}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(t.zs3),t.Y36(t.SBq),t.Y36(t.sBO),t.Y36(O.H7),t.Y36(t.Lbi),t.Y36(t.Qsj),t.Y36(t.R0b),t.Y36(T))},i.\u0275dir=t.lG2({type:i,inputs:{format:"format",theme:"theme",modules:"modules",debug:"debug",readOnly:"readOnly",placeholder:"placeholder",maxLength:"maxLength",minLength:"minLength",required:"required",formats:"formats",customToolbarPosition:"customToolbarPosition",sanitize:"sanitize",beforeRender:"beforeRender",styles:"styles",strict:"strict",scrollingContainer:"scrollingContainer",bounds:"bounds",customOptions:"customOptions",customModules:"customModules",trackChanges:"trackChanges",preserveWhitespace:"preserveWhitespace",classes:"classes",trimOnValidation:"trimOnValidation",linkPlaceholder:"linkPlaceholder",compareValues:"compareValues",filterNull:"filterNull",debounceTime:"debounceTime",defaultEmptyValue:"defaultEmptyValue",valueGetter:"valueGetter",valueSetter:"valueSetter"},outputs:{onEditorCreated:"onEditorCreated",onEditorChanged:"onEditorChanged",onContentChanged:"onContentChanged",onSelectionChanged:"onSelectionChanged",onFocus:"onFocus",onBlur:"onBlur"},features:[t.TTD]}),i})(),L=(()=>{class i extends K{constructor(e,s,n,o,r,f,m,g){super(e,s,n,o,r,f,m,g)}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(t.zs3),t.Y36(t.SBq),t.Y36(t.sBO),t.Y36(O.H7),t.Y36(t.Lbi),t.Y36(t.Qsj),t.Y36(t.R0b),t.Y36(T))},i.\u0275cmp=t.Xpm({type:i,selectors:[["quill-editor"]],standalone:!0,features:[t._Bn([{multi:!0,provide:V.JU,useExisting:(0,t.Gpc)(()=>i)},{multi:!0,provide:V.Cf,useExisting:(0,t.Gpc)(()=>i)}]),t.qOj,t.jDz],ngContentSelectors:_,decls:3,vars:2,consts:[[4,"ngIf"],["quill-editor-element","",4,"ngIf"],["quill-editor-element",""]],template:function(e,s){1&e&&(t.F$t(W),t.YNc(0,G,3,2,"ng-container",0),t.Hsn(1),t.YNc(2,U,3,2,"ng-container",0)),2&e&&(t.Q6J("ngIf","top"!==s.toolbarPosition),t.xp6(2),t.Q6J("ngIf","top"===s.toolbarPosition))},dependencies:[C.ez,C.O5],styles:[":host{display:inline-block}\n"],encapsulation:2}),i})(),X=(()=>{class i{constructor(e,s){this.sanitizer=e,this.service=s,this.content="",this.innerHTML="",this.themeClass="ql-snow"}ngOnChanges(e){if(e.theme?this.themeClass=`ql-${e.theme.currentValue||(this.service.config.theme?this.service.config.theme:"snow")} ngx-quill-view-html`:this.theme||(this.themeClass=`ql-${this.service.config.theme?this.service.config.theme:"snow"} ngx-quill-view-html`),e.content){const s=e.content.currentValue,n=[!0,!1].includes(this.sanitize)?this.sanitize:this.service.config.sanitize||!1;this.innerHTML=n?s:this.sanitizer.bypassSecurityTrustHtml(s)}}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(O.H7),t.Y36(T))},i.\u0275cmp=t.Xpm({type:i,selectors:[["quill-view-html"]],inputs:{content:"content",theme:"theme",sanitize:"sanitize"},standalone:!0,features:[t.TTD,t.jDz],decls:2,vars:2,consts:[[1,"ql-container",3,"ngClass"],[1,"ql-editor",3,"innerHTML"]],template:function(e,s){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"div",1),t.qZA()),2&e&&(t.Q6J("ngClass",s.themeClass),t.xp6(1),t.Q6J("innerHTML",s.innerHTML,t.oJD))},dependencies:[C.ez,C.mk],styles:[".ql-container.ngx-quill-view-html{border:0}\n"],encapsulation:2}),i})(),ee=(()=>{class i{constructor(e,s,n,o,r,f){this.elementRef=e,this.renderer=s,this.zone=n,this.service=o,this.domSanitizer=r,this.platformId=f,this.strict=!0,this.customModules=[],this.customOptions=[],this.preserveWhitespace=!1,this.onEditorCreated=new t.vpe,this.preserve=!1,this.quillSubscription=null,this.valueSetter=(m,g)=>{const u=y(this.format,this.service.config.format);let a=g;if("text"===u)m.setText(a);else{if("html"===u)([!0,!1].includes(this.sanitize)?this.sanitize:this.service.config.sanitize||!1)&&(g=this.domSanitizer.sanitize(t.q3G.HTML,g)),a=m.clipboard.convert(g);else if("json"===u)try{a=JSON.parse(g)}catch(l){a=[{insert:g}]}m.setContents(a)}}}ngOnInit(){this.preserve=this.preserveWhitespace}ngOnChanges(e){!this.quillEditor||e.content&&this.valueSetter(this.quillEditor,e.content.currentValue)}ngAfterViewInit(){(0,C.PM)(this.platformId)||(this.quillSubscription=this.service.getQuill().pipe((0,Q.z)(e=>{var s;const n=[this.service.registerCustomModules(e,this.customModules)],o=null!==(s=this.beforeRender)&&void 0!==s?s:this.service.config.beforeRender;return o&&n.push(o()),Promise.all(n).then(()=>e)})).subscribe(e=>{const s=Object.assign({},this.modules||this.service.config.modules);s.toolbar=!1,this.customOptions.forEach(f=>{const m=e.import(f.import);m.whitelist=f.whitelist,e.register(m,!0)});let n=this.debug;!n&&!1!==n&&this.service.config.debug&&(n=this.service.config.debug);let o=this.formats;!o&&void 0===o&&(o=this.service.config.formats?Object.assign({},this.service.config.formats):null===this.service.config.formats?null:void 0);const r=this.theme||(this.service.config.theme?this.service.config.theme:"snow");this.editorElem=this.elementRef.nativeElement.querySelector("[quill-view-element]"),this.zone.runOutsideAngular(()=>{this.quillEditor=new e(this.editorElem,{debug:n,formats:o,modules:s,readOnly:!0,strict:this.strict,theme:r})}),this.renderer.addClass(this.editorElem,"ngx-quill-view"),this.content&&this.valueSetter(this.quillEditor,this.content),this.onEditorCreated.observers.length&&requestAnimationFrame(()=>{this.onEditorCreated.emit(this.quillEditor)})}))}ngOnDestroy(){var e;null===(e=this.quillSubscription)||void 0===e||e.unsubscribe(),this.quillSubscription=null}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(t.SBq),t.Y36(t.Qsj),t.Y36(t.R0b),t.Y36(T),t.Y36(O.H7),t.Y36(t.Lbi))},i.\u0275cmp=t.Xpm({type:i,selectors:[["quill-view"]],inputs:{format:"format",theme:"theme",modules:"modules",debug:"debug",formats:"formats",sanitize:"sanitize",beforeRender:"beforeRender",strict:"strict",content:"content",customModules:"customModules",customOptions:"customOptions",preserveWhitespace:"preserveWhitespace"},outputs:{onEditorCreated:"onEditorCreated"},standalone:!0,features:[t.TTD,t.jDz],decls:2,vars:2,consts:[["quill-view-element","",4,"ngIf"],["quill-view-element",""]],template:function(e,s){1&e&&(t.YNc(0,Z,1,0,"div",0),t.YNc(1,$,1,0,"pre",0)),2&e&&(t.Q6J("ngIf",!s.preserve),t.xp6(1),t.Q6J("ngIf",s.preserve))},dependencies:[C.ez,C.O5],styles:[".ql-container.ngx-quill-view{border:0}\n"],encapsulation:2}),i})(),te=(()=>{class i{static forRoot(e){return{ngModule:i,providers:[{provide:q,useValue:e}]}}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({imports:[L,ee,X]}),i})()}}]);