decap-cms-lib-widgets
Version:
Shared utilities for Decap CMS.
2 lines • 27.4 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("immutable")):"function"==typeof define&&define.amd?define("DecapCmsLibWidgets",["immutable"],e):"object"==typeof exports?exports.DecapCmsLibWidgets=e(require("immutable")):t.DecapCmsLibWidgets=e(t.DecapCmsDefaultExports.Immutable)}(window,t=>(()=>{var e={88:(t,e,r)=>{var n=r(4700);t.exports=function(t){return n(this,t).get(t)}},155:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},547:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},685:(t,e,r)=>{var n=r(2291),o=r(8931),i=r(3417),a=r(1580),s=r(4358),u=r(1090),c=r(2237),f=r(7642),l=r(5243),h=/\w*$/;t.exports=function(t,e){var r=30,p="...";if(a(e)){var d="separator"in e?e.separator:d;r="length"in e?f(e.length):r,p="omission"in e?n(e.omission):p}var v=(t=l(t)).length;if(i(t)){var g=c(t);v=g.length}if(r>=v)return t;var y=r-u(p);if(y<1)return p;var x=g?o(g,0,y).join(""):t.slice(0,y);if(void 0===d)return x+p;if(g&&(y+=x.length-y),s(d)){if(t.slice(y).search(d)){var m,b=x;for(d.global||(d=RegExp(d.source,l(h.exec(d))+"g")),d.lastIndex=0;m=d.exec(b);)var $=m.index;x=x.slice(0,void 0===$?y:$)}}else if(t.indexOf(n(d),y)!=y){var _=x.lastIndexOf(d);_>-1&&(x=x.slice(0,_))}return x+p}},906:(t,e,r)=>{var n=r(2762)("length");t.exports=n},986:(t,e,r)=>{var n=r(7379),o=r(547);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==n(t)}},1090:(t,e,r)=>{var n=r(906),o=r(3417),i=r(4962);t.exports=function(t){return o(t)?i(t):n(t)}},1112:(t,e,r)=>{var n=r(4497),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(e,t)?e[t]:void 0}},1187:(t,e,r)=>{var n=r(7379),o=r(547);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==n(t)}},1386:(t,e,r)=>{var n=r(2393),o=r(2049),i=r(7144),a=r(5071),s=r(3964);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},1580:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},1950:(t,e,r)=>{var n=r(8942)["__core-js_shared__"];t.exports=n},2013:t=>{var e="\\ud800-\\udfff",r="["+e+"]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="[^"+e+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+n+"|"+o+")?",c="[\\ufe0e\\ufe0f]?",f=c+u+"(?:\\u200d(?:"+[i,a,s].join("|")+")"+c+u+")*",l="(?:"+[i+n+"?",n,a,s,r].join("|")+")",h=RegExp(o+"(?="+o+")|"+l+f,"g");t.exports=function(t){return t.match(h)||[]}},2049:(t,e,r)=>{var n=r(7034),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0||(r==e.length-1?e.pop():o.call(e,r,1),--this.size,0))}},2237:(t,e,r)=>{var n=r(2837),o=r(3417),i=r(2013);t.exports=function(t){return o(t)?i(t):n(t)}},2291:(t,e,r)=>{var n=r(5650),o=r(5111),i=r(3142),a=r(1187),s=n?n.prototype:void 0,u=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return u?u.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}},2306:(t,e,r)=>{t=r.nmd(t);var n=r(4967),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s},2393:t=>{t.exports=function(){this.__data__=[],this.size=0}},2478:(t,e,r)=>{var n=r(7250),o=r(9454),i=r(7706);t.exports=function(t,e,r){return e==e?i(t,e,r):n(t,o,r)}},2522:e=>{"use strict";e.exports=t},2762:t=>{t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},2837:t=>{t.exports=function(t){return t.split("")}},2945:t=>{var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},3142:t=>{var e=Array.isArray;t.exports=e},3301:(t,e,r)=>{var n=r(6131),o=1/0;t.exports=function(t){return t?(t=n(t))===o||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},3305:(t,e,r)=>{var n=r(4497);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},3417:t=>{var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return e.test(t)}},3464:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,r="millisecond",n="second",o="minute",i="hour",a="day",s="week",u="month",c="quarter",f="year",l="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},g=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},y={s:g,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r%60;return(e<=0?"+":"-")+g(n,2,"0")+":"+g(o,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),o=e.clone().add(n,u),i=r-o<0,a=e.clone().add(n+(i?-1:1),u);return+(-(n+(r-o)/(i?o-a:a-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:f,w:s,d:a,D:l,h:i,m:o,s:n,ms:r,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},x="en",m={};m[x]=v;var b="$isDayjsObject",$=function(t){return t instanceof M||!(!t||!t[b])},_=function t(e,r,n){var o;if(!e)return x;if("string"==typeof e){var i=e.toLowerCase();m[i]&&(o=i),r&&(m[i]=r,o=i);var a=e.split("-");if(!o&&a.length>1)return t(a[0])}else{var s=e.name;m[s]=e,o=s}return!n&&o&&(x=o),o||!n&&x},w=function(t,e){if($(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new M(r)},S=y;S.l=_,S.i=$,S.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var M=function(){function v(t){this.$L=_(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[b]=!0}var g=v.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(S.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(p);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(e)}(t),this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return S},g.isValid=function(){return!(this.$d.toString()===h)},g.isSame=function(t,e){var r=w(t);return this.startOf(e)<=r&&r<=this.endOf(e)},g.isAfter=function(t,e){return w(t)<this.startOf(e)},g.isBefore=function(t,e){return this.endOf(e)<w(t)},g.$g=function(t,e,r){return S.u(t)?this[e]:this.set(r,t)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(t,e){var r=this,c=!!S.u(e)||e,h=S.p(t),p=function(t,e){var n=S.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return c?n:n.endOf(a)},d=function(t,e){return S.w(r.toDate()[t].apply(r.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(e)),r)},v=this.$W,g=this.$M,y=this.$D,x="set"+(this.$u?"UTC":"");switch(h){case f:return c?p(1,0):p(31,11);case u:return c?p(1,g):p(0,g+1);case s:var m=this.$locale().weekStart||0,b=(v<m?v+7:v)-m;return p(c?y-b:y+(6-b),g);case a:case l:return d(x+"Hours",0);case i:return d(x+"Minutes",1);case o:return d(x+"Seconds",2);case n:return d(x+"Milliseconds",3);default:return this.clone()}},g.endOf=function(t){return this.startOf(t,!1)},g.$set=function(t,e){var s,c=S.p(t),h="set"+(this.$u?"UTC":""),p=(s={},s[a]=h+"Date",s[l]=h+"Date",s[u]=h+"Month",s[f]=h+"FullYear",s[i]=h+"Hours",s[o]=h+"Minutes",s[n]=h+"Seconds",s[r]=h+"Milliseconds",s)[c],d=c===a?this.$D+(e-this.$W):e;if(c===u||c===f){var v=this.clone().set(l,1);v.$d[p](d),v.init(),this.$d=v.set(l,Math.min(this.$D,v.daysInMonth())).$d}else p&&this.$d[p](d);return this.init(),this},g.set=function(t,e){return this.clone().$set(t,e)},g.get=function(t){return this[S.p(t)]()},g.add=function(r,c){var l,h=this;r=Number(r);var p=S.p(c),d=function(t){var e=w(h);return S.w(e.date(e.date()+Math.round(t*r)),h)};if(p===u)return this.set(u,this.$M+r);if(p===f)return this.set(f,this.$y+r);if(p===a)return d(1);if(p===s)return d(7);var v=(l={},l[o]=t,l[i]=e,l[n]=1e3,l)[p]||1,g=this.$d.getTime()+r*v;return S.w(g,this)},g.subtract=function(t,e){return this.add(-1*t,e)},g.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||h;var n=t||"YYYY-MM-DDTHH:mm:ssZ",o=S.z(this),i=this.$H,a=this.$m,s=this.$M,u=r.weekdays,c=r.months,f=r.meridiem,l=function(t,r,o,i){return t&&(t[r]||t(e,n))||o[r].slice(0,i)},p=function(t){return S.s(i%12||12,t,"0")},v=f||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(d,function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return S.s(e.$y,4,"0");case"M":return s+1;case"MM":return S.s(s+1,2,"0");case"MMM":return l(r.monthsShort,s,c,3);case"MMMM":return l(c,s);case"D":return e.$D;case"DD":return S.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return l(r.weekdaysMin,e.$W,u,2);case"ddd":return l(r.weekdaysShort,e.$W,u,3);case"dddd":return u[e.$W];case"H":return String(i);case"HH":return S.s(i,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return v(i,a,!0);case"A":return v(i,a,!1);case"m":return String(a);case"mm":return S.s(a,2,"0");case"s":return String(e.$s);case"ss":return S.s(e.$s,2,"0");case"SSS":return S.s(e.$ms,3,"0");case"Z":return o}return null}(t)||o.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(r,l,h){var p,d=this,v=S.p(l),g=w(r),y=(g.utcOffset()-this.utcOffset())*t,x=this-g,m=function(){return S.m(d,g)};switch(v){case f:p=m()/12;break;case u:p=m();break;case c:p=m()/3;break;case s:p=(x-y)/6048e5;break;case a:p=(x-y)/864e5;break;case i:p=x/e;break;case o:p=x/t;break;case n:p=x/1e3;break;default:p=x}return h?p:S.a(p)},g.daysInMonth=function(){return this.endOf(u).$D},g.$locale=function(){return m[this.$L]},g.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=_(t,e,!0);return n&&(r.$L=n),r},g.clone=function(){return S.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},v}(),O=M.prototype;return w.prototype=O,[["$ms",r],["$s",n],["$m",o],["$H",i],["$W",a],["$M",u],["$y",f],["$D",l]].forEach(function(t){O[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),w.extend=function(t,e){return t.$i||(t(e,M,w),t.$i=!0),w},w.locale=_,w.isDayjs=$,w.unix=function(t){return w(1e3*t)},w.en=m[x],w.Ls=m,w.p={},w}()},3501:t=>{t.exports=function(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}},3526:(t,e,r)=>{var n=r(3142),o=r(5187),i=r(6493),a=r(5243);t.exports=function(t,e){return n(t)?t:o(t,e)?[t]:i(a(t))}},3655:(t,e,r)=>{var n=r(7379),o=r(1580);t.exports=function(t){if(!o(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},3964:(t,e,r)=>{var n=r(7034);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},4066:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},4358:(t,e,r)=>{var n=r(5902),o=r(9460),i=r(2306),a=i&&i.isRegExp,s=a?o(a):n;t.exports=s},4497:(t,e,r)=>{var n=r(4715)(Object,"create");t.exports=n},4700:(t,e,r)=>{var n=r(9067);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},4715:(t,e,r)=>{var n=r(9624),o=r(155);t.exports=function(t,e){var r=o(t,e);return n(r)?r:void 0}},4732:(t,e,r)=>{var n=r(4700);t.exports=function(t){return n(this,t).has(t)}},4759:(t,e,r)=>{var n,o=r(1950),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!i&&i in t}},4962:t=>{var e="\\ud800-\\udfff",r="["+e+"]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="[^"+e+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+n+"|"+o+")?",c="[\\ufe0e\\ufe0f]?",f=c+u+"(?:\\u200d(?:"+[i,a,s].join("|")+")"+c+u+")*",l="(?:"+[i+n+"?",n,a,s,r].join("|")+")",h=RegExp(o+"(?="+o+")|"+l+f,"g");t.exports=function(t){for(var e=h.lastIndex=0;h.test(t);)++e;return e}},4967:(t,e,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},5071:(t,e,r)=>{var n=r(7034);t.exports=function(t){return n(this.__data__,t)>-1}},5098:(t,e,r)=>{var n=r(3305),o=r(9361),i=r(1112),a=r(5276),s=r(7452);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},5111:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}},5187:(t,e,r)=>{var n=r(3142),o=r(1187),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!o(t))||a.test(t)||!i.test(t)||null!=e&&t in Object(e)}},5243:(t,e,r)=>{var n=r(2291);t.exports=function(t){return null==t?"":n(t)}},5276:(t,e,r)=>{var n=r(4497),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:o.call(e,t)}},5650:(t,e,r)=>{var n=r(8942).Symbol;t.exports=n},5681:(t,e,r)=>{var n=r(4700);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},5902:(t,e,r)=>{var n=r(7379),o=r(547);t.exports=function(t){return o(t)&&"[object RegExp]"==n(t)}},6040:(t,e,r)=>{var n=r(1187);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},6123:(t,e,r)=>{var n=r(7923);t.exports=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}},6131:(t,e,r)=>{var n=r(6403),o=r(1580),i=r(1187),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=s.test(t);return r||u.test(t)?c(t.slice(2),r?2:8):a.test(t)?NaN:+t}},6285:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},6403:(t,e,r)=>{var n=r(2945),o=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(o,""):t}},6493:(t,e,r)=>{var n=r(6853),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=n(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,function(t,r,n,o){e.push(n?o.replace(i,"$1"):r||t)}),e});t.exports=a},6853:(t,e,r)=>{var n=r(9011);t.exports=function(t){var e=n(t,function(t){return 500===r.size&&r.clear(),t}),r=e.cache;return e}},7034:(t,e,r)=>{var n=r(6285);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},7144:(t,e,r)=>{var n=r(7034);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},7250:t=>{t.exports=function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}},7379:(t,e,r)=>{var n=r(5650),o=r(8870),i=r(9005),a=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},7426:(t,e,r)=>{var n=r(2291),o=r(8931),i=r(8774),a=r(2237),s=r(5243),u=r(2945);t.exports=function(t,e,r){if((t=s(t))&&(r||void 0===e))return t.slice(0,u(t)+1);if(!t||!(e=n(e)))return t;var c=a(t),f=i(c,a(e))+1;return o(c,0,f).join("")}},7452:(t,e,r)=>{var n=r(4497);t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},7642:(t,e,r)=>{var n=r(3301);t.exports=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}},7706:t=>{t.exports=function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}},7923:(t,e,r)=>{var n=r(3526),o=r(6040);t.exports=function(t,e){for(var r=0,i=(e=n(e,t)).length;null!=t&&r<i;)t=t[o(e[r++])];return r&&r==i?t:void 0}},8250:(t,e,r)=>{var n=r(9753),o=r(5681),i=r(88),a=r(4732),s=r(9068);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},8774:(t,e,r)=>{var n=r(2478);t.exports=function(t,e){for(var r=t.length;r--&&n(e,t[r],0)>-1;);return r}},8870:(t,e,r)=>{var n=r(5650),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,s),r=t[s];try{t[s]=void 0;var n=!0}catch(t){}var o=a.call(t);return n&&(e?t[s]=r:delete t[s]),o}},8931:(t,e,r)=>{var n=r(3501);t.exports=function(t,e,r){var o=t.length;return r=void 0===r?o:r,!e&&r>=o?t:n(t,e,r)}},8942:(t,e,r)=>{var n=r(4967),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},9005:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},9011:(t,e,r)=>{var n=r(8250);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(o.Cache||n),r}o.Cache=n,t.exports=o},9067:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},9068:(t,e,r)=>{var n=r(4700);t.exports=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}},9361:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},9454:t=>{t.exports=function(t){return t!=t}},9460:t=>{t.exports=function(t){return function(e){return t(e)}}},9624:(t,e,r)=>{var n=r(3655),o=r(4759),i=r(1580),a=r(4066),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,f=u.toString,l=c.hasOwnProperty,h=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(n(t)?h:s).test(a(t))}},9753:(t,e,r)=>{var n=r(5098),o=r(1386),i=r(9770);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},9770:(t,e,r)=>{var n=r(4715)(r(8942),"Map");t.exports=n},9942:t=>{"use strict";function e(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function r(t,e){for(var r,n="",o=0,i=-1,a=0,s=0;s<=t.length;++s){if(s<t.length)r=t.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(i===s-1||1===a);else if(i!==s-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",o=0):o=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),i=s,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=s,a=0;continue}e&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),o=s-i-1;i=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var t,n="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var a;i>=0?a=arguments[i]:(void 0===t&&(t=process.cwd()),a=t),e(a),0!==a.length&&(n=a+"/"+n,o=47===a.charCodeAt(0))}return n=r(n,!o),o?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(t){if(e(t),0===t.length)return".";var n=47===t.charCodeAt(0),o=47===t.charCodeAt(t.length-1);return 0!==(t=r(t,!n)).length||n||(t="."),t.length>0&&o&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return e(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,r=0;r<arguments.length;++r){var o=arguments[r];e(o),o.length>0&&(void 0===t?t=o:t+="/"+o)}return void 0===t?".":n.normalize(t)},relative:function(t,r){if(e(t),e(r),t===r)return"";if((t=n.resolve(t))===(r=n.resolve(r)))return"";for(var o=1;o<t.length&&47===t.charCodeAt(o);++o);for(var i=t.length,a=i-o,s=1;s<r.length&&47===r.charCodeAt(s);++s);for(var u=r.length-s,c=a<u?a:u,f=-1,l=0;l<=c;++l){if(l===c){if(u>c){if(47===r.charCodeAt(s+l))return r.slice(s+l+1);if(0===l)return r.slice(s+l)}else a>c&&(47===t.charCodeAt(o+l)?f=l:0===l&&(f=0));break}var h=t.charCodeAt(o+l);if(h!==r.charCodeAt(s+l))break;47===h&&(f=l)}var p="";for(l=o+f+1;l<=i;++l)l!==i&&47!==t.charCodeAt(l)||(0===p.length?p+="..":p+="/..");return p.length>0?p+r.slice(s+f):(s+=f,47===r.charCodeAt(s)&&++s,r.slice(s))},_makeLong:function(t){return t},dirname:function(t){if(e(t),0===t.length)return".";for(var r=t.charCodeAt(0),n=47===r,o=-1,i=!0,a=t.length-1;a>=1;--a)if(47===(r=t.charCodeAt(a))){if(!i){o=a;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":t.slice(0,o)},basename:function(t,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');e(t);var n,o=0,i=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,u=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!a){o=n+1;break}}else-1===u&&(a=!1,u=n+1),s>=0&&(c===r.charCodeAt(s)?-1===--s&&(i=n):(s=-1,i=u))}return o===i?i=u:-1===i&&(i=t.length),t.slice(o,i)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!a){o=n+1;break}}else-1===i&&(a=!1,i=n+1);return-1===i?"":t.slice(o,i)},extname:function(t){e(t);for(var r=-1,n=0,o=-1,i=!0,a=0,s=t.length-1;s>=0;--s){var u=t.charCodeAt(s);if(47!==u)-1===o&&(i=!1,o=s+1),46===u?-1===r?r=s:1!==a&&(a=1):-1!==r&&(a=-1);else if(!i){n=s+1;break}}return-1===r||-1===o||0===a||1===a&&r===o-1&&r===n+1?"":t.slice(r,o)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+"/"+n:n}(0,t)},parse:function(t){e(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return r;var n,o=t.charCodeAt(0),i=47===o;i?(r.root="/",n=1):n=0;for(var a=-1,s=0,u=-1,c=!0,f=t.length-1,l=0;f>=n;--f)if(47!==(o=t.charCodeAt(f)))-1===u&&(c=!1,u=f+1),46===o?-1===a?a=f:1!==l&&(l=1):-1!==a&&(l=-1);else if(!c){s=f+1;break}return-1===a||-1===u||0===l||1===l&&a===u-1&&a===s+1?-1!==u&&(r.base=r.name=0===s&&i?t.slice(1,u):t.slice(s,u)):(0===s&&i?(r.name=t.slice(1,a),r.base=t.slice(1,u)):(r.name=t.slice(s,a),r.base=t.slice(s,u)),r.ext=t.slice(a,u)),s>0?r.dir=t.slice(0,s-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,t.exports=n}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={id:t,loaded:!1,exports:{}};return e[t].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var o={};return(()=>{"use strict";n.d(o,{DecapCmsLibWidgets:()=>A});var t={};n.r(t),n.d(t,{SLUG_MISSING_REQUIRED_DATE:()=>$,addFileTemplateFields:()=>O,compileStringTemplate:()=>S,dateParsers:()=>m,expandPath:()=>w,extractTemplateVars:()=>M,keyToPathArray:()=>_,parseDateFromEntry:()=>b});var e={};n.r(e),n.d(e,{validateMinMax:()=>D});var r=n(2522),i=n(6123),a=n.n(i),s=n(7426),u=n.n(s),c=n(685),f=n.n(c),l=n(3464),h=n.n(l),p=n(9942);const d=[{pattern:/^upper$/,transform:t=>t.toUpperCase()},{pattern:/^lower$/,transform:t=>t.toLowerCase()},{pattern:/^date\('(.+)'\)$/,transform:(t,e)=>h()(t).format(e[1])},{pattern:/^default\('(.+)'\)$/,transform:(t,e)=>t||e[1]},{pattern:/^ternary\('(.*)',\s*'(.*)'\)$/,transform:(t,e)=>t?e[1]:e[2]},{pattern:/^truncate\(([0-9]+)(?:(?:,\s*['"])([^'"]*)(?:['"]))?\)$/,transform:(t,e)=>{const r=e[2]||"...",n=parseInt(e[1])+r.length;return f()(t,{length:n,omission:r})}}],v="fields.",g=" *([^}{| ]+)",y=`{{${g}( \\| ([^}{]+?))? *}}`;function x(t){return`0${t}`.slice(-2)}const m={year:t=>`${t.getUTCFullYear()}`,month:t=>x(t.getUTCMonth()+1),day:t=>x(t.getUTCDate()),hour:t=>x(t.getUTCHours()),minute:t=>x(t.getUTCMinutes()),second:t=>x(t.getUTCSeconds())};function b(t,e){if(!e)return;const r=t.getIn(["data",e]),n=r&&h()(r);return n&&n.isValid()?n.toDate():void 0}const $="SLUG_MISSING_REQUIRED_DATE";function _(t){if(!t)return[];const e=[],r=t.split("");let n,o=[];for(;n=r.shift();)["[","]","."].includes(n)?(o.length>0&&e.push(o.join("")),o=[]):o.push(n);return o.length>0&&e.push(o.join("")),e}function w({data:t,path:e,paths:r=[]}){e.endsWith(".*")&&(e+=".");const n=e.split(".*.");if(1===n.length)r.push(e);else{const e=n[0],o=a()(t,e);Array.isArray(o)&&o.forEach((o,i)=>{w({data:t,path:u()(`${e}.${i}.${n.slice(1).join(".*.")}`,"."),paths:r})})}return r}function S(t,e,n="",o=(0,r.Map)(),i){let a;const s=null!==e,u=t.replace(RegExp(y,"g"),(t,r,s,u)=>{let c;const f=function(t,e){if(!t.startsWith(v))return;const r=t.slice(v.length),n=e.getIn(_(r));return"object"==typeof n&&null!==n?JSON.stringify(n):n}(r,o);if(f)c=f;else{if(m[r]&&!e)return a=!0,"";c=m[r]?m[r](e):"slug"===r?n:o.getIn(_(r),"")}if(i)return i(c);{const t=function(t){if(t){let e=null;const r=d.find(r=>(e=t.match(r.pattern),!!e));if(r)return t=>r.transform(t,e)}return null}(u);t&&(c=t(c))}return c});if(s&&a){const t=new Error;throw t.name=$,t}return u}function M(t){const e=RegExp(y,"g"),r=RegExp(g,"g");return(t.match(e)||[]).map(t=>{const e=t.match(r);return e?e[0]:""})}function O(t,e,r=""){if(!t)return e;const n=(0,p.extname)(t),o=(0,p.basename)(t,n),i=(0,p.dirname)(t).replace(new RegExp(`^(/?)${r}/?`),"$1");return e.withMutations(t=>{t.set("dirname",i),t.set("filename",o),t.set("extension",""===n?n:n.slice(1))})}var j=n(986),C=n.n(j);function D(t,e,r,n,o){function i(r){return{type:"RANGE",message:t(`editor.editorControlPane.widget.${r}`,{fieldLabel:e,minCount:n,maxCount:o,count:n})}}return[n,o,null==r?void 0:r.size].every(C())&&(r.size<n||r.size>o)?i(n===o?"rangeCountExact":"rangeCount"):C()(n)&&n>0&&null!=r&&r.size&&r.size<n?i("rangeMin"):C()(o)&&null!=r&&r.size&&r.size>o?i("rangeMax"):void 0}const A={stringTemplate:t,validations:e}})(),o.DecapCmsLibWidgets})());
//# sourceMappingURL=decap-cms-lib-widgets.js.map