@kong-ui-public/forms 2.1.28 → 2.1.29

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.
package/dist/forms.es.js CHANGED
@@ -5787,7 +5787,7 @@ const kl = /* @__PURE__ */ K(c_, [["render", I_], ["__scopeId", "data-v-22600a29
5787
5787
  for (const [h, f] of a)
5788
5788
  s[h] = f;
5789
5789
  return s;
5790
- }, A_ = (n) => (an("data-v-98fcb3eb"), n = n(), on(), n), M_ = ["aria-hidden"], E_ = {
5790
+ }, A_ = (n) => (an("data-v-897b9266"), n = n(), on(), n), M_ = ["aria-hidden"], E_ = {
5791
5791
  key: 0,
5792
5792
  "data-testid": "kui-icon-svg-title"
5793
5793
  }, F_ = /* @__PURE__ */ A_(() => /* @__PURE__ */ M("path", {
@@ -5886,7 +5886,7 @@ const kl = /* @__PURE__ */ K(c_, [["render", I_], ["__scopeId", "data-v-22600a29
5886
5886
  _: 1
5887
5887
  }, 8, ["aria-hidden", "style"]));
5888
5888
  }
5889
- }), O_ = /* @__PURE__ */ Ll($_, [["__scopeId", "data-v-98fcb3eb"]]), k_ = (n) => (an("data-v-c466bb6b"), n = n(), on(), n), L_ = ["aria-hidden"], U_ = {
5889
+ }), O_ = /* @__PURE__ */ Ll($_, [["__scopeId", "data-v-897b9266"]]), k_ = (n) => (an("data-v-a67bac4e"), n = n(), on(), n), L_ = ["aria-hidden"], U_ = {
5890
5890
  key: 0,
5891
5891
  "data-testid": "kui-icon-svg-title"
5892
5892
  }, R_ = /* @__PURE__ */ k_(() => /* @__PURE__ */ M("path", {
@@ -5985,7 +5985,7 @@ const kl = /* @__PURE__ */ K(c_, [["render", I_], ["__scopeId", "data-v-22600a29
5985
5985
  _: 1
5986
5986
  }, 8, ["aria-hidden", "style"]));
5987
5987
  }
5988
- }), Qi = /* @__PURE__ */ Ll(D_, [["__scopeId", "data-v-c466bb6b"]]), N_ = {
5988
+ }), Qi = /* @__PURE__ */ Ll(D_, [["__scopeId", "data-v-a67bac4e"]]), N_ = {
5989
5989
  name: "FieldArrayItem",
5990
5990
  components: { TrashIcon: Qi },
5991
5991
  props: {
package/dist/forms.umd.js CHANGED
@@ -24,4 +24,4 @@ __p += '`),K&&(S+=`' +
24
24
  function print() { __p += __j.call(arguments, '') }
25
25
  `:`;
26
26
  `)+S+`return __p
27
- }`;var q=hl(function(){return Z(c,N+"return "+S).apply(s,f)});if(q.source=S,Hi(q))throw q;return q}function a1(e){return J(e).toLowerCase()}function l1(e){return J(e).toUpperCase()}function d1(e,t,r){if(e=J(e),e&&(r||t===s))return ks(e);if(!e||!(t=Oe(t)))return e;var o=Xe(e),l=Xe(t),c=Es(o,l),f=vs(o,l)+1;return Mt(o,c,f).join("")}function c1(e,t,r){if(e=J(e),e&&(r||t===s))return e.slice(0,Ts(e)+1);if(!e||!(t=Oe(t)))return e;var o=Xe(e),l=vs(o,Xe(t))+1;return Mt(o,0,l).join("")}function u1(e,t,r){if(e=J(e),e&&(r||t===s))return e.replace(Hr,"");if(!e||!(t=Oe(t)))return e;var o=Xe(e),l=Es(o,Xe(t));return Mt(o,l).join("")}function f1(e,t){var r=oh,o=sh;if(oe(t)){var l="separator"in t?t.separator:l;r="length"in t?R(t.length):r,o="omission"in t?Oe(t.omission):o}e=J(e);var c=e.length;if(Zt(e)){var f=Xe(e);c=f.length}if(r>=c)return e;var p=r-Jt(o);if(p<1)return o;var _=f?Mt(f,0,p).join(""):e.slice(0,p);if(l===s)return _+o;if(f&&(p+=_.length-p),Wi(l)){if(e.slice(p).search(l)){var E,v=_;for(l.global||(l=ai(l.source,J(Ho.exec(l))+"g")),l.lastIndex=0;E=l.exec(v);)var S=E.index;_=_.slice(0,S===s?p:S)}}else if(e.indexOf(Oe(l),p)!=p){var I=_.lastIndexOf(l);I>-1&&(_=_.slice(0,I))}return _+o}function h1(e){return e=J(e),e&&vh.test(e)?e.replace(Po,qm):e}var m1=rn(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Gi=ma("toUpperCase");function fl(e,t,r){return e=J(e),t=r?s:t,t===s?Lm(e)?Wm(e):Im(e):e.match(t)||[]}var hl=z(function(e,t){try{return $e(e,s,t)}catch(r){return Hi(r)?r:new U(r)}}),p1=ht(function(e,t){return qe(t,function(r){r=ot(r),ut(e,r,qi(e[r],e))}),e});function g1(e){var t=e==null?0:e.length,r=F();return e=t?re(e,function(o){if(typeof o[1]!="function")throw new ze(b);return[r(o[0]),o[1]]}):[],z(function(o){for(var l=-1;++l<t;){var c=e[l];if($e(c[0],this,o))return $e(c[1],this,o)}})}function y1(e){return qp(We(e,ee))}function Zi(e){return function(){return e}}function _1(e,t){return e==null||e!==e?t:e}var b1=ga(),w1=ga(!0);function Fe(e){return e}function Ji(e){return Ks(typeof e=="function"?e:We(e,ee))}function C1(e){return Gs(We(e,ee))}function k1(e,t){return Zs(e,We(t,ee))}var E1=z(function(e,t){return function(r){return Tn(r,e,t)}}),v1=z(function(e,t){return function(r){return Tn(e,r,t)}});function Xi(e,t,r){var o=he(t),l=ur(t,o);r==null&&!(oe(t)&&(l.length||!o.length))&&(r=t,t=e,e=this,l=ur(t,he(t)));var c=!(oe(r)&&"chain"in r)||!!r.chain,f=pt(e);return qe(l,function(p){var _=t[p];e[p]=_,f&&(e.prototype[p]=function(){var E=this.__chain__;if(c||E){var v=e(this.__wrapped__),S=v.__actions__=Me(this.__actions__);return S.push({func:_,args:arguments,thisArg:e}),v.__chain__=E,v}return _.apply(e,Et([this.value()],arguments))})}),e}function S1(){return me._===this&&(me._=Xm),this}function Qi(){}function T1(e){return e=R(e),z(function(t){return Js(t,e)})}var B1=Mi(re),I1=Mi(ys),M1=Mi(ei);function ml(e){return Di(e)?ti(ot(e)):og(e)}function N1(e){return function(t){return e==null?s:Rt(e,t)}}var A1=_a(),F1=_a(!0);function ji(){return[]}function eo(){return!1}function $1(){return{}}function V1(){return""}function O1(){return!0}function D1(e,t){if(e=R(e),e<1||e>Ct)return[];var r=nt,o=ye(e,nt);t=F(t),e-=nt;for(var l=ii(o,t);++r<e;)t(r);return l}function L1(e){return x(e)?re(e,ot):De(e)?[e]:Me(Va(J(e)))}function U1(e){var t=++Zm;return J(e)+t}var x1=yr(function(e,t){return e+t},0),R1=Ni("ceil"),P1=yr(function(e,t){return e/t},1),q1=Ni("floor");function z1(e){return e&&e.length?cr(e,Fe,pi):s}function H1(e,t){return e&&e.length?cr(e,F(t,2),pi):s}function W1(e){return ws(e,Fe)}function K1(e,t){return ws(e,F(t,2))}function Y1(e){return e&&e.length?cr(e,Fe,bi):s}function G1(e,t){return e&&e.length?cr(e,F(t,2),bi):s}var Z1=yr(function(e,t){return e*t},1),J1=Ni("round"),X1=yr(function(e,t){return e-t},0);function Q1(e){return e&&e.length?ri(e,Fe):0}function j1(e,t){return e&&e.length?ri(e,F(t,2)):0}return d.after=C_,d.ary=Wa,d.assign=l0,d.assignIn=ol,d.assignInWith=Nr,d.assignWith=d0,d.at=c0,d.before=Ka,d.bind=qi,d.bindAll=p1,d.bindKey=Ya,d.castArray=$_,d.chain=qa,d.chunk=qg,d.compact=zg,d.concat=Hg,d.cond=g1,d.conforms=y1,d.constant=Zi,d.countBy=Qy,d.create=u0,d.curry=Ga,d.curryRight=Za,d.debounce=Ja,d.defaults=f0,d.defaultsDeep=h0,d.defer=k_,d.delay=E_,d.difference=Wg,d.differenceBy=Kg,d.differenceWith=Yg,d.drop=Gg,d.dropRight=Zg,d.dropRightWhile=Jg,d.dropWhile=Xg,d.fill=Qg,d.filter=e_,d.flatMap=r_,d.flatMapDeep=i_,d.flatMapDepth=o_,d.flatten=Ua,d.flattenDeep=jg,d.flattenDepth=ey,d.flip=v_,d.flow=b1,d.flowRight=w1,d.fromPairs=ty,d.functions=w0,d.functionsIn=C0,d.groupBy=s_,d.initial=ry,d.intersection=iy,d.intersectionBy=oy,d.intersectionWith=sy,d.invert=E0,d.invertBy=v0,d.invokeMap=l_,d.iteratee=Ji,d.keyBy=d_,d.keys=he,d.keysIn=Ae,d.map=vr,d.mapKeys=T0,d.mapValues=B0,d.matches=C1,d.matchesProperty=k1,d.memoize=Tr,d.merge=I0,d.mergeWith=sl,d.method=E1,d.methodOf=v1,d.mixin=Xi,d.negate=Br,d.nthArg=T1,d.omit=M0,d.omitBy=N0,d.once=S_,d.orderBy=c_,d.over=B1,d.overArgs=T_,d.overEvery=I1,d.overSome=M1,d.partial=zi,d.partialRight=Xa,d.partition=u_,d.pick=A0,d.pickBy=al,d.property=ml,d.propertyOf=N1,d.pull=cy,d.pullAll=Ra,d.pullAllBy=uy,d.pullAllWith=fy,d.pullAt=hy,d.range=A1,d.rangeRight=F1,d.rearg=B_,d.reject=m_,d.remove=my,d.rest=I_,d.reverse=Ri,d.sampleSize=g_,d.set=$0,d.setWith=V0,d.shuffle=y_,d.slice=py,d.sortBy=w_,d.sortedUniq=ky,d.sortedUniqBy=Ey,d.split=r1,d.spread=M_,d.tail=vy,d.take=Sy,d.takeRight=Ty,d.takeRightWhile=By,d.takeWhile=Iy,d.tap=zy,d.throttle=N_,d.thru=Er,d.toArray=nl,d.toPairs=ll,d.toPairsIn=dl,d.toPath=L1,d.toPlainObject=il,d.transform=O0,d.unary=A_,d.union=My,d.unionBy=Ny,d.unionWith=Ay,d.uniq=Fy,d.uniqBy=$y,d.uniqWith=Vy,d.unset=D0,d.unzip=Pi,d.unzipWith=Pa,d.update=L0,d.updateWith=U0,d.values=an,d.valuesIn=x0,d.without=Oy,d.words=fl,d.wrap=F_,d.xor=Dy,d.xorBy=Ly,d.xorWith=Uy,d.zip=xy,d.zipObject=Ry,d.zipObjectDeep=Py,d.zipWith=qy,d.entries=ll,d.entriesIn=dl,d.extend=ol,d.extendWith=Nr,Xi(d,d),d.add=x1,d.attempt=hl,d.camelCase=z0,d.capitalize=cl,d.ceil=R1,d.clamp=R0,d.clone=V_,d.cloneDeep=D_,d.cloneDeepWith=L_,d.cloneWith=O_,d.conformsTo=U_,d.deburr=ul,d.defaultTo=_1,d.divide=P1,d.endsWith=H0,d.eq=je,d.escape=W0,d.escapeRegExp=K0,d.every=jy,d.find=t_,d.findIndex=Da,d.findKey=m0,d.findLast=n_,d.findLastIndex=La,d.findLastKey=p0,d.floor=q1,d.forEach=za,d.forEachRight=Ha,d.forIn=g0,d.forInRight=y0,d.forOwn=_0,d.forOwnRight=b0,d.get=Ki,d.gt=x_,d.gte=R_,d.has=k0,d.hasIn=Yi,d.head=xa,d.identity=Fe,d.includes=a_,d.indexOf=ny,d.inRange=P0,d.invoke=S0,d.isArguments=zt,d.isArray=x,d.isArrayBuffer=P_,d.isArrayLike=Ne,d.isArrayLikeObject=ae,d.isBoolean=q_,d.isBuffer=Nt,d.isDate=z_,d.isElement=H_,d.isEmpty=W_,d.isEqual=K_,d.isEqualWith=Y_,d.isError=Hi,d.isFinite=G_,d.isFunction=pt,d.isInteger=Qa,d.isLength=Ir,d.isMap=ja,d.isMatch=Z_,d.isMatchWith=J_,d.isNaN=X_,d.isNative=Q_,d.isNil=e0,d.isNull=j_,d.isNumber=el,d.isObject=oe,d.isObjectLike=se,d.isPlainObject=Fn,d.isRegExp=Wi,d.isSafeInteger=t0,d.isSet=tl,d.isString=Mr,d.isSymbol=De,d.isTypedArray=sn,d.isUndefined=n0,d.isWeakMap=r0,d.isWeakSet=i0,d.join=ay,d.kebabCase=Y0,d.last=Ye,d.lastIndexOf=ly,d.lowerCase=G0,d.lowerFirst=Z0,d.lt=o0,d.lte=s0,d.max=z1,d.maxBy=H1,d.mean=W1,d.meanBy=K1,d.min=Y1,d.minBy=G1,d.stubArray=ji,d.stubFalse=eo,d.stubObject=$1,d.stubString=V1,d.stubTrue=O1,d.multiply=Z1,d.nth=dy,d.noConflict=S1,d.noop=Qi,d.now=Sr,d.pad=J0,d.padEnd=X0,d.padStart=Q0,d.parseInt=j0,d.random=q0,d.reduce=f_,d.reduceRight=h_,d.repeat=e1,d.replace=t1,d.result=F0,d.round=J1,d.runInContext=y,d.sample=p_,d.size=__,d.snakeCase=n1,d.some=b_,d.sortedIndex=gy,d.sortedIndexBy=yy,d.sortedIndexOf=_y,d.sortedLastIndex=by,d.sortedLastIndexBy=wy,d.sortedLastIndexOf=Cy,d.startCase=i1,d.startsWith=o1,d.subtract=X1,d.sum=Q1,d.sumBy=j1,d.template=s1,d.times=D1,d.toFinite=gt,d.toInteger=R,d.toLength=rl,d.toLower=a1,d.toNumber=Ge,d.toSafeInteger=a0,d.toString=J,d.toUpper=l1,d.trim=d1,d.trimEnd=c1,d.trimStart=u1,d.truncate=f1,d.unescape=h1,d.uniqueId=U1,d.upperCase=m1,d.upperFirst=Gi,d.each=za,d.eachRight=Ha,d.first=xa,Xi(d,function(){var e={};return rt(d,function(t,r){X.call(d.prototype,r)||(e[r]=t)}),e}(),{chain:!1}),d.VERSION=m,qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){d[e].placeholder=d}),qe(["drop","take"],function(e,t){W.prototype[e]=function(r){r=r===s?1:fe(R(r),0);var o=this.__filtered__&&!t?new W(this):this.clone();return o.__filtered__?o.__takeCount__=ye(r,o.__takeCount__):o.__views__.push({size:ye(r,nt),type:e+(o.__dir__<0?"Right":"")}),o},W.prototype[e+"Right"]=function(r){return this.reverse()[e](r).reverse()}}),qe(["filter","map","takeWhile"],function(e,t){var r=t+1,o=r==Uo||r==ch;W.prototype[e]=function(l){var c=this.clone();return c.__iteratees__.push({iteratee:F(l,3),type:r}),c.__filtered__=c.__filtered__||o,c}}),qe(["head","last"],function(e,t){var r="take"+(t?"Right":"");W.prototype[e]=function(){return this[r](1).value()[0]}}),qe(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");W.prototype[e]=function(){return this.__filtered__?new W(this):this[r](1)}}),W.prototype.compact=function(){return this.filter(Fe)},W.prototype.find=function(e){return this.filter(e).head()},W.prototype.findLast=function(e){return this.reverse().find(e)},W.prototype.invokeMap=z(function(e,t){return typeof e=="function"?new W(this):this.map(function(r){return Tn(r,e,t)})}),W.prototype.reject=function(e){return this.filter(Br(F(e)))},W.prototype.slice=function(e,t){e=R(e);var r=this;return r.__filtered__&&(e>0||t<0)?new W(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==s&&(t=R(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},W.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},W.prototype.toArray=function(){return this.take(nt)},rt(W.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),l=d[o?"take"+(t=="last"?"Right":""):t],c=o||/^find/.test(t);l&&(d.prototype[t]=function(){var f=this.__wrapped__,p=o?[1]:arguments,_=f instanceof W,E=p[0],v=_||x(f),S=function(H){var K=l.apply(d,Et([H],p));return o&&I?K[0]:K};v&&r&&typeof E=="function"&&E.length!=1&&(_=v=!1);var I=this.__chain__,N=!!this.__actions__.length,O=c&&!I,q=_&&!N;if(!c&&v){f=q?f:new W(this);var D=e.apply(f,p);return D.__actions__.push({func:Er,args:[S],thisArg:s}),new He(D,I)}return O&&q?e.apply(this,p):(D=this.thru(S),O?o?D.value()[0]:D.value():D)})}),qe(["pop","push","shift","sort","splice","unshift"],function(e){var t=Zn[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);d.prototype[e]=function(){var l=arguments;if(o&&!this.__chain__){var c=this.value();return t.apply(x(c)?c:[],l)}return this[r](function(f){return t.apply(x(f)?f:[],l)})}}),rt(W.prototype,function(e,t){var r=d[t];if(r){var o=r.name+"";X.call(en,o)||(en[o]=[]),en[o].push({name:t,func:r})}}),en[gr(s,Te).name]=[{name:"wrapper",func:s}],W.prototype.clone=hp,W.prototype.reverse=mp,W.prototype.value=pp,d.prototype.at=Hy,d.prototype.chain=Wy,d.prototype.commit=Ky,d.prototype.next=Yy,d.prototype.plant=Zy,d.prototype.reverse=Jy,d.prototype.toJSON=d.prototype.valueOf=d.prototype.value=Xy,d.prototype.first=d.prototype.head,bn&&(d.prototype[bn]=Gy),d},Xt=Km();Ot?((Ot.exports=Xt)._=Xt,Jr._=Xt):me._=Xt}).call(ln)}($n,$n.exports);var C=$n.exports;const no={methods:{getFieldRowClasses(n){const a=this.fieldErrors(n).length>0,s={[C.get(this.options,"validationErrorClass","error")]:a,[C.get(this.options,"validationSuccessClass","valid")]:!a,disabled:this.fieldDisabled(n),readonly:this.fieldReadonly(n),featured:this.fieldFeatured(n),required:this.fieldRequired(n)};return C.isArray(n.styleClasses)?C.forEach(n.styleClasses,m=>s[m]=!0):C.isString(n.styleClasses)&&(s[n.styleClasses]=!0),C.isNil(n.type)||(s["field-"+n.type]=!0),s},fieldErrors(n){return this.errors.filter(s=>s.field.fieldName===n.fieldName).map(s=>s.error)},fieldDisabled(n){return C.isFunction(n.disabled)?n.disabled.call(this,this.model,n,this):C.isNil(n.disabled)?!1:n.disabled},fieldReadonly(n){return C.isFunction(n.readonly)?n.readonly.call(this,this.model,n,this):C.isNil(n.readonly)?!1:n.readonly},fieldFeatured(n){return C.isFunction(n.featured)?n.featured.call(this,this.model,n,this):C.isNil(n.featured)?!1:n.featured},fieldRequired(n){return C.isFunction(n.required)?n.required.call(this,this.model,n,this):C.isNil(n.required)?!1:n.required}}},ro=(n,a="")=>typeof n.id<"u"?a+n.id:a+(n.inputName||n.label||n.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),io=(n="")=>n.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var oo=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,_t="\\d\\d?",bt="\\d\\d",gl="\\d{3}",yl="\\d{4}",dn="[^\\s]+",so=/\[([^]*?)\]/gm;function ao(n,a){for(var s=[],m=0,h=n.length;m<h;m++)s.push(n[m].substr(0,a));return s}var lo=function(n){return function(a,s){var m=s[n].map(function(u){return u.toLowerCase()}),h=m.indexOf(a.toLowerCase());return h>-1?h:null}};function At(n){for(var a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];for(var m=0,h=a;m<h.length;m++){var u=h[m];for(var b in u)n[b]=u[b]}return n}var co=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],uo=["January","February","March","April","May","June","July","August","September","October","November","December"],_l=ao(uo,3),bl=ao(co,3),fo={dayNamesShort:bl,dayNames:co,monthNamesShort:_l,monthNames:uo,amPm:["am","pm"],DoFn:function(n){return n+["th","st","nd","rd"][n%10>3?0:(n-n%10!==10?1:0)*n%10]}},Vn=At({},fo),wl=function(n){return Vn=At(Vn,n)},ho=function(n){return n.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Se=function(n,a){for(a===void 0&&(a=2),n=String(n);n.length<a;)n="0"+n;return n},Cl={D:function(n){return String(n.getDate())},DD:function(n){return Se(n.getDate())},Do:function(n,a){return a.DoFn(n.getDate())},d:function(n){return String(n.getDay())},dd:function(n){return Se(n.getDay())},ddd:function(n,a){return a.dayNamesShort[n.getDay()]},dddd:function(n,a){return a.dayNames[n.getDay()]},M:function(n){return String(n.getMonth()+1)},MM:function(n){return Se(n.getMonth()+1)},MMM:function(n,a){return a.monthNamesShort[n.getMonth()]},MMMM:function(n,a){return a.monthNames[n.getMonth()]},YY:function(n){return Se(String(n.getFullYear()),4).substr(2)},YYYY:function(n){return Se(n.getFullYear(),4)},h:function(n){return String(n.getHours()%12||12)},hh:function(n){return Se(n.getHours()%12||12)},H:function(n){return String(n.getHours())},HH:function(n){return Se(n.getHours())},m:function(n){return String(n.getMinutes())},mm:function(n){return Se(n.getMinutes())},s:function(n){return String(n.getSeconds())},ss:function(n){return Se(n.getSeconds())},S:function(n){return String(Math.round(n.getMilliseconds()/100))},SS:function(n){return Se(Math.round(n.getMilliseconds()/10),2)},SSS:function(n){return Se(n.getMilliseconds(),3)},a:function(n,a){return n.getHours()<12?a.amPm[0]:a.amPm[1]},A:function(n,a){return n.getHours()<12?a.amPm[0].toUpperCase():a.amPm[1].toUpperCase()},ZZ:function(n){var a=n.getTimezoneOffset();return(a>0?"-":"+")+Se(Math.floor(Math.abs(a)/60)*100+Math.abs(a)%60,4)},Z:function(n){var a=n.getTimezoneOffset();return(a>0?"-":"+")+Se(Math.floor(Math.abs(a)/60),2)+":"+Se(Math.abs(a)%60,2)}},mo=function(n){return+n-1},po=[null,_t],go=[null,dn],yo=["isPm",dn,function(n,a){var s=n.toLowerCase();return s===a.amPm[0]?0:s===a.amPm[1]?1:null}],_o=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(n){var a=(n+"").match(/([+-]|\d\d)/gi);if(a){var s=+a[1]*60+parseInt(a[2],10);return a[0]==="+"?s:-s}return 0}],kl={D:["day",_t],DD:["day",bt],Do:["day",_t+dn,function(n){return parseInt(n,10)}],M:["month",_t,mo],MM:["month",bt,mo],YY:["year",bt,function(n){var a=new Date,s=+(""+a.getFullYear()).substr(0,2);return+(""+(+n>68?s-1:s)+n)}],h:["hour",_t,void 0,"isPm"],hh:["hour",bt,void 0,"isPm"],H:["hour",_t],HH:["hour",bt],m:["minute",_t],mm:["minute",bt],s:["second",_t],ss:["second",bt],YYYY:["year",yl],S:["millisecond","\\d",function(n){return+n*100}],SS:["millisecond",bt,function(n){return+n*10}],SSS:["millisecond",gl],d:po,dd:po,ddd:go,dddd:go,MMM:["month",dn,lo("monthNamesShort")],MMMM:["month",dn,lo("monthNames")],a:yo,A:yo,ZZ:_o,Z:_o},On={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},El=function(n){return At(On,n)},vl=function(n,a,s){if(a===void 0&&(a=On.default),s===void 0&&(s={}),typeof n=="number"&&(n=new Date(n)),Object.prototype.toString.call(n)!=="[object Date]"||isNaN(n.getTime()))throw new Error("Invalid Date pass to format");a=On[a]||a;var m=[];a=a.replace(so,function(u,b){return m.push(b),"@@@"});var h=At(At({},Vn),s);return a=a.replace(oo,function(u){return Cl[u](n,h)}),a.replace(/@@@/g,function(){return m.shift()})};function Sl(n,a,s){if(s===void 0&&(s={}),typeof a!="string")throw new Error("Invalid format in fecha parse");if(a=On[a]||a,n.length>1e3)return null;var m=new Date,h={year:m.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},u=[],b=[],g=a.replace(so,function(Ie,A){return b.push(ho(A)),"@@@"}),T={},B={};g=ho(g).replace(oo,function(Ie){var A=kl[Ie],L=A[0],G=A[1],ce=A[3];if(T[L])throw new Error("Invalid format. "+L+" specified twice in format");return T[L]=!0,ce&&(B[ce]=!0),u.push(A),"("+G+")"}),Object.keys(B).forEach(function(Ie){if(!T[Ie])throw new Error("Invalid format. "+Ie+" is required in specified format")}),g=g.replace(/@@@/g,function(){return b.shift()});var V=n.match(new RegExp(g,"i"));if(!V)return null;for(var ee=At(At({},Vn),s),Q=1;Q<V.length;Q++){var we=u[Q-1],tt=we[0],st=we[2],de=st?st(V[Q],ee):+V[Q];if(de==null)return null;h[tt]=de}h.isPm===1&&h.hour!=null&&+h.hour!=12?h.hour=+h.hour+12:h.isPm===0&&+h.hour==12&&(h.hour=0);var Te;if(h.timezoneOffset==null){Te=new Date(h.year,h.month,h.day,h.hour,h.minute,h.second,h.millisecond);for(var at=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],Q=0,Be=at.length;Q<Be;Q++)if(T[at[Q][0]]&&h[at[Q][0]]!==Te[at[Q][1]]())return null}else if(Te=new Date(Date.UTC(h.year,h.month,h.day,h.hour,h.minute-h.timezoneOffset,h.second,h.millisecond)),h.month>11||h.month<0||h.day>31||h.day<1||h.hour>23||h.hour<0||h.minute>59||h.minute<0||h.second>59||h.second<0)return null;return Te}var xe={format:vl,parse:Sl,defaultI18n:fo,setGlobalDateI18n:wl,setGlobalDateMasks:El};const ge={fieldIsRequired:"This field is required!",invalidFormat:"Invalid format!",numberTooSmall:"The number is too small! Minimum: {0}",numberTooBig:"The number is too big! Maximum: {0}",invalidNumber:"Invalid number",invalidInteger:"The value is not an integer",textTooSmall:"The length of text is too small! Current: {0}, Minimum: {1}",textTooBig:"The length of text is too big! Current: {0}, Maximum: {1}",thisNotText:"This is not a text!",thisNotArray:"This is not an array!",selectMinItems:"Select minimum {0} items!",selectMaxItems:"Select maximum {0} items!",invalidDate:"Invalid date!",dateIsEarly:"The date is too early! Current: {0}, Minimum: {1}",dateIsLate:"The date is too late! Current: {0}, Maximum: {1}",invalidEmail:"Invalid e-mail address!",invalidURL:"Invalid URL!",invalidCard:"Invalid card format!",invalidCardNumber:"Invalid card number!",invalidTextContainNumber:"Invalid text! Cannot contains numbers or special characters",invalidTextContainSpec:"Invalid text! Cannot contains special characters"};function Re(n,a,s=ge){return C.isNil(n)||n===""?a?[ie(s.fieldIsRequired)]:[]:null}function ie(n,...a){if(n!=null&&a.length>0)for(let s=0;s<a.length;s++)n=n.replace("{"+(s-1)+"}",a[s]);return n}const cn={resources:ge,required(n,a,s,m=ge){return Re(n,a.required,m)},number(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;const u=[];return C.isFinite(n)?(!C.isNil(a.min)&&n<a.min&&u.push(ie(m.numberTooSmall,a.min)),!C.isNil(a.max)&&n>a.max&&u.push(ie(m.numberTooBig,a.max))):u.push(ie(m.invalidNumber)),u},integer(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;const u=cn.number(n,a,s,m);return C.isInteger(n)||u.push(ie(m.invalidInteger)),u},double(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!C.isNumber(n)||isNaN(n))return[ie(m.invalidNumber)]},string(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;const u=[];return C.isString(n)?(!C.isNil(a.min)&&n.length<a.min&&u.push(ie(m.textTooSmall,n.length,a.min)),!C.isNil(a.max)&&n.length>a.max&&u.push(ie(m.textTooBig,n.length,a.max))):u.push(ie(m.thisNotText)),u},array(n,a,s,m=ge){if(a.required){if(!C.isArray(n))return[ie(m.thisNotArray)];if(n.length===0)return[ie(m.fieldIsRequired)]}if(!C.isNil(n)){if(!C.isNil(a.min)&&n.length<a.min)return[ie(m.selectMinItems,a.min)];if(!C.isNil(a.max)&&n.length>a.max)return[ie(m.selectMaxItems,a.max)]}},date(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;const u=new Date(n);if(isNaN(u.getDate()))return[ie(m.invalidDate)];const b=[];if(!C.isNil(a.min)){const g=new Date(a.min);u.valueOf()<g.valueOf()&&b.push(ie(m.dateIsEarly,xe.format(u),xe.format(g)))}if(!C.isNil(a.max)){const g=new Date(a.max);u.valueOf()>g.valueOf()&&b.push(ie(m.dateIsLate,xe.format(u),xe.format(g)))}return b},regexp(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!C.isNil(a.pattern)&&!new RegExp(a.pattern).test(n))return[ie(m.invalidFormat)]},email(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n))return[ie(m.invalidEmail)]},url(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(n))return[ie(m.invalidURL)]},creditCard(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;const u=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,b=n.replace(/[^0-9]+/g,"");if(!u.test(b))return[ie(m.invalidCard)];let g=0,T,B,V;for(let ee=b.length-1;ee>=0;ee--)T=b.substring(ee,ee+1),B=parseInt(T,10),V?(B*=2,B>=10?g+=B%10+1:g+=B):g+=B,V=!V;if(!(g%10===0&&b))return[ie(m.invalidCardNumber)]},alpha(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!/^[a-zA-Z]*$/.test(n))return[ie(m.invalidTextContainNumber)]},alphaNumeric(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!/^[a-zA-Z0-9]*$/.test(n))return[ie(m.invalidTextContainSpec)]}};Object.keys(cn).forEach(n=>{const a=cn[n];C.isFunction(a)&&(a.locale=s=>(m,h,u)=>a(m,h,u,C.defaults(s,ge)))});function bo(n){return C.isString(n)?cn[n]!=null?cn[n]:(console.warn(`'${n}' is not a validator function!`),null):n}function Ar(n,a,s){let m=C.get(s.context,"schema.attributes",{});const h=a.value||"input";C.isString(h)&&(m=C.get(m,h)||m),C.forEach(m,(u,b)=>{n.setAttribute(b,u)})}const Y={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:Ar,updated:Ar,componentUpdated:Ar}},computed:{value:{cache:!1,get(){let n;return C.isFunction(C.get(this.schema,"get"))?n=this.schema.get(this.model):n=C.get(this.model,this.schema.model),this.formatValueToField(n)},set(n){const a=this.value;n=this.formatValueToModel(n),C.isFunction(n)?n(n,a):this.updateModelValue(n,a)}}},methods:{validate(n){this.clearValidationErrors();const a=C.get(this.formOptions,"validateAsync",!1);let s=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const h=[];C.isArray(this.schema.validator)?C.forEach(this.schema.validator,u=>{h.push(bo(u).bind(this))}):h.push(bo(this.schema.validator).bind(this)),C.forEach(h,u=>{if(a)s.push(u(this.value,this.schema,this.model));else{const b=u(this.value,this.schema,this.model);b&&C.isFunction(b.then)?b.then(g=>{g&&(this.errors=this.errors.concat(g));const T=this.errors.length===0;this.$emit("validated",T,this.errors,this)}):b&&(s=s.concat(b))}})}const m=h=>{let u=[];C.forEach(C.uniq(h),g=>{C.isArray(g)&&g.length>0?u=u.concat(g):C.isString(g)&&u.push(g)}),C.isFunction(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,u,this.schema);const b=u.length===0;return n||this.$emit("validated",b,u,this),this.errors=u,u};return a?Promise.all(s).then(m):m(s)},debouncedValidate(){C.isFunction(this.debouncedValidateFunc)||(this.debouncedValidateFunc=C.debounce(this.validate.bind(this),C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(n,a){let s=!1;C.isFunction(this.schema.set)?(this.schema.set(this.model,n),s=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,n),s=!0),s&&(this.$emit("modelUpdated",n,this.schema.model),C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,n,a,this.schema),C.get(this.formOptions,"validateAfterChanged",!1)===!0&&(C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(n,a){let s=n.replace(/\[(\w+)\]/g,".$1");s=s.replace(/^\./,"");let m=this.model;const h=s.split(".");let u=0;const b=h.length;for(;u<b;){const g=h[u];if(u<b-1)m[g]!==void 0||(m[g]={}),m=m[g];else{m[g]=a;return}++u}},getFieldID(n,a=!1){const s=C.get(this.formOptions,"fieldIdPrefix","");return ro(n,s)+(a?"-"+C.uniqueId():"")},getFieldClasses(){return C.get(this.schema,"fieldClasses",[])},formatValueToField(n){return n},formatValueToModel(n){return n}}},Tl=Object.freeze(Object.defineProperty({__proto__:null,default:Y},Symbol.toStringTag,{value:"Module"})),Bl={mixins:[Y]},Il=["id","autocomplete","disabled","name","required"];function Ml(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("input",{id:n.getFieldID(n.schema),type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=g=>n.value=g),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,class:i.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Il)),[[i.vModelCheckbox,n.value],[b,"input"]])}const P=(n,a)=>{const s=n.__vccOpts||n;for(const[m,h]of a)s[m]=h;return s},Nl=P(Bl,[["render",Ml]]),Al={class:"wrapper"},Fl=["disabled"],$l=["id","checked","disabled","onChange","name"],Vl=["disabled"],Ol={class:"info"},Dl=i.createElementVNode("div",{class:"arrow"},null,-1),Ll={class:"dropList"},Ul=["id","checked","disabled","onChange","name"];function xl(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",Al,[n.schema.listBox?(i.openBlock(),i.createElementBlock("div",{key:0,class:"listbox form-control",disabled:n.disabled||null},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[i.createElementVNode("label",null,[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:T=>u.onChanged(T,g),name:u.getInputName(g)},null,40,$l),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)])],2))),256))],8,Fl)):i.createCommentVNode("",!0),n.schema.listBox?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:1,class:"combobox form-control",disabled:n.disabled||null},[i.createElementVNode("div",{class:i.normalizeClass(["mainRow",{expanded:h.comboExpanded}]),onClick:a[0]||(a[0]=(...g)=>u.onExpandCombo&&u.onExpandCombo(...g))},[i.createElementVNode("div",Ol,i.toDisplayString(u.selectedCount)+" selected",1),Dl],2),i.createElementVNode("div",Ll,[h.comboExpanded?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[i.createElementVNode("label",null,[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:T=>u.onChanged(T,g),name:u.getInputName(g)},null,40,Ul),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)])],2))),256)):i.createCommentVNode("",!0)])],8,Vl))])),[[b,"wrapper"]])}const Rl=P({mixins:[Y],data(){return{comboExpanded:!1}},computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(n){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?io(this.schema.inputName+"_"+this.getItemValue(n)):io(this.getItemValue(n))},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return n[this.schema.checklistOptions.value];if(typeof n.value<"u")return n.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return n[this.schema.checklistOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return n},isItemChecked(n){return this.value&&this.value.indexOf(this.getItemValue(n))!==-1},onChanged(n,a){if((C.isNil(this.value)||!Array.isArray(this.value))&&(this.value=[]),n.target.checked){const s=C.clone(this.value);s.push(this.getItemValue(a)),this.value=s}else{const s=C.clone(this.value);s.splice(this.value.indexOf(this.getItemValue(a)),1),this.value=s}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",xl]]),Pl={class:"wrapper"},ql=["id","type","value","disabled","accept","alt","autocomplete","checked","dirname","formaction","formenctype","formmethod","formnovalidate","formtarget","height","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","readonly","required","size","src","step","width","files"],zl={key:0,class:"helper"};function Hl(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",Pl,[i.withDirectives(i.createElementVNode("input",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),id:n.getFieldID(n.schema),type:u.inputType,value:n.value,onInput:a[0]||(a[0]=(...g)=>u.onInput&&u.onInput(...g)),onBlur:a[1]||(a[1]=(...g)=>u.onBlur&&u.onBlur(...g)),onChange:a[2]||(a[2]=(...g)=>n.schema.onChange&&n.schema.onChange(...g)),disabled:n.disabled||null,accept:n.schema.accept,alt:n.schema.alt,autocomplete:n.schema.autocomplete,checked:n.schema.checked||null,dirname:n.schema.dirname,formaction:n.schema.formaction,formenctype:n.schema.formenctype,formmethod:n.schema.formmethod,formnovalidate:n.schema.formnovalidate,formtarget:n.schema.formtarget,height:n.schema.height,list:n.schema.list,max:n.schema.max,maxlength:n.schema.maxlength,min:n.schema.min,minlength:n.schema.minlength,multiple:n.schema.multiple,name:n.schema.inputName,pattern:n.schema.pattern,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,size:n.schema&&n.schema.size>0?n.schema.size:1,src:n.schema.src,step:n.schema.step,width:n.schema.width,files:n.schema.files},null,42,ql),[[b,"input"]]),n.schema.inputType.toLowerCase()==="color"||n.schema.inputType.toLowerCase()==="range"?(i.openBlock(),i.createElementBlock("span",zl,i.toDisplayString(n.value),1)):i.createCommentVNode("",!0)])),[[b,"wrapper"]])}const wo={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},Co=P({mixins:[Y],computed:{inputType(){return this.schema&&this.schema.inputType==="datetime"?"datetime-local":this.schema.inputType}},mounted(){switch(this.schema.inputType.toLowerCase()){case"number":case"range":this.debouncedFormatFunc=C.debounce((n,a)=>{this.formatNumberToModel(n,a)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":this.debouncedFormatFunc=C.debounce((n,a)=>{this.formatDatetimeToModel(n,a)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}},created(){this.schema.inputType.toLowerCase()==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")},methods:{formatValueToModel(n){if(n!=null)switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":case"number":case"range":return(a,s)=>{this.debouncedFormatFunc(n,s)}}return n},formatValueToField(n){switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":return this.formatDatetimeValueToField(n)}return n},formatDatetimeToModel(n,a){const s=wo[this.schema.inputType.toLowerCase()],m=xe.parse(n,s);m!==!1&&(this.schema.format?n=xe.format(m,this.schema.format):n=m.valueOf()),this.updateModelValue(n,a)},formatDatetimeValueToField(n){if(n==null)return null;const a=wo[this.schema.inputType.toLowerCase()];let s=n;return C.isNumber(n)||(s=xe.parse(n,a)),s!==!1?xe.format(s,a):n},formatNumberToModel(n,a){C.isNumber(n)||(n=NaN),this.updateModelValue(n,a)},onInput(n){let a=n.target.value;switch(this.schema.inputType.toLowerCase()){case"number":case"range":C.isNumber(parseFloat(n.target.value))&&(a=parseFloat(n.target.value));break}this.value=a},onBlur(){C.isFunction(this.debouncedFormatFunc)&&this.debouncedFormatFunc.flush()}}},[["render",Hl]]),Wl=["id"];function Kl(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("span",{id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[i.createTextVNode(i.toDisplayString(n.value),1)],10,Wl)),[[b,"label"]])}const Yl=P({mixins:[Y]},[["render",Kl]]),Gl=["disabled"],Zl=["id","disabled","name","onClick","value","checked","required"];function Jl(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",{class:"radio-list",disabled:n.disabled||null},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>i.withDirectives((i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(u.getItemCssClasses(g))},[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"radio",disabled:u.isItemDisabled(g)||null,name:u.id,onClick:T=>u.onSelection(g),value:u.getItemValue(g),checked:u.isItemChecked(g)||null,class:i.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Zl),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)],2)),[[b,"label"]])),256))],8,Gl)),[[b,"wrapper"]])}const Xl=P({mixins:[Y],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},id(){return this.schema.model}},methods:{getItemValue(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.value<"u")return n[this.schema.radiosOptions.value];if(typeof n.value<"u")return n.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.name<"u")return n[this.schema.radiosOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return n},getItemCssClasses(n){return{"is-checked":this.isItemChecked(n),"is-disabled":this.isItemDisabled(n)}},onSelection(n){this.value=this.getItemValue(n)},isItemChecked(n){return this.getItemValue(n)===this.value},isItemDisabled(n){if(this.disabled)return!0;const a=C.get(n,"disabled",!1);return C.isFunction(a)?a(this.model):a}}},[["render",Jl]]),Ql=["disabled","name","id"],jl=["disabled"],ed=["label"],td=["value"],nd=["value"];function rd(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("select",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":a[0]||(a[0]=g=>n.value=g),disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},[u.selectOptions.hideNoneSelectedText?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null},i.toDisplayString(u.selectOptions.noneSelectedText||"<Nothing selected>"),9,jl)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[g.group?(i.openBlock(),i.createElementBlock("optgroup",{key:0,label:u.getGroupName(g)},[g.ops?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(g.ops,T=>(i.openBlock(),i.createElementBlock("option",{value:u.getItemValue(T)},i.toDisplayString(u.getItemName(T)),9,td))),256)):i.createCommentVNode("",!0)],8,ed)):i.createCommentVNode("",!0),g.group?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",{key:1,value:u.getItemValue(g)},i.toDisplayString(u.getItemName(g)),9,nd))],64))),256))],10,Ql)),[[i.vModelSelect,n.value],[b,"input"]])}const ko=P({mixins:[Y],computed:{selectOptions(){return this.schema.selectOptions||{}},items(){const n=this.schema.values;return typeof n=="function"?this.groupValues(n.apply(this,[this.model,this.schema])):this.groupValues(n)}},methods:{formatValueToField(n){return C.isNil(n)?null:n},groupValues(n){const a=[];let s={};return n.forEach(m=>{s=null,m.group&&C.isObject(m)?(s=C.find(a,h=>h.group===m.group),s?s.ops.push({id:m.id,name:m.name}):(s={group:"",ops:[]},s.group=m.group,s.ops.push({id:m.id,name:m.name}),a.push(s))):a.push(m)}),a},getGroupName(n){if(n&&n.group)return n.group;throw new Error("Group name is missing! https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n}}},[["render",rd]]),id=["id","value","name","disabled"];function od(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("input",{id:n.getFieldID(n.schema),type:"submit",value:n.schema.buttonText,onClick:a[0]||(a[0]=(...b)=>u.onClick&&u.onClick(...b)),name:n.schema.inputName,disabled:n.disabled||null,class:i.normalizeClass(n.schema.fieldClasses)},null,10,id)}const sd=P({mixins:[Y],methods:{onClick(n){if(this.schema.validateBeforeSubmit===!0){n.preventDefault();const a=C.get(this.formOptions,"validateAsync",!1),s=this.vfg.validate(),m=h=>{a&&!C.isEmpty(h)||!a&&!h?C.isFunction(this.schema.onValidationError)&&this.schema.onValidationError(this.model,this.schema,h,n):C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)};s&&C.isFunction(s.then)?s.then(m):m(s)}else C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)}}},[["render",od]]),ad=["id","disabled","maxlength","minlength","placeholder","readonly","required","rows","name"];function ld(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("textarea",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":a[0]||(a[0]=g=>n.value=g),id:n.getFieldID(n.schema),disabled:n.disabled||null,maxlength:n.schema.max,minlength:n.schema.min,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,rows:n.schema.rows||2,name:n.schema.inputName},null,10,ad)),[[i.vModelText,n.value],[b,"input"]])}const Eo=P({mixins:[Y]},[["render",ld]]),dd={class:"wrapper"},cd=["id","name","accept","multiple","placeholder","readonly","required","disabled"];function ud(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",dd,[i.withDirectives(i.createElementVNode("input",{class:"form-control",id:n.getFieldID(n.schema),type:"file",name:n.schema.inputName,onChange:a[0]||(a[0]=(...g)=>u.onChange&&u.onChange(...g)),accept:n.schema.accept,multiple:n.schema.multiple,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,disabled:n.disabled||null},null,40,cd),[[b,"input"]])])),[[b,"wrapper"]])}const fd=P({mixins:[Y],methods:{onChange(n){C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,this.schema,n,this)}}},[["render",ud]]),hd=["value","autocomplete","disabled","placeholder","readonly","name","id"];function md(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text",value:n.value,autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,hd)}const pd=P({mixins:[Y],data(){return{cleave:null}},mounted(){this.$nextTick(function(){window.Cleave?(this.cleave=new window.Cleave(this.$el,C.defaults(this.schema.cleaveOptions||{},{creditCard:!1,phone:!1,phoneRegionCode:"AU",date:!1,datePattern:["d","m","Y"],numeral:!1,numeralThousandsGroupStyle:"thousand",numeralDecimalScale:2,numeralDecimalMark:".",blocks:[],delimiter:" ",prefix:null,numericOnly:!1,uppercase:!1,lowercase:!1,maxLength:0})),this.cleave.properties&&this.cleave.properties.hasOwnProperty.call("result")?this.$watch("cleave.properties.result",()=>{this.value=this.cleave.properties.result}):this.$el.addEventListener("input",this.inputChange)):console.warn("Cleave is missing. Please download from https://github.com/nosir/cleave.js/ and load the script in the HTML head section!")})},beforeUnmount(){this.cleave&&(this.cleave.destroy(),this.$el.removeEventListener("input",this.inputChange))},methods:{inputChange(){this.value=this.$el.value}}},[["render",md]]),vo={formatValueToField(n){if(n!=null){const a=this.schema.format?xe.parse(n,this.schema.format):new Date(n);return xe.format(a,this.getDateFormat())}return n},formatValueToModel(n){if(n!=null){const a=xe.parse(n,this.getDateFormat());this.schema.format?n=xe.format(a,this.schema.format):n=a.valueOf()}return n}},gd={class:"input-group date"},yd=["autocomplete","disabled","placeholder","readonly","name","id"],_d=i.createElementVNode("span",{class:"input-group-addon"},[i.createElementVNode("span",{class:"glyphicon glyphicon-calendar"})],-1);function bd(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("div",gd,[i.withDirectives(i.createElementVNode("input",{class:"form-control",type:"text","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,yd),[[i.vModelText,n.value]]),_d])}const So="YYYY-MM-DD HH:mm:ss",wd={mixins:[Y],mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.datetimepicker){const n=this.$el.querySelector(".form-control");$(this.$el).datetimepicker(C.defaults(this.schema.dateTimePickerOptions||{},{format:So})).on("dp.change",()=>{this.value=n.value})}else console.warn("Bootstrap datetimepicker library is missing. Please download from https://eonasdan.github.io/bootstrap-datetimepicker/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.datetimepicker&&$(this.$el).data("DateTimePicker").destroy()},methods:{getDateFormat(){return this.schema.dateTimePickerOptions&&this.schema.dateTimePickerOptions.format?this.schema.dateTimePickerOptions.format:So},...vo}},Cd=P(wd,[["render",bd]]),kd=["autocomplete","disabled","placeholder","readonly","name","id"];function Ed(n,a,s,m,h,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,debounce:"500",onFocus:a[1]||(a[1]=b=>u.geolocate()),id:n.getFieldID(n.schema)},null,40,kd)),[[i.vModelText,n.value]])}const vd=P({mixins:[Y],data(){return{autocomplete:"",inputs:{street_number:"long_name",route:"long_name",country:"long_name",administrative_area_level_1:"long_name",administrative_area_level_2:"long_name",locality:"long_name",postal_code:"short_name"}}},mounted(){this.$nextTick(()=>{window.google&&window.google.maps&&window.google.maps.places&&window.google.maps.places.Autocomplete?(this.autocomplete=new google.maps.places.Autocomplete(this.$el,{types:["geocode"]}),this.autocomplete.addListener("place_changed",this.pipeAddress)):console.warn("Google Maps API is missing. Please add https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&libraries=places script in the HTML head section!")})},methods:{pipeAddress(){const n=this.autocomplete.getPlace();if(n){this.value=n.formatted_address;const a={};if(n.address_components!==void 0)for(let s=0;s<n.address_components.length;s++){const m=n.address_components[s].types[0];this.inputs[m]&&(a[m]=n.address_components[s][this.inputs[m]])}C.isFunction(this.schema.onPlaceChanged)&&this.schema.onPlaceChanged(this.value,a,n,this.model,this.schema)}},geolocate(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(n=>{const a={lat:n.coords.latitude,lng:n.coords.longitude},s=new window.google.maps.Circle({center:a,radius:n.coords.accuracy});this.autocomplete.setBounds(s.getBounds())})}}},[["render",Ed]]),Sd={class:"wrapper"},Td=["autocomplete","disabled","placeholder","readonly"],Bd=["disabled","name"];function Id(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("div",Sd,[i.withDirectives(i.createElementVNode("input",{class:"form-control link",type:"text","onUpdate:modelValue":a[0]||(a[0]=b=>u.wrappedValue=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly},null,8,Td),[[i.vShow,n.schema.hideInput!==!0],[i.vModelText,u.wrappedValue]]),n.schema.browse!==!1?(i.openBlock(),i.createElementBlock("input",{key:0,class:"form-control file",type:"file",disabled:n.disabled||null,onChange:a[1]||(a[1]=(...b)=>u.fileChanged&&u.fileChanged(...b)),name:n.schema.inputName},null,40,Bd)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"preview",style:i.normalizeStyle(u.previewStyle)},[i.createElementVNode("div",{class:"remove",title:"Remove image",onClick:a[2]||(a[2]=(...b)=>u.remove&&u.remove(...b))})],4)])}const Md=P({mixins:[Y],computed:{previewStyle(){return this.schema.preview!==!1?{display:"block","background-image":this.value!=null?"url("+this.value+")":"none"}:{display:"none"}},wrappedValue:{get(){return this.value&&this.value.indexOf("data")===0?"<inline base64 image>":this.value},set(n){n&&n.indexOf("http")===0&&(this.value=n)}}},watch:{model:{deep:!0,handler(){const n=this.$el.querySelector("input.file");n&&(n.value="")}}},methods:{remove(){this.value=""},fileChanged(n){const a=new FileReader;a.onload=s=>{this.value=s.target.result},n.target.files&&n.target.files.length>0&&a.readAsDataURL(n.target.files[0])}}},[["render",Id]]),Nd=["autocomplete","disabled","placeholder","readonly","name","id"];function Ad(n,a,s,m,h,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Nd)),[[i.vModelText,n.value]])}const Fd=P({mixins:[Y],mounted(){this.$nextTick(function(){window.$&&window.$.fn.mask?$(this.$el).unmask().mask(this.schema.mask,this.schema.maskOptions):console.warn("JQuery MaskedInput library is missing. Please download from https://github.com/digitalBush/jquery.maskedinput and load the script in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.mask&&$(this.$el).unmask()}},[["render",Ad]]),$d={mixins:[Y],data(){return{slider:null}},computed:{containPips(){return this.schema.noUiSliderOptions&&typeof this.schema.noUiSliderOptions.pips<"u"},containTooltip(){return this.schema.noUiSliderOptions&&this.schema.noUiSliderOptions.tooltips}},watch:{model:{handler(){window.noUiSlider&&this.slider&&this.slider.noUiSlider&&this.slider.noUiSlider.set(this.value)},deep:!0}},mounted(){this.$nextTick(()=>{window.noUiSlider?(this.slider=this.$el,window.noUiSlider.create(this.slider,C.defaults(this.schema.noUiSliderOptions||{},{start:this.getStartValue(),range:{min:this.schema.min,max:this.schema.max}})),this.slider.noUiSlider.on("change",this.onChange.bind(this))):console.warn("noUiSlider is missing. Please download from https://github.com/leongersen/noUiSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.noUiSlider.off("change")},methods:{onChange(n){C.isArray(n)?this.value=[parseFloat(n[0]),parseFloat(n[1])]:this.value=parseFloat(n)},formatValueToField(n){this.slider!==null&&typeof this.slider.noUiSlider<"u"&&this.slider.noUiSlider.set(n)},formatValueToModel(n){if(typeof this.slider.noUiSlider<"u")return n instanceof Array?[Number(n[0]),Number(n[1])]:Number(n)},getStartValue(){return this.value!=null?this.value:typeof this.schema.noUiSliderOptions<"u"&&this.schema.noUiSliderOptions.double?[this.schema.min,this.schema.min]:this.schema.min}}},Vd=["disabled"];function Od(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["slider",{"contain-pips":u.containPips,"contain-tooltip":u.containTooltip}]),disabled:n.disabled||null},null,10,Vd)}const Dd=P($d,[["render",Od]]),Ld=["autocomplete","disabled","placeholder","readonly","name"];function Ud(n,a,s,m,h,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,Ld)),[[i.vModelText,n.value]])}const xd="YYYY-MM-DD",Rd={mixins:[Y],data(){return{picker:null,options:null}},mounted(){this.initialize(C.get(this.schema,"pikadayOptions",{}))},beforeUnmount(){this.picker&&this.picker.destroy()},methods:{getDateFormat(){return C.get(this.schema,"pikadayOptions.format",xd)},...vo,initialize(n){this.picker&&this.picker.destroy&&this.picker.destroy(),this.$nextTick(()=>{window.Pikaday?(this.options=C.defaults({},n,{field:this.$el,onSelect:()=>{this.value=this.picker.toString()}}),this.picker=new window.Pikaday(this.options)):console.warn("Pikaday is missing. Please download from https://github.com/dbushell/Pikaday/ and load the script and CSS in the HTML head section!")})}}},Pd=P(Rd,[["render",Ud]]),qd=["autocomplete","data-disable","data-max","data-min","data-step","placeholder","readonly","name"];function zd(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,"data-disable":n.disabled,"data-max":n.schema.max,"data-min":n.schema.min,"data-step":n.schema.step,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,qd)}const Hd=P({mixins:[Y],data(){return{slider:null}},watch:{model:{deep:!0,handler(){if(window.$&&window.$.fn.ionRangeSlider){let n,a;C.isArray(this.value)?[n,a]=this.value:n=this.value,this.slider&&this.slider.update({from:n,to:a})}}}},mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.ionRangeSlider){let n,a;C.isArray(this.value)?[n,a]=this.value:n=this.value;const s=this;$(this.$el).ionRangeSlider(C.defaults(this.schema.rangeSliderOptions||{},{type:"single",grid:!0,hide_min_max:!0,from:n,to:a,onChange(m){s.slider.options.type==="double"?s.value=[m.from,m.to]:s.value=m.from}})),this.slider=$(this.$el).data("ionRangeSlider")}else console.warn("ion.rangeSlider library is missing. Please download from https://github.com/IonDen/ion.rangeSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.destroy()}},[["render",zd]]),Wd=["disabled","multiple","title","name"],Kd=["disabled","selected"],Yd=["value"];function Gd(n,a,s,m,h,u){return i.withDirectives((i.openBlock(),i.createElementBlock("select",{class:"selectpicker","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),disabled:n.disabled||null,multiple:n.schema.multiSelect,title:n.schema.placeholder,"data-width":"100%",name:n.schema.inputName},[n.schema.multiSelect!==!0?(i.openBlock(),i.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null,selected:n.value==null},null,8,Kd)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,b=>(i.openBlock(),i.createElementBlock("option",{value:u.getItemValue(b)},i.toDisplayString(u.getItemName(b)),9,Yd))),256))],8,Wd)),[[i.vModelSelect,n.value]])}const Zd=P({mixins:[Y],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n}},watch:{model:{deep:!0,handler(){$.fn.selectpicker&&$(this.$el).selectpicker("refresh")}}},mounted(){this.$nextTick(function(){$.fn.selectpicker?$(this.$el).selectpicker("destroy").selectpicker(this.schema.selectOptions):console.warn("Bootstrap-select library is missing. Please download from https://silviomoreto.github.io/bootstrap-select/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){$.fn.selectpicker&&$(this.$el).selectpicker("destroy")},methods:{getItemValue(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n}}},[["render",Gd]]),Jd=["autocomplete","disabled","placeholder","readonly","name","id"];function Xd(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Jd)}const Qd=P({mixins:[Y],data(){return{picker:null}},watch:{model:{deep:!0,handler(){window.$&&window.$.fn.spectrum&&this.picker.spectrum("set",this.value)}},disabled(n){n?this.picker.spectrum("disable"):this.picker.spectrum("enable")}},mounted(){this.$nextTick(function(){window.$&&window.$.fn.spectrum?(this.picker=$(this.$el).spectrum("destroy").spectrum(C.defaults(this.schema.colorOptions||{},{showInput:!0,showAlpha:!0,disabled:this.schema.disabled,allowEmpty:!this.schema.required,preferredFormat:"hex",change:n=>{this.value=n?n.toString():null}})),this.picker.spectrum("set",this.value)):console.warn("Spectrum color library is missing. Please download from http://bgrins.github.io/spectrum/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.picker&&this.picker.spectrum("destroy")}},[["render",Xd]]),jd=["src"];function ec(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("img",{src:u.mapLink},null,8,jd)}const tc=P({mixins:[Y],computed:{mapLink(){let n,a,s;if(this.value){const m=C.defaults(this.schema.staticMapOptions||{},{lat:"lat",lng:"lng",zoom:8,sizeX:640,sizeY:640});n=this.value[m.lat],a=this.value[m.lng],s=`http://maps.googleapis.com/maps/api/staticmap?center=${n},${a}&zoom=${m.zoom}&size=${m.sizeX}x${m.sizeY}`;const h=["scale","format","maptype","language","region","markers","path","visible","style","key","signature"];for(const u of h)typeof m[u]<"u"&&(s+=`&${u}=${m[u]}`)}return s}}},[["render",ec]]),nc=["autocomplete","disabled","name","id"],rc=["data-on","data-off","for"],ic=i.createElementVNode("span",{class:"handle"},null,-1);function oc(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("label",null,[i.withDirectives(i.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,nc),[[i.vModelCheckbox,n.value]]),i.createElementVNode("span",{class:"label","data-on":n.schema.textOn||"On","data-off":n.schema.textOff||"Off",for:n.getFieldID(n.schema)},null,8,rc),ic])}const sc=P({mixins:[Y],methods:{formatValueToField(n){return n!=null&&this.schema.valueOn?n===this.schema.valueOn:n},formatValueToModel(n){return n!=null&&this.schema.valueOn?n?this.schema.valueOn:this.schema.valueOff:n}}},[["render",oc]]),ac={mixins:[Y],data(){return{attributes:this.schema?this.schema.attributes:void 0,newKeyType:"string",newKeyName:"",keyTypes:{}}},created(){this.value||(this.value={})},mounted(){if(!this.value)return;const n=Object.keys(this.value),a={};for(let s=0;s<n.length;s++){const m=n[s];a[m]=typeof this.value[m]}this.keyTypes=a},methods:{removeElement(n){const a=this.value;delete a[n],this.value=JSON.parse(JSON.stringify(a));const s=this.keyTypes;delete s[n],this.keyTypes=JSON.parse(JSON.stringify(s))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""}}},lc={key:0},dc={key:1},cc=["id"],uc={key:0},fc=["onUpdate:modelValue"],hc={key:1},mc=["onUpdate:modelValue"],pc={key:2},gc=["onUpdate:modelValue"],yc=["onClick"],_c=[i.createElementVNode("option",{value:"string"}," String ",-1),i.createElementVNode("option",{value:"number"}," Number ",-1),i.createElementVNode("option",{value:"boolean"}," Boolean ",-1)];function bc(n,a,s,m,h,u){const b=i.resolveComponent("vue-form-generator"),g=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",null,[n.schema.schema?(i.openBlock(),i.createElementBlock("div",lc,[i.createVNode(b,{model:n.value,options:n.formOptions,schema:n.schema.schema},null,8,["model","options","schema"])])):(i.openBlock(),i.createElementBlock("div",dc,[i.createElementVNode("table",{id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(T,B)=>(i.openBlock(),i.createElementBlock("tr",{key:B},[i.createElementVNode("td",null,i.toDisplayString(B),1),h.keyTypes[B]==="string"?(i.openBlock(),i.createElementBlock("td",uc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":V=>n.value[B]=V,type:"text"},null,8,fc),[[i.vModelText,n.value[B]]])])):i.createCommentVNode("",!0),h.keyTypes[B]==="boolean"?(i.openBlock(),i.createElementBlock("td",hc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":V=>n.value[B]=V,type:"checkbox"},null,8,mc),[[i.vModelCheckbox,n.value[B]]])])):i.createCommentVNode("",!0),h.keyTypes[B]==="number"?(i.openBlock(),i.createElementBlock("td",pc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":V=>n.value[B]=V,type:"number"},null,8,gc),[[i.vModelText,n.value[B]]])])):i.createCommentVNode("",!0),i.createElementVNode("td",null,[i.createElementVNode("input",{type:"button",value:"x",onClick:V=>u.removeElement(B)},null,8,yc)])]))),128))],10,cc),i.withDirectives(i.createElementVNode("select",{"onUpdate:modelValue":a[0]||(a[0]=T=>h.newKeyType=T)},_c,512),[[i.vModelSelect,h.newKeyType]]),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":a[1]||(a[1]=T=>h.newKeyName=T),type:"text"},null,512),[[i.vModelText,h.newKeyName]]),i.createElementVNode("input",{type:"button",value:"Add key",onClick:a[2]||(a[2]=(...T)=>u.addKey&&u.addKey(...T))})]))])),[[g,h.attributes]])}const To=P(ac,[["render",bc]]),wc={mixins:[Y],emits:["model-updated"],data(){return{newKeyName:""}},computed:{subSchema(){return this.schema.schema&&this.schema.schema.fields[0].schema},subFields(){return!this.subSchema&&this.schema.fields},hasObjectKeys(){return this.value&&Object.keys(this.value).length>0},transformedModel(){return this.subSchema&&this.subSchema.fields.length>=1&&this.subSchema.fields[0].type==="array"?new Proxy(this.model[this.schema.model],{get:(n,a)=>({[this.schema.model]:n[a]}),set:(n,a,s)=>n[a]=s[this.schema.model]}):this.model[this.schema.model]}},mounted(){this.value||(this.value={});let n=[];this.subSchema?n=this.subSchema.fields:this.subFields&&(n=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,n,this.schema.model)},methods:{removeElement(n){const a=this.value;delete a[n],this.value={...a}},transformMapModelValuesToObject(n,a,s){const m={};return Object.keys(n).map(h=>{const u=h.indexOf(s+"-");if(u>-1&&Array.isArray(a))if(a.length>0){const g=h.split("-").filter(B=>a.find(V=>V.model===B)),T=h.split(`-${g}`)[0].split(`${s}-`)[1];g.length?m[T]={...m[T],[g]:n[h]}:m[h.substring(u+`${s}-`.length)]=n[h]}else m[h.substring(`${s}-`.length)]=n[h];else{const g=h.split("-").filter(B=>B===this.schema.model),T=h.split(`-${g}`)[0].split(`${s}-`)[1];T&&(m[T]=n[h])}return h}),m},addKey(){const n=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",a=this.subSchema?n?[""]:{}:"";this.value[this.newKeyName]=a,this.newKeyName=""},updateModel(n,a){this.$emit("model-updated",this.model[this.schema.model],a)}}},Bo=n=>(i.pushScopeId("data-v-22600a29"),n=n(),i.popScopeId(),n),Cc=["id"],kc=["data-testid"],Ec={class:"item-wrapper"},vc={class:"index-wrapper"},Sc=Bo(()=>i.createElementVNode("hr",{class:"divider"},null,-1)),Tc={key:0},Bc={key:1},Ic=["onUpdate:modelValue","placeholder","onInput"],Mc={key:0,class:"hint"},Nc=Bo(()=>i.createElementVNode("hr",{class:"wide-divider"},null,-1)),Ac={class:"input-item"},Fc=["placeholder"],$c={key:0,class:"hint"};function Vc(n,a,s,m,h,u){const b=i.resolveComponent("KIcon"),g=i.resolveComponent("KButton"),T=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",{id:n.getFieldID(n.schema),class:i.normalizeClass(["object-advanced-wrapper",n.schema.fieldClasses])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(B,V)=>(i.openBlock(),i.createElementBlock("div",{key:V,"data-testid":`field-object-key-${V}`},[i.createElementVNode("div",null,[i.createElementVNode("div",Ec,[i.createElementVNode("div",vc,[i.createElementVNode("strong",null,i.toDisplayString(V),1),i.createElementVNode("div",null,[i.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:ee=>u.removeElement(V)},{default:i.withCtx(()=>[i.createVNode(b,{icon:"trash",size:"18"})]),_:2},1032,["onClick"])])]),Sc,u.subSchema?(i.openBlock(),i.createElementBlock("div",Tc,[i.createVNode(T,{model:u.transformedModel[V],options:{helpAsHtml:!0},schema:u.subSchema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])):(i.openBlock(),i.createElementBlock("div",Bc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":ee=>n.value[V]=ee,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:"text",onInput:ee=>u.updateModel(n.value[V],n.model[n.schema.model])},null,40,Ic),[[i.vModelText,n.value[V]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(i.openBlock(),i.createElementBlock("p",Mc,i.toDisplayString(n.schema.fields[0].schema.hint),1)):i.createCommentVNode("",!0)])),Nc])])],8,kc))),128)),i.createElementVNode("div",{class:i.normalizeClass(["input-wrapper",{indent:u.hasObjectKeys}])},[i.createElementVNode("div",Ac,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=B=>h.newKeyName=B),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,Fc),[[i.vModelText,h.newKeyName]]),i.createVNode(g,{appearance:"tertiary","data-testid":"add-key",disabled:!h.newKeyName,onClick:u.addKey},{default:i.withCtx(()=>[i.createTextVNode(" + Add "+i.toDisplayString(n.schema.buttonLabel||n.schema.label),1)]),_:1},8,["disabled","onClick"])]),n.schema.hintText?(i.openBlock(),i.createElementBlock("p",$c,i.toDisplayString(n.schema.hintText),1)):i.createCommentVNode("",!0)],2)],10,Cc)}const Io=P(wc,[["render",Vc],["__scopeId","data-v-22600a29"]]),Dn="24px",Mo=(n,a)=>{const s=n.__vccOpts||n;for(const[m,h]of a)s[m]=h;return s},Oc=n=>(i.pushScopeId("data-v-98fcb3eb"),n=n(),i.popScopeId(),n),Dc=["aria-hidden"],Lc={key:0,"data-testid":"kui-icon-svg-title"},Uc=Oc(()=>i.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),xc=i.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const a=String(n).replace(/px/gi,""),s=Number(a);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const a=n,s=i.computed(()=>{if(typeof a.size=="number"&&a.size>0)return`${a.size}px`;if(typeof a.size=="string"){const h=String(a.size).replace(/px/gi,""),u=Number(h);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=i.computed(()=>({boxSizing:"border-box",color:a.color,display:a.display,height:s.value,lineHeight:"0",width:s.value}));return(h,u)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:i.normalizeStyle(m.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(i.openBlock(),i.createElementBlock("title",Lc,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),Uc],8,Dc))]),_:1},8,["aria-hidden","style"]))}}),Rc=Mo(xc,[["__scopeId","data-v-98fcb3eb"]]),Pc=n=>(i.pushScopeId("data-v-c466bb6b"),n=n(),i.popScopeId(),n),qc=["aria-hidden"],zc={key:0,"data-testid":"kui-icon-svg-title"},Hc=Pc(()=>i.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),Wc=i.defineComponent({__name:"TrashIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const a=String(n).replace(/px/gi,""),s=Number(a);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const a=n,s=i.computed(()=>{if(typeof a.size=="number"&&a.size>0)return`${a.size}px`;if(typeof a.size=="string"){const h=String(a.size).replace(/px/gi,""),u=Number(h);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=i.computed(()=>({boxSizing:"border-box",color:a.color,display:a.display,height:s.value,lineHeight:"0",width:s.value}));return(h,u)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:i.normalizeStyle(m.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-trash-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(i.openBlock(),i.createElementBlock("title",zc,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),Hc],8,qc))]),_:1},8,["aria-hidden","style"]))}}),Ln=Mo(Wc,[["__scopeId","data-v-c466bb6b"]]),Kc={name:"FieldArrayItem",components:{TrashIcon:Ln},props:{model:{type:String,default:null}},emits:["remove-item"],data(){return{contentVisible:!1}}},Yc={class:"array-item"};function Gc(n,a,s,m,h,u){const b=i.resolveComponent("TrashIcon"),g=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Yc,[i.renderSlot(n.$slots,"default",{},void 0,!0),i.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:a[0]||(a[0]=T=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})])}const No=P(Kc,[["render",Gc],["__scopeId","data-v-d42daeb2"]]),Zc={name:"FieldArrayMultiItem",emits:["remove-item"],data(){return{contentVisible:!1}}},Jc=n=>(i.pushScopeId("data-v-47ff1f9a"),n=n(),i.popScopeId(),n),Xc={class:"multi-item-wrapper"},Qc=Jc(()=>i.createElementVNode("hr",null,null,-1));function jc(n,a,s,m,h,u){const b=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Xc,[i.renderSlot(n.$slots,"default",{},void 0,!0),i.createVNode(b,{appearance:"danger",class:"delete",type:"input",onClick:a[0]||(a[0]=g=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createTextVNode(" - Remove Field ")]),_:1}),Qc])}const Ao=P(Zc,[["render",jc],["__scopeId","data-v-47ff1f9a"]]),eu={name:"FieldMetric",components:{AddIcon:Rc,TrashIcon:Ln},mixins:[Y],emits:["remove-item"],data(){return{contentVisible:!1}}},tu={key:0,class:"content"};function nu(n,a,s,m,h,u){const b=i.resolveComponent("AddIcon"),g=i.resolveComponent("TrashIcon"),T=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["field-dropdown",{active:h.contentVisible}])},[i.createElementVNode("div",{class:"title",onClick:a[0]||(a[0]=B=>h.contentVisible=!h.contentVisible)},[i.createTextVNode(i.toDisplayString(n.model.name?n.model.name:"New Item")+" ",1),i.createVNode(b,{class:"metric-add-icon"})]),i.createVNode(i.Transition,{name:"slide-fade"},{default:i.withCtx(()=>[h.contentVisible?(i.openBlock(),i.createElementBlock("div",tu,[i.renderSlot(n.$slots,"default"),i.createVNode(T,{appearance:"tertiary",class:"metric-remove-button",onClick:a[1]||(a[1]=B=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(g)]),_:1})])):i.createCommentVNode("",!0)]),_:3})],2)}const Fo=P(eu,[["render",nu]]),wt="kong-ui-forms-api",ru="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";function iu(n){return n?n.length===36&&new RegExp(`^${ru}$`).test(n):!1}const Fr=50,Ft={CREATE_NOT_FROM_ENTITY:"CREATE_NOT_FROM_ENTITY",CREATE_FROM_ENTITY:"CREATE_FROM_ENTITY",UPDATE_ENTITY:"UPDATE_ENTITY",SET_REFERRAL_VALUE:"SET_REFERRAL_VALUE"};function ou(n,a,s){return s?Ft.SET_REFERRAL_VALUE:n&&!a||!n&&a?Ft.UPDATE_ENTITY:n&&a?Ft.CREATE_FROM_ENTITY:Ft.CREATE_NOT_FROM_ENTITY}const su={mixins:[Y],inject:[wt],emits:["model-updated"],data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return ou(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search}},watch:{idValue:{handler(n,a){n!==a&&this.updateModel(n)}}},async created(){await this.$nextTick();let n,a;switch(this.fieldState){case Ft.UPDATE_ENTITY:if(!this[wt]){console.warn("[@kong-ui-public/forms] No API service provided");break}a=(await this[wt].getOne(this.entity,this.model[this.schema.model])).data,n=this.getItem(this.schema.entityDataKey?a[this.schema.entityDataKey]:a),this.idValue=n.id;break;case Ft.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case Ft.SET_REFERRAL_VALUE:this.idValue=this.value}try{n&&(this.initialItems=[{...n,label:this.getSuggestionLabel(n),value:n.id}]),this.items=this.initialItems}catch(s){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",s)}},methods:{onQueryChange(n){n.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=C.debounce(this.search,500)),this.performSearch(n)},async search(n){if(n.trim().length===0)return;this.loading=!0;const a=[],s=[],m=this.getInputFields(),h=new Set;iu(n)&&m.includes("id")?s.push((async()=>{const u=await this.fetchExact(n);a.push({...u,label:this.getSuggestionLabel(u),value:u.id})})()):s.push(...m.filter(u=>u!=="id").map(async u=>{(await this.fetchSuggestions(n,u)).forEach(g=>{h.has(g.id)||(h.add(g.id),a.push({...g,label:this.getSuggestionLabel(g),value:g.id}))})})),await Promise.all(s),this.items=a,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(n){return n.data?n.data.length>0?n.data[0]:[]:n},async fetchUntilLimit(n){const a=[];let s=null;if(!this[wt])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;a.length<Fr;){const m=await this[wt].getAll(this.entity,{size:Fr,offset:s,...n});if(a.push(...m.data.data),s=m.data.offset,!s)break}return a.slice(0,Fr)},async fetchSuggestions(n,a){return this.fetchUntilLimit({[a]:n})},async fetchExact(n){return this[wt]?(await this[wt].getOne(this.entity,n)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var n,a;return((a=(n=this.schema)==null?void 0:n.inputValues)==null?void 0:a.fields)||[]},getSuggestionLabel(n){const a=this.getInputFields();return a.length&&n?a.map(s=>n[s]).filter(Boolean).join(" - "):""},updateModel(n){this.$emit("model-updated",n!=null&&n.length?n:null,this.schema.model)},onSelected(n){this.idValue=n&&n.id,this.updateModel(this.getReturnValue(n||{}))},getReturnValue(n){var s;const a=(s=this.schema)==null?void 0:s.returnKey;return a?n[a]:n.id}}},au={class:"field-wrap autosuggest"},lu=["data-testid","data-testlabel"],du=["data-testid"],cu={class:"autosuggest__results_message"};function uu(n,a,s,m,h,u){const b=i.resolveComponent("KSelect");return i.openBlock(),i.createElementBlock("div",au,[i.createVNode(b,{id:n.schema.model,ref:"suggestion",modelValue:h.idValue,"onUpdate:modelValue":a[0]||(a[0]=g=>h.idValue=g),clearable:"","enable-filtering":"","filter-function":()=>!0,items:h.items,loading:h.loading,placeholder:n.schema.placeholder,width:"100%",onChange:u.onSelected,onQueryChange:u.onQueryChange},{"item-template":i.withCtx(({item:g})=>[i.createElementVNode("span",{class:"first-part","data-testid":g.id&&`${g.id}-0`,"data-testlabel":g.label},i.toDisplayString(u.getSuggestionLabel(g).split(" - ")[0]),9,lu),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.getSuggestionLabel(g).split(" - ").slice(1),(T,B)=>(i.openBlock(),i.createElementBlock("span",{key:B,class:"field-span","data-testid":g.id&&`${g.id}-${B+1}`||B+1},i.toDisplayString(T),9,du))),128))]),empty:i.withCtx(()=>[i.createElementVNode("div",cu,[i.createElementVNode("span",null,i.toDisplayString(h.message),1)])]),_:1},8,["id","modelValue","items","loading","placeholder","onChange","onQueryChange"])])}const $o=P(su,[["render",uu],["__scopeId","data-v-62760c9d"]]),fu={name:"FieldArrayCardContainer",components:{TrashIcon:Ln},props:{model:{type:Object,default:null},schema:{type:Object,default:null}},emits:["remove-item"]},hu={class:"array-card-container"};function mu(n,a,s,m,h,u){const b=i.resolveComponent("KCard"),g=i.resolveComponent("TrashIcon"),T=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",hu,[i.createVNode(b,{class:"card"},{default:i.withCtx(()=>[i.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3}),i.createVNode(T,{appearance:"tertiary",class:"array-card-remove-button",onClick:a[0]||(a[0]=B=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(g)]),_:1})])}const Vo=P(fu,[["render",mu],["__scopeId","data-v-68702965"]]),pu={mixins:[Y],emits:["model-updated"],methods:{updateModel(n){this.$emit("model-updated",n,this.schema.model)},checkOption(n){return this.model[this.schema.model]?n.value.toString()===this.model[this.schema.model].toString():n.checked},onChange(n){let a=n.target.value.split(",");this.schema.array||(a=a.toString()),this.updateModel(a)}}},gu={class:"selection-group"},yu={class:"form-group"},_u=["id","checked","name","value"];function bu(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("div",gu,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.schema.values,(b,g)=>(i.openBlock(),i.createElementBlock("div",{key:g,class:"option-group"},[i.createElementVNode("div",yu,[i.createElementVNode("label",{class:i.normalizeClass(["k-label",b.name])},[i.createElementVNode("input",{id:n.schema.name+"-"+g,checked:u.checkOption(b),class:"k-input",name:n.schema.name,type:"radio",value:b.value,onChange:a[0]||(a[0]=(...T)=>u.onChange&&u.onChange(...T))},null,40,_u),i.createTextVNode(" "+i.toDisplayString(b.name),1)],2)])]))),128))])}const Oo=P(pu,[["render",bu],["__scopeId","data-v-7e49acd6"]]),wu={name:"FieldArray",components:{FieldArrayItem:No,FieldArrayMultiItem:Ao,FieldSelect:ko,FieldMetric:Fo,FieldObject:To,FieldObjectAdvanced:Io,FieldAutoSuggest:$o,FieldRadio:Oo,FieldArrayCardContainer:Vo,FieldTextArea:Eo,FieldInput:Co},mixins:[Y],props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},methods:{generateSchema(n,a,s){var h,u,b;let m;return a&&(m=JSON.parse(JSON.stringify(a)),(b=(u=(h=m.schema)==null?void 0:h.fields)==null?void 0:u.map)==null||b.call(u,g=>(g.id=`${g.id||g.model}-${s}`,g))),{...m,set(g,T){n[s]=T},get(){return n[s]}}},newElement(){let n=this.value,a;(!n||!n.push)&&(n=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?a=this.schema.items.default():a=this.schema.items.default),n.push(a),this.value=[...n]},removeElement(n){this.value.splice(n,1)},getFieldType(n){return"field-"+n.type},modelUpdated(){}}},Cu=["id"],ku={key:1},Eu=["onUpdate:modelValue","type"],vu=["value","onClick"],Su=["onUpdate:modelValue"],Tu=["value","onClick"];function Bu(n,a,s,m,h,u){const b=i.resolveComponent("FieldTextArea"),g=i.resolveComponent("KButton");return n.schema?(i.openBlock(),i.createElementBlock("div",{key:0,id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(T,B)=>(i.openBlock(),i.createElementBlock("div",{key:B,class:i.normalizeClass(n.schema.fieldItemsClasses)},[n.schema.items&&n.schema.itemContainerComponent?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.schema.itemContainerComponent),{key:0,model:T,schema:u.generateSchema(n.value,n.schema.items,B),onRemoveItem:V=>u.removeElement(B)},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,B),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["model","schema","onRemoveItem"])):n.schema.items?(i.openBlock(),i.createElementBlock("span",ku,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,B),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):n.schema.itemContainerComponent?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.schema.itemContainerComponent),{key:2,"data-testid":`${n.getFieldID(n.schema)}-item-${B}`,model:T,schema:u.generateSchema(n.value,n.schema.items,B),onRemoveItem:V=>u.removeElement(B)},{default:i.withCtx(()=>{var V,ee;return[((V=n.schema.inputAttributes)==null?void 0:V.type)==="textarea"?(i.openBlock(),i.createBlock(b,{key:0,class:"k-input","form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,B),onModelUpdated:u.modelUpdated},null,8,["form-options","model","schema","onModelUpdated"])):i.withDirectives((i.openBlock(),i.createElementBlock("input",i.mergeProps({key:1,"onUpdate:modelValue":Q=>n.value[B]=Q},n.schema.inputAttributes,{type:((ee=n.schema.inputAttributes)==null?void 0:ee.type)||"text"}),null,16,Eu)),[[i.vModelDynamic,n.value[B]]]),n.schema.showRemoveButton?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:2},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||s.removeElementButtonLabel,onClick:Q=>u.removeElement(B)}),null,16,vu)):i.createCommentVNode("",!0)]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):i.withDirectives((i.openBlock(),i.createElementBlock("input",i.mergeProps({key:3},n.schema.inputAttributes,{"onUpdate:modelValue":V=>n.value[B]=V,type:"text"}),null,16,Su)),[[i.vModelText,n.value[B]]]),n.schema.showRemoveButton?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:4},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||s.removeElementButtonLabel,onClick:V=>u.removeElement(B)}),null,16,Tu)):i.createCommentVNode("",!0)],2))),128)),i.createVNode(g,{appearance:"tertiary",class:i.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`add-${n.getFieldID(n.schema)}`,type:"button",onClick:u.newElement},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.schema.newElementButtonLabel||s.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Cu)):i.createCommentVNode("",!0)}const Iu=P(wu,[["render",Bu],["__scopeId","data-v-1731cb2f"]]),Mu={mixins:[Y],emits:["model-updated"],data(){return{isOpen:!1}},computed:{openClass(){return this.isOpen?"open":"closed"},fieldCount(){return this.schema.fields.length},titleText(){return`${this.isOpen?"Hide":"View"} ${this.fieldCount} Advanced Fields`}},methods:{handleOpen(){this.isOpen=!this.isOpen},updateModel(n,a){this.$emit("model-updated",n,a)}}},Nu={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},Au={class:"material-icons"};function Fu(n,a,s,m,h,u){const b=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",Nu,[i.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:a[0]||(a[0]=(...g)=>u.handleOpen&&u.handleOpen(...g))},[i.createElementVNode("i",Au,i.toDisplayString(h.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),i.createElementVNode("span",null,i.toDisplayString(u.titleText),1)]),i.createElementVNode("div",{class:i.normalizeClass(["advanced-field-dropdown",u.openClass])},[i.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:n.schema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])],2)])}const $u=P(Mu,[["render",Fu],["__scopeId","data-v-2d8e71e1"]]),Vu={mixins:[Y],emits:["model-updated"],data(){return{checkedGroup:null,fieldModel:{...this.model},fieldSchema:[]}},watch:{checkedGroup:{handler(n,a){if(a===null){this.fieldModel={...this.model};return}const s=this.schema.fields[n].fields,m=this.schema.fields[a].fields;m&&m.forEach(h=>this.updateModel("",h.model)),s&&s.forEach(h=>this.updateModel(this.fieldModel[h.model],h.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((n,a)=>{n.fields&&n.fields.forEach(s=>{this.model[s.model]&&(this.checkedGroup=a,this.fieldSchema.push(s.model))})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(n,a){this.$emit("model-updated",n,a)}}},Ou={class:"selection-group"},Du={class:"form-group"},Lu=["value"],Uu={class:"control-help"},xu={class:"option-field"},Ru={class:"option-field-container"};function Pu(n,a,s,m,h,u){const b=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",Ou,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.schema.fields,(g,T)=>(i.openBlock(),i.createElementBlock("div",{key:T,class:"option-group"},[i.createElementVNode("div",Du,[i.createElementVNode("label",{class:i.normalizeClass(["k-label",`${g.label}-check`])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=B=>h.checkedGroup=B),class:"k-input",type:"radio",value:T},null,8,Lu),[[i.vModelRadio,h.checkedGroup]]),i.createTextVNode(" "+i.toDisplayString(g.label)+" ",1),i.createElementVNode("div",Uu,i.toDisplayString(g.description),1)],2)]),i.withDirectives(i.createElementVNode("div",xu,[i.createElementVNode("div",Ru,[i.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:{fields:g.fields},onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[i.vShow,g.fields&&h.checkedGroup===T]])]))),128))])}const qu=P(Vu,[["render",Pu],["__scopeId","data-v-25fe24da"]]),zu={mixins:[Y],emits:["model-updated"],methods:{onUpdate(n){this.$emit("model-updated",n,this.schema.model)}}};function Hu(n,a,s,m,h,u){const b=i.resolveComponent("KMultiselect");return i.openBlock(),i.createBlock(b,{"data-testid":"field-multiselect",items:n.schema.values,"label-attributes":{info:n.schema.help},"model-value":n.value,placeholder:n.schema.placeholder,required:n.schema.required||void 0,width:"100%","onUpdate:modelValue":u.onUpdate},null,8,["items","label-attributes","model-value","placeholder","required","onUpdate:modelValue"])}const Wu=P(zu,[["render",Hu]]),Ku={name:"FieldKeyValuePairs",components:{TrashIcon:Ln},mixins:[Y],data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var a,s;this.value||(this.value={});const n=((s=this.model)==null?void 0:s[(a=this.schema)==null?void 0:a.model])??{};Object.keys(n).forEach(m=>{this.pairs.push({key:m,value:n[m]})})},methods:{onInput(n,a,s){this.pairs[a][s]=n.target.value},updateValue(){this.value=this.pairs.reduce((n,{key:a,value:s})=>({...n,...a&&s?{[a]:s}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(n){this.pairs.splice(n,1)}}},Yu={class:"key-value-pairs-editor"},Gu=["data-testid","placeholder","value","onInput"],Zu=["data-testid","placeholder","value","onInput"];function Ju(n,a,s,m,h,u){const b=i.resolveComponent("TrashIcon"),g=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Yu,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.pairs,(T,B)=>(i.openBlock(),i.createElementBlock("div",{key:B,class:"pair-item"},[i.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-key-${B}`,placeholder:n.schema.keyInputPlaceholder??"Key",type:"text",value:T.key,onInput:V=>{u.onInput(V,B,"key")}},null,40,Gu),i.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-value-${B}`,placeholder:n.schema.valueInputPlaceholder??"Value",type:"text",value:T.value,onInput:V=>{u.onInput(V,B,"value")}},null,40,Zu),i.createVNode(g,{appearance:"tertiary","data-testid":`${n.getFieldID(n.schema)}-remove-pair-${B}`,onClick:()=>{u.removePair(B)}},{default:i.withCtx(()=>[i.createVNode(b)]),_:2},1032,["data-testid","onClick"])]))),128)),i.createVNode(g,{appearance:"tertiary",class:i.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`${n.getFieldID(n.schema)}-add-pair`,type:"button",onClick:u.addPair},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Xu={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:$u,FieldArray:Iu,FieldArrayCardContainer:Vo,FieldArrayItem:No,FieldArrayMultiItem:Ao,FieldAutoSuggest:$o,FieldCheckbox:Nl,FieldChecklist:Rl,FieldCleave:pd,FieldDateTimePicker:Cd,FieldGoogleAddress:vd,FieldImage:Md,FieldInput:Co,FieldKeyValuePairs:P(Ku,[["render",Ju],["__scopeId","data-v-29d15375"]]),FieldLabel:Yl,FieldMasked:Fd,FieldMetric:Fo,FieldMultiselect:Wu,FieldNoUiSlider:Dd,FieldObject:To,FieldObjectAdvanced:Io,FieldPikaday:Pd,FieldRadio:Oo,FieldRadios:Xl,FieldRangeSlider:Hd,FieldSelect:ko,FieldSelectEx:Zd,FieldSelectionGroup:qu,FieldSpectrum:Qd,FieldStaticMap:tc,FieldSubmit:sd,FieldTextArea:Eo,FieldUpload:fd,fieldSwitch:sc},Symbol.toStringTag,{value:"Module"})),mixins:[no],props:{vfg:{type:Object,required:!0},model:{type:Object,default:()=>{}},options:{type:Object,default:()=>{}},field:{type:Object,required:!0},errors:{type:Array,default(){return[]}}},emits:["validated","modelUpdated"],data(){return{child:i.ref()}},methods:{fieldTypeHasLabel(n){if(C.isNil(n.label))return!1;let a="";switch(n.type==="input"?a=n.inputType:a=n.type,a){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(n){const a=C.get(this.options,"fieldIdPrefix","");return ro(n,a)},getFieldType(n){return"field-"+n.type},getButtonType(n){return C.get(n,"type","button")},onFieldValidated(n,a,s){this.$emit("validated",n,a,s)},buttonVisibility(n){return n.buttons&&n.buttons.length>0},buttonClickHandler(n,a,s){return n.onclick.call(this,this.model,a,s,this)},fieldHint(n){return C.isFunction(n.hint)?n.hint.call(this,this.model,n,this):n.hint},fieldErrors(n){return this.errors.filter(a=>a.field.fieldName===n.fieldName).map(a=>a.error)},onModelUpdated(n,a){this.$emit("modelUpdated",n,a)},validate(n){return this.$refs.child.validate(n)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(n){return n?n.replace(/^[cC]onfig\./,""):""}}},Do=n=>(i.pushScopeId("data-v-bee61052"),n=n(),i.popScopeId(),n),Qu=["for"],ju={class:"icon-wrapper"},ef=["innerHTML"],tf=Do(()=>i.createElementVNode("div",{class:"help",role:"button",tabindex:"0"},[i.createElementVNode("i",{class:"icon"})],-1)),nf=["innerHTML"],rf={key:0,class:"link-wrapper"},of=Do(()=>i.createElementVNode("span",{class:"section-header"},"More info",-1)),sf={class:"field-wrap"},af={key:0,class:"buttons"},lf=["type","onClick","textContent"],df=["innerHTML"],cf={key:2,class:"errors help-block"},uf=["innerHTML"];function ff(n,a,s,m,h,u){const b=i.resolveComponent("KTooltip"),g=i.resolveComponent("KExternalLink");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["form-group",n.getFieldRowClasses(s.field)])},[u.fieldTypeHasLabel(s.field)?(i.openBlock(),i.createElementBlock("label",{key:0,class:i.normalizeClass(["form-group-label",s.field.labelClasses]),for:u.getFieldID(s.field)},[i.createElementVNode("div",ju,[i.createElementVNode("span",{innerHTML:u.formattedLabel(s.field.label)},null,8,ef),s.field.help?(i.openBlock(),i.createBlock(b,{key:0,"max-width":"300",placement:"top","position-fixed":!0},{content:i.withCtx(()=>[s.options.helpAsHtml?(i.openBlock(),i.createElementBlock("div",{key:0,innerHTML:s.field.help},null,8,nf)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(s.field.help),1)],64))]),default:i.withCtx(()=>[tf]),_:1})):i.createCommentVNode("",!0)]),s.field.link?(i.openBlock(),i.createElementBlock("div",rf,[i.createVNode(g,{href:s.field.link},{default:i.withCtx(()=>[of]),_:1},8,["href"])])):i.createCommentVNode("",!0)],10,Qu)):i.createCommentVNode("",!0),i.createElementVNode("div",sf,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(s.field)),i.mergeProps(n.$attrs,{ref:"child",disabled:n.fieldDisabled(s.field)||null,"form-options":s.options,model:s.model,schema:s.field,vfg:s.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated}),null,16,["disabled","form-options","model","schema","vfg","onModelUpdated","onValidated"])),u.buttonVisibility(s.field)?(i.openBlock(),i.createElementBlock("div",af,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.field.buttons,(T,B)=>(i.openBlock(),i.createElementBlock("button",{key:B,class:i.normalizeClass(T.classes),type:u.getButtonType(T),onClick:V=>u.buttonClickHandler(T,s.field,V),textContent:i.toDisplayString(T.label)},null,10,lf))),128))])):i.createCommentVNode("",!0)]),s.field.hint?(i.openBlock(),i.createElementBlock("div",{key:1,class:"hint",innerHTML:u.fieldHint(s.field)},null,8,df)):i.createCommentVNode("",!0),u.fieldErrors(s.field).length>0?(i.openBlock(),i.createElementBlock("div",cf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.fieldErrors(s.field),(T,B)=>(i.openBlock(),i.createElementBlock("span",{key:B,innerHTML:T},null,8,uf))),128))])):i.createCommentVNode("",!0)],2)}const hf=P(Xu,[["render",ff],["__scopeId","data-v-bee61052"]]),mf={key:0,class:"vue-form-generator"},pf=["is"],gf=["is"],yf={key:0};function _f(n,a,s,m,h,u){const b=i.resolveComponent("form-group");return s.schema!=null?(i.openBlock(),i.createElementBlock("div",mf,[s.schema.fields?(i.openBlock(),i.createElementBlock("fieldset",{key:0,is:s.tag},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.fields,g=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[u.fieldVisible(g)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",vfg:h.vfg,field:g,errors:h.errors,model:s.model,options:s.options,onValidated:u.onFieldValidated,onModelUpdated:u.onModelUpdated},null,8,["vfg","field","errors","model","options","onValidated","onModelUpdated"])):i.createCommentVNode("",!0)],64))),256))],8,pf)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.groups,g=>(i.openBlock(),i.createElementBlock("fieldset",{is:s.tag,class:i.normalizeClass(n.getFieldRowClasses(g))},[g.legend?(i.openBlock(),i.createElementBlock("legend",yf,i.toDisplayString(g.legend),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(g.fields,T=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[u.fieldVisible(T)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",vfg:h.vfg,field:T,errors:h.errors,model:s.model,options:s.options,onValidated:u.onFieldValidated,onModelUpdated:u.onModelUpdated},null,8,["vfg","field","errors","model","options","onValidated","onModelUpdated"])):i.createCommentVNode("",!0)],64))),256))],10,gf))),256))])):i.createCommentVNode("",!0)}const be=P({name:"FormGenerator",components:{formGroup:hf},mixins:[no],props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:i.ref([]),fieldIdPrefix:"",validateAsync:!1,validationErrorClass:"error",validationSuccessClass:"",helpAsHtml:!1}}},multiple:{type:Boolean,default:!1},isNewModel:{type:Boolean,default:!1},tag:{type:String,default:"fieldset",validator:function(n){return n.length>0}}},emits:["validated","modelUpdated"],data(){return{vfg:this,errors:[],children:i.ref([])}},computed:{fields(){const n=[];return this.schema&&this.schema.fields&&C.forEach(this.schema.fields,a=>{(!this.multiple||a.multi===!0)&&n.push(a)}),n},groups(){const n=[];return this.schema&&this.schema.groups&&C.forEach(this.schema.groups.slice(0),a=>{n.push(a)}),n}},watch:{model:{deep:!0,handler(n,a){a!==n&&n!=null&&this.$nextTick(()=>{this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors()})}}},mounted(){this.$nextTick(()=>{this.model&&(this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors())})},methods:{fieldVisible(n){return C.isFunction(n.visible)?n.visible.call(this,this.model,n,this):C.isNil(n.visible)?!0:n.visible},onFieldValidated(n,a,s){this.errors=this.errors.filter(h=>h.field.fieldName!==s.schema.fieldName),!n&&a&&a.length>0&&C.forEach(a,h=>{this.errors.push({field:s.schema,error:h})});const m=this.errors.length===0;this.$emit("validated",m,this.errors,this)},onModelUpdated(n,a){this.$emit("modelUpdated",n,a)},validate(n=null){n===null&&(n=C.get(this.options,"validateAsync",!1)),this.clearValidationErrors();const a=[],s=[];C.forEach(this.$refs.children,h=>{C.isFunction(h.validate)&&(a.push(h.$refs.child),s.push(h.$refs.child.validate(!0)))});const m=h=>{const u=[];C.forEach(h,(g,T)=>{C.isArray(g)&&g.length>0&&C.forEach(g,B=>{u.push({field:a[T].schema,error:B})})}),this.errors=u;const b=u.length===0;return this.$emit("validated",b,u,this),n?u:b};return n?Promise.all(s).then(m):m(s)},clearValidationErrors(){this.errors.splice(0),C.forEach(this.$refs.children,n=>{n.clearValidationErrors()})}}},[["render",_f]]),bf={fields:[{inputType:"text",label:"Config.Client Id",model:"config-client_id",type:"input"},{inputType:"text",label:"Config.Client Secret",model:"config-client_secret",type:"input"},{inputType:"text",label:"Config.Issuer",model:"config-issuer",required:!0,type:"input"},{inputType:"text",label:"Config.Auth Methods",model:"config-auth_methods",type:"input"}]},wf={fields:[{inputType:"text",label:"Config.Scopes Claim",model:"config-scopes_claim",type:"input"},{inputType:"text",label:"Config.Scopes Required",model:"config-scopes_required",type:"input"},{inputType:"text",label:"Config.Audience Claim",model:"config-audience_claim",type:"input"},{inputType:"text",label:"Config.Audience Required",model:"config-audience_required",type:"input"},{inputType:"text",label:"Config.Roles Claim",model:"config-roles_claim",type:"input"},{inputType:"text",label:"Config.Roles Required",model:"config-roles_required",type:"input"},{inputType:"text",label:"Config.Groups Claim",model:"config-groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Groups Required",model:"config-groups_required",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Authenticated Groups Claim",model:"config-authenticated_groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"}]},Cf={fields:[{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Client JWK",items:{type:"object",schema:{fields:[{model:"kid",label:"kid",type:"input",inputType:"string"},{model:"issuer",label:"issuer",type:"input",inputType:"string"},{model:"kty",label:"kty",type:"input",inputType:"string"},{model:"use",label:"use",type:"input",inputType:"string"},{model:"key_ops",label:"key_ops",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"alg",label:"alg",type:"input",inputType:"string"},{model:"x5u",label:"x5u",type:"input",inputType:"string"},{model:"x5c",label:"x5c",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"x5t",label:"x5t",type:"input",inputType:"string"},{model:"x5t#S256",label:"x5t#S256",type:"input",inputType:"string"},{model:"k",label:"k",type:"input",inputType:"string"},{model:"x",label:"x",type:"input",inputType:"string"},{model:"y",label:"y",type:"input",inputType:"string"},{model:"crv",label:"crv",type:"input",inputType:"string"},{model:"n",label:"n",type:"input",inputType:"string"},{model:"e",label:"e",type:"input",inputType:"string"},{model:"d",label:"d",type:"input",inputType:"string"},{model:"p",label:"p",type:"input",inputType:"string"},{model:"q",label:"q",type:"input",inputType:"string"},{model:"dp",label:"dp",type:"input",inputType:"string"},{model:"dq",label:"dq",type:"input",inputType:"string"},{model:"qi",label:"qi",type:"input",inputType:"string"},{model:"oth",label:"oth",type:"input",inputType:"string"},{model:"r",label:"r",type:"input",inputType:"string"},{model:"t",label:"t",type:"input",inputType:"string"}]}},model:"config-client_jwk",label:"Config.Client Jwk",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#jwk-record"},{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Cluster Node",items:{type:"object",schema:{fields:[{label:"IP",model:"ip",type:"input",inputType:"text"},{label:"Port",model:"port",type:"input",inputType:"number"}]}},model:"config-session_redis_cluster_nodes",label:"Config.Session Redis Cluster Nodes",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#host-record"}]},kf={name:"OIDCForm",components:{VueFormGenerator:be},props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},data(){return{init:!1,authMethods:[],sessionManagement:!1,globalFields:null,commonFieldsSchema:null,authFieldsSchema:null,advancedFieldsSchema:{fields:[]},advancedFields:null,tabs:[{hash:"#common",title:"Common"},{hash:"#authorization",title:"Authorization"},{hash:"#advanced",title:"Advanced"}]}},computed:{displayForm(){return this.formModel.id&&this.isEditing||!this.isEditing}},watch:{formModel:{handler:function(){this.oidcSetup()}}},mounted(){this.oidcSetup()},methods:{oidcSetup(){var a;this.init||(this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(s=>!s.model.startsWith("config")&&s.model!=="tags")},this.commonFieldsSchema={...bf},this.authFieldsSchema={...wf},this.advancedFieldsSchema.fields=this.formSchema.fields.filter(s=>s.model.startsWith("config")&&!this.commonFieldsSchema.fields.filter(m=>m.model===s.model).length&&!this.authFieldsSchema.fields.filter(m=>m.model===s.model).length||s.model==="tags"),this.advancedFieldsSchema.fields=this.advancedFieldsSchema.fields.map(s=>{const m=Cf.fields.find(h=>h.model===s.model);return m||s}),this.commonFieldsSchema.fields=this.commonFieldsSchema.fields.filter(s=>s.model!=="config-auth_methods"),this.sessionManagement=this.isEditing?this.formModel["config-auth_methods"].includes("session"):!1,this.authMethods=[{label:"Authorization Code Flow",value:"authorization_code",hint:"authorization code flow",prop:this.isEditing?this.formModel["config-auth_methods"].includes("authorization_code"):!1},{label:"Bearer Access Token",value:"bearer",hint:"JWT access token verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("bearer"):!1},{label:"Client Credentials Grant",value:"client_credentials",hint:"OAuth client credentials grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("client_credentials"):!1},{label:"Passwords Grant",value:"password",hint:"OAuth legacy password grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("password"):!1},{label:"Introspection",value:"introspection",hint:"OAuth introspection",prop:this.isEditing?this.formModel["config-auth_methods"].includes("introspection"):!1},{label:"UserInfo",value:"userinfo",hint:"OpenID Connect user info endpoint authentication",prop:this.isEditing?this.formModel["config-auth_methods"].includes("userinfo"):!1},{label:"Kong OAuth",value:"kong_oauth2",hint:"Kong OAuth plugin issued tokens verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("kong_oauth2"):!1},{label:"Refresh Token",value:"refresh_token",hint:"OAuth refresh token grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("refresh_token"):!1}]);const n={};for(const s of this.formSchema.fields)n[s.model]=s;for(const s of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const m of s.fields){const h=(a=n[m.model])==null?void 0:a.help;m.help===void 0&&typeof h=="string"&&(m.help=h)}},getAuthMethodsValue(n,a){const s=[];for(let m=0;m<this.authMethods.length;m++)this.authMethods[m].prop&&this.authMethods[m].value!==n&&s.push(this.authMethods[m].value);return this.sessionManagement&&n&&s.push("session"),a&&(n?s.push(n):s.push("session")),s},handleUpdate(n,a){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(a,n),this.onModelUpdated()}}},Ht=n=>(i.pushScopeId("data-v-e7395ff0"),n=n(),i.popScopeId(),n),Ef={class:"general-settings"},vf={class:"link-wrapper"},Sf=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)),Tf=Ht(()=>i.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),Bf={class:"auth-method-container"},If={class:"general-settings"},Mf={class:"link-wrapper"},Nf=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)),Af=Ht(()=>i.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),Ff={class:"general-settings"},$f={class:"link-wrapper"},Vf=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)),Of=Ht(()=>i.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1));function Df(n,a,s,m,h,u){const b=i.resolveComponent("VueFormGenerator"),g=i.resolveComponent("KExternalLink"),T=i.resolveComponent("KLabel"),B=i.resolveComponent("KCheckbox"),V=i.resolveComponent("KInputSwitch"),ee=i.resolveComponent("KTabs");return i.openBlock(),i.createElementBlock("div",null,[s.formModel.id&&s.isEditing||!s.isEditing?(i.openBlock(),i.createBlock(b,{key:0,class:"global-fields",model:s.formModel,options:s.formOptions,schema:h.globalFields,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(ee,{tabs:h.tabs},{common:i.withCtx(()=>[i.createElementVNode("div",Ef,[i.createElementVNode("div",vf,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#important-configuration-parameters"},{default:i.withCtx(()=>[Sf]),_:1})]),Tf,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.commonFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(T,null,{default:i.withCtx(()=>[i.createTextVNode("Auth Methods")]),_:1}),i.createElementVNode("div",Bf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.authMethods,Q=>(i.openBlock(),i.createElementBlock("div",{key:Q.value,class:"auth-method"},[i.createVNode(B,{modelValue:Q.prop,"onUpdate:modelValue":we=>Q.prop=we,onChange:we=>u.handleUpdate(we,Q.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Q.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),i.createVNode(V,{modelValue:h.sessionManagement,"onUpdate:modelValue":a[0]||(a[0]=Q=>h.sessionManagement=Q),label:"Enable Session Management",onChange:u.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:i.withCtx(()=>[i.createElementVNode("div",If,[i.createElementVNode("div",Mf,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#authorization"},{default:i.withCtx(()=>[Nf]),_:1})]),Af,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.authFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),advanced:i.withCtx(()=>[i.createElementVNode("div",Ff,[i.createElementVNode("div",$f,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/"},{default:i.withCtx(()=>[Vf]),_:1})]),Of,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.advancedFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),_:1},8,["tabs"])])}const Lf=P(kf,[["render",Df],["__scopeId","data-v-e7395ff0"]]),Lo={general:{packageName:"forms"},"post-function":{tags:{hint:"e.g. tag1, tag2, tag3",newElementButtonLabel:"+ Add"},enabled:{newElementButtonLabel:"+ Add"},selectionGroup:{newElementButtonLabel:"+ Add"},instance_name:{newElementButtonLabel:"+ Add"},name:{newElementButtonLabel:"+ Add"},"config-certificate":{help:"Array of stringified Lua code to be cached and run in sequence during the certificate phase.",newElementButtonLabel:"+ Add"},"config-access":{help:"Array of stringified Lua code to be cached and run in sequence during the access phase.",newElementButtonLabel:"+ Add"},"config-body_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the body_filter phase.",newElementButtonLabel:"+ Add"},"config-header_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the header_filter phase.",newElementButtonLabel:"+ Add"},"config-functions":{newElementButtonLabel:"+ Add"},"config-log":{newElementButtonLabel:"+ Add"},"config-rewrite":{newElementButtonLabel:"+ Add"},"config-ws_client_frame":{newElementButtonLabel:"+ Add"},"config-ws_close":{newElementButtonLabel:"+ Add"},"config-ws_handshake":{newElementButtonLabel:"+ Add"},"config-ws_upstream_frame":{newElementButtonLabel:"+ Add"}},"exit-transformer":{"config-functions":{newElementButtonLabel:"+ Add"}}},Uf=P(i.defineComponent({__name:"PostFunction",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const{t:a,te:s}=to.createI18n("en-us",Lo),m=n,h=i.computed(()=>m.formModel.id&&m.isEditing||!m.isEditing),u=i.computed(()=>{const b=m.formSchema;return b.fields.map(g=>{const T=`post-function.${g.model}`;return g.hint=s(`${T}.hint`)&&a(`${T}.hint`)||g.hint,g.help=s(`${T}.help`)&&a(`${T}.help`)||g.help,g.newElementButtonLabel=s(`${T}.newElementButtonLabel`)&&a(`${T}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="post-function-array-item-container",g.fieldItemsClasses="post-function-array-item",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>h.value?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)}}),[["__scopeId","data-v-6706c68b"]]),xf=P(i.defineComponent({__name:"ExitTransformer",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const{t:a,te:s}=to.createI18n("en-us",Lo),m=n,h=i.computed(()=>m.formModel.id&&m.isEditing||!m.isEditing),u=i.computed(()=>{const b=m.formSchema;return b.fields.map(g=>{const T=`exit-transformer.${g.model}`;return g.hint=s(`${T}.hint`)&&a(`${T}.hint`)||g.hint,g.help=s(`${T}.help`)&&a(`${T}.help`)||g.help,g.newElementButtonLabel=s(`${T}.newElementButtonLabel`)&&a(`${T}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="exit-transformer-array-item-container",g.fieldItemsClasses="exit-transformer-array-item",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>h.value?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)}}),[["__scopeId","data-v-0fc8ef29"]]),Rf={fields:[{inputType:"text",label:"Config.Account Email",model:"config-account_email",required:!0,type:"input"},{inputType:"text",label:"Config.Account Key.Key Id",model:"config-account_key-key_id",required:!0,type:"input"},{type:"input",inputType:"text",valueType:"string",label:"Config.Account Key.Key Set",model:"config-account_key-key_set",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",label:"Config.Allow Any Domain",model:"config-allow_any_domain",order:0,disabled:!1}]},Pf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",model:"config-tos_accepted",label:"Config.Tos Accepted",order:0,disabled:!1}]},qf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_hmac_key",label:"Config.Eab Hmac Key",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_kid",label:"Config.Eab Kid",order:0,disabled:!1}]},$t=n=>(i.pushScopeId("data-v-5b189366"),n=n(),i.popScopeId(),n),zf={class:"general-settings"},Hf=$t(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),Wf=$t(()=>i.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),Kf=$t(()=>i.createElementVNode("hr",null,null,-1)),Yf={class:"sub-form"},Gf={class:"general-settings"},Zf=$t(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),Jf=$t(()=>i.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),Xf={class:"sub-form"},Qf={class:"general-settings"},jf=$t(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),eh=$t(()=>i.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),th=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:P(i.defineComponent({__name:"ACMEForm",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const a=n,s=i.ref("zeroSsl"),m=i.ref("shm"),h=i.computed(()=>{var L;const A={};if((L=a.formSchema)!=null&&L.fields)for(const G of a.formSchema.fields)A[G.model]=G;return A}),u=i.computed(()=>{var L;const A=C.cloneDeep(Rf);for(const G of A.fields){const ce=(L=h.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ce=="string"&&(G.help=ce)}return A}),b=i.computed(()=>{var L;const A=C.cloneDeep(Pf);for(const G of A.fields){const ce=(L=h.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ce=="string"&&(G.help=ce)}return A}),g=i.computed(()=>{var L;const A=C.cloneDeep(qf);for(const G of A.fields){const ce=(L=h.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ce=="string"&&(G.help=ce)}return A}),T=i.computed(()=>({fields:a.formSchema.fields.filter(A=>!A.model.startsWith("config")&&A.model!=="tags")})),B=i.computed(()=>({fields:u.value.fields.filter(L=>!b.value.fields.some(G=>G.model===L.model)&&!g.value.fields.some(G=>G.model===L.model))})),V=i.computed(()=>({fields:a.formSchema.fields.filter(L=>L.model.startsWith("config-storage")&&!L.model.startsWith("config-storage_config-consul")&&!L.model.startsWith("config-storage_config-redis")&&!L.model.startsWith("config-storage_config-shm")&&!L.model.startsWith("config-storage_config-vault"))})),ee=i.computed(()=>({fields:a.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-consul"))})),Q=i.computed(()=>({fields:a.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-redis"))})),we=i.computed(()=>({fields:a.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-shm"))})),tt=i.computed(()=>({fields:a.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-vault"))})),st=i.computed(()=>({fields:a.formSchema.fields.filter(A=>A.model.startsWith("config")&&!B.value.fields.filter(L=>L.model===A.model).length&&!V.value.fields.filter(L=>L.model===A.model).length||A.model==="tags")})),de=i.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),Te=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],at=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];i.onMounted(()=>{s.value==="zeroSsl"&&(a.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const Be=A=>{s.value=A.value,(A.value==="zeroSsl"||A.value==="other")&&(A.value==="zeroSsl"?a.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":a.formModel["config-api_uri"]="https://acme.example.com/",a.formModel["config-tos_accepted"]=!1),A.value==="letsEncrypt"&&(a.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",a.formModel["config-eab_hmac_key"]="",a.formModel["config-eab_kid"]=""),a.onModelUpdated()},Ie=(A,L)=>{L==="config-storage"&&(m.value=A),a.onModelUpdated()};return(A,L)=>{const G=i.resolveComponent("KSelect"),ce=i.resolveComponent("KTabs");return i.openBlock(),i.createElementBlock("div",null,[n.formModel.id&&n.isEditing||!n.isEditing?(i.openBlock(),i.createBlock(be,{key:0,class:"global-fields",model:n.formModel,options:n.formOptions,schema:T.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(ce,{tabs:Te},{general:i.withCtx(()=>[i.createElementVNode("div",zf,[Hf,Wf,de.value?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:B.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),Kf,i.createVNode(G,{class:"issuer-select",items:at,label:"Issuer",onChange:Be}),i.createElementVNode("div",Yf,[s.value==="letsEncrypt"?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:b.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),s.value==="zeroSsl"||s.value==="other"?(i.openBlock(),i.createBlock(be,{key:1,model:n.formModel,options:n.formOptions,schema:g.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])])]),storage:i.withCtx(()=>[i.createElementVNode("div",Gf,[Zf,Jf,de.value?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:V.value,onModelUpdated:Ie},null,8,["model","options","schema"])):i.createCommentVNode("",!0),i.createElementVNode("div",Xf,[m.value==="consul"?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:ee.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="redis"?(i.openBlock(),i.createBlock(be,{key:1,model:n.formModel,options:n.formOptions,schema:Q.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="shm"?(i.openBlock(),i.createBlock(be,{key:2,model:n.formModel,options:n.formOptions,schema:we.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="vault"?(i.openBlock(),i.createBlock(be,{key:3,model:n.formModel,options:n.formOptions,schema:tt.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])])]),advanced:i.withCtx(()=>[i.createElementVNode("div",Qf,[jf,eh,de.value?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:st.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-5b189366"]]),ExitTransformer:xf,OIDCForm:Lf,PostFunction:Uf},Symbol.toStringTag,{value:"Module"})),nh=["array","metric","advanced","selectionGroup","object-advanced"],rh={install:n=>{n.component("VueFormGenerator",be)}},ih=(n,a=!1)=>({...a&&{acme:"ACMEForm"},"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer"})[n];ve.FORMS_API_KEY=wt,ve.VueFormGenerator=be,ve.abstractField=Tl,ve.customFields=nh,ve.default=rh,ve.getSharedFormName=ih,ve.sharedForms=th,Object.defineProperties(ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
27
+ }`;var q=hl(function(){return Z(c,N+"return "+S).apply(s,f)});if(q.source=S,Hi(q))throw q;return q}function a1(e){return J(e).toLowerCase()}function l1(e){return J(e).toUpperCase()}function d1(e,t,r){if(e=J(e),e&&(r||t===s))return ks(e);if(!e||!(t=Oe(t)))return e;var o=Xe(e),l=Xe(t),c=Es(o,l),f=vs(o,l)+1;return Mt(o,c,f).join("")}function c1(e,t,r){if(e=J(e),e&&(r||t===s))return e.slice(0,Ts(e)+1);if(!e||!(t=Oe(t)))return e;var o=Xe(e),l=vs(o,Xe(t))+1;return Mt(o,0,l).join("")}function u1(e,t,r){if(e=J(e),e&&(r||t===s))return e.replace(Hr,"");if(!e||!(t=Oe(t)))return e;var o=Xe(e),l=Es(o,Xe(t));return Mt(o,l).join("")}function f1(e,t){var r=oh,o=sh;if(oe(t)){var l="separator"in t?t.separator:l;r="length"in t?R(t.length):r,o="omission"in t?Oe(t.omission):o}e=J(e);var c=e.length;if(Zt(e)){var f=Xe(e);c=f.length}if(r>=c)return e;var p=r-Jt(o);if(p<1)return o;var _=f?Mt(f,0,p).join(""):e.slice(0,p);if(l===s)return _+o;if(f&&(p+=_.length-p),Wi(l)){if(e.slice(p).search(l)){var E,v=_;for(l.global||(l=ai(l.source,J(Ho.exec(l))+"g")),l.lastIndex=0;E=l.exec(v);)var S=E.index;_=_.slice(0,S===s?p:S)}}else if(e.indexOf(Oe(l),p)!=p){var I=_.lastIndexOf(l);I>-1&&(_=_.slice(0,I))}return _+o}function h1(e){return e=J(e),e&&vh.test(e)?e.replace(Po,qm):e}var m1=rn(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Gi=ma("toUpperCase");function fl(e,t,r){return e=J(e),t=r?s:t,t===s?Lm(e)?Wm(e):Im(e):e.match(t)||[]}var hl=z(function(e,t){try{return $e(e,s,t)}catch(r){return Hi(r)?r:new U(r)}}),p1=ht(function(e,t){return qe(t,function(r){r=ot(r),ut(e,r,qi(e[r],e))}),e});function g1(e){var t=e==null?0:e.length,r=F();return e=t?re(e,function(o){if(typeof o[1]!="function")throw new ze(b);return[r(o[0]),o[1]]}):[],z(function(o){for(var l=-1;++l<t;){var c=e[l];if($e(c[0],this,o))return $e(c[1],this,o)}})}function y1(e){return qp(We(e,ee))}function Zi(e){return function(){return e}}function _1(e,t){return e==null||e!==e?t:e}var b1=ga(),w1=ga(!0);function Fe(e){return e}function Ji(e){return Ks(typeof e=="function"?e:We(e,ee))}function C1(e){return Gs(We(e,ee))}function k1(e,t){return Zs(e,We(t,ee))}var E1=z(function(e,t){return function(r){return Tn(r,e,t)}}),v1=z(function(e,t){return function(r){return Tn(e,r,t)}});function Xi(e,t,r){var o=he(t),l=ur(t,o);r==null&&!(oe(t)&&(l.length||!o.length))&&(r=t,t=e,e=this,l=ur(t,he(t)));var c=!(oe(r)&&"chain"in r)||!!r.chain,f=pt(e);return qe(l,function(p){var _=t[p];e[p]=_,f&&(e.prototype[p]=function(){var E=this.__chain__;if(c||E){var v=e(this.__wrapped__),S=v.__actions__=Me(this.__actions__);return S.push({func:_,args:arguments,thisArg:e}),v.__chain__=E,v}return _.apply(e,Et([this.value()],arguments))})}),e}function S1(){return me._===this&&(me._=Xm),this}function Qi(){}function T1(e){return e=R(e),z(function(t){return Js(t,e)})}var B1=Mi(re),I1=Mi(ys),M1=Mi(ei);function ml(e){return Di(e)?ti(ot(e)):og(e)}function N1(e){return function(t){return e==null?s:Rt(e,t)}}var A1=_a(),F1=_a(!0);function ji(){return[]}function eo(){return!1}function $1(){return{}}function V1(){return""}function O1(){return!0}function D1(e,t){if(e=R(e),e<1||e>Ct)return[];var r=nt,o=ye(e,nt);t=F(t),e-=nt;for(var l=ii(o,t);++r<e;)t(r);return l}function L1(e){return x(e)?re(e,ot):De(e)?[e]:Me(Va(J(e)))}function U1(e){var t=++Zm;return J(e)+t}var x1=yr(function(e,t){return e+t},0),R1=Ni("ceil"),P1=yr(function(e,t){return e/t},1),q1=Ni("floor");function z1(e){return e&&e.length?cr(e,Fe,pi):s}function H1(e,t){return e&&e.length?cr(e,F(t,2),pi):s}function W1(e){return ws(e,Fe)}function K1(e,t){return ws(e,F(t,2))}function Y1(e){return e&&e.length?cr(e,Fe,bi):s}function G1(e,t){return e&&e.length?cr(e,F(t,2),bi):s}var Z1=yr(function(e,t){return e*t},1),J1=Ni("round"),X1=yr(function(e,t){return e-t},0);function Q1(e){return e&&e.length?ri(e,Fe):0}function j1(e,t){return e&&e.length?ri(e,F(t,2)):0}return d.after=C_,d.ary=Wa,d.assign=l0,d.assignIn=ol,d.assignInWith=Nr,d.assignWith=d0,d.at=c0,d.before=Ka,d.bind=qi,d.bindAll=p1,d.bindKey=Ya,d.castArray=$_,d.chain=qa,d.chunk=qg,d.compact=zg,d.concat=Hg,d.cond=g1,d.conforms=y1,d.constant=Zi,d.countBy=Qy,d.create=u0,d.curry=Ga,d.curryRight=Za,d.debounce=Ja,d.defaults=f0,d.defaultsDeep=h0,d.defer=k_,d.delay=E_,d.difference=Wg,d.differenceBy=Kg,d.differenceWith=Yg,d.drop=Gg,d.dropRight=Zg,d.dropRightWhile=Jg,d.dropWhile=Xg,d.fill=Qg,d.filter=e_,d.flatMap=r_,d.flatMapDeep=i_,d.flatMapDepth=o_,d.flatten=Ua,d.flattenDeep=jg,d.flattenDepth=ey,d.flip=v_,d.flow=b1,d.flowRight=w1,d.fromPairs=ty,d.functions=w0,d.functionsIn=C0,d.groupBy=s_,d.initial=ry,d.intersection=iy,d.intersectionBy=oy,d.intersectionWith=sy,d.invert=E0,d.invertBy=v0,d.invokeMap=l_,d.iteratee=Ji,d.keyBy=d_,d.keys=he,d.keysIn=Ae,d.map=vr,d.mapKeys=T0,d.mapValues=B0,d.matches=C1,d.matchesProperty=k1,d.memoize=Tr,d.merge=I0,d.mergeWith=sl,d.method=E1,d.methodOf=v1,d.mixin=Xi,d.negate=Br,d.nthArg=T1,d.omit=M0,d.omitBy=N0,d.once=S_,d.orderBy=c_,d.over=B1,d.overArgs=T_,d.overEvery=I1,d.overSome=M1,d.partial=zi,d.partialRight=Xa,d.partition=u_,d.pick=A0,d.pickBy=al,d.property=ml,d.propertyOf=N1,d.pull=cy,d.pullAll=Ra,d.pullAllBy=uy,d.pullAllWith=fy,d.pullAt=hy,d.range=A1,d.rangeRight=F1,d.rearg=B_,d.reject=m_,d.remove=my,d.rest=I_,d.reverse=Ri,d.sampleSize=g_,d.set=$0,d.setWith=V0,d.shuffle=y_,d.slice=py,d.sortBy=w_,d.sortedUniq=ky,d.sortedUniqBy=Ey,d.split=r1,d.spread=M_,d.tail=vy,d.take=Sy,d.takeRight=Ty,d.takeRightWhile=By,d.takeWhile=Iy,d.tap=zy,d.throttle=N_,d.thru=Er,d.toArray=nl,d.toPairs=ll,d.toPairsIn=dl,d.toPath=L1,d.toPlainObject=il,d.transform=O0,d.unary=A_,d.union=My,d.unionBy=Ny,d.unionWith=Ay,d.uniq=Fy,d.uniqBy=$y,d.uniqWith=Vy,d.unset=D0,d.unzip=Pi,d.unzipWith=Pa,d.update=L0,d.updateWith=U0,d.values=an,d.valuesIn=x0,d.without=Oy,d.words=fl,d.wrap=F_,d.xor=Dy,d.xorBy=Ly,d.xorWith=Uy,d.zip=xy,d.zipObject=Ry,d.zipObjectDeep=Py,d.zipWith=qy,d.entries=ll,d.entriesIn=dl,d.extend=ol,d.extendWith=Nr,Xi(d,d),d.add=x1,d.attempt=hl,d.camelCase=z0,d.capitalize=cl,d.ceil=R1,d.clamp=R0,d.clone=V_,d.cloneDeep=D_,d.cloneDeepWith=L_,d.cloneWith=O_,d.conformsTo=U_,d.deburr=ul,d.defaultTo=_1,d.divide=P1,d.endsWith=H0,d.eq=je,d.escape=W0,d.escapeRegExp=K0,d.every=jy,d.find=t_,d.findIndex=Da,d.findKey=m0,d.findLast=n_,d.findLastIndex=La,d.findLastKey=p0,d.floor=q1,d.forEach=za,d.forEachRight=Ha,d.forIn=g0,d.forInRight=y0,d.forOwn=_0,d.forOwnRight=b0,d.get=Ki,d.gt=x_,d.gte=R_,d.has=k0,d.hasIn=Yi,d.head=xa,d.identity=Fe,d.includes=a_,d.indexOf=ny,d.inRange=P0,d.invoke=S0,d.isArguments=zt,d.isArray=x,d.isArrayBuffer=P_,d.isArrayLike=Ne,d.isArrayLikeObject=ae,d.isBoolean=q_,d.isBuffer=Nt,d.isDate=z_,d.isElement=H_,d.isEmpty=W_,d.isEqual=K_,d.isEqualWith=Y_,d.isError=Hi,d.isFinite=G_,d.isFunction=pt,d.isInteger=Qa,d.isLength=Ir,d.isMap=ja,d.isMatch=Z_,d.isMatchWith=J_,d.isNaN=X_,d.isNative=Q_,d.isNil=e0,d.isNull=j_,d.isNumber=el,d.isObject=oe,d.isObjectLike=se,d.isPlainObject=Fn,d.isRegExp=Wi,d.isSafeInteger=t0,d.isSet=tl,d.isString=Mr,d.isSymbol=De,d.isTypedArray=sn,d.isUndefined=n0,d.isWeakMap=r0,d.isWeakSet=i0,d.join=ay,d.kebabCase=Y0,d.last=Ye,d.lastIndexOf=ly,d.lowerCase=G0,d.lowerFirst=Z0,d.lt=o0,d.lte=s0,d.max=z1,d.maxBy=H1,d.mean=W1,d.meanBy=K1,d.min=Y1,d.minBy=G1,d.stubArray=ji,d.stubFalse=eo,d.stubObject=$1,d.stubString=V1,d.stubTrue=O1,d.multiply=Z1,d.nth=dy,d.noConflict=S1,d.noop=Qi,d.now=Sr,d.pad=J0,d.padEnd=X0,d.padStart=Q0,d.parseInt=j0,d.random=q0,d.reduce=f_,d.reduceRight=h_,d.repeat=e1,d.replace=t1,d.result=F0,d.round=J1,d.runInContext=y,d.sample=p_,d.size=__,d.snakeCase=n1,d.some=b_,d.sortedIndex=gy,d.sortedIndexBy=yy,d.sortedIndexOf=_y,d.sortedLastIndex=by,d.sortedLastIndexBy=wy,d.sortedLastIndexOf=Cy,d.startCase=i1,d.startsWith=o1,d.subtract=X1,d.sum=Q1,d.sumBy=j1,d.template=s1,d.times=D1,d.toFinite=gt,d.toInteger=R,d.toLength=rl,d.toLower=a1,d.toNumber=Ge,d.toSafeInteger=a0,d.toString=J,d.toUpper=l1,d.trim=d1,d.trimEnd=c1,d.trimStart=u1,d.truncate=f1,d.unescape=h1,d.uniqueId=U1,d.upperCase=m1,d.upperFirst=Gi,d.each=za,d.eachRight=Ha,d.first=xa,Xi(d,function(){var e={};return rt(d,function(t,r){X.call(d.prototype,r)||(e[r]=t)}),e}(),{chain:!1}),d.VERSION=m,qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){d[e].placeholder=d}),qe(["drop","take"],function(e,t){W.prototype[e]=function(r){r=r===s?1:fe(R(r),0);var o=this.__filtered__&&!t?new W(this):this.clone();return o.__filtered__?o.__takeCount__=ye(r,o.__takeCount__):o.__views__.push({size:ye(r,nt),type:e+(o.__dir__<0?"Right":"")}),o},W.prototype[e+"Right"]=function(r){return this.reverse()[e](r).reverse()}}),qe(["filter","map","takeWhile"],function(e,t){var r=t+1,o=r==Uo||r==ch;W.prototype[e]=function(l){var c=this.clone();return c.__iteratees__.push({iteratee:F(l,3),type:r}),c.__filtered__=c.__filtered__||o,c}}),qe(["head","last"],function(e,t){var r="take"+(t?"Right":"");W.prototype[e]=function(){return this[r](1).value()[0]}}),qe(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");W.prototype[e]=function(){return this.__filtered__?new W(this):this[r](1)}}),W.prototype.compact=function(){return this.filter(Fe)},W.prototype.find=function(e){return this.filter(e).head()},W.prototype.findLast=function(e){return this.reverse().find(e)},W.prototype.invokeMap=z(function(e,t){return typeof e=="function"?new W(this):this.map(function(r){return Tn(r,e,t)})}),W.prototype.reject=function(e){return this.filter(Br(F(e)))},W.prototype.slice=function(e,t){e=R(e);var r=this;return r.__filtered__&&(e>0||t<0)?new W(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==s&&(t=R(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},W.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},W.prototype.toArray=function(){return this.take(nt)},rt(W.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),l=d[o?"take"+(t=="last"?"Right":""):t],c=o||/^find/.test(t);l&&(d.prototype[t]=function(){var f=this.__wrapped__,p=o?[1]:arguments,_=f instanceof W,E=p[0],v=_||x(f),S=function(H){var K=l.apply(d,Et([H],p));return o&&I?K[0]:K};v&&r&&typeof E=="function"&&E.length!=1&&(_=v=!1);var I=this.__chain__,N=!!this.__actions__.length,O=c&&!I,q=_&&!N;if(!c&&v){f=q?f:new W(this);var D=e.apply(f,p);return D.__actions__.push({func:Er,args:[S],thisArg:s}),new He(D,I)}return O&&q?e.apply(this,p):(D=this.thru(S),O?o?D.value()[0]:D.value():D)})}),qe(["pop","push","shift","sort","splice","unshift"],function(e){var t=Zn[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);d.prototype[e]=function(){var l=arguments;if(o&&!this.__chain__){var c=this.value();return t.apply(x(c)?c:[],l)}return this[r](function(f){return t.apply(x(f)?f:[],l)})}}),rt(W.prototype,function(e,t){var r=d[t];if(r){var o=r.name+"";X.call(en,o)||(en[o]=[]),en[o].push({name:t,func:r})}}),en[gr(s,Te).name]=[{name:"wrapper",func:s}],W.prototype.clone=hp,W.prototype.reverse=mp,W.prototype.value=pp,d.prototype.at=Hy,d.prototype.chain=Wy,d.prototype.commit=Ky,d.prototype.next=Yy,d.prototype.plant=Zy,d.prototype.reverse=Jy,d.prototype.toJSON=d.prototype.valueOf=d.prototype.value=Xy,d.prototype.first=d.prototype.head,bn&&(d.prototype[bn]=Gy),d},Xt=Km();Ot?((Ot.exports=Xt)._=Xt,Jr._=Xt):me._=Xt}).call(ln)}($n,$n.exports);var C=$n.exports;const no={methods:{getFieldRowClasses(n){const a=this.fieldErrors(n).length>0,s={[C.get(this.options,"validationErrorClass","error")]:a,[C.get(this.options,"validationSuccessClass","valid")]:!a,disabled:this.fieldDisabled(n),readonly:this.fieldReadonly(n),featured:this.fieldFeatured(n),required:this.fieldRequired(n)};return C.isArray(n.styleClasses)?C.forEach(n.styleClasses,m=>s[m]=!0):C.isString(n.styleClasses)&&(s[n.styleClasses]=!0),C.isNil(n.type)||(s["field-"+n.type]=!0),s},fieldErrors(n){return this.errors.filter(s=>s.field.fieldName===n.fieldName).map(s=>s.error)},fieldDisabled(n){return C.isFunction(n.disabled)?n.disabled.call(this,this.model,n,this):C.isNil(n.disabled)?!1:n.disabled},fieldReadonly(n){return C.isFunction(n.readonly)?n.readonly.call(this,this.model,n,this):C.isNil(n.readonly)?!1:n.readonly},fieldFeatured(n){return C.isFunction(n.featured)?n.featured.call(this,this.model,n,this):C.isNil(n.featured)?!1:n.featured},fieldRequired(n){return C.isFunction(n.required)?n.required.call(this,this.model,n,this):C.isNil(n.required)?!1:n.required}}},ro=(n,a="")=>typeof n.id<"u"?a+n.id:a+(n.inputName||n.label||n.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),io=(n="")=>n.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var oo=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,_t="\\d\\d?",bt="\\d\\d",gl="\\d{3}",yl="\\d{4}",dn="[^\\s]+",so=/\[([^]*?)\]/gm;function ao(n,a){for(var s=[],m=0,h=n.length;m<h;m++)s.push(n[m].substr(0,a));return s}var lo=function(n){return function(a,s){var m=s[n].map(function(u){return u.toLowerCase()}),h=m.indexOf(a.toLowerCase());return h>-1?h:null}};function At(n){for(var a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];for(var m=0,h=a;m<h.length;m++){var u=h[m];for(var b in u)n[b]=u[b]}return n}var co=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],uo=["January","February","March","April","May","June","July","August","September","October","November","December"],_l=ao(uo,3),bl=ao(co,3),fo={dayNamesShort:bl,dayNames:co,monthNamesShort:_l,monthNames:uo,amPm:["am","pm"],DoFn:function(n){return n+["th","st","nd","rd"][n%10>3?0:(n-n%10!==10?1:0)*n%10]}},Vn=At({},fo),wl=function(n){return Vn=At(Vn,n)},ho=function(n){return n.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Se=function(n,a){for(a===void 0&&(a=2),n=String(n);n.length<a;)n="0"+n;return n},Cl={D:function(n){return String(n.getDate())},DD:function(n){return Se(n.getDate())},Do:function(n,a){return a.DoFn(n.getDate())},d:function(n){return String(n.getDay())},dd:function(n){return Se(n.getDay())},ddd:function(n,a){return a.dayNamesShort[n.getDay()]},dddd:function(n,a){return a.dayNames[n.getDay()]},M:function(n){return String(n.getMonth()+1)},MM:function(n){return Se(n.getMonth()+1)},MMM:function(n,a){return a.monthNamesShort[n.getMonth()]},MMMM:function(n,a){return a.monthNames[n.getMonth()]},YY:function(n){return Se(String(n.getFullYear()),4).substr(2)},YYYY:function(n){return Se(n.getFullYear(),4)},h:function(n){return String(n.getHours()%12||12)},hh:function(n){return Se(n.getHours()%12||12)},H:function(n){return String(n.getHours())},HH:function(n){return Se(n.getHours())},m:function(n){return String(n.getMinutes())},mm:function(n){return Se(n.getMinutes())},s:function(n){return String(n.getSeconds())},ss:function(n){return Se(n.getSeconds())},S:function(n){return String(Math.round(n.getMilliseconds()/100))},SS:function(n){return Se(Math.round(n.getMilliseconds()/10),2)},SSS:function(n){return Se(n.getMilliseconds(),3)},a:function(n,a){return n.getHours()<12?a.amPm[0]:a.amPm[1]},A:function(n,a){return n.getHours()<12?a.amPm[0].toUpperCase():a.amPm[1].toUpperCase()},ZZ:function(n){var a=n.getTimezoneOffset();return(a>0?"-":"+")+Se(Math.floor(Math.abs(a)/60)*100+Math.abs(a)%60,4)},Z:function(n){var a=n.getTimezoneOffset();return(a>0?"-":"+")+Se(Math.floor(Math.abs(a)/60),2)+":"+Se(Math.abs(a)%60,2)}},mo=function(n){return+n-1},po=[null,_t],go=[null,dn],yo=["isPm",dn,function(n,a){var s=n.toLowerCase();return s===a.amPm[0]?0:s===a.amPm[1]?1:null}],_o=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(n){var a=(n+"").match(/([+-]|\d\d)/gi);if(a){var s=+a[1]*60+parseInt(a[2],10);return a[0]==="+"?s:-s}return 0}],kl={D:["day",_t],DD:["day",bt],Do:["day",_t+dn,function(n){return parseInt(n,10)}],M:["month",_t,mo],MM:["month",bt,mo],YY:["year",bt,function(n){var a=new Date,s=+(""+a.getFullYear()).substr(0,2);return+(""+(+n>68?s-1:s)+n)}],h:["hour",_t,void 0,"isPm"],hh:["hour",bt,void 0,"isPm"],H:["hour",_t],HH:["hour",bt],m:["minute",_t],mm:["minute",bt],s:["second",_t],ss:["second",bt],YYYY:["year",yl],S:["millisecond","\\d",function(n){return+n*100}],SS:["millisecond",bt,function(n){return+n*10}],SSS:["millisecond",gl],d:po,dd:po,ddd:go,dddd:go,MMM:["month",dn,lo("monthNamesShort")],MMMM:["month",dn,lo("monthNames")],a:yo,A:yo,ZZ:_o,Z:_o},On={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},El=function(n){return At(On,n)},vl=function(n,a,s){if(a===void 0&&(a=On.default),s===void 0&&(s={}),typeof n=="number"&&(n=new Date(n)),Object.prototype.toString.call(n)!=="[object Date]"||isNaN(n.getTime()))throw new Error("Invalid Date pass to format");a=On[a]||a;var m=[];a=a.replace(so,function(u,b){return m.push(b),"@@@"});var h=At(At({},Vn),s);return a=a.replace(oo,function(u){return Cl[u](n,h)}),a.replace(/@@@/g,function(){return m.shift()})};function Sl(n,a,s){if(s===void 0&&(s={}),typeof a!="string")throw new Error("Invalid format in fecha parse");if(a=On[a]||a,n.length>1e3)return null;var m=new Date,h={year:m.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},u=[],b=[],g=a.replace(so,function(Ie,A){return b.push(ho(A)),"@@@"}),T={},B={};g=ho(g).replace(oo,function(Ie){var A=kl[Ie],L=A[0],G=A[1],ce=A[3];if(T[L])throw new Error("Invalid format. "+L+" specified twice in format");return T[L]=!0,ce&&(B[ce]=!0),u.push(A),"("+G+")"}),Object.keys(B).forEach(function(Ie){if(!T[Ie])throw new Error("Invalid format. "+Ie+" is required in specified format")}),g=g.replace(/@@@/g,function(){return b.shift()});var V=n.match(new RegExp(g,"i"));if(!V)return null;for(var ee=At(At({},Vn),s),Q=1;Q<V.length;Q++){var we=u[Q-1],tt=we[0],st=we[2],de=st?st(V[Q],ee):+V[Q];if(de==null)return null;h[tt]=de}h.isPm===1&&h.hour!=null&&+h.hour!=12?h.hour=+h.hour+12:h.isPm===0&&+h.hour==12&&(h.hour=0);var Te;if(h.timezoneOffset==null){Te=new Date(h.year,h.month,h.day,h.hour,h.minute,h.second,h.millisecond);for(var at=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],Q=0,Be=at.length;Q<Be;Q++)if(T[at[Q][0]]&&h[at[Q][0]]!==Te[at[Q][1]]())return null}else if(Te=new Date(Date.UTC(h.year,h.month,h.day,h.hour,h.minute-h.timezoneOffset,h.second,h.millisecond)),h.month>11||h.month<0||h.day>31||h.day<1||h.hour>23||h.hour<0||h.minute>59||h.minute<0||h.second>59||h.second<0)return null;return Te}var xe={format:vl,parse:Sl,defaultI18n:fo,setGlobalDateI18n:wl,setGlobalDateMasks:El};const ge={fieldIsRequired:"This field is required!",invalidFormat:"Invalid format!",numberTooSmall:"The number is too small! Minimum: {0}",numberTooBig:"The number is too big! Maximum: {0}",invalidNumber:"Invalid number",invalidInteger:"The value is not an integer",textTooSmall:"The length of text is too small! Current: {0}, Minimum: {1}",textTooBig:"The length of text is too big! Current: {0}, Maximum: {1}",thisNotText:"This is not a text!",thisNotArray:"This is not an array!",selectMinItems:"Select minimum {0} items!",selectMaxItems:"Select maximum {0} items!",invalidDate:"Invalid date!",dateIsEarly:"The date is too early! Current: {0}, Minimum: {1}",dateIsLate:"The date is too late! Current: {0}, Maximum: {1}",invalidEmail:"Invalid e-mail address!",invalidURL:"Invalid URL!",invalidCard:"Invalid card format!",invalidCardNumber:"Invalid card number!",invalidTextContainNumber:"Invalid text! Cannot contains numbers or special characters",invalidTextContainSpec:"Invalid text! Cannot contains special characters"};function Re(n,a,s=ge){return C.isNil(n)||n===""?a?[ie(s.fieldIsRequired)]:[]:null}function ie(n,...a){if(n!=null&&a.length>0)for(let s=0;s<a.length;s++)n=n.replace("{"+(s-1)+"}",a[s]);return n}const cn={resources:ge,required(n,a,s,m=ge){return Re(n,a.required,m)},number(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;const u=[];return C.isFinite(n)?(!C.isNil(a.min)&&n<a.min&&u.push(ie(m.numberTooSmall,a.min)),!C.isNil(a.max)&&n>a.max&&u.push(ie(m.numberTooBig,a.max))):u.push(ie(m.invalidNumber)),u},integer(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;const u=cn.number(n,a,s,m);return C.isInteger(n)||u.push(ie(m.invalidInteger)),u},double(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!C.isNumber(n)||isNaN(n))return[ie(m.invalidNumber)]},string(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;const u=[];return C.isString(n)?(!C.isNil(a.min)&&n.length<a.min&&u.push(ie(m.textTooSmall,n.length,a.min)),!C.isNil(a.max)&&n.length>a.max&&u.push(ie(m.textTooBig,n.length,a.max))):u.push(ie(m.thisNotText)),u},array(n,a,s,m=ge){if(a.required){if(!C.isArray(n))return[ie(m.thisNotArray)];if(n.length===0)return[ie(m.fieldIsRequired)]}if(!C.isNil(n)){if(!C.isNil(a.min)&&n.length<a.min)return[ie(m.selectMinItems,a.min)];if(!C.isNil(a.max)&&n.length>a.max)return[ie(m.selectMaxItems,a.max)]}},date(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;const u=new Date(n);if(isNaN(u.getDate()))return[ie(m.invalidDate)];const b=[];if(!C.isNil(a.min)){const g=new Date(a.min);u.valueOf()<g.valueOf()&&b.push(ie(m.dateIsEarly,xe.format(u),xe.format(g)))}if(!C.isNil(a.max)){const g=new Date(a.max);u.valueOf()>g.valueOf()&&b.push(ie(m.dateIsLate,xe.format(u),xe.format(g)))}return b},regexp(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!C.isNil(a.pattern)&&!new RegExp(a.pattern).test(n))return[ie(m.invalidFormat)]},email(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n))return[ie(m.invalidEmail)]},url(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(n))return[ie(m.invalidURL)]},creditCard(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;const u=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,b=n.replace(/[^0-9]+/g,"");if(!u.test(b))return[ie(m.invalidCard)];let g=0,T,B,V;for(let ee=b.length-1;ee>=0;ee--)T=b.substring(ee,ee+1),B=parseInt(T,10),V?(B*=2,B>=10?g+=B%10+1:g+=B):g+=B,V=!V;if(!(g%10===0&&b))return[ie(m.invalidCardNumber)]},alpha(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!/^[a-zA-Z]*$/.test(n))return[ie(m.invalidTextContainNumber)]},alphaNumeric(n,a,s,m=ge){const h=Re(n,a.required,m);if(h!=null)return h;if(!/^[a-zA-Z0-9]*$/.test(n))return[ie(m.invalidTextContainSpec)]}};Object.keys(cn).forEach(n=>{const a=cn[n];C.isFunction(a)&&(a.locale=s=>(m,h,u)=>a(m,h,u,C.defaults(s,ge)))});function bo(n){return C.isString(n)?cn[n]!=null?cn[n]:(console.warn(`'${n}' is not a validator function!`),null):n}function Ar(n,a,s){let m=C.get(s.context,"schema.attributes",{});const h=a.value||"input";C.isString(h)&&(m=C.get(m,h)||m),C.forEach(m,(u,b)=>{n.setAttribute(b,u)})}const Y={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:Ar,updated:Ar,componentUpdated:Ar}},computed:{value:{cache:!1,get(){let n;return C.isFunction(C.get(this.schema,"get"))?n=this.schema.get(this.model):n=C.get(this.model,this.schema.model),this.formatValueToField(n)},set(n){const a=this.value;n=this.formatValueToModel(n),C.isFunction(n)?n(n,a):this.updateModelValue(n,a)}}},methods:{validate(n){this.clearValidationErrors();const a=C.get(this.formOptions,"validateAsync",!1);let s=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const h=[];C.isArray(this.schema.validator)?C.forEach(this.schema.validator,u=>{h.push(bo(u).bind(this))}):h.push(bo(this.schema.validator).bind(this)),C.forEach(h,u=>{if(a)s.push(u(this.value,this.schema,this.model));else{const b=u(this.value,this.schema,this.model);b&&C.isFunction(b.then)?b.then(g=>{g&&(this.errors=this.errors.concat(g));const T=this.errors.length===0;this.$emit("validated",T,this.errors,this)}):b&&(s=s.concat(b))}})}const m=h=>{let u=[];C.forEach(C.uniq(h),g=>{C.isArray(g)&&g.length>0?u=u.concat(g):C.isString(g)&&u.push(g)}),C.isFunction(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,u,this.schema);const b=u.length===0;return n||this.$emit("validated",b,u,this),this.errors=u,u};return a?Promise.all(s).then(m):m(s)},debouncedValidate(){C.isFunction(this.debouncedValidateFunc)||(this.debouncedValidateFunc=C.debounce(this.validate.bind(this),C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(n,a){let s=!1;C.isFunction(this.schema.set)?(this.schema.set(this.model,n),s=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,n),s=!0),s&&(this.$emit("modelUpdated",n,this.schema.model),C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,n,a,this.schema),C.get(this.formOptions,"validateAfterChanged",!1)===!0&&(C.get(this.schema,"validateDebounceTime",C.get(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(n,a){let s=n.replace(/\[(\w+)\]/g,".$1");s=s.replace(/^\./,"");let m=this.model;const h=s.split(".");let u=0;const b=h.length;for(;u<b;){const g=h[u];if(u<b-1)m[g]!==void 0||(m[g]={}),m=m[g];else{m[g]=a;return}++u}},getFieldID(n,a=!1){const s=C.get(this.formOptions,"fieldIdPrefix","");return ro(n,s)+(a?"-"+C.uniqueId():"")},getFieldClasses(){return C.get(this.schema,"fieldClasses",[])},formatValueToField(n){return n},formatValueToModel(n){return n}}},Tl=Object.freeze(Object.defineProperty({__proto__:null,default:Y},Symbol.toStringTag,{value:"Module"})),Bl={mixins:[Y]},Il=["id","autocomplete","disabled","name","required"];function Ml(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("input",{id:n.getFieldID(n.schema),type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=g=>n.value=g),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,class:i.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Il)),[[i.vModelCheckbox,n.value],[b,"input"]])}const P=(n,a)=>{const s=n.__vccOpts||n;for(const[m,h]of a)s[m]=h;return s},Nl=P(Bl,[["render",Ml]]),Al={class:"wrapper"},Fl=["disabled"],$l=["id","checked","disabled","onChange","name"],Vl=["disabled"],Ol={class:"info"},Dl=i.createElementVNode("div",{class:"arrow"},null,-1),Ll={class:"dropList"},Ul=["id","checked","disabled","onChange","name"];function xl(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",Al,[n.schema.listBox?(i.openBlock(),i.createElementBlock("div",{key:0,class:"listbox form-control",disabled:n.disabled||null},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[i.createElementVNode("label",null,[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:T=>u.onChanged(T,g),name:u.getInputName(g)},null,40,$l),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)])],2))),256))],8,Fl)):i.createCommentVNode("",!0),n.schema.listBox?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:1,class:"combobox form-control",disabled:n.disabled||null},[i.createElementVNode("div",{class:i.normalizeClass(["mainRow",{expanded:h.comboExpanded}]),onClick:a[0]||(a[0]=(...g)=>u.onExpandCombo&&u.onExpandCombo(...g))},[i.createElementVNode("div",Ol,i.toDisplayString(u.selectedCount)+" selected",1),Dl],2),i.createElementVNode("div",Ll,[h.comboExpanded?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["list-row",{"is-checked":u.isItemChecked(g)}])},[i.createElementVNode("label",null,[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"checkbox",checked:u.isItemChecked(g)||null,disabled:n.disabled||null,onChange:T=>u.onChanged(T,g),name:u.getInputName(g)},null,40,Ul),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)])],2))),256)):i.createCommentVNode("",!0)])],8,Vl))])),[[b,"wrapper"]])}const Rl=P({mixins:[Y],data(){return{comboExpanded:!1}},computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(n){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?io(this.schema.inputName+"_"+this.getItemValue(n)):io(this.getItemValue(n))},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return n[this.schema.checklistOptions.value];if(typeof n.value<"u")return n.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return n[this.schema.checklistOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return n},isItemChecked(n){return this.value&&this.value.indexOf(this.getItemValue(n))!==-1},onChanged(n,a){if((C.isNil(this.value)||!Array.isArray(this.value))&&(this.value=[]),n.target.checked){const s=C.clone(this.value);s.push(this.getItemValue(a)),this.value=s}else{const s=C.clone(this.value);s.splice(this.value.indexOf(this.getItemValue(a)),1),this.value=s}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",xl]]),Pl={class:"wrapper"},ql=["id","type","value","disabled","accept","alt","autocomplete","checked","dirname","formaction","formenctype","formmethod","formnovalidate","formtarget","height","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","readonly","required","size","src","step","width","files"],zl={key:0,class:"helper"};function Hl(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",Pl,[i.withDirectives(i.createElementVNode("input",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),id:n.getFieldID(n.schema),type:u.inputType,value:n.value,onInput:a[0]||(a[0]=(...g)=>u.onInput&&u.onInput(...g)),onBlur:a[1]||(a[1]=(...g)=>u.onBlur&&u.onBlur(...g)),onChange:a[2]||(a[2]=(...g)=>n.schema.onChange&&n.schema.onChange(...g)),disabled:n.disabled||null,accept:n.schema.accept,alt:n.schema.alt,autocomplete:n.schema.autocomplete,checked:n.schema.checked||null,dirname:n.schema.dirname,formaction:n.schema.formaction,formenctype:n.schema.formenctype,formmethod:n.schema.formmethod,formnovalidate:n.schema.formnovalidate,formtarget:n.schema.formtarget,height:n.schema.height,list:n.schema.list,max:n.schema.max,maxlength:n.schema.maxlength,min:n.schema.min,minlength:n.schema.minlength,multiple:n.schema.multiple,name:n.schema.inputName,pattern:n.schema.pattern,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,size:n.schema&&n.schema.size>0?n.schema.size:1,src:n.schema.src,step:n.schema.step,width:n.schema.width,files:n.schema.files},null,42,ql),[[b,"input"]]),n.schema.inputType.toLowerCase()==="color"||n.schema.inputType.toLowerCase()==="range"?(i.openBlock(),i.createElementBlock("span",zl,i.toDisplayString(n.value),1)):i.createCommentVNode("",!0)])),[[b,"wrapper"]])}const wo={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},Co=P({mixins:[Y],computed:{inputType(){return this.schema&&this.schema.inputType==="datetime"?"datetime-local":this.schema.inputType}},mounted(){switch(this.schema.inputType.toLowerCase()){case"number":case"range":this.debouncedFormatFunc=C.debounce((n,a)=>{this.formatNumberToModel(n,a)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":this.debouncedFormatFunc=C.debounce((n,a)=>{this.formatDatetimeToModel(n,a)},parseInt(C.get(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}},created(){this.schema.inputType.toLowerCase()==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")},methods:{formatValueToModel(n){if(n!=null)switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":case"number":case"range":return(a,s)=>{this.debouncedFormatFunc(n,s)}}return n},formatValueToField(n){switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":return this.formatDatetimeValueToField(n)}return n},formatDatetimeToModel(n,a){const s=wo[this.schema.inputType.toLowerCase()],m=xe.parse(n,s);m!==!1&&(this.schema.format?n=xe.format(m,this.schema.format):n=m.valueOf()),this.updateModelValue(n,a)},formatDatetimeValueToField(n){if(n==null)return null;const a=wo[this.schema.inputType.toLowerCase()];let s=n;return C.isNumber(n)||(s=xe.parse(n,a)),s!==!1?xe.format(s,a):n},formatNumberToModel(n,a){C.isNumber(n)||(n=NaN),this.updateModelValue(n,a)},onInput(n){let a=n.target.value;switch(this.schema.inputType.toLowerCase()){case"number":case"range":C.isNumber(parseFloat(n.target.value))&&(a=parseFloat(n.target.value));break}this.value=a},onBlur(){C.isFunction(this.debouncedFormatFunc)&&this.debouncedFormatFunc.flush()}}},[["render",Hl]]),Wl=["id"];function Kl(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("span",{id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[i.createTextVNode(i.toDisplayString(n.value),1)],10,Wl)),[[b,"label"]])}const Yl=P({mixins:[Y]},[["render",Kl]]),Gl=["disabled"],Zl=["id","disabled","name","onClick","value","checked","required"];function Jl(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",{class:"radio-list",disabled:n.disabled||null},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>i.withDirectives((i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(u.getItemCssClasses(g))},[i.withDirectives(i.createElementVNode("input",{id:n.getFieldID(n.schema,!0),type:"radio",disabled:u.isItemDisabled(g)||null,name:u.id,onClick:T=>u.onSelection(g),value:u.getItemValue(g),checked:u.isItemChecked(g)||null,class:i.normalizeClass(n.schema.fieldClasses),required:n.schema.required},null,10,Zl),[[b,"input"]]),i.createTextVNode(i.toDisplayString(u.getItemName(g)),1)],2)),[[b,"label"]])),256))],8,Gl)),[[b,"wrapper"]])}const Xl=P({mixins:[Y],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n},id(){return this.schema.model}},methods:{getItemValue(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.value<"u")return n[this.schema.radiosOptions.value];if(typeof n.value<"u")return n.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.radiosOptions<"u"&&typeof this.schema.radiosOptions.name<"u")return n[this.schema.radiosOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values")}else return n},getItemCssClasses(n){return{"is-checked":this.isItemChecked(n),"is-disabled":this.isItemDisabled(n)}},onSelection(n){this.value=this.getItemValue(n)},isItemChecked(n){return this.getItemValue(n)===this.value},isItemDisabled(n){if(this.disabled)return!0;const a=C.get(n,"disabled",!1);return C.isFunction(a)?a(this.model):a}}},[["render",Jl]]),Ql=["disabled","name","id"],jl=["disabled"],ed=["label"],td=["value"],nd=["value"];function rd(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("select",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":a[0]||(a[0]=g=>n.value=g),disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},[u.selectOptions.hideNoneSelectedText?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null},i.toDisplayString(u.selectOptions.noneSelectedText||"<Nothing selected>"),9,jl)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,g=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[g.group?(i.openBlock(),i.createElementBlock("optgroup",{key:0,label:u.getGroupName(g)},[g.ops?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(g.ops,T=>(i.openBlock(),i.createElementBlock("option",{value:u.getItemValue(T)},i.toDisplayString(u.getItemName(T)),9,td))),256)):i.createCommentVNode("",!0)],8,ed)):i.createCommentVNode("",!0),g.group?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",{key:1,value:u.getItemValue(g)},i.toDisplayString(u.getItemName(g)),9,nd))],64))),256))],10,Ql)),[[i.vModelSelect,n.value],[b,"input"]])}const ko=P({mixins:[Y],computed:{selectOptions(){return this.schema.selectOptions||{}},items(){const n=this.schema.values;return typeof n=="function"?this.groupValues(n.apply(this,[this.model,this.schema])):this.groupValues(n)}},methods:{formatValueToField(n){return C.isNil(n)?null:n},groupValues(n){const a=[];let s={};return n.forEach(m=>{s=null,m.group&&C.isObject(m)?(s=C.find(a,h=>h.group===m.group),s?s.ops.push({id:m.id,name:m.name}):(s={group:"",ops:[]},s.group=m.group,s.ops.push({id:m.id,name:m.name}),a.push(s))):a.push(m)}),a},getGroupName(n){if(n&&n.group)return n.group;throw new Error("Group name is missing! https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")},getItemValue(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n}}},[["render",rd]]),id=["id","value","name","disabled"];function od(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("input",{id:n.getFieldID(n.schema),type:"submit",value:n.schema.buttonText,onClick:a[0]||(a[0]=(...b)=>u.onClick&&u.onClick(...b)),name:n.schema.inputName,disabled:n.disabled||null,class:i.normalizeClass(n.schema.fieldClasses)},null,10,id)}const sd=P({mixins:[Y],methods:{onClick(n){if(this.schema.validateBeforeSubmit===!0){n.preventDefault();const a=C.get(this.formOptions,"validateAsync",!1),s=this.vfg.validate(),m=h=>{a&&!C.isEmpty(h)||!a&&!h?C.isFunction(this.schema.onValidationError)&&this.schema.onValidationError(this.model,this.schema,h,n):C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)};s&&C.isFunction(s.then)?s.then(m):m(s)}else C.isFunction(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,n)}}},[["render",od]]),ad=["id","disabled","maxlength","minlength","placeholder","readonly","required","rows","name"];function ld(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("textarea",{class:i.normalizeClass(["form-control",n.schema.fieldClasses]),"onUpdate:modelValue":a[0]||(a[0]=g=>n.value=g),id:n.getFieldID(n.schema),disabled:n.disabled||null,maxlength:n.schema.max,minlength:n.schema.min,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,rows:n.schema.rows||2,name:n.schema.inputName},null,10,ad)),[[i.vModelText,n.value],[b,"input"]])}const Eo=P({mixins:[Y]},[["render",ld]]),dd={class:"wrapper"},cd=["id","name","accept","multiple","placeholder","readonly","required","disabled"];function ud(n,a,s,m,h,u){const b=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",dd,[i.withDirectives(i.createElementVNode("input",{class:"form-control",id:n.getFieldID(n.schema),type:"file",name:n.schema.inputName,onChange:a[0]||(a[0]=(...g)=>u.onChange&&u.onChange(...g)),accept:n.schema.accept,multiple:n.schema.multiple,placeholder:n.schema.placeholder,readonly:n.schema.readonly,required:n.schema.required,disabled:n.disabled||null},null,40,cd),[[b,"input"]])])),[[b,"wrapper"]])}const fd=P({mixins:[Y],methods:{onChange(n){C.isFunction(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,this.schema,n,this)}}},[["render",ud]]),hd=["value","autocomplete","disabled","placeholder","readonly","name","id"];function md(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text",value:n.value,autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,hd)}const pd=P({mixins:[Y],data(){return{cleave:null}},mounted(){this.$nextTick(function(){window.Cleave?(this.cleave=new window.Cleave(this.$el,C.defaults(this.schema.cleaveOptions||{},{creditCard:!1,phone:!1,phoneRegionCode:"AU",date:!1,datePattern:["d","m","Y"],numeral:!1,numeralThousandsGroupStyle:"thousand",numeralDecimalScale:2,numeralDecimalMark:".",blocks:[],delimiter:" ",prefix:null,numericOnly:!1,uppercase:!1,lowercase:!1,maxLength:0})),this.cleave.properties&&this.cleave.properties.hasOwnProperty.call("result")?this.$watch("cleave.properties.result",()=>{this.value=this.cleave.properties.result}):this.$el.addEventListener("input",this.inputChange)):console.warn("Cleave is missing. Please download from https://github.com/nosir/cleave.js/ and load the script in the HTML head section!")})},beforeUnmount(){this.cleave&&(this.cleave.destroy(),this.$el.removeEventListener("input",this.inputChange))},methods:{inputChange(){this.value=this.$el.value}}},[["render",md]]),vo={formatValueToField(n){if(n!=null){const a=this.schema.format?xe.parse(n,this.schema.format):new Date(n);return xe.format(a,this.getDateFormat())}return n},formatValueToModel(n){if(n!=null){const a=xe.parse(n,this.getDateFormat());this.schema.format?n=xe.format(a,this.schema.format):n=a.valueOf()}return n}},gd={class:"input-group date"},yd=["autocomplete","disabled","placeholder","readonly","name","id"],_d=i.createElementVNode("span",{class:"input-group-addon"},[i.createElementVNode("span",{class:"glyphicon glyphicon-calendar"})],-1);function bd(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("div",gd,[i.withDirectives(i.createElementVNode("input",{class:"form-control",type:"text","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,yd),[[i.vModelText,n.value]]),_d])}const So="YYYY-MM-DD HH:mm:ss",wd={mixins:[Y],mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.datetimepicker){const n=this.$el.querySelector(".form-control");$(this.$el).datetimepicker(C.defaults(this.schema.dateTimePickerOptions||{},{format:So})).on("dp.change",()=>{this.value=n.value})}else console.warn("Bootstrap datetimepicker library is missing. Please download from https://eonasdan.github.io/bootstrap-datetimepicker/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.datetimepicker&&$(this.$el).data("DateTimePicker").destroy()},methods:{getDateFormat(){return this.schema.dateTimePickerOptions&&this.schema.dateTimePickerOptions.format?this.schema.dateTimePickerOptions.format:So},...vo}},Cd=P(wd,[["render",bd]]),kd=["autocomplete","disabled","placeholder","readonly","name","id"];function Ed(n,a,s,m,h,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,debounce:"500",onFocus:a[1]||(a[1]=b=>u.geolocate()),id:n.getFieldID(n.schema)},null,40,kd)),[[i.vModelText,n.value]])}const vd=P({mixins:[Y],data(){return{autocomplete:"",inputs:{street_number:"long_name",route:"long_name",country:"long_name",administrative_area_level_1:"long_name",administrative_area_level_2:"long_name",locality:"long_name",postal_code:"short_name"}}},mounted(){this.$nextTick(()=>{window.google&&window.google.maps&&window.google.maps.places&&window.google.maps.places.Autocomplete?(this.autocomplete=new google.maps.places.Autocomplete(this.$el,{types:["geocode"]}),this.autocomplete.addListener("place_changed",this.pipeAddress)):console.warn("Google Maps API is missing. Please add https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&libraries=places script in the HTML head section!")})},methods:{pipeAddress(){const n=this.autocomplete.getPlace();if(n){this.value=n.formatted_address;const a={};if(n.address_components!==void 0)for(let s=0;s<n.address_components.length;s++){const m=n.address_components[s].types[0];this.inputs[m]&&(a[m]=n.address_components[s][this.inputs[m]])}C.isFunction(this.schema.onPlaceChanged)&&this.schema.onPlaceChanged(this.value,a,n,this.model,this.schema)}},geolocate(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(n=>{const a={lat:n.coords.latitude,lng:n.coords.longitude},s=new window.google.maps.Circle({center:a,radius:n.coords.accuracy});this.autocomplete.setBounds(s.getBounds())})}}},[["render",Ed]]),Sd={class:"wrapper"},Td=["autocomplete","disabled","placeholder","readonly"],Bd=["disabled","name"];function Id(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("div",Sd,[i.withDirectives(i.createElementVNode("input",{class:"form-control link",type:"text","onUpdate:modelValue":a[0]||(a[0]=b=>u.wrappedValue=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly},null,8,Td),[[i.vShow,n.schema.hideInput!==!0],[i.vModelText,u.wrappedValue]]),n.schema.browse!==!1?(i.openBlock(),i.createElementBlock("input",{key:0,class:"form-control file",type:"file",disabled:n.disabled||null,onChange:a[1]||(a[1]=(...b)=>u.fileChanged&&u.fileChanged(...b)),name:n.schema.inputName},null,40,Bd)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"preview",style:i.normalizeStyle(u.previewStyle)},[i.createElementVNode("div",{class:"remove",title:"Remove image",onClick:a[2]||(a[2]=(...b)=>u.remove&&u.remove(...b))})],4)])}const Md=P({mixins:[Y],computed:{previewStyle(){return this.schema.preview!==!1?{display:"block","background-image":this.value!=null?"url("+this.value+")":"none"}:{display:"none"}},wrappedValue:{get(){return this.value&&this.value.indexOf("data")===0?"<inline base64 image>":this.value},set(n){n&&n.indexOf("http")===0&&(this.value=n)}}},watch:{model:{deep:!0,handler(){const n=this.$el.querySelector("input.file");n&&(n.value="")}}},methods:{remove(){this.value=""},fileChanged(n){const a=new FileReader;a.onload=s=>{this.value=s.target.result},n.target.files&&n.target.files.length>0&&a.readAsDataURL(n.target.files[0])}}},[["render",Id]]),Nd=["autocomplete","disabled","placeholder","readonly","name","id"];function Ad(n,a,s,m,h,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Nd)),[[i.vModelText,n.value]])}const Fd=P({mixins:[Y],mounted(){this.$nextTick(function(){window.$&&window.$.fn.mask?$(this.$el).unmask().mask(this.schema.mask,this.schema.maskOptions):console.warn("JQuery MaskedInput library is missing. Please download from https://github.com/digitalBush/jquery.maskedinput and load the script in the HTML head section!")})},beforeUnmount(){window.$&&window.$.fn.mask&&$(this.$el).unmask()}},[["render",Ad]]),$d={mixins:[Y],data(){return{slider:null}},computed:{containPips(){return this.schema.noUiSliderOptions&&typeof this.schema.noUiSliderOptions.pips<"u"},containTooltip(){return this.schema.noUiSliderOptions&&this.schema.noUiSliderOptions.tooltips}},watch:{model:{handler(){window.noUiSlider&&this.slider&&this.slider.noUiSlider&&this.slider.noUiSlider.set(this.value)},deep:!0}},mounted(){this.$nextTick(()=>{window.noUiSlider?(this.slider=this.$el,window.noUiSlider.create(this.slider,C.defaults(this.schema.noUiSliderOptions||{},{start:this.getStartValue(),range:{min:this.schema.min,max:this.schema.max}})),this.slider.noUiSlider.on("change",this.onChange.bind(this))):console.warn("noUiSlider is missing. Please download from https://github.com/leongersen/noUiSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.noUiSlider.off("change")},methods:{onChange(n){C.isArray(n)?this.value=[parseFloat(n[0]),parseFloat(n[1])]:this.value=parseFloat(n)},formatValueToField(n){this.slider!==null&&typeof this.slider.noUiSlider<"u"&&this.slider.noUiSlider.set(n)},formatValueToModel(n){if(typeof this.slider.noUiSlider<"u")return n instanceof Array?[Number(n[0]),Number(n[1])]:Number(n)},getStartValue(){return this.value!=null?this.value:typeof this.schema.noUiSliderOptions<"u"&&this.schema.noUiSliderOptions.double?[this.schema.min,this.schema.min]:this.schema.min}}},Vd=["disabled"];function Od(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["slider",{"contain-pips":u.containPips,"contain-tooltip":u.containTooltip}]),disabled:n.disabled||null},null,10,Vd)}const Dd=P($d,[["render",Od]]),Ld=["autocomplete","disabled","placeholder","readonly","name"];function Ud(n,a,s,m,h,u){return i.withDirectives((i.openBlock(),i.createElementBlock("input",{class:"form-control",type:"text","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,Ld)),[[i.vModelText,n.value]])}const xd="YYYY-MM-DD",Rd={mixins:[Y],data(){return{picker:null,options:null}},mounted(){this.initialize(C.get(this.schema,"pikadayOptions",{}))},beforeUnmount(){this.picker&&this.picker.destroy()},methods:{getDateFormat(){return C.get(this.schema,"pikadayOptions.format",xd)},...vo,initialize(n){this.picker&&this.picker.destroy&&this.picker.destroy(),this.$nextTick(()=>{window.Pikaday?(this.options=C.defaults({},n,{field:this.$el,onSelect:()=>{this.value=this.picker.toString()}}),this.picker=new window.Pikaday(this.options)):console.warn("Pikaday is missing. Please download from https://github.com/dbushell/Pikaday/ and load the script and CSS in the HTML head section!")})}}},Pd=P(Rd,[["render",Ud]]),qd=["autocomplete","data-disable","data-max","data-min","data-step","placeholder","readonly","name"];function zd(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,"data-disable":n.disabled,"data-max":n.schema.max,"data-min":n.schema.min,"data-step":n.schema.step,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName},null,8,qd)}const Hd=P({mixins:[Y],data(){return{slider:null}},watch:{model:{deep:!0,handler(){if(window.$&&window.$.fn.ionRangeSlider){let n,a;C.isArray(this.value)?[n,a]=this.value:n=this.value,this.slider&&this.slider.update({from:n,to:a})}}}},mounted(){this.$nextTick(function(){if(window.$&&window.$.fn.ionRangeSlider){let n,a;C.isArray(this.value)?[n,a]=this.value:n=this.value;const s=this;$(this.$el).ionRangeSlider(C.defaults(this.schema.rangeSliderOptions||{},{type:"single",grid:!0,hide_min_max:!0,from:n,to:a,onChange(m){s.slider.options.type==="double"?s.value=[m.from,m.to]:s.value=m.from}})),this.slider=$(this.$el).data("ionRangeSlider")}else console.warn("ion.rangeSlider library is missing. Please download from https://github.com/IonDen/ion.rangeSlider and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.slider&&this.slider.destroy()}},[["render",zd]]),Wd=["disabled","multiple","title","name"],Kd=["disabled","selected"],Yd=["value"];function Gd(n,a,s,m,h,u){return i.withDirectives((i.openBlock(),i.createElementBlock("select",{class:"selectpicker","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),disabled:n.disabled||null,multiple:n.schema.multiSelect,title:n.schema.placeholder,"data-width":"100%",name:n.schema.inputName},[n.schema.multiSelect!==!0?(i.openBlock(),i.createElementBlock("option",{key:0,disabled:n.schema.required||null,value:null,selected:n.value==null},null,8,Kd)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.items,b=>(i.openBlock(),i.createElementBlock("option",{value:u.getItemValue(b)},i.toDisplayString(u.getItemName(b)),9,Yd))),256))],8,Wd)),[[i.vModelSelect,n.value]])}const Zd=P({mixins:[Y],computed:{items(){const n=this.schema.values;return typeof n=="function"?n.apply(this,[this.model,this.schema]):n}},watch:{model:{deep:!0,handler(){$.fn.selectpicker&&$(this.$el).selectpicker("refresh")}}},mounted(){this.$nextTick(function(){$.fn.selectpicker?$(this.$el).selectpicker("destroy").selectpicker(this.schema.selectOptions):console.warn("Bootstrap-select library is missing. Please download from https://silviomoreto.github.io/bootstrap-select/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){$.fn.selectpicker&&$(this.$el).selectpicker("destroy")},methods:{getItemValue(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.value<"u")return n[this.schema.selectOptions.value];if(typeof n.id<"u")return n.id;throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n},getItemName(n){if(C.isObject(n)){if(typeof this.schema.selectOptions<"u"&&typeof this.schema.selectOptions.name<"u")return n[this.schema.selectOptions.name];if(typeof n.name<"u")return n.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return n}}},[["render",Gd]]),Jd=["autocomplete","disabled","placeholder","readonly","name","id"];function Xd(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("input",{type:"text",autocomplete:n.schema.autocomplete,disabled:n.disabled||null,placeholder:n.schema.placeholder,readonly:n.schema.readonly,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,Jd)}const Qd=P({mixins:[Y],data(){return{picker:null}},watch:{model:{deep:!0,handler(){window.$&&window.$.fn.spectrum&&this.picker.spectrum("set",this.value)}},disabled(n){n?this.picker.spectrum("disable"):this.picker.spectrum("enable")}},mounted(){this.$nextTick(function(){window.$&&window.$.fn.spectrum?(this.picker=$(this.$el).spectrum("destroy").spectrum(C.defaults(this.schema.colorOptions||{},{showInput:!0,showAlpha:!0,disabled:this.schema.disabled,allowEmpty:!this.schema.required,preferredFormat:"hex",change:n=>{this.value=n?n.toString():null}})),this.picker.spectrum("set",this.value)):console.warn("Spectrum color library is missing. Please download from http://bgrins.github.io/spectrum/ and load the script and CSS in the HTML head section!")})},beforeUnmount(){this.picker&&this.picker.spectrum("destroy")}},[["render",Xd]]),jd=["src"];function ec(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("img",{src:u.mapLink},null,8,jd)}const tc=P({mixins:[Y],computed:{mapLink(){let n,a,s;if(this.value){const m=C.defaults(this.schema.staticMapOptions||{},{lat:"lat",lng:"lng",zoom:8,sizeX:640,sizeY:640});n=this.value[m.lat],a=this.value[m.lng],s=`http://maps.googleapis.com/maps/api/staticmap?center=${n},${a}&zoom=${m.zoom}&size=${m.sizeX}x${m.sizeY}`;const h=["scale","format","maptype","language","region","markers","path","visible","style","key","signature"];for(const u of h)typeof m[u]<"u"&&(s+=`&${u}=${m[u]}`)}return s}}},[["render",ec]]),nc=["autocomplete","disabled","name","id"],rc=["data-on","data-off","for"],ic=i.createElementVNode("span",{class:"handle"},null,-1);function oc(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("label",null,[i.withDirectives(i.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=b=>n.value=b),autocomplete:n.schema.autocomplete,disabled:n.disabled||null,name:n.schema.inputName,id:n.getFieldID(n.schema)},null,8,nc),[[i.vModelCheckbox,n.value]]),i.createElementVNode("span",{class:"label","data-on":n.schema.textOn||"On","data-off":n.schema.textOff||"Off",for:n.getFieldID(n.schema)},null,8,rc),ic])}const sc=P({mixins:[Y],methods:{formatValueToField(n){return n!=null&&this.schema.valueOn?n===this.schema.valueOn:n},formatValueToModel(n){return n!=null&&this.schema.valueOn?n?this.schema.valueOn:this.schema.valueOff:n}}},[["render",oc]]),ac={mixins:[Y],data(){return{attributes:this.schema?this.schema.attributes:void 0,newKeyType:"string",newKeyName:"",keyTypes:{}}},created(){this.value||(this.value={})},mounted(){if(!this.value)return;const n=Object.keys(this.value),a={};for(let s=0;s<n.length;s++){const m=n[s];a[m]=typeof this.value[m]}this.keyTypes=a},methods:{removeElement(n){const a=this.value;delete a[n],this.value=JSON.parse(JSON.stringify(a));const s=this.keyTypes;delete s[n],this.keyTypes=JSON.parse(JSON.stringify(s))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""}}},lc={key:0},dc={key:1},cc=["id"],uc={key:0},fc=["onUpdate:modelValue"],hc={key:1},mc=["onUpdate:modelValue"],pc={key:2},gc=["onUpdate:modelValue"],yc=["onClick"],_c=[i.createElementVNode("option",{value:"string"}," String ",-1),i.createElementVNode("option",{value:"number"}," Number ",-1),i.createElementVNode("option",{value:"boolean"}," Boolean ",-1)];function bc(n,a,s,m,h,u){const b=i.resolveComponent("vue-form-generator"),g=i.resolveDirective("attributes");return i.withDirectives((i.openBlock(),i.createElementBlock("div",null,[n.schema.schema?(i.openBlock(),i.createElementBlock("div",lc,[i.createVNode(b,{model:n.value,options:n.formOptions,schema:n.schema.schema},null,8,["model","options","schema"])])):(i.openBlock(),i.createElementBlock("div",dc,[i.createElementVNode("table",{id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(T,B)=>(i.openBlock(),i.createElementBlock("tr",{key:B},[i.createElementVNode("td",null,i.toDisplayString(B),1),h.keyTypes[B]==="string"?(i.openBlock(),i.createElementBlock("td",uc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":V=>n.value[B]=V,type:"text"},null,8,fc),[[i.vModelText,n.value[B]]])])):i.createCommentVNode("",!0),h.keyTypes[B]==="boolean"?(i.openBlock(),i.createElementBlock("td",hc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":V=>n.value[B]=V,type:"checkbox"},null,8,mc),[[i.vModelCheckbox,n.value[B]]])])):i.createCommentVNode("",!0),h.keyTypes[B]==="number"?(i.openBlock(),i.createElementBlock("td",pc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":V=>n.value[B]=V,type:"number"},null,8,gc),[[i.vModelText,n.value[B]]])])):i.createCommentVNode("",!0),i.createElementVNode("td",null,[i.createElementVNode("input",{type:"button",value:"x",onClick:V=>u.removeElement(B)},null,8,yc)])]))),128))],10,cc),i.withDirectives(i.createElementVNode("select",{"onUpdate:modelValue":a[0]||(a[0]=T=>h.newKeyType=T)},_c,512),[[i.vModelSelect,h.newKeyType]]),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":a[1]||(a[1]=T=>h.newKeyName=T),type:"text"},null,512),[[i.vModelText,h.newKeyName]]),i.createElementVNode("input",{type:"button",value:"Add key",onClick:a[2]||(a[2]=(...T)=>u.addKey&&u.addKey(...T))})]))])),[[g,h.attributes]])}const To=P(ac,[["render",bc]]),wc={mixins:[Y],emits:["model-updated"],data(){return{newKeyName:""}},computed:{subSchema(){return this.schema.schema&&this.schema.schema.fields[0].schema},subFields(){return!this.subSchema&&this.schema.fields},hasObjectKeys(){return this.value&&Object.keys(this.value).length>0},transformedModel(){return this.subSchema&&this.subSchema.fields.length>=1&&this.subSchema.fields[0].type==="array"?new Proxy(this.model[this.schema.model],{get:(n,a)=>({[this.schema.model]:n[a]}),set:(n,a,s)=>n[a]=s[this.schema.model]}):this.model[this.schema.model]}},mounted(){this.value||(this.value={});let n=[];this.subSchema?n=this.subSchema.fields:this.subFields&&(n=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,n,this.schema.model)},methods:{removeElement(n){const a=this.value;delete a[n],this.value={...a}},transformMapModelValuesToObject(n,a,s){const m={};return Object.keys(n).map(h=>{const u=h.indexOf(s+"-");if(u>-1&&Array.isArray(a))if(a.length>0){const g=h.split("-").filter(B=>a.find(V=>V.model===B)),T=h.split(`-${g}`)[0].split(`${s}-`)[1];g.length?m[T]={...m[T],[g]:n[h]}:m[h.substring(u+`${s}-`.length)]=n[h]}else m[h.substring(`${s}-`.length)]=n[h];else{const g=h.split("-").filter(B=>B===this.schema.model),T=h.split(`-${g}`)[0].split(`${s}-`)[1];T&&(m[T]=n[h])}return h}),m},addKey(){const n=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",a=this.subSchema?n?[""]:{}:"";this.value[this.newKeyName]=a,this.newKeyName=""},updateModel(n,a){this.$emit("model-updated",this.model[this.schema.model],a)}}},Bo=n=>(i.pushScopeId("data-v-22600a29"),n=n(),i.popScopeId(),n),Cc=["id"],kc=["data-testid"],Ec={class:"item-wrapper"},vc={class:"index-wrapper"},Sc=Bo(()=>i.createElementVNode("hr",{class:"divider"},null,-1)),Tc={key:0},Bc={key:1},Ic=["onUpdate:modelValue","placeholder","onInput"],Mc={key:0,class:"hint"},Nc=Bo(()=>i.createElementVNode("hr",{class:"wide-divider"},null,-1)),Ac={class:"input-item"},Fc=["placeholder"],$c={key:0,class:"hint"};function Vc(n,a,s,m,h,u){const b=i.resolveComponent("KIcon"),g=i.resolveComponent("KButton"),T=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",{id:n.getFieldID(n.schema),class:i.normalizeClass(["object-advanced-wrapper",n.schema.fieldClasses])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(B,V)=>(i.openBlock(),i.createElementBlock("div",{key:V,"data-testid":`field-object-key-${V}`},[i.createElementVNode("div",null,[i.createElementVNode("div",Ec,[i.createElementVNode("div",vc,[i.createElementVNode("strong",null,i.toDisplayString(V),1),i.createElementVNode("div",null,[i.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:ee=>u.removeElement(V)},{default:i.withCtx(()=>[i.createVNode(b,{icon:"trash",size:"18"})]),_:2},1032,["onClick"])])]),Sc,u.subSchema?(i.openBlock(),i.createElementBlock("div",Tc,[i.createVNode(T,{model:u.transformedModel[V],options:{helpAsHtml:!0},schema:u.subSchema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])):(i.openBlock(),i.createElementBlock("div",Bc,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":ee=>n.value[V]=ee,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:"text",onInput:ee=>u.updateModel(n.value[V],n.model[n.schema.model])},null,40,Ic),[[i.vModelText,n.value[V]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(i.openBlock(),i.createElementBlock("p",Mc,i.toDisplayString(n.schema.fields[0].schema.hint),1)):i.createCommentVNode("",!0)])),Nc])])],8,kc))),128)),i.createElementVNode("div",{class:i.normalizeClass(["input-wrapper",{indent:u.hasObjectKeys}])},[i.createElementVNode("div",Ac,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=B=>h.newKeyName=B),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,Fc),[[i.vModelText,h.newKeyName]]),i.createVNode(g,{appearance:"tertiary","data-testid":"add-key",disabled:!h.newKeyName,onClick:u.addKey},{default:i.withCtx(()=>[i.createTextVNode(" + Add "+i.toDisplayString(n.schema.buttonLabel||n.schema.label),1)]),_:1},8,["disabled","onClick"])]),n.schema.hintText?(i.openBlock(),i.createElementBlock("p",$c,i.toDisplayString(n.schema.hintText),1)):i.createCommentVNode("",!0)],2)],10,Cc)}const Io=P(wc,[["render",Vc],["__scopeId","data-v-22600a29"]]),Dn="24px",Mo=(n,a)=>{const s=n.__vccOpts||n;for(const[m,h]of a)s[m]=h;return s},Oc=n=>(i.pushScopeId("data-v-897b9266"),n=n(),i.popScopeId(),n),Dc=["aria-hidden"],Lc={key:0,"data-testid":"kui-icon-svg-title"},Uc=Oc(()=>i.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),xc=i.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const a=String(n).replace(/px/gi,""),s=Number(a);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const a=n,s=i.computed(()=>{if(typeof a.size=="number"&&a.size>0)return`${a.size}px`;if(typeof a.size=="string"){const h=String(a.size).replace(/px/gi,""),u=Number(h);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=i.computed(()=>({boxSizing:"border-box",color:a.color,display:a.display,height:s.value,lineHeight:"0",width:s.value}));return(h,u)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:i.normalizeStyle(m.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(i.openBlock(),i.createElementBlock("title",Lc,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),Uc],8,Dc))]),_:1},8,["aria-hidden","style"]))}}),Rc=Mo(xc,[["__scopeId","data-v-897b9266"]]),Pc=n=>(i.pushScopeId("data-v-a67bac4e"),n=n(),i.popScopeId(),n),qc=["aria-hidden"],zc={key:0,"data-testid":"kui-icon-svg-title"},Hc=Pc(()=>i.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),Wc=i.defineComponent({__name:"TrashIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Dn,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const a=String(n).replace(/px/gi,""),s=Number(a);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const a=n,s=i.computed(()=>{if(typeof a.size=="number"&&a.size>0)return`${a.size}px`;if(typeof a.size=="string"){const h=String(a.size).replace(/px/gi,""),u=Number(h);if(u&&!isNaN(u)&&Number.isInteger(u)&&u>0)return`${u}px`}return Dn}),m=i.computed(()=>({boxSizing:"border-box",color:a.color,display:a.display,height:s.value,lineHeight:"0",width:s.value}));return(h,u)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:i.normalizeStyle(m.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-trash-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(i.openBlock(),i.createElementBlock("title",zc,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),Hc],8,qc))]),_:1},8,["aria-hidden","style"]))}}),Ln=Mo(Wc,[["__scopeId","data-v-a67bac4e"]]),Kc={name:"FieldArrayItem",components:{TrashIcon:Ln},props:{model:{type:String,default:null}},emits:["remove-item"],data(){return{contentVisible:!1}}},Yc={class:"array-item"};function Gc(n,a,s,m,h,u){const b=i.resolveComponent("TrashIcon"),g=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Yc,[i.renderSlot(n.$slots,"default",{},void 0,!0),i.createVNode(g,{appearance:"tertiary",class:"delete",type:"button",onClick:a[0]||(a[0]=T=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})])}const No=P(Kc,[["render",Gc],["__scopeId","data-v-d42daeb2"]]),Zc={name:"FieldArrayMultiItem",emits:["remove-item"],data(){return{contentVisible:!1}}},Jc=n=>(i.pushScopeId("data-v-47ff1f9a"),n=n(),i.popScopeId(),n),Xc={class:"multi-item-wrapper"},Qc=Jc(()=>i.createElementVNode("hr",null,null,-1));function jc(n,a,s,m,h,u){const b=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Xc,[i.renderSlot(n.$slots,"default",{},void 0,!0),i.createVNode(b,{appearance:"danger",class:"delete",type:"input",onClick:a[0]||(a[0]=g=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createTextVNode(" - Remove Field ")]),_:1}),Qc])}const Ao=P(Zc,[["render",jc],["__scopeId","data-v-47ff1f9a"]]),eu={name:"FieldMetric",components:{AddIcon:Rc,TrashIcon:Ln},mixins:[Y],emits:["remove-item"],data(){return{contentVisible:!1}}},tu={key:0,class:"content"};function nu(n,a,s,m,h,u){const b=i.resolveComponent("AddIcon"),g=i.resolveComponent("TrashIcon"),T=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["field-dropdown",{active:h.contentVisible}])},[i.createElementVNode("div",{class:"title",onClick:a[0]||(a[0]=B=>h.contentVisible=!h.contentVisible)},[i.createTextVNode(i.toDisplayString(n.model.name?n.model.name:"New Item")+" ",1),i.createVNode(b,{class:"metric-add-icon"})]),i.createVNode(i.Transition,{name:"slide-fade"},{default:i.withCtx(()=>[h.contentVisible?(i.openBlock(),i.createElementBlock("div",tu,[i.renderSlot(n.$slots,"default"),i.createVNode(T,{appearance:"tertiary",class:"metric-remove-button",onClick:a[1]||(a[1]=B=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(g)]),_:1})])):i.createCommentVNode("",!0)]),_:3})],2)}const Fo=P(eu,[["render",nu]]),wt="kong-ui-forms-api",ru="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";function iu(n){return n?n.length===36&&new RegExp(`^${ru}$`).test(n):!1}const Fr=50,Ft={CREATE_NOT_FROM_ENTITY:"CREATE_NOT_FROM_ENTITY",CREATE_FROM_ENTITY:"CREATE_FROM_ENTITY",UPDATE_ENTITY:"UPDATE_ENTITY",SET_REFERRAL_VALUE:"SET_REFERRAL_VALUE"};function ou(n,a,s){return s?Ft.SET_REFERRAL_VALUE:n&&!a||!n&&a?Ft.UPDATE_ENTITY:n&&a?Ft.CREATE_FROM_ENTITY:Ft.CREATE_NOT_FROM_ENTITY}const su={mixins:[Y],inject:[wt],emits:["model-updated"],data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return ou(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search}},watch:{idValue:{handler(n,a){n!==a&&this.updateModel(n)}}},async created(){await this.$nextTick();let n,a;switch(this.fieldState){case Ft.UPDATE_ENTITY:if(!this[wt]){console.warn("[@kong-ui-public/forms] No API service provided");break}a=(await this[wt].getOne(this.entity,this.model[this.schema.model])).data,n=this.getItem(this.schema.entityDataKey?a[this.schema.entityDataKey]:a),this.idValue=n.id;break;case Ft.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case Ft.SET_REFERRAL_VALUE:this.idValue=this.value}try{n&&(this.initialItems=[{...n,label:this.getSuggestionLabel(n),value:n.id}]),this.items=this.initialItems}catch(s){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",s)}},methods:{onQueryChange(n){n.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=C.debounce(this.search,500)),this.performSearch(n)},async search(n){if(n.trim().length===0)return;this.loading=!0;const a=[],s=[],m=this.getInputFields(),h=new Set;iu(n)&&m.includes("id")?s.push((async()=>{const u=await this.fetchExact(n);a.push({...u,label:this.getSuggestionLabel(u),value:u.id})})()):s.push(...m.filter(u=>u!=="id").map(async u=>{(await this.fetchSuggestions(n,u)).forEach(g=>{h.has(g.id)||(h.add(g.id),a.push({...g,label:this.getSuggestionLabel(g),value:g.id}))})})),await Promise.all(s),this.items=a,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(n){return n.data?n.data.length>0?n.data[0]:[]:n},async fetchUntilLimit(n){const a=[];let s=null;if(!this[wt])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;a.length<Fr;){const m=await this[wt].getAll(this.entity,{size:Fr,offset:s,...n});if(a.push(...m.data.data),s=m.data.offset,!s)break}return a.slice(0,Fr)},async fetchSuggestions(n,a){return this.fetchUntilLimit({[a]:n})},async fetchExact(n){return this[wt]?(await this[wt].getOne(this.entity,n)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var n,a;return((a=(n=this.schema)==null?void 0:n.inputValues)==null?void 0:a.fields)||[]},getSuggestionLabel(n){const a=this.getInputFields();return a.length&&n?a.map(s=>n[s]).filter(Boolean).join(" - "):""},updateModel(n){this.$emit("model-updated",n!=null&&n.length?n:null,this.schema.model)},onSelected(n){this.idValue=n&&n.id,this.updateModel(this.getReturnValue(n||{}))},getReturnValue(n){var s;const a=(s=this.schema)==null?void 0:s.returnKey;return a?n[a]:n.id}}},au={class:"field-wrap autosuggest"},lu=["data-testid","data-testlabel"],du=["data-testid"],cu={class:"autosuggest__results_message"};function uu(n,a,s,m,h,u){const b=i.resolveComponent("KSelect");return i.openBlock(),i.createElementBlock("div",au,[i.createVNode(b,{id:n.schema.model,ref:"suggestion",modelValue:h.idValue,"onUpdate:modelValue":a[0]||(a[0]=g=>h.idValue=g),clearable:"","enable-filtering":"","filter-function":()=>!0,items:h.items,loading:h.loading,placeholder:n.schema.placeholder,width:"100%",onChange:u.onSelected,onQueryChange:u.onQueryChange},{"item-template":i.withCtx(({item:g})=>[i.createElementVNode("span",{class:"first-part","data-testid":g.id&&`${g.id}-0`,"data-testlabel":g.label},i.toDisplayString(u.getSuggestionLabel(g).split(" - ")[0]),9,lu),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.getSuggestionLabel(g).split(" - ").slice(1),(T,B)=>(i.openBlock(),i.createElementBlock("span",{key:B,class:"field-span","data-testid":g.id&&`${g.id}-${B+1}`||B+1},i.toDisplayString(T),9,du))),128))]),empty:i.withCtx(()=>[i.createElementVNode("div",cu,[i.createElementVNode("span",null,i.toDisplayString(h.message),1)])]),_:1},8,["id","modelValue","items","loading","placeholder","onChange","onQueryChange"])])}const $o=P(su,[["render",uu],["__scopeId","data-v-62760c9d"]]),fu={name:"FieldArrayCardContainer",components:{TrashIcon:Ln},props:{model:{type:Object,default:null},schema:{type:Object,default:null}},emits:["remove-item"]},hu={class:"array-card-container"};function mu(n,a,s,m,h,u){const b=i.resolveComponent("KCard"),g=i.resolveComponent("TrashIcon"),T=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",hu,[i.createVNode(b,{class:"card"},{default:i.withCtx(()=>[i.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3}),i.createVNode(T,{appearance:"tertiary",class:"array-card-remove-button",onClick:a[0]||(a[0]=B=>n.$emit("remove-item"))},{default:i.withCtx(()=>[i.createVNode(g)]),_:1})])}const Vo=P(fu,[["render",mu],["__scopeId","data-v-68702965"]]),pu={mixins:[Y],emits:["model-updated"],methods:{updateModel(n){this.$emit("model-updated",n,this.schema.model)},checkOption(n){return this.model[this.schema.model]?n.value.toString()===this.model[this.schema.model].toString():n.checked},onChange(n){let a=n.target.value.split(",");this.schema.array||(a=a.toString()),this.updateModel(a)}}},gu={class:"selection-group"},yu={class:"form-group"},_u=["id","checked","name","value"];function bu(n,a,s,m,h,u){return i.openBlock(),i.createElementBlock("div",gu,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.schema.values,(b,g)=>(i.openBlock(),i.createElementBlock("div",{key:g,class:"option-group"},[i.createElementVNode("div",yu,[i.createElementVNode("label",{class:i.normalizeClass(["k-label",b.name])},[i.createElementVNode("input",{id:n.schema.name+"-"+g,checked:u.checkOption(b),class:"k-input",name:n.schema.name,type:"radio",value:b.value,onChange:a[0]||(a[0]=(...T)=>u.onChange&&u.onChange(...T))},null,40,_u),i.createTextVNode(" "+i.toDisplayString(b.name),1)],2)])]))),128))])}const Oo=P(pu,[["render",bu],["__scopeId","data-v-7e49acd6"]]),wu={name:"FieldArray",components:{FieldArrayItem:No,FieldArrayMultiItem:Ao,FieldSelect:ko,FieldMetric:Fo,FieldObject:To,FieldObjectAdvanced:Io,FieldAutoSuggest:$o,FieldRadio:Oo,FieldArrayCardContainer:Vo,FieldTextArea:Eo,FieldInput:Co},mixins:[Y],props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},methods:{generateSchema(n,a,s){var h,u,b;let m;return a&&(m=JSON.parse(JSON.stringify(a)),(b=(u=(h=m.schema)==null?void 0:h.fields)==null?void 0:u.map)==null||b.call(u,g=>(g.id=`${g.id||g.model}-${s}`,g))),{...m,set(g,T){n[s]=T},get(){return n[s]}}},newElement(){let n=this.value,a;(!n||!n.push)&&(n=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?a=this.schema.items.default():a=this.schema.items.default),n.push(a),this.value=[...n]},removeElement(n){this.value.splice(n,1)},getFieldType(n){return"field-"+n.type},modelUpdated(){}}},Cu=["id"],ku={key:1},Eu=["onUpdate:modelValue","type"],vu=["value","onClick"],Su=["onUpdate:modelValue"],Tu=["value","onClick"];function Bu(n,a,s,m,h,u){const b=i.resolveComponent("FieldTextArea"),g=i.resolveComponent("KButton");return n.schema?(i.openBlock(),i.createElementBlock("div",{key:0,id:n.getFieldID(n.schema),class:i.normalizeClass(n.schema.fieldClasses)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,(T,B)=>(i.openBlock(),i.createElementBlock("div",{key:B,class:i.normalizeClass(n.schema.fieldItemsClasses)},[n.schema.items&&n.schema.itemContainerComponent?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.schema.itemContainerComponent),{key:0,model:T,schema:u.generateSchema(n.value,n.schema.items,B),onRemoveItem:V=>u.removeElement(B)},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,B),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["model","schema","onRemoveItem"])):n.schema.items?(i.openBlock(),i.createElementBlock("span",ku,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(n.schema.items)),{"form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,B),onModelUpdated:u.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):n.schema.itemContainerComponent?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.schema.itemContainerComponent),{key:2,"data-testid":`${n.getFieldID(n.schema)}-item-${B}`,model:T,schema:u.generateSchema(n.value,n.schema.items,B),onRemoveItem:V=>u.removeElement(B)},{default:i.withCtx(()=>{var V,ee;return[((V=n.schema.inputAttributes)==null?void 0:V.type)==="textarea"?(i.openBlock(),i.createBlock(b,{key:0,class:"k-input","form-options":n.formOptions,model:T,schema:u.generateSchema(n.value,n.schema.items,B),onModelUpdated:u.modelUpdated},null,8,["form-options","model","schema","onModelUpdated"])):i.withDirectives((i.openBlock(),i.createElementBlock("input",i.mergeProps({key:1,"onUpdate:modelValue":Q=>n.value[B]=Q},n.schema.inputAttributes,{type:((ee=n.schema.inputAttributes)==null?void 0:ee.type)||"text"}),null,16,Eu)),[[i.vModelDynamic,n.value[B]]]),n.schema.showRemoveButton?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:2},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||s.removeElementButtonLabel,onClick:Q=>u.removeElement(B)}),null,16,vu)):i.createCommentVNode("",!0)]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):i.withDirectives((i.openBlock(),i.createElementBlock("input",i.mergeProps({key:3},n.schema.inputAttributes,{"onUpdate:modelValue":V=>n.value[B]=V,type:"text"}),null,16,Su)),[[i.vModelText,n.value[B]]]),n.schema.showRemoveButton?(i.openBlock(),i.createElementBlock("input",i.mergeProps({key:4},n.schema.removeElementButtonAttributes,{type:"button",value:n.schema.removeElementButtonLabel||s.removeElementButtonLabel,onClick:V=>u.removeElement(B)}),null,16,Tu)):i.createCommentVNode("",!0)],2))),128)),i.createVNode(g,{appearance:"tertiary",class:i.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`add-${n.getFieldID(n.schema)}`,type:"button",onClick:u.newElement},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.schema.newElementButtonLabel||s.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Cu)):i.createCommentVNode("",!0)}const Iu=P(wu,[["render",Bu],["__scopeId","data-v-1731cb2f"]]),Mu={mixins:[Y],emits:["model-updated"],data(){return{isOpen:!1}},computed:{openClass(){return this.isOpen?"open":"closed"},fieldCount(){return this.schema.fields.length},titleText(){return`${this.isOpen?"Hide":"View"} ${this.fieldCount} Advanced Fields`}},methods:{handleOpen(){this.isOpen=!this.isOpen},updateModel(n,a){this.$emit("model-updated",n,a)}}},Nu={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},Au={class:"material-icons"};function Fu(n,a,s,m,h,u){const b=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",Nu,[i.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:a[0]||(a[0]=(...g)=>u.handleOpen&&u.handleOpen(...g))},[i.createElementVNode("i",Au,i.toDisplayString(h.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),i.createElementVNode("span",null,i.toDisplayString(u.titleText),1)]),i.createElementVNode("div",{class:i.normalizeClass(["advanced-field-dropdown",u.openClass])},[i.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:n.schema,onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])],2)])}const $u=P(Mu,[["render",Fu],["__scopeId","data-v-2d8e71e1"]]),Vu={mixins:[Y],emits:["model-updated"],data(){return{checkedGroup:null,fieldModel:{...this.model},fieldSchema:[]}},watch:{checkedGroup:{handler(n,a){if(a===null){this.fieldModel={...this.model};return}const s=this.schema.fields[n].fields,m=this.schema.fields[a].fields;m&&m.forEach(h=>this.updateModel("",h.model)),s&&s.forEach(h=>this.updateModel(this.fieldModel[h.model],h.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((n,a)=>{n.fields&&n.fields.forEach(s=>{this.model[s.model]&&(this.checkedGroup=a,this.fieldSchema.push(s.model))})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(n,a){this.$emit("model-updated",n,a)}}},Ou={class:"selection-group"},Du={class:"form-group"},Lu=["value"],Uu={class:"control-help"},xu={class:"option-field"},Ru={class:"option-field-container"};function Pu(n,a,s,m,h,u){const b=i.resolveComponent("vue-form-generator");return i.openBlock(),i.createElementBlock("div",Ou,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.schema.fields,(g,T)=>(i.openBlock(),i.createElementBlock("div",{key:T,class:"option-group"},[i.createElementVNode("div",Du,[i.createElementVNode("label",{class:i.normalizeClass(["k-label",`${g.label}-check`])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=B=>h.checkedGroup=B),class:"k-input",type:"radio",value:T},null,8,Lu),[[i.vModelRadio,h.checkedGroup]]),i.createTextVNode(" "+i.toDisplayString(g.label)+" ",1),i.createElementVNode("div",Uu,i.toDisplayString(g.description),1)],2)]),i.withDirectives(i.createElementVNode("div",xu,[i.createElementVNode("div",Ru,[i.createVNode(b,{model:n.model,options:{helpAsHtml:!0},schema:{fields:g.fields},onModelUpdated:u.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[i.vShow,g.fields&&h.checkedGroup===T]])]))),128))])}const qu=P(Vu,[["render",Pu],["__scopeId","data-v-25fe24da"]]),zu={mixins:[Y],emits:["model-updated"],methods:{onUpdate(n){this.$emit("model-updated",n,this.schema.model)}}};function Hu(n,a,s,m,h,u){const b=i.resolveComponent("KMultiselect");return i.openBlock(),i.createBlock(b,{"data-testid":"field-multiselect",items:n.schema.values,"label-attributes":{info:n.schema.help},"model-value":n.value,placeholder:n.schema.placeholder,required:n.schema.required||void 0,width:"100%","onUpdate:modelValue":u.onUpdate},null,8,["items","label-attributes","model-value","placeholder","required","onUpdate:modelValue"])}const Wu=P(zu,[["render",Hu]]),Ku={name:"FieldKeyValuePairs",components:{TrashIcon:Ln},mixins:[Y],data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var a,s;this.value||(this.value={});const n=((s=this.model)==null?void 0:s[(a=this.schema)==null?void 0:a.model])??{};Object.keys(n).forEach(m=>{this.pairs.push({key:m,value:n[m]})})},methods:{onInput(n,a,s){this.pairs[a][s]=n.target.value},updateValue(){this.value=this.pairs.reduce((n,{key:a,value:s})=>({...n,...a&&s?{[a]:s}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(n){this.pairs.splice(n,1)}}},Yu={class:"key-value-pairs-editor"},Gu=["data-testid","placeholder","value","onInput"],Zu=["data-testid","placeholder","value","onInput"];function Ju(n,a,s,m,h,u){const b=i.resolveComponent("TrashIcon"),g=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",Yu,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.pairs,(T,B)=>(i.openBlock(),i.createElementBlock("div",{key:B,class:"pair-item"},[i.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-key-${B}`,placeholder:n.schema.keyInputPlaceholder??"Key",type:"text",value:T.key,onInput:V=>{u.onInput(V,B,"key")}},null,40,Gu),i.createElementVNode("input",{class:"form-control","data-testid":`${n.getFieldID(n.schema)}-pair-value-${B}`,placeholder:n.schema.valueInputPlaceholder??"Value",type:"text",value:T.value,onInput:V=>{u.onInput(V,B,"value")}},null,40,Zu),i.createVNode(g,{appearance:"tertiary","data-testid":`${n.getFieldID(n.schema)}-remove-pair-${B}`,onClick:()=>{u.removePair(B)}},{default:i.withCtx(()=>[i.createVNode(b)]),_:2},1032,["data-testid","onClick"])]))),128)),i.createVNode(g,{appearance:"tertiary",class:i.normalizeClass(n.schema.newElementButtonLabelClasses),"data-testid":`${n.getFieldID(n.schema)}-add-pair`,type:"button",onClick:u.addPair},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Xu={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:$u,FieldArray:Iu,FieldArrayCardContainer:Vo,FieldArrayItem:No,FieldArrayMultiItem:Ao,FieldAutoSuggest:$o,FieldCheckbox:Nl,FieldChecklist:Rl,FieldCleave:pd,FieldDateTimePicker:Cd,FieldGoogleAddress:vd,FieldImage:Md,FieldInput:Co,FieldKeyValuePairs:P(Ku,[["render",Ju],["__scopeId","data-v-29d15375"]]),FieldLabel:Yl,FieldMasked:Fd,FieldMetric:Fo,FieldMultiselect:Wu,FieldNoUiSlider:Dd,FieldObject:To,FieldObjectAdvanced:Io,FieldPikaday:Pd,FieldRadio:Oo,FieldRadios:Xl,FieldRangeSlider:Hd,FieldSelect:ko,FieldSelectEx:Zd,FieldSelectionGroup:qu,FieldSpectrum:Qd,FieldStaticMap:tc,FieldSubmit:sd,FieldTextArea:Eo,FieldUpload:fd,fieldSwitch:sc},Symbol.toStringTag,{value:"Module"})),mixins:[no],props:{vfg:{type:Object,required:!0},model:{type:Object,default:()=>{}},options:{type:Object,default:()=>{}},field:{type:Object,required:!0},errors:{type:Array,default(){return[]}}},emits:["validated","modelUpdated"],data(){return{child:i.ref()}},methods:{fieldTypeHasLabel(n){if(C.isNil(n.label))return!1;let a="";switch(n.type==="input"?a=n.inputType:a=n.type,a){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(n){const a=C.get(this.options,"fieldIdPrefix","");return ro(n,a)},getFieldType(n){return"field-"+n.type},getButtonType(n){return C.get(n,"type","button")},onFieldValidated(n,a,s){this.$emit("validated",n,a,s)},buttonVisibility(n){return n.buttons&&n.buttons.length>0},buttonClickHandler(n,a,s){return n.onclick.call(this,this.model,a,s,this)},fieldHint(n){return C.isFunction(n.hint)?n.hint.call(this,this.model,n,this):n.hint},fieldErrors(n){return this.errors.filter(a=>a.field.fieldName===n.fieldName).map(a=>a.error)},onModelUpdated(n,a){this.$emit("modelUpdated",n,a)},validate(n){return this.$refs.child.validate(n)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(n){return n?n.replace(/^[cC]onfig\./,""):""}}},Do=n=>(i.pushScopeId("data-v-bee61052"),n=n(),i.popScopeId(),n),Qu=["for"],ju={class:"icon-wrapper"},ef=["innerHTML"],tf=Do(()=>i.createElementVNode("div",{class:"help",role:"button",tabindex:"0"},[i.createElementVNode("i",{class:"icon"})],-1)),nf=["innerHTML"],rf={key:0,class:"link-wrapper"},of=Do(()=>i.createElementVNode("span",{class:"section-header"},"More info",-1)),sf={class:"field-wrap"},af={key:0,class:"buttons"},lf=["type","onClick","textContent"],df=["innerHTML"],cf={key:2,class:"errors help-block"},uf=["innerHTML"];function ff(n,a,s,m,h,u){const b=i.resolveComponent("KTooltip"),g=i.resolveComponent("KExternalLink");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["form-group",n.getFieldRowClasses(s.field)])},[u.fieldTypeHasLabel(s.field)?(i.openBlock(),i.createElementBlock("label",{key:0,class:i.normalizeClass(["form-group-label",s.field.labelClasses]),for:u.getFieldID(s.field)},[i.createElementVNode("div",ju,[i.createElementVNode("span",{innerHTML:u.formattedLabel(s.field.label)},null,8,ef),s.field.help?(i.openBlock(),i.createBlock(b,{key:0,"max-width":"300",placement:"top","position-fixed":!0},{content:i.withCtx(()=>[s.options.helpAsHtml?(i.openBlock(),i.createElementBlock("div",{key:0,innerHTML:s.field.help},null,8,nf)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(s.field.help),1)],64))]),default:i.withCtx(()=>[tf]),_:1})):i.createCommentVNode("",!0)]),s.field.link?(i.openBlock(),i.createElementBlock("div",rf,[i.createVNode(g,{href:s.field.link},{default:i.withCtx(()=>[of]),_:1},8,["href"])])):i.createCommentVNode("",!0)],10,Qu)):i.createCommentVNode("",!0),i.createElementVNode("div",sf,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.getFieldType(s.field)),i.mergeProps(n.$attrs,{ref:"child",disabled:n.fieldDisabled(s.field)||null,"form-options":s.options,model:s.model,schema:s.field,vfg:s.vfg,onModelUpdated:u.onModelUpdated,onValidated:u.onFieldValidated}),null,16,["disabled","form-options","model","schema","vfg","onModelUpdated","onValidated"])),u.buttonVisibility(s.field)?(i.openBlock(),i.createElementBlock("div",af,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.field.buttons,(T,B)=>(i.openBlock(),i.createElementBlock("button",{key:B,class:i.normalizeClass(T.classes),type:u.getButtonType(T),onClick:V=>u.buttonClickHandler(T,s.field,V),textContent:i.toDisplayString(T.label)},null,10,lf))),128))])):i.createCommentVNode("",!0)]),s.field.hint?(i.openBlock(),i.createElementBlock("div",{key:1,class:"hint",innerHTML:u.fieldHint(s.field)},null,8,df)):i.createCommentVNode("",!0),u.fieldErrors(s.field).length>0?(i.openBlock(),i.createElementBlock("div",cf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.fieldErrors(s.field),(T,B)=>(i.openBlock(),i.createElementBlock("span",{key:B,innerHTML:T},null,8,uf))),128))])):i.createCommentVNode("",!0)],2)}const hf=P(Xu,[["render",ff],["__scopeId","data-v-bee61052"]]),mf={key:0,class:"vue-form-generator"},pf=["is"],gf=["is"],yf={key:0};function _f(n,a,s,m,h,u){const b=i.resolveComponent("form-group");return s.schema!=null?(i.openBlock(),i.createElementBlock("div",mf,[s.schema.fields?(i.openBlock(),i.createElementBlock("fieldset",{key:0,is:s.tag},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.fields,g=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[u.fieldVisible(g)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",vfg:h.vfg,field:g,errors:h.errors,model:s.model,options:s.options,onValidated:u.onFieldValidated,onModelUpdated:u.onModelUpdated},null,8,["vfg","field","errors","model","options","onValidated","onModelUpdated"])):i.createCommentVNode("",!0)],64))),256))],8,pf)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.groups,g=>(i.openBlock(),i.createElementBlock("fieldset",{is:s.tag,class:i.normalizeClass(n.getFieldRowClasses(g))},[g.legend?(i.openBlock(),i.createElementBlock("legend",yf,i.toDisplayString(g.legend),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(g.fields,T=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[u.fieldVisible(T)?(i.openBlock(),i.createBlock(b,{key:0,ref_for:!0,ref:"children",vfg:h.vfg,field:T,errors:h.errors,model:s.model,options:s.options,onValidated:u.onFieldValidated,onModelUpdated:u.onModelUpdated},null,8,["vfg","field","errors","model","options","onValidated","onModelUpdated"])):i.createCommentVNode("",!0)],64))),256))],10,gf))),256))])):i.createCommentVNode("",!0)}const be=P({name:"FormGenerator",components:{formGroup:hf},mixins:[no],props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:i.ref([]),fieldIdPrefix:"",validateAsync:!1,validationErrorClass:"error",validationSuccessClass:"",helpAsHtml:!1}}},multiple:{type:Boolean,default:!1},isNewModel:{type:Boolean,default:!1},tag:{type:String,default:"fieldset",validator:function(n){return n.length>0}}},emits:["validated","modelUpdated"],data(){return{vfg:this,errors:[],children:i.ref([])}},computed:{fields(){const n=[];return this.schema&&this.schema.fields&&C.forEach(this.schema.fields,a=>{(!this.multiple||a.multi===!0)&&n.push(a)}),n},groups(){const n=[];return this.schema&&this.schema.groups&&C.forEach(this.schema.groups.slice(0),a=>{n.push(a)}),n}},watch:{model:{deep:!0,handler(n,a){a!==n&&n!=null&&this.$nextTick(()=>{this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors()})}}},mounted(){this.$nextTick(()=>{this.model&&(this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors())})},methods:{fieldVisible(n){return C.isFunction(n.visible)?n.visible.call(this,this.model,n,this):C.isNil(n.visible)?!0:n.visible},onFieldValidated(n,a,s){this.errors=this.errors.filter(h=>h.field.fieldName!==s.schema.fieldName),!n&&a&&a.length>0&&C.forEach(a,h=>{this.errors.push({field:s.schema,error:h})});const m=this.errors.length===0;this.$emit("validated",m,this.errors,this)},onModelUpdated(n,a){this.$emit("modelUpdated",n,a)},validate(n=null){n===null&&(n=C.get(this.options,"validateAsync",!1)),this.clearValidationErrors();const a=[],s=[];C.forEach(this.$refs.children,h=>{C.isFunction(h.validate)&&(a.push(h.$refs.child),s.push(h.$refs.child.validate(!0)))});const m=h=>{const u=[];C.forEach(h,(g,T)=>{C.isArray(g)&&g.length>0&&C.forEach(g,B=>{u.push({field:a[T].schema,error:B})})}),this.errors=u;const b=u.length===0;return this.$emit("validated",b,u,this),n?u:b};return n?Promise.all(s).then(m):m(s)},clearValidationErrors(){this.errors.splice(0),C.forEach(this.$refs.children,n=>{n.clearValidationErrors()})}}},[["render",_f]]),bf={fields:[{inputType:"text",label:"Config.Client Id",model:"config-client_id",type:"input"},{inputType:"text",label:"Config.Client Secret",model:"config-client_secret",type:"input"},{inputType:"text",label:"Config.Issuer",model:"config-issuer",required:!0,type:"input"},{inputType:"text",label:"Config.Auth Methods",model:"config-auth_methods",type:"input"}]},wf={fields:[{inputType:"text",label:"Config.Scopes Claim",model:"config-scopes_claim",type:"input"},{inputType:"text",label:"Config.Scopes Required",model:"config-scopes_required",type:"input"},{inputType:"text",label:"Config.Audience Claim",model:"config-audience_claim",type:"input"},{inputType:"text",label:"Config.Audience Required",model:"config-audience_required",type:"input"},{inputType:"text",label:"Config.Roles Claim",model:"config-roles_claim",type:"input"},{inputType:"text",label:"Config.Roles Required",model:"config-roles_required",type:"input"},{inputType:"text",label:"Config.Groups Claim",model:"config-groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Groups Required",model:"config-groups_required",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"},{inputType:"text",label:"Config.Authenticated Groups Claim",model:"config-authenticated_groups_claim",type:"array",valueType:"string",valueArrayType:"array",itemContainerComponent:"FieldArrayItem",fieldClasses:"auth-array-item-container",fieldItemsClasses:"auth-array-item",inputAttributes:{class:"form-control",style:{minWidth:"200px"}},validator:"array",newElementButtonLabelClasses:"auth-array-item-new",newElementButtonLabel:"+ Add"}]},Cf={fields:[{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Client JWK",items:{type:"object",schema:{fields:[{model:"kid",label:"kid",type:"input",inputType:"string"},{model:"issuer",label:"issuer",type:"input",inputType:"string"},{model:"kty",label:"kty",type:"input",inputType:"string"},{model:"use",label:"use",type:"input",inputType:"string"},{model:"key_ops",label:"key_ops",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"alg",label:"alg",type:"input",inputType:"string"},{model:"x5u",label:"x5u",type:"input",inputType:"string"},{model:"x5c",label:"x5c",type:"array",fieldItemsClasses:"jwk-array-input-wrapper",showRemoveButton:!0,removeElementButtonLabel:"Remove",items:{type:"input",inputType:"string"}},{model:"x5t",label:"x5t",type:"input",inputType:"string"},{model:"x5t#S256",label:"x5t#S256",type:"input",inputType:"string"},{model:"k",label:"k",type:"input",inputType:"string"},{model:"x",label:"x",type:"input",inputType:"string"},{model:"y",label:"y",type:"input",inputType:"string"},{model:"crv",label:"crv",type:"input",inputType:"string"},{model:"n",label:"n",type:"input",inputType:"string"},{model:"e",label:"e",type:"input",inputType:"string"},{model:"d",label:"d",type:"input",inputType:"string"},{model:"p",label:"p",type:"input",inputType:"string"},{model:"q",label:"q",type:"input",inputType:"string"},{model:"dp",label:"dp",type:"input",inputType:"string"},{model:"dq",label:"dq",type:"input",inputType:"string"},{model:"qi",label:"qi",type:"input",inputType:"string"},{model:"oth",label:"oth",type:"input",inputType:"string"},{model:"r",label:"r",type:"input",inputType:"string"},{model:"t",label:"t",type:"input",inputType:"string"}]}},model:"config-client_jwk",label:"Config.Client Jwk",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#jwk-record"},{type:"array",showRemoveButton:!1,newElementButtonLabelClasses:"kong-form-new-element-button-label",itemContainerComponent:"FieldArrayCardContainer",fieldClasses:"array-card-container-wrapper",newElementButtonLabel:"+ Add Cluster Node",items:{type:"object",schema:{fields:[{label:"IP",model:"ip",type:"input",inputType:"text"},{label:"Port",model:"port",type:"input",inputType:"number"}]}},model:"config-session_redis_cluster_nodes",label:"Config.Session Redis Cluster Nodes",order:0,disabled:!1,link:"https://docs.konghq.com/hub/kong-inc/openid-connect/#host-record"}]},kf={name:"OIDCForm",components:{VueFormGenerator:be},props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},data(){return{init:!1,authMethods:[],sessionManagement:!1,globalFields:null,commonFieldsSchema:null,authFieldsSchema:null,advancedFieldsSchema:{fields:[]},advancedFields:null,tabs:[{hash:"#common",title:"Common"},{hash:"#authorization",title:"Authorization"},{hash:"#advanced",title:"Advanced"}]}},computed:{displayForm(){return this.formModel.id&&this.isEditing||!this.isEditing}},watch:{formModel:{handler:function(){this.oidcSetup()}}},mounted(){this.oidcSetup()},methods:{oidcSetup(){var a;this.init||(this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(s=>!s.model.startsWith("config")&&s.model!=="tags")},this.commonFieldsSchema={...bf},this.authFieldsSchema={...wf},this.advancedFieldsSchema.fields=this.formSchema.fields.filter(s=>s.model.startsWith("config")&&!this.commonFieldsSchema.fields.filter(m=>m.model===s.model).length&&!this.authFieldsSchema.fields.filter(m=>m.model===s.model).length||s.model==="tags"),this.advancedFieldsSchema.fields=this.advancedFieldsSchema.fields.map(s=>{const m=Cf.fields.find(h=>h.model===s.model);return m||s}),this.commonFieldsSchema.fields=this.commonFieldsSchema.fields.filter(s=>s.model!=="config-auth_methods"),this.sessionManagement=this.isEditing?this.formModel["config-auth_methods"].includes("session"):!1,this.authMethods=[{label:"Authorization Code Flow",value:"authorization_code",hint:"authorization code flow",prop:this.isEditing?this.formModel["config-auth_methods"].includes("authorization_code"):!1},{label:"Bearer Access Token",value:"bearer",hint:"JWT access token verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("bearer"):!1},{label:"Client Credentials Grant",value:"client_credentials",hint:"OAuth client credentials grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("client_credentials"):!1},{label:"Passwords Grant",value:"password",hint:"OAuth legacy password grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("password"):!1},{label:"Introspection",value:"introspection",hint:"OAuth introspection",prop:this.isEditing?this.formModel["config-auth_methods"].includes("introspection"):!1},{label:"UserInfo",value:"userinfo",hint:"OpenID Connect user info endpoint authentication",prop:this.isEditing?this.formModel["config-auth_methods"].includes("userinfo"):!1},{label:"Kong OAuth",value:"kong_oauth2",hint:"Kong OAuth plugin issued tokens verification",prop:this.isEditing?this.formModel["config-auth_methods"].includes("kong_oauth2"):!1},{label:"Refresh Token",value:"refresh_token",hint:"OAuth refresh token grant",prop:this.isEditing?this.formModel["config-auth_methods"].includes("refresh_token"):!1}]);const n={};for(const s of this.formSchema.fields)n[s.model]=s;for(const s of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const m of s.fields){const h=(a=n[m.model])==null?void 0:a.help;m.help===void 0&&typeof h=="string"&&(m.help=h)}},getAuthMethodsValue(n,a){const s=[];for(let m=0;m<this.authMethods.length;m++)this.authMethods[m].prop&&this.authMethods[m].value!==n&&s.push(this.authMethods[m].value);return this.sessionManagement&&n&&s.push("session"),a&&(n?s.push(n):s.push("session")),s},handleUpdate(n,a){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(a,n),this.onModelUpdated()}}},Ht=n=>(i.pushScopeId("data-v-e7395ff0"),n=n(),i.popScopeId(),n),Ef={class:"general-settings"},vf={class:"link-wrapper"},Sf=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)),Tf=Ht(()=>i.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),Bf={class:"auth-method-container"},If={class:"general-settings"},Mf={class:"link-wrapper"},Nf=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)),Af=Ht(()=>i.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),Ff={class:"general-settings"},$f={class:"link-wrapper"},Vf=Ht(()=>i.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)),Of=Ht(()=>i.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1));function Df(n,a,s,m,h,u){const b=i.resolveComponent("VueFormGenerator"),g=i.resolveComponent("KExternalLink"),T=i.resolveComponent("KLabel"),B=i.resolveComponent("KCheckbox"),V=i.resolveComponent("KInputSwitch"),ee=i.resolveComponent("KTabs");return i.openBlock(),i.createElementBlock("div",null,[s.formModel.id&&s.isEditing||!s.isEditing?(i.openBlock(),i.createBlock(b,{key:0,class:"global-fields",model:s.formModel,options:s.formOptions,schema:h.globalFields,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(ee,{tabs:h.tabs},{common:i.withCtx(()=>[i.createElementVNode("div",Ef,[i.createElementVNode("div",vf,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#important-configuration-parameters"},{default:i.withCtx(()=>[Sf]),_:1})]),Tf,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.commonFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(T,null,{default:i.withCtx(()=>[i.createTextVNode("Auth Methods")]),_:1}),i.createElementVNode("div",Bf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.authMethods,Q=>(i.openBlock(),i.createElementBlock("div",{key:Q.value,class:"auth-method"},[i.createVNode(B,{modelValue:Q.prop,"onUpdate:modelValue":we=>Q.prop=we,onChange:we=>u.handleUpdate(we,Q.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Q.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),i.createVNode(V,{modelValue:h.sessionManagement,"onUpdate:modelValue":a[0]||(a[0]=Q=>h.sessionManagement=Q),label:"Enable Session Management",onChange:u.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:i.withCtx(()=>[i.createElementVNode("div",If,[i.createElementVNode("div",Mf,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/#authorization"},{default:i.withCtx(()=>[Nf]),_:1})]),Af,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.authFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),advanced:i.withCtx(()=>[i.createElementVNode("div",Ff,[i.createElementVNode("div",$f,[i.createVNode(g,{href:"https://docs.konghq.com/hub/kong-inc/openid-connect/"},{default:i.withCtx(()=>[Vf]),_:1})]),Of,u.displayForm?(i.openBlock(),i.createBlock(b,{key:0,model:s.formModel,options:s.formOptions,schema:h.advancedFieldsSchema,onModelUpdated:s.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),_:1},8,["tabs"])])}const Lf=P(kf,[["render",Df],["__scopeId","data-v-e7395ff0"]]),Lo={general:{packageName:"forms"},"post-function":{tags:{hint:"e.g. tag1, tag2, tag3",newElementButtonLabel:"+ Add"},enabled:{newElementButtonLabel:"+ Add"},selectionGroup:{newElementButtonLabel:"+ Add"},instance_name:{newElementButtonLabel:"+ Add"},name:{newElementButtonLabel:"+ Add"},"config-certificate":{help:"Array of stringified Lua code to be cached and run in sequence during the certificate phase.",newElementButtonLabel:"+ Add"},"config-access":{help:"Array of stringified Lua code to be cached and run in sequence during the access phase.",newElementButtonLabel:"+ Add"},"config-body_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the body_filter phase.",newElementButtonLabel:"+ Add"},"config-header_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the header_filter phase.",newElementButtonLabel:"+ Add"},"config-functions":{newElementButtonLabel:"+ Add"},"config-log":{newElementButtonLabel:"+ Add"},"config-rewrite":{newElementButtonLabel:"+ Add"},"config-ws_client_frame":{newElementButtonLabel:"+ Add"},"config-ws_close":{newElementButtonLabel:"+ Add"},"config-ws_handshake":{newElementButtonLabel:"+ Add"},"config-ws_upstream_frame":{newElementButtonLabel:"+ Add"}},"exit-transformer":{"config-functions":{newElementButtonLabel:"+ Add"}}},Uf=P(i.defineComponent({__name:"PostFunction",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const{t:a,te:s}=to.createI18n("en-us",Lo),m=n,h=i.computed(()=>m.formModel.id&&m.isEditing||!m.isEditing),u=i.computed(()=>{const b=m.formSchema;return b.fields.map(g=>{const T=`post-function.${g.model}`;return g.hint=s(`${T}.hint`)&&a(`${T}.hint`)||g.hint,g.help=s(`${T}.help`)&&a(`${T}.help`)||g.help,g.newElementButtonLabel=s(`${T}.newElementButtonLabel`)&&a(`${T}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="post-function-array-item-container",g.fieldItemsClasses="post-function-array-item",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>h.value?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)}}),[["__scopeId","data-v-6706c68b"]]),xf=P(i.defineComponent({__name:"ExitTransformer",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const{t:a,te:s}=to.createI18n("en-us",Lo),m=n,h=i.computed(()=>m.formModel.id&&m.isEditing||!m.isEditing),u=i.computed(()=>{const b=m.formSchema;return b.fields.map(g=>{const T=`exit-transformer.${g.model}`;return g.hint=s(`${T}.hint`)&&a(`${T}.hint`)||g.hint,g.help=s(`${T}.help`)&&a(`${T}.help`)||g.help,g.newElementButtonLabel=s(`${T}.newElementButtonLabel`)&&a(`${T}.newElementButtonLabel`)||g.newElementButtonLabel,g.model!=="tags"&&(g.valueType==="array"||g.type==="array")&&(g.type="array",g.valueArrayType="array",g.itemContainerComponent="FieldArrayItem",g.fieldClasses="exit-transformer-array-item-container",g.fieldItemsClasses="exit-transformer-array-item",g.inputAttributes={...g.inputAttributes,type:"textarea"}),g}),b});return(b,g)=>h.value?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:u.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)}}),[["__scopeId","data-v-0fc8ef29"]]),Rf={fields:[{inputType:"text",label:"Config.Account Email",model:"config-account_email",required:!0,type:"input"},{inputType:"text",label:"Config.Account Key.Key Id",model:"config-account_key-key_id",required:!0,type:"input"},{type:"input",inputType:"text",valueType:"string",label:"Config.Account Key.Key Set",model:"config-account_key-key_set",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",label:"Config.Allow Any Domain",model:"config-allow_any_domain",order:0,disabled:!1}]},Pf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",model:"config-tos_accepted",label:"Config.Tos Accepted",order:0,disabled:!1}]},qf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_hmac_key",label:"Config.Eab Hmac Key",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_kid",label:"Config.Eab Kid",order:0,disabled:!1}]},$t=n=>(i.pushScopeId("data-v-5b189366"),n=n(),i.popScopeId(),n),zf={class:"general-settings"},Hf=$t(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),Wf=$t(()=>i.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),Kf=$t(()=>i.createElementVNode("hr",null,null,-1)),Yf={class:"sub-form"},Gf={class:"general-settings"},Zf=$t(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),Jf=$t(()=>i.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),Xf={class:"sub-form"},Qf={class:"general-settings"},jf=$t(()=>i.createElementVNode("div",{class:"header-wrapper"},[i.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),eh=$t(()=>i.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),th=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:P(i.defineComponent({__name:"ACMEForm",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(n){const a=n,s=i.ref("zeroSsl"),m=i.ref("shm"),h=i.computed(()=>{var L;const A={};if((L=a.formSchema)!=null&&L.fields)for(const G of a.formSchema.fields)A[G.model]=G;return A}),u=i.computed(()=>{var L;const A=C.cloneDeep(Rf);for(const G of A.fields){const ce=(L=h.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ce=="string"&&(G.help=ce)}return A}),b=i.computed(()=>{var L;const A=C.cloneDeep(Pf);for(const G of A.fields){const ce=(L=h.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ce=="string"&&(G.help=ce)}return A}),g=i.computed(()=>{var L;const A=C.cloneDeep(qf);for(const G of A.fields){const ce=(L=h.value[G.model])==null?void 0:L.help;G.help===void 0&&typeof ce=="string"&&(G.help=ce)}return A}),T=i.computed(()=>({fields:a.formSchema.fields.filter(A=>!A.model.startsWith("config")&&A.model!=="tags")})),B=i.computed(()=>({fields:u.value.fields.filter(L=>!b.value.fields.some(G=>G.model===L.model)&&!g.value.fields.some(G=>G.model===L.model))})),V=i.computed(()=>({fields:a.formSchema.fields.filter(L=>L.model.startsWith("config-storage")&&!L.model.startsWith("config-storage_config-consul")&&!L.model.startsWith("config-storage_config-redis")&&!L.model.startsWith("config-storage_config-shm")&&!L.model.startsWith("config-storage_config-vault"))})),ee=i.computed(()=>({fields:a.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-consul"))})),Q=i.computed(()=>({fields:a.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-redis"))})),we=i.computed(()=>({fields:a.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-shm"))})),tt=i.computed(()=>({fields:a.formSchema.fields.filter(L=>L.model.startsWith("config-storage_config-vault"))})),st=i.computed(()=>({fields:a.formSchema.fields.filter(A=>A.model.startsWith("config")&&!B.value.fields.filter(L=>L.model===A.model).length&&!V.value.fields.filter(L=>L.model===A.model).length||A.model==="tags")})),de=i.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),Te=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],at=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];i.onMounted(()=>{s.value==="zeroSsl"&&(a.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const Be=A=>{s.value=A.value,(A.value==="zeroSsl"||A.value==="other")&&(A.value==="zeroSsl"?a.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":a.formModel["config-api_uri"]="https://acme.example.com/",a.formModel["config-tos_accepted"]=!1),A.value==="letsEncrypt"&&(a.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",a.formModel["config-eab_hmac_key"]="",a.formModel["config-eab_kid"]=""),a.onModelUpdated()},Ie=(A,L)=>{L==="config-storage"&&(m.value=A),a.onModelUpdated()};return(A,L)=>{const G=i.resolveComponent("KSelect"),ce=i.resolveComponent("KTabs");return i.openBlock(),i.createElementBlock("div",null,[n.formModel.id&&n.isEditing||!n.isEditing?(i.openBlock(),i.createBlock(be,{key:0,class:"global-fields",model:n.formModel,options:n.formOptions,schema:T.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),i.createVNode(ce,{tabs:Te},{general:i.withCtx(()=>[i.createElementVNode("div",zf,[Hf,Wf,de.value?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:B.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),Kf,i.createVNode(G,{class:"issuer-select",items:at,label:"Issuer",onChange:Be}),i.createElementVNode("div",Yf,[s.value==="letsEncrypt"?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:b.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),s.value==="zeroSsl"||s.value==="other"?(i.openBlock(),i.createBlock(be,{key:1,model:n.formModel,options:n.formOptions,schema:g.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])])]),storage:i.withCtx(()=>[i.createElementVNode("div",Gf,[Zf,Jf,de.value?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:V.value,onModelUpdated:Ie},null,8,["model","options","schema"])):i.createCommentVNode("",!0),i.createElementVNode("div",Xf,[m.value==="consul"?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:ee.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="redis"?(i.openBlock(),i.createBlock(be,{key:1,model:n.formModel,options:n.formOptions,schema:Q.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="shm"?(i.openBlock(),i.createBlock(be,{key:2,model:n.formModel,options:n.formOptions,schema:we.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0),m.value==="vault"?(i.openBlock(),i.createBlock(be,{key:3,model:n.formModel,options:n.formOptions,schema:tt.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])])]),advanced:i.withCtx(()=>[i.createElementVNode("div",Qf,[jf,eh,de.value?(i.openBlock(),i.createBlock(be,{key:0,model:n.formModel,options:n.formOptions,schema:st.value,onModelUpdated:n.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):i.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-5b189366"]]),ExitTransformer:xf,OIDCForm:Lf,PostFunction:Uf},Symbol.toStringTag,{value:"Module"})),nh=["array","metric","advanced","selectionGroup","object-advanced"],rh={install:n=>{n.component("VueFormGenerator",be)}},ih=(n,a=!1)=>({...a&&{acme:"ACMEForm"},"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer"})[n];ve.FORMS_API_KEY=wt,ve.VueFormGenerator=be,ve.abstractField=Tl,ve.customFields=nh,ve.default=rh,ve.getSharedFormName=ih,ve.sharedForms=th,Object.defineProperties(ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/forms",
3
- "version": "2.1.28",
3
+ "version": "2.1.29",
4
4
  "type": "module",
5
5
  "main": "./dist/forms.umd.js",
6
6
  "module": "./dist/forms.es.js",
@@ -32,7 +32,7 @@
32
32
  "extends": "../../../package.json"
33
33
  },
34
34
  "dependencies": {
35
- "@kong/icons": "^1.8.12",
35
+ "@kong/icons": "^1.8.13",
36
36
  "fecha": "^4.2.3",
37
37
  "lodash": "^4.17.21"
38
38
  },