← All changes
|
assets/js/packages/editor-props/editor-props.js
+2647
-2
4.1.0-dev3
→
4.3.2
View file →
| @@ -1,3 +1,2648 @@ | ||
| 1 | -/*! For license information please see editor-props.js.LICENSE.txt */ | |
| 2 | -!function(){"use strict";var e={"./node_modules/jsonschema/lib/attribute.js":function(e,r,t){var s=t("./node_modules/jsonschema/lib/helpers.js"),o=s.ValidatorResult,a=s.SchemaError,i={ignoreProperties:{id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0}},n=i.validators={};function testSchemaNoThrow(e,r,t,s,o){var a=r.throwError,i=r.throwAll;r.throwError=!1,r.throwAll=!1;var n=this.validateSchema(e,o,r,t);return r.throwError=a,r.throwAll=i,!n.valid&&s instanceof Function&&s(n),n.valid}function getEnumerableProperty(e,r){if(Object.hasOwnProperty.call(e,r))return e[r];if(r in e)for(;e=Object.getPrototypeOf(e);)if(Object.propertyIsEnumerable.call(e,r))return e[r]}function testAdditionalProperty(e,r,t,s,o,a){if(this.types.object(e)&&(!r.properties||void 0===r.properties[o]))if(!1===r.additionalProperties)a.addError({name:"additionalProperties",argument:o,message:"is not allowed to have the additional property "+JSON.stringify(o)});else{var i=r.additionalProperties||{};"function"==typeof t.preValidateProperty&&t.preValidateProperty(e,o,i,t,s);var n=this.validateSchema(e[o],i,t,s.makeChild(i,o));n.instance!==a.instance[o]&&(a.instance[o]=n.instance),a.importErrors(n)}}n.type=function validateType(e,r,t,s){if(void 0===e)return null;var a=new o(e,r,t,s),i=Array.isArray(r.type)?r.type:[r.type];if(!i.some(this.testType.bind(this,e,r,t,s))){var n=i.map(function(e){if(e){var r=e.$id||e.id;return r?"<"+r+">":e+""}});a.addError({name:"type",argument:n,message:"is not of a type(s) "+n})}return a},n.anyOf=function validateAnyOf(e,r,t,s){if(void 0===e)return null;var i=new o(e,r,t,s),n=new o(e,r,t,s);if(!Array.isArray(r.anyOf))throw new a("anyOf must be an array");if(!r.anyOf.some(testSchemaNoThrow.bind(this,e,t,s,function(e){n.importErrors(e)}))){var p=r.anyOf.map(function(e,r){var t=e.$id||e.id;return t?"<"+t+">":e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+r+"]"});t.nestedErrors&&i.importErrors(n),i.addError({name:"anyOf",argument:p,message:"is not any of "+p.join(",")})}return i},n.allOf=function validateAllOf(e,r,t,s){if(void 0===e)return null;if(!Array.isArray(r.allOf))throw new a("allOf must be an array");var i=new o(e,r,t,s),n=this;return r.allOf.forEach(function(r,o){var a=n.validateSchema(e,r,t,s);if(!a.valid){var p=r.$id||r.id||r.title&&JSON.stringify(r.title)||r.$ref&&"<"+r.$ref+">"||"[subschema "+o+"]";i.addError({name:"allOf",argument:{id:p,length:a.errors.length,valid:a},message:"does not match allOf schema "+p+" with "+a.errors.length+" error[s]:"}),i.importErrors(a)}}),i},n.oneOf=function validateOneOf(e,r,t,s){if(void 0===e)return null;if(!Array.isArray(r.oneOf))throw new a("oneOf must be an array");var i=new o(e,r,t,s),n=new o(e,r,t,s),p=r.oneOf.filter(testSchemaNoThrow.bind(this,e,t,s,function(e){n.importErrors(e)})).length,c=r.oneOf.map(function(e,r){return e.$id||e.id||e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+r+"]"});return 1!==p&&(t.nestedErrors&&i.importErrors(n),i.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),i},n.if=function validateIf(e,r,t,a){if(void 0===e)return null;if(!s.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var i,n=testSchemaNoThrow.call(this,e,t,a,null,r.if),p=new o(e,r,t,a);if(n){if(void 0===r.then)return;if(!s.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');i=this.validateSchema(e,r.then,t,a.makeChild(r.then)),p.importErrors(i)}else{if(void 0===r.else)return;if(!s.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');i=this.validateSchema(e,r.else,t,a.makeChild(r.else)),p.importErrors(i)}return p},n.propertyNames=function validatePropertyNames(e,r,t,i){if(this.types.object(e)){var n=new o(e,r,t,i),p=void 0!==r.propertyNames?r.propertyNames:{};if(!s.isSchema(p))throw new a('Expected "propertyNames" to be a schema (object or boolean)');for(var c in e)if(void 0!==getEnumerableProperty(e,c)){var l=this.validateSchema(c,p,t,i.makeChild(p));n.importErrors(l)}return n}},n.properties=function validateProperties(e,r,t,s){if(this.types.object(e)){var i=new o(e,r,t,s),n=r.properties||{};for(var p in n){var c=n[p];if(void 0!==c){if(null===c)throw new a('Unexpected null, expected schema in "properties"');"function"==typeof t.preValidateProperty&&t.preValidateProperty(e,p,c,t,s);var l=getEnumerableProperty(e,p),u=this.validateSchema(l,c,t,s.makeChild(c,p));u.instance!==i.instance[p]&&(i.instance[p]=u.instance),i.importErrors(u)}}return i}},n.patternProperties=function validatePatternProperties(e,r,t,s){if(this.types.object(e)){var i=new o(e,r,t,s),n=r.patternProperties||{};for(var p in e){var c=!0;for(var l in n){var u=n[l];if(void 0!==u){if(null===u)throw new a('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(l,"u")}catch(e){d=new RegExp(l)}if(d.test(p)){c=!1,"function"==typeof t.preValidateProperty&&t.preValidateProperty(e,p,u,t,s);var m=this.validateSchema(e[p],u,t,s.makeChild(u,p));m.instance!==i.instance[p]&&(i.instance[p]=m.instance),i.importErrors(m)}}}c&&testAdditionalProperty.call(this,e,r,t,s,p,i)}return i}},n.additionalProperties=function validateAdditionalProperties(e,r,t,s){if(this.types.object(e)){if(r.patternProperties)return null;var a=new o(e,r,t,s);for(var i in e)testAdditionalProperty.call(this,e,r,t,s,i,a);return a}},n.minProperties=function validateMinProperties(e,r,t,s){if(this.types.object(e)){var a=new o(e,r,t,s);return Object.keys(e).length>=r.minProperties||a.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),a}},n.maxProperties=function validateMaxProperties(e,r,t,s){if(this.types.object(e)){var a=new o(e,r,t,s);return Object.keys(e).length<=r.maxProperties||a.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),a}},n.items=function validateItems(e,r,t,s){var a=this;if(this.types.array(e)&&void 0!==r.items){var i=new o(e,r,t,s);return e.every(function(e,o){if(Array.isArray(r.items))var n=void 0===r.items[o]?r.additionalItems:r.items[o];else n=r.items;if(void 0===n)return!0;if(!1===n)return i.addError({name:"items",message:"additionalItems not permitted"}),!1;var p=a.validateSchema(e,n,t,s.makeChild(n,o));return p.instance!==i.instance[o]&&(i.instance[o]=p.instance),i.importErrors(p),!0}),i}},n.contains=function validateContains(e,r,t,a){var i=this;if(this.types.array(e)&&void 0!==r.contains){if(!s.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var n=new o(e,r,t,a);return!1===e.some(function(e,s){return 0===i.validateSchema(e,r.contains,t,a.makeChild(r.contains,s)).errors.length})&&n.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),n}},n.minimum=function validateMinimum(e,r,t,s){if(this.types.number(e)){var a=new o(e,r,t,s);return r.exclusiveMinimum&&!0===r.exclusiveMinimum?e>r.minimum||a.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):e>=r.minimum||a.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),a}},n.maximum=function validateMaximum(e,r,t,s){if(this.types.number(e)){var a=new o(e,r,t,s);return r.exclusiveMaximum&&!0===r.exclusiveMaximum?e<r.maximum||a.addError({name:"maximum",argument:r.maximum,message:"must be less than "+r.maximum}):e<=r.maximum||a.addError({name:"maximum",argument:r.maximum,message:"must be less than or equal to "+r.maximum}),a}},n.exclusiveMinimum=function validateExclusiveMinimum(e,r,t,s){if("boolean"!=typeof r.exclusiveMinimum&&this.types.number(e)){var a=new o(e,r,t,s);return e>r.exclusiveMinimum||a.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),a}},n.exclusiveMaximum=function validateExclusiveMaximum(e,r,t,s){if("boolean"!=typeof r.exclusiveMaximum&&this.types.number(e)){var a=new o(e,r,t,s);return e<r.exclusiveMaximum||a.addError({name:"exclusiveMaximum",argument:r.exclusiveMaximum,message:"must be strictly less than "+r.exclusiveMaximum}),a}};var p=function validateMultipleOfOrDivisbleBy(e,r,t,i,n,p){if(this.types.number(e)){var c=r[n];if(0==c)throw new a(n+" cannot be zero");var l=new o(e,r,t,i),u=s.getDecimalPlaces(e),d=s.getDecimalPlaces(c),m=Math.max(u,d),f=Math.pow(10,m);return Math.round(e*f)%Math.round(c*f)!==0&&l.addError({name:n,argument:c,message:p+JSON.stringify(c)}),l}};function testArrays(e,r,t){var o,a=t.length;for(o=r+1;o<a;o++)if(s.deepCompareStrict(e,t[o]))return!1;return!0}n.multipleOf=function validateMultipleOf(e,r,t,s){return p.call(this,e,r,t,s,"multipleOf","is not a multiple of (divisible by) ")},n.divisibleBy=function validateDivisibleBy(e,r,t,s){return p.call(this,e,r,t,s,"divisibleBy","is not divisible by (multiple of) ")},n.required=function validateRequired(e,r,t,s){var a=new o(e,r,t,s);return void 0===e&&!0===r.required?a.addError({name:"required",message:"is required"}):this.types.object(e)&&Array.isArray(r.required)&&r.required.forEach(function(r){void 0===getEnumerableProperty(e,r)&&a.addError({name:"required",argument:r,message:"requires property "+JSON.stringify(r)})}),a},n.pattern=function validatePattern(e,r,t,s){if(this.types.string(e)){var a=new o(e,r,t,s),i=r.pattern;try{var n=new RegExp(i,"u")}catch(e){n=new RegExp(i)}return e.match(n)||a.addError({name:"pattern",argument:r.pattern,message:"does not match pattern "+JSON.stringify(r.pattern.toString())}),a}},n.format=function validateFormat(e,r,t,a){if(void 0!==e){var i=new o(e,r,t,a);return i.disableFormat||s.isFormat(e,r.format,this)||i.addError({name:"format",argument:r.format,message:"does not conform to the "+JSON.stringify(r.format)+" format"}),i}},n.minLength=function validateMinLength(e,r,t,s){if(this.types.string(e)){var a=new o(e,r,t,s),i=e.match(/[\uDC00-\uDFFF]/g);return e.length-(i?i.length:0)>=r.minLength||a.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),a}},n.maxLength=function validateMaxLength(e,r,t,s){if(this.types.string(e)){var a=new o(e,r,t,s),i=e.match(/[\uDC00-\uDFFF]/g);return e.length-(i?i.length:0)<=r.maxLength||a.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),a}},n.minItems=function validateMinItems(e,r,t,s){if(this.types.array(e)){var a=new o(e,r,t,s);return e.length>=r.minItems||a.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),a}},n.maxItems=function validateMaxItems(e,r,t,s){if(this.types.array(e)){var a=new o(e,r,t,s);return e.length<=r.maxItems||a.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),a}},n.uniqueItems=function validateUniqueItems(e,r,t,s){if(!0===r.uniqueItems&&this.types.array(e)){var a=new o(e,r,t,s);return e.every(testArrays)||a.addError({name:"uniqueItems",message:"contains duplicate item"}),a}},n.dependencies=function validateDependencies(e,r,t,s){if(this.types.object(e)){var a=new o(e,r,t,s);for(var i in r.dependencies)if(void 0!==e[i]){var n=r.dependencies[i],p=s.makeChild(n,i);if("string"==typeof n&&(n=[n]),Array.isArray(n))n.forEach(function(r){void 0===e[r]&&a.addError({name:"dependencies",argument:p.propertyPath,message:"property "+r+" not found, required by "+p.propertyPath})});else{var c=this.validateSchema(e,n,t,p);a.instance!==c.instance&&(a.instance=c.instance),c&&c.errors.length&&(a.addError({name:"dependencies",argument:p.propertyPath,message:"does not meet dependency required by "+p.propertyPath}),a.importErrors(c))}}return a}},n.enum=function validateEnum(e,r,t,i){if(void 0===e)return null;if(!Array.isArray(r.enum))throw new a("enum expects an array",r);var n=new o(e,r,t,i);return r.enum.some(s.deepCompareStrict.bind(null,e))||n.addError({name:"enum",argument:r.enum,message:"is not one of enum values: "+r.enum.map(String).join(",")}),n},n.const=function validateEnum(e,r,t,a){if(void 0===e)return null;var i=new o(e,r,t,a);return s.deepCompareStrict(r.const,e)||i.addError({name:"const",argument:r.const,message:"does not exactly match expected constant: "+r.const}),i},n.not=n.disallow=function validateNot(e,r,t,s){var a=this;if(void 0===e)return null;var i=new o(e,r,t,s),n=r.not||r.disallow;return n?(Array.isArray(n)||(n=[n]),n.forEach(function(o){if(a.testType(e,r,t,s,o)){var n=o&&(o.$id||o.id)||o;i.addError({name:"not",argument:n,message:"is of prohibited type "+n})}}),i):null},e.exports=i},"./node_modules/jsonschema/lib/helpers.js":function(e,r){var t=r.ValidationError=function ValidationError(e,r,t,s,o,a){if(Array.isArray(s)?(this.path=s,this.property=s.reduce(function(e,r){return e+n(r)},"instance")):void 0!==s&&(this.property=s),e&&(this.message=e),t){var i=t.$id||t.id;this.schema=i||t}void 0!==r&&(this.instance=r),this.name=o,this.argument=a,this.stack=this.toString()};t.prototype.toString=function toString(){return this.property+" "+this.message};var s=r.ValidatorResult=function ValidatorResult(e,r,t,s){this.instance=e,this.schema=r,this.options=t,this.path=s.path,this.propertyPath=s.propertyPath,this.errors=[],this.throwError=t&&t.throwError,this.throwFirst=t&&t.throwFirst,this.throwAll=t&&t.throwAll,this.disableFormat=t&&!0===t.disableFormat};function stringizer(e,r){return r+": "+e.toString()+"\n"}function ValidatorResultError(e){"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,ValidatorResultError),this.instance=e.instance,this.schema=e.schema,this.options=e.options,this.errors=e.errors}s.prototype.addError=function addError(e){var r;if("string"==typeof e)r=new t(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");r=new t(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new ValidatorResultError(this);if(this.throwError)throw r;return r},s.prototype.importErrors=function importErrors(e){"string"==typeof e||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))},s.prototype.toString=function toString(e){return this.errors.map(stringizer).join("")},Object.defineProperty(s.prototype,"valid",{get:function(){return!this.errors.length}}),e.exports.ValidatorResultError=ValidatorResultError,ValidatorResultError.prototype=new Error,ValidatorResultError.prototype.constructor=ValidatorResultError,ValidatorResultError.prototype.name="Validation Error";var o=r.SchemaError=function SchemaError(e,r){this.message=e,this.schema=r,Error.call(this,e),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,SchemaError)};o.prototype=Object.create(Error.prototype,{constructor:{value:o,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var a=r.SchemaContext=function SchemaContext(e,r,t,s,o){this.schema=e,this.options=r,Array.isArray(t)?(this.path=t,this.propertyPath=t.reduce(function(e,r){return e+n(r)},"instance")):this.propertyPath=t,this.base=s,this.schemas=o};a.prototype.resolve=function resolve(e){return(()=>p(this.base,e))()},a.prototype.makeChild=function makeChild(e,r){var t=void 0===r?this.path:this.path.concat([r]),s=e.$id||e.id;let o=(()=>p(this.base,s||""))();var i=new a(e,this.options,t,o,Object.create(this.schemas));return s&&!i.schemas[o]&&(i.schemas[o]=e),i};var i=r.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(e){return"string"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)},regex:function(e){var r=!0;try{new RegExp(e)}catch(e){r=!1}return r},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};i.regexp=i.regex,i.pattern=i.regex,i.ipv4=i["ip-address"],r.isFormat=function isFormat(e,r,t){if("string"==typeof e&&void 0!==i[r]){if(i[r]instanceof RegExp)return i[r].test(e);if("function"==typeof i[r])return i[r](e)}else if(t&&t.customFormats&&"function"==typeof t.customFormats[r])return t.customFormats[r](e);return!0};var n=r.makeSuffix=function makeSuffix(e){return(e=e.toString()).match(/[.\s\[\]]/)||e.match(/^[\d]/)?e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]":"."+e};function deepMerger(e,r,t,s){"object"==typeof t?r[s]=deepMerge(e[s],t):-1===e.indexOf(t)&&r.push(t)}function copyist(e,r,t){r[t]=e[t]}function copyistWithDeepMerge(e,r,t,s){"object"==typeof r[s]&&r[s]&&e[s]?t[s]=deepMerge(e[s],r[s]):t[s]=r[s]}function deepMerge(e,r){var t=Array.isArray(r),s=t&&[]||{};return t?(e=e||[],s=s.concat(e),r.forEach(deepMerger.bind(null,e,s))):(e&&"object"==typeof e&&Object.keys(e).forEach(copyist.bind(null,e,s)),Object.keys(r).forEach(copyistWithDeepMerge.bind(null,e,r,s))),s}function pathEncoder(e){return"/"+encodeURIComponent(e).replace(/~/g,"%7E")}r.deepCompareStrict=function deepCompareStrict(e,r){if(typeof e!=typeof r)return!1;if(Array.isArray(e))return!!Array.isArray(r)&&(e.length===r.length&&e.every(function(t,s){return deepCompareStrict(e[s],r[s])}));if("object"==typeof e){if(!e||!r)return e===r;var t=Object.keys(e),s=Object.keys(r);return t.length===s.length&&t.every(function(t){return deepCompareStrict(e[t],r[t])})}return e===r},e.exports.deepMerge=deepMerge,r.objectGetPath=function objectGetPath(e,r){for(var t,s=r.split("/").slice(1);"string"==typeof(t=s.shift());){var o=decodeURIComponent(t.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e},r.encodePath=function encodePointer(e){return e.map(pathEncoder).join("")},r.getDecimalPlaces=function getDecimalPlaces(e){var r=0;if(isNaN(e))return r;"number"!=typeof e&&(e=Number(e));var t=e.toString().split("e");if(2===t.length){if("-"!==t[1][0])return r;r=Number(t[1].slice(1))}var s=t[0].split(".");return 2===s.length&&(r+=s[1].length),r},r.isSchema=function isSchema(e){return"object"==typeof e&&e||"boolean"==typeof e};var p=r.resolveUrl=function resolveUrl(e,r){const t=new URL(r,new URL(e,"resolve://"));if("resolve:"===t.protocol){const{pathname:e,search:r,hash:s}=t;return e+r+s}return t.toString()}},"./node_modules/jsonschema/lib/index.js":function(e,r,t){var s=e.exports.Validator=t("./node_modules/jsonschema/lib/validator.js");e.exports.ValidatorResult=t("./node_modules/jsonschema/lib/helpers.js").ValidatorResult,e.exports.ValidatorResultError=t("./node_modules/jsonschema/lib/helpers.js").ValidatorResultError,e.exports.ValidationError=t("./node_modules/jsonschema/lib/helpers.js").ValidationError,e.exports.SchemaError=t("./node_modules/jsonschema/lib/helpers.js").SchemaError,e.exports.SchemaScanResult=t("./node_modules/jsonschema/lib/scan.js").SchemaScanResult,e.exports.scan=t("./node_modules/jsonschema/lib/scan.js").scan,e.exports.validate=function(e,r,t){return(new s).validate(e,r,t)}},"./node_modules/jsonschema/lib/scan.js":function(e,r,t){var s=t("./node_modules/jsonschema/lib/helpers.js");function SchemaScanResult(e,r){this.id=e,this.ref=r}e.exports.SchemaScanResult=SchemaScanResult,e.exports.scan=function scan(e,r){function scanSchema(e,r){if(!r||"object"!=typeof r)return;if(r.$ref){let t=s.resolveUrl(e,r.$ref);return void(o[t]=o[t]?o[t]+1:0)}var a=r.$id||r.id;let i=s.resolveUrl(e,a);var n=a?i:e;if(n){if(n.indexOf("#")<0&&(n+="#"),t[n]){if(!s.deepCompareStrict(t[n],r))throw new Error("Schema <"+n+"> already exists with different definition");return t[n]}t[n]=r,"#"==n[n.length-1]&&(t[n.substring(0,n.length-1)]=r)}scanArray(n+"/items",Array.isArray(r.items)?r.items:[r.items]),scanArray(n+"/extends",Array.isArray(r.extends)?r.extends:[r.extends]),scanSchema(n+"/additionalItems",r.additionalItems),scanObject(n+"/properties",r.properties),scanSchema(n+"/additionalProperties",r.additionalProperties),scanObject(n+"/definitions",r.definitions),scanObject(n+"/patternProperties",r.patternProperties),scanObject(n+"/dependencies",r.dependencies),scanArray(n+"/disallow",r.disallow),scanArray(n+"/allOf",r.allOf),scanArray(n+"/anyOf",r.anyOf),scanArray(n+"/oneOf",r.oneOf),scanSchema(n+"/not",r.not)}function scanArray(e,r){if(Array.isArray(r))for(var t=0;t<r.length;t++)scanSchema(e+"/"+t,r[t])}function scanObject(e,r){if(r&&"object"==typeof r)for(var t in r)scanSchema(e+"/"+t,r[t])}var t={},o={};return scanSchema(e,r),new SchemaScanResult(t,o)}},"./node_modules/jsonschema/lib/validator.js":function(e,r,t){var s=t("./node_modules/jsonschema/lib/attribute.js"),o=t("./node_modules/jsonschema/lib/helpers.js"),a=t("./node_modules/jsonschema/lib/scan.js").scan,i=o.ValidatorResult,n=o.ValidatorResultError,p=o.SchemaError,c=o.SchemaContext,l=function Validator(){this.customFormats=Object.create(Validator.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(u),this.attributes=Object.create(s.validators)};function shouldResolve(e){var r="string"==typeof e?e:e.$ref;return"string"==typeof r&&r}l.prototype.customFormats={},l.prototype.schemas=null,l.prototype.types=null,l.prototype.attributes=null,l.prototype.unresolvedRefs=null,l.prototype.addSchema=function addSchema(e,r){var t=this;if(!e)return null;var s=a(r||"/",e),o=r||e.$id||e.id;for(var i in s.id)this.schemas[i]=s.id[i];for(var i in s.ref)this.unresolvedRefs.push(i);return this.unresolvedRefs=this.unresolvedRefs.filter(function(e){return void 0===t.schemas[e]}),this.schemas[o]},l.prototype.addSubSchemaArray=function addSubSchemaArray(e,r){if(Array.isArray(r))for(var t=0;t<r.length;t++)this.addSubSchema(e,r[t])},l.prototype.addSubSchemaObject=function addSubSchemaArray(e,r){if(r&&"object"==typeof r)for(var t in r)this.addSubSchema(e,r[t])},l.prototype.setSchemas=function setSchemas(e){this.schemas=e},l.prototype.getSchema=function getSchema(e){return this.schemas[e]},l.prototype.validate=function validate(e,r,t,s){if("boolean"!=typeof r&&"object"!=typeof r||null===r)throw new p("Expected `schema` to be an object or boolean");t||(t={});var l=r.$id||r.id;let u=o.resolveUrl(t.base,l||"");if(!s){(s=new c(r,t,[],u,Object.create(this.schemas))).schemas[u]||(s.schemas[u]=r);var d=a(u,r);for(var m in d.id){var f=d.id[m];s.schemas[m]=f}}var y;if(t.required&&void 0===e)return(y=new i(e,r,t,s)).addError("is required, but is undefined"),y;if(!(y=this.validateSchema(e,r,t,s)))throw new Error("Result undefined");if(t.throwAll&&y.errors.length)throw new n(y);return y},l.prototype.validateSchema=function validateSchema(e,r,t,a){var n=new i(e,r,t,a);if("boolean"==typeof r)!0===r?r={}:!1===r&&(r={type:[]});else if(!r)throw new Error("schema is undefined");if(r.extends)if(Array.isArray(r.extends)){var l={schema:r,ctx:a};r.extends.forEach(this.schemaTraverser.bind(this,l)),r=l.schema,l.schema=null,l.ctx=null,l=null}else r=o.deepMerge(r,this.superResolve(r.extends,a));var u=shouldResolve(r);if(u){var d=this.resolve(r,u,a),m=new c(d.subschema,t,a.path,d.switchSchema,a.schemas);return this.validateSchema(e,d.subschema,t,m)}var f=t&&t.skipAttributes||[];for(var y in r)if(!s.ignoreProperties[y]&&f.indexOf(y)<0){var g=null,h=this.attributes[y];if(h)g=h.call(this,e,r,t,a);else if(!1===t.allowUnknownAttributes)throw new p("Unsupported attribute: "+y,r);g&&n.importErrors(g)}if("function"==typeof t.rewrite){var k=t.rewrite.call(this,e,r,t,a);n.instance=k}return n},l.prototype.schemaTraverser=function schemaTraverser(e,r){e.schema=o.deepMerge(e.schema,this.superResolve(r,e.ctx))},l.prototype.superResolve=function superResolve(e,r){var t=shouldResolve(e);return t?this.resolve(e,t,r).subschema:e},l.prototype.resolve=function resolve(e,r,t){if(r=t.resolve(r),t.schemas[r])return{subschema:t.schemas[r],switchSchema:r};let s=new URL(r,"thismessage::/").hash;var a=s&&s.length&&r.substr(0,r.length-s.length);if(!a||!t.schemas[a])throw new p("no such schema <"+r+">",e);var i=o.objectGetPath(t.schemas[a],s.substr(1));if(void 0===i)throw new p("no such schema "+s+" located in <"+a+">",e);return{subschema:i,switchSchema:r}},l.prototype.testType=function validateType(e,r,t,s,o){if(void 0!==o){if(null===o)throw new p('Unexpected null in "type" keyword');if("function"==typeof this.types[o])return this.types[o].call(this,e);if(o&&"object"==typeof o){var a=this.validateSchema(e,o,t,s);return void 0===a||!(a&&a.errors.length)}return!0}};var u=l.prototype.types={};u.string=function testString(e){return"string"==typeof e},u.number=function testNumber(e){return"number"==typeof e&&isFinite(e)},u.integer=function testInteger(e){return"number"==typeof e&&e%1==0},u.boolean=function testBoolean(e){return"boolean"==typeof e},u.array=function testArray(e){return Array.isArray(e)},u.null=function testNull(e){return null===e},u.date=function testDate(e){return e instanceof Date},u.any=function testAny(e){return!0},u.object=function testObject(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof Date)},e.exports=l},"./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-color-overlay.ts":function(e,r,t){t.r(r),t.d(r,{backgroundColorOverlayPropTypeUtil:function(){return a}});var s=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),o=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const a=(0,s.createPropUtils)("background-color-overlay",o.unknownChildrenSchema)},"./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-gradient-overlay.ts":function(e,r,t){t.r(r),t.d(r,{backgroundGradientOverlayPropTypeUtil:function(){return a}});var s=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),o=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const a=(0,s.createPropUtils)("background-gradient-overlay",o.unknownChildrenSchema)},"./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-image-overlay.ts":function(e,r,t){t.r(r),t.d(r,{backgroundImageOverlayPropTypeUtil:function(){return a}});var s=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),o=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const a=(0,s.createPropUtils)("background-image-overlay",o.unknownChildrenSchema)},"./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-image-position-offset.ts":function(e,r,t){t.r(r),t.d(r,{backgroundImagePositionOffsetPropTypeUtil:function(){return a}});var s=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),o=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const a=(0,s.createPropUtils)("background-image-position-offset",o.unknownChildrenSchema)},"./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-image-size-scale.ts":function(e,r,t){t.r(r),t.d(r,{backgroundImageSizeScalePropTypeUtil:function(){return a}});var s=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),o=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const a=(0,s.createPropUtils)("background-image-size-scale",o.unknownChildrenSchema)},"./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-overlay.ts":function(e,r,t){t.r(r),t.d(r,{backgroundOverlayItem:function(){return p},backgroundOverlayPropTypeUtil:function(){return c}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-color-overlay.ts"),i=t("./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-gradient-overlay.ts"),n=t("./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-image-overlay.ts");const p=a.backgroundColorOverlayPropTypeUtil.schema.or(i.backgroundGradientOverlayPropTypeUtil.schema).or(n.backgroundImageOverlayPropTypeUtil.schema),c=(0,o.createPropUtils)("background-overlay",s.z.array(p))},"./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background.ts":function(e,r,t){t.r(r),t.d(r,{backgroundPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("background",s.z.strictObject({color:a.unknownChildrenSchema,clip:a.unknownChildrenSchema,"background-overlay":a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/boolean.ts":function(e,r,t){t.r(r),t.d(r,{booleanPropTypeUtil:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("boolean",s.z.boolean().nullable())},"./packages/packages/libs/editor-props/src/prop-types/border-radius.ts":function(e,r,t){t.r(r),t.d(r,{borderRadiusPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("border-radius",s.z.strictObject({"start-start":a.unknownChildrenSchema,"start-end":a.unknownChildrenSchema,"end-start":a.unknownChildrenSchema,"end-end":a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/border-width.ts":function(e,r,t){t.r(r),t.d(r,{borderWidthPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("border-width",s.z.strictObject({"block-start":a.unknownChildrenSchema,"block-end":a.unknownChildrenSchema,"inline-start":a.unknownChildrenSchema,"inline-end":a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/box-shadow.ts":function(e,r,t){t.r(r),t.d(r,{boxShadowPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/shadow.ts");const i=(0,o.createPropUtils)("box-shadow",s.z.array(a.shadowPropTypeUtil.schema))},"./packages/packages/libs/editor-props/src/prop-types/classes.ts":function(e,r,t){t.r(r),t.d(r,{CLASSES_PROP_KEY:function(){return a},classesPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts");const a="classes",i=(0,o.createPropUtils)(a,s.z.array(s.z.string().regex(/^[a-z][a-z-_0-9]*$/i)))},"./packages/packages/libs/editor-props/src/prop-types/color-stop.ts":function(e,r,t){t.r(r),t.d(r,{colorStopPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("color-stop",s.z.strictObject({color:a.unknownChildrenSchema,offset:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/color.ts":function(e,r,t){t.r(r),t.d(r,{colorPropTypeUtil:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("color",s.z.string())},"./packages/packages/libs/editor-props/src/prop-types/date-range.ts":function(e,r,t){t.r(r),t.d(r,{dateRangePropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("date-range",s.z.strictObject({min:a.unknownChildrenSchema,max:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/date-string.ts":function(e,r,t){t.r(r),t.d(r,{dateStringPropTypeUtil:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("date-string",s.z.string())},"./packages/packages/libs/editor-props/src/prop-types/date-time.ts":function(e,r,t){t.r(r),t.d(r,{DateTimePropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("date-time",s.z.strictObject({date:a.unknownChildrenSchema,time:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/dimensions.ts":function(e,r,t){t.r(r),t.d(r,{dimensionsPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("dimensions",s.z.strictObject({"block-start":a.unknownChildrenSchema,"block-end":a.unknownChildrenSchema,"inline-start":a.unknownChildrenSchema,"inline-end":a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/email.ts":function(e,r,t){t.r(r),t.d(r,{emailPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("email",s.z.strictObject({to:a.unknownChildrenSchema,subject:a.unknownChildrenSchema,message:a.unknownChildrenSchema,from:a.unknownChildrenSchema,"meta-data":a.unknownChildrenSchema,"send-as":a.unknownChildrenSchema,"from-name":a.unknownChildrenSchema,"reply-to":a.unknownChildrenSchema,cc:a.unknownChildrenSchema,bcc:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/backdrop-filter.ts":function(e,r,t){t.r(r),t.d(r,{backdropFilterPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter.ts");const i=(0,o.createPropUtils)("backdrop-filter",s.z.array(a.cssFilterFunctionPropUtil.schema))},"./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/drop-shadow-filter.ts":function(e,r,t){t.r(r),t.d(r,{dropShadowFilterPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("drop-shadow",s.z.object({xAxis:a.unknownChildrenSchema,yAxis:a.unknownChildrenSchema,blur:a.unknownChildrenSchema,color:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/blur-filter.ts":function(e,r,t){t.r(r),t.d(r,{blurFilterPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("blur",s.z.strictObject({size:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/color-tone-filter.ts":function(e,r,t){t.r(r),t.d(r,{colorToneFilterPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("color-tone",s.z.strictObject({size:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/hue-rotate-filter.ts":function(e,r,t){t.r(r),t.d(r,{hueRotateFilterPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("hue-rotate",s.z.strictObject({size:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/intensity-filter.ts":function(e,r,t){t.r(r),t.d(r,{intensityFilterPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("intensity",s.z.strictObject({size:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter.ts":function(e,r,t){t.r(r),t.d(r,{cssFilterFunctionPropUtil:function(){return u},filterPropTypeUtil:function(){return d}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/string.ts"),i=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/drop-shadow-filter.ts"),n=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/blur-filter.ts"),p=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/color-tone-filter.ts"),c=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/hue-rotate-filter.ts"),l=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/intensity-filter.ts");const u=(0,o.createPropUtils)("css-filter-func",s.z.object({func:a.stringPropTypeUtil.schema,args:s.z.union([n.blurFilterPropTypeUtil.schema,l.intensityFilterPropTypeUtil.schema,p.colorToneFilterPropTypeUtil.schema,c.hueRotateFilterPropTypeUtil.schema,i.dropShadowFilterPropTypeUtil.schema])})),d=(0,o.createPropUtils)("filter",s.z.array(u.schema))},"./packages/packages/libs/editor-props/src/prop-types/flex.ts":function(e,r,t){t.r(r),t.d(r,{flexPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("flex",s.z.strictObject({flexGrow:a.unknownChildrenSchema,flexShrink:a.unknownChildrenSchema,flexBasis:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/gradient-color-stop.ts":function(e,r,t){t.r(r),t.d(r,{gradientColorStopPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/color-stop.ts");const i=(0,o.createPropUtils)("gradient-color-stop",s.z.array(a.colorStopPropTypeUtil.schema))},"./packages/packages/libs/editor-props/src/prop-types/html-v2.ts":function(e,r,t){t.r(r),t.d(r,{htmlV2PropTypeUtil:function(){return n}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts");const a=s.z.lazy(()=>s.z.object({id:s.z.string(),type:s.z.string(),content:s.z.string().optional(),children:s.z.array(a).optional()})),i=s.z.object({content:s.z.string().nullable(),children:s.z.array(a)}),n=(0,o.createPropUtils)("html-v2",i)},"./packages/packages/libs/editor-props/src/prop-types/html-v3.ts":function(e,r,t){t.r(r),t.d(r,{htmlV3PropTypeUtil:function(){return n}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/string.ts");const i=s.z.object({content:a.stringPropTypeUtil.schema.nullable(),children:s.z.array(s.z.unknown())}),n=(0,o.createPropUtils)("html-v3",i)},"./packages/packages/libs/editor-props/src/prop-types/html.ts":function(e,r,t){t.r(r),t.d(r,{htmlPropTypeUtil:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("html",s.z.string().nullable())},"./packages/packages/libs/editor-props/src/prop-types/image-attachment-id.ts":function(e,r,t){t.r(r),t.d(r,{imageAttachmentIdPropType:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("image-attachment-id",s.z.number())},"./packages/packages/libs/editor-props/src/prop-types/image-src.ts":function(e,r,t){t.r(r),t.d(r,{imageSrcPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("image-src",s.z.strictObject({id:a.unknownChildrenSchema,url:s.z.null()}).or(s.z.strictObject({id:s.z.null(),url:a.unknownChildrenSchema,alt:a.unknownChildrenSchema})))},"./packages/packages/libs/editor-props/src/prop-types/image.ts":function(e,r,t){t.r(r),t.d(r,{imagePropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("image",s.z.strictObject({src:a.unknownChildrenSchema,size:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/index.ts":function(e,r,t){t.r(r),t.d(r,{CLASSES_PROP_KEY:function(){return i.CLASSES_PROP_KEY},DateTimePropTypeUtil:function(){return I.DateTimePropTypeUtil},backdropFilterPropTypeUtil:function(){return re.backdropFilterPropTypeUtil},backgroundColorOverlayPropTypeUtil:function(){return O.backgroundColorOverlayPropTypeUtil},backgroundGradientOverlayPropTypeUtil:function(){return x.backgroundGradientOverlayPropTypeUtil},backgroundImageOverlayPropTypeUtil:function(){return j.backgroundImageOverlayPropTypeUtil},backgroundImagePositionOffsetPropTypeUtil:function(){return C.backgroundImagePositionOffsetPropTypeUtil},backgroundImageSizeScalePropTypeUtil:function(){return E.backgroundImageSizeScalePropTypeUtil},backgroundOverlayItem:function(){return _.backgroundOverlayItem},backgroundOverlayPropTypeUtil:function(){return _.backgroundOverlayPropTypeUtil},backgroundPropTypeUtil:function(){return z.backgroundPropTypeUtil},blurFilterPropTypeUtil:function(){return se.blurFilterPropTypeUtil},booleanPropTypeUtil:function(){return $.booleanPropTypeUtil},borderRadiusPropTypeUtil:function(){return o.borderRadiusPropTypeUtil},borderWidthPropTypeUtil:function(){return a.borderWidthPropTypeUtil},boxShadowPropTypeUtil:function(){return s.boxShadowPropTypeUtil},classesPropTypeUtil:function(){return i.classesPropTypeUtil},colorPropTypeUtil:function(){return n.colorPropTypeUtil},colorStopPropTypeUtil:function(){return Z.colorStopPropTypeUtil},colorToneFilterPropTypeUtil:function(){return ae.colorToneFilterPropTypeUtil},cssFilterFunctionPropUtil:function(){return K.cssFilterFunctionPropUtil},dateRangePropTypeUtil:function(){return ne.dateRangePropTypeUtil},dateStringPropTypeUtil:function(){return pe.dateStringPropTypeUtil},dimensionsPropTypeUtil:function(){return y.dimensionsPropTypeUtil},dropShadowFilterPropTypeUtil:function(){return te.dropShadowFilterPropTypeUtil},emailPropTypeUtil:function(){return A.emailPropTypeUtil},filterPropTypeUtil:function(){return K.filterPropTypeUtil},flexPropTypeUtil:function(){return p.flexPropTypeUtil},gradientColorStopPropTypeUtil:function(){return V.gradientColorStopPropTypeUtil},htmlPropTypeUtil:function(){return N.htmlPropTypeUtil},htmlV2PropTypeUtil:function(){return J.htmlV2PropTypeUtil},htmlV3PropTypeUtil:function(){return L.htmlV3PropTypeUtil},hueRotateFilterPropTypeUtil:function(){return ie.hueRotateFilterPropTypeUtil},imageAttachmentIdPropType:function(){return l.imageAttachmentIdPropType},imagePropTypeUtil:function(){return c.imagePropTypeUtil},imageSrcPropTypeUtil:function(){return u.imageSrcPropTypeUtil},intensityFilterPropTypeUtil:function(){return oe.intensityFilterPropTypeUtil},keyValuePropTypeUtil:function(){return R.keyValuePropTypeUtil},layoutDirectionPropTypeUtil:function(){return w.layoutDirectionPropTypeUtil},linkPropTypeUtil:function(){return S.linkPropTypeUtil},moveTransformPropTypeUtil:function(){return H.moveTransformPropTypeUtil},numberPropTypeUtil:function(){return g.numberPropTypeUtil},numberRangePropTypeUtil:function(){return M.numberRangePropTypeUtil},perspectiveOriginPropTypeUtil:function(){return ee.perspectiveOriginPropTypeUtil},positionPropTypeUtil:function(){return q.positionPropTypeUtil},queryPropTypeUtil:function(){return D.queryPropTypeUtil},rotateTransformPropTypeUtil:function(){return Y.rotateTransformPropTypeUtil},scaleTransformPropTypeUtil:function(){return B.scaleTransformPropTypeUtil},selectionSizePropTypeUtil:function(){return F.selectionSizePropTypeUtil},shadowPropTypeUtil:function(){return h.shadowPropTypeUtil},sizePropTypeUtil:function(){return k.sizePropTypeUtil},skewTransformPropTypeUtil:function(){return X.skewTransformPropTypeUtil},spanPropTypeUtil:function(){return b.spanPropTypeUtil},stringArrayPropTypeUtil:function(){return P.stringArrayPropTypeUtil},stringPropTypeUtil:function(){return v.stringPropTypeUtil},strokePropTypeUtil:function(){return T.strokePropTypeUtil},svgSrcPropTypeUtil:function(){return d.svgSrcPropTypeUtil},timeRangePropTypeUtil:function(){return ce.timeRangePropTypeUtil},timeStringPropTypeUtil:function(){return le.timeStringPropTypeUtil},transformFunctionsPropTypeUtil:function(){return G.transformFunctionsPropTypeUtil},transformOriginPropTypeUtil:function(){return Q.transformOriginPropTypeUtil},transformPropTypeUtil:function(){return W.transformPropTypeUtil},urlPropTypeUtil:function(){return U.urlPropTypeUtil},videoAttachmentIdPropType:function(){return m.videoAttachmentIdPropType},videoSrcPropTypeUtil:function(){return f.videoSrcPropTypeUtil}});var s=t("./packages/packages/libs/editor-props/src/prop-types/box-shadow.ts"),o=t("./packages/packages/libs/editor-props/src/prop-types/border-radius.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/border-width.ts"),i=t("./packages/packages/libs/editor-props/src/prop-types/classes.ts"),n=t("./packages/packages/libs/editor-props/src/prop-types/color.ts"),p=t("./packages/packages/libs/editor-props/src/prop-types/flex.ts"),c=t("./packages/packages/libs/editor-props/src/prop-types/image.ts"),l=t("./packages/packages/libs/editor-props/src/prop-types/image-attachment-id.ts"),u=t("./packages/packages/libs/editor-props/src/prop-types/image-src.ts"),d=t("./packages/packages/libs/editor-props/src/prop-types/svg-src.ts"),m=t("./packages/packages/libs/editor-props/src/prop-types/video-attachment-id.ts"),f=t("./packages/packages/libs/editor-props/src/prop-types/video-src.ts"),y=t("./packages/packages/libs/editor-props/src/prop-types/dimensions.ts"),g=t("./packages/packages/libs/editor-props/src/prop-types/number.ts"),h=t("./packages/packages/libs/editor-props/src/prop-types/shadow.ts"),k=t("./packages/packages/libs/editor-props/src/prop-types/size.ts"),b=t("./packages/packages/libs/editor-props/src/prop-types/span.ts"),v=t("./packages/packages/libs/editor-props/src/prop-types/string.ts"),P=t("./packages/packages/libs/editor-props/src/prop-types/string-array.ts"),T=t("./packages/packages/libs/editor-props/src/prop-types/stroke.ts"),U=t("./packages/packages/libs/editor-props/src/prop-types/url.ts"),w=t("./packages/packages/libs/editor-props/src/prop-types/layout-direction.ts"),S=t("./packages/packages/libs/editor-props/src/prop-types/link.ts"),A=t("./packages/packages/libs/editor-props/src/prop-types/email.ts"),F=t("./packages/packages/libs/editor-props/src/prop-types/selection-size.ts"),z=t("./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background.ts"),_=t("./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-overlay.ts"),O=t("./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-color-overlay.ts"),j=t("./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-image-overlay.ts"),x=t("./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-gradient-overlay.ts"),C=t("./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-image-position-offset.ts"),E=t("./packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-image-size-scale.ts"),$=t("./packages/packages/libs/editor-props/src/prop-types/boolean.ts"),Z=t("./packages/packages/libs/editor-props/src/prop-types/color-stop.ts"),V=t("./packages/packages/libs/editor-props/src/prop-types/gradient-color-stop.ts"),R=t("./packages/packages/libs/editor-props/src/prop-types/key-value.ts"),M=t("./packages/packages/libs/editor-props/src/prop-types/number-range.ts"),I=t("./packages/packages/libs/editor-props/src/prop-types/date-time.ts"),q=t("./packages/packages/libs/editor-props/src/prop-types/position.ts"),D=t("./packages/packages/libs/editor-props/src/prop-types/query.ts"),N=t("./packages/packages/libs/editor-props/src/prop-types/html.ts"),J=t("./packages/packages/libs/editor-props/src/prop-types/html-v2.ts"),L=t("./packages/packages/libs/editor-props/src/prop-types/html-v3.ts"),K=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter.ts"),W=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform.ts"),G=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions.ts"),H=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/move-transform.ts"),B=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/scale-transform.ts"),Y=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/rotate-transform.ts"),X=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/skew-transform.ts"),Q=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-origin.ts"),ee=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/perspective-origin.ts"),re=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/backdrop-filter.ts"),te=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/drop-shadow-filter.ts"),se=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/blur-filter.ts"),oe=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/intensity-filter.ts"),ae=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/color-tone-filter.ts"),ie=t("./packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/hue-rotate-filter.ts"),ne=t("./packages/packages/libs/editor-props/src/prop-types/date-range.ts"),pe=t("./packages/packages/libs/editor-props/src/prop-types/date-string.ts"),ce=t("./packages/packages/libs/editor-props/src/prop-types/time-range.ts"),le=t("./packages/packages/libs/editor-props/src/prop-types/time-string.ts")},"./packages/packages/libs/editor-props/src/prop-types/key-value.ts":function(e,r,t){t.r(r),t.d(r,{keyValuePropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("key-value",s.z.strictObject({key:a.unknownChildrenSchema,value:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/layout-direction.ts":function(e,r,t){t.r(r),t.d(r,{layoutDirectionPropTypeUtil:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("layout-direction",s.z.object({row:s.z.any(),column:s.z.any()}))},"./packages/packages/libs/editor-props/src/prop-types/link.ts":function(e,r,t){t.r(r),t.d(r,{linkPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("link",s.z.strictObject({destination:a.unknownChildrenSchema,isTargetBlank:a.unknownChildrenSchema,tag:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/number-range.ts":function(e,r,t){t.r(r),t.d(r,{numberRangePropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("number-range",s.z.strictObject({min:a.unknownChildrenSchema,max:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/number.ts":function(e,r,t){t.r(r),t.d(r,{numberPropTypeUtil:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("number",s.z.number().nullable())},"./packages/packages/libs/editor-props/src/prop-types/position.ts":function(e,r,t){t.r(r),t.d(r,{positionPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("object-position",s.z.strictObject({x:a.unknownChildrenSchema,y:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/query.ts":function(e,r,t){t.r(r),t.d(r,{queryPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("query",s.z.strictObject({id:a.unknownChildrenSchema,label:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/selection-size.ts":function(e,r,t){t.r(r),t.d(r,{selectionSizePropTypeUtil:function(){return p}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/key-value.ts"),i=t("./packages/packages/libs/editor-props/src/prop-types/string.ts"),n=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const p=(0,o.createPropUtils)("selection-size",s.z.strictObject({selection:s.z.union([a.keyValuePropTypeUtil.schema,i.stringPropTypeUtil.schema]),size:n.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/shadow.ts":function(e,r,t){t.r(r),t.d(r,{shadowPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("shadow",s.z.strictObject({position:a.unknownChildrenSchema,hOffset:a.unknownChildrenSchema,vOffset:a.unknownChildrenSchema,blur:a.unknownChildrenSchema,spread:a.unknownChildrenSchema,color:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/size.ts":function(e,r,t){t.r(r),t.d(r,{sizePropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts");const a=s.z.union([s.z.number(),s.z.literal("")]),i=(0,o.createPropUtils)("size",s.z.strictObject({unit:s.z.enum(["px","em","rem","%","vw","vh","ch"]),size:a}).or(s.z.strictObject({unit:s.z.enum(["deg","rad","grad","turn"]),size:a})).or(s.z.strictObject({unit:s.z.enum(["s","ms"]),size:a})).or(s.z.strictObject({unit:s.z.literal("auto"),size:s.z.literal("")})).or(s.z.strictObject({unit:s.z.literal("custom"),size:s.z.string()})))},"./packages/packages/libs/editor-props/src/prop-types/span.ts":function(e,r,t){t.r(r),t.d(r,{spanPropTypeUtil:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("span",s.z.number().nullable())},"./packages/packages/libs/editor-props/src/prop-types/string-array.ts":function(e,r,t){t.r(r),t.d(r,{stringArrayPropTypeUtil:function(){return a}});var s=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),o=t("./packages/packages/libs/editor-props/src/prop-types/string.ts");const a=(0,s.createArrayPropUtils)(o.stringPropTypeUtil.key,o.stringPropTypeUtil.schema)},"./packages/packages/libs/editor-props/src/prop-types/string.ts":function(e,r,t){t.r(r),t.d(r,{stringPropTypeUtil:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("string",s.z.string().nullable())},"./packages/packages/libs/editor-props/src/prop-types/stroke.ts":function(e,r,t){t.r(r),t.d(r,{strokePropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("stroke",s.z.strictObject({color:a.unknownChildrenSchema,width:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/svg-src.ts":function(e,r,t){t.r(r),t.d(r,{svgSrcPropTypeUtil:function(){return n}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=s.z.strictObject({id:a.unknownChildrenSchema,url:s.z.null()}).or(s.z.strictObject({id:s.z.null(),url:a.unknownChildrenSchema})).or(s.z.strictObject({id:a.unknownChildrenSchema,url:a.unknownChildrenSchema})),n=(0,o.createPropUtils)("svg-src",i)},"./packages/packages/libs/editor-props/src/prop-types/time-range.ts":function(e,r,t){t.r(r),t.d(r,{timeRangePropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("time-range",s.z.strictObject({min:a.unknownChildrenSchema,max:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/time-string.ts":function(e,r,t){t.r(r),t.d(r,{timeStringPropTypeUtil:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("time-string",s.z.string())},"./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/perspective-origin.ts":function(e,r,t){t.r(r),t.d(r,{perspectiveOriginPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("perspective-origin",s.z.strictObject({x:a.unknownChildrenSchema,y:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions.ts":function(e,r,t){t.r(r),t.d(r,{transformFunctionsPropTypeUtil:function(){return l}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/move-transform.ts"),i=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/rotate-transform.ts"),n=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/scale-transform.ts"),p=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/skew-transform.ts");const c=a.moveTransformPropTypeUtil.schema.or(n.scaleTransformPropTypeUtil.schema).or(i.rotateTransformPropTypeUtil.schema).or(p.skewTransformPropTypeUtil.schema),l=(0,o.createPropUtils)("transform-functions",s.z.array(c))},"./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/move-transform.ts":function(e,r,t){t.r(r),t.d(r,{moveTransformPropTypeUtil:function(){return n}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts"),i=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/types.ts");const n=(0,o.createPropUtils)(i.TransformFunctionKeys.move,s.z.strictObject({x:a.unknownChildrenSchema,y:a.unknownChildrenSchema,z:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/rotate-transform.ts":function(e,r,t){t.r(r),t.d(r,{rotateTransformPropTypeUtil:function(){return n}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts"),i=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/types.ts");const n=(0,o.createPropUtils)(i.TransformFunctionKeys.rotate,s.z.strictObject({x:a.unknownChildrenSchema,y:a.unknownChildrenSchema,z:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/scale-transform.ts":function(e,r,t){t.r(r),t.d(r,{scaleTransformPropTypeUtil:function(){return n}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/number.ts"),i=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/types.ts");const n=(0,o.createPropUtils)(i.TransformFunctionKeys.scale,s.z.strictObject({x:a.numberPropTypeUtil.schema.nullable(),y:a.numberPropTypeUtil.schema.nullable(),z:a.numberPropTypeUtil.schema.nullable()}))},"./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/skew-transform.ts":function(e,r,t){t.r(r),t.d(r,{skewTransformPropTypeUtil:function(){return n}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts"),i=t("./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/types.ts");const n=(0,o.createPropUtils)(i.TransformFunctionKeys.skew,s.z.strictObject({x:a.unknownChildrenSchema,y:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-origin.ts":function(e,r,t){t.r(r),t.d(r,{transformOriginPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("transform-origin",s.z.strictObject({x:a.unknownChildrenSchema,y:a.unknownChildrenSchema,z:a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform.ts":function(e,r,t){t.r(r),t.d(r,{transformPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("transform",s.z.strictObject({"transform-functions":a.unknownChildrenSchema,"transform-origin":a.unknownChildrenSchema,perspective:a.unknownChildrenSchema,"perspective-origin":a.unknownChildrenSchema}))},"./packages/packages/libs/editor-props/src/prop-types/transform-prop-types/types.ts":function(e,r,t){t.r(r),t.d(r,{TransformFunctionKeys:function(){return s}});const s={move:"transform-move",scale:"transform-scale",rotate:"transform-rotate",skew:"transform-skew"}},"./packages/packages/libs/editor-props/src/prop-types/url.ts":function(e,r,t){t.r(r),t.d(r,{urlPropTypeUtil:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("url",s.z.string().nullable())},"./packages/packages/libs/editor-props/src/prop-types/utils.ts":function(e,r,t){t.r(r),t.d(r,{unknownChildrenSchema:function(){return o}});var s=t("@elementor/schema");const o=s.z.any().nullable()},"./packages/packages/libs/editor-props/src/prop-types/video-attachment-id.ts":function(e,r,t){t.r(r),t.d(r,{videoAttachmentIdPropType:function(){return o}});var s=t("@elementor/schema");const o=(0,t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts").createPropUtils)("video-attachment-id",s.z.number())},"./packages/packages/libs/editor-props/src/prop-types/video-src.ts":function(e,r,t){t.r(r),t.d(r,{videoSrcPropTypeUtil:function(){return i}});var s=t("@elementor/schema"),o=t("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),a=t("./packages/packages/libs/editor-props/src/prop-types/utils.ts");const i=(0,o.createPropUtils)("video-src",s.z.strictObject({id:a.unknownChildrenSchema,url:s.z.null()}).or(s.z.strictObject({id:s.z.null(),url:a.unknownChildrenSchema})))},"./packages/packages/libs/editor-props/src/types.ts":function(e,r,t){t.r(r)},"./packages/packages/libs/editor-props/src/utils/adjust-llm-prop-value-schema.ts":function(e,r,t){t.r(r),t.d(r,{adjustLlmPropValueSchema:function(){return adjustLlmPropValueSchema}});var s=t("./packages/packages/libs/editor-props/src/prop-types/index.ts");const ensureNotNull=(e,r)=>null===e?r:e,o={transformers:{}},adjustLlmPropValueSchema=(e,{transformers:r={},forceKey:t}=o)=>{const a=structuredClone(e);if("object"!=typeof a||null===a)return null;if(Array.isArray(a))return a.map(e=>adjustLlmPropValueSchema(e,{forceKey:t,transformers:r}));const i=a;switch("$intention"in i&&delete i.$intention,t&&(i.$$type=t),i.$$type){case"size":{const{value:e}=i;return{$$type:"size",value:{unit:"string"==typeof e.unit?e.unit:ensureNotNull(s.stringPropTypeUtil.extract(e.unit),"px"),size:"string"==typeof e.size||"number"==typeof e.size?e.size:ensureNotNull(s.stringPropTypeUtil.extract(e.size),s.numberPropTypeUtil.extract(e.size))}}}case"html-v3":{const{value:e}=i;return{$$type:"html-v3",value:{content:e.content,children:e.children??[]}}}default:const e=r?.[i.$$type];if(e)return e(i.value)}if("object"==typeof i.value)if(Array.isArray(i.value))i.value=adjustLlmPropValueSchema(i.value,{transformers:r});else{const{value:e}=i,t=a;t.value={},Object.entries(e).forEach(([e,s])=>{t.value[e]=adjustLlmPropValueSchema(s,{transformers:r})})}return a}},"./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts":function(e,r,t){t.r(r),t.d(r,{createArrayPropUtils:function(){return createArrayPropUtils},createPropUtils:function(){return createPropUtils},getPropSchemaFromCache:function(){return getPropSchemaFromCache}});var s=t("@elementor/schema");const o=new Map;function getPropSchemaFromCache(e){return o.get(e)}function createPropUtils(e,r){const t=s.z.strictObject({$$type:s.z.literal(e),value:r,disabled:s.z.boolean().optional()});function isValid(e){return t.safeParse(e).success}const a={extract:function extract(e){return isValid(e)?e.value:null},isValid:isValid,create:function create(r,t){const s="function"==typeof r?r:()=>r,{base:o,disabled:a}=t||{};if(!o)return{$$type:e,value:s(),...a&&{disabled:a}};if(!isValid(o))throw new Error(`Cannot create prop based on invalid value: ${JSON.stringify(o)}`);return{$$type:e,value:s(o.value),...a&&{disabled:a}}},schema:t,key:e};return o.set(e,a),a}function createArrayPropUtils(e,r,t){return createPropUtils(t||`${e}-array`,s.z.array(r))}},"./packages/packages/libs/editor-props/src/utils/filter-empty-values.ts":function(e,r,t){t.r(r),t.d(r,{filterEmptyValues:function(){return filterEmptyValues},isEmpty:function(){return isEmpty}});var s=t("./packages/packages/libs/editor-props/src/utils/is-transformable.ts");const filterEmptyValues=e=>isEmpty(e)?null:Array.isArray(e)?e.map(filterEmptyValues).filter(e=>!isEmpty(e)):"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[e,filterEmptyValues(r)]).filter(([,e])=>!isEmpty(e))):e,isEmpty=e=>e&&(0,s.isTransformable)(e)?isEmpty(e.value):isNullish(e)||isNullishArray(e)||isNullishObject(e),isNullish=e=>null==e||""===e,isNullishArray=e=>Array.isArray(e)&&e.every(isEmpty),isNullishObject=e=>"object"==typeof e&&isNullishArray(Object.values(e))},"./packages/packages/libs/editor-props/src/utils/is-overridable.ts":function(e,r,t){t.r(r),t.d(r,{isOverridable:function(){return isOverridable},rewrapOverridableValue:function(){return rewrapOverridableValue}});var s=t("./packages/packages/libs/editor-props/src/utils/is-transformable.ts");function isOverridable(e){return(0,s.isTransformable)(e)&&"overridable"===e.$$type}function rewrapOverridableValue(e,r){return{...e,value:{...e.value,origin_value:r}}}},"./packages/packages/libs/editor-props/src/utils/is-transformable.ts":function(e,r,t){t.r(r),t.d(r,{isTransformable:function(){return isTransformable}});var s=t("@elementor/schema");const o=s.z.object({$$type:s.z.string(),value:s.z.any(),disabled:s.z.boolean().optional()}),isTransformable=e=>o.safeParse(e).success},"./packages/packages/libs/editor-props/src/utils/llm-schema-to-props.ts":function(e,r,t){function jsonSchemaToPropType(e,r=e.key){const t={};return e.description&&(t.description=e.description),e.anyOf&&Array.isArray(e.anyOf)?function convertJsonSchemaToUnionPropType(e,r){const t={};if(!e.anyOf||!Array.isArray(e.anyOf))throw new Error("Invalid anyOf schema");for(const r of e.anyOf)if("object"===r.type&&r.properties&&r.properties.$$type&&r.properties.value){const e=r.properties.$$type;let s;if(!(e.enum&&Array.isArray(e.enum)&&e.enum.length>0))continue;s=e.enum[0];const o=convertJsonSchemaToPropType(r.properties.value);t[s]=o}return{kind:"union",prop_types:t,settings:{},meta:r}}(e,t):"object"===e.type&&e.properties?function convertJsonSchemaToObjectPropType(e,r,t=e.key){const s={};if(!e.properties)return{kind:"object",key:t,shape:{},settings:{},meta:r};const o=Array.isArray(e.required)?e.required:[];for(const[r,a]of Object.entries(e.properties)){const e=convertJsonSchemaToPropType(a,t);o.includes(r)&&(e.settings={...e.settings,required:!0}),s[r]=e}return{kind:"object",key:t||"object",shape:s,settings:{},meta:r}}(e,t,r):"array"===e.type&&e.items?function convertJsonSchemaToArrayPropType(e,r,t=e.key){if(!e.items)throw new Error("Array schema must have items property");const s=convertJsonSchemaToPropType(e.items);return{kind:"array",key:t||"array",item_prop_type:s,settings:{},meta:r}}(e,t,r):function convertJsonSchemaToPlainPropType(e,r,t=e.key){const s={};let o=t||"string";"number"===e.type?o="number":"boolean"===e.type?o="boolean":"string"===e.type&&(o="string");Array.isArray(e.enum)&&(s.enum=e.enum);return{kind:"plain",key:o,settings:s,meta:r}}(e,t,r)}function convertJsonSchemaToPropType(e,r){return jsonSchemaToPropType(e,r)}function jsonSchemaToPropsSchema(e){const r={};if("object"!==e.type||!e.properties)throw new Error("Root schema must be an object with properties");for(const[t,s]of Object.entries(e.properties))r[t]=convertJsonSchemaToPropType(s,t);return r}t.r(r),t.d(r,{jsonSchemaToPropType:function(){return jsonSchemaToPropType},jsonSchemaToPropsSchema:function(){return jsonSchemaToPropsSchema}})},"./packages/packages/libs/editor-props/src/utils/merge-props.ts":function(e,r,t){function mergeProps(e,r){let t={};return Array.isArray(e)||(t=structuredClone(e)),Object.entries(r).forEach(([e,r])=>{null==r?delete t[e]:t[e]=r}),t}t.r(r),t.d(r,{mergeProps:function(){return mergeProps}})},"./packages/packages/libs/editor-props/src/utils/parse-html-children.ts":function(e,r,t){t.r(r),t.d(r,{parseHtmlChildren:function(){return parseHtmlChildren}});const s=new Set(["span","b","strong","i","em","u","a","del","sup","sub","s"]);function generateElementId(){return`e-${Date.now().toString(36)}-${Math.random().toString(36).substring(2,9)}`}function traverseChildren(e){const r=[];for(const t of Array.from(e.children)){const e=t.tagName.toLowerCase();if(!s.has(e)){r.push(...traverseChildren(t));continue}let o=t.getAttribute("id");o||(o=generateElementId(),t.setAttribute("id",o));const a={id:o,type:e},i=t.textContent?.trim();i&&(a.content=i);const n=traverseChildren(t);n.length>0&&(a.children=n),r.push(a)}return r}function parseHtmlChildren(e){if(!e)return{content:e,children:[]};const r=(new DOMParser).parseFromString(`<body>${e}</body>`,"text/html"),t=r.querySelector("parsererror");if(t)return console.warn("HTML parsing error, returning original content:",t.textContent),{content:e,children:[]};const s=r.body,o=traverseChildren(s);return{content:s.innerHTML,children:o}}},"./packages/packages/libs/editor-props/src/utils/prop-dependency-utils.ts":function(e,r,t){t.r(r),t.d(r,{evaluateTerm:function(){return evaluateTerm},extractValue:function(){return extractValue},isDependency:function(){return isDependency},isDependencyMet:function(){return isDependencyMet}});var s=t("./packages/packages/libs/editor-props/src/utils/is-overridable.ts"),o=t("./packages/packages/libs/editor-props/src/utils/is-transformable.ts");function isDependencyMet(e,r){if(!e?.terms.length)return{isMet:!0};const{relation:t,terms:s}=e,o=function getRelationMethod(e){switch(e){case"or":return"some";case"and":return"every";default:throw new Error(`Relation not supported ${e}`)}}(t),a=[];return{isMet:s[o](e=>{const t=isDependency(e)?isDependencyMet(e,r).isMet:evaluateTerm(e,extractValue(e.path,r,e.nestedPath)?.value);return t||a.push(e),t}),failingDependencies:a}}function evaluateTerm(e,r){const{value:t,operator:s}=e;switch(s){case"eq":case"ne":return r===t==("eq"===s);case"gt":case"lte":return!(!isNumber(r)||!isNumber(t))&&Number(r)>Number(t)==("gt"===s);case"lt":case"gte":return!(!isNumber(r)||!isNumber(t))&&Number(r)<Number(t)==("lt"===s);case"in":case"nin":return!!Array.isArray(t)&&t.includes(r)===("in"===s);case"contains":case"ncontains":if(("string"!=typeof r||"string"!=typeof t)&&!Array.isArray(r))return!1;return"contains"===s===(Array.isArray(r)?r.map(e=>(0,o.isTransformable)(e)?e.value:e):r).includes(t);case"exists":case"not_exist":return"exists"===s===(!!r||0===r||!1===r);default:return!0}}function isNumber(e){return"number"==typeof e&&!isNaN(e)}function extractValue(e,r,t=[],a={}){const{unwrapOverridableLeaf:i=!0}=a;let n=e.reduce((r,t,a)=>{const i=r?.[t];if(a===e.length-1)return i;if((0,s.isOverridable)(i)){const e=i.value.origin_value;return(0,o.isTransformable)(e)?e.value??null:e}return(0,o.isTransformable)(i)?i.value??null:i},r);if(i&&n&&(0,s.isOverridable)(n)&&(n=n.value.origin_value??null),!t?.length)return n;return{$$type:"unknown",value:t.reduce((e,r)=>e?.[r],n?.value)}}function isDependency(e){return"terms"in e}},"./packages/packages/libs/editor-props/src/utils/props-to-llm-schema.ts":function(e,r,t){function propTypeToJsonSchema(e){const r=e.meta?.description,t={};switch(r&&(t.description=r),null!==e.initial_value&&void 0!==e.initial_value&&(t.examples=[e.initial_value]),e.kind){case"union":return function convertUnionPropType(e,r){const t=structuredClone(r),s=e.prop_types||{},o=[];for(const[e,r]of Object.entries(s)){if("dynamic"===e||"overridable"===e)continue;const t=convertPropTypeToJsonSchema(r);o.push(t)}o.length>0&&(t.anyOf=o);const a=e.meta?.description;a&&(t.description=a);return t}(e,t);case"object":return function convertObjectPropType(e,r){const t=structuredClone(r);t.type="object";const s={properties:{$$type:{type:"string",const:e.key},value:{type:"object",properties:{},additionalProperties:!1}}},o=["$$type","value"],a=[],i=e.shape||{};for(const[e,r]of Object.entries(i)){const t=propTypeToJsonSchema(r);!0===r.settings?.required&&a.push(e),s.properties.value.properties&&(s.properties.value.properties[e]=t)}t.required=o,a.length>0&&(s.properties.value.required=a);return{...t,...s}}(e,t);case"array":return function convertArrayPropType(e,r){const t=structuredClone(r);let s;t.type="object";const o=e.item_prop_type;o&&(s=convertPropTypeToJsonSchema(o));return t.properties={$$type:{type:"string",const:e.key},value:{type:"array",...s?{items:s}:{}}},t}(e,t);default:return function convertPlainPropType(e,r){const t={...r};if(!Object.hasOwn(e,"kind"))throw new Error(`PropType kind is undefined for propType with key: ${e.key??"[unknown key]"}`);const s=e.settings?.enum||[];switch(e.kind){case"string":case"number":case"boolean":return{...t,type:"object",properties:{$$type:{type:"string",const:e.key??e.kind},value:{type:e.kind,...s.length>0?{enum:s}:{}}},required:["$$type","value"]};default:return{...t,type:"object",$$type:e.kind,value:{type:e.kind}}}}(e,t)}}function convertPropTypeToJsonSchema(e){return propTypeToJsonSchema(e)}t.r(r),t.d(r,{configurableKeys:function(){return configurableKeys},enrichWithIntention:function(){return enrichWithIntention},isPropKeyConfigurable:function(){return isPropKeyConfigurable},nonConfigurablePropKeys:function(){return s},propTypeToJsonSchema:function(){return propTypeToJsonSchema},removeIntention:function(){return removeIntention}});const s=["_cssid","classes","attributes"];function isPropKeyConfigurable(e,r){return!s.includes(e)||!(Array.isArray(r?.meta)||!r?.meta?.llm_configurable)}function configurableKeys(e){return Object.keys(e).filter(r=>isPropKeyConfigurable(r,e[r]))}function enrichWithIntention(e,r="Describe the desired outcome"){const t=structuredClone(e);return t.properties?(t.properties.$intention={type:"string",description:r},t.required=[...t.required||[],"$intention"],t):e}function removeIntention(e){const r=structuredClone(e);return r.properties?(delete r.properties.$intention,r.required&&(r.required=r.required.filter(e=>"$intention"!==e)),r):e}},"./packages/packages/libs/editor-props/src/utils/validate-prop-value.ts":function(e,r,t){t.r(r),t.d(r,{validatePropValue:function(){return validatePropValue},validatePropValueDetailed:function(){return validatePropValueDetailed}});var s=t("./node_modules/jsonschema/lib/index.js"),o=t("./packages/packages/libs/editor-props/src/utils/props-to-llm-schema.ts");function processValidationError(e){const r={path:e.path,message:e.message,schema:e.schema,instance:e.instance,name:e.name};if("anyOf"===e.name&&e.schema&&"object"==typeof e.schema&&"anyOf"in e.schema){const t=(e.schema.anyOf||[]).map((r,t)=>{const o=(0,s.validate)(e.instance,r);let a=`variant-${t}`;if(r&&"object"==typeof r&&"properties"in r&&r.properties&&"object"==typeof r.properties&&"$$type"in r.properties){const e=r.properties.$$type;e&&"object"==typeof e&&"const"in e&&"string"==typeof e.const&&(a=e.const)}return{discriminator:a,errors:o.errors.map(processValidationError)}});r.variants=t}return r}function formatDetailedErrors(e,r=""){const t=[];for(const s of e){const e=s.path.length>0?s.path.join("."):"root";if(t.push(`${r}Error at ${e}: ${s.message}`),s.variants&&s.variants.length>0){t.push(`${r} Tried ${s.variants.length} variant(s):`);for(const e of s.variants)if(t.push(`${r} - ${e.discriminator}:`),0===e.errors.length)t.push(`${r} (no errors - this variant matched!)`);else for(const s of e.errors){const e=s.path.length>0?s.path.join("."):"root";t.push(`${r} ${e}: ${s.message}`),s.variants&&s.variants.length>0&&t.push(formatDetailedErrors([s],`${r} `))}}}return t.join("\n")}const validatePropValue=(e,r)=>{const t=(0,o.propTypeToJsonSchema)(e);if(null===r)return{valid:!0,errors:[],errorMessages:[],jsonSchema:JSON.stringify((0,o.propTypeToJsonSchema)(e))};const a=(0,s.validate)(r,t),i=a.errors.map(processValidationError);return{valid:a.valid,errors:a.errors,errorMessages:formatDetailedErrors(i),jsonSchema:JSON.stringify(t)}},validatePropValueDetailed=(e,r)=>{const t=(0,o.propTypeToJsonSchema)(e),a=(0,s.validate)(r,t),i=a.errors.map(processValidationError);return{valid:a.valid,errors:i,errorMessages:i.map(e=>e.message),formattedErrors:formatDetailedErrors(i),jsonSchema:JSON.stringify(t)}}},"@elementor/schema":function(e){e.exports=window.elementorV2.schema}},r={};function __webpack_require__(t){var s=r[t];if(void 0!==s)return s.exports;var o=r[t]={exports:{}};return e[t](o,o.exports,__webpack_require__),o.exports}__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,{a:r}),r},__webpack_require__.d=function(e,r){for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};!function(){__webpack_require__.r(t),__webpack_require__.d(t,{CLASSES_PROP_KEY:function(){return a.CLASSES_PROP_KEY},DateTimePropTypeUtil:function(){return a.DateTimePropTypeUtil},Schema:function(){return m},backdropFilterPropTypeUtil:function(){return a.backdropFilterPropTypeUtil},backgroundColorOverlayPropTypeUtil:function(){return a.backgroundColorOverlayPropTypeUtil},backgroundGradientOverlayPropTypeUtil:function(){return a.backgroundGradientOverlayPropTypeUtil},backgroundImageOverlayPropTypeUtil:function(){return a.backgroundImageOverlayPropTypeUtil},backgroundImagePositionOffsetPropTypeUtil:function(){return a.backgroundImagePositionOffsetPropTypeUtil},backgroundImageSizeScalePropTypeUtil:function(){return a.backgroundImageSizeScalePropTypeUtil},backgroundOverlayItem:function(){return a.backgroundOverlayItem},backgroundOverlayPropTypeUtil:function(){return a.backgroundOverlayPropTypeUtil},backgroundPropTypeUtil:function(){return a.backgroundPropTypeUtil},blurFilterPropTypeUtil:function(){return a.blurFilterPropTypeUtil},booleanPropTypeUtil:function(){return a.booleanPropTypeUtil},borderRadiusPropTypeUtil:function(){return a.borderRadiusPropTypeUtil},borderWidthPropTypeUtil:function(){return a.borderWidthPropTypeUtil},boxShadowPropTypeUtil:function(){return a.boxShadowPropTypeUtil},classesPropTypeUtil:function(){return a.classesPropTypeUtil},colorPropTypeUtil:function(){return a.colorPropTypeUtil},colorStopPropTypeUtil:function(){return a.colorStopPropTypeUtil},colorToneFilterPropTypeUtil:function(){return a.colorToneFilterPropTypeUtil},createArrayPropUtils:function(){return i.createArrayPropUtils},createPropUtils:function(){return i.createPropUtils},cssFilterFunctionPropUtil:function(){return a.cssFilterFunctionPropUtil},dateRangePropTypeUtil:function(){return a.dateRangePropTypeUtil},dateStringPropTypeUtil:function(){return a.dateStringPropTypeUtil},dimensionsPropTypeUtil:function(){return a.dimensionsPropTypeUtil},dropShadowFilterPropTypeUtil:function(){return a.dropShadowFilterPropTypeUtil},emailPropTypeUtil:function(){return a.emailPropTypeUtil},evaluateTerm:function(){return u.evaluateTerm},extractValue:function(){return u.extractValue},filterEmptyValues:function(){return n.filterEmptyValues},filterPropTypeUtil:function(){return a.filterPropTypeUtil},flexPropTypeUtil:function(){return a.flexPropTypeUtil},getPropSchemaFromCache:function(){return i.getPropSchemaFromCache},gradientColorStopPropTypeUtil:function(){return a.gradientColorStopPropTypeUtil},htmlPropTypeUtil:function(){return a.htmlPropTypeUtil},htmlV2PropTypeUtil:function(){return a.htmlV2PropTypeUtil},htmlV3PropTypeUtil:function(){return a.htmlV3PropTypeUtil},hueRotateFilterPropTypeUtil:function(){return a.hueRotateFilterPropTypeUtil},imageAttachmentIdPropType:function(){return a.imageAttachmentIdPropType},imagePropTypeUtil:function(){return a.imagePropTypeUtil},imageSrcPropTypeUtil:function(){return a.imageSrcPropTypeUtil},intensityFilterPropTypeUtil:function(){return a.intensityFilterPropTypeUtil},isDependency:function(){return u.isDependency},isDependencyMet:function(){return u.isDependencyMet},isEmpty:function(){return n.isEmpty},isOverridable:function(){return p.isOverridable},isTransformable:function(){return c.isTransformable},keyValuePropTypeUtil:function(){return a.keyValuePropTypeUtil},layoutDirectionPropTypeUtil:function(){return a.layoutDirectionPropTypeUtil},linkPropTypeUtil:function(){return a.linkPropTypeUtil},mergeProps:function(){return l.mergeProps},moveTransformPropTypeUtil:function(){return a.moveTransformPropTypeUtil},numberPropTypeUtil:function(){return a.numberPropTypeUtil},numberRangePropTypeUtil:function(){return a.numberRangePropTypeUtil},parseHtmlChildren:function(){return d.parseHtmlChildren},perspectiveOriginPropTypeUtil:function(){return a.perspectiveOriginPropTypeUtil},positionPropTypeUtil:function(){return a.positionPropTypeUtil},queryPropTypeUtil:function(){return a.queryPropTypeUtil},rewrapOverridableValue:function(){return p.rewrapOverridableValue},rotateTransformPropTypeUtil:function(){return a.rotateTransformPropTypeUtil},scaleTransformPropTypeUtil:function(){return a.scaleTransformPropTypeUtil},selectionSizePropTypeUtil:function(){return a.selectionSizePropTypeUtil},shadowPropTypeUtil:function(){return a.shadowPropTypeUtil},sizePropTypeUtil:function(){return a.sizePropTypeUtil},skewTransformPropTypeUtil:function(){return a.skewTransformPropTypeUtil},spanPropTypeUtil:function(){return a.spanPropTypeUtil},stringArrayPropTypeUtil:function(){return a.stringArrayPropTypeUtil},stringPropTypeUtil:function(){return a.stringPropTypeUtil},strokePropTypeUtil:function(){return a.strokePropTypeUtil},svgSrcPropTypeUtil:function(){return a.svgSrcPropTypeUtil},timeRangePropTypeUtil:function(){return a.timeRangePropTypeUtil},timeStringPropTypeUtil:function(){return a.timeStringPropTypeUtil},transformFunctionsPropTypeUtil:function(){return a.transformFunctionsPropTypeUtil},transformOriginPropTypeUtil:function(){return a.transformOriginPropTypeUtil},transformPropTypeUtil:function(){return a.transformPropTypeUtil},urlPropTypeUtil:function(){return a.urlPropTypeUtil},videoAttachmentIdPropType:function(){return a.videoAttachmentIdPropType},videoSrcPropTypeUtil:function(){return a.videoSrcPropTypeUtil}});var e=__webpack_require__("./packages/packages/libs/editor-props/src/utils/adjust-llm-prop-value-schema.ts"),r=__webpack_require__("./packages/packages/libs/editor-props/src/utils/llm-schema-to-props.ts"),s=__webpack_require__("./packages/packages/libs/editor-props/src/utils/props-to-llm-schema.ts"),o=__webpack_require__("./packages/packages/libs/editor-props/src/utils/validate-prop-value.ts"),a=(__webpack_require__("./packages/packages/libs/editor-props/src/types.ts"),__webpack_require__("./packages/packages/libs/editor-props/src/prop-types/index.ts")),i=__webpack_require__("./packages/packages/libs/editor-props/src/utils/create-prop-utils.ts"),n=__webpack_require__("./packages/packages/libs/editor-props/src/utils/filter-empty-values.ts"),p=__webpack_require__("./packages/packages/libs/editor-props/src/utils/is-overridable.ts"),c=__webpack_require__("./packages/packages/libs/editor-props/src/utils/is-transformable.ts"),l=__webpack_require__("./packages/packages/libs/editor-props/src/utils/merge-props.ts"),u=__webpack_require__("./packages/packages/libs/editor-props/src/utils/prop-dependency-utils.ts"),d=__webpack_require__("./packages/packages/libs/editor-props/src/utils/parse-html-children.ts");const m={jsonSchemaToPropType:r.jsonSchemaToPropType,propTypeToJsonSchema:s.propTypeToJsonSchema,adjustLlmPropValueSchema:e.adjustLlmPropValueSchema,isPropKeyConfigurable:s.isPropKeyConfigurable,nonConfigurablePropKeys:s.nonConfigurablePropKeys,configurableKeys:s.configurableKeys,validatePropValue:o.validatePropValue,enrichWithIntention:s.enrichWithIntention,removeIntention:s.removeIntention}}(),(window.elementorV2=window.elementorV2||{}).editorProps=t}(),window.elementorV2.editorProps?.init?.(); | |
| 1 | +(function(_elementor_schema) { | |
| 2 | + | |
| 3 | +//#region \0rolldown/runtime.js | |
| 4 | + var __defProp = Object.defineProperty; | |
| 5 | + var __name = (target, value) => __defProp(target, "name", { | |
| 6 | + value, | |
| 7 | + configurable: true | |
| 8 | + }); | |
| 9 | + var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); | |
| 10 | + var __exportAll = (all, no_symbols) => { | |
| 11 | + let target = {}; | |
| 12 | + for (var name in all) { | |
| 13 | + __defProp(target, name, { | |
| 14 | + get: all[name], | |
| 15 | + enumerable: true | |
| 16 | + }); | |
| 17 | + } | |
| 18 | + if (!no_symbols) { | |
| 19 | + __defProp(target, Symbol.toStringTag, { value: "Module" }); | |
| 20 | + } | |
| 21 | + return target; | |
| 22 | + }; | |
| 23 | + | |
| 24 | +//#endregion | |
| 25 | + | |
| 26 | +//#region packages/packages/libs/editor-props/src/utils/create-prop-utils.ts | |
| 27 | + var SCHEMA_CACHE = /* @__PURE__ */ new Map(); | |
| 28 | + function getPropSchemaFromCache(key) { | |
| 29 | + return SCHEMA_CACHE.get(key); | |
| 30 | + } | |
| 31 | + function createPropUtils(key, valueSchema) { | |
| 32 | + const schema = _elementor_schema.z.strictObject({ | |
| 33 | + $$type: _elementor_schema.z.literal(key), | |
| 34 | + value: valueSchema, | |
| 35 | + disabled: _elementor_schema.z.boolean().optional() | |
| 36 | + }); | |
| 37 | + function isValid(prop) { | |
| 38 | + return schema.safeParse(prop).success; | |
| 39 | + } | |
| 40 | + function create(value, createOptions) { | |
| 41 | + const fn = typeof value === "function" ? value : () => value; | |
| 42 | + const { base, disabled } = createOptions || {}; | |
| 43 | + if (!base) return { | |
| 44 | + $$type: key, | |
| 45 | + value: fn(), | |
| 46 | + ...disabled && { disabled } | |
| 47 | + }; | |
| 48 | + if (!isValid(base)) throw new Error(`Cannot create prop based on invalid value: ${JSON.stringify(base)}`); | |
| 49 | + return { | |
| 50 | + $$type: key, | |
| 51 | + value: fn(base.value), | |
| 52 | + ...disabled && { disabled } | |
| 53 | + }; | |
| 54 | + } | |
| 55 | + function extract(prop) { | |
| 56 | + if (!isValid(prop)) return null; | |
| 57 | + return prop.value; | |
| 58 | + } | |
| 59 | + const propUtil = { | |
| 60 | + extract, | |
| 61 | + isValid, | |
| 62 | + create, | |
| 63 | + schema, | |
| 64 | + key | |
| 65 | + }; | |
| 66 | + SCHEMA_CACHE.set(key, propUtil); | |
| 67 | + return propUtil; | |
| 68 | + } | |
| 69 | + function createArrayPropUtils(key, valueSchema, overrideKey) { | |
| 70 | + return createPropUtils(overrideKey || `${key}-array`, _elementor_schema.z.array(valueSchema)); | |
| 71 | + } | |
| 72 | + | |
| 73 | +//#endregion | |
| 74 | +//#region packages/packages/libs/editor-props/src/prop-types/utils.ts | |
| 75 | + var unknownChildrenSchema = _elementor_schema.z.any().nullable(); | |
| 76 | + | |
| 77 | +//#endregion | |
| 78 | +//#region packages/packages/libs/editor-props/src/prop-types/shadow.ts | |
| 79 | + var shadowPropTypeUtil = createPropUtils("shadow", _elementor_schema.z.strictObject({ | |
| 80 | + position: unknownChildrenSchema, | |
| 81 | + hOffset: unknownChildrenSchema, | |
| 82 | + vOffset: unknownChildrenSchema, | |
| 83 | + blur: unknownChildrenSchema, | |
| 84 | + spread: unknownChildrenSchema, | |
| 85 | + color: unknownChildrenSchema | |
| 86 | + })); | |
| 87 | + | |
| 88 | +//#endregion | |
| 89 | +//#region packages/packages/libs/editor-props/src/prop-types/box-shadow.ts | |
| 90 | + var boxShadowPropTypeUtil = createPropUtils("box-shadow", _elementor_schema.z.array(shadowPropTypeUtil.schema)); | |
| 91 | + | |
| 92 | +//#endregion | |
| 93 | +//#region packages/packages/libs/editor-props/src/prop-types/border-radius.ts | |
| 94 | + var borderRadiusPropTypeUtil = createPropUtils("border-radius-v2", _elementor_schema.z.strictObject({ | |
| 95 | + "start-start": unknownChildrenSchema, | |
| 96 | + "start-end": unknownChildrenSchema, | |
| 97 | + "end-start": unknownChildrenSchema, | |
| 98 | + "end-end": unknownChildrenSchema | |
| 99 | + })); | |
| 100 | + | |
| 101 | +//#endregion | |
| 102 | +//#region packages/packages/libs/editor-props/src/prop-types/border-width.ts | |
| 103 | + var borderWidthPropTypeUtil = createPropUtils("border-width-v2", _elementor_schema.z.strictObject({ | |
| 104 | + "block-start": unknownChildrenSchema, | |
| 105 | + "block-end": unknownChildrenSchema, | |
| 106 | + "inline-start": unknownChildrenSchema, | |
| 107 | + "inline-end": unknownChildrenSchema | |
| 108 | + })); | |
| 109 | + | |
| 110 | +//#endregion | |
| 111 | +//#region packages/packages/libs/editor-props/src/prop-types/classes.ts | |
| 112 | + var CLASSES_PROP_KEY = "classes"; | |
| 113 | + var classesPropTypeUtil = createPropUtils(CLASSES_PROP_KEY, _elementor_schema.z.array(_elementor_schema.z.string().regex(/^[a-z][a-z-_0-9]*$/i))); | |
| 114 | + | |
| 115 | +//#endregion | |
| 116 | +//#region packages/packages/libs/editor-props/src/prop-types/color.ts | |
| 117 | + var colorPropTypeUtil = createPropUtils("color", _elementor_schema.z.string()); | |
| 118 | + | |
| 119 | +//#endregion | |
| 120 | +//#region packages/packages/libs/editor-props/src/prop-types/flex.ts | |
| 121 | + var flexPropTypeUtil = createPropUtils("flex", _elementor_schema.z.strictObject({ | |
| 122 | + flexGrow: unknownChildrenSchema, | |
| 123 | + flexShrink: unknownChildrenSchema, | |
| 124 | + flexBasis: unknownChildrenSchema | |
| 125 | + })); | |
| 126 | + | |
| 127 | +//#endregion | |
| 128 | +//#region packages/packages/libs/editor-props/src/prop-types/font-family.ts | |
| 129 | + var baseUtil = createPropUtils("font-family", _elementor_schema.z.string().nullable()); | |
| 130 | + var fontFamilyPropTypeUtil = Object.assign(baseUtil, { getEnqueueFontFamily: (value) => { | |
| 131 | + const trimmed = value.trim(); | |
| 132 | + if (trimmed.startsWith("\"") && trimmed.endsWith("\"") || trimmed.startsWith("'") && trimmed.endsWith("'")) return trimmed.slice(1, -1).trim(); | |
| 133 | + return trimmed; | |
| 134 | + } }); | |
| 135 | + | |
| 136 | +//#endregion | |
| 137 | +//#region packages/packages/libs/editor-props/src/prop-types/image.ts | |
| 138 | + var imagePropTypeUtil = createPropUtils("image", _elementor_schema.z.strictObject({ | |
| 139 | + src: unknownChildrenSchema, | |
| 140 | + size: unknownChildrenSchema | |
| 141 | + })); | |
| 142 | + | |
| 143 | +//#endregion | |
| 144 | +//#region packages/packages/libs/editor-props/src/prop-types/image-attachment-id.ts | |
| 145 | + var imageAttachmentIdPropType = createPropUtils("image-attachment-id", _elementor_schema.z.number()); | |
| 146 | + | |
| 147 | +//#endregion | |
| 148 | +//#region packages/packages/libs/editor-props/src/prop-types/image-src.ts | |
| 149 | + var imageSrcPropTypeUtil = createPropUtils("image-src", _elementor_schema.z.strictObject({ | |
| 150 | + id: unknownChildrenSchema, | |
| 151 | + url: _elementor_schema.z.null(), | |
| 152 | + alt: unknownChildrenSchema.optional().default(null) | |
| 153 | + }).or(_elementor_schema.z.strictObject({ | |
| 154 | + id: unknownChildrenSchema.optional().default(null), | |
| 155 | + url: unknownChildrenSchema, | |
| 156 | + alt: unknownChildrenSchema.optional().default(null) | |
| 157 | + }))); | |
| 158 | + | |
| 159 | +//#endregion | |
| 160 | +//#region packages/packages/libs/editor-props/src/prop-types/icon.ts | |
| 161 | + var iconPropTypeUtil = createPropUtils("icon", _elementor_schema.z.strictObject({ | |
| 162 | + value: unknownChildrenSchema, | |
| 163 | + library: unknownChildrenSchema | |
| 164 | + })); | |
| 165 | + | |
| 166 | +//#endregion | |
| 167 | +//#region packages/packages/libs/editor-props/src/prop-types/svg-src.ts | |
| 168 | + var svgSrcValueSchema = _elementor_schema.z.strictObject({ | |
| 169 | + id: unknownChildrenSchema, | |
| 170 | + url: _elementor_schema.z.null() | |
| 171 | + }).or(_elementor_schema.z.strictObject({ | |
| 172 | + id: _elementor_schema.z.null(), | |
| 173 | + url: unknownChildrenSchema | |
| 174 | + })).or(_elementor_schema.z.strictObject({ | |
| 175 | + id: unknownChildrenSchema, | |
| 176 | + url: unknownChildrenSchema | |
| 177 | + })); | |
| 178 | + var svgSrcPropTypeUtil = createPropUtils("svg-src", svgSrcValueSchema); | |
| 179 | + | |
| 180 | +//#endregion | |
| 181 | +//#region packages/packages/libs/editor-props/src/prop-types/video-attachment-id.ts | |
| 182 | + var videoAttachmentIdPropType = createPropUtils("video-attachment-id", _elementor_schema.z.number()); | |
| 183 | + | |
| 184 | +//#endregion | |
| 185 | +//#region packages/packages/libs/editor-props/src/prop-types/video-src.ts | |
| 186 | + var videoSrcPropTypeUtil = createPropUtils("video-src", _elementor_schema.z.strictObject({ | |
| 187 | + id: unknownChildrenSchema, | |
| 188 | + url: _elementor_schema.z.literal(null).optional() | |
| 189 | + }).or(_elementor_schema.z.strictObject({ | |
| 190 | + id: _elementor_schema.z.literal(null).optional(), | |
| 191 | + url: unknownChildrenSchema | |
| 192 | + }))); | |
| 193 | + | |
| 194 | +//#endregion | |
| 195 | +//#region packages/packages/libs/editor-props/src/prop-types/dimensions.ts | |
| 196 | + var dimensionsPropTypeUtil = createPropUtils("dimensions", _elementor_schema.z.strictObject({ | |
| 197 | + "block-start": unknownChildrenSchema, | |
| 198 | + "block-end": unknownChildrenSchema, | |
| 199 | + "inline-start": unknownChildrenSchema, | |
| 200 | + "inline-end": unknownChildrenSchema | |
| 201 | + })); | |
| 202 | + | |
| 203 | +//#endregion | |
| 204 | +//#region packages/packages/libs/editor-props/src/prop-types/number.ts | |
| 205 | + var numberPropTypeUtil = createPropUtils("number", _elementor_schema.z.number().nullable()); | |
| 206 | + | |
| 207 | +//#endregion | |
| 208 | +//#region packages/packages/libs/editor-props/src/prop-types/size.ts | |
| 209 | + var sizeNumberOrEmpty = _elementor_schema.z.union([_elementor_schema.z.number(), _elementor_schema.z.literal("")]); | |
| 210 | + var sizePropTypeUtil = createPropUtils("size", _elementor_schema.z.strictObject({ | |
| 211 | + unit: _elementor_schema.z.enum([ | |
| 212 | + "px", | |
| 213 | + "em", | |
| 214 | + "rem", | |
| 215 | + "%", | |
| 216 | + "vw", | |
| 217 | + "vh", | |
| 218 | + "ch", | |
| 219 | + "fr" | |
| 220 | + ]), | |
| 221 | + size: sizeNumberOrEmpty | |
| 222 | + }).or(_elementor_schema.z.strictObject({ | |
| 223 | + unit: _elementor_schema.z.enum([ | |
| 224 | + "deg", | |
| 225 | + "rad", | |
| 226 | + "grad", | |
| 227 | + "turn" | |
| 228 | + ]), | |
| 229 | + size: sizeNumberOrEmpty | |
| 230 | + })).or(_elementor_schema.z.strictObject({ | |
| 231 | + unit: _elementor_schema.z.enum(["s", "ms"]), | |
| 232 | + size: sizeNumberOrEmpty | |
| 233 | + })).or(_elementor_schema.z.strictObject({ | |
| 234 | + unit: _elementor_schema.z.literal("auto"), | |
| 235 | + size: _elementor_schema.z.literal("") | |
| 236 | + })).or(_elementor_schema.z.strictObject({ | |
| 237 | + unit: _elementor_schema.z.literal("custom"), | |
| 238 | + size: _elementor_schema.z.string() | |
| 239 | + }))); | |
| 240 | + | |
| 241 | +//#endregion | |
| 242 | +//#region packages/packages/libs/editor-props/src/prop-types/grid-track-size.ts | |
| 243 | + var gridTrackSizePropTypeUtil = createPropUtils("grid-track-size", _elementor_schema.z.strictObject({ | |
| 244 | + unit: _elementor_schema.z.literal("fr"), | |
| 245 | + size: _elementor_schema.z.union([_elementor_schema.z.number(), _elementor_schema.z.literal("")]) | |
| 246 | + }).or(_elementor_schema.z.strictObject({ | |
| 247 | + unit: _elementor_schema.z.literal("custom"), | |
| 248 | + size: _elementor_schema.z.string() | |
| 249 | + }))); | |
| 250 | + | |
| 251 | +//#endregion | |
| 252 | +//#region packages/packages/libs/editor-props/src/prop-types/span.ts | |
| 253 | + var spanPropTypeUtil = createPropUtils("span", _elementor_schema.z.string().nullable()); | |
| 254 | + | |
| 255 | +//#endregion | |
| 256 | +//#region packages/packages/libs/editor-props/src/prop-types/string.ts | |
| 257 | + var stringPropTypeUtil = createPropUtils("string", _elementor_schema.z.string().nullable()); | |
| 258 | + | |
| 259 | +//#endregion | |
| 260 | +//#region packages/packages/libs/editor-props/src/prop-types/string-array.ts | |
| 261 | + var stringArrayPropTypeUtil = createArrayPropUtils(stringPropTypeUtil.key, stringPropTypeUtil.schema); | |
| 262 | + | |
| 263 | +//#endregion | |
| 264 | +//#region packages/packages/libs/editor-props/src/prop-types/stroke.ts | |
| 265 | + var strokePropTypeUtil = createPropUtils("stroke", _elementor_schema.z.strictObject({ | |
| 266 | + color: unknownChildrenSchema, | |
| 267 | + width: unknownChildrenSchema | |
| 268 | + })); | |
| 269 | + | |
| 270 | +//#endregion | |
| 271 | +//#region packages/packages/libs/editor-props/src/prop-types/url.ts | |
| 272 | + var urlPropTypeUtil = createPropUtils("url", _elementor_schema.z.string().nullable()); | |
| 273 | + | |
| 274 | +//#endregion | |
| 275 | +//#region packages/packages/libs/editor-props/src/prop-types/layout-direction.ts | |
| 276 | + var layoutDirectionPropTypeUtil = createPropUtils("layout-direction", _elementor_schema.z.object({ | |
| 277 | + row: _elementor_schema.z.any(), | |
| 278 | + column: _elementor_schema.z.any() | |
| 279 | + })); | |
| 280 | + | |
| 281 | +//#endregion | |
| 282 | +//#region packages/packages/libs/editor-props/src/prop-types/link.ts | |
| 283 | + var linkPropTypeUtil = createPropUtils("link", _elementor_schema.z.strictObject({ | |
| 284 | + destination: unknownChildrenSchema, | |
| 285 | + isTargetBlank: unknownChildrenSchema, | |
| 286 | + tag: unknownChildrenSchema | |
| 287 | + })); | |
| 288 | + | |
| 289 | +//#endregion | |
| 290 | +//#region packages/packages/libs/editor-props/src/prop-types/email.ts | |
| 291 | + var emailPropTypeUtil = createPropUtils("email", _elementor_schema.z.strictObject({ | |
| 292 | + to: unknownChildrenSchema, | |
| 293 | + subject: unknownChildrenSchema, | |
| 294 | + message: unknownChildrenSchema, | |
| 295 | + from: unknownChildrenSchema, | |
| 296 | + "meta-data": unknownChildrenSchema, | |
| 297 | + "send-as": unknownChildrenSchema, | |
| 298 | + "from-name": unknownChildrenSchema, | |
| 299 | + "reply-to": unknownChildrenSchema, | |
| 300 | + cc: unknownChildrenSchema, | |
| 301 | + bcc: unknownChildrenSchema | |
| 302 | + })); | |
| 303 | + | |
| 304 | +//#endregion | |
| 305 | +//#region packages/packages/libs/editor-props/src/prop-types/emails.ts | |
| 306 | + var emailsPropTypeUtil = createPropUtils("emails", _elementor_schema.z.strictObject({ | |
| 307 | + to: unknownChildrenSchema, | |
| 308 | + subject: unknownChildrenSchema, | |
| 309 | + message: unknownChildrenSchema, | |
| 310 | + from: unknownChildrenSchema, | |
| 311 | + "meta-data": unknownChildrenSchema, | |
| 312 | + "send-as": unknownChildrenSchema, | |
| 313 | + "from-name": unknownChildrenSchema, | |
| 314 | + "reply-to": unknownChildrenSchema, | |
| 315 | + cc: unknownChildrenSchema, | |
| 316 | + bcc: unknownChildrenSchema | |
| 317 | + })); | |
| 318 | + | |
| 319 | +//#endregion | |
| 320 | +//#region packages/packages/libs/editor-props/src/prop-types/key-value.ts | |
| 321 | + var keyValuePropTypeUtil = createPropUtils("key-value", _elementor_schema.z.strictObject({ | |
| 322 | + key: unknownChildrenSchema, | |
| 323 | + value: unknownChildrenSchema | |
| 324 | + })); | |
| 325 | + | |
| 326 | +//#endregion | |
| 327 | +//#region packages/packages/libs/editor-props/src/prop-types/selection-size.ts | |
| 328 | + var selectionSizePropTypeUtil = createPropUtils("selection-size", _elementor_schema.z.strictObject({ | |
| 329 | + selection: _elementor_schema.z.union([keyValuePropTypeUtil.schema, stringPropTypeUtil.schema]), | |
| 330 | + size: unknownChildrenSchema | |
| 331 | + })); | |
| 332 | + | |
| 333 | +//#endregion | |
| 334 | +//#region packages/packages/libs/editor-props/src/prop-types/background-prop-types/background.ts | |
| 335 | + var backgroundPropTypeUtil = createPropUtils("background", _elementor_schema.z.strictObject({ | |
| 336 | + color: unknownChildrenSchema, | |
| 337 | + clip: unknownChildrenSchema, | |
| 338 | + "background-overlay": unknownChildrenSchema | |
| 339 | + })); | |
| 340 | + | |
| 341 | +//#endregion | |
| 342 | +//#region packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-color-overlay.ts | |
| 343 | + var backgroundColorOverlayPropTypeUtil = createPropUtils("background-color-overlay", unknownChildrenSchema); | |
| 344 | + | |
| 345 | +//#endregion | |
| 346 | +//#region packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-gradient-overlay.ts | |
| 347 | + var backgroundGradientOverlayPropTypeUtil = createPropUtils("background-gradient-overlay", unknownChildrenSchema); | |
| 348 | + | |
| 349 | +//#endregion | |
| 350 | +//#region packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-image-overlay.ts | |
| 351 | + var backgroundImageOverlayPropTypeUtil = createPropUtils("background-image-overlay", unknownChildrenSchema); | |
| 352 | + | |
| 353 | +//#endregion | |
| 354 | +//#region packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-overlay.ts | |
| 355 | + var backgroundOverlayItem = backgroundColorOverlayPropTypeUtil.schema.or(backgroundGradientOverlayPropTypeUtil.schema).or(backgroundImageOverlayPropTypeUtil.schema); | |
| 356 | + var backgroundOverlayPropTypeUtil = createPropUtils("background-overlay", _elementor_schema.z.array(backgroundOverlayItem)); | |
| 357 | + | |
| 358 | +//#endregion | |
| 359 | +//#region packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-image-position-offset.ts | |
| 360 | + var backgroundImagePositionOffsetPropTypeUtil = createPropUtils("background-image-position-offset", unknownChildrenSchema); | |
| 361 | + | |
| 362 | +//#endregion | |
| 363 | +//#region packages/packages/libs/editor-props/src/prop-types/background-prop-types/background-image-size-scale.ts | |
| 364 | + var backgroundImageSizeScalePropTypeUtil = createPropUtils("background-image-size-scale", unknownChildrenSchema); | |
| 365 | + | |
| 366 | +//#endregion | |
| 367 | +//#region packages/packages/libs/editor-props/src/prop-types/boolean.ts | |
| 368 | + var booleanPropTypeUtil = createPropUtils("boolean", _elementor_schema.z.boolean().nullable()); | |
| 369 | + | |
| 370 | +//#endregion | |
| 371 | +//#region packages/packages/libs/editor-props/src/prop-types/color-stop.ts | |
| 372 | + var colorStopPropTypeUtil = createPropUtils("color-stop", _elementor_schema.z.strictObject({ | |
| 373 | + color: unknownChildrenSchema, | |
| 374 | + offset: unknownChildrenSchema | |
| 375 | + })); | |
| 376 | + | |
| 377 | +//#endregion | |
| 378 | +//#region packages/packages/libs/editor-props/src/prop-types/gradient-color-stop.ts | |
| 379 | + var gradientColorStopPropTypeUtil = createPropUtils("gradient-color-stop", _elementor_schema.z.array(colorStopPropTypeUtil.schema)); | |
| 380 | + | |
| 381 | +//#endregion | |
| 382 | +//#region packages/packages/libs/editor-props/src/prop-types/number-range.ts | |
| 383 | + var numberRangePropTypeUtil = createPropUtils("number-range", _elementor_schema.z.strictObject({ | |
| 384 | + min: unknownChildrenSchema, | |
| 385 | + max: unknownChildrenSchema | |
| 386 | + })); | |
| 387 | + | |
| 388 | +//#endregion | |
| 389 | +//#region packages/packages/libs/editor-props/src/prop-types/date-time.ts | |
| 390 | + var DateTimePropTypeUtil = createPropUtils("date-time", _elementor_schema.z.strictObject({ | |
| 391 | + date: unknownChildrenSchema, | |
| 392 | + time: unknownChildrenSchema | |
| 393 | + })); | |
| 394 | + | |
| 395 | +//#endregion | |
| 396 | +//#region packages/packages/libs/editor-props/src/prop-types/position.ts | |
| 397 | + var positionPropTypeUtil = createPropUtils("object-position", _elementor_schema.z.strictObject({ | |
| 398 | + x: unknownChildrenSchema, | |
| 399 | + y: unknownChildrenSchema | |
| 400 | + })); | |
| 401 | + | |
| 402 | +//#endregion | |
| 403 | +//#region packages/packages/libs/editor-props/src/prop-types/query.ts | |
| 404 | + var queryPropTypeUtil = createPropUtils("query", _elementor_schema.z.strictObject({ | |
| 405 | + id: unknownChildrenSchema, | |
| 406 | + label: unknownChildrenSchema | |
| 407 | + })); | |
| 408 | + | |
| 409 | +//#endregion | |
| 410 | +//#region packages/packages/libs/editor-props/src/prop-types/query-filter.ts | |
| 411 | + var queryFilterPropTypeUtil = createPropUtils("query-filter", _elementor_schema.z.strictObject({ | |
| 412 | + key: unknownChildrenSchema, | |
| 413 | + values: unknownChildrenSchema, | |
| 414 | + taxonomies: unknownChildrenSchema | |
| 415 | + })); | |
| 416 | + var queryFilterArrayPropTypeUtil = createArrayPropUtils(queryFilterPropTypeUtil.key, queryFilterPropTypeUtil.schema); | |
| 417 | + | |
| 418 | +//#endregion | |
| 419 | +//#region packages/packages/libs/editor-props/src/prop-types/html.ts | |
| 420 | + var htmlPropTypeUtil = createPropUtils("html", _elementor_schema.z.string().nullable()); | |
| 421 | + | |
| 422 | +//#endregion | |
| 423 | +//#region packages/packages/libs/editor-props/src/prop-types/html-v2.ts | |
| 424 | + var childElementSchema = _elementor_schema.z.lazy(() => _elementor_schema.z.object({ | |
| 425 | + id: _elementor_schema.z.string(), | |
| 426 | + type: _elementor_schema.z.string(), | |
| 427 | + content: _elementor_schema.z.string().optional(), | |
| 428 | + children: _elementor_schema.z.array(childElementSchema).optional() | |
| 429 | + })); | |
| 430 | + var htmlV2ValueSchema = _elementor_schema.z.object({ | |
| 431 | + content: _elementor_schema.z.string().nullable(), | |
| 432 | + children: _elementor_schema.z.array(childElementSchema) | |
| 433 | + }); | |
| 434 | + var htmlV2PropTypeUtil = createPropUtils("html-v2", htmlV2ValueSchema); | |
| 435 | + | |
| 436 | +//#endregion | |
| 437 | +//#region packages/packages/libs/editor-props/src/prop-types/html-v3.ts | |
| 438 | + var htmlV3ValueSchema = _elementor_schema.z.object({ | |
| 439 | + content: stringPropTypeUtil.schema.nullable(), | |
| 440 | + children: _elementor_schema.z.array(_elementor_schema.z.unknown()) | |
| 441 | + }); | |
| 442 | + var htmlV3PropTypeUtil = createPropUtils("html-v3", htmlV3ValueSchema); | |
| 443 | + | |
| 444 | +//#endregion | |
| 445 | +//#region packages/packages/libs/editor-props/src/prop-types/escaped-html.ts | |
| 446 | + var escapedHtmlPropTypeUtil = createPropUtils("escaped-html", _elementor_schema.z.string().nullable()); | |
| 447 | + | |
| 448 | +//#endregion | |
| 449 | +//#region packages/packages/libs/editor-props/src/prop-types/filter-prop-types/drop-shadow-filter.ts | |
| 450 | + var dropShadowFilterPropTypeUtil = createPropUtils("drop-shadow", _elementor_schema.z.object({ | |
| 451 | + xAxis: unknownChildrenSchema, | |
| 452 | + yAxis: unknownChildrenSchema, | |
| 453 | + blur: unknownChildrenSchema, | |
| 454 | + color: unknownChildrenSchema | |
| 455 | + })); | |
| 456 | + | |
| 457 | +//#endregion | |
| 458 | +//#region packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/blur-filter.ts | |
| 459 | + var blurFilterPropTypeUtil = createPropUtils("blur", _elementor_schema.z.strictObject({ size: unknownChildrenSchema })); | |
| 460 | + | |
| 461 | +//#endregion | |
| 462 | +//#region packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/color-tone-filter.ts | |
| 463 | + var colorToneFilterPropTypeUtil = createPropUtils("color-tone", _elementor_schema.z.strictObject({ size: unknownChildrenSchema })); | |
| 464 | + | |
| 465 | +//#endregion | |
| 466 | +//#region packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/hue-rotate-filter.ts | |
| 467 | + var hueRotateFilterPropTypeUtil = createPropUtils("hue-rotate", _elementor_schema.z.strictObject({ size: unknownChildrenSchema })); | |
| 468 | + | |
| 469 | +//#endregion | |
| 470 | +//#region packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter-functions/intensity-filter.ts | |
| 471 | + var intensityFilterPropTypeUtil = createPropUtils("intensity", _elementor_schema.z.strictObject({ size: unknownChildrenSchema })); | |
| 472 | + | |
| 473 | +//#endregion | |
| 474 | +//#region packages/packages/libs/editor-props/src/prop-types/filter-prop-types/filter.ts | |
| 475 | + var cssFilterFunctionPropUtil = createPropUtils("css-filter-func", _elementor_schema.z.object({ | |
| 476 | + func: stringPropTypeUtil.schema, | |
| 477 | + args: _elementor_schema.z.union([ | |
| 478 | + blurFilterPropTypeUtil.schema, | |
| 479 | + intensityFilterPropTypeUtil.schema, | |
| 480 | + colorToneFilterPropTypeUtil.schema, | |
| 481 | + hueRotateFilterPropTypeUtil.schema, | |
| 482 | + dropShadowFilterPropTypeUtil.schema | |
| 483 | + ]) | |
| 484 | + })); | |
| 485 | + var filterPropTypeUtil = createPropUtils("filter", _elementor_schema.z.array(cssFilterFunctionPropUtil.schema)); | |
| 486 | + | |
| 487 | +//#endregion | |
| 488 | +//#region packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform.ts | |
| 489 | + var transformPropTypeUtil = createPropUtils("transform", _elementor_schema.z.strictObject({ | |
| 490 | + "transform-functions": unknownChildrenSchema, | |
| 491 | + "transform-origin": unknownChildrenSchema, | |
| 492 | + perspective: unknownChildrenSchema, | |
| 493 | + "perspective-origin": unknownChildrenSchema | |
| 494 | + })); | |
| 495 | + | |
| 496 | +//#endregion | |
| 497 | +//#region packages/packages/libs/editor-props/src/prop-types/transform-prop-types/types.ts | |
| 498 | + var TransformFunctionKeys = { | |
| 499 | + move: "transform-move", | |
| 500 | + scale: "transform-scale", | |
| 501 | + rotate: "transform-rotate", | |
| 502 | + skew: "transform-skew" | |
| 503 | + }; | |
| 504 | + | |
| 505 | +//#endregion | |
| 506 | +//#region packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/move-transform.ts | |
| 507 | + var moveTransformPropTypeUtil = createPropUtils(TransformFunctionKeys.move, _elementor_schema.z.strictObject({ | |
| 508 | + x: unknownChildrenSchema, | |
| 509 | + y: unknownChildrenSchema, | |
| 510 | + z: unknownChildrenSchema | |
| 511 | + })); | |
| 512 | + | |
| 513 | +//#endregion | |
| 514 | +//#region packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/rotate-transform.ts | |
| 515 | + var rotateTransformPropTypeUtil = createPropUtils(TransformFunctionKeys.rotate, _elementor_schema.z.strictObject({ | |
| 516 | + x: unknownChildrenSchema, | |
| 517 | + y: unknownChildrenSchema, | |
| 518 | + z: unknownChildrenSchema | |
| 519 | + })); | |
| 520 | + | |
| 521 | +//#endregion | |
| 522 | +//#region packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/scale-transform.ts | |
| 523 | + var scaleTransformPropTypeUtil = createPropUtils(TransformFunctionKeys.scale, _elementor_schema.z.strictObject({ | |
| 524 | + x: numberPropTypeUtil.schema.nullable(), | |
| 525 | + y: numberPropTypeUtil.schema.nullable(), | |
| 526 | + z: numberPropTypeUtil.schema.nullable() | |
| 527 | + })); | |
| 528 | + | |
| 529 | +//#endregion | |
| 530 | +//#region packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions/skew-transform.ts | |
| 531 | + var skewTransformPropTypeUtil = createPropUtils(TransformFunctionKeys.skew, _elementor_schema.z.strictObject({ | |
| 532 | + x: unknownChildrenSchema, | |
| 533 | + y: unknownChildrenSchema | |
| 534 | + })); | |
| 535 | + | |
| 536 | +//#endregion | |
| 537 | +//#region packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-functions.ts | |
| 538 | + var filterTypes = moveTransformPropTypeUtil.schema.or(scaleTransformPropTypeUtil.schema).or(rotateTransformPropTypeUtil.schema).or(skewTransformPropTypeUtil.schema); | |
| 539 | + var transformFunctionsPropTypeUtil = createPropUtils("transform-functions", _elementor_schema.z.array(filterTypes)); | |
| 540 | + | |
| 541 | +//#endregion | |
| 542 | +//#region packages/packages/libs/editor-props/src/prop-types/transform-prop-types/transform-origin.ts | |
| 543 | + var transformOriginPropTypeUtil = createPropUtils("transform-origin", _elementor_schema.z.strictObject({ | |
| 544 | + x: unknownChildrenSchema, | |
| 545 | + y: unknownChildrenSchema, | |
| 546 | + z: unknownChildrenSchema | |
| 547 | + })); | |
| 548 | + | |
| 549 | +//#endregion | |
| 550 | +//#region packages/packages/libs/editor-props/src/prop-types/transform-prop-types/perspective-origin.ts | |
| 551 | + var perspectiveOriginPropTypeUtil = createPropUtils("perspective-origin", _elementor_schema.z.strictObject({ | |
| 552 | + x: unknownChildrenSchema, | |
| 553 | + y: unknownChildrenSchema | |
| 554 | + })); | |
| 555 | + | |
| 556 | +//#endregion | |
| 557 | +//#region packages/packages/libs/editor-props/src/prop-types/filter-prop-types/backdrop-filter.ts | |
| 558 | + var backdropFilterPropTypeUtil = createPropUtils("backdrop-filter", _elementor_schema.z.array(cssFilterFunctionPropUtil.schema)); | |
| 559 | + | |
| 560 | +//#endregion | |
| 561 | +//#region packages/packages/libs/editor-props/src/prop-types/date-range.ts | |
| 562 | + var dateRangePropTypeUtil = createPropUtils("date-range", _elementor_schema.z.strictObject({ | |
| 563 | + min: unknownChildrenSchema, | |
| 564 | + max: unknownChildrenSchema | |
| 565 | + })); | |
| 566 | + | |
| 567 | +//#endregion | |
| 568 | +//#region packages/packages/libs/editor-props/src/prop-types/date-string.ts | |
| 569 | + var dateStringPropTypeUtil = createPropUtils("date-string", _elementor_schema.z.string()); | |
| 570 | + | |
| 571 | +//#endregion | |
| 572 | +//#region packages/packages/libs/editor-props/src/prop-types/time-range.ts | |
| 573 | + var timeRangePropTypeUtil = createPropUtils("time-range", _elementor_schema.z.strictObject({ | |
| 574 | + min: unknownChildrenSchema, | |
| 575 | + max: unknownChildrenSchema | |
| 576 | + })); | |
| 577 | + | |
| 578 | +//#endregion | |
| 579 | +//#region packages/packages/libs/editor-props/src/prop-types/time-string.ts | |
| 580 | + var timeStringPropTypeUtil = createPropUtils("time-string", _elementor_schema.z.string()); | |
| 581 | + | |
| 582 | +//#endregion | |
| 583 | +//#region packages/packages/libs/editor-props/src/utils/adjust-llm-prop-value-schema.ts | |
| 584 | + var ensureNotNull = (v, fallback) => v === null ? fallback : v; | |
| 585 | + var defaultOptions = { transformers: {} }; | |
| 586 | + var adjustLlmPropValueSchema = (value, { transformers = {}, forceKey = void 0 } = defaultOptions) => { | |
| 587 | + const clone = structuredClone(value); | |
| 588 | + if (typeof clone !== "object" || clone === null) return null; | |
| 589 | + if (Array.isArray(clone)) return clone.map((item) => adjustLlmPropValueSchema(item, { | |
| 590 | + forceKey, | |
| 591 | + transformers | |
| 592 | + })); | |
| 593 | + const transformablePropValue = clone; | |
| 594 | + if ("$intention" in transformablePropValue) delete transformablePropValue.$intention; | |
| 595 | + if (forceKey) transformablePropValue.$$type = forceKey; | |
| 596 | + switch (transformablePropValue.$$type) { | |
| 597 | + case "size": { | |
| 598 | + const { value: rawSizePropValue } = transformablePropValue; | |
| 599 | + return { | |
| 600 | + $$type: "size", | |
| 601 | + value: { | |
| 602 | + unit: typeof rawSizePropValue.unit === "string" ? rawSizePropValue.unit : ensureNotNull(stringPropTypeUtil.extract(rawSizePropValue.unit), "px"), | |
| 603 | + size: typeof rawSizePropValue.size === "string" || typeof rawSizePropValue.size === "number" ? rawSizePropValue.size : ensureNotNull(stringPropTypeUtil.extract(rawSizePropValue.size), numberPropTypeUtil.extract(rawSizePropValue.size)) | |
| 604 | + } | |
| 605 | + }; | |
| 606 | + } | |
| 607 | + case "html-v3": { | |
| 608 | + const { value: rawHtmlV3PropValue } = transformablePropValue; | |
| 609 | + return { | |
| 610 | + $$type: "html-v3", | |
| 611 | + value: { | |
| 612 | + ...rawHtmlV3PropValue, | |
| 613 | + children: Array.isArray(rawHtmlV3PropValue.children) ? rawHtmlV3PropValue.children : [] | |
| 614 | + } | |
| 615 | + }; | |
| 616 | + } | |
| 617 | + default: | |
| 618 | + const transformer = transformers?.[transformablePropValue.$$type]; | |
| 619 | + if (transformer) return transformer(transformablePropValue.value); | |
| 620 | + } | |
| 621 | + if (typeof transformablePropValue.value === "object") if (Array.isArray(transformablePropValue.value)) transformablePropValue.value = adjustLlmPropValueSchema(transformablePropValue.value, { transformers }); | |
| 622 | + else { | |
| 623 | + const { value: objectValue } = transformablePropValue; | |
| 624 | + const clonedObject = clone; | |
| 625 | + clonedObject.value = {}; | |
| 626 | + Object.entries(objectValue).forEach(([key, childProp]) => { | |
| 627 | + clonedObject.value[key] = adjustLlmPropValueSchema(childProp, { transformers }); | |
| 628 | + }); | |
| 629 | + } | |
| 630 | + return clone; | |
| 631 | + }; | |
| 632 | + | |
| 633 | +//#endregion | |
| 634 | +//#region packages/packages/libs/editor-props/src/utils/llm-schema-to-props.ts | |
| 635 | + function jsonSchemaToPropType(schema, key = schema.key) { | |
| 636 | + const meta = {}; | |
| 637 | + if (schema.description) meta.description = schema.description; | |
| 638 | + if (schema.anyOf && Array.isArray(schema.anyOf)) return convertJsonSchemaToUnionPropType(schema, meta); | |
| 639 | + if (schema.type === "object" && schema.properties) return convertJsonSchemaToObjectPropType(schema, meta, key); | |
| 640 | + if (schema.type === "array" && schema.items) return convertJsonSchemaToArrayPropType(schema, meta, key); | |
| 641 | + return convertJsonSchemaToPlainPropType(schema, meta, key); | |
| 642 | + } | |
| 643 | + function convertJsonSchemaToPlainPropType(schema, meta, key = schema.key) { | |
| 644 | + const settings = {}; | |
| 645 | + let propKey = key || "string"; | |
| 646 | + if (schema.type === "number") propKey = "number"; | |
| 647 | + else if (schema.type === "boolean") propKey = "boolean"; | |
| 648 | + else if (schema.type === "string") propKey = "string"; | |
| 649 | + if (Array.isArray(schema.enum)) settings.enum = schema.enum; | |
| 650 | + return { | |
| 651 | + kind: "plain", | |
| 652 | + key: propKey, | |
| 653 | + settings, | |
| 654 | + meta | |
| 655 | + }; | |
| 656 | + } | |
| 657 | + function convertJsonSchemaToUnionPropType(schema, meta) { | |
| 658 | + const propTypes = {}; | |
| 659 | + if (!schema.anyOf || !Array.isArray(schema.anyOf)) throw new Error("Invalid anyOf schema"); | |
| 660 | + for (const variantSchema of schema.anyOf) if (variantSchema.type === "object" && variantSchema.properties && variantSchema.properties.$$type && variantSchema.properties.value) { | |
| 661 | + const typeProperty = variantSchema.properties.$$type; | |
| 662 | + let typeKey; | |
| 663 | + if (typeProperty.enum && Array.isArray(typeProperty.enum) && typeProperty.enum.length > 0) typeKey = typeProperty.enum[0]; | |
| 664 | + else continue; | |
| 665 | + propTypes[typeKey] = convertJsonSchemaToPropType(variantSchema.properties.value); | |
| 666 | + } | |
| 667 | + return { | |
| 668 | + kind: "union", | |
| 669 | + prop_types: propTypes, | |
| 670 | + settings: {}, | |
| 671 | + meta | |
| 672 | + }; | |
| 673 | + } | |
| 674 | + function convertJsonSchemaToObjectPropType(schema, meta, key = schema.key) { | |
| 675 | + const shape = {}; | |
| 676 | + if (!schema.properties) return { | |
| 677 | + kind: "object", | |
| 678 | + key, | |
| 679 | + shape: {}, | |
| 680 | + settings: {}, | |
| 681 | + meta | |
| 682 | + }; | |
| 683 | + const requiredFields = Array.isArray(schema.required) ? schema.required : []; | |
| 684 | + for (const [propKey, propSchema] of Object.entries(schema.properties)) { | |
| 685 | + const subPropType = convertJsonSchemaToPropType(propSchema, key); | |
| 686 | + if (requiredFields.includes(propKey)) subPropType.settings = { | |
| 687 | + ...subPropType.settings, | |
| 688 | + required: true | |
| 689 | + }; | |
| 690 | + shape[propKey] = subPropType; | |
| 691 | + } | |
| 692 | + return { | |
| 693 | + kind: "object", | |
| 694 | + key: key || "object", | |
| 695 | + shape, | |
| 696 | + settings: {}, | |
| 697 | + meta | |
| 698 | + }; | |
| 699 | + } | |
| 700 | + function convertJsonSchemaToArrayPropType(schema, meta, key = schema.key) { | |
| 701 | + if (!schema.items) throw new Error("Array schema must have items property"); | |
| 702 | + const itemPropType = convertJsonSchemaToPropType(schema.items); | |
| 703 | + return { | |
| 704 | + kind: "array", | |
| 705 | + key: key || "array", | |
| 706 | + item_prop_type: itemPropType, | |
| 707 | + settings: {}, | |
| 708 | + meta | |
| 709 | + }; | |
| 710 | + } | |
| 711 | + function convertJsonSchemaToPropType(schema, key) { | |
| 712 | + return jsonSchemaToPropType(schema, key); | |
| 713 | + } | |
| 714 | + | |
| 715 | +//#endregion | |
| 716 | +//#region packages/packages/libs/editor-props/src/utils/props-to-llm-schema.ts | |
| 717 | + var DYNAMIC_PROP_TYPE_KEY = "dynamic"; | |
| 718 | + var OVERRIDABLE_PROP_TYPE_KEY = "overridable"; | |
| 719 | + var dynamicTagNamesResolver = null; | |
| 720 | + function setDynamicTagNamesResolver(resolver) { | |
| 721 | + dynamicTagNamesResolver = resolver; | |
| 722 | + } | |
| 723 | + function propTypeToJsonSchema(propType, suppressDynamic = false) { | |
| 724 | + const description = propType.meta?.description; | |
| 725 | + const schema = {}; | |
| 726 | + if (description) schema.description = description; | |
| 727 | + if (propType.initial_value !== null && propType.initial_value !== void 0) schema.examples = [propType.initial_value]; | |
| 728 | + switch (propType.kind) { | |
| 729 | + case "union": return convertUnionPropType(propType, schema, suppressDynamic); | |
| 730 | + case "object": return convertObjectPropType(propType, schema, suppressDynamic); | |
| 731 | + case "array": return convertArrayPropType(propType, schema, suppressDynamic); | |
| 732 | + default: return convertPlainPropType(propType, schema); | |
| 733 | + } | |
| 734 | + } | |
| 735 | + function convertPlainPropType(propType, baseSchema) { | |
| 736 | + const schema = { ...baseSchema }; | |
| 737 | + if (!Object.hasOwn(propType, "kind")) throw new Error(`PropType kind is undefined for propType with key: ${propType.key ?? "[unknown key]"}`); | |
| 738 | + const enumValues = propType.settings?.enum || []; | |
| 739 | + switch (propType.kind) { | |
| 740 | + case "string": | |
| 741 | + case "number": | |
| 742 | + case "boolean": return { | |
| 743 | + ...schema, | |
| 744 | + type: "object", | |
| 745 | + properties: { | |
| 746 | + $$type: { | |
| 747 | + type: "string", | |
| 748 | + const: propType.key ?? propType.kind | |
| 749 | + }, | |
| 750 | + value: { | |
| 751 | + type: propType.kind, | |
| 752 | + ...enumValues.length > 0 ? { enum: enumValues } : {} | |
| 753 | + } | |
| 754 | + }, | |
| 755 | + required: ["$$type", "value"] | |
| 756 | + }; | |
| 757 | + case "unknown": return {}; | |
| 758 | + default: return { | |
| 759 | + ...schema, | |
| 760 | + type: "object", | |
| 761 | + $$type: propType.kind, | |
| 762 | + value: { type: propType.kind } | |
| 763 | + }; | |
| 764 | + } | |
| 765 | + } | |
| 766 | + function convertUnionPropType(propType, baseSchema, suppressDynamic) { | |
| 767 | + const schema = structuredClone(baseSchema); | |
| 768 | + const propTypes = propType.prop_types || {}; | |
| 769 | + const offersDynamic = !suppressDynamic && Boolean(propTypes[DYNAMIC_PROP_TYPE_KEY]); | |
| 770 | + const suppressNestedDynamic = suppressDynamic || offersDynamic; | |
| 771 | + const schemas = []; | |
| 772 | + for (const [typeKey, subPropType] of Object.entries(propTypes)) { | |
| 773 | + if (typeKey === OVERRIDABLE_PROP_TYPE_KEY) continue; | |
| 774 | + if (typeKey === DYNAMIC_PROP_TYPE_KEY) { | |
| 775 | + if (offersDynamic) schemas.push(convertDynamicPropType(subPropType)); | |
| 776 | + continue; | |
| 777 | + } | |
| 778 | + schemas.push(propTypeToJsonSchema(subPropType, suppressNestedDynamic)); | |
| 779 | + } | |
| 780 | + if (schemas.length > 0) schema.anyOf = schemas; | |
| 781 | + const propTypeDescription = propType.meta?.description; | |
| 782 | + if (propTypeDescription) schema.description = propTypeDescription; | |
| 783 | + return schema; | |
| 784 | + } | |
| 785 | + function convertDynamicPropType(propType) { | |
| 786 | + const categories = Array.isArray(propType.settings?.categories) ? propType.settings.categories : []; | |
| 787 | + const allowedTagNames = dynamicTagNamesResolver?.(categories) ?? []; | |
| 788 | + return { | |
| 789 | + type: "object", | |
| 790 | + description: `Bind THIS value to a dynamic tag instead of a static value (this may be a nested field, e.g. an image's "src"). Look up the chosen tag in the "elementor://dynamic-tags" resource and populate "settings" exactly as its schema requires.`, | |
| 791 | + properties: { | |
| 792 | + $$type: { | |
| 793 | + type: "string", | |
| 794 | + const: DYNAMIC_PROP_TYPE_KEY | |
| 795 | + }, | |
| 796 | + value: { | |
| 797 | + type: "object", | |
| 798 | + properties: { | |
| 799 | + name: { | |
| 800 | + type: "string", | |
| 801 | + description: "Dynamic tag name from \"elementor://dynamic-tags\".", | |
| 802 | + ...allowedTagNames.length ? { enum: allowedTagNames } : {} | |
| 803 | + }, | |
| 804 | + settings: { | |
| 805 | + type: "object", | |
| 806 | + description: "Tag settings matching the chosen tag's schema in the resource." | |
| 807 | + } | |
| 808 | + }, | |
| 809 | + required: ["name"] | |
| 810 | + } | |
| 811 | + }, | |
| 812 | + required: ["$$type", "value"] | |
| 813 | + }; | |
| 814 | + } | |
| 815 | + function convertObjectPropType(propType, baseSchema, suppressDynamic) { | |
| 816 | + const schema = structuredClone(baseSchema); | |
| 817 | + schema.type = "object"; | |
| 818 | + const internalStructure = { properties: { | |
| 819 | + $$type: { | |
| 820 | + type: "string", | |
| 821 | + const: propType.key | |
| 822 | + }, | |
| 823 | + value: { | |
| 824 | + type: "object", | |
| 825 | + properties: {}, | |
| 826 | + additionalProperties: false | |
| 827 | + } | |
| 828 | + } }; | |
| 829 | + const required = ["$$type", "value"]; | |
| 830 | + const valueRequired = []; | |
| 831 | + const shape = propType.shape || {}; | |
| 832 | + for (const [key, subPropType] of Object.entries(shape)) { | |
| 833 | + const propSchema = propTypeToJsonSchema(subPropType, suppressDynamic); | |
| 834 | + if (subPropType.settings?.required === true) valueRequired.push(key); | |
| 835 | + if (internalStructure.properties.value.properties) internalStructure.properties.value.properties[key] = propSchema; | |
| 836 | + } | |
| 837 | + schema.required = required; | |
| 838 | + if (valueRequired.length > 0) internalStructure.properties.value.required = valueRequired; | |
| 839 | + return { | |
| 840 | + ...schema, | |
| 841 | + ...internalStructure | |
| 842 | + }; | |
| 843 | + } | |
| 844 | + function convertArrayPropType(propType, baseSchema, suppressDynamic) { | |
| 845 | + const schema = structuredClone(baseSchema); | |
| 846 | + schema.type = "object"; | |
| 847 | + let items; | |
| 848 | + const itemPropType = propType.item_prop_type; | |
| 849 | + if (itemPropType) items = propTypeToJsonSchema(itemPropType, suppressDynamic); | |
| 850 | + schema.properties = { | |
| 851 | + $$type: { | |
| 852 | + type: "string", | |
| 853 | + const: propType.key | |
| 854 | + }, | |
| 855 | + value: { | |
| 856 | + type: "array", | |
| 857 | + ...items ? { items } : {} | |
| 858 | + } | |
| 859 | + }; | |
| 860 | + return schema; | |
| 861 | + } | |
| 862 | + var nonConfigurablePropKeys = [ | |
| 863 | + "_cssid", | |
| 864 | + "classes", | |
| 865 | + "attributes" | |
| 866 | + ]; | |
| 867 | + function isPropKeyConfigurable(propKey, propType) { | |
| 868 | + if (!nonConfigurablePropKeys.includes(propKey)) return true; | |
| 869 | + return !!(!Array.isArray(propType?.meta) && propType?.meta?.llm_configurable); | |
| 870 | + } | |
| 871 | + function configurableKeys(schema) { | |
| 872 | + return Object.keys(schema).filter((key) => isPropKeyConfigurable(key, schema[key])); | |
| 873 | + } | |
| 874 | + function enrichWithIntention(jsonSchema, text = "Describe the desired outcome") { | |
| 875 | + const result = structuredClone(jsonSchema); | |
| 876 | + if (!result.properties) return jsonSchema; | |
| 877 | + result.properties.$intention = { | |
| 878 | + type: "string", | |
| 879 | + description: text | |
| 880 | + }; | |
| 881 | + result.required = [...result.required || [], "$intention"]; | |
| 882 | + return result; | |
| 883 | + } | |
| 884 | + function removeIntention(jsonSchema) { | |
| 885 | + const result = structuredClone(jsonSchema); | |
| 886 | + if (!result.properties) return jsonSchema; | |
| 887 | + delete result.properties.$intention; | |
| 888 | + if (result.required) result.required = result.required.filter((req) => req !== "$intention"); | |
| 889 | + return result; | |
| 890 | + } | |
| 891 | + | |
| 892 | +//#endregion | |
| 893 | +//#region node_modules/jsonschema/lib/helpers.js | |
| 894 | + var require_helpers = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 895 | + var ValidationError = exports.ValidationError = function ValidationError(message, instance, schema, path, name, argument) { | |
| 896 | + if (Array.isArray(path)) { | |
| 897 | + this.path = path; | |
| 898 | + this.property = path.reduce(function(sum, item) { | |
| 899 | + return sum + makeSuffix(item); | |
| 900 | + }, "instance"); | |
| 901 | + } else if (path !== void 0) this.property = path; | |
| 902 | + if (message) this.message = message; | |
| 903 | + if (schema) { | |
| 904 | + var id = schema.$id || schema.id; | |
| 905 | + this.schema = id || schema; | |
| 906 | + } | |
| 907 | + if (instance !== void 0) this.instance = instance; | |
| 908 | + this.name = name; | |
| 909 | + this.argument = argument; | |
| 910 | + this.stack = this.toString(); | |
| 911 | + }; | |
| 912 | + ValidationError.prototype.toString = function toString() { | |
| 913 | + return this.property + " " + this.message; | |
| 914 | + }; | |
| 915 | + var ValidatorResult = exports.ValidatorResult = function ValidatorResult(instance, schema, options, ctx) { | |
| 916 | + this.instance = instance; | |
| 917 | + this.schema = schema; | |
| 918 | + this.options = options; | |
| 919 | + this.path = ctx.path; | |
| 920 | + this.propertyPath = ctx.propertyPath; | |
| 921 | + this.errors = []; | |
| 922 | + this.throwError = options && options.throwError; | |
| 923 | + this.throwFirst = options && options.throwFirst; | |
| 924 | + this.throwAll = options && options.throwAll; | |
| 925 | + this.disableFormat = options && options.disableFormat === true; | |
| 926 | + }; | |
| 927 | + ValidatorResult.prototype.addError = function addError(detail) { | |
| 928 | + var err; | |
| 929 | + if (typeof detail == "string") err = new ValidationError(detail, this.instance, this.schema, this.path); | |
| 930 | + else { | |
| 931 | + if (!detail) throw new Error("Missing error detail"); | |
| 932 | + if (!detail.message) throw new Error("Missing error message"); | |
| 933 | + if (!detail.name) throw new Error("Missing validator type"); | |
| 934 | + err = new ValidationError(detail.message, this.instance, this.schema, this.path, detail.name, detail.argument); | |
| 935 | + } | |
| 936 | + this.errors.push(err); | |
| 937 | + if (this.throwFirst) throw new ValidatorResultError(this); | |
| 938 | + else if (this.throwError) throw err; | |
| 939 | + return err; | |
| 940 | + }; | |
| 941 | + ValidatorResult.prototype.importErrors = function importErrors(res) { | |
| 942 | + if (typeof res == "string" || res && res.validatorType) this.addError(res); | |
| 943 | + else if (res && res.errors) this.errors = this.errors.concat(res.errors); | |
| 944 | + }; | |
| 945 | + function stringizer(v, i) { | |
| 946 | + return i + ": " + v.toString() + "\n"; | |
| 947 | + } | |
| 948 | + ValidatorResult.prototype.toString = function toString(res) { | |
| 949 | + return this.errors.map(stringizer).join(""); | |
| 950 | + }; | |
| 951 | + Object.defineProperty(ValidatorResult.prototype, "valid", { get: function() { | |
| 952 | + return !this.errors.length; | |
| 953 | + } }); | |
| 954 | + module.exports.ValidatorResultError = ValidatorResultError; | |
| 955 | + function ValidatorResultError(result) { | |
| 956 | + if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, ValidatorResultError); | |
| 957 | + this.instance = result.instance; | |
| 958 | + this.schema = result.schema; | |
| 959 | + this.options = result.options; | |
| 960 | + this.errors = result.errors; | |
| 961 | + } | |
| 962 | + ValidatorResultError.prototype = /* @__PURE__ */ new Error(); | |
| 963 | + ValidatorResultError.prototype.constructor = ValidatorResultError; | |
| 964 | + ValidatorResultError.prototype.name = "Validation Error"; | |
| 965 | + /** | |
| 966 | + * Describes a problem with a Schema which prevents validation of an instance | |
| 967 | + * @name SchemaError | |
| 968 | + * @constructor | |
| 969 | + */ | |
| 970 | + var SchemaError = exports.SchemaError = function SchemaError(msg, schema) { | |
| 971 | + this.message = msg; | |
| 972 | + this.schema = schema; | |
| 973 | + Error.call(this, msg); | |
| 974 | + if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, SchemaError); | |
| 975 | + }; | |
| 976 | + SchemaError.prototype = Object.create(Error.prototype, { | |
| 977 | + constructor: { | |
| 978 | + value: SchemaError, | |
| 979 | + enumerable: false | |
| 980 | + }, | |
| 981 | + name: { | |
| 982 | + value: "SchemaError", | |
| 983 | + enumerable: false | |
| 984 | + } | |
| 985 | + }); | |
| 986 | + var SchemaContext = exports.SchemaContext = function SchemaContext(schema, options, path, base, schemas) { | |
| 987 | + this.schema = schema; | |
| 988 | + this.options = options; | |
| 989 | + if (Array.isArray(path)) { | |
| 990 | + this.path = path; | |
| 991 | + this.propertyPath = path.reduce(function(sum, item) { | |
| 992 | + return sum + makeSuffix(item); | |
| 993 | + }, "instance"); | |
| 994 | + } else this.propertyPath = path; | |
| 995 | + this.base = base; | |
| 996 | + this.schemas = schemas; | |
| 997 | + }; | |
| 998 | + SchemaContext.prototype.resolve = function resolve(target) { | |
| 999 | + return (() => resolveUrl(this.base, target))(); | |
| 1000 | + }; | |
| 1001 | + SchemaContext.prototype.makeChild = function makeChild(schema, propertyName) { | |
| 1002 | + var path = propertyName === void 0 ? this.path : this.path.concat([propertyName]); | |
| 1003 | + var id = schema.$id || schema.id; | |
| 1004 | + let base = (() => resolveUrl(this.base, id || ""))(); | |
| 1005 | + var ctx = new SchemaContext(schema, this.options, path, base, Object.create(this.schemas)); | |
| 1006 | + if (id && !ctx.schemas[base]) ctx.schemas[base] = schema; | |
| 1007 | + return ctx; | |
| 1008 | + }; | |
| 1009 | + var FORMAT_REGEXPS = exports.FORMAT_REGEXPS = { | |
| 1010 | + "date-time": /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/, | |
| 1011 | + "date": /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/, | |
| 1012 | + "time": /^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/, | |
| 1013 | + "duration": /P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i, | |
| 1014 | + "email": /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/, | |
| 1015 | + "idn-email": /^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u, | |
| 1016 | + "ip-address": /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, | |
| 1017 | + "ipv6": /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/, | |
| 1018 | + "uri": /^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/, | |
| 1019 | + "uri-reference": /^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/, | |
| 1020 | + "iri": /^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/, | |
| 1021 | + "iri-reference": /^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u, | |
| 1022 | + "uuid": /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i, | |
| 1023 | + "uri-template": /(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu, | |
| 1024 | + "json-pointer": /^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu, | |
| 1025 | + "relative-json-pointer": /^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu, | |
| 1026 | + "hostname": /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/, | |
| 1027 | + "host-name": /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/, | |
| 1028 | + "utc-millisec": function(input) { | |
| 1029 | + return typeof input === "string" && parseFloat(input) === parseInt(input, 10) && !isNaN(input); | |
| 1030 | + }, | |
| 1031 | + "regex": function(input) { | |
| 1032 | + var result = true; | |
| 1033 | + try { | |
| 1034 | + new RegExp(input); | |
| 1035 | + } catch (e) { | |
| 1036 | + result = false; | |
| 1037 | + } | |
| 1038 | + return result; | |
| 1039 | + }, | |
| 1040 | + "style": /[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/, | |
| 1041 | + "color": /^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/, | |
| 1042 | + "phone": /^\+(?:[0-9] ?){6,14}[0-9]$/, | |
| 1043 | + "alpha": /^[a-zA-Z]+$/, | |
| 1044 | + "alphanumeric": /^[a-zA-Z0-9]+$/ | |
| 1045 | + }; | |
| 1046 | + FORMAT_REGEXPS.regexp = FORMAT_REGEXPS.regex; | |
| 1047 | + FORMAT_REGEXPS.pattern = FORMAT_REGEXPS.regex; | |
| 1048 | + FORMAT_REGEXPS.ipv4 = FORMAT_REGEXPS["ip-address"]; | |
| 1049 | + exports.isFormat = function isFormat(input, format, validator) { | |
| 1050 | + if (typeof input === "string" && FORMAT_REGEXPS[format] !== void 0) { | |
| 1051 | + if (FORMAT_REGEXPS[format] instanceof RegExp) return FORMAT_REGEXPS[format].test(input); | |
| 1052 | + if (typeof FORMAT_REGEXPS[format] === "function") return FORMAT_REGEXPS[format](input); | |
| 1053 | + } else if (validator && validator.customFormats && typeof validator.customFormats[format] === "function") return validator.customFormats[format](input); | |
| 1054 | + return true; | |
| 1055 | + }; | |
| 1056 | + var makeSuffix = exports.makeSuffix = function makeSuffix(key) { | |
| 1057 | + key = key.toString(); | |
| 1058 | + if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) return "." + key; | |
| 1059 | + if (key.match(/^\d+$/)) return "[" + key + "]"; | |
| 1060 | + return "[" + JSON.stringify(key) + "]"; | |
| 1061 | + }; | |
| 1062 | + exports.deepCompareStrict = function deepCompareStrict(a, b) { | |
| 1063 | + if (typeof a !== typeof b) return false; | |
| 1064 | + if (Array.isArray(a)) { | |
| 1065 | + if (!Array.isArray(b)) return false; | |
| 1066 | + if (a.length !== b.length) return false; | |
| 1067 | + return a.every(function(v, i) { | |
| 1068 | + return deepCompareStrict(a[i], b[i]); | |
| 1069 | + }); | |
| 1070 | + } | |
| 1071 | + if (typeof a === "object") { | |
| 1072 | + if (!a || !b) return a === b; | |
| 1073 | + var aKeys = Object.keys(a); | |
| 1074 | + var bKeys = Object.keys(b); | |
| 1075 | + if (aKeys.length !== bKeys.length) return false; | |
| 1076 | + return aKeys.every(function(v) { | |
| 1077 | + return deepCompareStrict(a[v], b[v]); | |
| 1078 | + }); | |
| 1079 | + } | |
| 1080 | + return a === b; | |
| 1081 | + }; | |
| 1082 | + function deepMerger(target, dst, e, i) { | |
| 1083 | + if (typeof e === "object") dst[i] = deepMerge(target[i], e); | |
| 1084 | + else if (target.indexOf(e) === -1) dst.push(e); | |
| 1085 | + } | |
| 1086 | + function copyist(src, dst, key) { | |
| 1087 | + dst[key] = src[key]; | |
| 1088 | + } | |
| 1089 | + function copyistWithDeepMerge(target, src, dst, key) { | |
| 1090 | + if (typeof src[key] !== "object" || !src[key]) dst[key] = src[key]; | |
| 1091 | + else if (!target[key]) dst[key] = src[key]; | |
| 1092 | + else dst[key] = deepMerge(target[key], src[key]); | |
| 1093 | + } | |
| 1094 | + function deepMerge(target, src) { | |
| 1095 | + var array = Array.isArray(src); | |
| 1096 | + var dst = array && [] || {}; | |
| 1097 | + if (array) { | |
| 1098 | + target = target || []; | |
| 1099 | + dst = dst.concat(target); | |
| 1100 | + src.forEach(deepMerger.bind(null, target, dst)); | |
| 1101 | + } else { | |
| 1102 | + if (target && typeof target === "object") Object.keys(target).forEach(copyist.bind(null, target, dst)); | |
| 1103 | + Object.keys(src).forEach(copyistWithDeepMerge.bind(null, target, src, dst)); | |
| 1104 | + } | |
| 1105 | + return dst; | |
| 1106 | + } | |
| 1107 | + module.exports.deepMerge = deepMerge; | |
| 1108 | + /** | |
| 1109 | + * Validates instance against the provided schema | |
| 1110 | + * Implements URI+JSON Pointer encoding, e.g. "%7e"="~0"=>"~", "~1"="%2f"=>"/" | |
| 1111 | + * @param o | |
| 1112 | + * @param s The path to walk o along | |
| 1113 | + * @return any | |
| 1114 | + */ | |
| 1115 | + exports.objectGetPath = function objectGetPath(o, s) { | |
| 1116 | + var parts = s.split("/").slice(1); | |
| 1117 | + var k; | |
| 1118 | + while (typeof (k = parts.shift()) == "string") { | |
| 1119 | + var n = decodeURIComponent(k.replace(/~0/, "~").replace(/~1/g, "/")); | |
| 1120 | + if (!(n in o)) return; | |
| 1121 | + o = o[n]; | |
| 1122 | + } | |
| 1123 | + return o; | |
| 1124 | + }; | |
| 1125 | + function pathEncoder(v) { | |
| 1126 | + return "/" + encodeURIComponent(v).replace(/~/g, "%7E"); | |
| 1127 | + } | |
| 1128 | + /** | |
| 1129 | + * Accept an Array of property names and return a JSON Pointer URI fragment | |
| 1130 | + * @param Array a | |
| 1131 | + * @return {String} | |
| 1132 | + */ | |
| 1133 | + exports.encodePath = function encodePointer(a) { | |
| 1134 | + return a.map(pathEncoder).join(""); | |
| 1135 | + }; | |
| 1136 | + /** | |
| 1137 | + * Calculate the number of decimal places a number uses | |
| 1138 | + * We need this to get correct results out of multipleOf and divisibleBy | |
| 1139 | + * when either figure is has decimal places, due to IEEE-754 float issues. | |
| 1140 | + * @param number | |
| 1141 | + * @returns {number} | |
| 1142 | + */ | |
| 1143 | + exports.getDecimalPlaces = function getDecimalPlaces(number) { | |
| 1144 | + var decimalPlaces = 0; | |
| 1145 | + if (isNaN(number)) return decimalPlaces; | |
| 1146 | + if (typeof number !== "number") number = Number(number); | |
| 1147 | + var parts = number.toString().split("e"); | |
| 1148 | + if (parts.length === 2) if (parts[1][0] !== "-") return decimalPlaces; | |
| 1149 | + else decimalPlaces = Number(parts[1].slice(1)); | |
| 1150 | + var decimalParts = parts[0].split("."); | |
| 1151 | + if (decimalParts.length === 2) decimalPlaces += decimalParts[1].length; | |
| 1152 | + return decimalPlaces; | |
| 1153 | + }; | |
| 1154 | + exports.isSchema = function isSchema(val) { | |
| 1155 | + return typeof val === "object" && val || typeof val === "boolean"; | |
| 1156 | + }; | |
| 1157 | + /** | |
| 1158 | + * Resolve target URL from a base and relative URL. | |
| 1159 | + * Similar to Node's URL Lib's legacy resolve function. | |
| 1160 | + * Code from example in deprecation note in said library. | |
| 1161 | + * @param string | |
| 1162 | + * @param string | |
| 1163 | + * @returns {string} | |
| 1164 | + */ | |
| 1165 | + var resolveUrl = exports.resolveUrl = function resolveUrl(from, to) { | |
| 1166 | + const resolvedUrl = new URL(to, new URL(from, "resolve://")); | |
| 1167 | + if (resolvedUrl.protocol === "resolve:") { | |
| 1168 | + const { pathname, search, hash } = resolvedUrl; | |
| 1169 | + return pathname + search + hash; | |
| 1170 | + } | |
| 1171 | + return resolvedUrl.toString(); | |
| 1172 | + }; | |
| 1173 | + })); | |
| 1174 | + | |
| 1175 | +//#endregion | |
| 1176 | +//#region node_modules/jsonschema/lib/attribute.js | |
| 1177 | + var require_attribute = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1178 | + var helpers = require_helpers(); | |
| 1179 | + /** @type ValidatorResult */ | |
| 1180 | + var ValidatorResult = helpers.ValidatorResult; | |
| 1181 | + /** @type SchemaError */ | |
| 1182 | + var SchemaError = helpers.SchemaError; | |
| 1183 | + var attribute = {}; | |
| 1184 | + attribute.ignoreProperties = { | |
| 1185 | + "id": true, | |
| 1186 | + "default": true, | |
| 1187 | + "description": true, | |
| 1188 | + "title": true, | |
| 1189 | + "additionalItems": true, | |
| 1190 | + "then": true, | |
| 1191 | + "else": true, | |
| 1192 | + "$schema": true, | |
| 1193 | + "$ref": true, | |
| 1194 | + "extends": true | |
| 1195 | + }; | |
| 1196 | + /** | |
| 1197 | + * @name validators | |
| 1198 | + */ | |
| 1199 | + var validators = attribute.validators = {}; | |
| 1200 | + /** | |
| 1201 | + * Validates whether the instance if of a certain type | |
| 1202 | + * @param instance | |
| 1203 | + * @param schema | |
| 1204 | + * @param options | |
| 1205 | + * @param ctx | |
| 1206 | + * @return {ValidatorResult|null} | |
| 1207 | + */ | |
| 1208 | + validators.type = function validateType(instance, schema, options, ctx) { | |
| 1209 | + if (instance === void 0) return null; | |
| 1210 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1211 | + var types = Array.isArray(schema.type) ? schema.type : [schema.type]; | |
| 1212 | + if (!types.some(this.testType.bind(this, instance, schema, options, ctx))) { | |
| 1213 | + var list = types.map(function(v) { | |
| 1214 | + if (!v) return; | |
| 1215 | + var id = v.$id || v.id; | |
| 1216 | + return id ? "<" + id + ">" : v + ""; | |
| 1217 | + }); | |
| 1218 | + result.addError({ | |
| 1219 | + name: "type", | |
| 1220 | + argument: list, | |
| 1221 | + message: "is not of a type(s) " + list | |
| 1222 | + }); | |
| 1223 | + } | |
| 1224 | + return result; | |
| 1225 | + }; | |
| 1226 | + function testSchemaNoThrow(instance, options, ctx, callback, schema) { | |
| 1227 | + var throwError = options.throwError; | |
| 1228 | + var throwAll = options.throwAll; | |
| 1229 | + options.throwError = false; | |
| 1230 | + options.throwAll = false; | |
| 1231 | + var res = this.validateSchema(instance, schema, options, ctx); | |
| 1232 | + options.throwError = throwError; | |
| 1233 | + options.throwAll = throwAll; | |
| 1234 | + if (!res.valid && callback instanceof Function) callback(res); | |
| 1235 | + return res.valid; | |
| 1236 | + } | |
| 1237 | + /** | |
| 1238 | + * Validates whether the instance matches some of the given schemas | |
| 1239 | + * @param instance | |
| 1240 | + * @param schema | |
| 1241 | + * @param options | |
| 1242 | + * @param ctx | |
| 1243 | + * @return {ValidatorResult|null} | |
| 1244 | + */ | |
| 1245 | + validators.anyOf = function validateAnyOf(instance, schema, options, ctx) { | |
| 1246 | + if (instance === void 0) return null; | |
| 1247 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1248 | + var inner = new ValidatorResult(instance, schema, options, ctx); | |
| 1249 | + if (!Array.isArray(schema.anyOf)) throw new SchemaError("anyOf must be an array"); | |
| 1250 | + if (!schema.anyOf.some(testSchemaNoThrow.bind(this, instance, options, ctx, function(res) { | |
| 1251 | + inner.importErrors(res); | |
| 1252 | + }))) { | |
| 1253 | + var list = schema.anyOf.map(function(v, i) { | |
| 1254 | + var id = v.$id || v.id; | |
| 1255 | + if (id) return "<" + id + ">"; | |
| 1256 | + return v.title && JSON.stringify(v.title) || v["$ref"] && "<" + v["$ref"] + ">" || "[subschema " + i + "]"; | |
| 1257 | + }); | |
| 1258 | + if (options.nestedErrors) result.importErrors(inner); | |
| 1259 | + result.addError({ | |
| 1260 | + name: "anyOf", | |
| 1261 | + argument: list, | |
| 1262 | + message: "is not any of " + list.join(",") | |
| 1263 | + }); | |
| 1264 | + } | |
| 1265 | + return result; | |
| 1266 | + }; | |
| 1267 | + /** | |
| 1268 | + * Validates whether the instance matches every given schema | |
| 1269 | + * @param instance | |
| 1270 | + * @param schema | |
| 1271 | + * @param options | |
| 1272 | + * @param ctx | |
| 1273 | + * @return {String|null} | |
| 1274 | + */ | |
| 1275 | + validators.allOf = function validateAllOf(instance, schema, options, ctx) { | |
| 1276 | + if (instance === void 0) return null; | |
| 1277 | + if (!Array.isArray(schema.allOf)) throw new SchemaError("allOf must be an array"); | |
| 1278 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1279 | + var self = this; | |
| 1280 | + schema.allOf.forEach(function(v, i) { | |
| 1281 | + var valid = self.validateSchema(instance, v, options, ctx); | |
| 1282 | + if (!valid.valid) { | |
| 1283 | + var msg = v.$id || v.id || v.title && JSON.stringify(v.title) || v["$ref"] && "<" + v["$ref"] + ">" || "[subschema " + i + "]"; | |
| 1284 | + result.addError({ | |
| 1285 | + name: "allOf", | |
| 1286 | + argument: { | |
| 1287 | + id: msg, | |
| 1288 | + length: valid.errors.length, | |
| 1289 | + valid | |
| 1290 | + }, | |
| 1291 | + message: "does not match allOf schema " + msg + " with " + valid.errors.length + " error[s]:" | |
| 1292 | + }); | |
| 1293 | + result.importErrors(valid); | |
| 1294 | + } | |
| 1295 | + }); | |
| 1296 | + return result; | |
| 1297 | + }; | |
| 1298 | + /** | |
| 1299 | + * Validates whether the instance matches exactly one of the given schemas | |
| 1300 | + * @param instance | |
| 1301 | + * @param schema | |
| 1302 | + * @param options | |
| 1303 | + * @param ctx | |
| 1304 | + * @return {String|null} | |
| 1305 | + */ | |
| 1306 | + validators.oneOf = function validateOneOf(instance, schema, options, ctx) { | |
| 1307 | + if (instance === void 0) return null; | |
| 1308 | + if (!Array.isArray(schema.oneOf)) throw new SchemaError("oneOf must be an array"); | |
| 1309 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1310 | + var inner = new ValidatorResult(instance, schema, options, ctx); | |
| 1311 | + var count = schema.oneOf.filter(testSchemaNoThrow.bind(this, instance, options, ctx, function(res) { | |
| 1312 | + inner.importErrors(res); | |
| 1313 | + })).length; | |
| 1314 | + var list = schema.oneOf.map(function(v, i) { | |
| 1315 | + return v.$id || v.id || v.title && JSON.stringify(v.title) || v["$ref"] && "<" + v["$ref"] + ">" || "[subschema " + i + "]"; | |
| 1316 | + }); | |
| 1317 | + if (count !== 1) { | |
| 1318 | + if (options.nestedErrors) result.importErrors(inner); | |
| 1319 | + result.addError({ | |
| 1320 | + name: "oneOf", | |
| 1321 | + argument: list, | |
| 1322 | + message: "is not exactly one from " + list.join(",") | |
| 1323 | + }); | |
| 1324 | + } | |
| 1325 | + return result; | |
| 1326 | + }; | |
| 1327 | + /** | |
| 1328 | + * Validates "then" or "else" depending on the result of validating "if" | |
| 1329 | + * @param instance | |
| 1330 | + * @param schema | |
| 1331 | + * @param options | |
| 1332 | + * @param ctx | |
| 1333 | + * @return {String|null} | |
| 1334 | + */ | |
| 1335 | + validators.if = function validateIf(instance, schema, options, ctx) { | |
| 1336 | + if (instance === void 0) return null; | |
| 1337 | + if (!helpers.isSchema(schema.if)) throw new Error("Expected \"if\" keyword to be a schema"); | |
| 1338 | + var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema.if); | |
| 1339 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1340 | + var res; | |
| 1341 | + if (ifValid) { | |
| 1342 | + if (schema.then === void 0) return; | |
| 1343 | + if (!helpers.isSchema(schema.then)) throw new Error("Expected \"then\" keyword to be a schema"); | |
| 1344 | + res = this.validateSchema(instance, schema.then, options, ctx.makeChild(schema.then)); | |
| 1345 | + result.importErrors(res); | |
| 1346 | + } else { | |
| 1347 | + if (schema.else === void 0) return; | |
| 1348 | + if (!helpers.isSchema(schema.else)) throw new Error("Expected \"else\" keyword to be a schema"); | |
| 1349 | + res = this.validateSchema(instance, schema.else, options, ctx.makeChild(schema.else)); | |
| 1350 | + result.importErrors(res); | |
| 1351 | + } | |
| 1352 | + return result; | |
| 1353 | + }; | |
| 1354 | + function getEnumerableProperty(object, key) { | |
| 1355 | + if (Object.hasOwnProperty.call(object, key)) return object[key]; | |
| 1356 | + if (!(key in object)) return; | |
| 1357 | + while (object = Object.getPrototypeOf(object)) if (Object.propertyIsEnumerable.call(object, key)) return object[key]; | |
| 1358 | + } | |
| 1359 | + /** | |
| 1360 | + * Validates propertyNames | |
| 1361 | + * @param instance | |
| 1362 | + * @param schema | |
| 1363 | + * @param options | |
| 1364 | + * @param ctx | |
| 1365 | + * @return {String|null|ValidatorResult} | |
| 1366 | + */ | |
| 1367 | + validators.propertyNames = function validatePropertyNames(instance, schema, options, ctx) { | |
| 1368 | + if (!this.types.object(instance)) return; | |
| 1369 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1370 | + var subschema = schema.propertyNames !== void 0 ? schema.propertyNames : {}; | |
| 1371 | + if (!helpers.isSchema(subschema)) throw new SchemaError("Expected \"propertyNames\" to be a schema (object or boolean)"); | |
| 1372 | + for (var property in instance) if (getEnumerableProperty(instance, property) !== void 0) { | |
| 1373 | + var res = this.validateSchema(property, subschema, options, ctx.makeChild(subschema)); | |
| 1374 | + result.importErrors(res); | |
| 1375 | + } | |
| 1376 | + return result; | |
| 1377 | + }; | |
| 1378 | + /** | |
| 1379 | + * Validates properties | |
| 1380 | + * @param instance | |
| 1381 | + * @param schema | |
| 1382 | + * @param options | |
| 1383 | + * @param ctx | |
| 1384 | + * @return {String|null|ValidatorResult} | |
| 1385 | + */ | |
| 1386 | + validators.properties = function validateProperties(instance, schema, options, ctx) { | |
| 1387 | + if (!this.types.object(instance)) return; | |
| 1388 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1389 | + var properties = schema.properties || {}; | |
| 1390 | + for (var property in properties) { | |
| 1391 | + var subschema = properties[property]; | |
| 1392 | + if (subschema === void 0) continue; | |
| 1393 | + else if (subschema === null) throw new SchemaError("Unexpected null, expected schema in \"properties\""); | |
| 1394 | + if (typeof options.preValidateProperty == "function") options.preValidateProperty(instance, property, subschema, options, ctx); | |
| 1395 | + var prop = getEnumerableProperty(instance, property); | |
| 1396 | + var res = this.validateSchema(prop, subschema, options, ctx.makeChild(subschema, property)); | |
| 1397 | + if (res.instance !== result.instance[property]) result.instance[property] = res.instance; | |
| 1398 | + result.importErrors(res); | |
| 1399 | + } | |
| 1400 | + return result; | |
| 1401 | + }; | |
| 1402 | + /** | |
| 1403 | + * Test a specific property within in instance against the additionalProperties schema attribute | |
| 1404 | + * This ignores properties with definitions in the properties schema attribute, but no other attributes. | |
| 1405 | + * If too many more types of property-existence tests pop up they may need their own class of tests (like `type` has) | |
| 1406 | + * @private | |
| 1407 | + * @return {boolean} | |
| 1408 | + */ | |
| 1409 | + function testAdditionalProperty(instance, schema, options, ctx, property, result) { | |
| 1410 | + if (!this.types.object(instance)) return; | |
| 1411 | + if (schema.properties && schema.properties[property] !== void 0) return; | |
| 1412 | + if (schema.additionalProperties === false) result.addError({ | |
| 1413 | + name: "additionalProperties", | |
| 1414 | + argument: property, | |
| 1415 | + message: "is not allowed to have the additional property " + JSON.stringify(property) | |
| 1416 | + }); | |
| 1417 | + else { | |
| 1418 | + var additionalProperties = schema.additionalProperties || {}; | |
| 1419 | + if (typeof options.preValidateProperty == "function") options.preValidateProperty(instance, property, additionalProperties, options, ctx); | |
| 1420 | + var res = this.validateSchema(instance[property], additionalProperties, options, ctx.makeChild(additionalProperties, property)); | |
| 1421 | + if (res.instance !== result.instance[property]) result.instance[property] = res.instance; | |
| 1422 | + result.importErrors(res); | |
| 1423 | + } | |
| 1424 | + } | |
| 1425 | + /** | |
| 1426 | + * Validates patternProperties | |
| 1427 | + * @param instance | |
| 1428 | + * @param schema | |
| 1429 | + * @param options | |
| 1430 | + * @param ctx | |
| 1431 | + * @return {String|null|ValidatorResult} | |
| 1432 | + */ | |
| 1433 | + validators.patternProperties = function validatePatternProperties(instance, schema, options, ctx) { | |
| 1434 | + if (!this.types.object(instance)) return; | |
| 1435 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1436 | + var patternProperties = schema.patternProperties || {}; | |
| 1437 | + for (var property in instance) { | |
| 1438 | + var test = true; | |
| 1439 | + for (var pattern in patternProperties) { | |
| 1440 | + var subschema = patternProperties[pattern]; | |
| 1441 | + if (subschema === void 0) continue; | |
| 1442 | + else if (subschema === null) throw new SchemaError("Unexpected null, expected schema in \"patternProperties\""); | |
| 1443 | + try { | |
| 1444 | + var regexp = new RegExp(pattern, "u"); | |
| 1445 | + } catch (_e) { | |
| 1446 | + regexp = new RegExp(pattern); | |
| 1447 | + } | |
| 1448 | + if (!regexp.test(property)) continue; | |
| 1449 | + test = false; | |
| 1450 | + if (typeof options.preValidateProperty == "function") options.preValidateProperty(instance, property, subschema, options, ctx); | |
| 1451 | + var res = this.validateSchema(instance[property], subschema, options, ctx.makeChild(subschema, property)); | |
| 1452 | + if (res.instance !== result.instance[property]) result.instance[property] = res.instance; | |
| 1453 | + result.importErrors(res); | |
| 1454 | + } | |
| 1455 | + if (test) testAdditionalProperty.call(this, instance, schema, options, ctx, property, result); | |
| 1456 | + } | |
| 1457 | + return result; | |
| 1458 | + }; | |
| 1459 | + /** | |
| 1460 | + * Validates additionalProperties | |
| 1461 | + * @param instance | |
| 1462 | + * @param schema | |
| 1463 | + * @param options | |
| 1464 | + * @param ctx | |
| 1465 | + * @return {String|null|ValidatorResult} | |
| 1466 | + */ | |
| 1467 | + validators.additionalProperties = function validateAdditionalProperties(instance, schema, options, ctx) { | |
| 1468 | + if (!this.types.object(instance)) return; | |
| 1469 | + if (schema.patternProperties) return null; | |
| 1470 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1471 | + for (var property in instance) testAdditionalProperty.call(this, instance, schema, options, ctx, property, result); | |
| 1472 | + return result; | |
| 1473 | + }; | |
| 1474 | + /** | |
| 1475 | + * Validates whether the instance value is at least of a certain length, when the instance value is a string. | |
| 1476 | + * @param instance | |
| 1477 | + * @param schema | |
| 1478 | + * @return {String|null} | |
| 1479 | + */ | |
| 1480 | + validators.minProperties = function validateMinProperties(instance, schema, options, ctx) { | |
| 1481 | + if (!this.types.object(instance)) return; | |
| 1482 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1483 | + if (!(Object.keys(instance).length >= schema.minProperties)) result.addError({ | |
| 1484 | + name: "minProperties", | |
| 1485 | + argument: schema.minProperties, | |
| 1486 | + message: "does not meet minimum property length of " + schema.minProperties | |
| 1487 | + }); | |
| 1488 | + return result; | |
| 1489 | + }; | |
| 1490 | + /** | |
| 1491 | + * Validates whether the instance value is at most of a certain length, when the instance value is a string. | |
| 1492 | + * @param instance | |
| 1493 | + * @param schema | |
| 1494 | + * @return {String|null} | |
| 1495 | + */ | |
| 1496 | + validators.maxProperties = function validateMaxProperties(instance, schema, options, ctx) { | |
| 1497 | + if (!this.types.object(instance)) return; | |
| 1498 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1499 | + if (!(Object.keys(instance).length <= schema.maxProperties)) result.addError({ | |
| 1500 | + name: "maxProperties", | |
| 1501 | + argument: schema.maxProperties, | |
| 1502 | + message: "does not meet maximum property length of " + schema.maxProperties | |
| 1503 | + }); | |
| 1504 | + return result; | |
| 1505 | + }; | |
| 1506 | + /** | |
| 1507 | + * Validates items when instance is an array | |
| 1508 | + * @param instance | |
| 1509 | + * @param schema | |
| 1510 | + * @param options | |
| 1511 | + * @param ctx | |
| 1512 | + * @return {String|null|ValidatorResult} | |
| 1513 | + */ | |
| 1514 | + validators.items = function validateItems(instance, schema, options, ctx) { | |
| 1515 | + var self = this; | |
| 1516 | + if (!this.types.array(instance)) return; | |
| 1517 | + if (schema.items === void 0) return; | |
| 1518 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1519 | + instance.every(function(value, i) { | |
| 1520 | + if (Array.isArray(schema.items)) var items = schema.items[i] === void 0 ? schema.additionalItems : schema.items[i]; | |
| 1521 | + else var items = schema.items; | |
| 1522 | + if (items === void 0) return true; | |
| 1523 | + if (items === false) { | |
| 1524 | + result.addError({ | |
| 1525 | + name: "items", | |
| 1526 | + message: "additionalItems not permitted" | |
| 1527 | + }); | |
| 1528 | + return false; | |
| 1529 | + } | |
| 1530 | + var res = self.validateSchema(value, items, options, ctx.makeChild(items, i)); | |
| 1531 | + if (res.instance !== result.instance[i]) result.instance[i] = res.instance; | |
| 1532 | + result.importErrors(res); | |
| 1533 | + return true; | |
| 1534 | + }); | |
| 1535 | + return result; | |
| 1536 | + }; | |
| 1537 | + /** | |
| 1538 | + * Validates the "contains" keyword | |
| 1539 | + * @param instance | |
| 1540 | + * @param schema | |
| 1541 | + * @param options | |
| 1542 | + * @param ctx | |
| 1543 | + * @return {String|null|ValidatorResult} | |
| 1544 | + */ | |
| 1545 | + validators.contains = function validateContains(instance, schema, options, ctx) { | |
| 1546 | + var self = this; | |
| 1547 | + if (!this.types.array(instance)) return; | |
| 1548 | + if (schema.contains === void 0) return; | |
| 1549 | + if (!helpers.isSchema(schema.contains)) throw new Error("Expected \"contains\" keyword to be a schema"); | |
| 1550 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1551 | + if (instance.some(function(value, i) { | |
| 1552 | + return self.validateSchema(value, schema.contains, options, ctx.makeChild(schema.contains, i)).errors.length === 0; | |
| 1553 | + }) === false) result.addError({ | |
| 1554 | + name: "contains", | |
| 1555 | + argument: schema.contains, | |
| 1556 | + message: "must contain an item matching given schema" | |
| 1557 | + }); | |
| 1558 | + return result; | |
| 1559 | + }; | |
| 1560 | + /** | |
| 1561 | + * Validates minimum and exclusiveMinimum when the type of the instance value is a number. | |
| 1562 | + * @param instance | |
| 1563 | + * @param schema | |
| 1564 | + * @return {String|null} | |
| 1565 | + */ | |
| 1566 | + validators.minimum = function validateMinimum(instance, schema, options, ctx) { | |
| 1567 | + if (!this.types.number(instance)) return; | |
| 1568 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1569 | + if (schema.exclusiveMinimum && schema.exclusiveMinimum === true) { | |
| 1570 | + if (!(instance > schema.minimum)) result.addError({ | |
| 1571 | + name: "minimum", | |
| 1572 | + argument: schema.minimum, | |
| 1573 | + message: "must be greater than " + schema.minimum | |
| 1574 | + }); | |
| 1575 | + } else if (!(instance >= schema.minimum)) result.addError({ | |
| 1576 | + name: "minimum", | |
| 1577 | + argument: schema.minimum, | |
| 1578 | + message: "must be greater than or equal to " + schema.minimum | |
| 1579 | + }); | |
| 1580 | + return result; | |
| 1581 | + }; | |
| 1582 | + /** | |
| 1583 | + * Validates maximum and exclusiveMaximum when the type of the instance value is a number. | |
| 1584 | + * @param instance | |
| 1585 | + * @param schema | |
| 1586 | + * @return {String|null} | |
| 1587 | + */ | |
| 1588 | + validators.maximum = function validateMaximum(instance, schema, options, ctx) { | |
| 1589 | + if (!this.types.number(instance)) return; | |
| 1590 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1591 | + if (schema.exclusiveMaximum && schema.exclusiveMaximum === true) { | |
| 1592 | + if (!(instance < schema.maximum)) result.addError({ | |
| 1593 | + name: "maximum", | |
| 1594 | + argument: schema.maximum, | |
| 1595 | + message: "must be less than " + schema.maximum | |
| 1596 | + }); | |
| 1597 | + } else if (!(instance <= schema.maximum)) result.addError({ | |
| 1598 | + name: "maximum", | |
| 1599 | + argument: schema.maximum, | |
| 1600 | + message: "must be less than or equal to " + schema.maximum | |
| 1601 | + }); | |
| 1602 | + return result; | |
| 1603 | + }; | |
| 1604 | + /** | |
| 1605 | + * Validates the number form of exclusiveMinimum when the type of the instance value is a number. | |
| 1606 | + * @param instance | |
| 1607 | + * @param schema | |
| 1608 | + * @return {String|null} | |
| 1609 | + */ | |
| 1610 | + validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema, options, ctx) { | |
| 1611 | + if (typeof schema.exclusiveMinimum === "boolean") return; | |
| 1612 | + if (!this.types.number(instance)) return; | |
| 1613 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1614 | + if (!(instance > schema.exclusiveMinimum)) result.addError({ | |
| 1615 | + name: "exclusiveMinimum", | |
| 1616 | + argument: schema.exclusiveMinimum, | |
| 1617 | + message: "must be strictly greater than " + schema.exclusiveMinimum | |
| 1618 | + }); | |
| 1619 | + return result; | |
| 1620 | + }; | |
| 1621 | + /** | |
| 1622 | + * Validates the number form of exclusiveMaximum when the type of the instance value is a number. | |
| 1623 | + * @param instance | |
| 1624 | + * @param schema | |
| 1625 | + * @return {String|null} | |
| 1626 | + */ | |
| 1627 | + validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema, options, ctx) { | |
| 1628 | + if (typeof schema.exclusiveMaximum === "boolean") return; | |
| 1629 | + if (!this.types.number(instance)) return; | |
| 1630 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1631 | + if (!(instance < schema.exclusiveMaximum)) result.addError({ | |
| 1632 | + name: "exclusiveMaximum", | |
| 1633 | + argument: schema.exclusiveMaximum, | |
| 1634 | + message: "must be strictly less than " + schema.exclusiveMaximum | |
| 1635 | + }); | |
| 1636 | + return result; | |
| 1637 | + }; | |
| 1638 | + /** | |
| 1639 | + * Perform validation for multipleOf and divisibleBy, which are essentially the same. | |
| 1640 | + * @param instance | |
| 1641 | + * @param schema | |
| 1642 | + * @param validationType | |
| 1643 | + * @param errorMessage | |
| 1644 | + * @returns {String|null} | |
| 1645 | + */ | |
| 1646 | + var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy(instance, schema, options, ctx, validationType, errorMessage) { | |
| 1647 | + if (!this.types.number(instance)) return; | |
| 1648 | + var validationArgument = schema[validationType]; | |
| 1649 | + if (validationArgument == 0) throw new SchemaError(validationType + " cannot be zero"); | |
| 1650 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1651 | + var instanceDecimals = helpers.getDecimalPlaces(instance); | |
| 1652 | + var divisorDecimals = helpers.getDecimalPlaces(validationArgument); | |
| 1653 | + var multiplier = Math.pow(10, Math.max(instanceDecimals, divisorDecimals)); | |
| 1654 | + if (Math.round(instance * multiplier) % Math.round(validationArgument * multiplier) !== 0) result.addError({ | |
| 1655 | + name: validationType, | |
| 1656 | + argument: validationArgument, | |
| 1657 | + message: errorMessage + JSON.stringify(validationArgument) | |
| 1658 | + }); | |
| 1659 | + return result; | |
| 1660 | + }; | |
| 1661 | + /** | |
| 1662 | + * Validates divisibleBy when the type of the instance value is a number. | |
| 1663 | + * @param instance | |
| 1664 | + * @param schema | |
| 1665 | + * @return {String|null} | |
| 1666 | + */ | |
| 1667 | + validators.multipleOf = function validateMultipleOf(instance, schema, options, ctx) { | |
| 1668 | + return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); | |
| 1669 | + }; | |
| 1670 | + /** | |
| 1671 | + * Validates multipleOf when the type of the instance value is a number. | |
| 1672 | + * @param instance | |
| 1673 | + * @param schema | |
| 1674 | + * @return {String|null} | |
| 1675 | + */ | |
| 1676 | + validators.divisibleBy = function validateDivisibleBy(instance, schema, options, ctx) { | |
| 1677 | + return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); | |
| 1678 | + }; | |
| 1679 | + /** | |
| 1680 | + * Validates whether the instance value is present. | |
| 1681 | + * @param instance | |
| 1682 | + * @param schema | |
| 1683 | + * @return {String|null} | |
| 1684 | + */ | |
| 1685 | + validators.required = function validateRequired(instance, schema, options, ctx) { | |
| 1686 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1687 | + if (instance === void 0 && schema.required === true) result.addError({ | |
| 1688 | + name: "required", | |
| 1689 | + message: "is required" | |
| 1690 | + }); | |
| 1691 | + else if (this.types.object(instance) && Array.isArray(schema.required)) schema.required.forEach(function(n) { | |
| 1692 | + if (getEnumerableProperty(instance, n) === void 0) result.addError({ | |
| 1693 | + name: "required", | |
| 1694 | + argument: n, | |
| 1695 | + message: "requires property " + JSON.stringify(n) | |
| 1696 | + }); | |
| 1697 | + }); | |
| 1698 | + return result; | |
| 1699 | + }; | |
| 1700 | + /** | |
| 1701 | + * Validates whether the instance value matches the regular expression, when the instance value is a string. | |
| 1702 | + * @param instance | |
| 1703 | + * @param schema | |
| 1704 | + * @return {String|null} | |
| 1705 | + */ | |
| 1706 | + validators.pattern = function validatePattern(instance, schema, options, ctx) { | |
| 1707 | + if (!this.types.string(instance)) return; | |
| 1708 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1709 | + var pattern = schema.pattern; | |
| 1710 | + try { | |
| 1711 | + var regexp = new RegExp(pattern, "u"); | |
| 1712 | + } catch (_e) { | |
| 1713 | + regexp = new RegExp(pattern); | |
| 1714 | + } | |
| 1715 | + if (!instance.match(regexp)) result.addError({ | |
| 1716 | + name: "pattern", | |
| 1717 | + argument: schema.pattern, | |
| 1718 | + message: "does not match pattern " + JSON.stringify(schema.pattern.toString()) | |
| 1719 | + }); | |
| 1720 | + return result; | |
| 1721 | + }; | |
| 1722 | + /** | |
| 1723 | + * Validates whether the instance value is of a certain defined format or a custom | |
| 1724 | + * format. | |
| 1725 | + * The following formats are supported for string types: | |
| 1726 | + * - date-time | |
| 1727 | + * - date | |
| 1728 | + * - time | |
| 1729 | + * - ip-address | |
| 1730 | + * - ipv6 | |
| 1731 | + * - uri | |
| 1732 | + * - color | |
| 1733 | + * - host-name | |
| 1734 | + * - alpha | |
| 1735 | + * - alpha-numeric | |
| 1736 | + * - utc-millisec | |
| 1737 | + * @param instance | |
| 1738 | + * @param schema | |
| 1739 | + * @param [options] | |
| 1740 | + * @param [ctx] | |
| 1741 | + * @return {String|null} | |
| 1742 | + */ | |
| 1743 | + validators.format = function validateFormat(instance, schema, options, ctx) { | |
| 1744 | + if (instance === void 0) return; | |
| 1745 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1746 | + if (!result.disableFormat && !helpers.isFormat(instance, schema.format, this)) result.addError({ | |
| 1747 | + name: "format", | |
| 1748 | + argument: schema.format, | |
| 1749 | + message: "does not conform to the " + JSON.stringify(schema.format) + " format" | |
| 1750 | + }); | |
| 1751 | + return result; | |
| 1752 | + }; | |
| 1753 | + /** | |
| 1754 | + * Validates whether the instance value is at least of a certain length, when the instance value is a string. | |
| 1755 | + * @param instance | |
| 1756 | + * @param schema | |
| 1757 | + * @return {String|null} | |
| 1758 | + */ | |
| 1759 | + validators.minLength = function validateMinLength(instance, schema, options, ctx) { | |
| 1760 | + if (!this.types.string(instance)) return; | |
| 1761 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1762 | + var hsp = instance.match(/[\uDC00-\uDFFF]/g); | |
| 1763 | + if (!(instance.length - (hsp ? hsp.length : 0) >= schema.minLength)) result.addError({ | |
| 1764 | + name: "minLength", | |
| 1765 | + argument: schema.minLength, | |
| 1766 | + message: "does not meet minimum length of " + schema.minLength | |
| 1767 | + }); | |
| 1768 | + return result; | |
| 1769 | + }; | |
| 1770 | + /** | |
| 1771 | + * Validates whether the instance value is at most of a certain length, when the instance value is a string. | |
| 1772 | + * @param instance | |
| 1773 | + * @param schema | |
| 1774 | + * @return {String|null} | |
| 1775 | + */ | |
| 1776 | + validators.maxLength = function validateMaxLength(instance, schema, options, ctx) { | |
| 1777 | + if (!this.types.string(instance)) return; | |
| 1778 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1779 | + var hsp = instance.match(/[\uDC00-\uDFFF]/g); | |
| 1780 | + if (!(instance.length - (hsp ? hsp.length : 0) <= schema.maxLength)) result.addError({ | |
| 1781 | + name: "maxLength", | |
| 1782 | + argument: schema.maxLength, | |
| 1783 | + message: "does not meet maximum length of " + schema.maxLength | |
| 1784 | + }); | |
| 1785 | + return result; | |
| 1786 | + }; | |
| 1787 | + /** | |
| 1788 | + * Validates whether instance contains at least a minimum number of items, when the instance is an Array. | |
| 1789 | + * @param instance | |
| 1790 | + * @param schema | |
| 1791 | + * @return {String|null} | |
| 1792 | + */ | |
| 1793 | + validators.minItems = function validateMinItems(instance, schema, options, ctx) { | |
| 1794 | + if (!this.types.array(instance)) return; | |
| 1795 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1796 | + if (!(instance.length >= schema.minItems)) result.addError({ | |
| 1797 | + name: "minItems", | |
| 1798 | + argument: schema.minItems, | |
| 1799 | + message: "does not meet minimum length of " + schema.minItems | |
| 1800 | + }); | |
| 1801 | + return result; | |
| 1802 | + }; | |
| 1803 | + /** | |
| 1804 | + * Validates whether instance contains no more than a maximum number of items, when the instance is an Array. | |
| 1805 | + * @param instance | |
| 1806 | + * @param schema | |
| 1807 | + * @return {String|null} | |
| 1808 | + */ | |
| 1809 | + validators.maxItems = function validateMaxItems(instance, schema, options, ctx) { | |
| 1810 | + if (!this.types.array(instance)) return; | |
| 1811 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1812 | + if (!(instance.length <= schema.maxItems)) result.addError({ | |
| 1813 | + name: "maxItems", | |
| 1814 | + argument: schema.maxItems, | |
| 1815 | + message: "does not meet maximum length of " + schema.maxItems | |
| 1816 | + }); | |
| 1817 | + return result; | |
| 1818 | + }; | |
| 1819 | + /** | |
| 1820 | + * Deep compares arrays for duplicates | |
| 1821 | + * @param v | |
| 1822 | + * @param i | |
| 1823 | + * @param a | |
| 1824 | + * @private | |
| 1825 | + * @return {boolean} | |
| 1826 | + */ | |
| 1827 | + function testArrays(v, i, a) { | |
| 1828 | + var j; | |
| 1829 | + var len = a.length; | |
| 1830 | + for (j = i + 1; j < len; j++) if (helpers.deepCompareStrict(v, a[j])) return false; | |
| 1831 | + return true; | |
| 1832 | + } | |
| 1833 | + /** | |
| 1834 | + * Validates whether there are no duplicates, when the instance is an Array. | |
| 1835 | + * @param instance | |
| 1836 | + * @return {String|null} | |
| 1837 | + */ | |
| 1838 | + validators.uniqueItems = function validateUniqueItems(instance, schema, options, ctx) { | |
| 1839 | + if (schema.uniqueItems !== true) return; | |
| 1840 | + if (!this.types.array(instance)) return; | |
| 1841 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1842 | + if (!instance.every(testArrays)) result.addError({ | |
| 1843 | + name: "uniqueItems", | |
| 1844 | + message: "contains duplicate item" | |
| 1845 | + }); | |
| 1846 | + return result; | |
| 1847 | + }; | |
| 1848 | + /** | |
| 1849 | + * Validate for the presence of dependency properties, if the instance is an object. | |
| 1850 | + * @param instance | |
| 1851 | + * @param schema | |
| 1852 | + * @param options | |
| 1853 | + * @param ctx | |
| 1854 | + * @return {null|ValidatorResult} | |
| 1855 | + */ | |
| 1856 | + validators.dependencies = function validateDependencies(instance, schema, options, ctx) { | |
| 1857 | + if (!this.types.object(instance)) return; | |
| 1858 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1859 | + for (var property in schema.dependencies) { | |
| 1860 | + if (instance[property] === void 0) continue; | |
| 1861 | + var dep = schema.dependencies[property]; | |
| 1862 | + var childContext = ctx.makeChild(dep, property); | |
| 1863 | + if (typeof dep == "string") dep = [dep]; | |
| 1864 | + if (Array.isArray(dep)) dep.forEach(function(prop) { | |
| 1865 | + if (instance[prop] === void 0) result.addError({ | |
| 1866 | + name: "dependencies", | |
| 1867 | + argument: childContext.propertyPath, | |
| 1868 | + message: "property " + prop + " not found, required by " + childContext.propertyPath | |
| 1869 | + }); | |
| 1870 | + }); | |
| 1871 | + else { | |
| 1872 | + var res = this.validateSchema(instance, dep, options, childContext); | |
| 1873 | + if (result.instance !== res.instance) result.instance = res.instance; | |
| 1874 | + if (res && res.errors.length) { | |
| 1875 | + result.addError({ | |
| 1876 | + name: "dependencies", | |
| 1877 | + argument: childContext.propertyPath, | |
| 1878 | + message: "does not meet dependency required by " + childContext.propertyPath | |
| 1879 | + }); | |
| 1880 | + result.importErrors(res); | |
| 1881 | + } | |
| 1882 | + } | |
| 1883 | + } | |
| 1884 | + return result; | |
| 1885 | + }; | |
| 1886 | + /** | |
| 1887 | + * Validates whether the instance value is one of the enumerated values. | |
| 1888 | + * | |
| 1889 | + * @param instance | |
| 1890 | + * @param schema | |
| 1891 | + * @return {ValidatorResult|null} | |
| 1892 | + */ | |
| 1893 | + validators["enum"] = function validateEnum(instance, schema, options, ctx) { | |
| 1894 | + if (instance === void 0) return null; | |
| 1895 | + if (!Array.isArray(schema["enum"])) throw new SchemaError("enum expects an array", schema); | |
| 1896 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1897 | + if (!schema["enum"].some(helpers.deepCompareStrict.bind(null, instance))) result.addError({ | |
| 1898 | + name: "enum", | |
| 1899 | + argument: schema["enum"], | |
| 1900 | + message: "is not one of enum values: " + schema["enum"].map(String).join(",") | |
| 1901 | + }); | |
| 1902 | + return result; | |
| 1903 | + }; | |
| 1904 | + /** | |
| 1905 | + * Validates whether the instance exactly matches a given value | |
| 1906 | + * | |
| 1907 | + * @param instance | |
| 1908 | + * @param schema | |
| 1909 | + * @return {ValidatorResult|null} | |
| 1910 | + */ | |
| 1911 | + validators["const"] = function validateEnum(instance, schema, options, ctx) { | |
| 1912 | + if (instance === void 0) return null; | |
| 1913 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1914 | + if (!helpers.deepCompareStrict(schema["const"], instance)) result.addError({ | |
| 1915 | + name: "const", | |
| 1916 | + argument: schema["const"], | |
| 1917 | + message: "does not exactly match expected constant: " + schema["const"] | |
| 1918 | + }); | |
| 1919 | + return result; | |
| 1920 | + }; | |
| 1921 | + /** | |
| 1922 | + * Validates whether the instance if of a prohibited type. | |
| 1923 | + * @param instance | |
| 1924 | + * @param schema | |
| 1925 | + * @param options | |
| 1926 | + * @param ctx | |
| 1927 | + * @return {null|ValidatorResult} | |
| 1928 | + */ | |
| 1929 | + validators.not = validators.disallow = function validateNot(instance, schema, options, ctx) { | |
| 1930 | + var self = this; | |
| 1931 | + if (instance === void 0) return null; | |
| 1932 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 1933 | + var notTypes = schema.not || schema.disallow; | |
| 1934 | + if (!notTypes) return null; | |
| 1935 | + if (!Array.isArray(notTypes)) notTypes = [notTypes]; | |
| 1936 | + notTypes.forEach(function(type) { | |
| 1937 | + if (self.testType(instance, schema, options, ctx, type)) { | |
| 1938 | + var schemaId = type && (type.$id || type.id) || type; | |
| 1939 | + result.addError({ | |
| 1940 | + name: "not", | |
| 1941 | + argument: schemaId, | |
| 1942 | + message: "is of prohibited type " + schemaId | |
| 1943 | + }); | |
| 1944 | + } | |
| 1945 | + }); | |
| 1946 | + return result; | |
| 1947 | + }; | |
| 1948 | + module.exports = attribute; | |
| 1949 | + })); | |
| 1950 | + | |
| 1951 | +//#endregion | |
| 1952 | +//#region node_modules/jsonschema/lib/scan.js | |
| 1953 | + var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1954 | + var helpers = require_helpers(); | |
| 1955 | + module.exports.SchemaScanResult = SchemaScanResult; | |
| 1956 | + function SchemaScanResult(found, ref) { | |
| 1957 | + this.id = found; | |
| 1958 | + this.ref = ref; | |
| 1959 | + } | |
| 1960 | + /** | |
| 1961 | + * Adds a schema with a certain urn to the Validator instance. | |
| 1962 | + * @param string uri | |
| 1963 | + * @param object schema | |
| 1964 | + * @return {Object} | |
| 1965 | + */ | |
| 1966 | + module.exports.scan = function scan(base, schema) { | |
| 1967 | + function scanSchema(baseuri, schema) { | |
| 1968 | + if (!schema || typeof schema != "object") return; | |
| 1969 | + if (schema.$ref) { | |
| 1970 | + let resolvedUri = helpers.resolveUrl(baseuri, schema.$ref); | |
| 1971 | + ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; | |
| 1972 | + return; | |
| 1973 | + } | |
| 1974 | + var id = schema.$id || schema.id; | |
| 1975 | + let resolvedBase = helpers.resolveUrl(baseuri, id); | |
| 1976 | + var ourBase = id ? resolvedBase : baseuri; | |
| 1977 | + if (ourBase) { | |
| 1978 | + if (ourBase.indexOf("#") < 0) ourBase += "#"; | |
| 1979 | + if (found[ourBase]) { | |
| 1980 | + if (!helpers.deepCompareStrict(found[ourBase], schema)) throw new Error("Schema <" + ourBase + "> already exists with different definition"); | |
| 1981 | + return found[ourBase]; | |
| 1982 | + } | |
| 1983 | + found[ourBase] = schema; | |
| 1984 | + if (ourBase[ourBase.length - 1] == "#") found[ourBase.substring(0, ourBase.length - 1)] = schema; | |
| 1985 | + } | |
| 1986 | + scanArray(ourBase + "/items", Array.isArray(schema.items) ? schema.items : [schema.items]); | |
| 1987 | + scanArray(ourBase + "/extends", Array.isArray(schema.extends) ? schema.extends : [schema.extends]); | |
| 1988 | + scanSchema(ourBase + "/additionalItems", schema.additionalItems); | |
| 1989 | + scanObject(ourBase + "/properties", schema.properties); | |
| 1990 | + scanSchema(ourBase + "/additionalProperties", schema.additionalProperties); | |
| 1991 | + scanObject(ourBase + "/definitions", schema.definitions); | |
| 1992 | + scanObject(ourBase + "/patternProperties", schema.patternProperties); | |
| 1993 | + scanObject(ourBase + "/dependencies", schema.dependencies); | |
| 1994 | + scanArray(ourBase + "/disallow", schema.disallow); | |
| 1995 | + scanArray(ourBase + "/allOf", schema.allOf); | |
| 1996 | + scanArray(ourBase + "/anyOf", schema.anyOf); | |
| 1997 | + scanArray(ourBase + "/oneOf", schema.oneOf); | |
| 1998 | + scanSchema(ourBase + "/not", schema.not); | |
| 1999 | + } | |
| 2000 | + function scanArray(baseuri, schemas) { | |
| 2001 | + if (!Array.isArray(schemas)) return; | |
| 2002 | + for (var i = 0; i < schemas.length; i++) scanSchema(baseuri + "/" + i, schemas[i]); | |
| 2003 | + } | |
| 2004 | + function scanObject(baseuri, schemas) { | |
| 2005 | + if (!schemas || typeof schemas != "object") return; | |
| 2006 | + for (var p in schemas) scanSchema(baseuri + "/" + p, schemas[p]); | |
| 2007 | + } | |
| 2008 | + var found = {}; | |
| 2009 | + var ref = {}; | |
| 2010 | + scanSchema(base, schema); | |
| 2011 | + return new SchemaScanResult(found, ref); | |
| 2012 | + }; | |
| 2013 | + })); | |
| 2014 | + | |
| 2015 | +//#endregion | |
| 2016 | +//#region node_modules/jsonschema/lib/validator.js | |
| 2017 | + var require_validator = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2018 | + var attribute = require_attribute(); | |
| 2019 | + var helpers = require_helpers(); | |
| 2020 | + var scanSchema = require_scan().scan; | |
| 2021 | + var ValidatorResult = helpers.ValidatorResult; | |
| 2022 | + var ValidatorResultError = helpers.ValidatorResultError; | |
| 2023 | + var SchemaError = helpers.SchemaError; | |
| 2024 | + var SchemaContext = helpers.SchemaContext; | |
| 2025 | + var anonymousBase = "/"; | |
| 2026 | + /** | |
| 2027 | + * Creates a new Validator object | |
| 2028 | + * @name Validator | |
| 2029 | + * @constructor | |
| 2030 | + */ | |
| 2031 | + var Validator = function Validator() { | |
| 2032 | + this.customFormats = Object.create(Validator.prototype.customFormats); | |
| 2033 | + this.schemas = {}; | |
| 2034 | + this.unresolvedRefs = []; | |
| 2035 | + this.types = Object.create(types); | |
| 2036 | + this.attributes = Object.create(attribute.validators); | |
| 2037 | + }; | |
| 2038 | + Validator.prototype.customFormats = {}; | |
| 2039 | + Validator.prototype.schemas = null; | |
| 2040 | + Validator.prototype.types = null; | |
| 2041 | + Validator.prototype.attributes = null; | |
| 2042 | + Validator.prototype.unresolvedRefs = null; | |
| 2043 | + /** | |
| 2044 | + * Adds a schema with a certain urn to the Validator instance. | |
| 2045 | + * @param schema | |
| 2046 | + * @param urn | |
| 2047 | + * @return {Object} | |
| 2048 | + */ | |
| 2049 | + Validator.prototype.addSchema = function addSchema(schema, base) { | |
| 2050 | + var self = this; | |
| 2051 | + if (!schema) return null; | |
| 2052 | + var scan = scanSchema(base || anonymousBase, schema); | |
| 2053 | + var ourUri = base || schema.$id || schema.id; | |
| 2054 | + for (var uri in scan.id) this.schemas[uri] = scan.id[uri]; | |
| 2055 | + for (var uri in scan.ref) this.unresolvedRefs.push(uri); | |
| 2056 | + this.unresolvedRefs = this.unresolvedRefs.filter(function(uri) { | |
| 2057 | + return typeof self.schemas[uri] === "undefined"; | |
| 2058 | + }); | |
| 2059 | + return this.schemas[ourUri]; | |
| 2060 | + }; | |
| 2061 | + Validator.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) { | |
| 2062 | + if (!Array.isArray(schemas)) return; | |
| 2063 | + for (var i = 0; i < schemas.length; i++) this.addSubSchema(baseuri, schemas[i]); | |
| 2064 | + }; | |
| 2065 | + Validator.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { | |
| 2066 | + if (!schemas || typeof schemas != "object") return; | |
| 2067 | + for (var p in schemas) this.addSubSchema(baseuri, schemas[p]); | |
| 2068 | + }; | |
| 2069 | + /** | |
| 2070 | + * Sets all the schemas of the Validator instance. | |
| 2071 | + * @param schemas | |
| 2072 | + */ | |
| 2073 | + Validator.prototype.setSchemas = function setSchemas(schemas) { | |
| 2074 | + this.schemas = schemas; | |
| 2075 | + }; | |
| 2076 | + /** | |
| 2077 | + * Returns the schema of a certain urn | |
| 2078 | + * @param urn | |
| 2079 | + */ | |
| 2080 | + Validator.prototype.getSchema = function getSchema(urn) { | |
| 2081 | + return this.schemas[urn]; | |
| 2082 | + }; | |
| 2083 | + /** | |
| 2084 | + * Validates instance against the provided schema | |
| 2085 | + * @param instance | |
| 2086 | + * @param schema | |
| 2087 | + * @param [options] | |
| 2088 | + * @param [ctx] | |
| 2089 | + * @return {Array} | |
| 2090 | + */ | |
| 2091 | + Validator.prototype.validate = function validate(instance, schema, options, ctx) { | |
| 2092 | + if (typeof schema !== "boolean" && typeof schema !== "object" || schema === null) throw new SchemaError("Expected `schema` to be an object or boolean"); | |
| 2093 | + if (!options) options = {}; | |
| 2094 | + var id = schema.$id || schema.id; | |
| 2095 | + let base = helpers.resolveUrl(options.base, id || ""); | |
| 2096 | + if (!ctx) { | |
| 2097 | + ctx = new SchemaContext(schema, options, [], base, Object.create(this.schemas)); | |
| 2098 | + if (!ctx.schemas[base]) ctx.schemas[base] = schema; | |
| 2099 | + var found = scanSchema(base, schema); | |
| 2100 | + for (var n in found.id) { | |
| 2101 | + var sch = found.id[n]; | |
| 2102 | + ctx.schemas[n] = sch; | |
| 2103 | + } | |
| 2104 | + } | |
| 2105 | + if (options.required && instance === void 0) { | |
| 2106 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 2107 | + result.addError("is required, but is undefined"); | |
| 2108 | + return result; | |
| 2109 | + } | |
| 2110 | + var result = this.validateSchema(instance, schema, options, ctx); | |
| 2111 | + if (!result) throw new Error("Result undefined"); | |
| 2112 | + else if (options.throwAll && result.errors.length) throw new ValidatorResultError(result); | |
| 2113 | + return result; | |
| 2114 | + }; | |
| 2115 | + /** | |
| 2116 | + * @param Object schema | |
| 2117 | + * @return mixed schema uri or false | |
| 2118 | + */ | |
| 2119 | + function shouldResolve(schema) { | |
| 2120 | + var ref = typeof schema === "string" ? schema : schema.$ref; | |
| 2121 | + if (typeof ref == "string") return ref; | |
| 2122 | + return false; | |
| 2123 | + } | |
| 2124 | + /** | |
| 2125 | + * Validates an instance against the schema (the actual work horse) | |
| 2126 | + * @param instance | |
| 2127 | + * @param schema | |
| 2128 | + * @param options | |
| 2129 | + * @param ctx | |
| 2130 | + * @private | |
| 2131 | + * @return {ValidatorResult} | |
| 2132 | + */ | |
| 2133 | + Validator.prototype.validateSchema = function validateSchema(instance, schema, options, ctx) { | |
| 2134 | + var result = new ValidatorResult(instance, schema, options, ctx); | |
| 2135 | + if (typeof schema === "boolean") { | |
| 2136 | + if (schema === true) schema = {}; | |
| 2137 | + else if (schema === false) schema = { type: [] }; | |
| 2138 | + } else if (!schema) throw new Error("schema is undefined"); | |
| 2139 | + if (schema["extends"]) if (Array.isArray(schema["extends"])) { | |
| 2140 | + var schemaobj = { | |
| 2141 | + schema, | |
| 2142 | + ctx | |
| 2143 | + }; | |
| 2144 | + schema["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); | |
| 2145 | + schema = schemaobj.schema; | |
| 2146 | + schemaobj.schema = null; | |
| 2147 | + schemaobj.ctx = null; | |
| 2148 | + schemaobj = null; | |
| 2149 | + } else schema = helpers.deepMerge(schema, this.superResolve(schema["extends"], ctx)); | |
| 2150 | + var switchSchema = shouldResolve(schema); | |
| 2151 | + if (switchSchema) { | |
| 2152 | + var resolved = this.resolve(schema, switchSchema, ctx); | |
| 2153 | + var subctx = new SchemaContext(resolved.subschema, options, ctx.path, resolved.switchSchema, ctx.schemas); | |
| 2154 | + return this.validateSchema(instance, resolved.subschema, options, subctx); | |
| 2155 | + } | |
| 2156 | + var skipAttributes = options && options.skipAttributes || []; | |
| 2157 | + for (var key in schema) if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { | |
| 2158 | + var validatorErr = null; | |
| 2159 | + var validator = this.attributes[key]; | |
| 2160 | + if (validator) validatorErr = validator.call(this, instance, schema, options, ctx); | |
| 2161 | + else if (options.allowUnknownAttributes === false) throw new SchemaError("Unsupported attribute: " + key, schema); | |
| 2162 | + if (validatorErr) result.importErrors(validatorErr); | |
| 2163 | + } | |
| 2164 | + if (typeof options.rewrite == "function") result.instance = options.rewrite.call(this, instance, schema, options, ctx); | |
| 2165 | + return result; | |
| 2166 | + }; | |
| 2167 | + /** | |
| 2168 | + * @private | |
| 2169 | + * @param Object schema | |
| 2170 | + * @param SchemaContext ctx | |
| 2171 | + * @returns Object schema or resolved schema | |
| 2172 | + */ | |
| 2173 | + Validator.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) { | |
| 2174 | + schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); | |
| 2175 | + }; | |
| 2176 | + /** | |
| 2177 | + * @private | |
| 2178 | + * @param Object schema | |
| 2179 | + * @param SchemaContext ctx | |
| 2180 | + * @returns Object schema or resolved schema | |
| 2181 | + */ | |
| 2182 | + Validator.prototype.superResolve = function superResolve(schema, ctx) { | |
| 2183 | + var ref = shouldResolve(schema); | |
| 2184 | + if (ref) return this.resolve(schema, ref, ctx).subschema; | |
| 2185 | + return schema; | |
| 2186 | + }; | |
| 2187 | + /** | |
| 2188 | + * @private | |
| 2189 | + * @param Object schema | |
| 2190 | + * @param Object switchSchema | |
| 2191 | + * @param SchemaContext ctx | |
| 2192 | + * @return Object resolved schemas {subschema:String, switchSchema: String} | |
| 2193 | + * @throws SchemaError | |
| 2194 | + */ | |
| 2195 | + Validator.prototype.resolve = function resolve(schema, switchSchema, ctx) { | |
| 2196 | + switchSchema = ctx.resolve(switchSchema); | |
| 2197 | + if (ctx.schemas[switchSchema]) return { | |
| 2198 | + subschema: ctx.schemas[switchSchema], | |
| 2199 | + switchSchema | |
| 2200 | + }; | |
| 2201 | + let fragment = new URL(switchSchema, "thismessage::/").hash; | |
| 2202 | + var document = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); | |
| 2203 | + if (!document || !ctx.schemas[document]) throw new SchemaError("no such schema <" + switchSchema + ">", schema); | |
| 2204 | + var subschema = helpers.objectGetPath(ctx.schemas[document], fragment.substr(1)); | |
| 2205 | + if (subschema === void 0) throw new SchemaError("no such schema " + fragment + " located in <" + document + ">", schema); | |
| 2206 | + return { | |
| 2207 | + subschema, | |
| 2208 | + switchSchema | |
| 2209 | + }; | |
| 2210 | + }; | |
| 2211 | + /** | |
| 2212 | + * Tests whether the instance if of a certain type. | |
| 2213 | + * @private | |
| 2214 | + * @param instance | |
| 2215 | + * @param schema | |
| 2216 | + * @param options | |
| 2217 | + * @param ctx | |
| 2218 | + * @param type | |
| 2219 | + * @return {boolean} | |
| 2220 | + */ | |
| 2221 | + Validator.prototype.testType = function validateType(instance, schema, options, ctx, type) { | |
| 2222 | + if (type === void 0) return; | |
| 2223 | + else if (type === null) throw new SchemaError("Unexpected null in \"type\" keyword"); | |
| 2224 | + if (typeof this.types[type] == "function") return this.types[type].call(this, instance); | |
| 2225 | + if (type && typeof type == "object") { | |
| 2226 | + var res = this.validateSchema(instance, type, options, ctx); | |
| 2227 | + return res === void 0 || !(res && res.errors.length); | |
| 2228 | + } | |
| 2229 | + return true; | |
| 2230 | + }; | |
| 2231 | + var types = Validator.prototype.types = {}; | |
| 2232 | + types.string = function testString(instance) { | |
| 2233 | + return typeof instance == "string"; | |
| 2234 | + }; | |
| 2235 | + types.number = function testNumber(instance) { | |
| 2236 | + return typeof instance == "number" && isFinite(instance); | |
| 2237 | + }; | |
| 2238 | + types.integer = function testInteger(instance) { | |
| 2239 | + return typeof instance == "number" && instance % 1 === 0; | |
| 2240 | + }; | |
| 2241 | + types.boolean = function testBoolean(instance) { | |
| 2242 | + return typeof instance == "boolean"; | |
| 2243 | + }; | |
| 2244 | + types.array = function testArray(instance) { | |
| 2245 | + return Array.isArray(instance); | |
| 2246 | + }; | |
| 2247 | + types["null"] = function testNull(instance) { | |
| 2248 | + return instance === null; | |
| 2249 | + }; | |
| 2250 | + types.date = function testDate(instance) { | |
| 2251 | + return instance instanceof Date; | |
| 2252 | + }; | |
| 2253 | + types.any = function testAny(instance) { | |
| 2254 | + return true; | |
| 2255 | + }; | |
| 2256 | + types.object = function testObject(instance) { | |
| 2257 | + return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date); | |
| 2258 | + }; | |
| 2259 | + module.exports = Validator; | |
| 2260 | + })); | |
| 2261 | + | |
| 2262 | +//#endregion | |
| 2263 | +//#region node_modules/jsonschema/lib/index.js | |
| 2264 | + var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2265 | + var Validator = module.exports.Validator = require_validator(); | |
| 2266 | + module.exports.ValidatorResult = require_helpers().ValidatorResult; | |
| 2267 | + module.exports.ValidatorResultError = require_helpers().ValidatorResultError; | |
| 2268 | + module.exports.ValidationError = require_helpers().ValidationError; | |
| 2269 | + module.exports.SchemaError = require_helpers().SchemaError; | |
| 2270 | + module.exports.SchemaScanResult = require_scan().SchemaScanResult; | |
| 2271 | + module.exports.scan = require_scan().scan; | |
| 2272 | + module.exports.validate = function(instance, schema, options) { | |
| 2273 | + return new Validator().validate(instance, schema, options); | |
| 2274 | + }; | |
| 2275 | + })); | |
| 2276 | + | |
| 2277 | +//#endregion | |
| 2278 | +//#region packages/packages/libs/editor-props/src/utils/validate-prop-value.ts | |
| 2279 | + var import_lib = require_lib(); | |
| 2280 | + function processValidationError(error) { | |
| 2281 | + const detailed = { | |
| 2282 | + path: error.path, | |
| 2283 | + message: error.message, | |
| 2284 | + schema: error.schema, | |
| 2285 | + instance: error.instance, | |
| 2286 | + name: error.name | |
| 2287 | + }; | |
| 2288 | + if (error.name === "anyOf" && error.schema && typeof error.schema === "object" && "anyOf" in error.schema) detailed.variants = (error.schema.anyOf || []).map((variantSchema, idx) => { | |
| 2289 | + const variantResult = (0, import_lib.validate)(error.instance, variantSchema); | |
| 2290 | + let discriminator = `variant-${idx}`; | |
| 2291 | + if (variantSchema && typeof variantSchema === "object" && "properties" in variantSchema && variantSchema.properties && typeof variantSchema.properties === "object" && "$$type" in variantSchema.properties) { | |
| 2292 | + const typeProperty = variantSchema.properties.$$type; | |
| 2293 | + if (typeProperty && typeof typeProperty === "object" && "const" in typeProperty && typeof typeProperty.const === "string") discriminator = typeProperty.const; | |
| 2294 | + } | |
| 2295 | + return { | |
| 2296 | + discriminator, | |
| 2297 | + errors: variantResult.errors.map(processValidationError) | |
| 2298 | + }; | |
| 2299 | + }); | |
| 2300 | + return detailed; | |
| 2301 | + } | |
| 2302 | + function formatDetailedErrors(errors, indent = "") { | |
| 2303 | + const lines = []; | |
| 2304 | + for (const error of errors) { | |
| 2305 | + const pathStr = error.path.length > 0 ? error.path.join(".") : "root"; | |
| 2306 | + lines.push(`${indent}Error at ${pathStr}: ${error.message}`); | |
| 2307 | + if (error.variants && error.variants.length > 0) { | |
| 2308 | + lines.push(`${indent} Tried ${error.variants.length} variant(s):`); | |
| 2309 | + for (const variant of error.variants) { | |
| 2310 | + lines.push(`${indent} - ${variant.discriminator}:`); | |
| 2311 | + if (variant.errors.length === 0) lines.push(`${indent} (no errors - this variant matched!)`); | |
| 2312 | + else for (const nestedError of variant.errors) { | |
| 2313 | + const nestedPathStr = nestedError.path.length > 0 ? nestedError.path.join(".") : "root"; | |
| 2314 | + lines.push(`${indent} ${nestedPathStr}: ${nestedError.message}`); | |
| 2315 | + if (nestedError.variants && nestedError.variants.length > 0) lines.push(formatDetailedErrors([nestedError], `${indent} `)); | |
| 2316 | + } | |
| 2317 | + } | |
| 2318 | + } | |
| 2319 | + } | |
| 2320 | + return lines.join("\n"); | |
| 2321 | + } | |
| 2322 | + var validatePropValue = (schema, value) => { | |
| 2323 | + const jsonSchema = propTypeToJsonSchema(schema); | |
| 2324 | + if (value === null) return { | |
| 2325 | + valid: true, | |
| 2326 | + errors: [], | |
| 2327 | + errorMessages: [], | |
| 2328 | + jsonSchema: JSON.stringify(propTypeToJsonSchema(schema)) | |
| 2329 | + }; | |
| 2330 | + const result = (0, import_lib.validate)(value, jsonSchema); | |
| 2331 | + const detailedErrors = result.errors.map(processValidationError); | |
| 2332 | + return { | |
| 2333 | + valid: result.valid, | |
| 2334 | + errors: result.errors, | |
| 2335 | + errorMessages: formatDetailedErrors(detailedErrors), | |
| 2336 | + jsonSchema: JSON.stringify(jsonSchema) | |
| 2337 | + }; | |
| 2338 | + }; | |
| 2339 | + | |
| 2340 | +//#endregion | |
| 2341 | +//#region packages/packages/libs/editor-props/src/utils/is-transformable.ts | |
| 2342 | + var transformableSchema = _elementor_schema.z.object({ | |
| 2343 | + $$type: _elementor_schema.z.string(), | |
| 2344 | + value: _elementor_schema.z.any(), | |
| 2345 | + disabled: _elementor_schema.z.boolean().optional() | |
| 2346 | + }); | |
| 2347 | + var isTransformable = (value) => { | |
| 2348 | + return transformableSchema.safeParse(value).success; | |
| 2349 | + }; | |
| 2350 | + | |
| 2351 | +//#endregion | |
| 2352 | +//#region packages/packages/libs/editor-props/src/utils/filter-empty-values.ts | |
| 2353 | + var filterEmptyValues = (value) => { | |
| 2354 | + if (isEmpty(value)) return null; | |
| 2355 | + if (Array.isArray(value)) return value.map(filterEmptyValues).filter((item) => !isEmpty(item)); | |
| 2356 | + if (typeof value === "object") return Object.fromEntries(Object.entries(value).map(([key, val]) => [key, filterEmptyValues(val)]).filter(([, val]) => !isEmpty(val))); | |
| 2357 | + return value; | |
| 2358 | + }; | |
| 2359 | + var isEmpty = (value) => { | |
| 2360 | + if (value && isTransformable(value)) return isEmpty(value.value); | |
| 2361 | + return isNullish(value) || isNullishArray(value) || isNullishObject(value); | |
| 2362 | + }; | |
| 2363 | + var isNullish = (value) => value === null || value === void 0 || value === ""; | |
| 2364 | + var isNullishArray = (value) => Array.isArray(value) && value.every(isEmpty); | |
| 2365 | + var isNullishObject = (value) => { | |
| 2366 | + return typeof value === "object" && isNullishArray(Object.values(value)); | |
| 2367 | + }; | |
| 2368 | + | |
| 2369 | +//#endregion | |
| 2370 | +//#region packages/packages/libs/editor-props/src/utils/is-overridable.ts | |
| 2371 | + function isOverridable(value) { | |
| 2372 | + return isTransformable(value) && value.$$type === "overridable"; | |
| 2373 | + } | |
| 2374 | + function rewrapOverridableValue(existing, newInner) { | |
| 2375 | + return { | |
| 2376 | + ...existing, | |
| 2377 | + value: { | |
| 2378 | + ...existing.value, | |
| 2379 | + origin_value: newInner | |
| 2380 | + } | |
| 2381 | + }; | |
| 2382 | + } | |
| 2383 | + | |
| 2384 | +//#endregion | |
| 2385 | +//#region packages/packages/libs/editor-props/src/utils/merge-props.ts | |
| 2386 | + function mergeProps(current, updates) { | |
| 2387 | + let props = {}; | |
| 2388 | + if (!Array.isArray(current)) props = structuredClone(current); | |
| 2389 | + Object.entries(updates).forEach(([key, value]) => { | |
| 2390 | + if (value === null || value === void 0) delete props[key]; | |
| 2391 | + else props[key] = value; | |
| 2392 | + }); | |
| 2393 | + return props; | |
| 2394 | + } | |
| 2395 | + | |
| 2396 | +//#endregion | |
| 2397 | +//#region packages/packages/libs/editor-props/src/utils/prop-dependency-utils.ts | |
| 2398 | + function isDependencyMet(dependency, values) { | |
| 2399 | + if (!dependency?.terms.length) return { isMet: true }; | |
| 2400 | + const { relation, terms } = dependency; | |
| 2401 | + const method = getRelationMethod(relation); | |
| 2402 | + const failingDependencies = []; | |
| 2403 | + return { | |
| 2404 | + isMet: terms[method]((term) => { | |
| 2405 | + const result = isDependency(term) ? isDependencyMet(term, values).isMet : evaluateTerm(term, extractValue(term.path, values, term.nestedPath)?.value); | |
| 2406 | + if (!result) failingDependencies.push(term); | |
| 2407 | + return result; | |
| 2408 | + }), | |
| 2409 | + failingDependencies | |
| 2410 | + }; | |
| 2411 | + } | |
| 2412 | + function evaluateTerm(term, actualValue) { | |
| 2413 | + const { value: valueToCompare, operator } = term; | |
| 2414 | + switch (operator) { | |
| 2415 | + case "eq": | |
| 2416 | + case "ne": return actualValue === valueToCompare === ("eq" === operator); | |
| 2417 | + case "gt": | |
| 2418 | + case "lte": | |
| 2419 | + if (!isNumber(actualValue) || !isNumber(valueToCompare)) return false; | |
| 2420 | + return Number(actualValue) > Number(valueToCompare) === ("gt" === operator); | |
| 2421 | + case "lt": | |
| 2422 | + case "gte": | |
| 2423 | + if (!isNumber(actualValue) || !isNumber(valueToCompare)) return false; | |
| 2424 | + return Number(actualValue) < Number(valueToCompare) === ("lt" === operator); | |
| 2425 | + case "in": | |
| 2426 | + case "nin": | |
| 2427 | + if (!Array.isArray(valueToCompare)) return false; | |
| 2428 | + return valueToCompare.includes(actualValue) === ("in" === operator); | |
| 2429 | + case "contains": | |
| 2430 | + case "ncontains": | |
| 2431 | + if (("string" !== typeof actualValue || "string" !== typeof valueToCompare) && !Array.isArray(actualValue)) return false; | |
| 2432 | + const transformedValue = Array.isArray(actualValue) ? actualValue.map((item) => isTransformable(item) ? item.value : item) : actualValue; | |
| 2433 | + return "contains" === operator === transformedValue.includes(valueToCompare); | |
| 2434 | + case "exists": | |
| 2435 | + case "not_exist": return "exists" === operator === (!!actualValue || 0 === actualValue || false === actualValue); | |
| 2436 | + default: return true; | |
| 2437 | + } | |
| 2438 | + } | |
| 2439 | + function isNumber(value) { | |
| 2440 | + return typeof value === "number" && !isNaN(value); | |
| 2441 | + } | |
| 2442 | + function getRelationMethod(relation) { | |
| 2443 | + switch (relation) { | |
| 2444 | + case "or": return "some"; | |
| 2445 | + case "and": return "every"; | |
| 2446 | + default: throw new Error(`Relation not supported ${relation}`); | |
| 2447 | + } | |
| 2448 | + } | |
| 2449 | + function extractValue(path, elementValues, nestedPath = [], options = {}) { | |
| 2450 | + const { unwrapOverridableLeaf = true } = options; | |
| 2451 | + let resolved = path.reduce((acc, key, index) => { | |
| 2452 | + const value = acc?.[key]; | |
| 2453 | + if (index === path.length - 1) return value; | |
| 2454 | + if (isOverridable(value)) { | |
| 2455 | + const inner = value.value.origin_value; | |
| 2456 | + return isTransformable(inner) ? inner.value ?? null : inner; | |
| 2457 | + } | |
| 2458 | + if (isTransformable(value)) return value.value ?? null; | |
| 2459 | + return value; | |
| 2460 | + }, elementValues); | |
| 2461 | + if (unwrapOverridableLeaf && resolved && isOverridable(resolved)) resolved = resolved.value.origin_value ?? null; | |
| 2462 | + if (!nestedPath?.length) return resolved; | |
| 2463 | + return { | |
| 2464 | + $$type: "unknown", | |
| 2465 | + value: nestedPath.reduce((acc, key) => acc?.[key], resolved?.value) | |
| 2466 | + }; | |
| 2467 | + } | |
| 2468 | + function isDependency(term) { | |
| 2469 | + return "terms" in term; | |
| 2470 | + } | |
| 2471 | + | |
| 2472 | +//#endregion | |
| 2473 | +//#region packages/packages/libs/editor-props/src/utils/parse-html-children.ts | |
| 2474 | + var INLINE_ELEMENTS = /* @__PURE__ */ new Set([ | |
| 2475 | + "span", | |
| 2476 | + "b", | |
| 2477 | + "strong", | |
| 2478 | + "i", | |
| 2479 | + "em", | |
| 2480 | + "u", | |
| 2481 | + "a", | |
| 2482 | + "del", | |
| 2483 | + "sup", | |
| 2484 | + "sub", | |
| 2485 | + "s" | |
| 2486 | + ]); | |
| 2487 | + function generateElementId() { | |
| 2488 | + return `e-${Date.now().toString(36)}-${Math.random().toString(36).substring(2, 9)}`; | |
| 2489 | + } | |
| 2490 | + function traverseChildren(node) { | |
| 2491 | + const result = []; | |
| 2492 | + for (const child of Array.from(node.children)) { | |
| 2493 | + const tagName = child.tagName.toLowerCase(); | |
| 2494 | + if (!INLINE_ELEMENTS.has(tagName)) { | |
| 2495 | + result.push(...traverseChildren(child)); | |
| 2496 | + continue; | |
| 2497 | + } | |
| 2498 | + let id = child.getAttribute("id"); | |
| 2499 | + if (!id) { | |
| 2500 | + id = generateElementId(); | |
| 2501 | + child.setAttribute("id", id); | |
| 2502 | + } | |
| 2503 | + const childElement = { | |
| 2504 | + id, | |
| 2505 | + type: tagName | |
| 2506 | + }; | |
| 2507 | + const textContent = child.textContent?.trim(); | |
| 2508 | + if (textContent) childElement.content = textContent; | |
| 2509 | + const nestedChildren = traverseChildren(child); | |
| 2510 | + if (nestedChildren.length > 0) childElement.children = nestedChildren; | |
| 2511 | + result.push(childElement); | |
| 2512 | + } | |
| 2513 | + return result; | |
| 2514 | + } | |
| 2515 | + function parseHtmlChildren(html) { | |
| 2516 | + if (!html) return { | |
| 2517 | + content: html, | |
| 2518 | + children: [] | |
| 2519 | + }; | |
| 2520 | + const doc = new DOMParser().parseFromString(`<body>${html}</body>`, "text/html"); | |
| 2521 | + const parserError = doc.querySelector("parsererror"); | |
| 2522 | + if (parserError) { | |
| 2523 | + console.warn("HTML parsing error, returning original content:", parserError.textContent); | |
| 2524 | + return { | |
| 2525 | + content: html, | |
| 2526 | + children: [] | |
| 2527 | + }; | |
| 2528 | + } | |
| 2529 | + const body = doc.body; | |
| 2530 | + const children = traverseChildren(body); | |
| 2531 | + return { | |
| 2532 | + content: body.innerHTML, | |
| 2533 | + children | |
| 2534 | + }; | |
| 2535 | + } | |
| 2536 | + | |
| 2537 | +//#endregion | |
| 2538 | +//#region packages/packages/libs/editor-props/src/index.ts | |
| 2539 | + var src_exports = /* @__PURE__ */ __exportAll({ | |
| 2540 | + CLASSES_PROP_KEY: () => CLASSES_PROP_KEY, | |
| 2541 | + DateTimePropTypeUtil: () => DateTimePropTypeUtil, | |
| 2542 | + Schema: () => Schema, | |
| 2543 | + backdropFilterPropTypeUtil: () => backdropFilterPropTypeUtil, | |
| 2544 | + backgroundColorOverlayPropTypeUtil: () => backgroundColorOverlayPropTypeUtil, | |
| 2545 | + backgroundGradientOverlayPropTypeUtil: () => backgroundGradientOverlayPropTypeUtil, | |
| 2546 | + backgroundImageOverlayPropTypeUtil: () => backgroundImageOverlayPropTypeUtil, | |
| 2547 | + backgroundImagePositionOffsetPropTypeUtil: () => backgroundImagePositionOffsetPropTypeUtil, | |
| 2548 | + backgroundImageSizeScalePropTypeUtil: () => backgroundImageSizeScalePropTypeUtil, | |
| 2549 | + backgroundOverlayItem: () => backgroundOverlayItem, | |
| 2550 | + backgroundOverlayPropTypeUtil: () => backgroundOverlayPropTypeUtil, | |
| 2551 | + backgroundPropTypeUtil: () => backgroundPropTypeUtil, | |
| 2552 | + blurFilterPropTypeUtil: () => blurFilterPropTypeUtil, | |
| 2553 | + booleanPropTypeUtil: () => booleanPropTypeUtil, | |
| 2554 | + borderRadiusPropTypeUtil: () => borderRadiusPropTypeUtil, | |
| 2555 | + borderWidthPropTypeUtil: () => borderWidthPropTypeUtil, | |
| 2556 | + boxShadowPropTypeUtil: () => boxShadowPropTypeUtil, | |
| 2557 | + classesPropTypeUtil: () => classesPropTypeUtil, | |
| 2558 | + colorPropTypeUtil: () => colorPropTypeUtil, | |
| 2559 | + colorStopPropTypeUtil: () => colorStopPropTypeUtil, | |
| 2560 | + colorToneFilterPropTypeUtil: () => colorToneFilterPropTypeUtil, | |
| 2561 | + createArrayPropUtils: () => createArrayPropUtils, | |
| 2562 | + createPropUtils: () => createPropUtils, | |
| 2563 | + cssFilterFunctionPropUtil: () => cssFilterFunctionPropUtil, | |
| 2564 | + dateRangePropTypeUtil: () => dateRangePropTypeUtil, | |
| 2565 | + dateStringPropTypeUtil: () => dateStringPropTypeUtil, | |
| 2566 | + dimensionsPropTypeUtil: () => dimensionsPropTypeUtil, | |
| 2567 | + dropShadowFilterPropTypeUtil: () => dropShadowFilterPropTypeUtil, | |
| 2568 | + emailPropTypeUtil: () => emailPropTypeUtil, | |
| 2569 | + emailsPropTypeUtil: () => emailsPropTypeUtil, | |
| 2570 | + escapedHtmlPropTypeUtil: () => escapedHtmlPropTypeUtil, | |
| 2571 | + evaluateTerm: () => evaluateTerm, | |
| 2572 | + extractValue: () => extractValue, | |
| 2573 | + filterEmptyValues: () => filterEmptyValues, | |
| 2574 | + filterPropTypeUtil: () => filterPropTypeUtil, | |
| 2575 | + flexPropTypeUtil: () => flexPropTypeUtil, | |
| 2576 | + fontFamilyPropTypeUtil: () => fontFamilyPropTypeUtil, | |
| 2577 | + getPropSchemaFromCache: () => getPropSchemaFromCache, | |
| 2578 | + gradientColorStopPropTypeUtil: () => gradientColorStopPropTypeUtil, | |
| 2579 | + gridTrackSizePropTypeUtil: () => gridTrackSizePropTypeUtil, | |
| 2580 | + htmlPropTypeUtil: () => htmlPropTypeUtil, | |
| 2581 | + htmlV2PropTypeUtil: () => htmlV2PropTypeUtil, | |
| 2582 | + htmlV3PropTypeUtil: () => htmlV3PropTypeUtil, | |
| 2583 | + hueRotateFilterPropTypeUtil: () => hueRotateFilterPropTypeUtil, | |
| 2584 | + iconPropTypeUtil: () => iconPropTypeUtil, | |
| 2585 | + imageAttachmentIdPropType: () => imageAttachmentIdPropType, | |
| 2586 | + imagePropTypeUtil: () => imagePropTypeUtil, | |
| 2587 | + imageSrcPropTypeUtil: () => imageSrcPropTypeUtil, | |
| 2588 | + intensityFilterPropTypeUtil: () => intensityFilterPropTypeUtil, | |
| 2589 | + isDependency: () => isDependency, | |
| 2590 | + isDependencyMet: () => isDependencyMet, | |
| 2591 | + isEmpty: () => isEmpty, | |
| 2592 | + isOverridable: () => isOverridable, | |
| 2593 | + isTransformable: () => isTransformable, | |
| 2594 | + keyValuePropTypeUtil: () => keyValuePropTypeUtil, | |
| 2595 | + layoutDirectionPropTypeUtil: () => layoutDirectionPropTypeUtil, | |
| 2596 | + linkPropTypeUtil: () => linkPropTypeUtil, | |
| 2597 | + mergeProps: () => mergeProps, | |
| 2598 | + moveTransformPropTypeUtil: () => moveTransformPropTypeUtil, | |
| 2599 | + numberPropTypeUtil: () => numberPropTypeUtil, | |
| 2600 | + numberRangePropTypeUtil: () => numberRangePropTypeUtil, | |
| 2601 | + parseHtmlChildren: () => parseHtmlChildren, | |
| 2602 | + perspectiveOriginPropTypeUtil: () => perspectiveOriginPropTypeUtil, | |
| 2603 | + positionPropTypeUtil: () => positionPropTypeUtil, | |
| 2604 | + queryFilterArrayPropTypeUtil: () => queryFilterArrayPropTypeUtil, | |
| 2605 | + queryFilterPropTypeUtil: () => queryFilterPropTypeUtil, | |
| 2606 | + queryPropTypeUtil: () => queryPropTypeUtil, | |
| 2607 | + rewrapOverridableValue: () => rewrapOverridableValue, | |
| 2608 | + rotateTransformPropTypeUtil: () => rotateTransformPropTypeUtil, | |
| 2609 | + scaleTransformPropTypeUtil: () => scaleTransformPropTypeUtil, | |
| 2610 | + selectionSizePropTypeUtil: () => selectionSizePropTypeUtil, | |
| 2611 | + shadowPropTypeUtil: () => shadowPropTypeUtil, | |
| 2612 | + sizePropTypeUtil: () => sizePropTypeUtil, | |
| 2613 | + skewTransformPropTypeUtil: () => skewTransformPropTypeUtil, | |
| 2614 | + spanPropTypeUtil: () => spanPropTypeUtil, | |
| 2615 | + stringArrayPropTypeUtil: () => stringArrayPropTypeUtil, | |
| 2616 | + stringPropTypeUtil: () => stringPropTypeUtil, | |
| 2617 | + strokePropTypeUtil: () => strokePropTypeUtil, | |
| 2618 | + svgSrcPropTypeUtil: () => svgSrcPropTypeUtil, | |
| 2619 | + timeRangePropTypeUtil: () => timeRangePropTypeUtil, | |
| 2620 | + timeStringPropTypeUtil: () => timeStringPropTypeUtil, | |
| 2621 | + transformFunctionsPropTypeUtil: () => transformFunctionsPropTypeUtil, | |
| 2622 | + transformOriginPropTypeUtil: () => transformOriginPropTypeUtil, | |
| 2623 | + transformPropTypeUtil: () => transformPropTypeUtil, | |
| 2624 | + urlPropTypeUtil: () => urlPropTypeUtil, | |
| 2625 | + videoAttachmentIdPropType: () => videoAttachmentIdPropType, | |
| 2626 | + videoSrcPropTypeUtil: () => videoSrcPropTypeUtil | |
| 2627 | + }); | |
| 2628 | + var Schema = { | |
| 2629 | + jsonSchemaToPropType, | |
| 2630 | + propTypeToJsonSchema, | |
| 2631 | + adjustLlmPropValueSchema, | |
| 2632 | + isPropKeyConfigurable, | |
| 2633 | + nonConfigurablePropKeys, | |
| 2634 | + configurableKeys, | |
| 2635 | + validatePropValue, | |
| 2636 | + enrichWithIntention, | |
| 2637 | + removeIntention, | |
| 2638 | + setDynamicTagNamesResolver | |
| 2639 | + }; | |
| 2640 | + | |
| 2641 | +//#endregion | |
| 2642 | +//#region \0elementor-package-library-entry | |
| 2643 | + (window.elementorV2 = window.elementorV2 || {}).editorProps = src_exports; | |
| 2644 | + | |
| 2645 | +//#endregion | |
| 2646 | +})(elementorV2.schema); | |
| 2647 | +window.elementorV2.editorProps?.init?.(); | |
| 3 | 2648 | //# sourceMappingURL=editor-props.js.map |