import{filterEmpty as e}from"../../_util/props-util/index.mjs";var t=t=>t!=null&&(!Array.isArray(t)||e(t).length);function n(e){return t(e.prefix)||t(e.suffix)||t(e.allowClear)}function r(e){return t(e.addonBefore)||t(e.addonAfter)}function i(e){return e==null?``:String(e)}function a(e,t,n,r){if(!n)return;let i=t;if(t.type===`click`){Object.defineProperty(i,"target",{writable:!0}),Object.defineProperty(i,"currentTarget",{writable:!0});let t=e.cloneNode(!0);i.target=t,i.currentTarget=t,t.value=``,n(i);return}if(r!==void 0){Object.defineProperty(i,"target",{writable:!0}),Object.defineProperty(i,"currentTarget",{writable:!0}),i.target=e,i.currentTarget=e,e.value=r,n(i);return}n(i)}function o(e,t){if(!e)return;e.focus(t);let{cursor:n}=t||{};if(n){let t=e.value.length;switch(n){case`start`:e.setSelectionRange(0,0);break;case`end`:e.setSelectionRange(t,t);break;default:e.setSelectionRange(0,t)}}}export{i as fixControlledValue,r as hasAddon,n as hasPrefixSuffix,a as resolveOnChange,o as triggerFocus};