UNPKG

ruru

Version:

Grafast-flavoured GraphiQL distribution

2 lines 4.11 kB
export const __webpack_id__=6973;export const __webpack_ids__=[6973];export const __webpack_modules__={17531:(t,e,s)=>{s.d(e,{N:()=>a,v:()=>r});var i=s(72015);const n=[];function r(t,e,s){e instanceof i.d||(e=new i.d(e,[],Boolean(s))),n.push([t,e])}function a(){return n}},26973:(t,e,s)=>{s.r(e),s.d(e,{ILanguageFeatureDebounceService:()=>l,LanguageFeatureDebounceService:()=>g});var i=s(58053),n=s(27735),r=s(68175),a=s(63056),u=s(17531),o=s(35184),c=s(69570),_=s(54835),h=function(t,e){return function(s,i){e(s,i,t)}};const l=(0,o.u1)("ILanguageFeatureDebounceService");var d;!function(t){const e=new WeakMap;let s=0;t.of=function(t){let i=e.get(t);return void 0===i&&(i=++s,e.set(t,i)),i}}(d||(d={}));class v{constructor(t){this._default=t}get(t){return this._default}update(t,e){return this._default}default(){return this._default}}class f{constructor(t,e,s,i,r,a){this._logService=t,this._name=e,this._registry=s,this._default=i,this._min=r,this._max=a,this._cache=new n.qK(50,.7)}_key(t){return t.id+this._registry.all(t).reduce((t,e)=>(0,i.sN)(d.of(e),t),0)}get(t){const e=this._key(t),s=this._cache.get(e);return s?(0,r.qE)(s.value,this._min,this._max):this.default()}update(t,e){const s=this._key(t);let i=this._cache.get(s);i||(i=new r.mu(6),this._cache.set(s,i));const n=(0,r.qE)(i.update(e),this._min,this._max);return(0,_.v$)(t.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${t.uri.toString()} is ${n}ms`),n}_overall(){const t=new r.Uq;for(const[,e]of this._cache)t.update(e.value);return t.value}default(){const t=0|this._overall()||this._default;return(0,r.qE)(t,this._min,this._max)}}let g=class{constructor(t,e){this._logService=t,this._data=new Map,this._isDev=e.isExtensionDevelopment||!e.isBuilt}for(t,e,s){const i=s?.min??50,n=s?.max??i**2,r=s?.key??void 0,a=`${d.of(t)},${i}${r?","+r:""}`;let u=this._data.get(a);return u||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${e}] is disabled in developed mode`),u=new v(1.5*i)):u=new f(this._logService,e,t,0|this._overallAverage()||1.5*i,i,n),this._data.set(a,u)),u}_overallAverage(){const t=new r.Uq;for(const e of this._data.values())t.update(e.default());return t.value}};g=function(t,e,s,i){var n,r=arguments.length,a=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,i);else for(var u=t.length-1;u>=0;u--)(n=t[u])&&(a=(r<3?n(a):r>3?n(e,s,a):n(e,s))||a);return r>3&&a&&Object.defineProperty(e,s,a),a}([h(0,c.rr),h(1,a.k)],g),(0,u.v)(l,g,1)},35184:(t,e,s)=>{var i;s.d(e,{_$:()=>i,_Y:()=>n,u1:()=>r}),function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies",t.getServiceDependencies=function(e){return e[t.DI_DEPENDENCIES]||[]}}(i||(i={}));const n=r("instantiationService");function r(t){if(i.serviceIds.has(t))return i.serviceIds.get(t);const e=function(t,s,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(t,e,s){e[i.DI_TARGET]===e?e[i.DI_DEPENDENCIES].push({id:t,index:s}):(e[i.DI_DEPENDENCIES]=[{id:t,index:s}],e[i.DI_TARGET]=e)}(e,t,n)};return e.toString=()=>t,i.serviceIds.set(t,e),e}},63056:(t,e,s)=>{s.d(e,{k:()=>i});const i=(0,s(35184).u1)("environmentService")},68175:(t,e,s)=>{function i(t,e,s){return Math.min(Math.max(t,e),s)}s.d(e,{Uq:()=>n,mu:()=>r,qE:()=>i});class n{constructor(){this._n=1,this._val=0}update(t){return this._val=this._val+(t-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class r{constructor(t){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(t),this._values.fill(0,0,t)}update(t){const e=this._values[this._index];return this._values[this._index]=t,this._index=(this._index+1)%this._values.length,this._sum-=e,this._sum+=t,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}},72015:(t,e,s)=>{s.d(e,{d:()=>i});class i{constructor(t,e=[],s=!1){this.ctor=t,this.staticArguments=e,this.supportsDelayedInstantiation=s}}}}; //# sourceMappingURL=6973.js.map