import{getStatusCodesFromWarp10 as t}from"@clevercloud/client/esm/access-logs.js";import{getWarp10AccessLogsToken as e}from"@clevercloud/client/esm/api/v2/warp-10.js";import{THIRTY_SECONDS as o}from"@clevercloud/client/esm/request.fetch-with-timeout.js";import{ONE_DAY as n}from"@clevercloud/client/esm/with-cache.js";import{sendToApi as i,sendToWarp as a}from"./lib/send-to-api.js";import{defineSmartComponent as s}from"./lib/smart/define-smart-component.js";import"./cc-smart-container.js";import"./cc-tile-status-codes.js";s({selector:"cc-tile-status-codes",params:{apiConfig:{type:Object},ownerId:{type:String},appId:{type:String,optional:!0}},onContextUpdate({context:s,updateComponent:r,signal:p}){const{apiConfig:c,ownerId:l,appId:d}=s;r("state",{type:"loading"}),async function({apiConfig:s,signal:r,ownerId:p,appId:c}){const l=await e({orgaId:p}).then(i({apiConfig:s,signal:r,cacheDelay:n}));return t({warpToken:l,ownerId:p,appId:c}).then(a({apiConfig:s,signal:r,timeout:o})).then((t=>{for(const e in t){parseInt(e)<100&&delete t[e]}return t}))}({apiConfig:c,signal:p,ownerId:l,appId:d}).then((t=>{r("state",{type:"loaded",statusCodes:t})})).catch((t=>{console.log(t),r("state",{type:"error"})}))}});
//# sourceMappingURL=cc-tile-status-codes.smart.js.map
