"use strict";(self.webpackChunkwebpackcloud=self.webpackChunkwebpackcloud||[]).push([[716],{57051:(e,t,a)=>{a.r(t),a.d(t,{runEndPageScript:()=>l});a(47941);var n=a(22398),i=a(66157),r=a(1703);function o(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e){n.Z.afterCreateAllForms.isStopped?s.script(e):n.Z.afterCreateAllForms.subscribe((function(){return s.script(e)}))}var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,a,l;return t=e,l=[{key:"script",value:function(t){var a=t.scope;e.setLinkConsultaOrigem(a),e.handleScopeEhModal(a),e.handleScopeNew(a),PrepararMaskDefault(),(0,i.T0)(a.DefinicaoObjetos.MultiColuna)}},{key:"setLinkConsultaOrigem",value:function(e){var t=e.DefinicaoObjetos;n.Z.LinkConsultaOrigem='RedirectPage?Scope={Class:"'.concat(t.Class,'"}')}},{key:"handleScopeEhModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.EhModal,a=e.Filtros,i=e.ChaveMestre,r=e.Sugerir;if(t){var o=n.Z.itens.firstUsable();o.detailfields=i,o.suggestionFields=Object.keys(r||{}),n.Z.FiltroModal=a,n.Z.SuggestionFieldValues=r}}},{key:"handleScopeNew",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.new,a=e.Filtros,i=e.Class,o=e.data,l=e.redirect;if(t)n.Z.Scopenew=!0,n.Z.itens.firstUsable().executeAction("actDataSetInsertExecute");else{if(n.Z.Scopenew=!1,l){var s=n.Z.byname(i);s.executeAction("actDataSetRefreshExecute")}o?(n.Z.filterForCadGrid=a,$((function(){var e;(0,r.Q1)(o),null===(e=n.Z.itens.firstUsable())||void 0===e||e.focusFirstField()}))):a&&n.Z.loadCadastro({_ACadastro:i,_AAlias:"",_AFiltros:a}).then((function(){n.Z.byname(i).focusFirstField()}))}}}],(a=null)&&o(t.prototype,a),l&&o(t,l),Object.defineProperty(t,"prototype",{writable:!1}),e}()}}]);