text: (window.webpackJsonp=window.webpackJsonp||[]).push([[25,22],{550:function(t,e,r){"use strict";var n=r(13),o=r(3),l=r(4),c=r(135),d=r(20),f=r(15),h=r(405),m=r(48),v=r(134),_=r(404),N=r(5),I=r(93).f,w=r(40).f,S=r(18).f,$=r(406),x=r(553).trim,E="Number",y=o.Number,F=y.prototype,C=o.TypeError,O=l("".slice),R=l("".charCodeAt),T=function(t){var e=_(t,"number");return"bigint"==typeof e?e:k(e)},k=function(t){var e,r,n,o,l,c,d,code,f=_(t,"number");if(v(f))throw C("Cannot convert a Symbol value to a number");if("string"==typeof f&&f.length>2)if(f=x(f),43===(e=R(f,0))||45===e){if(88===(r=R(f,2))||120===r)return NaN}else if(48===e){switch(R(f,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+f}for(c=(l=O(f,2)).length,d=0;d<c;d++)if((code=R(l,d))<48||code>o)return NaN;return parseInt(l,n)}return+f};if(c(E,!y(" 0o1")||!y("0b1")||y("+0x1"))){for(var A,j=function(t){var e=arguments.length<1?0:y(T(t)),r=this;return m(F,r)&&N((function(){$(r)}))?h(Object(e),r,j):e},J=n?I(y):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),M=0;J.length>M;M++)f(y,A=J[M])&&!f(j,A)&&S(j,A,w(y,A));j.prototype=F,F.constructor=j,d(o,E,j)}},553:function(t,e,r){var n=r(4),o=r(25),l=r(14),c=r(554),d=n("".replace),f="["+c+"]",h=RegExp("^"+f+f+"*"),m=RegExp(f+f+"*$"),v=function(t){return function(e){var r=l(o(e));return 1&t&&(r=d(r,h,"")),2&t&&(r=d(r,m,"")),r}};t.exports={start:v(1),end:v(2),trim:v(3)}},554:function(t,e){t.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},558:function(t,e,r){"use strict";r.r(e);r(12);var n={props:{value:[Boolean,Object],method:{default:"get"},action:{default:""},mountedSubmit:{default:!1,type:Boolean},successText:{default:""}},data:function(){return{loading:!1,response:!1,error:!1,errorFields:{}}},methods:{submit:function(){var t=this;return this.loading=!0,this.error=!1,this.errorFields={},this.$axios({method:this.method,url:this.action,data:"get"!=this.method?this.value:null,params:"get"==this.method?this.value:null}).then((function(e){var r=t.parseResponseData(e.data);t.loading=!1,t.response=r,t.$emit("success",r),t.$emit("response",r),t.successText&&t.$swal.fire(t.successText)})).catch((function(e){var r=t.parseResponseData(e.response.data);t.loading=!1,t.error=r.message,t.errorFields=r.fields,t.$emit("error",r),t.$emit("response",r)}))},parseResponseData:function(t){return["per_page","page"].forEach((function(e){"string"==typeof t[e]&&(t[e]=parseInt(t[e]))})),t}},mounted:function(){this.mountedSubmit&&this.submit()}},o=r(16),component=Object(o.a)(n,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("form",{attrs:{action:""},on:{submit:function(e){return e.preventDefault(),t.submit()}}},[t._t("default",null,{loading:t.loading,response:t.response,error:t.error,errorFields:t.errorFields})],2)}),[],!1,null,null,null);e.default=component.exports},569:function(t,e,r){"use strict";r.r(e);var n=r(21),o=(r(550),r(75),r(94),r(409),r(12),{props:{value:{default:function(){return{}},type:[Boolean,Number,String,Object]},modelName:{default:""},modelId:{default:!1,type:[Boolean,Number,String]},singular:{default:"Item"},plural:{default:"Itens"},showActions:{default:!0},redirect:{default:"edit"}},watch:{$props:{deep:!0,handler:function(t){this.__preventRecursive||(this.props=JSON.parse(JSON.stringify(t)))}},props:{deep:!0,handler:function(t){var e=this;for(var i in this.__preventRecursive=!0,t)this.$emit("update:".concat(i),t[i]);setTimeout((function(){e.__preventRecursive=!1}),10)}}},computed:{_modelId:function(){var t=+this.props.modelId;return"object"==Object(n.a)(this.props.value)&&this.props.value.id&&(t=+this.props.value.id),!isNaN(t)&&t}},data:function(){return{finding:!1,props:JSON.parse(JSON.stringify(this.$props))}},methods:{find:function(){var t=this;this._modelId&&(this.finding=!0,this.$axios.get("/api/".concat(this.modelName,"/find/").concat(this._modelId)).then((function(e){t.finding=!1,t.props.value=e.data})))},onSuccess:function(t){this.props.value=t,this.$emit("success",t),this.successRedirect()},successRedirect:function(){"edit"==this.redirect?this.$router.push("/admin/".concat(this.modelName,"/").concat(this.props.value&&this.props.value.id?this.props.value.id:"new")):"back"==this.redirect?this.$router.go(-1):this.$router.push(this.redirect)}},mounted:function(){this.find()}}),l=r(16),component=Object(l.a)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("ui-form",{attrs:{method:"post",action:"/api/"+t.modelName+"/save","success-text":t.singular+" salvo(a)"},on:{success:t.onSuccess},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.loading,o=e.error,l=e.errorFields;return[r("div",{staticClass:"bg-white p-3 shadow-sm"},[r("el-collapse-transition",[o?r("div",{staticClass:"alert alert-danger"},[r("a",{staticClass:"float-end text-danger fw-bold",attrs:{href:"javascript:;"},on:{click:function(t){o=!1}}},[r("i",{staticClass:"fas fa-fw fa-times"})]),t._v(" "),r("div",{domProps:{innerHTML:t._s(o)}})]):t._e()]),t._v(" "),t._t("default",null,{value:t.props.value,loading:n,error:o,errorFields:l})],2),t._v(" "),t.showActions?r("div",{staticClass:"text-end mt-3 p-3 bg-white shadow-sm"},[t._t("actions"),t._v(" "),t.props.value.id?r("nuxt-link",{staticClass:"btn btn-light",attrs:{to:"/admin/"+t.modelName+"/new"}},[t._v("\n            Criar "+t._s(t.singular)+"\n        ")]):t._e(),t._v(" "),r("button",{staticClass:"btn btn-light",attrs:{type:"button"},on:{click:function(e){return t.$router.go(-1)}}},[t._v("\n            Voltar\n        ")]),t._v(" "),r("button",{directives:[{name:"loading",rawName:"v-loading",value:n,expression:"loading"}],staticClass:"btn btn-primary",attrs:{type:"submit"}},[t._v("\n            Salvar\n        ")])],2):t._e()]}}],null,!0),model:{value:t.props.value,callback:function(e){t.$set(t.props,"value",e)},expression:"props.value"}})}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{UiForm:r(558).default})}}]);