import{co as T,cQ as x,cR as F,s as M,bf as P,y as m,f as o,ag as s,L as C,E as S,G as E,bh as b,c6 as R,O as V,bb as v,k as _,z as p,P as u,Q as a,a1 as B}from"./index-BPRWoLf4.js";var g=[];function w(i){i===void 0&&(i="amis-icon-manage-mount-node");var n=document.getElementById(i);if(n)return n;var e=document.createElement("div");return e.setAttribute("id",i),e.setAttribute("style","width:0;height:0;visibility:hidden;"),document.body.firstElementChild?document.body.insertBefore(e,document.body.firstElementChild):document.body.appendChild(e),e}function N(i,n){var e=w(n);e&&(e.innerHTML=i)}var f=null;function A(i){if(i&&typeof i=="function")f=function(){return i({setSvgIconList:L,mountIconSpriteToDom:N})};else throw f=null,new Error("setRefreshSvgListAction need a function param, not "+typeof i)}function L(i,n,e){n===void 0&&(n=!0),e===void 0&&(e=F());var t=T(i),r=x(e);if(n){var l=t.map(function(d){return d.children}).flat();g=[{name:r("IconSelect.all"),groupId:"all",children:l}].concat(i)}else g=i}const k=Object.freeze(Object.defineProperty({__proto__:null,mountIconSpriteToDom:N,get refreshIconList(){return f},setRefreshSvgListAction:A,setSvgIconList:L,get svgIcons(){return g}},Symbol.toStringTag,{value:"Module"}));var D=function(i){M(n,i);function n(e){var t=i.call(this,e)||this;return t.state={activeTypeIndex:0,showModal:!1,tmpCheckIconId:null,searchValue:"",isRefreshLoading:!1},t.handleSearchValueChange=P(t.handleSearchValueChange.bind(t),300),t}return n.prototype.getSvgName=function(e){var t;return typeof e=="string"?((t=/data-name="(.*?)"/.exec(e))===null||t===void 0?void 0:t[1])||"":(e==null?void 0:e.name)||(e==null?void 0:e.id)||""},n.prototype.getSvgId=function(e){var t;return typeof e=="string"?((t=/data-id="(.*?)"/.exec(e))===null||t===void 0?void 0:t[1])||"":(e==null?void 0:e.id)||""},n.prototype.getValueBySvg=function(e){var t;if(!e)return null;if(typeof e!="string")return m(m({},e),{svg:(t=e.svg)===null||t===void 0?void 0:t.replace(/'/g,"")});var r=this.getSvgName(e),l=this.getSvgId(e);return{name:r,id:l,svg:e.replace(/'/g,"")}},n.prototype.handleClick=function(){this.props.disabled||this.toggleModel(!0)},n.prototype.handleClear=function(e){e.preventDefault(),e.stopPropagation(),this.props.onChange&&this.props.onChange("")},n.prototype.renderInputArea=function(){var e=this.props,t=e.classPrefix,r=e.disabled,l=e.value,d=e.placeholder,h=e.clearable,c=this.getValueBySvg(l);return o.createElement("div",{className:s("".concat(t,"IconSelectControl-input-area"))},o.createElement("div",{className:s("".concat(t,"IconSelectControl-input-icon-show"))},o.createElement(C,{icon:c==null?void 0:c.svg,className:"icon"})),o.createElement("span",{className:s("".concat(t,"IconSelectControl-input-icon-id"))},c==null?void 0:c.name),h&&!r&&c?o.createElement("a",{onClick:this.handleClear,className:s("".concat(t,"IconSelectControl-clear"))},o.createElement(C,{icon:"input-clear",className:"icon"})):null,!c&&d&&o.createElement("span",{className:s("".concat(t,"IconSelectControl-input-icon-placeholder"))},d)||null)},n.prototype.handleIconTypeClick=function(e,t){this.setState({activeTypeIndex:t})},n.prototype.renderIconTypes=function(){var e=this,t=this.props.classPrefix,r=g.map(function(l){return{id:l.groupId,label:l.name}});return o.createElement("ul",{className:s("".concat(t,"IconSelectControl-type-list"))},r.map(function(l,d){return o.createElement("li",{key:l.id,onClick:function(){return e.handleIconTypeClick(l,d)},className:s({active:d===e.state.activeTypeIndex})},l.label)}))},n.prototype.handleConfirm=function(){var e=this.state.tmpCheckIconId;if(this.props.returnSvg){var t=e&&e.svg||"";t=t.replace(/