"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["scoped-access-token-selector"],{"./web_src/js/components/ScopedAccessTokenSelector.vue":function(h,d,o){o.d(d,{default:function(){return f}});var e=o("./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js"),n=o("./node_modules/@vue/shared/dist/shared.esm-bundler.js");const u=["for"],l={class:"gitea-select"},a=["id"],p={value:""},m=["value"],v=["value"];function k(s,c,i,S,y,E){return(0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(s.categories,t=>((0,e.uX)(),(0,e.CE)("div",{key:t,class:"field tw-pl-1 tw-pb-1 access-token-category"},[(0,e.Lk)("label",{class:"category-label",for:"access-token-scope-"+t},(0,n.v_)(t),9,u),(0,e.Lk)("div",l,[(0,e.Lk)("select",{class:"ui selection access-token-select",name:"scope",id:"access-token-scope-"+t},[(0,e.Lk)("option",p,(0,n.v_)(s.noAccessLabel),1),(0,e.Lk)("option",{value:"read:"+t},(0,n.v_)(s.readLabel),9,m),(0,e.Lk)("option",{value:"write:"+t},(0,n.v_)(s.writeLabel),9,v)],8,a)])]))),128)}var r=o("./web_src/js/utils/dom.js"),b={props:{isAdmin:{type:Boolean,required:!0},noAccessLabel:{type:String,required:!0},readLabel:{type:String,required:!0},writeLabel:{type:String,required:!0}},computed:{categories(){const s=["activitypub"];return this.isAdmin&&s.push("admin"),s.push("issue","misc","notification","organization","package","repository","user"),s}},mounted(){document.getElementById("scoped-access-submit").addEventListener("click",this.onClickSubmit)},unmounted(){document.getElementById("scoped-access-submit").removeEventListener("click",this.onClickSubmit)},methods:{onClickSubmit(s){s.preventDefault();const c=document.getElementById("scoped-access-warning");for(const i of document.getElementsByClassName("access-token-select"))if(i.value){(0,r.y9)(c),document.getElementById("scoped-access-form").submit();return}(0,r.fi)(c)}}},_=o("./node_modules/vue-loader/dist/exportHelper.js"),f=(0,_.A)(b,[["render",k]])}}]);