@farris/ui-vue 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.esm.js +103 -99
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +301 -351
- package/components/avatar/index.umd.cjs +1 -1
- package/components/binding-selector/index.esm.js +444 -0
- package/components/binding-selector/index.umd.cjs +1 -0
- package/components/binding-selector/package.json +8 -0
- package/components/border-editor/index.esm.js +5 -3
- package/components/border-editor/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +143 -139
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +407 -396
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +266 -255
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +628 -641
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +379 -374
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +471 -471
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +155 -148
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +487 -478
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +330 -279
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1171 -1277
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +220 -204
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4743 -4641
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +2916 -3019
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +2375 -2590
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +9518 -1198
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +2 -1
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +34 -38
- package/components/drawer/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +149 -138
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1602 -1740
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +159 -151
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +218 -218
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +311 -0
- package/components/event-parameter/index.umd.cjs +1 -0
- package/components/event-parameter/package.json +8 -0
- package/components/events-editor/index.css +1 -1
- package/components/events-editor/index.esm.js +533 -563
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +95 -91
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +2356 -2455
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +3048 -3308
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +10537 -3249
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +9781 -1327
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +353 -341
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +510 -827
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +278 -268
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +144 -136
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +2139 -2237
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +6414 -6367
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +5216 -5114
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +252 -252
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +70 -70
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +486 -984
- package/components/nav/index.umd.cjs +3 -3
- package/components/number-range/index.esm.js +446 -498
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +363 -388
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1050 -1308
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +134 -131
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1072 -1082
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +412 -910
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +214 -203
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +1361 -1536
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +650 -677
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +12344 -5048
- package/components/query-solution/index.umd.cjs +6 -1
- package/components/radio-button/index.esm.js +97 -97
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.css +1 -1
- package/components/radio-group/index.esm.js +1821 -565
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +251 -244
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +151 -140
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +707 -676
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +719 -740
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +4977 -5249
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +145 -134
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +348 -337
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +141 -130
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +311 -301
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +231 -220
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +385 -432
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +1932 -1914
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +351 -340
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +209 -199
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +388 -415
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +619 -666
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +493 -486
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +3169 -3278
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2320 -2418
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +563 -554
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +287 -276
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +368 -324
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +498 -487
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +51302 -47651
- package/farris.all.umd.cjs +14 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/binding-selector/index.d.ts +55 -0
- package/types/binding-selector/src/binding-selector.component.d.ts +11 -0
- package/types/binding-selector/src/binding-selector.props.d.ts +52 -0
- package/types/binding-selector/src/components/binding-selector-container.component.d.ts +13 -0
- package/types/binding-selector/src/composition/use-field-selection.d.ts +9 -0
- package/types/combo-list/src/components/list-container.component.d.ts +6 -6
- package/types/combo-list/src/components/list-container.props.d.ts +1 -1
- package/types/combo-tree/src/components/tree-container.component.d.ts +5 -5
- package/types/common/entity/entity-schema.d.ts +26 -11
- package/types/common/index.d.ts +1 -0
- package/types/common/types.d.ts +2 -2
- package/types/condition/src/condition-fields.design.component.d.ts +18 -0
- package/types/condition/src/types.d.ts +6 -6
- package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +20 -0
- package/types/data-grid/src/{designer/data-grid-column.props.d.ts → data-grid-column.props.d.ts} +1 -1
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/grid-field-editor.component.d.ts +14 -14
- package/types/data-grid/src/schema/schema-resolver.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +2 -2
- package/types/date-picker/src/components/calendar/calendar.component.d.ts +3 -3
- package/types/date-picker/src/components/month/month.component.d.ts +3 -3
- package/types/date-picker/src/components/year/year.component.d.ts +3 -3
- package/types/designer-canvas/index.d.ts +2 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/function/drag-resolve.d.ts +5 -0
- package/types/designer-canvas/src/composition/types.d.ts +49 -40
- package/types/designer-canvas/src/types.d.ts +8 -20
- package/types/dynamic-form/index.d.ts +1 -1
- package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +3 -0
- package/types/dynamic-form/src/schema/{schema-resolver.d.ts → response-form-schema-resolver.d.ts} +1 -1
- package/types/dynamic-form/src/types.d.ts +1 -1
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +5 -0
- package/types/dynamic-resolver/src/converter/row-number.converter.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +7 -0
- package/types/entity-binding-selector/entity-binding-selector.component.d.ts +11 -0
- package/types/entity-binding-selector/entity-binding-selector.props.d.ts +3 -0
- package/types/enum-editor/src/components/enum-editor-container.component.d.ts +3 -3
- package/types/enum-editor/src/enum-editor.component.d.ts +3 -3
- package/types/event-parameter/index.d.ts +31 -0
- package/types/event-parameter/src/composition/type.d.ts +77 -0
- package/types/event-parameter/src/composition/use-editor-combotree.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-input.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-select.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-switch.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor.d.ts +3 -0
- package/types/event-parameter/src/event-parameter.component.d.ts +8 -0
- package/types/event-parameter/src/event-parameter.props.d.ts +34 -0
- package/types/external-container/src/designer/import-external-schema.component.d.ts +1 -1
- package/types/field-selector/src/field-selector.component.d.ts +1 -2
- package/types/field-selector/src/field-selector.props.d.ts +0 -9
- package/types/input-group/src/designer/use-input-group-rules.d.ts +1 -2
- package/types/list-view/src/designer/list-view-table.design.component.d.ts +15 -0
- package/types/list-view/src/list-view-table.component.d.ts +15 -0
- package/types/lookup/src/composition/use-user-data.d.ts +2 -2
- package/types/lookup/src/property-config/lookup.property-config.d.ts +2 -6
- package/types/modal/src/composition/modal.service.d.ts +2 -1
- package/types/page-header/src/designer/page-header.design.component.d.ts +1 -1
- package/types/page-header/src/page-header.component.d.ts +1 -1
- package/types/property-panel/index.d.ts +2 -1
- package/types/property-panel/src/composition/entity/property-entity.d.ts +1 -1
- package/types/property-panel/src/composition/type.d.ts +0 -13
- package/types/query-solution/src/composition/types.d.ts +35 -4
- package/types/query-solution/src/composition/use-header.d.ts +21 -0
- package/types/query-solution/src/composition/{use-filter.d.ts → use-http.d.ts} +2 -2
- package/types/query-solution/src/composition/use-solution.d.ts +20 -0
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +17 -16
- package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +14 -14
- package/types/query-solution/src/property-config/query-solution.property-config.d.ts +3 -51
- package/types/query-solution/src/query-solution.d.ts +10 -2
- package/types/radio-group/src/designer/item-collection-editor-inner.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.props.d.ts +21 -0
- package/types/radio-group/src/schema/schema-mapper.d.ts +1 -0
- package/types/radio-group/src/schema/schema-resolver.d.ts +1 -0
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -0
- package/types/section/src/property-config/section.property-config.d.ts +17 -17
- package/types/section/src/schema/schema-resolver.d.ts +1 -2
- package/types/section/src/schema/toolbar-resolver.d.ts +1 -1
- package/types/tabs/src/composition/types.d.ts +4 -1
- package/types/tabs/src/property-config/tab-page.property-config.d.ts +9 -59
- package/types/tabs/src/property-config/tabs.property-config.d.ts +8 -71
- package/types/tabs/src/schema/schema-resolver.d.ts +1 -2
- package/types/text/src/composition/types.d.ts +4 -4
- package/types/textarea/src/property-config/textarea.property-config.d.ts +23 -0
- package/types/weather/src/composition/use-weather-charts.d.ts +15 -0
- package/types/weather/src/composition/use-weather-color.d.ts +15 -0
- package/types/weather/src/composition/use-weather-data.d.ts +15 -0
- package/types/weather/src/composition/use-weather-format-number.d.ts +15 -0
- package/types/property-panel/src/composition/entity/use-input-rules.d.ts +0 -3
- package/types/tree-grid/src/schema/column-resolver.d.ts +0 -3
- package/types/weather/src/composition/types.d.ts +0 -2
- /package/types/dynamic-form/src/designer/{use-designer-rules.d.ts → response-form-use-designer-rules.d.ts} +0 -0
- /package/types/dynamic-form/src/property-config/{form.property-config.d.ts → response-form.property-config.d.ts} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(R,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],a):(R=typeof globalThis<"u"?globalThis:R||self,a(R["color-picker"]={},R.Vue,R.LodashES))})(this,function(R,a,q){"use strict";var Ht=Object.defineProperty;var Bt=(R,a,q)=>a in R?Ht(R,a,{enumerable:!0,configurable:!0,writable:!0,value:q}):R[a]=q;var s=(R,a,q)=>Bt(R,typeof a!="symbol"?a+"":a,q);const Me={},Oe={};function ae(r){const{properties:e,title:t,ignore:n}=r,i=n&&Array.isArray(n),u=Object.keys(e).reduce((l,h)=>((!i||!n.find(m=>m==h))&&(l[h]=e[h].type==="object"&&e[h].properties?ae(e[h]):q.cloneDeep(e[h].default)),l),{});return t&&(!i||!n.find(l=>l=="id"))&&(u.id=`${t}-${Date.now()}`),u}function He(r,e={},t){const n=Me[r];if(n){let i=ae(n);const u=Oe[r];return i=u?u({getSchemaByType:He},i,e,t):i,i}return null}function Ce(r,e){const t=ae(e);return Object.keys(r).reduce((n,i)=>(n[i]&&q.isPlainObject(n[i])&&q.isPlainObject(r[i])?Object.assign(n[i],r[i]):n[i]=r[i],n),t),t}function ze(r,e){return Object.keys(r).filter(n=>r[n]!=null).reduce((n,i)=>{if(e.has(i)){const u=e.get(i);if(typeof u=="string")n[u]=r[i];else{const l=u(i,r[i],r);Object.assign(n,l)}}else n[i]=r[i];return n},{})}function Je(r,e,t=new Map){const n=Ce(r,e);return ze(n,t)}function Qe(r={}){function e(d,p,f,g){if(typeof f=="number")return g[d].length===f;if(typeof f=="object"){const k=Object.keys(f)[0],v=f[k];if(k==="not")return Number(g[d].length)!==Number(v);if(k==="moreThan")return Number(g[d].length)>=Number(v);if(k==="lessThan")return Number(g[d].length)<=Number(v)}return!1}function t(d,p,f,g){return g[d]&&g[d].propertyValue&&String(g[d].propertyValue.value)===String(f)}const n=new Map([["length",e],["getProperty",t]]);Object.keys(r).reduce((d,p)=>(d.set(p,r[p]),d),n);function i(d,p){const f=d;return typeof p=="number"?[{target:f,operator:"length",param:null,value:Number(p)}]:typeof p=="boolean"?[{target:f,operator:"getProperty",param:d,value:!!p}]:typeof p=="object"?Object.keys(p).map(g=>{if(g==="length")return{target:f,operator:"length",param:null,value:p[g]};const k=g,v=p[g];return{target:f,operator:"getProperty",param:k,value:v}}):[]}function u(d){return Object.keys(d).reduce((f,g)=>{const k=i(g,d[g]);return f.push(...k),f},[])}function l(d,p){if(n.has(d.operator)){const f=n.get(d.operator);return f&&f(d.target,d.param,d.value,p)||!1}return!1}function h(d,p){return u(d).reduce((k,v)=>k&&l(v,p),!0)}function m(d,p){const f=Object.keys(d),g=f.includes("allOf"),k=f.includes("anyOf"),v=g||k,P=(v?d[v?g?"allOf":"anyOf":"allOf"]:[d]).map(B=>h(B,p));return g?!P.includes(!1):P.includes(!0)}return{parseValueSchema:m}}const Ze={},Ke={};Qe();function Te(r,e,t=new Map,n=(l,h,m)=>h,i={},u=l=>l){return Me[e.title]=e,Oe[e.title]=n,Ze[e.title]=i,Ke[e.title]=u,(l={})=>{const h=Je(l,e,t),m=Object.keys(r).reduce((d,p)=>(d[p]=r[p].default,d),{});return Object.assign(m,h)}}const _e={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/color-picker.schema.json",title:"color-picker",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for color picker",type:"string"},type:{description:"The type string of color picker",type:"string",default:"color-picker"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]};function et(r,e,t){return e}function tt(r,e){return{customClass:e.class,customStyle:e.style}}const nt=new Map([["appearance",tt]]),rt={title:"color-picker",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},se={color:{type:String,default:"#e1e2e3"},disabled:{type:Boolean,default:!1},presets:{type:Array,default:[]},allowColorNull:{type:Boolean,default:!1},onValueChanged:{type:Function,default:()=>{}}},Be=Te(se,_e,nt,et,rt);class _{}class oe extends _{constructor(e,t,n,i){super(),this.cyan=e,this.magenta=t,this.yellow=n,this.black=i}toString(){return`cmyk(${this.getCyan()}%, ${this.getMagenta()}%, ${this.getYellow()}%, ${this.getBlack()}%)`}getCyan(){return Math.round(this.cyan)}getMagenta(){return Math.round(this.magenta)}getYellow(){return Math.round(this.yellow)}getBlack(){return Math.round(this.black)}}class J extends _{constructor(e,t,n,i){super(),this.hue=e,this.saturation=t,this.lightness=n,this.alpha=i}toString(e=!0){return e?`hsla(${this.getHue()}, ${this.getSaturation()}%, ${this.getLightness()}%, ${this.getAlpha()})`:`hsl(${this.getHue()}, ${this.getSaturation()}%, ${this.getLightness()}%)`}getHue(){return Math.round(this.hue)}getSaturation(){return Math.round(this.saturation)}getLightness(){return Math.round(this.lightness)}getAlpha(){return Math.round(this.alpha*100)/100}}class Q extends _{constructor(e,t,n,i){super(),this.hue=e,this.saturation=t,this.value=n,this.alpha=i}toString(e=!0){return e?`hsva(${this.getHue()}, ${this.getSaturation()}%, ${this.getValue()}%, ${this.getAlpha()})`:`hsv(${this.getHue()}, ${this.getSaturation()}%, ${this.getValue()}%)`}getHue(){return Math.round(this.hue)}getSaturation(){return Math.round(this.saturation)}getValue(){return Math.round(this.value)}getAlpha(){return Math.round(this.alpha*100)/100}}class c extends _{constructor(e,t,n,i){super(),this.red=e,this.green=t,this.blue=n,this.alpha=i}toString(e=!0){return e?`rgba(${this.getRed()}, ${this.getGreen()}, ${this.getBlue()}, ${this.getAlpha()})`:`rgb(${this.getRed()}, ${this.getGreen()}, ${this.getBlue()})`}getRed(){return Math.round(this.red)}getGreen(){return Math.round(this.green)}getBlue(){return Math.round(this.blue)}getAlpha(){return Math.round(this.alpha*100)/100}}const o=class o{};s(o,"transparent",new c(0,0,0,0)),s(o,"aliceblue",new c(240,248,255,1)),s(o,"antiquewhite",new c(250,235,215,1)),s(o,"aqua",new c(0,255,255,1)),s(o,"aquamarine",new c(127,255,212,1)),s(o,"azure",new c(240,255,255,1)),s(o,"beige",new c(245,245,220,1)),s(o,"bisque",new c(255,228,196,1)),s(o,"black",new c(0,0,0,1)),s(o,"blanchedalmond",new c(255,235,205,1)),s(o,"blue",new c(0,0,255,1)),s(o,"blueviolet",new c(138,43,226,1)),s(o,"brown",new c(165,42,42,1)),s(o,"burlywood",new c(222,184,135,1)),s(o,"cadetblue",new c(95,158,160,1)),s(o,"chartreuse",new c(127,255,0,1)),s(o,"chocolate",new c(210,105,30,1)),s(o,"coral",new c(255,127,80,1)),s(o,"cornflowerblue",new c(100,149,237,1)),s(o,"cornsilk",new c(255,248,220,1)),s(o,"crimson",new c(220,20,60,1)),s(o,"cyan",new c(0,255,255,1)),s(o,"darkblue",new c(0,0,139,1)),s(o,"darkcyan",new c(0,139,139,1)),s(o,"darkgoldenrod",new c(184,134,11,1)),s(o,"darkgray",new c(169,169,169,1)),s(o,"darkgreen",new c(0,100,0,1)),s(o,"darkgrey",o.darkgray),s(o,"darkkhaki",new c(189,183,107,1)),s(o,"darkmagenta",new c(139,0,139,1)),s(o,"darkolivegreen",new c(85,107,47,1)),s(o,"darkorange",new c(255,140,0,1)),s(o,"darkorchid",new c(153,50,204,1)),s(o,"darkred",new c(139,0,0,1)),s(o,"darksalmon",new c(233,150,122,1)),s(o,"darkseagreen",new c(143,188,143,1)),s(o,"darkslateblue",new c(72,61,139,1)),s(o,"darkslategray",new c(47,79,79,1)),s(o,"darkslategrey",o.darkslategray),s(o,"darkturquoise",new c(0,206,209,1)),s(o,"darkviolet",new c(148,0,211,1)),s(o,"deeppink",new c(255,20,147,1)),s(o,"deepskyblue",new c(0,191,255,1)),s(o,"dimgray",new c(105,105,105,1)),s(o,"dimgrey",o.dimgray),s(o,"dodgerblue",new c(30,144,255,1)),s(o,"firebrick",new c(178,34,34,1)),s(o,"floralwhite",new c(255,250,240,1)),s(o,"forestgreen",new c(34,139,34,1)),s(o,"fuchsia",new c(255,0,255,1)),s(o,"gainsboro",new c(220,220,220,1)),s(o,"ghostwhite",new c(248,248,255,1)),s(o,"gold",new c(255,215,0,1)),s(o,"goldenrod",new c(218,165,32,1)),s(o,"gray",new c(128,128,128,1)),s(o,"grey",o.gray),s(o,"green",new c(0,128,0,1)),s(o,"greenyellow",new c(173,255,47,1)),s(o,"honeydew",new c(240,255,240,1)),s(o,"hotpink",new c(255,105,180,1)),s(o,"indianred",new c(205,92,92,1)),s(o,"indigo",new c(75,0,130,1)),s(o,"ivory",new c(255,255,240,1)),s(o,"khaki",new c(240,230,140,1)),s(o,"lavender",new c(230,230,250,1)),s(o,"lavenderblush",new c(255,240,245,1)),s(o,"lawngreen",new c(124,252,0,1)),s(o,"lemonchiffon",new c(255,250,205,1)),s(o,"lightblue",new c(173,216,230,1)),s(o,"lightcoral",new c(240,128,128,1)),s(o,"lightcyan",new c(224,255,255,1)),s(o,"lightgoldenrodyellow",new c(250,250,210,1)),s(o,"lightgray",new c(211,211,211,1)),s(o,"lightgreen",new c(144,238,144,1)),s(o,"lightgrey",o.lightgray),s(o,"lightpink",new c(255,182,193,1)),s(o,"lightsalmon",new c(255,160,122,1)),s(o,"lightseagreen",new c(32,178,170,1)),s(o,"lightskyblue",new c(135,206,250,1)),s(o,"lightslategray",new c(119,136,153,1)),s(o,"lightslategrey",o.lightslategray),s(o,"lightsteelblue",new c(176,196,222,1)),s(o,"lightyellow",new c(255,255,224,1)),s(o,"lime",new c(0,255,0,1)),s(o,"limegreen",new c(50,205,50,1)),s(o,"linen",new c(250,240,230,1)),s(o,"magenta",new c(255,0,255,1)),s(o,"maroon",new c(128,0,0,1)),s(o,"mediumaquamarine",new c(102,205,170,1)),s(o,"mediumblue",new c(0,0,205,1)),s(o,"mediumorchid",new c(186,85,211,1)),s(o,"mediumpurple",new c(147,112,219,1)),s(o,"mediumseagreen",new c(60,179,113,1)),s(o,"mediumslateblue",new c(123,104,238,1)),s(o,"mediumspringgreen",new c(0,250,154,1)),s(o,"mediumturquoise",new c(72,209,204,1)),s(o,"mediumvioletred",new c(199,21,133,1)),s(o,"midnightblue",new c(25,25,112,1)),s(o,"mintcream",new c(245,255,250,1)),s(o,"mistyrose",new c(255,228,225,1)),s(o,"moccasin",new c(255,228,181,1)),s(o,"navajowhite",new c(255,222,173,1)),s(o,"navy",new c(0,0,128,1)),s(o,"oldlace",new c(253,245,230,1)),s(o,"olive",new c(128,128,0,1)),s(o,"olivedrab",new c(107,142,35,1)),s(o,"orange",new c(255,165,0,1)),s(o,"orangered",new c(255,69,0,1)),s(o,"orchid",new c(218,112,214,1)),s(o,"palegoldenrod",new c(238,232,170,1)),s(o,"palegreen",new c(152,251,152,1)),s(o,"paleturquoise",new c(175,238,238,1)),s(o,"palevioletred",new c(219,112,147,1)),s(o,"papayawhip",new c(255,239,213,1)),s(o,"peachpuff",new c(255,218,185,1)),s(o,"peru",new c(205,133,63,1)),s(o,"pink",new c(255,192,203,1)),s(o,"plum",new c(221,160,221,1)),s(o,"powderblue",new c(176,224,230,1)),s(o,"purple",new c(128,0,128,1)),s(o,"red",new c(255,0,0,1)),s(o,"rosybrown",new c(188,143,143,1)),s(o,"royalblue",new c(65,105,225,1)),s(o,"saddlebrown",new c(139,69,19,1)),s(o,"salmon",new c(250,128,114,1)),s(o,"sandybrown",new c(244,164,96,1)),s(o,"seagreen",new c(46,139,87,1)),s(o,"seashell",new c(255,245,238,1)),s(o,"sienna",new c(160,82,45,1)),s(o,"silver",new c(192,192,192,1)),s(o,"skyblue",new c(135,206,235,1)),s(o,"slateblue",new c(106,90,205,1)),s(o,"slategray",new c(112,128,144,1)),s(o,"slategrey",o.slategray),s(o,"snow",new c(255,250,250,1)),s(o,"springgreen",new c(0,255,127,1)),s(o,"steelblue",new c(70,130,180,1)),s(o,"tan",new c(210,180,140,1)),s(o,"teal",new c(0,128,128,1)),s(o,"thistle",new c(216,191,216,1)),s(o,"tomato",new c(255,99,71,1)),s(o,"turquoise",new c(64,224,208,1)),s(o,"violet",new c(238,130,238,1)),s(o,"wheat",new c(245,222,179,1)),s(o,"white",new c(255,255,255,1)),s(o,"whitesmoke",new c(245,245,245,1)),s(o,"yellow",new c(255,255,0,1)),s(o,"yellowgreen",new c(154,205,50,1));let ce=o;class S{constructor(e){s(this,"hsva",new Q(0,1,1,1));s(this,"rgba",new c(255,0,0,1));e&&this.stringToColor(e)}static from(e){return typeof e=="string"?new S(e):e instanceof S?e.clone():e instanceof c?new S().setRgba(e.red,e.green,e.blue,e.alpha):e instanceof Q?new S().setHsva(e.hue,e.saturation,e.value,e.alpha):e instanceof J?new S().setHsla(e.hue,e.saturation,e.lightness,e.alpha):new S(e)}clone(){return S.from(this.getRgba())}setFromString(e){return this.stringToColor(e)}setHsva(e,t=100,n=100,i=1){return e!=null&&(this.hsva.hue=e),t!=null&&(this.hsva.saturation=t),n!=null&&(this.hsva.value=n),i!=null&&(i=i>1?1:i<0?0:i,this.hsva.alpha=i),this.rgba=this.hsvaToRgba(this.hsva),this}setRgba(e,t,n,i=1){return e!=null&&(this.rgba.red=e),t!=null&&(this.rgba.green=t),n!=null&&(this.rgba.blue=n),i!=null&&(i=i>1?1:i<0?0:i,this.rgba.alpha=i),this.hsva=this.rgbaToHsva(this.rgba),this}setHsla(e,t,n,i=1){i!=null&&(i=i>1?1:i<0?0:i,this.rgba.alpha=i);const u=new J(e,t,n,i);return this.rgba=this.hslaToRgba(u),this.hsva=this.rgbaToHsva(this.rgba),this}toHexString(e=!1){let t="#"+(16777216|this.rgba.getRed()<<16|this.rgba.getGreen()<<8|this.rgba.getBlue()).toString(16).substr(1);return e&&(t+=(256|Math.round(this.rgba.alpha*255)).toString(16).substr(1)),t.toUpperCase()}toRgbaString(){return this.rgba.toString()}toRgbString(){return this.rgba.toString(!1)}toHslaString(){return this.getHsla().toString()}toHslString(){return this.getHsla().toString(!1)}toHsvaString(){return this.hsva.toString()}toHsvString(){return this.hsva.toString(!1)}toCmykString(){return this.getCmyk().toString()}getHsva(){return new Q(this.hsva.hue,this.hsva.saturation,this.hsva.value,this.hsva.alpha)}getRgba(){return new c(this.rgba.red,this.rgba.green,this.rgba.blue,this.rgba.alpha)}getHsla(){return this.rgbaToHsla(this.rgba)}getCmyk(){return this.rgbaToCmyk(this.rgba)}hsvaToHsla(e){const{hue:t}=e,n=e.saturation/100,i=e.value/100,u=(2-n)*e.value/2,l=n*i/(u<=1?u:2-u)||0;return new J(t,u*100,l*100,e.alpha)}hslaToHsva(e){const{hue:t}=e,n=e.lightness/100*2,i=e.saturation/100*(n<=1?n:2-n),u=(n+i)/2,l=2*i/(n+i)||0;return new Q(t,l,u,e.alpha)}rgbaToHsva(e){const t=e.red/255,n=e.green/255,i=e.blue/255,{alpha:u}=e,l=Math.max(t,n,i),h=Math.min(t,n,i),m=l-h;let d=0,p=l===0?0:m/l,f=l;if(l!==h){switch(l){case t:d=(n-i)/m+(n<i?6:0);break;case n:d=2+(i-t)/m;break;case i:d=4+(t-n)/m;break}d/=6}return d*=360,p*=100,f*=100,new Q(d,p,f,u)}hsvaToRgba(e){let t=1,n=0,i=0;const u=e.saturation/100,l=e.value/100,{alpha:h}=e,m=e.hue/60,d=Math.floor(m),p=m-d,f=(1-u)*l,g=(1-u*p)*l,k=(1-u*(1-p))*l;switch(d){case 6:case 0:t=l,n=k,i=f;break;case 1:t=g,n=l,i=f;break;case 2:t=f,n=l,i=k;break;case 3:t=f,n=g,i=l;break;case 4:t=k,n=f,i=l;break;case 5:t=l,n=f,i=g;break}return t*=255,n*=255,i*=255,new c(t,n,i,h)}rgbaToHsla(e){const t=e.red/255,n=e.green/255,i=e.blue/255,{alpha:u}=e,l=Math.max(t,n,i),h=Math.min(t,n,i);let m=0,d=0,p=(l+h)/2;const f=l-h;if(l!==h){switch(d=p>.5?f/(2-l-h):f/(l+h),l){case t:m=(n-i)/f+(n<i?6:0);break;case n:m=(i-t)/f+2;break;case i:m=(t-n)/f+4;break}m/=6}return m*=360,d*=100,p*=100,new J(m,d,p,u)}hslaToRgba(e){const t=e.hue/360,n=e.saturation/100,i=e.lightness/100,{alpha:u}=e;let l=i,h=i,m=i;if(n!==0){const d=i<.5?i*(1+n):i+n-i*n,p=2*i-d;l=this.hueToRgb(p,d,t+1/3),h=this.hueToRgb(p,d,t),m=this.hueToRgb(p,d,t-1/3)}return l*=255,h*=255,m*=255,new c(l,h,m,u)}hueToRgb(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}cmykToRgba(e){const t=e.black/100,n=e.cyan/100,i=e.magenta/100,u=e.yellow/100;let l=Math.min(1,(1-n)*(1-t)),h=Math.min(1,(1-i)*(1-t)),m=Math.min(1,(1-u)*(1-t));return l*=255,h*=255,m*=255,new c(l,h,m,1)}rgbaToCmyk(e){const t=e.red/255,n=e.green/255,i=e.blue/255;let u=1-t,l=1-n,h=1-i,m=Math.min(u,l,h);return m===1?new oe(0,0,0,1):(u=(u-m)/(1-m),l=(l-m)/(1-m),h=(h-m)/(1-m),m*=100,u*=100,l*=100,h*=100,new oe(u,l,h,m))}roundNumber(e){return Math.round(e*100)/100}stringToColor(e){const t=e.replace(/ /g,"").toLowerCase();let n=ce[e]||null;if(t[0]==="#"){let l=t.substr(1);const{length:h}=l;let m=1,d;if(h===3)d=l.split("").map(p=>p+p);else if(h===6)d=l.match(/.{2}/g);else if(h===8){const p=l.substr(-2);l=l.substr(0,h-2),m=this.roundNumber(parseInt(p||"FF",16)/255),d=l.match(/.{2}/g)}d&&d.length===3&&(n=new c(parseInt(d[0],16),parseInt(d[1],16),parseInt(d[2],16),m))}const i=t.indexOf("("),u=t.indexOf(")");if(i!==-1&&u+1===t.length){const l=t.substr(0,i),h=t.substr(i+1,u-(i+1)).split(",");let m=1,d,p;switch(l){case"rgba":m=parseFloat(h.pop());case"rgb":n=new c(parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10),m);break;case"hsla":m=parseFloat(h.pop());break;case"hsl":d=new J(parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10),m),n=this.hslaToRgba(d);break;case"cmyk":p=new oe(parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10),parseInt(h[3],10)),n=this.cmykToRgba(p);break}}return n&&(this.rgba=n,this.hsva=this.rgbaToHsva(n)),this}}var le=function(r,e){return le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},le(r,e)};function X(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");le(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ue(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function he(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,u=[],l;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)u.push(i.value)}catch(h){l={error:h}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(l)throw l.error}}return u}function de(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,u;n<i;n++)(u||!(n in e))&&(u||(u=Array.prototype.slice.call(e,0,n)),u[n]=e[n]);return r.concat(u||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;function L(r){return typeof r=="function"}function $e(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var pe=$e(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
1
|
+
(function(R,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js"],a):(R=typeof globalThis<"u"?globalThis:R||self,a(R["color-picker"]={},R.Vue,R.LodashES,R.common))})(this,function(R,a,q,ze){"use strict";var Ot=Object.defineProperty;var Bt=(R,a,q)=>a in R?Ot(R,a,{enumerable:!0,configurable:!0,writable:!0,value:q}):R[a]=q;var s=(R,a,q)=>Bt(R,typeof a!="symbol"?a+"":a,q);const Ee={},He={};function ae(r){const{properties:e,title:t,ignore:n}=r,i=n&&Array.isArray(n),u=Object.keys(e).reduce((l,h)=>((!i||!n.find(m=>m===h))&&(l[h]=e[h].type==="object"&&e[h].properties?ae(e[h]):q.cloneDeep(e[h].default)),l),{});if(t&&(!i||!n.find(l=>l==="id"))){const l=t.toLowerCase().replace(/-/g,"_");u.id=`${l}_${Math.random().toString().slice(2,6)}`}return u}function Oe(r,e={},t){const n=Ee[r];if(n){let i=ae(n);const u=He[r];return i=u?u({getSchemaByType:Oe},i,e,t):i,i}return null}function Je(r,e){const t=ae(e);return Object.keys(t).reduce((n,i)=>(n[i]&&q.isPlainObject(n[i])&&q.isPlainObject(r[i]||!r[i])?Object.assign(n[i],r[i]||{}):n[i]=r[i],n),t),t}function Qe(r,e){return Object.keys(r).filter(n=>r[n]!=null).reduce((n,i)=>{if(e.has(i)){const u=e.get(i);if(typeof u=="string")n[u]=r[i];else{const l=u(i,r[i],r);Object.assign(n,l)}}else n[i]=r[i];return n},{})}function Ze(r,e,t=new Map){const n=Je(r,e);return Qe(n,t)}function Ce(r={}){function e(p,d,f,g){if(typeof f=="number")return g[p].length===f;if(typeof f=="object"){const k=Object.keys(f)[0],v=f[k];if(k==="not")return Number(g[p].length)!==Number(v);if(k==="moreThan")return Number(g[p].length)>=Number(v);if(k==="lessThan")return Number(g[p].length)<=Number(v)}return!1}function t(p,d,f,g){return g[p]&&g[p].propertyValue&&String(g[p].propertyValue.value)===String(f)}const n=new Map([["length",e],["getProperty",t]]);Object.keys(r).reduce((p,d)=>(p.set(d,r[d]),p),n);function i(p,d){const f=p;return typeof d=="number"?[{target:f,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:f,operator:"getProperty",param:p,value:!!d}]:typeof d=="object"?Object.keys(d).map(g=>{if(g==="length")return{target:f,operator:"length",param:null,value:d[g]};const k=g,v=d[g];return{target:f,operator:"getProperty",param:k,value:v}}):[]}function u(p){return Object.keys(p).reduce((f,g)=>{const k=i(g,p[g]);return f.push(...k),f},[])}function l(p,d){if(n.has(p.operator)){const f=n.get(p.operator);return f&&f(p.target,p.param,p.value,d)||!1}return!1}function h(p,d){return u(p).reduce((k,v)=>k&&l(v,d),!0)}function m(p,d){const f=Object.keys(p),g=f.includes("allOf"),k=f.includes("anyOf"),v=g||k,V=(v?p[v?g?"allOf":"anyOf":"allOf"]:[p]).map($=>h($,d));return g?!V.includes(!1):V.includes(!0)}return{parseValueSchema:m}}const Ke={},Te={};Ce();function _e(r,e,t=new Map,n=(l,h,m,p)=>h,i={},u=l=>l){return Ee[e.title]=e,He[e.title]=n,Ke[e.title]=i,Te[e.title]=u,(l={})=>{const h=Ze(l,e,t),m=Object.keys(r).reduce((p,d)=>(p[d]=r[d].default,p),{});return Object.assign(m,h)}}const et={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/color-picker.schema.json",title:"color-picker",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for color picker",type:"string"},type:{description:"The type string of color picker",type:"string",default:"color-picker"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]};function tt(r,e,t){return e}function nt(r,e){return{customClass:e.class,customStyle:e.style}}const rt=new Map([["appearance",nt]]),it={title:"color-picker",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},se={color:{type:String,default:"#e1e2e3"},disabled:{type:Boolean,default:!1},presets:{type:Array,default:[]},allowColorNull:{type:Boolean,default:!1},onValueChanged:{type:Function,default:()=>{}}},Be=_e(se,et,rt,tt,it);class _{}class oe extends _{constructor(e,t,n,i){super(),this.cyan=e,this.magenta=t,this.yellow=n,this.black=i}toString(){return`cmyk(${this.getCyan()}%, ${this.getMagenta()}%, ${this.getYellow()}%, ${this.getBlack()}%)`}getCyan(){return Math.round(this.cyan)}getMagenta(){return Math.round(this.magenta)}getYellow(){return Math.round(this.yellow)}getBlack(){return Math.round(this.black)}}class Q extends _{constructor(e,t,n,i){super(),this.hue=e,this.saturation=t,this.lightness=n,this.alpha=i}toString(e=!0){return e?`hsla(${this.getHue()}, ${this.getSaturation()}%, ${this.getLightness()}%, ${this.getAlpha()})`:`hsl(${this.getHue()}, ${this.getSaturation()}%, ${this.getLightness()}%)`}getHue(){return Math.round(this.hue)}getSaturation(){return Math.round(this.saturation)}getLightness(){return Math.round(this.lightness)}getAlpha(){return Math.round(this.alpha*100)/100}}class Z extends _{constructor(e,t,n,i){super(),this.hue=e,this.saturation=t,this.value=n,this.alpha=i}toString(e=!0){return e?`hsva(${this.getHue()}, ${this.getSaturation()}%, ${this.getValue()}%, ${this.getAlpha()})`:`hsv(${this.getHue()}, ${this.getSaturation()}%, ${this.getValue()}%)`}getHue(){return Math.round(this.hue)}getSaturation(){return Math.round(this.saturation)}getValue(){return Math.round(this.value)}getAlpha(){return Math.round(this.alpha*100)/100}}class c extends _{constructor(e,t,n,i){super(),this.red=e,this.green=t,this.blue=n,this.alpha=i}toString(e=!0){return e?`rgba(${this.getRed()}, ${this.getGreen()}, ${this.getBlue()}, ${this.getAlpha()})`:`rgb(${this.getRed()}, ${this.getGreen()}, ${this.getBlue()})`}getRed(){return Math.round(this.red)}getGreen(){return Math.round(this.green)}getBlue(){return Math.round(this.blue)}getAlpha(){return Math.round(this.alpha*100)/100}}const o=class o{};s(o,"transparent",new c(0,0,0,0)),s(o,"aliceblue",new c(240,248,255,1)),s(o,"antiquewhite",new c(250,235,215,1)),s(o,"aqua",new c(0,255,255,1)),s(o,"aquamarine",new c(127,255,212,1)),s(o,"azure",new c(240,255,255,1)),s(o,"beige",new c(245,245,220,1)),s(o,"bisque",new c(255,228,196,1)),s(o,"black",new c(0,0,0,1)),s(o,"blanchedalmond",new c(255,235,205,1)),s(o,"blue",new c(0,0,255,1)),s(o,"blueviolet",new c(138,43,226,1)),s(o,"brown",new c(165,42,42,1)),s(o,"burlywood",new c(222,184,135,1)),s(o,"cadetblue",new c(95,158,160,1)),s(o,"chartreuse",new c(127,255,0,1)),s(o,"chocolate",new c(210,105,30,1)),s(o,"coral",new c(255,127,80,1)),s(o,"cornflowerblue",new c(100,149,237,1)),s(o,"cornsilk",new c(255,248,220,1)),s(o,"crimson",new c(220,20,60,1)),s(o,"cyan",new c(0,255,255,1)),s(o,"darkblue",new c(0,0,139,1)),s(o,"darkcyan",new c(0,139,139,1)),s(o,"darkgoldenrod",new c(184,134,11,1)),s(o,"darkgray",new c(169,169,169,1)),s(o,"darkgreen",new c(0,100,0,1)),s(o,"darkgrey",o.darkgray),s(o,"darkkhaki",new c(189,183,107,1)),s(o,"darkmagenta",new c(139,0,139,1)),s(o,"darkolivegreen",new c(85,107,47,1)),s(o,"darkorange",new c(255,140,0,1)),s(o,"darkorchid",new c(153,50,204,1)),s(o,"darkred",new c(139,0,0,1)),s(o,"darksalmon",new c(233,150,122,1)),s(o,"darkseagreen",new c(143,188,143,1)),s(o,"darkslateblue",new c(72,61,139,1)),s(o,"darkslategray",new c(47,79,79,1)),s(o,"darkslategrey",o.darkslategray),s(o,"darkturquoise",new c(0,206,209,1)),s(o,"darkviolet",new c(148,0,211,1)),s(o,"deeppink",new c(255,20,147,1)),s(o,"deepskyblue",new c(0,191,255,1)),s(o,"dimgray",new c(105,105,105,1)),s(o,"dimgrey",o.dimgray),s(o,"dodgerblue",new c(30,144,255,1)),s(o,"firebrick",new c(178,34,34,1)),s(o,"floralwhite",new c(255,250,240,1)),s(o,"forestgreen",new c(34,139,34,1)),s(o,"fuchsia",new c(255,0,255,1)),s(o,"gainsboro",new c(220,220,220,1)),s(o,"ghostwhite",new c(248,248,255,1)),s(o,"gold",new c(255,215,0,1)),s(o,"goldenrod",new c(218,165,32,1)),s(o,"gray",new c(128,128,128,1)),s(o,"grey",o.gray),s(o,"green",new c(0,128,0,1)),s(o,"greenyellow",new c(173,255,47,1)),s(o,"honeydew",new c(240,255,240,1)),s(o,"hotpink",new c(255,105,180,1)),s(o,"indianred",new c(205,92,92,1)),s(o,"indigo",new c(75,0,130,1)),s(o,"ivory",new c(255,255,240,1)),s(o,"khaki",new c(240,230,140,1)),s(o,"lavender",new c(230,230,250,1)),s(o,"lavenderblush",new c(255,240,245,1)),s(o,"lawngreen",new c(124,252,0,1)),s(o,"lemonchiffon",new c(255,250,205,1)),s(o,"lightblue",new c(173,216,230,1)),s(o,"lightcoral",new c(240,128,128,1)),s(o,"lightcyan",new c(224,255,255,1)),s(o,"lightgoldenrodyellow",new c(250,250,210,1)),s(o,"lightgray",new c(211,211,211,1)),s(o,"lightgreen",new c(144,238,144,1)),s(o,"lightgrey",o.lightgray),s(o,"lightpink",new c(255,182,193,1)),s(o,"lightsalmon",new c(255,160,122,1)),s(o,"lightseagreen",new c(32,178,170,1)),s(o,"lightskyblue",new c(135,206,250,1)),s(o,"lightslategray",new c(119,136,153,1)),s(o,"lightslategrey",o.lightslategray),s(o,"lightsteelblue",new c(176,196,222,1)),s(o,"lightyellow",new c(255,255,224,1)),s(o,"lime",new c(0,255,0,1)),s(o,"limegreen",new c(50,205,50,1)),s(o,"linen",new c(250,240,230,1)),s(o,"magenta",new c(255,0,255,1)),s(o,"maroon",new c(128,0,0,1)),s(o,"mediumaquamarine",new c(102,205,170,1)),s(o,"mediumblue",new c(0,0,205,1)),s(o,"mediumorchid",new c(186,85,211,1)),s(o,"mediumpurple",new c(147,112,219,1)),s(o,"mediumseagreen",new c(60,179,113,1)),s(o,"mediumslateblue",new c(123,104,238,1)),s(o,"mediumspringgreen",new c(0,250,154,1)),s(o,"mediumturquoise",new c(72,209,204,1)),s(o,"mediumvioletred",new c(199,21,133,1)),s(o,"midnightblue",new c(25,25,112,1)),s(o,"mintcream",new c(245,255,250,1)),s(o,"mistyrose",new c(255,228,225,1)),s(o,"moccasin",new c(255,228,181,1)),s(o,"navajowhite",new c(255,222,173,1)),s(o,"navy",new c(0,0,128,1)),s(o,"oldlace",new c(253,245,230,1)),s(o,"olive",new c(128,128,0,1)),s(o,"olivedrab",new c(107,142,35,1)),s(o,"orange",new c(255,165,0,1)),s(o,"orangered",new c(255,69,0,1)),s(o,"orchid",new c(218,112,214,1)),s(o,"palegoldenrod",new c(238,232,170,1)),s(o,"palegreen",new c(152,251,152,1)),s(o,"paleturquoise",new c(175,238,238,1)),s(o,"palevioletred",new c(219,112,147,1)),s(o,"papayawhip",new c(255,239,213,1)),s(o,"peachpuff",new c(255,218,185,1)),s(o,"peru",new c(205,133,63,1)),s(o,"pink",new c(255,192,203,1)),s(o,"plum",new c(221,160,221,1)),s(o,"powderblue",new c(176,224,230,1)),s(o,"purple",new c(128,0,128,1)),s(o,"red",new c(255,0,0,1)),s(o,"rosybrown",new c(188,143,143,1)),s(o,"royalblue",new c(65,105,225,1)),s(o,"saddlebrown",new c(139,69,19,1)),s(o,"salmon",new c(250,128,114,1)),s(o,"sandybrown",new c(244,164,96,1)),s(o,"seagreen",new c(46,139,87,1)),s(o,"seashell",new c(255,245,238,1)),s(o,"sienna",new c(160,82,45,1)),s(o,"silver",new c(192,192,192,1)),s(o,"skyblue",new c(135,206,235,1)),s(o,"slateblue",new c(106,90,205,1)),s(o,"slategray",new c(112,128,144,1)),s(o,"slategrey",o.slategray),s(o,"snow",new c(255,250,250,1)),s(o,"springgreen",new c(0,255,127,1)),s(o,"steelblue",new c(70,130,180,1)),s(o,"tan",new c(210,180,140,1)),s(o,"teal",new c(0,128,128,1)),s(o,"thistle",new c(216,191,216,1)),s(o,"tomato",new c(255,99,71,1)),s(o,"turquoise",new c(64,224,208,1)),s(o,"violet",new c(238,130,238,1)),s(o,"wheat",new c(245,222,179,1)),s(o,"white",new c(255,255,255,1)),s(o,"whitesmoke",new c(245,245,245,1)),s(o,"yellow",new c(255,255,0,1)),s(o,"yellowgreen",new c(154,205,50,1));let ce=o;class S{constructor(e){s(this,"hsva",new Z(0,1,1,1));s(this,"rgba",new c(255,0,0,1));e&&this.stringToColor(e)}static from(e){return typeof e=="string"?new S(e):e instanceof S?e.clone():e instanceof c?new S().setRgba(e.red,e.green,e.blue,e.alpha):e instanceof Z?new S().setHsva(e.hue,e.saturation,e.value,e.alpha):e instanceof Q?new S().setHsla(e.hue,e.saturation,e.lightness,e.alpha):new S(e)}clone(){return S.from(this.getRgba())}setFromString(e){return this.stringToColor(e)}setHsva(e,t=100,n=100,i=1){return e!=null&&(this.hsva.hue=e),t!=null&&(this.hsva.saturation=t),n!=null&&(this.hsva.value=n),i!=null&&(i=i>1?1:i<0?0:i,this.hsva.alpha=i),this.rgba=this.hsvaToRgba(this.hsva),this}setRgba(e,t,n,i=1){return e!=null&&(this.rgba.red=e),t!=null&&(this.rgba.green=t),n!=null&&(this.rgba.blue=n),i!=null&&(i=i>1?1:i<0?0:i,this.rgba.alpha=i),this.hsva=this.rgbaToHsva(this.rgba),this}setHsla(e,t,n,i=1){i!=null&&(i=i>1?1:i<0?0:i,this.rgba.alpha=i);const u=new Q(e,t,n,i);return this.rgba=this.hslaToRgba(u),this.hsva=this.rgbaToHsva(this.rgba),this}toHexString(e=!1){let t="#"+(16777216|this.rgba.getRed()<<16|this.rgba.getGreen()<<8|this.rgba.getBlue()).toString(16).substr(1);return e&&(t+=(256|Math.round(this.rgba.alpha*255)).toString(16).substr(1)),t.toUpperCase()}toRgbaString(){return this.rgba.toString()}toRgbString(){return this.rgba.toString(!1)}toHslaString(){return this.getHsla().toString()}toHslString(){return this.getHsla().toString(!1)}toHsvaString(){return this.hsva.toString()}toHsvString(){return this.hsva.toString(!1)}toCmykString(){return this.getCmyk().toString()}getHsva(){return new Z(this.hsva.hue,this.hsva.saturation,this.hsva.value,this.hsva.alpha)}getRgba(){return new c(this.rgba.red,this.rgba.green,this.rgba.blue,this.rgba.alpha)}getHsla(){return this.rgbaToHsla(this.rgba)}getCmyk(){return this.rgbaToCmyk(this.rgba)}hsvaToHsla(e){const{hue:t}=e,n=e.saturation/100,i=e.value/100,u=(2-n)*e.value/2,l=n*i/(u<=1?u:2-u)||0;return new Q(t,u*100,l*100,e.alpha)}hslaToHsva(e){const{hue:t}=e,n=e.lightness/100*2,i=e.saturation/100*(n<=1?n:2-n),u=(n+i)/2,l=2*i/(n+i)||0;return new Z(t,l,u,e.alpha)}rgbaToHsva(e){const t=e.red/255,n=e.green/255,i=e.blue/255,{alpha:u}=e,l=Math.max(t,n,i),h=Math.min(t,n,i),m=l-h;let p=0,d=l===0?0:m/l,f=l;if(l!==h){switch(l){case t:p=(n-i)/m+(n<i?6:0);break;case n:p=2+(i-t)/m;break;case i:p=4+(t-n)/m;break}p/=6}return p*=360,d*=100,f*=100,new Z(p,d,f,u)}hsvaToRgba(e){let t=1,n=0,i=0;const u=e.saturation/100,l=e.value/100,{alpha:h}=e,m=e.hue/60,p=Math.floor(m),d=m-p,f=(1-u)*l,g=(1-u*d)*l,k=(1-u*(1-d))*l;switch(p){case 6:case 0:t=l,n=k,i=f;break;case 1:t=g,n=l,i=f;break;case 2:t=f,n=l,i=k;break;case 3:t=f,n=g,i=l;break;case 4:t=k,n=f,i=l;break;case 5:t=l,n=f,i=g;break}return t*=255,n*=255,i*=255,new c(t,n,i,h)}rgbaToHsla(e){const t=e.red/255,n=e.green/255,i=e.blue/255,{alpha:u}=e,l=Math.max(t,n,i),h=Math.min(t,n,i);let m=0,p=0,d=(l+h)/2;const f=l-h;if(l!==h){switch(p=d>.5?f/(2-l-h):f/(l+h),l){case t:m=(n-i)/f+(n<i?6:0);break;case n:m=(i-t)/f+2;break;case i:m=(t-n)/f+4;break}m/=6}return m*=360,p*=100,d*=100,new Q(m,p,d,u)}hslaToRgba(e){const t=e.hue/360,n=e.saturation/100,i=e.lightness/100,{alpha:u}=e;let l=i,h=i,m=i;if(n!==0){const p=i<.5?i*(1+n):i+n-i*n,d=2*i-p;l=this.hueToRgb(d,p,t+1/3),h=this.hueToRgb(d,p,t),m=this.hueToRgb(d,p,t-1/3)}return l*=255,h*=255,m*=255,new c(l,h,m,u)}hueToRgb(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}cmykToRgba(e){const t=e.black/100,n=e.cyan/100,i=e.magenta/100,u=e.yellow/100;let l=Math.min(1,(1-n)*(1-t)),h=Math.min(1,(1-i)*(1-t)),m=Math.min(1,(1-u)*(1-t));return l*=255,h*=255,m*=255,new c(l,h,m,1)}rgbaToCmyk(e){const t=e.red/255,n=e.green/255,i=e.blue/255;let u=1-t,l=1-n,h=1-i,m=Math.min(u,l,h);return m===1?new oe(0,0,0,1):(u=(u-m)/(1-m),l=(l-m)/(1-m),h=(h-m)/(1-m),m*=100,u*=100,l*=100,h*=100,new oe(u,l,h,m))}roundNumber(e){return Math.round(e*100)/100}stringToColor(e){const t=e.replace(/ /g,"").toLowerCase();let n=ce[e]||null;if(t[0]==="#"){let l=t.substr(1);const{length:h}=l;let m=1,p;if(h===3)p=l.split("").map(d=>d+d);else if(h===6)p=l.match(/.{2}/g);else if(h===8){const d=l.substr(-2);l=l.substr(0,h-2),m=this.roundNumber(parseInt(d||"FF",16)/255),p=l.match(/.{2}/g)}p&&p.length===3&&(n=new c(parseInt(p[0],16),parseInt(p[1],16),parseInt(p[2],16),m))}const i=t.indexOf("("),u=t.indexOf(")");if(i!==-1&&u+1===t.length){const l=t.substr(0,i),h=t.substr(i+1,u-(i+1)).split(",");let m=1,p,d;switch(l){case"rgba":m=parseFloat(h.pop());case"rgb":n=new c(parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10),m);break;case"hsla":m=parseFloat(h.pop());break;case"hsl":p=new Q(parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10),m),n=this.hslaToRgba(p);break;case"cmyk":d=new oe(parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10),parseInt(h[3],10)),n=this.cmykToRgba(d);break}}return n&&(this.rgba=n,this.hsva=this.rgbaToHsva(n)),this}}var le=function(r,e){return le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},le(r,e)};function X(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");le(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ue(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function he(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,u=[],l;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)u.push(i.value)}catch(h){l={error:h}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(l)throw l.error}}return u}function pe(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,u;n<i;n++)(u||!(n in e))&&(u||(u=Array.prototype.slice.call(e,0,n)),u[n]=e[n]);return r.concat(u||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;function L(r){return typeof r=="function"}function $e(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var de=$e(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
2
2
|
`+t.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=t}});function fe(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var ee=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,i,u;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var h=ue(l),m=h.next();!m.done;m=h.next()){var d=m.value;d.remove(this)}}catch(y){e={error:y}}finally{try{m&&!m.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}else l.remove(this);var p=this.initialTeardown;if(L(p))try{p()}catch(y){u=y instanceof pe?y.errors:[y]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var g=ue(f),k=g.next();!k.done;k=g.next()){var v=k.value;try{je(v)}catch(y){u=u??[],y instanceof pe?u=de(de([],he(u)),he(y.errors)):u.push(y)}}}catch(y){n={error:y}}finally{try{k&&!k.done&&(i=g.return)&&i.call(g)}finally{if(n)throw n.error}}}if(u)throw new pe(u)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)je(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&fe(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&fe(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}(),Re=ee.EMPTY;function xe(r){return r instanceof ee||r&&"closed"in r&&L(r.remove)&&L(r.add)&&L(r.unsubscribe)}function je(r){L(r)?r():r.unsubscribe()}var Ie={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},it={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,de([r,e],he(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function at(r){it.setTimeout(function(){throw r})}function Ae(){}function te(r){r()}var ge=function(r){X(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,xe(t)&&t.add(n)):n.destination=lt,n}return e.create=function(t,n,i){return new me(t,n,i)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(ee),st=Function.prototype.bind;function ye(r,e){return st.call(r,e)}var ot=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){ne(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){ne(n)}else ne(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){ne(t)}},r}(),me=function(r){X(e,r);function e(t,n,i){var u=r.call(this)||this,l;if(L(t)||!t)l={next:t??void 0,error:n??void 0,complete:i??void 0};else{var h;u&&Ie.useDeprecatedNextContext?(h=Object.create(t),h.unsubscribe=function(){return u.unsubscribe()},l={next:t.next&&ye(t.next,h),error:t.error&&ye(t.error,h),complete:t.complete&&ye(t.complete,h)}):l=t}return u.destination=new ot(l),u}return e}(ge);function ne(r){at(r)}function ct(r){throw r}var lt={closed:!0,next:Ae,error:ct,complete:Ae},ut=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function De(r){return r}function ht(r){return r.length===0?De:r.length===1?r[0]:function(t){return r.reduce(function(n,i){return i(n)},t)}}var Ue=function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var i=this,u=pt(e)?e:new me(e,t,n);return te(function(){var l=i,h=l.operator,m=l.source;u.add(h?h.call(u,m):m?i._subscribe(u):i._trySubscribe(u))}),u},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=Le(t),new t(function(i,u){var l=new me({next:function(h){try{e(h)}catch(m){u(m),l.unsubscribe()}},error:u,complete:i});n.subscribe(l)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[ut]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ht(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=Le(e),new e(function(n,i){var u;t.subscribe(function(l){return u=l},function(l){return i(l)},function(){return n(u)})})},r.create=function(e){return new r(e)},r}();function Le(r){var e;return(e=r??Ie.Promise)!==null&&e!==void 0?e:Promise}function dt(r){return r&&L(r.next)&&L(r.error)&&L(r.complete)}function pt(r){return r&&r instanceof ge||dt(r)&&xe(r)}function ft(r){return L(r==null?void 0:r.lift)}function gt(r){return function(e){if(ft(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function yt(r,e,t,n,i){return new mt(r,e,t,n,i)}var mt=function(r){X(e,r);function e(t,n,i,u,l,h){var m=r.call(this,t)||this;return m.onFinalize=l,m.shouldUnsubscribe=h,m._next=n?function(d){try{n(d)}catch(p){t.error(p)}}:r.prototype._next,m._error=u?function(d){try{u(d)}catch(p){t.error(p)}finally{this.unsubscribe()}}:r.prototype._error,m._complete=i?function(){try{i()}catch(d){t.error(d)}finally{this.unsubscribe()}}:r.prototype._complete,m}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(ge),vt=$e(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ve=function(r){X(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new Fe(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new vt},e.prototype.next=function(t){var n=this;te(function(){var i,u;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var l=ue(n.currentObservers),h=l.next();!h.done;h=l.next()){var m=h.value;m.next(t)}}catch(d){i={error:d}}finally{try{h&&!h.done&&(u=l.return)&&u.call(l)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;te(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var i=n.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;te(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,i=this,u=i.hasError,l=i.isStopped,h=i.observers;return u||l?Re:(this.currentObservers=null,h.push(t),new ee(function(){n.currentObservers=null,fe(h,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,u=n.thrownError,l=n.isStopped;i?t.error(u):l&&t.complete()},e.prototype.asObservable=function(){var t=new Ue;return t.source=this,t},e.create=function(t,n){return new Fe(t,n)},e}(Ue),Fe=function(r){X(e,r);function e(t,n){var i=r.call(this)||this;return i.destination=t,i.source=n,i}return e.prototype.next=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,t)},e.prototype.error=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&i!==void 0?i:Re},e}(ve),qe=function(r){X(e,r);function e(t){var n=r.call(this)||this;return n._value=t,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=r.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,i=t.thrownError,u=t._value;if(n)throw i;return this._throwIfClosed(),u},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e}(ve);function wt(r,e){return e===void 0&&(e=De),r=r??bt,gt(function(t,n){var i,u=!0;t.subscribe(yt(n,function(l){var h=e(l);(u||!r(i,h))&&(u=!1,i=h,n.next(l))}))})}function bt(r,e){return r===e}var M=(r=>(r.hex="hex",r.hexa="hexa",r.rgba="rgba",r.rgb="rgb",r.hsla="hsla",r.hsl="hsl",r.cmyk="cmyk",r))(M||{});class we{constructor(e){s(this,"modelValue",null);s(this,"hueValue",null);s(this,"initValue",null);s(this,"valueChanged",new ve);s(this,"presetsVisibilityChanges",new qe(!0));s(this,"initType",null);s(this,"alphaChannelVisibilityChanges",new qe(!0));s(this,"valueChanges",this.valueChanged.asObservable().pipe(wt((e,t)=>e.toRgbaString()===t.toRgbaString())));s(this,"colorPresets",[]);const t=e[0],n=S.from(t);this.setValue(n),this.setHueColor(n)}setValueFrom(e,t,n){const i=S.from(e);return this.initValue||(this.initValue=S.from(e)),typeof e=="string"&&this.finOutInputType(e),this.setHueColor(i),this.setValue(i),this}setHueColor(e){(this.hueValue&&e.getHsva().hue>0||!this.hueValue)&&(this.hueValue=new S().setHsva(e.getHsva().hue))}get hue(){return this.hueValue}set hue(e){this.hueValue=e}setValue(e){return this.modelValue=e,this.valueChanged.next(e),this}get value(){return this.modelValue}set value(e){this.setValue(e)}reset(){let e;return this.initValue?(e=this.initValue.clone(),this.setHueColor(e)):(e=S.from(new c(255,0,0,1)),this.hueValue=new S().setHsva(e.getHsva().hue)),this.setValue(e),this}showAlphaChannel(){return this.alphaChannelVisibilityChanges.next(!0),this}finOutInputType(e){const t=e.replace(/ /g,"").toLowerCase();t[0]==="#"&&(this.initType="hex",t.length>7&&(this.initType="hexa"));const n=t.indexOf("(");switch(t.substr(0,n)){case"rgba":this.initType="rgba";break;case"rgb":this.initType="rgb";break;case"hsla":this.initType="hsla";break;case"hsl":this.initType="hsl";break;case"cmyk":this.initType="cmyk";break}}setColorPresets(e){return this.colorPresets=this.setPresets(e),this}setPresets(e){const t=[];return e.map(n=>{Array.isArray(n)?t.push(this.setPresets(n)):t.push(new S(n))}),t}get presets(){return this.colorPresets}hasPresets(){return this.colorPresets.length>0}}s(we,"finOutInputType");function j(r,e){switch(e){case M.hex:return r.toHexString();case M.hexa:return r.toHexString(!0);case M.rgb:return r.toRgbString();case M.rgba:return r.toRgbaString();case M.hsl:return r.toHslString();case M.hsla:return r.toHslaString();default:return r.toRgbaString()}}const kt={color:{type:Object,default:""},hue:{type:Object,default:""},randomId:{type:String,default:""},allowColorNull:{type:Boolean,default:!1}},Ye=a.defineComponent({name:"SvPanel",props:kt,emits:["update:color"],setup(r,e){const t=a.ref(null),n=a.ref(null),i=a.ref(r.randomId),u=a.ref(r.allowColorNull);function l(){return r.hue?r.hue.toRgbaString():"#3f51b5"}function h(f,g){var k,v;f=Math.max(0,Math.min(f,100)),g=Math.max(0,Math.min(g,100)),t.value&&((k=t.value.style)==null||k.setProperty("top",`${100-g}%`),(v=t.value.style)==null||v.setProperty("left",`${f}%`))}function m(){const f=document.getElementById(`farris-color-picker-plus-sure-${i.value}`);f.className="btn btn-secondary";const g=document.getElementById(`farris-color-picker-plus-input-${i.value}`);g.style.borderColor="#dcdfe6"}function d({x:f,y:g,height:k,width:v}){const y=f*100/v,H=-(g*100/k)+100;h(y,H);const P=r.color==null?"transparent":r.color,N=S.from(P);if(m(),N!=null){const B=r.hue.getHsva(),I=N.getHsva(),V=new S().setHsva(B.hue,y,H,I.alpha);e.emit("update:color",V)}!N&&u.value&&e.emit("update:color",null)}function p(f){if(n.value){const{width:g,height:k,top:v,left:y}=n.value.getBoundingClientRect(),{pageX:H,pageY:P}="touches"in f?f.touches[0]:f,N=Math.max(0,Math.min(H-(y+window.pageXOffset),g)),B=Math.max(0,Math.min(P-(v+window.pageYOffset),k));d({x:N,y:B,height:k,width:g})}}return a.onMounted(()=>{const f=r.color.getHsva();h(f.saturation,f.value)}),a.watch(()=>r.color,f=>{f.getHsva()}),a.watch(()=>r.color,f=>{const g=f.getHsva();h(g.saturation,g.value)}),()=>a.createVNode("div",{class:"f-sv-panel-component",ref:n,style:{backgroundColor:l()},onMousedown:a.withModifiers(f=>p(f),["prevent"]),onTouchstart:a.withModifiers(f=>p(f),["prevent"])},[a.createVNode("div",{class:"color-svpanel__white"},null),a.createVNode("div",{class:"color-svpanel__black"},null),a.createVNode("div",{class:"color-svpanel__cursor",ref:t},[a.createVNode("div",null,null)])])}}),St={color:{type:Object,default:""},hue:{type:Object,default:""},allowColorNull:{type:Boolean,default:!1},onChange:{type:Function}},Xe=a.defineComponent({name:"Hue",props:St,emits:["update:color","update:hue"],setup(r,e){const t=a.ref(r.hue),n=a.ref(r.allowColorNull),i=[];function u(v){v.preventDefault(),h(v)}const l=a.ref(null);function h(v){if(l.value){const{width:y,height:H,top:P,left:N}=l.value.getBoundingClientRect(),{pageX:B,pageY:I}="touches"in v?v.touches[0]:v,V=Math.max(0,Math.min(B-(N+window.pageXOffset),y)),$=Math.max(0,Math.min(I-(P+window.pageYOffset),H));k({x:V,y:$,height:H,width:y})}}function m(){i.forEach(v=>v()),i.length=0}function d(v){u(v),document.addEventListener("mouseup",m),document.addEventListener("touchend",m),document.addEventListener("touchmove",u)}const p=v=>{d(v),v.stopPropagation()};a.onMounted(()=>{document.querySelectorAll(".f-hue-component").forEach(H=>{H.addEventListener("mousedown",p),H.addEventListener("touchstart",p)});const y=r.color.getHsva();g(y.hue)});const f=a.ref(null);function g(v){var P;const y=Math.max(0,Math.min(v/360*100,100));f.value&&((P=f.value.style)==null||P.setProperty("top",`${y}%`))}function k({x:v,y,height:H,width:P}){const N=y/H*360;g(N);const B=r.color.getHsva(),I=new S().setHsva(N,B.saturation,B.value,B.alpha),V=new S().setHsva(N,100,100,B.alpha);(r.color!=null||r.color==null&&n.value)&&(e.emit("update:hue",V),e.emit("update:color",I))}return a.watch(t,v=>{const y=v.getHsva();g(y.hue)}),a.watch(()=>r.color,v=>{const y=v.getHsva();g(y.hue)}),()=>a.createVNode("div",{class:"f-hue-component",ref:l,onMousedown:a.withModifiers(v=>h(v),["prevent"]),onTouchstart:a.withModifiers(v=>h(v),["prevent"])},[a.createVNode("div",{class:"color-hue-slider__bar"},null),a.createVNode("div",{class:"color-hue-slider__thumb",ref:f},null)])}}),Pt={color:{type:Object,default:""},randomId:{type:String,default:""},allowColorNull:{type:Boolean,default:!1}},Ge=a.defineComponent({name:"Alpha",props:Pt,emits:["update:color"],setup(r,e){const t=a.ref(null),n=a.ref(null),i=a.ref(r.randomId),u=a.ref(r.allowColorNull),l=p=>{var k;const f=Math.max(0,Math.min(p*100,100));n.value&&((k=n.value.style)==null||k.setProperty("left",`${f}%`))};function h(p){if(t.value){const{width:f,height:g,top:k,left:v}=t.value.getBoundingClientRect(),{pageX:y,pageY:H}="touches"in p?p.touches[0]:p,P=Math.max(0,Math.min(y-(v+window.pageXOffset),f)),N=Math.max(0,Math.min(H-(k+window.pageYOffset),g));d({x:P,y:N,height:g,width:f})}}function m(){const p=document.getElementById(`farris-color-picker-plus-sure-${i.value}`);p.className="btn btn-secondary";const f=document.getElementById(`farris-color-picker-plus-input-${i.value}`);f.style.borderColor="#dcdfe6"}const d=({x:p,width:f})=>{const g=p/f;l(g),m();const k=r.color.getHsva(),v=new S().setHsva(k.hue,k.saturation,k.value,g);r.color!=null?e.emit("update:color",v):r.color==null&&u.value&&e.emit("update:color",null)};return a.onMounted(()=>{const p=r.color.getHsva();l(p.alpha)}),a.watch(()=>r.color,p=>{const f=p.getHsva();l(f.alpha)}),()=>a.createVNode("div",{class:"f-alpha-component",ref:t,onMousedown:a.withModifiers(p=>h(p),["prevent"]),onTouchstart:a.withModifiers(p=>h(p),["prevent"])},[a.createVNode("div",{class:"color-alpha-slider__bar"},[a.createTextVNode(" ")]),a.createVNode("div",{class:"color-alpha-slider__thumb",ref:n},null)])}}),Vt={color:{type:Object,default:""},hue:{type:Object,default:""},colorPresets:{type:Object,default:""},randomId:{type:String,default:""}},We=a.defineComponent({name:"Preset",props:Vt,emits:["update:hue","update:color"],setup(r,e){const t=a.ref(new S),n=a.ref(r.colorPresets),i=a.ref(r.randomId);function u(){const d=document.getElementById(`farris-color-picker-plus-sure-${i.value}`);d.className="btn btn-secondary";const p=document.getElementById(`farris-color-picker-plus-input-${i.value}`);p.style.borderColor="#dcdfe6"}function l(d){u();const p=d.getRgba(),f=d.getHsva(),g=new S().setRgba(p.red,p.green,p.blue,p.alpha),k=new S().setHsva(f.hue);t.value=d,e.emit("update:hue",k),e.emit("update:color",g)}function h(d){const p=t.value.getRgba().toString(),f=t.value.getHsva().toString(),g=d.getRgba().toString()===p&&d.getHsva().toString()===f;return{"color-preset__color-selector":g,selected:g}}function m(d,p){return a.createVNode("div",{class:"color-preset__color-selector"},[a.createVNode("div",{key:p,class:h(d),style:{backgroundColor:d.toRgbString()},onClick:()=>l(d)},null)])}return()=>a.createVNode("div",{class:"f-preset-component"},[a.createVNode("div",{class:"color-preset__colors"},[n.value.map((d,p)=>m(d,p))])])}}),Z=a.defineComponent({name:"FColorPicker",props:se,emits:["valueChanged","activeChange","update:color","update:hue"],setup(r,e){const t=a.ref(new S(r.color)),n=a.ref(r.color),i=a.ref(r.disabled),u=a.ref(r.color),l=a.ref(r.allowColorNull),h=a.ref(r.presets),m=a.ref(!1),d=a.ref(!1),p=a.ref(!1),f=a.ref("HEX"),g=Math.floor(Math.random()*1e3).toString();let k=-1,v,y=new we("#000000");const H=a.ref(r.color);let P,N;const B=a.ref(null),I=a.ref(null),V=a.ref(null);let $=a.computed(()=>!v&&y&&y.initType?y.initType:v);const O=a.computed({get(){return v&&n.value!==null?(T(v),j(new S(n.value),M[v])):n.value},set(b){b!==null&&(F(b),C(b))}}),A=a.ref(O.value),x=a.computed(()=>k>-1),G=a.computed(()=>h.value.length>0),be=a.computed(()=>({"background-color":u.value})),re=a.computed(()=>d.value&&m.value?"display:flex":"display:none"),W=[{text:"HEX",type:M.hex},{text:"RGBA",type:M.rgba}];function ke(){const b=document.getElementById("farris-color-picker-panel");b.id=`farris-color-picker-panel-${g}`;const w=document.getElementById("farris-color-picker-plus-sure");w.id=`farris-color-picker-plus-sure-${g}`;const E=document.getElementById("farris-color-picker-plus-input");E.id=`farris-color-picker-plus-input-${g}`,N=document.getElementById(`farris-color-picker-plus-sure-${g}`),P=document.getElementById(`farris-color-picker-panel-${g}`),P.className="color-picker-panel disabled"}function Y(){if(!l.value&&!n.value){document.getElementById(`farris-color-picker-plus-sure-${g}`).classList.toggle("disabled");const w=document.getElementById(`farris-color-picker-plus-input-${g}`);w.style.borderColor="red"}}function Se(){n.value&&(F(n.value),!n.value&&l.value||(n.value=j(new S(n.value),M[$.value])),A.value=O.value),K(T(y.initType))}function ie(){n.value&&F(n.value),y.hasPresets()||y.setColorPresets(h.value),n.value?u.value=j(new S(n.value),M[$.value]):!n.value&&l.value&&(u.value=null)}function Pe(){y.valueChanges.subscribe(b=>{const w=j(b,M[v||y.initType]);n.value=w})}function K(b){f.value=W[b].text}function Ve(){var b;d.value=!!(v!=null&&v.includes("a")||(b=y.initType)!=null&&b.includes("a"))}a.onBeforeMount(()=>{y.setColorPresets(h.value||["#eaecf3"])}),a.onMounted(()=>{ke(),Y(),Se(),ie()}),a.watch(f,()=>{Pe(),O.value=j(new S(n.value),M[v||y.initType]),t.value=new S(O.value),Ve()}),a.watch(n,b=>{j(y.value,y.initType)!==b&&b!==null&&F(b),K(T(y.initType))}),a.watch(t,b=>{n.value=j(b,M[v||y.initType]),F(n.value),O.value=n.value});function C(b){const w=document.getElementById(`farris-color-picker-plus-input-${g}`);(b==""||b==null||b==null)&&!l.value?(n.value=null,w.style.borderColor="red",N.className="btn btn-secondary disabled"):(w.style.borderColor="#dcdfe6",N.className="btn btn-secondary")}function Ne(b){var w,E;if(b==null||b.stopPropagation(),l.value){u.value=(n==null?void 0:n.value)??null;const U={elementValue:u};e.emit("valueChanged",U),D()}if(!l.value&&!(O.value==null||O.value==null||O.value=="")){(E=(w=B.value)==null?void 0:w.style)==null||E.setProperty("background",n.value),p.value=!0,u.value=n.value;const U={elementValue:u};e.emit("valueChanged",U),D()}!H.value&&!n.value&&!p.value&&l&&D(),C(n.value),O.value=n.value,N.classList.contains("disabled")||(A.value=n.value,m.value=!1)}function F(b){y==null||y.setValueFrom(b,g,l.value)}function Ee(b){P=document.getElementById(`farris-color-picker-panel-${g}`);const w=P.className=="color-picker-panel";i.value||w||(m.value=!0,P.classList.toggle("disabled"),Y(),F(n.value),b.stopPropagation())}function D(){P=document.getElementById(`farris-color-picker-panel-${g}`),P.className="color-picker-panel disabled"}function T(b){const w=W.findIndex(E=>E.type===b);return k=w,w}function z(b){if(!N.classList.contains("disabled")){const w=W.length;k=(w+k+(b==="up"?1:-1))%w,v=W[k].type,K(k),F(n.value)}}return()=>a.createVNode("div",{class:"f-color-picker-component",ref:I},[a.createVNode("div",{class:["color-picker-panel",{disabled:i.value}],id:"farris-color-picker-panel",ref:V,onClick:b=>b.stopPropagation(),style:"top:30px"},[a.createVNode("div",{class:"color-picker-main"},[a.createVNode(Xe,{hue:y.hue,"onUpdate:hue":b=>y.hue=b,allowColorNull:l.value,color:t.value,"onUpdate:color":b=>t.value=b},null),a.createVNode(Ye,{randomId:g,hue:y.hue,"onUpdate:hue":b=>y.hue=b,allowColorNull:l.value,color:t.value,"onUpdate:color":b=>t.value=b},null)]),a.createVNode(Ge,{style:re.value,randomId:g,allowColorNull:l.value,color:t.value,"onUpdate:color":b=>t.value=b},null),a.createVNode("div",{class:"input-btn",style:"display:flex;align-items: center;"},[a.withDirectives(a.createVNode("span",{style:"width:40px;margin-right:10px;"},[f.value]),[[a.vShow,G]]),a.withDirectives(a.createVNode("input",{type:"text",title:"color-picker-plus",id:"farris-color-picker-plus-input","onUpdate:modelValue":b=>O.value=b,style:"float:none"},null),[[a.vModelText,O.value]]),a.withDirectives(a.createVNode("div",{class:"type-icon-btn-wrapper",style:"cursor:pointer"},[a.createVNode("span",{class:"f-icon f-icon-arrow-60-up type-icon-btn",onClick:()=>z("up")},null),a.createVNode("span",{class:"f-icon f-icon-arrow-60-down type-icon-btn",onClick:()=>z("down")},null)]),[[a.vShow,G]]),a.createVNode("div",{class:"input-btn"},[a.createVNode("button",{id:"farris-color-picker-plus-sure",class:"btn btn-secondary",onClick:b=>Ne(b)},[a.createTextVNode("确定")])])]),a.withDirectives(a.createVNode(We,{color:t.value,"onUpdate:color":b=>t.value=b,hue:y.hue,"onUpdate:hue":b=>y.hue=b,randomId:g,colorPresets:y.presets},null),[[a.vShow,x]])]),a.createVNode("div",{class:"color-picker-wrapper"},[a.createVNode("input",{title:"color-picker-input",type:"text",class:"color-picker-input form-control",value:A.value,readonly:i.value,onClick:b=>b.stopPropagation()},null),a.createVNode("div",{class:"color-picker-trigger",onClick:Ee},[a.createVNode("div",{class:"color-picker-trigger-inner"},[a.createVNode("div",{style:be.value},null)])])])])}});function Nt(r,e,t){var I;function n(){}const i="",u="",l=a.ref();function h(){return(e==null?void 0:e.schema.componentType)!=="frame"}function m(){return!1}function d(){return(e==null?void 0:e.schema.componentType)!=="frame"}function p(){return(e==null?void 0:e.schema.componentType)==="frame"}function f(V){if(!V||!V.value)return null;if(V.value.schema&&V.value.schema.type==="component")return V.value;const $=a.ref(V==null?void 0:V.value.parent),O=f($);return O||null}function g(V=e){const{componentInstance:$,designerItemElementRef:O}=V;return!$||!$.value?null:$.value.canMove?O:g(V.parent)}function k(V){return!!t}function v(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function y(){}function H(V,$){}function P(V,$){const{componentType:O}=V;let A=He(O,V,$);const x=O.toLowerCase().replace("-","_");return A&&!A.id&&A.type===O&&(A.id=`${x}_${Math.random().toString().slice(2,6)}`),A}function N(V){}function B(...V){}return l.value={canMove:h(),canSelectParent:m(),canDelete:d(),canNested:!p(),contents:e==null?void 0:e.schema.contents,elementRef:r,parent:(I=e==null?void 0:e.parent)==null?void 0:I.componentInstance,schema:e==null?void 0:e.schema,styles:i,designerClass:u,canAccepts:k,getBelongedComponentInstance:f,getDraggableDesignItemElement:g,getDraggingDisplayText:v,getPropConfig:B,getDragScopeElement:y,onAcceptMovedChildElement:H,onChildElementMovedOut:N,addNewChildComponentSchema:P,updateDragAndDropRules:n,triggerBelongedComponentToMoveWhenMoved:a.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:a.ref(!1)},l}const Et=a.defineComponent({name:"FColorPickerDesign",props:se,emits:["valueChanged","activeChange","update:color","update:hue"],setup(r,e){const t=a.ref(new S(r.color)),n=a.ref(r.color),i=a.ref(r.disabled),u=a.ref(r.color),l=a.ref(r.allowColorNull),h=a.ref(r.presets),m=a.ref(!1),d=a.ref(!1),p=a.ref(!1),f=a.ref("HEX"),g=Math.floor(Math.random()*1e3).toString();let k=-1,v,y=new we("#000000");const H=a.ref(r.color);let P,N;const B=a.ref(null),I=a.ref(null),V=a.ref(),$=a.inject("design-item-context"),O=Nt(V,$);a.onMounted(()=>{V.value.componentInstance=O}),e.expose(O.value);let A=a.computed(()=>!v&&y&&y.initType?y.initType:v);const x=a.computed({get(){return v&&n.value!==null?(z(v),j(new S(n.value),M[v])):n.value},set(w){w!==null&&(D(w),F(w))}}),G=a.ref(x.value),be=a.computed(()=>k>-1),re=a.computed(()=>h.value.length>0),W=a.computed(()=>({"background-color":u.value})),ke=a.computed(()=>d.value&&m.value?"display:flex":"display:none"),Y=[{text:"HEX",type:M.hex},{text:"RGBA",type:M.rgba}];function Se(){const w=document.getElementById("farris-color-picker-panel");w.id=`farris-color-picker-panel-${g}`;const E=document.getElementById("farris-color-picker-plus-sure");E.id=`farris-color-picker-plus-sure-${g}`;const U=document.getElementById("farris-color-picker-plus-input");U.id=`farris-color-picker-plus-input-${g}`,N=document.getElementById(`farris-color-picker-plus-sure-${g}`),P=document.getElementById(`farris-color-picker-panel-${g}`),P.className="color-picker-panel disabled"}function ie(){if(!l.value&&!n.value){document.getElementById(`farris-color-picker-plus-sure-${g}`).classList.toggle("disabled");const E=document.getElementById(`farris-color-picker-plus-input-${g}`);E.style.borderColor="red"}}function Pe(){n.value&&(D(n.value),!n.value&&l.value||(n.value=j(new S(n.value),M[A.value])),G.value=x.value),C(z(y.initType))}function K(){n.value&&D(n.value),y.hasPresets()||y.setColorPresets(h.value),n.value?u.value=j(new S(n.value),M[A.value]):!n.value&&l.value&&(u.value=null)}function Ve(){y.valueChanges.subscribe(w=>{const E=j(w,M[v||y.initType]);n.value=E})}function C(w){f.value=Y[w].text}function Ne(){var w;d.value=!!(v!=null&&v.includes("a")||(w=y.initType)!=null&&w.includes("a"))}a.onBeforeMount(()=>{y.setColorPresets(h.value||["#eaecf3"])}),a.onMounted(()=>{Se(),ie(),Pe(),K()}),a.watch(f,()=>{Ve(),x.value=j(new S(n.value),M[v||y.initType]),t.value=new S(x.value),Ne()}),a.watch(n,w=>{j(y.value,y.initType)!==w&&w!==null&&D(w),C(z(y.initType))}),a.watch(t,w=>{n.value=j(w,M[v||y.initType]),D(n.value),x.value=n.value});function F(w){const E=document.getElementById(`farris-color-picker-plus-input-${g}`);(w==""||w==null||w==null)&&!l.value?(n.value=null,E.style.borderColor="red",N.className="btn btn-secondary disabled"):(E.style.borderColor="#dcdfe6",N.className="btn btn-secondary")}function Ee(){var w,E;if(l.value){u.value=(n==null?void 0:n.value)??null;const U={elementValue:u};e.emit("valueChanged",U),P.classList.toggle("disabled")}if(!l.value&&!(x.value==null||x.value==null||x.value=="")){(E=(w=B.value)==null?void 0:w.style)==null||E.setProperty("background",n.value),p.value=!0,u.value=n.value;const U={elementValue:u};e.emit("valueChanged",U),P.classList.toggle("disabled")}!H.value&&!n.value&&!p.value&&l&&P.classList.toggle("disabled"),F(n.value),x.value=n.value,N.classList.contains("disabled")||(G.value=n.value,m.value=!1)}function D(w){y==null||y.setValueFrom(w,g,l.value)}function T(w){i.value||(m.value=!0,P.classList.toggle("disabled"),ie(),D(n.value))}function z(w){const E=Y.findIndex(U=>U.type===w);return k=E,E}function b(w){if(!N.classList.contains("disabled")){const E=Y.length;k=(E+k+(w==="up"?1:-1))%E,v=Y[k].type,C(k),D(n.value)}}return()=>a.createVNode("div",{class:"f-color-picker-component",ref:V},[a.createVNode("div",{class:["color-picker-panel",{disabled:i.value}],id:"farris-color-picker-panel",ref:I,onClick:w=>w.stopPropagation,style:"top:30px"},[a.createVNode("div",{class:"color-picker-main"},[a.createVNode(Xe,{hue:y.hue,"onUpdate:hue":w=>y.hue=w,allowColorNull:l.value,color:t.value,"onUpdate:color":w=>t.value=w},null),a.createVNode(Ye,{randomId:g,hue:y.hue,"onUpdate:hue":w=>y.hue=w,allowColorNull:l.value,color:t.value,"onUpdate:color":w=>t.value=w},null)]),a.createVNode(Ge,{style:ke.value,randomId:g,allowColorNull:l.value,color:t.value,"onUpdate:color":w=>t.value=w},null),a.createVNode("div",{class:"input-btn",style:"display:flex;align-items: center;"},[a.withDirectives(a.createVNode("span",{style:"width:40px;margin-right:10px;"},[f.value]),[[a.vShow,re]]),a.withDirectives(a.createVNode("input",{type:"text",id:"farris-color-picker-plus-input","onUpdate:modelValue":w=>x.value=w,style:"float:none"},null),[[a.vModelText,x.value]]),a.withDirectives(a.createVNode("div",{class:"type-icon-btn-wrapper",style:"cursor:pointer"},[a.createVNode("span",{class:"f-icon f-icon-arrow-60-up type-icon-btn",onClick:()=>b("up")},null),a.createVNode("span",{class:"f-icon f-icon-arrow-60-down type-icon-btn",onClick:()=>b("down")},null)]),[[a.vShow,re]]),a.createVNode("div",{class:"input-btn"},[a.createVNode("button",{id:"farris-color-picker-plus-sure",class:"btn btn-secondary",onClick:Ee},[a.createTextVNode("确定")])])]),a.withDirectives(a.createVNode(We,{color:t.value,"onUpdate:color":w=>t.value=w,colorPresets:y.presets,hue:y.hue,"onUpdate:hue":w=>y.hue=w,randomId:g},null),[[a.vShow,be]])]),a.createVNode("div",{class:"color-picker-wrapper"},[a.createVNode("input",{type:"text",class:"color-picker-input form-control",value:G.value,readonly:i.value,onClick:w=>w.stopPropagation()},null),a.createVNode("div",{class:"color-picker-trigger",onClick:T},[a.createVNode("div",{class:"color-picker-trigger-inner"},[a.createVNode("div",{style:W.value},null)])])])])}}),Mt=r=>{const e=r;return e.install=function(t){t.component(e.name,r)},r};Z.register=(r,e,t)=>{r["color-picker"]=Z,e["color-picker"]=Be},Z.registerDesigner=(r,e,t)=>{r["color-picker"]=Et,e["color-picker"]=Be};const Ot=Mt(Z);R.FColorPicker=Z,R.default=Ot,Object.defineProperties(R,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function fe(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var ee=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,i,u;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var h=ue(l),m=h.next();!m.done;m=h.next()){var p=m.value;p.remove(this)}}catch(y){e={error:y}}finally{try{m&&!m.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}else l.remove(this);var d=this.initialTeardown;if(L(d))try{d()}catch(y){u=y instanceof de?y.errors:[y]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var g=ue(f),k=g.next();!k.done;k=g.next()){var v=k.value;try{xe(v)}catch(y){u=u??[],y instanceof de?u=pe(pe([],he(u)),he(y.errors)):u.push(y)}}}catch(y){n={error:y}}finally{try{k&&!k.done&&(i=g.return)&&i.call(g)}finally{if(n)throw n.error}}}if(u)throw new de(u)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)xe(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&fe(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&fe(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}(),Re=ee.EMPTY;function je(r){return r instanceof ee||r&&"closed"in r&&L(r.remove)&&L(r.add)&&L(r.unsubscribe)}function xe(r){L(r)?r():r.unsubscribe()}var Ae={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},at={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,pe([r,e],he(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function st(r){at.setTimeout(function(){throw r})}function Ie(){}function te(r){r()}var ge=function(r){X(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,je(t)&&t.add(n)):n.destination=ut,n}return e.create=function(t,n,i){return new me(t,n,i)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(ee),ot=Function.prototype.bind;function ye(r,e){return ot.call(r,e)}var ct=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){ne(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){ne(n)}else ne(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){ne(t)}},r}(),me=function(r){X(e,r);function e(t,n,i){var u=r.call(this)||this,l;if(L(t)||!t)l={next:t??void 0,error:n??void 0,complete:i??void 0};else{var h;u&&Ae.useDeprecatedNextContext?(h=Object.create(t),h.unsubscribe=function(){return u.unsubscribe()},l={next:t.next&&ye(t.next,h),error:t.error&&ye(t.error,h),complete:t.complete&&ye(t.complete,h)}):l=t}return u.destination=new ct(l),u}return e}(ge);function ne(r){st(r)}function lt(r){throw r}var ut={closed:!0,next:Ie,error:lt,complete:Ie},ht=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function De(r){return r}function pt(r){return r.length===0?De:r.length===1?r[0]:function(t){return r.reduce(function(n,i){return i(n)},t)}}var Ue=function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var i=this,u=ft(e)?e:new me(e,t,n);return te(function(){var l=i,h=l.operator,m=l.source;u.add(h?h.call(u,m):m?i._subscribe(u):i._trySubscribe(u))}),u},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=Le(t),new t(function(i,u){var l=new me({next:function(h){try{e(h)}catch(m){u(m),l.unsubscribe()}},error:u,complete:i});n.subscribe(l)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[ht]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return pt(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=Le(e),new e(function(n,i){var u;t.subscribe(function(l){return u=l},function(l){return i(l)},function(){return n(u)})})},r.create=function(e){return new r(e)},r}();function Le(r){var e;return(e=r??Ae.Promise)!==null&&e!==void 0?e:Promise}function dt(r){return r&&L(r.next)&&L(r.error)&&L(r.complete)}function ft(r){return r&&r instanceof ge||dt(r)&&je(r)}function gt(r){return L(r==null?void 0:r.lift)}function yt(r){return function(e){if(gt(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function mt(r,e,t,n,i){return new vt(r,e,t,n,i)}var vt=function(r){X(e,r);function e(t,n,i,u,l,h){var m=r.call(this,t)||this;return m.onFinalize=l,m.shouldUnsubscribe=h,m._next=n?function(p){try{n(p)}catch(d){t.error(d)}}:r.prototype._next,m._error=u?function(p){try{u(p)}catch(d){t.error(d)}finally{this.unsubscribe()}}:r.prototype._error,m._complete=i?function(){try{i()}catch(p){t.error(p)}finally{this.unsubscribe()}}:r.prototype._complete,m}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(ge),wt=$e(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ve=function(r){X(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new Fe(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new wt},e.prototype.next=function(t){var n=this;te(function(){var i,u;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var l=ue(n.currentObservers),h=l.next();!h.done;h=l.next()){var m=h.value;m.next(t)}}catch(p){i={error:p}}finally{try{h&&!h.done&&(u=l.return)&&u.call(l)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;te(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var i=n.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;te(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,i=this,u=i.hasError,l=i.isStopped,h=i.observers;return u||l?Re:(this.currentObservers=null,h.push(t),new ee(function(){n.currentObservers=null,fe(h,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,u=n.thrownError,l=n.isStopped;i?t.error(u):l&&t.complete()},e.prototype.asObservable=function(){var t=new Ue;return t.source=this,t},e.create=function(t,n){return new Fe(t,n)},e}(Ue),Fe=function(r){X(e,r);function e(t,n){var i=r.call(this)||this;return i.destination=t,i.source=n,i}return e.prototype.next=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,t)},e.prototype.error=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&i!==void 0?i:Re},e}(ve),qe=function(r){X(e,r);function e(t){var n=r.call(this)||this;return n._value=t,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=r.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,i=t.thrownError,u=t._value;if(n)throw i;return this._throwIfClosed(),u},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e}(ve);function bt(r,e){return e===void 0&&(e=De),r=r??kt,yt(function(t,n){var i,u=!0;t.subscribe(mt(n,function(l){var h=e(l);(u||!r(i,h))&&(u=!1,i=h,n.next(l))}))})}function kt(r,e){return r===e}var H=(r=>(r.hex="hex",r.hexa="hexa",r.rgba="rgba",r.rgb="rgb",r.hsla="hsla",r.hsl="hsl",r.cmyk="cmyk",r))(H||{});class we{constructor(e){s(this,"modelValue",null);s(this,"hueValue",null);s(this,"initValue",null);s(this,"valueChanged",new ve);s(this,"presetsVisibilityChanges",new qe(!0));s(this,"initType",null);s(this,"alphaChannelVisibilityChanges",new qe(!0));s(this,"valueChanges",this.valueChanged.asObservable().pipe(bt((e,t)=>e.toRgbaString()===t.toRgbaString())));s(this,"colorPresets",[]);const t=e[0],n=S.from(t);this.setValue(n),this.setHueColor(n)}setValueFrom(e,t,n){const i=S.from(e);return this.initValue||(this.initValue=S.from(e)),typeof e=="string"&&this.finOutInputType(e),this.setHueColor(i),this.setValue(i),this}setHueColor(e){(this.hueValue&&e.getHsva().hue>0||!this.hueValue)&&(this.hueValue=new S().setHsva(e.getHsva().hue))}get hue(){return this.hueValue}set hue(e){this.hueValue=e}setValue(e){return this.modelValue=e,this.valueChanged.next(e),this}get value(){return this.modelValue}set value(e){this.setValue(e)}reset(){let e;return this.initValue?(e=this.initValue.clone(),this.setHueColor(e)):(e=S.from(new c(255,0,0,1)),this.hueValue=new S().setHsva(e.getHsva().hue)),this.setValue(e),this}showAlphaChannel(){return this.alphaChannelVisibilityChanges.next(!0),this}finOutInputType(e){const t=e.replace(/ /g,"").toLowerCase();t[0]==="#"&&(this.initType="hex",t.length>7&&(this.initType="hexa"));const n=t.indexOf("(");switch(t.substr(0,n)){case"rgba":this.initType="rgba";break;case"rgb":this.initType="rgb";break;case"hsla":this.initType="hsla";break;case"hsl":this.initType="hsl";break;case"cmyk":this.initType="cmyk";break}}setColorPresets(e){return this.colorPresets=this.setPresets(e),this}setPresets(e){const t=[];return e.map(n=>{Array.isArray(n)?t.push(this.setPresets(n)):t.push(new S(n))}),t}get presets(){return this.colorPresets}hasPresets(){return this.colorPresets.length>0}}s(we,"finOutInputType");function A(r,e){switch(e){case H.hex:return r.toHexString();case H.hexa:return r.toHexString(!0);case H.rgb:return r.toRgbString();case H.rgba:return r.toRgbaString();case H.hsl:return r.toHslString();case H.hsla:return r.toHslaString();default:return r.toRgbaString()}}const St={color:{type:Object,default:""},hue:{type:Object,default:""},randomId:{type:String,default:""},allowColorNull:{type:Boolean,default:!1}},Ye=a.defineComponent({name:"SvPanel",props:St,emits:["update:color"],setup(r,e){const t=a.ref(null),n=a.ref(null),i=a.ref(r.randomId),u=a.ref(r.allowColorNull);function l(){return r.hue?r.hue.toRgbaString():"#3f51b5"}function h(f,g){var k,v;f=Math.max(0,Math.min(f,100)),g=Math.max(0,Math.min(g,100)),t.value&&((k=t.value.style)==null||k.setProperty("top",`${100-g}%`),(v=t.value.style)==null||v.setProperty("left",`${f}%`))}function m(){const f=document.getElementById(`farris-color-picker-plus-sure-${i.value}`);f.className="btn btn-secondary";const g=document.getElementById(`farris-color-picker-plus-input-${i.value}`);g.style.borderColor="#dcdfe6"}function p({x:f,y:g,height:k,width:v}){const y=f*100/v,O=-(g*100/k)+100;h(y,O);const V=r.color==null?"transparent":r.color,N=S.from(V);if(m(),N!=null){const $=r.hue.getHsva(),I=N.getHsva(),P=new S().setHsva($.hue,y,O,I.alpha);e.emit("update:color",P)}!N&&u.value&&e.emit("update:color",null)}function d(f){if(n.value){const{width:g,height:k,top:v,left:y}=n.value.getBoundingClientRect(),{pageX:O,pageY:V}="touches"in f?f.touches[0]:f,N=Math.max(0,Math.min(O-(y+window.pageXOffset),g)),$=Math.max(0,Math.min(V-(v+window.pageYOffset),k));p({x:N,y:$,height:k,width:g})}}return a.onMounted(()=>{const f=r.color.getHsva();h(f.saturation,f.value)}),a.watch(()=>r.color,f=>{f.getHsva()}),a.watch(()=>r.color,f=>{const g=f.getHsva();h(g.saturation,g.value)}),()=>a.createVNode("div",{class:"f-sv-panel-component",ref:n,style:{backgroundColor:l()},onMousedown:a.withModifiers(f=>d(f),["prevent"]),onTouchstart:a.withModifiers(f=>d(f),["prevent"])},[a.createVNode("div",{class:"color-svpanel__white"},null),a.createVNode("div",{class:"color-svpanel__black"},null),a.createVNode("div",{class:"color-svpanel__cursor",ref:t},[a.createVNode("div",null,null)])])}}),Pt={color:{type:Object,default:""},hue:{type:Object,default:""},allowColorNull:{type:Boolean,default:!1},onChange:{type:Function}},Xe=a.defineComponent({name:"Hue",props:Pt,emits:["update:color","update:hue"],setup(r,e){const t=a.ref(r.hue),n=a.ref(r.allowColorNull),i=[];function u(v){v.preventDefault(),h(v)}const l=a.ref(null);function h(v){if(l.value){const{width:y,height:O,top:V,left:N}=l.value.getBoundingClientRect(),{pageX:$,pageY:I}="touches"in v?v.touches[0]:v,P=Math.max(0,Math.min($-(N+window.pageXOffset),y)),B=Math.max(0,Math.min(I-(V+window.pageYOffset),O));k({x:P,y:B,height:O,width:y})}}function m(){i.forEach(v=>v()),i.length=0}function p(v){u(v),document.addEventListener("mouseup",m),document.addEventListener("touchend",m),document.addEventListener("touchmove",u)}const d=v=>{p(v),v.stopPropagation()};a.onMounted(()=>{document.querySelectorAll(".f-hue-component").forEach(O=>{O.addEventListener("mousedown",d),O.addEventListener("touchstart",d)});const y=r.color.getHsva();g(y.hue)});const f=a.ref(null);function g(v){var V;const y=Math.max(0,Math.min(v/360*100,100));f.value&&((V=f.value.style)==null||V.setProperty("top",`${y}%`))}function k({x:v,y,height:O,width:V}){const N=y/O*360;g(N);const $=r.color.getHsva(),I=new S().setHsva(N,$.saturation,$.value,$.alpha),P=new S().setHsva(N,100,100,$.alpha);(r.color!=null||r.color==null&&n.value)&&(e.emit("update:hue",P),e.emit("update:color",I))}return a.watch(t,v=>{const y=v.getHsva();g(y.hue)}),a.watch(()=>r.color,v=>{const y=v.getHsva();g(y.hue)}),()=>a.createVNode("div",{class:"f-hue-component",ref:l,onMousedown:a.withModifiers(v=>h(v),["prevent"]),onTouchstart:a.withModifiers(v=>h(v),["prevent"])},[a.createVNode("div",{class:"color-hue-slider__bar"},null),a.createVNode("div",{class:"color-hue-slider__thumb",ref:f},null)])}}),Vt={color:{type:Object,default:""},randomId:{type:String,default:""},allowColorNull:{type:Boolean,default:!1}},Ge=a.defineComponent({name:"Alpha",props:Vt,emits:["update:color"],setup(r,e){const t=a.ref(null),n=a.ref(null),i=a.ref(r.randomId),u=a.ref(r.allowColorNull),l=d=>{var k;const f=Math.max(0,Math.min(d*100,100));n.value&&((k=n.value.style)==null||k.setProperty("left",`${f}%`))};function h(d){if(t.value){const{width:f,height:g,top:k,left:v}=t.value.getBoundingClientRect(),{pageX:y,pageY:O}="touches"in d?d.touches[0]:d,V=Math.max(0,Math.min(y-(v+window.pageXOffset),f)),N=Math.max(0,Math.min(O-(k+window.pageYOffset),g));p({x:V,y:N,height:g,width:f})}}function m(){const d=document.getElementById(`farris-color-picker-plus-sure-${i.value}`);d.className="btn btn-secondary";const f=document.getElementById(`farris-color-picker-plus-input-${i.value}`);f.style.borderColor="#dcdfe6"}const p=({x:d,width:f})=>{const g=d/f;l(g),m();const k=r.color.getHsva(),v=new S().setHsva(k.hue,k.saturation,k.value,g);r.color!=null?e.emit("update:color",v):r.color==null&&u.value&&e.emit("update:color",null)};return a.onMounted(()=>{const d=r.color.getHsva();l(d.alpha)}),a.watch(()=>r.color,d=>{const f=d.getHsva();l(f.alpha)}),()=>a.createVNode("div",{class:"f-alpha-component",ref:t,onMousedown:a.withModifiers(d=>h(d),["prevent"]),onTouchstart:a.withModifiers(d=>h(d),["prevent"])},[a.createVNode("div",{class:"color-alpha-slider__bar"},[a.createTextVNode(" ")]),a.createVNode("div",{class:"color-alpha-slider__thumb",ref:n},null)])}}),Nt={color:{type:Object,default:""},hue:{type:Object,default:""},colorPresets:{type:Object,default:""},randomId:{type:String,default:""}},We=a.defineComponent({name:"Preset",props:Nt,emits:["update:hue","update:color"],setup(r,e){const t=a.ref(new S),n=a.ref(r.colorPresets),i=a.ref(r.randomId);function u(){const p=document.getElementById(`farris-color-picker-plus-sure-${i.value}`);p.className="btn btn-secondary";const d=document.getElementById(`farris-color-picker-plus-input-${i.value}`);d.style.borderColor="#dcdfe6"}function l(p){u();const d=p.getRgba(),f=p.getHsva(),g=new S().setRgba(d.red,d.green,d.blue,d.alpha),k=new S().setHsva(f.hue);t.value=p,e.emit("update:hue",k),e.emit("update:color",g)}function h(p){const d=t.value.getRgba().toString(),f=t.value.getHsva().toString(),g=p.getRgba().toString()===d&&p.getHsva().toString()===f;return{"color-preset__color-selector":g,selected:g}}function m(p,d){return a.createVNode("div",{class:"color-preset__color-selector"},[a.createVNode("div",{key:d,class:h(p),style:{backgroundColor:p.toRgbString()},onClick:()=>l(p)},null)])}return()=>a.createVNode("div",{class:"f-preset-component"},[a.createVNode("div",{class:"color-preset__colors"},[n.value.map((p,d)=>m(p,d))])])}}),C=a.defineComponent({name:"FColorPicker",props:se,emits:["valueChanged","activeChange","update:color","update:hue"],setup(r,e){const t=a.ref(new S(r.color)),n=a.ref(r.color),i=a.ref(r.disabled),u=a.ref(r.color),l=a.ref(r.allowColorNull),h=a.ref(r.presets),m=a.ref(!1),p=a.ref(!1),d=a.ref(!1),f=a.ref("HEX"),g=Math.floor(Math.random()*1e3).toString();let k=-1,v;const y=new we("#000000"),O=a.ref(r.color);let V,N;const $=a.ref(null),I=a.ref(null),P=a.ref(null),B=a.computed(()=>!v&&y&&y.initType?y.initType:v),M=a.computed({get(){return v&&n.value!==null?(T(v),A(new S(n.value),H[v])):n.value},set(b){b!==null&&(F(b),z(b))}}),j=a.ref(M.value),x=a.computed(()=>k>-1),G=a.computed(()=>h.value.length>0),be=a.computed(()=>({"background-color":u.value})),re=a.computed(()=>p.value&&m.value?"display:flex":"display:none"),W=[{text:"HEX",type:H.hex},{text:"RGBA",type:H.rgba}];function ke(){const b=document.getElementById("farris-color-picker-panel");b.id=`farris-color-picker-panel-${g}`;const w=document.getElementById("farris-color-picker-plus-sure");w.id=`farris-color-picker-plus-sure-${g}`;const E=document.getElementById("farris-color-picker-plus-input");E.id=`farris-color-picker-plus-input-${g}`,N=document.getElementById(`farris-color-picker-plus-sure-${g}`),V=document.getElementById(`farris-color-picker-panel-${g}`),V.className="color-picker-panel disabled"}function Y(){if(!l.value&&!n.value){document.getElementById(`farris-color-picker-plus-sure-${g}`).classList.toggle("disabled");const w=document.getElementById(`farris-color-picker-plus-input-${g}`);w.style.borderColor="red"}}function Se(){n.value&&(F(n.value),!n.value&&l.value||(n.value=A(new S(n.value),H[B.value])),j.value=M.value),K(T(y.initType))}function ie(){n.value&&F(n.value),y.hasPresets()||y.setColorPresets(h.value),n.value?u.value=A(new S(n.value),H[B.value]):!n.value&&l.value&&(u.value=null)}function Pe(){y.valueChanges.subscribe(b=>{const w=A(b,H[v||y.initType]);n.value=w})}function K(b){f.value=W[b].text}function Ve(){var b;p.value=!!(v!=null&&v.includes("a")||(b=y.initType)!=null&&b.includes("a"))}a.onBeforeMount(()=>{y.setColorPresets(h.value||["#eaecf3"])}),a.onMounted(()=>{ke(),Y(),Se(),ie()}),a.watch(f,()=>{Pe(),M.value=A(new S(n.value),H[v||y.initType]),t.value=new S(M.value),Ve()}),a.watch(n,b=>{A(y.value,y.initType)!==b&&b!==null&&F(b),K(T(y.initType))}),a.watch(t,b=>{n.value=A(b,H[v||y.initType]),F(n.value),M.value=n.value});function z(b){const w=document.getElementById(`farris-color-picker-plus-input-${g}`);(b===""||b===void 0||b==null)&&!l.value?(n.value=null,w.style.borderColor="red",N.className="btn btn-secondary disabled"):(w.style.borderColor="#dcdfe6",N.className="btn btn-secondary")}function Ne(b){var w,E;if(b==null||b.stopPropagation(),l.value){u.value=(n==null?void 0:n.value)??null;const U={elementValue:u};e.emit("valueChanged",U),D()}if(!l.value&&!(M.value===void 0||M.value==null||M.value==="")){(E=(w=$.value)==null?void 0:w.style)==null||E.setProperty("background",n.value),d.value=!0,u.value=n.value;const U={elementValue:u};e.emit("valueChanged",U),D()}!O.value&&!n.value&&!d.value&&l&&D(),z(n.value),M.value=n.value,N.classList.contains("disabled")||(j.value=n.value,m.value=!1)}function F(b){y==null||y.setValueFrom(b,g,l.value)}function Me(b){V=document.getElementById(`farris-color-picker-panel-${g}`);const w=V.className==="color-picker-panel";i.value||w||(m.value=!0,V.classList.toggle("disabled"),Y(),F(n.value),b.stopPropagation())}function D(){V=document.getElementById(`farris-color-picker-panel-${g}`),V.className="color-picker-panel disabled"}function T(b){const w=W.findIndex(E=>E.type===b);return k=w,w}function J(b){if(!N.classList.contains("disabled")){const w=W.length;k=(w+k+(b==="up"?1:-1))%w,v=W[k].type,K(k),F(n.value)}}return()=>a.createVNode("div",{class:"f-color-picker-component",ref:I},[a.createVNode("div",{class:["color-picker-panel",{disabled:i.value}],id:"farris-color-picker-panel",ref:P,onClick:b=>b.stopPropagation(),style:"top:30px"},[a.createVNode("div",{class:"color-picker-main"},[a.createVNode(Xe,{hue:y.hue,"onUpdate:hue":b=>y.hue=b,allowColorNull:l.value,color:t.value,"onUpdate:color":b=>t.value=b},null),a.createVNode(Ye,{randomId:g,hue:y.hue,"onUpdate:hue":b=>y.hue=b,allowColorNull:l.value,color:t.value,"onUpdate:color":b=>t.value=b},null)]),a.createVNode(Ge,{style:re.value,randomId:g,allowColorNull:l.value,color:t.value,"onUpdate:color":b=>t.value=b},null),a.createVNode("div",{class:"input-btn",style:"display:flex;align-items: center;"},[a.withDirectives(a.createVNode("span",{style:"width:40px;margin-right:10px;"},[f.value]),[[a.vShow,G]]),a.withDirectives(a.createVNode("input",{type:"text",title:"color-picker-plus",id:"farris-color-picker-plus-input","onUpdate:modelValue":b=>M.value=b,style:"float:none"},null),[[a.vModelText,M.value]]),a.withDirectives(a.createVNode("div",{class:"type-icon-btn-wrapper",style:"cursor:pointer"},[a.createVNode("span",{class:"f-icon f-icon-arrow-60-up type-icon-btn",onClick:()=>J("up")},null),a.createVNode("span",{class:"f-icon f-icon-arrow-60-down type-icon-btn",onClick:()=>J("down")},null)]),[[a.vShow,G]]),a.createVNode("div",{class:"input-btn"},[a.createVNode("button",{id:"farris-color-picker-plus-sure",class:"btn btn-secondary",onClick:b=>Ne(b)},[a.createTextVNode("确定")])])]),a.withDirectives(a.createVNode(We,{color:t.value,"onUpdate:color":b=>t.value=b,hue:y.hue,"onUpdate:hue":b=>y.hue=b,randomId:g,colorPresets:y.presets},null),[[a.vShow,x]])]),a.createVNode("div",{class:"color-picker-wrapper"},[a.createVNode("input",{title:"color-picker-input",type:"text",class:"color-picker-input form-control",value:j.value,readonly:i.value,onClick:b=>b.stopPropagation()},null),a.createVNode("div",{class:"color-picker-trigger",onClick:Me},[a.createVNode("div",{class:"color-picker-trigger-inner"},[a.createVNode("div",{style:be.value},null)])])])])}});function Mt(r,e,t){var I;const n="",i="",u=a.ref();function l(){return(e==null?void 0:e.schema.componentType)!=="frame"}function h(){return!1}function m(){return(e==null?void 0:e.schema.componentType)!=="frame"}function p(){return(e==null?void 0:e.schema.componentType)==="frame"}function d(P){if(!P||!P.value)return null;if(P.value.schema&&P.value.schema.type==="component")return P.value;const B=a.ref(P==null?void 0:P.value.parent),M=d(B);return M||null}function f(P=e){const{componentInstance:B,designerItemElementRef:M}=P;return!B||!B.value?null:B.value.canMove?M:f(P.parent)}function g(P){return!!t}function k(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function v(){}function y(P,B){}function O(P,B){const{componentType:M}=P;let j=Oe(M,P,B);const x=M.toLowerCase().replace(/-/g,"_");return j&&!j.id&&j.type===M&&(j.id=`${x}_${Math.random().toString().slice(2,6)}`),j}function V(P){}function N(...P){}function $(){e!=null&&e.schema.contents&&e.schema.contents.map(P=>{var j;let B=P.id;P.type==="component-ref"&&(B=P.component);const M=r.value.querySelector(`#${B}-design-item`);(j=M==null?void 0:M.componentInstance)!=null&&j.value.onRemoveComponent&&M.componentInstance.value.onRemoveComponent()})}return u.value={canMove:l(),canSelectParent:h(),canDelete:m(),canNested:!p(),contents:e==null?void 0:e.schema.contents,elementRef:r,parent:(I=e==null?void 0:e.parent)==null?void 0:I.componentInstance,schema:e==null?void 0:e.schema,styles:n,designerClass:i,canAccepts:g,getBelongedComponentInstance:d,getDraggableDesignItemElement:f,getDraggingDisplayText:k,getPropConfig:N,getDragScopeElement:v,onAcceptMovedChildElement:y,onChildElementMovedOut:V,addNewChildComponentSchema:O,triggerBelongedComponentToMoveWhenMoved:a.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:a.ref(!1),onRemoveComponent:$},u}const Et=a.defineComponent({name:"FColorPickerDesign",props:se,emits:["valueChanged","activeChange","update:color","update:hue"],setup(r,e){const t=a.ref(new S(r.color)),n=a.ref(r.color),i=a.ref(r.disabled),u=a.ref(r.color),l=a.ref(r.allowColorNull),h=a.ref(r.presets),m=a.ref(!1),p=a.ref(!1),d=a.ref(!1),f=a.ref("HEX"),g=Math.floor(Math.random()*1e3).toString();let k=-1,v;const y=new we("#000000"),O=a.ref(r.color);let V,N;const $=a.ref(null),I=a.ref(null),P=a.ref(),B=a.inject("design-item-context"),M=Mt(P,B);a.onMounted(()=>{P.value.componentInstance=M}),e.expose(M.value);const j=a.computed(()=>!v&&y&&y.initType?y.initType:v),x=a.computed({get(){return v&&n.value!==null?(J(v),A(new S(n.value),H[v])):n.value},set(w){w!==null&&(D(w),F(w))}}),G=a.ref(x.value),be=a.computed(()=>k>-1),re=a.computed(()=>h.value.length>0),W=a.computed(()=>({"background-color":u.value})),ke=a.computed(()=>p.value&&m.value?"display:flex":"display:none"),Y=[{text:"HEX",type:H.hex},{text:"RGBA",type:H.rgba}];function Se(){const w=document.getElementById("farris-color-picker-panel");w.id=`farris-color-picker-panel-${g}`;const E=document.getElementById("farris-color-picker-plus-sure");E.id=`farris-color-picker-plus-sure-${g}`;const U=document.getElementById("farris-color-picker-plus-input");U.id=`farris-color-picker-plus-input-${g}`,N=document.getElementById(`farris-color-picker-plus-sure-${g}`),V=document.getElementById(`farris-color-picker-panel-${g}`),V.className="color-picker-panel disabled"}function ie(){if(!l.value&&!n.value){document.getElementById(`farris-color-picker-plus-sure-${g}`).classList.toggle("disabled");const E=document.getElementById(`farris-color-picker-plus-input-${g}`);E.style.borderColor="red"}}function Pe(){n.value&&(D(n.value),!n.value&&l.value||(n.value=A(new S(n.value),H[j.value])),G.value=x.value),z(J(y.initType))}function K(){n.value&&D(n.value),y.hasPresets()||y.setColorPresets(h.value),n.value?u.value=A(new S(n.value),H[j.value]):!n.value&&l.value&&(u.value=null)}function Ve(){y.valueChanges.subscribe(w=>{const E=A(w,H[v||y.initType]);n.value=E})}function z(w){f.value=Y[w].text}function Ne(){var w;p.value=!!(v!=null&&v.includes("a")||(w=y.initType)!=null&&w.includes("a"))}a.onBeforeMount(()=>{y.setColorPresets(h.value||["#eaecf3"])}),a.onMounted(()=>{Se(),ie(),Pe(),K()}),a.watch(f,()=>{Ve(),x.value=A(new S(n.value),H[v||y.initType]),t.value=new S(x.value),Ne()}),a.watch(n,w=>{A(y.value,y.initType)!==w&&w!==null&&D(w),z(J(y.initType))}),a.watch(t,w=>{n.value=A(w,H[v||y.initType]),D(n.value),x.value=n.value});function F(w){const E=document.getElementById(`farris-color-picker-plus-input-${g}`);(w===""||w===void 0||w==null)&&!l.value?(n.value=null,E.style.borderColor="red",N.className="btn btn-secondary disabled"):(E.style.borderColor="#dcdfe6",N.className="btn btn-secondary")}function Me(){var w,E;if(l.value){u.value=(n==null?void 0:n.value)??null;const U={elementValue:u};e.emit("valueChanged",U),V.classList.toggle("disabled")}if(!l.value&&!(x.value===void 0||x.value==null||x.value==="")){(E=(w=$.value)==null?void 0:w.style)==null||E.setProperty("background",n.value),d.value=!0,u.value=n.value;const U={elementValue:u};e.emit("valueChanged",U),V.classList.toggle("disabled")}!O.value&&!n.value&&!d.value&&l&&V.classList.toggle("disabled"),F(n.value),x.value=n.value,N.classList.contains("disabled")||(G.value=n.value,m.value=!1)}function D(w){y==null||y.setValueFrom(w,g,l.value)}function T(w){i.value||(m.value=!0,V.classList.toggle("disabled"),ie(),D(n.value))}function J(w){const E=Y.findIndex(U=>U.type===w);return k=E,E}function b(w){if(!N.classList.contains("disabled")){const E=Y.length;k=(E+k+(w==="up"?1:-1))%E,v=Y[k].type,z(k),D(n.value)}}return()=>a.createVNode("div",{class:"f-color-picker-component",ref:P},[a.createVNode("div",{class:["color-picker-panel",{disabled:i.value}],id:"farris-color-picker-panel",ref:I,onClick:w=>w.stopPropagation,style:"top:30px"},[a.createVNode("div",{class:"color-picker-main"},[a.createVNode(Xe,{hue:y.hue,"onUpdate:hue":w=>y.hue=w,allowColorNull:l.value,color:t.value,"onUpdate:color":w=>t.value=w},null),a.createVNode(Ye,{randomId:g,hue:y.hue,"onUpdate:hue":w=>y.hue=w,allowColorNull:l.value,color:t.value,"onUpdate:color":w=>t.value=w},null)]),a.createVNode(Ge,{style:ke.value,randomId:g,allowColorNull:l.value,color:t.value,"onUpdate:color":w=>t.value=w},null),a.createVNode("div",{class:"input-btn",style:"display:flex;align-items: center;"},[a.withDirectives(a.createVNode("span",{style:"width:40px;margin-right:10px;"},[f.value]),[[a.vShow,re]]),a.withDirectives(a.createVNode("input",{title:"color-picker-plus-input",type:"text",id:"farris-color-picker-plus-input","onUpdate:modelValue":w=>x.value=w,style:"float:none"},null),[[a.vModelText,x.value]]),a.withDirectives(a.createVNode("div",{class:"type-icon-btn-wrapper",style:"cursor:pointer"},[a.createVNode("span",{class:"f-icon f-icon-arrow-60-up type-icon-btn",onClick:()=>b("up")},null),a.createVNode("span",{class:"f-icon f-icon-arrow-60-down type-icon-btn",onClick:()=>b("down")},null)]),[[a.vShow,re]]),a.createVNode("div",{class:"input-btn"},[a.createVNode("button",{id:"farris-color-picker-plus-sure",class:"btn btn-secondary",onClick:Me},[a.createTextVNode("确定")])])]),a.withDirectives(a.createVNode(We,{color:t.value,"onUpdate:color":w=>t.value=w,colorPresets:y.presets,hue:y.hue,"onUpdate:hue":w=>y.hue=w,randomId:g},null),[[a.vShow,be]])]),a.createVNode("div",{class:"color-picker-wrapper"},[a.createVNode("input",{type:"text",class:"color-picker-input form-control",value:G.value,readonly:i.value,onClick:w=>w.stopPropagation()},null),a.createVNode("div",{class:"color-picker-trigger",onClick:T},[a.createVNode("div",{class:"color-picker-trigger-inner"},[a.createVNode("div",{style:W.value},null)])])])])}});C.register=(r,e,t)=>{r["color-picker"]=C,e["color-picker"]=Be},C.registerDesigner=(r,e,t)=>{r["color-picker"]=Et,e["color-picker"]=Be};const Ht=ze.withInstall(C);R.FColorPicker=C,R.default=Ht,Object.defineProperties(R,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|