/*! For license information please see oauth2-oauth2.js.LICENSE.txt */ !function(){"use strict";var e,n={10522:function(e,n,i){var r=i(20144),o=i(4820),a=i(11341),l=i(10861),s=i.n(l),c={name:"OAuthItem",components:{Delete:a.Z,NcButton:s()},props:{client:{type:Object,required:!0}},data:function(){return{id:this.client.id,name:this.client.name,redirectUri:this.client.redirectUri,clientId:this.client.clientId,clientSecret:this.client.clientSecret,renderSecret:!1}},computed:{renderedSecret:function(){return this.renderSecret?this.clientSecret:"****"}},methods:{toggleSecret:function(){this.renderSecret=!this.renderSecret}}},d=i(93379),u=i.n(d),h=i(7795),p=i.n(h),m=i(90569),A=i.n(m),f=i(3565),v=i.n(f),g=i(19216),C=i.n(g),b=i(44589),w=i.n(b),y=i(3553),S={};S.styleTagTransform=w(),S.setAttributes=v(),S.insert=A().bind(null,"head"),S.domAPI=p(),S.insertStyleElement=C(),u()(y.Z,S),y.Z&&y.Z.locals&&y.Z.locals;var x=i(51900),_=(0,x.Z)(c,(function(){var t=this,e=t._self._c;return e("tr",[e("td",[e("table",{staticClass:"inline"},[e("tr",[e("td",[t._v(t._s(t.t("oauth2","Name")))]),t._v(" "),e("td",[t._v(t._s(t.name))])]),t._v(" "),e("tr",[e("td",[t._v(t._s(t.t("oauth2","Redirection URI")))]),t._v(" "),e("td",[t._v(t._s(t.redirectUri))])]),t._v(" "),e("tr",[e("td",[t._v(t._s(t.t("oauth2","Client Identifier")))]),t._v(" "),e("td",[e("code",[t._v(t._s(t.clientId))])])]),t._v(" "),e("tr",[e("td",[t._v(t._s(t.t("oauth2","Secret")))]),t._v(" "),e("td",[e("code",[t._v(t._s(t.renderedSecret))]),e("a",{staticClass:"icon-toggle has-tooltip",attrs:{title:t.t("oauth2","Show client secret")},on:{click:t.toggleSecret}})])])])]),t._v(" "),e("td",{staticClass:"action-column"},[e("NcButton",{attrs:{type:"tertiary-no-background","aria-label":t.t("oauth2","Delete")},on:{click:function(e){return t.$emit("delete",t.id)}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Delete",{attrs:{size:20,title:t.t("oauth2","Delete")}})]},proxy:!0}])})],1)])}),[],!1,null,"75e22bc6",null).exports,N=i(79753),U=i(42515),O=i(13299),I=i.n(O),R=i(16453),k={name:"App",components:{OAuthItem:_,NcSettingsSection:I(),NcButton:s()},props:{clients:{type:Array,required:!0}},data:function(){return{newClient:{name:"",redirectUri:"",errorMsg:"",error:!1},oauthDocLink:(0,R.loadState)("oauth2","oauth2-doc-link")}},computed:{instanceName:function(){return(0,U.getCapabilities)().theming.name}},methods:{deleteClient:function(t){var e=this;o.default.delete((0,N.generateUrl)("apps/oauth2/clients/{id}",{id:t})).then((function(n){e.clients=e.clients.filter((function(e){return e.id!==t}))}))},addClient:function(){var t=this;this.newClient.error=!1,o.default.post((0,N.generateUrl)("apps/oauth2/clients"),{name:this.newClient.name,redirectUri:this.newClient.redirectUri}).then((function(e){t.clients.push(e.data),t.newClient.name="",t.newClient.redirectUri=""})).catch((function(e){t.newClient.error=!0,t.newClient.errorMsg=e.response.data.message}))}}},T=i(97942),P={};P.styleTagTransform=w(),P.setAttributes=v(),P.insert=A().bind(null,"head"),P.domAPI=p(),P.insertStyleElement=C(),u()(T.Z,P),T.Z&&T.Z.locals&&T.Z.locals;var B=(0,x.Z)(k,(function(){var t=this,e=t._self._c;return e("NcSettingsSection",{attrs:{title:t.t("oauth2","OAuth 2.0 clients"),description:t.t("oauth2","OAuth 2.0 allows external services to request access to {instanceName}.",{instanceName:t.instanceName}),"doc-url":t.oauthDocLink}},[t.clients.length>0?e("table",{staticClass:"grid"},[e("thead",[e("tr",[e("th",{attrs:{id:"headerContent"}}),t._v(" "),e("th",{attrs:{id:"headerRemove"}},[t._v("\n \n\t\t\t\t\t")])])]),t._v(" "),e("tbody",t._l(t.clients,(function(n){return e("OAuthItem",{key:n.id,attrs:{client:n},on:{delete:t.deleteClient}})})),1)]):t._e(),t._v(" "),e("br"),t._v(" "),e("h3",[t._v(t._s(t.t("oauth2","Add client")))]),t._v(" "),t.newClient.error?e("span",{staticClass:"msg error"},[t._v(t._s(t.newClient.errorMsg))]):t._e(),t._v(" "),e("form",{on:{submit:function(e){return e.preventDefault(),t.addClient.apply(null,arguments)}}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.newClient.name,expression:"newClient.name"}],attrs:{id:"name",type:"text",name:"name",placeholder:t.t("oauth2","Name")},domProps:{value:t.newClient.name},on:{input:function(e){e.target.composing||t.$set(t.newClient,"name",e.target.value)}}}),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.newClient.redirectUri,expression:"newClient.redirectUri"}],attrs:{id:"redirectUri",type:"url",name:"redirectUri",placeholder:t.t("oauth2","Redirection URI")},domProps:{value:t.newClient.redirectUri},on:{input:function(e){e.target.composing||t.$set(t.newClient,"redirectUri",e.target.value)}}}),t._v(" "),e("NcButton",{staticClass:"inline-button",attrs:{"native-type":"submit"}},[t._v("\n\t\t\t\t"+t._s(t.t("oauth2","Add"))+"\n\t\t\t")])],1)])}),[],!1,null,"28d94e7c",null),D=B.exports;r.ZP.prototype.t=t,r.ZP.prototype.OC=OC;var L=(0,R.loadState)("oauth2","clients");new(r.ZP.extend(D))({propsData:{clients:L}}).$mount("#oauth2")},97942:function(t,e,n){var i=n(87537),r=n.n(i),o=n(23645),a=n.n(o)()(r());a.push([t.id,"\ntable[data-v-28d94e7c] {\n\tmax-width: 800px;\n}\n\n/** Overwrite button height and position to be aligned with the text input */\n.inline-button[data-v-28d94e7c] {\n\tmin-height: 34px !important;\n\tdisplay: inline-flex !important;\n}\n","",{version:3,sources:["webpack://./apps/oauth2/src/App.vue"],names:[],mappings:";AAgJA;CACA,gBAAA;AACA;;AAEA,4EAAA;AACA;CACA,2BAAA;CACA,+BAAA;AACA",sourcesContent:["\x3c!--\n - @copyright Copyright (c) 2018 Roeland Jago Douma \n -\n - @author Roeland Jago Douma \n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see .\n -\n --\x3e\n\n\n