@zydon/common-csr 2.0.18 → 2.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -292,6 +292,6 @@ var $e=a((Ie,re)=>{ace.define("ace/mode/jsdoc_comment_highlight_rules",["require
|
|
|
292
292
|
animation: none;
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
`,"autocompletion.css",!1),T.AcePopup=A,T.$singleLineEditor=C,T.getAriaId=f;});ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(a,T,L){var R=function(){function w(S){this.editor=S,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv);}return w.prototype.setScreenReaderContent=function(S){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var u=this.popup.getRow(),v=this.popup.renderer.$textLayer,p=v.element.childNodes[u-v.config.firstRow];if(p){for(var b="doc-tooltip ",f=0;f<this._lines.length;f++)b+="ace-inline-screenreader-line-".concat(f," ");p.setAttribute("aria-describedby",b);}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=S.split(/\r\n|\r|\n/);var d=this.createCodeBlock();this.screenReaderDiv.appendChild(d);},w.prototype.destroy=function(){this.screenReaderDiv.remove();},w.prototype.createCodeBlock=function(){var S=document.createElement("pre");S.setAttribute("id","ace-inline-screenreader");for(var d=0;d<this._lines.length;d++){var u=document.createElement("code");u.setAttribute("id","ace-inline-screenreader-line-".concat(d));var v=document.createTextNode(this._lines[d]);u.appendChild(v),S.appendChild(u);}return S},w}();T.AceInlineScreenReader=R;});ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],function(a,T,L){var R=a("../snippets").snippetManager,w=a("./inline_screenreader").AceInlineScreenReader,S=function(){function d(){this.editor=null;}return d.prototype.show=function(u,v,p){if(p=p||"",u&&this.editor&&this.editor!==u&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!u||!v)return !1;this.inlineScreenReader||(this.inlineScreenReader=new w(u));var b=v.snippet?R.getDisplayTextForSnippet(u,v.snippet):v.value;return v.hideInlinePreview||!b||!b.startsWith(p)?!1:(this.editor=u,this.inlineScreenReader.setScreenReaderContent(b),b=b.slice(p.length),b===""?u.removeGhostText():u.setGhostText(b),!0)},d.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},d.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},d.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null);},d}();T.AceInline=S;});ace.define("ace/autocomplete/util",["require","exports","module"],function(a,T,L){T.parForEach=function(w,S,d){var u=0,v=w.length;v===0&&d();for(var p=0;p<v;p++)S(w[p],function(b,f){u++,u===v&&d(b,f);});};var R=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;T.retrievePrecedingIdentifier=function(w,S,d){d=d||R;for(var u=[],v=S-1;v>=0&&d.test(w[v]);v--)u.push(w[v]);return u.reverse().join("")},T.retrieveFollowingIdentifier=function(w,S,d){d=d||R;for(var u=[],v=S;v<w.length&&d.test(w[v]);v++)u.push(w[v]);return u},T.getCompletionPrefix=function(w){var S=w.getCursorPosition(),d=w.session.getLine(S.row),u;return w.completers.forEach(function(v){v.identifierRegexps&&v.identifierRegexps.forEach(function(p){!u&&p&&(u=this.retrievePrecedingIdentifier(d,S.column,p));}.bind(this));}.bind(this)),u||this.retrievePrecedingIdentifier(d,S.column)},T.triggerAutocomplete=function(w,d){var d=d??w.session.getPrecedingCharacter();return w.completers.some(function(u){if(u.triggerCharacters&&Array.isArray(u.triggerCharacters))return u.triggerCharacters.includes(d)})};});ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"],function(a,T,L){var R=a("./keyboard/hash_handler").HashHandler,w=a("./autocomplete/popup").AcePopup,S=a("./autocomplete/inline").AceInline,d=a("./autocomplete/popup").getAriaId,u=a("./autocomplete/util"),v=a("./lib/lang"),p=a("./lib/dom"),b=a("./snippets").snippetManager,f=a("./config"),y=a("./lib/event"),m=a("./lib/scroll").preventParentScroll,k=function(c,i){i.completer&&i.completer.destroy();},C=function(){function c(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new R,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=v.delayedCall(function(){this.updateCompletions(!0);}.bind(this)),this.tooltipTimer=v.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=v.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=v.delayedCall(function(){this.stickySelection=!0;}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=v.delayedCall(function(){var i=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!i||this.editor.completers.length===0||(this.completions=new I(c.completionsForLoading),this.openPopup(this.editor,i.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0));}.bind(this),this.stickySelectionDelay);}return Object.defineProperty(c,"completionsForLoading",{get:function(){return [{caption:f.nls("autocomplete.loading","Loading..."),value:""}]},enumerable:!1,configurable:!0}),c.prototype.$init=function(){return this.popup=new w(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(i){this.insertMatch(),i.stop();}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupShow.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),y.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup.renderer.on("afterRender",this.$onPopupRender.bind(this)),this.popup},c.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new S,this.inlineRenderer},c.prototype.getPopup=function(){return this.popup||this.$init()},c.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1;},c.prototype.$seen=function(i){!this.hasSeen.has(i)&&i&&i.completer&&i.completer.onSeen&&typeof i.completer.onSeen=="function"&&(i.completer.onSeen(this.editor,i),this.hasSeen.add(i));},c.prototype.$onPopupChange=function(i){if(this.inlineRenderer&&this.inlineEnabled){var e=i?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(e),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule();}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null);},c.prototype.$updateGhostText=function(i){var e=this.base.row,n=this.base.column,t=this.editor.getCursorPosition().column,o=this.editor.session.getLine(e).slice(n,t);this.inlineRenderer.show(this.editor,i,o)?this.$seen(i):this.inlineRenderer.hide();},c.prototype.$onPopupRender=function(){var i=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var e=this.popup.getFirstVisibleRow();e<=this.popup.getLastVisibleRow();e++){var n=this.popup.getData(e);n&&(!i||n.hideInlinePreview)&&this.$seen(n);}},c.prototype.$onPopupShow=function(i){this.$onPopupChange(i),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay);},c.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var i=this.editor.container.parentNode,e=[];i;)e.push(i),i.addEventListener("scroll",this.onLayoutChange,{passive:!0}),i=i.parentNode;this.$elements=e;}},c.prototype.unObserveLayoutChanges=function(){var i=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(e){e.removeEventListener("scroll",i.onLayoutChange,{passive:!0});}),this.$elements=null;},c.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip();},c.prototype.$updatePopupPosition=function(){var i=this.editor,e=i.renderer,n=e.layerConfig.lineHeight,t=e.$cursorLayer.getPixelPosition(this.base,!0);t.left-=this.popup.getTextLeftOffset();var o=i.container.getBoundingClientRect();t.top+=o.top-e.layerConfig.offset,t.left+=o.left-i.renderer.scrollLeft,t.left+=e.gutterWidth;var r={top:t.top,left:t.left};e.$ghostText&&e.$ghostTextWidget&&this.base.row===e.$ghostText.position.row&&(r.top+=e.$ghostTextWidget.el.offsetHeight);var h=i.container.getBoundingClientRect().bottom-n,g=h<r.top?{top:h,left:r.left}:r;this.popup.tryShow(g,n,"bottom")||this.popup.tryShow(t,n,"top")||this.popup.show(t,n);},c.prototype.openPopup=function(i,e,n){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var t=this.popup.getRow(),o=this.popup.data[t];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:d(this.popup.getRow()),inline:this.inlineEnabled}),i.keyBinding.addKeyboardHandler(this.keyboardHandler);var r;this.stickySelection&&(r=this.popup.data.indexOf(o)),(!r||r===-1)&&(r=0),this.popup.setRow(this.autoSelect?r:-1),r===t&&o!==this.completions.filtered[r]&&this.$onPopupChange();var h=this.inlineRenderer&&this.inlineEnabled;if(r===t&&h){var g=this.popup.getData(this.popup.getRow());this.$updateGhostText(g);}n||(this.popup.setTheme(i.getTheme()),this.popup.setFontSize(i.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges();},c.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges();},c.prototype.changeListener=function(i){var e=this.editor.selection.lead;(e.row!=this.base.row||e.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach();},c.prototype.blurListener=function(i){var e=document.activeElement,n=this.editor.textInput.getElement(),t=i.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(i.relatedTarget),o=this.popup&&this.popup.container;e!=n&&e.parentNode!=o&&!t&&e!=this.tooltipNode&&i.relatedTarget!=n&&this.detach();},c.prototype.mousedownListener=function(i){this.detach();},c.prototype.mousewheelListener=function(i){this.popup&&!this.popup.isMouseOver&&this.detach();},c.prototype.mouseOutListener=function(i){this.popup.isOpen&&this.$updatePopupPosition();},c.prototype.goTo=function(i){this.popup.goTo(i);},c.prototype.insertMatch=function(i,e){if(i||(i=this.popup.getData(this.popup.getRow())),!i)return !1;if(i.value==="")return this.detach();var n=this.completions,t=this.getCompletionProvider().insertMatch(this.editor,i,n.filterText,e);return this.completions==n&&this.detach(),t},c.prototype.showPopup=function(i,e){this.editor&&this.detach(),this.activated=!0,this.editor=i,i.completer!=this&&(i.completer&&i.completer.detach(),i.completer=this),i.on("changeSelection",this.changeListener),i.on("blur",this.blurListener),i.on("mousedown",this.mousedownListener),i.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,e);},c.prototype.getCompletionProvider=function(i){return this.completionProvider||(this.completionProvider=new A(i)),this.completionProvider},c.prototype.gatherCompletions=function(i,e){return this.getCompletionProvider().gatherCompletions(i,e)},c.prototype.updateCompletions=function(i,e){if(i&&this.base&&this.completions){var t=this.editor.getCursorPosition(),o=this.editor.session.getTextRange({start:this.base,end:t});if(o==this.completions.filterText)return;if(this.completions.setFilter(o),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==o&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,o,i);return}if(e&&e.matches){var t=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(t.row,t.column),this.base.$insertRight=!0,this.completions=new I(e.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",i)}var n=this.editor.getSession(),t=this.editor.getCursorPosition(),o=u.getCompletionPrefix(this.editor);this.base=n.doc.createAnchor(t.row,t.column-o.length),this.base.$insertRight=!0;var r={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:o,pos:t}).provideCompletions(this.editor,r,function(h,g,l){var x=g.filtered,s=u.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),l){if(!x.length){var _=!this.autoShown&&this.emptyMessage;if(typeof _=="function"&&(_=this.emptyMessage(s)),_){var M=[{caption:_,value:""}];this.completions=new I(M),this.openPopup(this.editor,s,i),this.popup.renderer.setStyle("ace_loading",!1),this.popup.renderer.setStyle("ace_empty-message",!0);return}return this.detach()}if(x.length==1&&x[0].value==s&&!x[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&x.length==1)return this.insertMatch(x[0])}this.completions=!l&&this.showLoadingState?new I(c.completionsForLoading.concat(x),g.filterText):g,this.openPopup(this.editor,s,i),this.popup.renderer.setStyle("ace_empty-message",!1),this.popup.renderer.setStyle("ace_loading",!l);}.bind(this)),this.showLoadingState&&!this.autoShown&&!(this.popup&&this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2);},c.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu();},c.prototype.updateDocTooltip=function(){var i=this.popup,e=this.completions.filtered,n=e&&(e[i.getHoveredRow()]||e[i.getRow()]),t=null;if(!n||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var o=this.editor.completers.length,r=0;r<o;r++){var h=this.editor.completers[r];if(h.getDocTooltip&&n.completerId===h.id){t=h.getDocTooltip(n);break}}if(!t&&typeof n!="string"&&(t=n),typeof t=="string"&&(t={docText:t}),!t||!(t.docHTML||t.docText))return this.hideDocTooltip();this.showDocTooltip(t);},c.prototype.showDocTooltip=function(i){this.tooltipNode||(this.tooltipNode=p.createElement("div"),this.tooltipNode.style.margin="0",this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.style.overscrollBehavior="contain",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"),this.tooltipNode.addEventListener("wheel",m));var e=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(e.isDark?"ace_dark ":"")+(e.cssClass||"");var n=this.tooltipNode;i.docHTML?n.innerHTML=i.docHTML:i.docText&&(n.textContent=i.docText),n.parentNode||this.popup.container.appendChild(this.tooltipNode);var t=this.popup,o=t.container.getBoundingClientRect();n.style.top=t.container.style.top,n.style.bottom=t.container.style.bottom,n.style.display="block",window.innerWidth-o.right<320?o.left<320?t.isTopdown?(n.style.top=o.bottom+"px",n.style.left=o.left+"px",n.style.right="",n.style.bottom=""):(n.style.top=t.container.offsetTop-n.offsetHeight+"px",n.style.left=o.left+"px",n.style.right="",n.style.bottom=""):(n.style.right=window.innerWidth-o.left+"px",n.style.left=""):(n.style.left=o.right+1+"px",n.style.right="");},c.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var i=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==i&&this.editor.focus(),this.tooltipNode=null,i.parentNode&&i.parentNode.removeChild(i);}},c.prototype.onTooltipClick=function(i){for(var e=i.target;e&&e!=this.tooltipNode;){if(e.nodeName=="A"&&e.href){e.rel="noreferrer",e.target="_blank";break}e=e.parentNode;}},c.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var i=this.popup.container;i&&i.parentNode&&i.parentNode.removeChild(i);}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",k),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null;},c}();C.prototype.commands={Up:function(c){c.completer.goTo("up");},Down:function(c){c.completer.goTo("down");},"Ctrl-Up|Ctrl-Home":function(c){c.completer.goTo("start");},"Ctrl-Down|Ctrl-End":function(c){c.completer.goTo("end");},Esc:function(c){c.completer.detach();},Return:function(c){return c.completer.insertMatch()},"Shift-Return":function(c){c.completer.insertMatch(null,{deleteSuffix:!0});},Tab:function(c){var i=c.completer.insertMatch();if(!i&&!c.tabstopManager)c.completer.goTo("down");else return i},Backspace:function(c){c.execCommand("backspace");var i=u.getCompletionPrefix(c);!i&&c.completer&&c.completer.detach();},PageUp:function(c){c.completer.popup.gotoPageUp();},PageDown:function(c){c.completer.popup.gotoPageDown();}},C.for=function(c){return c.completer instanceof C||(c.completer&&(c.completer.destroy(),c.completer=null),f.get("sharedPopups")?(C.$sharedInstance||(C.$sharedInstance=new C),c.completer=C.$sharedInstance):(c.completer=new C,c.once("destroy",k))),c.completer},C.startCommand={name:"startAutocomplete",exec:function(c,i){var e=C.for(c);e.autoInsert=!1,e.autoSelect=!0,e.autoShown=!1,e.showPopup(c,i),e.cancelContextMenu();},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var A=function(){function c(i){this.initialPosition=i,this.active=!0;}return c.prototype.insertByIndex=function(i,e,n){return !this.completions||!this.completions.filtered?!1:this.insertMatch(i,this.completions.filtered[e],n)},c.prototype.insertMatch=function(i,e,n){if(!e)return !1;if(i.startOperation({command:{name:"insertMatch"}}),e.completer&&e.completer.insertMatch)e.completer.insertMatch(i,e);else {if(!this.completions)return !1;var t=this.completions.filterText.length,o=0;if(e.range&&e.range.start.row===e.range.end.row&&(t-=this.initialPosition.prefix.length,t+=this.initialPosition.pos.column-e.range.start.column,o+=e.range.end.column-this.initialPosition.pos.column),t||o){var r;i.selection.getAllRanges?r=i.selection.getAllRanges():r=[i.getSelectionRange()];for(var h=0,g;g=r[h];h++)g.start.column-=t,g.end.column+=o,i.session.remove(g);}e.snippet?b.insertSnippet(i,e.snippet):this.$insertString(i,e),e.completer&&e.completer.onInsert&&typeof e.completer.onInsert=="function"&&e.completer.onInsert(i,e),e.command&&e.command==="startAutocomplete"&&i.execCommand(e.command);}return i.endOperation(),!0},c.prototype.$insertString=function(i,e){var n=e.value||e;i.execCommand("insertstring",n);},c.prototype.gatherCompletions=function(i,e){var n=i.getSession(),t=i.getCursorPosition(),o=u.getCompletionPrefix(i),r=[];this.completers=i.completers;var h=i.completers.length;return i.completers.forEach(function(g,l){g.getCompletions(i,n,t,o,function(x,s){g.hideInlinePreview&&(s=s.map(function(_){return Object.assign(_,{hideInlinePreview:g.hideInlinePreview})})),!x&&s&&(r=r.concat(s)),e(null,{prefix:u.getCompletionPrefix(i),matches:r,finished:--h===0});});}),!0},c.prototype.provideCompletions=function(i,e,n){var t=function(g){var l=g.prefix,x=g.matches;this.completions=new I(x),e.exactMatch&&(this.completions.exactMatch=!0),e.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(l),(g.finished||this.completions.filtered.length)&&n(null,this.completions,g.finished);}.bind(this),o=!0,r=null;if(this.gatherCompletions(i,function(g,l){if(this.active){g&&(n(g,[],!0),this.detach());var x=l.prefix;if(x.indexOf(l.prefix)===0){if(o){r=l;return}t(l);}}}.bind(this)),o=!1,r){var h=r;r=null,t(h);}},c.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(i){typeof i.cancel=="function"&&i.cancel();});},c}(),I=function(){function c(i,e){this.all=i,this.filtered=i,this.filterText=e||"",this.exactMatch=!1,this.ignoreCaption=!1;}return c.prototype.setFilter=function(i){if(i.length>this.filterText&&i.lastIndexOf(this.filterText,0)===0)var e=this.filtered;else var e=this.all;this.filterText=i,e=this.filterCompletions(e,this.filterText),e=e.sort(function(t,o){return o.exactMatch-t.exactMatch||o.$score-t.$score||(t.caption||t.value).localeCompare(o.caption||o.value)});var n=null;e=e.filter(function(t){var o=t.snippet||t.caption||t.value;return o===n?!1:(n=o,!0)}),this.filtered=e;},c.prototype.filterCompletions=function(i,e){var n=[],t=e.toUpperCase(),o=e.toLowerCase();e:for(var r=0,h;h=i[r];r++){var g=!this.ignoreCaption&&h.caption||h.value||h.snippet;if(g){var l=-1,x=0,s=0,_,M;if(this.exactMatch){if(e!==g.substr(0,e.length))continue e}else {var E=g.toLowerCase().indexOf(o);if(E>-1)s=E;else for(var $=0;$<e.length;$++){var N=g.indexOf(o[$],l+1),P=g.indexOf(t[$],l+1);if(_=N>=0&&(P<0||N<P)?N:P,_<0)continue e;M=_-l-1,M>0&&(l===-1&&(s+=10),s+=M,x=x|1<<$),l=_;}}h.matchMask=x,h.exactMatch=s?0:1,h.$score=(h.score||0)-s,n.push(h);}}return n},c}();T.Autocomplete=C,T.CompletionProvider=A,T.FilteredList=I;});ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(a,T,L){var R=a("../range").Range,w=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function S(u,v){var p=u.getTextRange(R.fromPoints({row:0,column:0},v));return p.split(w).length-1}function d(u,v){var p=S(u,v),b=u.getValue().split(w),f=Object.create(null),y=b[p];return b.forEach(function(m,k){if(!(!m||m===y)){var C=Math.abs(p-k),A=b.length-C;f[m]?f[m]=Math.max(A,f[m]):f[m]=A;}}),f}T.getCompletions=function(u,v,p,b,f){var y=d(v,p),m=Object.keys(y);f(null,m.map(function(k){return {caption:k,value:k,score:y[k],meta:"local"}}));};});ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(a,T,L){var R=a("../snippets").snippetManager,w=a("../autocomplete").Autocomplete,S=a("../config"),d=a("../lib/lang"),u=a("../autocomplete/util"),v=a("../autocomplete/text_completer"),p={getCompletions:function(t,o,r,h,g){if(o.$mode.completer)return o.$mode.completer.getCompletions(t,o,r,h,g);var l=t.session.getState(r.row),x=o.$mode.getCompletions(l,o,r,h);x=x.map(function(s){return s.completerId=p.id,s}),g(null,x);},id:"keywordCompleter"},b=function(t){var o={};return t.replace(/\${(\d+)(:(.*?))?}/g,function(r,h,g,l){return o[h]=l||""}).replace(/\$(\d+?)/g,function(r,h){return o[h]})},f={getCompletions:function(t,o,r,h,g){var l=[],x=o.getTokenAt(r.row,r.column);x&&x.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?l.push("html-tag"):l=R.getActiveScopes(t);var s=R.snippetMap,_=[];l.forEach(function(M){for(var E=s[M]||[],$=E.length;$--;){var N=E[$],P=N.name||N.tabTrigger;P&&_.push({caption:P,snippet:N.content,meta:N.tabTrigger&&!N.name?N.tabTrigger+"\u21E5 ":"snippet",completerId:f.id});}},this),g(null,_);},getDocTooltip:function(t){t.snippet&&!t.docHTML&&(t.docHTML=["<b>",d.escapeHTML(t.caption),"</b>","<hr></hr>",d.escapeHTML(b(t.snippet))].join(""));},id:"snippetCompleter"},y=[f,v,p];T.setCompleters=function(t){y.length=0,t&&y.push.apply(y,t);},T.addCompleter=function(t){y.push(t);},T.textCompleter=v,T.keyWordCompleter=p,T.snippetCompleter=f;var m={name:"expandSnippet",exec:function(t){return R.expandWithTab(t)},bindKey:"Tab"},k=function(t,o){C(o.session.$mode);},C=function(t){typeof t=="string"&&(t=S.$modes[t]),t&&(R.files||(R.files={}),A(t.$id,t.snippetFileId),t.modes&&t.modes.forEach(C));},A=function(t,o){!o||!t||R.files[t]||(R.files[t]={},S.loadModule(o,function(r){r&&(R.files[t]=r,!r.snippets&&r.snippetText&&(r.snippets=R.parseSnippetFile(r.snippetText)),R.register(r.snippets||[],r.scope),r.includeScopes&&(R.snippetMap[r.scope].includeScopes=r.includeScopes,r.includeScopes.forEach(function(h){C("ace/mode/"+h);})));}));},I=function(t){var o=t.editor,r=o.completer&&o.completer.activated;if(t.command.name==="backspace")r&&!u.getCompletionPrefix(o)&&o.completer.detach();else if(t.command.name==="insertstring"&&!r){c=t;var h=t.editor.$liveAutocompletionDelay;h?i.delay(h):e(t);}},c,i=d.delayedCall(function(){e(c);},0),e=function(t){var o=t.editor,r=u.getCompletionPrefix(o),h=t.args,g=u.triggerAutocomplete(o,h);if(r&&r.length>=o.$liveAutocompletionThreshold||g){var l=w.for(o);l.autoShown=!0,l.showPopup(o);}},n=a("../editor").Editor;a("../config").defineOptions(n.prototype,"editor",{enableBasicAutocompletion:{set:function(t){t?(this.completers||(this.completers=Array.isArray(t)?t:y),this.commands.addCommand(w.startCommand)):this.commands.removeCommand(w.startCommand);},value:!1},enableLiveAutocompletion:{set:function(t){t?(this.completers||(this.completers=Array.isArray(t)?t:y),this.commands.on("afterExec",I)):this.commands.off("afterExec",I);},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(t){t?(this.commands.addCommand(m),this.on("changeMode",k),k(null,this)):(this.commands.removeCommand(m),this.off("changeMode",k));},value:!1}});});(function(){ace.require(["ace/ext/language_tools"],function(a){typeof ae=="object"&&typeof Pe=="object"&&ae&&(ae.exports=a);});})();});var oe=styled(ne)(({theme:a})=>({borderBottom:`1px solid ${alpha(a.palette.grey[500],.32)}`,borderTop:`1px solid ${alpha(a.palette.grey[500],.32)}`,padding:16})),_e=styled(ne)(({theme:a})=>({border:`1px solid ${alpha(a.palette.grey[500],.32)}`,borderRadius:8,padding:12,"& .MuiInputBase-root":{background:a.palette.grey[100]}})),Re=styled(ne)(({theme:a})=>({display:"flex",textAlign:"center",flexDirection:"row",alignItems:"center",width:"100%",gap:8,height:34,backgroundColor:"#fff",padding:"8px 16px",borderRadius:8,border:`1px solid ${alpha(a.palette.grey[500],.24)}`,cursor:"pointer",color:a.palette.text.disabled,"&:hover, &:focus":{border:`1px solid ${a.palette.primary.main}`,backgroundColor:alpha(a.palette.primary.main,.05)}})),Ae=styled(ne)(({theme:a})=>({width:"100%","& fieldset":{border:`1px solid ${alpha(a.palette.grey[500],.24)}`,borderRadius:8,"& legend":{color:a.palette.text.disabled,fontSize:12}}})),ge=styled(at)({padding:0});var ht=({openPopover:a,handleClose:T,argumentsValues:L,filter:R,onExecute:w})=>{let[S,d]=useState([]),u=(p,b)=>{if(b&&b!=="")S.filter(y=>y.name===p).length>0?d(S.map(y=>y.name===p?{name:p,value:b}:y)):d([...S||[],{name:p,value:b}]);else {let f=S.filter(y=>y.name===p);d(f);}},v=()=>{let p=R||"";return S.forEach(b=>{p=p.replace(`$ARG[${b.name}]`,`'${b.value}'`);}),p};return jsxs(lt,{open:!!a,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:a,onClose:T,title:"Pr\xE9-visualizar",children:[jsx(ze,{variant:"subtitle1",color:"text.primary",p:1,children:"Pr\xE9-visualizar"}),jsx(oe,{children:L?.map((p,b)=>jsx(pt,{name:p,label:p,size:"small",onChange:f=>u(p,f.target.value),required:!0},b))}),jsxs(ne,{p:2,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(Ee,{variant:"outlined",color:"inherit",size:"small",onClick:T,children:"Cancelar"}),jsx(Ee,{variant:"contained",color:"primary",size:"small",startIcon:jsx(me,{icon:"PLAY_SIMPLE"}),onClick:()=>w(v()),disabled:S.length<L.length,children:"Executar"})]})]})},Le=ht;b($e());b(Fe());b(Oe());var yt=({openPopover:a,handleClose:T,addItem:L})=>{let[R,w]=useState("");return jsxs(lt,{open:!!a,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:a,onClose:T,sx:{maxWidth:464},title:"Novo Argumento",children:[jsx(ze,{variant:"subtitle1",color:"text.primary",p:1,children:"Novo Argumento"}),jsx(oe,{children:jsx(pt,{value:R,onChange:d=>w(d.target.value),name:"item",label:"Novo argumento",size:"small"})}),jsxs(ne,{p:1,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(Ee,{variant:"outlined",color:"inherit",size:"small",onClick:T,children:"Cancelar"}),jsx(Ee,{variant:"contained",color:"primary",size:"small",startIcon:jsx(me,{icon:"SAVE_MARK"}),disabled:!R||R==="",onClick:()=>{L(R),T(),w("");},children:"Salvar"})]})]})},He=yt;var Tt=({label:a,itens:T,argumentsValues:L,fields:R,addItem:w,removeItem:S,insertItemSQL:d})=>{let[u,v]=useState(!1),p=wt(),b=()=>{v(!u);},f=(m,k)=>{m.stopPropagation(),S&&S(k);},y=m=>{d(L?` $ARG[${m}]`:R?` this.${m}`:` ${m}`);};return jsxs(ne,{children:[jsxs(ne,{direction:"row",alignItems:"center",spacing:1.5,padding:1,paddingLeft:0,children:[jsx(ge,{edge:"end",onClick:b,children:jsx(me,{icon:u?"CHEVRON_UP":"CHEVRON_RIGHT"})}),jsx(ze,{variant:"overline",color:"text.primary",children:a}),w&&jsxs(Fragment,{children:[jsx(ge,{edge:"end",onClick:p.onOpen,children:jsx(me,{icon:"SIMPLE_ADD"})}),jsx(He,{addItem:w,handleClose:p.onClose,openPopover:p.open})]})]}),u&&jsx(ne,{spacing:.5,children:jsx(St,{sx:{maxHeight:150},children:T?.map((m,k)=>jsxs(Re,{direction:"row",justifyContent:"space-between",onClick:()=>y(m),children:[jsx(ze,{variant:"caption",textAlign:"center",width:"100%",children:m}),S&&jsx(at,{edge:"end",onClick:C=>f(C,m),children:jsx(me,{icon:"DELETE_MARK_BUTTON_02"})})]},k))})})]})},q=Tt;var Lt=({fieldsSelect:a,argumentsValues:T,onChangeArguments:L,sql:R,setSql:w,setFilterRule:S})=>{let[d,u]=useState(),{setValue:v}=useFormContext(),[p,b]=useState(1),[f,y]=useState(),m=c=>{f.session.insert(p,` ${c} `);},k=c=>{L([...T||[],c]);},C=c=>{L(T?.filter(i=>i!==c));},A=c=>{w(c[0]),S(c[0]),v("groups",void 0);},I=d?a.filter(c=>c.id.toString().toLocaleLowerCase().includes(d)||c.description.toString().toLocaleLowerCase().includes(d)||c.name?.toString().toLocaleLowerCase().includes(d)):a;return jsxs(ne,{direction:"row",padding:1.5,spacing:1.5,children:[jsxs(_e,{children:[jsx(Et,{value:d,trigger:"change",onSearch:c=>u(c?.toLocaleLowerCase()),fullWidth:!0,size:"small",placeholder:"Buscar",iconPosition:"start"}),jsx(q,{label:"Campos",fields:!0,itens:I.map(c=>c.name),insertItemSQL:m}),jsx(q,{label:"Argumentos",argumentsValues:!0,itens:T,addItem:k,removeItem:C,insertItemSQL:m}),jsx(q,{label:"Operadores",insertItemSQL:m,itens:["=",">","<","<=",">=","!=","IS NULL","IN","LIKE","NOT IN","NOT LIKE","IS NOT NULL"]}),jsx(q,{label:"Filtros",fields:!0,insertItemSQL:m,itens:I.map(c=>c.name)})]}),jsx(Ae,{children:jsxs("fieldset",{children:[jsx("legend",{children:"Regras de listagem"}),jsx(Rt,{width:"100%",mode:"sql",theme:"chrome",name:"rule",fontSize:14,onChange:A,onCursorChange:c=>b(c.getCursor()),value:R,onLoad:c=>y(c),showPrintMargin:!1,showGutter:!1,highlightActiveLine:!1,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!1,tabSize:2}})]})})]})},We=Lt;var Nt=({data:a,fields:T,isLoading:L,isError:R})=>jsxs(ne,{children:[jsx(ze,{variant:"subtitle2",color:"text.secondary",children:"PR\xC9 VISUALIZA\xC7\xC3O DOS RESULTADOS DA LISTAGEM"}),R&&jsx(ne,{children:"Falha ao gerar resultado"}),a&&jsx($t,{columns:T?.map(w=>({field:w,headerName:w,width:150,type:"string"})),loading:L,rows:a,disableRowSelectionOnClick:!0,disableColumnMenu:!0,disableColumnResize:!0,showColumnVerticalBorder:!0,hideFooter:!0})]}),je=Nt;var Xe=styled(ne)(({theme:a})=>({border:`1px solid ${alpha(a.palette.primary.main,.32)}`,backgroundColor:alpha(a.palette.primary.main,.08),borderRadius:8,padding:8,paddingLeft:24,alignItems:"center"})),Ge=styled(at)(()=>({height:"28px",marginLeft:"16px","&:hover":{backgroundColor:"transparent"}})),le=styled(ce)(()=>({width:230}));var Ut=({index:a,indexGroup:T,removeConditional:L,fieldsSelect:R})=>{let{watch:w}=useFormContext(),S=`groups.[${T}].conditionals[${a}].field`,d=`groups.[${T}].conditionals[${a}].conditional`,u=`groups.[${T}].conditionals[${a}].type`,v=`groups.[${T}].conditionals[${a}].value`,p=[{value:"=",label:"Igual a"},{value:">",label:"Maior que"},{value:"<",label:"Menor que"},{value:"<=",label:"Menor ou igual a"},{value:">=",label:"Maior ou igual a"},{value:"!=",label:"Diferente de"},{value:"IS NULL",label:"Est\xE1 vazio"},{value:"IN",label:"Contido em"},{value:"LIKE",label:"Contendo"},{value:"NOT IN",label:"N\xE3o contido em"},{value:"NOT LIKE",label:"N\xE3o cont\xE9m"},{value:"IS NOT NULL",label:"N\xE3o est\xE1 vazio"}],b=w(u);return jsxs(ne,{direction:"row",spacing:1.5,alignItems:"center",width:1,children:[jsx(ce,{label:"Se",name:S,size:"small",fullWidth:!0,options:R?.map(f=>({value:f.name,label:f.description}))}),jsx(ce,{label:"Estado",name:d,size:"small",fullWidth:!0,options:p}),jsx(ce,{label:"Objetivo",name:`groups.[${T}].conditionals[${a}].type`,size:"small",fullWidth:!0,options:[{label:"Valor",value:"value"},{label:"Campo",value:"field"}]}),b==="value"?jsx(Wt,{label:"Valor",name:v,size:"small",fullWidth:!0}):jsx(ce,{label:"Se",name:v,size:"small",fullWidth:!0,options:R?.map(f=>({value:f.name,label:f.description}))}),jsx(Ge,{color:"error",onClick:()=>{L(a);},children:jsx(me,{icon:"DELETE_MARK_BUTTON_02"})})]})},Ye=Ut;var Jt=({index:a,removeGroup:T,fieldsSelect:L})=>{let{control:R}=useFormContext(),w=`groups.[${a}].operator`,{fields:S,append:d,remove:u}=useFieldArray({name:`groups.${a}.conditionals`,control:R});return jsx(Kt,{name:`GRUPO ${a+1}`,description:"EXIBIR A LISTAGEM QUANDO ATENDER UMA DAS CONDI\xC7\xD5ES",header:jsx(le,{name:w,size:"small",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]}),onDelete:()=>T(a),children:jsxs(ne,{spacing:1.5,alignItems:"flex-start",children:[S.map((v,p)=>jsx(Ye,{index:p,indexGroup:a,removeConditional:b=>u(b),fieldsSelect:L},v.id)),jsx(Yt,{actionType:"NEW",onClick:()=>d({field:"",conditional:"=",type:"value",value:""}),variant:"text",size:"small",children:"Adicionar condi\xE7\xE3o"})]})})},Ke=Jt;var nn=({fieldsSelect:a})=>{let{control:T}=useFormContext(),{fields:L,append:R,remove:w}=useFieldArray({name:"groups",control:T});return jsxs(ne,{gap:1.5,children:[jsxs(Xe,{direction:"row",spacing:1.5,children:[jsx(ze,{variant:"body2",color:"text.light.primary",children:"Se"}),jsx(ne,{children:jsx(le,{size:"small",name:"operator",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]})}),jsxs(ze,{variant:"body2",color:"text.light.primary",children:["regra de ",jsx("strong",{children:"todos os grupos"})," \u201CSe\u201D forem cumpridas,"," ",jsx("strong",{children:"ir\xE1 exibir a listagem."})]})]}),L.map((S,d)=>jsx(Ke,{index:d,removeGroup:u=>w(u),fieldsSelect:a},S.id)),jsx(Ee,{size:"large",color:"inherit",startIcon:jsx(me,{icon:"SIMPLE_ADD"}),variant:"outlined",fullWidth:!0,onClick:()=>{R({operator:"or",conditionals:[{field:"",conditional:"=",type:"value",value:""}]});},children:"Adicionar grupo"})]})},Ze=nn;var qe=styled(ne)(({theme:a})=>({border:`1px solid ${alpha(a.palette.grey[500],.32)}`,borderRadius:8,marginTop:24})),et=styled(ne)(()=>({padding:12,borderBottom:"1px solid #e0e0e0"})),Se=styled(rn)(()=>({lineHeight:"1em"})),tt=styled(ne)(()=>({padding:12}));var hn=({argumentsValues:a,onChangeArguments:T,fieldsSelect:L,onChangeRule:R,onChangeSqlProcessed:w,defaultMode:S,defaultFilter:d,dataPreview:u,errorPreview:v,loadingPreview:p})=>{let[b,f]=useState(d||""),[y,m]=dn(),[k,C]=useState(S||"simple"),{watch:A,setValue:I}=useFormContext(),c=wt(),i=A("operator"),e=A("groups");useEffect(()=>()=>{I("config",{});},[]);let n=(r,h)=>{if(h==="advanced"){let g=a$1(e,i);f(g),w(g),R(g);}C(h);},t=r=>{y||k==="simple"||a.length===0?m():c.onOpen(r);},o=r=>{m(),w(r);};return jsx(Fragment,{children:jsxs(qe,{children:[jsxs(et,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxs(cn,{color:"primary",value:k,size:"small",exclusive:!0,onChange:n,children:[jsx(Se,{value:"simple",size:"small",children:"Modo simplificado"}),jsx(Se,{value:"advanced",size:"small",children:"Modo avan\xE7ado"})]}),jsx(Ee,{variant:"outlined",color:"inherit",onClick:r=>t(r),startIcon:!y&&jsx(me,{icon:"PLAY_SIMPLE",color:"primary.main"}),children:y?"Voltar":"Executar"}),!!c.open&&jsx(Le,{handleClose:c.onClose,openPopover:c.open,argumentsValues:a,filter:b,onExecute:r=>o(r)})]}),jsx(tt,{children:y?jsx(je,{fields:L.map(r=>r.name),data:u,isError:v,isLoading:p}):jsx(Fragment,{children:k==="simple"?jsx(Ze,{fieldsSelect:L,sql:b,setSql:f}):jsx(We,{fieldsSelect:L,argumentsValues:a,onChangeArguments:T,sql:b,setSql:f,setFilterRule:R})})})]})})},lr=hn;
|
|
295
|
+
`,"autocompletion.css",!1),T.AcePopup=A,T.$singleLineEditor=C,T.getAriaId=f;});ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(a,T,L){var R=function(){function w(S){this.editor=S,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv);}return w.prototype.setScreenReaderContent=function(S){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var u=this.popup.getRow(),v=this.popup.renderer.$textLayer,p=v.element.childNodes[u-v.config.firstRow];if(p){for(var b="doc-tooltip ",f=0;f<this._lines.length;f++)b+="ace-inline-screenreader-line-".concat(f," ");p.setAttribute("aria-describedby",b);}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=S.split(/\r\n|\r|\n/);var d=this.createCodeBlock();this.screenReaderDiv.appendChild(d);},w.prototype.destroy=function(){this.screenReaderDiv.remove();},w.prototype.createCodeBlock=function(){var S=document.createElement("pre");S.setAttribute("id","ace-inline-screenreader");for(var d=0;d<this._lines.length;d++){var u=document.createElement("code");u.setAttribute("id","ace-inline-screenreader-line-".concat(d));var v=document.createTextNode(this._lines[d]);u.appendChild(v),S.appendChild(u);}return S},w}();T.AceInlineScreenReader=R;});ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],function(a,T,L){var R=a("../snippets").snippetManager,w=a("./inline_screenreader").AceInlineScreenReader,S=function(){function d(){this.editor=null;}return d.prototype.show=function(u,v,p){if(p=p||"",u&&this.editor&&this.editor!==u&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!u||!v)return !1;this.inlineScreenReader||(this.inlineScreenReader=new w(u));var b=v.snippet?R.getDisplayTextForSnippet(u,v.snippet):v.value;return v.hideInlinePreview||!b||!b.startsWith(p)?!1:(this.editor=u,this.inlineScreenReader.setScreenReaderContent(b),b=b.slice(p.length),b===""?u.removeGhostText():u.setGhostText(b),!0)},d.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},d.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},d.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null);},d}();T.AceInline=S;});ace.define("ace/autocomplete/util",["require","exports","module"],function(a,T,L){T.parForEach=function(w,S,d){var u=0,v=w.length;v===0&&d();for(var p=0;p<v;p++)S(w[p],function(b,f){u++,u===v&&d(b,f);});};var R=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;T.retrievePrecedingIdentifier=function(w,S,d){d=d||R;for(var u=[],v=S-1;v>=0&&d.test(w[v]);v--)u.push(w[v]);return u.reverse().join("")},T.retrieveFollowingIdentifier=function(w,S,d){d=d||R;for(var u=[],v=S;v<w.length&&d.test(w[v]);v++)u.push(w[v]);return u},T.getCompletionPrefix=function(w){var S=w.getCursorPosition(),d=w.session.getLine(S.row),u;return w.completers.forEach(function(v){v.identifierRegexps&&v.identifierRegexps.forEach(function(p){!u&&p&&(u=this.retrievePrecedingIdentifier(d,S.column,p));}.bind(this));}.bind(this)),u||this.retrievePrecedingIdentifier(d,S.column)},T.triggerAutocomplete=function(w,d){var d=d??w.session.getPrecedingCharacter();return w.completers.some(function(u){if(u.triggerCharacters&&Array.isArray(u.triggerCharacters))return u.triggerCharacters.includes(d)})};});ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"],function(a,T,L){var R=a("./keyboard/hash_handler").HashHandler,w=a("./autocomplete/popup").AcePopup,S=a("./autocomplete/inline").AceInline,d=a("./autocomplete/popup").getAriaId,u=a("./autocomplete/util"),v=a("./lib/lang"),p=a("./lib/dom"),b=a("./snippets").snippetManager,f=a("./config"),y=a("./lib/event"),m=a("./lib/scroll").preventParentScroll,k=function(c,i){i.completer&&i.completer.destroy();},C=function(){function c(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new R,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=v.delayedCall(function(){this.updateCompletions(!0);}.bind(this)),this.tooltipTimer=v.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=v.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=v.delayedCall(function(){this.stickySelection=!0;}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=v.delayedCall(function(){var i=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!i||this.editor.completers.length===0||(this.completions=new I(c.completionsForLoading),this.openPopup(this.editor,i.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0));}.bind(this),this.stickySelectionDelay);}return Object.defineProperty(c,"completionsForLoading",{get:function(){return [{caption:f.nls("autocomplete.loading","Loading..."),value:""}]},enumerable:!1,configurable:!0}),c.prototype.$init=function(){return this.popup=new w(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(i){this.insertMatch(),i.stop();}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupShow.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),y.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup.renderer.on("afterRender",this.$onPopupRender.bind(this)),this.popup},c.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new S,this.inlineRenderer},c.prototype.getPopup=function(){return this.popup||this.$init()},c.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1;},c.prototype.$seen=function(i){!this.hasSeen.has(i)&&i&&i.completer&&i.completer.onSeen&&typeof i.completer.onSeen=="function"&&(i.completer.onSeen(this.editor,i),this.hasSeen.add(i));},c.prototype.$onPopupChange=function(i){if(this.inlineRenderer&&this.inlineEnabled){var e=i?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(e),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule();}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null);},c.prototype.$updateGhostText=function(i){var e=this.base.row,n=this.base.column,t=this.editor.getCursorPosition().column,o=this.editor.session.getLine(e).slice(n,t);this.inlineRenderer.show(this.editor,i,o)?this.$seen(i):this.inlineRenderer.hide();},c.prototype.$onPopupRender=function(){var i=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var e=this.popup.getFirstVisibleRow();e<=this.popup.getLastVisibleRow();e++){var n=this.popup.getData(e);n&&(!i||n.hideInlinePreview)&&this.$seen(n);}},c.prototype.$onPopupShow=function(i){this.$onPopupChange(i),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay);},c.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var i=this.editor.container.parentNode,e=[];i;)e.push(i),i.addEventListener("scroll",this.onLayoutChange,{passive:!0}),i=i.parentNode;this.$elements=e;}},c.prototype.unObserveLayoutChanges=function(){var i=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(e){e.removeEventListener("scroll",i.onLayoutChange,{passive:!0});}),this.$elements=null;},c.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip();},c.prototype.$updatePopupPosition=function(){var i=this.editor,e=i.renderer,n=e.layerConfig.lineHeight,t=e.$cursorLayer.getPixelPosition(this.base,!0);t.left-=this.popup.getTextLeftOffset();var o=i.container.getBoundingClientRect();t.top+=o.top-e.layerConfig.offset,t.left+=o.left-i.renderer.scrollLeft,t.left+=e.gutterWidth;var r={top:t.top,left:t.left};e.$ghostText&&e.$ghostTextWidget&&this.base.row===e.$ghostText.position.row&&(r.top+=e.$ghostTextWidget.el.offsetHeight);var h=i.container.getBoundingClientRect().bottom-n,g=h<r.top?{top:h,left:r.left}:r;this.popup.tryShow(g,n,"bottom")||this.popup.tryShow(t,n,"top")||this.popup.show(t,n);},c.prototype.openPopup=function(i,e,n){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var t=this.popup.getRow(),o=this.popup.data[t];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:d(this.popup.getRow()),inline:this.inlineEnabled}),i.keyBinding.addKeyboardHandler(this.keyboardHandler);var r;this.stickySelection&&(r=this.popup.data.indexOf(o)),(!r||r===-1)&&(r=0),this.popup.setRow(this.autoSelect?r:-1),r===t&&o!==this.completions.filtered[r]&&this.$onPopupChange();var h=this.inlineRenderer&&this.inlineEnabled;if(r===t&&h){var g=this.popup.getData(this.popup.getRow());this.$updateGhostText(g);}n||(this.popup.setTheme(i.getTheme()),this.popup.setFontSize(i.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges();},c.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges();},c.prototype.changeListener=function(i){var e=this.editor.selection.lead;(e.row!=this.base.row||e.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach();},c.prototype.blurListener=function(i){var e=document.activeElement,n=this.editor.textInput.getElement(),t=i.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(i.relatedTarget),o=this.popup&&this.popup.container;e!=n&&e.parentNode!=o&&!t&&e!=this.tooltipNode&&i.relatedTarget!=n&&this.detach();},c.prototype.mousedownListener=function(i){this.detach();},c.prototype.mousewheelListener=function(i){this.popup&&!this.popup.isMouseOver&&this.detach();},c.prototype.mouseOutListener=function(i){this.popup.isOpen&&this.$updatePopupPosition();},c.prototype.goTo=function(i){this.popup.goTo(i);},c.prototype.insertMatch=function(i,e){if(i||(i=this.popup.getData(this.popup.getRow())),!i)return !1;if(i.value==="")return this.detach();var n=this.completions,t=this.getCompletionProvider().insertMatch(this.editor,i,n.filterText,e);return this.completions==n&&this.detach(),t},c.prototype.showPopup=function(i,e){this.editor&&this.detach(),this.activated=!0,this.editor=i,i.completer!=this&&(i.completer&&i.completer.detach(),i.completer=this),i.on("changeSelection",this.changeListener),i.on("blur",this.blurListener),i.on("mousedown",this.mousedownListener),i.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,e);},c.prototype.getCompletionProvider=function(i){return this.completionProvider||(this.completionProvider=new A(i)),this.completionProvider},c.prototype.gatherCompletions=function(i,e){return this.getCompletionProvider().gatherCompletions(i,e)},c.prototype.updateCompletions=function(i,e){if(i&&this.base&&this.completions){var t=this.editor.getCursorPosition(),o=this.editor.session.getTextRange({start:this.base,end:t});if(o==this.completions.filterText)return;if(this.completions.setFilter(o),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==o&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,o,i);return}if(e&&e.matches){var t=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(t.row,t.column),this.base.$insertRight=!0,this.completions=new I(e.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",i)}var n=this.editor.getSession(),t=this.editor.getCursorPosition(),o=u.getCompletionPrefix(this.editor);this.base=n.doc.createAnchor(t.row,t.column-o.length),this.base.$insertRight=!0;var r={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:o,pos:t}).provideCompletions(this.editor,r,function(h,g,l){var x=g.filtered,s=u.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),l){if(!x.length){var _=!this.autoShown&&this.emptyMessage;if(typeof _=="function"&&(_=this.emptyMessage(s)),_){var M=[{caption:_,value:""}];this.completions=new I(M),this.openPopup(this.editor,s,i),this.popup.renderer.setStyle("ace_loading",!1),this.popup.renderer.setStyle("ace_empty-message",!0);return}return this.detach()}if(x.length==1&&x[0].value==s&&!x[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&x.length==1)return this.insertMatch(x[0])}this.completions=!l&&this.showLoadingState?new I(c.completionsForLoading.concat(x),g.filterText):g,this.openPopup(this.editor,s,i),this.popup.renderer.setStyle("ace_empty-message",!1),this.popup.renderer.setStyle("ace_loading",!l);}.bind(this)),this.showLoadingState&&!this.autoShown&&!(this.popup&&this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2);},c.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu();},c.prototype.updateDocTooltip=function(){var i=this.popup,e=this.completions.filtered,n=e&&(e[i.getHoveredRow()]||e[i.getRow()]),t=null;if(!n||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var o=this.editor.completers.length,r=0;r<o;r++){var h=this.editor.completers[r];if(h.getDocTooltip&&n.completerId===h.id){t=h.getDocTooltip(n);break}}if(!t&&typeof n!="string"&&(t=n),typeof t=="string"&&(t={docText:t}),!t||!(t.docHTML||t.docText))return this.hideDocTooltip();this.showDocTooltip(t);},c.prototype.showDocTooltip=function(i){this.tooltipNode||(this.tooltipNode=p.createElement("div"),this.tooltipNode.style.margin="0",this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.style.overscrollBehavior="contain",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"),this.tooltipNode.addEventListener("wheel",m));var e=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(e.isDark?"ace_dark ":"")+(e.cssClass||"");var n=this.tooltipNode;i.docHTML?n.innerHTML=i.docHTML:i.docText&&(n.textContent=i.docText),n.parentNode||this.popup.container.appendChild(this.tooltipNode);var t=this.popup,o=t.container.getBoundingClientRect();n.style.top=t.container.style.top,n.style.bottom=t.container.style.bottom,n.style.display="block",window.innerWidth-o.right<320?o.left<320?t.isTopdown?(n.style.top=o.bottom+"px",n.style.left=o.left+"px",n.style.right="",n.style.bottom=""):(n.style.top=t.container.offsetTop-n.offsetHeight+"px",n.style.left=o.left+"px",n.style.right="",n.style.bottom=""):(n.style.right=window.innerWidth-o.left+"px",n.style.left=""):(n.style.left=o.right+1+"px",n.style.right="");},c.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var i=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==i&&this.editor.focus(),this.tooltipNode=null,i.parentNode&&i.parentNode.removeChild(i);}},c.prototype.onTooltipClick=function(i){for(var e=i.target;e&&e!=this.tooltipNode;){if(e.nodeName=="A"&&e.href){e.rel="noreferrer",e.target="_blank";break}e=e.parentNode;}},c.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var i=this.popup.container;i&&i.parentNode&&i.parentNode.removeChild(i);}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",k),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null;},c}();C.prototype.commands={Up:function(c){c.completer.goTo("up");},Down:function(c){c.completer.goTo("down");},"Ctrl-Up|Ctrl-Home":function(c){c.completer.goTo("start");},"Ctrl-Down|Ctrl-End":function(c){c.completer.goTo("end");},Esc:function(c){c.completer.detach();},Return:function(c){return c.completer.insertMatch()},"Shift-Return":function(c){c.completer.insertMatch(null,{deleteSuffix:!0});},Tab:function(c){var i=c.completer.insertMatch();if(!i&&!c.tabstopManager)c.completer.goTo("down");else return i},Backspace:function(c){c.execCommand("backspace");var i=u.getCompletionPrefix(c);!i&&c.completer&&c.completer.detach();},PageUp:function(c){c.completer.popup.gotoPageUp();},PageDown:function(c){c.completer.popup.gotoPageDown();}},C.for=function(c){return c.completer instanceof C||(c.completer&&(c.completer.destroy(),c.completer=null),f.get("sharedPopups")?(C.$sharedInstance||(C.$sharedInstance=new C),c.completer=C.$sharedInstance):(c.completer=new C,c.once("destroy",k))),c.completer},C.startCommand={name:"startAutocomplete",exec:function(c,i){var e=C.for(c);e.autoInsert=!1,e.autoSelect=!0,e.autoShown=!1,e.showPopup(c,i),e.cancelContextMenu();},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var A=function(){function c(i){this.initialPosition=i,this.active=!0;}return c.prototype.insertByIndex=function(i,e,n){return !this.completions||!this.completions.filtered?!1:this.insertMatch(i,this.completions.filtered[e],n)},c.prototype.insertMatch=function(i,e,n){if(!e)return !1;if(i.startOperation({command:{name:"insertMatch"}}),e.completer&&e.completer.insertMatch)e.completer.insertMatch(i,e);else {if(!this.completions)return !1;var t=this.completions.filterText.length,o=0;if(e.range&&e.range.start.row===e.range.end.row&&(t-=this.initialPosition.prefix.length,t+=this.initialPosition.pos.column-e.range.start.column,o+=e.range.end.column-this.initialPosition.pos.column),t||o){var r;i.selection.getAllRanges?r=i.selection.getAllRanges():r=[i.getSelectionRange()];for(var h=0,g;g=r[h];h++)g.start.column-=t,g.end.column+=o,i.session.remove(g);}e.snippet?b.insertSnippet(i,e.snippet):this.$insertString(i,e),e.completer&&e.completer.onInsert&&typeof e.completer.onInsert=="function"&&e.completer.onInsert(i,e),e.command&&e.command==="startAutocomplete"&&i.execCommand(e.command);}return i.endOperation(),!0},c.prototype.$insertString=function(i,e){var n=e.value||e;i.execCommand("insertstring",n);},c.prototype.gatherCompletions=function(i,e){var n=i.getSession(),t=i.getCursorPosition(),o=u.getCompletionPrefix(i),r=[];this.completers=i.completers;var h=i.completers.length;return i.completers.forEach(function(g,l){g.getCompletions(i,n,t,o,function(x,s){g.hideInlinePreview&&(s=s.map(function(_){return Object.assign(_,{hideInlinePreview:g.hideInlinePreview})})),!x&&s&&(r=r.concat(s)),e(null,{prefix:u.getCompletionPrefix(i),matches:r,finished:--h===0});});}),!0},c.prototype.provideCompletions=function(i,e,n){var t=function(g){var l=g.prefix,x=g.matches;this.completions=new I(x),e.exactMatch&&(this.completions.exactMatch=!0),e.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(l),(g.finished||this.completions.filtered.length)&&n(null,this.completions,g.finished);}.bind(this),o=!0,r=null;if(this.gatherCompletions(i,function(g,l){if(this.active){g&&(n(g,[],!0),this.detach());var x=l.prefix;if(x.indexOf(l.prefix)===0){if(o){r=l;return}t(l);}}}.bind(this)),o=!1,r){var h=r;r=null,t(h);}},c.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(i){typeof i.cancel=="function"&&i.cancel();});},c}(),I=function(){function c(i,e){this.all=i,this.filtered=i,this.filterText=e||"",this.exactMatch=!1,this.ignoreCaption=!1;}return c.prototype.setFilter=function(i){if(i.length>this.filterText&&i.lastIndexOf(this.filterText,0)===0)var e=this.filtered;else var e=this.all;this.filterText=i,e=this.filterCompletions(e,this.filterText),e=e.sort(function(t,o){return o.exactMatch-t.exactMatch||o.$score-t.$score||(t.caption||t.value).localeCompare(o.caption||o.value)});var n=null;e=e.filter(function(t){var o=t.snippet||t.caption||t.value;return o===n?!1:(n=o,!0)}),this.filtered=e;},c.prototype.filterCompletions=function(i,e){var n=[],t=e.toUpperCase(),o=e.toLowerCase();e:for(var r=0,h;h=i[r];r++){var g=!this.ignoreCaption&&h.caption||h.value||h.snippet;if(g){var l=-1,x=0,s=0,_,M;if(this.exactMatch){if(e!==g.substr(0,e.length))continue e}else {var E=g.toLowerCase().indexOf(o);if(E>-1)s=E;else for(var $=0;$<e.length;$++){var N=g.indexOf(o[$],l+1),P=g.indexOf(t[$],l+1);if(_=N>=0&&(P<0||N<P)?N:P,_<0)continue e;M=_-l-1,M>0&&(l===-1&&(s+=10),s+=M,x=x|1<<$),l=_;}}h.matchMask=x,h.exactMatch=s?0:1,h.$score=(h.score||0)-s,n.push(h);}}return n},c}();T.Autocomplete=C,T.CompletionProvider=A,T.FilteredList=I;});ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(a,T,L){var R=a("../range").Range,w=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function S(u,v){var p=u.getTextRange(R.fromPoints({row:0,column:0},v));return p.split(w).length-1}function d(u,v){var p=S(u,v),b=u.getValue().split(w),f=Object.create(null),y=b[p];return b.forEach(function(m,k){if(!(!m||m===y)){var C=Math.abs(p-k),A=b.length-C;f[m]?f[m]=Math.max(A,f[m]):f[m]=A;}}),f}T.getCompletions=function(u,v,p,b,f){var y=d(v,p),m=Object.keys(y);f(null,m.map(function(k){return {caption:k,value:k,score:y[k],meta:"local"}}));};});ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(a,T,L){var R=a("../snippets").snippetManager,w=a("../autocomplete").Autocomplete,S=a("../config"),d=a("../lib/lang"),u=a("../autocomplete/util"),v=a("../autocomplete/text_completer"),p={getCompletions:function(t,o,r,h,g){if(o.$mode.completer)return o.$mode.completer.getCompletions(t,o,r,h,g);var l=t.session.getState(r.row),x=o.$mode.getCompletions(l,o,r,h);x=x.map(function(s){return s.completerId=p.id,s}),g(null,x);},id:"keywordCompleter"},b=function(t){var o={};return t.replace(/\${(\d+)(:(.*?))?}/g,function(r,h,g,l){return o[h]=l||""}).replace(/\$(\d+?)/g,function(r,h){return o[h]})},f={getCompletions:function(t,o,r,h,g){var l=[],x=o.getTokenAt(r.row,r.column);x&&x.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?l.push("html-tag"):l=R.getActiveScopes(t);var s=R.snippetMap,_=[];l.forEach(function(M){for(var E=s[M]||[],$=E.length;$--;){var N=E[$],P=N.name||N.tabTrigger;P&&_.push({caption:P,snippet:N.content,meta:N.tabTrigger&&!N.name?N.tabTrigger+"\u21E5 ":"snippet",completerId:f.id});}},this),g(null,_);},getDocTooltip:function(t){t.snippet&&!t.docHTML&&(t.docHTML=["<b>",d.escapeHTML(t.caption),"</b>","<hr></hr>",d.escapeHTML(b(t.snippet))].join(""));},id:"snippetCompleter"},y=[f,v,p];T.setCompleters=function(t){y.length=0,t&&y.push.apply(y,t);},T.addCompleter=function(t){y.push(t);},T.textCompleter=v,T.keyWordCompleter=p,T.snippetCompleter=f;var m={name:"expandSnippet",exec:function(t){return R.expandWithTab(t)},bindKey:"Tab"},k=function(t,o){C(o.session.$mode);},C=function(t){typeof t=="string"&&(t=S.$modes[t]),t&&(R.files||(R.files={}),A(t.$id,t.snippetFileId),t.modes&&t.modes.forEach(C));},A=function(t,o){!o||!t||R.files[t]||(R.files[t]={},S.loadModule(o,function(r){r&&(R.files[t]=r,!r.snippets&&r.snippetText&&(r.snippets=R.parseSnippetFile(r.snippetText)),R.register(r.snippets||[],r.scope),r.includeScopes&&(R.snippetMap[r.scope].includeScopes=r.includeScopes,r.includeScopes.forEach(function(h){C("ace/mode/"+h);})));}));},I=function(t){var o=t.editor,r=o.completer&&o.completer.activated;if(t.command.name==="backspace")r&&!u.getCompletionPrefix(o)&&o.completer.detach();else if(t.command.name==="insertstring"&&!r){c=t;var h=t.editor.$liveAutocompletionDelay;h?i.delay(h):e(t);}},c,i=d.delayedCall(function(){e(c);},0),e=function(t){var o=t.editor,r=u.getCompletionPrefix(o),h=t.args,g=u.triggerAutocomplete(o,h);if(r&&r.length>=o.$liveAutocompletionThreshold||g){var l=w.for(o);l.autoShown=!0,l.showPopup(o);}},n=a("../editor").Editor;a("../config").defineOptions(n.prototype,"editor",{enableBasicAutocompletion:{set:function(t){t?(this.completers||(this.completers=Array.isArray(t)?t:y),this.commands.addCommand(w.startCommand)):this.commands.removeCommand(w.startCommand);},value:!1},enableLiveAutocompletion:{set:function(t){t?(this.completers||(this.completers=Array.isArray(t)?t:y),this.commands.on("afterExec",I)):this.commands.off("afterExec",I);},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(t){t?(this.commands.addCommand(m),this.on("changeMode",k),k(null,this)):(this.commands.removeCommand(m),this.off("changeMode",k));},value:!1}});});(function(){ace.require(["ace/ext/language_tools"],function(a){typeof ae=="object"&&typeof Pe=="object"&&ae&&(ae.exports=a);});})();});var oe=styled(ne)(({theme:a})=>({borderBottom:`1px solid ${alpha(a.palette.grey[500],.32)}`,borderTop:`1px solid ${alpha(a.palette.grey[500],.32)}`,padding:16})),_e=styled(ne)(({theme:a})=>({border:`1px solid ${alpha(a.palette.grey[500],.32)}`,borderRadius:8,padding:12,"& .MuiInputBase-root":{background:a.palette.grey[100]}})),Re=styled(ne)(({theme:a})=>({display:"flex",textAlign:"center",flexDirection:"row",alignItems:"center",width:"100%",gap:8,height:34,backgroundColor:"#fff",padding:"8px 16px",borderRadius:8,border:`1px solid ${alpha(a.palette.grey[500],.24)}`,cursor:"pointer",color:a.palette.text.disabled,"&:hover, &:focus":{border:`1px solid ${a.palette.primary.main}`,backgroundColor:alpha(a.palette.primary.main,.05)}})),Ae=styled(ne)(({theme:a})=>({width:"100%","& fieldset":{border:`1px solid ${alpha(a.palette.grey[500],.24)}`,borderRadius:8,"& legend":{color:a.palette.text.disabled,fontSize:12}}})),ge=styled(at)({padding:0});var ht=({openPopover:a,handleClose:T,argumentsValues:L,filter:R,onExecute:w})=>{let[S,d]=useState([]),u=(p,b)=>{if(b&&b!=="")S.filter(y=>y.name===p).length>0?d(S.map(y=>y.name===p?{name:p,value:b}:y)):d([...S||[],{name:p,value:b}]);else {let f=S.filter(y=>y.name===p);d(f);}},v=()=>{let p=R||"";return S.forEach(b=>{p=p.replace(`$ARG[${b.name}]`,`'${b.value}'`);}),p};return jsxs(lt,{open:!!a,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:a,onClose:T,title:"Pr\xE9-visualizar",children:[jsx(ze,{variant:"subtitle1",color:"text.primary",p:1,children:"Pr\xE9-visualizar"}),jsx(oe,{children:L?.map((p,b)=>jsx(pt,{name:p,label:p,size:"small",onChange:f=>u(p,f.target.value),required:!0},b))}),jsxs(ne,{p:2,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(Ee,{variant:"outlined",color:"inherit",size:"small",onClick:T,children:"Cancelar"}),jsx(Ee,{variant:"contained",color:"primary",size:"small",startIcon:jsx(me,{icon:"PLAY_SIMPLE"}),onClick:()=>w(v()),disabled:S.length<L.length,children:"Executar"})]})]})},Le=ht;b($e());b(Fe());b(Oe());var yt=({openPopover:a,handleClose:T,addItem:L})=>{let[R,w]=useState("");return jsxs(lt,{open:!!a,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:a,onClose:T,sx:{maxWidth:464},title:"Novo Argumento",children:[jsx(ze,{variant:"subtitle1",color:"text.primary",p:1,children:"Novo Argumento"}),jsx(oe,{children:jsx(pt,{value:R,onChange:d=>w(d.target.value),name:"item",label:"Novo argumento",size:"small"})}),jsxs(ne,{p:1,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(Ee,{variant:"outlined",color:"inherit",size:"small",onClick:T,children:"Cancelar"}),jsx(Ee,{variant:"contained",color:"primary",size:"small",startIcon:jsx(me,{icon:"SAVE_MARK"}),disabled:!R||R==="",onClick:()=>{L(R),T(),w("");},children:"Salvar"})]})]})},He=yt;var Tt=({label:a,itens:T,argumentsValues:L,fields:R,addItem:w,removeItem:S,insertItemSQL:d})=>{let[u,v]=useState(!1),p=wt(),b=()=>{v(!u);},f=(m,k)=>{m.stopPropagation(),S&&S(k);},y=m=>{d(L?` $ARG[${m}]`:R?` this.${m}`:` ${m}`);};return jsxs(ne,{children:[jsxs(ne,{direction:"row",alignItems:"center",spacing:1.5,padding:1,paddingLeft:0,children:[jsx(ge,{edge:"end",onClick:b,children:jsx(me,{icon:u?"CHEVRON_UP":"CHEVRON_RIGHT"})}),jsx(ze,{variant:"overline",color:"text.primary",children:a}),w&&jsxs(Fragment,{children:[jsx(ge,{edge:"end",onClick:p.onOpen,children:jsx(me,{icon:"SIMPLE_ADD"})}),jsx(He,{addItem:w,handleClose:p.onClose,openPopover:p.open})]})]}),u&&jsx(ne,{spacing:.5,children:jsx(St,{sx:{maxHeight:150},children:T?.map((m,k)=>jsxs(Re,{direction:"row",justifyContent:"space-between",onClick:()=>y(m),children:[jsx(ze,{variant:"caption",textAlign:"center",width:"100%",children:m}),S&&jsx(at,{edge:"end",onClick:C=>f(C,m),children:jsx(me,{icon:"DELETE_MARK_BUTTON_02"})})]},k))})})]})},q=Tt;var Lt=({fieldsSelect:a,argumentsValues:T,onChangeArguments:L,sql:R,setSql:w,setFilterRule:S})=>{let[d,u]=useState(),{setValue:v}=useFormContext(),[p,b]=useState(1),[f,y]=useState(),m=c=>{f.session.insert(p,` ${c} `);},k=c=>{L([...T||[],c]);},C=c=>{L(T?.filter(i=>i!==c));},A=c=>{w(c[0]),S(c[0]),v("groups",void 0);},I=d?a.filter(c=>c.id.toString().toLocaleLowerCase().includes(d)||c.description.toString().toLocaleLowerCase().includes(d)||c.name?.toString().toLocaleLowerCase().includes(d)):a;return jsxs(ne,{direction:"row",padding:1.5,spacing:1.5,children:[jsxs(_e,{children:[jsx(Et,{value:d,trigger:"change",onSearch:c=>u(c?.toLocaleLowerCase()),fullWidth:!0,size:"small",placeholder:"Buscar",iconPosition:"start"}),jsx(q,{label:"Campos",fields:!0,itens:I.map(c=>c.name),insertItemSQL:m}),jsx(q,{label:"Argumentos",argumentsValues:!0,itens:T,addItem:k,removeItem:C,insertItemSQL:m}),jsx(q,{label:"Operadores",insertItemSQL:m,itens:["=",">","<","<=",">=","!=","IS NULL","IN","LIKE","NOT IN","NOT LIKE","IS NOT NULL"]}),jsx(q,{label:"Filtros",fields:!0,insertItemSQL:m,itens:I.map(c=>c.name)})]}),jsx(Ae,{children:jsxs("fieldset",{children:[jsx("legend",{children:"Regras de listagem"}),jsx(Rt,{width:"100%",mode:"sql",theme:"chrome",name:"rule",fontSize:14,onChange:A,onCursorChange:c=>b(c.getCursor()),value:`${R?.toString()}`,onLoad:c=>y(c),showPrintMargin:!1,showGutter:!1,highlightActiveLine:!1,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!1,tabSize:2}})]})})]})},We=Lt;var Nt=({data:a,fields:T,isLoading:L,isError:R})=>jsxs(ne,{children:[jsx(ze,{variant:"subtitle2",color:"text.secondary",children:"PR\xC9 VISUALIZA\xC7\xC3O DOS RESULTADOS DA LISTAGEM"}),R&&jsx(ne,{children:"Falha ao gerar resultado"}),a&&jsx($t,{columns:T?.map(w=>({field:w,headerName:w,width:150,type:"string"})),loading:L,rows:a,disableRowSelectionOnClick:!0,disableColumnMenu:!0,disableColumnResize:!0,showColumnVerticalBorder:!0,hideFooter:!0})]}),je=Nt;var Xe=styled(ne)(({theme:a})=>({border:`1px solid ${alpha(a.palette.primary.main,.32)}`,backgroundColor:alpha(a.palette.primary.main,.08),borderRadius:8,padding:8,paddingLeft:24,alignItems:"center"})),Ge=styled(at)(()=>({height:"28px",marginLeft:"16px","&:hover":{backgroundColor:"transparent"}})),le=styled(ce)(()=>({width:230}));var Ut=({index:a,indexGroup:T,removeConditional:L,fieldsSelect:R})=>{let{watch:w}=useFormContext(),S=`groups.[${T}].conditionals[${a}].field`,d=`groups.[${T}].conditionals[${a}].conditional`,u=`groups.[${T}].conditionals[${a}].type`,v=`groups.[${T}].conditionals[${a}].value`,p=[{value:"=",label:"Igual a"},{value:">",label:"Maior que"},{value:"<",label:"Menor que"},{value:"<=",label:"Menor ou igual a"},{value:">=",label:"Maior ou igual a"},{value:"!=",label:"Diferente de"},{value:"IS NULL",label:"Est\xE1 vazio"},{value:"IN",label:"Contido em"},{value:"LIKE",label:"Contendo"},{value:"NOT IN",label:"N\xE3o contido em"},{value:"NOT LIKE",label:"N\xE3o cont\xE9m"},{value:"IS NOT NULL",label:"N\xE3o est\xE1 vazio"}],b=w(u);return jsxs(ne,{direction:"row",spacing:1.5,alignItems:"center",width:1,children:[jsx(ce,{label:"Se",name:S,size:"small",fullWidth:!0,options:R?.map(f=>({value:f.name,label:f.description}))}),jsx(ce,{label:"Estado",name:d,size:"small",fullWidth:!0,options:p}),jsx(ce,{label:"Objetivo",name:`groups.[${T}].conditionals[${a}].type`,size:"small",fullWidth:!0,options:[{label:"Valor",value:"value"},{label:"Campo",value:"field"}]}),b==="value"?jsx(Wt,{label:"Valor",name:v,size:"small",fullWidth:!0}):jsx(ce,{label:"Se",name:v,size:"small",fullWidth:!0,options:R?.map(f=>({value:f.name,label:f.description}))}),jsx(Ge,{color:"error",onClick:()=>{L(a);},children:jsx(me,{icon:"DELETE_MARK_BUTTON_02"})})]})},Ye=Ut;var Jt=({index:a,removeGroup:T,fieldsSelect:L})=>{let{control:R}=useFormContext(),w=`groups.[${a}].operator`,{fields:S,append:d,remove:u}=useFieldArray({name:`groups.${a}.conditionals`,control:R});return jsx(Kt,{name:`GRUPO ${a+1}`,description:"EXIBIR A LISTAGEM QUANDO ATENDER UMA DAS CONDI\xC7\xD5ES",header:jsx(le,{name:w,size:"small",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]}),onDelete:()=>T(a),children:jsxs(ne,{spacing:1.5,alignItems:"flex-start",children:[S.map((v,p)=>jsx(Ye,{index:p,indexGroup:a,removeConditional:b=>u(b),fieldsSelect:L},v.id)),jsx(Yt,{actionType:"NEW",onClick:()=>d({field:"",conditional:"=",type:"value",value:""}),variant:"text",size:"small",children:"Adicionar condi\xE7\xE3o"})]})})},Ke=Jt;var nn=({fieldsSelect:a})=>{let{control:T}=useFormContext(),{fields:L,append:R,remove:w}=useFieldArray({name:"groups",control:T});return jsxs(ne,{gap:1.5,children:[jsxs(Xe,{direction:"row",spacing:1.5,children:[jsx(ze,{variant:"body2",color:"text.light.primary",children:"Se"}),jsx(ne,{children:jsx(le,{size:"small",name:"operator",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]})}),jsxs(ze,{variant:"body2",color:"text.light.primary",children:["regra de ",jsx("strong",{children:"todos os grupos"})," \u201CSe\u201D forem cumpridas,"," ",jsx("strong",{children:"ir\xE1 exibir a listagem."})]})]}),L.map((S,d)=>jsx(Ke,{index:d,removeGroup:u=>w(u),fieldsSelect:a},S.id)),jsx(Ee,{size:"large",color:"inherit",startIcon:jsx(me,{icon:"SIMPLE_ADD"}),variant:"outlined",fullWidth:!0,onClick:()=>{R({operator:"or",conditionals:[{field:"",conditional:"=",type:"value",value:""}]});},children:"Adicionar grupo"})]})},Ze=nn;var qe=styled(ne)(({theme:a})=>({border:`1px solid ${alpha(a.palette.grey[500],.32)}`,borderRadius:8,marginTop:24})),et=styled(ne)(()=>({padding:12,borderBottom:"1px solid #e0e0e0"})),Se=styled(rn)(()=>({lineHeight:"1em"})),tt=styled(ne)(()=>({padding:12}));var hn=({argumentsValues:a,onChangeArguments:T,fieldsSelect:L,onChangeRule:R,onChangeSqlProcessed:w,defaultMode:S,defaultFilter:d,dataPreview:u,errorPreview:v,loadingPreview:p})=>{let[b,f]=useState(d||""),[y,m]=dn(),[k,C]=useState(S||"simple"),{watch:A,setValue:I}=useFormContext(),c=wt(),i=A("operator"),e=A("groups");useEffect(()=>()=>{I("config",{});},[]);let n=(r,h)=>{if(h==="advanced"){let g=a$1(e,i);f(g),w(g),R(g);}C(h);},t=r=>{y||k==="simple"||a.length===0?m():c.onOpen(r);},o=r=>{m(),w(r);};return jsx(Fragment,{children:jsxs(qe,{children:[jsxs(et,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxs(cn,{color:"primary",value:k,size:"small",exclusive:!0,onChange:n,children:[jsx(Se,{value:"simple",size:"small",children:"Modo simplificado"}),jsx(Se,{value:"advanced",size:"small",children:"Modo avan\xE7ado"})]}),jsx(Ee,{variant:"outlined",color:"inherit",onClick:r=>t(r),startIcon:!y&&jsx(me,{icon:"PLAY_SIMPLE",color:"primary.main"}),children:y?"Voltar":"Executar"}),!!c.open&&jsx(Le,{handleClose:c.onClose,openPopover:c.open,argumentsValues:a,filter:b,onExecute:r=>o(r)})]}),jsx(tt,{children:y?jsx(je,{fields:L.map(r=>r.name),data:u,isError:v,isLoading:p}):jsx(Fragment,{children:k==="simple"?jsx(Ze,{fieldsSelect:L,sql:b,setSql:f}):jsx(We,{fieldsSelect:L,argumentsValues:a,onChangeArguments:T,sql:b,setSql:f,setFilterRule:R})})})]})})},lr=hn;
|
|
296
296
|
|
|
297
297
|
export { lr as default };
|
package/package.json
CHANGED