import{html as t}from"lit";import{v as e}from"../virtualize-a4a40d96.esm.js";import{unsafeHTML as i}from"lit/directives/unsafe-html.js";import{classMap as s}from"lit/directives/class-map.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";class r{static getVirtualizedContent(i,s,l,o,a,n,c,d,p,$,m,u,v,_,f,j){return t`
      <div part="select-options" class="select__options ${s?"select__options__search-enabled":""} ${v?"loading":""}">
        ${m&&!v?t`
              <div part="select-no-results" class="select__no-results">
                ${u||"No results found"}
              </div>
            `:t`
              <div
                class="virtualized"
                part="virtualized"
                @scroll=${_}
              >
                ${r.shouldUseVirtualizer(i)?t`
                      ${e({items:i,renderItem:t=>r.getItemRenderFunction(t,l,o,a,n,c,d,p,$,f,j),scroller:!0})}
                    `:t`
                      ${i.map((t=>r.getItemRenderFunction(t,l,o,a,n,c,d,p,$,f,j)))}
                    `}
              </div>
            `}
      </div>`}static getItemRenderFunction(e,r,l,o,a,n,c,d,p,$,m){if(!e)return t``;const u=a||r,v=n||(t=>t?.value||t),_=v(e),f=u(e),j=e?.disabled||!1,g=e?.className,h=(c?c(e):e?.description)??"",z=(d?d(e):e?.prefix)??"",b=(p?p(e):e?.suffix)??"";let y=!1;return y=o?Array.isArray(l)&&l.some((t=>String(t)===String(_))):(Array.isArray(l)?l[0]:l)===_,t`
      <nile-option
        value=${_} 
        .selected=${y} 
        .disabled=${j}
        .showCheckbox=${o}
        class=${s({option:m??!1,[g??""]:!!g})}
        .description=${h}
        .isDescriptionEnabled=${m}
      >
        ${i(z)}
        ${$?i(f):f}
        ${i(b)}
      </nile-option>
    `}static shouldUseVirtualizer(t){return t.length>=5}}export{r as V};
