1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Files
netbox-community-netbox/netbox/project-static/dist/netbox.js

68 lines
308 KiB
JavaScript
Raw Normal View History

(()=>{var lv=Object.create;var Un=Object.defineProperty,cv=Object.defineProperties,uv=Object.getOwnPropertyDescriptor,fv=Object.getOwnPropertyDescriptors,dv=Object.getOwnPropertyNames,Ml=Object.getOwnPropertySymbols,hv=Object.getPrototypeOf,Il=Object.prototype.hasOwnProperty,pv=Object.prototype.propertyIsEnumerable;var Io=(t,e,n)=>e in t?Un(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e)=>{for(var n in e||(e={}))Il.call(e,n)&&Io(t,n,e[n]);if(Ml)for(var n of Ml(e))pv.call(e,n)&&Io(t,n,e[n]);return t},Vi=(t,e)=>cv(t,fv(e)),kl=t=>Un(t,"__esModule",{value:!0});var C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mv=(t,e)=>{kl(t);for(var n in e)Un(t,n,{get:e[n],enumerable:!0})},gv=(t,e,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of dv(e))!Il.call(t,i)&&i!=="default"&&Un(t,i,{get:()=>e[i],enumerable:!(n=uv(e,i))||n.enumerable});return t},Oe=t=>gv(kl(Un(t!=null?lv(hv(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var G=(t,e,n)=>(Io(t,typeof e!="symbol"?e+"":e,n),n);var ke=(t,e,n)=>new Promise((i,o)=>{var s=f=>{try{c(n.next(f))}catch(u){o(u)}},a=f=>{try{c(n.throw(f))}catch(u){o(u)}},c=f=>f.done?i(f.value):Promise.resolve(f.value).then(s,a);c((n=n.apply(t,e)).next())});var pe=C((ck,pu)=>{var vr=function(t){return t&&t.Math==Math&&t};pu.exports=vr(typeof globalThis=="object"&&globalThis)||vr(typeof window=="object"&&window)||vr(typeof self=="object"&&self)||vr(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var me=C((uk,mu)=>{mu.exports=function(t){try{return!!t()}catch(e){return!0}}});var It=C((fk,gu)=>{var p_=me();gu.exports=!p_(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var hs=C(yu=>{"use strict";var vu={}.propertyIsEnumerable,bu=Object.getOwnPropertyDescriptor,m_=bu&&!vu.call({1:2},1);yu.f=m_?function(e){var n=bu(this,e);return!!n&&n.enumerable}:vu});var br=C((hk,Eu)=>{Eu.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}});var Dn=C((pk,_u)=>{var g_={}.toString;_u.exports=function(t){return g_.call(t).slice(8,-1)}});var vi=C((mk,Su)=>{var v_=me(),b_=Dn(),y_="".split;Su.exports=v_(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return b_(t)=="String"?y_.call(t,""):Object(t)}:Object});var rn=C((gk,wu)=>{wu.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t}});var bi=C((vk,Tu)=>{var E_=vi(),__=rn();Tu.exports=function(t){return E_(__(t))}});var Be=C((bk,xu)=>{xu.exports=function(t){return typeof t=="object"?t!==null:typeof t=="function"}});var ps=C((yk,Ou)=>{var yr=Be();Ou.exports=function(t,e){if(!yr(t))return t;var n,i;if(e&&typeof(n=t.toString)=="function"&&!yr(i=n.call(t))||typeof(n=t.valueOf)=="function"&&!yr(i=n.call(t))||!e&&typeof(n=t.toString)=="function"&&!yr(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}});var on=C((Ek,Au)=>{var S_=rn();Au.exports=function(t){return Object(S_(t))}});var Fe=C((_k,Cu)=>{var w_=on(),T_={}.hasOwnProperty;Cu.exports=Object.hasOwn||function(e,n){return T_.call(w_(e),n)}});var gs=C((Sk,Du)=>{var x_=pe(),Lu=Be(),ms=x_.document,O_=Lu(ms)&&Lu(ms.createElement);Du.exports=function(t){return O_?ms.createElement(t):{}}});var vs=C((wk,Mu)=>{var A_=It(),C_=me(),L_=gs();Mu.exports=!A_&&!C_(function(){return Object.defineProperty(L_("div"),"a",{get:function(){return 7}}).a!=7})});var bs=C(ku=>{var D_=It(),M_=hs(),I_=br(),k_=bi(),N_=ps(),P_=Fe(),R_=vs(),Iu=Object.getOwnPropertyDescriptor;ku.f=D_?Iu:function(e,n){if(e=k_(e),n=N_(n,!0),R_)try{return Iu(e,n)}catch(i){}if(P_(e,n))return I_(!M_.f.call(e,n),e[n])}});var ze=C((xk,Nu)=>{var j_=Be();Nu.exports=function(t){if(!j_(t))throw TypeError(String(t)+" is not an object");return t}});var kt=C(ju=>{var H_=It(),q_=vs(),Pu=ze(),$_=ps(),Ru=Object.defineProperty;ju.f=H_?Ru:function(e,n,i){if(Pu(e),n=$_(n,!0),Pu(i),q_)try{return Ru(e,n,i)}catch(o){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(e[n]=i.v
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`});var oh=C((qN,rh)=>{var ZT=rn(),ex=aa(),$r="["+ex+"]",tx=RegExp("^"+$r+$r+"*"),nx=RegExp($r+$r+"*$"),la=function(t){return function(e){var n=String(ZT(e));return t&1&&(n=n.replace(tx,"")),t&2&&(n=n.replace(nx,"")),n}};rh.exports={start:la(1),end:la(2),trim:la(3)}});var lh=C(($N,ah)=>{var ix=pe(),rx=oh().trim,sh=aa(),Br=ix.parseInt,ox=/^[+-]?0[Xx]/,sx=Br(sh+"08")!==8||Br(sh+"0x16")!==22;ah.exports=sx?function(e,n){var i=rx(String(e));return Br(i,n>>>0||(ox.test(i)?16:10))}:Br});var ca=C((FN,fh)=>{var lx=_i(),cx=rn(),uh=function(t){return function(e,n){var i=String(cx(e)),o=lx(n),s=i.length,a,c;return o<0||o>=s?t?"":void 0:(a=i.charCodeAt(o),a<55296||a>56319||o+1===s||(c=i.charCodeAt(o+1))<56320||c>57343?t?i.charAt(o):a:t?i.slice(o,o+2):(a-55296<<10)+(c-56320)+65536)}};fh.exports={codeAt:uh(!1),charAt:uh(!0)}});var ua=C((WN,ph)=>{var px=ln();ph.exports=function(t,e,n){for(var i in e)px(t,i,e[i],n);return t}});var gh=C((VN,mh)=>{var mx=me();mh.exports=!mx(function(){return Object.isExtensible(Object.preventExtensions({}))})});var Fr=C((YN,vh)=>{var gx=yi(),vx=Be(),fa=Fe(),bx=kt().f,yx=Tr(),Ex=gh(),fn=yx("meta"),_x=0,da=Object.isExtensible||function(){return!0},ha=function(t){bx(t,fn,{value:{objectID:"O"+ ++_x,weakData:{}}})},Sx=function(t,e){if(!vx(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!fa(t,fn)){if(!da(t))return"F";if(!e)return"E";ha(t)}return t[fn].objectID},wx=function(t,e){if(!fa(t,fn)){if(!da(t))return!0;if(!e)return!1;ha(t)}return t[fn].weakData},Tx=function(t){return Ex&&xx.REQUIRED&&da(t)&&!fa(t,fn)&&ha(t),t},xx=vh.exports={REQUIRED:!1,fastKey:Sx,getWeakData:wx,onFreeze:Tx};gx[fn]=!0});var yh=C((UN,bh)=>{var Ox=Te(),Ax=Mn(),Cx=Ox("iterator"),Lx=Array.prototype;bh.exports=function(t){return t!==void 0&&(Ax.Array===t||Lx[Cx]===t)}});var _h=C((KN,Eh)=>{var Dx=sa(),Mx=Mn(),Ix=Te(),kx=Ix("iterator");Eh.exports=function(t){if(t!=null)return t[kx]||t["@@iterator"]||Mx[Dx(t)]}});var wh=C((GN,Sh)=>{var Nx=ze();Sh.exports=function(t){var e=t.return;if(e!==void 0)return Nx(e.call(t)).value}});var pa=C((XN,xh)=>{var Px=ze(),Rx=yh(),jx=cn(),Hx=ks(),qx=_h(),Th=wh(),Ai=function(t,e){this.stopped=t,this.result=e};xh.exports=function(t,e,n){var i=n&&n.that,o=!!(n&&n.AS_ENTRIES),s=!!(n&&n.IS_ITERATOR),a=!!(n&&n.INTERRUPTED),c=Hx(e,i,1+o+a),f,u,l,m,d,p,b,y=function(v){return f&&Th(f),new Ai(!0,v)},h=function(v){return o?(Px(v),a?c(v[0],v[1],y):c(v[0],v[1])):a?c(v,y):c(v)};if(s)f=t;else{if(u=qx(t),typeof u!="function")throw TypeError("Target is not iterable");if(Rx(u)){for(l=0,m=jx(t.length);m>l;l++)if(d=h(t[l]),d&&d instanceof Ai)return d;return new Ai(!1)}f=u.call(t)}for(p=f.next;!(b=p.call(f)).done;){try{d=h(b.value)}catch(v){throw Th(f),v}if(typeof d=="object"&&d&&d instanceof Ai)return d}return new Ai(!1)}});var ma=C((QN,Oh)=>{Oh.exports=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t}});var Mh=C((JN,Dh)=>{var $x=Te(),Ah=$x("iterator"),Ch=!1;try{Lh=0,ga={next:function(){return{done:!!Lh++}},return:function(){Ch=!0}},ga[Ah]=function(){return this},Array.from(ga,function(){throw 2})}catch(t){}var Lh,ga;Dh.exports=function(t,e){if(!e&&!Ch)return!1;var n=!1;try{var i={};i[Ah]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(o){}return n}});var Nh=C((ZN,kh)=>{var Bx=Be(),Ih=Zs();kh.exports=function(t,e,n){var i,o;return Ih&&typeof(i=e.constructor)=="function"&&i!==n&&Bx(o=i.prototype)&&o!==n.prototype&&Ih(t,o),t}});var jh=C((eP,Rh)=>{"use strict";var Fx=Et(),zx=pe(),Ph=Ds(),Wx=ln(),Vx=Fr(),Yx=pa(),Ux=ma(),va=Be(),ba=me(),Kx=Mh(),Gx=Pr(),Xx=Nh();Rh.exports=function(t,e,n){var i=t.indexOf("Map")!==-1,o=t.indexOf("Weak")!==-1,s=i?"set":"add",a=zx[t],c=a&&a.prototype,f=a,u={},l=function(v){var S=c[v];Wx(c,v,v=="add"?function(O){return S.call(this,O===0?0:O),this}:v=="delete"?function(A){return o&&!va(A)?!1:S.call(this,A===0?0:A)}:v=="get"?function(O){return o&&!va(O)?void 0:S.call(this,O===0?0:O)}:v=="has"?function(O){retu
`)&&t.flags==="s")})});var Gp=C((TR,Kp)=>{var e0=me();Kp.exports=e0(function(){var t=RegExp("(?<a>b)","string".charAt(5));return t.exec("b").groups.a!=="b"||"b".replace(t,"$<a>c")!=="bc"})});var oo=C((xR,Jp)=>{"use strict";var t0=Fp(),Xp=Vp(),n0=wr(),i0=Nr(),r0=an().get,o0=Up(),s0=Gp(),ro=RegExp.prototype.exec,a0=n0("native-string-replace",String.prototype.replace),Ua=ro,Ka=function(){var t=/a/,e=/b*/g;return ro.call(t,"a"),ro.call(e,"a"),t.lastIndex!==0||e.lastIndex!==0}(),Qp=Xp.UNSUPPORTED_Y||Xp.BROKEN_CARET,Ga=/()??/.exec("")[1]!==void 0,l0=Ka||Ga||Qp||o0||s0;l0&&(Ua=function(e){var n=this,i=r0(n),o=i.raw,s,a,c,f,u,l,m;if(o)return o.lastIndex=n.lastIndex,s=Ua.call(o,e),n.lastIndex=o.lastIndex,s;var d=i.groups,p=Qp&&n.sticky,b=t0.call(n),y=n.source,h=0,v=e;if(p&&(b=b.replace("y",""),b.indexOf("g")===-1&&(b+="g"),v=String(e).slice(n.lastIndex),n.lastIndex>0&&(!n.multiline||n.multiline&&e[n.lastIndex-1]!==`
`)&&(y="(?: "+y+")",v=" "+v,h++),a=new RegExp("^(?:"+y+")",b)),Ga&&(a=new RegExp("^"+y+"$(?!\\s)",b)),Ka&&(c=n.lastIndex),f=ro.call(p?a:n,v),p?f?(f.input=f.input.slice(h),f[0]=f[0].slice(h),f.index=n.lastIndex,n.lastIndex+=f[0].length):n.lastIndex=0:Ka&&f&&(n.lastIndex=n.global?f.index+f[0].length:c),Ga&&f&&f.length>1&&a0.call(f[0],a,function(){for(u=1;u<arguments.length-2;u++)arguments[u]===void 0&&(f[u]=void 0)}),f&&d)for(f.groups=l=i0(null),u=0;u<d.length;u++)m=d[u],l[m[0]]=f[m[1]];return f});Jp.exports=Ua});var Xa=C(()=>{"use strict";var c0=Et(),Zp=oo();c0({target:"RegExp",proto:!0,forced:/./.exec!==Zp},{exec:Zp})});var Ja=C((CR,im)=>{"use strict";Xa();var em=ln(),u0=oo(),tm=me(),nm=Te(),f0=tt(),d0=nm("species"),Qa=RegExp.prototype;im.exports=function(t,e,n,i){var o=nm(t),s=!tm(function(){var u={};return u[o]=function(){return 7},""[t](u)!=7}),a=s&&!tm(function(){var u=!1,l=/a/;return t==="split"&&(l={},l.constructor={},l.constructor[d0]=function(){return l},l.flags="",l[o]=/./[o]),l.exec=function(){return u=!0,null},l[o](""),!u});if(!s||!a||n){var c=/./[o],f=e(o,""[t],function(u,l,m,d,p){var b=l.exec;return b===u0||b===Qa.exec?s&&!p?{done:!0,value:c.call(l,m,d)}:{done:!0,value:u.call(m,l,d)}:{done:!1}});em(String.prototype,t,f[0]),em(Qa,o,f[1])}i&&f0(Qa[o],"sham",!0)}});var Za=C((LR,rm)=>{"use strict";var h0=ca().charAt;rm.exports=function(t,e,n){return e+(n?h0(t,e).length:1)}});var el=C((DR,om)=>{var p0=Dn(),m0=oo();om.exports=function(t,e){var n=t.exec;if(typeof n=="function"){var i=n.call(t,e);if(typeof i!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return i}if(p0(t)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return m0.call(t,e)}});var lm=C((IR,am)=>{var _0=on(),S0=Math.floor,w0="".replace,T0=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,x0=/\$([$&'`]|\d{1,2})/g;am.exports=function(t,e,n,i,o,s){var a=n+t.length,c=i.length,f=x0;return o!==void 0&&(o=_0(o),f=T0),w0.call(s,f,function(u,l){var m;switch(l.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(a);case"<":m=o[l.slice(1,-1)];break;default:var d=+l;if(d===0)return u;if(d>c){var p=S0(d/10);return p===0?u:p<=c?i[p-1]===void 0?l.charAt(1):i[p-1]+l.charAt(1):u}m=i[d-1]}return m===void 0?"":m})}});var hm=C(rl=>{"use strict";rl.parse=W0;rl.serialize=V0;var B0=decodeURIComponent,F0=encodeURIComponent,z0=/; */,co=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function W0(t,e){if(typeof t!="string")throw new TypeError("argument str must be a string");for(var n={},i=e||{},o=t.split(z0),s=i.decode||B0,a=0;a<o.length;a++){var c=o[a],f=c.indexOf("=");if(!(f<0)){var u=c.substr(0,f).trim(),l=c.substr(++f,c.length).trim();l[0]=='"'&&(l=l.slice(1,-1)),n[u]==null&&(n[u]=Y0(l,s))}}return n}function V0(t,e,n){var i=n||{},o=i.encode||F0;if(typeof o!="function")throw new TypeError("option encode is invalid");if(!co.test(t))throw new TypeError("argument name is invalid");var s=o(e);if(s&&!co.test(s))throw new TypeError("argument val is invalid");var a=t+"="+s;if(i.maxAge!=null){var c=i.maxAge-0;if(isNaN(c)||!isFinite(c))throw new TypeError("option maxAge is invalid");a+="; Max-Age="+Math.floor(c)}if(i.domain){if(!co.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain="+i.domain}if(i.path){if(!co.test(i.path))throw new TypeError("option path is invalid");a+="; Path="+i.path}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var f=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(f){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a}function Y0(t,e){try{return e(t)}catch(n){return t}}});var cl=C((xm,fo)=>{(function(t,e){typeof define=="function"&&define.amd?define(e):typeof fo=="object"&&fo.exports?fo.expo
<span class='flatpickr-weekday'>
`+E.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function Fg(){r.calendarContainer.classList.add("hasWeeks");var g=u("div","flatpickr-weekwrapper");g.appendChild(u("span","flatpickr-weekday",r.l10n.weekAbbreviation));var E=u("div","flatpickr-weeks");return g.appendChild(E),{weekWrapper:g,weekNumbers:E}}function To(g,E){E===void 0&&(E=!0);var w=E?g:g-r.currentMonth;w<0&&r._hidePrevMonthArrow===!0||w>0&&r._hideNextMonthArrow===!0||(r.currentMonth+=w,(r.currentMonth<0||r.currentMonth>11)&&(r.currentYear+=r.currentMonth>11?1:-1,r.currentMonth=(r.currentMonth+12)%12,Z("onYearChange"),Fn()),Hi(),Z("onMonthChange"),Fi())}function zg(g,E){g===void 0&&(g=!0),E===void 0&&(E=!0),r.input.value="",r.altInput!==void 0&&(r.altInput.value=""),r.mobileInput!==void 0&&(r.mobileInput.value=""),r.selectedDates=[],r.latestSelectedDateObj=void 0,E===!0&&(r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth()),r.showTimeInput=!1,r.config.enableTime===!0&&ye(),r.redraw(),g&&Z("onChange")}function Wg(){r.isOpen=!1,r.isMobile||(r.calendarContainer!==void 0&&r.calendarContainer.classList.remove("open"),r._input!==void 0&&r._input.classList.remove("active")),Z("onClose")}function Vg(){r.config!==void 0&&Z("onDestroy");for(var g=r._handlers.length;g--;){var E=r._handlers[g];E.element.removeEventListener(E.event,E.handler,E.options)}if(r._handlers=[],r.mobileInput)r.mobileInput.parentNode&&r.mobileInput.parentNode.removeChild(r.mobileInput),r.mobileInput=void 0;else if(r.calendarContainer&&r.calendarContainer.parentNode)if(r.config.static&&r.calendarContainer.parentNode){var w=r.calendarContainer.parentNode;if(w.lastChild&&w.removeChild(w.lastChild),w.parentNode){for(;w.firstChild;)w.parentNode.insertBefore(w.firstChild,w);w.parentNode.removeChild(w)}}else r.calendarContainer.parentNode.removeChild(r.calendarContainer);r.altInput&&(r.input.type="text",r.altInput.parentNode&&r.altInput.parentNode.removeChild(r.altInput),delete r.altInput),r.input&&(r.input.type=r.input._type,r.input.classList.remove("flatpickr-input"),r.input.removeAttribute("readonly"),r.input.value=""),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(I){try{delete r[I]}catch(R){}})}function zn(g){return r.config.appendTo&&r.config.appendTo.contains(g)?!0:r.calendarContainer.contains(g)}function xo(g){if(r.isOpen&&!r.config.inline){var E=p(g),w=zn(E),I=E===r.input||E===r.altInput||r.element.contains(E)||g.path&&g.path.indexOf&&(~g.path.indexOf(r.input)||~g.path.indexOf(r.altInput)),R=g.type==="blur"?I&&g.relatedTarget&&!zn(g.relatedTarget):!I&&!w&&!zn(g.relatedTarget),P=!r.config.ignoredFocusElements.some(function(q){return q.contains(E)});R&&P&&(r.timeContainer!==void 0&&r.minuteElement!==void 0&&r.hourElement!==void 0&&ee(),r.close(),r.config.mode==="range"&&r.selectedDates.length===1&&(r.clear(!1),r.redraw()))}}function qi(g){if(!(!g||r.config.minDate&&g<r.config.minDate.getFullYear()||r.config.maxDate&&g>r.config.maxDate.getFullYear())){var E=g,w=r.currentYear!==E;r.currentYear=E||r.currentYear,r.config.maxDate&&r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth=Math.min(r.config.maxDate.getMonth(),r.currentMonth):r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&(r.currentMonth=Math.max(r.config.minDate.getMonth(),r.currentMonth)),w&&(r.redraw(),Z("onYearChange"),Fn())}}function Ht(g,E){E===void 0&&(E=!0);var w=r.parseDate(g,void 0,E);if(r.config.minDate&&w&&k(w,r.config.minDate,E!==void 0?E:!r.minDateHasTime)<0||r.config.maxDate&&w&&k(w,r.config.maxDate,E!==void 0?E:!r.maxDateHasTime)>0)return!1;if(r.config.enable.length===0&&r.config.disable.length===0)return!0;if(w===void 0)return!1;for(var I=r.
`)}:!a.ok&&"detail"in f?{error:f.detail}:f})}function uo(t,e){return ke(this,null,function*(){return yield vm(t,"PATCH",e)})}function K0(t){return ke(this,null,function*(){return yield vm(t,"GET")})}function bm(t){return ke(this,null,function*(){return yield K0(t)})}function*H(...t){for(let e of t)for(let n of document.querySelectorAll(e))n!==null&&(yield n)}function vn(t){return document.getElementById(t)}function ym(t,e=0){let n=e,i=document.getElementById("content-title");i!==null&&(n+=i.getBoundingClientRect().bottom);let o=t.getBoundingClientRect().top+window.pageYOffset+n;window.scrollTo({top:o,behavior:"smooth"})}function Em(t){let e=[];for(let n of t.querySelectorAll("select"))if(n!==null){let i={name:n.name,options:[]};for(let o of n.options)o.selected&&i.options.push(o.value);e=[...e,i]}return e}function*_m(t){for(let e of t.querySelectorAll("td"))e!==null&&ie(e.innerText)&&e.innerText!=="\u2014"&&(yield e.innerText.replaceAll(/[\n\r]/g,"").trim())}function Le(t,e,n){function i(s){return!!(typeof n=="string"&&s!==null&&s.matches(n))}function o(s){if(s!==null&&s.parentElement!==null&&!i(s)){for(let a of s.parentElement.querySelectorAll(e))if(a!==null)return a;return o(s.parentElement.parentElement)}return null}return o(t)}function al(t,e,n,i=[]){let o=document.createElement(t);for(let s of Object.keys(e)){let a=s,c=e[a];a in o&&(o[a]=c)}o.classList.add(...n);for(let s of i)o.appendChild(s);return o}function Sm(t,e){let n=new Map;for(let i of t){let o=i[e];n.has(o)||n.set(o,i)}return Array.from(n.values())}function G0(t){t.preventDefault();let e=t.currentTarget;if(e!==null){let n=Le(e,"form"),i=e.getAttribute("href");n!==null&&ie(i)&&(n.setAttribute("action",i),n.submit())}}function X0(){for(let t of H("a.formaction"))t.addEventListener("click",G0)}function Q0(){for(let t of H("a.set_speed"))if(t!==null){let e=function(n){n.preventDefault();let i=t.getAttribute("data"),o=document.getElementById(t.target);o!==null&&i!==null&&(o.value=i)};t.addEventListener("click",e)}}function J0(t,e){let n=new Set;for(let i of e.querySelectorAll("*[name]"))i.validity.valid?(i.classList.contains("is-invalid")&&i.classList.remove("is-invalid"),i.classList.contains("is-valid")||i.classList.add("is-valid")):(n.add(i.name),i.classList.contains("is-valid")&&i.classList.remove("is-valid"),i.classList.contains("is-invalid")||i.classList.add("is-invalid"));if(n.size!==0){let i=e.elements.namedItem(Array.from(n)[0]);ym(i),t.preventDefault()}}function Z0(){for(let t of H("form")){let e=t.querySelectorAll("button[type=submit]");for(let n of e)n.addEventListener("click",i=>J0(i,t))}}function eC(t){let e=Array.from(t.options);for(let n=1;n<e.length;n++){let i=e[n];i.selected&&(t.removeChild(i),t.insertBefore(i,t.options[n-1]))}}function tC(t){let e=Array.from(t.options);for(let n=e.length-2;n>=0;n--){let i=e[n];if(i.selected){let o=t.options[n+1];i=t.removeChild(i),o=t.replaceChild(i,o),t.insertBefore(o,i)}}}function nC(){for(let t of H("#move-option-up")){let e=t.getAttribute("data-target");if(e!==null)for(let n of H(`#${e}`))t.addEventListener("click",()=>eC(n))}for(let t of H("#move-option-down")){let e=t.getAttribute("data-target");if(e!==null)for(let n of H(`#${e}`))t.addEventListener("click",()=>tC(n))}}var wm={region:{hide:["id_sitegroup","id_site","id_location","id_rack","id_clustergroup","id_cluster"],show:["id_region"]},"site group":{hide:["id_region","id_site","id_location","id_rack","id_clustergroup","id_cluster"],show:["id_sitegroup"]},site:{hide:["id_location","id_rack","id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site"]},location:{hide:["id_rack","id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site","id_location"]},rack:{hide:["id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site","id_location","id_rack"]},"cluster group":{hide:["id_region","id_sitegroup","id_site","id_location","id_rack","id_cluster"],show:["id_clustergroup"]},cluster:{hide:["id_region","id_sitegroup","id_site","id_location","id_rack"],show:["id_clustergroup","id_cluster"]},default:{hide:["id_reg
div.ss-values div.ss-value[data-id="${n}"],
div.ss-list div.ss-option:not(.ss-disabled)[data-id="${n}"]
{
background-color: ${s} !important;
color: ${a} !important;
}
`.replaceAll(`
`,"").trim(),document.head.appendChild(o)}}resetClasses(){let e=this.slim.slim;if(e)for(let n of this.base.classList)e.container.classList.remove(n)}initResetButton(){let e=Le(this.base,"button[data-reset-select]");e!==null&&e.addEventListener("click",()=>{window.location.assign(window.location.origin+window.location.pathname)})}initRefreshButton(){if(this.allowRefresh){let e=al("button",{type:"button"},["btn","btn-sm","btn-ghost-dark"],[al("i",{},["mdi","mdi-reload"])]);e.addEventListener("click",()=>this.loadData()),this.slim.slim.search.container.appendChild(e)}}};function cg(){for(let t of H(".netbox-api-select"))new lg(t)}function ug(t){return typeof t.value=="string"&&t.value!==""}function fg(){for(let t of H("select.netbox-color-select")){let n=function(i){if(e.slim.singleSelected!==null)if(ug(i)){let o=`#${i.value}`,s=Pi(o);e.slim.singleSelected.container.style.backgroundColor=o,e.slim.singleSelected.container.style.color=s}else e.slim.singleSelected.container.removeAttribute("style")};for(let i of t.options)if(ug(i)){let o=`#${i.value}`,s=Pi(o);i.style.backgroundColor=o,i.style.color=s}let e=new $n({select:t,allowDeselect:!0,deselectLabel:'<i class="mdi mdi-close-circle" style="color: currentColor;"></i>'});for(let i of e.data.data)if("selected"in i&&i.selected){n(i);break}for(let i of t.classList)e.slim.container.classList.remove(i);e.onChange=n}}function dg(){for(let t of H(".netbox-static-select"))if(t!==null){let e=document.querySelector(`label[for=${t.id}]`),n;e!==null&&(n=`Select ${e.innerText.trim()}`);let i=new $n({select:t,allowDeselect:!0,deselectLabel:'<i class="mdi mdi-close-circle"></i>',placeholder:n});for(let o of t.classList)i.slim.container.classList.remove(o)}}function hg(){for(let t of[cg,fg,dg])t()}var Bn="netbox-color-mode",PC="Light Mode",RC="Dark Mode",pg="mdi-lightbulb-on",mg="mdi-lightbulb";function jC(t){return t==="dark"||t==="light"}function HC(t){return localStorage.setItem(Bn,t)}function qC(t){var e,n;document.documentElement.setAttribute(`data-${Bn}`,t);for(let i of H("span.color-mode-text"))t==="light"?i.innerText=RC:t==="dark"&&(i.innerText=PC);for(let i of H("i.color-mode-icon","span.color-mode-icon"))t==="light"?(i.classList.remove(pg),i.classList.add(mg)):t==="dark"&&(i.classList.remove(mg),i.classList.add(pg));for(let i of H(".rack_elevation")){let o=(n=(e=i.contentDocument)==null?void 0:e.querySelector("svg"))!=null?n:null;o!==null&&o.setAttribute(`data-${Bn}`,t)}}function Ue(t){for(let e of[HC,qC])e(t)}function $C(){let t=localStorage.getItem(Bn);t==="light"?Ue("dark"):t==="dark"?Ue("light"):console.warn("Unable to determine the current color mode")}function BC(){let t=localStorage.getItem(Bn),e=document.documentElement.getAttribute(`data-${Bn}`);if(ie(e)&&ie(t))return Ue(t);let n="none";for(let i of["dark","light"])if(window.matchMedia(`(prefers-color-scheme: ${i})`).matches){n=i;break}if(ie(t)&&!ie(e)&&jC(t))return Ue(t);switch(n){case"dark":return Ue("dark");case"light":return Ue("light");case"none":return Ue("light");default:return Ue("light")}}function FC(){for(let t of H("button.color-mode-toggle"))t.addEventListener("click",$C)}function gg(){window.addEventListener("load",BC);for(let t of[FC])t()}function zC(t){let e=t.getAttribute("data"),n=t.classList.contains("connected"),i=n?"planned":"connected";ie(e)&&uo(`/api/dcim/cables/${e}/`,{status:i}).then(o=>{var s;if(jn(o)){Hn("danger","Error",o.error).show();return}else{let a=(s=t.parentElement)==null?void 0:s.parentElement,c=t.querySelector("i.mdi, span.mdi");n?(a.classList.remove("success"),a.classList.add("info"),t.classList.remove("connected","btn-warning"),t.classList.add("btn-info"),t.title="Mark Installed",c.classList.remove("mdi-lan-disconnect"),c.classList.add("mdi-lan-connect")):(a.classList.remove("info"),a.classList.add("success"),t.classList.remove("btn-success"),t.classList.add("connected","btn-warning"),t.title="Mark Installed",c.classList.remove("mdi-lan-connect"),c.classList.add("mdi-lan-disconnect"))}})}function WC(){for(let t of H("button.cable-toggle"))t.addEventListener("click",()=>zC(t))}function
/* flatpickr v4.6.3, @license MIT */
/*!
* Bootstrap v5.0.2 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Masonry v4.2.2
* Cascading grid layout library
* https://masonry.desandro.com
* MIT License
* by David DeSandro
*/
/*!
* Outlayer v2.1.1
* the brains and guts of a layout library
* MIT license
*/
/*!
* clipboard.js v2.0.6
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* getSize v2.0.3
* measure size of elements
* MIT license
*/
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
//# sourceMappingURL=netbox.js.map