Jump to content

Todoist Workflow


Recommended Posts

  • 3 weeks later...

Hi,

 

I've noticed that if I use the workflow to add a task to Todoist, say, "empty bins, every wed 9pm," it won't be the same as if I had entered it natively on Todoist. In Todoist itself, any tasks I add with a date and time will get an "auto-reminder" added to them. This is signified by a little alarm clock icon next to the task. My automatic reminders are set up to trigger "0 mins before."

 

So when the date/time task is added via your workflow, this "auto reminder" doesn't get added making behaviour inconsistent with how my native Todoist set up works. There is an "auto_reminder" property in the API apparently, so could there be a way for a user of the workflow to toggle this to Y/N in the configuration/set up to ensure it is consistent with Todoist web/app?

 

Thanks.

Link to comment

It doesn’t work at present unfortunately. Give it a go. Something has definitely changed their end in recent weeks. Anything I’ve added with natural language with a date/time, using your Workflow or Drafts on iOS (also uses REST API), now doesn’t create auto-reminders; the alarm clock icon. I only discovered the hard way; not being alerted about timed tasks. Upon investigating, I then found this different behaviour. So I will only send tasks to Todoist via your workflow and Drafts. I will then set dates and times in Todoist so that auto-reminders get applied.

Link to comment

It used to work. I've already raised it with them, but this is what they said. I don't think the support person really grasped what I was on about.

 

"Thanks for reaching out to us.

From your description of the issue it seems that the issue is with the integrations using the API. It seems they are not using the auto_reminder property when creating tasks and so no default reminder gets added when creating the task.

More information can be found here - https://developer.todoist.com/sync/v8/#add-an-item .

We recommend reporting this to the developers of those apps/integrations so that they can make the adjustments for you."

 

They've definitely made changes on their front-end lately to reminders. They've added a "before task" option. So if a task has already got an auto-reminder set by virtue of its date/time, when adding another reminder, you can now select x mins / days before. This is definitely new.  The only option before, apart from location, was to set another reminder on a specific time/date.

 

 

Link to comment
  • 1 month later...

Whoops that's not good. I'm in the middle of a big rewrite which solves a lot of the outstanding issues l, a better updater, better notifications and better error response. I hope I'll be able to release an alpha soon. If that's not acceptable I would recommend a downgrade (find it on github).

 

Did you ever hear anything back from Todoist? I got a note they'd look into it. But nothing definite.

Link to comment
  • 2 weeks later...
  • 2 weeks later...

Forgive me if this was covered before, but is anyone else having this problem? This seems like a cool workflow and I'd love it if this is an easy fix! MTIA

[10:30:16.781] Alfred Workflow Todoist[Script Filter] Queuing argument 'b'
[10:30:16.974] Alfred Workflow Todoist[Script Filter] Queuing argument 'bu'
[10:30:17.183] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy'
[10:30:17.295] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy '
[10:30:17.797] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[10:30:17.801] Alfred Workflow Todoist[Script Filter] {"items":[{"uid":"693e9af84d3dfcc71e640e005bdc5e2e","title":"CREATE: b","subtitle":"INBOX","icon":{"path":"icon.png"},"arg":"{\"content\":\"b\",\"priority\":1}","type":"default","valid":true}]}
[10:30:18.345] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[10:30:18.349] Alfred Workflow Todoist[Script Filter] {"items":[{"uid":"693e9af84d3dfcc71e640e005bdc5e2e","title":"CREATE: buy","subtitle":"INBOX","icon":{"path":"icon.png"},"arg":"{\"content\":\"buy\",\"priority\":1}","type":"default","valid":true}]}
[10:30:22.388] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy m'
[10:30:22.522] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy mi'
[10:30:22.729] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy mil'
[10:30:22.882] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[10:30:22.889] Alfred Workflow Todoist[Script Filter] {"items":[{"uid":"693e9af84d3dfcc71e640e005bdc5e2e","title":"CREATE: buy m","subtitle":"INBOX","icon":{"path":"icon.png"},"arg":"{\"content\":\"buy m\",\"priority\":1}","type":"default","valid":true}]}
[10:30:22.891] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy milk'
[10:30:23.334] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[10:30:23.343] Alfred Workflow Todoist[Script Filter] {"items":[{"uid":"693e9af84d3dfcc71e640e005bdc5e2e","title":"CREATE: buy mil","subtitle":"INBOX","icon":{"path":"icon.png"},"arg":"{\"content\":\"buy mil\",\"priority\":1}","type":"default","valid":true}]}
[10:30:23.817] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[10:30:23.830] Alfred Workflow Todoist[Script Filter] {"items":[{"uid":"693e9af84d3dfcc71e640e005bdc5e2e","title":"CREATE: buy milk","subtitle":"INBOX","icon":{"path":"icon.png"},"arg":"{\"content\":\"buy milk\",\"priority\":1}","type":"default","valid":true}]}

 

Link to comment
On 2/5/2020 at 4:32 PM, Curly Dubewe said:

Forgive me if this was covered before, but is anyone else having this problem? This seems like a cool workflow and I'd love it if this is an easy fix! MTIA


[10:30:16.781] Alfred Workflow Todoist[Script Filter] Queuing argument 'b'
[10:30:16.974] Alfred Workflow Todoist[Script Filter] Queuing argument 'bu'
[10:30:17.183] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy'
[10:30:17.295] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy '
[10:30:17.797] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[10:30:17.801] Alfred Workflow Todoist[Script Filter] {"items":[{"uid":"693e9af84d3dfcc71e640e005bdc5e2e","title":"CREATE: b","subtitle":"INBOX","icon":{"path":"icon.png"},"arg":"{\"content\":\"b\",\"priority\":1}","type":"default","valid":true}]}
[10:30:18.345] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[10:30:18.349] Alfred Workflow Todoist[Script Filter] {"items":[{"uid":"693e9af84d3dfcc71e640e005bdc5e2e","title":"CREATE: buy","subtitle":"INBOX","icon":{"path":"icon.png"},"arg":"{\"content\":\"buy\",\"priority\":1}","type":"default","valid":true}]}
[10:30:22.388] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy m'
[10:30:22.522] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy mi'
[10:30:22.729] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy mil'
[10:30:22.882] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[10:30:22.889] Alfred Workflow Todoist[Script Filter] {"items":[{"uid":"693e9af84d3dfcc71e640e005bdc5e2e","title":"CREATE: buy m","subtitle":"INBOX","icon":{"path":"icon.png"},"arg":"{\"content\":\"buy m\",\"priority\":1}","type":"default","valid":true}]}
[10:30:22.891] Alfred Workflow Todoist[Script Filter] Queuing argument 'buy milk'
[10:30:23.334] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[10:30:23.343] Alfred Workflow Todoist[Script Filter] {"items":[{"uid":"693e9af84d3dfcc71e640e005bdc5e2e","title":"CREATE: buy mil","subtitle":"INBOX","icon":{"path":"icon.png"},"arg":"{\"content\":\"buy mil\",\"priority\":1}","type":"default","valid":true}]}
[10:30:23.817] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[10:30:23.830] Alfred Workflow Todoist[Script Filter] {"items":[{"uid":"693e9af84d3dfcc71e640e005bdc5e2e","title":"CREATE: buy milk","subtitle":"INBOX","icon":{"path":"icon.png"},"arg":"{\"content\":\"buy milk\",\"priority\":1}","type":"default","valid":true}]}

 

 

Please describe what problem you are referring to. I don't see anything out of the ordinary.

 

Martien

Link to comment
  • 2 weeks later...

Hi! Every time I try to add a task, this is what I get as a message on the top right corner of the screen: "HTTPError: Response code 410 (Gone)"

Could y'all please help me telling what I should do in order to fix it?

Thx a lot.

 

Hold on >> Tried the update (alpha 9) and it seems that it worked - thx

Edited by Tassos Lycurgo
Link to comment
  • 2 months later...

Hello, 

 

unfortunately, the current beta (6.6.6-beta.1) always branches out to Google. Even the configuration does not work for me!

node.js is set in /user/local/bin and the link in /usr/local/bin as well as described!

 

What can I do here?

 

The debug output is more than confused:

 

[18:24:09.462] Alfred Workflow Todoist[Script Filter] Queuing argument ''
[18:24:09.674] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[18:24:09.679] ERROR: Alfred Workflow Todoist[Script Filter] Code 7: /Users/oliver/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.80EA2E24-94D4-4FAD-83F1-5DF74160855B/alfred-workflow-todoist.js:15
!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,a=1;a<n;++a)t[a]=t[a].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function a(e){return e.toUpperCase()}function o(e){var n=t("[0-9]","[A-Fa-f]"),a=r(r("%[EFef]"+n+"%"+n+n+"%"+n+n)+"|"+r("%[89A-Fa-f]"+n+"%"+n+n)+"|"+r("%"+n+n)),o="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",i=t("[\\:\\/\\?\\#\\[\\]\\@]",o),s=e?"[\\uE000-\\uF8FF]":"[]",u=t("[A-Za-z]","[0-9]","[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),c=(r("[A-Za-z]"+t("[A-Za-z]","[0-9]","[\\+\\-\\.]")+"*"),r(r(a+"|"+t(u,o,"[\\:]"))+"*"),r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("0?[1-9][0-9]")+"|0?0?[0-9]")),l=r(c+"\\."+c+"\\."+c+"\\."+c),d=r(n+"{1,4}"),h=r(r(d+"\\:"+d)+"|"+l),p=r(r(d+"\\:")+"{6}"+h),f=r("\\:\\:"+r(d+"\\:")+"{5}"+h),m=r(r(d)+"?\\:\\:"+r(d+"\\:")+"{4}"+h),v=r(r(r(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+r(d+"\\:")+"{3}"+h),y=r(r(r(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+r(d+"\\:")+"{2}"+h),g=r(r(r(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+h),b=r(r(r(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+h),w=r(r(r(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),E=r(r(r(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),P=r([p,f,m,v,y,g,b,w,E].join("|")),_=r(r(u+"|"+a)+"+"),S=(r("[vV]"+n+"+\\."+t(u,o,"[\\:]")+"+"),r(r(a+"|"+t(u,o))+"*"),r(a+"|"+t(u,o,"[\\:\\@]")));return r(r(a+"|"+t(u,o,"[\\@]"))+"+"),r(r(S+"|"+t("[\\/\\?]",s))+"*"),{NOT_SCHEME:new RegExp(t("[^]","[A-Za-z]","[0-9]","[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",u,o),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",u,o),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",u,o),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",u,o),"g"),NOT_QUERY:new RegExp(t("[^\\%]",u,o,"[\\:\\@\\/\\?]",s),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",u,o,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",u,o),"g"),UNRESERVED:new RegExp(u,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",u,i),"g"),PCT_ENCODED:new RegExp(a,"g"),IPV4ADDRESS:new RegExp("^("+l+")$"),IPV6ADDRESS:new RegExp("^\\[?("+P+")"+r(r("\\%25|\\%(?!"+n+"{2})")+"("+_+")")+"?\\]?$")}}var i=o(!1),s=o(!0),u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){a=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(a)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},c=2147483647,l=/^xn--/,d=/[^\0-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,m=String.fromCharCode;function v(e){throw new RangeError(p[e])}function y(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var a=function(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}((e=e.replace(h,".")).split("."),t).join(".");return n+a}function g(e){for(var t=[],r=0,n=e.length;r<n;){var a=e.charCodeAt(r++);if(a>=55296&&a<=56319&&r<n){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&a)<<10)+(1023&o)+65536):(t.push(a),r--)}else t.push(a)}return t}var b=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},w=function(e,t,r){var n=0;for(e=r?f(e/700):e>>1,e+=f(e/t);e>455;n+=36)e=f(e/35);return f(n+36*e/(e+38))},E=function(e){var t,r=[],n=e.length,a=0,o=128,i=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var u=0;u<s;++u)e.charCodeAt(u)>=128&&v("not-basic"),r.push(e.charCodeAt(u));for(var l=s>0?s+1:0;l<n;){for(var d=a,h=1,p=36;;p+=36){l>=n&&v("invalid-input");var m=(t=e.charCodeAt(l++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>f((c-a)/h))&&v("overflow"),a+=m*h;var y=p<=i?1:p>=i+26?26:p-i;if(m<y)break;var g=36-y;h>f(c/g)&&v("overflow"),h*=g}var b=r.length+1;i=w(a-d,b,0==d),f(a/b)>c-o&&v("overflow"),o+=f(a/b),a%=b,r.splice(a++,0,o)}return String.fromCodePoint.apply(String,r)},P=function(e){var t=[],r=(e=g(e)).length,n=128,a=0,o=72,i=!0,s=!1,u=void 0;try{for(var l,d=e[Symbol.iterator]();!(i=(l=d.next()).done);i=!0){var h=l.value;h<128&&t.push(m(h))}}catch(e){s=!0,u=e}finally{try{!i&&d.return&&d.return()}finally{if(s)throw u}}var p=t.length,y=p;for(p&&t.push("-");y<r;){var E=c,P=!0,_=!1,S=void 0;try{for(var k,x=e[Symbol.iterator]();!(P=(k=x.next()).done);P=!0){var j=k.value;j>=n&&j<E&&(E=j)}}catch(e){_=!0,S=e}finally{try{!P&&x.return&&x.return()}finally{if(_)throw S}}var O=y+1;E-n>f((c-a)/O)&&v("overflow"),a+=(E-n)*O,n=E;var T=!0,A=!1,M=void 0;try{for(var R,I=e[Symbol.iterator]();!(T=(R=I.next()).done);T=!0){var C=R.value;if(C<n&&++a>c&&v("overflow"),C==n){for(var N=a,D=36;;D+=36){var $=D<=o?1:D>=o+26?26:D-o;if(N<$)break;var F=N-$,z=36-$;t.push(m(b($+F%z,0))),N=f(F/z)}t.push(m(b(N,0))),o=w(a,O,y==p),a=0,++y}}}catch(e){A=!0,M=e}finally{try{!T&&I.return&&I.return()}finally{if(A)throw M}}++a,++n}return t.join("")},_=function(e){return y(e,(function(e){return d.test(e)?"xn--"+P(e):e}))},S=function(e){return y(e,(function(e){return l.test(e)?E(e.slice(4).toLowerCase()):e}))},k={};function x(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function j(e){for(var t="",r=0,n=e.length;r<n;){var a=parseInt(e.substr(r+1,2),16);if(a<128)t+=String.fromCharCode(a),r+=3;else if(a>=194&&a<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&a)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(a>=224){if(n-r>=9){var i=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&a)<<12|(63&i)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function O(e,t){function r(e){var r=j(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,x).replace(t.PCT_ENCODED,a)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,x).replace(t.PCT_ENCODED,a)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,x).replace(t.PCT_ENCODED,a)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,x).replace(t.PCT_ENCODED,a)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,x).replace(t.PCT_ENCODED,a)),e}function T(e){return e.replace(/^0*(.*)/,"$1")||"0"}function A(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=u(r,2)[1];return n?n.split(".").map(T).join("."):e}function M(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=u(r,3),a=n[1],o=n[2];if(a){for(var i=a.toLowerCase().split("::").reverse(),s=u(i,2),c=s[0],l=s[1],d=l?l.split(":").map(T):[],h=c.split(":").map(T),p=t.IPV4ADDRESS.test(h[h.length-1]),f=p?7:8,m=h.length-f,v=Array(f),y=0;y<f;++y)v[y]=d[y]||h[m+y]||"";p&&(v[f-1]=A(v[f-1],t));var g=v.reduce((function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],b=void 0;if(g&&g.length>1){var w=v.slice(0,g.index),E=v.slice(g.index+g.length);b=w.join(":")+"::"+E.join(":")}else b=v.join(":");return o&&(b+="%"+o),b}return e}var R=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,I=void 0==="".match(/(){0}/)[1];function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?s:i;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var a=e.match(R);if(a){I?(r.scheme=a[1],r.userinfo=a[3],r.host=a[4],r.port=parseInt(a[5],10),r.path=a[6]||"",r.query=a[7],r.fragment=a[8],isNaN(r.port)&&(r.port=a[5])):(r.scheme=a[1]||void 0,r.userinfo=-1!==e.indexOf("@")?a[3]:void 0,r.host=-1!==e.indexOf("//")?a[4]:void 0,r.port=parseInt(a[5],10),r.path=a[6]||"",r.query=-1!==e.indexOf("?")?a[7]:void 0,r.fragment=-1!==e.indexOf("#")?a[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?a[4]:void 0)),r.host&&(r.host=M(A(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=k[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)O(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=_(r.host.replace(n.PCT_ENCODED,j).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}O(r,i)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function N(e,t){var r=!1!==t.iri?s:i,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(M(A(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"==typeof e.port&&(n.push(":"),n.push(e.port.toString(10))),n.length?n.join(""):void 0}var D=/^\.\.?\//,$=/^\/\.(\/|$)/,F=/^\/\.\.(\/|$)/,z=/^\/?(?:.|\n)*?(?=\/|$)/;function W(e){for(var t=[];e.length;)if(e.match(D))e=e.replace(D,"");else if(e.match($))e=e.replace($,"/");else if(e.match(F))e=e.replace(F,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(z);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:i,n=[],a=k[(t.scheme||e.scheme||"").toLowerCase()];if(a&&a.serialize&&a.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||a&&a.domainHost)try{e.host=t.iri?S(e.host):_(e.host.replace(r.PCT_ENCODED,j).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}O(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=N(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var u=e.path;t.absolutePath||a&&a.absolutePath||(u=W(u)),void 0===o&&(u=u.replace(/^\/\//,"/%2F")),n.push(u)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function U(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],a={};return n||(e=C(L(e,r),r),t=C(L(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=W(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=W(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=W(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=W(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function H(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:i.PCT_ENCODED,j)}var q={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},B={scheme:"https",domainHost:q.domainHost,parse:q.parse,serialize:q.serialize},V={},G="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",X="[0-9A-Fa-f]",J=r(r("%[EFef][0-9A-Fa-f]%"+X+X+"%"+X+X)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+X+X)+"|"+r("%"+X+X)),Q=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Y=new RegExp(G,"g"),K=new RegExp(J,"g"),Z=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Q),"g"),ee=new RegExp(t("[^]",G,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),te=ee;function re(e){var t=j(e);return t.match(Y)?t:e}var ne={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var a=!1,o={},i=r.query.split("&"),s=0,u=i.length;s<u;++s){var c=i[s].split("=");switch(c[0]){case"to":for(var l=c[1].split(","),d=0,h=l.length;d<h;++d)n.push(l[d]);break;case"subject":r.subject=H(c[1],t);break;case"body":r.body=H(c[1],t);break;default:a=!0,o[H(c[0],t)]=H(c[1],t)}}a&&(r.headers=o)}r.query=void 0;for(var p=0,f=n.length;p<f;++p){var m=n[p].split("@");if(m[0]=H(m[0]),t.unicodeSupport)m[1]=H(m[1],t).toLowerCase();else try{m[1]=_(H(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[p]=m.join("@")}return r},serialize:function(e,t){var r,n=e,o=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(o){for(var i=0,s=o.length;i<s;++i){var u=String(o[i]),c=u.lastIndexOf("@"),l=u.slice(0,c).replace(K,re).replace(K,a).replace(Z,x),d=u.slice(c+1);try{d=t.iri?S(d):_(H(d,t).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}o[i]=l+"@"+d}n.path=o.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var p=[];for(var f in h)h[f]!==V[f]&&p.push(f.replace(K,re).replace(K,a).replace(ee,x)+"="+h[f].replace(K,re).replace(K,a).replace(te,x));return p.length&&(n.query=p.join("&")),n}},ae=/^([^\:]+)\:(.*)/,oe={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(ae),n=e;if(r){var a=t.scheme||n.scheme||"urn",o=r[1].toLowerCase(),i=r[2],s=a+":"+(t.nid||o),u=k[s];n.nid=o,n.nss=i,n.path=void 0,u&&(n=u.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,a=r+":"+(t.nid||n),o=k[a];o&&(e=o.serialize(e,t));var i=e,s=e.nss;return i.path=(n||t.nid)+":"+s,i}},ie=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,se={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ie)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};k[q.scheme]=q,k[B.scheme]=B,k[ne.scheme]=ne,k[oe.scheme]=oe,k[se.scheme]=se,e.SCHEMES=k,e.pctEncChar=x,e.pctDecChars=j,e.parse=C,e.removeDotSegments=W,e.serialize=L,e.resolveComponents=U,e.resolve=function(e,t,r){var n=function(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}({scheme:"null"},r);return L(U(C(e,n),C(t,n),n,!0),n)},e.normalize=function(e,t){return"string"==typeof e?e=L(C(e,t),t):"object"===n(e)&&(e=C(L(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=L(C(e,r),r):"object"===n(e)&&(e=L(e,r)),"string"==typeof t?t=L(C(t,r),r):"object"===n(t)&&(t=L(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?s.ESCAPE:i.ESCAPE,x)},e.unescapeComponent=H,Object.defineProperty(e,"__esModule",{value:!0})}(t)}));j(Ze);var et=Array.isArray,tt=Object.keys,rt=Object.prototype.hasOwnProperty,nt=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){var n,a,o,i=et(t),s=et(r);if(i&&s){if((a=t.length)!=r.length)return!1;for(n=a;0!=n--;)if(!e(t[n],r[n]))return!1;return!0}if(i!=s)return!1;var u=t instanceof Date,c=r instanceof Date;if(u!=c)return!1;if(u&&c)return t.getTime()==r.getTime();var l=t instanceof RegExp,d=r instanceof RegExp;if(l!=d)return!1;if(l&&d)return t.toString()==r.toString();var h=tt(t);if((a=h.length)!==tt(r).length)return!1;for(n=a;0!=n--;)if(!rt.call(r,h[n]))return!1;for(n=a;0!=n--;)if(!e(t[o=h[n]],r[o]))return!1;return!0}return t!=t&&r!=r},ot={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:it,checkDataTypes:function(e,t){switch(e.length){case 1:return it(e[0],t,!0);default:var r="",n=ut(e);for(var a in n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)r+=(r?" && ":"")+it(a,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],n=0;n<t.length;n++){var a=t[n];st[a]?r[r.length]=a:"array"===e&&"array"===a&&(r[r.length]=a)}if(r.length)return r}else{if(st[t])return[t];if("array"===e&&"array"===t)return["array"]}},toHash:ut,getProperty:dt,escapeQuotes:ht,equal:nt,ucs2length:function(e){for(var t,r=0,n=e.length,a=0;a<n;)r++,(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<n&&56320==(64512&(t=e.charCodeAt(a)))&&a++;return r},varOccurences:function(e,t){t+="[^0-9]";var r=e.match(new RegExp(t,"g"));return r?r.length:0},varReplace:function(e,t,r){return t+="([^0-9])",r=r.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),r+"$1")},cleanUpCode:function(e){return e.replace(pt,"").replace(ft,"").replace(mt,"if (!($1))")},finalCleanUpCode:function(e,t){var r=e.match(vt);r&&2==r.length&&(e=t?e.replace(gt,"").replace(bt,"return data;"):e.replace(yt,"").replace("return errors === 0;","validate.errors = null; return true;"));return(r=e.match(wt))&&3===r.length?e.replace(Et,""):e},schemaHasRules:function(e,t){if("boolean"==typeof e)return!e;for(var r in e)if(t[r])return!0},schemaHasRulesExcept:function(e,t,r){if("boolean"==typeof e)return!e&&"not"!=r;for(var n in e)if(n!=r&&t[n])return!0},schemaUnknownRules:function(e,t){if("boolean"==typeof e)return;for(var r in e)if(!t[r])return r},toQuotedString:Pt,getPathExpr:function(e,t,r,n){return kt(e,r?"'/' + "+t+(n?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):n?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")},getPath:function(e,t,r){var n=Pt(r?"/"+xt(t):dt(t));return kt(e,n)},getData:function(e,t,r){var n,a,o,i;if(""===e)return"rootData";if("/"==e[0]){if(!_t.test(e))throw new Error("Invalid JSON-pointer: "+e);a=e,o="rootData"}else{if(!(i=e.match(St)))throw new Error("Invalid JSON-pointer: "+e);if(n=+i[1],"#"==(a=i[2])){if(n>=t)throw new Error("Cannot access property/index "+n+" levels up, current level is "+t);return r[t-n]}if(n>t)throw new Error("Cannot access data "+n+" levels up, current level is "+t);if(o="data"+(t-n||""),!a)return o}for(var s=o,u=a.split("/"),c=0;c<u.length;c++){var l=u[c];l&&(o+=dt(jt(l)),s+=" && "+o)}return s},unescapeFragment:function(e){return jt(decodeURIComponent(e))},unescapeJsonPointer:jt,escapeFragment:function(e){return encodeURIComponent(xt(e))},escapeJsonPointer:xt};function it(e,t,r){var n=r?" !== ":" === ",a=r?" || ":" && ",o=r?"!":"",i=r?"":"!";switch(e){case"null":return t+n+"null";case"array":return o+"Array.isArray("+t+")";case"object":return"("+o+t+a+"typeof "+t+n+'"object"'+a+i+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+n+'"number"'+a+i+"("+t+" % 1)"+a+t+n+t+")";default:return"typeof "+t+n+'"'+e+'"'}}var st=ut(["string","number","integer","boolean","null"]);function ut(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!0;return t}var ct=/^[a-z$_][a-z$_0-9]*$/i,lt=/'|\\/g;function dt(e){return"number"==typeof e?"["+e+"]":ct.test(e)?"."+e:"['"+ht(e)+"']"}function ht(e){return e.replace(lt,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}var pt=/else\s*{\s*}/g,ft=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,mt=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g;var vt=/[^v.]errors/g,yt=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,gt=/var errors = 0;|var vErrors = null;/g,bt=/if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/,wt=/[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g,Et=/if \(rootData === undefined\) rootData = data;/;function Pt(e){return"'"+ht(e)+"'"}var _t=/^\/(?:[^~]|~0|~1)*$/,St=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function kt(e,t){return'""'==e?t:(e+" + "+t).replace(/' \+ '/g,"")}function xt(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function jt(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}var Ot=function(e){ot.copy(e,this)};var Tt=O((function(e){var t=e.exports=function(e,r,n){"function"==typeof r&&(n=r,r={}),function e(r,n,a,o,i,s,u,c,l,d){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var h in n(o,i,s,u,c,l,d),o){var p=o[h];if(Array.isArray(p)){if(h in t.arrayKeywords)for(var f=0;f<p.length;f++)e(r,n,a,p[f],i+"/"+h+"/"+f,s,i,h,o,f)}else if(h in t.propsKeywords){if(p&&"object"==typeof p)for(var m in p)e(r,n,a,p[m],i+"/"+h+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),s,i,h,o,m)}else(h in t.keywords||r.allKeys&&!(h in t.skipKeywords))&&e(r,n,a,p,i+"/"+h,s,i,h,o)}a(o,i,s,u,c,l,d)}}(r,"function"==typeof(n=r.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}})),At=Mt;function Mt(e,t,r){var n=this._refs[r];if("string"==typeof n){if(!this._refs[n])return Mt.call(this,e,t,n);n=this._refs[n]}if((n=n||this._schemas[r])instanceof Ot)return $t(n.schema,this._opts.inlineRefs)?n.schema:n.validate||this._compile(n);var a,o,i,s=Rt.call(this,t,r);return s&&(a=s.schema,t=s.root,i=s.baseId),a instanceof Ot?o=a.validate||e.call(this,a.schema,t,void 0,i):void 0!==a&&(o=$t(a,this._opts.inlineRefs)?a:e.call(this,a,t,void 0,i)),o}function Rt(e,t){var r=Ze.parse(t),n=zt(r),a=Ft(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==a){var o=Lt(n),i=this._refs[o];if("string"==typeof i)return It.call(this,e,i,r);if(i instanceof Ot)i.validate||this._compile(i),e=i;else{if(!((i=this._schemas[o])instanceof Ot))return;if(i.validate||this._compile(i),o==Lt(t))return{schema:i,root:e,baseId:a};e=i}if(!e.schema)return;a=Ft(this._getId(e.schema))}return Nt.call(this,r,a,e.schema,e)}function It(e,t,r){var n=Rt.call(this,e,t);if(n){var a=n.schema,o=n.baseId;e=n.root;var i=this._getId(a);return i&&(o=Ut(o,i)),Nt.call(this,r,o,a,e)}}Mt.normalizeId=Lt,Mt.fullPath=Ft,Mt.url=Ut,Mt.ids=function(e){var t=Lt(this._getId(e)),r={"":t},n={"":Ft(t,!1)},a={},o=this;return Tt(e,{allKeys:!0},(function(e,t,i,s,u,c,l){if(""!==t){var d=o._getId(e),h=r[s],p=n[s]+"/"+u;if(void 0!==l&&(p+="/"+("number"==typeof l?l:ot.escapeFragment(l))),"string"==typeof d){d=h=Lt(h?Ze.resolve(h,d):d);var f=o._refs[d];if("string"==typeof f&&(f=o._refs[f]),f&&f.schema){if(!nt(e,f.schema))throw new Error('id "'+d+'" resolves to more than one schema')}else if(d!=Lt(p))if("#"==d[0]){if(a[d]&&!nt(e,a[d]))throw new Error('id "'+d+'" resolves to more than one schema');a[d]=e}else o._refs[d]=p}r[t]=h,n[t]=p}})),a},Mt.inlineRef=$t,Mt.schema=Rt;var Ct=ot.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function Nt(e,t,r,n){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var a=e.fragment.split("/"),o=1;o<a.length;o++){var i=a[o];if(i){if(void 0===(r=r[i=ot.unescapeFragment(i)]))break;var s;if(!Ct[i]&&((s=this._getId(r))&&(t=Ut(t,s)),r.$ref)){var u=Ut(t,r.$ref),c=Rt.call(this,n,u);c&&(r=c.schema,n=c.root,t=c.baseId)}}}return void 0!==r&&r!==n.schema?{schema:r,root:n,baseId:t}:void 0}}var Dt=ot.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function $t(e,t){return!1!==t&&(void 0===t||!0===t?function e(t){var r;if(Array.isArray(t)){for(var n=0;n<t.length;n++)if("object"==typeof(r=t[n])&&!e(r))return!1}else for(var a in t){if("$ref"==a)return!1;if("object"==typeof(r=t[a])&&!e(r))return!1}return!0}(e):t?function e(t){var r,n=0;if(Array.isArray(t)){for(var a=0;a<t.length;a++)if("object"==typeof(r=t[a])&&(n+=e(r)),n==1/0)return 1/0}else for(var o in t){if("$ref"==o)return 1/0;if(Dt[o])n++;else if("object"==typeof(r=t[o])&&(n+=e(r)+1),n==1/0)return 1/0}return n}(e)<=t:void 0)}function Ft(e,t){return!1!==t&&(e=Lt(e)),zt(Ze.parse(e))}function zt(e){return Ze.serialize(e).split("#")[0]+"#"}var Wt=/#\/?$/;function Lt(e){return e?e.replace(Wt,""):""}function Ut(e,t){return t=Lt(t),Ze.resolve(e,t)}var Ht={Validation:Bt((function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0})),MissingRef:Bt(qt)};function qt(e,t,r){this.message=r||qt.message(e,t),this.missingRef=At.url(e,t),this.missingSchema=At.normalizeId(At.fullPath(this.missingRef))}function Bt(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}qt.message=function(e,t){return"can't resolve reference "+t+" from id "+e};var Vt=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,a=t.cmp&&(r=t.cmp,function(e){return function(t,n){var a={key:t,value:e[t]},o={key:n,value:e[n]};return r(a,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,i;if(Array.isArray(t)){for(i="[",r=0;r<t.length;r++)r&&(i+=","),i+=e(t[r])||"null";return i+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(t)-1,u=Object.keys(t).sort(a&&a(t));for(i="",r=0;r<u.length;r++){var c=u[r],l=e(t[c]);l&&(i&&(i+=","),i+=JSON.stringify(c)+":"+l)}return o.splice(s,1),"{"+i+"}"}}(e)},Gt=function(e,t,r){var n="",a=!0===e.schema.$async,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),i=e.self._getId(e.schema);if(e.opts.strictKeywords){var s=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(s){var u="unknown keyword: "+s;if("log"!==e.opts.strictKeywords)throw new Error(u);e.logger.warn(u)}}if(e.isTop&&(n+=" var validate = ",a&&(e.async=!0,n+="async "),n+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",i&&(e.opts.sourceCode||e.opts.processCode)&&(n+=" /*# sourceURL="+i+" */ ")),"boolean"==typeof e.schema||!o&&!e.schema.$ref){var c=e.level,l=e.dataLevel,d=e.schema["false schema"],h=e.schemaPath+e.util.getProperty("false schema"),p=e.errSchemaPath+"/false schema",f=!e.opts.allErrors,m="data"+(l||""),v="valid"+c;if(!1===e.schema){e.isTop?f=!0:n+=" var "+v+" = false; ",(Y=Y||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'boolean schema is false' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";var y=n;n=Y.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?n+=a?" return data; ":" validate.errors = null; return true; ":n+=" var "+v+" = true; ";return e.isTop&&(n+=" }; return validate; "),n}if(e.isTop){var g=e.isTop;c=e.level=0,l=e.dataLevel=0,m="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[void 0],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var b="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(b);e.logger.warn(b)}n+=" var vErrors = null; ",n+=" var errors = 0;     ",n+=" if (rootData === undefined) rootData = data; "}else{c=e.level,m="data"+((l=e.dataLevel)||"");if(i&&(e.baseId=e.resolve.url(e.baseId,i)),a&&!e.async)throw new Error("async schema in sync schema");n+=" var errs_"+c+" = errors;"}v="valid"+c,f=!e.opts.allErrors;var w="",E="",P=e.schema.type,_=Array.isArray(P);if(P&&e.opts.nullable&&!0===e.schema.nullable&&(_?-1==P.indexOf("null")&&(P=P.concat("null")):"null"!=P&&(P=[P,"null"],_=!0)),_&&1==P.length&&(P=P[0],_=!1),e.schema.$ref&&o){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(o=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(n+=" "+e.RULES.all.$comment.code(e,"$comment")),P){if(e.opts.coerceTypes)var S=e.util.coerceToTypes(e.opts.coerceTypes,P);var k=e.RULES.types[P];if(S||_||!0===k||k&&!K(k)){h=e.schemaPath+".type",p=e.errSchemaPath+"/type",h=e.schemaPath+".type",p=e.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(n+=" if ("+e.util[x](P,m,!0)+") { ",S){var j="dataType"+c,O="coerced"+c;n+=" var "+j+" = typeof "+m+"; ","array"==e.opts.coerceTypes&&(n+=" if ("+j+" == 'object' && Array.isArray("+m+")) "+j+" = 'array'; "),n+=" var "+O+" = undefined; ";var T="",A=S;if(A)for(var M,R=-1,I=A.length-1;R<I;)M=A[R+=1],R&&(n+=" if ("+O+" === undefined) { ",T+="}"),"array"==e.opts.coerceTypes&&"array"!=M&&(n+=" if ("+j+" == 'array' && "+m+".length == 1) { "+O+" = "+m+" = "+m+"[0]; "+j+" = typeof "+m+";  } "),"string"==M?n+=" if ("+j+" == 'number' || "+j+" == 'boolean') "+O+" = '' + "+m+"; else if ("+m+" === null) "+O+" = ''; ":"number"==M||"integer"==M?(n+=" if ("+j+" == 'boolean' || "+m+" === null || ("+j+" == 'string' && "+m+" && "+m+" == +"+m+" ","integer"==M&&(n+=" && !("+m+" % 1)"),n+=")) "+O+" = +"+m+"; "):"boolean"==M?n+=" if ("+m+" === 'false' || "+m+" === 0 || "+m+" === null) "+O+" = false; else if ("+m+" === 'true' || "+m+" === 1) "+O+" = true; ":"null"==M?n+=" if ("+m+" === '' || "+m+" === 0 || "+m+" === false) "+O+" = null; ":"array"==e.opts.coerceTypes&&"array"==M&&(n+=" if ("+j+" == 'string' || "+j+" == 'number' || "+j+" == 'boolean' || "+m+" == null) "+O+" = ["+m+"]; ");n+=" "+T+" if ("+O+" === undefined) {   ",(Y=Y||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",n+=_?""+P.join(","):""+P,n+="' } ",!1!==e.opts.messages&&(n+=" , message: 'should be ",n+=_?""+P.join(","):""+P,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";y=n;n=Y.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else {  ";var C=l?"data"+(l-1||""):"parentData";n+=" "+m+" = "+O+"; ",l||(n+="if ("+C+" !== undefined)"),n+=" "+C+"["+(l?e.dataPathArr[l]:"parentDataProperty")+"] = "+O+"; } "}else{(Y=Y||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",n+=_?""+P.join(","):""+P,n+="' } ",!1!==e.opts.messages&&(n+=" , message: 'should be ",n+=_?""+P.join(","):""+P,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";y=n;n=Y.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}n+=" } "}}if(e.schema.$ref&&!o)n+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",f&&(n+=" } if (errors === ",n+=g?"0":"errs_"+c,n+=") { ",E+="}");else{var N=e.RULES;if(N)for(var D=-1,$=N.length-1;D<$;)if(K(k=N[D+=1])){if(k.type&&(n+=" if ("+e.util.checkDataType(k.type,m)+") { "),e.opts.useDefaults)if("object"==k.type&&e.schema.properties){d=e.schema.properties;var F=Object.keys(d);if(F)for(var z,W=-1,L=F.length-1;W<L;){if(void 0!==(q=d[z=F[W+=1]]).default){var U=m+e.util.getProperty(z);if(e.compositeRule){if(e.opts.strictDefaults){b="default is ignored for: "+U;if("log"!==e.opts.strictDefaults)throw new Error(b);e.logger.warn(b)}}else n+=" if ("+U+" === undefined ","empty"==e.opts.useDefaults&&(n+=" || "+U+" === null || "+U+" === '' "),n+=" ) "+U+" = ","shared"==e.opts.useDefaults?n+=" "+e.useDefault(q.default)+" ":n+=" "+JSON.stringify(q.default)+" ",n+="; "}}}else if("array"==k.type&&Array.isArray(e.schema.items)){var H=e.schema.items;if(H){R=-1;for(var q,B=H.length-1;R<B;)if(void 0!==(q=H[R+=1]).default){U=m+"["+R+"]";if(e.compositeRule){if(e.opts.strictDefaults){b="default is ignored for: "+U;if("log"!==e.opts.strictDefaults)throw new Error(b);e.logger.warn(b)}}else n+=" if ("+U+" === undefined ","empty"==e.opts.useDefaults&&(n+=" || "+U+" === null || "+U+" === '' "),n+=" ) "+U+" = ","shared"==e.opts.useDefaults?n+=" "+e.useDefault(q.default)+" ":n+=" "+JSON.stringify(q.default)+" ",n+="; "}}}var V=k.rules;if(V)for(var G,X=-1,J=V.length-1;X<J;)if(Z(G=V[X+=1])){var Q=G.code(e,G.keyword,k.type);Q&&(n+=" "+Q+" ",f&&(w+="}"))}if(f&&(n+=" "+w+" ",w=""),k.type&&(n+=" } ",P&&P===k.type&&!S)){n+=" else { ";var Y;h=e.schemaPath+".type",p=e.errSchemaPath+"/type";(Y=Y||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { type: '",n+=_?""+P.join(","):""+P,n+="' } ",!1!==e.opts.messages&&(n+=" , message: 'should be ",n+=_?""+P.join(","):""+P,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";y=n;n=Y.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } "}f&&(n+=" if (errors === ",n+=g?"0":"errs_"+c,n+=") { ",E+="}")}}function K(e){for(var t=e.rules,r=0;r<t.length;r++)if(Z(t[r]))return!0}function Z(t){return void 0!==e.schema[t.keyword]||t.implements&&function(t){for(var r=t.implements,n=0;n<r.length;n++)if(void 0!==e.schema[r[n]])return!0}(t)}return f&&(n+=" "+E+" "),g?(a?(n+=" if (errors === 0) return data;           ",n+=" else throw new ValidationError(vErrors); "):(n+=" validate.errors = vErrors; ",n+=" return errors === 0;       "),n+=" }; return validate;"):n+=" var "+v+" = errors === errs_"+c+";",n=e.util.cleanUpCode(n),g&&(n=e.util.finalCleanUpCode(n,a)),n},Xt=ot.ucs2length,Jt=Ht.Validation,Qt=function e(t,r,n,a){var o=this,i=this._opts,s=[void 0],u={},c=[],l={},d=[],h={},p=[];r=r||{schema:t,refVal:s,refs:u};var f=Yt.call(this,t,r,a),m=this._compilations[f.index];if(f.compiling)return m.callValidate=function e(){var t=m.validate,r=t.apply(this,arguments);return e.errors=t.errors,r};var v=this._formats,y=this.RULES;try{var g=w(t,r,n,a);m.validate=g;var b=m.callValidate;return b&&(b.schema=g.schema,b.errors=null,b.refs=g.refs,b.refVal=g.refVal,b.root=g.root,b.$async=g.$async,i.sourceCode&&(b.source=g.source)),g}finally{Kt.call(this,t,r,a)}function w(t,n,a,l){var h=!n||n&&n.schema==t;if(n.schema!=r.schema)return e.call(o,t,n,a,l);var f,m=!0===t.$async,g=Gt({isTop:!0,schema:t,isRoot:h,baseId:l,root:n,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:Ht.MissingRef,RULES:y,validate:Gt,util:ot,resolve:At,resolveRef:E,usePattern:S,useDefault:k,useCustomRule:x,opts:i,formats:v,logger:o.logger,self:o});g=ar(s,rr)+ar(c,er)+ar(d,tr)+ar(p,nr)+g,i.processCode&&(g=i.processCode(g));try{f=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",g)(o,y,v,r,s,d,p,nt,Xt,Jt),s[0]=f}catch(e){throw o.logger.error("Error compiling schema, function code:",g),e}return f.schema=t,f.errors=null,f.refs=u,f.refVal=s,f.root=h?f:n,m&&(f.$async=!0),!0===i.sourceCode&&(f.source={code:g,patterns:c,defaults:d}),f}function E(t,a,c){a=At.url(t,a);var l,d,h=u[a];if(void 0!==h)return _(l=s[h],d="refVal["+h+"]");if(!c&&r.refs){var p=r.refs[a];if(void 0!==p)return _(l=r.refVal[p],d=P(a,l))}d=P(a);var f=At.call(o,w,r,a);if(void 0===f){var m=n&&n[a];m&&(f=At.inlineRef(m,i.inlineRefs)?m:e.call(o,m,r,n,t))}if(void 0!==f)return function(e,t){var r=u[e];s[r]=t}(a,f),_(f,d);!function(e){delete u[e]}(a)}function P(e,t){var r=s.length;return s[r]=t,u[e]=r,"refVal"+r}function _(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function S(e){var t=l[e];return void 0===t&&(t=l[e]=c.length,c[t]=e),"pattern"+t}function k(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return ot.toQuotedString(e);case"object":if(null===e)return"null";var t=Vt(e),r=h[t];return void 0===r&&(r=h[t]=d.length,d[r]=e),"default"+r}}function x(e,t,r,n){if(!1!==o._opts.validateSchema){var a=e.definition.dependencies;if(a&&!a.every((function(e){return Object.prototype.hasOwnProperty.call(r,e)})))throw new Error("parent schema must have all required keywords: "+a.join(","));var s=e.definition.validateSchema;if(s)if(!s(t)){var u="keyword schema is invalid: "+o.errorsText(s.errors);if("log"!=o._opts.validateSchema)throw new Error(u);o.logger.error(u)}}var c,l=e.definition.compile,d=e.definition.inline,h=e.definition.macro;if(l)c=l.call(o,t,r,n);else if(h)c=h.call(o,t,r,n),!1!==i.validateSchema&&o.validateSchema(c,!0);else if(d)c=d.call(o,n,e.keyword,t,r);else if(!(c=e.definition.validate))return;if(void 0===c)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var f=p.length;return p[f]=c,{code:"customRule"+f,validate:c}}};function Yt(e,t,r){var n=Zt.call(this,e,t,r);return n>=0?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:e,root:t,baseId:r},{index:n,compiling:!1})}function Kt(e,t,r){var n=Zt.call(this,e,t,r);n>=0&&this._compilations.splice(n,1)}function Zt(e,t,r){for(var n=0;n<this._compilations.length;n++){var a=this._compilations[n];if(a.schema==e&&a.root==t&&a.baseId==r)return n}return-1}function er(e,t){return"var pattern"+e+" = new RegExp("+ot.toQuotedString(t[e])+");"}function tr(e){return"var default"+e+" = defaults["+e+"];"}function rr(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function nr(e){return"var customRule"+e+" = customRules["+e+"];"}function ar(e,t){if(!e.length)return"";for(var r="",n=0;n<e.length;n++)r+=t(n,e);return r}var or=O((function(e){var t=e.exports=function(){this._cache={}};t.prototype.put=function(e,t){this._cache[e]=t},t.prototype.get=function(e){return this._cache[e]},t.prototype.del=function(e){delete this._cache[e]},t.prototype.clear=function(){this._cache={}}})),ir=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,sr=[0,31,28,31,30,31,30,31,31,30,31,30,31],ur=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i,cr=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,lr=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,dr=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,hr=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,pr=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,fr=/^(?:\/(?:[^~/]|~0|~1)*)*$/,mr=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,vr=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,yr=gr;function gr(e){return e="full"==e?"full":"fast",ot.copy(gr[e])}function br(e){var t=e.match(ir);if(!t)return!1;var r=+t[1],n=+t[2],a=+t[3];return n>=1&&n<=12&&a>=1&&a<=(2==n&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:sr[n])}function wr(e,t){var r=e.match(ur);if(!r)return!1;var n=r[1],a=r[2],o=r[3],i=r[5];return(n<=23&&a<=59&&o<=59||23==n&&59==a&&60==o)&&(!t||i)}gr.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":dr,url:hr,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:cr,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:Sr,uuid:pr,"json-pointer":fr,"json-pointer-uri-fragment":mr,"relative-json-pointer":vr},gr.full={date:br,time:wr,"date-time":function(e){var t=e.split(Er);return 2==t.length&&br(t[0])&&wr(t[1],!0)},uri:function(e){return Pr.test(e)&&lr.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":dr,url:hr,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&cr.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:Sr,uuid:pr,"json-pointer":fr,"json-pointer-uri-fragment":mr,"relative-json-pointer":vr};var Er=/t|\s/i;var Pr=/\/|:/;var _r=/[^\\]\\Z/;function Sr(e){if(_r.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}var kr=function(e,t,r){var n,a=" ",o=e.level,i=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),h=e.opts.$data&&s&&s.$data;h?(a+=" var schema"+o+" = "+e.util.getData(s.$data,i,e.dataPathArr)+"; ",n="schema"+o):n=s;var p="maximum"==t,f=p?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[f],v=e.opts.$data&&m&&m.$data,y=p?"<":">",g=p?">":"<",b=void 0;if(v){var w=e.util.getData(m.$data,i,e.dataPathArr),E="exclusive"+o,P="exclType"+o,_="exclIsNumber"+o,S="' + "+(j="op"+o)+" + '";a+=" var schemaExcl"+o+" = "+w+"; ",a+=" var "+E+"; var "+P+" = typeof "+(w="schemaExcl"+o)+"; if ("+P+" != 'boolean' && "+P+" != 'undefined' && "+P+" != 'number') { ";var k;b=f;(k=k||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(a+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var x=a;a=k.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else if ( ",h&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),a+=" "+P+" == 'number' ? ( ("+E+" = "+n+" === undefined || "+w+" "+y+"= "+n+") ? "+d+" "+g+"= "+w+" : "+d+" "+g+" "+n+" ) : ( ("+E+" = "+w+" === true) ? "+d+" "+g+"= "+n+" : "+d+" "+g+" "+n+" ) || "+d+" !== "+d+") { var op"+o+" = "+E+" ? '"+y+"' : '"+y+"='; ",void 0===s&&(b=f,c=e.errSchemaPath+"/"+f,n=w,h=v)}else{S=y;if((_="number"==typeof m)&&h){var j="'"+S+"'";a+=" if ( ",h&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),a+=" ( "+n+" === undefined || "+m+" "+y+"= "+n+" ? "+d+" "+g+"= "+m+" : "+d+" "+g+" "+n+" ) || "+d+" !== "+d+") { "}else{_&&void 0===s?(E=!0,b=f,c=e.errSchemaPath+"/"+f,n=m,g+="="):(_&&(n=Math[p?"min":"max"](m,s)),m===(!_||n)?(E=!0,b=f,c=e.errSchemaPath+"/"+f,g+="="):(E=!1,S+="="));j="'"+S+"'";a+=" if ( ",h&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),a+=" "+d+" "+g+" "+n+" || "+d+" !== "+d+") { "}}b=b||t,(k=k||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+j+", limit: "+n+", exclusive: "+E+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be "+S+" ",a+=h?"' + "+n:n+"'"),e.opts.verbose&&(a+=" , schema:  ",a+=h?"validate.schema"+u:""+s,a+="         , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";x=a;return a=k.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l&&(a+=" else { "),a},xr=function(e,t,r){var n,a=" ",o=e.level,i=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),h=e.opts.$data&&s&&s.$data;h?(a+=" var schema"+o+" = "+e.util.getData(s.$data,i,e.dataPathArr)+"; ",n="schema"+o):n=s,a+="if ( ",h&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),a+=" "+d+".length "+("maxItems"==t?">":"<")+" "+n+") { ";var p=t,f=f||[];f.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxItems"==t?"more":"fewer",a+=" than ",a+=h?"' + "+n+" + '":""+s,a+=" items' "),e.opts.verbose&&(a+=" , schema:  ",a+=h?"validate.schema"+u:""+s,a+="         , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var m=a;return a=f.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",l&&(a+=" else { "),a},jr=function(e,t,r){var n,a=" ",o=e.level,i=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),h=e.opts.$data&&s&&s.$data;h?(a+=" var schema"+o+" = "+e.util.getData(s.$data,i,e.dataPathArr)+"; ",n="schema"+o):n=s;var p="maxLength"==t?">":"<";a+="if ( ",h&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),!1===e.opts.unicode?a+=" "+d+".length ":a+=" ucs2length("+d+") ",a+=" "+p+" "+n+") { ";var f=t,m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(f||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be ",a+="maxLength"==t?"longer":"shorter",a+=" than ",a+=h?"' + "+n+" + '":""+s,a+=" characters' "),e.opts.verbose&&(a+=" , schema:  ",a+=h?"validate.schema"+u:""+s,a+="         , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var v=a;return a=m.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",l&&(a+=" else { "),a},Or=function(e,t,r){var n,a=" ",o=e.level,i=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),h=e.opts.$data&&s&&s.$data;h?(a+=" var schema"+o+" = "+e.util.getData(s.$data,i,e.dataPathArr)+"; ",n="schema"+o):n=s,a+="if ( ",h&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),a+=" Object.keys("+d+").length "+("maxProperties"==t?">":"<")+" "+n+") { ";var p=t,f=f||[];f.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have ",a+="maxProperties"==t?"more":"fewer",a+=" than ",a+=h?"' + "+n+" + '":""+s,a+=" properties' "),e.opts.verbose&&(a+=" , schema:  ",a+=h?"validate.schema"+u:""+s,a+="         , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var m=a;return a=f.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",l&&(a+=" else { "),a},Tr={$ref:function(e,t,r){var n,a,o=" ",i=e.level,s=e.dataLevel,u=e.schema[t],c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(s||""),h="valid"+i;if("#"==u||"#/"==u)e.isRoot?(n=e.async,a="validate"):(n=!0===e.root.schema.$async,a="root.refVal[0]");else{var p=e.resolveRef(e.baseId,u,e.isRoot);if(void 0===p){var f=e.MissingRefError.message(e.baseId,u);if("fail"==e.opts.missingRefs){e.logger.error(f),(g=g||[]).push(o),o="",!1!==e.createErrors?(o+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(u)+"' } ",!1!==e.opts.messages&&(o+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(u)+"' "),e.opts.verbose&&(o+=" , schema: "+e.util.toQuotedString(u)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var m=o;o=g.pop(),!e.compositeRule&&l?e.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(o+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,u,f);e.logger.warn(f),l&&(o+=" if (true) { ")}}else if(p.inline){var v=e.util.copy(e);v.level++;var y="valid"+v.level;v.schema=p.schema,v.schemaPath="",v.errSchemaPath=u,o+=" "+e.validate(v).replace(/validate\.schema/g,p.code)+" ",l&&(o+=" if ("+y+") { ")}else n=!0===p.$async||e.async&&!1!==p.$async,a=p.code}if(a){var g;(g=g||[]).push(o),o="",e.opts.passContext?o+=" "+a+".call(this, ":o+=" "+a+"( ",o+=" "+d+", (dataPath || '')",'""'!=e.errorPath&&(o+=" + "+e.errorPath);var b=o+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData)  ";if(o=g.pop(),n){if(!e.async)throw new Error("async schema referenced by sync schema");l&&(o+=" var "+h+"; "),o+=" try { await "+b+"; ",l&&(o+=" "+h+" = true; "),o+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",l&&(o+=" "+h+" = false; "),o+=" } ",l&&(o+=" if ("+h+") { ")}else o+=" if (!"+b+") { if (vErrors === null) vErrors = "+a+".errors; else vErrors = vErrors.concat("+a+".errors); errors = vErrors.length; } ",l&&(o+=" else { ")}return o},allOf:function(e,t,r){var n=" ",a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),i=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,u=e.util.copy(e),c="";u.level++;var l="valid"+u.level,d=u.baseId,h=!0,p=a;if(p)for(var f,m=-1,v=p.length-1;m<v;)f=p[m+=1],(e.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0:e.util.schemaHasRules(f,e.RULES.all))&&(h=!1,u.schema=f,u.schemaPath=o+"["+m+"]",u.errSchemaPath=i+"/"+m,n+="  "+e.validate(u)+" ",u.baseId=d,s&&(n+=" if ("+l+") { ",c+="}"));return s&&(n+=h?" if (true) { ":" "+c.slice(0,-1)+" "),n=e.util.cleanUpCode(n)},anyOf:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="valid"+a,h="errs__"+a,p=e.util.copy(e),f="";p.level++;var m="valid"+p.level;if(i.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var v=p.baseId;n+=" var "+h+" = errors; var "+d+" = false;  ";var y=e.compositeRule;e.compositeRule=p.compositeRule=!0;var g=i;if(g)for(var b,w=-1,E=g.length-1;w<E;)b=g[w+=1],p.schema=b,p.schemaPath=s+"["+w+"]",p.errSchemaPath=u+"/"+w,n+="  "+e.validate(p)+" ",p.baseId=v,n+=" "+d+" = "+d+" || "+m+"; if (!"+d+") { ",f+="}";e.compositeRule=p.compositeRule=y,n+=" "+f+" if (!"+d+") {   var err =   ",!1!==e.createErrors?(n+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } else {  errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } "),n=e.util.cleanUpCode(n)}else c&&(n+=" if (true) { ");return n},$comment:function(e,t,r){var n=" ",a=e.schema[t],o=e.errSchemaPath+"/"+t,i=(e.opts.allErrors,e.util.toQuotedString(a));return!0===e.opts.$comment?n+=" console.log("+i+");":"function"==typeof e.opts.$comment&&(n+=" self._opts.$comment("+i+", "+e.util.toQuotedString(o)+", validate.root.schema);"),n},const:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="valid"+a,h=e.opts.$data&&i&&i.$data;h&&(n+=" var schema"+a+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; "),h||(n+=" var schema"+a+" = validate.schema"+s+";"),n+="var "+d+" = equal("+l+", schema"+a+"); if (!"+d+") {   ";var p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValue: schema"+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to constant' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var f=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+f+"]); ":n+=" validate.errors = ["+f+"]; return false; ":n+=" var err = "+f+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",c&&(n+=" else { "),n},contains:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="valid"+a,h="errs__"+a,p=e.util.copy(e);p.level++;var f="valid"+p.level,m="i"+a,v=p.dataLevel=e.dataLevel+1,y="data"+v,g=e.baseId,b=e.opts.strictKeywords?"object"==typeof i&&Object.keys(i).length>0:e.util.schemaHasRules(i,e.RULES.all);if(n+="var "+h+" = errors;var "+d+";",b){var w=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=i,p.schemaPath=s,p.errSchemaPath=u,n+=" var "+f+" = false; for (var "+m+" = 0; "+m+" < "+l+".length; "+m+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var E=l+"["+m+"]";p.dataPathArr[v]=m;var P=e.validate(p);p.baseId=g,e.util.varOccurences(P,y)<2?n+=" "+e.util.varReplace(P,y,E)+" ":n+=" var "+y+" = "+E+"; "+P+" ",n+=" if ("+f+") break; }  ",e.compositeRule=p.compositeRule=w,n+="  if (!"+f+") {"}else n+=" if ("+l+".length == 0) {";var _=_||[];_.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should contain a valid item' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var S=n;return n=_.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+S+"]); ":n+=" validate.errors = ["+S+"]; return false; ":n+=" var err = "+S+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",b&&(n+="  errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(n+=" } "),n=e.util.cleanUpCode(n)},dependencies:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="errs__"+a,h=e.util.copy(e),p="";h.level++;var f="valid"+h.level,m={},v={},y=e.opts.ownProperties;for(E in i){var g=i[E],b=Array.isArray(g)?v:m;b[E]=g}n+="var "+d+" = errors;";var w=e.errorPath;for(var E in n+="var missing"+a+";",v)if((b=v[E]).length){if(n+=" if ( "+l+e.util.getProperty(E)+" !== undefined ",y&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(E)+"') "),c){n+=" && ( ";var P=b;if(P)for(var _=-1,S=P.length-1;_<S;){A=P[_+=1],_&&(n+=" || "),n+=" ( ( "+(C=l+(I=e.util.getProperty(A)))+" === undefined ",y&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(A)+"') "),n+=") && (missing"+a+" = "+e.util.toQuotedString(e.opts.jsonPointers?A:I)+") ) "}n+=")) {  ";var k="missing"+a,x="' + "+k+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,k,!0):w+" + "+k);var j=j||[];j.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(E)+"', missingProperty: '"+x+"', depsCount: "+b.length+", deps: '"+e.util.escapeQuotes(1==b.length?b[0]:b.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==b.length?n+="property "+e.util.escapeQuotes(b[0]):n+="properties "+e.util.escapeQuotes(b.join(", ")),n+=" when property "+e.util.escapeQuotes(E)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var O=n;n=j.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+O+"]); ":n+=" validate.errors = ["+O+"]; return false; ":n+=" var err = "+O+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{n+=" ) { ";var T=b;if(T)for(var A,M=-1,R=T.length-1;M<R;){A=T[M+=1];var I=e.util.getProperty(A),C=(x=e.util.escapeQuotes(A),l+I);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,A,e.opts.jsonPointers)),n+=" if ( "+C+" === undefined ",y&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(A)+"') "),n+=") {  var err =   ",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(E)+"', missingProperty: '"+x+"', depsCount: "+b.length+", deps: '"+e.util.escapeQuotes(1==b.length?b[0]:b.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==b.length?n+="property "+e.util.escapeQuotes(b[0]):n+="properties "+e.util.escapeQuotes(b.join(", ")),n+=" when property "+e.util.escapeQuotes(E)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}n+=" }   ",c&&(p+="}",n+=" else { ")}e.errorPath=w;var N=h.baseId;for(var E in m){g=m[E];(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0:e.util.schemaHasRules(g,e.RULES.all))&&(n+=" "+f+" = true; if ( "+l+e.util.getProperty(E)+" !== undefined ",y&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(E)+"') "),n+=") { ",h.schema=g,h.schemaPath=s+e.util.getProperty(E),h.errSchemaPath=u+"/"+e.util.escapeFragment(E),n+="  "+e.validate(h)+" ",h.baseId=N,n+=" }  ",c&&(n+=" if ("+f+") { ",p+="}"))}return c&&(n+="   "+p+" if ("+d+" == errors) {"),n=e.util.cleanUpCode(n)},enum:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="valid"+a,h=e.opts.$data&&i&&i.$data;h&&(n+=" var schema"+a+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ");var p="i"+a,f="schema"+a;h||(n+=" var "+f+" = validate.schema"+s+";"),n+="var "+d+";",h&&(n+=" if (schema"+a+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+a+")) "+d+" = false; else {"),n+=d+" = false;for (var "+p+"=0; "+p+"<"+f+".length; "+p+"++) if (equal("+l+", "+f+"["+p+"])) { "+d+" = true; break; }",h&&(n+="  }  "),n+=" if (!"+d+") {   ";var m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var v=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",c&&(n+=" else { "),n},format:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||"");if(!1===e.opts.format)return c&&(n+=" if (true) { "),n;var d,h=e.opts.$data&&i&&i.$data;h?(n+=" var schema"+a+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",d="schema"+a):d=i;var p=e.opts.unknownFormats,f=Array.isArray(p);if(h){n+=" var "+(m="format"+a)+" = formats["+d+"]; var "+(v="isObject"+a)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(y="formatType"+a)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(n+=" var async"+a+" = "+m+".async; "),n+=" "+m+" = "+m+".validate; } if (  ",h&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),n+=" (","ignore"!=p&&(n+=" ("+d+" && !"+m+" ",f&&(n+=" && self._opts.unknownFormats.indexOf("+d+") == -1 "),n+=") || "),n+=" ("+m+" && "+y+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?n+=" (async"+a+" ? await "+m+"("+l+") : "+m+"("+l+")) ":n+=" "+m+"("+l+") ",n+=" : "+m+".test("+l+"))))) {"}else{var m;if(!(m=e.formats[i])){if("ignore"==p)return e.logger.warn('unknown format "'+i+'" ignored in schema at path "'+e.errSchemaPath+'"'),c&&(n+=" if (true) { "),n;if(f&&p.indexOf(i)>=0)return c&&(n+=" if (true) { "),n;throw new Error('unknown format "'+i+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,y=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var g=!0===m.async;m=m.validate}if(y!=r)return c&&(n+=" if (true) { "),n;if(g){if(!e.async)throw new Error("async format in sync schema");n+=" if (!(await "+(b="formats"+e.util.getProperty(i)+".validate")+"("+l+"))) { "}else{n+=" if (! ";var b="formats"+e.util.getProperty(i);v&&(b+=".validate"),n+="function"==typeof m?" "+b+"("+l+") ":" "+b+".test("+l+") ",n+=") { "}}var w=w||[];w.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format:  ",n+=h?""+d:""+e.util.toQuotedString(i),n+="  } ",!1!==e.opts.messages&&(n+=" , message: 'should match format \"",n+=h?"' + "+d+" + '":""+e.util.escapeQuotes(i),n+="\"' "),e.opts.verbose&&(n+=" , schema:  ",n+=h?"validate.schema"+s:""+e.util.toQuotedString(i),n+="         , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var E=n;return n=w.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n},if:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="valid"+a,h="errs__"+a,p=e.util.copy(e);p.level++;var f="valid"+p.level,m=e.schema.then,v=e.schema.else,y=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),g=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),b=p.baseId;if(y||g){var w;p.createErrors=!1,p.schema=i,p.schemaPath=s,p.errSchemaPath=u,n+=" var "+h+" = errors; var "+d+" = true;  ";var E=e.compositeRule;e.compositeRule=p.compositeRule=!0,n+="  "+e.validate(p)+" ",p.baseId=b,p.createErrors=!0,n+="  errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }  ",e.compositeRule=p.compositeRule=E,y?(n+=" if ("+f+") {  ",p.schema=e.schema.then,p.schemaPath=e.schemaPath+".then",p.errSchemaPath=e.errSchemaPath+"/then",n+="  "+e.validate(p)+" ",p.baseId=b,n+=" "+d+" = "+f+"; ",y&&g?n+=" var "+(w="ifClause"+a)+" = 'then'; ":w="'then'",n+=" } ",g&&(n+=" else { ")):n+=" if (!"+f+") { ",g&&(p.schema=e.schema.else,p.schemaPath=e.schemaPath+".else",p.errSchemaPath=e.errSchemaPath+"/else",n+="  "+e.validate(p)+" ",p.baseId=b,n+=" "+d+" = "+f+"; ",y&&g?n+=" var "+(w="ifClause"+a)+" = 'else'; ":w="'else'",n+=" } "),n+=" if (!"+d+") {   var err =   ",!1!==e.createErrors?(n+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" }   ",c&&(n+=" else { "),n=e.util.cleanUpCode(n)}else c&&(n+=" if (true) { ");return n},items:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="valid"+a,h="errs__"+a,p=e.util.copy(e),f="";p.level++;var m="valid"+p.level,v="i"+a,y=p.dataLevel=e.dataLevel+1,g="data"+y,b=e.baseId;if(n+="var "+h+" = errors;var "+d+";",Array.isArray(i)){var w=e.schema.additionalItems;if(!1===w){n+=" "+d+" = "+l+".length <= "+i.length+"; ";var E=u;u=e.errSchemaPath+"/additionalItems",n+="  if (!"+d+") {   ";var P=P||[];P.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i.length+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have more than "+i.length+" items' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var _=n;n=P.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",u=E,c&&(f+="}",n+=" else { ")}var S=i;if(S)for(var k,x=-1,j=S.length-1;x<j;)if(k=S[x+=1],e.opts.strictKeywords?"object"==typeof k&&Object.keys(k).length>0:e.util.schemaHasRules(k,e.RULES.all)){n+=" "+m+" = true; if ("+l+".length > "+x+") { ";var O=l+"["+x+"]";p.schema=k,p.schemaPath=s+"["+x+"]",p.errSchemaPath=u+"/"+x,p.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0),p.dataPathArr[y]=x;var T=e.validate(p);p.baseId=b,e.util.varOccurences(T,g)<2?n+=" "+e.util.varReplace(T,g,O)+" ":n+=" var "+g+" = "+O+"; "+T+" ",n+=" }  ",c&&(n+=" if ("+m+") { ",f+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){p.schema=w,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",n+=" "+m+" = true; if ("+l+".length > "+i.length+") {  for (var "+v+" = "+i.length+"; "+v+" < "+l+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);O=l+"["+v+"]";p.dataPathArr[y]=v;T=e.validate(p);p.baseId=b,e.util.varOccurences(T,g)<2?n+=" "+e.util.varReplace(T,g,O)+" ":n+=" var "+g+" = "+O+"; "+T+" ",c&&(n+=" if (!"+m+") break; "),n+=" } }  ",c&&(n+=" if ("+m+") { ",f+="}")}}else if(e.opts.strictKeywords?"object"==typeof i&&Object.keys(i).length>0:e.util.schemaHasRules(i,e.RULES.all)){p.schema=i,p.schemaPath=s,p.errSchemaPath=u,n+="  for (var "+v+" = 0; "+v+" < "+l+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);O=l+"["+v+"]";p.dataPathArr[y]=v;T=e.validate(p);p.baseId=b,e.util.varOccurences(T,g)<2?n+=" "+e.util.varReplace(T,g,O)+" ":n+=" var "+g+" = "+O+"; "+T+" ",c&&(n+=" if (!"+m+") break; "),n+=" }"}return c&&(n+=" "+f+" if ("+h+" == errors) {"),n=e.util.cleanUpCode(n)},maximum:kr,minimum:kr,maxItems:xr,minItems:xr,maxLength:jr,minLength:jr,maxProperties:Or,minProperties:Or,multipleOf:function(e,t,r){var n,a=" ",o=e.level,i=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),h=e.opts.$data&&s&&s.$data;h?(a+=" var schema"+o+" = "+e.util.getData(s.$data,i,e.dataPathArr)+"; ",n="schema"+o):n=s,a+="var division"+o+";if (",h&&(a+=" "+n+" !== undefined && ( typeof "+n+" != 'number' || "),a+=" (division"+o+" = "+d+" / "+n+", ",e.opts.multipleOfPrecision?a+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":a+=" division"+o+" !== parseInt(division"+o+") ",a+=" ) ",h&&(a+="  )  "),a+=" ) {   ";var p=p||[];p.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be multiple of ",a+=h?"' + "+n:n+"'"),e.opts.verbose&&(a+=" , schema:  ",a+=h?"validate.schema"+u:""+s,a+="         , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var f=a;return a=p.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+f+"]); ":a+=" validate.errors = ["+f+"]; return false; ":a+=" var err = "+f+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",l&&(a+=" else { "),a},not:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="errs__"+a,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof i&&Object.keys(i).length>0:e.util.schemaHasRules(i,e.RULES.all)){h.schema=i,h.schemaPath=s,h.errSchemaPath=u,n+=" var "+d+" = errors;  ";var f,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(f=h.opts.allErrors,h.opts.allErrors=!1),n+=" "+e.validate(h)+" ",h.createErrors=!0,f&&(h.opts.allErrors=f),e.compositeRule=h.compositeRule=m,n+=" if ("+p+") {   ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var y=n;n=v.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else {  errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else n+="  var err =   ",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(n+=" if (false) { ");return n},oneOf:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="valid"+a,h="errs__"+a,p=e.util.copy(e),f="";p.level++;var m="valid"+p.level,v=p.baseId,y="prevValid"+a,g="passingSchemas"+a;n+="var "+h+" = errors , "+y+" = false , "+d+" = false , "+g+" = null; ";var b=e.compositeRule;e.compositeRule=p.compositeRule=!0;var w=i;if(w)for(var E,P=-1,_=w.length-1;P<_;)E=w[P+=1],(e.opts.strictKeywords?"object"==typeof E&&Object.keys(E).length>0:e.util.schemaHasRules(E,e.RULES.all))?(p.schema=E,p.schemaPath=s+"["+P+"]",p.errSchemaPath=u+"/"+P,n+="  "+e.validate(p)+" ",p.baseId=v):n+=" var "+m+" = true; ",P&&(n+=" if ("+m+" && "+y+") { "+d+" = false; "+g+" = ["+g+", "+P+"]; } else { ",f+="}"),n+=" if ("+m+") { "+d+" = "+y+" = true; "+g+" = "+P+"; }";return e.compositeRule=p.compositeRule=b,n+=f+"if (!"+d+") {   var err =   ",!1!==e.createErrors?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+g+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else {  errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(n+=" } "),n},pattern:function(e,t,r){var n,a=" ",o=e.level,i=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),h=e.opts.$data&&s&&s.$data;h?(a+=" var schema"+o+" = "+e.util.getData(s.$data,i,e.dataPathArr)+"; ",n="schema"+o):n=s,a+="if ( ",h&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'string') || "),a+=" !"+(h?"(new RegExp("+n+"))":e.usePattern(s))+".test("+d+") ) {   ";var p=p||[];p.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { pattern:  ",a+=h?""+n:""+e.util.toQuotedString(s),a+="  } ",!1!==e.opts.messages&&(a+=" , message: 'should match pattern \"",a+=h?"' + "+n+" + '":""+e.util.escapeQuotes(s),a+="\"' "),e.opts.verbose&&(a+=" , schema:  ",a+=h?"validate.schema"+u:""+e.util.toQuotedString(s),a+="         , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var f=a;return a=p.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+f+"]); ":a+=" validate.errors = ["+f+"]; return false; ":a+=" var err = "+f+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",l&&(a+=" else { "),a},properties:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="errs__"+a,h=e.util.copy(e),p="";h.level++;var f="valid"+h.level,m="key"+a,v="idx"+a,y=h.dataLevel=e.dataLevel+1,g="data"+y,b="dataProperties"+a,w=Object.keys(i||{}),E=e.schema.patternProperties||{},P=Object.keys(E),_=e.schema.additionalProperties,S=w.length||P.length,k=!1===_,x="object"==typeof _&&Object.keys(_).length,j=e.opts.removeAdditional,O=k||x||j,T=e.opts.ownProperties,A=e.baseId,M=e.schema.required;if(M&&(!e.opts.$data||!M.$data)&&M.length<e.opts.loopRequired)var R=e.util.toHash(M);if(n+="var "+d+" = errors;var "+f+" = true;",T&&(n+=" var "+b+" = undefined;"),O){if(n+=T?" "+b+" = "+b+" || Object.keys("+l+"); for (var "+v+"=0; "+v+"<"+b+".length; "+v+"++) { var "+m+" = "+b+"["+v+"]; ":" for (var "+m+" in "+l+") { ",S){if(n+=" var isAdditional"+a+" = !(false ",w.length)if(w.length>8)n+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var I=w;if(I)for(var C=-1,N=I.length-1;C<N;)X=I[C+=1],n+=" || "+m+" == "+e.util.toQuotedString(X)+" "}if(P.length){var D=P;if(D)for(var $=-1,F=D.length-1;$<F;)ae=D[$+=1],n+=" || "+e.usePattern(ae)+".test("+m+") "}n+=" ); if (isAdditional"+a+") { "}if("all"==j)n+=" delete "+l+"["+m+"]; ";else{var z=e.errorPath,W="' + "+m+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)),k)if(j)n+=" delete "+l+"["+m+"]; ";else{n+=" "+f+" = false; ";var L=u;u=e.errSchemaPath+"/additionalProperties",(te=te||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { additionalProperty: '"+W+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is an invalid additional property":n+="should NOT have additional properties",n+="' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var U=n;n=te.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+U+"]); ":n+=" validate.errors = ["+U+"]; return false; ":n+=" var err = "+U+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=L,c&&(n+=" break; ")}else if(x)if("failing"==j){n+=" var "+d+" = errors;  ";var H=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=_,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var q=l+"["+m+"]";h.dataPathArr[y]=m;var B=e.validate(h);h.baseId=A,e.util.varOccurences(B,g)<2?n+=" "+e.util.varReplace(B,g,q)+" ":n+=" var "+g+" = "+q+"; "+B+" ",n+=" if (!"+f+") { errors = "+d+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+l+"["+m+"]; }  ",e.compositeRule=h.compositeRule=H}else{h.schema=_,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);q=l+"["+m+"]";h.dataPathArr[y]=m;B=e.validate(h);h.baseId=A,e.util.varOccurences(B,g)<2?n+=" "+e.util.varReplace(B,g,q)+" ":n+=" var "+g+" = "+q+"; "+B+" ",c&&(n+=" if (!"+f+") break; ")}e.errorPath=z}S&&(n+=" } "),n+=" }  ",c&&(n+=" if ("+f+") { ",p+="}")}var V=e.opts.useDefaults&&!e.compositeRule;if(w.length){var G=w;if(G)for(var X,J=-1,Q=G.length-1;J<Q;){var Y=i[X=G[J+=1]];if(e.opts.strictKeywords?"object"==typeof Y&&Object.keys(Y).length>0:e.util.schemaHasRules(Y,e.RULES.all)){var K=e.util.getProperty(X),Z=(q=l+K,V&&void 0!==Y.default);h.schema=Y,h.schemaPath=s+K,h.errSchemaPath=u+"/"+e.util.escapeFragment(X),h.errorPath=e.util.getPath(e.errorPath,X,e.opts.jsonPointers),h.dataPathArr[y]=e.util.toQuotedString(X);B=e.validate(h);if(h.baseId=A,e.util.varOccurences(B,g)<2){B=e.util.varReplace(B,g,q);var ee=q}else{ee=g;n+=" var "+g+" = "+q+"; "}if(Z)n+=" "+B+" ";else{if(R&&R[X]){n+=" if ( "+ee+" === undefined ",T&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(X)+"') "),n+=") { "+f+" = false; ";z=e.errorPath,L=u;var te,re=e.util.escapeQuotes(X);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(z,X,e.opts.jsonPointers)),u=e.errSchemaPath+"/required",(te=te||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+re+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";U=n;n=te.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+U+"]); ":n+=" validate.errors = ["+U+"]; return false; ":n+=" var err = "+U+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=L,e.errorPath=z,n+=" } else { "}else c?(n+=" if ( "+ee+" === undefined ",T&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(X)+"') "),n+=") { "+f+" = true; } else { "):(n+=" if ("+ee+" !== undefined ",T&&(n+=" &&   Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(X)+"') "),n+=" ) { ");n+=" "+B+" } "}}c&&(n+=" if ("+f+") { ",p+="}")}}if(P.length){var ne=P;if(ne)for(var ae,oe=-1,ie=ne.length-1;oe<ie;){Y=E[ae=ne[oe+=1]];if(e.opts.strictKeywords?"object"==typeof Y&&Object.keys(Y).length>0:e.util.schemaHasRules(Y,e.RULES.all)){h.schema=Y,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),n+=T?" "+b+" = "+b+" || Object.keys("+l+"); for (var "+v+"=0; "+v+"<"+b+".length; "+v+"++) { var "+m+" = "+b+"["+v+"]; ":" for (var "+m+" in "+l+") { ",n+=" if ("+e.usePattern(ae)+".test("+m+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);q=l+"["+m+"]";h.dataPathArr[y]=m;B=e.validate(h);h.baseId=A,e.util.varOccurences(B,g)<2?n+=" "+e.util.varReplace(B,g,q)+" ":n+=" var "+g+" = "+q+"; "+B+" ",c&&(n+=" if (!"+f+") break; "),n+=" } ",c&&(n+=" else "+f+" = true; "),n+=" }  ",c&&(n+=" if ("+f+") { ",p+="}")}}}return c&&(n+=" "+p+" if ("+d+" == errors) {"),n=e.util.cleanUpCode(n)},propertyNames:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="errs__"+a,h=e.util.copy(e);h.level++;var p="valid"+h.level;if(n+="var "+d+" = errors;",e.opts.strictKeywords?"object"==typeof i&&Object.keys(i).length>0:e.util.schemaHasRules(i,e.RULES.all)){h.schema=i,h.schemaPath=s,h.errSchemaPath=u;var f="key"+a,m="idx"+a,v="i"+a,y="' + "+f+" + '",g="data"+(h.dataLevel=e.dataLevel+1),b="dataProperties"+a,w=e.opts.ownProperties,E=e.baseId;w&&(n+=" var "+b+" = undefined; "),n+=w?" "+b+" = "+b+" || Object.keys("+l+"); for (var "+m+"=0; "+m+"<"+b+".length; "+m+"++) { var "+f+" = "+b+"["+m+"]; ":" for (var "+f+" in "+l+") { ",n+=" var startErrs"+a+" = errors; ";var P=f,_=e.compositeRule;e.compositeRule=h.compositeRule=!0;var S=e.validate(h);h.baseId=E,e.util.varOccurences(S,g)<2?n+=" "+e.util.varReplace(S,g,P)+" ":n+=" var "+g+" = "+P+"; "+S+" ",e.compositeRule=h.compositeRule=_,n+=" if (!"+p+") { for (var "+v+"=startErrs"+a+"; "+v+"<errors; "+v+"++) { vErrors["+v+"].propertyName = "+f+"; }   var err =   ",!1!==e.createErrors?(n+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { propertyName: '"+y+"' } ",!1!==e.opts.messages&&(n+=" , message: 'property name \\'"+y+"\\' is invalid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),c&&(n+=" break; "),n+=" } }"}return c&&(n+="  if ("+d+" == errors) {"),n=e.util.cleanUpCode(n)},required:function(e,t,r){var n=" ",a=e.level,o=e.dataLevel,i=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="valid"+a,h=e.opts.$data&&i&&i.$data;h&&(n+=" var schema"+a+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ");var p="schema"+a;if(!h)if(i.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var f=[],m=i;if(m)for(var v,y=-1,g=m.length-1;y<g;){v=m[y+=1];var b=e.schema.properties[v];b&&(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0:e.util.schemaHasRules(b,e.RULES.all))||(f[f.length]=v)}}else f=i;if(h||f.length){var w=e.errorPath,E=h||f.length>=e.opts.loopRequired,P=e.opts.ownProperties;if(c)if(n+=" var missing"+a+"; ",E){h||(n+=" var "+p+" = validate.schema"+s+"; ");var _="' + "+(T="schema"+a+"["+(x="i"+a)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,T,e.opts.jsonPointers)),n+=" var "+d+" = true; ",h&&(n+=" if (schema"+a+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+a+")) "+d+" = false; else {"),n+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { "+d+" = "+l+"["+p+"["+x+"]] !== undefined ",P&&(n+=" &&   Object.prototype.hasOwnProperty.call("+l+", "+p+"["+x+"]) "),n+="; if (!"+d+") break; } ",h&&(n+="  }  "),n+="  if (!"+d+") {   ",(O=O||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+_+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+_+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var S=n;n=O.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+S+"]); ":n+=" validate.errors = ["+S+"]; return false; ":n+=" var err = "+S+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else{n+=" if ( ";var k=f;if(k)for(var x=-1,j=k.length-1;x<j;){M=k[x+=1],x&&(n+=" || "),n+=" ( ( "+(N=l+(C=e.util.getProperty(M)))+" === undefined ",P&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(M)+"') "),n+=") && (missing"+a+" = "+e.util.toQuotedString(e.opts.jsonPointers?M:C)+") ) "}n+=") {  ";var O;_="' + "+(T="missing"+a)+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,T,!0):w+" + "+T),(O=O||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+_+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+_+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";S=n;n=O.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+S+"]); ":n+=" validate.errors = ["+S+"]; return false; ":n+=" var err = "+S+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else if(E){h||(n+=" var "+p+" = validate.schema"+s+"; ");var T;_="' + "+(T="schema"+a+"["+(x="i"+a)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,T,e.opts.jsonPointers)),h&&(n+=" if ("+p+" && !Array.isArray("+p+")) {  var err =   ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+_+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+_+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+p+" !== undefined) { "),n+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { if ("+l+"["+p+"["+x+"]] === undefined ",P&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", "+p+"["+x+"]) "),n+=") {  var err =   ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+_+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+_+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(n+="  }  ")}else{var A=f;if(A)for(var M,R=-1,I=A.length-1;R<I;){M=A[R+=1];var C=e.util.getProperty(M),N=(_=e.util.escapeQuotes(M),l+C);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,M,e.opts.jsonPointers)),n+=" if ( "+N+" === undefined ",P&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(M)+"') "),n+=") {  var err =   ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+_+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+_+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=w}else c&&(n+=" if (true) {");return n},uniqueItems:function(e,t,r){var n,a=" ",o=e.level,i=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,d="data"+(i||""),h="valid"+o,p=e.opts.$data&&s&&s.$data;if(p?(a+=" var schema"+o+" = "+e.util.getData(s.$data,i,e.dataPathArr)+"; ",n="schema"+o):n=s,(s||p)&&!1!==e.opts.uniqueItems){p&&(a+=" var "+h+"; if ("+n+" === false || "+n+" === undefined) "+h+" = true; else if (typeof "+n+" != 'boolean') "+h+" = false; else { "),a+=" var i = "+d+".length , "+h+" = true , j; if (i > 1) { ";var f=e.schema.items&&e.schema.items.type,m=Array.isArray(f);if(!f||"object"==f||"array"==f||m&&(f.indexOf("object")>=0||f.indexOf("array")>=0))a+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+d+"[i], "+d+"[j])) { "+h+" = false; break outer; } } } ";else{a+=" var itemIndices = {}, item; for (;i--;) { var item = "+d+"[i]; ";var v="checkDataType"+(m?"s":"");a+=" if ("+e.util[v](f,"item",!0)+") continue; ",m&&(a+=" if (typeof item == 'string') item = '\"' + item; "),a+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}a+=" } ",p&&(a+="  }  "),a+=" if (!"+h+") {   ";var y=y||[];y.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(a+=" , schema:  ",a+=p?"validate.schema"+u:""+s,a+="         , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var g=a;a=y.pop(),!e.compositeRule&&l?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l&&(a+=" else { ")}else l&&(a+=" if (true) { ");return a},validate:Gt},Ar=ot.toHash,Mr=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"],Rr=function(e,t){for(var r=0;r<t.length;r++){e=JSON.parse(JSON.stringify(e));var n,a=t[r].split("/"),o=e;for(n=1;n<a.length;n++)o=o[a[n]];for(n=0;n<Mr.length;n++){var i=Mr[n],s=o[i];s&&(o[i]={anyOf:[s,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]})}}return e},Ir=Ht.MissingRef,Cr=function e(t,r,n){var a=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof r&&(n=r,r=void 0);var o=i(t).then((function(){var e=a._addSchema(t,void 0,r);return e.validate||function e(t){try{return a._compile(t)}catch(e){if(e instanceof Ir)return n(e);throw e}function n(n){var o=n.missingSchema;if(c(o))throw new Error("Schema "+o+" is loaded but "+n.missingRef+" cannot be resolved");var s=a._loadingSchemas[o];return s||(s=a._loadingSchemas[o]=a._opts.loadSchema(o)).then(u,u),s.then((function(e){if(!c(o))return i(e).then((function(){c(o)||a.addSchema(e,o,void 0,r)}))})).then((function(){return e(t)}));function u(){delete a._loadingSchemas[o]}function c(e){return a._refs[e]||a._schemas[e]}}}(e)}));n&&o.then((function(e){n(null,e)}),n);return o;function i(t){var r=t.$schema;return r&&!a.getSchema(r)?e.call(a,{$ref:r},!0):Promise.resolve()}};var Nr=function(e,t,r){var n,a,o=" ",i=e.level,s=e.dataLevel,u=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,h="data"+(s||""),p="valid"+i,f="errs__"+i,m=e.opts.$data&&u&&u.$data;m?(o+=" var schema"+i+" = "+e.util.getData(u.$data,s,e.dataPathArr)+"; ",a="schema"+i):a=u;var v,y,g,b,w,E="definition"+i,P=this.definition,_="";if(m&&P.$data){w="keywordValidate" [truncated]

 

Ohne Titel.png

Link to comment
  • 2 weeks later...

Hi Martien,

 

Testing out your beta version, and I received this error. It's working if I set the max number to 1, but any higher, it gives me this error. 

[23:23:34.407] Alfred Workflow Todoist[Script Filter] Queuing argument ''
[23:23:35.097] Alfred Workflow Todoist[Script Filter] Script with argv '(null)' finished
[23:23:35.099] STDERR: Alfred Workflow Todoist[Script Filter] [ERROR] TypeError: Cannot read property 'name' of undefined
    at nv (/Users/derekhousman/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C3101EC8-6E07-4891-805B-1578E63DC0C7/alfred-workflow-todoist.js:29:321114)
    at async /Users/derekhousman/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C3101EC8-6E07-4891-805B-1578E63DC0C7/alfred-workflow-todoist.js:29:324141
    at async Promise.all (index 1)
    at async iv (/Users/derekhousman/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C3101EC8-6E07-4891-805B-1578E63DC0C7/alfred-workflow-todoist.js:29:325884)
[23:23:35.100] Alfred Workflow Todoist[Script Filter] {
  "items": [
    {
      "title": "Oops, something is not right",
      "subtitle": "Create a bug report",
      "icon": {
        "path": "icon.png"
      },
      "arg": "{\"name\":\"openUrl\",\"args\":\"https://github.com/moranje/alfred-workflow-todoist/issues/new?body=%23%23%23+Description%0A%0A%3CA+clear+and+concise+description+of+what+the+bug+is.%3E%0A%0A%23%23%23+Steps+to+reproduce+behavior%0A%0A%3CPlease+describe+what+you+did+here.%3E%0A%0A%23%23%23+Expected+behavior%0A%0A%3CA+clear+and+concise+description+of+what+you+expected+to+happen.%3E%0A%0A%23%23%23+Error+logs%0A%0AALFRED+WORKFLOW+TODOIST%0A----------------------------------------%0A_Title_%3A+TypeError%0A_Description_%3A+Cannot+read+property+%27name%27+of+undefined%0A%0A_OS_%3A+macOS+10.15.5%0A_Query_%3A+%0A_Node.js_%3A+v14.1.0%0A_Alfred_%3A+4.0.9%0A_Workflow_%3A+6.0.0-beta.1%0A_Workflow-id_%3A+user.workflow.C3101EC8-6E07-4891-805B-1578E63DC0C7%0A%0A_Stack_%3A+TypeError%3A+Cannot+read+property+%27name%27+of+undefined%0A++++at+nv+%28%2FUsers%2Fderekhousman%2FLibrary%2FApplication+Support%2FAlfred%2FAlfred.alfredpreferences%2Fworkflows%2Fuser.workflow.C3101EC8-6E07-4891-805B-1578E63DC0C7%2Falfred-workflow-todoist.js%3A29%3A321114%29%0A++++at+async+%2FUsers%2Fderekhousman%2FLibrary%2FApplication+Support%2FAlfred%2FAlfred.alfredpreferences%2Fworkflows%2Fuser.workflow.C3101EC8-6E07-4891-805B-1578E63DC0C7%2Falfred-workflow-todoist.js%3A29%3A324141%0A++++at+async+Promise.all+%28index+1%29%0A++++at+async+iv+%28%2FUsers%2Fderekhousman%2FLibrary%2FApplication+Support%2FAlfred%2FAlfred.alfredpreferences%2Fworkflows%2Fuser.workflow.C3101EC8-6E07-4891-805B-1578E63DC0C7%2Falfred-workflow-todoist.js%3A29%3A325884%29&title=%5BBug%5D+TypeError%3A+Cannot+read+property+%27name%27+of+undefined\"}",
      "type": "default",
      "valid": true,
      "quicklookurl": "https://github.com/moranje/alfred-workflow-todoist/issues/new?body=%23%23%23+Description%0A%0A%3CA+clear+and+concise+description+of+what+the+bug+is.%3E%0A%0A%23%23%23+Steps+to+reproduce+behavior%0A%0A%3CPlease+describe+what+you+did+here.%3E%0A%0A%23%23%23+Expected+behavior%0A%0A%3CA+clear+and+concise+description+of+what+you+expected+to+happen.%3E%0A%0A%23%23%23+Error+logs%0A%0AALFRED+WORKFLOW+TODOIST%0A----------------------------------------%0A_Title_%3A+TypeError%0A_Description_%3A+Cannot+read+property+%27name%27+of+undefined%0A%0A_OS_%3A+macOS+10.15.5%0A_Query_%3A+%0A_Node.js_%3A+v14.1.0%0A_Alfred_%3A+4.0.9%0A_Workflow_%3A+6.0.0-beta.1%0A_Workflow-id_%3A+user.workflow.C3101EC8-6E07-4891-805B-1578E63DC0C7%0A%0A_Stack_%3A+TypeError%3A+Cannot+read+property+%27name%27+of+undefined%0A++++at+nv+%28%2FUsers%2Fderekhousman%2FLibrary%2FApplication+Support%2FAlfred%2FAlfred.alfredpreferences%2Fworkflows%2Fuser.workflow.C3101EC8-6E07-4891-805B-1578E63DC0C7%2Falfred-workflow-todoist.js%3A29%3A321114%29%0A++++at+async+%2FUsers%2Fderekhousman%2FLibrary%2FApplication+Support%2FAlfred%2FAlfred.alfredpreferences%2Fworkflows%2Fuser.workflow.C3101EC8-6E07-4891-805B-1578E63DC0C7%2Falfred-workflow-todoist.js%3A29%3A324141%0A++++at+async+Promise.all+%28index+1%29%0A++++at+async+iv+%28%2FUsers%2Fderekhousman%2FLibrary%2FApplication+Support%2FAlfred%2FAlfred.alfredpreferences%2Fworkflows%2Fuser.workflow.C3101EC8-6E07-4891-805B-1578E63DC0C7%2Falfred-workflow-todoist.js%3A29%3A325884%29&title=%5BBug%5D+TypeError%3A+Cannot+read+property+%27name%27+of+undefined"
    }
  ]
}

 

Link to comment
  • 3 weeks later...

To set it up, entering the following into Alfred,

 

todo:setting token {api token}  # replaced by my required api

 

It doesn't get the settings properly but does a google search.
What's the problem, can someone tell me what's wrong?
 

Link to comment
On 6/8/2020 at 7:42 AM, dan_0209 said:

To set it up, entering the following into Alfred,

 

todo:setting token {api token}  # replaced by my required api

 

It doesn't get the settings properly but does a google search.
What's the problem, can someone tell me what's wrong?
 

 

Hi!

 

Did you install node.js? Check the install instructions if you have trouble setting everything up.

 

Cheers

Link to comment
  • 2 months later...

I've installed Node.js and set the API token and it was registered as successful. However, whenever I run any command, like creating a task or searching for tasks, there was a notification from Alfred “Couldn't update workflow. Can't read property 'length' of null”.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...